{"version":3,"file":"node_modules-b25321a4.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/regenerator-runtime/runtime.js","../../../node_modules/whatwg-fetch/fetch.js","../../../node_modules/smoothscroll-polyfill/dist/smoothscroll.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/prop-types/lib/ReactPropTypesSecret.js","../../../node_modules/prop-types/factoryWithThrowingShims.js","../../../node_modules/prop-types/index.js","../../../node_modules/react-redux/es/components/Context.js","../../../node_modules/react-redux/es/utils/batch.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/@babel/runtime/helpers/esm/extends.js","../../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../../node_modules/react-is/cjs/react-is.production.min.js","../../../node_modules/react-is/index.js","../../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.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/components/connectAdvanced.js","../../../node_modules/react-redux/es/utils/shallowEqual.js","../../../node_modules/react-redux/es/utils/bindActionCreators.js","../../../node_modules/react-redux/es/connect/wrapMapToProps.js","../../../node_modules/react-redux/es/connect/mapDispatchToProps.js","../../../node_modules/react-redux/es/connect/mapStateToProps.js","../../../node_modules/react-redux/es/connect/mergeProps.js","../../../node_modules/react-redux/es/connect/selectorFactory.js","../../../node_modules/react-redux/es/connect/connect.js","../../../node_modules/react-redux/es/hooks/useReduxContext.js","../../../node_modules/react-redux/es/hooks/useStore.js","../../../node_modules/react-redux/es/hooks/useDispatch.js","../../../node_modules/react-redux/es/hooks/useSelector.js","../../../node_modules/react-redux/es/index.js","../../../node_modules/@babel/runtime/helpers/esm/typeof.js","../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../../../node_modules/@babel/runtime/helpers/esm/objectSpread2.js","../../../node_modules/redux/es/redux.js","../../../node_modules/redux-devtools-extension/utils/assign.js","../../../node_modules/redux-devtools-extension/logOnly.js","../../../node_modules/redux-devtools-extension/logOnlyInProduction.js","../../../node_modules/redux-thunk/es/index.js","../../../node_modules/redux-undo/lib/actions.js","../../../node_modules/redux-undo/lib/helpers.js","../../../node_modules/redux-undo/lib/debug.js","../../../node_modules/redux-undo/lib/reducer.js","../../../node_modules/redux-undo/lib/index.js","../../../node_modules/@insights/insights-data-provider/lib/utilities/MetadataManager.js","../../../node_modules/@insights/insights-data-provider/lib/utilities/SequenceNumberHandler.js","../../../node_modules/@insights/insights-data-provider/lib/enums/TrackingIdEnum.js","../../../node_modules/@insights/insights-data-provider/lib/utilities/IdGenerator.js","../../../node_modules/@insights/insights-data-provider/lib/utilities/SessionManager.js","../../../node_modules/@insights/insights-data-provider/lib/enums/IpexMomentEnum.js","../../../node_modules/@insights/insights-data-provider/lib/utilities/CookieReader.js","../../../node_modules/@insights/insights-data-provider/lib/utilities/EntryPoint.js","../../../node_modules/@insights/insights-data-provider/lib/enums/DesignInteractionEnum.js","../../../node_modules/@insights/insights-data-provider/lib/enums/InsightsEventEnum.js","../../../node_modules/@insights/insights-data-provider/lib/targets/InsightsTarget.js","../../../node_modules/@insights/insights-data-provider/lib/targets/GoogleAnalyticsTarget.js","../../../node_modules/@insights/insights-data-provider/lib/enums/GaEventEnum.js","../../../node_modules/@insights/insights-data-provider/lib/enums/GaCategoryEnum.js","../../../node_modules/@insights/insights-data-provider/lib/enums/DesignSourceEnum.js","../../../node_modules/@insights/insights-data-provider/lib/enums/ArticleActionEnum.js","../../../node_modules/@insights/insights-data-provider/lib/EventSender.js","../../../node_modules/@insights/insights-data-provider/lib/utilities/GAScriptLoader.js","../../../node_modules/@insights/insights-data-provider/lib/enums/PlatformEnum.js","../../../node_modules/@insights/insights-data-provider/lib/ModuleClient.js","../../../node_modules/@insights/insights-data-provider/lib/InsightsApi.js","../../../node_modules/@insights/insights-data-provider/lib/index.js","../../../node_modules/@inter-ikea-kompis/enums/lib/ABTestNameEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/ABTestVariationEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/AccountDataSourceEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/AkamaiImageQualityEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/ApiPlatformEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/AssemblyServicesDataSourceEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/AutoCompleteEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/CookieConsentDataSourceEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/CookieInformationDataSourceEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/DexfNotificationTypeEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/DexfSettingsEnvironmentEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/DexfSettingsFilterSegmentEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/EcommerceCartDataSourceEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/EcommerceShoppingListDataSourceEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/FinancingOptionDataSourceEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/HeadingsEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/IksaShoppingBagTypeEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/ImageSizeTypeEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/ImageTypeNameEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/InvalidProductReasonEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/IowsShoppingBagTypeEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/ItemTypeEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/MvEcomIrwBagTypeEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/MvEcomShoppingBagTypeEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/NotificationDataSourceEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/NotificationLinkTypeEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/ProductComplianceLabelTypeEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/ProductComplianceTechnicalHeadingTypeEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/ProductDataSourceEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/ProductOptionalFieldNameEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/SalesDivisionCodeEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/SalesSystemEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/SalesTypeCodeEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/SaveDataSourceEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/SheetAlignmentEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/StatusIndicatorColorEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/StoreAvailabilityDataSourceEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/StoreAvailabilityProbabilityEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/StoreAvailabilityReasonCodeEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/StoreBuTypeEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/StoreDataSourceEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/TemporaryPricePeriodEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/ThemeBreakpointEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/ThemeBreakpointIndexEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/ThemeFontStyleTypeEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/ThemeMotionDelayEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/ThemeMotionDurationEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/ThemeMotionEaseEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/ThemeMotionIconDurationEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/ThemeSpacingEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/VpcDataSourceEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/WriteDirectionEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/ZipAvailabilityDataSourceEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/ZipAvailabilityProbabilityEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/ZipValidationDataSourceEnum.js","../../../node_modules/@inter-ikea-kompis/enums/lib/index.js","../../../node_modules/@inter-ikea-kompis/services/lib/enums/CacheStoreType.js","../../../node_modules/@inter-ikea-kompis/exceptions/lib/enums/ExceptionTypeEnum.js","../../../node_modules/@inter-ikea-kompis/exceptions/lib/AbstractException.js","../../../node_modules/@inter-ikea-kompis/exceptions/lib/exceptions/ComponentElementException.js","../../../node_modules/@inter-ikea-kompis/exceptions/lib/exceptions/ComponentException.js","../../../node_modules/@inter-ikea-kompis/exceptions/lib/exceptions/ConnectionProblemException.js","../../../node_modules/@inter-ikea-kompis/exceptions/lib/exceptions/Exception.js","../../../node_modules/@inter-ikea-kompis/exceptions/lib/exceptions/InvalidZipCodeException.js","../../../node_modules/@inter-ikea-kompis/exceptions/lib/exceptions/ServerErrorResponseException.js","../../../node_modules/@inter-ikea-kompis/exceptions/lib/exceptions/ServiceException.js","../../../node_modules/@inter-ikea-kompis/exceptions/lib/exceptions/ShoppingCartException.js","../../../node_modules/@inter-ikea-kompis/exceptions/lib/exceptions/UnableToParseServerResponseException.js","../../../node_modules/@inter-ikea-kompis/exceptions/lib/index.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/alternate-language/LocalizedInformationAlternateLanguage.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/animation/EasingAnimation.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/availability/AvailabilityUtility.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/cache/CacheStore.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/cache/GlobalCacheStore.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/color-converter/ColorConverter.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/css-loader/CssLoader.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/date/DateFormatter.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/debounce/DebounceManager.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/encoding/HtmlEncoder.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/energy-class/EnergyClassParser.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/generator/IdGenerator.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/iframe/IframeUtility.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/iframe/IframeVisibleArea.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/iframe/IframeVisibleAreaObserver.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/image/ImageUtility.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/javascript-loader/JavascriptLoader.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/keep-screen-awake/KeepScreenAwakeUtility.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/latch/Latch.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/locale/LocaleUtility.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/measurement/MeasurementUtility.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/price/PriceFormatter.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/price/ProductPriceInformationSummaryTransformer.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/price/PriceUtility.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/price/TotalPriceCalculator.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/product/ProductDescriptionProductMeasureEnum.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/string/StringUtility.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/product/ProductDescriptionUtility.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/product/ProductUtility.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/settings/DexfSettingsUtility.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/shopping-support/ShoppingSupport.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/url-utility/UrlUtility.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/weight/WeightUtility.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/write-direction/SafariWriteDirectionUtility.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/zip-availability/ZipAvailabilityUtility.js","../../../node_modules/@inter-ikea-kompis/utilities/lib/index.js","../../../node_modules/base64-js/index.js","../../../node_modules/ieee754/index.js","../../../node_modules/isarray/index.js","../../../node_modules/buffer/index.js","../../../node_modules/safe-buffer/index.js","../../../node_modules/@frando/randombytes/browser.js","../../../node_modules/@inter-ikea-kompis/services/lib/utilities/ServiceFetch.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/authentication/account-service/enums/AccountServiceEnum.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/authentication/account-service/DexfAccountServiceStorage.js","../../../node_modules/jwt-decode/build/jwt-decode.cjs.js","../../../node_modules/inherits/inherits_browser.js","../../../node_modules/sha.js/hash.js","../../../node_modules/sha.js/sha.js","../../../node_modules/sha.js/sha1.js","../../../node_modules/sha.js/sha256.js","../../../node_modules/sha.js/sha224.js","../../../node_modules/sha.js/sha512.js","../../../node_modules/sha.js/sha384.js","../../../node_modules/sha.js/index.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/authentication/account-service/DexfAccountServiceUtility.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/authentication/account-service/DexfAccountService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/localization/OversattaTransformer.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/localization/OversattaService.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/localization/LocalizationService.js","../../../node_modules/@inter-ikea-kompis/services/lib/utilities/DexfConfiguration.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/account-service/AccountService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/store-availability/DexfWebplannerStoreAvailabilityService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/zip-availability/DexfWebplannerZipAvailabilityService.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/application-availability/ApplicationAvailabilityService.js","../../../node_modules/@inter-ikea-kompis/services/lib/utilities/ItemUtility.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/assembly-services/DexfAssemblyServicesService.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/assembly-services/AssemblyServicesService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/store-availability/DexfStoreAvailabilityService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/zip-availability/DexfZipAvailabilityService.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/checkout-availability/CheckoutAvailabilityService.js","../../../node_modules/@inter-ikea-kompis/services/lib/utilities/IframeManager.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/cookie-consent/OneWebCookieConsentService.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/cookie-consent/CookieConsentService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/cookie-information/OneWebStoreIdCookieInformationService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/cookie-information/OneWebZipCodeCookieInformationService.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/cookie-information/CookieInformationService.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/cookie-information/StoreIdCookieInformationService.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/cookie-information/ZipCodeCookieInformationService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/financing/OneWebFinancingService.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/financing/FinancingService.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/localization/LocalizationServiceKompis1Migration.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/localization/DexfSettingsTransformer.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/localization/DexfSettingsService.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/localization/SettingsService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/localization/TranslationsTransformer.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/localization/InternalTranslationsService.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/localization/TranslationsService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/notification/DexfNotificationService.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/notification/NotificationService.js","../../../node_modules/@inter-ikea-kompis/services/lib/utilities/platform-communication/IrwPlatformCommunication.js","../../../node_modules/@inter-ikea-kompis/services/lib/utilities/platform-communication/RoigPlatformCommunication.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/platform/PlatformService.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/product/KompisDefaultFields.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/product/ProductCache.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/product/DexfWebplannerService.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/product/ProductItemQueue.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/product/ProductService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/save-service/DexfSaveService.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/save-service/SaveService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/authentication/china/ChinaAuthenticationServiceCookieNameEnum.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/authentication/china/ChinaAuthenticationService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/shopping/china/cart/ChinaCartService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/shopping/iksa/IksaShoppingBagErrorCodes.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/shopping/iksa/IksaShoppingBagService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/shopping/ingka/cart/IngkaCartService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/shopping/iows/IowsShoppingBagErrorCodes.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/shopping/iows/IowsShoppingBagService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/shopping/mvecom/MvEcomShoppingBagErrorCodes.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/shopping/mvecom/MvEcomShoppingBagService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/shopping/nif/enums/NifUnitTypeEnum.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/shopping/nif/NifCartService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/authentication/iows/IowsAuthenticationService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/authentication/nif/NifAuthenticationService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/authentication/one-web/OneWebAuthenticationService.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/shopping/AuthenticationQueue.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/shopping/ShoppingCartService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/shopping/china/shopping-list/ChinaShoppingListService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/shopping/ingka/shopping-list/IngkaShoppingListService.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/shopping/ShoppingListService.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/store/StoreCache.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/store/DexfStoreService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/store/IowsStoreTransformer.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/store/IowsStoreService.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/store/StoreService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/vpc/dexf/DexfVpcService.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/vpc/VpcService.js","../../../node_modules/@inter-ikea-kompis/services/lib/services/zip-availability/DexfZipValidationService.js","../../../node_modules/@inter-ikea-kompis/services/lib/facades/zip-validation/ZipValidationService.js","../../../node_modules/@inter-ikea-kompis/services/lib/index.js","../../../node_modules/@inter-ikea-kompis/analytics/lib/enums/NavigationToEnum.js","../../../node_modules/@inter-ikea-kompis/analytics/lib/utilities/ABTestUtility.js","../../../node_modules/@inter-ikea-kompis/analytics/lib/utilities/AnalyticsManager.js","../../../node_modules/@inter-ikea-kompis/analytics/lib/reporters/InsightsReporter.js","../../../node_modules/@inter-ikea-kompis/analytics/lib/utilities/ReporterManager.js","../../../node_modules/@inter-ikea-kompis/analytics/lib/trackers/AbstractAnalyticsTracker.js","../../../node_modules/@inter-ikea-kompis/analytics/lib/index.js","../../../node_modules/@sentry/utils/esm/is.js","../../../node_modules/@sentry/utils/esm/string.js","../../../node_modules/@sentry/utils/esm/aggregate-errors.js","../../../node_modules/@sentry/utils/esm/worldwide.js","../../../node_modules/@sentry/utils/esm/browser.js","../../../node_modules/@sentry/utils/esm/debug-build.js","../../../node_modules/@sentry/utils/esm/logger.js","../../../node_modules/@sentry/utils/esm/dsn.js","../../../node_modules/@sentry/utils/esm/error.js","../../../node_modules/@sentry/utils/esm/object.js","../../../node_modules/@sentry/utils/esm/stacktrace.js","../../../node_modules/@sentry/utils/esm/instrument/_handlers.js","../../../node_modules/@sentry/utils/esm/instrument/console.js","../../../node_modules/@sentry/utils/esm/misc.js","../../../node_modules/@sentry/utils/esm/instrument/dom.js","../../../node_modules/@sentry/utils/esm/supports.js","../../../node_modules/@sentry/utils/esm/instrument/fetch.js","../../../node_modules/@sentry/utils/esm/instrument/globalError.js","../../../node_modules/@sentry/utils/esm/instrument/globalUnhandledRejection.js","../../../node_modules/@sentry/utils/esm/vendor/supportsHistory.js","../../../node_modules/@sentry/utils/esm/instrument/history.js","../../../node_modules/@sentry/utils/esm/instrument/xhr.js","../../../node_modules/@sentry/utils/esm/env.js","../../../node_modules/@sentry/utils/esm/memo.js","../../../node_modules/@sentry/utils/esm/normalize.js","../../../node_modules/@sentry/utils/esm/syncpromise.js","../../../node_modules/@sentry/utils/esm/promisebuffer.js","../../../node_modules/@sentry/utils/esm/url.js","../../../node_modules/@sentry/utils/esm/severity.js","../../../node_modules/@sentry/utils/esm/time.js","../../../node_modules/@sentry/utils/esm/baggage.js","../../../node_modules/@sentry/utils/esm/tracing.js","../../../node_modules/@sentry/utils/esm/envelope.js","../../../node_modules/@sentry/utils/esm/clientreport.js","../../../node_modules/@sentry/utils/esm/ratelimit.js","../../../node_modules/@sentry/core/esm/debug-build.js","../../../node_modules/@sentry/core/esm/constants.js","../../../node_modules/@sentry/core/esm/eventProcessors.js","../../../node_modules/@sentry/core/esm/session.js","../../../node_modules/@sentry/core/esm/utils/spanUtils.js","../../../node_modules/@sentry/core/esm/utils/prepareEvent.js","../../../node_modules/@sentry/core/esm/exports.js","../../../node_modules/@sentry/core/esm/utils/getRootSpan.js","../../../node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js","../../../node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js","../../../node_modules/@sentry/core/esm/scope.js","../../../node_modules/@sentry/core/esm/version.js","../../../node_modules/@sentry/core/esm/hub.js","../../../node_modules/@sentry/core/esm/tracing/utils.js","../../../node_modules/@sentry/core/esm/tracing/errors.js","../../../node_modules/@sentry/core/esm/tracing/spanstatus.js","../../../node_modules/@sentry/core/esm/utils/hasTracingEnabled.js","../../../node_modules/@sentry/core/esm/tracing/trace.js","../../../node_modules/@sentry/core/esm/metrics/metric-summary.js","../../../node_modules/@sentry/core/esm/semanticAttributes.js","../../../node_modules/@sentry/core/esm/tracing/span.js","../../../node_modules/@sentry/core/esm/tracing/transaction.js","../../../node_modules/@sentry/core/esm/tracing/idletransaction.js","../../../node_modules/@sentry/core/esm/tracing/sampling.js","../../../node_modules/@sentry/core/esm/tracing/hubextensions.js","../../../node_modules/@sentry/core/esm/tracing/measurement.js","../../../node_modules/@sentry/core/esm/envelope.js","../../../node_modules/@sentry/core/esm/api.js","../../../node_modules/@sentry/core/esm/integration.js","../../../node_modules/@sentry/core/esm/metrics/utils.js","../../../node_modules/@sentry/core/esm/metrics/envelope.js","../../../node_modules/@sentry/core/esm/baseclient.js","../../../node_modules/@sentry/core/esm/sdk.js","../../../node_modules/@sentry/core/esm/transports/base.js","../../../node_modules/@sentry/core/esm/span.js","../../../node_modules/@sentry/core/esm/utils/sdkMetadata.js","../../../node_modules/@sentry/core/esm/integrations/inboundfilters.js","../../../node_modules/@sentry/core/esm/integrations/functiontostring.js","../../../node_modules/@sentry-internal/tracing/esm/common/debug-build.js","../../../node_modules/@sentry-internal/tracing/esm/browser/types.js","../../../node_modules/@sentry-internal/tracing/esm/browser/backgroundtab.js","../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/lib/bindReporter.js","../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/lib/generateUniqueID.js","../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/lib/getNavigationEntry.js","../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/lib/getActivationStart.js","../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/lib/initMetric.js","../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/lib/observe.js","../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/lib/onHidden.js","../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/getCLS.js","../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/lib/getVisibilityWatcher.js","../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/getFID.js","../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/lib/polyfills/interactionCountPolyfill.js","../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/getINP.js","../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/getLCP.js","../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/onTTFB.js","../../../node_modules/@sentry-internal/tracing/esm/browser/instrument.js","../../../node_modules/@sentry-internal/tracing/esm/browser/metrics/utils.js","../../../node_modules/@sentry-internal/tracing/esm/browser/metrics/index.js","../../../node_modules/@sentry-internal/tracing/esm/common/fetch.js","../../../node_modules/@sentry-internal/tracing/esm/browser/request.js","../../../node_modules/@sentry-internal/tracing/esm/browser/router.js","../../../node_modules/@sentry-internal/tracing/esm/browser/browsertracing.js","../../../node_modules/@sentry/browser/esm/helpers.js","../../../node_modules/@sentry/browser/esm/debug-build.js","../../../node_modules/@sentry/browser/esm/eventbuilder.js","../../../node_modules/@sentry/browser/esm/userfeedback.js","../../../node_modules/@sentry/browser/esm/client.js","../../../node_modules/@sentry/browser/esm/transports/utils.js","../../../node_modules/@sentry/browser/esm/transports/fetch.js","../../../node_modules/@sentry/browser/esm/transports/xhr.js","../../../node_modules/@sentry/browser/esm/stack-parsers.js","../../../node_modules/@sentry/browser/esm/integrations/breadcrumbs.js","../../../node_modules/@sentry/browser/esm/integrations/dedupe.js","../../../node_modules/@sentry/browser/esm/integrations/globalhandlers.js","../../../node_modules/@sentry/browser/esm/integrations/httpcontext.js","../../../node_modules/@sentry/browser/esm/integrations/linkederrors.js","../../../node_modules/@sentry/browser/esm/integrations/trycatch.js","../../../node_modules/@sentry/browser/esm/sdk.js","../../../node_modules/@sentry/integrations/esm/captureconsole.js","../../../node_modules/@sentry/react/esm/sdk.js","../../../node_modules/@sentry/react/esm/redux.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/util/DateFormatter.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/node_modules/file-saver/FileSaver.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/util/FileUtility.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/util/IframeConfig.json.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/animation/EasingAnimation.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/util/IframeUtility.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/util/JsonUtility.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/util/PriceFormatter.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/util/UrlUtility.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/util/StringUtility.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/util/StyleUtility.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/util/AkamaiImageSizes.json.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/util/ImageUtility.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/constant/ExceptionTypeConstant.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/exception/Exception.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/exception/ComponentException.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/event/EventHandler.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/util/ApplicationResizeObserver.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/util/EventSupport.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/CacheStore.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/exception/UnsupportedException.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/exception/AbstractMethodException.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/settings/AbstractSettingsManager.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/settings/ComponentSettings.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/util/ScrollUtility.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/util/ResourceTagLoader.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/util/Mutex.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/util/Latch.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/index.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/lit-html/lib/directive.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/lit-html/lib/dom.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/lit-html/lib/part.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/lit-html/lib/template.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/lit-html/lib/template-instance.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/lit-html/lib/template-result.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/lit-html/lib/parts.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/lit-html/lib/default-template-processor.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/lit-html/lib/template-factory.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/lit-html/lib/render.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/lit-html/lit-html.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/lit-html/directives/class-map.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/lit-html/directives/repeat.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/lit-html/directives/style-map.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/lit-html/directives/unsafe-html.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/dom-diff/DomDiff.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/kompis-element/decorators/KompisElementCustomElementDecorator.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/utilties/EqualsUtility.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/kompis-element/decorators/KompisElementPropertyDecorator.js","../../../node_modules/@inter-ikea-kompis/themes/lib/themes/skapa/enums/SkapaDelayEnum.js","../../../node_modules/@inter-ikea-kompis/themes/lib/themes/skapa/enums/SkapaDurationEnum.js","../../../node_modules/@inter-ikea-kompis/themes/lib/themes/skapa/enums/SkapaFontSizeEnum.js","../../../node_modules/@inter-ikea-kompis/themes/lib/themes/skapa/enums/SkapaIconDurationEnum.js","../../../node_modules/@inter-ikea-kompis/themes/lib/themes/skapa/SkapaTheme.js","../../../node_modules/@inter-ikea-kompis/themes/lib/utilities/FontFace.js","../../../node_modules/@inter-ikea-kompis/themes/lib/utilities/FontLoader.js","../../../node_modules/@inter-ikea-kompis/themes/lib/utilities/FontStyle.js","../../../node_modules/@inter-ikea-kompis/themes/lib/utilities/ThemeBreakpointObserver.js","../../../node_modules/@inter-ikea-kompis/themes/lib/index.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/kompis-element/KompisElement.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/template/CssTemplateLiteralTag.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/template/HtmlTemplateLiteralTag.js","../../../node_modules/@inter-ikea-kompis/web-component/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-accordion/lib/components/accordion-item-padding/AccordionItemPadding.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisAccordionItemPadding.js","../../../node_modules/@inter-ikea-kompis/component-text/lib/components/text/Text.js","../../../node_modules/@inter-ikea-kompis/component-text/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-icon/lib/utilities/IconSizeCalculator.js","../../../node_modules/@inter-ikea-kompis/component-icon/lib/components/icon/Icon.js","../../../node_modules/@inter-ikea-kompis/component-icon/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-collapsible/lib/components/collapsible/CollapsibleStyle.js","../../../node_modules/@inter-ikea-kompis/component-collapsible/lib/components/collapsible/Collapsible.js","../../../node_modules/@inter-ikea-kompis/component-collapsible/lib/index.js","../../../node_modules/@ingka/webc-tools/src/features/focus-visible-poly.js","../../../node_modules/@ingka/webc-tools/src/features/cachedValue.js","../../../node_modules/@ingka/webc-tools/src/features/delegateFocusPolyfill.js","../../../node_modules/@ingka/webc-tools/src/features/toggleAttributePolyfill.js","../../../node_modules/@ingka/webc-tools/src/features/isRTL.js","../../../node_modules/@ingka/webc-tools/src/features/resizeListener.js","../../../node_modules/@ingka/webc-tools/src/features/rtlObserver.js","../../../node_modules/@ingka/webc-tools/src/features/preDefinitionProperties.js","../../../node_modules/@ingka/webc-tools/src/features/prefixReplacer.js","../../../node_modules/@ingka/webc-tools/src/features/evaluateSlot.js","../../../node_modules/@ingka/webc-tools/src/features/breakpointInfo.js","../../../node_modules/@ingka/webc-tools/index.js","../../../node_modules/@ingka/skapa-webc-element/src/SkapaElement.js","../../../node_modules/@ingka/singleton-store/index.js","../../../node_modules/@ingka/icon-webc/node_modules/@ingka/icon-store/esm/index.js","../../../node_modules/@ingka/icon-webc/src/tools/svg-renderer.js","../../../node_modules/@ingka/icon-webc/src/Icon.js","../../../node_modules/@ingka/icon-webc/index.js","../../../node_modules/@ingka/icon-store/index.js","../../../node_modules/@ingka/icon-store/chevron-down-small.js","../../../node_modules/@inter-ikea-kompis/component-accordion/lib/enums/AccordionItemAriaDisabledEnum.js","../../../node_modules/@inter-ikea-kompis/component-accordion/lib/components/accordion-item/AccordionItemStyle.js","../../../node_modules/@inter-ikea-kompis/component-accordion/lib/components/accordion-item/AccordionItem.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisAccordionItem.js","../../../node_modules/@inter-ikea-kompis/component-accordion/lib/components/accordion/AccordionStyle.js","../../../node_modules/@inter-ikea-kompis/component-accordion/lib/components/accordion/Accordion.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisAccordion.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/AccessibilityIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/AccessibleDisabledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/AddOnIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/AdjustableBackrestIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/AirIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/AllenKeyIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/AluminiumCanIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/EnergyAIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/EnergyApIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/EnergyAppIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/EnergyApppIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/EnergyBIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/EnergyBlankIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/EnergyCIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/EnergyDIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/EnergyEIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/EnergyFIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CheckmarkIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChevronDownSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChevronDownIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MinusSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/AppleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ARIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArchiveBoxIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowClockwiseIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowCloudInIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowCloudOutIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowCounterclockwiseIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowDownIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowDownBackwardsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowDownForwardsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowDownfromBaseIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowDowntoBaseIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowDowntoLineIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowDowntoLineSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowForkRightIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowLeftIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowLeftArrowRightIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowLeftfromBaseIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowLeftRightIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowLefttoBaseIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowLefttoLineIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowLefttoLineSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowLevelDownIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowLevelUpIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowonPathIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowPairSquarepathIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowRightIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowRightfromBaseIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowRighttoBaseIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowRighttoLineIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowRighttoLineSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowsInwardIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowUTurnBackwardsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowUTurnForwardsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowUpIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowUpArrowDownIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowUpBackwardsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowUpDownIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowUpForwardsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowUpfromBaseIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowUptoBaseIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowUptoLineIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ArrowUptoLineSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ATMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BabyStrollerIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BackwardEndIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BandaidIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BarChartDowntrendIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BarChartUptrendIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/Battery0Icon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/Battery100Icon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/Battery25Icon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/Battery50Icon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/Battery75Icon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BatteryChargingIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BeamAngleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BedIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BedsideTableIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BeefIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BellIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BikeIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BlockOutIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BluetoothIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BoardIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BoldIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BookcaseIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BookmarkIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BookmarkFilledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BoxIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BoxCancelIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BoxExchangeIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BoxExpressIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BoxRepeatIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BoxReturnIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BriefcaseIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BriefcaseCheckmarkIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BriefcaseSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BrightnessDownIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BrightnessUpIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BucketIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BulldozerIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/BulletIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CalculatorFinancialIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CalendarIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/Calendar90Icon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CameraIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CandleLight1800Icon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CandleLight1800DMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CanvasIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CarIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CarElectricIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CarFittingBoldIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CargoBikeIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CartonIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CeilingHeightReducerIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CertificateIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChairIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChargingIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChatIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CheckmarkBoxIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CheckmarkCircleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CheckmarkSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChestofDrawersIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChevronDoubleDownIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChevronDoubleDownSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChevronDoubleLeftIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChevronDoubleLeftSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChevronDoubleRightIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChevronDoubleRightSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChevronDoubleUpIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChevronDoubleUpSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChevronLeftIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChevronLeftSlashChevronRightIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChevronLeftSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChevronRightIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChevronRightSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChevronUpIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChevronUpChevronDownIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChevronUpChevronDownSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChevronUpSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ChickenIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CircleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CircleFilledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CircleFourSegmentsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CircleFourSegmentsFilledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CircleHalfIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CirclepathThreeTrianglesIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CirclepathTwoTrianglesIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CircleThreeSegmentsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CircleThreeSegmentsFilledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CleanSparklesIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ClickandCollectIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ClickandCollectStrikethroughIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ClipboardIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ClipboardCheckmarkIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ClipboardStrikethroughIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ClockIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ClosedCaptionsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CoatHangerIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CoffeeTableIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CoffeeWasteIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ColdDrinkIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ColdDrinkContentsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ColourfanIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ColourSpectrumIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ColourSpectrumDMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CommandLineIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ContactlessPaymentIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ContractIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CoolDaylight5000Icon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CoolDaylight5000DMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CoolDaylight5200Icon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CoolDaylight5200DMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CoolingIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CoolSky6000Icon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CoolSky6000DMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CoolWhite4000Icon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CoolWhite4000DMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CopyIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CouponIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CoverIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CreateNewIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CreditCardIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CropIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CrossIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CrossBoxIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CrossCircleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CrosshairIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CrossSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/Cube3DIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/Cube3DBottomFilledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/Cube3DLeftFilledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/Cube3DRightFilledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/Cube3DTopFilledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CupIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CupFilledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CurtainsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/CutleryIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DarkModeIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DatabaseIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DataChartIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DefineSpaceIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DeliveryTruckIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DeliveryTruckStrikethroughIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DepthIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DimmableIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DirtIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DiscountTagIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DisplayIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DocumentIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DocumentAddIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DocumentAlertIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DocumentCheckmarkIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DocumentFinancialIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DocumentMagnifyingGlassIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DocumentPencilIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DocumentUploadIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DogIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DoorIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DoorLayoutIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DoubleDoorsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DresserIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DressingTableIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DrillIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DuvetDoubleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/DuvetSingleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/EarIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/EarStrikethroughIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/EggIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/EggStrikethroughIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ElectronicCircleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/EllipsesHorizontalIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/EllipsesVerticalIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/EscalatorDownIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/EscalatorUpIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/EscalatorUpDownIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ExpandIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ExtraSoftIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FabricIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FactoryIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FallingboxesIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FamilyGenderMenIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FamilyGenderMixedIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FamilyGenderWomenIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FanIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FastForwardIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FauxLeatherIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FeedbackDissatisfiedIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FeedbackHappyIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FeedbackNeutralIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FeedbackSadIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FeedbackSatisfiedIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FillBucketIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FiltersIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FinancingIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FirstAidRoomCrescentIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FirstAidRoomCrossIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FirstPersonIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FishIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FlagIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FlameIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FlipHorizontalIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FloorLampIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FlowerIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FluorescentLampIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FolderIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FootprintIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ForkliftIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ForkliftLoadedIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ForwardEndIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FrameIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FramewithLegsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FullscreenIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FurnitureSetIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FurnitureTrolleyIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/FurnitureTrolleyLoadedIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/GalleryLayoutAlternativesIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/GarbageTruckIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/GearIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/GiftBagIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/GiftBagActiveIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/GiftBagActiveDMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/GiftBagAddIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/GiftBoxIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/GiftBoxActiveIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/GiftBoxActiveDMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/GiftBoxFilledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/GiftCardIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/GlobeIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/GlobeStrikethroughIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/GroupIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/Guarantee10Icon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/Guarantee15Icon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/Guarantee2Icon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/Guarantee25Icon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/Guarantee3Icon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/Guarantee5Icon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HandIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HandgesturesIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HandleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HandMoveIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HandPointIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HandStrikethroughIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HandTouchIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HandwithBagIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HandwithBoxIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HandwithDiscountIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HandwithDropIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HandwithDropsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HandwithHeartIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HandwithKeyIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HandwithPlateIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HandwithSparklesIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HeadphonesIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HeartIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HeartFilledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HeatPumpIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HeightIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HistoryIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HomeIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HotDogIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HotDrinkIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/HourglassIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/IceCreamIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/IDIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ImageIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ImageStackIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ImageStrikethroughIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/IncorrectIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/InformationIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/InformationCircleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/InformationCircleSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/InstitutionIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/InteriorsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/InverterIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ItalicIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/KickScooterIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/KitchenIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LambIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LaptopIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LaptopCheckmarkIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LaptopMagnifyingGlassIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LaptopPencilIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LayoutIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LayoutAlternativeIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LeafIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LeatherIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LeatherandFauxLeatherIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LiftDownIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LiftFurnitureTrolleyIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LiftShoppingTrolleyIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LiftUpIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LiftUpDownIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LightbulbIncandescentIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LightbulbLEDIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LightbulbLEDAlternativeIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LightbulbwithRaysIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LightFilteringIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LinkIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LinkOutIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LinkStrikethroughIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ListIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LiveVideoIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LocationPinIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LocationPinFilledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LocationPinSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LocationPinSmallFilledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LocationPointerIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LocationPointerFilledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LockIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LockersIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LockOpenIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/LockSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MagnifyingGlassIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MagnifyingGlassListIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MailIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MapIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MattressComfortZonesIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MattressExtraFirmIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MattressFeatherIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MattressFirmIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MattressFoamIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MattressHybridIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MattressLatexIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MattressMaterialGenericIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MattressMaterialNaturalIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MattressMaterialVeganIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MattressMediumFirmIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MattressMemoryFoamIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MattressPlushIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MattressRollPackedIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MattressSilkIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MattressSpringsBonnellIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MattressSpringsMiniIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MattressSpringsPocketIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MattressTopperIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MattressWoolIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MedicIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MedicCrescentIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MembershipCardIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MembershipDigitalCardIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MenuIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MetalSawIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MicrophoneIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MilkBottleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MilkBottleStrikethroughIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MinusIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MirrorIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MissingIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MobileIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MobileHandoverIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MoneyBillsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MoneyCashIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MoneyCoinsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MotionSensorIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/MotorBikeIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/NetworkIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/NoteIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/NoticeIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/NoticeCircleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/NoticeSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/NursingIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/OfficeChairIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/OilContainerIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/OpenDoorIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/OpeningsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/OrderedListIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/OvalIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PaintbrushIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PairingIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PalletLoadedIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PalletMixedIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PalletwithBoxesIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PanIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PanelsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PaperclipIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PaperTowelsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ParasolIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ParkingIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ParkingGarageIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PassIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PauseIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PedestrianIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PedestrianwithWalkingStickIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PencilIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PeopleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PersonIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PersonActiveIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PersonActiveDMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PersonHeightIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PersoninBedIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PersonSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PersonwithBackgroundIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PhoneIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PhonePaymentIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PhoneRotationIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PickingIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PictureFrameIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PictureFramesIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PictureFramewithImageIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PictureinPictureIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PieChartIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PillowIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PillowHighIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PillowLowIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PinIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PlantinPotIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PlasticBagIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PlasticBottleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PlasticBottleCapIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PlayIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PlayAreaIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PlusIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PlusCircleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PlusSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PodcastIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PorkIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PotwithLidIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PowerIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PramIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PriceTagIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PriceTagDigitalIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/PrinterIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/QuestionMarkIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/QuestionMarkCircleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/QuietRoomIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ReceiptIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ReceiptAlertIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RectangleHorizontalIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RectangleHorizontalDoubleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RectangleHorizontalThinIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RectangleHorizontalThinTrippleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RectanglePairUnevenIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RectangleVerticalIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RectangleVerticalDoubleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RectangleVerticalThinIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RecycleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RefillingIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ReplaceMeIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ReplaceMeSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ResizeIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RestroomIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RestroomBabyCareIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RestroomManIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RestroomManandChildIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RestroomWomanIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RestroomWomanandChildIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ReturnsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RewardIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RewindIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RobotArmIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RoomDarkeningIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RoomLayoutIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RoomWithoutFurnitureIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RotateIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RotateDownIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RotateLeftIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RotateRightIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RotateUpIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RugIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/RulerIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ScanBarcodeIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ScanQRCodeIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ScissorsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ScooterIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ScrewIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SeafoodIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SeatHeightIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SeatLumbarSupportIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SeatTensionIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SeatTiltIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SectionsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SecurityCameraIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SelectionAddIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SelectionHiddenIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SewingMachineIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShapeCornerIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShapeFreeIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShapeLIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShapeOrganicIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShapeUIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShareNetworkIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SheerFabricIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShelvesIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShelvingUnitIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShieldCheckmarkIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShoppingBagIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShoppingBagActiveIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShoppingBagActiveDMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShoppingBagAddIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShoppingBagPrideIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShoppingBagPrideActiveIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShoppingBagPrideActiveDMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShoppingBagPrideDMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShoppingBagTrolleyIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShoppingBasketIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShoppingTrolleyIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShoppingTrolleyFilledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShowerIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ShuffleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SinkIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SkipNextIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SkipPreviousIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SleepingPositionBackIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SleepingPositionMixedIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SleepingPositionSideIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SleepingPositionStomachIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SmokingIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SmokingStrikethroughIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SofaIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SofaBedIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SofaStorageIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SolarEnergyIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SolarPanelsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SolarStorageBatteryIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SortAscendingIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SortDescendingIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SoundAbsorptionIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SoundBlockingIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SpeechBubbleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SpeechBubbleActiveIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SpeechBubbleActiveDMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SquareIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SquareCutIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SquareGrid2x2Icon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SquareGrid3x3FilledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SquareSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/StackIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/StackStrikethroughIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/StairsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/StairsDownIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/StairsUpIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/StarIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/StarFilledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/StarFilledSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/StarHalfFilledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/StarHalfFilledRTLIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/StarHalfFilledSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/StarHalfFilledSmallRTLIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/StarSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/StopIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/StopbarsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/StoreIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/StoreStrikethroughIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SubtitlesIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SuitcaseIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/Sunrise3000Icon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/Sunrise3000DMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SurgicalMaskIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/SurgicalMaskonFaceIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/TShirtIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/TableIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/TagIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/TagFilledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/TakeBackIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/TextIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ThemeIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ThermometerIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ThermometerExtraWarmIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ThermometerExtraWarmDMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ThermometerLightIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ThermometerLightDMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ThermometerWarmIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ThermometerWarmDMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ThermoregulationIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ThumbsDownIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ThumbsDownFilledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ThumbsUpIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ThumbsUpFilledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/TinCanIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ToiletIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/TonerCartridgeIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/TouchscreenIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/TrailerIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/TransportBusIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/TransportTaxiIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/TransportTrainIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/TransportTramIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/TransportTrolleybusIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/TrashCanIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/TrolleyIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/UnderscoreIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/UngroupIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/USBPoweredIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/UtilityKnifeIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/VaseIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/VideoIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/VideoCameraIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/VisibilityHideIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/VisibilityShowIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/VoiceIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/VolumeMuteIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/VolumeOffIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/VolumeUpIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WallDividerIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WallRailsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WardrobeIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WarehouseIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WarmGlow2200Icon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WarmGlow2200DMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WarmWhite2500Icon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WarmWhite2500DMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WarmWhite2700Icon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WarmWhite2700DMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WarningTriangleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WarningTriangleColourIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WarningTriangleColourDMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WarningTriangleSmallIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WashableCoverIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WashingMachineIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WaterdropIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WaterproofIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WeightIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WeightsIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WheatIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WheatStrikethroughIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WheelIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WhiteSpectrumIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WhiteSpectrumDMIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WidthIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WifiIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WindFarmIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WindowIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WineBottleIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WineBottleFilledIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WineGlassIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WirelessChargingIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WirelessDimmingIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WoodIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/WrenchIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ZoomInIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/icons/ZoomOutIcon.js","../../../node_modules/@inter-ikea-kompis/icons/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-checkbox/lib/enums/CheckboxAlignButtonEnum.js","../../../node_modules/@inter-ikea-kompis/component-checkbox/lib/enums/CheckboxLayoutEnum.js","../../../node_modules/@inter-ikea-kompis/component-checkbox/lib/components/checkbox/CheckboxStyle.js","../../../node_modules/@inter-ikea-kompis/component-checkbox/lib/components/checkbox/Checkbox.js","../../../node_modules/@inter-ikea-kompis/component-checkbox/lib/components/checkbox-group/CheckboxGroupStyle.js","../../../node_modules/@inter-ikea-kompis/component-checkbox/lib/components/checkbox-group/CheckboxGroup.js","../../../node_modules/@inter-ikea-kompis/component-checkbox/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-radio-button/lib/enums/RadioLayoutEnum.js","../../../node_modules/@inter-ikea-kompis/component-radio-button/lib/components/radio-button/RadioButtonStyle.js","../../../node_modules/@inter-ikea-kompis/component-radio-button/lib/components/radio-button/RadioButton.js","../../../node_modules/@inter-ikea-kompis/component-radio-button/lib/components/radio-group/RadioGroupStyle.js","../../../node_modules/@inter-ikea-kompis/component-radio-button/lib/components/radio-group/RadioGroup.js","../../../node_modules/@inter-ikea-kompis/component-radio-button/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-switch/lib/enums/SwitchLayoutTypeEnum.js","../../../node_modules/@inter-ikea-kompis/component-switch/lib/components/switch/SwitchStyle.js","../../../node_modules/@inter-ikea-kompis/component-switch/lib/components/switch/Switch.js","../../../node_modules/@inter-ikea-kompis/component-switch/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-action-list/lib/enums/ActionListBorderEnum.js","../../../node_modules/@inter-ikea-kompis/component-action-list/lib/enums/ActionListControlEnum.js","../../../node_modules/@inter-ikea-kompis/component-action-list/lib/components/action-list-item/ActionListItemStyle.js","../../../node_modules/@inter-ikea-kompis/component-action-list/lib/components/action-list-item/ActionListItem.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisActionListItem.js","../../../node_modules/@inter-ikea-kompis/component-action-list/lib/components/action-list/ActionList.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisActionList.js","../../../node_modules/@ingka/common-styles-webc/src/utils/feature-configurator.js","../../../node_modules/@ingka/common-styles-webc/src/Divider.js","../../../node_modules/@ingka/common-styles-webc/src/FocusRing.js","../../../node_modules/@ingka/common-styles-webc/src/Hyperlink.js","../../../node_modules/@ingka/common-styles-webc/src/List.js","../../../node_modules/@ingka/common-styles-webc/src/Table.js","../../../node_modules/@ingka/common-styles-webc/src/Text.js","../../../node_modules/@ingka/common-styles-webc/src/TypographicBaseStyles.js","../../../node_modules/@ingka/button-webc/node_modules/@ingka/icon-store/esm/index.js","../../../node_modules/@ingka/button-webc/node_modules/@ingka/icon-store/esm/warning-triangle.js","../../../node_modules/@ingka/button-webc/src/common/DangerIcon.js","../../../node_modules/@ingka/loading-webc/src/Loading.js","../../../node_modules/@ingka/loading-webc/src/LoadingBall.js","../../../node_modules/@ingka/loading-webc/src/LoadingLinear.js","../../../node_modules/@ingka/loading-webc/index.js","../../../node_modules/@ingka/button-webc/src/common/LoadingBall.js","../../../node_modules/@ingka/button-webc/src/common/ButtonAbstract.js","../../../node_modules/@ingka/button-webc/src/Button.js","../../../node_modules/@ingka/button-webc/src/Expanding.js","../../../node_modules/@ingka/button-webc/src/IconButton.js","../../../node_modules/@ingka/button-webc/index.js","../../../node_modules/@ingka/icon-store/checkmark.js","../../../node_modules/@ingka/icon-store/heart.js","../../../node_modules/@ingka/icon-store/warning-triangle.js","../../../node_modules/@inter-ikea-kompis/component-add-to-list/lib/enums/AddToListLayoutEnum.js","../../../node_modules/@inter-ikea-kompis/component-add-to-list/lib/enums/AddToListStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-add-to-list/lib/trackers/AddToListTracker.js","../../../node_modules/@inter-ikea-kompis/component-add-to-list/lib/components/add-to-list/AddToListStyle.js","../../../node_modules/@inter-ikea-kompis/component-add-to-list/lib/components/add-to-list/AddToList.js","../../../node_modules/@inter-ikea-kompis/component-add-to-list/lib/utilities/AddToListToastMessage.js","../../../node_modules/@inter-ikea-kompis/component-add-to-list/lib/index.js","../../../node_modules/@ingka/inline-message-webc/src/InlineMessage.js","../../../node_modules/@ingka/inline-message-webc/index.js","../../../node_modules/@ingka/modal-webc/src/utils/scroll-lock.js","../../../node_modules/@ingka/focus-lock-shared/esm/utils/focus-lock-event.js","../../../node_modules/@ingka/focus-lock-shared/esm/utils/helpers.js","../../../node_modules/@ingka/focus-lock-shared/esm/utils/focus-catcher.js","../../../node_modules/@ingka/focus-lock-shared/esm/index.js","../../../node_modules/@ingka/modal-webc/src/ModalAbstract.js","../../../node_modules/@ingka/modal-webc/src/Sheet.js","../../../node_modules/@ingka/modal-webc/src/Prompt.js","../../../node_modules/@ingka/modal-webc/node_modules/@ingka/icon-store/esm/index.js","../../../node_modules/@ingka/modal-webc/node_modules/@ingka/icon-store/esm/cross.js","../../../node_modules/@ingka/modal-webc/node_modules/@ingka/icon-store/esm/arrow-left.js","../../../node_modules/@ingka/modal-webc/src/ModalHeader.js","../../../node_modules/@ingka/modal-webc/src/ModalFooter.js","../../../node_modules/@ingka/modal-webc/index.js","../../../node_modules/@ingka/icon-store/shopping-bag-add.js","../../../node_modules/@inter-ikea-kompis/component-focus-outline/lib/enums/FocusOutlinePositionWatcherEnum.js","../../../node_modules/@inter-ikea-kompis/component-focus-outline/lib/enums/FocusOutlineStyleTypeEnum.js","../../../node_modules/@inter-ikea-kompis/component-focus-outline/lib/components/focus-outline/FocusOutlineStyle.js","../../../node_modules/@inter-ikea-kompis/component-focus-outline/lib/components/focus-outline/FocusOutline.js","../../../node_modules/@inter-ikea-kompis/component-focus-outline/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-hyperlink/lib/enums/HyperlinkColorEnum.js","../../../node_modules/@inter-ikea-kompis/component-hyperlink/lib/enums/HyperlinkTargetEnum.js","../../../node_modules/@inter-ikea-kompis/component-hyperlink/lib/components/hyperlink/HyperlinkStyle.js","../../../node_modules/@inter-ikea-kompis/component-hyperlink/lib/components/hyperlink/Hyperlink.js","../../../node_modules/@inter-ikea-kompis/component-hyperlink/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-energy-efficiency-class/lib/components/energy-efficiency-non-rescaled/EnergyEfficiencyNonRescaled.js","../../../node_modules/qrcode/lib/can-promise.js","../../../node_modules/qrcode/lib/core/utils.js","../../../node_modules/qrcode/lib/core/error-correction-level.js","../../../node_modules/qrcode/lib/core/bit-buffer.js","../../../node_modules/qrcode/lib/core/bit-matrix.js","../../../node_modules/qrcode/lib/core/alignment-pattern.js","../../../node_modules/qrcode/lib/core/finder-pattern.js","../../../node_modules/qrcode/lib/core/mask-pattern.js","../../../node_modules/qrcode/lib/core/error-correction-code.js","../../../node_modules/qrcode/lib/core/galois-field.js","../../../node_modules/qrcode/lib/core/polynomial.js","../../../node_modules/qrcode/lib/core/reed-solomon-encoder.js","../../../node_modules/qrcode/lib/core/version-check.js","../../../node_modules/qrcode/lib/core/regex.js","../../../node_modules/qrcode/lib/core/mode.js","../../../node_modules/qrcode/lib/core/version.js","../../../node_modules/qrcode/lib/core/format-info.js","../../../node_modules/qrcode/lib/core/numeric-data.js","../../../node_modules/qrcode/lib/core/alphanumeric-data.js","../../../node_modules/encode-utf8/index.js","../../../node_modules/qrcode/lib/core/byte-data.js","../../../node_modules/qrcode/lib/core/kanji-data.js","../../../node_modules/dijkstrajs/dijkstra.js","../../../node_modules/qrcode/lib/core/segments.js","../../../node_modules/qrcode/lib/core/qrcode.js","../../../node_modules/qrcode/lib/renderer/utils.js","../../../node_modules/qrcode/lib/renderer/canvas.js","../../../node_modules/qrcode/lib/renderer/svg-tag.js","../../../node_modules/qrcode/lib/browser.js","../../../node_modules/@inter-ikea-kompis/component-qr-code/lib/components/qr-code/QrCode.js","../../../node_modules/@inter-ikea-kompis/component-qr-code/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-text-toggle/lib/enums/TextToggleLayoutEnum.js","../../../node_modules/@inter-ikea-kompis/component-text-toggle/lib/enums/TextToggleSizeEnum.js","../../../node_modules/@inter-ikea-kompis/component-text-toggle/lib/components/text-toggle/TextToggleStyle.js","../../../node_modules/@inter-ikea-kompis/component-text-toggle/lib/components/text-toggle/TextToggle.js","../../../node_modules/@inter-ikea-kompis/component-text-toggle/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-energy-efficiency-class/lib/components/eprel-qr/EprelQrStyle.js","../../../node_modules/@inter-ikea-kompis/component-energy-efficiency-class/lib/components/eprel-qr/EprelQr.js","../../../node_modules/@inter-ikea-kompis/component-energy-efficiency-class/lib/components/eprel-qr-toggle/EprelQrToggle.js","../../../node_modules/@inter-ikea-kompis/component-energy-efficiency-class/lib/components/energy-label-card/EnergyLabelCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-energy-efficiency-class/lib/components/energy-label-card/EnergyLabelCard.js","../../../node_modules/@inter-ikea-kompis/component-energy-efficiency-class/lib/enums/EnergyEfficiencyClassMediaEnum.js","../../../node_modules/@inter-ikea-kompis/component-energy-efficiency-class/lib/enums/EnergyEfficiencyClassModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-energy-efficiency-class/lib/components/energy-efficiency-class/EnergyEfficiencyClassStyle.js","../../../node_modules/@inter-ikea-kompis/component-energy-efficiency-class/lib/components/energy-efficiency-class/EnergyEfficiencyClass.js","../../../node_modules/@inter-ikea-kompis/component-energy-efficiency-class/lib/components/energy-fiche-card/EnergyFicheCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-energy-efficiency-class/lib/components/energy-fiche-card/EnergyFicheCard.js","../../../node_modules/@inter-ikea-kompis/component-energy-efficiency-class/lib/enums/EprelLinkModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-energy-efficiency-class/lib/components/eprel-link/EprelLink.js","../../../node_modules/@inter-ikea-kompis/component-energy-efficiency-class/lib/enums/ChileSecLinkModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-energy-efficiency-class/lib/components/sec-link/SecLink.js","../../../node_modules/@inter-ikea-kompis/component-energy-efficiency-class/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-water-efficiency-class/lib/components/water-label-card/WaterLabelCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-water-efficiency-class/lib/components/water-label-card/WaterLabelCard.js","../../../node_modules/@inter-ikea-kompis/component-water-efficiency-class/lib/enums/WaterEfficiencyClassMediaEnum.js","../../../node_modules/@inter-ikea-kompis/component-water-efficiency-class/lib/enums/WaterEfficiencyClassModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-water-efficiency-class/lib/components/water-efficiency-class/WaterEfficiencyClassStyle.js","../../../node_modules/@inter-ikea-kompis/component-water-efficiency-class/lib/components/water-efficiency-class/WaterEfficiencyClass.js","../../../node_modules/@inter-ikea-kompis/component-water-efficiency-class/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-price-formatter/lib/enums/VerticalAlignmentEnum.js","../../../node_modules/@inter-ikea-kompis/component-price-formatter/lib/components/price-formatter/PriceFormatterStyle.js","../../../node_modules/@inter-ikea-kompis/component-price-formatter/lib/components/price-formatter/PriceFormatter.js","../../../node_modules/@inter-ikea-kompis/component-price-formatter/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-eco-fee/lib/components/eco-fee-card/EcoFeeCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-eco-fee/lib/components/eco-fee-card/EcoFeeCard.js","../../../node_modules/@inter-ikea-kompis/component-eco-fee/lib/enums/EcoFeeModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-eco-fee/lib/components/eco-fee/EcoFeeStyle.js","../../../node_modules/@inter-ikea-kompis/component-eco-fee/lib/components/eco-fee/EcoFee.js","../../../node_modules/@inter-ikea-kompis/component-eco-fee/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-repairability-index/lib/utilities/RepairabilityIndexUtility.js","../../../node_modules/@inter-ikea-kompis/component-repairability-index/lib/components/repairability-index-card/RepairabilityIndexCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-repairability-index/lib/components/repairability-index-card/RepairabilityIndexCard.js","../../../node_modules/@inter-ikea-kompis/component-repairability-index/lib/enums/RepairabilityIndexModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-repairability-index/lib/components/repairability-index/RepairabilityIndexStyle.js","../../../node_modules/@inter-ikea-kompis/component-repairability-index/lib/components/repairability-index/RepairabilityIndex.js","../../../node_modules/@inter-ikea-kompis/component-repairability-index/lib/index.js","../../../node_modules/@ingka/commercial-message-webc/src/CommercialMessage.js","../../../node_modules/@ingka/commercial-message-webc/index.js","../../../node_modules/@inter-ikea-kompis/component-price-module/lib/enums/PriceModuleLayoutTypeEnum.js","../../../node_modules/@inter-ikea-kompis/component-price-module/lib/enums/PriceModuleModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-price-module/lib/enums/PriceModuleProductLinkEnum.js","../../../node_modules/@inter-ikea-kompis/component-price-module/lib/utilities/PriceModuleUtility.js","../../../node_modules/@inter-ikea-kompis/component-price-module/lib/components/price-module/PriceModuleStyle.js","../../../node_modules/@inter-ikea-kompis/component-price-module/lib/components/price-module/PriceModule.js","../../../node_modules/@inter-ikea-kompis/component-price-module/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-quantity/lib/components/quantity/QuantityStyle.js","../../../node_modules/@inter-ikea-kompis/component-quantity/lib/components/quantity/Quantity.js","../../../node_modules/@inter-ikea-kompis/component-quantity/lib/index.js","../../../node_modules/@ingka/skeleton-webc/src/Skeleton.js","../../../node_modules/@ingka/skeleton-webc/index.js","../../../node_modules/@inter-ikea-kompis/component-image/lib/enums/ImageAspectRatioEnum.js","../../../node_modules/@inter-ikea-kompis/component-image/lib/components/image/ImageStyle.js","../../../node_modules/@inter-ikea-kompis/component-image/lib/components/image/Image.js","../../../node_modules/@inter-ikea-kompis/component-image/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-do-not-diy/lib/components/do-not-diy/DoNotDiyStyle.js","../../../node_modules/@inter-ikea-kompis/component-do-not-diy/lib/components/do-not-diy/DoNotDiy.js","../../../node_modules/@inter-ikea-kompis/component-do-not-diy/lib/index.js","../../../node_modules/@ingka/status-webc/src/elements/icons.js","../../../node_modules/@ingka/status-webc/src/Status.js","../../../node_modules/@ingka/status-webc/index.js","../../../node_modules/@ingka/fieldset-webc/src/Fieldset.js","../../../node_modules/@ingka/fieldset-webc/index.js","../../../node_modules/@ingka/checkbox-webc/src/CheckboxGroup.js","../../../node_modules/@ingka/checkbox-webc/index.js","../../../node_modules/@ingka/product-identifier-webc/src/ProductIdentifier.js","../../../node_modules/@ingka/product-identifier-webc/index.js","../../../node_modules/@ingka/icon-store/trash-can.js","../../../node_modules/@ingka/icon-store/plus-small.js","../../../node_modules/@inter-ikea-kompis/component-product-row/lib/utilities/ProductRowUtility.js","../../../node_modules/@inter-ikea-kompis/component-product-row/lib/components/compact-product-row/CompactProductRowStyle.js","../../../node_modules/@inter-ikea-kompis/component-product-row/lib/components/compact-product-row/CompactProductRow.js","../../../node_modules/@inter-ikea-kompis/component-product-row/lib/enums/ProductRowLayoutEnum.js","../../../node_modules/@inter-ikea-kompis/component-product-row/lib/enums/ProductRowOptionalStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-product-row/lib/enums/ProductRowProductLinkEnum.js","../../../node_modules/@inter-ikea-kompis/component-product-row/lib/enums/ProductRowProductMeasureEnum.js","../../../node_modules/@inter-ikea-kompis/component-product-row/lib/components/product-row/ProductRowStyle.js","../../../node_modules/@inter-ikea-kompis/component-product-row/lib/components/product-row/ProductRow.js","../../../node_modules/@inter-ikea-kompis/component-product-row/lib/enums/ProductRowModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-product-row/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-accordion/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-add-to-bag/lib/components/unavailable-products-card/UnavailableProductsCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-add-to-bag/lib/components/unavailable-products-card/UnavailableProductsCard.js","../../../node_modules/@inter-ikea-kompis/component-add-to-bag/lib/enums/AddToBagLayoutEnum.js","../../../node_modules/@inter-ikea-kompis/component-add-to-bag/lib/enums/AddToBagModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-add-to-bag/lib/enums/AddToBagStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-add-to-bag/lib/enums/AddToListLayoutEnum.js","../../../node_modules/@inter-ikea-kompis/component-add-to-bag/lib/enums/UnavailableOnlineBehaviourEnum.js","../../../node_modules/@inter-ikea-kompis/component-add-to-bag/lib/trackers/AddToBagTracker.js","../../../node_modules/@inter-ikea-kompis/component-add-to-bag/lib/components/add-to-bag/AddToBagStyle.js","../../../node_modules/@inter-ikea-kompis/component-add-to-bag/lib/components/add-to-bag/AddToBag.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisAddToBag.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisUnavailableProductsCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisAddToList.js","../../../node_modules/@inter-ikea-kompis/component-article-number/lib/components/article-number/ArticleNumber.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisArticleNumber.js","../../../node_modules/@inter-ikea-kompis/component-assembly-services/lib/components/assembly-services-status-button/AssemblyServicesStatusButtonStyle.js","../../../node_modules/@inter-ikea-kompis/component-assembly-services/lib/components/assembly-services-status-button/AssemblyServicesStatusButton.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisAssemblyServicesStatusButton.js","../../../node_modules/@inter-ikea-kompis/keyboard-manager/lib/enums/InputModeEnum.js","../../../node_modules/@inter-ikea-kompis/keyboard-manager/lib/enums/KeyboardTypeEnum.js","../../../node_modules/@inter-ikea-kompis/keyboard-manager/lib/KeyboardManager.js","../../../node_modules/@inter-ikea-kompis/keyboard-manager/lib/index.js","../../../node_modules/@ingka/helper-text-webc/node_modules/@ingka/icon-store/esm/index.js","../../../node_modules/@ingka/helper-text-webc/node_modules/@ingka/icon-store/esm/warning-triangle-orange-small.js","../../../node_modules/@ingka/helper-text-webc/node_modules/@ingka/icon-store/esm/checkmark-green-small.js","../../../node_modules/@ingka/helper-text-webc/node_modules/@ingka/icon-store/esm/notice-red-small.js","../../../node_modules/@ingka/helper-text-webc/src/HelperText.js","../../../node_modules/@ingka/helper-text-webc/src/CharacterCount.js","../../../node_modules/@ingka/helper-text-webc/index.js","../../../node_modules/@ingka/input-field-webc/src/InputField.js","../../../node_modules/@ingka/input-field-webc/index.js","../../../node_modules/@inter-ikea-kompis/component-zip-in/lib/enums/ZipInCardStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-zip-in/lib/components/zip-in-card/ZipInCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-zip-in/lib/components/zip-in-card/ZipInCard.js","../../../node_modules/@inter-ikea-kompis/component-zip-in/lib/enums/ZipInActionEnum.js","../../../node_modules/@inter-ikea-kompis/component-zip-in/lib/enums/ZipInModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-zip-in/lib/trackers/ZipInTracker.js","../../../node_modules/@inter-ikea-kompis/component-zip-in/lib/components/zip-in/ZipIn.js","../../../node_modules/@inter-ikea-kompis/component-zip-in/lib/enums/ZipInButtonStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-zip-in/lib/utilities/ZipInToastMessage.js","../../../node_modules/@inter-ikea-kompis/component-zip-in/lib/index.js","../../../node_modules/@ingka/icon-store/drill.js","../../../node_modules/@inter-ikea-kompis/component-assembly-services/lib/trackers/AssemblyServicesTracker.js","../../../node_modules/@inter-ikea-kompis/component-assembly-services/lib/components/assembly-services/AssemblyServicesStyle.js","../../../node_modules/@inter-ikea-kompis/component-assembly-services/lib/components/assembly-services/AssemblyServices.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisAssemblyServices.js","../../../node_modules/@ingka/icon-store/laptop-checkmark.js","../../../node_modules/@ingka/icon-store/speech-bubble.js","../../../node_modules/@inter-ikea-kompis/component-assistance-card/lib/components/assistance-card/AssistanceCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-assistance-card/lib/components/assistance-card/AssistanceCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisAssistanceCard.js","../../../node_modules/@ingka/icon-store/cross-small.js","../../../node_modules/@inter-ikea-kompis/component-banner/lib/enums/BannerLayoutEnum.js","../../../node_modules/@inter-ikea-kompis/component-banner/lib/components/banner/BannerStyle.js","../../../node_modules/@inter-ikea-kompis/component-banner/lib/components/banner/Banner.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisBanner.js","../../../node_modules/@inter-ikea-kompis/component-loading-indicator/lib/enums/LoadingIndicatorColorEnum.js","../../../node_modules/@inter-ikea-kompis/component-loading-indicator/lib/enums/LoadingIndicatorSizeEnum.js","../../../node_modules/@inter-ikea-kompis/component-loading-indicator/lib/components/loading-indicator/LoadingIndicatorStyle.js","../../../node_modules/@inter-ikea-kompis/component-loading-indicator/lib/components/loading-indicator/LoadingIndicator.js","../../../node_modules/@inter-ikea-kompis/component-loading-indicator/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-button/lib/enums/ButtonAlignEnum.js","../../../node_modules/@inter-ikea-kompis/component-button/lib/enums/ButtonSizeEnum.js","../../../node_modules/@inter-ikea-kompis/component-button/lib/enums/ButtonTypeEnum.js","../../../node_modules/@inter-ikea-kompis/component-button/lib/enums/ButtonOverlayColorEnum.js","../../../node_modules/@inter-ikea-kompis/component-button/lib/components/button/ButtonStyle.js","../../../node_modules/@inter-ikea-kompis/component-button/lib/components/button/Button.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisButton.js","../../../node_modules/@ingka/icon-store/chevron-left-small.js","../../../node_modules/@ingka/icon-store/chevron-right-small.js","../../../node_modules/@inter-ikea-kompis/component-carousel/lib/enums/CarouselLayoutEnum.js","../../../node_modules/@inter-ikea-kompis/component-carousel/lib/components/carousel-controls/CarouselControls.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisCarouselControls.js","../../../node_modules/@inter-ikea-kompis/component-carousel/lib/components/carousel-item/CarouselItem.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisCarouselItem.js","../../../node_modules/@inter-ikea-kompis/component-carousel/lib/components/carousel/CarouselStyle.js","../../../node_modules/@inter-ikea-kompis/component-carousel/lib/components/carousel/Carousel.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisCarousel.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisCheckboxGroup.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisCheckbox.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisCollapsible.js","../../../node_modules/@inter-ikea-kompis/component-popover/lib/enums/PopoverAlignmentEnum.js","../../../node_modules/@inter-ikea-kompis/component-popover/lib/enums/PopoverDirectionEnum.js","../../../node_modules/@inter-ikea-kompis/component-popover/lib/components/popover-positioner/PopoverPositionerStyle.js","../../../node_modules/@inter-ikea-kompis/component-popover/lib/components/popover-positioner/PopoverPositioner.js","../../../node_modules/@inter-ikea-kompis/component-popover/lib/components/popover/Popover.js","../../../node_modules/@inter-ikea-kompis/component-popover/lib/components/popover-padding/PopoverPadding.js","../../../node_modules/@inter-ikea-kompis/component-popover/lib/components/popover-position/PopoverPosition.js","../../../node_modules/@inter-ikea-kompis/component-popover/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-tooltip/lib/components/tooltip/Tooltip.js","../../../node_modules/@inter-ikea-kompis/component-tooltip/lib/index.js","../../../node_modules/@ingka/tooltip-webc/node_modules/@ingka/icon-store/esm/index.js","../../../node_modules/@ingka/tooltip-webc/node_modules/@ingka/icon-store/esm/question-mark.js","../../../node_modules/@ingka/tooltip-shared/esm/index.js","../../../node_modules/@ingka/tooltip-webc/src/tools/escapeListener.js","../../../node_modules/@ingka/tooltip-webc/src/Tooltip.js","../../../node_modules/@ingka/tooltip-webc/index.js","../../../node_modules/@ingka/icon-store/copy.js","../../../node_modules/@inter-ikea-kompis/component-copy-design-code/lib/enums/CopyDesignCodeStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-copy-design-code/lib/components/copy-design-code/CopyDesignCodeStyle.js","../../../node_modules/@inter-ikea-kompis/component-copy-design-code/lib/components/copy-design-code/CopyDesignCode.js","../../../node_modules/@inter-ikea-kompis/component-copy-design-code/lib/utilities/CopyDesignCodeToastMessage.js","../../../node_modules/@inter-ikea-kompis/component-copy-design-code/lib/index.js","../../../node_modules/@ingka/card-webc/node_modules/@ingka/icon-store/esm/index.js","../../../node_modules/@ingka/card-webc/node_modules/@ingka/icon-store/esm/arrow-right.js","../../../node_modules/@ingka/aspect-ratio-box-webc/src/AspectRatioBox.js","../../../node_modules/@ingka/aspect-ratio-box-webc/index.js","../../../node_modules/@ingka/image-webc/node_modules/@ingka/icon-store/esm/index.js","../../../node_modules/@ingka/image-webc/node_modules/@ingka/icon-store/esm/image-strikethrough.js","../../../node_modules/@ingka/image-webc/node_modules/@ingka/icon-store/esm/image.js","../../../node_modules/@ingka/image-webc/src/Image.js","../../../node_modules/@ingka/image-webc/index.js","../../../node_modules/@ingka/card-webc/src/Card.js","../../../node_modules/@ingka/card-webc/index.js","../../../node_modules/@ingka/icon-store/incorrect.js","../../../node_modules/@ingka/icon-store/information-circle.js","../../../node_modules/@ingka/icon-store/checkmark-circle.js","../../../node_modules/@inter-ikea-kompis/component-configuration-summary/lib/enums/ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-configuration-summary/lib/enums/ConfigurationSummaryConfirmationCardStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-configuration-summary/lib/enums/ConfigurationSummaryConfirmationCardTypeEnum.js","../../../node_modules/@inter-ikea-kompis/component-configuration-summary/lib/enums/ConfirmationSummaryCopyDesignCodeStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-configuration-summary/lib/trackers/ConfigurationSummaryConfirmationCardTracker.js","../../../node_modules/@inter-ikea-kompis/component-configuration-summary/lib/components/configuration-summary-confirmation-card/ConfigurationSummaryConfirmationCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-configuration-summary/lib/components/configuration-summary-confirmation-card/ConfigurationSummaryConfirmationCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisConfigurationSummaryConfirmationCard.js","../../../node_modules/@inter-ikea-kompis/component-input/lib/enums/InputLayoutEnum.js","../../../node_modules/@inter-ikea-kompis/component-input/lib/enums/InputTypeEnum.js","../../../node_modules/@inter-ikea-kompis/component-input/lib/components/input/InputStyle.js","../../../node_modules/@inter-ikea-kompis/component-input/lib/components/input/Input.js","../../../node_modules/@inter-ikea-kompis/component-input/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-send-by-email/lib/enums/SendByEmailStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-send-by-email/lib/components/send-by-email/SendByEmailStyle.js","../../../node_modules/@inter-ikea-kompis/component-send-by-email/lib/components/send-by-email/SendByEmail.js","../../../node_modules/@inter-ikea-kompis/component-send-by-email/lib/index.js","../../../node_modules/libphonenumber-js/build/constants.js","../../../node_modules/libphonenumber-js/build/ParseError.js","../../../node_modules/libphonenumber-js/build/tools/semver-compare.js","../../../node_modules/libphonenumber-js/build/metadata.js","../../../node_modules/libphonenumber-js/build/helpers/extension/createExtensionPattern.js","../../../node_modules/libphonenumber-js/build/helpers/isViablePhoneNumber.js","../../../node_modules/libphonenumber-js/build/helpers/extension/extractExtension.js","../../../node_modules/libphonenumber-js/build/helpers/parseDigits.js","../../../node_modules/libphonenumber-js/build/parseIncompletePhoneNumber.js","../../../node_modules/libphonenumber-js/build/getCountryCallingCode.js","../../../node_modules/libphonenumber-js/build/helpers/mergeArrays.js","../../../node_modules/libphonenumber-js/build/helpers/checkNumberLength.js","../../../node_modules/libphonenumber-js/build/isPossibleNumber_.js","../../../node_modules/libphonenumber-js/build/helpers/RFC3966.js","../../../node_modules/libphonenumber-js/build/helpers/matchesEntirely.js","../../../node_modules/libphonenumber-js/build/helpers/getNumberType.js","../../../node_modules/libphonenumber-js/build/validate_.js","../../../node_modules/libphonenumber-js/build/isValidNumberForRegion_.js","../../../node_modules/libphonenumber-js/build/helpers/applyInternationalSeparatorStyle.js","../../../node_modules/libphonenumber-js/build/helpers/formatNationalNumberUsingFormat.js","../../../node_modules/libphonenumber-js/build/helpers/getIddPrefix.js","../../../node_modules/libphonenumber-js/build/format_.js","../../../node_modules/libphonenumber-js/build/PhoneNumber.js","../../../node_modules/libphonenumber-js/build/helpers/stripIddPrefix.js","../../../node_modules/libphonenumber-js/build/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js","../../../node_modules/libphonenumber-js/build/helpers/extractNationalNumber.js","../../../node_modules/libphonenumber-js/build/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js","../../../node_modules/libphonenumber-js/build/helpers/extractCountryCallingCode.js","../../../node_modules/libphonenumber-js/build/helpers/getCountryByCallingCode.js","../../../node_modules/libphonenumber-js/build/parse_.js","../../../node_modules/libphonenumber-js/build/parsePhoneNumber_.js","../../../node_modules/libphonenumber-js/build/parsePhoneNumber.js","../../../node_modules/libphonenumber-js/build/parsePhoneNumberFromString_.js","../../../node_modules/libphonenumber-js/build/parsePhoneNumberFromString.js","../../../node_modules/libphonenumber-js/build/isValidPhoneNumber.js","../../../node_modules/libphonenumber-js/build/isPossiblePhoneNumber.js","../../../node_modules/libphonenumber-js/build/validatePhoneNumberLength.js","../../../node_modules/libphonenumber-js/build/findNumbers/LRUCache.js","../../../node_modules/libphonenumber-js/build/findNumbers/RegExpCache.js","../../../node_modules/libphonenumber-js/build/findNumbers/util.js","../../../node_modules/libphonenumber-js/build/findNumbers/utf-8.js","../../../node_modules/libphonenumber-js/build/findNumbers/Leniency.js","../../../node_modules/libphonenumber-js/build/findNumbers/parsePreCandidate.js","../../../node_modules/libphonenumber-js/build/findNumbers/isValidPreCandidate.js","../../../node_modules/libphonenumber-js/build/findNumbers/isValidCandidate.js","../../../node_modules/libphonenumber-js/build/PhoneNumberMatcher.js","../../../node_modules/libphonenumber-js/build/findNumbers_.js","../../../node_modules/libphonenumber-js/build/findNumbers.js","../../../node_modules/libphonenumber-js/build/searchNumbers.js","../../../node_modules/libphonenumber-js/build/findPhoneNumbersInText.js","../../../node_modules/libphonenumber-js/build/searchPhoneNumbersInText.js","../../../node_modules/libphonenumber-js/build/AsYouTypeState.js","../../../node_modules/libphonenumber-js/build/AsYouTypeFormatter.util.js","../../../node_modules/libphonenumber-js/build/AsYouTypeFormatter.complete.js","../../../node_modules/libphonenumber-js/build/AsYouTypeFormatter.PatternMatcher.js","../../../node_modules/libphonenumber-js/build/AsYouTypeFormatter.js","../../../node_modules/libphonenumber-js/build/AsYouTypeParser.js","../../../node_modules/libphonenumber-js/build/AsYouType.js","../../../node_modules/libphonenumber-js/build/getCountries.js","../../../node_modules/libphonenumber-js/build/getExampleNumber.js","../../../node_modules/libphonenumber-js/build/formatIncompletePhoneNumber.js","../../../node_modules/libphonenumber-js/core/index.commonjs.js","../../../node_modules/libphonenumber-js/min/index.commonjs.js","../../../node_modules/libphonenumber-js/build/parse.js","../../../node_modules/libphonenumber-js/build/format.js","../../../node_modules/libphonenumber-js/build/getNumberType.js","../../../node_modules/libphonenumber-js/build/isPossibleNumber.js","../../../node_modules/libphonenumber-js/build/validate.js","../../../node_modules/libphonenumber-js/build/isValidNumberForRegion.js","../../../node_modules/libphonenumber-js/build/findPhoneNumbers_.js","../../../node_modules/libphonenumber-js/build/findPhoneNumbers.js","../../../node_modules/libphonenumber-js/index.common.js","../../../node_modules/@inter-ikea-kompis/component-send-by-sms/lib/enums/SendBySmsStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-send-by-sms/lib/components/send-by-sms/SendBySmsStyle.js","../../../node_modules/@inter-ikea-kompis/component-send-by-sms/lib/components/send-by-sms/SendBySms.js","../../../node_modules/@inter-ikea-kompis/component-send-by-sms/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-action-list/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-divider/lib/enums/DividerTypeEnum.js","../../../node_modules/@inter-ikea-kompis/component-divider/lib/components/divider/DividerStyle.js","../../../node_modules/@inter-ikea-kompis/component-divider/lib/components/divider/Divider.js","../../../node_modules/@inter-ikea-kompis/component-divider/lib/index.js","../../../node_modules/@ingka/icon-store/link.js","../../../node_modules/@inter-ikea-kompis/component-share-design-card/lib/enums/ShareDesignCardCopyStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-share-design-card/lib/enums/ShareDesignCardStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-share-design-card/lib/trackers/ShareDesignCardTracker.js","../../../node_modules/@inter-ikea-kompis/component-share-design-card/lib/components/share-design-card/ShareDesignCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-share-design-card/lib/components/share-design-card/ShareDesignCard.js","../../../node_modules/@inter-ikea-kompis/component-share-design-card/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-configuration-summary/lib/enums/ConfigurationSummaryModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-configuration-summary/lib/components/configuration-summary-share-design-sheet/ConfigurationSummaryShareDesignSheet.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisConfigurationSummaryShareDesignSheet.js","../../../node_modules/@inter-ikea-kompis/component-add-to-bag/lib/utilities/AddToBagToastMessage.js","../../../node_modules/@inter-ikea-kompis/component-add-to-bag/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-save-design-to-profile/lib/components/save-design-to-profile-card/SaveDesignToProfileCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-save-design-to-profile/lib/components/save-design-to-profile-card/SaveDesignToProfileCard.js","../../../node_modules/@inter-ikea-kompis/component-save-design-to-profile/lib/enums/SaveDesignToProfileModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-save-design-to-profile/lib/enums/SaveDesignToProfileStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-save-design-to-profile/lib/components/save-design-to-profile/SaveDesignToProfile.js","../../../node_modules/@inter-ikea-kompis/component-save-design-to-profile/lib/utilities/SaveDesignToProfileToastMessage.js","../../../node_modules/@inter-ikea-kompis/component-save-design-to-profile/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-sheet/lib/enums/SheetAnimationNameEnum.js","../../../node_modules/@inter-ikea-kompis/component-sheet/lib/enums/SheetStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-sheet/lib/components/sheet-backdrop/SheetBackdropStyle.js","../../../node_modules/@inter-ikea-kompis/component-sheet/lib/components/sheet-backdrop/SheetBackdrop.js","../../../node_modules/@inter-ikea-kompis/component-sheet/lib/enums/SheetAlignmentEnum.js","../../../node_modules/@inter-ikea-kompis/component-sheet/lib/enums/SheetSizeEnum.js","../../../node_modules/@inter-ikea-kompis/component-sheet/lib/components/sheet/SheetStyle.js","../../../node_modules/@inter-ikea-kompis/component-sheet/lib/components/sheet/Sheet.js","../../../node_modules/@inter-ikea-kompis/component-sheet/lib/components/sheet-body/SheetBody.js","../../../node_modules/@inter-ikea-kompis/component-sheet/lib/components/sheet-body-padding/SheetBodyPadding.js","../../../node_modules/@inter-ikea-kompis/component-sheet/lib/components/sheet-footer/SheetFooterStyle.js","../../../node_modules/@inter-ikea-kompis/component-sheet/lib/components/sheet-footer/SheetFooter.js","../../../node_modules/@inter-ikea-kompis/component-button/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-sheet/lib/components/sheet-footer-buttons/SheetFooterButtonsStyle.js","../../../node_modules/@inter-ikea-kompis/component-sheet/lib/components/sheet-footer-buttons/SheetFooterButtons.js","../../../node_modules/@ingka/icon-store/arrow-left.js","../../../node_modules/@ingka/icon-store/cross.js","../../../node_modules/@inter-ikea-kompis/component-sheet/lib/components/sheet-header/SheetHeaderStyle.js","../../../node_modules/@inter-ikea-kompis/component-sheet/lib/components/sheet-header/SheetHeader.js","../../../node_modules/@inter-ikea-kompis/component-sheet/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-financial-services/lib/components/financial-services-card/FinancialServicesCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-financial-services/lib/components/financial-services-card/FinancialServicesCard.js","../../../node_modules/@inter-ikea-kompis/component-financial-services/lib/components/financial-services-link/FinancialServicesLink.js","../../../node_modules/@inter-ikea-kompis/component-financial-services/lib/components/financial-services-buttons/FinancialServicesButtonsStyle.js","../../../node_modules/@inter-ikea-kompis/component-financial-services/lib/components/financial-services-buttons/FinancialServicesButtons.js","../../../node_modules/@inter-ikea-kompis/component-financial-services/lib/enums/FinancialServicesModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-financial-services/lib/trackers/FinancialServicesTracker.js","../../../node_modules/@inter-ikea-kompis/component-financial-services/lib/components/financial-services/FinancialServicesStyle.js","../../../node_modules/@inter-ikea-kompis/component-financial-services/lib/components/financial-services/FinancialServices.js","../../../node_modules/@inter-ikea-kompis/component-financial-services/lib/index.js","../../../node_modules/@ingka/icon-store/arrow-up-from-base.js","../../../node_modules/@inter-ikea-kompis/component-configuration-summary/lib/enums/ConfirmationSummaryShareDesignStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-configuration-summary/lib/trackers/ConfigurationSummaryTracker.js","../../../node_modules/@inter-ikea-kompis/component-configuration-summary/lib/utilities/ConfigurationSummaryWeightUtility.js","../../../node_modules/@inter-ikea-kompis/component-configuration-summary/lib/components/configuration-summary/ConfigurationSummaryStyle.js","../../../node_modules/@inter-ikea-kompis/component-configuration-summary/lib/components/configuration-summary/ConfigurationSummary.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisConfigurationSummary.js","../../../node_modules/@inter-ikea-kompis/component-content-margins/lib/utilities/StyleUtility.js","../../../node_modules/@inter-ikea-kompis/component-content-margins/lib/components/content-margins/ContentMarginsStyle.js","../../../node_modules/@inter-ikea-kompis/component-content-margins/lib/components/content-margins/ContentMargins.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisContentMargins.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisCopyDesignCode.js","../../../node_modules/@inter-ikea-kompis/component-countdown-banner/lib/components/countdown/CountdownStyle.js","../../../node_modules/@inter-ikea-kompis/component-countdown-banner/lib/components/countdown/Countdown.js","../../../node_modules/@inter-ikea-kompis/component-countdown-banner/lib/enums/CountdownBannerAnimationNameEnum.js","../../../node_modules/@inter-ikea-kompis/component-countdown-banner/lib/components/countdown-banner/CountdownBannerStyle.js","../../../node_modules/@inter-ikea-kompis/component-countdown-banner/lib/components/countdown-banner/CountdownBanner.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisCountdownBanner.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisCountdown.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisDivider.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisDoNotDiy.js","../../../node_modules/@inter-ikea-kompis/component-drag-and-drop/lib/enums/DragAndDropAreaEventEnum.js","../../../node_modules/@inter-ikea-kompis/component-drag-and-drop/lib/components/drag-and-drop-area/DragAndDropArea.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisDragAndDropArea.js","../../../node_modules/@inter-ikea-kompis/component-drag-and-drop/lib/enums/DragAndDropItemEventEnum.js","../../../node_modules/@inter-ikea-kompis/component-drag-and-drop/lib/enums/DragDirectionEnum.js","../../../node_modules/@inter-ikea-kompis/component-drag-and-drop/lib/components/drag-and-drop-item/DragAndDropItemStyle.js","../../../node_modules/@inter-ikea-kompis/component-drag-and-drop/lib/components/drag-and-drop-item/DragAndDropItem.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisDragAndDropItem.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisEcoFeeCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisEcoFee.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisEnergyEfficiencyClass.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisEnergyEfficiencyNonRescaled.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisEnergyFicheCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisEnergyLabelCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisEprelLink.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisEprelQrToggle.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisEprelQr.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSecLink.js","../../../node_modules/@inter-ikea-kompis/component-fake-data/lib/components/fake-data/FakeDataStyle.js","../../../node_modules/@inter-ikea-kompis/component-fake-data/lib/components/fake-data/FakeData.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisFakeData.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisFinancialServicesButtons.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisFinancialServicesCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisFinancialServicesLink.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisFinancialServices.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisFocusOutline.js","../../../node_modules/@inter-ikea-kompis/component-function-icon/lib/enums/FunctionIconEnum.js","../../../node_modules/@inter-ikea-kompis/component-function-icon/lib/components/function-icon/FunctionIconStyle.js","../../../node_modules/@inter-ikea-kompis/component-function-icon/lib/components/function-icon/FunctionIcon.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisFunctionIcon.js","../../../node_modules/@inter-ikea-kompis/component-home-delivery/lib/enums/HomeDeliveryAvailabilityEnum.js","../../../node_modules/@inter-ikea-kompis/component-home-delivery/lib/enums/HomeDeliveryStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-home-delivery/lib/utilities/HomeDeliveryUtility.js","../../../node_modules/@inter-ikea-kompis/component-home-delivery/lib/components/home-delivery-card/HomeDeliveryCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-home-delivery/lib/components/home-delivery-card/HomeDeliveryCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisHomeDeliveryCard.js","../../../node_modules/@ingka/icon-store/delivery-truck.js","../../../node_modules/@inter-ikea-kompis/component-home-delivery/lib/enums/HomeDeliveryLevelEnum.js","../../../node_modules/@inter-ikea-kompis/component-home-delivery/lib/enums/HomeDeliveryLinkStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-home-delivery/lib/enums/HomeDeliveryModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-home-delivery/lib/components/home-delivery-link/HomeDeliveryLinkStyle.js","../../../node_modules/@inter-ikea-kompis/component-home-delivery/lib/components/home-delivery-link/HomeDeliveryLink.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisHomeDeliveryLink.js","../../../node_modules/@inter-ikea-kompis/component-home-delivery/lib/enums/HomeDeliveryStartOverEventEnum.js","../../../node_modules/@inter-ikea-kompis/component-home-delivery/lib/components/home-delivery/HomeDelivery.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisHomeDelivery.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisHyperlink.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisIcon.js","../../../node_modules/@inter-ikea-kompis/component-icon-button/lib/enums/IconButtonSizeEnum.js","../../../node_modules/@inter-ikea-kompis/component-icon-button/lib/enums/IconButtonOverlayColorEnum.js","../../../node_modules/@inter-ikea-kompis/component-icon-button/lib/components/icon-button/IconButtonStyle.js","../../../node_modules/@inter-ikea-kompis/component-icon-button/lib/components/icon-button/IconButton.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisIconButton.js","../../../node_modules/@inter-ikea-kompis/component-icon-pill/lib/components/icon-pill-group/IconPillGroupStyle.js","../../../node_modules/@inter-ikea-kompis/component-icon-pill/lib/components/icon-pill-group/IconPillGroup.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisIconPillGroup.js","../../../node_modules/@inter-ikea-kompis/component-icon-pill/lib/enums/IconPillSizeOptionsEnum.js","../../../node_modules/@inter-ikea-kompis/component-icon-pill/lib/components/icon-pill/IconPillStyle.js","../../../node_modules/@inter-ikea-kompis/component-icon-pill/lib/components/icon-pill/IconPill.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisIconPill.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisImage.js","../../../node_modules/@inter-ikea-kompis/component-inline-message/lib/enums/InlineMessageLayoutEnum.js","../../../node_modules/@inter-ikea-kompis/component-inline-message/lib/enums/InlineMessageTypeEnum.js","../../../node_modules/@inter-ikea-kompis/component-inline-message/lib/components/inline-message/InlineMessageStyle.js","../../../node_modules/@inter-ikea-kompis/component-inline-message/lib/components/inline-message/InlineMessage.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisInlineMessage.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisInput.js","../../../node_modules/@inter-ikea-kompis/component-keyboard/lib/enums/KeyboardKeyCodeEnum.js","../../../node_modules/@inter-ikea-kompis/component-keyboard/lib/components/keyboard-button/KeyboardButtonStyle.js","../../../node_modules/@inter-ikea-kompis/component-keyboard/lib/components/keyboard-button/KeyboardButton.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisKeyboardButton.js","../../../node_modules/@inter-ikea-kompis/component-keyboard/lib/enums/KeyboardLayout.js","../../../node_modules/@inter-ikea-kompis/component-keyboard/lib/enums/KeyboardTransition.js","../../../node_modules/@inter-ikea-kompis/component-keyboard/lib/components/keyboard/KeyboardStyle.js","../../../node_modules/@inter-ikea-kompis/component-keyboard/lib/components/keyboard/Keyboard.js","../../../node_modules/@inter-ikea-kompis/component-keyboard/lib/components/keyboard-injector/KeyboardInjectorStyle.js","../../../node_modules/@inter-ikea-kompis/component-keyboard/lib/components/keyboard-injector/KeyboardInjector.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisKeyboardInjector.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisKeyboard.js","../../../node_modules/@ingka/choice-webc/src/Choice.js","../../../node_modules/@ingka/collapsible-webc/src/Collapsible.js","../../../node_modules/@ingka/collapsible-webc/index.js","../../../node_modules/@ingka/choice-webc/src/ChoiceItem.js","../../../node_modules/@ingka/choice-webc/index.js","../../../node_modules/@inter-ikea-kompis/component-language-selector/lib/components/language-selector-card/LanguageSelectorCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisLanguageSelectorCard.js","../../../node_modules/@ingka/icon-store/globe.js","../../../node_modules/@inter-ikea-kompis/component-language-selector/lib/components/language-selector-link-group/LanguageSelectorLinkGroupStyle.js","../../../node_modules/@inter-ikea-kompis/component-language-selector/lib/components/language-selector-link-group/LanguageSelectorLinkGroup.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisLanguageSelectorLinkGroup.js","../../../node_modules/@inter-ikea-kompis/component-language-selector/lib/enums/LanguageSelectorLayoutEnum.js","../../../node_modules/@inter-ikea-kompis/component-language-selector/lib/enums/LanguageSelectorModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-language-selector/lib/enums/LanguageSelectorSizeEnum.js","../../../node_modules/@inter-ikea-kompis/component-language-selector/lib/components/language-selector/LanguageSelectorStyle.js","../../../node_modules/@inter-ikea-kompis/component-language-selector/lib/components/language-selector/LanguageSelector.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisLanguageSelector.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisLoadingIndicator.js","../../../node_modules/@inter-ikea-kompis/component-loading-skeleton/lib/components/loading-skeleton/LoadingSkeletonStyle.js","../../../node_modules/@inter-ikea-kompis/component-loading-skeleton/lib/components/loading-skeleton/LoadingSkeleton.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisLoadingSkeleton.js","../../../node_modules/@inter-ikea-kompis/component-content-margins/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-main-footer/lib/components/main-footer/MainFooterStyle.js","../../../node_modules/@inter-ikea-kompis/component-main-footer/lib/components/main-footer/MainFooter.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisMainFooter.js","../../../node_modules/@ingka/icon-store/shopping-bag.js","../../../node_modules/@ingka/icon-store/shopping-bag-active.js","../../../node_modules/@inter-ikea-kompis/component-main-header/lib/trackers/MainHeaderTracker.js","../../../node_modules/@inter-ikea-kompis/component-main-header/lib/components/main-header/IkeaLogo.js","../../../node_modules/@inter-ikea-kompis/component-main-header/lib/components/main-header/MainHeaderStyle.js","../../../node_modules/@inter-ikea-kompis/component-main-header/lib/components/main-header/MainHeader.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisMainHeader.js","../../../node_modules/@inter-ikea-kompis/component-carousel/lib/enums/CarouselButtonTypeEnum.js","../../../node_modules/@inter-ikea-kompis/component-carousel/lib/index.js","../../../node_modules/@ingka/carousel-webc/src/features/utils/speed-tracker.js","../../../node_modules/@ingka/carousel-webc/node_modules/@ingka/icon-store/esm/index.js","../../../node_modules/@ingka/carousel-webc/node_modules/@ingka/icon-store/esm/chevron-right.js","../../../node_modules/@ingka/carousel-webc/node_modules/@ingka/icon-store/esm/chevron-left.js","../../../node_modules/@ingka/carousel-webc/node_modules/@ingka/icon-store/esm/chevron-right-small.js","../../../node_modules/@ingka/carousel-webc/node_modules/@ingka/icon-store/esm/chevron-left-small.js","../../../node_modules/@ingka/carousel-webc/src/elements/CarouselControls.js","../../../node_modules/@ingka/carousel-webc/src/elements/Scrollbar.js","../../../node_modules/@ingka/carousel-webc/src/features/utils/smooth-scroll.js","../../../node_modules/@ingka/carousel-webc/src/features/feature-base.js","../../../node_modules/@ingka/carousel-webc/src/features/rtl-handler.js","../../../node_modules/@ingka/carousel-webc/src/features/scroll-handler.js","../../../node_modules/@ingka/carousel-webc/src/features/slide-visibility.js","../../../node_modules/@ingka/carousel-webc/src/features/slide-index.js","../../../node_modules/@ingka/carousel-webc/src/features/paging-controls.js","../../../node_modules/@ingka/carousel-webc/src/features/child-focus-handler.js","../../../node_modules/@ingka/carousel-webc/src/features/touch-mode-detection.js","../../../node_modules/@ingka/carousel-webc/src/features/resize-handler.js","../../../node_modules/@ingka/carousel-webc/src/features/auto-slide-size.js","../../../node_modules/@ingka/carousel-webc/src/CarouselBase.js","../../../node_modules/@ingka/carousel-webc/src/features/slide-show.js","../../../node_modules/@ingka/carousel-webc/src/features/skip-listing.js","../../../node_modules/@ingka/carousel-webc/src/features/scrollbar-handler.js","../../../node_modules/@ingka/carousel-webc/src/Carousel.js","../../../node_modules/@ingka/carousel-webc/src/OverflowCarousel.js","../../../node_modules/@ingka/carousel-webc/index.js","../../../node_modules/@inter-ikea-kompis/component-media-carousel/lib/components/media-carousel/MediaCarouselStyle.js","../../../node_modules/@inter-ikea-kompis/component-media-carousel/lib/components/media-carousel/MediaCarousel.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisMediaCarousel.js","../../../node_modules/@inter-ikea-kompis/component-language-selector/lib/index.js","../../../node_modules/@ingka/icon-store/arrow-left-to-base.js","../../../node_modules/@ingka/icon-store/folder.js","../../../node_modules/@ingka/icon-store/create-new.js","../../../node_modules/@ingka/icon-store/bookmark.js","../../../node_modules/@ingka/icon-store/printer.js","../../../node_modules/@ingka/icon-store/question-mark-circle.js","../../../node_modules/@ingka/icon-store/warehouse.js","../../../node_modules/@inter-ikea-kompis/component-menu/lib/enums/MenuCardBackButtonEnum.js","../../../node_modules/@inter-ikea-kompis/component-menu/lib/enums/MenuCardStepEnum.js","../../../node_modules/@inter-ikea-kompis/component-menu/lib/enums/MenuItemEnum.js","../../../node_modules/@inter-ikea-kompis/component-menu/lib/IkeaLogo.js","../../../node_modules/@inter-ikea-kompis/component-menu/lib/trackers/MenuCardTracker.js","../../../node_modules/@inter-ikea-kompis/component-menu/lib/components/menu-card/MenuCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-menu/lib/components/menu-card/MenuCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisMenuCard.js","../../../node_modules/@ingka/icon-store/menu.js","../../../node_modules/@inter-ikea-kompis/component-menu/lib/trackers/MenuTracker.js","../../../node_modules/@inter-ikea-kompis/component-menu/lib/types/MenuModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-menu/lib/components/menu/MenuStyle.js","../../../node_modules/@inter-ikea-kompis/component-menu/lib/components/menu/Menu.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisMenu.js","../../../node_modules/@inter-ikea-kompis/component-mini-price/lib/enums/MiniPriceAlignmentEnum.js","../../../node_modules/@inter-ikea-kompis/component-mini-price/lib/enums/MiniPriceModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-mini-price/lib/components/mini-price/MiniPriceStyle.js","../../../node_modules/@inter-ikea-kompis/component-mini-price/lib/components/mini-price/MiniPrice.js","../../../node_modules/@inter-ikea-kompis/component-mini-price/lib/index.js","../../../node_modules/@ingka/icon-store/arrow-right.js","../../../node_modules/@inter-ikea-kompis/component-mini-configuration-summary/lib/enums/MiniConfigurationSummaryIconTypeEnum.js","../../../node_modules/@inter-ikea-kompis/component-mini-configuration-summary/lib/components/mini-configuration-summary/MiniConfigurationSummaryStyle.js","../../../node_modules/@inter-ikea-kompis/component-mini-configuration-summary/lib/components/mini-configuration-summary/MiniConfigurationSummary.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisMiniConfigurationSummary.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisMiniPrice.js","../../../node_modules/@inter-ikea-kompis/component-icon-pill/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-mini-survey/lib/enums/MiniSurveyAnswerEnum.js","../../../node_modules/@inter-ikea-kompis/component-mini-survey/lib/enums/MiniSurveyLayoutEnum.js","../../../node_modules/@inter-ikea-kompis/component-mini-survey/lib/enums/MiniSurveyStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-mini-survey/lib/components/mini-survey-card/MiniSurveyCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-mini-survey/lib/components/mini-survey-card/MiniSurveyCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisMiniSurveyCard.js","../../../node_modules/@inter-ikea-kompis/component-mini-survey/lib/enums/MiniSurveyAnimationNameEnum.js","../../../node_modules/@inter-ikea-kompis/component-mini-survey/lib/components/mini-survey/MiniSurveyStyle.js","../../../node_modules/@inter-ikea-kompis/component-mini-survey/lib/components/mini-survey/MiniSurvey.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisMiniSurvey.js","../../../node_modules/@inter-ikea-kompis/component-open-design-code/lib/enums/OpenDesignCodeLengthEnum.js","../../../node_modules/@inter-ikea-kompis/component-open-design-code/lib/enums/OpenDesignCodeStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-open-design-code/lib/components/open-design-code-input/OpenDesignCodeInput.js","../../../node_modules/@inter-ikea-kompis/component-open-design-code/lib/components/open-design-code/OpenDesignCodeStyle.js","../../../node_modules/@inter-ikea-kompis/component-open-design-code/lib/components/open-design-code/OpenDesignCode.js","../../../node_modules/@inter-ikea-kompis/component-open-design-code/lib/index.js","../../../node_modules/@ingka/tabs-webc/src/features/selection-highlight.js","../../../node_modules/@ingka/tabs-webc/src/utils/accessible-tab.js","../../../node_modules/@ingka/tabs-webc/src/features/key-handler.js","../../../node_modules/@ingka/tabs-webc/src/features/tab-decorator.js","../../../node_modules/@ingka/tabs-webc/src/features/selection-event.js","../../../node_modules/@ingka/tabs-webc/src/Tabs.js","../../../node_modules/@ingka/tabs-webc/index.js","../../../node_modules/@inter-ikea-kompis/component-open-design/lib/enums/OpenDesignTabEnum.js","../../../node_modules/@inter-ikea-kompis/component-open-design/lib/components/open-design-card/OpenDesignCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-open-design/lib/components/open-design-card/OpenDesignCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisOpenDesignCard.js","../../../node_modules/@inter-ikea-kompis/component-open-design/lib/enums/OpenDesignModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-open-design/lib/enums/OpenDesignStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-open-design/lib/components/open-design/OpenDesignStyle.js","../../../node_modules/@inter-ikea-kompis/component-open-design/lib/components/open-design/OpenDesign.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisOpenDesign.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisOpenDesignCodeInput.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisOpenDesignCode.js","../../../node_modules/@inter-ikea-kompis/component-pill/lib/enums/PillAlignEnum.js","../../../node_modules/@inter-ikea-kompis/component-pill/lib/enums/PillSizeOptionsEnum.js","../../../node_modules/@inter-ikea-kompis/component-pill/lib/components/pill/PillStyle.js","../../../node_modules/@inter-ikea-kompis/component-pill/lib/components/pill/Pill.js","../../../node_modules/@inter-ikea-kompis/component-pill/lib/components/pill-group-carousel/PillGroupCarouselStyle.js","../../../node_modules/@inter-ikea-kompis/component-pill/lib/components/pill-group-carousel/PillGroupCarousel.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisPillGroupCarousel.js","../../../node_modules/@inter-ikea-kompis/component-pill/lib/components/pill-group/PillGroupStyle.js","../../../node_modules/@inter-ikea-kompis/component-pill/lib/components/pill-group/PillGroup.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisPillGroup.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisPill.js","../../../node_modules/@inter-ikea-kompis/component-mini-configuration-summary/lib/enums/MiniConfigurationSummaryTemporaryPeriod.js","../../../node_modules/@inter-ikea-kompis/component-mini-configuration-summary/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-planning-header/lib/enums/ClickItemEnum.js","../../../node_modules/@inter-ikea-kompis/component-planning-header/lib/trackers/PlanningHeaderTracker.js","../../../node_modules/@inter-ikea-kompis/component-planning-header/lib/components/planning-header/PlanningHeaderStyle.js","../../../node_modules/@inter-ikea-kompis/component-planning-header/lib/components/planning-header/PlanningHeader.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisPlanningHeader.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisPopoverPadding.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisPopoverPosition.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisPopoverPositioner.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisPopover.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisPriceFormatter.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisPriceModule.js","../../../node_modules/@inter-ikea-kompis/component-function-icon/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-home-delivery/lib/index.js","../../../node_modules/@ingka/icon-store/store.js","../../../node_modules/@inter-ikea-kompis/component-store-selector/lib/components/store-selector-card/StoreSelectorCard.js","../../../node_modules/@inter-ikea-kompis/component-store-selector/lib/enums/StoreSelectorLayoutEnum.js","../../../node_modules/@inter-ikea-kompis/component-store-selector/lib/enums/StoreSelectorModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-store-selector/lib/enums/StoreSelectorTagNameEnum.js","../../../node_modules/@inter-ikea-kompis/component-store-selector/lib/components/store-selector/StoreSelectorStyle.js","../../../node_modules/@inter-ikea-kompis/component-store-selector/lib/components/store-selector/StoreSelector.js","../../../node_modules/@inter-ikea-kompis/component-store-selector/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-product-information-section/lib/components/measurements-card/MeasurementsCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-product-information-section/lib/components/measurements-card/MeasurementsCard.js","../../../node_modules/@inter-ikea-kompis/component-wood-declaration/lib/components/wood-declaration-card/WoodDeclarationCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-wood-declaration/lib/components/wood-declaration-card/WoodDeclarationCard.js","../../../node_modules/@inter-ikea-kompis/component-wood-declaration/lib/components/wood-declaration/WoodDeclarationStyle.js","../../../node_modules/@inter-ikea-kompis/component-wood-declaration/lib/components/wood-declaration/WoodDeclaration.js","../../../node_modules/@inter-ikea-kompis/component-wood-declaration/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-product-information-section/lib/enums/ProductInformationExpandedAccordionEnum.js","../../../node_modules/@inter-ikea-kompis/component-product-information-section/lib/enums/ProductInformationSectionSecurityAndComplianceEnum.js","../../../node_modules/@inter-ikea-kompis/component-product-information-section/lib/components/product-details-card/ProductDetailsCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-product-information-section/lib/components/product-details-card/ProductDetailsCard.js","../../../node_modules/@inter-ikea-kompis/component-product-information-section/lib/components/technical-information-card/TechnicalInformationCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-product-information-section/lib/components/technical-information-card/TechnicalInformationCard.js","../../../node_modules/@inter-ikea-kompis/component-product-information-section/lib/enums/ProductInformationSectionModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-product-information-section/lib/components/product-information-section/ProductInformationSection.js","../../../node_modules/@inter-ikea-kompis/component-product-information-section/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-media-carousel/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-product-card/lib/enums/ProductCardMediaEnum.js","../../../node_modules/@inter-ikea-kompis/component-product-card/lib/components/product-card-media/ProductCardMediaStyle.js","../../../node_modules/@inter-ikea-kompis/component-product-card/lib/components/product-card-media/ProductCardMedia.js","../../../node_modules/@inter-ikea-kompis/component-product-card/lib/components/product-card-water-sense-image/ProductCardWaterSenseImage.js","../../../node_modules/@inter-ikea-kompis/component-product-card/lib/enums/ProductCardPriceLayoutTypeEnum.js","../../../node_modules/@inter-ikea-kompis/component-product-card/lib/enums/ProductCardOrderEnum.js","../../../node_modules/@inter-ikea-kompis/component-product-card/lib/components/information-card/InformationCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-product-card/lib/components/information-card/InformationCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisInformationCard.js","../../../node_modules/@inter-ikea-kompis/component-product-card/lib/components/product-card-variants/ProductCardVariantsStyle.js","../../../node_modules/@inter-ikea-kompis/component-product-card/lib/components/product-card-variants/ProductCardVariants.js","../../../node_modules/@inter-ikea-kompis/component-product-card/lib/enums/ListGalleryCardMediaEnum.js","../../../node_modules/@inter-ikea-kompis/component-product-card/lib/enums/ProductCardInfoIconButtonLinkTargetEnum.js","../../../node_modules/@inter-ikea-kompis/component-product-card/lib/enums/ProductCardLayoutEnum.js","../../../node_modules/@inter-ikea-kompis/component-product-card/lib/enums/ProductCardSelectBehaviourEnum.js","../../../node_modules/@inter-ikea-kompis/component-product-card/lib/enums/ProductCardSelectedStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-product-card/lib/components/list-gallery-card/ListGalleryCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-product-card/lib/components/list-gallery-card/ListGalleryCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisListGalleryCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisProductCardMedia.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisProductCardVariants.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisProductCardWaterSenseImage.js","../../../node_modules/@inter-ikea-kompis/component-product-card/lib/trackers/ProductCardTracker.js","../../../node_modules/@inter-ikea-kompis/component-product-card/lib/components/product-card/ProductCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisProductCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisMeasurementsCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisProductDetailsCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisProductInformationSection.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisTechnicalInformationCard.js","../../../node_modules/@inter-ikea-kompis/component-product-list/lib/components/product-list-section/ProductListSectionStyle.js","../../../node_modules/@inter-ikea-kompis/component-product-list/lib/components/product-list-section/ProductListSection.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisProductListSection.js","../../../node_modules/@inter-ikea-kompis/component-product-list/lib/enums/ProductListModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-product-list/lib/components/product-list-total-price/ProductListTotalPriceStyle.js","../../../node_modules/@inter-ikea-kompis/component-product-list/lib/components/product-list-total-price/ProductListTotalPrice.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisProductListTotalPrice.js","../../../node_modules/@ingka/icon-store/arrow-up-arrow-down.js","../../../node_modules/@ingka/icon-store/sort-descending.js","../../../node_modules/@inter-ikea-kompis/component-sort-list/lib/enums/SortListOptionsEnum.js","../../../node_modules/@inter-ikea-kompis/component-sort-list/lib/utilities/LabelUtility.js","../../../node_modules/@inter-ikea-kompis/component-sort-list/lib/components/sort-list-card/SortListCard.js","../../../node_modules/@inter-ikea-kompis/component-sort-list/lib/enums/SortListModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-sort-list/lib/components/sort-list/SortListStyle.js","../../../node_modules/@inter-ikea-kompis/component-sort-list/lib/components/sort-list/SortList.js","../../../node_modules/@inter-ikea-kompis/component-sort-list/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-product-list/lib/utilities/ProductListSprUtility.js","../../../node_modules/@inter-ikea-kompis/component-product-list/lib/utilities/ProductListSorting.js","../../../node_modules/@inter-ikea-kompis/component-product-list/lib/components/product-list/ProductListStyle.js","../../../node_modules/@inter-ikea-kompis/component-product-list/lib/components/product-list/ProductList.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisProductList.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisCompactProductRow.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisProductRow.js","../../../node_modules/@inter-ikea-kompis/component-product-card/lib/enums/ProductCardModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-product-card/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-product-shelf/lib/enums/ProductShelfProductCardMediaEnum.js","../../../node_modules/@inter-ikea-kompis/component-product-shelf/lib/enums/ProductShelfProductLinkEnum.js","../../../node_modules/@inter-ikea-kompis/component-product-shelf/lib/components/product-shelf/ProductShelfStyle.js","../../../node_modules/@inter-ikea-kompis/component-product-shelf/lib/components/product-shelf/ProductShelf.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisProductShelf.js","../../../node_modules/@inter-ikea-kompis/component-prompt/lib/enums/PromptButtonTypeEnum.js","../../../node_modules/@inter-ikea-kompis/component-prompt/lib/enums/PromptAnimationNameEnum.js","../../../node_modules/@inter-ikea-kompis/component-prompt/lib/components/prompt/PromptStyle.js","../../../node_modules/@inter-ikea-kompis/component-prompt/lib/components/prompt/Prompt.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisPrompt.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisQrCode.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisQuantity.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisRadioButton.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisRadioGroup.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisRepairabilityIndexCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisRepairabilityIndex.js","../../../node_modules/@inter-ikea-kompis/component-save-design-card/lib/enums/SaveDesignCardCopyStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-save-design-card/lib/enums/SaveDesignCardStateEnum.js","../../../node_modules/@inter-ikea-kompis/component-save-design-card/lib/trackers/SaveDesignCardTracker.js","../../../node_modules/@inter-ikea-kompis/component-save-design-card/lib/components/save-design-card/SaveDesignCardStyle.js","../../../node_modules/@inter-ikea-kompis/component-save-design-card/lib/components/save-design-card/SaveDesignCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSaveDesignCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSaveDesignToProfileCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSaveDesignToProfile.js","../../../node_modules/@inter-ikea-kompis/component-screensaver-frame/lib/enums/ScreensaverFrameVideoObjectFitEnum.js","../../../node_modules/@inter-ikea-kompis/component-screensaver-frame/lib/components/screensaver-frame/ScreensaverFrameStyle.js","../../../node_modules/@inter-ikea-kompis/component-screensaver-frame/lib/components/screensaver-frame/ScreensaverFrame.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisScreensaverFrame.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSendByEmail.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSendBySms.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisShareDesignCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSheetBackdrop.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSheetBodyPadding.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSheetBody.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSheetFooterButtons.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSheetFooter.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSheetHeader.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSheet.js","../../../node_modules/@inter-ikea-kompis/component-slider/lib/components/slider/SliderStyle.js","../../../node_modules/@inter-ikea-kompis/component-slider/lib/components/slider/Slider.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSlider.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSortListCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSortList.js","../../../node_modules/@inter-ikea-kompis/component-status-indicator/lib/enums/StatusIndicatorDotPositionEnum.js","../../../node_modules/@inter-ikea-kompis/component-status-indicator/lib/enums/StatusIndicatorFontSizeEnum.js","../../../node_modules/@inter-ikea-kompis/component-status-indicator/lib/enums/StatusIndicatorColorEnum.js","../../../node_modules/@inter-ikea-kompis/component-status-indicator/lib/components/status-indicator/StatusIndicatorStyle.js","../../../node_modules/@inter-ikea-kompis/component-status-indicator/lib/components/status-indicator/StatusIndicator.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisStatusIndicator.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisStoreSelectorCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisStoreSelector.js","../../../node_modules/@inter-ikea-kompis/component-configuration-summary/lib/utilities/ConfigurationSummaryToastMessage.js","../../../node_modules/@inter-ikea-kompis/component-configuration-summary/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-toast/lib/enums/ToastAnimationNameEnum.js","../../../node_modules/@inter-ikea-kompis/component-toast/lib/utils/ToastFocusUtil.js","../../../node_modules/@inter-ikea-kompis/component-toast/lib/components/toast/ToastStyle.js","../../../node_modules/@inter-ikea-kompis/component-toast/lib/components/toast/Toast.js","../../../node_modules/@inter-ikea-kompis/component-toast/lib/ToastManager.js","../../../node_modules/@inter-ikea-kompis/component-toast/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-assembly-services/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-assistance-card/lib/index.js","../../../node_modules/@ingka/icon-store/pencil.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/components/summary-page-images/SummaryPageImages.js","../../../node_modules/@inter-ikea-kompis/component-product-list/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/enums/SummaryPageModalEnum.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/components/summary-page-product-list/SummaryPageProductListStyle.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/components/summary-page-product-list/SummaryPageProductList.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/components/summary-page-security/SummaryPageSecurityStyle.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/components/summary-page-security/SummaryPageSecurity.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/enums/PrintableContentEnum.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/enums/SummaryPageTabEnum.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/utilities/SummaryPageCustomTabsUtility.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/components/summary-page-tabs/SummaryPageTabsStyle.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/components/summary-page-tabs/SummaryPageTabs.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/enums/SummaryPageConfigurationMeasureEnum.js","../../../node_modules/@inter-ikea-kompis/browser-support/node_modules/bowser/es5.js","../../../node_modules/@inter-ikea-kompis/browser-support/lib/browser-detection/BrowserDetection.js","../../../node_modules/@inter-ikea-kompis/browser-support/lib/browser-support-message/image/IllAlien.js","../../../node_modules/@inter-ikea-kompis/browser-support/lib/browser-support-message/BrowserSupportMessage.js","../../../node_modules/@inter-ikea-kompis/browser-support/lib/index.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/utilities/SummaryPageBrowserUtility.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/utilities/SummaryPageMeasurementUtility.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/components/summary-page-header/IkeaLogo.js","../../../node_modules/@ingka/variables/colours-css.js","../../../node_modules/@ingka/variables/design-tokens.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/components/summary-page-print/SummaryPagePrintStyle.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/components/summary-page-print/SummaryPagePrint.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/enums/InlineMessageIconEnum.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/enums/InlineMessageLayoutEnum.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/trackers/SummaryPageAnalyticsContext.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/trackers/SummaryPageTracker.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/utilities/SummaryPagePaddingUtility.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/components/summary-page/SummaryPageStyle.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/components/summary-page/SummaryPage.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/enums/SummaryPageConfirmationCardTypeEnum.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/enums/SummaryPageControllerLoginBehaviourEnum.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/components/summary-page-controller/SummaryPageControllerDefaultState.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/components/summary-page-controller/SummaryPageController.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSummaryPageController.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/components/summary-page-footer/SummaryPageFooterStyle.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/components/summary-page-footer/SummaryPageFooter.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSummaryPageFooter.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/trackers/SummaryPageHeaderTracker.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/components/summary-page-header/SummaryPageHeaderStyle.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/components/summary-page-header/SummaryPageHeader.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSummaryPageHeader.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSummaryPageImages.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSummaryPagePrint.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSummaryPageProductList.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSummaryPageSecurity.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSummaryPageTabs.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSummaryPage.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisSwitch.js","../../../node_modules/@inter-ikea-kompis/component-tabs/lib/components/tab-button/TabButtonStyle.js","../../../node_modules/@inter-ikea-kompis/component-tabs/lib/components/tab-button/TabButton.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisTabButton.js","../../../node_modules/@inter-ikea-kompis/component-tabs/lib/components/tabs/Tabs.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisTabs.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisText.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisTextToggle.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisToast.js","../../../node_modules/@inter-ikea-kompis/component-toggle/lib/components/toggle/ToggleStyle.js","../../../node_modules/@inter-ikea-kompis/component-toggle/lib/components/toggle/Toggle.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisToggle.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisTooltip.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisWaterEfficiencyClass.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisWaterLabelCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisWoodDeclarationCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisWoodDeclaration.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisZipInCard.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/es6/components/KompisZipIn.js","../../../node_modules/lodash/lodash.js","../../../node_modules/polybooljs/lib/build-log.js","../../../node_modules/polybooljs/lib/epsilon.js","../../../node_modules/polybooljs/lib/linked-list.js","../../../node_modules/polybooljs/lib/intersecter.js","../../../node_modules/polybooljs/lib/segment-chainer.js","../../../node_modules/polybooljs/lib/segment-selector.js","../../../node_modules/polybooljs/lib/geojson.js","../../../node_modules/polybooljs/index.js","../../../node_modules/two-product/two-product.js","../../../node_modules/robust-sum/robust-sum.js","../../../node_modules/two-sum/two-sum.js","../../../node_modules/robust-scale/robust-scale.js","../../../node_modules/robust-subtract/robust-diff.js","../../../node_modules/robust-orientation/orientation.js","../../../node_modules/robust-point-in-polygon/robust-pnp.js","../../../node_modules/@ikea-aoa/ikea-shared-styles/lib/variables/Screen.json.js","../../../node_modules/@inter-ikea-kompis/component-prompt/lib/index.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/exception/AbstractClassException.js","../../../node_modules/@ikea-aoa/ikea-shared-component/lib/dom/ComponentBody.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/Console.js","../../../node_modules/@ikea-aoa/ikea-shared-component/lib/utility/UniqueComponentVerifier.js","../../../node_modules/@ikea-aoa/ikea-shared-component/lib/ComponentManager.js","../../../node_modules/@ikea-aoa/ikea-shared-component/lib/dom/DomMutation.js","../../../node_modules/@ikea-aoa/ikea-shared-component/lib/dom/ComponentDom.js","../../../node_modules/@ikea-aoa/ikea-shared-component/lib/prop/ComponentPropHandler.js","../../../node_modules/@ikea-aoa/ikea-shared-component/lib/event/ComponentEventHandler.js","../../../node_modules/@ikea-aoa/ikea-shared-component/lib/utility/ComponentCacheStore.js","../../../node_modules/@ikea-aoa/ikea-shared-component/lib/utility/ComponentResizeHandler.js","../../../node_modules/@ikea-aoa/ikea-shared-component/lib/utility/ComponentAttributeObserver.js","../../../node_modules/@ikea-aoa/ikea-shared-component/lib/AbstractComponent.js","../../../node_modules/@ikea-aoa/ikea-shared-component/lib/mock/SupportedMock.js","../../../node_modules/@ikea-aoa/ikea-shared-component/lib/prop/SupportedProp.js","../../../node_modules/@ikea-aoa/ikea-shared-component/lib/index.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/exception/ServiceException.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/ServiceSettings.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/CacheWaitItem.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/CacheNotFoundItem.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/exception/ServiceFacadeException.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/exception/TypeException.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/AbstractServiceFacade.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/AbstractService.js","../../../node_modules/@ikea-aoa/ikea-shared-utils/lib/exception/FactoryException.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/util/ServiceUrlUtility.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/auth/IrwAuthService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/auth/NifAuthService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/platform/AbstractPlatformService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/platform/irw/IrwPlatformService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/platform/nwp/NwpPlatformClient.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/platform/nwp/NwpPlatformService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/platform/roig/RoigPlatformService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/article/AbstractArticleService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/article/retailitem/RetailItemParser.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/article/retailitem/IrwRetailItemService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/article/retailitem/NwpRetailItemService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/article/retailitem/WprwRetailItemService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/article/dexf/TypeCodeToGlobalTypeMap.json.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/facade/LocalizationServiceFacade.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/constant/EcommerceCartDataSourceConstant.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/util/LocalizationUtility.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/article/dexf/DexfWebPlannerParser.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/article/dexf/DexfWebPlannerService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/shoppingbag/ShoppingBagService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/shoppingbag/NifCartService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/storeavailability/irw/IrwStoreAvailabilityParser.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/storeavailability/irw/IrwStoreAvailabilityService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/store/IrwStoreService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/store/NwpStoreService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/storeavailability/nwp/NwpStoreItemParser.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/storeavailability/nwp/NwpStoreItemService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/url/ApplicationUrlService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/vpc/AbstractVpcService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/vpc/iows/VpcSkeleton.json.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/vpc/iows/IowsVpcService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/vpc/dexf/DexfVpcService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/localization/LocalizationService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/seriesgallery/SeriesGalleryService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/auth/OneWebAuthService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/shoppingbag/OneWebCartService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/shoppingbag/OneWebShoppingListService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/shoppingbag/MvEcomService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/ServiceFactory.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/AbstractServiceConfig.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/article/ArticleServiceConfig.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/facade/ApplicationUrlServiceFacade.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/constant/ApiPlatformConstant.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/constant/ProductDataSourceConstant.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/facade/ArticleServiceFacade.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/facade/AuthServiceFacade.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/facade/PlatformServiceFacade.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/model/TotalPriceModel.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/util/TotalPriceCalculator.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/facade/PriceServiceFacade.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/constant/EcommerceShoppingListDataSourceConstant.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/enums/CacheStoreType.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/animation/EasingAnimation.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/debounce/DebounceManager.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/encoding/HtmlEncoder.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/iframe/IframeUtility.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/string/StringUtility.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/cache/CacheStore.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/cache/GlobalCacheStore.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/latch/Latch.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/locale/LocaleUtility.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/date/DateFormatter.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/iframe/IframeVisibleArea.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/iframe/IframeVisibleAreaObserver.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/image/ImageUtility.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/energy-class/EnergyClassParser.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/exceptions/lib/AbstractException.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/exceptions/lib/enums/ExceptionTypeEnum.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/exceptions/lib/exceptions/ComponentElementException.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/exceptions/lib/exceptions/ComponentException.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/exceptions/lib/exceptions/Exception.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/exceptions/lib/exceptions/ServerErrorResponseException.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/exceptions/lib/exceptions/ConnectionProblemException.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/exceptions/lib/exceptions/UnableToParseServerResponseException.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/exceptions/lib/exceptions/ServiceException.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/exceptions/lib/index.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/price/ProductPriceInformationSummaryTransformer.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/price/TotalPriceCalculator.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/measurement/MeasurementUtility.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/price/PriceFormatter.js","../../../node_modules/@ikea-aoa/enums/lib/ApiPlatformEnum.js","../../../node_modules/@ikea-aoa/enums/lib/ImageTypeNameEnum.js","../../../node_modules/@ikea-aoa/enums/lib/SalesMethodCodeEnum.js","../../../node_modules/@ikea-aoa/enums/lib/InStockProbabilityEnum.js","../../../node_modules/@ikea-aoa/enums/lib/ProductDataSourceEnum.js","../../../node_modules/@ikea-aoa/enums/lib/VpcDataSourceEnum.js","../../../node_modules/@ikea-aoa/enums/lib/WriteDirectionEnum.js","../../../node_modules/@ikea-aoa/enums/lib/EcommerceCartDataSourceEnum.js","../../../node_modules/@ikea-aoa/enums/lib/EcommerceShoppingListDataSourceEnum.js","../../../node_modules/@ikea-aoa/enums/lib/CookieConsentDataSourceEnum.js","../../../node_modules/@ikea-aoa/enums/lib/SalesSystemEnum.js","../../../node_modules/@ikea-aoa/enums/lib/IowsShoppingBagTypeEnum.js","../../../node_modules/@ikea-aoa/enums/lib/ThemeBreakpointIndexEnum.js","../../../node_modules/@ikea-aoa/enums/lib/ThemeFontStyleTypeEnum.js","../../../node_modules/@ikea-aoa/enums/lib/ThemeIconSizeEnum.js","../../../node_modules/@ikea-aoa/enums/lib/ThemeSpacingEnum.js","../../../node_modules/@ikea-aoa/enums/lib/ThemeMotionDurationEnum.js","../../../node_modules/@ikea-aoa/enums/lib/ThemeBreakpointEnum.js","../../../node_modules/@ikea-aoa/enums/lib/ThemeMotionEaseEnum.js","../../../node_modules/@ikea-aoa/enums/lib/ThemeMotionIconDurationEnum.js","../../../node_modules/@ikea-aoa/enums/lib/DexfNotificationTypeEnum.js","../../../node_modules/@ikea-aoa/enums/lib/TemporaryPricePeriodEnum.js","../../../node_modules/@ikea-aoa/enums/lib/AutoCompleteEnum.js","../../../node_modules/@ikea-aoa/enums/lib/NotificationLinkTypeEnum.js","../../../node_modules/@ikea-aoa/enums/lib/InvalidProductReasonEnum.js","../../../node_modules/@ikea-aoa/enums/lib/index.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/price/PriceUtility.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/write-direction/SafariWriteDirectionUtility.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/product/ProductUtility.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/cssLoader/CssLoader.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/javascriptLoader/JavascriptLoader.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/utilities/lib/index.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/utilities/platform-communication/IrwPlatformCommunication.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/facades/platform/PlatformService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/utilities/ServiceFetch.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/product/DexfWebplannerService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/facades/product/ProductCache.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/facades/product/ProductItemQueue.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/localization/OversattaTransformer.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/localization/OversattaService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/facades/localization/LocalizationService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/facades/product/ProductService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/shopping/iows/IowsShoppingBagErrorCodes.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/shopping/iows/IowsShoppingBagService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/shopping/ingka/cart/IngkaCartService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/shopping/china/cart/ChinaCartService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/shopping/nif/enums/NifUnitTypeEnum.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/shopping/nif/NifCartService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/utilities/platform-communication/RoigPlatformCommunication.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/authentication/iows/IowsAuthenticationService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/utilities/IframeManager.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/authentication/one-web/OneWebAuthenticationService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/authentication/nif/NifAuthenticationService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/authentication/china/ChinaAuthenticationServiceCookieNameEnum.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/authentication/china/ChinaAuthenticationService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/facades/shopping/AuthenticationQueue.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/facades/shopping/ShoppingCartService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/shopping/ingka/shopping-list/IngkaShoppingListService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/shopping/china/shopping-list/ChinaShoppingListService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/facades/shopping/ShoppingListService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/store/IowsStoreTransformer.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/store/IowsStoreService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/facades/store/StoreCache.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/facades/store/StoreService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/store-availability/IowsStoreAvailabilityListTransformer.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/store-availability/IowsStoreAvailabilityListService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/facades/store-availability/StoreAvailabilityQueue.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/facades/store-availability/StoreAvailabilityCache.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/facades/store-availability/StoreAvailabilityService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/facades/localization/LocalizationServiceKompis1Migration.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/vpc/dexf/DexfVpcService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/facades/vpc/VpcService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/cookie-consent/OneWebCookieConsentService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/facades/cookie-consent/CookieConsentService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/services/notification/DexfNotificationService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/facades/notification/NotificationService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/utilities/shopping-support/ShoppingSupport.js","../../../node_modules/@ikea-aoa/ikea-shared-services/node_modules/@ikea-aoa/services/lib/index.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/facade/ShoppingServiceFacade.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/article/dexf/DexfStoreAvailabilityService.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/facade/StoreAvailabilityServiceFacade.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/facade/StoreServiceFacade.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/service/vpc/VpcServiceConfig.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/facade/VpcServiceFacade.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/facade/SeriesGalleryServiceFacade.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/util/PriceFormatter.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/util/DateFormatter.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/util/IframeUtility.js","../../../node_modules/@ikea-aoa/ikea-shared-services/lib/index.js","../../../node_modules/@ikea-aoa/ikea-shared-localized-component/lib/AbstractLocalizedComponent.js","../../../node_modules/@ikea-aoa/ikea-shared-localized-component/lib/index.js","../../../node_modules/@ikea-aoa/ikea-component-swiper/lib/Swiper.ejs.js","../../../node_modules/@ikea-aoa/ikea-component-swiper/lib/pagination/SwiperPage.js","../../../node_modules/@ikea-aoa/ikea-component-swiper/lib/render/SwiperRenderSize.js","../../../node_modules/@ikea-aoa/ikea-component-swiper/lib/render/SwiperBodyRenderer.js","../../../node_modules/@ikea-aoa/ikea-component-swiper/lib/event/SwiperPointer.js","../../../node_modules/@ikea-aoa/ikea-component-swiper/lib/event/SwiperScroll.js","../../../node_modules/@ikea-aoa/ikea-component-swiper/lib/render/SwiperAnimation.js","../../../node_modules/@ikea-aoa/ikea-component-swiper/lib/utility/PageObserver.js","../../../node_modules/@ikea-aoa/ikea-component-swiper/lib/pagination/SwiperPosition.js","../../../node_modules/@ikea-aoa/ikea-component-swiper/lib/pagination/SwiperInfo.js","../../../node_modules/@ikea-aoa/ikea-component-swiper/lib/Swiper.js","../../../node_modules/@ikea-aoa/ikea-component-button/lib/Button.ejs.js","../../../node_modules/@ikea-aoa/ikea-component-button/lib/Button.js","../../../node_modules/@ikea-aoa/ikea-component-keyboard/lib/Layout.js","../../../node_modules/@ikea-aoa/ikea-component-keyboard/lib/Keyboard.ejs.js","../../../node_modules/@ikea-aoa/ikea-component-keyboard/lib/Keyboard.js","../../../node_modules/@ikea-aoa/ikea-component-load-vpc/lib/LoadVpc.ejs.js","../../../node_modules/@ikea-aoa/ikea-component-load-vpc/lib/LoadVpc.js","../../../node_modules/@ikea-aoa/ikea-component-language-picker/lib/LanguagePicker.ejs.js","../../../node_modules/@ikea-aoa/ikea-component-language-picker/lib/IkeaLocale.js","../../../node_modules/@ikea-aoa/ikea-component-language-picker/lib/LanguagePicker.js","../../../node_modules/@ikea-aoa/ikea-component-image/lib/Image.ejs.js","../../../node_modules/@ikea-aoa/ikea-component-image/lib/Image.js","../../../node_modules/@ikea-aoa/ikea-component-series-gallery/lib/SeriesGallery.ejs.js","../../../node_modules/@ikea-aoa/ikea-component-series-gallery/lib/SeriesGallery.js","../../../node_modules/@inter-ikea-gallery/integration/build/index.js","../../../node_modules/@inter-ikea-kompis/component-mini-survey/lib/index.js","../../../node_modules/reselect/es/defaultMemoize.js","../../../node_modules/reselect/es/index.js","../../../node_modules/classnames/index.js","../../../node_modules/eventemitter3/index.js","../../../node_modules/bowser/src/bowser.js","../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js","../../../node_modules/dom-helpers/class/hasClass.js","../../../node_modules/dom-helpers/class/addClass.js","../../../node_modules/dom-helpers/class/removeClass.js","../../../node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js","../../../node_modules/react-transition-group/utils/PropTypes.js","../../../node_modules/react-transition-group/TransitionGroupContext.js","../../../node_modules/react-transition-group/Transition.js","../../../node_modules/react-transition-group/CSSTransition.js","../../../node_modules/react-transition-group/utils/ChildMapping.js","../../../node_modules/react-transition-group/TransitionGroup.js","../../../node_modules/react-transition-group/ReplaceTransition.js","../../../node_modules/react-transition-group/index.js","../../../node_modules/@inter-ikea-kompis/component-icon-button/lib/index.js","../../../node_modules/@inter-ikea-kompis/react-components/lib/commonjs/components/KompisIconButton.js","../../../node_modules/@inter-ikea-kompis/component-summary-page/lib/index.js","../../../node_modules/dom7/node_modules/ssr-window/dist/ssr-window.esm.js","../../../node_modules/dom7/dist/dom7.modular.js","../../../node_modules/ssr-window/dist/ssr-window.esm.js","../../../node_modules/swiper/dist/js/swiper.esm.bundle.js","../../../node_modules/intrinsic-scale/dist/intrinsic-scale.es-modules.js","../../../node_modules/@ingka/label/esm/Label.js","../../../node_modules/@ingka/label/esm/index.js","../../../node_modules/@ingka/switch/esm/Switch.js","../../../node_modules/@ingka/switch/esm/index.js","../../../node_modules/es6-promise-polyfill/promise.js","../../../node_modules/@pixi/polyfill/lib/polyfill.es.js","../../../node_modules/ismobilejs/esm/isMobile.js","../../../node_modules/@pixi/settings/lib/settings.es.js","../../../node_modules/@pixi/utils/node_modules/eventemitter3/index.js","../../../node_modules/earcut/src/earcut.js","../../../node_modules/url/node_modules/punycode/punycode.js","../../../node_modules/url/util.js","../../../node_modules/querystring/decode.js","../../../node_modules/querystring/encode.js","../../../node_modules/querystring/index.js","../../../node_modules/url/url.js","../../../node_modules/@pixi/constants/lib/constants.es.js","../../../node_modules/@pixi/utils/lib/utils.es.js","../../../node_modules/@pixi/math/lib/math.es.js","../../../node_modules/@pixi/display/lib/display.es.js","../../../node_modules/@pixi/accessibility/lib/accessibility.es.js","../../../node_modules/@pixi/ticker/lib/ticker.es.js","../../../node_modules/@pixi/interaction/lib/interaction.es.js","../../../node_modules/@pixi/runner/lib/runner.es.js","../../../node_modules/@pixi/core/lib/core.es.js","../../../node_modules/@pixi/app/lib/app.es.js","../../../node_modules/@pixi/extract/lib/extract.es.js","../../../node_modules/parse-uri/src/index.js","../../../node_modules/mini-signals/src/mini-signals.js","../../../node_modules/resource-loader/dist/resource-loader.esm.js","../../../node_modules/@pixi/loaders/lib/loaders.es.js","../../../node_modules/@pixi/particles/lib/particles.es.js","../../../node_modules/@pixi/graphics/lib/graphics.es.js","../../../node_modules/@pixi/sprite/lib/sprite.es.js","../../../node_modules/@pixi/text/lib/text.es.js","../../../node_modules/@pixi/prepare/lib/prepare.es.js","../../../node_modules/@pixi/spritesheet/lib/spritesheet.es.js","../../../node_modules/@pixi/sprite-tiling/lib/sprite-tiling.es.js","../../../node_modules/@pixi/text-bitmap/lib/text-bitmap.es.js","../../../node_modules/@pixi/filter-alpha/lib/filter-alpha.es.js","../../../node_modules/@pixi/filter-blur/lib/filter-blur.es.js","../../../node_modules/@pixi/filter-color-matrix/lib/filter-color-matrix.es.js","../../../node_modules/@pixi/filter-displacement/lib/filter-displacement.es.js","../../../node_modules/@pixi/filter-fxaa/lib/filter-fxaa.es.js","../../../node_modules/@pixi/filter-noise/lib/filter-noise.es.js","../../../node_modules/@pixi/mixin-cache-as-bitmap/lib/mixin-cache-as-bitmap.es.js","../../../node_modules/@pixi/mixin-get-child-by-name/lib/mixin-get-child-by-name.es.js","../../../node_modules/@pixi/mixin-get-global-position/lib/mixin-get-global-position.es.js","../../../node_modules/@pixi/mesh/lib/mesh.es.js","../../../node_modules/pixi.js/lib/pixi.es.js","../../../node_modules/@pixi/canvas-renderer/lib/canvas-renderer.es.js","../../../node_modules/@pixi/canvas-mesh/lib/canvas-mesh.es.js","../../../node_modules/@pixi/canvas-graphics/lib/canvas-graphics.es.js","../../../node_modules/@pixi/canvas-sprite/lib/canvas-sprite.es.js","../../../node_modules/@pixi/canvas-extract/lib/canvas-extract.es.js","../../../node_modules/@pixi/canvas-prepare/lib/canvas-prepare.es.js","../../../node_modules/@pixi/canvas-display/lib/canvas-display.es.js","../../../node_modules/@pixi/canvas-text/lib/canvas-text.es.js","../../../node_modules/pixi.js-legacy/lib/pixi-legacy.es.js","../../../node_modules/fast-deep-equal/index.js","../../../node_modules/gl-matrix/lib/gl-matrix/common.js","../../../node_modules/gl-matrix/lib/gl-matrix/mat4.js","../../../node_modules/gl-matrix/lib/gl-matrix/vec3.js","../../../node_modules/@ingka/ssr-icon/esm/SSRIcon.js","../../../node_modules/@ingka/ssr-icon/esm/index.js","../../../node_modules/@ingka/ssr-icon/esm/paths/warning-triangle.js","../../../node_modules/@ingka/button/esm/Button.js","../../../node_modules/@ingka/button/esm/index.js","../../../node_modules/@ingka/hyperlink/esm/Hyperlink.js","../../../node_modules/@ingka/hyperlink/esm/index.js","../../../node_modules/@ingka/ssr-icon/esm/paths/cross-small.js","../../../node_modules/@ingka/ssr-icon/esm/paths/incorrect.js","../../../node_modules/@ingka/ssr-icon/esm/paths/checkmark-circle.js","../../../node_modules/@ingka/ssr-icon/esm/paths/information-circle.js","../../../node_modules/@ingka/inline-message/esm/InlineMessage.js","../../../node_modules/@ingka/inline-message/esm/index.js","../../../node_modules/@ingka/loading/esm/Loading.js","../../../node_modules/@ingka/loading/esm/LoadingBall.js","../../../node_modules/file-saver/dist/FileSaver.min.js","../../../node_modules/@inter-ikea-kompis/navision-export/lib/NavisionExport.js","../../../node_modules/@inter-ikea-kompis/navision-export/lib/index.js","../../../node_modules/gsap/TweenLite.js","../../../node_modules/gsap/TimelineLite.js","../../../node_modules/gsap/TimelineMax.js","../../../node_modules/gsap/TweenMaxBase.js","../../../node_modules/gsap/CSSPlugin.js","../../../node_modules/gsap/AttrPlugin.js","../../../node_modules/gsap/RoundPropsPlugin.js","../../../node_modules/gsap/DirectionalRotationPlugin.js","../../../node_modules/gsap/BezierPlugin.js","../../../node_modules/gsap/EasePack.js","../../../node_modules/gsap/TweenMax.js","../../../node_modules/focus-visible/dist/focus-visible.js"],"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 v16.14.0\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\n'use strict';var l=require(\"object-assign\"),n=\"function\"===typeof Symbol&&Symbol.for,p=n?Symbol.for(\"react.element\"):60103,q=n?Symbol.for(\"react.portal\"):60106,r=n?Symbol.for(\"react.fragment\"):60107,t=n?Symbol.for(\"react.strict_mode\"):60108,u=n?Symbol.for(\"react.profiler\"):60114,v=n?Symbol.for(\"react.provider\"):60109,w=n?Symbol.for(\"react.context\"):60110,x=n?Symbol.for(\"react.forward_ref\"):60112,y=n?Symbol.for(\"react.suspense\"):60113,z=n?Symbol.for(\"react.memo\"):60115,A=n?Symbol.for(\"react.lazy\"):\n60116,B=\"function\"===typeof Symbol&&Symbol.iterator;function C(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;cQ.length&&Q.push(a)}\nfunction T(a,b,c,e){var d=typeof a;if(\"undefined\"===d||\"boolean\"===d)a=null;var g=!1;if(null===a)g=!0;else switch(d){case \"string\":case \"number\":g=!0;break;case \"object\":switch(a.$$typeof){case p:case q:g=!0}}if(g)return c(e,a,\"\"===b?\".\"+U(a,0):b),1;g=0;b=\"\"===b?\".\":b+\":\";if(Array.isArray(a))for(var k=0;k result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n defineProperty(this, \"_invoke\", { value: enqueue });\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var methodName = context.method;\n var method = delegate.iterator[methodName];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method, or a missing .next mehtod, always terminate the\n // yield* loop.\n context.delegate = null;\n\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (methodName === \"throw\" && delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n if (methodName !== \"return\") {\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a '\" + methodName + \"' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(val) {\n var object = Object(val);\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","var global =\n (typeof globalThis !== 'undefined' && globalThis) ||\n (typeof self !== 'undefined' && self) ||\n (typeof global !== 'undefined' && global)\n\nvar support = {\n searchParams: 'URLSearchParams' in global,\n iterable: 'Symbol' in global && 'iterator' in Symbol,\n blob:\n 'FileReader' in global &&\n 'Blob' in global &&\n (function() {\n try {\n new Blob()\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in global,\n arrayBuffer: 'ArrayBuffer' in global\n}\n\nfunction isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n}\n\nif (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ]\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n }\n}\n\nfunction normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {\n throw new TypeError('Invalid character in header field name: \"' + name + '\"')\n }\n return name.toLowerCase()\n}\n\nfunction normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n}\n\n// Build a destructive iterator for the value list\nfunction iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n}\n\nexport function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1])\n }, this)\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n}\n\nHeaders.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var oldValue = this.map[name]\n this.map[name] = oldValue ? oldValue + ', ' + value : value\n}\n\nHeaders.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n}\n\nHeaders.prototype.get = function(name) {\n name = normalizeName(name)\n return this.has(name) ? this.map[name] : null\n}\n\nHeaders.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n}\n\nHeaders.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value)\n}\n\nHeaders.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this)\n }\n }\n}\n\nHeaders.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push(name)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.values = function() {\n var items = []\n this.forEach(function(value) {\n items.push(value)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push([name, value])\n })\n return iteratorFor(items)\n}\n\nif (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n}\n\nfunction consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n}\n\nfunction fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n}\n\nfunction readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsArrayBuffer(blob)\n return promise\n}\n\nfunction readBlobAsText(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsText(blob)\n return promise\n}\n\nfunction readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf)\n var chars = new Array(view.length)\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i])\n }\n return chars.join('')\n}\n\nfunction bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength)\n view.set(new Uint8Array(buf))\n return view.buffer\n }\n}\n\nfunction Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n /*\n fetch-mock wraps the Response object in an ES6 Proxy to\n provide useful test harness features such as flush. However, on\n ES5 browsers without fetch or Proxy support pollyfills must be used;\n the proxy-pollyfill is unable to proxy an attribute unless it exists\n on the object before the Proxy is created. This change ensures\n Response.bodyUsed exists on the instance, while maintaining the\n semantic of setting Request.bodyUsed in the constructor before\n _initBody is called.\n */\n this.bodyUsed = this.bodyUsed\n this._bodyInit = body\n if (!body) {\n this._bodyText = ''\n } else if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer)\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer])\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body)\n } else {\n this._bodyText = body = Object.prototype.toString.call(body)\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n var isConsumed = consumed(this)\n if (isConsumed) {\n return isConsumed\n }\n if (ArrayBuffer.isView(this._bodyArrayBuffer)) {\n return Promise.resolve(\n this._bodyArrayBuffer.buffer.slice(\n this._bodyArrayBuffer.byteOffset,\n this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength\n )\n )\n } else {\n return Promise.resolve(this._bodyArrayBuffer)\n }\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n }\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n}\n\n// HTTP methods whose capitalization should be normalized\nvar methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\nfunction normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return methods.indexOf(upcased) > -1 ? upcased : method\n}\n\nexport function Request(input, options) {\n if (!(this instanceof Request)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n\n options = options || {}\n var body = options.body\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n this.signal = input.signal\n if (!body && input._bodyInit != null) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = String(input)\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.signal = options.signal || this.signal\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n\n if (this.method === 'GET' || this.method === 'HEAD') {\n if (options.cache === 'no-store' || options.cache === 'no-cache') {\n // Search for a '_' parameter in the query string\n var reParamSearch = /([?&])_=[^&]*/\n if (reParamSearch.test(this.url)) {\n // If it already exists then set the value with the current time\n this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime())\n } else {\n // Otherwise add a new '_' parameter to the end with the current time\n var reQueryString = /\\?/\n this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime()\n }\n }\n }\n}\n\nRequest.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n}\n\nfunction decode(body) {\n var form = new FormData()\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n}\n\nfunction parseHeaders(rawHeaders) {\n var headers = new Headers()\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ')\n // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill\n // https://github.com/github/fetch/issues/748\n // https://github.com/zloirock/core-js/issues/751\n preProcessedHeaders\n .split('\\r')\n .map(function(header) {\n return header.indexOf('\\n') === 0 ? header.substr(1, header.length) : header\n })\n .forEach(function(line) {\n var parts = line.split(':')\n var key = parts.shift().trim()\n if (key) {\n var value = parts.join(':').trim()\n headers.append(key, value)\n }\n })\n return headers\n}\n\nBody.call(Request.prototype)\n\nexport function Response(bodyInit, options) {\n if (!(this instanceof Response)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status === undefined ? 200 : options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText === undefined ? '' : '' + options.statusText\n this.headers = new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n}\n\nBody.call(Response.prototype)\n\nResponse.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n}\n\nResponse.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n}\n\nvar redirectStatuses = [301, 302, 303, 307, 308]\n\nResponse.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n}\n\nexport var DOMException = global.DOMException\ntry {\n new DOMException()\n} catch (err) {\n DOMException = function(message, name) {\n this.message = message\n this.name = name\n var error = Error(message)\n this.stack = error.stack\n }\n DOMException.prototype = Object.create(Error.prototype)\n DOMException.prototype.constructor = DOMException\n}\n\nexport function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init)\n\n if (request.signal && request.signal.aborted) {\n return reject(new DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest()\n\n function abortXhr() {\n xhr.abort()\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n }\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n setTimeout(function() {\n resolve(new Response(body, options))\n }, 0)\n }\n\n xhr.onerror = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'))\n }, 0)\n }\n\n xhr.ontimeout = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'))\n }, 0)\n }\n\n xhr.onabort = function() {\n setTimeout(function() {\n reject(new DOMException('Aborted', 'AbortError'))\n }, 0)\n }\n\n function fixUrl(url) {\n try {\n return url === '' && global.location.href ? global.location.href : url\n } catch (e) {\n return url\n }\n }\n\n xhr.open(request.method, fixUrl(request.url), true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false\n }\n\n if ('responseType' in xhr) {\n if (support.blob) {\n xhr.responseType = 'blob'\n } else if (\n support.arrayBuffer &&\n request.headers.get('Content-Type') &&\n request.headers.get('Content-Type').indexOf('application/octet-stream') !== -1\n ) {\n xhr.responseType = 'arraybuffer'\n }\n }\n\n if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers)) {\n Object.getOwnPropertyNames(init.headers).forEach(function(name) {\n xhr.setRequestHeader(name, normalizeValue(init.headers[name]))\n })\n } else {\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n }\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr)\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr)\n }\n }\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n}\n\nfetch.polyfill = true\n\nif (!global.fetch) {\n global.fetch = fetch\n global.Headers = Headers\n global.Request = Request\n global.Response = Response\n}\n","/* smoothscroll v0.4.4 - 2019 - Dustan Kasten, Jeremias Menichelli - MIT License */\n(function () {\n 'use strict';\n\n // polyfill\n function polyfill() {\n // aliases\n var w = window;\n var d = document;\n\n // return if scroll behavior is supported and polyfill is not forced\n if (\n 'scrollBehavior' in d.documentElement.style &&\n w.__forceSmoothScrollPolyfill__ !== true\n ) {\n return;\n }\n\n // globals\n var Element = w.HTMLElement || w.Element;\n var SCROLL_TIME = 468;\n\n // object gathering original scroll methods\n var original = {\n scroll: w.scroll || w.scrollTo,\n scrollBy: w.scrollBy,\n elementScroll: Element.prototype.scroll || scrollElement,\n scrollIntoView: Element.prototype.scrollIntoView\n };\n\n // define timing method\n var now =\n w.performance && w.performance.now\n ? w.performance.now.bind(w.performance)\n : Date.now;\n\n /**\n * indicates if a the current browser is made by Microsoft\n * @method isMicrosoftBrowser\n * @param {String} userAgent\n * @returns {Boolean}\n */\n function isMicrosoftBrowser(userAgent) {\n var userAgentPatterns = ['MSIE ', 'Trident/', 'Edge/'];\n\n return new RegExp(userAgentPatterns.join('|')).test(userAgent);\n }\n\n /*\n * IE has rounding bug rounding down clientHeight and clientWidth and\n * rounding up scrollHeight and scrollWidth causing false positives\n * on hasScrollableSpace\n */\n var ROUNDING_TOLERANCE = isMicrosoftBrowser(w.navigator.userAgent) ? 1 : 0;\n\n /**\n * changes scroll position inside an element\n * @method scrollElement\n * @param {Number} x\n * @param {Number} y\n * @returns {undefined}\n */\n function scrollElement(x, y) {\n this.scrollLeft = x;\n this.scrollTop = y;\n }\n\n /**\n * returns result of applying ease math function to a number\n * @method ease\n * @param {Number} k\n * @returns {Number}\n */\n function ease(k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n }\n\n /**\n * indicates if a smooth behavior should be applied\n * @method shouldBailOut\n * @param {Number|Object} firstArg\n * @returns {Boolean}\n */\n function shouldBailOut(firstArg) {\n if (\n firstArg === null ||\n typeof firstArg !== 'object' ||\n firstArg.behavior === undefined ||\n firstArg.behavior === 'auto' ||\n firstArg.behavior === 'instant'\n ) {\n // first argument is not an object/null\n // or behavior is auto, instant or undefined\n return true;\n }\n\n if (typeof firstArg === 'object' && firstArg.behavior === 'smooth') {\n // first argument is an object and behavior is smooth\n return false;\n }\n\n // throw error when behavior is not supported\n throw new TypeError(\n 'behavior member of ScrollOptions ' +\n firstArg.behavior +\n ' is not a valid value for enumeration ScrollBehavior.'\n );\n }\n\n /**\n * indicates if an element has scrollable space in the provided axis\n * @method hasScrollableSpace\n * @param {Node} el\n * @param {String} axis\n * @returns {Boolean}\n */\n function hasScrollableSpace(el, axis) {\n if (axis === 'Y') {\n return el.clientHeight + ROUNDING_TOLERANCE < el.scrollHeight;\n }\n\n if (axis === 'X') {\n return el.clientWidth + ROUNDING_TOLERANCE < el.scrollWidth;\n }\n }\n\n /**\n * indicates if an element has a scrollable overflow property in the axis\n * @method canOverflow\n * @param {Node} el\n * @param {String} axis\n * @returns {Boolean}\n */\n function canOverflow(el, axis) {\n var overflowValue = w.getComputedStyle(el, null)['overflow' + axis];\n\n return overflowValue === 'auto' || overflowValue === 'scroll';\n }\n\n /**\n * indicates if an element can be scrolled in either axis\n * @method isScrollable\n * @param {Node} el\n * @param {String} axis\n * @returns {Boolean}\n */\n function isScrollable(el) {\n var isScrollableY = hasScrollableSpace(el, 'Y') && canOverflow(el, 'Y');\n var isScrollableX = hasScrollableSpace(el, 'X') && canOverflow(el, 'X');\n\n return isScrollableY || isScrollableX;\n }\n\n /**\n * finds scrollable parent of an element\n * @method findScrollableParent\n * @param {Node} el\n * @returns {Node} el\n */\n function findScrollableParent(el) {\n while (el !== d.body && isScrollable(el) === false) {\n el = el.parentNode || el.host;\n }\n\n return el;\n }\n\n /**\n * self invoked function that, given a context, steps through scrolling\n * @method step\n * @param {Object} context\n * @returns {undefined}\n */\n function step(context) {\n var time = now();\n var value;\n var currentX;\n var currentY;\n var elapsed = (time - context.startTime) / SCROLL_TIME;\n\n // avoid elapsed times higher than one\n elapsed = elapsed > 1 ? 1 : elapsed;\n\n // apply easing to elapsed time\n value = ease(elapsed);\n\n currentX = context.startX + (context.x - context.startX) * value;\n currentY = context.startY + (context.y - context.startY) * value;\n\n context.method.call(context.scrollable, currentX, currentY);\n\n // scroll more if we have not reached our destination\n if (currentX !== context.x || currentY !== context.y) {\n w.requestAnimationFrame(step.bind(w, context));\n }\n }\n\n /**\n * scrolls window or element with a smooth behavior\n * @method smoothScroll\n * @param {Object|Node} el\n * @param {Number} x\n * @param {Number} y\n * @returns {undefined}\n */\n function smoothScroll(el, x, y) {\n var scrollable;\n var startX;\n var startY;\n var method;\n var startTime = now();\n\n // define scroll context\n if (el === d.body) {\n scrollable = w;\n startX = w.scrollX || w.pageXOffset;\n startY = w.scrollY || w.pageYOffset;\n method = original.scroll;\n } else {\n scrollable = el;\n startX = el.scrollLeft;\n startY = el.scrollTop;\n method = scrollElement;\n }\n\n // scroll looping over a frame\n step({\n scrollable: scrollable,\n method: method,\n startTime: startTime,\n startX: startX,\n startY: startY,\n x: x,\n y: y\n });\n }\n\n // ORIGINAL METHODS OVERRIDES\n // w.scroll and w.scrollTo\n w.scroll = w.scrollTo = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n original.scroll.call(\n w,\n arguments[0].left !== undefined\n ? arguments[0].left\n : typeof arguments[0] !== 'object'\n ? arguments[0]\n : w.scrollX || w.pageXOffset,\n // use top prop, second argument if present or fallback to scrollY\n arguments[0].top !== undefined\n ? arguments[0].top\n : arguments[1] !== undefined\n ? arguments[1]\n : w.scrollY || w.pageYOffset\n );\n\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n arguments[0].left !== undefined\n ? ~~arguments[0].left\n : w.scrollX || w.pageXOffset,\n arguments[0].top !== undefined\n ? ~~arguments[0].top\n : w.scrollY || w.pageYOffset\n );\n };\n\n // w.scrollBy\n w.scrollBy = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scrollBy.call(\n w,\n arguments[0].left !== undefined\n ? arguments[0].left\n : typeof arguments[0] !== 'object' ? arguments[0] : 0,\n arguments[0].top !== undefined\n ? arguments[0].top\n : arguments[1] !== undefined ? arguments[1] : 0\n );\n\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left + (w.scrollX || w.pageXOffset),\n ~~arguments[0].top + (w.scrollY || w.pageYOffset)\n );\n };\n\n // Element.prototype.scroll and Element.prototype.scrollTo\n Element.prototype.scroll = Element.prototype.scrollTo = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n // if one number is passed, throw error to match Firefox implementation\n if (typeof arguments[0] === 'number' && arguments[1] === undefined) {\n throw new SyntaxError('Value could not be converted');\n }\n\n original.elementScroll.call(\n this,\n // use left prop, first number argument or fallback to scrollLeft\n arguments[0].left !== undefined\n ? ~~arguments[0].left\n : typeof arguments[0] !== 'object' ? ~~arguments[0] : this.scrollLeft,\n // use top prop, second argument or fallback to scrollTop\n arguments[0].top !== undefined\n ? ~~arguments[0].top\n : arguments[1] !== undefined ? ~~arguments[1] : this.scrollTop\n );\n\n return;\n }\n\n var left = arguments[0].left;\n var top = arguments[0].top;\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n this,\n this,\n typeof left === 'undefined' ? this.scrollLeft : ~~left,\n typeof top === 'undefined' ? this.scrollTop : ~~top\n );\n };\n\n // Element.prototype.scrollBy\n Element.prototype.scrollBy = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n original.elementScroll.call(\n this,\n arguments[0].left !== undefined\n ? ~~arguments[0].left + this.scrollLeft\n : ~~arguments[0] + this.scrollLeft,\n arguments[0].top !== undefined\n ? ~~arguments[0].top + this.scrollTop\n : ~~arguments[1] + this.scrollTop\n );\n\n return;\n }\n\n this.scroll({\n left: ~~arguments[0].left + this.scrollLeft,\n top: ~~arguments[0].top + this.scrollTop,\n behavior: arguments[0].behavior\n });\n };\n\n // Element.prototype.scrollIntoView\n Element.prototype.scrollIntoView = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n original.scrollIntoView.call(\n this,\n arguments[0] === undefined ? true : arguments[0]\n );\n\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n var scrollableParent = findScrollableParent(this);\n var parentRects = scrollableParent.getBoundingClientRect();\n var clientRects = this.getBoundingClientRect();\n\n if (scrollableParent !== d.body) {\n // reveal element inside parent\n smoothScroll.call(\n this,\n scrollableParent,\n scrollableParent.scrollLeft + clientRects.left - parentRects.left,\n scrollableParent.scrollTop + clientRects.top - parentRects.top\n );\n\n // reveal parent in viewport unless is fixed\n if (w.getComputedStyle(scrollableParent).position !== 'fixed') {\n w.scrollBy({\n left: parentRects.left,\n top: parentRects.top,\n behavior: 'smooth'\n });\n }\n } else {\n // reveal element in viewport\n w.scrollBy({\n left: clientRects.left,\n top: clientRects.top,\n behavior: 'smooth'\n });\n }\n };\n }\n\n if (typeof exports === 'object' && typeof module !== 'undefined') {\n // commonjs\n module.exports = { polyfill: polyfill };\n } else {\n // global\n polyfill();\n }\n\n}());\n","/** @license React v0.19.1\n * scheduler.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 f,g,h,k,l;\nif(\"undefined\"===typeof window||\"function\"!==typeof MessageChannel){var p=null,q=null,t=function(){if(null!==p)try{var a=exports.unstable_now();p(!0,a);p=null}catch(b){throw setTimeout(t,0),b;}},u=Date.now();exports.unstable_now=function(){return Date.now()-u};f=function(a){null!==p?setTimeout(f,0,a):(p=a,setTimeout(t,0))};g=function(a,b){q=setTimeout(a,b)};h=function(){clearTimeout(q)};k=function(){return!1};l=exports.unstable_forceFrameRate=function(){}}else{var w=window.performance,x=window.Date,\ny=window.setTimeout,z=window.clearTimeout;if(\"undefined\"!==typeof console){var A=window.cancelAnimationFrame;\"function\"!==typeof window.requestAnimationFrame&&console.error(\"This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills\");\"function\"!==typeof A&&console.error(\"This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills\")}if(\"object\"===\ntypeof w&&\"function\"===typeof w.now)exports.unstable_now=function(){return w.now()};else{var B=x.now();exports.unstable_now=function(){return x.now()-B}}var C=!1,D=null,E=-1,F=5,G=0;k=function(){return exports.unstable_now()>=G};l=function(){};exports.unstable_forceFrameRate=function(a){0>a||125>>1,e=a[d];if(void 0!==e&&0K(n,c))void 0!==r&&0>K(r,n)?(a[d]=r,a[v]=c,d=v):(a[d]=n,a[m]=c,d=m);else if(void 0!==r&&0>K(r,c))a[d]=r,a[v]=c,d=v;else break a}}return b}return null}function K(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}var N=[],O=[],P=1,Q=null,R=3,S=!1,T=!1,U=!1;\nfunction V(a){for(var b=L(O);null!==b;){if(null===b.callback)M(O);else if(b.startTime<=a)M(O),b.sortIndex=b.expirationTime,J(N,b);else break;b=L(O)}}function W(a){U=!1;V(a);if(!T)if(null!==L(N))T=!0,f(X);else{var b=L(O);null!==b&&g(W,b.startTime-a)}}\nfunction X(a,b){T=!1;U&&(U=!1,h());S=!0;var c=R;try{V(b);for(Q=L(N);null!==Q&&(!(Q.expirationTime>b)||a&&!k());){var d=Q.callback;if(null!==d){Q.callback=null;R=Q.priorityLevel;var e=d(Q.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?Q.callback=e:Q===L(N)&&M(N);V(b)}else M(N);Q=L(N)}if(null!==Q)var m=!0;else{var n=L(O);null!==n&&g(W,n.startTime-b);m=!1}return m}finally{Q=null,R=c,S=!1}}\nfunction Y(a){switch(a){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1E4;default:return 5E3}}var Z=l;exports.unstable_IdlePriority=5;exports.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(){T||S||(T=!0,f(X))};\nexports.unstable_getCurrentPriorityLevel=function(){return R};exports.unstable_getFirstCallbackNode=function(){return L(N)};exports.unstable_next=function(a){switch(R){case 1:case 2:case 3:var b=3;break;default:b=R}var c=R;R=b;try{return a()}finally{R=c}};exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=Z;exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=R;R=a;try{return b()}finally{R=c}};\nexports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();if(\"object\"===typeof c&&null!==c){var e=c.delay;e=\"number\"===typeof e&&0d?(a.sortIndex=e,J(O,a),null===L(N)&&a===L(O)&&(U?h():U=!0,g(W,e-d))):(a.sortIndex=c,J(N,a),T||S||(T=!0,f(X)));return a};\nexports.unstable_shouldYield=function(){var a=exports.unstable_now();V(a);var b=L(N);return b!==Q&&null!==Q&&null!==b&&null!==b.callback&&b.startTime<=a&&b.expirationTimeb}return!1}function v(a,b,c,d,e,f){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}var C={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){C[a]=new v(a,0,!1,a,null,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];C[b]=new v(b,1,!1,a[1],null,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){C[a]=new v(a,2,!1,a.toLowerCase(),null,!1)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){C[a]=new v(a,2,!1,a,null,!1)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(a){C[a]=new v(a,3,!1,a.toLowerCase(),null,!1)});\n[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){C[a]=new v(a,3,!0,a,null,!1)});[\"capture\",\"download\"].forEach(function(a){C[a]=new v(a,4,!1,a,null,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){C[a]=new v(a,6,!1,a,null,!1)});[\"rowSpan\",\"start\"].forEach(function(a){C[a]=new v(a,5,!1,a.toLowerCase(),null,!1)});var Ua=/[\\-:]([a-z])/g;function Va(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(Ua,\nVa);C[b]=new v(b,1,!1,a,null,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(Ua,Va);C[b]=new v(b,1,!1,a,\"http://www.w3.org/1999/xlink\",!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(Ua,Va);C[b]=new v(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\",!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){C[a]=new v(a,1,!1,a.toLowerCase(),null,!1)});\nC.xlinkHref=new v(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(a){C[a]=new v(a,1,!1,a.toLowerCase(),null,!0)});var Wa=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Wa.hasOwnProperty(\"ReactCurrentDispatcher\")||(Wa.ReactCurrentDispatcher={current:null});Wa.hasOwnProperty(\"ReactCurrentBatchConfig\")||(Wa.ReactCurrentBatchConfig={suspense:null});\nfunction Xa(a,b,c,d){var e=C.hasOwnProperty(b)?C[b]:null;var f=null!==e?0===e.type:d?!1:!(2=c.length))throw Error(u(93));c=c[0]}b=c}null==b&&(b=\"\");c=b}a._wrapperState={initialValue:rb(c)}}\nfunction Kb(a,b){var c=rb(b.value),d=rb(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 Lb(a){var b=a.textContent;b===a._wrapperState.initialValue&&\"\"!==b&&null!==b&&(a.value=b)}var Mb={html:\"http://www.w3.org/1999/xhtml\",mathml:\"http://www.w3.org/1998/Math/MathML\",svg:\"http://www.w3.org/2000/svg\"};\nfunction Nb(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 Ob(a,b){return null==a||\"http://www.w3.org/1999/xhtml\"===a?Nb(b):\"http://www.w3.org/2000/svg\"===a&&\"foreignObject\"===b?\"http://www.w3.org/1999/xhtml\":a}\nvar Pb,Qb=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!==Mb.svg||\"innerHTML\"in a)a.innerHTML=b;else{Pb=Pb||document.createElement(\"div\");Pb.innerHTML=\"\"+b.valueOf().toString()+\"\";for(b=Pb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction Rb(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}function Sb(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c[\"Webkit\"+a]=\"webkit\"+b;c[\"Moz\"+a]=\"moz\"+b;return c}var Tb={animationend:Sb(\"Animation\",\"AnimationEnd\"),animationiteration:Sb(\"Animation\",\"AnimationIteration\"),animationstart:Sb(\"Animation\",\"AnimationStart\"),transitionend:Sb(\"Transition\",\"TransitionEnd\")},Ub={},Vb={};\nya&&(Vb=document.createElement(\"div\").style,\"AnimationEvent\"in window||(delete Tb.animationend.animation,delete Tb.animationiteration.animation,delete Tb.animationstart.animation),\"TransitionEvent\"in window||delete Tb.transitionend.transition);function Wb(a){if(Ub[a])return Ub[a];if(!Tb[a])return a;var b=Tb[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in Vb)return Ub[a]=b[c];return a}\nvar Xb=Wb(\"animationend\"),Yb=Wb(\"animationiteration\"),Zb=Wb(\"animationstart\"),$b=Wb(\"transitionend\"),ac=\"abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting\".split(\" \"),bc=new (\"function\"===typeof WeakMap?WeakMap:Map);function cc(a){var b=bc.get(a);void 0===b&&(b=new Map,bc.set(a,b));return b}\nfunction dc(a){var b=a,c=a;if(a.alternate)for(;b.return;)b=b.return;else{a=b;do b=a,0!==(b.effectTag&1026)&&(c=b.return),a=b.return;while(a)}return 3===b.tag?c:null}function ec(a){if(13===a.tag){var b=a.memoizedState;null===b&&(a=a.alternate,null!==a&&(b=a.memoizedState));if(null!==b)return b.dehydrated}return null}function fc(a){if(dc(a)!==a)throw Error(u(188));}\nfunction gc(a){var b=a.alternate;if(!b){b=dc(a);if(null===b)throw Error(u(188));return b!==a?null:a}for(var c=a,d=b;;){var e=c.return;if(null===e)break;var f=e.alternate;if(null===f){d=e.return;if(null!==d){c=d;continue}break}if(e.child===f.child){for(f=e.child;f;){if(f===c)return fc(e),a;if(f===d)return fc(e),b;f=f.sibling}throw Error(u(188));}if(c.return!==d.return)c=e,d=f;else{for(var g=!1,h=e.child;h;){if(h===c){g=!0;c=e;d=f;break}if(h===d){g=!0;d=e;c=f;break}h=h.sibling}if(!g){for(h=f.child;h;){if(h===\nc){g=!0;c=f;d=e;break}if(h===d){g=!0;d=f;c=e;break}h=h.sibling}if(!g)throw Error(u(189));}}if(c.alternate!==d)throw Error(u(190));}if(3!==c.tag)throw Error(u(188));return c.stateNode.current===c?a:b}function hc(a){a=gc(a);if(!a)return null;for(var b=a;;){if(5===b.tag||6===b.tag)return b;if(b.child)b.child.return=b,b=b.child;else{if(b===a)break;for(;!b.sibling;){if(!b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}}return null}\nfunction ic(a,b){if(null==b)throw Error(u(30));if(null==a)return b;if(Array.isArray(a)){if(Array.isArray(b))return a.push.apply(a,b),a;a.push(b);return a}return Array.isArray(b)?[a].concat(b):[a,b]}function jc(a,b,c){Array.isArray(a)?a.forEach(b,c):a&&b.call(c,a)}var kc=null;\nfunction lc(a){if(a){var b=a._dispatchListeners,c=a._dispatchInstances;if(Array.isArray(b))for(var d=0;dpc.length&&pc.push(a)}\nfunction rc(a,b,c,d){if(pc.length){var e=pc.pop();e.topLevelType=a;e.eventSystemFlags=d;e.nativeEvent=b;e.targetInst=c;return e}return{topLevelType:a,eventSystemFlags:d,nativeEvent:b,targetInst:c,ancestors:[]}}\nfunction sc(a){var b=a.targetInst,c=b;do{if(!c){a.ancestors.push(c);break}var d=c;if(3===d.tag)d=d.stateNode.containerInfo;else{for(;d.return;)d=d.return;d=3!==d.tag?null:d.stateNode.containerInfo}if(!d)break;b=c.tag;5!==b&&6!==b||a.ancestors.push(c);c=tc(d)}while(c);for(c=0;c=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=ud(c)}}\nfunction wd(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?wd(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}function xd(){for(var a=window,b=td();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=td(a.document)}return b}\nfunction yd(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)}var zd=\"$\",Ad=\"/$\",Bd=\"$?\",Cd=\"$!\",Dd=null,Ed=null;function Fd(a,b){switch(a){case \"button\":case \"input\":case \"select\":case \"textarea\":return!!b.autoFocus}return!1}\nfunction Gd(a,b){return\"textarea\"===a||\"option\"===a||\"noscript\"===a||\"string\"===typeof b.children||\"number\"===typeof b.children||\"object\"===typeof b.dangerouslySetInnerHTML&&null!==b.dangerouslySetInnerHTML&&null!=b.dangerouslySetInnerHTML.__html}var Hd=\"function\"===typeof setTimeout?setTimeout:void 0,Id=\"function\"===typeof clearTimeout?clearTimeout:void 0;function Jd(a){for(;null!=a;a=a.nextSibling){var b=a.nodeType;if(1===b||3===b)break}return a}\nfunction Kd(a){a=a.previousSibling;for(var b=0;a;){if(8===a.nodeType){var c=a.data;if(c===zd||c===Cd||c===Bd){if(0===b)return a;b--}else c===Ad&&b++}a=a.previousSibling}return null}var Ld=Math.random().toString(36).slice(2),Md=\"__reactInternalInstance$\"+Ld,Nd=\"__reactEventHandlers$\"+Ld,Od=\"__reactContainere$\"+Ld;\nfunction tc(a){var b=a[Md];if(b)return b;for(var c=a.parentNode;c;){if(b=c[Od]||c[Md]){c=b.alternate;if(null!==b.child||null!==c&&null!==c.child)for(a=Kd(a);null!==a;){if(c=a[Md])return c;a=Kd(a)}return b}a=c;c=a.parentNode}return null}function Nc(a){a=a[Md]||a[Od];return!a||5!==a.tag&&6!==a.tag&&13!==a.tag&&3!==a.tag?null:a}function Pd(a){if(5===a.tag||6===a.tag)return a.stateNode;throw Error(u(33));}function Qd(a){return a[Nd]||null}\nfunction Rd(a){do a=a.return;while(a&&5!==a.tag);return a?a:null}\nfunction Sd(a,b){var c=a.stateNode;if(!c)return null;var d=la(c);if(!d)return null;c=d[b];a:switch(b){case \"onClick\":case \"onClickCapture\":case \"onDoubleClick\":case \"onDoubleClickCapture\":case \"onMouseDown\":case \"onMouseDownCapture\":case \"onMouseMove\":case \"onMouseMoveCapture\":case \"onMouseUp\":case \"onMouseUpCapture\":case \"onMouseEnter\":(d=!d.disabled)||(a=a.type,d=!(\"button\"===a||\"input\"===a||\"select\"===a||\"textarea\"===a));a=!d;break a;default:a=!1}if(a)return null;if(c&&\"function\"!==typeof c)throw Error(u(231,\nb,typeof c));return c}function Td(a,b,c){if(b=Sd(a,c.dispatchConfig.phasedRegistrationNames[b]))c._dispatchListeners=ic(c._dispatchListeners,b),c._dispatchInstances=ic(c._dispatchInstances,a)}function Ud(a){if(a&&a.dispatchConfig.phasedRegistrationNames){for(var b=a._targetInst,c=[];b;)c.push(b),b=Rd(b);for(b=c.length;0this.eventPool.length&&this.eventPool.push(a)}function de(a){a.eventPool=[];a.getPooled=ee;a.release=fe}var ge=G.extend({data:null}),he=G.extend({data:null}),ie=[9,13,27,32],je=ya&&\"CompositionEvent\"in window,ke=null;ya&&\"documentMode\"in document&&(ke=document.documentMode);\nvar le=ya&&\"TextEvent\"in window&&!ke,me=ya&&(!je||ke&&8=ke),ne=String.fromCharCode(32),oe={beforeInput:{phasedRegistrationNames:{bubbled:\"onBeforeInput\",captured:\"onBeforeInputCapture\"},dependencies:[\"compositionend\",\"keypress\",\"textInput\",\"paste\"]},compositionEnd:{phasedRegistrationNames:{bubbled:\"onCompositionEnd\",captured:\"onCompositionEndCapture\"},dependencies:\"blur compositionend keydown keypress keyup mousedown\".split(\" \")},compositionStart:{phasedRegistrationNames:{bubbled:\"onCompositionStart\",\ncaptured:\"onCompositionStartCapture\"},dependencies:\"blur compositionstart keydown keypress keyup mousedown\".split(\" \")},compositionUpdate:{phasedRegistrationNames:{bubbled:\"onCompositionUpdate\",captured:\"onCompositionUpdateCapture\"},dependencies:\"blur compositionupdate keydown keypress keyup mousedown\".split(\" \")}},pe=!1;\nfunction qe(a,b){switch(a){case \"keyup\":return-1!==ie.indexOf(b.keyCode);case \"keydown\":return 229!==b.keyCode;case \"keypress\":case \"mousedown\":case \"blur\":return!0;default:return!1}}function re(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}var se=!1;function te(a,b){switch(a){case \"compositionend\":return re(b);case \"keypress\":if(32!==b.which)return null;pe=!0;return ne;case \"textInput\":return a=b.data,a===ne&&pe?null:a;default:return null}}\nfunction ue(a,b){if(se)return\"compositionend\"===a||!je&&qe(a,b)?(a=ae(),$d=Zd=Yd=null,se=!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=document.documentMode,df={select:{phasedRegistrationNames:{bubbled:\"onSelect\",captured:\"onSelectCapture\"},dependencies:\"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange\".split(\" \")}},ef=null,ff=null,gf=null,hf=!1;\nfunction jf(a,b){var c=b.window===b?b.document:9===b.nodeType?b:b.ownerDocument;if(hf||null==ef||ef!==td(c))return null;c=ef;\"selectionStart\"in c&&yd(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset});return gf&&bf(gf,c)?null:(gf=c,a=G.getPooled(df.select,ff,a,b),a.type=\"select\",a.target=ef,Xd(a),a)}\nvar kf={eventTypes:df,extractEvents:function(a,b,c,d,e,f){e=f||(d.window===d?d.document:9===d.nodeType?d:d.ownerDocument);if(!(f=!e)){a:{e=cc(e);f=wa.onSelect;for(var g=0;gzf||(a.current=yf[zf],yf[zf]=null,zf--)}\nfunction I(a,b){zf++;yf[zf]=a.current;a.current=b}var Af={},J={current:Af},K={current:!1},Bf=Af;function Cf(a,b){var c=a.type.contextTypes;if(!c)return Af;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 L(a){a=a.childContextTypes;return null!==a&&void 0!==a}\nfunction Df(){H(K);H(J)}function Ef(a,b,c){if(J.current!==Af)throw Error(u(168));I(J,b);I(K,c)}function Ff(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(u(108,pb(b)||\"Unknown\",e));return n({},c,{},d)}function Gf(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Af;Bf=J.current;I(J,a);I(K,K.current);return!0}\nfunction Hf(a,b,c){var d=a.stateNode;if(!d)throw Error(u(169));c?(a=Ff(a,b,Bf),d.__reactInternalMemoizedMergedChildContext=a,H(K),H(J),I(J,a)):H(K);I(K,c)}\nvar If=r.unstable_runWithPriority,Jf=r.unstable_scheduleCallback,Kf=r.unstable_cancelCallback,Lf=r.unstable_requestPaint,Mf=r.unstable_now,Nf=r.unstable_getCurrentPriorityLevel,Of=r.unstable_ImmediatePriority,Pf=r.unstable_UserBlockingPriority,Qf=r.unstable_NormalPriority,Rf=r.unstable_LowPriority,Sf=r.unstable_IdlePriority,Tf={},Uf=r.unstable_shouldYield,Vf=void 0!==Lf?Lf:function(){},Wf=null,Xf=null,Yf=!1,Zf=Mf(),$f=1E4>Zf?Mf:function(){return Mf()-Zf};\nfunction ag(){switch(Nf()){case Of:return 99;case Pf:return 98;case Qf:return 97;case Rf:return 96;case Sf:return 95;default:throw Error(u(332));}}function bg(a){switch(a){case 99:return Of;case 98:return Pf;case 97:return Qf;case 96:return Rf;case 95:return Sf;default:throw Error(u(332));}}function cg(a,b){a=bg(a);return If(a,b)}function dg(a,b,c){a=bg(a);return Jf(a,b,c)}function eg(a){null===Wf?(Wf=[a],Xf=Jf(Of,fg)):Wf.push(a);return Tf}function gg(){if(null!==Xf){var a=Xf;Xf=null;Kf(a)}fg()}\nfunction fg(){if(!Yf&&null!==Wf){Yf=!0;var a=0;try{var b=Wf;cg(99,function(){for(;a=b&&(rg=!0),a.firstContext=null)}\nfunction sg(a,b){if(mg!==a&&!1!==b&&0!==b){if(\"number\"!==typeof b||1073741823===b)mg=a,b=1073741823;b={context:a,observedBits:b,next:null};if(null===lg){if(null===kg)throw Error(u(308));lg=b;kg.dependencies={expirationTime:0,firstContext:b,responders:null}}else lg=lg.next=b}return a._currentValue}var tg=!1;function ug(a){a.updateQueue={baseState:a.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}\nfunction vg(a,b){a=a.updateQueue;b.updateQueue===a&&(b.updateQueue={baseState:a.baseState,baseQueue:a.baseQueue,shared:a.shared,effects:a.effects})}function wg(a,b){a={expirationTime:a,suspenseConfig:b,tag:0,payload:null,callback:null,next:null};return a.next=a}function xg(a,b){a=a.updateQueue;if(null!==a){a=a.shared;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}}\nfunction yg(a,b){var c=a.alternate;null!==c&&vg(c,a);a=a.updateQueue;c=a.baseQueue;null===c?(a.baseQueue=b.next=b,b.next=b):(b.next=c.next,c.next=b)}\nfunction zg(a,b,c,d){var e=a.updateQueue;tg=!1;var f=e.baseQueue,g=e.shared.pending;if(null!==g){if(null!==f){var h=f.next;f.next=g.next;g.next=h}f=g;e.shared.pending=null;h=a.alternate;null!==h&&(h=h.updateQueue,null!==h&&(h.baseQueue=g))}if(null!==f){h=f.next;var k=e.baseState,l=0,m=null,p=null,x=null;if(null!==h){var z=h;do{g=z.expirationTime;if(gl&&(l=g)}else{null!==x&&(x=x.next={expirationTime:1073741823,suspenseConfig:z.suspenseConfig,tag:z.tag,payload:z.payload,callback:z.callback,next:null});Ag(g,z.suspenseConfig);a:{var D=a,t=z;g=b;ca=c;switch(t.tag){case 1:D=t.payload;if(\"function\"===typeof D){k=D.call(ca,k,g);break a}k=D;break a;case 3:D.effectTag=D.effectTag&-4097|64;case 0:D=t.payload;g=\"function\"===typeof D?D.call(ca,k,g):D;if(null===g||void 0===g)break a;k=n({},k,g);break a;case 2:tg=!0}}null!==z.callback&&\n(a.effectTag|=32,g=e.effects,null===g?e.effects=[z]:g.push(z))}z=z.next;if(null===z||z===h)if(g=e.shared.pending,null===g)break;else z=f.next=g.next,g.next=h,e.baseQueue=f=g,e.shared.pending=null}while(1)}null===x?m=k:x.next=p;e.baseState=m;e.baseQueue=x;Bg(l);a.expirationTime=l;a.memoizedState=k}}\nfunction Cg(a,b,c){a=b.effects;b.effects=null;if(null!==a)for(b=0;by?(A=m,m=null):A=m.sibling;var q=x(e,m,h[y],k);if(null===q){null===m&&(m=A);break}a&&\nm&&null===q.alternate&&b(e,m);g=f(q,g,y);null===t?l=q:t.sibling=q;t=q;m=A}if(y===h.length)return c(e,m),l;if(null===m){for(;yy?(A=t,t=null):A=t.sibling;var D=x(e,t,q.value,l);if(null===D){null===t&&(t=A);break}a&&t&&null===D.alternate&&b(e,t);g=f(D,g,y);null===m?k=D:m.sibling=D;m=D;t=A}if(q.done)return c(e,t),k;if(null===t){for(;!q.done;y++,q=h.next())q=p(e,q.value,l),null!==q&&(g=f(q,g,y),null===m?k=q:m.sibling=q,m=q);return k}for(t=d(e,t);!q.done;y++,q=h.next())q=z(t,e,y,q.value,l),null!==q&&(a&&null!==\nq.alternate&&t.delete(null===q.key?y:q.key),g=f(q,g,y),null===m?k=q:m.sibling=q,m=q);a&&t.forEach(function(a){return b(e,a)});return k}return function(a,d,f,h){var k=\"object\"===typeof f&&null!==f&&f.type===ab&&null===f.key;k&&(f=f.props.children);var l=\"object\"===typeof f&&null!==f;if(l)switch(f.$$typeof){case Za:a:{l=f.key;for(k=d;null!==k;){if(k.key===l){switch(k.tag){case 7:if(f.type===ab){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,\nk.sibling);d=e(k,f.props);d.ref=Pg(a,k,f);d.return=a;a=d;break a}}c(a,k);break}else b(a,k);k=k.sibling}f.type===ab?(d=Wg(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Ug(f.type,f.key,f.props,null,a.mode,h),h.ref=Pg(a,d,f),h.return=a,a=h)}return g(a);case $a: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=\nd.sibling}d=Vg(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=Tg(f,a.mode,h),d.return=a,a=d),g(a);if(Og(f))return ca(a,d,f,h);if(nb(f))return D(a,d,f,h);l&&Qg(a,f);if(\"undefined\"===typeof f&&!k)switch(a.tag){case 1:case 0:throw a=a.type,Error(u(152,a.displayName||a.name||\"Component\"));}return c(a,d)}}var Xg=Rg(!0),Yg=Rg(!1),Zg={},$g={current:Zg},ah={current:Zg},bh={current:Zg};\nfunction ch(a){if(a===Zg)throw Error(u(174));return a}function dh(a,b){I(bh,b);I(ah,a);I($g,Zg);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:Ob(null,\"\");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=Ob(b,a)}H($g);I($g,b)}function eh(){H($g);H(ah);H(bh)}function fh(a){ch(bh.current);var b=ch($g.current);var c=Ob(b,a.type);b!==c&&(I(ah,a),I($g,c))}function gh(a){ah.current===a&&(H($g),H(ah))}var M={current:0};\nfunction hh(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===Bd||c.data===Cd))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.effectTag&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}function ih(a,b){return{responder:a,props:b}}\nvar jh=Wa.ReactCurrentDispatcher,kh=Wa.ReactCurrentBatchConfig,lh=0,N=null,O=null,P=null,mh=!1;function Q(){throw Error(u(321));}function nh(a,b){if(null===b)return!1;for(var c=0;cf))throw Error(u(301));f+=1;P=O=null;b.updateQueue=null;jh.current=rh;a=c(d,e)}while(b.expirationTime===lh)}jh.current=sh;b=null!==O&&null!==O.next;lh=0;P=O=N=null;mh=!1;if(b)throw Error(u(300));return a}\nfunction th(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};null===P?N.memoizedState=P=a:P=P.next=a;return P}function uh(){if(null===O){var a=N.alternate;a=null!==a?a.memoizedState:null}else a=O.next;var b=null===P?N.memoizedState:P.next;if(null!==b)P=b,O=a;else{if(null===a)throw Error(u(310));O=a;a={memoizedState:O.memoizedState,baseState:O.baseState,baseQueue:O.baseQueue,queue:O.queue,next:null};null===P?N.memoizedState=P=a:P=P.next=a}return P}\nfunction vh(a,b){return\"function\"===typeof b?b(a):b}\nfunction wh(a){var b=uh(),c=b.queue;if(null===c)throw Error(u(311));c.lastRenderedReducer=a;var d=O,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.expirationTime;if(lN.expirationTime&&\n(N.expirationTime=l,Bg(l))}else null!==h&&(h=h.next={expirationTime:1073741823,suspenseConfig:k.suspenseConfig,action:k.action,eagerReducer:k.eagerReducer,eagerState:k.eagerState,next:null}),Ag(l,k.suspenseConfig),d=k.eagerReducer===a?k.eagerState:a(d,k.action);k=k.next}while(null!==k&&k!==e);null===h?f=d:h.next=g;$e(d,b.memoizedState)||(rg=!0);b.memoizedState=d;b.baseState=f;b.baseQueue=h;c.lastRenderedState=d}return[b.memoizedState,c.dispatch]}\nfunction xh(a){var b=uh(),c=b.queue;if(null===c)throw Error(u(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);$e(f,b.memoizedState)||(rg=!0);b.memoizedState=f;null===b.baseQueue&&(b.baseState=f);c.lastRenderedState=f}return[f,d]}\nfunction yh(a){var b=th();\"function\"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a=b.queue={pending:null,dispatch:null,lastRenderedReducer:vh,lastRenderedState:a};a=a.dispatch=zh.bind(null,N,a);return[b.memoizedState,a]}function Ah(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};b=N.updateQueue;null===b?(b={lastEffect:null},N.updateQueue=b,b.lastEffect=a.next=a):(c=b.lastEffect,null===c?b.lastEffect=a.next=a:(d=c.next,c.next=a,a.next=d,b.lastEffect=a));return a}\nfunction Bh(){return uh().memoizedState}function Ch(a,b,c,d){var e=th();N.effectTag|=a;e.memoizedState=Ah(1|b,c,void 0,void 0===d?null:d)}function Dh(a,b,c,d){var e=uh();d=void 0===d?null:d;var f=void 0;if(null!==O){var g=O.memoizedState;f=g.destroy;if(null!==d&&nh(d,g.deps)){Ah(b,c,f,d);return}}N.effectTag|=a;e.memoizedState=Ah(1|b,c,f,d)}function Eh(a,b){return Ch(516,4,a,b)}function Fh(a,b){return Dh(516,4,a,b)}function Gh(a,b){return Dh(4,2,a,b)}\nfunction Hh(a,b){if(\"function\"===typeof b)return a=a(),b(a),function(){b(null)};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null}}function Ih(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Dh(4,2,Hh.bind(null,b,a),c)}function Jh(){}function Kh(a,b){th().memoizedState=[a,void 0===b?null:b];return a}function Lh(a,b){var c=uh();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&nh(b,d[1]))return d[0];c.memoizedState=[a,b];return a}\nfunction Mh(a,b){var c=uh();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&nh(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a}function Nh(a,b,c){var d=ag();cg(98>d?98:d,function(){a(!0)});cg(97\\x3c/script>\",a=a.removeChild(a.firstChild)):\"string\"===typeof d.is?a=g.createElement(e,{is:d.is}):(a=g.createElement(e),\"select\"===e&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,e);a[Md]=b;a[Nd]=d;ni(a,b,!1,!1);b.stateNode=a;g=pd(e,d);switch(e){case \"iframe\":case \"object\":case \"embed\":F(\"load\",\na);h=d;break;case \"video\":case \"audio\":for(h=0;hd.tailExpiration&&1b)&&tj.set(a,b)))}}\nfunction xj(a,b){a.expirationTimea?c:a;return 2>=a&&b!==a?0:a}\nfunction Z(a){if(0!==a.lastExpiredTime)a.callbackExpirationTime=1073741823,a.callbackPriority=99,a.callbackNode=eg(yj.bind(null,a));else{var b=zj(a),c=a.callbackNode;if(0===b)null!==c&&(a.callbackNode=null,a.callbackExpirationTime=0,a.callbackPriority=90);else{var d=Gg();1073741823===b?d=99:1===b||2===b?d=95:(d=10*(1073741821-b)-10*(1073741821-d),d=0>=d?99:250>=d?98:5250>=d?97:95);if(null!==c){var e=a.callbackPriority;if(a.callbackExpirationTime===b&&e>=d)return;c!==Tf&&Kf(c)}a.callbackExpirationTime=\nb;a.callbackPriority=d;b=1073741823===b?eg(yj.bind(null,a)):dg(d,Bj.bind(null,a),{timeout:10*(1073741821-b)-$f()});a.callbackNode=b}}}\nfunction Bj(a,b){wj=0;if(b)return b=Gg(),Cj(a,b),Z(a),null;var c=zj(a);if(0!==c){b=a.callbackNode;if((W&(fj|gj))!==V)throw Error(u(327));Dj();a===T&&c===U||Ej(a,c);if(null!==X){var d=W;W|=fj;var e=Fj();do try{Gj();break}catch(h){Hj(a,h)}while(1);ng();W=d;cj.current=e;if(S===hj)throw b=kj,Ej(a,c),xi(a,c),Z(a),b;if(null===X)switch(e=a.finishedWork=a.current.alternate,a.finishedExpirationTime=c,d=S,T=null,d){case ti:case hj:throw Error(u(345));case ij:Cj(a,2=c){a.lastPingedTime=c;Ej(a,c);break}}f=zj(a);if(0!==f&&f!==c)break;if(0!==d&&d!==c){a.lastPingedTime=d;break}a.timeoutHandle=Hd(Jj.bind(null,a),e);break}Jj(a);break;case vi:xi(a,c);d=a.lastSuspendedTime;c===d&&(a.nextKnownPendingLevel=Ij(e));if(oj&&(e=a.lastPingedTime,0===e||e>=c)){a.lastPingedTime=c;Ej(a,c);break}e=zj(a);if(0!==e&&e!==c)break;if(0!==d&&d!==c){a.lastPingedTime=\nd;break}1073741823!==mj?d=10*(1073741821-mj)-$f():1073741823===lj?d=0:(d=10*(1073741821-lj)-5E3,e=$f(),c=10*(1073741821-c)-e,d=e-d,0>d&&(d=0),d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*bj(d/1960))-d,c=d?d=0:(e=g.busyDelayMs|0,f=$f()-(10*(1073741821-f)-(g.timeoutMs|0||5E3)),d=f<=e?0:e+d-f);if(10 component higher in the tree to provide a loading indicator or placeholder to display.\"+qb(g))}S!==\njj&&(S=ij);h=Ai(h,g);p=f;do{switch(p.tag){case 3:k=h;p.effectTag|=4096;p.expirationTime=b;var B=Xi(p,k,b);yg(p,B);break a;case 1:k=h;var w=p.type,ub=p.stateNode;if(0===(p.effectTag&64)&&(\"function\"===typeof w.getDerivedStateFromError||null!==ub&&\"function\"===typeof ub.componentDidCatch&&(null===aj||!aj.has(ub)))){p.effectTag|=4096;p.expirationTime=b;var vb=$i(p,k,b);yg(p,vb);break a}}p=p.return}while(null!==p)}X=Pj(X)}catch(Xc){b=Xc;continue}break}while(1)}\nfunction Fj(){var a=cj.current;cj.current=sh;return null===a?sh:a}function Ag(a,b){awi&&(wi=a)}function Kj(){for(;null!==X;)X=Qj(X)}function Gj(){for(;null!==X&&!Uf();)X=Qj(X)}function Qj(a){var b=Rj(a.alternate,a,U);a.memoizedProps=a.pendingProps;null===b&&(b=Pj(a));dj.current=null;return b}\nfunction Pj(a){X=a;do{var b=X.alternate;a=X.return;if(0===(X.effectTag&2048)){b=si(b,X,U);if(1===U||1!==X.childExpirationTime){for(var c=0,d=X.child;null!==d;){var e=d.expirationTime,f=d.childExpirationTime;e>c&&(c=e);f>c&&(c=f);d=d.sibling}X.childExpirationTime=c}if(null!==b)return b;null!==a&&0===(a.effectTag&2048)&&(null===a.firstEffect&&(a.firstEffect=X.firstEffect),null!==X.lastEffect&&(null!==a.lastEffect&&(a.lastEffect.nextEffect=X.firstEffect),a.lastEffect=X.lastEffect),1a?b:a}function Jj(a){var b=ag();cg(99,Sj.bind(null,a,b));return null}\nfunction Sj(a,b){do Dj();while(null!==rj);if((W&(fj|gj))!==V)throw Error(u(327));var c=a.finishedWork,d=a.finishedExpirationTime;if(null===c)return null;a.finishedWork=null;a.finishedExpirationTime=0;if(c===a.current)throw Error(u(177));a.callbackNode=null;a.callbackExpirationTime=0;a.callbackPriority=90;a.nextKnownPendingLevel=0;var e=Ij(c);a.firstPendingTime=e;d<=a.lastSuspendedTime?a.firstSuspendedTime=a.lastSuspendedTime=a.nextKnownPendingLevel=0:d<=a.firstSuspendedTime&&(a.firstSuspendedTime=\nd-1);d<=a.lastPingedTime&&(a.lastPingedTime=0);d<=a.lastExpiredTime&&(a.lastExpiredTime=0);a===T&&(X=T=null,U=0);1h&&(l=h,h=g,g=l),l=vd(q,g),m=vd(q,h),l&&m&&(1!==w.rangeCount||w.anchorNode!==l.node||w.anchorOffset!==l.offset||w.focusNode!==m.node||w.focusOffset!==m.offset)&&(B=B.createRange(),B.setStart(l.node,l.offset),w.removeAllRanges(),g>h?(w.addRange(B),w.extend(m.node,m.offset)):(B.setEnd(m.node,m.offset),w.addRange(B))))));B=[];for(w=q;w=w.parentNode;)1===w.nodeType&&B.push({element:w,left:w.scrollLeft,\ntop:w.scrollTop});\"function\"===typeof q.focus&&q.focus();for(q=0;q=c)return ji(a,b,c);I(M,M.current&1);b=$h(a,b,c);return null!==b?b.sibling:null}I(M,M.current&1);break;case 19:d=b.childExpirationTime>=c;if(0!==(a.effectTag&64)){if(d)return mi(a,b,c);b.effectTag|=64}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null);I(M,M.current);if(!d)return null}return $h(a,b,c)}rg=!1}}else rg=!1;b.expirationTime=0;switch(b.tag){case 2:d=b.type;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);a=b.pendingProps;e=Cf(b,J.current);qg(b,c);e=oh(null,\nb,d,a,e,c);b.effectTag|=1;if(\"object\"===typeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof){b.tag=1;b.memoizedState=null;b.updateQueue=null;if(L(d)){var f=!0;Gf(b)}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;ug(b);var g=d.getDerivedStateFromProps;\"function\"===typeof g&&Fg(b,d,g,a);e.updater=Jg;b.stateNode=e;e._reactInternalFiber=b;Ng(b,d,a,c);b=gi(null,b,d,!0,f,c)}else b.tag=0,R(null,b,e,c),b=b.child;return b;case 16:a:{e=b.elementType;null!==a&&(a.alternate=\nnull,b.alternate=null,b.effectTag|=2);a=b.pendingProps;ob(e);if(1!==e._status)throw e._result;e=e._result;b.type=e;f=b.tag=Xj(e);a=ig(e,a);switch(f){case 0:b=di(null,b,e,a,c);break a;case 1:b=fi(null,b,e,a,c);break a;case 11:b=Zh(null,b,e,a,c);break a;case 14:b=ai(null,b,e,ig(e.type,a),d,c);break a}throw Error(u(306,e,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:ig(d,e),di(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:ig(d,e),fi(a,b,d,e,c);\ncase 3:hi(b);d=b.updateQueue;if(null===a||null===d)throw Error(u(282));d=b.pendingProps;e=b.memoizedState;e=null!==e?e.element:null;vg(a,b);zg(b,d,null,c);d=b.memoizedState.element;if(d===e)Xh(),b=$h(a,b,c);else{if(e=b.stateNode.hydrate)Ph=Jd(b.stateNode.containerInfo.firstChild),Oh=b,e=Qh=!0;if(e)for(c=Yg(b,null,d,c),b.child=c;c;)c.effectTag=c.effectTag&-3|1024,c=c.sibling;else R(a,b,d,c),Xh();b=b.child}return b;case 5:return fh(b),null===a&&Uh(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:\nnull,g=e.children,Gd(d,e)?g=null:null!==f&&Gd(d,f)&&(b.effectTag|=16),ei(a,b),b.mode&4&&1!==c&&e.hidden?(b.expirationTime=b.childExpirationTime=1,b=null):(R(a,b,g,c),b=b.child),b;case 6:return null===a&&Uh(b),null;case 13:return ji(a,b,c);case 4:return dh(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Xg(b,null,d,c):R(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:ig(d,e),Zh(a,b,d,e,c);case 7:return R(a,b,b.pendingProps,c),b.child;case 8:return R(a,\nb,b.pendingProps.children,c),b.child;case 12:return R(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;g=b.memoizedProps;f=e.value;var h=b.type._context;I(jg,h._currentValue);h._currentValue=f;if(null!==g)if(h=g.value,f=$e(h,f)?0:(\"function\"===typeof d._calculateChangedBits?d._calculateChangedBits(h,f):1073741823)|0,0===f){if(g.children===e.children&&!K.current){b=$h(a,b,c);break a}}else for(h=b.child,null!==h&&(h.return=b);null!==h;){var k=h.dependencies;if(null!==\nk){g=h.child;for(var l=k.firstContext;null!==l;){if(l.context===d&&0!==(l.observedBits&f)){1===h.tag&&(l=wg(c,null),l.tag=2,xg(h,l));h.expirationTime=b&&a<=b}function xi(a,b){var c=a.firstSuspendedTime,d=a.lastSuspendedTime;cb||0===c)a.lastSuspendedTime=b;b<=a.lastPingedTime&&(a.lastPingedTime=0);b<=a.lastExpiredTime&&(a.lastExpiredTime=0)}\nfunction yi(a,b){b>a.firstPendingTime&&(a.firstPendingTime=b);var c=a.firstSuspendedTime;0!==c&&(b>=c?a.firstSuspendedTime=a.lastSuspendedTime=a.nextKnownPendingLevel=0:b>=a.lastSuspendedTime&&(a.lastSuspendedTime=b+1),b>a.nextKnownPendingLevel&&(a.nextKnownPendingLevel=b))}function Cj(a,b){var c=a.lastExpiredTime;if(0===c||c>b)a.lastExpiredTime=b}\nfunction bk(a,b,c,d){var e=b.current,f=Gg(),g=Dg.suspense;f=Hg(f,e,g);a:if(c){c=c._reactInternalFiber;b:{if(dc(c)!==c||1!==c.tag)throw Error(u(170));var h=c;do{switch(h.tag){case 3:h=h.stateNode.context;break b;case 1:if(L(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break b}}h=h.return}while(null!==h);throw Error(u(171));}if(1===c.tag){var k=c.type;if(L(k)){c=Ff(c,k,h);break a}}c=h}else c=Af;null===b.context?b.context=c:b.pendingContext=c;b=wg(f,g);b.payload={element:a};d=void 0===\nd?null:d;null!==d&&(b.callback=d);xg(e,b);Ig(e,f);return f}function ck(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function dk(a,b){a=a.memoizedState;null!==a&&null!==a.dehydrated&&a.retryTime= 0) continue;\n target[key] = source[key];\n }\n return target;\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","'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","/** @license React v17.0.2\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var b=60103,c=60106,d=60107,e=60108,f=60114,g=60109,h=60110,k=60112,l=60113,m=60120,n=60115,p=60116,q=60121,r=60122,u=60117,v=60129,w=60131;\nif(\"function\"===typeof Symbol&&Symbol.for){var x=Symbol.for;b=x(\"react.element\");c=x(\"react.portal\");d=x(\"react.fragment\");e=x(\"react.strict_mode\");f=x(\"react.profiler\");g=x(\"react.provider\");h=x(\"react.context\");k=x(\"react.forward_ref\");l=x(\"react.suspense\");m=x(\"react.suspense_list\");n=x(\"react.memo\");p=x(\"react.lazy\");q=x(\"react.block\");r=x(\"react.server.block\");u=x(\"react.fundamental\");v=x(\"react.debug_trace_mode\");w=x(\"react.legacy_hidden\")}\nfunction y(a){if(\"object\"===typeof a&&null!==a){var t=a.$$typeof;switch(t){case b:switch(a=a.type,a){case d:case f:case e:case l:case m:return a;default:switch(a=a&&a.$$typeof,a){case h:case k:case p:case n:case g:return a;default:return t}}case c:return t}}}var z=g,A=b,B=k,C=d,D=p,E=n,F=c,G=f,H=e,I=l;exports.ContextConsumer=h;exports.ContextProvider=z;exports.Element=A;exports.ForwardRef=B;exports.Fragment=C;exports.Lazy=D;exports.Memo=E;exports.Portal=F;exports.Profiler=G;exports.StrictMode=H;\nexports.Suspense=I;exports.isAsyncMode=function(){return!1};exports.isConcurrentMode=function(){return!1};exports.isContextConsumer=function(a){return y(a)===h};exports.isContextProvider=function(a){return y(a)===g};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===b};exports.isForwardRef=function(a){return y(a)===k};exports.isFragment=function(a){return y(a)===d};exports.isLazy=function(a){return y(a)===p};exports.isMemo=function(a){return y(a)===n};\nexports.isPortal=function(a){return y(a)===c};exports.isProfiler=function(a){return y(a)===f};exports.isStrictMode=function(a){return y(a)===e};exports.isSuspense=function(a){return y(a)===l};exports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===d||a===f||a===v||a===e||a===l||a===m||a===w||\"object\"===typeof a&&null!==a&&(a.$$typeof===p||a.$$typeof===n||a.$$typeof===g||a.$$typeof===h||a.$$typeof===k||a.$$typeof===u||a.$$typeof===q||a[0]===r)?!0:!1};\nexports.typeOf=y;\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","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nvar _excluded = [\"getDisplayName\", \"methodName\", \"renderCountProp\", \"shouldHandleStateChanges\", \"storeKey\", \"withRef\", \"forwardRef\", \"context\"],\n _excluded2 = [\"reactReduxForwardedRef\"];\nimport hoistStatics from 'hoist-non-react-statics';\nimport React, { useContext, useMemo, useRef, useReducer } from 'react';\nimport { isValidElementType, isContextConsumer } from 'react-is';\nimport { createSubscription } from '../utils/Subscription';\nimport { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect';\nimport { ReactReduxContext } from './Context'; // Define some constant arrays just to avoid re-creating these\n\nvar EMPTY_ARRAY = [];\nvar NO_SUBSCRIPTION_ARRAY = [null, null];\n\nvar stringifyComponent = function stringifyComponent(Comp) {\n try {\n return JSON.stringify(Comp);\n } catch (err) {\n return String(Comp);\n }\n};\n\nfunction storeStateUpdatesReducer(state, action) {\n var updateCount = state[1];\n return [action.payload, updateCount + 1];\n}\n\nfunction useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) {\n useIsomorphicLayoutEffect(function () {\n return effectFunc.apply(void 0, effectArgs);\n }, dependencies);\n}\n\nfunction captureWrapperProps(lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, actualChildProps, childPropsFromStoreUpdate, notifyNestedSubs) {\n // We want to capture the wrapper props and child props we used for later comparisons\n lastWrapperProps.current = wrapperProps;\n lastChildProps.current = actualChildProps;\n renderIsScheduled.current = false; // If the render was from a store update, clear out that reference and cascade the subscriber update\n\n if (childPropsFromStoreUpdate.current) {\n childPropsFromStoreUpdate.current = null;\n notifyNestedSubs();\n }\n}\n\nfunction subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, childPropsFromStoreUpdate, notifyNestedSubs, forceComponentUpdateDispatch) {\n // If we're not subscribed to the store, nothing to do here\n if (!shouldHandleStateChanges) return; // Capture values for checking if and when this component unmounts\n\n var didUnsubscribe = false;\n var lastThrownError = null; // We'll run this callback every time a store subscription update propagates to this component\n\n var checkForUpdates = function checkForUpdates() {\n if (didUnsubscribe) {\n // Don't run stale listeners.\n // Redux doesn't guarantee unsubscriptions happen until next dispatch.\n return;\n }\n\n var latestStoreState = store.getState();\n var newChildProps, error;\n\n try {\n // Actually run the selector with the most recent store state and wrapper props\n // to determine what the child props should be\n newChildProps = childPropsSelector(latestStoreState, lastWrapperProps.current);\n } catch (e) {\n error = e;\n lastThrownError = e;\n }\n\n if (!error) {\n lastThrownError = null;\n } // If the child props haven't changed, nothing to do here - cascade the subscription update\n\n\n if (newChildProps === lastChildProps.current) {\n if (!renderIsScheduled.current) {\n notifyNestedSubs();\n }\n } else {\n // Save references to the new child props. Note that we track the \"child props from store update\"\n // as a ref instead of a useState/useReducer because we need a way to determine if that value has\n // been processed. If this went into useState/useReducer, we couldn't clear out the value without\n // forcing another re-render, which we don't want.\n lastChildProps.current = newChildProps;\n childPropsFromStoreUpdate.current = newChildProps;\n renderIsScheduled.current = true; // If the child props _did_ change (or we caught an error), this wrapper component needs to re-render\n\n forceComponentUpdateDispatch({\n type: 'STORE_UPDATED',\n payload: {\n error: error\n }\n });\n }\n }; // Actually subscribe to the nearest connected ancestor (or store)\n\n\n subscription.onStateChange = checkForUpdates;\n subscription.trySubscribe(); // Pull data from the store after first render in case the store has\n // changed since we began.\n\n checkForUpdates();\n\n var unsubscribeWrapper = function unsubscribeWrapper() {\n didUnsubscribe = true;\n subscription.tryUnsubscribe();\n subscription.onStateChange = null;\n\n if (lastThrownError) {\n // It's possible that we caught an error due to a bad mapState function, but the\n // parent re-rendered without this component and we're about to unmount.\n // This shouldn't happen as long as we do top-down subscriptions correctly, but\n // if we ever do those wrong, this throw will surface the error in our tests.\n // In that case, throw the error from here so it doesn't get lost.\n throw lastThrownError;\n }\n };\n\n return unsubscribeWrapper;\n}\n\nvar initStateUpdates = function initStateUpdates() {\n return [null, 0];\n};\n\nexport default function connectAdvanced(\n/*\r\n selectorFactory is a func that is responsible for returning the selector function used to\r\n compute new props from state, props, and dispatch. For example:\r\n export default connectAdvanced((dispatch, options) => (state, props) => ({\r\n thing: state.things[props.thingId],\r\n saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),\r\n }))(YourComponent)\r\n Access to dispatch is provided to the factory so selectorFactories can bind actionCreators\r\n outside of their selector as an optimization. Options passed to connectAdvanced are passed to\r\n the selectorFactory, along with displayName and WrappedComponent, as the second argument.\r\n Note that selectorFactory is responsible for all caching/memoization of inbound and outbound\r\n props. Do not use connectAdvanced directly without memoizing results between calls to your\r\n selector, otherwise the Connect component will re-render on every state or props change.\r\n*/\nselectorFactory, // options object:\n_ref) {\n if (_ref === void 0) {\n _ref = {};\n }\n\n var _ref2 = _ref,\n _ref2$getDisplayName = _ref2.getDisplayName,\n getDisplayName = _ref2$getDisplayName === void 0 ? function (name) {\n return \"ConnectAdvanced(\" + name + \")\";\n } : _ref2$getDisplayName,\n _ref2$methodName = _ref2.methodName,\n methodName = _ref2$methodName === void 0 ? 'connectAdvanced' : _ref2$methodName,\n _ref2$renderCountProp = _ref2.renderCountProp,\n renderCountProp = _ref2$renderCountProp === void 0 ? undefined : _ref2$renderCountProp,\n _ref2$shouldHandleSta = _ref2.shouldHandleStateChanges,\n shouldHandleStateChanges = _ref2$shouldHandleSta === void 0 ? true : _ref2$shouldHandleSta,\n _ref2$storeKey = _ref2.storeKey,\n storeKey = _ref2$storeKey === void 0 ? 'store' : _ref2$storeKey,\n _ref2$withRef = _ref2.withRef,\n withRef = _ref2$withRef === void 0 ? false : _ref2$withRef,\n _ref2$forwardRef = _ref2.forwardRef,\n forwardRef = _ref2$forwardRef === void 0 ? false : _ref2$forwardRef,\n _ref2$context = _ref2.context,\n context = _ref2$context === void 0 ? ReactReduxContext : _ref2$context,\n connectOptions = _objectWithoutPropertiesLoose(_ref2, _excluded);\n\n if (process.env.NODE_ENV !== 'production') {\n if (renderCountProp !== undefined) {\n throw new Error(\"renderCountProp is removed. render counting is built into the latest React Dev Tools profiling extension\");\n }\n\n if (withRef) {\n throw new Error('withRef is removed. To access the wrapped instance, use a ref on the connected component');\n }\n\n var customStoreWarningMessage = 'To use a custom Redux store for specific components, create a custom React context with ' + \"React.createContext(), and pass the context object to React Redux's Provider and specific components\" + ' like: . ' + 'You may also pass a {context : MyContext} option to connect';\n\n if (storeKey !== 'store') {\n throw new Error('storeKey has been removed and does not do anything. ' + customStoreWarningMessage);\n }\n }\n\n var Context = context;\n return function wrapWithConnect(WrappedComponent) {\n if (process.env.NODE_ENV !== 'production' && !isValidElementType(WrappedComponent)) {\n throw new Error(\"You must pass a component to the function returned by \" + (methodName + \". Instead received \" + stringifyComponent(WrappedComponent)));\n }\n\n var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n var displayName = getDisplayName(wrappedComponentName);\n\n var selectorFactoryOptions = _extends({}, connectOptions, {\n getDisplayName: getDisplayName,\n methodName: methodName,\n renderCountProp: renderCountProp,\n shouldHandleStateChanges: shouldHandleStateChanges,\n storeKey: storeKey,\n displayName: displayName,\n wrappedComponentName: wrappedComponentName,\n WrappedComponent: WrappedComponent\n });\n\n var pure = connectOptions.pure;\n\n function createChildSelector(store) {\n return selectorFactory(store.dispatch, selectorFactoryOptions);\n } // If we aren't running in \"pure\" mode, we don't want to memoize values.\n // To avoid conditionally calling hooks, we fall back to a tiny wrapper\n // that just executes the given callback immediately.\n\n\n var usePureOnlyMemo = pure ? useMemo : function (callback) {\n return callback();\n };\n\n function ConnectFunction(props) {\n var _useMemo = useMemo(function () {\n // Distinguish between actual \"data\" props that were passed to the wrapper component,\n // and values needed to control behavior (forwarded refs, alternate context instances).\n // To maintain the wrapperProps object reference, memoize this destructuring.\n var reactReduxForwardedRef = props.reactReduxForwardedRef,\n wrapperProps = _objectWithoutPropertiesLoose(props, _excluded2);\n\n return [props.context, reactReduxForwardedRef, wrapperProps];\n }, [props]),\n propsContext = _useMemo[0],\n reactReduxForwardedRef = _useMemo[1],\n wrapperProps = _useMemo[2];\n\n var ContextToUse = useMemo(function () {\n // Users may optionally pass in a custom context instance to use instead of our ReactReduxContext.\n // Memoize the check that determines which context instance we should use.\n return propsContext && propsContext.Consumer && isContextConsumer( /*#__PURE__*/React.createElement(propsContext.Consumer, null)) ? propsContext : Context;\n }, [propsContext, Context]); // Retrieve the store and ancestor subscription via context, if available\n\n var contextValue = useContext(ContextToUse); // The store _must_ exist as either a prop or in context.\n // We'll check to see if it _looks_ like a Redux store first.\n // This allows us to pass through a `store` prop that is just a plain value.\n\n var didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch);\n var didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store);\n\n if (process.env.NODE_ENV !== 'production' && !didStoreComeFromProps && !didStoreComeFromContext) {\n throw new Error(\"Could not find \\\"store\\\" in the context of \" + (\"\\\"\" + displayName + \"\\\". Either wrap the root component in a , \") + \"or pass a custom React context provider to and the corresponding \" + (\"React context consumer to \" + displayName + \" in connect options.\"));\n } // Based on the previous check, one of these must be true\n\n\n var store = didStoreComeFromProps ? props.store : contextValue.store;\n var childPropsSelector = useMemo(function () {\n // The child props selector needs the store reference as an input.\n // Re-create this selector whenever the store changes.\n return createChildSelector(store);\n }, [store]);\n\n var _useMemo2 = useMemo(function () {\n if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY; // This Subscription's source should match where store came from: props vs. context. A component\n // connected to the store via props shouldn't use subscription from context, or vice versa.\n\n // This Subscription's source should match where store came from: props vs. context. A component\n // connected to the store via props shouldn't use subscription from context, or vice versa.\n var subscription = createSubscription(store, didStoreComeFromProps ? null : contextValue.subscription); // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in\n // the middle of the notification loop, where `subscription` will then be null. This can\n // probably be avoided if Subscription's listeners logic is changed to not call listeners\n // that have been unsubscribed in the middle of the notification loop.\n\n // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in\n // the middle of the notification loop, where `subscription` will then be null. This can\n // probably be avoided if Subscription's listeners logic is changed to not call listeners\n // that have been unsubscribed in the middle of the notification loop.\n var notifyNestedSubs = subscription.notifyNestedSubs.bind(subscription);\n return [subscription, notifyNestedSubs];\n }, [store, didStoreComeFromProps, contextValue]),\n subscription = _useMemo2[0],\n notifyNestedSubs = _useMemo2[1]; // Determine what {store, subscription} value should be put into nested context, if necessary,\n // and memoize that value to avoid unnecessary context updates.\n\n\n var overriddenContextValue = useMemo(function () {\n if (didStoreComeFromProps) {\n // This component is directly subscribed to a store from props.\n // We don't want descendants reading from this store - pass down whatever\n // the existing context value is from the nearest connected ancestor.\n return contextValue;\n } // Otherwise, put this component's subscription instance into context, so that\n // connected descendants won't update until after this component is done\n\n\n return _extends({}, contextValue, {\n subscription: subscription\n });\n }, [didStoreComeFromProps, contextValue, subscription]); // We need to force this wrapper component to re-render whenever a Redux store update\n // causes a change to the calculated child component props (or we caught an error in mapState)\n\n var _useReducer = useReducer(storeStateUpdatesReducer, EMPTY_ARRAY, initStateUpdates),\n _useReducer$ = _useReducer[0],\n previousStateUpdateResult = _useReducer$[0],\n forceComponentUpdateDispatch = _useReducer[1]; // Propagate any mapState/mapDispatch errors upwards\n\n\n if (previousStateUpdateResult && previousStateUpdateResult.error) {\n throw previousStateUpdateResult.error;\n } // Set up refs to coordinate values between the subscription effect and the render logic\n\n\n var lastChildProps = useRef();\n var lastWrapperProps = useRef(wrapperProps);\n var childPropsFromStoreUpdate = useRef();\n var renderIsScheduled = useRef(false);\n var actualChildProps = usePureOnlyMemo(function () {\n // Tricky logic here:\n // - This render may have been triggered by a Redux store update that produced new child props\n // - However, we may have gotten new wrapper props after that\n // If we have new child props, and the same wrapper props, we know we should use the new child props as-is.\n // But, if we have new wrapper props, those might change the child props, so we have to recalculate things.\n // So, we'll use the child props from store update only if the wrapper props are the same as last time.\n if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) {\n return childPropsFromStoreUpdate.current;\n } // TODO We're reading the store directly in render() here. Bad idea?\n // This will likely cause Bad Things (TM) to happen in Concurrent Mode.\n // Note that we do this because on renders _not_ caused by store updates, we need the latest store state\n // to determine what the child props should be.\n\n\n return childPropsSelector(store.getState(), wrapperProps);\n }, [store, previousStateUpdateResult, wrapperProps]); // We need this to execute synchronously every time we re-render. However, React warns\n // about useLayoutEffect in SSR, so we try to detect environment and fall back to\n // just useEffect instead to avoid the warning, since neither will run anyway.\n\n useIsomorphicLayoutEffectWithArgs(captureWrapperProps, [lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, actualChildProps, childPropsFromStoreUpdate, notifyNestedSubs]); // Our re-subscribe logic only runs when the store/subscription setup changes\n\n useIsomorphicLayoutEffectWithArgs(subscribeUpdates, [shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, childPropsFromStoreUpdate, notifyNestedSubs, forceComponentUpdateDispatch], [store, subscription, childPropsSelector]); // Now that all that's done, we can finally try to actually render the child component.\n // We memoize the elements for the rendered child component as an optimization.\n\n var renderedWrappedComponent = useMemo(function () {\n return /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, actualChildProps, {\n ref: reactReduxForwardedRef\n }));\n }, [reactReduxForwardedRef, WrappedComponent, actualChildProps]); // If React sees the exact same element reference as last time, it bails out of re-rendering\n // that child, same as if it was wrapped in React.memo() or returned false from shouldComponentUpdate.\n\n var renderedChild = useMemo(function () {\n if (shouldHandleStateChanges) {\n // If this component is subscribed to store updates, we need to pass its own\n // subscription instance down to our descendants. That means rendering the same\n // Context instance, and putting a different value into the context.\n return /*#__PURE__*/React.createElement(ContextToUse.Provider, {\n value: overriddenContextValue\n }, renderedWrappedComponent);\n }\n\n return renderedWrappedComponent;\n }, [ContextToUse, renderedWrappedComponent, overriddenContextValue]);\n return renderedChild;\n } // If we're in \"pure\" mode, ensure our wrapper component only re-renders when incoming props have changed.\n\n\n var Connect = pure ? React.memo(ConnectFunction) : ConnectFunction;\n Connect.WrappedComponent = WrappedComponent;\n Connect.displayName = ConnectFunction.displayName = displayName;\n\n if (forwardRef) {\n var forwarded = React.forwardRef(function forwardConnectRef(props, ref) {\n return /*#__PURE__*/React.createElement(Connect, _extends({}, props, {\n reactReduxForwardedRef: ref\n }));\n });\n forwarded.displayName = displayName;\n forwarded.WrappedComponent = WrappedComponent;\n return hoistStatics(forwarded, WrappedComponent);\n }\n\n return hoistStatics(Connect, WrappedComponent);\n };\n}","function is(x, y) {\n if (x === y) {\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\n\nexport default function shallowEqual(objA, objB) {\n if (is(objA, objB)) return true;\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n if (keysA.length !== keysB.length) return false;\n\n for (var i = 0; i < keysA.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n}","export default function bindActionCreators(actionCreators, dispatch) {\n var boundActionCreators = {};\n\n var _loop = function _loop(key) {\n var actionCreator = actionCreators[key];\n\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = function () {\n return dispatch(actionCreator.apply(void 0, arguments));\n };\n }\n };\n\n for (var key in actionCreators) {\n _loop(key);\n }\n\n return boundActionCreators;\n}","import verifyPlainObject from '../utils/verifyPlainObject';\nexport function wrapMapToPropsConstant(getConstant) {\n return function initConstantSelector(dispatch, options) {\n var constant = getConstant(dispatch, options);\n\n function constantSelector() {\n return constant;\n }\n\n constantSelector.dependsOnOwnProps = false;\n return constantSelector;\n };\n} // dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args\n// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine\n// whether mapToProps needs to be invoked when props have changed.\n//\n// A length of one signals that mapToProps does not depend on props from the parent component.\n// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and\n// therefore not reporting its length accurately..\n\nexport function getDependsOnOwnProps(mapToProps) {\n return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n} // Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,\n// this function wraps mapToProps in a proxy function which does several things:\n//\n// * Detects whether the mapToProps function being called depends on props, which\n// is used by selectorFactory to decide if it should reinvoke on props changes.\n//\n// * On first call, handles mapToProps if returns another function, and treats that\n// new function as the true mapToProps for subsequent calls.\n//\n// * On first call, verifies the first result is a plain object, in order to warn\n// the developer that their mapToProps function is not returning a valid result.\n//\n\nexport function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (process.env.NODE_ENV !== 'production') verifyPlainObject(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}","import bindActionCreators from '../utils/bindActionCreators';\nimport { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps';\nexport function whenMapDispatchToPropsIsFunction(mapDispatchToProps) {\n return typeof mapDispatchToProps === 'function' ? wrapMapToPropsFunc(mapDispatchToProps, 'mapDispatchToProps') : undefined;\n}\nexport function whenMapDispatchToPropsIsMissing(mapDispatchToProps) {\n return !mapDispatchToProps ? wrapMapToPropsConstant(function (dispatch) {\n return {\n dispatch: dispatch\n };\n }) : undefined;\n}\nexport function whenMapDispatchToPropsIsObject(mapDispatchToProps) {\n return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? wrapMapToPropsConstant(function (dispatch) {\n return bindActionCreators(mapDispatchToProps, dispatch);\n }) : undefined;\n}\nexport default [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];","import { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps';\nexport function whenMapStateToPropsIsFunction(mapStateToProps) {\n return typeof mapStateToProps === 'function' ? wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps') : undefined;\n}\nexport function whenMapStateToPropsIsMissing(mapStateToProps) {\n return !mapStateToProps ? wrapMapToPropsConstant(function () {\n return {};\n }) : undefined;\n}\nexport default [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing];","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport verifyPlainObject from '../utils/verifyPlainObject';\nexport function defaultMergeProps(stateProps, dispatchProps, ownProps) {\n return _extends({}, ownProps, stateProps, dispatchProps);\n}\nexport function wrapMergePropsFunc(mergeProps) {\n return function initMergePropsProxy(dispatch, _ref) {\n var displayName = _ref.displayName,\n pure = _ref.pure,\n areMergedPropsEqual = _ref.areMergedPropsEqual;\n var hasRunOnce = false;\n var mergedProps;\n return function mergePropsProxy(stateProps, dispatchProps, ownProps) {\n var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\n if (hasRunOnce) {\n if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;\n } else {\n hasRunOnce = true;\n mergedProps = nextMergedProps;\n if (process.env.NODE_ENV !== 'production') verifyPlainObject(mergedProps, displayName, 'mergeProps');\n }\n\n return mergedProps;\n };\n };\n}\nexport function whenMergePropsIsFunction(mergeProps) {\n return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;\n}\nexport function whenMergePropsIsOmitted(mergeProps) {\n return !mergeProps ? function () {\n return defaultMergeProps;\n } : undefined;\n}\nexport default [whenMergePropsIsFunction, whenMergePropsIsOmitted];","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nvar _excluded = [\"initMapStateToProps\", \"initMapDispatchToProps\", \"initMergeProps\"];\nimport verifySubselectors from './verifySubselectors';\nexport function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {\n return function impureFinalPropsSelector(state, ownProps) {\n return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);\n };\n}\nexport function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {\n var areStatesEqual = _ref.areStatesEqual,\n areOwnPropsEqual = _ref.areOwnPropsEqual,\n areStatePropsEqual = _ref.areStatePropsEqual;\n var hasRunAtLeastOnce = false;\n var state;\n var ownProps;\n var stateProps;\n var dispatchProps;\n var mergedProps;\n\n function handleFirstCall(firstState, firstOwnProps) {\n state = firstState;\n ownProps = firstOwnProps;\n stateProps = mapStateToProps(state, ownProps);\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n hasRunAtLeastOnce = true;\n return mergedProps;\n }\n\n function handleNewPropsAndNewState() {\n stateProps = mapStateToProps(state, ownProps);\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewProps() {\n if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewState() {\n var nextStateProps = mapStateToProps(state, ownProps);\n var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);\n stateProps = nextStateProps;\n if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleSubsequentCalls(nextState, nextOwnProps) {\n var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);\n var stateChanged = !areStatesEqual(nextState, state, nextOwnProps, ownProps);\n state = nextState;\n ownProps = nextOwnProps;\n if (propsChanged && stateChanged) return handleNewPropsAndNewState();\n if (propsChanged) return handleNewProps();\n if (stateChanged) return handleNewState();\n return mergedProps;\n }\n\n return function pureFinalPropsSelector(nextState, nextOwnProps) {\n return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);\n };\n} // TODO: Add more comments\n// If pure is true, the selector returned by selectorFactory will memoize its results,\n// allowing connectAdvanced's shouldComponentUpdate to return false if final\n// props have not changed. If false, the selector will always return a new\n// object and shouldComponentUpdate will always return true.\n\nexport default function finalPropsSelectorFactory(dispatch, _ref2) {\n var initMapStateToProps = _ref2.initMapStateToProps,\n initMapDispatchToProps = _ref2.initMapDispatchToProps,\n initMergeProps = _ref2.initMergeProps,\n options = _objectWithoutPropertiesLoose(_ref2, _excluded);\n\n var mapStateToProps = initMapStateToProps(dispatch, options);\n var mapDispatchToProps = initMapDispatchToProps(dispatch, options);\n var mergeProps = initMergeProps(dispatch, options);\n\n if (process.env.NODE_ENV !== 'production') {\n verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);\n }\n\n var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;\n return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nvar _excluded = [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"];\nimport connectAdvanced from '../components/connectAdvanced';\nimport shallowEqual from '../utils/shallowEqual';\nimport defaultMapDispatchToPropsFactories from './mapDispatchToProps';\nimport defaultMapStateToPropsFactories from './mapStateToProps';\nimport defaultMergePropsFactories from './mergeProps';\nimport defaultSelectorFactory from './selectorFactory';\n/*\r\n connect is a facade over connectAdvanced. It turns its args into a compatible\r\n selectorFactory, which has the signature:\r\n\r\n (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps\r\n \r\n connect passes its args to connectAdvanced as options, which will in turn pass them to\r\n selectorFactory each time a Connect component instance is instantiated or hot reloaded.\r\n\r\n selectorFactory returns a final props selector from its mapStateToProps,\r\n mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,\r\n mergePropsFactories, and pure args.\r\n\r\n The resulting final props selector is called by the Connect component instance whenever\r\n it receives new props or store state.\r\n */\n\nfunction match(arg, factories, name) {\n for (var i = factories.length - 1; i >= 0; i--) {\n var result = factories[i](arg);\n if (result) return result;\n }\n\n return function (dispatch, options) {\n throw new Error(\"Invalid value of type \" + typeof arg + \" for \" + name + \" argument when connecting component \" + options.wrappedComponentName + \".\");\n };\n}\n\nfunction strictEqual(a, b) {\n return a === b;\n} // createConnect with default args builds the 'official' connect behavior. Calling it with\n// different options opens up some testing and extensibility scenarios\n\n\nexport function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? defaultMergePropsFactories : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? defaultSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? shallowEqual : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? shallowEqual : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? shallowEqual : _ref3$areMergedPropsE,\n extraOptions = _objectWithoutPropertiesLoose(_ref3, _excluded);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}\nexport default /*#__PURE__*/createConnect();","import { useContext } from 'react';\nimport { ReactReduxContext } from '../components/Context';\n/**\r\n * A hook to access the value of the `ReactReduxContext`. This is a low-level\r\n * hook that you should usually not need to call directly.\r\n *\r\n * @returns {any} the value of the `ReactReduxContext`\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useReduxContext } from 'react-redux'\r\n *\r\n * export const CounterComponent = ({ value }) => {\r\n * const { store } = useReduxContext()\r\n * return
{store.getState()}
\r\n * }\r\n */\n\nexport function useReduxContext() {\n var contextValue = useContext(ReactReduxContext);\n\n if (process.env.NODE_ENV !== 'production' && !contextValue) {\n throw new Error('could not find react-redux context value; please ensure the component is wrapped in a ');\n }\n\n return contextValue;\n}","import { useContext } from 'react';\nimport { ReactReduxContext } from '../components/Context';\nimport { useReduxContext as useDefaultReduxContext } from './useReduxContext';\n/**\r\n * Hook factory, which creates a `useStore` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your ``.\r\n * @returns {Function} A `useStore` hook bound to the specified context.\r\n */\n\nexport function createStoreHook(context) {\n if (context === void 0) {\n context = ReactReduxContext;\n }\n\n var useReduxContext = context === ReactReduxContext ? useDefaultReduxContext : function () {\n return useContext(context);\n };\n return function useStore() {\n var _useReduxContext = useReduxContext(),\n store = _useReduxContext.store;\n\n return store;\n };\n}\n/**\r\n * A hook to access the redux store.\r\n *\r\n * @returns {any} the redux store\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useStore } from 'react-redux'\r\n *\r\n * export const ExampleComponent = () => {\r\n * const store = useStore()\r\n * return
{store.getState()}
\r\n * }\r\n */\n\nexport var useStore = /*#__PURE__*/createStoreHook();","import { ReactReduxContext } from '../components/Context';\nimport { useStore as useDefaultStore, createStoreHook } from './useStore';\n/**\r\n * Hook factory, which creates a `useDispatch` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your ``.\r\n * @returns {Function} A `useDispatch` hook bound to the specified context.\r\n */\n\nexport function createDispatchHook(context) {\n if (context === void 0) {\n context = ReactReduxContext;\n }\n\n var useStore = context === ReactReduxContext ? useDefaultStore : createStoreHook(context);\n return function useDispatch() {\n var store = useStore();\n return store.dispatch;\n };\n}\n/**\r\n * A hook to access the redux `dispatch` function.\r\n *\r\n * @returns {any|function} redux store's `dispatch` function\r\n *\r\n * @example\r\n *\r\n * import React, { useCallback } from 'react'\r\n * import { useDispatch } from 'react-redux'\r\n *\r\n * export const CounterComponent = ({ value }) => {\r\n * const dispatch = useDispatch()\r\n * const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])\r\n * return (\r\n *
\r\n * {value}\r\n * \r\n *
\r\n * )\r\n * }\r\n */\n\nexport var useDispatch = /*#__PURE__*/createDispatchHook();","import { useReducer, useRef, useMemo, useContext, useDebugValue } from 'react';\nimport { useReduxContext as useDefaultReduxContext } from './useReduxContext';\nimport { createSubscription } from '../utils/Subscription';\nimport { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect';\nimport { ReactReduxContext } from '../components/Context';\n\nvar refEquality = function refEquality(a, b) {\n return a === b;\n};\n\nfunction useSelectorWithStoreAndSubscription(selector, equalityFn, store, contextSub) {\n var _useReducer = useReducer(function (s) {\n return s + 1;\n }, 0),\n forceRender = _useReducer[1];\n\n var subscription = useMemo(function () {\n return createSubscription(store, contextSub);\n }, [store, contextSub]);\n var latestSubscriptionCallbackError = useRef();\n var latestSelector = useRef();\n var latestStoreState = useRef();\n var latestSelectedState = useRef();\n var storeState = store.getState();\n var selectedState;\n\n try {\n if (selector !== latestSelector.current || storeState !== latestStoreState.current || latestSubscriptionCallbackError.current) {\n var newSelectedState = selector(storeState); // ensure latest selected state is reused so that a custom equality function can result in identical references\n\n if (latestSelectedState.current === undefined || !equalityFn(newSelectedState, latestSelectedState.current)) {\n selectedState = newSelectedState;\n } else {\n selectedState = latestSelectedState.current;\n }\n } else {\n selectedState = latestSelectedState.current;\n }\n } catch (err) {\n if (latestSubscriptionCallbackError.current) {\n err.message += \"\\nThe error may be correlated with this previous error:\\n\" + latestSubscriptionCallbackError.current.stack + \"\\n\\n\";\n }\n\n throw err;\n }\n\n useIsomorphicLayoutEffect(function () {\n latestSelector.current = selector;\n latestStoreState.current = storeState;\n latestSelectedState.current = selectedState;\n latestSubscriptionCallbackError.current = undefined;\n });\n useIsomorphicLayoutEffect(function () {\n function checkForUpdates() {\n try {\n var newStoreState = store.getState(); // Avoid calling selector multiple times if the store's state has not changed\n\n if (newStoreState === latestStoreState.current) {\n return;\n }\n\n var _newSelectedState = latestSelector.current(newStoreState);\n\n if (equalityFn(_newSelectedState, latestSelectedState.current)) {\n return;\n }\n\n latestSelectedState.current = _newSelectedState;\n latestStoreState.current = newStoreState;\n } catch (err) {\n // we ignore all errors here, since when the component\n // is re-rendered, the selectors are called again, and\n // will throw again, if neither props nor store state\n // changed\n latestSubscriptionCallbackError.current = err;\n }\n\n forceRender();\n }\n\n subscription.onStateChange = checkForUpdates;\n subscription.trySubscribe();\n checkForUpdates();\n return function () {\n return subscription.tryUnsubscribe();\n };\n }, [store, subscription]);\n return selectedState;\n}\n/**\r\n * Hook factory, which creates a `useSelector` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your ``.\r\n * @returns {Function} A `useSelector` hook bound to the specified context.\r\n */\n\n\nexport function createSelectorHook(context) {\n if (context === void 0) {\n context = ReactReduxContext;\n }\n\n var useReduxContext = context === ReactReduxContext ? useDefaultReduxContext : function () {\n return useContext(context);\n };\n return function useSelector(selector, equalityFn) {\n if (equalityFn === void 0) {\n equalityFn = refEquality;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!selector) {\n throw new Error(\"You must pass a selector to useSelector\");\n }\n\n if (typeof selector !== 'function') {\n throw new Error(\"You must pass a function as a selector to useSelector\");\n }\n\n if (typeof equalityFn !== 'function') {\n throw new Error(\"You must pass a function as an equality function to useSelector\");\n }\n }\n\n var _useReduxContext = useReduxContext(),\n store = _useReduxContext.store,\n contextSub = _useReduxContext.subscription;\n\n var selectedState = useSelectorWithStoreAndSubscription(selector, equalityFn, store, contextSub);\n useDebugValue(selectedState);\n return selectedState;\n };\n}\n/**\r\n * A hook to access the redux store's state. This hook takes a selector function\r\n * as an argument. The selector is called with the store state.\r\n *\r\n * This hook takes an optional equality comparison function as the second parameter\r\n * that allows you to customize the way the selected state is compared to determine\r\n * whether the component needs to be re-rendered.\r\n *\r\n * @param {Function} selector the selector function\r\n * @param {Function=} equalityFn the function that will be used to determine equality\r\n *\r\n * @returns {any} the selected state\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useSelector } from 'react-redux'\r\n *\r\n * export const CounterComponent = () => {\r\n * const counter = useSelector(state => state.counter)\r\n * return
{counter}
\r\n * }\r\n */\n\nexport var useSelector = /*#__PURE__*/createSelectorHook();","export * from './exports';\nimport { unstable_batchedUpdates as batch } from './utils/reactBatchedUpdates';\nimport { setBatch } from './utils/batch'; // Enable batched updates in our subscriptions for use\n// with standard React renderers (ReactDOM, React Native)\n\nsetBatch(batch);\nexport { batch };","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import defineProperty from \"./defineProperty.js\";\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n enumerableOnly && (symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n })), keys.push.apply(keys, symbols);\n }\n return keys;\n}\nexport default function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = null != arguments[i] ? arguments[i] : {};\n i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {\n defineProperty(target, key, source[key]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n return target;\n}","import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';\n\n/**\n * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js\n *\n * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes\n * during build.\n * @param {number} code\n */\nfunction formatProdErrorMessage(code) {\n return \"Minified Redux error #\" + code + \"; visit https://redux.js.org/Errors?code=\" + code + \" for the full message or \" + 'use the non-minified dev environment for full errors. ';\n}\n\n// Inlined version of the `symbol-observable` polyfill\nvar $$observable = (function () {\n return typeof Symbol === 'function' && Symbol.observable || '@@observable';\n})();\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nvar randomString = function randomString() {\n return Math.random().toString(36).substring(7).split('').join('.');\n};\n\nvar ActionTypes = {\n INIT: \"@@redux/INIT\" + randomString(),\n REPLACE: \"@@redux/REPLACE\" + randomString(),\n PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {\n return \"@@redux/PROBE_UNKNOWN_ACTION\" + randomString();\n }\n};\n\n/**\n * @param {any} obj The object to inspect.\n * @returns {boolean} True if the argument appears to be a plain object.\n */\nfunction isPlainObject(obj) {\n if (typeof obj !== 'object' || obj === null) return false;\n var proto = obj;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(obj) === proto;\n}\n\nfunction kindOf(val) {\n var typeOfVal = typeof val;\n\n if (process.env.NODE_ENV !== 'production') {\n // Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of\n function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n }\n\n function ctorName(val) {\n return typeof val.constructor === 'function' ? val.constructor.name : null;\n }\n\n function isError(val) {\n return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';\n }\n\n function isDate(val) {\n if (val instanceof Date) return true;\n return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';\n }\n\n typeOfVal = miniKindOf(val);\n }\n\n return typeOfVal;\n}\n\n/**\n * Creates a Redux store that holds the state tree.\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n\nfunction createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(0) : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.');\n }\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(1) : \"Expected the enhancer to be a function. Instead, received: '\" + kindOf(enhancer) + \"'\");\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(2) : \"Expected the root reducer to be a function. Instead, received: '\" + kindOf(reducer) + \"'\");\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n /**\n * This makes a shallow copy of currentListeners so we can use\n * nextListeners as a temporary list while dispatching.\n *\n * This prevents any bugs around consumers calling\n * subscribe/unsubscribe in the middle of a dispatch.\n */\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n\n\n function getState() {\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(3) : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');\n }\n\n return currentState;\n }\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n\n\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(4) : \"Expected the listener to be a function. Instead, received: '\" + kindOf(listener) + \"'\");\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(5) : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n\n var isSubscribed = true;\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(6) : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n\n isSubscribed = false;\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n currentListeners = null;\n };\n }\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n\n\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(7) : \"Actions must be plain objects. Instead, the actual type was: '\" + kindOf(action) + \"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.\");\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(8) : 'Actions may not have an undefined \"type\" property. You may have misspelled an action type string constant.');\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(9) : 'Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n\n\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(10) : \"Expected the nextReducer to be a function. Instead, received: '\" + kindOf(nextReducer));\n }\n\n currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.\n // Any reducers that existed in both the new and old rootReducer\n // will receive the previous state. This effectively populates\n // the new state tree with any relevant data from the old one.\n\n dispatch({\n type: ActionTypes.REPLACE\n });\n }\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n\n\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(11) : \"Expected the observer to be an object. Instead, received: '\" + kindOf(observer) + \"'\");\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe: unsubscribe\n };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n } // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n\n\n dispatch({\n type: ActionTypes.INIT\n });\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n\n\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n } catch (e) {} // eslint-disable-line no-empty\n\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return \"The \" + argumentName + \" has unexpected type of \\\"\" + kindOf(inputState) + \"\\\". Expected argument to be an object with the following \" + (\"keys: \\\"\" + reducerKeys.join('\", \"') + \"\\\"\");\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === ActionTypes.REPLACE) return;\n\n if (unexpectedKeys.length > 0) {\n return \"Unexpected \" + (unexpectedKeys.length > 1 ? 'keys' : 'key') + \" \" + (\"\\\"\" + unexpectedKeys.join('\", \"') + \"\\\" found in \" + argumentName + \". \") + \"Expected to find one of the known reducer keys instead: \" + (\"\\\"\" + reducerKeys.join('\", \"') + \"\\\". Unexpected keys will be ignored.\");\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, {\n type: ActionTypes.INIT\n });\n\n if (typeof initialState === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(12) : \"The slice reducer for key \\\"\" + key + \"\\\" returned undefined during initialization. \" + \"If the state passed to the reducer is undefined, you must \" + \"explicitly return the initial state. The initial state may \" + \"not be undefined. If you don't want to set a value for this reducer, \" + \"you can use null instead of undefined.\");\n }\n\n if (typeof reducer(undefined, {\n type: ActionTypes.PROBE_UNKNOWN_ACTION()\n }) === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(13) : \"The slice reducer for key \\\"\" + key + \"\\\" returned undefined when probed with a random type. \" + (\"Don't try to handle '\" + ActionTypes.INIT + \"' or other actions in \\\"redux/*\\\" \") + \"namespace. They are considered private. Instead, you must return the \" + \"current state for any unknown actions, unless it is undefined, \" + \"in which case you must return the initial state, regardless of the \" + \"action type. The initial state may not be undefined, but can be null.\");\n }\n });\n}\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\n\n\nfunction combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning(\"No reducer provided for key \\\"\" + key + \"\\\"\");\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n\n var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same\n // keys multiple times.\n\n var unexpectedKeyCache;\n\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError;\n\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination(state, action) {\n if (state === void 0) {\n state = {};\n }\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n\n if (typeof nextStateForKey === 'undefined') {\n var actionType = action && action.type;\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(14) : \"When called with an action of type \" + (actionType ? \"\\\"\" + String(actionType) + \"\\\"\" : '(unknown type)') + \", the slice reducer for key \\\"\" + _key + \"\\\" returned undefined. \" + \"To ignore an action, you must explicitly return the previous state. \" + \"If you want this reducer to hold no value, you can return null instead of undefined.\");\n }\n\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(this, arguments));\n };\n}\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass an action creator as the first argument,\n * and get a dispatch wrapped function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\n\n\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(16) : \"bindActionCreators expected an object or a function, but instead received: '\" + kindOf(actionCreators) + \"'. \" + \"Did you write \\\"import ActionCreators from\\\" instead of \\\"import * as ActionCreators from\\\"?\");\n }\n\n var boundActionCreators = {};\n\n for (var key in actionCreators) {\n var actionCreator = actionCreators[key];\n\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n\n return boundActionCreators;\n}\n\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\nfunction compose() {\n for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(void 0, arguments));\n };\n });\n}\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\n\nfunction applyMiddleware() {\n for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function () {\n var store = createStore.apply(void 0, arguments);\n\n var _dispatch = function dispatch() {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(15) : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');\n };\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch() {\n return _dispatch.apply(void 0, arguments);\n }\n };\n var chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(void 0, chain)(store.dispatch);\n return _objectSpread(_objectSpread({}, store), {}, {\n dispatch: _dispatch\n });\n };\n };\n}\n\n/*\n * This is a dummy function to check if the function name has been altered by minification.\n * If the function has been minified and NODE_ENV !== 'production', warn the user.\n */\n\nfunction isCrushed() {}\n\nif (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {\n warning('You are currently using minified code outside of NODE_ENV === \"production\". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.');\n}\n\nexport { ActionTypes as __DO_NOT_USE__ActionTypes, applyMiddleware, bindActionCreators, combineReducers, compose, createStore };\n","var objectKeys =\n Object.keys ||\n function (obj) {\n var keys = [];\n for (var key in obj) {\n if ({}.hasOwnProperty.call(obj, key)) keys.push(key);\n }\n return keys;\n };\n\nfunction assign(obj, newKey, newValue) {\n var keys = objectKeys(obj);\n var copy = {};\n\n for (var i = 0, l = keys.length; i < l; i++) {\n var key = keys[i];\n copy[key] = obj[key];\n }\n\n copy[newKey] = newValue;\n return copy;\n}\n\nmodule.exports = assign;\n","'use strict';\n\nvar assign = require('./utils/assign');\nvar compose = require('redux').compose;\n\nfunction enhancer() {\n var config = arguments[0] || {};\n config.features = { pause: true, export: true, test: true };\n config.type = 'redux';\n if (config.autoPause === undefined) config.autoPause = true;\n if (config.latency === undefined) config.latency = 500;\n\n return function (createStore) {\n return function (reducer, preloadedState, enhancer) {\n var store = createStore(reducer, preloadedState, enhancer);\n var origDispatch = store.dispatch;\n\n var devTools = window.__REDUX_DEVTOOLS_EXTENSION__.connect(config);\n devTools.init(store.getState());\n\n var dispatch = function (action) {\n var r = origDispatch(action);\n devTools.send(action, store.getState());\n return r;\n };\n\n if (Object.assign) return Object.assign(store, { dispatch: dispatch });\n return assign(store, 'dispatch', dispatch);\n };\n };\n}\n\nfunction composeWithEnhancer(config) {\n return function () {\n return compose(compose.apply(null, arguments), enhancer(config));\n };\n}\n\nexports.__esModule = true;\nexports.composeWithDevTools = function () {\n if (typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__) {\n if (arguments.length === 0) return enhancer();\n if (typeof arguments[0] === 'object')\n return composeWithEnhancer(arguments[0]);\n return composeWithEnhancer().apply(null, arguments);\n }\n\n if (arguments.length === 0) return undefined;\n if (typeof arguments[0] === 'object') return compose;\n return compose.apply(null, arguments);\n};\n\nexports.devToolsEnhancer =\n typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__\n ? enhancer\n : function () {\n return function (noop) {\n return noop;\n };\n };\n","'use strict';\n\nvar compose = require('redux').compose;\nvar logOnly = require('./logOnly');\n\nexports.__esModule = true;\nexports.composeWithDevTools =\n process.env.NODE_ENV === 'production'\n ? logOnly.composeWithDevTools\n : typeof window !== 'undefined' &&\n window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\n ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\n : function () {\n if (arguments.length === 0) return undefined;\n if (typeof arguments[0] === 'object') return compose;\n return compose.apply(null, arguments);\n };\n\nexports.devToolsEnhancer =\n process.env.NODE_ENV === 'production'\n ? logOnly.devToolsEnhancer\n : typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__\n ? window.__REDUX_DEVTOOLS_EXTENSION__\n : function () {\n return function (noop) {\n return noop;\n };\n };\n","/** A function that accepts a potential \"extra argument\" value to be injected later,\r\n * and returns an instance of the thunk middleware that uses that value\r\n */\nfunction createThunkMiddleware(extraArgument) {\n // Standard Redux middleware definition pattern:\n // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware\n var middleware = function middleware(_ref) {\n var dispatch = _ref.dispatch,\n getState = _ref.getState;\n return function (next) {\n return function (action) {\n // The thunk middleware looks for any functions that were passed to `store.dispatch`.\n // If this \"action\" is really a function, call it and return the result.\n if (typeof action === 'function') {\n // Inject the store's `dispatch` and `getState` methods, as well as any \"extra arg\"\n return action(dispatch, getState, extraArgument);\n } // Otherwise, pass the action down the middleware chain as usual\n\n\n return next(action);\n };\n };\n };\n\n return middleware;\n}\n\nvar thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version\n// with whatever \"extra arg\" they want to inject into their thunks\n\nthunk.withExtraArgument = createThunkMiddleware;\nexport default thunk;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ActionCreators = exports.ActionTypes = void 0;\nvar ActionTypes = {\n UNDO: '@@redux-undo/UNDO',\n REDO: '@@redux-undo/REDO',\n JUMP_TO_FUTURE: '@@redux-undo/JUMP_TO_FUTURE',\n JUMP_TO_PAST: '@@redux-undo/JUMP_TO_PAST',\n JUMP: '@@redux-undo/JUMP',\n CLEAR_HISTORY: '@@redux-undo/CLEAR_HISTORY'\n};\nexports.ActionTypes = ActionTypes;\nvar ActionCreators = {\n undo: function undo() {\n return {\n type: ActionTypes.UNDO\n };\n },\n redo: function redo() {\n return {\n type: ActionTypes.REDO\n };\n },\n jumpToFuture: function jumpToFuture(index) {\n return {\n type: ActionTypes.JUMP_TO_FUTURE,\n index: index\n };\n },\n jumpToPast: function jumpToPast(index) {\n return {\n type: ActionTypes.JUMP_TO_PAST,\n index: index\n };\n },\n jump: function jump(index) {\n return {\n type: ActionTypes.JUMP,\n index: index\n };\n },\n clearHistory: function clearHistory() {\n return {\n type: ActionTypes.CLEAR_HISTORY\n };\n }\n};\nexports.ActionCreators = ActionCreators;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.parseActions = parseActions;\nexports.isHistory = isHistory;\nexports.includeAction = includeAction;\nexports.excludeAction = excludeAction;\nexports.combineFilters = combineFilters;\nexports.groupByActionTypes = groupByActionTypes;\nexports.newHistory = newHistory;\n\n// parseActions helper: takes a string (or array)\n// and makes it an array if it isn't yet\nfunction parseActions(rawActions) {\n var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n\n if (Array.isArray(rawActions)) {\n return rawActions;\n } else if (typeof rawActions === 'string') {\n return [rawActions];\n }\n\n return defaultValue;\n} // isHistory helper: check for a valid history object\n\n\nfunction isHistory(history) {\n return typeof history.present !== 'undefined' && typeof history.future !== 'undefined' && typeof history.past !== 'undefined' && Array.isArray(history.future) && Array.isArray(history.past);\n} // includeAction helper: whitelist actions to be added to the history\n\n\nfunction includeAction(rawActions) {\n var actions = parseActions(rawActions);\n return function (action) {\n return actions.indexOf(action.type) >= 0;\n };\n} // excludeAction helper: blacklist actions from being added to the history\n\n\nfunction excludeAction(rawActions) {\n var actions = parseActions(rawActions);\n return function (action) {\n return actions.indexOf(action.type) < 0;\n };\n} // combineFilters helper: combine multiple filters to one\n\n\nfunction combineFilters() {\n for (var _len = arguments.length, filters = new Array(_len), _key = 0; _key < _len; _key++) {\n filters[_key] = arguments[_key];\n }\n\n return filters.reduce(function (prev, curr) {\n return function (action, currentState, previousHistory) {\n return prev(action, currentState, previousHistory) && curr(action, currentState, previousHistory);\n };\n }, function () {\n return true;\n });\n}\n\nfunction groupByActionTypes(rawActions) {\n var actions = parseActions(rawActions);\n return function (action) {\n return actions.indexOf(action.type) >= 0 ? action.type : null;\n };\n}\n\nfunction newHistory(past, present, future) {\n var group = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n return {\n past: past,\n present: present,\n future: future,\n group: group,\n _latestUnfiltered: present,\n index: past.length,\n limit: past.length + future.length + 1\n };\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.set = set;\nexports.start = start;\nexports.end = end;\nexports.log = log;\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance\"); }\n\nfunction _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }\n\nvar __DEBUG__;\n\nvar displayBuffer;\nvar colors = {\n prevState: '#9E9E9E',\n action: '#03A9F4',\n nextState: '#4CAF50'\n};\n/* istanbul ignore next: debug messaging is not tested */\n\nfunction initBuffer() {\n displayBuffer = {\n header: [],\n prev: [],\n action: [],\n next: [],\n msgs: []\n };\n}\n/* istanbul ignore next: debug messaging is not tested */\n\n\nfunction printBuffer() {\n var _displayBuffer = displayBuffer,\n header = _displayBuffer.header,\n prev = _displayBuffer.prev,\n next = _displayBuffer.next,\n action = _displayBuffer.action,\n msgs = _displayBuffer.msgs;\n\n if (console.group) {\n var _console, _console2, _console3, _console4, _console5;\n\n (_console = console).groupCollapsed.apply(_console, _toConsumableArray(header));\n\n (_console2 = console).log.apply(_console2, _toConsumableArray(prev));\n\n (_console3 = console).log.apply(_console3, _toConsumableArray(action));\n\n (_console4 = console).log.apply(_console4, _toConsumableArray(next));\n\n (_console5 = console).log.apply(_console5, _toConsumableArray(msgs));\n\n console.groupEnd();\n } else {\n var _console6, _console7, _console8, _console9, _console10;\n\n (_console6 = console).log.apply(_console6, _toConsumableArray(header));\n\n (_console7 = console).log.apply(_console7, _toConsumableArray(prev));\n\n (_console8 = console).log.apply(_console8, _toConsumableArray(action));\n\n (_console9 = console).log.apply(_console9, _toConsumableArray(next));\n\n (_console10 = console).log.apply(_console10, _toConsumableArray(msgs));\n }\n}\n/* istanbul ignore next: debug messaging is not tested */\n\n\nfunction colorFormat(text, color, obj) {\n return [\"%c\".concat(text), \"color: \".concat(color, \"; font-weight: bold\"), obj];\n}\n/* istanbul ignore next: debug messaging is not tested */\n\n\nfunction start(action, state) {\n initBuffer();\n\n if (__DEBUG__) {\n if (console.group) {\n displayBuffer.header = ['%credux-undo', 'font-style: italic', 'action', action.type];\n displayBuffer.action = colorFormat('action', colors.action, action);\n displayBuffer.prev = colorFormat('prev history', colors.prevState, state);\n } else {\n displayBuffer.header = ['redux-undo action', action.type];\n displayBuffer.action = ['action', action];\n displayBuffer.prev = ['prev history', state];\n }\n }\n}\n/* istanbul ignore next: debug messaging is not tested */\n\n\nfunction end(nextState) {\n if (__DEBUG__) {\n if (console.group) {\n displayBuffer.next = colorFormat('next history', colors.nextState, nextState);\n } else {\n displayBuffer.next = ['next history', nextState];\n }\n\n printBuffer();\n }\n}\n/* istanbul ignore next: debug messaging is not tested */\n\n\nfunction log() {\n if (__DEBUG__) {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n displayBuffer.msgs = displayBuffer.msgs.concat([].concat(args, ['\\n']));\n }\n}\n/* istanbul ignore next: debug messaging is not tested */\n\n\nfunction set(debug) {\n __DEBUG__ = debug;\n}","\"use strict\";\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = undoable;\n\nvar debug = _interopRequireWildcard(require(\"./debug\"));\n\nvar _actions = require(\"./actions\");\n\nvar _helpers = require(\"./helpers\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance\"); }\n\nfunction _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }\n\nfunction createHistory(state, ignoreInitialState) {\n // ignoreInitialState essentially prevents the user from undoing to the\n // beginning, in the case that the undoable reducer handles initialization\n // in a way that can't be redone simply\n var history = (0, _helpers.newHistory)([], state, []);\n\n if (ignoreInitialState) {\n history._latestUnfiltered = null;\n }\n\n return history;\n} // insert: insert `state` into history, which means adding the current state\n// into `past`, setting the new `state` as `present` and erasing\n// the `future`.\n\n\nfunction insert(history, state, limit, group) {\n var lengthWithoutFuture = history.past.length + 1;\n debug.log('inserting', state);\n debug.log('new free: ', limit - lengthWithoutFuture);\n var past = history.past,\n _latestUnfiltered = history._latestUnfiltered;\n var isHistoryOverflow = limit && limit <= lengthWithoutFuture;\n var pastSliced = past.slice(isHistoryOverflow ? 1 : 0);\n var newPast = _latestUnfiltered != null ? [].concat(_toConsumableArray(pastSliced), [_latestUnfiltered]) : pastSliced;\n return (0, _helpers.newHistory)(newPast, state, [], group);\n} // jumpToFuture: jump to requested index in future history\n\n\nfunction jumpToFuture(history, index) {\n if (index < 0 || index >= history.future.length) return history;\n var past = history.past,\n future = history.future,\n _latestUnfiltered = history._latestUnfiltered;\n var newPast = [].concat(_toConsumableArray(past), [_latestUnfiltered], _toConsumableArray(future.slice(0, index)));\n var newPresent = future[index];\n var newFuture = future.slice(index + 1);\n return (0, _helpers.newHistory)(newPast, newPresent, newFuture);\n} // jumpToPast: jump to requested index in past history\n\n\nfunction jumpToPast(history, index) {\n if (index < 0 || index >= history.past.length) return history;\n var past = history.past,\n future = history.future,\n _latestUnfiltered = history._latestUnfiltered;\n var newPast = past.slice(0, index);\n var newFuture = [].concat(_toConsumableArray(past.slice(index + 1)), [_latestUnfiltered], _toConsumableArray(future));\n var newPresent = past[index];\n return (0, _helpers.newHistory)(newPast, newPresent, newFuture);\n} // jump: jump n steps in the past or forward\n\n\nfunction jump(history, n) {\n if (n > 0) return jumpToFuture(history, n - 1);\n if (n < 0) return jumpToPast(history, history.past.length + n);\n return history;\n} // helper to dynamically match in the reducer's switch-case\n\n\nfunction actionTypeAmongClearHistoryType(actionType, clearHistoryType) {\n return clearHistoryType.indexOf(actionType) > -1 ? actionType : !actionType;\n} // redux-undo higher order reducer\n\n\nfunction undoable(reducer) {\n var rawConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n debug.set(rawConfig.debug);\n\n var config = _objectSpread({\n limit: undefined,\n filter: function filter() {\n return true;\n },\n groupBy: function groupBy() {\n return null;\n },\n undoType: _actions.ActionTypes.UNDO,\n redoType: _actions.ActionTypes.REDO,\n jumpToPastType: _actions.ActionTypes.JUMP_TO_PAST,\n jumpToFutureType: _actions.ActionTypes.JUMP_TO_FUTURE,\n jumpType: _actions.ActionTypes.JUMP,\n neverSkipReducer: false,\n ignoreInitialState: false,\n syncFilter: false\n }, rawConfig, {\n initTypes: (0, _helpers.parseActions)(rawConfig.initTypes, ['@@redux-undo/INIT']),\n clearHistoryType: (0, _helpers.parseActions)(rawConfig.clearHistoryType, [_actions.ActionTypes.CLEAR_HISTORY])\n }); // Allows the user to call the reducer with redux-undo specific actions\n\n\n var skipReducer = config.neverSkipReducer ? function (res, action) {\n for (var _len = arguments.length, slices = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n slices[_key - 2] = arguments[_key];\n }\n\n return _objectSpread({}, res, {\n present: reducer.apply(void 0, [res.present, action].concat(slices))\n });\n } : function (res) {\n return res;\n };\n var initialState;\n return function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n debug.start(action, state);\n var history = state;\n\n for (var _len2 = arguments.length, slices = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n slices[_key2 - 2] = arguments[_key2];\n }\n\n if (!initialState) {\n debug.log('history is uninitialized');\n\n if (state === undefined) {\n var createHistoryAction = {\n type: '@@redux-undo/CREATE_HISTORY'\n };\n var start = reducer.apply(void 0, [state, createHistoryAction].concat(slices));\n history = createHistory(start, config.ignoreInitialState);\n debug.log('do not set initialState on probe actions');\n debug.end(history);\n return history;\n } else if ((0, _helpers.isHistory)(state)) {\n history = initialState = config.ignoreInitialState ? state : (0, _helpers.newHistory)(state.past, state.present, state.future);\n debug.log('initialHistory initialized: initialState is a history', initialState);\n } else {\n history = initialState = createHistory(state, config.ignoreInitialState);\n debug.log('initialHistory initialized: initialState is not a history', initialState);\n }\n }\n\n var res;\n\n switch (action.type) {\n case undefined:\n return history;\n\n case config.undoType:\n res = jump(history, -1);\n debug.log('perform undo');\n debug.end(res);\n return skipReducer.apply(void 0, [res, action].concat(slices));\n\n case config.redoType:\n res = jump(history, 1);\n debug.log('perform redo');\n debug.end(res);\n return skipReducer.apply(void 0, [res, action].concat(slices));\n\n case config.jumpToPastType:\n res = jumpToPast(history, action.index);\n debug.log(\"perform jumpToPast to \".concat(action.index));\n debug.end(res);\n return skipReducer.apply(void 0, [res, action].concat(slices));\n\n case config.jumpToFutureType:\n res = jumpToFuture(history, action.index);\n debug.log(\"perform jumpToFuture to \".concat(action.index));\n debug.end(res);\n return skipReducer.apply(void 0, [res, action].concat(slices));\n\n case config.jumpType:\n res = jump(history, action.index);\n debug.log(\"perform jump to \".concat(action.index));\n debug.end(res);\n return skipReducer.apply(void 0, [res, action].concat(slices));\n\n case actionTypeAmongClearHistoryType(action.type, config.clearHistoryType):\n res = createHistory(history.present, config.ignoreInitialState);\n debug.log('perform clearHistory');\n debug.end(res);\n return skipReducer.apply(void 0, [res, action].concat(slices));\n\n default:\n res = reducer.apply(void 0, [history.present, action].concat(slices));\n\n if (config.initTypes.some(function (actionType) {\n return actionType === action.type;\n })) {\n debug.log('reset history due to init action');\n debug.end(initialState);\n return initialState;\n }\n\n if (history._latestUnfiltered === res) {\n // Don't handle this action. Do not call debug.end here,\n // because this action should not produce side effects to the console\n return history;\n }\n /* eslint-disable-next-line no-case-declarations */\n\n\n var filtered = typeof config.filter === 'function' && !config.filter(action, res, history);\n\n if (filtered) {\n // if filtering an action, merely update the present\n var filteredState = (0, _helpers.newHistory)(history.past, res, history.future, history.group);\n\n if (!config.syncFilter) {\n filteredState._latestUnfiltered = history._latestUnfiltered;\n }\n\n debug.log('filter ignored action, not storing it in past');\n debug.end(filteredState);\n return filteredState;\n }\n /* eslint-disable-next-line no-case-declarations */\n\n\n var group = config.groupBy(action, res, history);\n\n if (group != null && group === history.group) {\n // if grouping with the previous action, only update the present\n var groupedState = (0, _helpers.newHistory)(history.past, res, history.future, history.group);\n debug.log('groupBy grouped the action with the previous action');\n debug.end(groupedState);\n return groupedState;\n } // If the action wasn't filtered or grouped, insert normally\n\n\n history = insert(history, res, config.limit, group);\n debug.log('inserted new state into history');\n debug.end(history);\n return history;\n }\n };\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"ActionTypes\", {\n enumerable: true,\n get: function get() {\n return _actions.ActionTypes;\n }\n});\nObject.defineProperty(exports, \"ActionCreators\", {\n enumerable: true,\n get: function get() {\n return _actions.ActionCreators;\n }\n});\nObject.defineProperty(exports, \"parseActions\", {\n enumerable: true,\n get: function get() {\n return _helpers.parseActions;\n }\n});\nObject.defineProperty(exports, \"isHistory\", {\n enumerable: true,\n get: function get() {\n return _helpers.isHistory;\n }\n});\nObject.defineProperty(exports, \"includeAction\", {\n enumerable: true,\n get: function get() {\n return _helpers.includeAction;\n }\n});\nObject.defineProperty(exports, \"excludeAction\", {\n enumerable: true,\n get: function get() {\n return _helpers.excludeAction;\n }\n});\nObject.defineProperty(exports, \"combineFilters\", {\n enumerable: true,\n get: function get() {\n return _helpers.combineFilters;\n }\n});\nObject.defineProperty(exports, \"groupByActionTypes\", {\n enumerable: true,\n get: function get() {\n return _helpers.groupByActionTypes;\n }\n});\nObject.defineProperty(exports, \"newHistory\", {\n enumerable: true,\n get: function get() {\n return _helpers.newHistory;\n }\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function get() {\n return _reducer[\"default\"];\n }\n});\n\nvar _actions = require(\"./actions\");\n\nvar _helpers = require(\"./helpers\");\n\nvar _reducer = _interopRequireDefault(require(\"./reducer\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Function for interacting with application and module metadata.\n */\nconst MetadataManager = (() => {\n let applicationMetadata = null;\n let moduleMetadata = [];\n /**\n * Register application metadata.\n *\n * @param applicationProps Application metadata to register.\n */\n const registerApplication = (applicationProps) => {\n applicationMetadata = applicationProps;\n };\n /**\n * Register module metadata.\n *\n * @param moduleProps Module metadata to register.\n */\n const registerModule = (moduleProps) => {\n moduleMetadata = [\n ...moduleMetadata.filter(m => m.moduleId !== moduleProps.moduleId),\n moduleProps\n ];\n };\n /**\n * Update and/or add some properties of the application metadata and saves it.\n * The new properties must be a subset of {@link IApplicationMetadata}.\n *\n * @param applicationProps The properties to update.\n */\n const updateApplication = (applicationProps) => {\n applicationMetadata = Object.assign(Object.assign({}, applicationMetadata), applicationProps);\n };\n /**\n * Update and/or add some properties of the module metadata and saves it.\n * The new properties must be a subset of {@link IModuleClient}.\n *\n * @param moduleProps The properties to update.\n * @param moduleId The module id.\n */\n const updateModule = (moduleProps, moduleId) => {\n const currentProps = getModuleMetadata(moduleId);\n moduleMetadata = [\n ...moduleMetadata.filter(m => m.moduleId !== moduleId),\n Object.assign(Object.assign({}, currentProps), moduleProps)\n ];\n };\n /**\n * Get the currently registered application metadata.\n *\n * @returns The registered application metadata if it exists.\n */\n const getApplicationMetadata = () => {\n return applicationMetadata;\n };\n /**\n * Get the registered module metadata for given module id.\n *\n * @param moduleId The module that you want to retrieve the metadata.\n * @returns The registered metadata as an object if it exists.\n */\n const getModuleMetadata = (moduleId) => {\n if (!moduleId) {\n return undefined;\n }\n return moduleMetadata.find(m => m.moduleId == moduleId) || null;\n };\n /**\n * Clear application and module metadata stored.\n */\n const clear = () => {\n applicationMetadata = null;\n moduleMetadata = [];\n };\n return {\n registerApplication,\n registerModule,\n updateApplication,\n updateModule,\n getApplicationMetadata,\n getModuleMetadata,\n clear\n };\n})();\nexports.default = MetadataManager;\n//# sourceMappingURL=MetadataManager.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst MetadataManager_1 = __importDefault(require(\"./MetadataManager\"));\nconst KEY = 'sequence_number';\n/**\n * Class for handling logic related to the sequence number.\n */\nclass SequenceNumberHandler {\n /**\n * Get the current sequence number.\n *\n * @returns The current sequence number.\n */\n getSequenceNumber() {\n const metadata = MetadataManager_1.default.getApplicationMetadata();\n return (metadata === null || metadata === void 0 ? void 0 : metadata.applicationId)\n ? Number(sessionStorage.getItem(metadata.applicationId.concat('_', KEY)))\n : 0;\n }\n /**\n * Reset sequence number to the default value.\n */\n resetSequenceNumber() {\n this.setSequenceNumber(0);\n }\n /**\n * Increment the current sequence number.\n */\n incrementSequenceNumber() {\n const value = this.getSequenceNumber();\n const updateValue = value + 1;\n this.setSequenceNumber(updateValue);\n }\n /**\n * Set the sequence number.\n *\n * @param value Sequence number to store.\n */\n setSequenceNumber(value) {\n const metadata = MetadataManager_1.default.getApplicationMetadata();\n if (metadata === null || metadata === void 0 ? void 0 : metadata.applicationId) {\n sessionStorage.setItem(metadata.applicationId.concat('_', KEY), String(value));\n }\n }\n}\nexports.default = SequenceNumberHandler;\n//# sourceMappingURL=SequenceNumberHandler.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar TrackingIdEnum;\n(function (TrackingIdEnum) {\n TrackingIdEnum[\"sessionIdKey\"] = \"session_id\";\n TrackingIdEnum[\"longTermIdKey\"] = \"long_term_id\";\n TrackingIdEnum[\"planningIdKey\"] = \"planning_id\";\n TrackingIdEnum[\"ipexIdKey\"] = \"ipex_id\";\n})(TrackingIdEnum || (TrackingIdEnum = {}));\nexports.default = TrackingIdEnum;\n//# sourceMappingURL=TrackingIdEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Utility class for random Id generation.\n */\nclass IdGenerator {\n /**\n * Generate a RFC4122 v4 compliant UUID.\n *\n * @returns The newly generated UUID.\n */\n uuidV4() {\n /* Tslint:disable:no-bitwise */\n let d = Date.now(); // Start with now as a seed\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, xy => {\n const r = (d + Math.random() * 16) % 16 | 0; // Generate a new random number\n const c = xy === 'x' ? r : (r & 0x3) | 0x8; // Make sure it's RFC4122 version 4 compliant\n d = Math.floor(d / 16); // Update the seed\n return c.toString(16); // Return the hex digit\n });\n /* Tslint:enable:no-bitwise */\n }\n}\nexports.default = IdGenerator;\n//# sourceMappingURL=IdGenerator.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst SequenceNumberHandler_1 = __importDefault(require(\"./SequenceNumberHandler\"));\nconst TrackingIdEnum_1 = __importDefault(require(\"../enums/TrackingIdEnum\"));\nconst IdGenerator_1 = __importDefault(require(\"./IdGenerator\"));\nconst MetadataManager_1 = __importDefault(require(\"./MetadataManager\"));\nconst localStorageKeys = [TrackingIdEnum_1.default.longTermIdKey, TrackingIdEnum_1.default.ipexIdKey];\nconst sessionStorageKeys = [TrackingIdEnum_1.default.sessionIdKey, TrackingIdEnum_1.default.planningIdKey];\n/**\n * Utility class for handling data about the session.\n */\nclass SessionManager {\n constructor() {\n this.sequenceNumber = new SequenceNumberHandler_1.default();\n this.idGenerator = new IdGenerator_1.default();\n }\n /**\n * Get the current session Id if one exists, or creates one and returns it if it doesn't.\n *\n * @param key The request session type.\n * @returns The valid tracking Id.\n */\n getValidId(key) {\n const trackingId = this.getId(key);\n if (trackingId) {\n return trackingId;\n }\n return this.createId(key);\n }\n /**\n * Update the time for when the session started to now, and saves it to storage.\n * Will throw an Error if no session exists.\n *\n * @param key The key for the id to update.\n * @returns The new session id object which has been saved.\n */\n updateIdTime(key) {\n const pastId = this.getId(key);\n if (!pastId) {\n throw Error('No session to update');\n }\n const newIdProps = {\n time: Date.now(),\n id: pastId.id\n };\n if (localStorageKeys.includes(key)) {\n localStorage.setItem(key, JSON.stringify(newIdProps));\n }\n else if (sessionStorageKeys.includes(key)) {\n this.safeSessionSet(key, newIdProps);\n }\n return newIdProps;\n }\n /**\n * Ensure the ids in local and session storage exist and are valid. Will create and/or update values if necessary.\n */\n updateIds() {\n const sessionId = this.getId(TrackingIdEnum_1.default.sessionIdKey);\n let longTermId = this.getId(TrackingIdEnum_1.default.longTermIdKey);\n let ipexId = this.getId(TrackingIdEnum_1.default.ipexIdKey);\n if (!longTermId) {\n longTermId = this.createId(TrackingIdEnum_1.default.longTermIdKey);\n }\n if (!ipexId || Date.now() - ipexId.time > 30 * 60 * 1000) {\n ipexId = this.createId(TrackingIdEnum_1.default.ipexIdKey);\n }\n else {\n this.updateIdTime(TrackingIdEnum_1.default.ipexIdKey);\n }\n if (!sessionId) {\n this.createId(TrackingIdEnum_1.default.sessionIdKey);\n this.sequenceNumber.resetSequenceNumber();\n return {\n ['long_term_id_created']: longTermId.time,\n ['ipex_id_created']: ipexId.time\n };\n }\n else if (Date.now() - sessionId.time > 30 * 60 * 1000) {\n // No interaction the past 30 minutes. Create a new session, but leave the long term id as is.\n this.createId(TrackingIdEnum_1.default.sessionIdKey);\n this.sequenceNumber.resetSequenceNumber();\n return {\n ['long_term_id_created']: longTermId.time,\n ['ipex_id_created']: ipexId.time\n };\n }\n else {\n this.updateIdTime(TrackingIdEnum_1.default.sessionIdKey);\n return undefined;\n }\n }\n /**\n * Clear all session related data.\n */\n clearSessions() {\n localStorage.clear();\n sessionStorage.clear();\n }\n /**\n * Create a new id for given key, generates an uuidV4 as id and sets time to now.\n *\n * @param key The key to generate a value for.\n * @param startSource Optional planning start source, which will be saved if the key is for planning ids.\n * @param sourceDesignId Optional design id, which will be saved if the key is for planning ids.\n * @param sourceSpr Optional spr source, which will be saved if the key is for planning ids.\n * @returns The new value object.\n */\n createId(key, startSource, sourceDesignId, sourceSpr) {\n const id = this.idGenerator.uuidV4();\n const newIdProps = {\n time: Date.now(),\n id\n };\n if (key === TrackingIdEnum_1.default.planningIdKey && startSource) {\n newIdProps.startSource = startSource;\n newIdProps.sourceDesignId = sourceDesignId;\n newIdProps.sourceSpr = sourceSpr;\n }\n if (localStorageKeys.includes(key)) {\n localStorage.setItem(key, JSON.stringify(newIdProps));\n }\n else if (sessionStorageKeys.includes(key)) {\n this.safeSessionSet(key, newIdProps);\n }\n return newIdProps;\n }\n /**\n * Get the value for supplied key.\n *\n * @param key The key which to look for.\n * @returns The value for the key. Will be null if no value exists.\n */\n getId(key) {\n if (localStorageKeys.includes(key)) {\n const idProps = localStorage.getItem(key);\n return idProps ? JSON.parse(idProps) : null;\n }\n else if (sessionStorageKeys.includes(key)) {\n return this.safeSessionGet(key);\n }\n return null;\n }\n /**\n * Get user ids.\n *\n * @returns The user ids (sessionId, planningId, longTermId and ipexId).\n */\n getIds() {\n var _a, _b, _c, _d;\n return {\n sessionId: (_a = this.getId(TrackingIdEnum_1.default.sessionIdKey)) === null || _a === void 0 ? void 0 : _a.id,\n planningId: (_b = this.getId(TrackingIdEnum_1.default.planningIdKey)) === null || _b === void 0 ? void 0 : _b.id,\n longTermId: (_c = this.getId(TrackingIdEnum_1.default.longTermIdKey)) === null || _c === void 0 ? void 0 : _c.id,\n ipexId: (_d = this.getId(TrackingIdEnum_1.default.ipexIdKey)) === null || _d === void 0 ? void 0 : _d.id\n };\n }\n /**\n * Save some props to a planner-prepended key, but only if planner name is registered in metadata.\n *\n * @param key The session storage key to save to.\n * @param props The props to save to the key.\n */\n safeSessionSet(key, props) {\n const metadata = MetadataManager_1.default.getApplicationMetadata();\n if ('applicationId' in metadata) {\n const applicationIdKey = metadata.applicationId.concat('_', key);\n sessionStorage.setItem(applicationIdKey, JSON.stringify(props));\n }\n }\n /**\n * Retrieve some props from a planner-prepended key, but only if planner name is registered in metadata.\n *\n * @param key The session storage key to save to.\n * @returns The ITrackingProps saved to the key if it exists, otherwise null.\n */\n safeSessionGet(key) {\n const metadata = MetadataManager_1.default.getApplicationMetadata();\n let idProps;\n if (metadata === null || metadata === void 0 ? void 0 : metadata.applicationId) {\n const applicationIdKey = metadata.applicationId.concat('_', key);\n idProps = sessionStorage.getItem(applicationIdKey);\n }\n return idProps ? JSON.parse(idProps) : null;\n }\n}\nexports.default = SessionManager;\n//# sourceMappingURL=SessionManager.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar IpexMomentEnum;\n(function (IpexMomentEnum) {\n IpexMomentEnum[\"giveMe\"] = \"give_me\";\n IpexMomentEnum[\"whatIsMe\"] = \"what_is_me\";\n IpexMomentEnum[\"showMe\"] = \"show_me\";\n IpexMomentEnum[\"makeItMe\"] = \"make_it_me\";\n IpexMomentEnum[\"helpMe\"] = \"help_me\";\n IpexMomentEnum[\"nonInteraction\"] = \"non_interaction\";\n})(IpexMomentEnum || (IpexMomentEnum = {}));\nexports.default = IpexMomentEnum;\n//# sourceMappingURL=IpexMomentEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Utility class for retrieving and handling cookie data.\n */\nclass CookieReader {\n /**\n * Read the Google Analytics clientId from the document cookie.\n *\n * @returns The GA clientId, extracted and trimmed from cookie.\n * @throws If there is no clientId in the cookie, or the cookie is incorrectly formatted.\n */\n getGaId() {\n const cookieSeparated = document.cookie.split('; ').filter(value => value.startsWith('_ga='));\n if (cookieSeparated.length == 0) {\n throw new Error('Unable to retrieve Google Analytics cookie.');\n }\n /* Some markets are setting two cookies with the same name\n * we want to filter out the one that has the following format\n * _ga=GA1.2.XXXXXXXXXX.XXXXXXXXXX\n */\n const gaCookie = cookieSeparated.filter(c => c.split('.').length == 4);\n if (!gaCookie.length) {\n throw new Error('GA cookie is incorrectly constructed.');\n }\n const cookieFields = gaCookie[0].split('.');\n return cookieFields[2] + '.' + cookieFields[3];\n }\n}\nexports.default = CookieReader;\n//# sourceMappingURL=CookieReader.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Utility class for retrieving document referrer.\n */\nclass EntryPoint {\n /**\n * Get document referrer.\n *\n * @returns The entry point as an object that contains host, pathname and search.\n */\n getEntryPoint() {\n const entryPoint = document.referrer;\n try {\n const url = new URL(entryPoint);\n return {\n host: url.host,\n pathname: url.pathname,\n search: url.search\n };\n }\n catch (e) {\n return undefined;\n }\n }\n}\nexports.default = EntryPoint;\n//# sourceMappingURL=EntryPoint.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar DesignInteractionEnum;\n(function (DesignInteractionEnum) {\n DesignInteractionEnum[\"getConfiguration\"] = \"get_configuration\";\n DesignInteractionEnum[\"storeConfiguration\"] = \"store_configuration\";\n})(DesignInteractionEnum || (DesignInteractionEnum = {}));\nexports.default = DesignInteractionEnum;\n//# sourceMappingURL=DesignInteractionEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst DesignInteractionEnum_1 = __importDefault(require(\"./DesignInteractionEnum\"));\nvar OtherEventsEnum;\n(function (OtherEventsEnum) {\n OtherEventsEnum[\"start\"] = \"start\";\n OtherEventsEnum[\"addToCart\"] = \"add_to_cart\";\n OtherEventsEnum[\"addToWishList\"] = \"add_to_wishlist\";\n OtherEventsEnum[\"initiatePlanningSession\"] = \"initiate_planning_session\";\n OtherEventsEnum[\"connectApplication\"] = \"connect_application\";\n OtherEventsEnum[\"pageview\"] = \"pageview\";\n OtherEventsEnum[\"articleAction\"] = \"article_action\";\n OtherEventsEnum[\"userFlow\"] = \"user_flow\";\n})(OtherEventsEnum || (OtherEventsEnum = {}));\nconst InsightsEventEnum = Object.assign(Object.assign({}, OtherEventsEnum), DesignInteractionEnum_1.default);\nexports.default = InsightsEventEnum;\n//# sourceMappingURL=InsightsEventEnum.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst SessionManager_1 = __importDefault(require(\"../utilities/SessionManager\"));\nconst SequenceNumberHandler_1 = __importDefault(require(\"../utilities/SequenceNumberHandler\"));\nconst IpexMomentEnum_1 = __importDefault(require(\"../enums/IpexMomentEnum\"));\nconst TrackingIdEnum_1 = __importDefault(require(\"../enums/TrackingIdEnum\"));\nconst CookieReader_1 = __importDefault(require(\"../utilities/CookieReader\"));\nconst EntryPoint_1 = __importDefault(require(\"../utilities/EntryPoint\"));\nconst InsightsEventEnum_1 = __importDefault(require(\"../enums/InsightsEventEnum\"));\nconst MetadataManager_1 = __importDefault(require(\"../utilities/MetadataManager\"));\n/**\n * Class for handling logic about sending events to Insights.\n */\nclass InsightsTarget {\n constructor() {\n this.sessionManager = new SessionManager_1.default();\n this.sequenceNumberHandler = new SequenceNumberHandler_1.default();\n this.cookie = new CookieReader_1.default();\n }\n /**\n * Sends a given set of data to Ipex Insights.\n *\n * @param ipexMoment The IPEX moment for the event.\n * @param name Name of the event.\n * @param payload Optional payload.\n * @param eventData Event data to send.\n */\n sendInsightsEvent(ipexMoment, name, eventData, payload) {\n return __awaiter(this, void 0, void 0, function* () {\n const applicationMetadata = MetadataManager_1.default.getApplicationMetadata();\n const moduleMetadata = MetadataManager_1.default.getModuleMetadata(this.moduleId);\n this.checkEventSchema(name, ipexMoment, applicationMetadata);\n const eventBody = this.constructEventBody(ipexMoment, name, applicationMetadata, eventData, payload);\n this.sequenceNumberHandler.incrementSequenceNumber();\n const dev = applicationMetadata.dev || (moduleMetadata === null || moduleMetadata === void 0 ? void 0 : moduleMetadata.dev);\n const domain = this.getIpexDomain(dev);\n const key = this.getIpexStreamKey(dev);\n try {\n yield fetch(domain, {\n method: 'POST',\n body: JSON.stringify(eventBody),\n headers: { 'x-api-key': key, 'Content-Type': 'application/json' }\n });\n }\n catch (error) {\n throw new Error(`Failed to send ${name} event, ${error}`);\n }\n });\n }\n /**\n * Create and populate event data object according to IEventSchema.\n *\n * @param ipexMoment Moment for the event.\n * @param name Name of the event.\n * @param applicationMetadata The application metadata.\n * @param eventData Optional eventData.\n * @param payload Optional payload.\n * @returns An event body, conforming to the IEventSchema type.\n */\n constructEventBody(ipexMoment, name, applicationMetadata, eventData, payload) {\n const location = window === null || window === void 0 ? void 0 : window.location;\n const eventBody = {\n event: name,\n moment: ipexMoment,\n ['app_id']: applicationMetadata.applicationId,\n ['session_id']: this.sessionManager.getId(TrackingIdEnum_1.default.sessionIdKey).id,\n ['sequence_nbr']: this.sequenceNumberHandler.getSequenceNumber(),\n ['visitor_timestamp']: Date.now(),\n ['meta']: this.constructMetadata(applicationMetadata),\n page: {\n origin: location === null || location === void 0 ? void 0 : location.origin,\n pathname: location === null || location === void 0 ? void 0 : location.pathname,\n ['query_param']: location === null || location === void 0 ? void 0 : location.search\n }\n };\n if (name == InsightsEventEnum_1.default.start) {\n const entryPoint = new EntryPoint_1.default().getEntryPoint();\n eventBody['meta']['entry_point'] = entryPoint;\n }\n const optionalParams = {\n ['payload']: JSON.stringify(payload),\n ['event_data']: eventData,\n planning: this.constructPlanningData(),\n module: this.constructModuleData()\n };\n for (const [key, value] of Object.entries(optionalParams)) {\n this.addOptionalParameter(eventBody, key, value);\n }\n return eventBody;\n }\n /**\n * Create and populate metatadata, to be added to the object body.\n *\n * @param appData Application metadata.\n * @returns An IMetaDataSchema object, with all relevant parameters set.\n */\n constructMetadata(appData) {\n const pjson = require('../../package.json');\n const metadata = {\n ['ipex_session_id']: this.sessionManager.getId(TrackingIdEnum_1.default.ipexIdKey).id,\n ['long_term_id']: this.sessionManager.getId(TrackingIdEnum_1.default.longTermIdKey).id,\n ['app_version']: appData.applicationVersion,\n ['dpc_version']: pjson.version,\n platform: appData.platform,\n ['country_code']: appData.countryCode,\n ['language_code']: appData.languageCode,\n ['is_planner']: appData.isPlanner\n };\n if (appData.abVersionName || appData.abVersionVariation) {\n metadata['ab_version'] = {\n name: appData.abVersionName || '',\n variation: appData.abVersionVariation || ''\n };\n }\n if (appData.enableGa === true) {\n let clientId;\n try {\n clientId = this.cookie.getGaId();\n }\n catch (error) {\n // eslint-disable-next-line\n console.error(error);\n }\n metadata['ga_client_id'] = clientId || '';\n }\n const optionalParams = {\n ['store_id']: appData.storeId,\n kiosk: appData.kiosk,\n ['kiosk_id']: appData.kioskId\n };\n for (const [key, value] of Object.entries(optionalParams)) {\n this.addOptionalParameter(metadata, key, value);\n }\n return metadata;\n }\n /**\n * Create planning data for the event body, with the appropriate structure.\n * Will set optional parameters only if they are present (i.e. Not undefined).\n *\n * @returns Planning data, as an IPlanning object.\n */\n constructPlanningData() {\n const planningId = this.sessionManager.getId(TrackingIdEnum_1.default.planningIdKey);\n if (planningId == null) {\n return undefined;\n }\n const planningData = {\n ['planning_id']: planningId.id,\n ['start_source']: planningId.startSource\n };\n this.addOptionalParameter(planningData, 'source_design_id', planningId.sourceDesignId);\n this.addOptionalParameter(planningData, 'source_spr', planningId.sourceSpr);\n return planningData;\n }\n /**\n * Create module data for the event body, with the appropriate structure.\n * Will set optional parameters only if they are present (i.e. Not undefined).\n *\n * @returns ModuleData Module data, as an IModuleData object.\n */\n constructModuleData() {\n const metadata = MetadataManager_1.default.getModuleMetadata(this.moduleId);\n if (!metadata) {\n return undefined;\n }\n const moduleData = {\n ['module_id']: metadata.moduleId,\n ['module_version']: metadata.moduleVersion\n };\n if (metadata.abVersionName || metadata.abVersionVariation) {\n moduleData['module_ab_version'] = {\n name: metadata.abVersionName || '',\n variation: metadata.abVersionVariation || ''\n };\n }\n return moduleData;\n }\n /**\n * Helper method to add optional parameters to objects.\n *\n * @param obj The object to add a parameter to.\n * @param key Thge parameter to add.\n * @param val The value of the parameter.\n */\n addOptionalParameter(obj, key, val) {\n if (val !== undefined) {\n obj[key] = val;\n }\n }\n /**\n * Get the domain URL for web events depending on if development or production environment.\n *\n * @param dev True if using the development environment, false if production.\n * @returns The domain URL address.\n */\n getIpexDomain(dev) {\n return dev\n ? 'https://dpc-qa.ipex-insights.com/event/submit'\n : 'https://dpc.ipex-insights.com/event/submit';\n }\n /**\n * Get the stream key for events depending on if development or production.\n *\n * @param dev True if using the development environment, false if production.\n * @returns The x-api-key for the IPEX stream.\n */\n getIpexStreamKey(dev) {\n return dev\n ? 'puIswII0bn2UxyC9IL8KI3aWnYCeIQmv2tya5v7b'\n : 'rZQMCYLyig4uqKOCiRBY78ypyNfCE9Cz7XVh7XdV';\n }\n /**\n * Checks if the event name is valid.\n *\n * @param eventName The event name.\n * @param moment The IPEX moment.\n * @param applicationMetadata The app metadata.\n * @throws An Error if eventName, moment, app_id or module_id are incorrect.\n */\n checkEventSchema(eventName, moment, applicationMetadata) {\n if (typeof eventName !== 'string') {\n throw Error('Insights event name not defined. Will not send event.');\n }\n if (eventName.match(/[^A-Za-z0-9_]/g)) {\n throw Error(`Insights event ${eventName} contains special characters. Only alphanumerics and underscores are allowed.`);\n }\n if (eventName.length <= 3 || eventName.length > 40) {\n throw Error(`Insights event name ${eventName} too long or too short. Please keep it between 3 and 40 characters.`);\n }\n if (!applicationMetadata || Object.keys(applicationMetadata).length === 0) {\n throw Error(`Failed to send ${eventName} event, application metadata not found.`);\n }\n const applicationId = applicationMetadata.applicationId;\n if (applicationId.match(/[^A-Za-z0-9_äÄåÅöÖ]/g)) {\n throw Error(`Application id ${applicationId} contains special characters. Only alphanumerics and underscores are allowed.`);\n }\n const moduleId = this.moduleId || '';\n if (moduleId.match(/[^A-Za-z0-9_äÄåÅöÖ]/g)) {\n throw Error(`Module id ${moduleId} contains special characters. Only alphanumerics and underscores are allowed.`);\n }\n if (!Object.values(IpexMomentEnum_1.default).includes(moment)) {\n throw Error(`Failed to send ${eventName}, moment ${moment} does not exist in IpexMomentEnum.`);\n }\n }\n}\nexports.default = InsightsTarget;\n//# sourceMappingURL=InsightsTarget.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst MetadataManager_1 = __importDefault(require(\"../utilities/MetadataManager\"));\nconst TEAM = 'ipexinsights';\n/**\n * Class for using Google Analytics and sending events.\n */\nclass GoogleAnalyticsTarget {\n /**\n * Set up the Google Analytics integration based on given properties.\n * Will initialize and send the first required event.\n * Requires the Google Analytics script to be loaded in advance.\n *\n * @param props Parameters needed to initiate Google Analytics.\n * @returns A Promise from window.sendEvent.\n */\n setupGoogleAnalytics(props) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.checkGaEnabled()) {\n try {\n return yield window\n .analyticsInit({\n countryCode: props.countryCode,\n languageCode: props.language,\n platform: props.platform,\n plannerName: props.plannerName,\n dev: props.dev\n })\n .then(() => {\n return this.sendPageViewEvent();\n });\n }\n catch (e) {\n // eslint-disable-next-line\n console.error(e);\n }\n }\n });\n }\n /**\n * Send a given set of data to Google Analytics.\n *\n * @param category The category the event belongs to.\n * @param action The action being performed in the event.\n * @param label Event label, optional.\n * @param custom Parameters to include in the custom dimension.\n */\n sendGoogleAnalyticsEvent(category, action, label, custom) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.checkGaEnabled()) {\n try {\n return yield window.sendEvent({\n ['event_category']: category,\n ['event_action']: action,\n ['event_label']: label,\n custom: Object.assign({ team: TEAM }, custom)\n });\n }\n catch (e) {\n // eslint-disable-next-line\n console.error(e);\n }\n }\n });\n }\n /**\n * Send an event to Google Analytics with a name and a set of parameters.\n *\n * @param name Name of the event to be sent.\n * @param params Parameters to include in the event.\n * @param custom Parameters to include in the custom dimension.\n */\n sendGoogleAnalyticsEventWithParams(name, params, custom) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.checkGaEnabled()) {\n try {\n return yield window.sendEvent({\n name: name,\n params: params,\n custom: Object.assign({ team: TEAM }, custom)\n });\n }\n catch (e) {\n // eslint-disable-next-line\n console.error(e);\n }\n }\n });\n }\n /**\n * Check app metadata to see if GA is enabled.\n *\n * @returns True if GA is enabled, false if it's not, or if it's not defined.\n */\n checkGaEnabled() {\n const appMeta = MetadataManager_1.default.getApplicationMetadata();\n if (!('enableGa' in appMeta)) {\n return false;\n }\n if (appMeta.enableGa == null || appMeta.enableGa === false) {\n return false;\n }\n return true;\n }\n /**\n * Send the initial page view event required for Google Analytics to work.\n *\n * @returns A Promise from window.sendEvent.\n */\n sendPageViewEvent() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.checkGaEnabled()) {\n try {\n return yield window.sendEvent({\n ['event_category']: 'pageview',\n ['page_path']: window.location.pathname,\n ['page_location']: window.location.href,\n custom: {\n team: TEAM\n }\n });\n }\n catch (e) {\n // eslint-disable-next-line\n console.error(e);\n }\n }\n });\n }\n}\nexports.default = GoogleAnalyticsTarget;\n//# sourceMappingURL=GoogleAnalyticsTarget.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar GaEventEnum;\n(function (GaEventEnum) {\n GaEventEnum[\"savePlanner\"] = \"save_planner\";\n GaEventEnum[\"addToWishlist\"] = \"add_to_wishlist\";\n GaEventEnum[\"addToCart\"] = \"add_to_cart\";\n GaEventEnum[\"openPlanner\"] = \"open_planner\";\n})(GaEventEnum || (GaEventEnum = {}));\nexports.default = GaEventEnum;\n//# sourceMappingURL=GaEventEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar GaCategoryEnum;\n(function (GaCategoryEnum) {\n GaCategoryEnum[\"ecommerce\"] = \"ecommerce\";\n GaCategoryEnum[\"planners\"] = \"planners\";\n GaCategoryEnum[\"nonInteraction\"] = \"non_interaction\";\n})(GaCategoryEnum || (GaCategoryEnum = {}));\nexports.default = GaCategoryEnum;\n//# sourceMappingURL=GaCategoryEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar DesignSourceEnum;\n(function (DesignSourceEnum) {\n DesignSourceEnum[\"clipboard\"] = \"clipboard\";\n DesignSourceEnum[\"designSearch\"] = \"design_search\";\n DesignSourceEnum[\"email\"] = \"email\";\n DesignSourceEnum[\"enterCode\"] = \"enter_code\";\n DesignSourceEnum[\"gallery\"] = \"gallery\";\n DesignSourceEnum[\"imageDeeplink\"] = \"image_deeplink\";\n DesignSourceEnum[\"iSell\"] = \"i_sell\";\n DesignSourceEnum[\"planningSupportTool\"] = \"planning_support_tool\";\n DesignSourceEnum[\"qr\"] = \"qr\";\n DesignSourceEnum[\"recommendation\"] = \"recommendation\";\n DesignSourceEnum[\"resumeLastDesign\"] = \"resume_last_design\";\n DesignSourceEnum[\"retailerSystem\"] = \"retailer_system\";\n DesignSourceEnum[\"salesSystem\"] = \"sales_system\";\n DesignSourceEnum[\"searchBar\"] = \"search_bar\";\n DesignSourceEnum[\"skytta\"] = \"skytta\";\n DesignSourceEnum[\"sms\"] = \"sms\";\n DesignSourceEnum[\"spr\"] = \"spr\";\n DesignSourceEnum[\"startFromSaved\"] = \"start_from_saved\";\n DesignSourceEnum[\"startFromScratch\"] = \"start_from_scratch\";\n DesignSourceEnum[\"startFromTemplate\"] = \"start_from_template\";\n})(DesignSourceEnum || (DesignSourceEnum = {}));\nexports.default = DesignSourceEnum;\n//# sourceMappingURL=DesignSourceEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ArticleActionEnum;\n(function (ArticleActionEnum) {\n ArticleActionEnum[\"add\"] = \"add\";\n ArticleActionEnum[\"delete\"] = \"delete\";\n ArticleActionEnum[\"move\"] = \"move\";\n ArticleActionEnum[\"select\"] = \"select\";\n ArticleActionEnum[\"copy\"] = \"copy\";\n ArticleActionEnum[\"rotate\"] = \"rotate\";\n})(ArticleActionEnum || (ArticleActionEnum = {}));\nexports.default = ArticleActionEnum;\n//# sourceMappingURL=ArticleActionEnum.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst InsightsTarget_1 = __importDefault(require(\"./targets/InsightsTarget\"));\nconst GoogleAnalyticsTarget_1 = __importDefault(require(\"./targets/GoogleAnalyticsTarget\"));\nconst IpexMomentEnum_1 = __importDefault(require(\"./enums/IpexMomentEnum\"));\nconst GaEventEnum_1 = __importDefault(require(\"./enums/GaEventEnum\"));\nconst GaCategoryEnum_1 = __importDefault(require(\"./enums/GaCategoryEnum\"));\nconst DesignSourceEnum_1 = __importDefault(require(\"./enums/DesignSourceEnum\"));\nconst SessionManager_1 = __importDefault(require(\"./utilities/SessionManager\"));\nconst DesignInteractionEnum_1 = __importDefault(require(\"./enums/DesignInteractionEnum\"));\nconst TrackingIdEnum_1 = __importDefault(require(\"./enums/TrackingIdEnum\"));\nconst ArticleActionEnum_1 = __importDefault(require(\"./enums/ArticleActionEnum\"));\nconst InsightsEventEnum_1 = __importDefault(require(\"./enums/InsightsEventEnum\"));\nconst MetadataManager_1 = __importDefault(require(\"./utilities/MetadataManager\"));\n/**\n * Class for sending of events to various sources.\n */\nclass EventSender {\n constructor() {\n this.insights = new InsightsTarget_1.default();\n this.sessionManager = new SessionManager_1.default();\n this.googleAnalytics = new GoogleAnalyticsTarget_1.default();\n }\n /**\n * Set the module id in insights target.\n *\n * @param moduleId The module id.\n */\n setTargetModuleId(moduleId) {\n this.insights.moduleId = moduleId;\n }\n /**\n * Set up Google Analytics, and send open_planner events to Insights and GA.\n *\n * @param props Properties for the init event.\n * @returns The promise for setupGoogleAnalytics.\n */\n setupAndSendInit(props) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.sendApplicationStartUpEvents();\n return this.googleAnalytics\n .setupGoogleAnalytics({\n countryCode: props.countryCode.toLowerCase(),\n language: props.languageCode.toLowerCase(),\n plannerName: props.applicationId,\n dev: !!props.dev,\n platform: props.platform\n })\n .then(() => __awaiter(this, void 0, void 0, function* () {\n const session = this.sessionManager.getValidId(TrackingIdEnum_1.default.sessionIdKey);\n this.googleAnalytics.sendGoogleAnalyticsEvent(GaCategoryEnum_1.default.planners, GaEventEnum_1.default.openPlanner, session.id);\n }));\n });\n }\n /**\n * Send an add_to_cart event to Insights and GA.\n *\n * @param data Items added to cart.\n */\n sendAddToCart(data) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n yield this.updateLocalIds();\n yield Promise.all([\n this.insights.sendInsightsEvent(IpexMomentEnum_1.default.giveMe, InsightsEventEnum_1.default.addToCart, {\n currency: data.currency,\n ['design_id']: data.designId ? data.designId : null,\n articles: data.items,\n ['unavailable_articles']: data.unavailableItems ? data.unavailableItems : null\n }, data.payload),\n this.googleAnalytics.sendGoogleAnalyticsEventWithParams(GaEventEnum_1.default.addToCart, {\n currency: data.currency,\n items: data.items.map(item => ({\n id: item.id,\n price: item.price,\n quantity: item.qty\n }))\n }, {\n // This is custom dimension 47 and will be renamed to planner_product_combination_id on the server side\n ['planning_id']: (_a = data.designId) !== null && _a !== void 0 ? _a : null\n })\n ]);\n });\n }\n /**\n * Send an add_to_wishlist event to Insights and GA.\n *\n * @param data Items added to wish list.\n */\n sendAddToWishList(data) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n yield this.updateLocalIds();\n yield Promise.all([\n this.insights.sendInsightsEvent(IpexMomentEnum_1.default.giveMe, InsightsEventEnum_1.default.addToWishList, {\n currency: data.currency,\n ['design_id']: (_a = data.designId) !== null && _a !== void 0 ? _a : null,\n articles: data.items\n }, data.payload),\n this.googleAnalytics.sendGoogleAnalyticsEvent(GaCategoryEnum_1.default.ecommerce, GaEventEnum_1.default.addToWishlist, undefined, {\n // Custom dimension 47\n ['planning_id']: (_b = data.designId) !== null && _b !== void 0 ? _b : null\n })\n ]);\n });\n }\n /**\n *\n * @param designId The design id that started the planning session.\n * @param source The source of the planning session.\n * @param payload The payload data.\n * @param spr The SPR that was used as base for the planning if any.\n * @throws If source does not exist in DesignSourceEnum.\n */\n sendInitPlanningSession(designId, source, payload, spr) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!Object.values(DesignSourceEnum_1.default).includes(source)) {\n throw Error(`Failed to send event, design source ${source} is not a valid source. Check DesignSourceEnum.`);\n }\n this.updateDesignId(designId, source);\n this.sessionManager.createId(TrackingIdEnum_1.default.planningIdKey, source, designId, spr);\n yield this.updateLocalIds();\n // Planning data is sent automatically when the event is created.\n yield this.insights.sendInsightsEvent(IpexMomentEnum_1.default.nonInteraction, InsightsEventEnum_1.default.initiatePlanningSession, undefined, payload);\n });\n }\n /**\n * Send a save_planner event to Insights and GA.\n *\n * @param designId The design id to save.\n * @param payload The payload data.\n */\n sendSavePlanner(designId, payload) {\n return __awaiter(this, void 0, void 0, function* () {\n const metadata = MetadataManager_1.default.getApplicationMetadata();\n yield this.updateLocalIds();\n yield Promise.all([\n this.insights.sendInsightsEvent(IpexMomentEnum_1.default.giveMe, 'save_planner', {\n ['design_id']: designId\n }, payload),\n this.googleAnalytics.sendGoogleAnalyticsEvent(GaCategoryEnum_1.default.planners, GaEventEnum_1.default.savePlanner, metadata.applicationId, {\n // Custom dimension 47\n ['planning_id']: designId\n })\n ]);\n });\n }\n /**\n * Send a custom event to Insights. The name of the event is contained in data.event.\n *\n * @param data Data sent with the event.\n */\n sendCustomEvent(data) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.updateLocalIds();\n yield this.insights.sendInsightsEvent(data.ipexMoment, data.event, undefined, data.payload);\n });\n }\n /**\n * Send a design interaction event to Insights.\n *\n * @param designId The design id which was interacted with.\n * @param interaction The interaction source.\n * @param payload The payload data.\n * @throws An Error if interaction is incorrect.\n */\n sendDesignInteractionEvent(designId, interaction, payload) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!Object.values(DesignInteractionEnum_1.default).includes(interaction)) {\n throw Error(`Failed to send event, interaction ${interaction} is not a valid interaction. Check DesignInteractionEnum.`);\n }\n yield this.updateLocalIds();\n yield this.insights.sendInsightsEvent(IpexMomentEnum_1.default.nonInteraction, interaction, {\n ['design_id']: designId\n }, payload);\n });\n }\n /**\n * Send an article_action event to Insights.\n *\n * @param articleId The article id.\n * @param action The action being performed.\n * @param isGlobal Indicate if article id is global or local.\n * @param [payload] Optional payload data.\n * @throws An Error if action is incorrect.\n */\n sendArticleAction(articleId, action, isGlobal, payload) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!Object.values(ArticleActionEnum_1.default).includes(action)) {\n throw Error(`Failed to send event, action ${action} is not a valid interaction. Check ArticleActionEnum.`);\n }\n yield this.updateLocalIds();\n yield this.insights.sendInsightsEvent(IpexMomentEnum_1.default.makeItMe, InsightsEventEnum_1.default.articleAction, {\n ['article_action']: action,\n ['article_id']: articleId,\n ['is_global']: isGlobal\n }, payload);\n });\n }\n /**\n * Send a flow step event to Insights.\n *\n * @param flowName Name of the flow.\n * @param stepName Name of the step in the flow.\n * @param stepLevel Level of step in the flow.\n */\n sendUserFlowStep(flowName, stepName, stepLevel, payload) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.updateLocalIds();\n yield this.insights.sendInsightsEvent(IpexMomentEnum_1.default.nonInteraction, InsightsEventEnum_1.default.userFlow, {\n ['flow_name']: flowName,\n ['step_name']: stepName,\n ['step_level']: stepLevel\n }, payload);\n });\n }\n /**\n * Send mandatory startup event for the module client flow.\n */\n sendModuleStartUpEvents() {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.updateLocalIds();\n yield this.insights.sendInsightsEvent(IpexMomentEnum_1.default.nonInteraction, 'connect_module');\n });\n }\n /**\n * Send mandatory startup event for the application startup flow.\n */\n sendApplicationStartUpEvents() {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.updateLocalIds();\n yield this.insights.sendInsightsEvent(IpexMomentEnum_1.default.nonInteraction, InsightsEventEnum_1.default.connectApplication);\n });\n }\n /**\n * Send AB version changed event.\n */\n sendSetAbVersion() {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.updateLocalIds();\n yield this.insights.sendInsightsEvent(IpexMomentEnum_1.default.nonInteraction, 'set_ab_version');\n });\n }\n /**\n * Register a design id in the metadata, or throw an Error if it's empty/undefined and source is incorrect.\n * If the design id is empty/undefined and the source is start_from_scratch, start_from_template,\n * or resume_last_design, design id will be registered as start_from_scratch, start_from_template,\n * or resume_last_design respectively.\n *\n * @param designId The design id to update.\n * @param source The source of the planning session.\n */\n updateDesignId(designId, source) {\n if (!designId &&\n source !== DesignSourceEnum_1.default.startFromScratch &&\n source !== DesignSourceEnum_1.default.startFromTemplate &&\n source !== DesignSourceEnum_1.default.resumeLastDesign) {\n // Will throw an error if no design id is provided (or it's empty), given source is not start_from_scratch\n throw Error('No design id provided');\n }\n else if (!designId && source === DesignSourceEnum_1.default.startFromScratch) {\n MetadataManager_1.default.updateApplication({ designId: 'start_from_scratch' });\n }\n else if (!designId && source === DesignSourceEnum_1.default.startFromTemplate) {\n MetadataManager_1.default.updateApplication({ designId: 'start_from_template' });\n }\n else if (!designId && source === DesignSourceEnum_1.default.resumeLastDesign) {\n MetadataManager_1.default.updateApplication({ designId: 'resume_last_design' });\n }\n else {\n MetadataManager_1.default.updateApplication({ designId });\n }\n }\n /**\n * Update all local Ids through the session manager, then sends a start event if a new Id was generated.\n */\n updateLocalIds() {\n return __awaiter(this, void 0, void 0, function* () {\n const eventData = this.sessionManager.updateIds();\n if (eventData !== undefined) {\n yield this.insights.sendInsightsEvent(IpexMomentEnum_1.default.nonInteraction, InsightsEventEnum_1.default.start, eventData);\n }\n });\n }\n}\nexports.default = EventSender;\n//# sourceMappingURL=EventSender.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst GA_SCRIPT_URL = 'https://www.ikea.com/se/sv/analytics/scripts/analytics-minor.min.js';\nconst TYPE = 'text/javascript';\n/**\n * Utility class for loading the INGKA GA script, necessary for setting up Google Analytics.\n */\nclass GAScriptLoader {\n /**\n * Check if the GA script is already loaded, and constructs and loads it if not.\n *\n * @returns The Promise from {@link constructScriptElement}, or an autoresolved Promise if already loaded.\n */\n loadGoogleAnalyticsScript() {\n return __awaiter(this, void 0, void 0, function* () {\n let scriptLoaded = false;\n const scripts = document.getElementsByTagName('script');\n // Loop through all script tags\n Array.from(scripts).forEach(script => {\n if (script.src && script.src === GA_SCRIPT_URL && script.type && script.type === TYPE) {\n scriptLoaded = true;\n }\n });\n if (!scriptLoaded) {\n try {\n yield this.constructScriptElement();\n return Promise.resolve();\n }\n catch (e) {\n return Promise.reject(e);\n }\n }\n return Promise.resolve();\n });\n }\n /**\n * Construct the script element, and appends it to document.head.\n *\n * @returns A promise for loading the script.\n */\n constructScriptElement() {\n return new Promise((resolve, reject) => {\n const script = document.createElement('script');\n script.src = GA_SCRIPT_URL;\n script.type = TYPE;\n script.async = true;\n document.head.appendChild(script);\n script.addEventListener('load', () => {\n resolve(script);\n });\n script.addEventListener('error', () => {\n reject(new Error(`${GA_SCRIPT_URL} failed to load.`));\n });\n });\n }\n}\nexports.default = GAScriptLoader;\n//# sourceMappingURL=GAScriptLoader.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar PlatformEnum;\n(function (PlatformEnum) {\n PlatformEnum[\"owfe\"] = \"owfe\";\n PlatformEnum[\"nonIrw\"] = \"non_irw\";\n PlatformEnum[\"kiosk\"] = \"kiosk\";\n})(PlatformEnum || (PlatformEnum = {}));\nexports.default = PlatformEnum;\n//# sourceMappingURL=PlatformEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst EventSender_1 = __importDefault(require(\"./EventSender\"));\nconst MetadataManager_1 = __importDefault(require(\"./utilities/MetadataManager\"));\n/**\n * Entrypoint API class for modules.\n */\nclass ModuleClient {\n /**\n * @param moduleMetadata The module metadata.\n * @param insightsApi The insightsApi instance.\n */\n constructor(moduleMetadata, insightsApi) {\n this.insightsApi = null;\n this.insightsApi = insightsApi;\n this.eventSender = new EventSender_1.default();\n MetadataManager_1.default.registerModule(moduleMetadata);\n this.moduleId = moduleMetadata.moduleId;\n this.eventSender.setTargetModuleId(moduleMetadata.moduleId);\n this.eventSender.sendModuleStartUpEvents();\n }\n /**\n * Send an addToCart event, if application is enabled.\n *\n * @param data The included items in the cart.\n */\n addToCart(data) {\n if (this.insightsApi.isEnabled) {\n this.eventSender.sendAddToCart(data);\n }\n }\n /**\n * Send an addToWishList event, if application is enabled.\n *\n * @param data The included items in the wish list.\n */\n addToWishList(data) {\n if (this.insightsApi.isEnabled) {\n this.eventSender.sendAddToWishList(data);\n }\n }\n /**\n * Send a savePlanner event, if application is enabled.\n *\n * @param designId The design id to save, optional.\n * @param [payload] Optional payload data.\n */\n saveDesign(designId, payload) {\n if (this.insightsApi.isEnabled) {\n this.eventSender.sendSavePlanner(designId, payload);\n }\n }\n /**\n * Send a custom event, if application is enabled.\n *\n * @param data The information about the custom event.\n */\n sendEvent(data) {\n if (this.insightsApi.isEnabled) {\n this.eventSender.sendCustomEvent(data);\n }\n }\n /**\n * Send an initPlanningSession event, if application is enabled.\n *\n * @param designId The design id that started the session.\n * @param source The source of the planning session.\n * @param [payload] Optional payload data.\n * @param [spr] Optional The SPR that was used as base for the planning if any.\n */\n initPlanningSession(designId, source, payload, spr) {\n if (this.insightsApi.isEnabled) {\n this.eventSender.sendInitPlanningSession(designId, source, payload, spr);\n }\n }\n /**\n * Send a design interaction event, if application is enabled.\n *\n * @param designId The design id which was interacted with.\n * @param interaction The interaction source.\n * @param [payload] Optional payload data.\n */\n sendDesignInteractionEvent(designId, interaction, payload) {\n if (this.insightsApi.isEnabled) {\n this.eventSender.sendDesignInteractionEvent(designId, interaction, payload);\n }\n }\n /**\n * Send a article action event, if application is enabled.\n *\n * @param articleId The article id.\n * @param action The action being performed.\n * @param isGlobal Indicate if article id is global or local.\n * @param [payload] Optional payload data.\n */\n articleAction(articleId, action, isGlobal, payload) {\n if (this.insightsApi.isEnabled) {\n this.eventSender.sendArticleAction(articleId, action, isGlobal, payload);\n }\n }\n /**\n * Sets the A/B version for the session to facilitate A/B testing, if application is enabled.\n *\n * @param abVersionName Name of the ab version.\n * @param abVersionVariation Optional ab varation.\n */\n setAbVersion(abVersionName, abVersionVariation) {\n if (this.insightsApi.isEnabled) {\n MetadataManager_1.default.updateModule({\n abVersionName,\n abVersionVariation\n }, this.moduleId);\n this.eventSender.sendSetAbVersion();\n }\n }\n /**\n * Send a flow step event, if the component is enabled.\n *\n * @param flowName Name of the flow.\n * @param stepName Name of the step in the flow.\n * @param stepLevel Level of step in the flow.\n */\n sendUserFlowStep(flowName, stepName, stepLevel, payload) {\n if (this.insightsApi.isEnabled) {\n this.eventSender.sendUserFlowStep(flowName, stepName, stepLevel, payload);\n }\n }\n /**\n * Get user ids.\n *\n * @returns The user ids (sessionId, planningId, longTermId and ipexId).\n */\n getIds() {\n if (this.insightsApi.isEnabled) {\n return this.insightsApi.getIds();\n }\n }\n}\nexports.default = ModuleClient;\n//# sourceMappingURL=ModuleClient.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst EventSender_1 = __importDefault(require(\"./EventSender\"));\nconst SessionManager_1 = __importDefault(require(\"./utilities/SessionManager\"));\nconst SequenceNumberHandler_1 = __importDefault(require(\"./utilities/SequenceNumberHandler\"));\nconst GAScriptLoader_1 = __importDefault(require(\"./utilities/GAScriptLoader\"));\nconst PlatformEnum_1 = __importDefault(require(\"./enums/PlatformEnum\"));\nconst ModuleClient_1 = __importDefault(require(\"./ModuleClient\"));\nconst CookieReader_1 = __importDefault(require(\"./utilities/CookieReader\"));\nconst MetadataManager_1 = __importDefault(require(\"./utilities/MetadataManager\"));\n/**\n * Entrypoint API class for applications.\n */\nclass InsightsApi {\n constructor() {\n // eslint-disable-next-line\n this._isEnabled = false;\n this.eventSender = new EventSender_1.default();\n this.session = new SessionManager_1.default();\n this.sequenceNumber = new SequenceNumberHandler_1.default();\n }\n /**\n *\tReturns a boolean that indicates whether or not insights api is enabled.\n */\n get isEnabled() {\n return this._isEnabled;\n }\n /**\n * Connect the component for an application.\n *\n * @param props Initialization data for the application.\n */\n connectApplication(props) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof props.applicationId !== 'string') {\n throw new Error('Property applicationId is not a string. DPC Initialization will not proceed.');\n }\n if (!Object.values(PlatformEnum_1.default).includes(props.platform)) {\n throw Error(`Platform ${props.platform} is not valid. Check PlatformEnum. DPC Initialization will not proceed.`);\n }\n if (props.kiosk) {\n props.platform = PlatformEnum_1.default.kiosk;\n }\n MetadataManager_1.default.registerApplication(props);\n if (props.enableGa === true) {\n const cookieReader = new CookieReader_1.default();\n try {\n cookieReader.getGaId();\n const scriptLoader = new GAScriptLoader_1.default();\n yield scriptLoader.loadGoogleAnalyticsScript();\n yield this.eventSender.setupAndSendInit(props);\n }\n catch (error) {\n // Disable GA in case we cannot find the cookie.\n // eslint-disable-next-line\n console.warn(`GA data not found. Disabling GA events.`);\n MetadataManager_1.default.updateApplication({ enableGa: false });\n // Send regular ApplicationStartUpEvents instead.\n yield this.eventSender.sendApplicationStartUpEvents();\n }\n }\n else {\n yield this.eventSender.sendApplicationStartUpEvents();\n }\n this._isEnabled = true;\n });\n }\n /**\n * Receive module initialization data and\n * returns instance of module client.\n *\n * @param moduleMetadata Initialization data for the module.\n * @returns The module client instance.\n */\n moduleClient(moduleMetadata) {\n if (typeof moduleMetadata.moduleId !== 'string') {\n throw new Error('Property moduleId is not a string. Module client initialization will not proceed.');\n }\n if (!this.isEnabled) {\n throw new Error('Application is not enabled. Module client initialization will not proceed.');\n }\n const applicationMetadata = MetadataManager_1.default.getApplicationMetadata();\n if (!applicationMetadata || Object.keys(applicationMetadata).length === 0) {\n throw new Error('Application metadata not found. Module client initialization will not proceed.');\n }\n return new ModuleClient_1.default(moduleMetadata, this);\n }\n /**\n * Disable the component. Will reset session data and metadata, as well as the sequence number.\n */\n disconnect() {\n this._isEnabled = false;\n this.session.clearSessions();\n this.sequenceNumber.resetSequenceNumber();\n MetadataManager_1.default.clear();\n }\n /**\n * Send an addToCart event, if the component is enabled.\n *\n * @param data The included items in the cart.\n */\n addToCart(data) {\n if (this.isEnabled) {\n this.eventSender.sendAddToCart(data);\n }\n }\n /**\n * Send an addToWishList event, if the component is enabled.\n *\n * @param data The included items in the wish list.\n */\n addToWishList(data) {\n if (this.isEnabled) {\n this.eventSender.sendAddToWishList(data);\n }\n }\n /**\n * Send an initPlanningSession event, if the component is enabled.\n *\n * @param designId The design id that started the session.\n * @param source The source of the planning session.\n * @param [payload] Optional payload data.\n * @param [spr] Optional The SPR that was used as base for the planning if any.\n *\n */\n initPlanningSession(designId, source, payload, spr) {\n if (this.isEnabled) {\n this.eventSender.sendInitPlanningSession(designId, source, payload, spr);\n }\n }\n /**\n * Send a savePlanner event, if the component is enabled.\n *\n * @param designId The design id to save, optional.\n * @param [payload] Optional payload data.\n */\n saveDesign(designId, payload) {\n if (this.isEnabled) {\n this.eventSender.sendSavePlanner(designId, payload);\n }\n }\n /**\n * Send a custom event, if the component is enabled.\n *\n * @param data The information about the custom event.\n */\n sendEvent(data) {\n if (this.isEnabled) {\n this.eventSender.sendCustomEvent(data);\n }\n }\n /**\n * Send a design interaction event, if the component is enabled.\n *\n * @param designId The design id which was interacted with.\n * @param interaction The interaction source.\n * @param [payload] Optional payload data.\n */\n sendDesignInteractionEvent(designId, interaction, payload) {\n if (this.isEnabled) {\n this.eventSender.sendDesignInteractionEvent(designId, interaction, payload);\n }\n }\n /**\n * Send a article action event, if the component is enabled.\n *\n * @param articleId The article id.\n * @param action The action being performed.\n * @param isGlobal Indicate if article id is global or local.\n * @param [payload] Optional payload data.\n */\n articleAction(articleId, action, isGlobal, payload) {\n if (this.isEnabled) {\n this.eventSender.sendArticleAction(articleId, action, isGlobal, payload);\n }\n }\n /**\n * Sets the A/B version for the session to facilitate A/B testing, if the component is enabled.\n *\n * @param abVersionName Name of the ab version.\n * @param abVersionVariation Optional ab variation.\n */\n setAbVersion(abVersionName, abVersionVariation) {\n if (this.isEnabled) {\n MetadataManager_1.default.updateApplication({ abVersionName, abVersionVariation });\n this.eventSender.sendSetAbVersion();\n }\n }\n /**\n * Send a flow step event, if the component is enabled.\n *\n * @param flowName Name of the flow.\n * @param stepName Name of the step in the flow.\n * @param stepLevel Level of step in the flow.\n */\n sendUserFlowStep(flowName, stepName, stepLevel, payload) {\n if (this.isEnabled) {\n this.eventSender.sendUserFlowStep(flowName, stepName, stepLevel, payload);\n }\n }\n /**\n * Get user ids.\n *\n * @returns The user ids (sessionId, planningId, longTermId and ipexId).\n */\n getIds() {\n if (this.isEnabled) {\n return this.session.getIds();\n }\n }\n}\nexports.default = InsightsApi;\n//# sourceMappingURL=InsightsApi.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PlatformEnum = exports.ModuleClient = exports.IpexMomentEnum = exports.InsightsApi = exports.DesignSourceEnum = exports.DesignInteractionEnum = exports.ArticleActionEnum = void 0;\nconst InsightsApi_1 = __importDefault(require(\"./InsightsApi\"));\nexports.InsightsApi = InsightsApi_1.default;\nconst DesignSourceEnum_1 = __importDefault(require(\"./enums/DesignSourceEnum\"));\nexports.DesignSourceEnum = DesignSourceEnum_1.default;\nconst IpexMomentEnum_1 = __importDefault(require(\"./enums/IpexMomentEnum\"));\nexports.IpexMomentEnum = IpexMomentEnum_1.default;\nconst DesignInteractionEnum_1 = __importDefault(require(\"./enums/DesignInteractionEnum\"));\nexports.DesignInteractionEnum = DesignInteractionEnum_1.default;\nconst PlatformEnum_1 = __importDefault(require(\"./enums/PlatformEnum\"));\nexports.PlatformEnum = PlatformEnum_1.default;\nconst ArticleActionEnum_1 = __importDefault(require(\"./enums/ArticleActionEnum\"));\nexports.ArticleActionEnum = ArticleActionEnum_1.default;\nconst ModuleClient_1 = __importDefault(require(\"./ModuleClient\"));\nexports.ModuleClient = ModuleClient_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ABTestNameEnum;\n(function (ABTestNameEnum) {\n ABTestNameEnum[\"assemblyServicesHidden\"] = \"assemblyServicesHidden\";\n})(ABTestNameEnum || (ABTestNameEnum = {}));\nexports.default = ABTestNameEnum;\n//# sourceMappingURL=ABTestNameEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ABTestVariationEnum;\n(function (ABTestVariationEnum) {\n ABTestVariationEnum[\"A\"] = \"A\";\n ABTestVariationEnum[\"B\"] = \"B\";\n})(ABTestVariationEnum || (ABTestVariationEnum = {}));\nexports.default = ABTestVariationEnum;\n//# sourceMappingURL=ABTestVariationEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AccountDataSourceEnum;\n(function (AccountDataSourceEnum) {\n AccountDataSourceEnum[\"disabled\"] = \"disabled\";\n AccountDataSourceEnum[\"DEXF\"] = \"DEXF\";\n})(AccountDataSourceEnum || (AccountDataSourceEnum = {}));\nexports.default = AccountDataSourceEnum;\n//# sourceMappingURL=AccountDataSourceEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AkamaiImageQualityEnum;\n(function (AkamaiImageQualityEnum) {\n AkamaiImageQualityEnum[\"low\"] = \"low\";\n AkamaiImageQualityEnum[\"medium\"] = \"medium\";\n AkamaiImageQualityEnum[\"high\"] = \"high\";\n})(AkamaiImageQualityEnum || (AkamaiImageQualityEnum = {}));\nexports.default = AkamaiImageQualityEnum;\n//# sourceMappingURL=AkamaiImageQualityEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ApiPlatformEnum;\n(function (ApiPlatformEnum) {\n ApiPlatformEnum[\"irw\"] = \"irw\";\n ApiPlatformEnum[\"roig\"] = \"roig\";\n})(ApiPlatformEnum || (ApiPlatformEnum = {}));\nexports.default = ApiPlatformEnum;\n//# sourceMappingURL=ApiPlatformEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AssemblyServicesDataSourceEnum;\n(function (AssemblyServicesDataSourceEnum) {\n AssemblyServicesDataSourceEnum[\"disabled\"] = \"disabled\";\n AssemblyServicesDataSourceEnum[\"DEXF\"] = \"DEXF\";\n})(AssemblyServicesDataSourceEnum || (AssemblyServicesDataSourceEnum = {}));\nexports.default = AssemblyServicesDataSourceEnum;\n//# sourceMappingURL=AssemblyServicesDataSourceEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AutoCompleteEnum;\n(function (AutoCompleteEnum) {\n // The browser is not permitted to automatically enter or select a value for this field. It is possible that the document or application provides its own autocomplete feature, or that security concerns require that the field's value not be automatically entered.\n AutoCompleteEnum[\"off\"] = \"off\";\n // The browser is allowed to automatically complete the input. No guidance is provided as to the type of data expected in the field, so the browser may use its own judgement.\n AutoCompleteEnum[\"on\"] = \"on\";\n // The field expects the value to be a person's full name. Using \"name\" rather than breaking the name down into its components is generally preferred because it avoids dealing with the wide diversity of human names and how they are structured; however, you can use the following autocomplete values if you do need to break the name down into its components:\n AutoCompleteEnum[\"name\"] = \"name\";\n // The prefix or title, such as \"Mrs.\", \"Mr.\", \"Miss\", \"Ms.\", \"Dr.\", or \"Mlle.\".\n AutoCompleteEnum[\"honorificPrefix\"] = \"honorific-prefix\";\n // The given (or \"first\") name.\n AutoCompleteEnum[\"givenName\"] = \"given-name\";\n // The middle name.\n AutoCompleteEnum[\"additionalName\"] = \"additional-name\";\n // The family (or \"last\") name.\n AutoCompleteEnum[\"familyName\"] = \"family-name\";\n // The suffix, such as \"Jr.\", \"B.Sc.\", \"PhD.\", \"MBASW\", or \"IV\".\n AutoCompleteEnum[\"honorificSuffix\"] = \"honorific-suffix\";\n // A nickname or handle.\n AutoCompleteEnum[\"nickname\"] = \"nickname\";\n // An email address.\n AutoCompleteEnum[\"email\"] = \"email\";\n // A username or account name.\n AutoCompleteEnum[\"username\"] = \"username\";\n // A new password. When creating a new account or changing passwords, this should be used for an \"Enter your new password\" or \"Confirm new password\" field, as opposed to a general \"Enter your current password\" field that might be present. This may be used by the browser both to avoid accidentally filling in an existing password and to offer assistance in creating a secure password (see also Preventing autofilling with autocomplete=\"new-password\").\n AutoCompleteEnum[\"newPassword\"] = \"new-password\";\n // The user's current password.\n AutoCompleteEnum[\"currentPassword\"] = \"current-password\";\n // A one-time code used for verifying user identity.\n AutoCompleteEnum[\"oneTimeCode\"] = \"one-time-code\";\n // A job title, or the title a person has within an organization, such as \"Senior Technical Writer\", \"President\", or \"Assistant Troop Leader\".\n AutoCompleteEnum[\"organizationTitle\"] = \"organization-title\";\n // A company or organization name, such as \"Acme Widget Company\" or \"Girl Scouts of America\".\n AutoCompleteEnum[\"organization\"] = \"organization\";\n // A street address. This can be multiple lines of text, and should fully identify the location of the address within its second administrative level (typically a city or town), but should not include the city name, ZIP or postal code, or country name.\n AutoCompleteEnum[\"streetAddress\"] = \"street-address\";\n // Each individual line of the street address. These should only be present if the \"street-address\" is not present.\n AutoCompleteEnum[\"addressLine1\"] = \"address-line1\";\n // Each individual line of the street address. These should only be present if the \"street-address\" is not present.\n AutoCompleteEnum[\"addressLine2\"] = \"address-line2\";\n // Each individual line of the street address. These should only be present if the \"street-address\" is not present.\n AutoCompleteEnum[\"addressLine3\"] = \"address-line3\";\n // The finest-grained administrative level, in addresses which have four levels.\n AutoCompleteEnum[\"addressLevel4\"] = \"address-level4\";\n // The third administrative level, in addresses with at least three administrative levels.\n AutoCompleteEnum[\"addressLevel3\"] = \"address-level3\";\n // The second administrative level, in addresses with at least two of them. In countries with two administrative levels, this would typically be the city, town, village, or other locality in which the address is located.\n AutoCompleteEnum[\"addressLevel2\"] = \"address-level2\";\n // The first administrative level in the address. This is typically the province in which the address is located. In the United States, this would be the state. In Switzerland, the canton. In the United Kingdom, the post town.\n AutoCompleteEnum[\"addressLevel1\"] = \"address-level1\";\n // A country or territory code.\n AutoCompleteEnum[\"country\"] = \"country\";\n // A country or territory name.\n AutoCompleteEnum[\"countryName\"] = \"country-name\";\n // A postal code (in the United States, this is the ZIP code).\n AutoCompleteEnum[\"postalCode\"] = \"postal-code\";\n // The full name as printed on or associated with a payment instrument such as a credit card. Using a full name field is preferred, typically, over breaking the name into pieces.\n AutoCompleteEnum[\"ccName\"] = \"cc-name\";\n // A given (first) name as given on a payment instrument like a credit card.\n AutoCompleteEnum[\"ccGivenName\"] = \"cc-given-name\";\n // A middle name as given on a payment instrument or credit card.\n AutoCompleteEnum[\"ccAdditionalName\"] = \"cc-additional-name\";\n // A family name, as given on a credit card.\n AutoCompleteEnum[\"ccFamilyName\"] = \"cc-family-name\";\n // A credit card number or other number identifying a payment method, such as an account number.\n AutoCompleteEnum[\"ccNumber\"] = \"cc-number\";\n // A payment method expiration date, typically in the form \"MM/YY\" or \"MM/YYYY\".\n AutoCompleteEnum[\"ccExp\"] = \"cc-exp\";\n // The month in which the payment method expires.\n AutoCompleteEnum[\"ccExpMonth\"] = \"cc-exp-month\";\n // The year in which the payment method expires.\n AutoCompleteEnum[\"ccExpYear\"] = \"cc-exp-year\";\n // The security code for the payment instrument; on credit cards, this is the 3-digit verification number on the back of the card.\n AutoCompleteEnum[\"ccCsc\"] = \"cc-csc\";\n // The type of payment instrument (such as \"Visa\" or \"Master Card\").\n AutoCompleteEnum[\"ccType\"] = \"cc-type\";\n // The currency in which the transaction is to take place.\n AutoCompleteEnum[\"transactionCurrency\"] = \"transaction-currency\";\n // The amount, given in the currency specified by \"transaction-currency\", of the transaction, for a payment form.\n AutoCompleteEnum[\"transactionAmount\"] = \"transaction-amount\";\n // A preferred language, given as a valid BCP 47 language tag.\n AutoCompleteEnum[\"language\"] = \"language\";\n // A birth date, as a full date.\n AutoCompleteEnum[\"bday\"] = \"bday\";\n // The day of the month of a birth date.\n AutoCompleteEnum[\"bdayDay\"] = \"bday-day\";\n // The month of the year of a birth date.\n AutoCompleteEnum[\"bdayMonth\"] = \"bday-month\";\n // The year of a birth date.\n AutoCompleteEnum[\"bdayYear\"] = \"bday-year\";\n // A gender identity (such as \"Female\", \"Fa'afafine\", \"Male\"), as freeform text without newlines.\n AutoCompleteEnum[\"sex\"] = \"sex\";\n // A full telephone number, including the country code. If you need to break the phone number up into its components, you can use these values for those fields:\n AutoCompleteEnum[\"tel\"] = \"tel\";\n // The country code, such as \"1\" for the United States, Canada, and other areas in North America and parts of the Caribbean.\n AutoCompleteEnum[\"telCountryCode\"] = \"tel-country-code\";\n // The entire phone number without the country code component, including a country-internal prefix. For the phone number \"1-855-555-6502\", this field's value would be \"855-555-6502\".\n AutoCompleteEnum[\"telNational\"] = \"tel-national\";\n // The area code, with any country-internal prefix applied if appropriate.\n AutoCompleteEnum[\"telAreaCode\"] = \"tel-area-code\";\n // The phone number without the country or area code. This can be split further into two parts, for phone numbers which have an exchange number and then a number within the exchange. For the phone number \"555-6502\", use \"tel-local-prefix\" for \"555\" and \"tel-local-suffix\" for \"6502\".\n AutoCompleteEnum[\"telLocal\"] = \"tel-local\";\n // A telephone extension code within the phone number, such as a room or suite number in a hotel or an office extension in a company.\n AutoCompleteEnum[\"telExtension\"] = \"tel-extension\";\n // A URL for an instant messaging protocol endpoint, such as \"xmpp:username@example.net\".\n AutoCompleteEnum[\"impp\"] = \"impp\";\n // A URL, such as a home page or company web site address as appropriate given the context of the other fields in the form.\n AutoCompleteEnum[\"url\"] = \"url\";\n // The URL of an image representing the person, company, or contact information given in the other fields in the form.\n AutoCompleteEnum[\"photo\"] = \"photo\";\n})(AutoCompleteEnum || (AutoCompleteEnum = {}));\nexports.default = AutoCompleteEnum;\n//# sourceMappingURL=AutoCompleteEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar CookieConsentDataSourceEnum;\n(function (CookieConsentDataSourceEnum) {\n CookieConsentDataSourceEnum[\"disabled\"] = \"Disabled\";\n CookieConsentDataSourceEnum[\"oneWeb\"] = \"OneWeb\";\n CookieConsentDataSourceEnum[\"block\"] = \"Block\";\n})(CookieConsentDataSourceEnum || (CookieConsentDataSourceEnum = {}));\nexports.default = CookieConsentDataSourceEnum;\n//# sourceMappingURL=CookieConsentDataSourceEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar CookieInformationDataSourceEnum;\n(function (CookieInformationDataSourceEnum) {\n CookieInformationDataSourceEnum[\"disabled\"] = \"Disabled\";\n CookieInformationDataSourceEnum[\"oneWeb\"] = \"OneWeb\";\n})(CookieInformationDataSourceEnum || (CookieInformationDataSourceEnum = {}));\nexports.default = CookieInformationDataSourceEnum;\n//# sourceMappingURL=CookieInformationDataSourceEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar DexfNotificationTypeEnum;\n(function (DexfNotificationTypeEnum) {\n DexfNotificationTypeEnum[\"email\"] = \"email\";\n DexfNotificationTypeEnum[\"sms\"] = \"sms\";\n})(DexfNotificationTypeEnum || (DexfNotificationTypeEnum = {}));\nexports.default = DexfNotificationTypeEnum;\n//# sourceMappingURL=DexfNotificationTypeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar DexfSettingsEnvironmentEnum;\n(function (DexfSettingsEnvironmentEnum) {\n DexfSettingsEnvironmentEnum[\"development\"] = \"development\";\n DexfSettingsEnvironmentEnum[\"production\"] = \"production\";\n})(DexfSettingsEnvironmentEnum || (DexfSettingsEnvironmentEnum = {}));\nexports.default = DexfSettingsEnvironmentEnum;\n//# sourceMappingURL=DexfSettingsEnvironmentEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar DexfSettingsFilterSegmentEnum;\n(function (DexfSettingsFilterSegmentEnum) {\n DexfSettingsFilterSegmentEnum[\"development\"] = \"development\";\n DexfSettingsFilterSegmentEnum[\"test\"] = \"test\";\n DexfSettingsFilterSegmentEnum[\"verification\"] = \"verification\";\n DexfSettingsFilterSegmentEnum[\"production\"] = \"production\";\n})(DexfSettingsFilterSegmentEnum || (DexfSettingsFilterSegmentEnum = {}));\nexports.default = DexfSettingsFilterSegmentEnum;\n//# sourceMappingURL=DexfSettingsFilterSegmentEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar EcommerceCartDataSourceEnum;\n(function (EcommerceCartDataSourceEnum) {\n EcommerceCartDataSourceEnum[\"default\"] = \"default\";\n EcommerceCartDataSourceEnum[\"disabled\"] = \"disabled\";\n EcommerceCartDataSourceEnum[\"iows\"] = \"IOWS\";\n EcommerceCartDataSourceEnum[\"cartApi\"] = \"CartApi\";\n EcommerceCartDataSourceEnum[\"chinaCartApi\"] = \"ChinaCartApi\";\n EcommerceCartDataSourceEnum[\"nifApi\"] = \"NifApi\";\n EcommerceCartDataSourceEnum[\"mvecom\"] = \"MvEcom\";\n EcommerceCartDataSourceEnum[\"iksa\"] = \"IKSA\";\n})(EcommerceCartDataSourceEnum || (EcommerceCartDataSourceEnum = {}));\nexports.default = EcommerceCartDataSourceEnum;\n//# sourceMappingURL=EcommerceCartDataSourceEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar EcommerceShoppingListDataSourceEnum;\n(function (EcommerceShoppingListDataSourceEnum) {\n EcommerceShoppingListDataSourceEnum[\"default\"] = \"default\";\n EcommerceShoppingListDataSourceEnum[\"disabled\"] = \"disabled\";\n EcommerceShoppingListDataSourceEnum[\"shoppingListApi\"] = \"ShoppingListApi\";\n EcommerceShoppingListDataSourceEnum[\"chinaShoppingListApi\"] = \"ChinaShoppingListApi\";\n EcommerceShoppingListDataSourceEnum[\"iows\"] = \"IOWS\";\n EcommerceShoppingListDataSourceEnum[\"mvecom\"] = \"MvEcom\";\n EcommerceShoppingListDataSourceEnum[\"iksa\"] = \"IKSA\";\n})(EcommerceShoppingListDataSourceEnum || (EcommerceShoppingListDataSourceEnum = {}));\nexports.default = EcommerceShoppingListDataSourceEnum;\n//# sourceMappingURL=EcommerceShoppingListDataSourceEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar FinancingOptionDataSourceEnum;\n(function (FinancingOptionDataSourceEnum) {\n FinancingOptionDataSourceEnum[\"disabled\"] = \"disabled\";\n FinancingOptionDataSourceEnum[\"oneWeb\"] = \"OneWeb\";\n})(FinancingOptionDataSourceEnum || (FinancingOptionDataSourceEnum = {}));\nexports.default = FinancingOptionDataSourceEnum;\n//# sourceMappingURL=FinancingOptionDataSourceEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar HeadingsEnum;\n(function (HeadingsEnum) {\n HeadingsEnum[\"h1\"] = \"1\";\n HeadingsEnum[\"h2\"] = \"2\";\n HeadingsEnum[\"h3\"] = \"3\";\n HeadingsEnum[\"h4\"] = \"4\";\n HeadingsEnum[\"h5\"] = \"5\";\n HeadingsEnum[\"h6\"] = \"6\";\n})(HeadingsEnum || (HeadingsEnum = {}));\nexports.default = HeadingsEnum;\n//# sourceMappingURL=HeadingsEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar IksaShoppingBagTypeEnum;\n(function (IksaShoppingBagTypeEnum) {\n IksaShoppingBagTypeEnum[\"cart\"] = \"onlineshoppingcart\";\n IksaShoppingBagTypeEnum[\"list\"] = \"onlineshoppinglist\";\n})(IksaShoppingBagTypeEnum || (IksaShoppingBagTypeEnum = {}));\nexports.default = IksaShoppingBagTypeEnum;\n//# sourceMappingURL=IksaShoppingBagTypeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Sizes available on images, where S1 is the smallest and S5 the largest.\n */\nvar ImageSizeTypeEnum;\n(function (ImageSizeTypeEnum) {\n ImageSizeTypeEnum[\"S1\"] = \"S1\";\n ImageSizeTypeEnum[\"S2\"] = \"S2\";\n ImageSizeTypeEnum[\"S3\"] = \"S3\";\n ImageSizeTypeEnum[\"S4\"] = \"S4\";\n ImageSizeTypeEnum[\"S5\"] = \"S5\";\n})(ImageSizeTypeEnum || (ImageSizeTypeEnum = {}));\nexports.default = ImageSizeTypeEnum;\n//# sourceMappingURL=ImageSizeTypeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ImageTypeNameEnum;\n(function (ImageTypeNameEnum) {\n ImageTypeNameEnum[\"mainProductPicture\"] = \"Main Product Picture\";\n ImageTypeNameEnum[\"contextProductPicture\"] = \"Context Product Picture\";\n ImageTypeNameEnum[\"functionalProductPicture\"] = \"Functional Product Picture\";\n ImageTypeNameEnum[\"inspirationalProductPicture\"] = \"Inspirational Product Picture\";\n /** Images that shows measurements.\n *\n * For instance when applied to a Malm bureau, it will show the entire bureau measurements, as well as the drawers measurements.\n */\n ImageTypeNameEnum[\"measurementIllustration\"] = \"Measurement Illustration\";\n})(ImageTypeNameEnum || (ImageTypeNameEnum = {}));\nexports.default = ImageTypeNameEnum;\n//# sourceMappingURL=ImageTypeNameEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar InvalidProductReasonEnum;\n(function (InvalidProductReasonEnum) {\n // Sell-stopped\n InvalidProductReasonEnum[\"retailItemNotAvailable\"] = \"RETAIL_ITEM_NOT_AVAILABLE\";\n})(InvalidProductReasonEnum || (InvalidProductReasonEnum = {}));\nexports.default = InvalidProductReasonEnum;\n//# sourceMappingURL=InvalidProductReasonEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar IowsShoppingBagTypeEnum;\n(function (IowsShoppingBagTypeEnum) {\n IowsShoppingBagTypeEnum[\"cart\"] = \"onlineshoppingcart\";\n IowsShoppingBagTypeEnum[\"list\"] = \"onlineshoppinglist\";\n})(IowsShoppingBagTypeEnum || (IowsShoppingBagTypeEnum = {}));\nexports.default = IowsShoppingBagTypeEnum;\n//# sourceMappingURL=IowsShoppingBagTypeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * All different types of items, that are accepted by DEXF.\n */\nvar ItemTypeEnum;\n(function (ItemTypeEnum) {\n ItemTypeEnum[\"art\"] = \"ART\";\n ItemTypeEnum[\"spr\"] = \"SPR\";\n ItemTypeEnum[\"ext\"] = \"EXT\";\n ItemTypeEnum[\"asl\"] = \"ASL\";\n ItemTypeEnum[\"msc\"] = \"MSC\";\n ItemTypeEnum[\"asm\"] = \"ASM\";\n ItemTypeEnum[\"asp\"] = \"ASP\";\n})(ItemTypeEnum || (ItemTypeEnum = {}));\nexports.default = ItemTypeEnum;\n//# sourceMappingURL=ItemTypeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar MvEcomIrwBagTypeEnum;\n(function (MvEcomIrwBagTypeEnum) {\n MvEcomIrwBagTypeEnum[\"irwCart\"] = \"irw-shopping-cart\";\n MvEcomIrwBagTypeEnum[\"irwList\"] = \"irw-shopping-list\";\n})(MvEcomIrwBagTypeEnum || (MvEcomIrwBagTypeEnum = {}));\nexports.default = MvEcomIrwBagTypeEnum;\n//# sourceMappingURL=MvEcomIrwBagTypeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar MvEcomShoppingBagTypeEnum;\n(function (MvEcomShoppingBagTypeEnum) {\n MvEcomShoppingBagTypeEnum[\"cart\"] = \"onlineshoppingcart\";\n MvEcomShoppingBagTypeEnum[\"list\"] = \"onlineshoppinglist\";\n})(MvEcomShoppingBagTypeEnum || (MvEcomShoppingBagTypeEnum = {}));\nexports.default = MvEcomShoppingBagTypeEnum;\n//# sourceMappingURL=MvEcomShoppingBagTypeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar NotificationDataSourceEnum;\n(function (NotificationDataSourceEnum) {\n NotificationDataSourceEnum[\"disabled\"] = \"Disabled\";\n NotificationDataSourceEnum[\"dexf\"] = \"DEXF\";\n})(NotificationDataSourceEnum || (NotificationDataSourceEnum = {}));\nexports.default = NotificationDataSourceEnum;\n//# sourceMappingURL=NotificationDataSourceEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar NotificationLinkTypeEnum;\n(function (NotificationLinkTypeEnum) {\n NotificationLinkTypeEnum[\"deeplink\"] = \"deeplink\";\n NotificationLinkTypeEnum[\"pickinglist\"] = \"pickinglist\";\n})(NotificationLinkTypeEnum || (NotificationLinkTypeEnum = {}));\nexports.default = NotificationLinkTypeEnum;\n//# sourceMappingURL=NotificationLinkTypeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ProductComplianceLabelTypeEnum;\n(function (ProductComplianceLabelTypeEnum) {\n ProductComplianceLabelTypeEnum[\"chileEnergyCompliance\"] = \"ENERGY_LABEL_CL\";\n ProductComplianceLabelTypeEnum[\"chileSecLabel\"] = \"SEC_LABEL_CL\";\n ProductComplianceLabelTypeEnum[\"usEnergy\"] = \"ENERGY_LABEL_US\";\n ProductComplianceLabelTypeEnum[\"euEnergy\"] = \"ENERGY_LABEL_EU\";\n ProductComplianceLabelTypeEnum[\"euUnifiedWaterLabel\"] = \"WATER_LABEL_EU\";\n ProductComplianceLabelTypeEnum[\"repairabilityIndexDocument\"] = \"REPAIR_DOC_FR\";\n ProductComplianceLabelTypeEnum[\"repairabilityIndexImage\"] = \"REPAIR_INDEX_FR\";\n})(ProductComplianceLabelTypeEnum || (ProductComplianceLabelTypeEnum = {}));\nexports.default = ProductComplianceLabelTypeEnum;\n//# sourceMappingURL=ProductComplianceLabelTypeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ProductComplianceTechnicalHeadingTypeEnum;\n(function (ProductComplianceTechnicalHeadingTypeEnum) {\n ProductComplianceTechnicalHeadingTypeEnum[\"energyEfficiencyClass\"] = \"ENERGY_EFFICIENCY_CLASS\";\n ProductComplianceTechnicalHeadingTypeEnum[\"rescaled\"] = \"PRODUCT_INFO_SHEET\";\n ProductComplianceTechnicalHeadingTypeEnum[\"nonRescaled\"] = \"PRODUCT_FICHE\";\n ProductComplianceTechnicalHeadingTypeEnum[\"hyperlink\"] = \"HYPERLINK\";\n ProductComplianceTechnicalHeadingTypeEnum[\"unifiedWaterLabel\"] = \"GRAPHICAL_ELEMENT\";\n ProductComplianceTechnicalHeadingTypeEnum[\"repairabilityIndex\"] = \"REPAIRABILITY_INDEX\";\n ProductComplianceTechnicalHeadingTypeEnum[\"doNotDiy\"] = \"INSTALLATION_TYPE\";\n})(ProductComplianceTechnicalHeadingTypeEnum || (ProductComplianceTechnicalHeadingTypeEnum = {}));\nexports.default = ProductComplianceTechnicalHeadingTypeEnum;\n//# sourceMappingURL=ProductComplianceTechnicalHeadingTypeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * @deprecated Not used and not part of settings from DEXF Settings / IDexfSettings. To be removed when LocalizationService is removed.\n */\nvar ProductDataSourceEnum;\n(function (ProductDataSourceEnum) {\n ProductDataSourceEnum[\"default\"] = \"default\";\n ProductDataSourceEnum[\"dexf\"] = \"DEXF\";\n})(ProductDataSourceEnum || (ProductDataSourceEnum = {}));\nexports.default = ProductDataSourceEnum;\n//# sourceMappingURL=ProductDataSourceEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ProductOptionalFieldNameEnum;\n(function (ProductOptionalFieldNameEnum) {\n ProductOptionalFieldNameEnum[\"asset\"] = \"asset\";\n ProductOptionalFieldNameEnum[\"careInstruction\"] = \"careInstruction\";\n ProductOptionalFieldNameEnum[\"complementaryItem\"] = \"complementaryItem\";\n ProductOptionalFieldNameEnum[\"customerMaterial\"] = \"customerMaterial\";\n ProductOptionalFieldNameEnum[\"document\"] = \"document\";\n ProductOptionalFieldNameEnum[\"filterAttribute\"] = \"filterAttribute\";\n ProductOptionalFieldNameEnum[\"genericProduct\"] = \"genericProduct\";\n ProductOptionalFieldNameEnum[\"customerBenefitSummary\"] = \"customerBenefitSummary\";\n ProductOptionalFieldNameEnum[\"priceInformation\"] = \"priceInformation\";\n ProductOptionalFieldNameEnum[\"priceUnit\"] = \"priceUnit\";\n ProductOptionalFieldNameEnum[\"child\"] = \"child\";\n ProductOptionalFieldNameEnum[\"measureReference\"] = \"measureReference\";\n ProductOptionalFieldNameEnum[\"measure\"] = \"measure\";\n ProductOptionalFieldNameEnum[\"packageMeasure\"] = \"packageMeasure\";\n ProductOptionalFieldNameEnum[\"customerBenefit\"] = \"customerBenefit\";\n ProductOptionalFieldNameEnum[\"goodToKnow\"] = \"goodToKnow\";\n ProductOptionalFieldNameEnum[\"peopleAndPlanet\"] = \"peopleAndPlanet\";\n ProductOptionalFieldNameEnum[\"image\"] = \"image\";\n ProductOptionalFieldNameEnum[\"video\"] = \"video\";\n ProductOptionalFieldNameEnum[\"technicalInformation\"] = \"technicalInformation\";\n ProductOptionalFieldNameEnum[\"complianceTechnical\"] = \"complianceTechnical\";\n ProductOptionalFieldNameEnum[\"complianceInformation\"] = \"complianceInformation\";\n ProductOptionalFieldNameEnum[\"complianceLabel\"] = \"complianceLabel\";\n ProductOptionalFieldNameEnum[\"validDesignPart\"] = \"validDesignPart\";\n ProductOptionalFieldNameEnum[\"appConfig\"] = \"appConfig\";\n})(ProductOptionalFieldNameEnum || (ProductOptionalFieldNameEnum = {}));\nexports.default = ProductOptionalFieldNameEnum;\n//# sourceMappingURL=ProductOptionalFieldNameEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SalesDivisionCodeEnum;\n(function (SalesDivisionCodeEnum) {\n SalesDivisionCodeEnum[\"showroom\"] = \"SHOWROOM\";\n SalesDivisionCodeEnum[\"marketHall\"] = \"MARKET_HALL\";\n SalesDivisionCodeEnum[\"selfServe\"] = \"SELF_SERVE\";\n SalesDivisionCodeEnum[\"warehouse\"] = \"WAREHOUSE\"; // Previous \"full_serve\" - Contact coworker\n})(SalesDivisionCodeEnum || (SalesDivisionCodeEnum = {}));\nexports.default = SalesDivisionCodeEnum;\n//# sourceMappingURL=SalesDivisionCodeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SalesSystemEnum;\n(function (SalesSystemEnum) {\n SalesSystemEnum[\"isell\"] = \"isell\";\n SalesSystemEnum[\"bitboxer\"] = \"bitboxer\";\n SalesSystemEnum[\"navision\"] = \"navision\";\n SalesSystemEnum[\"other\"] = \"other\";\n})(SalesSystemEnum || (SalesSystemEnum = {}));\nexports.default = SalesSystemEnum;\n//# sourceMappingURL=SalesSystemEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SalesTypeCodeEnum;\n(function (SalesTypeCodeEnum) {\n SalesTypeCodeEnum[\"aisleAndBin\"] = \"AISLE_AND_BIN\";\n SalesTypeCodeEnum[\"department\"] = \"DEPARTMENT\";\n SalesTypeCodeEnum[\"contactStaff\"] = \"CONTACT_STAFF\"; // WAREHOUSE - Prev full_serve/dds\n})(SalesTypeCodeEnum || (SalesTypeCodeEnum = {}));\nexports.default = SalesTypeCodeEnum;\n//# sourceMappingURL=SalesTypeCodeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SaveDataSourceEnum;\n(function (SaveDataSourceEnum) {\n SaveDataSourceEnum[\"disabled\"] = \"disabled\";\n SaveDataSourceEnum[\"DEXF\"] = \"DEXF\";\n})(SaveDataSourceEnum || (SaveDataSourceEnum = {}));\nexports.default = SaveDataSourceEnum;\n//# sourceMappingURL=SaveDataSourceEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SheetAlignmentEnum;\n(function (SheetAlignmentEnum) {\n SheetAlignmentEnum[\"left\"] = \"left\";\n SheetAlignmentEnum[\"right\"] = \"right\";\n})(SheetAlignmentEnum || (SheetAlignmentEnum = {}));\nexports.default = SheetAlignmentEnum;\n//# sourceMappingURL=SheetAlignmentEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/** @deprecated Use status color from Skapa instead. */\nvar StatusIndicatorColorEnum;\n(function (StatusIndicatorColorEnum) {\n StatusIndicatorColorEnum[\"red\"] = \"red\";\n StatusIndicatorColorEnum[\"orange\"] = \"orange\";\n StatusIndicatorColorEnum[\"green\"] = \"green\";\n StatusIndicatorColorEnum[\"grey\"] = \"grey\";\n})(StatusIndicatorColorEnum || (StatusIndicatorColorEnum = {}));\nexports.default = StatusIndicatorColorEnum;\n//# sourceMappingURL=StatusIndicatorColorEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar StoreAvailabilityDataSourceEnum;\n(function (StoreAvailabilityDataSourceEnum) {\n StoreAvailabilityDataSourceEnum[\"disabled\"] = \"disabled\";\n StoreAvailabilityDataSourceEnum[\"DEXF\"] = \"DEXF\";\n})(StoreAvailabilityDataSourceEnum || (StoreAvailabilityDataSourceEnum = {}));\nexports.default = StoreAvailabilityDataSourceEnum;\n//# sourceMappingURL=StoreAvailabilityDataSourceEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar StoreAvailabilityProbabilityEnum;\n(function (StoreAvailabilityProbabilityEnum) {\n StoreAvailabilityProbabilityEnum[\"highInStock\"] = \"HIGH_IN_STOCK\";\n StoreAvailabilityProbabilityEnum[\"mediumInStock\"] = \"MEDIUM_IN_STOCK\";\n StoreAvailabilityProbabilityEnum[\"lowInStock\"] = \"LOW_IN_STOCK\";\n StoreAvailabilityProbabilityEnum[\"someLowOrOutOfStock\"] = \"SOME_LOW_OR_OUT_OF_STOCK\";\n StoreAvailabilityProbabilityEnum[\"outOfStock\"] = \"OUT_OF_STOCK\";\n StoreAvailabilityProbabilityEnum[\"notSoldAtStore\"] = \"NOT_SOLD_AT_STORE\";\n /** Single product - will show caption text for StoreSelector. */\n StoreAvailabilityProbabilityEnum[\"orderItemSingle\"] = \"ORDER_ITEM_SINGLE\";\n /** Multipe products - caption text for StoreSelector should be hidden. */\n StoreAvailabilityProbabilityEnum[\"orderItemMultiple\"] = \"ORDER_ITEM_MULTIPLE\";\n})(StoreAvailabilityProbabilityEnum || (StoreAvailabilityProbabilityEnum = {}));\nexports.default = StoreAvailabilityProbabilityEnum;\n//# sourceMappingURL=StoreAvailabilityProbabilityEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar StoreAvailabilityReasonCodeEnum;\n(function (StoreAvailabilityReasonCodeEnum) {\n StoreAvailabilityReasonCodeEnum[\"retailItemNotAvailable\"] = \"RETAIL_ITEM_NOT_AVAILABLE\";\n StoreAvailabilityReasonCodeEnum[\"retailPriceNotAvailable\"] = \"RETAIL_PRICE_NOT_AVAILABLE\";\n StoreAvailabilityReasonCodeEnum[\"retailStockNotAvailable\"] = \"RETAIL_STOCK_NOT_AVAILABLE\";\n StoreAvailabilityReasonCodeEnum[\"retailInvalidRetailUnit\"] = \"RETAIL_INVALID_RETAIL_UNIT\";\n StoreAvailabilityReasonCodeEnum[\"retailInvalidStoreCode\"] = \"RETAIL_INVALID_STORE_CODE\";\n StoreAvailabilityReasonCodeEnum[\"retailInvalidZipCode\"] = \"RETAIL_INVALID_ZIP_CODE\";\n StoreAvailabilityReasonCodeEnum[\"validationInvalidId\"] = \"VALIDATION_INVALID_ID\";\n StoreAvailabilityReasonCodeEnum[\"validationNotSaleableItem\"] = \"VALIDATION_NOT_SALEABLE_ITEM\";\n StoreAvailabilityReasonCodeEnum[\"noAvailableService\"] = \"NO_AVAILABLE_SERVICE\";\n})(StoreAvailabilityReasonCodeEnum || (StoreAvailabilityReasonCodeEnum = {}));\nexports.default = StoreAvailabilityReasonCodeEnum;\n//# sourceMappingURL=StoreAvailabilityReasonCodeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar StoreBuTypeEnum;\n(function (StoreBuTypeEnum) {\n StoreBuTypeEnum[\"ecommerce\"] = \"E-commerce\";\n StoreBuTypeEnum[\"store\"] = \"Store\";\n StoreBuTypeEnum[\"office\"] = \"Office\";\n StoreBuTypeEnum[\"smallStore\"] = \"Small Store\";\n StoreBuTypeEnum[\"shop\"] = \"Shop\";\n})(StoreBuTypeEnum || (StoreBuTypeEnum = {}));\nexports.default = StoreBuTypeEnum;\n//# sourceMappingURL=StoreBuTypeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar StoreDataSourceEnum;\n(function (StoreDataSourceEnum) {\n StoreDataSourceEnum[\"iows\"] = \"IOWS\";\n StoreDataSourceEnum[\"dexf\"] = \"DEXF\";\n})(StoreDataSourceEnum || (StoreDataSourceEnum = {}));\nexports.default = StoreDataSourceEnum;\n//# sourceMappingURL=StoreDataSourceEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar TemporaryPricePeriodEnum;\n(function (TemporaryPricePeriodEnum) {\n TemporaryPricePeriodEnum[\"periodStartAndEnd\"] = \"PeriodStartAndEnd\";\n TemporaryPricePeriodEnum[\"periodEnd\"] = \"PeriodEnd\";\n TemporaryPricePeriodEnum[\"periodNone\"] = \"PeriodNone\";\n})(TemporaryPricePeriodEnum || (TemporaryPricePeriodEnum = {}));\nexports.default = TemporaryPricePeriodEnum;\n//# sourceMappingURL=TemporaryPricePeriodEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ThemeBreakpointEnum;\n(function (ThemeBreakpointEnum) {\n ThemeBreakpointEnum[\"small\"] = \"small\";\n ThemeBreakpointEnum[\"medium\"] = \"medium\";\n ThemeBreakpointEnum[\"large\"] = \"large\";\n ThemeBreakpointEnum[\"xlarge\"] = \"xlarge\";\n ThemeBreakpointEnum[\"xxlarge\"] = \"xxlarge\";\n})(ThemeBreakpointEnum || (ThemeBreakpointEnum = {}));\nexports.default = ThemeBreakpointEnum;\n//# sourceMappingURL=ThemeBreakpointEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ThemeBreakpointIndexEnum;\n(function (ThemeBreakpointIndexEnum) {\n ThemeBreakpointIndexEnum[ThemeBreakpointIndexEnum[\"small\"] = 0] = \"small\";\n ThemeBreakpointIndexEnum[ThemeBreakpointIndexEnum[\"medium\"] = 1] = \"medium\";\n ThemeBreakpointIndexEnum[ThemeBreakpointIndexEnum[\"large\"] = 2] = \"large\";\n ThemeBreakpointIndexEnum[ThemeBreakpointIndexEnum[\"xlarge\"] = 3] = \"xlarge\";\n ThemeBreakpointIndexEnum[ThemeBreakpointIndexEnum[\"xxlarge\"] = 4] = \"xxlarge\"; // Kiosk size\n})(ThemeBreakpointIndexEnum || (ThemeBreakpointIndexEnum = {}));\nexports.default = ThemeBreakpointIndexEnum;\n//# sourceMappingURL=ThemeBreakpointIndexEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ThemeFontStyleTypeEnum;\n(function (ThemeFontStyleTypeEnum) {\n ThemeFontStyleTypeEnum[\"bodySmall\"] = \"bodySmall\";\n ThemeFontStyleTypeEnum[\"bodyMedium\"] = \"bodyMedium\";\n ThemeFontStyleTypeEnum[\"bodyLarge\"] = \"bodyLarge\";\n ThemeFontStyleTypeEnum[\"bodyXLarge\"] = \"bodyXLarge\";\n ThemeFontStyleTypeEnum[\"headingXSmall\"] = \"headingXSmall\";\n ThemeFontStyleTypeEnum[\"headingSmall\"] = \"headingSmall\";\n ThemeFontStyleTypeEnum[\"headingMedium\"] = \"headingMedium\";\n ThemeFontStyleTypeEnum[\"headingLarge\"] = \"headingLarge\";\n ThemeFontStyleTypeEnum[\"headingXLarge\"] = \"headingXLarge\";\n ThemeFontStyleTypeEnum[\"priceXSmall\"] = \"priceXSmall\";\n ThemeFontStyleTypeEnum[\"priceSmall\"] = \"priceSmall\";\n ThemeFontStyleTypeEnum[\"priceMedium\"] = \"priceMedium\";\n ThemeFontStyleTypeEnum[\"priceLarge\"] = \"priceLarge\";\n ThemeFontStyleTypeEnum[\"priceXLarge\"] = \"priceXLarge\";\n ThemeFontStyleTypeEnum[\"priceXXLarge\"] = \"priceXXLarge\";\n})(ThemeFontStyleTypeEnum || (ThemeFontStyleTypeEnum = {}));\nexports.default = ThemeFontStyleTypeEnum;\n//# sourceMappingURL=ThemeFontStyleTypeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ThemeMotionDelayEnum;\n(function (ThemeMotionDelayEnum) {\n ThemeMotionDelayEnum[\"small\"] = \"small\";\n ThemeMotionDelayEnum[\"medium\"] = \"medium\";\n ThemeMotionDelayEnum[\"large\"] = \"large\";\n})(ThemeMotionDelayEnum || (ThemeMotionDelayEnum = {}));\nexports.default = ThemeMotionDelayEnum;\n//# sourceMappingURL=ThemeMotionDelayEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ThemeMotionDurationEnum;\n(function (ThemeMotionDurationEnum) {\n ThemeMotionDurationEnum[\"xsmall\"] = \"xsmall\";\n ThemeMotionDurationEnum[\"small\"] = \"small\";\n ThemeMotionDurationEnum[\"medium\"] = \"medium\";\n ThemeMotionDurationEnum[\"large\"] = \"large\";\n})(ThemeMotionDurationEnum || (ThemeMotionDurationEnum = {}));\nexports.default = ThemeMotionDurationEnum;\n//# sourceMappingURL=ThemeMotionDurationEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ThemeMotionEaseEnum;\n(function (ThemeMotionEaseEnum) {\n ThemeMotionEaseEnum[\"easy\"] = \"easy\";\n ThemeMotionEaseEnum[\"expressive\"] = \"expressive\";\n ThemeMotionEaseEnum[\"enter\"] = \"enter\";\n ThemeMotionEaseEnum[\"exit\"] = \"exit\";\n ThemeMotionEaseEnum[\"bob\"] = \"bob\";\n ThemeMotionEaseEnum[\"linear\"] = \"linear\";\n})(ThemeMotionEaseEnum || (ThemeMotionEaseEnum = {}));\nexports.default = ThemeMotionEaseEnum;\n//# sourceMappingURL=ThemeMotionEaseEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ThemeMotionIconDurationEnum;\n(function (ThemeMotionIconDurationEnum) {\n ThemeMotionIconDurationEnum[\"small\"] = \"small\";\n ThemeMotionIconDurationEnum[\"medium\"] = \"medium\";\n ThemeMotionIconDurationEnum[\"large\"] = \"large\";\n})(ThemeMotionIconDurationEnum || (ThemeMotionIconDurationEnum = {}));\nexports.default = ThemeMotionIconDurationEnum;\n//# sourceMappingURL=ThemeMotionIconDurationEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ThemeSpacingEnum;\n(function (ThemeSpacingEnum) {\n ThemeSpacingEnum[\"space25\"] = \"space25\";\n ThemeSpacingEnum[\"space50\"] = \"space50\";\n ThemeSpacingEnum[\"space75\"] = \"space75\";\n ThemeSpacingEnum[\"space100\"] = \"space100\";\n ThemeSpacingEnum[\"space125\"] = \"space125\";\n ThemeSpacingEnum[\"space150\"] = \"space150\";\n ThemeSpacingEnum[\"space200\"] = \"space200\";\n ThemeSpacingEnum[\"space250\"] = \"space250\";\n ThemeSpacingEnum[\"space300\"] = \"space300\";\n ThemeSpacingEnum[\"space400\"] = \"space400\";\n ThemeSpacingEnum[\"space550\"] = \"space550\";\n ThemeSpacingEnum[\"space750\"] = \"space750\";\n})(ThemeSpacingEnum || (ThemeSpacingEnum = {}));\nexports.default = ThemeSpacingEnum;\n//# sourceMappingURL=ThemeSpacingEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * @deprecated Not used and not part of settings from DEXF Settings / IDexfSettings. To be removed when LocalizationService is removed.\n */\nvar VpcDataSourceEnum;\n(function (VpcDataSourceEnum) {\n VpcDataSourceEnum[\"default\"] = \"default\";\n VpcDataSourceEnum[\"dexf\"] = \"DEXF\";\n VpcDataSourceEnum[\"iows\"] = \"IOWS\";\n})(VpcDataSourceEnum || (VpcDataSourceEnum = {}));\nexports.default = VpcDataSourceEnum;\n//# sourceMappingURL=VpcDataSourceEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar WriteDirectionEnum;\n(function (WriteDirectionEnum) {\n WriteDirectionEnum[\"ltr\"] = \"ltr\";\n WriteDirectionEnum[\"rtl\"] = \"rtl\";\n})(WriteDirectionEnum || (WriteDirectionEnum = {}));\nexports.default = WriteDirectionEnum;\n//# sourceMappingURL=WriteDirectionEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ZipAvailabilityDataSourceEnum;\n(function (ZipAvailabilityDataSourceEnum) {\n ZipAvailabilityDataSourceEnum[\"disabled\"] = \"disabled\";\n ZipAvailabilityDataSourceEnum[\"DEXF\"] = \"DEXF\";\n})(ZipAvailabilityDataSourceEnum || (ZipAvailabilityDataSourceEnum = {}));\nexports.default = ZipAvailabilityDataSourceEnum;\n//# sourceMappingURL=ZipAvailabilityDataSourceEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ZipAvailabilityProbabilityEnum;\n(function (ZipAvailabilityProbabilityEnum) {\n ZipAvailabilityProbabilityEnum[\"highInStock\"] = \"HIGH_IN_STOCK\";\n ZipAvailabilityProbabilityEnum[\"mediumInStock\"] = \"MEDIUM_IN_STOCK\";\n ZipAvailabilityProbabilityEnum[\"lowInStock\"] = \"LOW_IN_STOCK\";\n ZipAvailabilityProbabilityEnum[\"outOfStock\"] = \"OUT_OF_STOCK\";\n ZipAvailabilityProbabilityEnum[\"notInRange\"] = \"NOT_IN_RANGE\";\n ZipAvailabilityProbabilityEnum[\"notSoldTemp\"] = \"NOT_SOLD_TEMP\";\n})(ZipAvailabilityProbabilityEnum || (ZipAvailabilityProbabilityEnum = {}));\nexports.default = ZipAvailabilityProbabilityEnum;\n//# sourceMappingURL=ZipAvailabilityProbabilityEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ZipValidationDataSourceEnum;\n(function (ZipValidationDataSourceEnum) {\n ZipValidationDataSourceEnum[\"disabled\"] = \"disabled\";\n ZipValidationDataSourceEnum[\"DEXF\"] = \"DEXF\";\n})(ZipValidationDataSourceEnum || (ZipValidationDataSourceEnum = {}));\nexports.default = ZipValidationDataSourceEnum;\n//# sourceMappingURL=ZipValidationDataSourceEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ThemeSpacingEnum = exports.ThemeMotionIconDurationEnum = exports.ThemeMotionEaseEnum = exports.ThemeMotionDurationEnum = exports.ThemeMotionDelayEnum = exports.ThemeFontStyleTypeEnum = exports.ThemeBreakpointIndexEnum = exports.ThemeBreakpointEnum = exports.TemporaryPricePeriodEnum = exports.StoreDataSourceEnum = exports.StoreBuTypeEnum = exports.StoreAvailabilityReasonCodeEnum = exports.StoreAvailabilityProbabilityEnum = exports.StoreAvailabilityDataSourceEnum = exports.StatusIndicatorColorEnum = exports.SheetAlignmentEnum = exports.SaveDataSourceEnum = exports.SalesTypeCodeEnum = exports.SalesSystemEnum = exports.SalesDivisionCodeEnum = exports.ProductOptionalFieldNameEnum = exports.ProductDataSourceEnum = exports.ProductComplianceTechnicalHeadingTypeEnum = exports.ProductComplianceLabelTypeEnum = exports.NotificationLinkTypeEnum = exports.NotificationDataSourceEnum = exports.MvEcomShoppingBagTypeEnum = exports.MvEcomIrwBagTypeEnum = exports.ItemTypeEnum = exports.IowsShoppingBagTypeEnum = exports.InvalidProductReasonEnum = exports.ImageTypeNameEnum = exports.ImageSizeTypeEnum = exports.IksaShoppingBagTypeEnum = exports.HeadingsEnum = exports.FinancingOptionDataSourceEnum = exports.EcommerceShoppingListDataSourceEnum = exports.EcommerceCartDataSourceEnum = exports.DexfSettingsFilterSegmentEnum = exports.DexfSettingsEnvironmentEnum = exports.DexfNotificationTypeEnum = exports.CookieInformationDataSourceEnum = exports.CookieConsentDataSourceEnum = exports.AutoCompleteEnum = exports.AssemblyServicesDataSourceEnum = exports.ApiPlatformEnum = exports.AkamaiImageQualityEnum = exports.AccountDataSourceEnum = exports.ABTestVariationEnum = exports.ABTestNameEnum = void 0;\nexports.ZipValidationDataSourceEnum = exports.ZipAvailabilityProbabilityEnum = exports.ZipAvailabilityDataSourceEnum = exports.WriteDirectionEnum = exports.VpcDataSourceEnum = void 0;\nconst ABTestNameEnum_1 = __importDefault(require(\"./ABTestNameEnum\"));\nexports.ABTestNameEnum = ABTestNameEnum_1.default;\nconst ABTestVariationEnum_1 = __importDefault(require(\"./ABTestVariationEnum\"));\nexports.ABTestVariationEnum = ABTestVariationEnum_1.default;\nconst AccountDataSourceEnum_1 = __importDefault(require(\"./AccountDataSourceEnum\"));\nexports.AccountDataSourceEnum = AccountDataSourceEnum_1.default;\nconst AkamaiImageQualityEnum_1 = __importDefault(require(\"./AkamaiImageQualityEnum\"));\nexports.AkamaiImageQualityEnum = AkamaiImageQualityEnum_1.default;\nconst ApiPlatformEnum_1 = __importDefault(require(\"./ApiPlatformEnum\"));\nexports.ApiPlatformEnum = ApiPlatformEnum_1.default;\nconst AssemblyServicesDataSourceEnum_1 = __importDefault(require(\"./AssemblyServicesDataSourceEnum\"));\nexports.AssemblyServicesDataSourceEnum = AssemblyServicesDataSourceEnum_1.default;\nconst AutoCompleteEnum_1 = __importDefault(require(\"./AutoCompleteEnum\"));\nexports.AutoCompleteEnum = AutoCompleteEnum_1.default;\nconst CookieConsentDataSourceEnum_1 = __importDefault(require(\"./CookieConsentDataSourceEnum\"));\nexports.CookieConsentDataSourceEnum = CookieConsentDataSourceEnum_1.default;\nconst CookieInformationDataSourceEnum_1 = __importDefault(require(\"./CookieInformationDataSourceEnum\"));\nexports.CookieInformationDataSourceEnum = CookieInformationDataSourceEnum_1.default;\nconst DexfNotificationTypeEnum_1 = __importDefault(require(\"./DexfNotificationTypeEnum\"));\nexports.DexfNotificationTypeEnum = DexfNotificationTypeEnum_1.default;\nconst DexfSettingsEnvironmentEnum_1 = __importDefault(require(\"./DexfSettingsEnvironmentEnum\"));\nexports.DexfSettingsEnvironmentEnum = DexfSettingsEnvironmentEnum_1.default;\nconst DexfSettingsFilterSegmentEnum_1 = __importDefault(require(\"./DexfSettingsFilterSegmentEnum\"));\nexports.DexfSettingsFilterSegmentEnum = DexfSettingsFilterSegmentEnum_1.default;\nconst EcommerceCartDataSourceEnum_1 = __importDefault(require(\"./EcommerceCartDataSourceEnum\"));\nexports.EcommerceCartDataSourceEnum = EcommerceCartDataSourceEnum_1.default;\nconst EcommerceShoppingListDataSourceEnum_1 = __importDefault(require(\"./EcommerceShoppingListDataSourceEnum\"));\nexports.EcommerceShoppingListDataSourceEnum = EcommerceShoppingListDataSourceEnum_1.default;\nconst FinancingOptionDataSourceEnum_1 = __importDefault(require(\"./FinancingOptionDataSourceEnum\"));\nexports.FinancingOptionDataSourceEnum = FinancingOptionDataSourceEnum_1.default;\nconst HeadingsEnum_1 = __importDefault(require(\"./HeadingsEnum\"));\nexports.HeadingsEnum = HeadingsEnum_1.default;\nconst IksaShoppingBagTypeEnum_1 = __importDefault(require(\"./IksaShoppingBagTypeEnum\"));\nexports.IksaShoppingBagTypeEnum = IksaShoppingBagTypeEnum_1.default;\nconst ImageSizeTypeEnum_1 = __importDefault(require(\"./ImageSizeTypeEnum\"));\nexports.ImageSizeTypeEnum = ImageSizeTypeEnum_1.default;\nconst ImageTypeNameEnum_1 = __importDefault(require(\"./ImageTypeNameEnum\"));\nexports.ImageTypeNameEnum = ImageTypeNameEnum_1.default;\nconst InvalidProductReasonEnum_1 = __importDefault(require(\"./InvalidProductReasonEnum\"));\nexports.InvalidProductReasonEnum = InvalidProductReasonEnum_1.default;\nconst IowsShoppingBagTypeEnum_1 = __importDefault(require(\"./IowsShoppingBagTypeEnum\"));\nexports.IowsShoppingBagTypeEnum = IowsShoppingBagTypeEnum_1.default;\nconst ItemTypeEnum_1 = __importDefault(require(\"./ItemTypeEnum\"));\nexports.ItemTypeEnum = ItemTypeEnum_1.default;\nconst MvEcomIrwBagTypeEnum_1 = __importDefault(require(\"./MvEcomIrwBagTypeEnum\"));\nexports.MvEcomIrwBagTypeEnum = MvEcomIrwBagTypeEnum_1.default;\nconst MvEcomShoppingBagTypeEnum_1 = __importDefault(require(\"./MvEcomShoppingBagTypeEnum\"));\nexports.MvEcomShoppingBagTypeEnum = MvEcomShoppingBagTypeEnum_1.default;\nconst NotificationDataSourceEnum_1 = __importDefault(require(\"./NotificationDataSourceEnum\"));\nexports.NotificationDataSourceEnum = NotificationDataSourceEnum_1.default;\nconst NotificationLinkTypeEnum_1 = __importDefault(require(\"./NotificationLinkTypeEnum\"));\nexports.NotificationLinkTypeEnum = NotificationLinkTypeEnum_1.default;\nconst ProductComplianceLabelTypeEnum_1 = __importDefault(require(\"./ProductComplianceLabelTypeEnum\"));\nexports.ProductComplianceLabelTypeEnum = ProductComplianceLabelTypeEnum_1.default;\nconst ProductComplianceTechnicalHeadingTypeEnum_1 = __importDefault(require(\"./ProductComplianceTechnicalHeadingTypeEnum\"));\nexports.ProductComplianceTechnicalHeadingTypeEnum = ProductComplianceTechnicalHeadingTypeEnum_1.default;\nconst ProductDataSourceEnum_1 = __importDefault(require(\"./ProductDataSourceEnum\"));\nexports.ProductDataSourceEnum = ProductDataSourceEnum_1.default;\nconst ProductOptionalFieldNameEnum_1 = __importDefault(require(\"./ProductOptionalFieldNameEnum\"));\nexports.ProductOptionalFieldNameEnum = ProductOptionalFieldNameEnum_1.default;\nconst SalesDivisionCodeEnum_1 = __importDefault(require(\"./SalesDivisionCodeEnum\"));\nexports.SalesDivisionCodeEnum = SalesDivisionCodeEnum_1.default;\nconst SalesSystemEnum_1 = __importDefault(require(\"./SalesSystemEnum\"));\nexports.SalesSystemEnum = SalesSystemEnum_1.default;\nconst SalesTypeCodeEnum_1 = __importDefault(require(\"./SalesTypeCodeEnum\"));\nexports.SalesTypeCodeEnum = SalesTypeCodeEnum_1.default;\nconst SaveDataSourceEnum_1 = __importDefault(require(\"./SaveDataSourceEnum\"));\nexports.SaveDataSourceEnum = SaveDataSourceEnum_1.default;\nconst SheetAlignmentEnum_1 = __importDefault(require(\"./SheetAlignmentEnum\"));\nexports.SheetAlignmentEnum = SheetAlignmentEnum_1.default;\nconst StatusIndicatorColorEnum_1 = __importDefault(require(\"./StatusIndicatorColorEnum\"));\nexports.StatusIndicatorColorEnum = StatusIndicatorColorEnum_1.default;\nconst StoreAvailabilityDataSourceEnum_1 = __importDefault(require(\"./StoreAvailabilityDataSourceEnum\"));\nexports.StoreAvailabilityDataSourceEnum = StoreAvailabilityDataSourceEnum_1.default;\nconst StoreAvailabilityProbabilityEnum_1 = __importDefault(require(\"./StoreAvailabilityProbabilityEnum\"));\nexports.StoreAvailabilityProbabilityEnum = StoreAvailabilityProbabilityEnum_1.default;\nconst StoreAvailabilityReasonCodeEnum_1 = __importDefault(require(\"./StoreAvailabilityReasonCodeEnum\"));\nexports.StoreAvailabilityReasonCodeEnum = StoreAvailabilityReasonCodeEnum_1.default;\nconst StoreBuTypeEnum_1 = __importDefault(require(\"./StoreBuTypeEnum\"));\nexports.StoreBuTypeEnum = StoreBuTypeEnum_1.default;\nconst StoreDataSourceEnum_1 = __importDefault(require(\"./StoreDataSourceEnum\"));\nexports.StoreDataSourceEnum = StoreDataSourceEnum_1.default;\nconst TemporaryPricePeriodEnum_1 = __importDefault(require(\"./TemporaryPricePeriodEnum\"));\nexports.TemporaryPricePeriodEnum = TemporaryPricePeriodEnum_1.default;\nconst ThemeBreakpointEnum_1 = __importDefault(require(\"./ThemeBreakpointEnum\"));\nexports.ThemeBreakpointEnum = ThemeBreakpointEnum_1.default;\nconst ThemeBreakpointIndexEnum_1 = __importDefault(require(\"./ThemeBreakpointIndexEnum\"));\nexports.ThemeBreakpointIndexEnum = ThemeBreakpointIndexEnum_1.default;\nconst ThemeFontStyleTypeEnum_1 = __importDefault(require(\"./ThemeFontStyleTypeEnum\"));\nexports.ThemeFontStyleTypeEnum = ThemeFontStyleTypeEnum_1.default;\nconst ThemeMotionDelayEnum_1 = __importDefault(require(\"./ThemeMotionDelayEnum\"));\nexports.ThemeMotionDelayEnum = ThemeMotionDelayEnum_1.default;\nconst ThemeMotionDurationEnum_1 = __importDefault(require(\"./ThemeMotionDurationEnum\"));\nexports.ThemeMotionDurationEnum = ThemeMotionDurationEnum_1.default;\nconst ThemeMotionEaseEnum_1 = __importDefault(require(\"./ThemeMotionEaseEnum\"));\nexports.ThemeMotionEaseEnum = ThemeMotionEaseEnum_1.default;\nconst ThemeMotionIconDurationEnum_1 = __importDefault(require(\"./ThemeMotionIconDurationEnum\"));\nexports.ThemeMotionIconDurationEnum = ThemeMotionIconDurationEnum_1.default;\nconst ThemeSpacingEnum_1 = __importDefault(require(\"./ThemeSpacingEnum\"));\nexports.ThemeSpacingEnum = ThemeSpacingEnum_1.default;\nconst VpcDataSourceEnum_1 = __importDefault(require(\"./VpcDataSourceEnum\"));\nexports.VpcDataSourceEnum = VpcDataSourceEnum_1.default;\nconst WriteDirectionEnum_1 = __importDefault(require(\"./WriteDirectionEnum\"));\nexports.WriteDirectionEnum = WriteDirectionEnum_1.default;\nconst ZipAvailabilityDataSourceEnum_1 = __importDefault(require(\"./ZipAvailabilityDataSourceEnum\"));\nexports.ZipAvailabilityDataSourceEnum = ZipAvailabilityDataSourceEnum_1.default;\nconst ZipAvailabilityProbabilityEnum_1 = __importDefault(require(\"./ZipAvailabilityProbabilityEnum\"));\nexports.ZipAvailabilityProbabilityEnum = ZipAvailabilityProbabilityEnum_1.default;\nconst ZipValidationDataSourceEnum_1 = __importDefault(require(\"./ZipValidationDataSourceEnum\"));\nexports.ZipValidationDataSourceEnum = ZipValidationDataSourceEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = Object.freeze({\n authentication: 'authentication',\n localization: 'localization',\n translations: 'translations',\n product: 'product',\n storeAvailability: 'storeAvailability',\n store: 'store'\n});\n//# sourceMappingURL=CacheStoreType.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ExceptionTypeEnum;\n(function (ExceptionTypeEnum) {\n ExceptionTypeEnum[\"platformComponentElement\"] = \"platformComponentElement\";\n ExceptionTypeEnum[\"platform\"] = \"platform\";\n ExceptionTypeEnum[\"componentElement\"] = \"componentElement\";\n ExceptionTypeEnum[\"component\"] = \"component\";\n ExceptionTypeEnum[\"service\"] = \"service\";\n ExceptionTypeEnum[\"generic\"] = \"generic\";\n ExceptionTypeEnum[\"serverErrorResponse\"] = \"serverErrorResponse\";\n ExceptionTypeEnum[\"connectionProblem\"] = \"connectionProblem\";\n ExceptionTypeEnum[\"unableToParseServerResponse\"] = \"unableToParseServerResponse\";\n /**\n * @deprecated This exception type is not being used by any service and will\n * be removed in the future along with InvalidZipCodeException.\n */\n ExceptionTypeEnum[\"invalidZipCode\"] = \"invalidZipCode\";\n ExceptionTypeEnum[\"shoppingCart\"] = \"shoppingCart\";\n})(ExceptionTypeEnum || (ExceptionTypeEnum = {}));\nexports.default = ExceptionTypeEnum;\n//# sourceMappingURL=ExceptionTypeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Custom exception.\n */\nclass AbstractException extends Error {\n}\nexports.default = AbstractException;\n//# sourceMappingURL=AbstractException.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst AbstractException_1 = __importDefault(require(\"../AbstractException\"));\nconst ExceptionTypeEnum_1 = __importDefault(require(\"../enums/ExceptionTypeEnum\"));\n/**\n * Custom exception.\n */\nclass ComponentElementException extends AbstractException_1.default {\n /**\n * Class constructor.\n *\n * @param element Element.\n * @param message The error message.\n */\n constructor(element, message) {\n super(element.tagName + ' => ' + message);\n this.exceptionType = ExceptionTypeEnum_1.default.componentElement;\n this.name = 'ComponentElementException';\n this.elementTagName = element.tagName;\n }\n}\nexports.default = ComponentElementException;\n//# sourceMappingURL=ComponentElementException.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst AbstractException_1 = __importDefault(require(\"../AbstractException\"));\nconst ExceptionTypeEnum_1 = __importDefault(require(\"../enums/ExceptionTypeEnum\"));\n/**\n * Custom exception.\n */\nclass ComponentException extends AbstractException_1.default {\n constructor() {\n super(...arguments);\n this.exceptionType = ExceptionTypeEnum_1.default.component;\n this.name = 'ComponentException';\n }\n}\nexports.default = ComponentException;\n//# sourceMappingURL=ComponentException.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst AbstractException_1 = __importDefault(require(\"../AbstractException\"));\nconst ExceptionTypeEnum_1 = __importDefault(require(\"../enums/ExceptionTypeEnum\"));\n/**\n * Custom exception.\n */\nclass ConnectionProblemException extends AbstractException_1.default {\n /**\n * Class constructor.\n *\n * @param requestInfo Request info.\n * @param message Message.\n */\n constructor(requestInfo, message) {\n super(`Connection to \"${requestInfo.toString()}\" failed.${message ? ` Error: ${message}` : ''}`);\n this.exceptionType = ExceptionTypeEnum_1.default.connectionProblem;\n this.name = 'ConnectionProblemException';\n this.requestInfo = requestInfo;\n }\n}\nexports.default = ConnectionProblemException;\n//# sourceMappingURL=ConnectionProblemException.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst AbstractException_1 = __importDefault(require(\"../AbstractException\"));\nconst ExceptionTypeEnum_1 = __importDefault(require(\"../enums/ExceptionTypeEnum\"));\n/**\n * Custom exception.\n */\nclass Exception extends AbstractException_1.default {\n constructor() {\n super(...arguments);\n this.exceptionType = ExceptionTypeEnum_1.default.generic;\n this.name = 'Exception';\n }\n}\nexports.default = Exception;\n//# sourceMappingURL=Exception.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst AbstractException_1 = __importDefault(require(\"../AbstractException\"));\nconst ExceptionTypeEnum_1 = __importDefault(require(\"../enums/ExceptionTypeEnum\"));\n/**\n * Custom exception.\n *\n * @deprecated This exception is not being used by any service and will be\n * removed in the future along with ExceptionTypeEnum.invalidZipCode.\n */\nclass InvalidZipCodeException extends AbstractException_1.default {\n constructor() {\n super(...arguments);\n this.exceptionType = ExceptionTypeEnum_1.default.invalidZipCode;\n this.name = 'InvalidZipCodeException';\n }\n}\nexports.default = InvalidZipCodeException;\n//# sourceMappingURL=InvalidZipCodeException.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst AbstractException_1 = __importDefault(require(\"../AbstractException\"));\nconst ExceptionTypeEnum_1 = __importDefault(require(\"../enums/ExceptionTypeEnum\"));\n/**\n * Custom exception.\n */\nclass ServerErrorResponseException extends AbstractException_1.default {\n /**\n * Class constructor.\n *\n * @param response Server response.\n * @param message Message.\n */\n constructor(response, message) {\n super(`Failed to fetch from \"${response.url}\". Server responded with ${response.status} ${response.statusText}.${message ? ` Error: ${message}` : ''}`);\n this.exceptionType = ExceptionTypeEnum_1.default.serverErrorResponse;\n this.name = 'ServerErrorResponseException';\n this.serverResponse = response;\n }\n}\nexports.default = ServerErrorResponseException;\n//# sourceMappingURL=ServerErrorResponseException.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst AbstractException_1 = __importDefault(require(\"../AbstractException\"));\nconst ExceptionTypeEnum_1 = __importDefault(require(\"../enums/ExceptionTypeEnum\"));\n/**\n * Custom exception.\n */\nclass ServiceException extends AbstractException_1.default {\n constructor() {\n super(...arguments);\n this.exceptionType = ExceptionTypeEnum_1.default.service;\n this.name = 'ServiceException';\n }\n}\nexports.default = ServiceException;\n//# sourceMappingURL=ServiceException.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst AbstractException_1 = __importDefault(require(\"../AbstractException\"));\nconst ExceptionTypeEnum_1 = __importDefault(require(\"../enums/ExceptionTypeEnum\"));\n/**\n * Custom exception.\n */\nclass ShoppingCartException extends AbstractException_1.default {\n /**\n * Class constructor.\n *\n * @param failedShoppingItems Failed shopping items from the server. Probably from the NifApi when add to cart request fails.\n * @param errorList Expected errors from the Cart API.\n */\n constructor(failedShoppingItems, errorList) {\n super(`Error when trying to add items to cart. ${failedShoppingItems ? 'Article errors: ' + JSON.stringify(failedShoppingItems) : ''}`);\n this.exceptionType = ExceptionTypeEnum_1.default.shoppingCart;\n this.name = 'ShoppingCartException';\n this.failedShoppingItems = Array();\n this.errorList = Array();\n this.failedShoppingItems = failedShoppingItems;\n this.errorList = errorList;\n }\n}\nexports.default = ShoppingCartException;\n//# sourceMappingURL=ShoppingCartException.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst AbstractException_1 = __importDefault(require(\"../AbstractException\"));\nconst ExceptionTypeEnum_1 = __importDefault(require(\"../enums/ExceptionTypeEnum\"));\n/**\n * Custom exception.\n */\nclass UnableToParseServerResponseException extends AbstractException_1.default {\n /**\n * Class constructor.\n *\n * @param response Server response.\n * @param message Message.\n */\n constructor(response, message) {\n super(`Unable to parse response from \"${response.url}\". Server responded with ${response.status} ${response.statusText}.${message ? ` Error: ${message}` : ''}`);\n this.exceptionType = ExceptionTypeEnum_1.default.unableToParseServerResponse;\n this.name = 'UnableToParseServerResponseException';\n this.serverResponse = response;\n }\n}\nexports.default = UnableToParseServerResponseException;\n//# sourceMappingURL=UnableToParseServerResponseException.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UnableToParseServerResponseException = exports.ShoppingCartException = exports.ServiceException = exports.ServerErrorResponseException = exports.InvalidZipCodeException = exports.ExceptionTypeEnum = exports.Exception = exports.ConnectionProblemException = exports.ComponentException = exports.ComponentElementException = exports.AbstractException = void 0;\nconst ExceptionTypeEnum_1 = __importDefault(require(\"./enums/ExceptionTypeEnum\"));\nexports.ExceptionTypeEnum = ExceptionTypeEnum_1.default;\nconst ComponentElementException_1 = __importDefault(require(\"./exceptions/ComponentElementException\"));\nexports.ComponentElementException = ComponentElementException_1.default;\nconst ComponentException_1 = __importDefault(require(\"./exceptions/ComponentException\"));\nexports.ComponentException = ComponentException_1.default;\nconst ConnectionProblemException_1 = __importDefault(require(\"./exceptions/ConnectionProblemException\"));\nexports.ConnectionProblemException = ConnectionProblemException_1.default;\nconst Exception_1 = __importDefault(require(\"./exceptions/Exception\"));\nexports.Exception = Exception_1.default;\nconst InvalidZipCodeException_1 = __importDefault(require(\"./exceptions/InvalidZipCodeException\"));\nexports.InvalidZipCodeException = InvalidZipCodeException_1.default;\nconst ServerErrorResponseException_1 = __importDefault(require(\"./exceptions/ServerErrorResponseException\"));\nexports.ServerErrorResponseException = ServerErrorResponseException_1.default;\nconst ServiceException_1 = __importDefault(require(\"./exceptions/ServiceException\"));\nexports.ServiceException = ServiceException_1.default;\nconst ShoppingCartException_1 = __importDefault(require(\"./exceptions/ShoppingCartException\"));\nexports.ShoppingCartException = ShoppingCartException_1.default;\nconst UnableToParseServerResponseException_1 = __importDefault(require(\"./exceptions/UnableToParseServerResponseException\"));\nexports.UnableToParseServerResponseException = UnableToParseServerResponseException_1.default;\nconst AbstractException_1 = __importDefault(require(\"./AbstractException\"));\nexports.AbstractException = AbstractException_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n *\n */\nclass LocalizedInformationAlternateLanguage {\n /**\n * Gets the current alternate languages as an array.\n *\n * @param settings\n * @param settings.localisation\n * @param settings.localisation.alternateLanguages\n * @param locale\n * @returns Current language options.\n */\n static getAlternateLanguages(settings, locale) {\n if (settings) {\n const [, country] = locale.split('-');\n const alternateLanguages = 'localisation' in settings\n ? settings.localisation.alternateLanguages\n : settings.localization.alternateLanguages;\n return alternateLanguages\n .split(';')\n .reduce((accumulator, language) => {\n const [value, label] = language.split(':');\n if (label) {\n accumulator.push({ locale: `${value.toLowerCase()}-${country}`, label });\n }\n return accumulator;\n }, []);\n }\n return [];\n }\n}\nexports.default = LocalizedInformationAlternateLanguage;\n//# sourceMappingURL=LocalizedInformationAlternateLanguage.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Easings are taken from: https://gist.github.com/gre/1650294.\n */\nconst EASINGS = {\n easeInOutCubic: (t) => {\n return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;\n }\n};\n/**\n * This class is used for creating an animation with an easing.\n */\nclass EasingAnimation {\n constructor() {\n this.startValue = 0; // Start value\n this.endValue = 20; // End value\n this.easingType = 'easeInOutCubic'; // Type of easing\n this.animationDuration = 500; // Animation duration in ms\n this.frameInterval = 20; // Min time between frames in ms\n this.isRunning = false;\n this.frames = null;\n this.value = 0;\n this.animationStartTime = 0;\n this.lastFrame = 0;\n this.animationFrameId = null;\n this.events = {\n frame: [],\n end: []\n };\n this.callback = () => {\n // Do nothing\n }; // Callback to be called between each iteration\n }\n /**\n * Adds an event listener.\n *\n * @param eventName Event name (frame, end).\n * @param callback Callback to be called.\n */\n on(eventName, callback) {\n this.events[eventName].push(callback);\n }\n /**\n * Removes an event listener.\n *\n * @param eventName Event name (frame, end).\n * @param callback Callback to be called.\n */\n off(eventName, callback) {\n const index = this.events[eventName].indexOf(callback);\n if (index > -1) {\n this.events[eventName].splice(index, 1);\n }\n }\n /**\n * Triggers an event.\n *\n * @param eventName Event name (frame, end).\n * @param data Data to send to the callback.\n */\n trigger(eventName, data) {\n for (const callback of this.events[eventName]) {\n callback(data);\n }\n }\n /**\n * Starts the animation.\n */\n start() {\n this.animationFrameId && cancelAnimationFrame(this.animationFrameId);\n this.isRunning = true;\n this.value = this.startValue;\n this.animationStartTime = performance.now();\n this.animationFrameId = requestAnimationFrame(this.animate.bind(this));\n }\n /**\n * Stops the animation.\n */\n stop() {\n if (this.isRunning) {\n this.isRunning = false;\n this.animationFrameId && cancelAnimationFrame(this.animationFrameId);\n this.trigger('end', this.value);\n }\n }\n /**\n * Calculate eased value, from start value to end value, based on percent of progress.\n *\n * @param startValue Initial value for easing.\n * @param endValue Final value for easing.\n * @param progress Progress of animation [0 to 1].\n * @returns New value based on easing and progress.\n */\n calculateValue(startValue, endValue, progress) {\n let newValue = 0;\n if (startValue < endValue) {\n newValue = startValue + (endValue - startValue) * EASINGS.easeInOutCubic(progress);\n }\n else {\n newValue = startValue - (startValue - endValue) * EASINGS.easeInOutCubic(progress);\n }\n if (startValue === Math.round(startValue) && endValue === Math.round(endValue)) {\n newValue = Math.round(newValue);\n }\n if (progress > 1) {\n newValue = endValue;\n }\n return newValue;\n }\n /**\n * Animation frame - callback passed to rAF.\n *\n * @param now Current time when rAF start to fire callback.\n */\n animate(now) {\n const animationElapsedTime = now - this.animationStartTime;\n const frameElapsedTime = now - this.lastFrame;\n this.value = this.calculateValue(this.startValue, this.endValue, animationElapsedTime / this.animationDuration);\n if (animationElapsedTime > this.animationDuration) {\n this.trigger('frame', this.endValue);\n this.stop();\n }\n else {\n this.animationFrameId = requestAnimationFrame(this.animate.bind(this));\n if (frameElapsedTime > this.frameInterval) {\n this.trigger('frame', this.value);\n this.lastFrame = now - (frameElapsedTime % this.frameInterval);\n }\n }\n }\n}\nexports.default = EasingAnimation;\n//# sourceMappingURL=EasingAnimation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\n/**\n * Availability utility.\n */\nclass AvailabilityUtility {\n /**\n * Returns the availability status for the supplied product(s).\n *\n * There are four possible cases for availability.\n * Only one product exists.\n * Several storeAvailabilities exists, where the type of the storeAvailabilities is the same.\n * Several storeAvailabilities exists, where the type of the storeAvailabilities is different.\n * Null, if something unexpected occurs.\n *\n * @param availabilities Store availability information for individual products.\n */\n static getStoreAvailabilityStatus(availabilities) {\n if (availabilities.length === 1) {\n return this.getSingleAvailability(availabilities[0]);\n }\n const storeAvailabilities = this.mapAvailabiltiesToEnum(availabilities);\n if (storeAvailabilities.length === 0) {\n return null;\n }\n const findStoreAvailabilityWithMatchingTypes = this.findStoreAvailabilityWithMatchingTypes(storeAvailabilities);\n if (findStoreAvailabilityWithMatchingTypes) {\n return findStoreAvailabilityWithMatchingTypes;\n }\n const findAnyStoreAvailabilityType = this.findAnyStoreAvailabilityType(storeAvailabilities);\n if (findAnyStoreAvailabilityType) {\n return findAnyStoreAvailabilityType;\n }\n return null;\n }\n /**\n * Returns status indicator color.\n *\n * @param storeAvailability Store availability.\n * @returns Status indicator color.\n */\n static getStoreAvailabilityStatusColor(storeAvailability) {\n const availability = this.getStoreAvailabilty(storeAvailability);\n if (availability) {\n return this.getStoreAvailabilityColor(availability);\n }\n return null;\n }\n /**\n * Returns status indicator color for a given availability status.\n *\n * @param availabilityStatus\n * @returns Status indicator color.\n */\n static getStoreAvailabilityColor(availabilityStatus) {\n switch (availabilityStatus) {\n case enums_1.StoreAvailabilityProbabilityEnum.highInStock:\n return 'green';\n case enums_1.StoreAvailabilityProbabilityEnum.mediumInStock:\n case enums_1.StoreAvailabilityProbabilityEnum.lowInStock:\n case enums_1.StoreAvailabilityProbabilityEnum.someLowOrOutOfStock:\n return 'orange';\n case enums_1.StoreAvailabilityProbabilityEnum.outOfStock:\n case enums_1.StoreAvailabilityProbabilityEnum.notSoldAtStore:\n return 'red';\n case enums_1.StoreAvailabilityProbabilityEnum.orderItemSingle:\n case enums_1.StoreAvailabilityProbabilityEnum.orderItemMultiple:\n return 'grey';\n default:\n return null;\n }\n }\n /**\n * Returns status indicator label.\n *\n * @param options Options.\n * @param options.translations Localized information.\n * @param options.storeAvailability Store availability.\n * @returns Status indicator label.\n */\n static getStoreAvailabilityLabel(options) {\n const status = this.getStoreAvailabilty(options.storeAvailability);\n return AvailabilityUtility.getStoreAvailabilityTranslation(status, options.translations);\n }\n /**\n * Returns the store availability translation.\n *\n * @param availabilityStatus\n * @param localizedInformation\n * @param translations\n * @returns Store availability translation string.\n */\n static getStoreAvailabilityTranslation(availabilityStatus, translations) {\n switch (availabilityStatus) {\n case enums_1.StoreAvailabilityProbabilityEnum.highInStock:\n return translations.storeAvailabilityInStock;\n case enums_1.StoreAvailabilityProbabilityEnum.someLowOrOutOfStock:\n return translations.storeAvailabilitySomeLowOrOutOfStock;\n case enums_1.StoreAvailabilityProbabilityEnum.mediumInStock:\n case enums_1.StoreAvailabilityProbabilityEnum.lowInStock:\n return translations.storeAvailabilityLowInStock;\n case enums_1.StoreAvailabilityProbabilityEnum.outOfStock:\n return translations.storeAvailabilityOutOfStock;\n case enums_1.StoreAvailabilityProbabilityEnum.notSoldAtStore:\n return translations.storeAvailabilityNotSoldAtStore;\n case enums_1.StoreAvailabilityProbabilityEnum.orderItemSingle:\n case enums_1.StoreAvailabilityProbabilityEnum.orderItemMultiple:\n return translations.storeAvailabilityOrderItems;\n default:\n return null;\n }\n }\n /**\n * @param storeAvailability\n */\n static getSingleAvailability(storeAvailability) {\n var _a, _b, _c, _d, _e;\n if (((_a = storeAvailability.content.cashCarry) === null || _a === void 0 ? void 0 : _a.inRange) === false) {\n if (((_b = storeAvailability.content.homeDelivery) === null || _b === void 0 ? void 0 : _b.inRange) === true) {\n return enums_1.StoreAvailabilityProbabilityEnum.orderItemSingle;\n }\n return enums_1.StoreAvailabilityProbabilityEnum.notSoldAtStore;\n }\n return (_e = (_d = (_c = storeAvailability.content) === null || _c === void 0 ? void 0 : _c.cashCarry) === null || _d === void 0 ? void 0 : _d.messageType) !== null && _e !== void 0 ? _e : null;\n }\n /**\n * Returns status indicator enum.\n *\n * @param storeAvailability Store availability.\n * @returns StoreAvailabilityProbabilityEnum | null.\n */\n static getStoreAvailabilty(storeAvailability // Prop name and type not to introduce a breaking change from originally only supporting one availabiltity\n ) {\n if (Array.isArray(storeAvailability)) {\n return this.getStoreAvailabilityStatus(storeAvailability);\n }\n return this.getStoreAvailabilityStatus([storeAvailability]);\n }\n /**\n * Maps the data returned from DEXF to our StoreAvailabilityProbabilityEnum[].\n * Special business cases are also handled with this function.\n *\n * @param availabilities IStoreAvailability[].\n */\n static mapAvailabiltiesToEnum(availabilities) {\n const { notSoldAtStore } = enums_1.StoreAvailabilityProbabilityEnum;\n return availabilities\n .map((storeAvailability) => {\n var _a, _b, _c;\n if (((_a = storeAvailability.content.cashCarry) === null || _a === void 0 ? void 0 : _a.inRange) === false) {\n if (((_b = storeAvailability.content.homeDelivery) === null || _b === void 0 ? void 0 : _b.inRange) === true) {\n return enums_1.StoreAvailabilityProbabilityEnum.orderItemSingle;\n }\n return notSoldAtStore;\n }\n return (_c = storeAvailability.content.cashCarry) === null || _c === void 0 ? void 0 : _c.messageType;\n })\n .filter((type) => {\n return type !== undefined && Object.values(enums_1.StoreAvailabilityProbabilityEnum).includes(type);\n });\n }\n /**\n * Returns the matching StoreAvailabilityProbabilityEnum, see StoreAvailability flowchart for a clearer picture.\n * Https://i-p-e-x.atlassian.net/wiki/spaces/KOMPIS/pages/36238426201/Component+flow+charts#Store-Availability.\n *\n * @param storeAvailabilities StoreAvailabilityProbabilityEnum[].\n */\n static findStoreAvailabilityWithMatchingTypes(storeAvailabilities) {\n const { highInStock, mediumInStock, lowInStock, outOfStock, notSoldAtStore, orderItemSingle, orderItemMultiple } = enums_1.StoreAvailabilityProbabilityEnum;\n if (storeAvailabilities.every((type) => type === orderItemSingle)) {\n return orderItemMultiple;\n }\n else if (storeAvailabilities.every((type) => type === notSoldAtStore)) {\n return notSoldAtStore;\n }\n else if (storeAvailabilities.every((type) => type === outOfStock || type === notSoldAtStore)) {\n return outOfStock;\n }\n else if (storeAvailabilities.some((type) => type === orderItemSingle)) {\n return orderItemMultiple;\n }\n else if (storeAvailabilities.every((type) => type === lowInStock || type === mediumInStock)) {\n return lowInStock;\n }\n else if (storeAvailabilities.every((type) => type === highInStock)) {\n return highInStock;\n }\n return null;\n }\n /**\n * Returns the matching StoreAvailabilityProbabilityEnum, see StoreAvailability flowchart for a clearer picture.\n * Https://i-p-e-x.atlassian.net/wiki/spaces/KOMPIS/pages/36238426201/Component+flow+charts#Store-Availability.\n *\n * @param storeAvailabilities StoreAvailabilityProbabilityEnum[].\n */\n static findAnyStoreAvailabilityType(storeAvailabilities) {\n if (storeAvailabilities.some((type) => type === enums_1.StoreAvailabilityProbabilityEnum.lowInStock ||\n type === enums_1.StoreAvailabilityProbabilityEnum.outOfStock ||\n type === enums_1.StoreAvailabilityProbabilityEnum.notSoldAtStore ||\n type === enums_1.StoreAvailabilityProbabilityEnum.mediumInStock)) {\n return enums_1.StoreAvailabilityProbabilityEnum.someLowOrOutOfStock;\n }\n return null;\n }\n}\nexports.default = AvailabilityUtility;\n//# sourceMappingURL=AvailabilityUtility.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Cache store manager.\n */\nclass CacheStore {\n constructor() {\n this.stores = {};\n }\n /**\n * Returns store.\n *\n * @param name Name.\n * @returns Map.\n */\n getStore(name) {\n this.stores[name] = this.stores[name] || new Map();\n return this.stores[name];\n }\n}\nexports.default = CacheStore;\n//# sourceMappingURL=CacheStore.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst CacheStore_1 = __importDefault(require(\"./CacheStore\"));\n/**\n * Cache store manager.\n */\nclass GlobalCacheStore extends CacheStore_1.default {\n /**\n * Constructor.\n *\n * @param [global] Global/Window object.\n */\n constructor(global) {\n super();\n this.global = global || window;\n }\n /**\n * Returns store.\n *\n * @param name Name.\n * @returns Map.\n */\n getStore(name) {\n this.global['$ikeaKompisCacheStores'] = this.global['$ikeaKompisCacheStores'] || {};\n this.global['$ikeaKompisCacheStores'][name] =\n this.global['$ikeaKompisCacheStores'][name] || new Map();\n return this.global['$ikeaKompisCacheStores'][name];\n }\n}\nexports.default = GlobalCacheStore;\n//# sourceMappingURL=GlobalCacheStore.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Class that interprets color formats and make operations on them.\n */\nclass ColorConverter {\n /**\n * @param colorA\n * @param colorB\n */\n static multiply(colorA, colorB) {\n return this.convertToHex(this.multiplyColors(this.interpretText(colorA), this.interpretText(colorB)));\n }\n /**\n * @param color\n * @param opacity\n */\n static multiplyOpacity(color, opacity) {\n const opacityColor = {\n red: 1,\n green: 1,\n blue: 1,\n opacity: opacity\n };\n return this.convertToHex(this.multiplyColors(this.interpretText(color), opacityColor));\n }\n /**\n * @param str\n */\n static interpretText(str) {\n if (str.startsWith('rgba(')) {\n const results = /rgba\\((.+)\\)/g.exec(str)[1];\n const list = results.split(',');\n return {\n // 0 - 255\n red: this.bitsToNumber(list[0]),\n green: this.bitsToNumber(list[1]),\n blue: this.bitsToNumber(list[2]),\n opacity: list.length === 4 ? Number(list[3]) : 1\n };\n }\n if (str.startsWith('#')) {\n if (str.length === 4) {\n // 0 - 16\n return {\n red: this.hexToNumber(str.substring(1, 2)),\n green: this.hexToNumber(str.substring(2, 3)),\n blue: this.hexToNumber(str.substring(3, 4)),\n opacity: 1\n };\n }\n else if (str.length === 5) {\n // 0 - 16\n return {\n red: this.hexToNumber(str.substring(1, 2)),\n green: this.hexToNumber(str.substring(2, 3)),\n blue: this.hexToNumber(str.substring(3, 4)),\n opacity: this.hexToNumber(str.substring(4, 5))\n };\n }\n else if (str.length === 7) {\n // 0 - 255\n return {\n red: this.hexToNumber(str.substring(1, 3)),\n green: this.hexToNumber(str.substring(3, 5)),\n blue: this.hexToNumber(str.substring(5, 7)),\n opacity: 1\n };\n }\n else if (str.length === 9) {\n // 0 - 255\n return {\n red: this.hexToNumber(str.substring(1, 3)),\n green: this.hexToNumber(str.substring(3, 5)),\n blue: this.hexToNumber(str.substring(5, 7)),\n opacity: this.hexToNumber(str.substring(7, 9))\n };\n }\n }\n throw new Error(\"Color not in rgba or hex format. Color must start with either 'rgba(' or '#'\");\n }\n /**\n * @param color\n */\n static convertToHex(color) {\n return ('#' +\n [\n this.numberToHexBits(color.red),\n this.numberToHexBits(color.green),\n this.numberToHexBits(color.blue),\n this.numberToHexBits(color.opacity)\n ].join(''));\n }\n /**\n * @param a\n * @param b\n */\n static multiplyColors(a, b) {\n return {\n red: a.red * b.red,\n green: a.green * b.green,\n blue: a.blue * b.blue,\n opacity: a.opacity * b.opacity\n };\n }\n /**\n * E.g. \"cc\" -> 0.8.\n *\n * @param hex\n */\n static hexToNumber(hex) {\n if (hex.length === 2) {\n return parseInt(hex, 16) / 255;\n }\n return parseInt(hex, 16) / 15;\n }\n /**\n * 0 - 255 to 0 - 1.\n *\n * @param bits\n */\n static bitsToNumber(bits) {\n return Number(bits) / 255;\n }\n /**\n * E.g. 0.8 -> \"cc\".\n *\n * @param number\n */\n static numberToHexBits(number) {\n const results = Math.round(number * 255).toString(16);\n if (results.length === 1) {\n return '0' + results;\n }\n return results;\n }\n}\nexports.default = ColorConverter;\n//# sourceMappingURL=ColorConverter.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * CssLoader.\n */\nclass CssLoader {\n /**\n *\n * @param url Url to css file.\n */\n constructor(url) {\n this.element = document.createElement('link');\n this.element.href = url;\n }\n /**\n * Load a css file by adding a link tag.\n *\n * @returns Promise event.\n *\n */\n load() {\n return new Promise((resolve, reject) => {\n this.element.addEventListener('load', resolve);\n this.element.addEventListener('error', reject);\n this.element.setAttribute('type', 'text/css');\n this.element.setAttribute('rel', 'stylesheet');\n document.head.appendChild(this.element);\n });\n }\n}\nexports.default = CssLoader;\n//# sourceMappingURL=CssLoader.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst REPLACERS = [\n [/yyyy|YYYY/, (date) => date.getFullYear()],\n [/yy|YY/, (date) => date.getFullYear().toString().slice(2)],\n ['MM', (date) => DateFormatter.addLeadingZeros(date.getMonth() + 1)],\n ['M', (date) => date.getMonth() + 1],\n ['DD', (date) => DateFormatter.addLeadingZeros(date.getDate())],\n ['D', (date) => date.getDate()],\n ['HH', (date) => DateFormatter.addLeadingZeros(date.getHours())],\n ['H', (date) => date.getHours()],\n ['mm', (date) => DateFormatter.addLeadingZeros(date.getMinutes())],\n ['m', (date) => date.getMinutes()],\n ['ss', (date) => DateFormatter.addLeadingZeros(date.getSeconds())],\n ['s', (date) => date.getSeconds()],\n ['SSS', (date) => date.getMilliseconds()],\n ['SS', (date) => Math.floor(date.getMilliseconds() / 10)],\n ['S', (date) => Math.floor(date.getMilliseconds() / 100)]\n];\n/**\n * Handles formatting of dates.\n */\nclass DateFormatter {\n /**\n * Formats a date.\n *\n * @param dateString Date string.\n * @returns Formatted date.\n */\n static isoStringToDate(dateString) {\n return new Date(dateString.replace('Z', ''));\n }\n /**\n * Formats a date object to a date string.\n *\n * @param date Date object or string to pass into the Date constructor.\n * @param [format] Format to use. Default is \"YYYY-MM-DD\".\n * @returns Formatted date.\n */\n static dateToString(date, format = 'YYYY-MM-DD') {\n const parsedDate = date instanceof Date ? date : new Date(date);\n if (isNaN(parsedDate.getTime())) {\n return parsedDate.toString();\n }\n return REPLACERS.reduce((str, [pattern, fnc]) => {\n const arr = str.split(pattern);\n if (arr.length === 1) {\n return arr[0];\n }\n return arr.join(fnc(parsedDate));\n }, format);\n }\n /**\n * Adds leading zeross to a number.\n *\n * @param value Number to add leading zeros to.\n * @returns Number with leading zeros converted to a string.\n */\n static addLeadingZeros(value) {\n value = String(value);\n while (value.length < 2) {\n value = '0' + value;\n }\n return value;\n }\n}\nexports.default = DateFormatter;\n//# sourceMappingURL=DateFormatter.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Handles debouncing.\n */\nclass DebounceManager {\n constructor() {\n this.debounces = {};\n }\n /**\n * Sets a debounce.\n *\n * @param name Name.\n * @param callback Callback.\n * @param timeout Timeout.\n */\n set(name, callback, timeout = 0) {\n this.clear(name);\n this.debounces[name] = window.setTimeout(callback, timeout);\n }\n /**\n * Checks if a debounce exists.\n *\n * @param name Name of debounce.\n * @returns TRUE if debounce exists.\n */\n exists(name) {\n return typeof this.debounces[name] !== 'undefined';\n }\n /**\n * Clears a debounce.\n *\n * @param name Name of debounce.\n */\n clear(name) {\n clearTimeout(this.debounces[name]);\n delete this.debounces[name];\n }\n /**\n * Clears all debounces.\n */\n clearAll() {\n for (const name of Object.keys(this.debounces)) {\n this.clear(name);\n }\n }\n}\nexports.default = DebounceManager;\n//# sourceMappingURL=DebounceManager.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst CHARACTERS = [\n ['&', '&'],\n ['<', '<'],\n ['>', '>'],\n ['\"', '"'],\n [\"'\", '''],\n ['/', '/']\n];\n/**\n * HTML encoder.\n */\nclass HtmlEncoder {\n /**\n * Encode for attribute.\n *\n * @param text Model object.\n * @returns Encoded text.\n */\n static encodeForAttribute(text) {\n for (const character of CHARACTERS) {\n text = text.replace(new RegExp(character[0], 'gm'), character[1] + ';');\n }\n return text;\n }\n}\nexports.default = HtmlEncoder;\n//# sourceMappingURL=HtmlEncoder.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst ENERGY_CLASSES = {\n 'A+++': 1,\n 'A++': 1,\n 'A+': 1,\n A: 1,\n B: 1,\n C: 1,\n D: 1,\n E: 1\n};\n/**\n * Energy Class Parser.\n */\nclass EnergyClassParser {\n /**\n * Parses product and returns energy class.\n *\n * @param product Product item.\n * @returns EnergyClass.\n */\n static parseProduct(product) {\n const complianceTechnicalEnergyFlag = this.parseProductComplianceTechnical(product);\n return complianceTechnicalEnergyFlag\n ? complianceTechnicalEnergyFlag\n : this.parseProductTechnicalInformation(product);\n }\n /**\n * Parses the technicalInformation object array if there is a Energy Efficiency Class header type available.\n *\n * @param product Product item.\n * @returns EnergyClass.\n */\n static parseProductTechnicalInformation(product) {\n var _a, _b;\n if (!((_b = (_a = product.content) === null || _a === void 0 ? void 0 : _a.technicalInformation) === null || _b === void 0 ? void 0 : _b.length)) {\n return null;\n }\n for (const item of product.content.technicalInformation) {\n if (typeof item.valueMetric === 'string') {\n if (ENERGY_CLASSES[item.valueMetric]) {\n return item.valueMetric;\n }\n }\n }\n return null;\n }\n /**\n * Parses the complianceTechnical object array if there is a Energy Efficiency Class header type available.\n *\n * @param product Product item.\n * @returns EnergyClass.\n */\n static parseProductComplianceTechnical(product) {\n var _a, _b;\n if (!((_b = (_a = product.content) === null || _a === void 0 ? void 0 : _a.complianceTechnical) === null || _b === void 0 ? void 0 : _b.length)) {\n return null;\n }\n const item = product.content.complianceTechnical.find((value) => value.headingType === enums_1.ProductComplianceTechnicalHeadingTypeEnum.energyEfficiencyClass);\n if (typeof (item === null || item === void 0 ? void 0 : item.text) === 'string') {\n if (ENERGY_CLASSES[item.text]) {\n return item.text;\n }\n }\n return null;\n }\n}\nexports.default = EnergyClassParser;\n//# sourceMappingURL=EnergyClassParser.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst GlobalCacheStore_1 = __importDefault(require(\"../cache/GlobalCacheStore\"));\n/**\n * Id generator for unique id's.\n */\nclass IdGenerator {\n /**\n * @param cache\n */\n constructor(cache = new GlobalCacheStore_1.default()) {\n this.cache = cache;\n }\n /**\n * Generates a unique id from the cache.\n *\n * @param cache\n * @returns Unique id.\n */\n generateId() {\n const store = this.cache.getStore('IdGenerator');\n const id = store.get('id') || 0;\n store.set('id', id + 1);\n return 'kompis' + (id + 1);\n }\n}\nexports.default = IdGenerator;\n//# sourceMappingURL=IdGenerator.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst EasingAnimation_1 = __importDefault(require(\"../animation/EasingAnimation\"));\nconst IframeConfig_json_1 = __importDefault(require(\"./IframeConfig.json\"));\nconst DEFAULT_SCROLL_OPTIONS = {\n element: null,\n animate: true,\n center: true,\n minDistance: 200,\n scrollTopMargin: 10\n};\n/**\n * This class is used for calculating the application size when inside an iframe.\n */\nclass IframeUtility {\n /**\n * Calculates the application height based on width.\n *\n * @param width Application width.\n * @returns Calculated height.\n */\n static calculateHeight(width) {\n const screen = this.getScreen(width);\n const orientation = screen.orientation;\n const deviceType = this.calculateDeviceType(screen.width, orientation);\n const appWidth = Math.min(width, IframeConfig_json_1.default.maxWidth);\n const availableHeight = this.getAvailableHeight(screen.height, deviceType);\n let height = appWidth / this.getRatio(orientation);\n height = Math.min(height, availableHeight, IframeConfig_json_1.default.maxHeightLandscape);\n if (screen.orientation === IframeConfig_json_1.default.orientation.landscape) {\n height = Math.max(height, this.getMinHeightLandscape(deviceType, appWidth));\n }\n return Math.floor(height);\n }\n /**\n * Returns the device type based on the application size.\n *\n * @returns Device type (mobile, desktop or tablet).\n */\n static getDeviceType() {\n const minMeasurement = Math.min(window.screen.availWidth, window.screen.availHeight);\n return this.calculateDeviceType(minMeasurement, 'portrait');\n }\n /**\n * Returns the current orientation based on width.\n *\n * @param width Application width.\n * @returns Orientation (landscape or portrait).\n */\n static getOrientation(width) {\n return this.getScreen(width).orientation;\n }\n /**\n * Scrolls the parent window to make the element visible.\n *\n * @param options Options object.\n * @param options.element Element to scroll into view.\n * @param [options.animate] TRUE to animate. Default is TRUE.\n * @param [options.center] TRUE to center the element. Default is TRUE.\n * @param [options.minDistance] Minimal distance before scroll will be activated. Default is \"200\" (px).\n * @param [options.scrollTopMargin] Scroll top margin that will be offset from the top of the element when the element height is greater than the screen height. Default is \"10\" (px);.\n * @returns Returns the easing animation if \"animate\" has been set to \"true\".\n */\n static scrollToElement(options) {\n var _a, _b;\n const optionsWithDefault = Object.assign(Object.assign({}, DEFAULT_SCROLL_OPTIONS), options);\n if (this.isInsideIframe() && this.isParentWindowAccessible()) {\n const screenHeight = window.parent.innerHeight;\n const parentScrollPosition = this.getScrollPosition(window.parent);\n const scrollY = parentScrollPosition.y;\n const iframeTop = ((_b = (_a = window.frameElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().top) !== null && _b !== void 0 ? _b : 0) + scrollY;\n const elementTop = optionsWithDefault.element.getBoundingClientRect().top +\n this.getScrollPosition().y +\n iframeTop;\n const elementHeight = optionsWithDefault.element.offsetHeight;\n const centeredElementScrollY = elementHeight > screenHeight\n ? elementTop - optionsWithDefault.scrollTopMargin\n : elementTop - screenHeight / 2 + elementHeight / 2 - optionsWithDefault.scrollTopMargin;\n const elementScrollY = optionsWithDefault.center\n ? centeredElementScrollY\n : elementTop - optionsWithDefault.scrollTopMargin;\n const newScrollY = elementScrollY > 0 ? elementScrollY : 0;\n const distanceY = newScrollY < scrollY ? scrollY - newScrollY : newScrollY - scrollY;\n if (optionsWithDefault.animate) {\n const frames = Math.floor(distanceY / 10);\n if (distanceY > optionsWithDefault.minDistance || elementHeight > screenHeight) {\n const animation = new EasingAnimation_1.default();\n animation.on('frame', (y) => window.parent.scrollTo(parentScrollPosition.x, y));\n animation.startValue = scrollY;\n animation.endValue = newScrollY;\n animation.frames = frames;\n animation.start();\n return animation;\n }\n }\n else {\n window.parent.scrollTo(parentScrollPosition.x, newScrollY);\n }\n }\n return null;\n }\n /**\n * Checks if the application is inside an iframe.\n *\n * @returns TRUE if inside an iframe.\n */\n static isInsideIframe() {\n try {\n if (window.parent === window) {\n return false;\n }\n }\n catch (error) {\n // Ignore error\n }\n return true;\n }\n /**\n * Checks if the parent window is accessible and not subject to cross-origin issues.\n *\n * @returns TRU if the parent window is accessible.\n */\n static isParentWindowAccessible() {\n try {\n window.parent.document;\n }\n catch (error) {\n return false;\n }\n return true;\n }\n /**\n * Returns parent scroll position.\n *\n * @param frame Frame object. Defaults to \"window\".\n * @returns Scroll position.\n */\n static getScrollPosition(frame = window) {\n return {\n y: frame.pageYOffset !== undefined\n ? frame.pageYOffset\n : frame.document.documentElement.scrollTop,\n x: frame.pageXOffset !== undefined\n ? frame.pageXOffset\n : frame.document.documentElement.scrollLeft\n };\n }\n /**\n * Returns the current screen data: width, height and orientation.\n *\n * @param width Application width.\n * @returns Screen setup.\n */\n static getScreen(width) {\n /*\n * Some devices may return same availWidth/availHeight despite rotation\n * using given iframe width and assuming that it will not be greater that the actual screen width,\n * we can assume that we are in portrait if the iframe width is smaller or same as the smallest of the values\n */\n if (width <=\n Math.min(window.screen.availWidth, window.screen.availHeight, IframeConfig_json_1.default.minWidthLandscape)) {\n return {\n width: Math.min(window.screen.availWidth, window.screen.availHeight),\n height: Math.max(window.screen.availWidth, window.screen.availHeight),\n orientation: IframeConfig_json_1.default.orientation.portrait\n };\n }\n else {\n return {\n width: Math.max(window.screen.availWidth, window.screen.availHeight),\n height: Math.min(window.screen.availWidth, window.screen.availHeight),\n orientation: IframeConfig_json_1.default.orientation.landscape\n };\n }\n }\n /**\n * Returns the available height.\n *\n * @param screenHeight The screen height.\n * @param deviceType Device type (mobile, desktop or tablet).\n * @returns Available height.\n */\n static getAvailableHeight(screenHeight, deviceType) {\n return screenHeight - IframeConfig_json_1.default.unavailableHeight[deviceType];\n }\n /**\n * Calculates the device type.\n *\n * @param screenWidth The screen width.\n * @param orientation Orientation (portrait or landscape).\n * @returns Device type (mobile, desktop or tablet).\n */\n static calculateDeviceType(screenWidth, orientation) {\n if (screenWidth < IframeConfig_json_1.default.screenWidthLimits[orientation].mobile) {\n // Largest known phone is 736 (iPhone 6+), smallest known tablet is 1024 (iPad)\n return 'mobile';\n }\n if (screenWidth <= IframeConfig_json_1.default.screenWidthLimits[orientation].tablet) {\n // Tablets larger than this may use full desktop ui\n return 'tablet';\n }\n return 'desktop';\n }\n /**\n * Returns the minimal possible height when in landscape.\n *\n * @param deviceType Device type (mobile, desktop or tablet).\n * @param appWidth Application width.\n * @returns Minimal height for landscape.\n */\n static getMinHeightLandscape(deviceType, appWidth) {\n if (deviceType == IframeConfig_json_1.default.deviceType.mobile) {\n return appWidth / IframeConfig_json_1.default.maxRatioLandscape;\n }\n return IframeConfig_json_1.default.minHeightLandscape;\n }\n /**\n * Returns the current ratio.\n *\n * @param orientation Orientation (portrait or landscape).\n * @returns Ratio.\n */\n static getRatio(orientation) {\n const ratio = IframeConfig_json_1.default.preferredRatio[orientation].split('/');\n return parseInt(ratio[0]) / parseInt(ratio[1]);\n }\n}\nexports.default = IframeUtility;\n//# sourceMappingURL=IframeUtility.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst IframeUtility_1 = __importDefault(require(\"./IframeUtility\"));\n/**\n * IframeVisibleArea.\n */\nclass IframeVisibleArea {\n /**\n * Returns bottom, top, left and right.\n *\n * @param overflow Overflow.\n * @returns Position.\n */\n static getArea(overflow) {\n if (!this.isInsideIframe) {\n throw 'IframeVisibleArea only works when it is called from inside an iframe';\n }\n else if (!this.isParentWindowAccessible) {\n throw 'Could not get visible iframe area. Parent window is not accessible.';\n }\n // TODO: Remove header height as we can't calculate it anymore after we removed uiPlatform from settings.\n const headerHeight = 0;\n const pageHeight = document.body.offsetHeight;\n const screenHeight = window.parent.innerHeight;\n if (!window.frameElement) {\n throw new Error('No frameElement available on window');\n }\n const frameRect = window.frameElement.getBoundingClientRect();\n const positionBottom = pageHeight + frameRect.top - screenHeight;\n const position = {\n top: frameRect.top < headerHeight ? -1 * frameRect.top + headerHeight : 0,\n bottom: positionBottom > 0 ? positionBottom : 0\n };\n if (overflow) {\n const pageBodyHeight = 320;\n position.top = frameRect.top < headerHeight ? -1 * frameRect.top + headerHeight : 0;\n position.bottom = positionBottom > 0 ? positionBottom : 0;\n const topOffset = pageHeight - position.bottom - position.top;\n position.top -= topOffset < pageBodyHeight ? pageBodyHeight - topOffset : 0;\n position.top = position.top > 0 ? position.top : 0;\n const bottomOffset = pageHeight - position.bottom - position.top;\n position.bottom -= bottomOffset < pageBodyHeight ? pageBodyHeight - bottomOffset : 0;\n position.bottom = position.bottom > 0 ? position.bottom : 0;\n return position;\n }\n else {\n return position;\n }\n }\n}\nIframeVisibleArea.isInsideIframe = IframeUtility_1.default.isInsideIframe();\nIframeVisibleArea.isParentWindowAccessible = IframeUtility_1.default.isParentWindowAccessible();\nexports.default = IframeVisibleArea;\n//# sourceMappingURL=IframeVisibleArea.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst DebounceManager_1 = __importDefault(require(\"../debounce/DebounceManager\"));\nconst IframeUtility_1 = __importDefault(require(\"./IframeUtility\"));\nconst IframeVisibleArea_1 = __importDefault(require(\"./IframeVisibleArea\"));\n/**\n * IframeVisibleAreaObserver.\n */\nclass IframeVisibleAreaObserver {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.callback\n * @param options.overflow\n * @param options.debounceTime\n */\n constructor(options) {\n this.callback = null;\n this.debounce = new DebounceManager_1.default();\n this.debounceTime = null;\n this.overflow = false;\n this.isInsideIframe = IframeUtility_1.default.isInsideIframe();\n this.isParentWindowAccessible = IframeUtility_1.default.isParentWindowAccessible();\n this.updateListener = () => {\n if (!this.callback) {\n return;\n }\n if (this.debounceTime) {\n this.debounce.set('update', this.callback, this.debounceTime);\n }\n else {\n this.callback();\n }\n };\n this.debounceTime = options ? options.debounceTime : null;\n this.overflow = options ? options.overflow : false;\n this.callback = options\n ? () => options.callback(IframeVisibleArea_1.default.getArea(this.overflow))\n : null;\n }\n /**\n * Start dispatching update events.\n */\n observe() {\n if (this.isInsideIframe && this.isParentWindowAccessible) {\n window.parent.addEventListener('scroll', this.updateListener);\n window.parent.addEventListener('resize', this.updateListener);\n window.addEventListener('resize', this.updateListener);\n }\n else {\n throw 'Parent window is not accessible or IframeVisibleAreaObserver will only work from within an iframe. Use position: sticky; instead';\n }\n }\n /**\n * Removes listeners.\n */\n disconnect() {\n if (this.isInsideIframe && this.isParentWindowAccessible) {\n window.parent.removeEventListener('scroll', this.updateListener);\n window.parent.removeEventListener('resize', this.updateListener);\n window.removeEventListener('resize', this.updateListener);\n this.debounce.clearAll();\n }\n }\n /**\n * Returns bottom, top, left and right.\n *\n * @returns Position.\n */\n getArea() {\n return IframeVisibleArea_1.default.getArea(false);\n }\n}\nexports.default = IframeVisibleAreaObserver;\n//# sourceMappingURL=IframeVisibleAreaObserver.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst AKAMAI_SIZES = {\n '40': 'xxu',\n '80': 'xu',\n '160': 'u',\n '300': 'xxxs',\n '400': 'xxs',\n '500': 'xs',\n '600': 's',\n '700': 'm',\n '750': 'l',\n '900': 'xl',\n '1100': 'xxl',\n '1400': 'xxxl',\n '1600': 'sg',\n '2000': 'g',\n '3000': 'xg',\n '4000': 'xxg'\n};\nconst SIZE_NUMBERS = Object.keys(AKAMAI_SIZES).map((size) => parseInt(size));\n/**\n * Utility for calculating image src.\n */\nclass ImageUtility {\n /**\n * Returns Akamai URL for an image.\n *\n * @param url URL of image.\n * @param width Width in pixels.\n * @param [quality] Quality.\n * @returns Akamai URL.\n */\n static getAkamaiImageUrl(url, width, quality) {\n return url + this.getAkamaiQueryString(width, quality);\n }\n /**\n * Returns an Akamai query string based on size.\n *\n * @param width Width of the image in px.\n * @param [quality] Quality.\n * @returns Query string.\n */\n static getAkamaiQueryString(width, quality) {\n return `?f=${this.getAkamaiSize(width)}${quality ? `&q=${quality}` : ''}`;\n }\n /**\n * Get Akamai formatted size.\n *\n * @param width Image width.\n * @returns Size.\n */\n static getAkamaiSize(width) {\n for (const akamaiSize of SIZE_NUMBERS) {\n if (width <= akamaiSize) {\n return AKAMAI_SIZES[akamaiSize.toString()];\n }\n }\n return AKAMAI_SIZES[SIZE_NUMBERS[SIZE_NUMBERS.length - 1].toString()];\n }\n}\nexports.default = ImageUtility;\n//# sourceMappingURL=ImageUtility.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * JavascriptLoader.\n */\nclass JavascriptLoader {\n /**\n *\n * @param url Url to script file.\n */\n constructor(url) {\n this.element = document.createElement('script');\n this.element.src = url;\n }\n /**\n * Load a script by adding a script tag.\n *\n * @returns Promise event.\n */\n load() {\n return new Promise((resolve, reject) => {\n this.element.addEventListener('load', resolve);\n this.element.addEventListener('error', reject);\n this.element.async = true;\n document.head.appendChild(this.element);\n });\n }\n}\nexports.default = JavascriptLoader;\n//# sourceMappingURL=JavascriptLoader.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * This utility is used for locking the screen in an awake state (preventing sleep).\n * Main purpose is for kiosk applications like IPEX Gallery.\n */\nclass KeepScreenAwakeUtility {\n /**\n * Keeps the screen on.\n */\n static setWakeLock() {\n return __awaiter(this, void 0, void 0, function* () {\n const typedNavigator = navigator;\n if ('wakeLock' in typedNavigator) {\n yield typedNavigator['wakeLock'].request('screen');\n }\n });\n }\n}\nexports.default = KeepScreenAwakeUtility;\n//# sourceMappingURL=KeepScreenAwakeUtility.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst emptyFunction = () => {\n // Do nothings\n};\nconst returnEmptyFunction = () => emptyFunction;\n/**\n * Latch.\n */\nclass Latch {\n constructor() {\n this.isFirstRun = true;\n this.isFinished = false;\n this.list = [];\n }\n /**\n * Takes a lock, causing execution to wait if number of callers exceeds maxCount.\n *\n * @returns Promise resolved or not depending on if caller must wait.\n */\n aquire() {\n if (this.isFinished) {\n return Promise.resolve(returnEmptyFunction);\n }\n else if (this.isFirstRun) {\n this.isFirstRun = false;\n return Promise.resolve().then(this.getFirstReleaseFunction.bind(this));\n }\n else {\n return new Promise(this.addResolveToList.bind(this)).then(returnEmptyFunction);\n }\n }\n /**\n * Add promise resolve to list.\n *\n * @param resolve Argument from Promise constructor.\n */\n addResolveToList(resolve) {\n this.list.push(resolve);\n }\n /**\n * @returns A function for release.\n */\n getFirstReleaseFunction() {\n return () => this.firstRelease();\n }\n /**\n * First release.\n */\n firstRelease() {\n this.isFinished = true;\n this.releaseAll();\n }\n /**\n * Release all promises.\n */\n releaseAll() {\n this.list.forEach((fun) => fun());\n this.list = [];\n }\n}\nexports.default = Latch;\n//# sourceMappingURL=Latch.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * This utility is used for locales.\n */\nclass LocaleUtility {\n /**\n * Converts a locale to country and language.\n *\n * @param locale Locale. Example: en-GB.\n * @returns Country and language.\n */\n static getCountryAndLanguage(locale) {\n const list = locale.split('-');\n if (list.length > 1 && list[0].length === 2 && list[1].length === 2) {\n return {\n country: list[1].toLowerCase(),\n language: list[0].toLowerCase()\n };\n }\n return {\n country: null,\n language: null\n };\n }\n}\nexports.default = LocaleUtility;\n//# sourceMappingURL=LocaleUtility.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Handles Measurement utilities.\n *\n * @param millimeter\n */\nclass MeasurementUtility {\n /**\n * Metric measurements to imperial measurements.\n *\n * @param millimeter Number to convert.\n * @param inFeet If it should contain feet.\n * @param withoutMeasureUnit Return with measurement unit or not.\n * @returns Numbers in imperial.\n */\n static metricToImperial(millimeter, inFeet = false, withoutMeasureUnit = false) {\n const inInch = this.roundToEighths(this.millimeterToInch(millimeter));\n let feet = 0;\n let inches = '0';\n if (inFeet) {\n feet = (inInch / 12) << 0;\n inches = this.decimalsToFractions(inInch % 12);\n }\n else {\n inches = this.decimalsToFractions(inInch);\n }\n if (feet !== 0 && inches !== '0') {\n return `${feet} ft ${inches} in`;\n }\n else if (feet !== 0) {\n return `${feet} ft`;\n }\n return withoutMeasureUnit ? inches : `${inches} in`;\n }\n /**\n * Millimeter to inch.\n *\n * @param millimeter Number to convert.\n * @returns Number in Inches.\n */\n static millimeterToInch(millimeter) {\n return millimeter * 0.0393700787;\n }\n /**\n * Round a number to closest eighths.\n *\n * @param inch Number to convert.\n * @returns Number in Inches rounded to closest eights.\n */\n static roundToEighths(inch) {\n return parseFloat((Math.round(inch * 8) / 8).toFixed(3));\n }\n /**\n * Greatest common divisor.\n *\n * @param a Number.\n * @param b Number.\n * @returns Number the greatest common divisor.\n */\n static greatestCommonDivisor(a, b) {\n if (b === 0) {\n return a;\n }\n return this.greatestCommonDivisor(b, a % b);\n }\n /**\n * Decimals to fractions.\n *\n * @param decimals Number e.g 1.125.\n * @returns String the greatest common divisor.\n */\n static decimalsToFractions(decimals) {\n const decimalArray = decimals.toString().split('.');\n if (decimalArray.length === 1) {\n return decimalArray[0];\n }\n const leftDecimalPart = parseInt(decimalArray[0]);\n const rightDecimalPart = decimalArray[1];\n let numerator = parseInt(rightDecimalPart);\n let denominator = Math.pow(10, rightDecimalPart.length);\n const factor = this.greatestCommonDivisor(numerator, denominator);\n numerator /= factor;\n denominator /= factor;\n return leftDecimalPart !== 0\n ? `${leftDecimalPart} ${numerator}/${denominator}`\n : `${numerator}/${denominator}`;\n }\n}\nexports.default = MeasurementUtility;\n//# sourceMappingURL=MeasurementUtility.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst THOUSAND_SEPERATOR_REGEXP = /(\\d+)(\\d{3})/;\n/**\n * This is an internal utility, not meant to be used by planners.\n *\n * Handles formatting of prices.\n */\nclass PriceFormatter {\n /**\n * Formats a price.\n * Make sure that you add a dir=\"ltr\" attribute to the HTML, so that '1 400' wont get reversed in morocco.\n *\n * @param amount Price amount.\n * @param priceSettingsOrDexfPriceSettings Price settings from LocalizationService or DEXF settings.\n * @param fractions\n * @returns Formatted price with currency and spacing. The price formats are joinable by doing: priceFormat.map(price => price.value).join('').\n */\n static format(amount, priceSettingsOrDexfPriceSettings) {\n const localisation = 'localisation' in priceSettingsOrDexfPriceSettings\n ? priceSettingsOrDexfPriceSettings.localisation\n : priceSettingsOrDexfPriceSettings;\n if (typeof amount !== 'number' || isNaN(amount)) {\n throw new exceptions_1.Exception('Failed to format price. Invalid number.');\n }\n const numberOfDecimals = localisation.numberOfDecimals;\n if (isNaN(numberOfDecimals) || numberOfDecimals === null) {\n throw new exceptions_1.Exception('priceSettings.numberOfDecimals is not a number.');\n }\n const noValueDecimalsString = localisation.noValueDecimalsString === ' ' ? '' : localisation.noValueDecimalsString;\n const fixedAmount = amount.toFixed(numberOfDecimals).split('.'); // Since the number of trailing zeroes is set with the toFixed, the values cannot be integer\n const fraction = fixedAmount.length === 2 ? fixedAmount[1] : `${0}`;\n // Thousand separator\n let integerString = fixedAmount[0];\n if (localisation.currencyCode === 'INR') {\n integerString = this.formatIndianThousandSeperator(integerString);\n }\n else if (localisation.thousandSeparatorEnabled && integerString.length > 3) {\n integerString = this.formatThousandSeperator(integerString, localisation.thousandSeparator);\n }\n // Decimals\n let decimalArray = [];\n if (localisation.replaceNoValueDecimals &&\n typeof noValueDecimalsString === 'string' &&\n Number(fraction) === 0) {\n decimalArray = [noValueDecimalsString];\n }\n else if (localisation.decimalSeparator && numberOfDecimals !== 0) {\n decimalArray = [localisation.decimalSeparator, fraction];\n }\n // List of parts in order\n const priceWithCurrency = [\n {\n type: 'integerPart',\n value: integerString\n }\n ];\n if (decimalArray.length > 0) {\n priceWithCurrency.push({\n type: 'decimalPart',\n value: decimalArray.join('')\n });\n }\n if (localisation.currencyPosition === 'before') {\n if (localisation.symbolSpacing) {\n priceWithCurrency.unshift({\n type: 'spacing',\n value: ' '\n });\n }\n priceWithCurrency.unshift({\n type: 'currency',\n value: localisation.currencySymbol\n });\n }\n else {\n if (localisation.symbolSpacing) {\n priceWithCurrency.push({\n type: 'spacing',\n value: ' '\n });\n }\n priceWithCurrency.push({\n type: 'currency',\n value: localisation.currencySymbol\n });\n }\n return priceWithCurrency;\n }\n /**\n * Returns Indian price with thousand separator.\n *\n * @param integerString Price integer part (no decimals).\n * @returns Indian price with thousand separator.\n */\n static formatIndianThousandSeperator(integerString) {\n const result = [];\n let thousand = '';\n if (integerString.length > 3) {\n thousand = ',' + integerString.substring(integerString.length - 3);\n integerString = integerString.substring(0, integerString.length - 3);\n while (integerString.length > 2) {\n result.unshift(integerString.substring(integerString.length - 2));\n integerString = integerString.substring(0, integerString.length - 2);\n }\n }\n if (integerString.length > 0) {\n result.unshift(integerString);\n }\n return result.join(',') + thousand;\n }\n /**\n * Returns price with thousand separator.\n *\n * @param integerString Price integer part (no decimals).\n * @param thousandSeparator Thousand separator.\n * @returns Price with thousand separator.\n */\n static formatThousandSeperator(integerString, thousandSeparator) {\n const separator = thousandSeparator || ' ';\n while (THOUSAND_SEPERATOR_REGEXP.test(integerString)) {\n integerString = integerString.replace(THOUSAND_SEPERATOR_REGEXP, '$1' + separator + '$2');\n }\n return integerString;\n }\n}\nexports.default = PriceFormatter;\n//# sourceMappingURL=PriceFormatter.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Product price information summary transformer.\n */\nclass ProductPriceInformationSummaryTransformer {\n /**\n * Extracts the information from the sales price of a product and puts it into properties that are easier to interpret.\n *\n * @param priceInformation Product price information.\n * @param useThisCurrency Currency code.\n * @param currency\n * @returns Product price information summary.\n */\n static transform(priceInformation, currency) {\n const priceInformationSummary = {\n temporaryFamilyPrice: false,\n newLowerPrice: false,\n timeRestrictedOffer: false,\n familyPrice: null,\n price: null,\n regularPrice: null\n };\n if (!(priceInformation === null || priceInformation === void 0 ? void 0 : priceInformation.salesPrice)) {\n return priceInformationSummary;\n }\n const primaryCurrency = [\n ...new Set(priceInformation.salesPrice.map((price) => price.currencyCode))\n ][0];\n const salesPrices = currency\n ? [...priceInformation.salesPrice]\n .filter((salesPrice) => salesPrice.currencyCode === currency)\n .reverse()\n : [...priceInformation.salesPrice]\n .filter((salesPrice) => salesPrice.currencyCode === primaryCurrency)\n .reverse();\n const isFamilyAndNLP = () => {\n const isFamily = salesPrices.some((salesPrice) => salesPrice.typeCode === 'IKEAFamilySalesUnitPrice');\n const isNLP = salesPrices.some((salesPrice) => salesPrice.typeCode === 'RegularSalesUnitPrice' &&\n salesPrice.changeReason === 'NewLowerPrice');\n return isFamily && isNLP;\n };\n const isFamilyAndNLPPrice = isFamilyAndNLP();\n for (const salesPrice of salesPrices) {\n if (salesPrice.typeCode === 'IKEAFamilySalesUnitPrice') {\n priceInformationSummary.familyPrice = salesPrice;\n if (salesPrice.changeReason && salesPrice.changeReason === 'Temporary') {\n priceInformationSummary.temporaryFamilyPrice = true;\n }\n }\n else if (salesPrice.changeReason && salesPrice.changeReason === 'NewLowerPrice') {\n priceInformationSummary.newLowerPrice = true;\n priceInformationSummary.price = salesPrice;\n if (salesPrice.previousSalesPrice) {\n if (isFamilyAndNLPPrice) {\n priceInformationSummary.regularPrice = Object.assign({}, salesPrice);\n }\n else {\n priceInformationSummary.regularPrice = Object.assign({}, salesPrice, salesPrice.previousSalesPrice);\n }\n }\n }\n else if (salesPrice.changeReason && salesPrice.changeReason === 'TimeRestrictedOffer') {\n priceInformationSummary.timeRestrictedOffer = true;\n priceInformationSummary.price = salesPrice;\n if (salesPrice.previousSalesPrice) {\n priceInformationSummary.regularPrice = Object.assign({}, salesPrice, salesPrice.previousSalesPrice);\n }\n }\n else if (priceInformation.salesPrice.length > 1) {\n priceInformationSummary.regularPrice = salesPrice;\n }\n else {\n priceInformationSummary.price = salesPrice;\n }\n }\n if (!priceInformationSummary.price && priceInformationSummary.regularPrice) {\n priceInformationSummary.price = priceInformationSummary.regularPrice;\n }\n return priceInformationSummary;\n }\n}\nexports.default = ProductPriceInformationSummaryTransformer;\n//# sourceMappingURL=ProductPriceInformationSummaryTransformer.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst ProductPriceInformationSummaryTransformer_1 = __importDefault(require(\"./ProductPriceInformationSummaryTransformer\"));\n/**\n * Price utilities.\n */\nclass PriceUtility {\n /**\n * Check if shoppingProducts has a family price.\n *\n * @param shoppingProducts Shopping products.\n * @returns If it is family price.\n */\n static isFamilyPrice(shoppingProducts) {\n return shoppingProducts.some((shoppingProduct) => {\n var _a, _b;\n const priceInformation = (_b = (_a = shoppingProduct === null || shoppingProduct === void 0 ? void 0 : shoppingProduct.product) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.priceInformation;\n return priceInformation\n ? ProductPriceInformationSummaryTransformer_1.default.transform(priceInformation).familyPrice\n : false;\n });\n }\n /**\n * Returns true if it is just one product.\n *\n * @param shoppingProducts Shopping products.\n * @returns True if just one product.\n */\n static isIndividualProduct(shoppingProducts) {\n return shoppingProducts.length === 1 && shoppingProducts[0].quantity === 1;\n }\n /**\n * Returns \"true\" if TRO (Time Restricted Offer) or family.\n *\n * @param totalPrice Price model.\n * @returns \"true\" if TRO or family.\n */\n static isTroOrFamily(totalPrice) {\n return totalPrice.family || Boolean(totalPrice.temporary && totalPrice.validDateInterval);\n }\n /**\n * Returns \"true\" if TRO (Time Restricted Offer).\n *\n * @param totalPrice Price model.\n * @returns \"true\" if TRO.\n */\n static isTro(totalPrice) {\n return !totalPrice.family && Boolean(totalPrice.temporary && totalPrice.validDateInterval);\n }\n /**\n * Returns \"true\" if family.\n *\n * @param totalPrice Price model.\n * @returns \"true\" if family.\n */\n static isFamily(totalPrice) {\n return totalPrice.family;\n }\n /**\n * Returns \"true\" if new lower price.\n *\n * @param totalPrice Price model.\n * @returns \"true\" if new lower price.\n */\n static isNewLowerPrice(totalPrice) {\n return totalPrice.newLowerPrice;\n }\n /**\n * Returns \"true\" if an breath taking item.\n *\n * @param totalPrice Price model.\n * @returns \"true\" if breath taking item.\n */\n static isBreathTakingItem(totalPrice) {\n return totalPrice.breathTakingItem;\n }\n /**\n * The price unit.\n *\n * @param shoppingProducts Shopping products.\n * @param useMetricMeasures Metric or imperial values.\n * @returns The price unit.\n */\n static getPriceUnit(shoppingProducts, useMetricMeasures) {\n const product = shoppingProducts[0].product;\n if (!product.content || !product.content.priceUnit || !product.content.priceUnit[0]) {\n return null;\n }\n const priceUnit = product.content.priceUnit[0];\n if (useMetricMeasures) {\n const { factorMetric, textMetric } = priceUnit;\n return this.formatPriceUnit({ factor: factorMetric, text: textMetric });\n }\n else {\n const { factorImperial, textImperial } = priceUnit;\n return this.formatPriceUnit({ factor: factorImperial, text: textImperial });\n }\n }\n /**\n * Returns valid interval.\n *\n * @param totalPrice Price model.\n * @param localizedInformation Deprecated - Use translations and settings instead.\n * @param localizedInformation.translations\n * @param localizedInformation.priceSettings\n * @param localizedInformation.priceSettings.temporaryPricePeriod\n * @param translations The translations retrieved from translations service.\n * @param settings The settings retrieved from settings service.\n * @param settings.kompis\n * @param settings.kompis.priceSettings\n * @returns Interval.\n */\n static getValidInterval(totalPrice, \n /** @deprecated Use translations and settings instead. */\n localizedInformation, translations, settings) {\n var _a;\n const priceSettings = (_a = settings === null || settings === void 0 ? void 0 : settings.kompis.priceSettings) !== null && _a !== void 0 ? _a : localizedInformation === null || localizedInformation === void 0 ? void 0 : localizedInformation.priceSettings;\n const actualTranslations = translations !== null && translations !== void 0 ? translations : localizedInformation === null || localizedInformation === void 0 ? void 0 : localizedInformation.translations;\n if (!priceSettings || !actualTranslations) {\n throw Error('Either translations and settings parameters or localizedInformation parameter must be set.');\n }\n if (!this.isValidInterval(priceSettings, totalPrice.validDateInterval)) {\n return null;\n }\n const validFrom = totalPrice.validDateInterval.validFrom;\n const validTo = totalPrice.validDateInterval.validTo;\n const { priceInfoTemporaryPricePeriodEnd, priceInfoTemporaryPriceDisclaimer, priceInfoTemporaryPriceFullDateRange } = actualTranslations;\n if (enums_1.TemporaryPricePeriodEnum.periodEnd === priceSettings.temporaryPricePeriod) {\n return [priceInfoTemporaryPricePeriodEnd, validTo, priceInfoTemporaryPriceDisclaimer].join(' ');\n }\n const replacedDateRange = priceInfoTemporaryPriceFullDateRange\n .replace('[[dateFrom]]', validFrom)\n .replace('{{dateFrom}}', validFrom)\n .replace('[[dateTo]]', validTo)\n .replace('{{dateTo}}', validTo);\n return [replacedDateRange, priceInfoTemporaryPriceDisclaimer].join(' ');\n }\n /**\n * Returns price excl tax.\n *\n * @param totalPrice Price model.\n * @returns Price excl tax.\n */\n static getPriceExclTax(totalPrice) {\n return totalPrice.familyExclTax || totalPrice.exclTax;\n }\n /**\n * Returns the product that has the lowest regular price.\n *\n * @param products The products.\n * @returns The product with the lowest price.\n */\n static getLowestRegularPrice(products) {\n const productsOrderedByPrice = products\n .map((product) => ({\n product,\n price: this.getRegularPrice(product)\n }))\n .filter(({ price }) => price !== null)\n .sort((a, b) => { var _a, _b; return ((_a = a.price) !== null && _a !== void 0 ? _a : 0) - ((_b = b.price) !== null && _b !== void 0 ? _b : 0); })\n .map(({ product }) => product);\n return productsOrderedByPrice[0];\n }\n /**\n * Returns the array of shopping products that has the lowest total regular price.\n *\n * @param shoppingProductGroups Array of arrays of shopping products.\n * @returns The array of shopping products with the lowest total regular price.\n */\n static getShoppingProductsWithLowestTotalRegularPrice(shoppingProductGroups) {\n const getTotalPrice = (shoppingProducts) => {\n if (shoppingProducts.some((shoppingProduct) => !shoppingProduct.product.valid || this.getRegularPrice(shoppingProduct.product) === null)) {\n return null;\n }\n return shoppingProducts.reduce((sum, shoppingProduct) => { var _a; return sum + ((_a = this.getRegularPrice(shoppingProduct.product)) !== null && _a !== void 0 ? _a : 0) * shoppingProduct.quantity; }, 0);\n };\n const shoppingProductGroupsOrderedByTotalPrice = shoppingProductGroups\n .map((shoppingProducts) => ({\n shoppingProducts,\n totalPrice: getTotalPrice(shoppingProducts)\n }))\n .filter(({ totalPrice }) => totalPrice !== null)\n .sort((a, b) => {\n var _a, _b;\n return ((_a = a.totalPrice) !== null && _a !== void 0 ? _a : 0) - ((_b = b.totalPrice) !== null && _b !== void 0 ? _b : 0);\n })\n .map(({ shoppingProducts }) => shoppingProducts);\n if (shoppingProductGroupsOrderedByTotalPrice.length === 0) {\n return null;\n }\n return shoppingProductGroupsOrderedByTotalPrice[0];\n }\n /**\n * Returns price.\n *\n * @param totalPrice Price model.\n * @returns Price.\n */\n static getPrice(totalPrice) {\n return totalPrice.familyInclTax || totalPrice.inclTax;\n }\n /**\n * Returns price.\n *\n * @param totalPrice Price model.\n * @returns Price.\n */\n static getFromPrice(totalPrice) {\n if (this.isNewLowerPrice(totalPrice)) {\n return totalPrice.inclTax;\n }\n return totalPrice.regularInclTax || totalPrice.inclTax;\n }\n /**\n * Returns currency symbol.\n *\n * @param totalPrice Price model.\n * @param localizedInformationOrSettings Either settings retrieved from settings service or localized information fetched from localization service.\n * @returns Currency symbol.\n */\n static getCurrencySymbol(totalPrice, localizedInformationOrSettings) {\n const priceSettings = 'kompis' in localizedInformationOrSettings\n ? {\n currencyCode: localizedInformationOrSettings.localisation.currencyCode,\n currencySymbol: localizedInformationOrSettings.localisation.currencySymbol,\n currencyCodeAlt: localizedInformationOrSettings.kompis.priceSettings.currencyCodeAlt,\n currencySymbolAlt: localizedInformationOrSettings.kompis.priceSettings.currencySymbolAlt\n }\n : localizedInformationOrSettings.priceSettings;\n if (totalPrice.currencyCode === priceSettings.currencyCode) {\n return priceSettings.currencySymbol;\n }\n else if (totalPrice.currencyCode === priceSettings.currencyCodeAlt &&\n priceSettings.currencySymbolAlt) {\n return priceSettings.currencySymbolAlt;\n }\n return null;\n }\n /**\n * If there is a valid interval to show.\n *\n * @param priceSettings\n * @param priceSettings.temporaryPricePeriod\n * @param totalPriceDateInterval Price date interval.\n * @returns If it is valid interval.\n */\n static isValidInterval(priceSettings, totalPriceDateInterval) {\n return (!!totalPriceDateInterval &&\n priceSettings.temporaryPricePeriod !== enums_1.TemporaryPricePeriodEnum.periodNone);\n }\n /**\n * @param options Options.\n * @param options.factor Either Metric or imperial.\n * @param options.text Either Metric or imperial.\n */\n static formatPriceUnit(options) {\n const { factor, text } = options;\n if (!factor || !text) {\n return null;\n }\n const formattedFactor = factor === 1.0 ? '' : factor;\n return `${formattedFactor} ${text}`;\n }\n /**\n * @param product The product.\n */\n static getRegularPrice(product) {\n var _a, _b;\n if (!product.content || !product.content.priceInformation) {\n return null;\n }\n return ((_b = (_a = product.content.priceInformation.salesPrice.find((p) => p.typeCode == 'RegularSalesUnitPrice')) === null || _a === void 0 ? void 0 : _a.priceInclTax) !== null && _b !== void 0 ? _b : null // The salesPrice array always contains a RegularSalesUnitPrice so null should never be returned here\n );\n }\n}\nexports.default = PriceUtility;\n//# sourceMappingURL=PriceUtility.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst DateFormatter_1 = __importDefault(require(\"../date/DateFormatter\"));\nconst ProductPriceInformationSummaryTransformer_1 = __importDefault(require(\"./ProductPriceInformationSummaryTransformer\"));\n/**\n * Handles calculcation of total price for a list of products.\n */\nclass TotalPriceCalculator {\n /**\n * Calculates total price.\n *\n * @param shoppingProducts Shopping products.\n * @param dateFormat Date format. Example: YYYY-MM-DD.\n * @param currencyCode Currency code to match with.\n * @param isCombinedProduct True if the products should be treated as one.\n * @returns Instance of TotalPriceSummary.\n */\n static calculate(shoppingProducts, dateFormat, currencyCode, isCombinedProduct) {\n var _a, _b, _c, _d, _e, _f;\n if (!dateFormat) {\n throw new exceptions_1.Exception('Second parameter \"dateFormat\" was not given.');\n }\n const totalPrice = {\n inclTax: 0,\n exclTax: 0,\n familyInclTax: 0,\n familyExclTax: 0,\n regularInclTax: 0,\n regularExclTax: 0,\n onlineSaleable: false,\n newLowerPrice: false,\n breathTakingItem: false,\n family: false,\n temporary: false,\n validDateInterval: null,\n ecoPrice: 0,\n weeePrice: 0,\n currencyCode: null\n };\n const validDates = [];\n if (shoppingProducts.length > 0) {\n totalPrice.newLowerPrice = isCombinedProduct ? false : true;\n totalPrice.breathTakingItem = true;\n totalPrice.onlineSaleable = true;\n }\n for (let i = 0, max = shoppingProducts.length; i < max; i++) {\n const shoppingProduct = shoppingProducts[i];\n if (!shoppingProduct.product.valid) {\n throw new Error('Failed to calculate total price. One of the products is not valid.');\n }\n if (shoppingProduct.product.content) {\n const product = shoppingProduct.product.content;\n if (!product.priceInformation) {\n throw new exceptions_1.Exception('Failed to calulate total price, priceInformation was not present in the content object.');\n }\n // Uses the currency provided or only the first currency in the list, if two currencies are present.\n const forcedCurrency = currencyCode\n ? currencyCode\n : product.priceInformation.salesPrice[0].currencyCode;\n const productPriceInformationSummary = ProductPriceInformationSummaryTransformer_1.default.transform(product.priceInformation, forcedCurrency);\n const familyValidDate = this.calculateFamilyPrice(shoppingProduct, productPriceInformationSummary, totalPrice);\n const troValidDate = this.calculateTroPrice(productPriceInformationSummary, totalPrice);\n this.calculateNormalPrice(shoppingProduct, productPriceInformationSummary, totalPrice);\n this.calculateRegularPrice(shoppingProduct, productPriceInformationSummary, totalPrice);\n this.calculateFeePrices(shoppingProduct, totalPrice, forcedCurrency);\n totalPrice.onlineSaleable =\n product.priceInformation.onlineSaleable === false ? false : totalPrice.onlineSaleable;\n // If the products are considered a \"combined\" product it is enough that one of the products have NLP to produce a NPL price.\n // Otherwise all products need to have NLP to produce a total NLP price.\n if (isCombinedProduct) {\n totalPrice.newLowerPrice =\n productPriceInformationSummary.newLowerPrice === true ? true : totalPrice.newLowerPrice;\n }\n else {\n totalPrice.newLowerPrice =\n productPriceInformationSummary.newLowerPrice === false\n ? false\n : totalPrice.newLowerPrice;\n }\n totalPrice.breathTakingItem =\n product.breathTakingItem === false ? false : totalPrice.breathTakingItem;\n if (familyValidDate) {\n validDates.push(familyValidDate);\n }\n if (troValidDate) {\n validDates.push(troValidDate);\n }\n }\n }\n totalPrice.currencyCode = currencyCode\n ? currencyCode\n : (_f = (_e = (_d = (_c = (_b = (_a = shoppingProducts[0]) === null || _a === void 0 ? void 0 : _a.product) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.priceInformation) === null || _d === void 0 ? void 0 : _d.salesPrice[0]) === null || _e === void 0 ? void 0 : _e.currencyCode) !== null && _f !== void 0 ? _f : null;\n totalPrice.validDateInterval = this.getValidDateInterval(validDates, dateFormat);\n return totalPrice;\n }\n /**\n * Calculates total prices for more than one currency. Used for dual currencies.\n *\n * @param shoppingProducts Shopping products.\n * @param dateFormat Date format. Example: YYYY-MM-DD.\n * @param isCombinedProduct True if the products should be treated as one.\n * @returns Instance of TotalPriceSummary.\n */\n static calculateMultiple(shoppingProducts, dateFormat, isCombinedProduct) {\n var _a, _b, _c, _d, _e;\n if (!dateFormat) {\n throw new exceptions_1.Exception('Second parameter \"dateFormat\" was not given.');\n }\n if (shoppingProducts.some((product) => { var _a; return !((_a = product.product.content) === null || _a === void 0 ? void 0 : _a.priceInformation); })) {\n return [];\n }\n const totalPrices = [];\n if (!shoppingProducts.length) {\n totalPrices.push(this.calculate(shoppingProducts, dateFormat, undefined, isCombinedProduct));\n return totalPrices;\n }\n const providedCurrencies = [\n ...new Set((_e = (_d = (_c = (_b = (_a = shoppingProducts[0]) === null || _a === void 0 ? void 0 : _a.product) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.priceInformation) === null || _d === void 0 ? void 0 : _d.salesPrice) === null || _e === void 0 ? void 0 : _e.map((price) => price.currencyCode))\n ];\n for (const currency in providedCurrencies) {\n totalPrices.push(this.calculate(shoppingProducts, dateFormat, providedCurrencies[currency], isCombinedProduct));\n }\n return totalPrices;\n }\n /**\n * Handles normal price.\n *\n * @param shoppingProduct Shopping product.\n * @param productPriceInformationSummary Sales price information.\n * @param totalPrice Total price model.\n */\n static calculateNormalPrice(shoppingProduct, productPriceInformationSummary, totalPrice) {\n // We should always have a normal price\n if (productPriceInformationSummary.price) {\n totalPrice.inclTax +=\n productPriceInformationSummary.price.priceInclTax * shoppingProduct.quantity;\n totalPrice.exclTax +=\n productPriceInformationSummary.price.priceExclTax * shoppingProduct.quantity;\n }\n else if (productPriceInformationSummary.regularPrice) {\n totalPrice.inclTax +=\n productPriceInformationSummary.regularPrice.priceInclTax * shoppingProduct.quantity;\n totalPrice.exclTax +=\n productPriceInformationSummary.regularPrice.priceExclTax * shoppingProduct.quantity;\n }\n else {\n throw new exceptions_1.Exception('Failed to calculate total price. Missing valid normal price in item: ' +\n Array.from(shoppingProduct.product.itemId).join(', ') +\n '.');\n }\n }\n /**\n * Handles family price.\n *\n * @param shoppingProduct Shopping product.\n * @param productPriceInformationSummary Sales price information.\n * @param totalPrice Total price model.\n * @returns Valid date.\n */\n static calculateFamilyPrice(shoppingProduct, productPriceInformationSummary, totalPrice) {\n var _a, _b, _c, _d;\n if (productPriceInformationSummary.familyPrice) {\n totalPrice.family = true;\n totalPrice.familyInclTax +=\n productPriceInformationSummary.familyPrice.priceInclTax * shoppingProduct.quantity;\n totalPrice.familyExclTax +=\n productPriceInformationSummary.familyPrice.priceExclTax * shoppingProduct.quantity;\n }\n else {\n // If this was not a family product, family price increases with normal price\n totalPrice.familyInclTax +=\n ((_a = productPriceInformationSummary.price) === null || _a === void 0 ? void 0 : _a.priceInclTax) * shoppingProduct.quantity;\n totalPrice.familyExclTax +=\n ((_b = productPriceInformationSummary.price) === null || _b === void 0 ? void 0 : _b.priceExclTax) * shoppingProduct.quantity;\n }\n if (productPriceInformationSummary.temporaryFamilyPrice) {\n totalPrice.temporary = true;\n return {\n validFrom: DateFormatter_1.default.isoStringToDate((_c = productPriceInformationSummary.familyPrice) === null || _c === void 0 ? void 0 : _c.validFromText),\n validTo: DateFormatter_1.default.isoStringToDate((_d = productPriceInformationSummary.familyPrice) === null || _d === void 0 ? void 0 : _d.validToText)\n };\n }\n return null;\n }\n /**\n * Handles TRO (Time Restricted Offer) price.\n *\n * @param productPriceInformationSummary Sales price information.\n * @param totalPrice Total price model.\n * @returns Valid date.\n */\n static calculateTroPrice(productPriceInformationSummary, totalPrice) {\n var _a, _b;\n if (productPriceInformationSummary.timeRestrictedOffer) {\n totalPrice.temporary = true;\n return {\n validFrom: DateFormatter_1.default.isoStringToDate((_a = productPriceInformationSummary.price) === null || _a === void 0 ? void 0 : _a.validFromText),\n validTo: DateFormatter_1.default.isoStringToDate((_b = productPriceInformationSummary.price) === null || _b === void 0 ? void 0 : _b.validToText)\n };\n }\n return null;\n }\n /**\n * Handles Regular price.\n *\n * @param shoppingProduct Shopping product.\n * @param productPriceInformationSummary Sales price information.\n * @param totalPrice Total price model.\n */\n static calculateRegularPrice(shoppingProduct, productPriceInformationSummary, totalPrice) {\n var _a, _b;\n // There was a check here before: if (priceInformation.regularPrice && !priceInformation.newLowerPrice)\n // The check does not make sense, so it has been removed\n if (productPriceInformationSummary.regularPrice) {\n totalPrice.regularInclTax +=\n productPriceInformationSummary.regularPrice.priceInclTax * shoppingProduct.quantity;\n totalPrice.regularExclTax +=\n productPriceInformationSummary.regularPrice.priceExclTax * shoppingProduct.quantity;\n }\n else {\n // If we don't have a special regular price, then the normal is regular\n totalPrice.regularInclTax +=\n ((_a = productPriceInformationSummary.price) === null || _a === void 0 ? void 0 : _a.priceInclTax) * shoppingProduct.quantity;\n totalPrice.regularExclTax +=\n ((_b = productPriceInformationSummary.price) === null || _b === void 0 ? void 0 : _b.priceExclTax) * shoppingProduct.quantity;\n }\n }\n /**\n * Handles fee price.\n *\n * @param shoppingProduct Shopping product.\n * @param totalPrice Total price model.\n * @param currencyCode To match if there are multiple (dual) currencies in the prices.\n */\n static calculateFeePrices(shoppingProduct, totalPrice, currencyCode) {\n var _a, _b;\n const productFees = (_b = (_a = shoppingProduct.product.content) === null || _a === void 0 ? void 0 : _a.priceInformation) === null || _b === void 0 ? void 0 : _b.fees;\n if (productFees) {\n for (const fee of productFees.filter((fee) => fee.currencyCode === currencyCode)) {\n if (fee.typeCode === 'ECO') {\n totalPrice.ecoPrice += fee.amount * shoppingProduct.quantity;\n }\n else if (fee.typeCode === 'WEEE') {\n totalPrice.weeePrice += fee.amount * shoppingProduct.quantity;\n }\n }\n }\n }\n /**\n * Returns the shortest date span of multiple dates.\n *\n * @param validDates Valid dates.\n * @param dateFormat Pattern to use.\n * @returns Date interval.\n */\n static getValidDateInterval(validDates, dateFormat) {\n if (validDates.length > 0) {\n const date = {\n validFrom: validDates[0].validFrom,\n validTo: validDates[0].validTo\n };\n for (const validDate of validDates) {\n if (validDate.validFrom > date.validFrom) {\n date.validFrom = validDate.validFrom;\n }\n if (validDate.validTo < date.validTo) {\n date.validTo = validDate.validTo;\n }\n }\n return {\n validFrom: DateFormatter_1.default.dateToString(date.validFrom, dateFormat),\n validTo: DateFormatter_1.default.dateToString(date.validTo, dateFormat)\n };\n }\n return null;\n }\n}\nexports.default = TotalPriceCalculator;\n//# sourceMappingURL=TotalPriceCalculator.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * This allows you to control how descriptive the measurement will be.\n *\n * The total amount of measurements will differ depending on what type of product it is displayed.\n */\nvar ProductDescriptionProductMeasureEnum;\n(function (ProductDescriptionProductMeasureEnum) {\n /**\n * Don't display any measurements for the product.\n */\n ProductDescriptionProductMeasureEnum[\"none\"] = \"none\";\n /**\n * Displays a minimal text describing the measurment for the product.\n *\n * The text comes from the \"measureReference\" available in the products content.\n */\n ProductDescriptionProductMeasureEnum[\"short\"] = \"short\";\n /**\n * Displays a descriptive comma separated text for the product.\n *\n * Measurements for the product comes from the \"measure\" array available in the products content.\n */\n ProductDescriptionProductMeasureEnum[\"long\"] = \"long\";\n /**\n * An array of objects containg the measurement and measurement type.\n *\n * Measurements for the product comes from the \"measure\" array on the displayed product.\n *\n * Should only be used if the intention is to control how the data will be displayed.\n */\n ProductDescriptionProductMeasureEnum[\"array\"] = \"array\";\n})(ProductDescriptionProductMeasureEnum || (ProductDescriptionProductMeasureEnum = {}));\nexports.default = ProductDescriptionProductMeasureEnum;\n//# sourceMappingURL=ProductDescriptionProductMeasureEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Handles string utilities.\n */\nclass StringUtility {\n /**\n * Capitalizes first letter.\n *\n * @param text Text to use.\n * @returns String with first letter capitalized.\n */\n static capitalizeFirstLetter(text) {\n return text.charAt(0).toUpperCase() + text.slice(1);\n }\n /**\n * Kebab case to words.\n *\n * @param string String to convert.\n * @returns Text as kebab case.\n */\n static kebabToCamelCase(string) {\n string = string.split('-');\n for (let i = 0, max = string.length; i < max; i++) {\n string[i] = this.capitalizeFirstLetter(string[i]);\n }\n return string.join('');\n }\n /**\n * Function to change camel case to snake case.\n *\n * @param string\n */\n static camelToSnake(string) {\n let result = '';\n // Loop through string.\n for (let i = 0; i < string.length; i++) {\n const ch = string.charAt(i);\n // Check if character is upper case and is not the first in index.\n // Append '_' and change character to lower case.\n if (ch === ch.toUpperCase()) {\n if (i > 0) {\n result = result + '_';\n }\n result = result + ch.toLowerCase();\n }\n // If the character is lower case then append to result string.\n else {\n result = result + ch;\n }\n }\n // Return the result\n return result;\n }\n /**\n * Should remove spaces from both sides of string.\n *\n * @param text Text to use.\n * @param [trim= ] Character to trim. Defaults to \" \".\n * @returns Converted string.\n */\n static trim(text, trim = ' ') {\n while (text.length > 0 && text.charAt(0) === trim) {\n text = text.substring(1);\n }\n while (text.length > 0 && text.charAt(text.length - 1) === trim) {\n text = text.slice(0, -1);\n }\n return text;\n }\n}\nexports.default = StringUtility;\n//# sourceMappingURL=StringUtility.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst StringUtility_1 = __importDefault(require(\"../string/StringUtility\"));\nconst ProductDescriptionProductMeasureEnum_1 = __importDefault(require(\"./ProductDescriptionProductMeasureEnum\"));\n/**\n * Product description utility.\n */\nclass ProductDescriptionUtility {\n /**\n * Returns product description.\n *\n * @param options Options.\n * @param options.product Product.\n * @param options.localizedInformation Deprecated - Use translations and settings instead.\n * @param options.include Include in description.\n * @param options.include.designText Design text.\n * @param options.include.packageMeasures Package measures.\n * @param options.include.productMeasures Product measures.\n * @param options.include.weight Weight.\n * @param options.settings Settings from DEXF.\n * @param options.translations Translations.\n * @returns Product description.\n */\n static getDescription(options) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\n const actualTranslations = (_a = options.translations) !== null && _a !== void 0 ? _a : (_b = options.localizedInformation) === null || _b === void 0 ? void 0 : _b.translations;\n const actualSettings = (_c = options.settings) !== null && _c !== void 0 ? _c : (options.localizedInformation\n ? {\n localisation: {\n useMetricMeasures: options.localizedInformation.localization.useMetricMeasures\n }\n }\n : null);\n if (!actualSettings || !actualTranslations) {\n throw Error('Either translations and settings parameters or localizedInformation parameter must be set.');\n }\n const description = [];\n if ((_d = options.product.content) === null || _d === void 0 ? void 0 : _d.typeName) {\n description.push(StringUtility_1.default.capitalizeFirstLetter((_e = options.product.content) === null || _e === void 0 ? void 0 : _e.typeName));\n }\n // Design text\n if ((_f = options.include) === null || _f === void 0 ? void 0 : _f.designText) {\n const designText = this.getProductDesignText(options.product);\n if (designText) {\n description.push(designText);\n }\n }\n // Product measures\n if ((_g = options.include) === null || _g === void 0 ? void 0 : _g.productMeasures) {\n const productMeasures = this.getProductMeasures({\n settings: actualSettings,\n productMeasures: options.include.productMeasures,\n product: options.product\n });\n if (productMeasures && typeof productMeasures === 'string') {\n description.push(productMeasures);\n }\n }\n // Package measures\n if ((_h = options.include) === null || _h === void 0 ? void 0 : _h.packageMeasures) {\n const packageMeasures = this.getPackageMeasures({\n settings: actualSettings,\n product: options.product,\n translations: actualTranslations\n });\n if (packageMeasures) {\n description.push(packageMeasures);\n }\n }\n // Weight\n if ((_j = options.include) === null || _j === void 0 ? void 0 : _j.weight) {\n const weight = this.getProductWeight({\n settings: actualSettings,\n product: options.product,\n translations: actualTranslations,\n include: {\n label: true\n }\n });\n if (weight) {\n description.push(weight);\n }\n }\n return description.filter((part) => part != '').join(', ');\n }\n /**\n * Returns product measures.\n *\n * @param options Options.\n * @param options.localizedInformation Deprecated - Use settings instead.\n * @param options.productMeasures Product measure.\n * @param options.product Product.\n * @param options.settings Settings from DEXF.\n * @returns Returns a text with all product measurements.\n */\n static getProductMeasures(options) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n const useMetricMeasures = (_b = (_a = options.settings) === null || _a === void 0 ? void 0 : _a.localisation.useMetricMeasures) !== null && _b !== void 0 ? _b : (_c = options.localizedInformation) === null || _c === void 0 ? void 0 : _c.localization.useMetricMeasures;\n if (useMetricMeasures === undefined) {\n throw Error('Either options.settings or options.localizedInformation must be set.');\n }\n switch (options.productMeasures) {\n case ProductDescriptionProductMeasureEnum_1.default.short: {\n if (!((_d = options.product.content) === null || _d === void 0 ? void 0 : _d.measureReference)) {\n return null;\n }\n return useMetricMeasures\n ? options.product.content.measureReference.textMetric\n : options.product.content.measureReference.textImperial;\n }\n case ProductDescriptionProductMeasureEnum_1.default.long: {\n if (!((_e = options.product.content) === null || _e === void 0 ? void 0 : _e.measure)) {\n return null;\n }\n return (_f = options.product.content) === null || _f === void 0 ? void 0 : _f.measure.map((measure) => `${measure.typeName}: ${useMetricMeasures ? measure.textMetric : measure.textImperial}`).join(', ');\n }\n case ProductDescriptionProductMeasureEnum_1.default.array: {\n if (!((_g = options.product.content) === null || _g === void 0 ? void 0 : _g.measure)) {\n return null;\n }\n return (_h = options.product.content) === null || _h === void 0 ? void 0 : _h.measure.map((measure) => {\n return {\n typeName: measure.typeName,\n measure: useMetricMeasures ? measure.textMetric : measure.textImperial\n };\n });\n }\n }\n return null;\n }\n /**\n * Returns weight.\n *\n * @param options Options.\n * @param options.product Product.\n * @param options.settings Settings from DEXF.\n * @param options.translations Translations.\n * @param options.include Extra parameters to include values.\n * @param options.include.label Include label.\n * @returns Template.\n */\n static getProductWeight(options) {\n var _a, _b;\n const packageMeasure = (_a = options.product.content) === null || _a === void 0 ? void 0 : _a.packageMeasure;\n if (!packageMeasure) {\n return null;\n }\n const useMetricMeasures = options.settings.localisation.useMetricMeasures;\n const packageWeights = packageMeasure.package\n .map((p) => (useMetricMeasures ? p.weightGrossMetric : p.weightGrossImperial))\n .join(', ');\n if ((_b = options.include) === null || _b === void 0 ? void 0 : _b.label) {\n return `${options.translations.pickingListSortPackageWeight}: ${packageWeights}`;\n }\n return `${packageWeights}`;\n }\n /**\n * Returns package measures.\n *\n * @param options Options.\n * @param options.product Product.\n * @param options.settings Settings from DEXF.\n * @param options.translations Translations.\n * @returns Returns a text with all package measurements.\n */\n static getPackageMeasures(options) {\n var _a;\n if (!((_a = options.product.content) === null || _a === void 0 ? void 0 : _a.packageMeasure)) {\n return null;\n }\n const packages = options.product.content.packageMeasure.package;\n const useMetricMeasures = options.settings.localisation.useMetricMeasures;\n return `${options.translations.pickingListSortPackageSize}: ${packages\n .map((p) => {\n if (!useMetricMeasures) {\n return `${p.lengthImperial} x ${p.widthImperial} x ${p.heightImperial}`;\n }\n return `${p.lengthMetric} x ${p.widthMetric} x ${p.heightMetric}`;\n })\n .join(', ')}`;\n }\n /**\n * Returns design text.\n *\n * @param product Product.\n * @returns Design text.\n */\n static getProductDesignText(product) {\n var _a;\n if (!((_a = product.content) === null || _a === void 0 ? void 0 : _a.validDesignText)) {\n return '';\n }\n return product.content.validDesignText;\n }\n}\nexports.default = ProductDescriptionUtility;\n//# sourceMappingURL=ProductDescriptionUtility.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst ITEM_NO_NUMBER_OF_CHARACTERS = 3;\nconst ENERGY_CLASS_REGEXP = /^(A\\+{0,3}|B|C|D|E)/;\n/**\n * A product utility that can be used for formatting article numbers.\n */\nclass ProductUtility {\n /**\n * Formats a product article number to be more readable for the end user. The string \"12535352\" will for example be formatted to \"125.353.52\".\n *\n * @param itemNo Product item number.\n * @returns An item number including dots.\n */\n static formatItemNo(itemNo) {\n const numberOfDots = Math.ceil(itemNo.length / ITEM_NO_NUMBER_OF_CHARACTERS);\n const parts = Array(numberOfDots)\n .fill(null)\n .map((_, index) => itemNo.slice(index * ITEM_NO_NUMBER_OF_CHARACTERS, index * ITEM_NO_NUMBER_OF_CHARACTERS + ITEM_NO_NUMBER_OF_CHARACTERS));\n return parts.join('.');\n }\n /**\n * Returns product information page link.\n *\n * @param product Product.\n * @param localizedInformationOrSettings Either settings retrieved from settings service or localized information fetched from localization service.\n * @returns Product information page link.\n */\n static getProductInformationPageLink(product, localizedInformationOrSettings) {\n const productInformationPageLinkV2 = 'kompis' in localizedInformationOrSettings\n ? localizedInformationOrSettings.kompis.urls.productInformationPageLinkV2\n : localizedInformationOrSettings.urls.productInformationPageLinkV2;\n if (!product.content || !productInformationPageLinkV2) {\n return null;\n }\n const itemNo = product.content.itemNoLocal || product.content.itemNoGlobal;\n if (!itemNo) {\n return null;\n }\n if (this.isProductSPR(product)) {\n return productInformationPageLinkV2\n .replace('{productItemNo}', itemNo)\n .replace('{lowerCaseSprPrefix}', 's')\n .replace('{upperCaseSprPrefix}', 'S');\n }\n return productInformationPageLinkV2\n .replace('{productItemNo}', itemNo)\n .replace('{lowerCaseSprPrefix}', '')\n .replace('{lowerCaseSprPrefix}', '');\n }\n /**\n * Returns main image.\n *\n * @param product Product.\n * @returns Product images.\n */\n static getMainImages(product) {\n return product.content && product.content.image\n ? product.content.image.filter((image) => image.typeName === enums_1.ImageTypeNameEnum.mainProductPicture)\n : [];\n }\n /**\n * Checks whether itemType is of type SPR or not.\n *\n * @param product IProduct.\n * @returns Boolean.\n */\n static isProductSPR(product) {\n var _a;\n return ((_a = product.content) === null || _a === void 0 ? void 0 : _a.itemType) === enums_1.ItemTypeEnum.spr;\n }\n /**\n * Returns images based on what enum is passed.\n *\n * @param product Product - the product to fetch the image from..\n * @param imageType ImageTypeNameEnum - what type of image to fetch.\n * @returns Product images.\n */\n static getProductImages(product, imageType) {\n const images = product.content && product.content.image\n ? product.content.image.filter((image) => image.typeName === imageType)\n : [];\n return images;\n }\n /**\n * Returns energy class.\n *\n * @param product Product.\n * @returns Energy class.\n */\n static getEnergyClass(product) {\n var _a, _b;\n if (!((_b = (_a = product.content) === null || _a === void 0 ? void 0 : _a.technicalInformation) === null || _b === void 0 ? void 0 : _b.length)) {\n return null;\n }\n for (const item of product.content.technicalInformation) {\n if (typeof item.valueMetric === 'string') {\n const match = item.valueMetric.match(ENERGY_CLASS_REGEXP);\n if (match) {\n return match[1];\n }\n }\n }\n return null;\n }\n /**\n * Returns the link to EPREL for the product. EPREL stands for \"European Product Registry for Energy Labelling\".\n *\n * @param product\n */\n static getProductInformationSheetLink(product) {\n var _a, _b;\n if ((_b = (_a = product === null || product === void 0 ? void 0 : product.content) === null || _a === void 0 ? void 0 : _a.complianceTechnical) === null || _b === void 0 ? void 0 : _b.length) {\n const productInformationSheetInformation = product.content.complianceTechnical.find((complianceTechnicalItem) => complianceTechnicalItem.headingType === enums_1.ProductComplianceTechnicalHeadingTypeEnum.rescaled);\n if (productInformationSheetInformation) {\n return {\n text: productInformationSheetInformation.headingText,\n href: productInformationSheetInformation.text\n };\n }\n }\n return null;\n }\n /**\n * Returns energy compliance type (EU/US).\n *\n * @param product\n */\n static getProductComplianceType(product) {\n var _a, _b;\n if ((_b = (_a = product === null || product === void 0 ? void 0 : product.content) === null || _a === void 0 ? void 0 : _a.complianceTechnical) === null || _b === void 0 ? void 0 : _b.length) {\n const complianceType = product.content.complianceTechnical.find((complianceTechnicalItem) => complianceTechnicalItem.headingType ===\n enums_1.ProductComplianceTechnicalHeadingTypeEnum.energyEfficiencyClass ||\n complianceTechnicalItem.headingType ===\n enums_1.ProductComplianceTechnicalHeadingTypeEnum.hyperlink ||\n complianceTechnicalItem.headingType ===\n enums_1.ProductComplianceTechnicalHeadingTypeEnum.unifiedWaterLabel);\n if (complianceType) {\n return complianceType.headingType;\n }\n }\n return null;\n }\n /**\n * Returns IShoppingItem[] from a IShoppingProduct[].\n *\n * @param shoppingProducts\n */\n static getShoppingItems(shoppingProducts) {\n var _a, _b;\n const shoppingItems = [];\n for (const shoppingProduct of shoppingProducts) {\n if (((_a = shoppingProduct.product.content) === null || _a === void 0 ? void 0 : _a.ruItemNo) &&\n ((_b = shoppingProduct.product.content) === null || _b === void 0 ? void 0 : _b.ruItemType)) {\n shoppingItems.push({\n id: shoppingProduct.product.content.ruItemNo,\n type: shoppingProduct.product.content.ruItemType,\n quantity: shoppingProduct.quantity\n });\n }\n }\n return shoppingItems;\n }\n /**\n * Returns IShoppingProduct[] for child products of the main product.\n *\n * @param options\n * @param options.product The \"main\" product (with child products/items).\n * @param options.includedProducts Included products (those not being a main product child will be ignored).\n * @param options.ignoreInvalidProducts Whether or not invalid products in includedProducts should be ignored, i.e. Not be returned as shopping product (false is default).\n */\n static getIncludedShoppingProducts(options) {\n var _a, _b;\n const { product, includedProducts, ignoreInvalidProducts = false } = options;\n const shoppingProducts = [];\n for (const child of (_b = (_a = product.content) === null || _a === void 0 ? void 0 : _a.child) !== null && _b !== void 0 ? _b : []) {\n const itemNo = child.itemId.split('-').reverse()[0];\n const includedProduct = includedProducts.find((p) => { var _a, _b; return itemNo === ((_a = p.content) === null || _a === void 0 ? void 0 : _a.itemNoLocal) || itemNo === ((_b = p.content) === null || _b === void 0 ? void 0 : _b.itemNoGlobal); });\n if (includedProduct && !(ignoreInvalidProducts && !includedProduct.valid)) {\n shoppingProducts.push({\n product: includedProduct,\n quantity: child.quantity\n });\n }\n }\n return shoppingProducts;\n }\n /**\n * Returns true if product price should be calculated from the child products of the product.\n *\n * @param product The product.\n * @returns True if product have no price information and have child products, otherwise false.\n */\n static shouldCalculatePriceFromChildProducts(product) {\n var _a, _b;\n return !((_a = product.content) === null || _a === void 0 ? void 0 : _a.priceInformation) && !!((_b = product.content) === null || _b === void 0 ? void 0 : _b.child);\n }\n}\nexports.default = ProductUtility;\n//# sourceMappingURL=ProductUtility.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n *\n */\nclass DexfSettingsUtility {\n /**\n * Parses localized information object from Översätta to DEXF settings object.\n *\n * @param localizedInformation Localized information to parse.\n * @returns Parsed IDexfSettings object.\n */\n static parseLocalizedInformation(localizedInformation) {\n var _a;\n const parsedSettings = {\n kompis: {\n endpoints: localizedInformation.endpoints,\n localization: Object.assign(Object.assign({}, localizedInformation.localization), { abTest: (_a = localizedInformation.userABTest) === null || _a === void 0 ? void 0 : _a.ordnaTeam }),\n serviceSettings: localizedInformation.localization,\n urls: localizedInformation.urls,\n priceSettings: localizedInformation.priceSettings\n },\n localisation: {\n // localization\n useMetricMeasures: localizedInformation.localization.useMetricMeasures,\n usesSubDomain: localizedInformation.localization.usesSubDomain,\n dateFormat: localizedInformation.localization.dateFormat,\n alternateLanguages: localizedInformation.localization.alternateLanguages,\n writeDirection: localizedInformation.localization.writeDirection,\n // priceSettings\n decimalSeparator: localizedInformation.priceSettings.decimalSeparator,\n currencySymbol: localizedInformation.priceSettings.currencySymbol,\n noValueDecimalsString: localizedInformation.priceSettings.noValueDecimalsString,\n thousandSeparatorEnabled: localizedInformation.priceSettings.thousandSeparatorEnabled,\n currencyPosition: localizedInformation.priceSettings.currencyPosition,\n symbolSpacing: localizedInformation.priceSettings.symbolSpacing,\n thousandSeparator: localizedInformation.priceSettings.thousandSeparator,\n replaceNoValueDecimals: localizedInformation.priceSettings.replaceNoValueDecimals,\n numberOfDecimals: localizedInformation.priceSettings.numberOfDecimals,\n currencyCode: localizedInformation.priceSettings.currencyCode\n }\n };\n return parsedSettings;\n }\n}\nexports.default = DexfSettingsUtility;\n//# sourceMappingURL=DexfSettingsUtility.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\n/**\n * A utility for checking for shopping cart and list support.\n */\nclass ShoppingSupport {\n /**\n * Checks if shopping cart is supported.\n *\n * @param priceSettingsOrDexfPriceSettings\n * @returns Returns \"true\" if shopping cart is supported.\n */\n static hasCartSupport(priceSettingsOrDexfPriceSettings) {\n const localization = this.unwrapDexfSettingsObject(priceSettingsOrDexfPriceSettings);\n const eCommerceCartDataSource = localization === null || localization === void 0 ? void 0 : localization.eCommerceCartDataSource;\n const shopOnlineEnabled = localization === null || localization === void 0 ? void 0 : localization.shopOnlineEnabled;\n switch (eCommerceCartDataSource) {\n case enums_1.EcommerceCartDataSourceEnum.disabled:\n return false;\n case enums_1.EcommerceCartDataSourceEnum.default:\n return shopOnlineEnabled === true;\n }\n return true;\n }\n /**\n * Checks if shopping list is supported.\n *\n * @param priceSettingsOrDexfPriceSettings\n * @returns Returns \"true\" if shopping list is supported.\n */\n static hasListSupport(priceSettingsOrDexfPriceSettings) {\n const localization = this.unwrapDexfSettingsObject(priceSettingsOrDexfPriceSettings);\n const apiPlatform = localization === null || localization === void 0 ? void 0 : localization.apiPlatform;\n const eCommerceShoppingListDataSource = localization === null || localization === void 0 ? void 0 : localization.eCommerceShoppingListDataSource;\n const eCommerceCartDataSource = localization === null || localization === void 0 ? void 0 : localization.eCommerceCartDataSource;\n switch (eCommerceShoppingListDataSource) {\n case enums_1.EcommerceShoppingListDataSourceEnum.shoppingListApi:\n case enums_1.EcommerceShoppingListDataSourceEnum.chinaShoppingListApi:\n case enums_1.EcommerceShoppingListDataSourceEnum.iows:\n case enums_1.EcommerceShoppingListDataSourceEnum.mvecom:\n case enums_1.EcommerceShoppingListDataSourceEnum.iksa:\n return true;\n case enums_1.EcommerceShoppingListDataSourceEnum.default:\n switch (eCommerceCartDataSource) {\n case enums_1.EcommerceCartDataSourceEnum.iows:\n case enums_1.EcommerceCartDataSourceEnum.cartApi:\n return true;\n case enums_1.EcommerceCartDataSourceEnum.default:\n switch (apiPlatform) {\n case enums_1.ApiPlatformEnum.irw:\n return true;\n }\n }\n }\n return false;\n }\n /**\n * Constructs an object allowing DEXFSettings and LocalizedInformation to be passed into the function.\n *\n * @param priceSettingsOrDexfPriceSettings\n * @returns Returns the object with all properties required for ShoppingSupport.\n */\n static unwrapDexfSettingsObject(priceSettingsOrDexfPriceSettings) {\n if ('kompis' in priceSettingsOrDexfPriceSettings) {\n const { serviceSettings, localization } = priceSettingsOrDexfPriceSettings.kompis;\n return {\n eCommerceCartDataSource: serviceSettings.eCommerceCartDataSource,\n apiPlatform: serviceSettings.apiPlatform,\n eCommerceShoppingListDataSource: serviceSettings.eCommerceShoppingListDataSource,\n shopOnlineEnabled: localization.shopOnlineEnabled\n };\n }\n else {\n const localization = priceSettingsOrDexfPriceSettings.localization;\n return {\n eCommerceCartDataSource: localization === null || localization === void 0 ? void 0 : localization.eCommerceCartDataSource,\n apiPlatform: localization === null || localization === void 0 ? void 0 : localization.apiPlatform,\n eCommerceShoppingListDataSource: localization === null || localization === void 0 ? void 0 : localization.eCommerceShoppingListDataSource,\n shopOnlineEnabled: localization === null || localization === void 0 ? void 0 : localization.shopOnlineEnabled\n };\n }\n }\n}\nexports.default = ShoppingSupport;\n//# sourceMappingURL=ShoppingSupport.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * This utility is used for working with Url:s.\n */\nclass UrlUtility {\n /**\n * Can handle links without protocol and with wrong order of ancor and query parameters.\n * This property of the link will be kept - if original link had protocol the returned link will too, etc.\n *\n * @param link\n * @param paramToAdd Name of the query search parameter to add to link.\n * @param paramValueToAdd Value of the query search parameter to add to link.\n * @returns The link with the query parameter added.\n */\n static addQueryParameter(link, paramToAdd, paramValueToAdd) {\n if (!link || !paramToAdd || !paramValueToAdd) {\n return link;\n }\n const hasProtocol = !!link.match('https?://');\n const url = new URL(hasProtocol ? link : 'http://' + link);\n const hasPath = !!url.pathname && url.pathname !== '/';\n if (url.hash.includes('?')) {\n this.orderHashAndParams(url);\n this.addParamToUrl(url, paramToAdd, paramValueToAdd);\n return this.formattedLink(url, hasProtocol, false, hasPath);\n }\n this.addParamToUrl(url, paramToAdd, paramValueToAdd);\n return this.formattedLink(url, hasProtocol, true, hasPath);\n }\n /**\n * Adds the supplied parameters to the url.\n *\n * @param url\n * @param paramToAdd\n * @param paramValueToAdd\n */\n static addParamToUrl(url, paramToAdd, paramValueToAdd) {\n const params = new URLSearchParams(url.search);\n params.append(paramToAdd, paramValueToAdd);\n url.search = '?' + params.toString();\n }\n /**\n * @param url An url following the url standard in order.\n * @param hadProtocolBefore The returned link will contain protocol if it used to have it.\n * @param hadHashAndParamsInCorrectOrder The returned link will have params in the same order it used to have.\n * @param hadPathBefore\n */\n static formattedLink(url, hadProtocolBefore, hadHashAndParamsInCorrectOrder, hadPathBefore) {\n const protocolIfHadProtocolBefore = url.protocol && hadProtocolBefore ? url.protocol + '//' : '';\n const portIfHadPortBefore = url.port ? ':' + url.port : '';\n const pathIfHadPathBefore = hadPathBefore\n ? url.pathname && url.pathname.charAt(-1) === '/'\n ? url.pathname.slice(0, -1)\n : url.pathname\n : '';\n const hashAndParams = hadHashAndParamsInCorrectOrder\n ? url.search + url.hash\n : url.hash + url.search;\n return (protocolIfHadProtocolBefore +\n url.hostname +\n portIfHadPortBefore +\n pathIfHadPathBefore +\n hashAndParams);\n }\n /**\n * Reorders the supplied url to follow the standard url format.\n *\n * @param urlUnordered Url with the hash before the query parametes.\n */\n static orderHashAndParams(urlUnordered) {\n const params = new URLSearchParams();\n const [hashWithoutParams, paramsFromHash] = urlUnordered.hash.split('?');\n urlUnordered.hash = hashWithoutParams;\n const paramsList = paramsFromHash.split('&');\n paramsList.forEach((p) => {\n const [name, value] = p.split('=');\n params.append(name, value);\n });\n urlUnordered.search = '?' + params.toString();\n }\n}\nexports.default = UrlUtility;\n//# sourceMappingURL=UrlUtility.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Handles weight utilities.\n *\n */\nclass WeightUtility {\n /**\n * Converts weight in kilograms to pounds and ounces.\n *\n * @param weightInKg The weight in kilograms.\n * @returns The weight in pounds and ounces.\n */\n static metricToImperial(weightInKg) {\n const weightInPounds = weightInKg / 0.45359237;\n let lb = Math.floor(weightInPounds);\n let oz = Math.ceil((weightInPounds - lb) * 16);\n if (oz === 16) {\n oz = 0;\n lb++;\n }\n return { lb, oz };\n }\n}\nexports.default = WeightUtility;\n//# sourceMappingURL=WeightUtility.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Utility for getting the write direction in the browser which checks is the browser is Safari.\n */\nclass SafariWriteDirectionUtility {\n /**\n * Gets write direction.\n *\n * @returns Write direction.\n * @param element Html element.\n */\n static getWriteDirection(element) {\n var _a;\n if (navigator.userAgent.search('Safari') >= 0 && navigator.userAgent.search('Chrome') < 0) {\n return ((_a = document.defaultView) === null || _a === void 0 ? void 0 : _a.getComputedStyle(element, null).direction) || 'ltr';\n }\n return null;\n }\n}\nexports.default = SafariWriteDirectionUtility;\n//# sourceMappingURL=SafariWriteDirectionUtility.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\n/**\n * Zip availability utility.\n */\nclass ZipAvailabilityUtility {\n /**\n * Returns status indicator label for zip.\n *\n * @param options Options.\n * @param options.localizedInformation Deprecated - Use translations instead.\n * @param options.zipAvailability Zip availability.\n * @param options.translations Translations.\n * @returns Status Indicator Label.\n */\n static getLabel(options) {\n var _a, _b, _c, _d, _e;\n const { zipAvailability } = options;\n const actualTranslations = (_a = options.translations) !== null && _a !== void 0 ? _a : (_b = options.localizedInformation) === null || _b === void 0 ? void 0 : _b.translations;\n if (!actualTranslations) {\n throw Error('Either translations or localizedInformation parameter must be set to calculate a label.');\n }\n const { highInStock, lowInStock, mediumInStock, outOfStock, notSoldTemp, notInRange } = enums_1.ZipAvailabilityProbabilityEnum;\n if (!Array.isArray(zipAvailability)) {\n if (!zipAvailability) {\n return actualTranslations.zipAvailabilityNoDeliveryInfo;\n }\n if ((_c = zipAvailability === null || zipAvailability === void 0 ? void 0 : zipAvailability.content) === null || _c === void 0 ? void 0 : _c.availableForHomeDelivery) {\n return actualTranslations.zipAvailabilityAvailable;\n }\n else {\n switch ((_e = (_d = zipAvailability === null || zipAvailability === void 0 ? void 0 : zipAvailability.content) === null || _d === void 0 ? void 0 : _d.homeDelivery) === null || _e === void 0 ? void 0 : _e.messageType) {\n case outOfStock:\n return actualTranslations.zipAvailabilityUnavailable;\n case notSoldTemp:\n return actualTranslations.zipAvailabilityCurrentlyNotSold;\n case notInRange:\n return actualTranslations.zipAvailabilityNotSold;\n default:\n return actualTranslations.zipAvailabilityNoDeliveryInfo;\n }\n }\n }\n else {\n const zipAvailabilities = zipAvailability\n .map((item) => { var _a; return (_a = item.content.homeDelivery) === null || _a === void 0 ? void 0 : _a.messageType; })\n .filter((type) => type !== null);\n if (zipAvailabilities.every((type) => type === highInStock)) {\n return actualTranslations.zipAvailabilityAvailable;\n }\n if (zipAvailabilities.every((type) => type === outOfStock)) {\n return actualTranslations.zipAvailabilityUnavailable;\n }\n else if (zipAvailabilities.some((type) => type === lowInStock || type === mediumInStock || type === outOfStock)) {\n return actualTranslations.homeDeliveryStatusSomeAvailableWithoutZip;\n }\n }\n return '';\n }\n /**\n * Returns status indicator color for zip.\n *\n * @param options\n * @param zipAvailability Zip availability.\n * @param options.localizedInformation\n * @param options.zipAvailability\n * @returns Status Indicator Color.\n */\n static getColor(options) {\n var _a, _b, _c;\n const { zipAvailability } = options;\n const { highInStock, lowInStock, mediumInStock, outOfStock } = enums_1.ZipAvailabilityProbabilityEnum;\n if (!Array.isArray(zipAvailability)) {\n if (!zipAvailability) {\n return 'grey';\n }\n if ((_a = zipAvailability === null || zipAvailability === void 0 ? void 0 : zipAvailability.content) === null || _a === void 0 ? void 0 : _a.availableForHomeDelivery) {\n return 'green';\n }\n else {\n switch ((_c = (_b = zipAvailability.content) === null || _b === void 0 ? void 0 : _b.homeDelivery) === null || _c === void 0 ? void 0 : _c.messageType) {\n case enums_1.ZipAvailabilityProbabilityEnum.outOfStock:\n case enums_1.ZipAvailabilityProbabilityEnum.notSoldTemp:\n return 'red';\n default:\n return 'grey';\n }\n }\n }\n else {\n const zipAvailabilities = zipAvailability\n .map((item) => { var _a; return (_a = item.content.homeDelivery) === null || _a === void 0 ? void 0 : _a.messageType; })\n .filter((type) => !!type);\n // Is it intended that empty zipAvailabilities should return green?\n if (zipAvailabilities.every((type) => type === highInStock)) {\n return 'green';\n }\n if (zipAvailabilities.every((type) => type === outOfStock)) {\n return 'red';\n }\n else if (zipAvailabilities.some((type) => type === lowInStock || type === mediumInStock || type === outOfStock)) {\n return 'orange';\n }\n }\n return null;\n }\n}\nexports.default = ZipAvailabilityUtility;\n//# sourceMappingURL=ZipAvailabilityUtility.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ZipAvailabilityUtility = exports.WeightUtility = exports.UrlUtility = exports.TotalPriceCalculator = exports.StringUtility = exports.ShoppingSupport = exports.SafariWriteDirectionUtility = exports.ProductUtility = exports.ProductPriceInformationSummaryTransformer = exports.ProductDescriptionUtility = exports.ProductDescriptionProductMeasureEnum = exports.PriceUtility = exports.PriceFormatter = exports.MeasurementUtility = exports.LocalizedInformationAlternateLanguage = exports.LocaleUtility = exports.Latch = exports.KeepScreenAwakeUtility = exports.JavascriptLoader = exports.ImageUtility = exports.IframeVisibleAreaObserver = exports.IframeVisibleArea = exports.IframeUtility = exports.IdGenerator = exports.HtmlEncoder = exports.GlobalCacheStore = exports.EnergyClassParser = exports.EasingAnimation = exports.DexfSettingsUtility = exports.DebounceManager = exports.DateFormatter = exports.CssLoader = exports.ColorConverter = exports.CacheStore = exports.AvailabilityUtility = void 0;\nconst LocalizedInformationAlternateLanguage_1 = __importDefault(require(\"./alternate-language/LocalizedInformationAlternateLanguage\"));\nexports.LocalizedInformationAlternateLanguage = LocalizedInformationAlternateLanguage_1.default;\nconst EasingAnimation_1 = __importDefault(require(\"./animation/EasingAnimation\"));\nexports.EasingAnimation = EasingAnimation_1.default;\nconst AvailabilityUtility_1 = __importDefault(require(\"./availability/AvailabilityUtility\"));\nexports.AvailabilityUtility = AvailabilityUtility_1.default;\nconst CacheStore_1 = __importDefault(require(\"./cache/CacheStore\"));\nexports.CacheStore = CacheStore_1.default;\nconst GlobalCacheStore_1 = __importDefault(require(\"./cache/GlobalCacheStore\"));\nexports.GlobalCacheStore = GlobalCacheStore_1.default;\nconst ColorConverter_1 = __importDefault(require(\"./color-converter/ColorConverter\"));\nexports.ColorConverter = ColorConverter_1.default;\nconst CssLoader_1 = __importDefault(require(\"./css-loader/CssLoader\"));\nexports.CssLoader = CssLoader_1.default;\nconst DateFormatter_1 = __importDefault(require(\"./date/DateFormatter\"));\nexports.DateFormatter = DateFormatter_1.default;\nconst DebounceManager_1 = __importDefault(require(\"./debounce/DebounceManager\"));\nexports.DebounceManager = DebounceManager_1.default;\nconst HtmlEncoder_1 = __importDefault(require(\"./encoding/HtmlEncoder\"));\nexports.HtmlEncoder = HtmlEncoder_1.default;\nconst EnergyClassParser_1 = __importDefault(require(\"./energy-class/EnergyClassParser\"));\nexports.EnergyClassParser = EnergyClassParser_1.default;\nconst IdGenerator_1 = __importDefault(require(\"./generator/IdGenerator\"));\nexports.IdGenerator = IdGenerator_1.default;\nconst IframeUtility_1 = __importDefault(require(\"./iframe/IframeUtility\"));\nexports.IframeUtility = IframeUtility_1.default;\nconst IframeVisibleArea_1 = __importDefault(require(\"./iframe/IframeVisibleArea\"));\nexports.IframeVisibleArea = IframeVisibleArea_1.default;\nconst IframeVisibleAreaObserver_1 = __importDefault(require(\"./iframe/IframeVisibleAreaObserver\"));\nexports.IframeVisibleAreaObserver = IframeVisibleAreaObserver_1.default;\nconst ImageUtility_1 = __importDefault(require(\"./image/ImageUtility\"));\nexports.ImageUtility = ImageUtility_1.default;\nconst JavascriptLoader_1 = __importDefault(require(\"./javascript-loader/JavascriptLoader\"));\nexports.JavascriptLoader = JavascriptLoader_1.default;\nconst KeepScreenAwakeUtility_1 = __importDefault(require(\"./keep-screen-awake/KeepScreenAwakeUtility\"));\nexports.KeepScreenAwakeUtility = KeepScreenAwakeUtility_1.default;\nconst Latch_1 = __importDefault(require(\"./latch/Latch\"));\nexports.Latch = Latch_1.default;\nconst LocaleUtility_1 = __importDefault(require(\"./locale/LocaleUtility\"));\nexports.LocaleUtility = LocaleUtility_1.default;\nconst MeasurementUtility_1 = __importDefault(require(\"./measurement/MeasurementUtility\"));\nexports.MeasurementUtility = MeasurementUtility_1.default;\nconst PriceFormatter_1 = __importDefault(require(\"./price/PriceFormatter\"));\nexports.PriceFormatter = PriceFormatter_1.default;\nconst PriceUtility_1 = __importDefault(require(\"./price/PriceUtility\"));\nexports.PriceUtility = PriceUtility_1.default;\nconst ProductPriceInformationSummaryTransformer_1 = __importDefault(require(\"./price/ProductPriceInformationSummaryTransformer\"));\nexports.ProductPriceInformationSummaryTransformer = ProductPriceInformationSummaryTransformer_1.default;\nconst TotalPriceCalculator_1 = __importDefault(require(\"./price/TotalPriceCalculator\"));\nexports.TotalPriceCalculator = TotalPriceCalculator_1.default;\nconst ProductDescriptionProductMeasureEnum_1 = __importDefault(require(\"./product/ProductDescriptionProductMeasureEnum\"));\nexports.ProductDescriptionProductMeasureEnum = ProductDescriptionProductMeasureEnum_1.default;\nconst ProductDescriptionUtility_1 = __importDefault(require(\"./product/ProductDescriptionUtility\"));\nexports.ProductDescriptionUtility = ProductDescriptionUtility_1.default;\nconst ProductUtility_1 = __importDefault(require(\"./product/ProductUtility\"));\nexports.ProductUtility = ProductUtility_1.default;\nconst DexfSettingsUtility_1 = __importDefault(require(\"./settings/DexfSettingsUtility\"));\nexports.DexfSettingsUtility = DexfSettingsUtility_1.default;\nconst ShoppingSupport_1 = __importDefault(require(\"./shopping-support/ShoppingSupport\"));\nexports.ShoppingSupport = ShoppingSupport_1.default;\nconst StringUtility_1 = __importDefault(require(\"./string/StringUtility\"));\nexports.StringUtility = StringUtility_1.default;\nconst UrlUtility_1 = __importDefault(require(\"./url-utility/UrlUtility\"));\nexports.UrlUtility = UrlUtility_1.default;\nconst WeightUtility_1 = __importDefault(require(\"./weight/WeightUtility\"));\nexports.WeightUtility = WeightUtility_1.default;\nconst SafariWriteDirectionUtility_1 = __importDefault(require(\"./write-direction/SafariWriteDirectionUtility\"));\nexports.SafariWriteDirectionUtility = SafariWriteDirectionUtility_1.default;\nconst ZipAvailabilityUtility_1 = __importDefault(require(\"./zip-availability/ZipAvailabilityUtility\"));\nexports.ZipAvailabilityUtility = ZipAvailabilityUtility_1.default;\n//# sourceMappingURL=index.js.map","'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","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\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 isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object 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 * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\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 if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\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(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, 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 interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, 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(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\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(null, 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(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.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 that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().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)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\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 (!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 (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\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 (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (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 case undefined:\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) return utf8ToBytes(string).length // assume utf8\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 coersion 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// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\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 | 0\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.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 if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\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 (isNaN(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 (Buffer.TYPED_ARRAY_SUPPORT &&\n 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 // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\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 (isNaN(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 latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, 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 // legacy write(string, encoding, offset, length) - remove in v0.13\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 return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(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) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 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 += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; 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\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\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 = 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 = 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 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\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 = function readUInt32BE (offset, noAssert) {\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 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 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 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 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 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 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 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 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 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 = 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 = 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 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\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 if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\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 if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\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 if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\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 if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\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 (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\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 if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\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 if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\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 if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\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 if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\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 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 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 (!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('sourceStart out of bounds')\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 var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\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 (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\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 } else if (typeof val === 'number') {\n val = val & 255\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 : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\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 strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).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 stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\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\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","/*! safe-buffer. MIT License. Feross Aboukhadijeh */\n/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.prototype = Object.create(Buffer.prototype)\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","'use strict'\n\n// limit of Crypto.getRandomValues()\n// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues\nvar MAX_BYTES = 65536\n\n// Node supports requesting up to this number of bytes\n// https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48\nvar MAX_UINT32 = 4294967295\n\nfunction oldBrowser () {\n throw new Error('Secure random number generation is not supported by this browser.\\nUse Chrome, Firefox or Internet Explorer 11')\n}\n\nvar Buffer = require('safe-buffer').Buffer\nvar crypto = globalThis.crypto || globalThis.msCrypto\n\nif (crypto && crypto.getRandomValues) {\n module.exports = randomBytes\n} else {\n module.exports = oldBrowser\n}\n\nfunction randomBytes (size, cb) {\n // phantomjs needs to throw\n if (size > MAX_UINT32) throw new RangeError('requested too many random bytes')\n\n var bytes = Buffer.allocUnsafe(size)\n\n if (size > 0) { // getRandomValues fails on IE if size == 0\n if (size > MAX_BYTES) { // this is the max bytes crypto.getRandomValues\n // can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues\n for (var generated = 0; generated < size; generated += MAX_BYTES) {\n // buffer.slice automatically checks if the end is past the end of\n // the buffer so we don't have to here\n crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES))\n }\n } else {\n crypto.getRandomValues(bytes)\n }\n }\n\n if (typeof cb === 'function') {\n return process.nextTick(function () {\n cb(null, bytes)\n })\n }\n\n return bytes\n}\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\n/**\n * Service fetch utility.\n */\nclass ServiceFetch {\n /**\n * Fetches JSON and handles error responses.\n *\n * @param requestInfo Request info.\n * @param [options] Fetch options.\n * @param [options.headers] Fetch options.\n * @param [options.credentials] Fetch options.\n * @param [options.statusHandlers] Object with status handlers for a specific status code. Example: { 419: async () => { return this.__getUser() } }.\n * @returns Promise.\n */\n static json(requestInfo, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield this.fetch(requestInfo, options);\n if (typeof response.json === 'function') {\n try {\n return yield response.json();\n }\n catch (error) {\n throw new exceptions_1.UnableToParseServerResponseException(response, error.message);\n }\n }\n return response;\n });\n }\n /**\n * Fetches text and handles error responses.\n *\n * @param requestInfo Request info.\n * @param [options] Fetch options.\n * @param [options.headers] Fetch options.\n * @param [options.credentials] Fetch options.\n * @param [options.statusHandlers] Object with status handlers for a specific status code. Example: { 419: async () => { return this.__getUser() } }.\n * @returns Promise.\n */\n static text(requestInfo, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield this.fetch(requestInfo, options);\n if (typeof response.text === 'function') {\n try {\n return yield response.text();\n }\n catch (error) {\n throw new exceptions_1.UnableToParseServerResponseException(response, error.message);\n }\n }\n return null;\n });\n }\n /**\n * Fetches JSON and handles error responses.\n *\n * @param requestInfo Request info.\n * @param [options] Fetch options.\n * @param [options.headers] Fetch options.\n * @param [options.credentials] Fetch options.\n * @param [options.statusHandlers] Object with status handlers for a specific status code. Example: { 419: async () => { return this.__getUser() } }.\n * @returns Promise.\n */\n static fetch(requestInfo, options) {\n return __awaiter(this, void 0, void 0, function* () {\n let response;\n try {\n response = yield window.fetch(requestInfo, options);\n }\n catch (error) {\n throw new exceptions_1.ConnectionProblemException(requestInfo, error.message);\n }\n if (!response.ok) {\n throw new exceptions_1.ServerErrorResponseException(response);\n }\n return response;\n });\n }\n}\nexports.default = ServiceFetch;\n//# sourceMappingURL=ServiceFetch.js.map","\"use strict\";\n/**\n * These keys correspond to different aspects of a user's authentication state.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AccountServiceEnum;\n(function (AccountServiceEnum) {\n /**\n * Used for authentication to access the DEXF / Save API.\n * The application receives an access token after a user successfully authenticates and authorizes access.\n */\n AccountServiceEnum[\"accessToken\"] = \"accessToken\";\n /**\n * A value received from the server during OAuth 2.0 PKCE flow to verify the client\n * making the request is the one who initiated the authorization process.\n */\n AccountServiceEnum[\"codeVerifier\"] = \"codeVerifier\";\n /**\n * ID Tokens are a standardized feature of OpenID Connect designed to provide the client application with\n * information about the authenticated user. It contains user profile information in the form of claims,\n * in our case it contains the user's display name.\n */\n AccountServiceEnum[\"idToken\"] = \"idToken\";\n /**\n * PKCE (Proof Key for Code Exchange) is an OAuth 2.0 security extension that mitigates code interception attacks\n * by using a client-generated cryptographic key to link the authorization and token requests.\n */\n AccountServiceEnum[\"pkce\"] = \"pkce\";\n /**\n * Key indicating the status of authentication. True when an authentication attempt is in progress.\n */\n AccountServiceEnum[\"authenticationInProgress\"] = \"authenticationInProgress\";\n})(AccountServiceEnum || (AccountServiceEnum = {}));\nexports.default = AccountServiceEnum;\n//# sourceMappingURL=AccountServiceEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst AccountServiceEnum_1 = __importDefault(require(\"./enums/AccountServiceEnum\"));\n/**\n * This class is used for managing DexfAccountService tokens stored in the localStorage.\n */\nclass DexfAccountServiceStorage {\n constructor() {\n this.tokenPrefix = 'dexfAccount'; // Prefix used for all localStorage keys\n }\n /**\n * Removes all DexfAccountService tokens from localStorage.\n */\n clearAllTokens() {\n this.localStorageRemoveItem(AccountServiceEnum_1.default.idToken);\n this.localStorageRemoveItem(AccountServiceEnum_1.default.accessToken);\n this.localStorageRemoveItem(AccountServiceEnum_1.default.codeVerifier);\n }\n /**\n * Retrieves the PKCE value from localStorage and removes it.\n *\n * @returns The PKCE value, or error if not found.\n */\n getPkce() {\n const pkce = this.localStorageGetItem(AccountServiceEnum_1.default.pkce);\n if (!pkce) {\n throw new exceptions_1.ServiceException(`Failed to get Proof Key for Code Exchange (PKCE).`);\n }\n this.localStorageRemoveItem(AccountServiceEnum_1.default.pkce);\n return pkce;\n }\n /**\n * Retrieves the Code Verifier value from localStorage and removes it.\n *\n * @returns The Code Verifier value, or error if not found.\n */\n getCodeVerifier() {\n const code = this.localStorageGetItem(AccountServiceEnum_1.default.codeVerifier);\n if (!code) {\n return null;\n }\n this.localStorageRemoveItem(AccountServiceEnum_1.default.codeVerifier);\n return code;\n }\n /**\n * Remove code verifier from localStorage.\n *\n */\n removeCodeVerifier() {\n this.localStorageRemoveItem(AccountServiceEnum_1.default.codeVerifier);\n }\n /**\n * Retrieves the authentication in progress value from localStorage.\n *\n * @returns True if the authentication is in progress, otherwise false.\n */\n getAuthenticationState() {\n const state = this.localStorageGetItem(AccountServiceEnum_1.default.authenticationInProgress);\n // If the state is not 'true', this will return false\n if (state !== 'true') {\n return false;\n }\n return true;\n }\n /**\n * Remove authentication state from localStorage.\n */\n removeAuthenticationState() {\n this.localStorageRemoveItem(AccountServiceEnum_1.default.authenticationInProgress);\n }\n /**\n * Retrieves a token from localStorage.\n *\n * @param tokenName The name of the token to retrieve.\n * @returns The token value, or null if not found.\n */\n getToken(tokenName) {\n return this.localStorageGetItem(tokenName);\n }\n /**\n * Stores the PKCE value in localStorage.\n *\n * @param pkce The PKCE value to store.\n */\n storePkce(pkce) {\n this.localStorageSetItem(AccountServiceEnum_1.default.pkce, pkce);\n }\n /**\n * Stores the Code Verifier value in localStorage.\n *\n * @param code The Code Verifier value to store.\n */\n storeCodeVerifier(code) {\n this.localStorageSetItem(AccountServiceEnum_1.default.codeVerifier, code);\n }\n /**\n * Stores the authentication in progress state value in localStorage.\n *\n * @param state The authentication in progress state value to store.\n */\n storeAuthenticationState(state) {\n this.localStorageSetItem(AccountServiceEnum_1.default.authenticationInProgress, state.toString());\n }\n /**\n * Stores tokens in localStorage.\n *\n * @param tokens An object containing the tokens to store.\n */\n storeTokens(tokens) {\n this.localStorageSetItem(AccountServiceEnum_1.default.idToken, tokens.id_token);\n this.localStorageSetItem(AccountServiceEnum_1.default.accessToken, tokens.access_token);\n }\n /**\n * Generates the complete localStorage key name for a given token.\n *\n * @param token The token for which to generate the key name.\n * @returns The key name to use in localStorage.\n */\n generateTokenName(token) {\n return this.tokenPrefix + '_' + token;\n }\n /**\n * Stores a value in localStorage.\n *\n * @param name The key under which to store the value.\n * @param value The value to store.\n */\n localStorageSetItem(name, value) {\n window.localStorage.setItem(this.generateTokenName(name), value);\n }\n /**\n * Removes a value from localStorage.\n *\n * @param name The key of the value to remove.\n */\n localStorageRemoveItem(name) {\n window.localStorage.removeItem(this.generateTokenName(name));\n }\n /**\n * Retrieves a value from localStorage.\n *\n * @param name The key of the value to retrieve.\n * @returns The retrieved value, or null if not found.\n */\n localStorageGetItem(name) {\n return window.localStorage.getItem(this.generateTokenName(name));\n }\n}\nexports.default = DexfAccountServiceStorage;\n//# sourceMappingURL=DexfAccountServiceStorage.js.map","\"use strict\";function e(e){this.message=e}e.prototype=new Error,e.prototype.name=\"InvalidCharacterError\";var r=\"undefined\"!=typeof window&&window.atob&&window.atob.bind(window)||function(r){var t=String(r).replace(/=+$/,\"\");if(t.length%4==1)throw new e(\"'atob' failed: The string to be decoded is not correctly encoded.\");for(var n,o,a=0,i=0,c=\"\";o=t.charAt(i++);~o&&(n=a%4?64*n+o:o,a++%4)?c+=String.fromCharCode(255&n>>(-2*a&6)):0)o=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\".indexOf(o);return c};function t(e){var t=e.replace(/-/g,\"+\").replace(/_/g,\"/\");switch(t.length%4){case 0:break;case 2:t+=\"==\";break;case 3:t+=\"=\";break;default:throw\"Illegal base64url string!\"}try{return function(e){return decodeURIComponent(r(e).replace(/(.)/g,(function(e,r){var t=r.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t=\"0\"+t),\"%\"+t})))}(t)}catch(e){return r(t)}}function n(e){this.message=e}function o(e,r){if(\"string\"!=typeof e)throw new n(\"Invalid token specified\");var o=!0===(r=r||{}).header?0:1;try{return JSON.parse(t(e.split(\".\")[o]))}catch(e){throw new n(\"Invalid token specified: \"+e.message)}}n.prototype=new Error,n.prototype.name=\"InvalidTokenError\";const a=o;a.default=o,a.InvalidTokenError=n,module.exports=a;\n//# sourceMappingURL=jwt-decode.cjs.js.map\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","var Buffer = require('safe-buffer').Buffer\n\n// prototype class for hash functions\nfunction Hash (blockSize, finalSize) {\n this._block = Buffer.alloc(blockSize)\n this._finalSize = finalSize\n this._blockSize = blockSize\n this._len = 0\n}\n\nHash.prototype.update = function (data, enc) {\n if (typeof data === 'string') {\n enc = enc || 'utf8'\n data = Buffer.from(data, enc)\n }\n\n var block = this._block\n var blockSize = this._blockSize\n var length = data.length\n var accum = this._len\n\n for (var offset = 0; offset < length;) {\n var assigned = accum % blockSize\n var remainder = Math.min(length - offset, blockSize - assigned)\n\n for (var i = 0; i < remainder; i++) {\n block[assigned + i] = data[offset + i]\n }\n\n accum += remainder\n offset += remainder\n\n if ((accum % blockSize) === 0) {\n this._update(block)\n }\n }\n\n this._len += length\n return this\n}\n\nHash.prototype.digest = function (enc) {\n var rem = this._len % this._blockSize\n\n this._block[rem] = 0x80\n\n // zero (rem + 1) trailing bits, where (rem + 1) is the smallest\n // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize\n this._block.fill(0, rem + 1)\n\n if (rem >= this._finalSize) {\n this._update(this._block)\n this._block.fill(0)\n }\n\n var bits = this._len * 8\n\n // uint32\n if (bits <= 0xffffffff) {\n this._block.writeUInt32BE(bits, this._blockSize - 4)\n\n // uint64\n } else {\n var lowBits = (bits & 0xffffffff) >>> 0\n var highBits = (bits - lowBits) / 0x100000000\n\n this._block.writeUInt32BE(highBits, this._blockSize - 8)\n this._block.writeUInt32BE(lowBits, this._blockSize - 4)\n }\n\n this._update(this._block)\n var hash = this._hash()\n\n return enc ? hash.toString(enc) : hash\n}\n\nHash.prototype._update = function () {\n throw new Error('_update must be implemented by subclass')\n}\n\nmodule.exports = Hash\n","/*\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined\n * in FIPS PUB 180-1\n * This source code is derived from sha1.js of the same repository.\n * The difference between SHA-0 and SHA-1 is just a bitwise rotate left\n * operation was added.\n */\n\nvar inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0\n]\n\nvar W = new Array(80)\n\nfunction Sha () {\n this.init()\n this._w = W\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha, Hash)\n\nSha.prototype.init = function () {\n this._a = 0x67452301\n this._b = 0xefcdab89\n this._c = 0x98badcfe\n this._d = 0x10325476\n this._e = 0xc3d2e1f0\n\n return this\n}\n\nfunction rotl5 (num) {\n return (num << 5) | (num >>> 27)\n}\n\nfunction rotl30 (num) {\n return (num << 30) | (num >>> 2)\n}\n\nfunction ft (s, b, c, d) {\n if (s === 0) return (b & c) | ((~b) & d)\n if (s === 2) return (b & c) | (b & d) | (c & d)\n return b ^ c ^ d\n}\n\nSha.prototype._update = function (M) {\n var W = this._w\n\n var a = this._a | 0\n var b = this._b | 0\n var c = this._c | 0\n var d = this._d | 0\n var e = this._e | 0\n\n for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]\n\n for (var j = 0; j < 80; ++j) {\n var s = ~~(j / 20)\n var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0\n\n e = d\n d = c\n c = rotl30(b)\n b = a\n a = t\n }\n\n this._a = (a + this._a) | 0\n this._b = (b + this._b) | 0\n this._c = (c + this._c) | 0\n this._d = (d + this._d) | 0\n this._e = (e + this._e) | 0\n}\n\nSha.prototype._hash = function () {\n var H = Buffer.allocUnsafe(20)\n\n H.writeInt32BE(this._a | 0, 0)\n H.writeInt32BE(this._b | 0, 4)\n H.writeInt32BE(this._c | 0, 8)\n H.writeInt32BE(this._d | 0, 12)\n H.writeInt32BE(this._e | 0, 16)\n\n return H\n}\n\nmodule.exports = Sha\n","/*\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined\n * in FIPS PUB 180-1\n * Version 2.1a Copyright Paul Johnston 2000 - 2002.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for details.\n */\n\nvar inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0\n]\n\nvar W = new Array(80)\n\nfunction Sha1 () {\n this.init()\n this._w = W\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha1, Hash)\n\nSha1.prototype.init = function () {\n this._a = 0x67452301\n this._b = 0xefcdab89\n this._c = 0x98badcfe\n this._d = 0x10325476\n this._e = 0xc3d2e1f0\n\n return this\n}\n\nfunction rotl1 (num) {\n return (num << 1) | (num >>> 31)\n}\n\nfunction rotl5 (num) {\n return (num << 5) | (num >>> 27)\n}\n\nfunction rotl30 (num) {\n return (num << 30) | (num >>> 2)\n}\n\nfunction ft (s, b, c, d) {\n if (s === 0) return (b & c) | ((~b) & d)\n if (s === 2) return (b & c) | (b & d) | (c & d)\n return b ^ c ^ d\n}\n\nSha1.prototype._update = function (M) {\n var W = this._w\n\n var a = this._a | 0\n var b = this._b | 0\n var c = this._c | 0\n var d = this._d | 0\n var e = this._e | 0\n\n for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n for (; i < 80; ++i) W[i] = rotl1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16])\n\n for (var j = 0; j < 80; ++j) {\n var s = ~~(j / 20)\n var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0\n\n e = d\n d = c\n c = rotl30(b)\n b = a\n a = t\n }\n\n this._a = (a + this._a) | 0\n this._b = (b + this._b) | 0\n this._c = (c + this._c) | 0\n this._d = (d + this._d) | 0\n this._e = (e + this._e) | 0\n}\n\nSha1.prototype._hash = function () {\n var H = Buffer.allocUnsafe(20)\n\n H.writeInt32BE(this._a | 0, 0)\n H.writeInt32BE(this._b | 0, 4)\n H.writeInt32BE(this._c | 0, 8)\n H.writeInt32BE(this._d | 0, 12)\n H.writeInt32BE(this._e | 0, 16)\n\n return H\n}\n\nmodule.exports = Sha1\n","/**\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined\n * in FIPS 180-2\n * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n *\n */\n\nvar inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,\n 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,\n 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,\n 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,\n 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,\n 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,\n 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,\n 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,\n 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,\n 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,\n 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,\n 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,\n 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,\n 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,\n 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,\n 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2\n]\n\nvar W = new Array(64)\n\nfunction Sha256 () {\n this.init()\n\n this._w = W // new Array(64)\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha256, Hash)\n\nSha256.prototype.init = function () {\n this._a = 0x6a09e667\n this._b = 0xbb67ae85\n this._c = 0x3c6ef372\n this._d = 0xa54ff53a\n this._e = 0x510e527f\n this._f = 0x9b05688c\n this._g = 0x1f83d9ab\n this._h = 0x5be0cd19\n\n return this\n}\n\nfunction ch (x, y, z) {\n return z ^ (x & (y ^ z))\n}\n\nfunction maj (x, y, z) {\n return (x & y) | (z & (x | y))\n}\n\nfunction sigma0 (x) {\n return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)\n}\n\nfunction sigma1 (x) {\n return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)\n}\n\nfunction gamma0 (x) {\n return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)\n}\n\nfunction gamma1 (x) {\n return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)\n}\n\nSha256.prototype._update = function (M) {\n var W = this._w\n\n var a = this._a | 0\n var b = this._b | 0\n var c = this._c | 0\n var d = this._d | 0\n var e = this._e | 0\n var f = this._f | 0\n var g = this._g | 0\n var h = this._h | 0\n\n for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0\n\n for (var j = 0; j < 64; ++j) {\n var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0\n var T2 = (sigma0(a) + maj(a, b, c)) | 0\n\n h = g\n g = f\n f = e\n e = (d + T1) | 0\n d = c\n c = b\n b = a\n a = (T1 + T2) | 0\n }\n\n this._a = (a + this._a) | 0\n this._b = (b + this._b) | 0\n this._c = (c + this._c) | 0\n this._d = (d + this._d) | 0\n this._e = (e + this._e) | 0\n this._f = (f + this._f) | 0\n this._g = (g + this._g) | 0\n this._h = (h + this._h) | 0\n}\n\nSha256.prototype._hash = function () {\n var H = Buffer.allocUnsafe(32)\n\n H.writeInt32BE(this._a, 0)\n H.writeInt32BE(this._b, 4)\n H.writeInt32BE(this._c, 8)\n H.writeInt32BE(this._d, 12)\n H.writeInt32BE(this._e, 16)\n H.writeInt32BE(this._f, 20)\n H.writeInt32BE(this._g, 24)\n H.writeInt32BE(this._h, 28)\n\n return H\n}\n\nmodule.exports = Sha256\n","/**\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined\n * in FIPS 180-2\n * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n *\n */\n\nvar inherits = require('inherits')\nvar Sha256 = require('./sha256')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar W = new Array(64)\n\nfunction Sha224 () {\n this.init()\n\n this._w = W // new Array(64)\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha224, Sha256)\n\nSha224.prototype.init = function () {\n this._a = 0xc1059ed8\n this._b = 0x367cd507\n this._c = 0x3070dd17\n this._d = 0xf70e5939\n this._e = 0xffc00b31\n this._f = 0x68581511\n this._g = 0x64f98fa7\n this._h = 0xbefa4fa4\n\n return this\n}\n\nSha224.prototype._hash = function () {\n var H = Buffer.allocUnsafe(28)\n\n H.writeInt32BE(this._a, 0)\n H.writeInt32BE(this._b, 4)\n H.writeInt32BE(this._c, 8)\n H.writeInt32BE(this._d, 12)\n H.writeInt32BE(this._e, 16)\n H.writeInt32BE(this._f, 20)\n H.writeInt32BE(this._g, 24)\n\n return H\n}\n\nmodule.exports = Sha224\n","var inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n]\n\nvar W = new Array(160)\n\nfunction Sha512 () {\n this.init()\n this._w = W\n\n Hash.call(this, 128, 112)\n}\n\ninherits(Sha512, Hash)\n\nSha512.prototype.init = function () {\n this._ah = 0x6a09e667\n this._bh = 0xbb67ae85\n this._ch = 0x3c6ef372\n this._dh = 0xa54ff53a\n this._eh = 0x510e527f\n this._fh = 0x9b05688c\n this._gh = 0x1f83d9ab\n this._hh = 0x5be0cd19\n\n this._al = 0xf3bcc908\n this._bl = 0x84caa73b\n this._cl = 0xfe94f82b\n this._dl = 0x5f1d36f1\n this._el = 0xade682d1\n this._fl = 0x2b3e6c1f\n this._gl = 0xfb41bd6b\n this._hl = 0x137e2179\n\n return this\n}\n\nfunction Ch (x, y, z) {\n return z ^ (x & (y ^ z))\n}\n\nfunction maj (x, y, z) {\n return (x & y) | (z & (x | y))\n}\n\nfunction sigma0 (x, xl) {\n return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)\n}\n\nfunction sigma1 (x, xl) {\n return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)\n}\n\nfunction Gamma0 (x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)\n}\n\nfunction Gamma0l (x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)\n}\n\nfunction Gamma1 (x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)\n}\n\nfunction Gamma1l (x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)\n}\n\nfunction getCarry (a, b) {\n return (a >>> 0) < (b >>> 0) ? 1 : 0\n}\n\nSha512.prototype._update = function (M) {\n var W = this._w\n\n var ah = this._ah | 0\n var bh = this._bh | 0\n var ch = this._ch | 0\n var dh = this._dh | 0\n var eh = this._eh | 0\n var fh = this._fh | 0\n var gh = this._gh | 0\n var hh = this._hh | 0\n\n var al = this._al | 0\n var bl = this._bl | 0\n var cl = this._cl | 0\n var dl = this._dl | 0\n var el = this._el | 0\n var fl = this._fl | 0\n var gl = this._gl | 0\n var hl = this._hl | 0\n\n for (var i = 0; i < 32; i += 2) {\n W[i] = M.readInt32BE(i * 4)\n W[i + 1] = M.readInt32BE(i * 4 + 4)\n }\n for (; i < 160; i += 2) {\n var xh = W[i - 15 * 2]\n var xl = W[i - 15 * 2 + 1]\n var gamma0 = Gamma0(xh, xl)\n var gamma0l = Gamma0l(xl, xh)\n\n xh = W[i - 2 * 2]\n xl = W[i - 2 * 2 + 1]\n var gamma1 = Gamma1(xh, xl)\n var gamma1l = Gamma1l(xl, xh)\n\n // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]\n var Wi7h = W[i - 7 * 2]\n var Wi7l = W[i - 7 * 2 + 1]\n\n var Wi16h = W[i - 16 * 2]\n var Wi16l = W[i - 16 * 2 + 1]\n\n var Wil = (gamma0l + Wi7l) | 0\n var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0\n Wil = (Wil + gamma1l) | 0\n Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0\n Wil = (Wil + Wi16l) | 0\n Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0\n\n W[i] = Wih\n W[i + 1] = Wil\n }\n\n for (var j = 0; j < 160; j += 2) {\n Wih = W[j]\n Wil = W[j + 1]\n\n var majh = maj(ah, bh, ch)\n var majl = maj(al, bl, cl)\n\n var sigma0h = sigma0(ah, al)\n var sigma0l = sigma0(al, ah)\n var sigma1h = sigma1(eh, el)\n var sigma1l = sigma1(el, eh)\n\n // t1 = h + sigma1 + ch + K[j] + W[j]\n var Kih = K[j]\n var Kil = K[j + 1]\n\n var chh = Ch(eh, fh, gh)\n var chl = Ch(el, fl, gl)\n\n var t1l = (hl + sigma1l) | 0\n var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0\n t1l = (t1l + chl) | 0\n t1h = (t1h + chh + getCarry(t1l, chl)) | 0\n t1l = (t1l + Kil) | 0\n t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0\n t1l = (t1l + Wil) | 0\n t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0\n\n // t2 = sigma0 + maj\n var t2l = (sigma0l + majl) | 0\n var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0\n\n hh = gh\n hl = gl\n gh = fh\n gl = fl\n fh = eh\n fl = el\n el = (dl + t1l) | 0\n eh = (dh + t1h + getCarry(el, dl)) | 0\n dh = ch\n dl = cl\n ch = bh\n cl = bl\n bh = ah\n bl = al\n al = (t1l + t2l) | 0\n ah = (t1h + t2h + getCarry(al, t1l)) | 0\n }\n\n this._al = (this._al + al) | 0\n this._bl = (this._bl + bl) | 0\n this._cl = (this._cl + cl) | 0\n this._dl = (this._dl + dl) | 0\n this._el = (this._el + el) | 0\n this._fl = (this._fl + fl) | 0\n this._gl = (this._gl + gl) | 0\n this._hl = (this._hl + hl) | 0\n\n this._ah = (this._ah + ah + getCarry(this._al, al)) | 0\n this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0\n this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0\n this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0\n this._eh = (this._eh + eh + getCarry(this._el, el)) | 0\n this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0\n this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0\n this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0\n}\n\nSha512.prototype._hash = function () {\n var H = Buffer.allocUnsafe(64)\n\n function writeInt64BE (h, l, offset) {\n H.writeInt32BE(h, offset)\n H.writeInt32BE(l, offset + 4)\n }\n\n writeInt64BE(this._ah, this._al, 0)\n writeInt64BE(this._bh, this._bl, 8)\n writeInt64BE(this._ch, this._cl, 16)\n writeInt64BE(this._dh, this._dl, 24)\n writeInt64BE(this._eh, this._el, 32)\n writeInt64BE(this._fh, this._fl, 40)\n writeInt64BE(this._gh, this._gl, 48)\n writeInt64BE(this._hh, this._hl, 56)\n\n return H\n}\n\nmodule.exports = Sha512\n","var inherits = require('inherits')\nvar SHA512 = require('./sha512')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar W = new Array(160)\n\nfunction Sha384 () {\n this.init()\n this._w = W\n\n Hash.call(this, 128, 112)\n}\n\ninherits(Sha384, SHA512)\n\nSha384.prototype.init = function () {\n this._ah = 0xcbbb9d5d\n this._bh = 0x629a292a\n this._ch = 0x9159015a\n this._dh = 0x152fecd8\n this._eh = 0x67332667\n this._fh = 0x8eb44a87\n this._gh = 0xdb0c2e0d\n this._hh = 0x47b5481d\n\n this._al = 0xc1059ed8\n this._bl = 0x367cd507\n this._cl = 0x3070dd17\n this._dl = 0xf70e5939\n this._el = 0xffc00b31\n this._fl = 0x68581511\n this._gl = 0x64f98fa7\n this._hl = 0xbefa4fa4\n\n return this\n}\n\nSha384.prototype._hash = function () {\n var H = Buffer.allocUnsafe(48)\n\n function writeInt64BE (h, l, offset) {\n H.writeInt32BE(h, offset)\n H.writeInt32BE(l, offset + 4)\n }\n\n writeInt64BE(this._ah, this._al, 0)\n writeInt64BE(this._bh, this._bl, 8)\n writeInt64BE(this._ch, this._cl, 16)\n writeInt64BE(this._dh, this._dl, 24)\n writeInt64BE(this._eh, this._el, 32)\n writeInt64BE(this._fh, this._fl, 40)\n\n return H\n}\n\nmodule.exports = Sha384\n","var exports = module.exports = function SHA (algorithm) {\n algorithm = algorithm.toLowerCase()\n\n var Algorithm = exports[algorithm]\n if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')\n\n return new Algorithm()\n}\n\nexports.sha = require('./sha')\nexports.sha1 = require('./sha1')\nexports.sha224 = require('./sha224')\nexports.sha256 = require('./sha256')\nexports.sha384 = require('./sha384')\nexports.sha512 = require('./sha512')\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst jwt_decode_cjs_1 = __importDefault(require(\"jwt-decode/build/jwt-decode.cjs\"));\nconst sha_js_1 = __importDefault(require(\"sha.js\"));\n/**\n * This utility is used to handle encoding, decoding, and other operations related to DEXF AccountService tokens.\n */\nclass DexfAccountServiceUtility {\n /**\n * Converts a Buffer into a URL-safe base64 encoded string.\n *\n * @param value The Buffer to convert.\n * @returns The base64 encoded string.\n */\n base64(value) {\n return value.toString('base64').replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '');\n }\n /**\n * Converts an object's keys from camelCase to snake_case and encodes them into a URL query string.\n *\n * @param data The object to convert.\n * @returns The URL query string.\n */\n createUrlParameters(data) {\n const snakeData = this.renameKeysToSnake(data);\n return Object.entries(snakeData)\n .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)\n .join('&');\n }\n /**\n * Extracts the 'code' parameter from the current window's URL, if it exists and no error is present.\n *\n * @returns The value of the 'code' parameter, or null if it doesn't exist or an error is present.\n */\n getCodeSearchParam() {\n try {\n const url = new URL(this.getWindowLocation());\n return this.getCodeFromUrl(url);\n }\n catch (e) {\n throw new exceptions_1.ServiceException(`Failed to parse window location. Error: ${e.message}`);\n }\n }\n /**\n * Decodes a JWT token and extracts the displayName property.\n *\n * @param token The JWT token to decode.\n * @returns The displayName.\n * @throws {ServiceException} If decoding the token fails.\n */\n getIdTokenDisplayName(token) {\n try {\n return (0, jwt_decode_cjs_1.default)(token).displayName;\n }\n catch (error) {\n throw new exceptions_1.ServiceException(`Failed to decode JWT token. Error: ${error.message}`);\n }\n }\n /**\n * Creates a SHA-256 hash of the given string.\n *\n * @param verifier The string to hash.\n * @returns The SHA-256 hash.\n */\n createSha256Hash(verifier) {\n return (0, sha_js_1.default)('sha256').update(verifier).digest();\n }\n /**\n * Validates a JWT token's expiry time.\n *\n * @param token The JWT token to validate.\n * @returns True if the token's expiry time is more than 30 seconds in the future, false otherwise.\n */\n isTokenValid(token) {\n try {\n return ((0, jwt_decode_cjs_1.default)(token).exp >\n this.nowPlus30seconds());\n }\n catch (error) {\n return false;\n }\n }\n /**\n * Check if window is inside an iframe, and getting the parent window location if it is.\n */\n getWindowLocation() {\n if (utilities_1.IframeUtility.isInsideIframe()) {\n if (!utilities_1.IframeUtility.isParentWindowAccessible()) {\n throw new exceptions_1.ServiceException('Failed to redirect to login page in the parent window because it was not accessible. Try to use the usePopup option to login via popup instead.');\n }\n return window.parent.location.href;\n }\n return window.location.href;\n }\n /**\n * Extracts the 'code' parameter from the given URL, if it exists and no error is present.\n *\n * @param url\n */\n getCodeFromUrl(url) {\n return url.searchParams.get('error') ? null : url.searchParams.get('code');\n }\n /**\n * Converts all keys in an object from camelCase to snake_case.\n *\n * @param obj The object whose keys should be converted.\n * @returns The object with converted keys.\n */\n renameKeysToSnake(obj) {\n const keyValues = Object.keys(obj).map((key) => {\n const newKey = utilities_1.StringUtility.camelToSnake(key);\n return { [newKey]: obj[key] };\n });\n return Object.assign({}, ...keyValues);\n }\n /**\n * Returns a Unix timestamp representing 30 seconds from the current time.\n *\n * @returns The future timestamp.\n */\n nowPlus30seconds() {\n return Date.now() / 1000 + 30;\n }\n}\nexports.default = DexfAccountServiceUtility;\n//# sourceMappingURL=DexfAccountServiceUtility.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst randombytes_1 = __importDefault(require(\"@frando/randombytes\"));\nconst ServiceFetch_1 = __importDefault(require(\"../../../utilities/ServiceFetch\"));\nconst DexfAccountServiceStorage_1 = __importDefault(require(\"./DexfAccountServiceStorage\"));\nconst DexfAccountServiceUtility_1 = __importDefault(require(\"./DexfAccountServiceUtility\"));\n/**\n * This service is used for handling authentication with DEXF AccountService.\n */\nclass DexfAccountService {\n /**\n * Initializes a new instance of DexfAccountService.\n *\n * @param options Configuration options for DexfAccountService.\n * @param options.accessTokenUrl URL to get the access token.\n * @param options.authenticationUrl URL for authentication.\n * @param options.clientId Client ID for authentication.\n * @param options.redirectUri Redirect URI after authentication.\n * @param options.loginOptions [options={}] The options for login. Optional.\n */\n constructor(options) {\n this.loginIntervalTime = 500;\n this.accessTokenUrl = options.accessTokenUrl;\n this.authenticationUrl = options.authenticationUrl;\n this.clientId = options.clientId;\n this.redirectUri = options.redirectUri;\n this.loginOptions = options.loginOptions || {};\n this.dexfAccountServiceStorage = new DexfAccountServiceStorage_1.default();\n this.dexfAccountServiceUtility = new DexfAccountServiceUtility_1.default();\n }\n /**\n * Retrieves the access token or ID token if valid.\n *\n * @param authenticationEnum Type of authentication.\n * @returns The access token or null if invalid.\n */\n retrieveValidToken(authenticationEnum) {\n return __awaiter(this, void 0, void 0, function* () {\n const token = this.dexfAccountServiceStorage.getToken(authenticationEnum);\n // First, check if there is a valid token\n if (token && this.dexfAccountServiceUtility.isTokenValid(token)) {\n return token;\n }\n // If the token doesn't exist or is not valid, check if there is an ongoing authentication and a code verifier.\n const authenticationInProgress = this.dexfAccountServiceStorage.getAuthenticationState();\n const codeVerifier = this.dexfAccountServiceStorage.getCodeVerifier();\n if (authenticationInProgress && codeVerifier) {\n // Fetch a new token\n const newToken = yield this.fetchAccessToken(codeVerifier);\n // If a new token is fetched successfully, return it.\n if (newToken) {\n return newToken;\n }\n }\n // If no valid token is found or fetched, clear all tokens and return null\n this.dexfAccountServiceStorage.clearAllTokens();\n return null;\n });\n }\n /**\n * Initiates the login process.\n *\n * @param options\n * @param options.silent [silent=false] Optionally enable silent authentication. Defaults to false.\n * @param options.state Optional. Sets the state parameter in the login request.\n * @returns A promise that resolves with a string (token or code).\n * @throws Will throw an error if the popup fails to open or is blocked by the browser.\n */\n initiateLogin(options) {\n return __awaiter(this, void 0, void 0, function* () {\n // Destructure options with default values.\n const { usePopup = false, popupOptions: { width = 800, height = 640, name = 'oAuthPopup' } = {} } = this.loginOptions;\n // Clear all tokens in storage\n this.dexfAccountServiceStorage.clearAllTokens();\n // Create a verifier for PKCE\n const verifier = this.dexfAccountServiceUtility.base64((0, randombytes_1.default)(32));\n // Store the verifier in storage for later use\n this.dexfAccountServiceStorage.storePkce(verifier);\n // Create a code challenge from the verifier\n const challenge = this.dexfAccountServiceUtility.base64(this.dexfAccountServiceUtility.createSha256Hash(verifier));\n // Create the data payload for the authentication request\n const data = Object.assign(Object.assign({ redirectUri: this.redirectUri, responseType: 'code', clientId: this.clientId, codeChallenge: challenge, codeChallengeMethod: 'S256' }, (options.state && { state: options.state })), (options.silent && { prompt: 'none' }) // Include prompt: 'none' if silent is true\n );\n // Build the authentication URL\n const parameters = this.dexfAccountServiceUtility.createUrlParameters(data);\n const authUrl = this.authenticationUrl + '&' + parameters;\n this.dexfAccountServiceStorage.storeAuthenticationState(true);\n // If usePopup is true, open a popup window for authentication\n if (usePopup) {\n // Open popup in the center of the screen.\n const left = (screen.width - width) / 2;\n const top = (screen.height - height) / 2;\n const popup = window.open(authUrl, name, `width=${width},height=${height},left=${left},top=${top}`);\n if (popup) {\n // If the popup was opened successfully, handle the authentication through the popup\n return this.handleAuthentication(popup);\n }\n else {\n // If the popup failed to open, throw an error\n throw new exceptions_1.ServiceException('Popup failed to open or was blocked by the browser.');\n }\n }\n else {\n // If usePopup is false, redirect the current window to the authentication URL\n // If app is running in an iframe we need to redirect the parent url\n if (utilities_1.IframeUtility.isInsideIframe()) {\n // Planner can be running on a different domain than the parent page which means that it will not be possible to redirect\n if (utilities_1.IframeUtility.isParentWindowAccessible()) {\n window.parent.location.href = authUrl;\n }\n else {\n throw new exceptions_1.ServiceException('Failed to redirect to login page in the parent window because it was not accessible. Try to use the usePopup option to login via popup instead.');\n }\n }\n else {\n window.location.href = authUrl;\n }\n }\n });\n }\n /**\n * Fetches the access token using authorization code.\n *\n * @param code\n * @returns The access token.\n */\n fetchAccessToken(code) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = {\n grantType: 'authorization_code',\n code: code,\n redirectUri: this.redirectUri,\n clientId: this.clientId,\n codeVerifier: this.dexfAccountServiceStorage.getPkce()\n };\n const body = this.dexfAccountServiceUtility.createUrlParameters(data);\n const response = yield ServiceFetch_1.default.json(this.accessTokenUrl, {\n method: 'post',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded'\n },\n body: body\n });\n if (!response.id_token || !response.access_token || response['code']) {\n throw new exceptions_1.ServiceException('Failed to get access token. Error: ' + response['code']);\n }\n // If the response is successful, store the tokens in storage and remove the code verifier and authentication state.\n this.dexfAccountServiceStorage.removeAuthenticationState();\n this.dexfAccountServiceStorage.removeCodeVerifier();\n this.dexfAccountServiceStorage.storeTokens(response);\n return response.access_token;\n });\n }\n /**\n * Monitors the authentication process.\n *\n * @param popup Optional popup window for authentication.\n * @returns The access token.\n */\n handleAuthentication(popup) {\n return new Promise((resolve, reject) => {\n const intervalId = setInterval(() => __awaiter(this, void 0, void 0, function* () {\n try {\n if (popup && popup.closed) {\n this.dexfAccountServiceStorage.removeAuthenticationState();\n clearInterval(intervalId);\n reject(new exceptions_1.ServiceException('Failed to login. The popup was closed.'));\n return;\n }\n const authenticationInProgress = this.dexfAccountServiceStorage.getAuthenticationState();\n const codeVerifier = this.dexfAccountServiceStorage.getCodeVerifier();\n if (authenticationInProgress && codeVerifier) {\n const accessToken = yield this.fetchAccessToken(codeVerifier);\n if (popup) {\n popup.close();\n }\n resolve(accessToken);\n clearInterval(intervalId);\n }\n }\n catch (e) {\n clearInterval(intervalId);\n reject(new exceptions_1.ServiceException(`Failed to login: ${e.message}`));\n }\n }), this.loginIntervalTime);\n });\n }\n}\nexports.default = DexfAccountService;\n//# sourceMappingURL=DexfAccountService.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\n/**\n * This class is used for transforming data ÖVERSÄTTA translation tool.\n */\nclass OversattaTransformer {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param [options.localizationPrefixApplication] Localization prefix application.\n * @param options.locale Locale.\n */\n constructor(options) {\n this.localizationPrefixApplication = options.localizationPrefixApplication || null;\n this.locale = options.locale;\n }\n /**\n * Transforms data into a LocalizedInformation model.\n *\n * @param data Response data to parse.\n * @returns Localized information model.\n */\n transform(data) {\n const storeId = data.localization && data.localization.storeId ? data.localization.storeId : null;\n const langId = data.localization && data.localization.langId ? data.localization.langId : null;\n const localizedInformation = {\n localization: this.getLocalization(data.localization || {}),\n priceSettings: (data['priceSettings'] || data.prices || {}),\n urls: this.getUrls(data['urls'] || data.URLs || {}, storeId, langId),\n endpoints: this.getEndpoints(data.endpoints || {}),\n translations: this.getTranslations(data.translations || {}),\n userABTest: data.UserABTest\n };\n for (const key of Object.keys(data)) {\n if (!localizedInformation[key] &&\n key !== 'iconImages' &&\n key !== 'prices' &&\n key !== 'URLs' &&\n key !== 'UserABTest') {\n localizedInformation[key] = data[key];\n }\n }\n return localizedInformation;\n }\n /**\n * Parses localization.\n *\n * @param localization Localization.\n * @returns Parsed localization.\n */\n getLocalization(localization) {\n const newLocalization = Object.assign({}, localization);\n this.replaceApplicationPrefixedKeys(newLocalization);\n // We should not use these.\n // Instead we should take the locale from the URL, or use endpoints.\n delete newLocalization['locale'];\n delete newLocalization['iowsLocalePath'];\n delete newLocalization['countryCode'];\n delete newLocalization['languageCode'];\n return newLocalization;\n }\n /**\n * Parses translations.\n *\n * @param translations Translations.\n * @returns Parsed translations.\n */\n getTranslations(translations) {\n const newTranslations = {};\n this.replaceApplicationPrefixedKeys(translations);\n for (const key of Object.keys(translations)) {\n newTranslations[this.snakeToCamelCase(key)] = translations[key];\n }\n return newTranslations;\n }\n /**\n * Overrides keys with value from key with application prefix.\n *\n * @param keys Object of key/value.\n */\n replaceApplicationPrefixedKeys(keys) {\n const application = this.localizationPrefixApplication;\n if (application) {\n for (const key of Object.keys(keys)) {\n const pairs = key.split('__');\n if (pairs.length > 1 && pairs[0] === application) {\n keys[pairs[1]] = keys[key];\n }\n if (pairs.length > 1) {\n delete keys[key];\n }\n }\n }\n }\n /**\n * Parses URL:s.\n *\n * @param urls URL:s.\n * @param storeId Store id.\n * @param langId Langauge id.\n * @returns Parsed URL:s.\n */\n getUrls(urls, storeId, langId) {\n const { country, language } = utilities_1.LocaleUtility.getCountryAndLanguage(this.locale);\n const newUrls = {};\n for (const key of Object.keys(urls)) {\n newUrls[key] = urls[key]\n .replace('{country}', country)\n .replace('{language}', language)\n .replace('{storeId}', storeId)\n .replace('{langId}', langId);\n }\n return newUrls;\n }\n /**\n * Parses endpoints.\n *\n * @param endpoints Endpoints.\n * @returns Parsed endpoints.\n */\n getEndpoints(endpoints) {\n const { country, language } = utilities_1.LocaleUtility.getCountryAndLanguage(this.locale);\n const newEndpoints = {};\n for (const key of Object.keys(endpoints)) {\n newEndpoints[key] = endpoints[key]\n .replace('{country}', country)\n .replace('{language}', language)\n .replace('{retailUnit}', country === null || country === void 0 ? void 0 : country.toUpperCase())\n .replace('{locale}', this.locale);\n }\n return newEndpoints;\n }\n /**\n * Formats a lower camel case string into upper snake case (translation key).\n *\n * @param string String to format.\n * @returns Formatted string.\n */\n snakeToCamelCase(string) {\n if (/[^A-Z0-9_]/.test(string)) {\n return string;\n }\n return string\n .toLowerCase()\n .replace(/([_][a-z0-9])/gi, (chars) => chars.toUpperCase().replace('_', ''));\n }\n}\nexports.default = OversattaTransformer;\n//# sourceMappingURL=OversattaTransformer.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst ServiceFetch_1 = __importDefault(require(\"../../utilities/ServiceFetch\"));\nconst OversattaTransformer_1 = __importDefault(require(\"./OversattaTransformer\"));\n/**\n * This service is used for fetching localization information from ÖVERSÄTTA.\n */\nclass OversattaService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.localizationPrefixApplication Localization prefix application.\n * @param options.localizationEndpoints Localization endpoints.\n * @param [options.localizationOverrides] Localization overrides.\n * @param options.locale Locale.\n */\n constructor(options) {\n this.localizationPrefixApplication = options.localizationPrefixApplication;\n this.localizationEndpoints = options.localizationEndpoints;\n this.localizationOverrides = options.localizationOverrides;\n this.locale = options.locale;\n }\n /**\n * Fetches and returns translations.\n *\n * @returns Promise object.\n */\n getLocalizedInformation() {\n return __awaiter(this, void 0, void 0, function* () {\n const responses = yield Promise.all(this.localizationEndpoints.map((url) => this.fetch(url)));\n const transformer = new OversattaTransformer_1.default({\n localizationPrefixApplication: this.localizationPrefixApplication,\n locale: this.locale\n });\n const transformed = [];\n for (const response of responses) {\n transformed.push(transformer.transform(response));\n }\n if (this.localizationOverrides) {\n transformed.push(transformer.transform(this.localizationOverrides));\n }\n return this.mergeLocalizedInformation(transformed);\n });\n }\n /**\n * Merges multiple localized information.\n *\n * @param localizedInformations Array of localized informations.\n * @returns Merged localized informations.\n */\n mergeLocalizedInformation(localizedInformations) {\n const merged = Object.assign({}, ...localizedInformations);\n for (const key of Object.keys(merged)) {\n merged[key] = Object.assign({}, ...localizedInformations.map((localizedInformation) => localizedInformation[key]));\n }\n return merged;\n }\n /**\n * Fetches and returns translations.\n *\n * @param url URL.\n * @returns Promise object.\n */\n fetch(url) {\n return __awaiter(this, void 0, void 0, function* () {\n const { country, language } = utilities_1.LocaleUtility.getCountryAndLanguage(this.locale);\n if (!country || !language) {\n throw new exceptions_1.ServiceException('Country or language is not defined. Format locale correctly, e.g. en-GB');\n }\n const parsedUrl = url.replace('{country}', country).replace('{language}', language);\n return yield ServiceFetch_1.default.json(parsedUrl, {\n credentials: 'same-origin'\n });\n });\n }\n}\nexports.default = OversattaService;\n//# sourceMappingURL=OversattaService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst CacheStoreType_1 = __importDefault(require(\"../../enums/CacheStoreType\"));\nconst OversattaService_1 = __importDefault(require(\"../../services/localization/OversattaService\"));\n/**\n * @deprecated Use TranslationsService for translations (Phrase) and SettingsService for settings (DEXF).\n * This class is used as a simple interface for translation services.\n */\nclass LocalizationService {\n /**\n * Constructor.\n *\n * @param options Options.\n */\n constructor(options) {\n this.localizationPrefixApplication = options.localizationPrefixApplication;\n this.localizationEndpoints = options.localizationEndpoints;\n this.localizationOverrides = options.localizationOverrides;\n this.locale = options.locale;\n this.cache = options.cache || new utilities_1.GlobalCacheStore();\n }\n /**\n * Fetches and returns translations.\n *\n * @returns Promise object.\n */\n getLocalizedInformation() {\n return __awaiter(this, void 0, void 0, function* () {\n const cacheStore = this.cache.getStore(CacheStoreType_1.default.localization);\n const endpointsCacheKey = JSON.stringify(this.localizationEndpoints);\n const overridesCacheKey = this.localizationOverrides\n ? JSON.stringify(this.localizationOverrides)\n : '';\n const localizedCacheKey = this.locale + endpointsCacheKey + overridesCacheKey;\n const queueCacheKey = this.locale + endpointsCacheKey + overridesCacheKey + 'queue';\n const cachedLocalized = cacheStore.get(localizedCacheKey);\n const cachedQueue = cacheStore.get(queueCacheKey);\n const newQueue = [];\n if (cachedLocalized) {\n return cachedLocalized;\n }\n if (cachedQueue) {\n return new Promise((resolve, reject) => cachedQueue.push({ resolve, reject }));\n }\n cacheStore.set(queueCacheKey, newQueue);\n const service = new OversattaService_1.default({\n localizationPrefixApplication: this.localizationPrefixApplication,\n localizationEndpoints: this.localizationEndpoints,\n localizationOverrides: this.localizationOverrides,\n locale: this.locale\n });\n let localizedInformation;\n try {\n localizedInformation = yield service.getLocalizedInformation();\n }\n catch (error) {\n for (const item of newQueue) {\n item.reject(error);\n }\n throw error;\n }\n cacheStore.set(localizedCacheKey, localizedInformation);\n cacheStore.delete(queueCacheKey);\n for (const item of newQueue) {\n item.resolve(localizedInformation);\n }\n return localizedInformation;\n });\n }\n}\nexports.default = LocalizationService;\n//# sourceMappingURL=LocalizationService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst LocalizationService_1 = __importDefault(require(\"../facades/localization/LocalizationService\"));\n/**\n *\n */\nclass DexfConfiguration {\n /**\n * @param options\n */\n constructor(options) {\n this.settingsOptions = options;\n }\n /**\n * Returns the dexf API key that has been set.\n * If no key has been set or can't be fetched an exception will be thrown.\n */\n getDexfApiKeyOrThrow() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.dexfApiKey) {\n return this.dexfApiKey;\n }\n if (this.settingsOptions.dexfApiKey) {\n this.dexfApiKey = this.settingsOptions.dexfApiKey;\n }\n else {\n const localizedInformation = yield this.getLocalizedInformation();\n this.dexfApiKey = localizedInformation.localization.dexfApiKey;\n }\n if (!this.dexfApiKey) {\n throw new exceptions_1.ServiceException('DEXF API Key not set');\n }\n return this.dexfApiKey;\n });\n }\n /**\n * Get the DEXF settings, either through the already provided DEXF settings object, or by fetching Översätta settings and transforming them to DEXF settings.\n *\n * @returns Promise of DEXF settings.\n */\n getSettings() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.settings) {\n return this.settings;\n }\n if (this.settingsOptions.settings) {\n this.settings = this.settingsOptions.settings;\n }\n else {\n const localizedInformation = yield this.getLocalizedInformation();\n this.settings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(localizedInformation);\n }\n return this.settings;\n });\n }\n /**\n *\n */\n getLocalizedInformation() {\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.localizedInformation) {\n const { locale, localizationPrefixApplication, localizationEndpoints, localizationOverrides, cache } = this.settingsOptions;\n if (!localizationEndpoints || !locale) {\n throw new exceptions_1.ServiceException('Options to fetch localized information not set.');\n }\n const localizationService = new LocalizationService_1.default({\n localizationPrefixApplication: localizationPrefixApplication,\n localizationEndpoints: localizationEndpoints,\n localizationOverrides: localizationOverrides,\n locale: locale,\n cache: cache\n });\n this.localizedInformation = yield localizationService.getLocalizedInformation();\n }\n return this.localizedInformation;\n });\n }\n}\nexports.default = DexfConfiguration;\n//# sourceMappingURL=DexfConfiguration.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst DexfAccountService_1 = __importDefault(require(\"../../services/authentication/account-service/DexfAccountService\"));\nconst DexfAccountServiceStorage_1 = __importDefault(require(\"../../services/authentication/account-service/DexfAccountServiceStorage\"));\nconst DexfAccountServiceUtility_1 = __importDefault(require(\"../../services/authentication/account-service/DexfAccountServiceUtility\"));\nconst AccountServiceEnum_1 = __importDefault(require(\"../../services/authentication/account-service/enums/AccountServiceEnum\"));\nconst DexfConfiguration_1 = __importDefault(require(\"../../utilities/DexfConfiguration\"));\n/**\n * This class serves as an interface for DEXF Account Service.\n */\nclass AccountService {\n /**\n * Initializes a new instance of AccountService.\n *\n * @param options Configuration options.\n */\n constructor(options) {\n this.dexfConfiguration = new DexfConfiguration_1.default(options);\n this.applicationName = options.applicationName;\n this.loginOptions = options.loginOptions || {};\n this.redirectUri = options.redirectUri;\n this.settingsSegment = options.settingsSegment;\n }\n /**\n * Removes all DexfAccountService tokens from localStorage.\n */\n clearAllTokens() {\n const storage = new DexfAccountServiceStorage_1.default();\n storage.clearAllTokens();\n }\n /**\n * Retrieves access token if the user is signed in.\n *\n * @returns Access token or null if not signed in.\n */\n retrieveAccessToken() {\n return __awaiter(this, void 0, void 0, function* () {\n const service = yield this.getService();\n return yield service.retrieveValidToken(AccountServiceEnum_1.default.accessToken);\n });\n }\n /**\n * Retrieves ID token if the user is signed in.\n *\n * @returns ID token or null if not signed in.\n */\n retrieveIdToken() {\n return __awaiter(this, void 0, void 0, function* () {\n const service = yield this.getService();\n return yield service.retrieveValidToken(AccountServiceEnum_1.default.idToken);\n });\n }\n /**\n * Retrieves display name from the ID token.\n * ID token is fetched internally.\n *\n * @returns Display name.\n * @throws ServiceException if ID token does not exist.\n */\n retrieveIdTokenDisplayName() {\n return __awaiter(this, void 0, void 0, function* () {\n const utility = new DexfAccountServiceUtility_1.default();\n const idToken = yield this.retrieveIdToken();\n if (!idToken) {\n throw new exceptions_1.ServiceException('Failed to fetch token for user, cannot retrieve display name.');\n }\n return utility.getIdTokenDisplayName(idToken);\n });\n }\n /**\n * Initiates the user login process.\n *\n * @param silent If true, only checks if the user is logged in without showing login prompt. This can be used at the start-up of the application to get logged in in the background to DEXF without showing the log-in UI.\n * @param state When set the state option will be returned when redirected back to the application after login. This can be used to get the user back to where they were in the application.\n */\n initiateLogin(silent = false, state) {\n return __awaiter(this, void 0, void 0, function* () {\n const service = yield this.getService();\n return yield service.initiateLogin({ silent, state });\n });\n }\n /**\n * Handles the callback by extracting and storing the authorization code.\n */\n handleAuthorizationCallback() {\n return __awaiter(this, void 0, void 0, function* () {\n const storage = new DexfAccountServiceStorage_1.default();\n const code = this.extractCodeFromUrl();\n if (!code) {\n throw new exceptions_1.ServiceException('Failed to fetch code from URL.');\n }\n storage.storeCodeVerifier(code);\n });\n }\n /**\n * Initializes and returns a new instance of DexfAccountService.\n *\n * @returns DexfAccountService instance.\n */\n getService() {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n switch (kompis.serviceSettings.accountDataSource) {\n case enums_1.AccountDataSourceEnum.disabled:\n throw new exceptions_1.ServiceException('The accountDataSource is set to \"disabled\". When it is, the AccountService is not available on the market and the login functionality together with related features, should be hidden or disabled.');\n default:\n return new DexfAccountService_1.default({\n clientId: this.getClientId(),\n authenticationUrl: kompis.endpoints.dexfAccountService,\n accessTokenUrl: kompis.endpoints.dexfAccountServiceAccessTokenUrl,\n redirectUri: this.redirectUri,\n loginOptions: this.loginOptions\n });\n }\n });\n }\n getClientId() {\n return this.settingsSegment && this.settingsSegment !== enums_1.DexfSettingsFilterSegmentEnum.production\n ? `${this.applicationName}.${this.settingsSegment}`\n : this.applicationName;\n }\n /**\n * Extracts the authorization code from the URL.\n *\n * @returns Authorization code or null if not found.\n */\n extractCodeFromUrl() {\n const utility = new DexfAccountServiceUtility_1.default();\n return utility.getCodeSearchParam();\n }\n}\nexports.default = AccountService;\n//# sourceMappingURL=AccountService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst ServiceFetch_1 = __importDefault(require(\"../../utilities/ServiceFetch\"));\n/**\n * This class is used for fetching store availability data.\n */\nclass DexfWebplannerStoreAvailabilityService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.endpoint Endpoint.\n * @param options.dexfApiKey DEXF Api key.\n */\n constructor(options) {\n this.endpoint = options.endpoint;\n this.dexfApiKey = options.dexfApiKey;\n }\n /**\n * Fetches availability for a store id and given application.\n *\n * @param storeId Store ID.\n * @param dexfApplicationId Application id set in DEXF.\n * @returns Promise with IStoreAvailability[].\n */\n getStoreAvailabilities(storeId, dexfApplicationId) {\n return __awaiter(this, void 0, void 0, function* () {\n const options = {\n credentials: 'same-origin',\n headers: {\n 'dexf-api-key': this.dexfApiKey\n }\n };\n const url = `${this.endpoint.replace('{storeId}', encodeURIComponent(storeId.replace(/ /g, '')))}?filter.appId=${dexfApplicationId}`;\n const response = yield ServiceFetch_1.default.json(url, options);\n if (!response.data) {\n throw new exceptions_1.ServiceException('Failed to fetch from DEXF webplanner availability API. No data in response.');\n }\n return this.transformResponse(response);\n });\n }\n /**\n * Transforms the response and returns only valid items.\n *\n * @param response Responses.\n * @param response.data\n * @returns Valid IStoreAvailability items.\n */\n transformResponse(response) {\n const result = [];\n for (const item of response.data) {\n if (item.valid && item.content) {\n const storeAvailability = {\n itemId: item.itemId,\n content: {\n itemType: item.content.itemType,\n itemNo: item.content.itemNo,\n availableForCashCarry: item.content.availableForCashCarry\n }\n };\n if (item.content.cashCarry) {\n storeAvailability.content.cashCarry = {\n messageType: item.content.cashCarry.messageType,\n unitType: item.content.cashCarry.unitType,\n quantity: item.content.cashCarry.quantity,\n restock: item.content.cashCarry.restock,\n salesLocations: item.content.cashCarry.salesLocations\n };\n }\n if (item.content.homeDelivery) {\n storeAvailability.content.homeDelivery = item.content.homeDelivery;\n }\n result.push(storeAvailability);\n }\n }\n return result;\n }\n}\nexports.default = DexfWebplannerStoreAvailabilityService;\n//# sourceMappingURL=DexfWebplannerStoreAvailabilityService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst ServiceFetch_1 = __importDefault(require(\"../../utilities/ServiceFetch\"));\n/**\n * This class is used for fetching store availability data.\n */\nclass DexfWebplannerZipAvailabilityService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.endpoint Endpoint.\n * @param options.dexfApiKey DEXF Api key.\n */\n constructor(options) {\n this.endpoint = options.endpoint;\n this.dexfApiKey = options.dexfApiKey;\n }\n /**\n * Fetches availability for a zip code and given application.\n *\n * @param zipCode Zip Code.\n * @param dexfApplicationId Application id set in DEXF.\n * @returns Promise with IZipAvailability[].\n */\n getZipAvailabilities(zipCode, dexfApplicationId) {\n return __awaiter(this, void 0, void 0, function* () {\n const options = {\n credentials: 'same-origin',\n headers: {\n 'dexf-api-key': this.dexfApiKey\n }\n };\n const url = `${this.endpoint.replace('{zipCode}', encodeURIComponent(zipCode.replace(/ /g, '')))}?filter.appId=${dexfApplicationId}`;\n const response = yield ServiceFetch_1.default.json(url, options);\n if (!response.data) {\n throw new exceptions_1.ServiceException('Failed to fetch from DEXF webplanner availability API. No data in response.');\n }\n return this.transformResponse(response);\n });\n }\n /**\n * Transforms the response and returns only valid items.\n *\n * @param response Responses.\n * @param response.data\n * @returns Valid IZipAvailability items.\n */\n transformResponse(response) {\n const result = [];\n for (const item of response.data) {\n if (item.valid && item.content) {\n const zipAvailability = {\n itemId: item.itemId,\n content: {\n itemType: item.content.itemType,\n itemNo: item.content.itemNo,\n availableForHomeDelivery: item.content.availableForHomeDelivery\n }\n };\n if (item.content.homeDelivery) {\n zipAvailability.content.homeDelivery = {\n messageType: item.content.homeDelivery.messageType,\n quantity: item.content.homeDelivery.quantity\n };\n }\n result.push(zipAvailability);\n }\n }\n return result;\n }\n}\nexports.default = DexfWebplannerZipAvailabilityService;\n//# sourceMappingURL=DexfWebplannerZipAvailabilityService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst DexfWebplannerStoreAvailabilityService_1 = __importDefault(require(\"../../services/store-availability/DexfWebplannerStoreAvailabilityService\"));\nconst DexfWebplannerZipAvailabilityService_1 = __importDefault(require(\"../../services/zip-availability/DexfWebplannerZipAvailabilityService\"));\nconst DexfConfiguration_1 = __importDefault(require(\"../../utilities/DexfConfiguration\"));\n/**\n * This class is used as a simple interface for store availability services.\n */\nclass ApplicationAvailabilityService {\n /**\n * Constructor.\n *\n * @param options Options.\n */\n constructor(options) {\n this.dexfConfiguration = new DexfConfiguration_1.default(options);\n }\n /**\n * Fetches and returns zip code availability.\n *\n * @param zip Zip Code.\n * @param dexfApplicationId Application id set in DEXF.\n * @returns Promise with IZipAvailability[].\n */\n getZipAvailabilities(zip, dexfApplicationId) {\n return __awaiter(this, void 0, void 0, function* () {\n const service = yield this.getZipAvailabilityService();\n return yield service.getZipAvailabilities(zip, dexfApplicationId);\n });\n }\n /**\n * Fetches and returns store availability.\n *\n * @param storeId Store ID.\n * @param dexfApplicationId Application id set in DEXF.\n * @returns Promise with IStoreAvailability[].\n */\n getStoreAvailabilities(storeId, dexfApplicationId) {\n return __awaiter(this, void 0, void 0, function* () {\n const service = yield this.getStoreAvailabilityService();\n return yield service.getStoreAvailabilities(storeId, dexfApplicationId);\n });\n }\n /**\n * Returns DEXF service if the zipAvailabilityDataSource setting for the locale is not set to 'disabled'.\n *\n * @returns Service.\n * @throws ServiceException when zipAvailabilityDataSource is set to disabled.\n */\n getZipAvailabilityService() {\n return __awaiter(this, void 0, void 0, function* () {\n const settings = yield this.dexfConfiguration.getSettings();\n const dexfApiKey = yield this.dexfConfiguration.getDexfApiKeyOrThrow();\n switch (settings.kompis.serviceSettings.zipAvailabilityDataSource) {\n case enums_1.ZipAvailabilityDataSourceEnum.disabled:\n throw new exceptions_1.ServiceException('The zipAvailabilityDataSource is set to \"disabled\". When it is, the ZipAvailabilityService is not available on the market.');\n default:\n return new DexfWebplannerZipAvailabilityService_1.default({\n endpoint: settings.kompis.endpoints.dexfWebplannerZipAvailabilityService,\n dexfApiKey\n });\n }\n });\n }\n /**\n * Returns DEXF service if the storeAvailabilityDataSource setting for the locale is not set to 'disabled'.\n *\n * @returns Service.\n * @throws ServiceException when storeAvailabilityDataSource is set to disabled.\n */\n getStoreAvailabilityService() {\n return __awaiter(this, void 0, void 0, function* () {\n const settings = yield this.dexfConfiguration.getSettings();\n const dexfApiKey = yield this.dexfConfiguration.getDexfApiKeyOrThrow();\n switch (settings.kompis.serviceSettings.storeAvailabilityDataSource) {\n case enums_1.StoreAvailabilityDataSourceEnum.disabled:\n throw new exceptions_1.ServiceException('The storeAvailabilityDataSource is set to \"disabled\". When it is, the StoreAvailabilityService is not available on the market.');\n default:\n return new DexfWebplannerStoreAvailabilityService_1.default({\n endpoint: settings.kompis.endpoints.dexfWebplannerStoreAvailabilityService,\n dexfApiKey\n });\n }\n });\n }\n}\nexports.default = ApplicationAvailabilityService;\n//# sourceMappingURL=ApplicationAvailabilityService.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Item handling utility.\n */\nclass ItemUtility {\n /**\n * Returns an item string to be used in the request URL.\n *\n * @param items Array of items.\n * @returns Item string.\n */\n static getItemsString(items) {\n return items.map((item) => item.type.toUpperCase() + '-' + item.id).join(',');\n }\n /**\n * Returns item sets based on the maximum allowed items per request.\n *\n * @param items Array of items to parse.\n * @param maxItemsPerRequest Maximum items in the request.\n * @returns Product sets.\n */\n static getItemSets(items, maxItemsPerRequest) {\n const sets = [[]];\n let currentSet = sets[0];\n for (let i = 0, max = items.length; i < max; i++) {\n if (currentSet.length === maxItemsPerRequest) {\n currentSet = [];\n sets.push(currentSet);\n }\n if (items[i].id && items[i].type) {\n currentSet.push(items[i]);\n }\n }\n return sets;\n }\n}\nexports.default = ItemUtility;\n//# sourceMappingURL=ItemUtility.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst ItemUtility_1 = __importDefault(require(\"../../utilities/ItemUtility\"));\nconst ServiceFetch_1 = __importDefault(require(\"../../utilities/ServiceFetch\"));\n/**\n * This class is used for fetching assembly services data.\n */\nclass DexfAssemblyServicesService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.endpoint Endpoint.\n * @param options.dexfApiKey DEXF Api key.\n */\n constructor(options) {\n this.maxItemsPerRequest = 50;\n this.endpoint = options.endpoint;\n this.dexfApiKey = options.dexfApiKey;\n }\n /**\n * Fetches assembly services data.\n *\n * @param zipCode Zip Code.\n * @param items Item.\n * @returns Promise.\n */\n getAssemblyServices(zipCode, items) {\n return __awaiter(this, void 0, void 0, function* () {\n const batchRequests = ItemUtility_1.default.getItemSets(items, this.maxItemsPerRequest);\n const options = {\n credentials: 'same-origin',\n headers: {\n 'dexf-api-key': this.dexfApiKey\n }\n };\n const promises = batchRequests.map((set) => {\n const itemId = ItemUtility_1.default.getItemsString(set);\n const url = `${this.endpoint.replace('{zipCode}', encodeURIComponent(zipCode.replace(/ /g, '')))}?filter.itemId=${itemId}`;\n return ServiceFetch_1.default.json(url, options);\n });\n const responses = yield Promise.all(promises);\n return this.transformResponse(responses);\n });\n }\n /**\n * Transforms the response and returns assembly services items.\n *\n * @param responses Array of responses.\n * @returns Valid items.\n */\n transformResponse(responses) {\n const { valid, basePrice, reason } = responses[0].data;\n const assemblyServicesData = Object.assign(Object.assign({ valid: valid }, (basePrice && { basePrice })), (reason && { reason }));\n const assemblyItems = [];\n for (const response of responses) {\n const { items } = response.data;\n if (items) {\n for (const item of items) {\n assemblyItems.push(item);\n }\n }\n }\n if (assemblyItems.length > 0) {\n assemblyServicesData.items = assemblyItems;\n }\n return assemblyServicesData;\n }\n}\nexports.default = DexfAssemblyServicesService;\n//# sourceMappingURL=DexfAssemblyServicesService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst DexfAssemblyServicesService_1 = __importDefault(require(\"../../services/assembly-services/DexfAssemblyServicesService\"));\nconst DexfConfiguration_1 = __importDefault(require(\"../../utilities/DexfConfiguration\"));\n/**\n * This class is used as a simple interface for assembly services service.\n */\nclass AssemblyServicesService {\n /**\n * Constructor.\n *\n * @param options Options.\n */\n constructor(options) {\n this.dexfConfiguration = new DexfConfiguration_1.default(options);\n }\n /**\n * Fetches and returns Assembly service.\n *\n * @param zip Zip Code.\n * @param items Items.\n * @returns Promise.\n */\n getAssemblyServices(zip, items) {\n return __awaiter(this, void 0, void 0, function* () {\n const service = yield this.getAssemblyService();\n return yield service.getAssemblyServices(zip, items);\n });\n }\n /**\n * Returns DEXF service if the assemblyServicesDataSource setting is not set to 'disabled'.\n *\n * @returns Promise with a DexfAssemblyService.\n * @throws { ServiceException } When assemblyServicesDataSource is disabled, or when correct information to fetch data is not supplied.\n */\n getAssemblyService() {\n return __awaiter(this, void 0, void 0, function* () {\n const settings = yield this.dexfConfiguration.getSettings();\n const dexfApiKey = yield this.dexfConfiguration.getDexfApiKeyOrThrow();\n switch (settings.kompis.serviceSettings.assemblyServicesDataSource) {\n case enums_1.AssemblyServicesDataSourceEnum.disabled:\n throw new exceptions_1.ServiceException('The AssemblyServicesDataSource is set to \"disabled\" in the localized information or DexfSettings. When it is, the Assembly services is not available on the market.');\n default:\n return new DexfAssemblyServicesService_1.default({\n endpoint: settings.kompis.endpoints.dexfAssemblyServicesService,\n dexfApiKey: dexfApiKey\n });\n }\n });\n }\n}\nexports.default = AssemblyServicesService;\n//# sourceMappingURL=AssemblyServicesService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst ItemUtility_1 = __importDefault(require(\"../../utilities/ItemUtility\"));\nconst ServiceFetch_1 = __importDefault(require(\"../../utilities/ServiceFetch\"));\n/**\n * This class is used for fetching store availability data.\n */\nclass DexfStoreAvailabilityService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.endpoint Endpoint.\n * @param options.dexfApiKey DEXF Api key.\n */\n constructor(options) {\n this.maxItemsPerRequest = 50;\n this.maxNumProducts = 150;\n this.endpoint = options.endpoint;\n this.dexfApiKey = options.dexfApiKey;\n }\n /**\n * Authenticates and returns user.\n *\n * @param storeId Store ID.\n * @param items Item.\n * @returns Promise.\n */\n getStoreAvailabilities(storeId, items) {\n return __awaiter(this, void 0, void 0, function* () {\n if (items.length > this.maxNumProducts) {\n throw new exceptions_1.ServiceException(`Max number of articles exceeded, ${this.maxNumProducts}. Too many products to be handled by this service. Try using the webplanner service instead.`);\n }\n const sets = ItemUtility_1.default.getItemSets(items, this.maxItemsPerRequest);\n const options = {\n credentials: 'same-origin',\n headers: {\n 'dexf-api-key': this.dexfApiKey\n }\n };\n const promises = sets.map((set) => {\n const itemId = ItemUtility_1.default.getItemsString(set);\n const url = `${this.endpoint.replace('{storeId}', encodeURIComponent(storeId.replace(/ /g, '')))}?filter.itemId=${itemId}`;\n return ServiceFetch_1.default.json(url, options);\n });\n const responses = yield Promise.all(promises);\n return this.transformResponse(responses);\n });\n }\n /**\n * Transforms the response and returns only valid items.\n *\n * @param responses Responses.\n * @param response.data\n * @returns Valid items.\n */\n transformResponse(responses) {\n const result = [];\n for (const response of responses) {\n for (const item of response.data) {\n if (item.valid && item.content) {\n const storeAvailability = {\n itemId: item.itemId,\n content: {\n itemType: item.content.itemType,\n itemNo: item.content.itemNo,\n availableForCashCarry: item.content.availableForCashCarry\n }\n };\n if (item.content.cashCarry) {\n storeAvailability.content.cashCarry = {\n messageType: item.content.cashCarry.messageType,\n unitType: item.content.cashCarry.unitType,\n quantity: item.content.cashCarry.quantity,\n restock: item.content.cashCarry.restock,\n salesLocations: item.content.cashCarry.salesLocations\n };\n if ('inRange' in item.content.cashCarry) {\n storeAvailability.content.cashCarry.inRange = item.content.cashCarry.inRange;\n }\n }\n if (item.content.homeDelivery) {\n storeAvailability.content.homeDelivery = item.content.homeDelivery;\n }\n result.push(storeAvailability);\n }\n }\n }\n return result;\n }\n}\nexports.default = DexfStoreAvailabilityService;\n//# sourceMappingURL=DexfStoreAvailabilityService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst ItemUtility_1 = __importDefault(require(\"../../utilities/ItemUtility\"));\nconst ServiceFetch_1 = __importDefault(require(\"../../utilities/ServiceFetch\"));\n/**\n * This class is used for fetching store availability data.\n */\nclass DexfZipAvailabilityService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.endpoint Endpoint.\n * @param options.dexfApiKey DEXF Api key.\n */\n constructor(options) {\n this.maxItemsPerRequest = 50;\n this.maxNumProducts = 150;\n this.endpoint = options.endpoint;\n this.dexfApiKey = options.dexfApiKey;\n }\n /**\n * Authenticates and returns user.\n *\n * @param zipCode Zip Code.\n * @param items Item.\n * @returns Promise.\n */\n getZipAvailabilities(zipCode, items) {\n return __awaiter(this, void 0, void 0, function* () {\n if (items.length > this.maxNumProducts) {\n throw new exceptions_1.ServiceException(`Max number of articles exceeded, ${this.maxNumProducts}. Too many products to be handled by this service. Try using the webplanner service instead.`);\n }\n const sets = ItemUtility_1.default.getItemSets(items, this.maxItemsPerRequest);\n const options = {\n credentials: 'same-origin',\n headers: {\n 'dexf-api-key': this.dexfApiKey\n }\n };\n const promises = sets.map((set) => {\n const itemId = ItemUtility_1.default.getItemsString(set);\n const url = `${this.endpoint.replace('{zipCode}', encodeURIComponent(zipCode.replace(/ /g, '')))}?filter.itemId=${itemId}`;\n return ServiceFetch_1.default.json(url, options);\n });\n const responses = yield Promise.all(promises);\n return this.transformResponse(responses);\n });\n }\n /**\n * Transforms the response and returns only valid items.\n *\n * @param responses Responses.\n * @param response.data\n * @returns Valid items.\n */\n transformResponse(responses) {\n const result = [];\n for (const response of responses) {\n for (const item of response.data) {\n if (item.valid && item.content) {\n const zipAvailability = {\n itemId: item.itemId,\n content: {\n itemType: item.content.itemType,\n itemNo: item.content.itemNo,\n availableForHomeDelivery: item.content.availableForHomeDelivery\n }\n };\n if (item.content.homeDelivery) {\n zipAvailability.content.homeDelivery = {\n messageType: item.content.homeDelivery.messageType,\n quantity: item.content.homeDelivery.quantity\n };\n }\n result.push(zipAvailability);\n }\n }\n }\n return result;\n }\n}\nexports.default = DexfZipAvailabilityService;\n//# sourceMappingURL=DexfZipAvailabilityService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst DexfStoreAvailabilityService_1 = __importDefault(require(\"../../services/store-availability/DexfStoreAvailabilityService\"));\nconst DexfZipAvailabilityService_1 = __importDefault(require(\"../../services/zip-availability/DexfZipAvailabilityService\"));\nconst DexfConfiguration_1 = __importDefault(require(\"../../utilities/DexfConfiguration\"));\n/**\n * This class is used as a simple interface for store availability services.\n */\nclass CheckoutAvailabilityService {\n /**\n * Constructor.\n *\n * @param options Options.\n */\n constructor(options) {\n this.dexfConfiguration = new DexfConfiguration_1.default(options);\n }\n /**\n * Fetches and returns zip code availability.\n *\n * @param zip Zip Code.\n * @param items Items.\n * @returns Promise.\n */\n getZipAvailabilities(zip, items) {\n return __awaiter(this, void 0, void 0, function* () {\n const service = yield this.getZipAvailabilityService();\n return yield service.getZipAvailabilities(zip, items);\n });\n }\n /**\n * Fetches and returns store availability.\n *\n * @param storeId Store id.\n * @param items Items.\n * @returns Promise.\n */\n getStoreAvailabilities(storeId, items) {\n return __awaiter(this, void 0, void 0, function* () {\n const service = yield this.getStoreAvailabilityService();\n return yield service.getStoreAvailabilities(storeId, items);\n });\n }\n /**\n * Returns DEXF service if the zipAvailabilityDataSource setting\n * for the locale is not set to 'disabled'.\n *\n * @returns Service | null.\n */\n getZipAvailabilityService() {\n return __awaiter(this, void 0, void 0, function* () {\n const settings = yield this.dexfConfiguration.getSettings();\n const dexfApiKey = yield this.dexfConfiguration.getDexfApiKeyOrThrow();\n switch (settings.kompis.serviceSettings.zipAvailabilityDataSource) {\n case enums_1.ZipAvailabilityDataSourceEnum.disabled:\n throw new exceptions_1.ServiceException('The zipAvailabilityDataSource is set to \"disabled\" in the localized information. When it is, the ZipAvailabilityService is not available on the market.');\n default:\n return new DexfZipAvailabilityService_1.default({\n endpoint: settings.kompis.endpoints.dexfZipAvailabilityService,\n dexfApiKey: dexfApiKey\n });\n }\n });\n }\n /**\n * Returns DEXF service if the storeAvailabilityDataSource setting\n * for the locale is not set to 'disabled'.\n *\n * @returns Service | null.\n */\n getStoreAvailabilityService() {\n return __awaiter(this, void 0, void 0, function* () {\n const settings = yield this.dexfConfiguration.getSettings();\n const dexfApiKey = yield this.dexfConfiguration.getDexfApiKeyOrThrow();\n switch (settings.kompis.serviceSettings.storeAvailabilityDataSource) {\n case enums_1.StoreAvailabilityDataSourceEnum.disabled:\n throw new exceptions_1.ServiceException('The storeAvailabilityDataSource is set to \"disabled\" in the localized information. When it is, the StoreAvailabilityService is not available on the market.');\n default:\n return new DexfStoreAvailabilityService_1.default({\n endpoint: settings.kompis.endpoints.dexfStoreAvailabilityService,\n dexfApiKey: dexfApiKey\n });\n }\n });\n }\n}\nexports.default = CheckoutAvailabilityService;\n//# sourceMappingURL=CheckoutAvailabilityService.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst CONNECTION_TIMEOUT = 15000;\n/**\n * Service fetch utility.\n */\nclass IframeManager {\n /**\n * Constructor.\n *\n * @param url Iframe URL.\n * @param cacheStore Cache store.\n */\n constructor(url, cacheStore = new utilities_1.GlobalCacheStore()) {\n this.isConnected = false;\n this.url = url;\n this.cache = cacheStore.getStore('iframeManager');\n }\n /**\n * Connects the iframe.\n *\n * @returns Iframe.\n */\n getIframe() {\n return new Promise((resolve, reject) => {\n const cacheItem = this.cache.get(this.url);\n if (cacheItem) {\n if (!this.isConnected) {\n cacheItem.connectedCount++;\n }\n if (cacheItem.error) {\n reject(cacheItem.error);\n }\n else if (cacheItem.connectionTimeout === null) {\n resolve(cacheItem.iframe);\n }\n else {\n cacheItem.resolves.push(resolve);\n cacheItem.rejects.push(reject);\n }\n }\n else {\n const iframe = document.createElement('iframe');\n const cacheItemDefault = {\n connectedCount: 1,\n iframe,\n connectionTimeout: null,\n resolves: [resolve],\n rejects: [reject],\n error: null\n };\n cacheItemDefault.connectionTimeout = this.getConnectionTimeout(cacheItemDefault);\n this.cache.set(this.url, cacheItemDefault);\n iframe.addEventListener('load', this.onIframeLoad.bind(this, cacheItemDefault));\n iframe.src = this.url;\n iframe.style.display = 'none';\n document.body.appendChild(iframe);\n }\n this.isConnected = true;\n });\n }\n /**\n * Disconnects the iframe.\n */\n disconnect() {\n const cacheItem = this.cache.get(this.url);\n if (cacheItem) {\n cacheItem.connectedCount--;\n if (cacheItem.connectedCount === 0) {\n cacheItem.connectionTimeout && clearTimeout(cacheItem.connectionTimeout);\n document.body.removeChild(cacheItem.iframe);\n this.cache.delete(this.url);\n }\n }\n this.isConnected = false;\n }\n /**\n * Triggered on iframe load.\n *\n * @param cacheItem Cache item.\n */\n onIframeLoad(cacheItem) {\n cacheItem.connectionTimeout && clearTimeout(cacheItem.connectionTimeout);\n cacheItem.connectionTimeout = null;\n if (cacheItem.iframe.contentWindow) {\n const resolves = cacheItem.resolves;\n cacheItem.resolves = [];\n for (const resolve of resolves) {\n resolve(cacheItem.iframe);\n }\n }\n else {\n const rejects = cacheItem.rejects;\n cacheItem.error = new exceptions_1.ServiceException('Failed to load iframe. Missing access to iframe.contentWindow.');\n cacheItem.rejects = [];\n for (const reject of rejects) {\n reject(cacheItem.error);\n }\n }\n }\n /**\n * Returns a timeout.\n *\n * @param cacheItem Cache item.\n * @returns Timeout.\n */\n getConnectionTimeout(cacheItem) {\n return setTimeout(() => {\n const rejects = cacheItem.rejects;\n cacheItem.error = new exceptions_1.ServiceException('Failed to load iframe. Request timed out. Connection problems?');\n cacheItem.rejects = [];\n for (const reject of rejects) {\n reject(cacheItem.error);\n }\n }, CONNECTION_TIMEOUT);\n }\n}\nexports.default = IframeManager;\n//# sourceMappingURL=IframeManager.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst IframeManager_1 = __importDefault(require(\"../../utilities/IframeManager\"));\nconst COOKIE_NAME = 'ikea_cookieconsent_{countryCode}';\n/**\n * This class is used for checking cookie consent.\n */\nclass OneWebCookieConsentService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.locale Locale.\n * @param options.endpoint Endpoint.\n * @param options.cache Cache store.\n */\n constructor(options) {\n this.iframeManager = null;\n this.endpoint = options.endpoint;\n this.cache = options.cache;\n }\n /**\n * Checks if cookie consent meets a provided level.\n *\n * @param consentLevel Consent level (1-4).\n * @param country Country of the cookie.\n * @returns Promise.\n */\n hasCookieConsent(consentLevel, country) {\n var _a, _b, _c;\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof ((_b = (_a = window['ikea']) === null || _a === void 0 ? void 0 : _a.cookieConsent) === null || _b === void 0 ? void 0 : _b.hasConsent) === 'function') {\n return window['ikea'].cookieConsent.hasConsent(consentLevel);\n }\n const cookie = this.getCookie(country);\n if (cookie) {\n return !!Object.values(cookie)[Object.keys(cookie).indexOf(consentLevel.toString())];\n }\n if (this.iframeManager && this.iframeManager.url !== this.endpoint) {\n this.iframeManager.disconnect();\n this.iframeManager = null;\n }\n if (!this.iframeManager) {\n this.iframeManager = new IframeManager_1.default(this.endpoint, this.cache);\n }\n const iframe = yield this.iframeManager.getIframe();\n if (!((_c = iframe.contentWindow) === null || _c === void 0 ? void 0 : _c['ikea']) ||\n !iframe.contentWindow['ikea'].cookieConsent ||\n !iframe.contentWindow['ikea'].cookieConsent.hasConsent) {\n throw new exceptions_1.ServiceException('Failed to retrieve cookie consent from iframe. \"ikea.cookieConsent.hasConsent()\" is not defined.');\n }\n return iframe.contentWindow['ikea'].cookieConsent.hasConsent(consentLevel);\n });\n }\n /**\n * @param country Country.\n */\n getCookie(country) {\n const cookieName = COOKIE_NAME.replace('{countryCode}', country.toLowerCase()) + '=';\n const decodedCookie = decodeURIComponent(document.cookie);\n const existingCookies = decodedCookie.split(';');\n for (let cookie of existingCookies) {\n while (cookie.charAt(0) == ' ') {\n cookie = cookie.substring(1);\n }\n if (cookie.indexOf(cookieName) == 0) {\n return JSON.parse(cookie.substring(cookieName.length, cookie.length));\n }\n }\n return null;\n }\n}\nexports.default = OneWebCookieConsentService;\n//# sourceMappingURL=OneWebCookieConsentService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst OneWebCookieConsentService_1 = __importDefault(require(\"../../services/cookie-consent/OneWebCookieConsentService\"));\nconst DexfConfiguration_1 = __importDefault(require(\"../../utilities/DexfConfiguration\"));\n/**\n * This class is used as a simple interface for cookie consent services.\n */\nclass CookieConsentService {\n /**\n * Constructor.\n *\n * @param options Localization service options or a localized information object.\n */\n constructor(options) {\n var _a;\n this.localizedInformation = null;\n if ('localizedServiceOptions' in options) {\n this.localizedInformation = (_a = options.localizedServiceOptions) !== null && _a !== void 0 ? _a : null;\n }\n else {\n this.dexfConfiguration = new DexfConfiguration_1.default(options);\n }\n if ('cache' in options && options.cache) {\n this.cache = options.cache;\n }\n else {\n this.cache = new utilities_1.GlobalCacheStore();\n }\n this.locale = options.locale;\n }\n /**\n * Checks if cookie consent meets a provided level.\n *\n * @param consentLevel Consent level (1-4).\n * @returns Promise.\n */\n hasCookieConsent(consentLevel) {\n return __awaiter(this, void 0, void 0, function* () {\n const localizedInformation = yield this.getLocalizedInformation();\n const cookieConsentDataSource = localizedInformation.localization.cookieConsentDataSource;\n if (cookieConsentDataSource === enums_1.CookieConsentDataSourceEnum.disabled) {\n return true;\n }\n else if (cookieConsentDataSource !== enums_1.CookieConsentDataSourceEnum.oneWeb) {\n return false;\n }\n const service = new OneWebCookieConsentService_1.default({\n endpoint: localizedInformation.endpoints.oneWebCookieConsentService,\n cache: this.cache\n });\n const country = utilities_1.LocaleUtility.getCountryAndLanguage(this.locale).country;\n if (!country) {\n throw new exceptions_1.ServiceException(`Locale does not contain country. Bad format: ${this.locale}`);\n }\n return yield service.hasCookieConsent(consentLevel, country);\n });\n }\n /**\n *\n * @returns Get either the provided localized information or fetch a new/cached one using localization service options.\n */\n getLocalizedInformation() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.localizedInformation) {\n return this.localizedInformation;\n }\n const settings = yield this.dexfConfiguration.getSettings();\n return {\n localization: {\n cookieConsentDataSource: settings.kompis.serviceSettings.cookieConsentDataSource\n },\n endpoints: {\n oneWebCookieConsentService: settings.kompis.endpoints.oneWebCookieConsentService\n }\n };\n });\n }\n}\nexports.default = CookieConsentService;\n//# sourceMappingURL=CookieConsentService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst IframeManager_1 = __importDefault(require(\"../../utilities/IframeManager\"));\n/**\n * This class is used for setting and getting store id.\n *\n * When the INGKA Javascript API is available on the same page, we can use it directly.\n * This is the case when the footer fragment from INGKA is included using ESI include, or if INGKA includes the planner directly on the page using ESI include.\n *\n * When a planner is running under /addon-app/, it is not possible to include the footer fragment from INGKA as we are not under a retail unit path (e.g. /gb/en/).\n * Then we can use an iframe with a URL that contains a retail unit path to load the INGKA Javascript API.\n */\nclass OneWebStoreIdCookieInformationService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.locale Locale.\n * @param options.endpoint Endpoint.\n * @param options.cacheStore Cache store.\n */\n constructor(options) {\n this.endpoint = options.endpoint;\n this.cacheStore = options.cacheStore;\n }\n /**\n * Returns store id.\n *\n * @returns Store id.\n */\n getStoreId() {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n if ((_b = (_a = window['ikea']) === null || _a === void 0 ? void 0 : _a.store) === null || _b === void 0 ? void 0 : _b.get) {\n return yield this.getIngkaApi(window).get();\n }\n const iframe = yield this.getIframe();\n return yield this.getIngkaApi(iframe.contentWindow).get();\n });\n }\n /**\n * Sets store id.\n *\n * @param storeId Store id.\n */\n setStoreId(storeId) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n if (!storeId) {\n return yield this.clearStoreId();\n }\n if ((_b = (_a = window['ikea']) === null || _a === void 0 ? void 0 : _a.store) === null || _b === void 0 ? void 0 : _b.set) {\n yield this.getIngkaApi(window).set(storeId);\n return;\n }\n const iframe = yield this.getIframe();\n yield this.getIngkaApi(iframe.contentWindow).set(storeId);\n });\n }\n /**\n * Clears store id.\n */\n clearStoreId() {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n if ((_b = (_a = window['ikea']) === null || _a === void 0 ? void 0 : _a.store) === null || _b === void 0 ? void 0 : _b.clear) {\n yield this.getIngkaApi(window).clear();\n return;\n }\n const iframe = yield this.getIframe();\n yield this.getIngkaApi(iframe.contentWindow).clear();\n });\n }\n /**\n * Returns INGKA store Javascript API.\n *\n * @param targetWindow Window.\n * @returns INGKA API.\n */\n getIngkaApi(targetWindow) {\n var _a;\n if (!((_a = targetWindow['ikea']) === null || _a === void 0 ? void 0 : _a.store)) {\n throw new exceptions_1.ServiceException('Failed to retrieve store API. \"ikea.store\" is not defined.');\n }\n return targetWindow['ikea'].store;\n }\n /**\n * Returns iframe element.\n *\n * @returns Iframe.\n */\n getIframe() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.iframeManager && this.iframeManager.url !== this.endpoint) {\n this.iframeManager.disconnect();\n this.iframeManager = null;\n }\n if (!this.iframeManager) {\n this.iframeManager = new IframeManager_1.default(this.endpoint, this.cacheStore);\n }\n return yield this.iframeManager.getIframe();\n });\n }\n}\nexports.default = OneWebStoreIdCookieInformationService;\n//# sourceMappingURL=OneWebStoreIdCookieInformationService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst IframeManager_1 = __importDefault(require(\"../../utilities/IframeManager\"));\n/**\n * This class is used for setting and getting zip code.\n *\n * When the INGKA Javascript API is available on the same page, we can use it directly.\n * This is the case when the footer fragment from INGKA is included using ESI include, or if INGKA includes the planner directly on the page using ESI include.\n *\n * When a planner is running under /addon-app/, it is not possible to include the footer fragment from INGKA as we are not under a retail unit path (e.g. /gb/en/).\n * Then we can use an iframe with a URL that contains a retail unit path to load the INGKA Javascript API.\n */\nclass OneWebZipCodeCookieInformationService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.locale Locale.\n * @param options.endpoint Endpoint.\n * @param options.cacheStore Cache store.\n */\n constructor(options) {\n this.endpoint = options.endpoint;\n this.cacheStore = options.cacheStore;\n }\n /**\n * Returns zip code.\n *\n * @returns Zip code.\n */\n getZipCode() {\n var _a, _b, _c, _d;\n return __awaiter(this, void 0, void 0, function* () {\n if ((_b = (_a = window['ikea']) === null || _a === void 0 ? void 0 : _a.postalCode) === null || _b === void 0 ? void 0 : _b.get) {\n return ((_c = (yield this.getIngkaApi(window).get())) === null || _c === void 0 ? void 0 : _c.postalCode) || null;\n }\n const iframe = yield this.getIframe();\n return ((_d = (yield this.getIngkaApi(iframe.contentWindow).get())) === null || _d === void 0 ? void 0 : _d.postalCode) || null;\n });\n }\n /**\n * Sets zip code.\n *\n * @param zipCode Zip code.\n */\n setZipCode(zipCode) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n if (!zipCode) {\n return yield this.clearZipCode();\n }\n if ((_b = (_a = window['ikea']) === null || _a === void 0 ? void 0 : _a.postalCode) === null || _b === void 0 ? void 0 : _b.set) {\n yield this.getIngkaApi(window).set({ postalCode: zipCode, source: 'NAV' });\n return;\n }\n const iframe = yield this.getIframe();\n yield this.getIngkaApi(iframe.contentWindow).set({\n postalCode: zipCode,\n source: 'NAV'\n });\n });\n }\n /**\n * Clears zip code.\n */\n clearZipCode() {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n if ((_b = (_a = window['ikea']) === null || _a === void 0 ? void 0 : _a.postalCode) === null || _b === void 0 ? void 0 : _b.clear) {\n yield this.getIngkaApi(window).clear();\n return;\n }\n const iframe = yield this.getIframe();\n yield this.getIngkaApi(iframe.contentWindow).clear();\n });\n }\n /**\n * Returns INGKA store Javascript API.\n *\n * @param targetWindow Window.\n * @returns INGKA API.\n */\n getIngkaApi(targetWindow) {\n var _a;\n if (!((_a = targetWindow['ikea']) === null || _a === void 0 ? void 0 : _a.postalCode)) {\n throw new exceptions_1.ServiceException('Failed to retrieve zip code API. \"ikea.postalCode\" is not defined.');\n }\n return targetWindow['ikea'].postalCode;\n }\n /**\n * Returns iframe element.\n *\n * @returns Iframe.\n */\n getIframe() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.iframeManager && this.iframeManager.url !== this.endpoint) {\n this.iframeManager.disconnect();\n this.iframeManager = null;\n }\n if (!this.iframeManager) {\n this.iframeManager = new IframeManager_1.default(this.endpoint, this.cacheStore);\n }\n return yield this.iframeManager.getIframe();\n });\n }\n}\nexports.default = OneWebZipCodeCookieInformationService;\n//# sourceMappingURL=OneWebZipCodeCookieInformationService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst OneWebStoreIdCookieInformationService_1 = __importDefault(require(\"../../services/cookie-information/OneWebStoreIdCookieInformationService\"));\nconst OneWebZipCodeCookieInformationService_1 = __importDefault(require(\"../../services/cookie-information/OneWebZipCodeCookieInformationService\"));\nconst DexfConfiguration_1 = __importDefault(require(\"../../utilities/DexfConfiguration\"));\n/**\n * This class is used as a simple interface for cookie consent services.\n *\n * @deprecated Use OneWebStoreIdCookieInformationService or OneWebZipCodeCookieInformationService instead.\n */\nclass CookieInformationService {\n /**\n * Constructor.\n *\n * @param options Options.\n */\n constructor(options) {\n this.dexfConfiguration = new DexfConfiguration_1.default(options);\n this.cache = options.cache || new utilities_1.GlobalCacheStore();\n }\n /**\n * Fetches and returns store id selected by the user on the web.\n *\n * @returns Promise with store id.\n */\n getStoreId() {\n return __awaiter(this, void 0, void 0, function* () {\n const service = yield this.getStoreIdService();\n return yield service.getStoreId();\n });\n }\n /**\n * Fetches and returns zip code set by the user on the web.\n *\n * @returns Promise with store id.\n */\n getZipCode() {\n return __awaiter(this, void 0, void 0, function* () {\n const service = yield this.getZipCodeService();\n return yield service.getZipCode();\n });\n }\n /**\n * Returns service.\n *\n * @returns Service.\n */\n getStoreIdService() {\n return __awaiter(this, void 0, void 0, function* () {\n const settings = yield this.dexfConfiguration.getSettings();\n if (settings.kompis.serviceSettings.cookieInformationDataSource ===\n enums_1.CookieInformationDataSourceEnum.disabled) {\n throw new exceptions_1.ServiceException(`The cookieInformationDataSource is set to \"Disabled\". When it is, it is not possible to fetch the cookie information on the market.`);\n }\n return new OneWebStoreIdCookieInformationService_1.default({\n endpoint: settings.kompis.endpoints.oneWebCookieInformationService,\n cacheStore: this.cache\n });\n });\n }\n /**\n * Returns service.\n *\n * @returns Service.\n */\n getZipCodeService() {\n return __awaiter(this, void 0, void 0, function* () {\n const settings = yield this.dexfConfiguration.getSettings();\n if (settings.kompis.serviceSettings.cookieInformationDataSource ===\n enums_1.CookieInformationDataSourceEnum.disabled) {\n throw new exceptions_1.ServiceException(`The cookieInformationDataSource is set to \"Disabled\". When it is, it is not possible to fetch the cookie information on the market.`);\n }\n return new OneWebZipCodeCookieInformationService_1.default({\n endpoint: settings.kompis.endpoints.oneWebCookieInformationService,\n cacheStore: this.cache\n });\n });\n }\n}\nexports.default = CookieInformationService;\n//# sourceMappingURL=CookieInformationService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst OneWebStoreIdCookieInformationService_1 = __importDefault(require(\"../../services/cookie-information/OneWebStoreIdCookieInformationService\"));\nconst DexfConfiguration_1 = __importDefault(require(\"../../utilities/DexfConfiguration\"));\nconst SUBSCRIBE_CHECK_INTERVAL = 500;\nconst CACHES_STORE_NAME = 'storeIdCookieInformationService';\nconst CACHE_KEY = {\n storeId: 'storeId',\n listeners: 'listeners',\n globalListenerConnected: 'globalListenerConnected',\n globalListenerInterval: 'globalListenerInterval'\n};\n/**\n * This class is used as a simple interface for store id cookie information services.\n */\nclass StoreIdCookieInformationService {\n /**\n * Constructor.\n *\n * @param options Options.\n */\n constructor(options) {\n this.service = null;\n this.dexfConfiguration = new DexfConfiguration_1.default(options);\n this.cacheStore = options.cache || new utilities_1.GlobalCacheStore();\n this.cache = this.cacheStore.getStore(CACHES_STORE_NAME);\n }\n /**\n * Fetches and returns store id.\n *\n * @returns Store id.\n */\n getStoreId() {\n return __awaiter(this, void 0, void 0, function* () {\n const service = yield this.getService();\n if (service) {\n return yield service.getStoreId();\n }\n return this.cache.get(CACHE_KEY.storeId) || null;\n });\n }\n /**\n * Sets store id.\n *\n * @param storeId Store id.\n */\n setStoreId(storeId) {\n return __awaiter(this, void 0, void 0, function* () {\n this.publish(storeId);\n const service = yield this.getService();\n if (service) {\n yield service.setStoreId(storeId);\n }\n });\n }\n /**\n * Clears store id.\n */\n clearStoreId() {\n return __awaiter(this, void 0, void 0, function* () {\n this.publish(null);\n const service = yield this.getService();\n if (service) {\n yield service.clearStoreId();\n }\n });\n }\n /**\n * Subscribes to store id changes.\n *\n * @param listener Listener.\n */\n subscribe(listener) {\n if (!this.cache.has(CACHE_KEY.listeners)) {\n this.cache.set(CACHE_KEY.listeners, []);\n }\n const listeners = this.cache.get(CACHE_KEY.listeners);\n listeners.push(listener);\n this.connectGlobalListener();\n }\n /**\n * Subscribes to store id changes.\n *\n * @param listener Listener.\n */\n unsubscribe(listener) {\n const listeners = this.cache.get(CACHE_KEY.listeners) || [];\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n if (listeners.length === 0) {\n this.disconnectGlobalListener();\n }\n }\n /**\n * Notifies subscribers.\n *\n * @param newStoreId New store id.\n */\n publish(newStoreId) {\n const storeId = this.cache.get(CACHE_KEY.storeId);\n if ((newStoreId !== null && newStoreId !== void 0 ? newStoreId : '') !== (storeId !== null && storeId !== void 0 ? storeId : '')) {\n const listeners = this.cache.get(CACHE_KEY.listeners) || [];\n this.cache.set(CACHE_KEY.storeId, newStoreId);\n for (const listener of listeners) {\n listener(newStoreId);\n }\n }\n }\n /**\n * Connects global listener.\n */\n connectGlobalListener() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.cache.get(CACHE_KEY.globalListenerConnected)) {\n return;\n }\n this.cache.set(CACHE_KEY.globalListenerConnected, true);\n // Only necessary to use interval if we are using the OneWebStoreIdCookieInformationService.\n if (!(yield this.getService())) {\n return;\n }\n const storeId = yield this.getStoreId();\n this.cache.set(CACHE_KEY.storeId, storeId);\n // We need to check again as the connected state might have changed while waiting for the store id.\n if (!this.cache.get(CACHE_KEY.globalListenerConnected)) {\n return;\n }\n this.cache.set(CACHE_KEY.globalListenerInterval, setInterval(() => __awaiter(this, void 0, void 0, function* () {\n const newStoreId = yield this.getStoreId();\n this.publish(newStoreId);\n }), SUBSCRIBE_CHECK_INTERVAL));\n });\n }\n /**\n * Disconnects global listener.\n */\n disconnectGlobalListener() {\n if (!this.cache.get(CACHE_KEY.globalListenerConnected)) {\n return;\n }\n this.cache.set(CACHE_KEY.globalListenerConnected, false);\n if (this.cache.get(CACHE_KEY.globalListenerInterval)) {\n clearInterval(this.cache.get(CACHE_KEY.globalListenerInterval));\n this.cache.set(CACHE_KEY.globalListenerInterval, null);\n }\n }\n /**\n * Returns service.\n *\n * @returns Service.\n */\n getService() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.service) {\n return this.service;\n }\n const settings = yield this.dexfConfiguration.getSettings();\n if (settings.kompis.serviceSettings.cookieInformationDataSource ===\n enums_1.CookieInformationDataSourceEnum.disabled) {\n return null;\n }\n this.service = new OneWebStoreIdCookieInformationService_1.default({\n endpoint: settings.kompis.endpoints.oneWebCookieInformationService,\n cacheStore: this.cacheStore\n });\n return this.service;\n });\n }\n}\nexports.default = StoreIdCookieInformationService;\n//# sourceMappingURL=StoreIdCookieInformationService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst OneWebZipCodeCookieInformationService_1 = __importDefault(require(\"../../services/cookie-information/OneWebZipCodeCookieInformationService\"));\nconst DexfConfiguration_1 = __importDefault(require(\"../../utilities/DexfConfiguration\"));\nconst SUBSCRIBE_CHECK_INTERVAL = 500;\nconst CACHES_STORE_NAME = 'zipCodeCookieInformationService';\nconst CACHE_KEY = {\n zipCode: 'zipCode',\n listeners: 'listeners',\n globalListenerConnected: 'globalListenerConnected',\n globalListenerInterval: 'globalListenerInterval'\n};\n/**\n * This class is used as a simple interface for zip code cookie information services.\n */\nclass ZipCodeCookieInformationService {\n /**\n * Constructor.\n *\n * @param options Options.\n */\n constructor(options) {\n this.service = null;\n this.dexfConfiguration = new DexfConfiguration_1.default(options);\n this.cacheStore = options.cache || new utilities_1.GlobalCacheStore();\n this.cache = this.cacheStore.getStore(CACHES_STORE_NAME);\n }\n /**\n * Fetches and returns zip code.\n *\n * @returns Zip code.\n */\n getZipCode() {\n return __awaiter(this, void 0, void 0, function* () {\n const service = yield this.getService();\n if (service) {\n return yield service.getZipCode();\n }\n return this.cache.get(CACHE_KEY.zipCode) || null;\n });\n }\n /**\n * Sets zip code.\n *\n * @param zipCode Zip code.\n */\n setZipCode(zipCode) {\n return __awaiter(this, void 0, void 0, function* () {\n this.publish(zipCode);\n const service = yield this.getService();\n if (service) {\n yield service.setZipCode(zipCode);\n }\n });\n }\n /**\n * Clears zip code.\n */\n clearZipCode() {\n return __awaiter(this, void 0, void 0, function* () {\n this.publish(null);\n const service = yield this.getService();\n if (service) {\n yield service.clearZipCode();\n }\n });\n }\n /**\n * Subscribes to zip code changes.\n *\n * @param listener Listener.\n */\n subscribe(listener) {\n if (!this.cache.has(CACHE_KEY.listeners)) {\n this.cache.set(CACHE_KEY.listeners, []);\n }\n const listeners = this.cache.get(CACHE_KEY.listeners);\n listeners.push(listener);\n this.connectGlobalListener();\n }\n /**\n * Subscribes to zip code changes.\n *\n * @param listener Listener.\n */\n unsubscribe(listener) {\n const listeners = this.cache.get(CACHE_KEY.listeners) || [];\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n if (listeners.length === 0) {\n this.disconnectGlobalListener();\n }\n }\n /**\n * Notifies subscribers.\n *\n * @param newZipCode New zip code.\n */\n publish(newZipCode) {\n const zipCode = this.cache.get(CACHE_KEY.zipCode);\n // Empty string and null are considered the same value.\n if ((newZipCode !== null && newZipCode !== void 0 ? newZipCode : '') !== (zipCode !== null && zipCode !== void 0 ? zipCode : '')) {\n const listeners = this.cache.get(CACHE_KEY.listeners) || [];\n this.cache.set(CACHE_KEY.zipCode, newZipCode);\n for (const listener of listeners) {\n listener(newZipCode);\n }\n }\n }\n /**\n * Connects global listener.\n */\n connectGlobalListener() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.cache.get(CACHE_KEY.globalListenerConnected)) {\n return;\n }\n this.cache.set(CACHE_KEY.globalListenerConnected, true);\n // Only necessary to use interval if we are using the OneWebZipCodeCookieInformationService.\n if (!(yield this.getService())) {\n return;\n }\n const zipCode = yield this.getZipCode();\n this.cache.set(CACHE_KEY.zipCode, zipCode);\n // We need to check again as the connected state might have changed while waiting for the zip code.\n if (!this.cache.get(CACHE_KEY.globalListenerConnected)) {\n return;\n }\n this.cache.set(CACHE_KEY.globalListenerInterval, setInterval(() => __awaiter(this, void 0, void 0, function* () {\n const newZipCode = yield this.getZipCode();\n this.publish(newZipCode);\n }), SUBSCRIBE_CHECK_INTERVAL));\n });\n }\n /**\n * Disconnects global listener.\n */\n disconnectGlobalListener() {\n if (!this.cache.get(CACHE_KEY.globalListenerConnected)) {\n return;\n }\n this.cache.set(CACHE_KEY.globalListenerConnected, false);\n if (this.cache.get(CACHE_KEY.globalListenerInterval)) {\n clearInterval(this.cache.get(CACHE_KEY.globalListenerInterval));\n this.cache.set(CACHE_KEY.globalListenerInterval, null);\n }\n }\n /**\n * Returns service.\n *\n * @returns Service.\n */\n getService() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.service) {\n return this.service;\n }\n const settings = yield this.dexfConfiguration.getSettings();\n if (settings.kompis.serviceSettings.cookieInformationDataSource ===\n enums_1.CookieInformationDataSourceEnum.disabled) {\n return null;\n }\n this.service = new OneWebZipCodeCookieInformationService_1.default({\n endpoint: settings.kompis.endpoints.oneWebCookieInformationService,\n cacheStore: this.cacheStore\n });\n return this.service;\n });\n }\n}\nexports.default = ZipCodeCookieInformationService;\n//# sourceMappingURL=ZipCodeCookieInformationService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst ServiceFetch_1 = __importDefault(require(\"../../utilities/ServiceFetch\"));\n/**\n * OneWeb financing service.\n */\nclass OneWebFinancingService {\n /**\n * @param endpoint The endpoint to the API.\n * @param fragmentLocationBaseUrl The base URL of the fragment content location, needed for proxy server.\n * @param price The price of the solution.\n * @returns Promise of financing option.\n * @throws ServiceException if price is negative or if any part of the fetched financing option data is invalid.\n * @throws ServerErrorResponseException if API endpoint is not found or if fetch to API endpoint fails.\n */\n getFinancingOption(endpoint, fragmentLocationBaseUrl, price) {\n return __awaiter(this, void 0, void 0, function* () {\n if (price < 0) {\n throw new exceptions_1.ServiceException('Negative price.');\n }\n const priceWithTwoDecimals = price.toFixed(2);\n const endpointWithPrice = `${endpoint.replace('{totalPrice}', priceWithTwoDecimals)}`;\n const response = yield fetch(endpointWithPrice);\n this.validateResponse(response);\n const data = yield response.json();\n const { anchor, anchorLink, fragmentLocation, moreInfoAnchor, moreInfoLink } = this.getValidFinancingOptionData(data);\n const content = yield this.fetchFragmentContent(fragmentLocation, fragmentLocationBaseUrl);\n const financingOption = {\n anchor,\n anchorLink,\n content,\n moreInfoAnchor,\n moreInfoLink\n };\n return financingOption;\n });\n }\n /**\n * Validate the reponse.\n *\n * @param response The response from INGKA financing service API.\n */\n validateResponse(response) {\n if (response.status === 404) {\n throw new exceptions_1.ServerErrorResponseException(response, 'There was no financing option available for the market.');\n }\n if (!response.ok) {\n throw new exceptions_1.ServerErrorResponseException(response, 'Something went wrong when fetching from Ingka financing service.');\n }\n }\n /**\n * Get the validated financing option data.\n *\n * @param data Unvalidated JSON data from the external API, in camel case format.\n * @param data.anchor Anchor text used for button/link.\n * @param data.anchor_link Optional anchor link for anchor.\n * @param data.fragment_location URL to fragment.\n * @param data.read_more_anchor Anchor text for \"read more\" link.\n * @param data.read_more_link Link used as href when read_more_anchor is clicked.\n */\n getValidFinancingOptionData(data) {\n var _a;\n return {\n anchor: this.getValidatedPropWithLength(data.anchor, 'anchor'),\n anchorLink: (_a = data.anchor_link) !== null && _a !== void 0 ? _a : null,\n fragmentLocation: this.getValidatedPropWithLength(data.fragment_location, 'fragment_location'),\n moreInfoAnchor: this.getValidatedPropWithLength(data.read_more_anchor, 'read_more_anchor'),\n moreInfoLink: this.getValidatedPropWithLength(data.read_more_link, 'read_more_link')\n };\n }\n /**\n * @param prop The prop to validate.\n * @param propName The name of the property.\n * @returns The validated prop if valid.\n * @throws ServiceException if invalid prop.\n */\n getValidatedPropWithLength(prop, propName) {\n if (prop === null || prop === void 0 ? void 0 : prop.length) {\n return prop;\n }\n throw new exceptions_1.ServiceException(`Invalid financing option. Missing ${propName} or it is empty.`);\n }\n /**\n * @param fragmentLocation The fragment location.\n * @param fragmentLocationBaseUrl The base URL of the fragment content location, needed for proxy server.\n * @returns The HTML content of the fragment as text.\n */\n fetchFragmentContent(fragmentLocation, fragmentLocationBaseUrl) {\n return __awaiter(this, void 0, void 0, function* () {\n const updatedFragmentLocation = fragmentLocation.replace('https://www.ikea.com', fragmentLocationBaseUrl);\n const content = yield ServiceFetch_1.default.text(updatedFragmentLocation);\n if (!(content === null || content === void 0 ? void 0 : content.length)) {\n throw new exceptions_1.ServiceException('No fragment content found.');\n }\n return content;\n });\n }\n}\nexports.default = OneWebFinancingService;\n//# sourceMappingURL=OneWebFinancingService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst OneWebFinancingService_1 = __importDefault(require(\"../../services/financing/OneWebFinancingService\"));\nconst DexfConfiguration_1 = __importDefault(require(\"../../utilities/DexfConfiguration\"));\n/**\n * Financing service used to fetch a financing option for a customer's solution.\n */\nclass FinancingService {\n /**\n * Constructor.\n *\n * @param options IFinancingServiceOptions.\n */\n constructor(options) {\n this.dexfConfiguration = new DexfConfiguration_1.default(options);\n }\n /**\n * Fetches and returns financial services data.\n *\n * @param shoppingProducts The shopping products of the current solution.\n * @returns Promise of financing option, or null if not supported by the market.\n * @throws Different errors if fetching financing option fails in some way (see {@link OneWebFinancingService.getFinancingOption}).\n */\n getFinancingOption(shoppingProducts) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const settings = yield this.dexfConfiguration.getSettings();\n if (settings.kompis.serviceSettings.financingOptionDataSource ===\n enums_1.FinancingOptionDataSourceEnum.disabled) {\n return null;\n }\n const price = utilities_1.TotalPriceCalculator.calculate(shoppingProducts, settings.localisation.dateFormat);\n return yield new OneWebFinancingService_1.default().getFinancingOption(settings.kompis.endpoints.oneWebFinancingService, (_a = settings.kompis.endpoints.oneWebFinancingServiceFragmentBaseUrl) !== null && _a !== void 0 ? _a : '', utilities_1.PriceUtility.getPrice(price));\n });\n }\n}\nexports.default = FinancingService;\n//# sourceMappingURL=FinancingService.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst CacheStoreType_1 = __importDefault(require(\"../../enums/CacheStoreType\"));\nconst OversattaTransformer_1 = __importDefault(require(\"../../services/localization/OversattaTransformer\"));\n/**\n * This class is used for migrating from Kompis 1.0 to Kompis 2.0.\n */\nclass LocalizationServiceKompis1Migration {\n /**\n * Constructor.\n *\n * @param options Options.\n */\n constructor(options) {\n this.localizationPrefixApplication = options.localizationPrefixApplication;\n this.localizationEndpoints = options.localizationEndpoints;\n this.localizationOverrides = options.localizationOverrides;\n this.locale = options.locale;\n this.cache = options.cache || new utilities_1.GlobalCacheStore();\n }\n /**\n * Sets Kompis 1.0 Översätta data to cache.\n *\n * @param localizedInformation Localized information in Kompis 1.0 format.\n */\n setLocalizedInformationToCache(localizedInformation) {\n const endpointsCacheKey = JSON.stringify(this.localizationEndpoints);\n const overridesCacheKey = this.localizationOverrides\n ? JSON.stringify(this.localizationOverrides)\n : '';\n const localizedCacheKey = this.locale + endpointsCacheKey + overridesCacheKey;\n const cacheStore = this.cache.getStore(CacheStoreType_1.default.localization);\n const transformer = new OversattaTransformer_1.default({\n localizationPrefixApplication: this.localizationPrefixApplication,\n locale: this.locale\n });\n cacheStore.set(localizedCacheKey, transformer.transform(localizedInformation));\n }\n}\nexports.default = LocalizationServiceKompis1Migration;\n//# sourceMappingURL=LocalizationServiceKompis1Migration.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\n/**\n * This class is used for transforming data from DEXF Settings.\n */\nclass DexfSettingsTransformer {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.locale Locale.\n */\n constructor(options) {\n this.locale = options.locale;\n }\n /**\n * Transforms data into a DexfSettings model.\n *\n * @param data Response data to parse.\n * @param dexfApiKey\n * @returns IDexfSettings model.\n */\n transform(data) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\n const storeId = ((_b = (_a = data.kompis) === null || _a === void 0 ? void 0 : _a.localization) === null || _b === void 0 ? void 0 : _b.storeId) ? data.kompis.localization.storeId : null;\n const langId = ((_d = (_c = data.kompis) === null || _c === void 0 ? void 0 : _c.localization) === null || _d === void 0 ? void 0 : _d.langId) ? data.kompis.localization.langId : null;\n const dexfSettings = {\n kompis: {\n endpoints: this.getEndpoints(((_e = data.kompis) === null || _e === void 0 ? void 0 : _e.endpoints) || {}),\n urls: this.getUrls(((_f = data.kompis) === null || _f === void 0 ? void 0 : _f.urls) || {}, storeId, langId),\n serviceSettings: (((_g = data.kompis) === null || _g === void 0 ? void 0 : _g.serviceSettings) || {}),\n localization: (((_h = data.kompis) === null || _h === void 0 ? void 0 : _h.localization) || {}),\n priceSettings: (((_j = data.kompis) === null || _j === void 0 ? void 0 : _j.priceSettings) || {})\n },\n localisation: (data.localisation || {})\n };\n // Include all custom settings which the teams could have\n for (const key of Object.keys(data)) {\n if (!dexfSettings[key]) {\n dexfSettings[key] = data[key];\n }\n }\n return dexfSettings;\n }\n /**\n * Parses URL:s.\n *\n * @param urls URL:s.\n * @param storeId Store id.\n * @param langId Language id.\n * @returns Parsed URL:s.\n */\n getUrls(urls, storeId, langId) {\n const { country, language } = utilities_1.LocaleUtility.getCountryAndLanguage(this.locale);\n const newUrls = {};\n for (const key of Object.keys(urls)) {\n newUrls[key] = urls[key]\n .replace('{country}', country)\n .replace('{language}', language)\n .replace('{storeId}', storeId)\n .replace('{langId}', langId);\n }\n return newUrls;\n }\n /**\n * Parses endpoints.\n *\n * @param endpoints Endpoints.\n * @returns Parsed endpoints.\n */\n getEndpoints(endpoints) {\n const { country, language } = utilities_1.LocaleUtility.getCountryAndLanguage(this.locale);\n const newEndpoints = {};\n for (const key of Object.keys(endpoints)) {\n newEndpoints[key] = endpoints[key]\n .replace('{country}', country)\n .replace('{language}', language)\n .replace('{retailUnit}', country === null || country === void 0 ? void 0 : country.toUpperCase())\n .replace('{locale}', this.locale);\n }\n return newEndpoints;\n }\n}\nexports.default = DexfSettingsTransformer;\n//# sourceMappingURL=DexfSettingsTransformer.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities/\");\nconst ServiceFetch_1 = __importDefault(require(\"../../utilities/ServiceFetch\"));\nconst DexfSettingsTransformer_1 = __importDefault(require(\"./DexfSettingsTransformer\"));\nconst DEXF_QA = 'https://api.dexf.qa.ikeadt.com';\nconst DEXF_PROD = 'https://api.dexf.ikea.com';\n/**\n * This service is used for fetching setting configuration from DEXF.\n */\nclass DexfSettingsService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.dexfApiKey DEXF API key.\n * @param options.environment\n */\n constructor(options) {\n this.dexfApiKey = options.dexfApiKey;\n this.endpoint = `${options.environment === enums_1.DexfSettingsEnvironmentEnum.development ? DEXF_QA : DEXF_PROD}/setting/v1/data/apps/{appId}/retail-units/{retailUnit}/locales/{language}-{country}`;\n }\n /**\n * Fetches setting configuration assigned to an application in DEXF.\n *\n * @param dexfApplicationId\n * @param locale\n * @param filterSegment\n * @returns Promise.\n */\n getApplicationSettings(dexfApplicationId, locale, filterSegment) {\n return __awaiter(this, void 0, void 0, function* () {\n const { country, language } = utilities_1.LocaleUtility.getCountryAndLanguage(locale);\n if (!country || !language) {\n throw new exceptions_1.ServiceException('Country or language is not defined. Format locale correctly, e.g. en-GB');\n }\n const url = `${this.endpoint}${filterSegment ? `?filter.segment=${filterSegment}` : ''}`\n .replace('{appId}', dexfApplicationId)\n .replace('{retailUnit}', country.toUpperCase())\n .replace('{language}', language)\n .replace('{country}', country.toUpperCase());\n const response = yield ServiceFetch_1.default.json(url, {\n credentials: 'same-origin',\n headers: {\n 'dexf-api-key': this.dexfApiKey\n }\n });\n const transformer = new DexfSettingsTransformer_1.default({ locale });\n const transformedResponse = transformer.transform(response);\n return transformedResponse;\n });\n }\n}\nexports.default = DexfSettingsService;\n//# sourceMappingURL=DexfSettingsService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst DexfSettingsService_1 = __importDefault(require(\"../../services/localization/DexfSettingsService\"));\n/**\n * This class is used as a simple interface for settings configuration services.\n */\nclass SettingsService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.dexfApiKey\n * @param options.dexfApplicationId\n * @param options.locale\n */\n constructor(options) {\n this.dexfApiKey = options.dexfApiKey;\n this.dexfEnvironment = options.dexfEnvironment;\n this.dexfApplicationId = options.dexfApplicationId;\n this.locale = options.locale;\n }\n /**\n * Fetches and returns configuration settings from DEXF.\n *\n * @param filterSegment\n * @returns Promise object.\n */\n getApplicationSettings(filterSegment) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.dexfApiKey) {\n throw new exceptions_1.ServiceException('Failed to fetch application settings. The configuration \"dexfApiKey\" has not been defined. Send it in to the constructor of SettingsService.');\n }\n if (!this.dexfApplicationId) {\n throw new exceptions_1.ServiceException('Failed to fetch application settings. The configuration \"dexfApplicationId\" has not been defined. Send it in to the constructor of SettingsService.');\n }\n if (!this.locale) {\n throw new exceptions_1.ServiceException('Failed to fetch application settings. The configuration \"locale\" has not been defined. Send it in to the constructor of SettingsService.');\n }\n const service = new DexfSettingsService_1.default({\n dexfApiKey: this.dexfApiKey,\n environment: this.dexfEnvironment\n });\n const configurationSettings = yield service.getApplicationSettings(this.dexfApplicationId, this.locale, filterSegment);\n return configurationSettings;\n });\n }\n}\nexports.default = SettingsService;\n//# sourceMappingURL=SettingsService.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * This class is used for transforming translations data.\n */\nclass TranslationsTransformer {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.translationPrefixApplication Translation prefix application.\n */\n constructor(options) {\n this.translationPrefixApplication = (options === null || options === void 0 ? void 0 : options.translationPrefixApplication) || null;\n }\n /**\n * Transforms data into a ITranslations model.\n *\n * @param data Response data to parse.\n * @returns Localized information model.\n */\n transform(data) {\n return this.replaceApplicationPrefixInKeys(data);\n }\n /**\n * Recursively replaces application prefix in all keys in the object.\n *\n * @param objectOrString Object or string.\n */\n replaceApplicationPrefixInKeys(objectOrString) {\n if (!objectOrString || typeof objectOrString === 'string') {\n return objectOrString;\n }\n const objectWithUpdatedKeys = {};\n for (const key in objectOrString) {\n const updatedKey = this.replaceApplicationPrefixInKey(key);\n if (updatedKey) {\n objectWithUpdatedKeys[updatedKey] = this.replaceApplicationPrefixInKeys(objectOrString[key]);\n }\n }\n return objectWithUpdatedKeys;\n }\n /**\n * @param key The key to replace application prefix in.\n */\n replaceApplicationPrefixInKey(key) {\n const application = this.translationPrefixApplication;\n if (!application) {\n return key;\n }\n const pairs = key.split('__');\n if (pairs.length > 1 && pairs[0] === application) {\n return pairs[1];\n }\n // We should remove other application prefixed keys that don't match the application.\n if (pairs.length > 1) {\n return null;\n }\n return key;\n }\n}\nexports.default = TranslationsTransformer;\n//# sourceMappingURL=TranslationsTransformer.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst ServiceFetch_1 = __importDefault(require(\"../../utilities/ServiceFetch\"));\nconst TranslationsTransformer_1 = __importDefault(require(\"./TranslationsTransformer\"));\n/**\n * This service is used for fetching and transforming translations.\n */\nclass InternalTranslationsService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.translationPrefixApplication Translation prefix application.\n * @param options.translationEndpoints Translation endpoints.\n * @param options.locale Locale.\n */\n constructor(options) {\n this.translationPrefixApplication = options.translationPrefixApplication;\n this.translationEndpoints = options.translationEndpoints;\n this.locale = options.locale;\n }\n /**\n * Fetches and returns translations.\n *\n * @returns Promise object.\n */\n getTranslations() {\n return __awaiter(this, void 0, void 0, function* () {\n const responses = yield Promise.all(this.translationEndpoints.map((url) => this.fetch(url)));\n const transformer = new TranslationsTransformer_1.default({\n translationPrefixApplication: this.translationPrefixApplication\n });\n const transformed = responses.map((response) => transformer.transform(response));\n return this.mergeTranslations(transformed);\n });\n }\n /**\n * Merges multiple translations.\n *\n * @param translations Array of translations.\n * @returns Merged translations.\n */\n mergeTranslations(translations) {\n const merged = Object.assign({}, ...translations);\n for (const key of Object.keys(merged)) {\n merged[key] = Object.assign({}, ...translations.map((translations) => translations[key]));\n }\n return merged;\n }\n /**\n * Fetches and returns translations.\n *\n * @param url URL.\n * @returns Promise object.\n */\n fetch(url) {\n return __awaiter(this, void 0, void 0, function* () {\n const { country, language } = utilities_1.LocaleUtility.getCountryAndLanguage(this.locale);\n if (!country || !language) {\n throw new exceptions_1.ServiceException('Country or language is not defined. Format locale correctly, e.g. en-GB');\n }\n const parsedUrl = url\n .replace('{country}', country.toUpperCase())\n .replace('{language}', language);\n return yield ServiceFetch_1.default.json(parsedUrl, {\n credentials: 'same-origin'\n });\n });\n }\n}\nexports.default = InternalTranslationsService;\n//# sourceMappingURL=InternalTranslationsService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst CacheStoreType_1 = __importDefault(require(\"../../enums/CacheStoreType\"));\nconst InternalTranslationsService_1 = __importDefault(require(\"../../services/localization/InternalTranslationsService\"));\n/**\n * This class is used as a simple interface for translation services.\n */\nclass TranslationsService {\n /**\n * Constructor.\n *\n * @param options Options.\n */\n constructor(options) {\n this.translationPrefixApplication = options.translationPrefixApplication;\n this.translationEndpoints = options.translationEndpoints;\n this.locale = options.locale;\n this.cache = options.cache || new utilities_1.GlobalCacheStore();\n }\n /**\n * Fetches and returns translations.\n *\n * @returns Promise object.\n */\n getTranslations() {\n return __awaiter(this, void 0, void 0, function* () {\n const cacheStore = this.cache.getStore(CacheStoreType_1.default.translations);\n const endpointsCacheKey = JSON.stringify(this.translationEndpoints);\n const translationsCacheKey = this.locale + endpointsCacheKey;\n const queueCacheKey = this.locale + endpointsCacheKey + 'queue';\n const cachedTranslations = cacheStore.get(translationsCacheKey);\n if (cachedTranslations) {\n return cachedTranslations;\n }\n const cachedQueue = cacheStore.get(queueCacheKey);\n if (cachedQueue) {\n return new Promise((resolve, reject) => cachedQueue.push({ resolve, reject }));\n }\n const newQueue = [];\n cacheStore.set(queueCacheKey, newQueue);\n const service = new InternalTranslationsService_1.default({\n translationPrefixApplication: this.translationPrefixApplication,\n translationEndpoints: this.translationEndpoints,\n locale: this.locale\n });\n let translations;\n try {\n translations = yield service.getTranslations();\n }\n catch (error) {\n for (const item of newQueue) {\n item.reject(error);\n }\n throw error;\n }\n cacheStore.set(translationsCacheKey, translations);\n cacheStore.delete(queueCacheKey);\n for (const item of newQueue) {\n item.resolve(translations);\n }\n return translations;\n });\n }\n}\nexports.default = TranslationsService;\n//# sourceMappingURL=TranslationsService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst ServiceFetch_1 = __importDefault(require(\"../../utilities/ServiceFetch\"));\n/**\n * This class is used for sending a saved planner configuration to a user through email or sms.\n */\nclass DexfNotificationService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.endpoint Endpoint.\n * @param options.dexfApiKey DEXF API key.\n */\n constructor(options) {\n this.endpoint = options.endpoint;\n this.dexfApiKey = options.dexfApiKey;\n }\n /**\n * Sends an email with a configuration to a user.\n *\n * @param options Options.\n * @param options.vpcCode Vpc code.\n * @param options.type Email or Sms.\n * @param options.contact Email address or phone number.\n * @param options.linkType Destination for the link. Planner or pickinglist.\n * @param options.storeId Store ID. Configurable for pickinglist.\n * @returns Sent notification status.\n */\n sendNotification(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const preparedMessageUrl = yield this.prepareMessage(options.vpcCode, options.type, options.linkType, options.storeId);\n if (!preparedMessageUrl) {\n throw new exceptions_1.ServiceException('Failed to get preparedMessageUrl. Service did not return url.');\n }\n const response = yield ServiceFetch_1.default.json(preparedMessageUrl, {\n credentials: 'same-origin',\n method: 'POST',\n headers: this.getHeaders(),\n body: this.getBody(options.contact)\n });\n if (response['jobId'] === undefined) {\n throw new exceptions_1.ServiceException('Failed to get jobId. Service did not return jobID.');\n }\n });\n }\n /**\n * Prepares message template and returns prepared reference object.\n *\n * @param vpcCode VpcCode ex '34WY5'.\n * @param type Type ex 'email' or 'sms'.\n * @param linkType Destination for the link. Planner or pickinglist.\n * @param storeId Store ID. Configurable for pickinglist.\n * @returns Prepared message url.\n */\n prepareMessage(vpcCode, type, linkType, storeId) {\n return __awaiter(this, void 0, void 0, function* () {\n const baseUrl = this.endpoint;\n let url = `${baseUrl}/${vpcCode}/prepare?type=${type}&linkType=${linkType}`;\n if (storeId && enums_1.NotificationLinkTypeEnum.pickinglist === linkType) {\n url += `&storeCode=${storeId}`;\n }\n const response = yield ServiceFetch_1.default.json(url, {\n credentials: 'same-origin',\n method: 'GET',\n headers: this.getHeaders()\n });\n if (response['_links']) {\n return decodeURI(response['_links']['send']['href']);\n }\n return null;\n });\n }\n /**\n * Returns body for notification.\n *\n * @param contact Email address or phone number.\n * @returns Stringified body.\n */\n getBody(contact) {\n return JSON.stringify({\n to: contact\n });\n }\n /**\n * Returns headers.\n *\n * @returns Headers.\n */\n getHeaders() {\n return {\n 'dexf-api-key': this.dexfApiKey,\n 'content-type': 'application/json'\n };\n }\n}\nexports.default = DexfNotificationService;\n//# sourceMappingURL=DexfNotificationService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst DexfNotificationService_1 = __importDefault(require(\"../../services/notification/DexfNotificationService\"));\nconst DexfConfiguration_1 = __importDefault(require(\"../../utilities/DexfConfiguration\"));\n/**\n * This class is used as an interface for Dexf notification service.\n */\nclass NotificationService {\n /**\n * Constructor.\n *\n * @param options Options.\n */\n constructor(options) {\n this.dexfConfiguration = new DexfConfiguration_1.default(options);\n }\n /**\n * Send planner configuration to user via Email.\n *\n * @param options Notification Options.\n * @param options.vpcCode Vpc code.\n * @param options.email Email address.\n * @param options.linkType Link type.\n * @param options.storeId Store ID. Configurable for pickinglist.\n * @returns True if sent.\n */\n sendEmail(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const service = yield this.getService();\n const { vpcCode, email, linkType, storeId } = options;\n return yield service.sendNotification({\n vpcCode,\n type: enums_1.DexfNotificationTypeEnum.email,\n contact: email,\n linkType,\n storeId\n });\n });\n }\n /**\n * Send planner configuration to user via sms.\n *\n * @param options Notification Options.\n * @param options.vpcCode Vpc code.\n * @param options.phoneNumber Phone number.\n * @param options.linkType Link type.\n * @param options.storeId Store ID. Configurable for pickinglist.\n * @returns True if sent.\n */\n sendSms(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const service = yield this.getService();\n const { vpcCode, phoneNumber, linkType, storeId } = options;\n return yield service.sendNotification({\n vpcCode,\n type: enums_1.DexfNotificationTypeEnum.sms,\n contact: phoneNumber,\n linkType,\n storeId\n });\n });\n }\n /**\n * Returns service.\n *\n * @returns Service.\n */\n getService() {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const dexfApiKey = yield this.dexfConfiguration.getDexfApiKeyOrThrow();\n switch (kompis.serviceSettings.notificationDataSource) {\n case enums_1.NotificationDataSourceEnum.disabled:\n throw new exceptions_1.ServiceException(`The notificationDataSource is set to \"Disabled\". When it is, the notification functionality should be disabled in the planner.`);\n default:\n return new DexfNotificationService_1.default({\n endpoint: kompis.endpoints.dexfNotificationService,\n dexfApiKey: dexfApiKey\n });\n }\n });\n }\n}\nexports.default = NotificationService;\n//# sourceMappingURL=NotificationService.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\n/**\n * This class handles communication with the IRW application through post message.\n */\nclass IrwPlatformCommunication {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.applicationName Application name.\n */\n constructor(options) {\n this.applicationName = options.applicationName;\n }\n /**\n * Sets the iframe container height.\n *\n * @param height Height to set.\n */\n setIframeHeight(height) {\n if (utilities_1.IframeUtility.isInsideIframe()) {\n window.parent.postMessage({\n header: {\n name: 'setContainerSize'\n },\n body: {\n height: height,\n containerName: this.getContainerName()\n }\n }, '*');\n }\n }\n /**\n * Sets the cart count.\n *\n * @param cartCount Cart count to set.\n */\n setCartCount(cartCount) {\n if (utilities_1.IframeUtility.isInsideIframe()) {\n window.parent.postMessage({\n header: {\n name: 'shoppingcartCount'\n },\n body: {\n count: cartCount,\n containerName: this.getContainerName()\n }\n }, '*');\n }\n }\n /**\n * Returns the iframe container name.\n *\n * @returns Iframe container name.\n */\n getContainerName() {\n return '#' + this.applicationName + '-application';\n }\n}\nexports.default = IrwPlatformCommunication;\n//# sourceMappingURL=IrwPlatformCommunication.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\n/**\n * This class handles communication with the ROIG application through post message.\n */\nclass RoigPlatformCommunication {\n /**\n * Sets the iframe container height.\n *\n * @param height Height to set.\n */\n setIframeHeight(height) {\n if (utilities_1.IframeUtility.isInsideIframe()) {\n window.parent.postMessage({\n method: 'setHeight',\n parameters: {\n height\n }\n }, '*');\n }\n }\n /**\n * Adds items to shopping bag.\n *\n * @param items List of items.\n * @param vpcCode VPC code.\n */\n addToCart(items, vpcCode) {\n if (utilities_1.IframeUtility.isInsideIframe()) {\n window.parent.postMessage({\n method: 'addToShoppingBag',\n parameters: {\n items: items.map((item) => {\n return { ID: item.id, Type: item.type, Qty: item.quantity };\n }),\n vpcCode\n }\n }, '*');\n }\n }\n /**\n * Sets the cart count.\n *\n * @param cartCount Cart count to set.\n */\n setCartCount(cartCount) {\n if (utilities_1.IframeUtility.isInsideIframe()) {\n window.parent.postMessage({\n method: 'setCartCount',\n parameters: {\n cartCount: cartCount\n }\n }, '*');\n }\n }\n}\nexports.default = RoigPlatformCommunication;\n//# sourceMappingURL=RoigPlatformCommunication.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst DexfConfiguration_1 = __importDefault(require(\"../../utilities/DexfConfiguration\"));\nconst IrwPlatformCommunication_1 = __importDefault(require(\"../../utilities/platform-communication/IrwPlatformCommunication\"));\nconst RoigPlatformCommunication_1 = __importDefault(require(\"../../utilities/platform-communication/RoigPlatformCommunication\"));\n/**\n * This class is used as a interface for platform services.\n */\nclass PlatformService {\n /**\n * Constructor.\n *\n * @param options Options.\n */\n constructor(options) {\n this.applicationName = options.applicationName;\n this.dexfConfiguration = new DexfConfiguration_1.default(options);\n }\n /**\n * Sets the iframe container height.\n *\n * @param height Height in pixels.\n * @returns Promise object.\n */\n setIframeHeight(height) {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n switch (kompis.serviceSettings.apiPlatform) {\n case enums_1.ApiPlatformEnum.roig:\n new RoigPlatformCommunication_1.default().setIframeHeight(height);\n break;\n }\n /*\n Communicate via the standard API no matter what since we don't know if a\n NIF/ROIG market has implemented the new one or not.\n */\n new IrwPlatformCommunication_1.default({ applicationName: this.applicationName }).setIframeHeight(height);\n });\n }\n}\nexports.default = PlatformService;\n//# sourceMappingURL=PlatformService.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst KompisDefaultFields = [\n enums_1.ProductOptionalFieldNameEnum.priceInformation,\n enums_1.ProductOptionalFieldNameEnum.priceUnit,\n enums_1.ProductOptionalFieldNameEnum.child,\n enums_1.ProductOptionalFieldNameEnum.measureReference,\n enums_1.ProductOptionalFieldNameEnum.measure,\n enums_1.ProductOptionalFieldNameEnum.packageMeasure,\n enums_1.ProductOptionalFieldNameEnum.customerBenefit,\n enums_1.ProductOptionalFieldNameEnum.customerBenefitSummary,\n enums_1.ProductOptionalFieldNameEnum.goodToKnow,\n enums_1.ProductOptionalFieldNameEnum.peopleAndPlanet,\n enums_1.ProductOptionalFieldNameEnum.image,\n enums_1.ProductOptionalFieldNameEnum.video,\n enums_1.ProductOptionalFieldNameEnum.technicalInformation,\n enums_1.ProductOptionalFieldNameEnum.complianceTechnical,\n enums_1.ProductOptionalFieldNameEnum.complianceInformation,\n enums_1.ProductOptionalFieldNameEnum.complianceLabel,\n enums_1.ProductOptionalFieldNameEnum.careInstruction,\n enums_1.ProductOptionalFieldNameEnum.customerMaterial\n];\nexports.default = KompisDefaultFields;\n//# sourceMappingURL=KompisDefaultFields.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst CacheStoreType_1 = __importDefault(require(\"../../enums/CacheStoreType\"));\n/**\n * This class is used for storing and loading products from cache.\n */\nclass ProductCache {\n /**\n * Constructor.\n *\n * @param [locale] Locale.\n * @param [cache] Cache store.\n */\n constructor(locale, cache = null) {\n this.products = new Map();\n if (cache && !cache.getStore) {\n throw new exceptions_1.ServiceException('Failed to instanciate facade. Expected second parameter to be of type CacheStore.');\n }\n this.locale = locale;\n this.cache = cache || new utilities_1.GlobalCacheStore();\n }\n /**\n * Returns multiple cached products.\n *\n * @param items Array of items.\n * @param fields Fields.\n * @returns Products and missing items.\n */\n getProducts(items, fields) {\n const searchableProductMap = this.getSearchableProductMap(fields);\n const products = [];\n const missing = [];\n for (const item of items) {\n const product = searchableProductMap[this.getProductCacheKey(item)];\n if (product) {\n products.push(product);\n }\n else {\n missing.push(item);\n }\n }\n return { products, missing };\n }\n /**\n * Adds multiple products.\n *\n * @param products Products.\n * @param fields Fields.\n */\n addProducts(products, fields) {\n for (const product of products) {\n this.addProduct(product, fields);\n }\n }\n /**\n * Removes products that has been added to this instance from cache.\n *\n * @param products Products.\n * @param fields Fields.\n */\n removeProducts(products) {\n for (const product of products) {\n this.removeProduct(product);\n }\n }\n /**\n * Clears all products that has been added to this instance from cache.\n *\n * @param fields Fields.\n */\n clear() {\n for (const product of Array.from(this.products.values())) {\n this.removeProduct(product);\n }\n }\n /**\n * Returns map that can be used for when searching for a product item.\n *\n * @param fields Fields.\n * @returns Product items.\n */\n getSearchableProductMap(fields) {\n const store = this.cache.getStore(CacheStoreType_1.default.product);\n const cacheKey = this.getFieldsCacheKey(fields);\n const productItems = store.get(cacheKey);\n if (productItems) {\n return productItems;\n }\n let merged = {};\n for (const key of Array.from(store.keys())) {\n if (key.startsWith('items-' + this.locale)) {\n const cachedFields = key.replace('items-' + this.locale + '-', '').split('_');\n let hasMatch = true;\n for (let i = 0, max = fields.length; i < max; i++) {\n if (!cachedFields.includes(fields[i])) {\n hasMatch = false;\n break;\n }\n }\n if (hasMatch) {\n merged = Object.assign(merged, store.get(key));\n }\n }\n }\n return merged;\n }\n /**\n * Returns map that can be used for storing products.\n *\n * @param fields Fields.\n * @returns Product items.\n */\n getStorableProductMap(fields) {\n const store = this.cache.getStore(CacheStoreType_1.default.product);\n const cacheKey = this.getFieldsCacheKey(fields);\n const productMap = store.get(cacheKey);\n if (productMap) {\n return productMap;\n }\n const newProductMap = {};\n store.set(cacheKey, newProductMap);\n return newProductMap;\n }\n /**\n * Returns fields cache key.\n *\n * @param fields Fields.\n * @returns Cache key.\n */\n getFieldsCacheKey(fields) {\n return 'items-' + this.locale + '-' + fields.sort().join('_');\n }\n /**\n * Returns cache key for an item.\n *\n * @param item Product item.\n * @returns Cache key.\n */\n getProductCacheKey(item) {\n return item.type.toLowerCase() + item.id;\n }\n /**\n * Removes a product that has been added to this instance from cache.\n *\n * @param product Product.\n * @param fields Fields.\n */\n removeProduct(product) {\n const store = this.cache.getStore(CacheStoreType_1.default.product);\n const [type, id] = product.itemId.split('-');\n const cacheKey = this.getProductCacheKey({ id, type });\n if (this.products.get(cacheKey)) {\n this.products.delete(cacheKey);\n }\n for (const items of Array.from(store.values())) {\n if (items[cacheKey]) {\n delete items[cacheKey];\n }\n }\n }\n /**\n * Adds a product to cache.\n *\n * @param product Product.\n * @param fields Fields.\n */\n addProduct(product, fields) {\n const productMap = this.getStorableProductMap(fields);\n const [type, id] = product.itemId.split('-');\n const cacheKey = this.getProductCacheKey({ id, type });\n this.products.set(cacheKey, product);\n productMap[cacheKey] = product;\n }\n}\nexports.default = ProductCache;\n//# sourceMappingURL=ProductCache.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst ItemUtility_1 = __importDefault(require(\"../../utilities/ItemUtility\"));\nconst ServiceFetch_1 = __importDefault(require(\"../../utilities/ServiceFetch\"));\n/**\n * This class is used for fetching product data.\n */\nclass DexfWebplannerService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.endpoint Endpoint.\n * @param options.dexfApiKey DEXF API key.\n */\n constructor(options) {\n this.maxItemsPerRequest = 50;\n this.endpoint = options.endpoint;\n this.dexfApiKey = options.dexfApiKey;\n }\n /**\n * Fetches items from DEXF.\n *\n * @param items Array of items.\n * @param fields Fields.\n * @param params Optional params.\n * @returns Promise.\n */\n getProducts(items, fields, params = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!fields) {\n throw new exceptions_1.ServiceException('You have to specify fields to fetch product information.');\n }\n const sortedFields = fields.slice();\n const sets = ItemUtility_1.default.getItemSets(items, this.maxItemsPerRequest);\n const options = {\n credentials: 'same-origin',\n headers: {\n 'dexf-api-key': this.dexfApiKey\n }\n };\n sortedFields.sort();\n const promises = sets.map((set) => {\n const itemId = ItemUtility_1.default.getItemsString(set);\n const url = `${this.endpoint}?filter.itemId=${itemId}&fields=${sortedFields.join(',')}${this.getOptionalQueryString(params)}`;\n return ServiceFetch_1.default.json(url, options);\n });\n const parts = yield Promise.all(promises);\n const products = [];\n for (const part of parts) {\n for (const item of part['data']) {\n products.push(this.parseProduct(item));\n }\n }\n return products;\n });\n }\n /**\n * Fetches all items assigned to an application from DEXF.\n *\n * @param dexfApplicationId DEXF application ID.\n * @param fields Fields.\n * @param params Optional params.\n * @returns Promise.\n */\n getApplicationProducts(dexfApplicationId, fields, params = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!fields) {\n throw new exceptions_1.ServiceException('You have to specify fields to fetch product information.');\n }\n const sortedFields = fields.slice();\n sortedFields.sort();\n const url = `${this.endpoint}?filter.appId=${dexfApplicationId}&fields=${sortedFields.join(',')}${this.getOptionalQueryString(params)}`;\n const response = yield ServiceFetch_1.default.json(url, {\n credentials: 'same-origin',\n headers: {\n 'dexf-api-key': this.dexfApiKey\n }\n });\n const products = [];\n for (const item of response['data']) {\n products.push(this.parseProduct(item));\n }\n return products;\n });\n }\n /**\n * Get optional query string.\n *\n * @param params Optional params.\n * @returns Query string.\n */\n getOptionalQueryString(params) {\n let qs = '';\n if (params.tags && params.tags.length > 0) {\n qs += `&filter.tags=${params.tags.join(',')}`;\n }\n if (params.valid !== undefined) {\n qs += `&filter.valid=${params.valid}`;\n }\n if (params.customParams) {\n for (const param in params.customParams) {\n qs += `&${param}=${params.customParams[param]}`;\n }\n }\n return qs;\n }\n /**\n * Parses product data.\n *\n * @param data Data.\n * @returns Item string.\n */\n parseProduct(data) {\n return {\n reason: data['reason'] || [],\n valid: data['valid'] || false,\n itemId: data['itemId'] || null,\n content: data['content'] ? this.parseProductContent(data['content']) : null\n };\n }\n /**\n * Parses product content data.\n *\n * @param data Data.\n * @returns Item string.\n */\n parseProductContent(data) {\n return {\n itemType: data['itemType'] || null,\n itemNoGlobal: data['itemNoGlobal'] || null,\n itemNoLocal: data['itemNoLocal'] || null,\n ruItemType: data['ruItemType'] || null,\n ruItemNo: data['ruItemNo'] || null,\n breathTakingItem: data['breathTakingItem'] || false,\n name: data['name'] || null,\n mainTypeCode: data['mainTypeCode'] || null,\n mainTypeName: data['mainTypeName'] || null,\n typeCode: data['typeCode'] || null,\n typeName: data['typeName'] || null,\n validDesignText: data['validDesignText'] || null,\n colourDotCode: data['colourDotCode'] || null,\n colourDotUrl: data['colourDotUrl'] || null,\n requiresAssembly: data['requiresAssembly'] || null,\n appConfig: data['appConfig'] || null,\n measure: data['measure'] || null,\n packageMeasure: data['packageMeasure'] || null,\n priceInformation: data['priceInformation'] || null,\n image: data['image'] || null,\n video: data['video'] || null,\n goodToKnow: data['goodToKnow'] || null,\n customerBenefit: data['customerBenefit'] || null,\n customerBenefitSummary: data['customerBenefitSummary'] || null,\n complianceTechnical: data['complianceTechnical'] || null,\n complianceLabel: data['complianceLabel'] || null,\n complianceInformation: data['complianceInformation'] || null,\n technicalInformation: data['technicalInformation'] || null,\n peopleAndPlanet: data['peopleAndPlanet'] || null,\n careInstruction: data['careInstruction'] || null,\n customerMaterial: data['customerMaterial'] || null,\n filterAttribute: data['filterAttribute'] || null,\n validDesignPart: data['validDesignPart'] || null,\n priceUnit: data['priceUnit'] || null,\n child: data['child'] || null,\n fullyLocalized: data['fullyLocalized'] || null,\n presentationGroupCode: data['presentationGroupCode'] || null,\n assemblyTime: data['assemblyTime'] || null,\n genericProduct: data['genericProduct'] || null,\n measureReference: data['measureReference'] || null,\n reason: data['reason'] || null,\n document: data['document'] || null,\n complementaryItem: data['complementaryItem'] || null,\n asset: data['asset'] || null,\n saleEndDateTime: data['saleEndDateTime'] || null,\n saleEndDateText: data['saleEndDateText'] || null\n };\n }\n}\nexports.default = DexfWebplannerService;\n//# sourceMappingURL=DexfWebplannerService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * This class is used for storing items in a queue.\n */\nclass ProductItemQueue {\n constructor() {\n this.items = {};\n this.timeout = null;\n this.callbacks = [];\n }\n /**\n * Releases waiting in queue.\n *\n * @param callbacks Callbacks.\n */\n releaseWaiting(callbacks) {\n for (const callback of callbacks) {\n callback({ items: [], callbacks: [] });\n }\n }\n /**\n * Retrieves items in queue.\n *\n * @param items Array of items.\n * @returns Promise.\n */\n retrieveItems(items) {\n return __awaiter(this, void 0, void 0, function* () {\n this.addItems(items);\n return new Promise((resolve) => {\n if (this.timeout !== null) {\n this.callbacks.push(resolve);\n }\n else {\n this.timeout = setTimeout(() => {\n const items = Object.values(this.items);\n const callbacks = this.callbacks;\n this.callbacks = [];\n this.timeout = null;\n this.items = {};\n resolve({ items, callbacks });\n });\n }\n });\n });\n }\n /**\n * Adds items to queue.\n *\n * @param items Array of items.\n */\n addItems(items) {\n for (const item of items) {\n this.items[item.type.toLowerCase() + item.id] = item;\n }\n }\n}\nexports.default = ProductItemQueue;\n//# sourceMappingURL=ProductItemQueue.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst CacheStoreType_1 = __importDefault(require(\"../../enums/CacheStoreType\"));\nconst DexfWebplannerService_1 = __importDefault(require(\"../../services/product/DexfWebplannerService\"));\nconst DexfConfiguration_1 = __importDefault(require(\"../../utilities/DexfConfiguration\"));\nconst ProductCache_1 = __importDefault(require(\"./ProductCache\"));\nconst ProductItemQueue_1 = __importDefault(require(\"./ProductItemQueue\"));\n/**\n * This class is used as a simple interface for product services.\n */\nclass ProductService {\n /**\n * Constructor.\n *\n * @param options Options.\n */\n constructor(options) {\n this.locale = options.locale;\n this.dexfApplicationId = options.dexfApplicationId || null;\n this.cache = options.cache || new utilities_1.GlobalCacheStore();\n this.cacheStore = this.cache.getStore(CacheStoreType_1.default.product);\n this.productCache = new ProductCache_1.default(options.locale, this.cache);\n this.dexfConfiguration = new DexfConfiguration_1.default(options);\n }\n /**\n * Fetches and returns products.\n *\n * @param items Array of items.\n * @param fields Fields.\n * @param params Optional params.\n * @returns Promise.\n */\n getProducts(items, fields, params) {\n return __awaiter(this, void 0, void 0, function* () {\n const cached = this.productCache.getProducts(items, fields);\n if (cached.missing.length === 0) {\n return cached.products;\n }\n const productItemQueueKey = 'queue-' + this.locale + '-' + fields.sort().join('_');\n let productItemQueue = this.cacheStore.get(productItemQueueKey);\n if (!productItemQueue) {\n productItemQueue = new ProductItemQueue_1.default();\n this.cacheStore.set(productItemQueueKey, productItemQueue);\n }\n const callbacks = [];\n let itemsAndCallbacks = { items, callbacks };\n itemsAndCallbacks = yield productItemQueue.retrieveItems(cached.missing);\n if (itemsAndCallbacks.items.length > 0) {\n const service = yield this.getService();\n const products = yield service.getProducts(itemsAndCallbacks.items, fields, params);\n this.productCache.addProducts(products, fields);\n productItemQueue.releaseWaiting(itemsAndCallbacks.callbacks);\n }\n return this.productCache.getProducts(items, fields).products;\n });\n }\n /**\n * Returns an Array of fetched ShoppingProduct objects.\n *\n * @param fields Fields.\n * @param shoppingItems Array of ShoppingItem.\n * @returns Array of ShoppingProduct objects.\n */\n getShoppingProducts(shoppingItems, fields) {\n return __awaiter(this, void 0, void 0, function* () {\n const products = yield this.getProducts(shoppingItems, fields);\n const shoppingItemsMap = {};\n for (const shoppingItem of shoppingItems) {\n const type = shoppingItem.type.toLowerCase();\n shoppingItemsMap[type + '-' + shoppingItem.id] = shoppingItem;\n }\n return products.map((product) => {\n var _a;\n if (!product.content) {\n return {\n product,\n quantity: shoppingItemsMap[product.itemId.toLowerCase()].quantity\n };\n }\n const itemType = (_a = product.content.itemType) === null || _a === void 0 ? void 0 : _a.toLowerCase();\n const item = shoppingItemsMap[itemType + '-' + product.content.itemNoLocal] ||\n shoppingItemsMap[itemType + '-' + product.content.itemNoGlobal];\n return {\n product,\n quantity: item.quantity\n };\n });\n });\n }\n /**\n * Fetches and returns all products for a planner.\n *\n * @param fields Fields.\n * @param params Optional params.\n * @returns Promise.\n */\n getApplicationProducts(fields, params) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.dexfApplicationId) {\n throw new exceptions_1.ServiceException('Failed to fetch application products. The configuration \"dexfApplicationId\" has not been defined. Send it in to the constructor of ProductService.');\n }\n const service = yield this.getService();\n const products = yield service.getApplicationProducts(this.dexfApplicationId, fields, params);\n this.productCache.addProducts(products, fields);\n return products;\n });\n }\n /**\n * Returns service.\n *\n * @returns Service.\n */\n getService() {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const dexfApiKey = yield this.dexfConfiguration.getDexfApiKeyOrThrow();\n return new DexfWebplannerService_1.default({\n endpoint: kompis.endpoints.dexfWebplannerService,\n dexfApiKey\n });\n });\n }\n}\nexports.default = ProductService;\n//# sourceMappingURL=ProductService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst ServiceFetch_1 = __importDefault(require(\"../../utilities/ServiceFetch\"));\nconst DexfAccountServiceUtility_1 = __importDefault(require(\"../authentication/account-service/DexfAccountServiceUtility\"));\nconst DEFAULT_CONFIGURATION_VERSION = '1.0';\n/**\n * This class is used for saving planner configurations to the Dexf SaveService.\n */\nclass DexfSaveService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.dexfApplicationId DEXF application ID.\n * @param options.endpoint Endpoint.\n * @param options.dexfApiKey DEXF API key.\n * @param [options.dexfConfigurationVersion] Configuration version. Defaults to \"1.0\".\n * @param options.dexfConfigurationSchemaVersion\n */\n constructor(options) {\n this.authUtility = new DexfAccountServiceUtility_1.default();\n this.dexfIcfVersion = '1.0';\n this.dexfApplicationId = options.dexfApplicationId;\n this.endpoint = options.endpoint;\n this.dexfApiKey = options.dexfApiKey;\n this.dexfConfigurationSchemaVersion =\n options.dexfConfigurationSchemaVersion || DEFAULT_CONFIGURATION_VERSION;\n this.prefix = options.dexfApplicationId.toUpperCase() + ':';\n }\n /**\n * Fetches and return saved configuration.\n *\n * @param token\n * @param id\n */\n getConfiguration(token, id) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.authUtility.isTokenValid(token)) {\n throw new exceptions_1.ServiceException('Invalid JWT token is provided.');\n }\n const url = this.endpoint + '/' + id.toUpperCase();\n const options = {\n credentials: 'same-origin',\n headers: {\n 'dexf-api-key': this.dexfApiKey,\n authorization: 'Bearer ' + token\n }\n };\n const response = yield ServiceFetch_1.default.json(url, options);\n if (!response && !response['designId']) {\n throw new exceptions_1.ServiceException('Failed to fetch from configuration from DEXF save service API. No data in response.');\n }\n return this.getSaveConfigurationObject(response);\n });\n }\n /**\n * Fetches and returns users configurations.\n *\n * @param token\n * @param options To optimize the payload size, you can use the different filters. Look at: .\n * @param options.latest Exclude previous versions of configurations, latest only.\n * @param options.excludeImages Skip images from the response.\n * @param options.filter Desired applications instead of retrieving all configurations associated with the user.\n *\n */\n getConfigurations(token, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.authUtility.isTokenValid(token)) {\n throw new exceptions_1.ServiceException('Invalid JWT token is provided.');\n }\n const { latest, filter, excludeImages = false } = options;\n // Optional to decide if we only want the latest versions.\n const url = latest ? this.endpoint + '?filter.latest=' + latest : this.endpoint;\n const promises = [];\n try {\n if (filter) {\n filter.map((filterItem) => promises.push(this.getSaveConfigurations(token, url + '?filter.appId=' + filterItem)));\n }\n else {\n promises.push(this.getSaveConfigurations(token, url));\n }\n const configurations = yield Promise.all(promises);\n const designList = configurations.flatMap((c) => c.designList);\n if (excludeImages) {\n return { designList };\n }\n return this.fetchImagesForDesignList(token, designList);\n }\n catch (error) {\n throw new exceptions_1.ServiceException('Failed to fetch list of configurations from DEXF save service API.');\n }\n });\n }\n /**\n * Saves a planner configuration.\n *\n * @param token\n * @param configurationDescription\n * @param configuration\n * @param shoppingItems\n * @param configurationImage\n * @param insightsCombinationFormat\n * @param options\n */\n saveConfiguration(token, options) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.authUtility.isTokenValid(token)) {\n throw new exceptions_1.ServiceException('Invalid JWT token is provided.');\n }\n // TODO: Remove prefix when DEXF API is updated.\n const designName = this.prefix + new Date().toISOString();\n // We try to save the configuration.\n const response = yield ServiceFetch_1.default.json(this.endpoint, {\n method: 'POST',\n body: this.getRequestBody(options, designName),\n credentials: 'same-origin',\n headers: {\n 'dexf-api-key': this.dexfApiKey,\n 'content-type': 'application/json',\n authorization: 'Bearer ' + token\n }\n });\n // We do transform our response so if configuration has been saved we will transform it.\n if (response && response['designId']) {\n const configurationResponse = {\n designId: response['designId'],\n name: designName,\n description: options.configurationDescription,\n configurationVersion: this.dexfConfigurationSchemaVersion,\n appId: this.dexfApplicationId,\n configuration: options.configuration\n };\n // If there is only one image we will add typeCode or we will make a list with the images and links.\n if (options.configurationImage) {\n const images = [];\n if (typeof options.configurationImage === 'string') {\n images.push({\n typeCode: 'main-design-image',\n image: options.configurationImage\n });\n }\n else if (Array.isArray(options.configurationImage)) {\n images.push(...options.configurationImage);\n }\n const imageResponse = yield Promise.all(images.map((image) => this.saveImage(token, response['_links'], image.image, image.typeCode)));\n return Object.assign(Object.assign({}, configurationResponse), { imageUrl: imageResponse });\n }\n return configurationResponse;\n }\n // TODO: I think it is expected that an error is thrown if we fail to save the configuration.\n return null;\n });\n }\n /**\n * Save image to save service dexf.\n *\n * @param token\n * @param links\n * @param configurationImage\n * @param typeCode\n * @returns Promise object.\n */\n saveImage(token, links, configurationImage, typeCode) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n const options = {\n method: 'POST',\n body: configurationImage,\n credentials: 'same-origin',\n headers: {\n 'dexf-api-key': this.dexfApiKey,\n 'content-type': 'text/plain;charset=UTF-8',\n authorization: 'Bearer ' + token\n }\n };\n const response = yield ServiceFetch_1.default.json(links[typeCode].href, options);\n return {\n typeCode,\n url: response['url']\n };\n }\n catch (error) {\n throw new exceptions_1.ServiceException('Failed to save image. Error: ' + error);\n }\n });\n }\n /**\n * To display the necessary configuration images, we need to iterate through the designList array,\n * retrieve the images for each configuration, and return them to the user/application.\n * We must retrieve the images ourselves as they are not included in the initial response from DEXF.\n *\n * @param token\n * @param designList\n */\n fetchImagesForDesignList(token, designList) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // We iterate through the designList, retrieve the configuration image URLs, and add them to our configurationItem/response object.\n const promises = designList.map((configurationItem) => __awaiter(this, void 0, void 0, function* () {\n const configuration = yield this.getConfiguration(token, configurationItem.designId);\n configurationItem.imageUrl = configuration.imageUrl;\n return configurationItem;\n }));\n // We wait for all promises to resolve before returning the new list of configurations and images.\n const configurations = yield Promise.all(promises);\n return {\n designList: configurations\n };\n }\n catch (error) {\n throw new exceptions_1.ServiceException('Failed to fetch configuration from DEXF save service API.');\n }\n });\n }\n /**\n * Returns payload to be used when saving a configuration.\n *\n * @param configurationDescription\n * @param configuration\n * @param shoppingItems\n * @param insightsCombinationFormat\n * @param options\n * @param designName\n * @returns Parsed data.\n */\n getRequestBody(options, designName) {\n const body = {\n appId: this.dexfApplicationId,\n itemList: {\n items: options.shoppingItems.map((item) => {\n return { itemType: item.type, itemNo: item.id, quantity: item.quantity };\n })\n },\n // TODO: Remove prefix when DEXF API is updated.\n name: designName,\n description: options.configurationDescription,\n version: 1,\n configuration: {\n version: this.dexfConfigurationSchemaVersion,\n content: options.configuration\n }\n };\n if (options.insightsCombinationFormat) {\n Object.assign(body, {\n icf: {\n version: this.dexfIcfVersion,\n content: options.insightsCombinationFormat\n }\n });\n }\n return JSON.stringify(body);\n }\n /**\n * @param response\n */\n getSaveConfigurationObject(response) {\n var _a;\n return {\n designId: response['designId'],\n name: response['name'],\n description: response['description'],\n appId: response['appId'].toUpperCase(),\n configuration: response['configuration'].content,\n configurationVersion: this.dexfConfigurationSchemaVersion,\n imageUrl: response['image'],\n itemList: ((_a = response['itemList']) === null || _a === void 0 ? void 0 : _a.items)\n ? this.getShoppingItemList(response['itemList'])\n : undefined\n };\n }\n /**\n * @param token\n * @param url\n */\n getSaveConfigurations(token, url) {\n return __awaiter(this, void 0, void 0, function* () {\n const headers = {\n credentials: 'same-origin',\n headers: {\n 'dexf-api-key': this.dexfApiKey,\n authorization: 'Bearer ' + token\n }\n };\n return yield ServiceFetch_1.default.json(url, headers);\n });\n }\n /**\n * @param itemList\n */\n getShoppingItemList(itemList) {\n return itemList.items.map((item) => ({\n id: item.itemNo,\n type: item.itemType,\n quantity: item.quantity\n }));\n }\n}\nexports.default = DexfSaveService;\n//# sourceMappingURL=DexfSaveService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst DexfSaveService_1 = __importDefault(require(\"../../services/save-service/DexfSaveService\"));\nconst DexfConfiguration_1 = __importDefault(require(\"../../utilities/DexfConfiguration\"));\n/**\n * This class is used as a simple interface for Save Services.\n */\nclass SaveService {\n /**\n * Constructor.\n *\n * @param options Options.\n */\n constructor(options) {\n this.applicationName = options.applicationName;\n this.dexfApplicationId = options.dexfApplicationId || null;\n this.dexfConfigurationSchemaVersion = options.dexfConfigurationSchemaVersion;\n this.dexfConfiguration = new DexfConfiguration_1.default(options);\n }\n /**\n * Fetches and returns a save to profile configuration.\n *\n * @param token\n * @param id Design ID.\n * @returns Configuration: ISaveConfiguration.\n * @throws Will throw error if configuration is not found.\n */\n getConfiguration(token, id) {\n return __awaiter(this, void 0, void 0, function* () {\n const service = yield this.getService();\n return yield service.getConfiguration(token, id);\n });\n }\n /**\n * This will fetch and retrieve a list of all configurations the user have saved to profile.\n *\n * @param token\n * @param options To optimize the payload size, you can use the different filters. Look at: .\n * @param options.latest Exclude previous versions of configurations, latest only.\n * @param options.excludeImages Skip images from the response.\n * @param options.filter Desired applications instead of retrieving all configurations associated with the user.\n *\n */\n getConfigurations(token, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const service = yield this.getService();\n return yield service.getConfigurations(token, options);\n });\n }\n /**\n * Saves the planner design for the customer.\n *\n * @param token\n * @param options\n * @returns We will return the configuration if saved succesfully or we will return null if token is not valid or configurations was not saved.\n */\n saveConfiguration(token, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const service = yield this.getService();\n return yield service.saveConfiguration(token, options);\n });\n }\n /**\n * Returns service.\n *\n * @returns Service.\n */\n getService() {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const dexfApiKey = yield this.dexfConfiguration.getDexfApiKeyOrThrow();\n switch (kompis.serviceSettings.saveDataSource) {\n case enums_1.SaveDataSourceEnum.disabled:\n throw new exceptions_1.ServiceException('The saveDataSource is set to \"disabled\". When it is, the SaveService is not available on the market and the login functionality together with related features, should be hidden.');\n default:\n return new DexfSaveService_1.default({\n endpoint: kompis.endpoints.dexfSaveService,\n dexfApplicationId: this.dexfApplicationId || this.applicationName,\n dexfApiKey,\n dexfConfigurationSchemaVersion: this.dexfConfigurationSchemaVersion\n });\n }\n });\n }\n}\nexports.default = SaveService;\n//# sourceMappingURL=SaveService.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ChinaAuthenticationServiceCookieNameEnum;\n(function (ChinaAuthenticationServiceCookieNameEnum) {\n ChinaAuthenticationServiceCookieNameEnum[\"accessToken\"] = \"accessToken\";\n ChinaAuthenticationServiceCookieNameEnum[\"refreshToken\"] = \"refreshToken\";\n})(ChinaAuthenticationServiceCookieNameEnum || (ChinaAuthenticationServiceCookieNameEnum = {}));\nexports.default = ChinaAuthenticationServiceCookieNameEnum;\n//# sourceMappingURL=ChinaAuthenticationServiceCookieNameEnum.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst ServiceFetch_1 = __importDefault(require(\"../../../utilities/ServiceFetch\"));\nconst ChinaAuthenticationServiceCookieNameEnum_1 = __importDefault(require(\"./ChinaAuthenticationServiceCookieNameEnum\"));\n/**\n * This service is used for handling authentication in China.\n */\nclass ChinaAuthenticationService {\n /**\n * Constructor.\n *\n * @param options\n * @param options.endpoint\n * @param options.refreshTokenEndpoint\n * @param options.loginPageEndpoint\n * @param options.refreshTokenEndpoint\n * @param options.loginPageEndpoint\n */\n constructor(options) {\n this.loginIntervalTime = 500;\n this.refreshTokenEndpoint = options.refreshTokenEndpoint;\n this.loginPageEndpoint = options.loginPageEndpoint;\n }\n /**\n * Authenticates and returns token.\n *\n * @returns Promise.\n */\n getToken() {\n return __awaiter(this, void 0, void 0, function* () {\n const accessToken = this.getCookie(ChinaAuthenticationServiceCookieNameEnum_1.default.accessToken);\n const refreshToken = this.getCookie(ChinaAuthenticationServiceCookieNameEnum_1.default.refreshToken);\n if (accessToken) {\n return accessToken;\n }\n else if (refreshToken) {\n return yield this.refreshAccessToken(refreshToken);\n }\n return yield this.login();\n });\n }\n /**\n * Request the user to login.\n *\n * @returns Access token.\n */\n login() {\n return new Promise((resolve, reject) => {\n this.removeCookie(ChinaAuthenticationServiceCookieNameEnum_1.default.accessToken);\n this.removeCookie(ChinaAuthenticationServiceCookieNameEnum_1.default.refreshToken);\n const popup = window.open(this.loginPageEndpoint);\n let intervalId = null;\n intervalId = setInterval(() => {\n const accessToken = this.getCookie(ChinaAuthenticationServiceCookieNameEnum_1.default.accessToken);\n if (accessToken) {\n intervalId && clearInterval(intervalId);\n popup === null || popup === void 0 ? void 0 : popup.close();\n resolve(accessToken);\n }\n else if (popup === null || popup === void 0 ? void 0 : popup.closed) {\n reject(new exceptions_1.ServiceException('Failed to login. The popup was closed.'));\n }\n }, this.loginIntervalTime);\n });\n }\n /**\n * @returns \"true\" if access and/or refresh token cookie exists.\n */\n hasCookie() {\n const accessToken = this.getCookie(ChinaAuthenticationServiceCookieNameEnum_1.default.accessToken);\n const refreshToken = this.getCookie(ChinaAuthenticationServiceCookieNameEnum_1.default.refreshToken);\n return accessToken !== null || refreshToken !== null;\n }\n /**\n * Refreshes the access token.\n *\n * @param refreshToken Refresh token.\n * @returns Access token.\n */\n refreshAccessToken(refreshToken) {\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield ServiceFetch_1.default.json(this.refreshTokenEndpoint, {\n method: 'post',\n credentials: 'same-origin',\n headers: {\n 'content-type': 'application/json',\n 'x-client-channel': 'WEB',\n 'x-client-platform': 'PcWeb',\n source: 'PLANNER'\n },\n body: JSON.stringify({\n refreshToken\n })\n });\n if (!response['data'] && response['code']) {\n if (response['code'] === 'InvalidParameter.Refresh.Token.Error') {\n return this.login();\n }\n throw new exceptions_1.ServiceException(`Failed to refresh access token. Error: ${response['code']}`);\n }\n this.setCookie(ChinaAuthenticationServiceCookieNameEnum_1.default.accessToken, response['data']['id_token'], response['data']['expires_in'] * 1000);\n return response['data']['id_token'];\n });\n }\n /**\n * Removes a cookie.\n *\n * @param name Name.\n */\n removeCookie(name) {\n this.setCookie(name, '', -1000);\n }\n /**\n * Sets a cookie.\n *\n * @param name Name.\n * @param value Value.\n * @param expiresIn Expires in.\n */\n setCookie(name, value, expiresIn) {\n const date = new Date();\n date.setTime(date.getTime() + expiresIn);\n document.cookie = `${name}=${value}; path=/; expires=${date.toUTCString()};`;\n }\n /**\n * Returns a cookie.\n *\n * @param name Name.\n * @returns Cookie value.\n */\n getCookie(name) {\n var _a;\n const cookie = document.cookie.match('(^|;)\\\\s*' + name + '\\\\s*=\\\\s*([^;]+)');\n return (_a = cookie === null || cookie === void 0 ? void 0 : cookie.pop()) !== null && _a !== void 0 ? _a : null;\n }\n}\nexports.default = ChinaAuthenticationService;\n//# sourceMappingURL=ChinaAuthenticationService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst ServiceFetch_1 = __importDefault(require(\"../../../../utilities/ServiceFetch\"));\n/**\n * This class handles adding items to the China cart.\n */\nclass ChinaCartService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.endpoint Endpoint.\n */\n constructor(options) {\n this.endpoint = options.endpoint;\n }\n /**\n * Adds items to shopping cart in IRW.\n *\n * @param options Options.\n * @param options.items Array of shopping items.\n * @param options.token Token.\n * @param options.designCode VPC/design code to group articles in checkout.\n * @returns Promise object.\n */\n addToCart(options) {\n return __awaiter(this, void 0, void 0, function* () {\n yield ServiceFetch_1.default.json(`${this.endpoint}/add-planner-design-to-cart`, {\n method: 'post',\n credentials: 'same-origin',\n headers: this.getHeaders(options.token),\n body: this.getAddToCartBody(options.items, options.designCode)\n });\n const cartCount = yield this.getCartCount(options);\n return {\n cartCount,\n errorList: []\n };\n });\n }\n /**\n * Returns cart count for a shopping cart.\n *\n * @param options Options.\n * @param options.token Token.\n * @returns Promise object.\n */\n getCartCount(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield ServiceFetch_1.default.json(this.endpoint, {\n method: 'get',\n credentials: 'same-origin',\n headers: this.getHeaders(options.token)\n });\n let quantity = 0;\n for (const item of response['items']) {\n quantity += item.quantity;\n }\n return quantity;\n });\n }\n /**\n * Returns the body.\n *\n * @param items Items.\n * @param designCode VPC Code to group articles with.\n * @returns Add to cart body.\n */\n getAddToCartBody(items, designCode) {\n return JSON.stringify({\n products: items.map((item) => ({\n productFullId: (item.type.toUpperCase() === 'SPR' ? 's' : '') + item.id,\n quantity: item.quantity\n })),\n designCode\n });\n }\n /**\n * Returns headers.\n *\n * @param token Token.\n * @returns Headers.\n */\n getHeaders(token) {\n return {\n 'content-type': 'application/json',\n 'x-client-channel': 'WEB',\n 'x-client-platform': 'PcWeb',\n authorization: `Bearer ${token}`\n };\n }\n}\nexports.default = ChinaCartService;\n//# sourceMappingURL=ChinaCartService.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = {\n 10001: 'INVALID_ITEM_NUMBER'\n};\n//# sourceMappingURL=IksaShoppingBagErrorCodes.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst ServiceFetch_1 = __importDefault(require(\"../../../utilities/ServiceFetch\"));\nconst IksaShoppingBagErrorCodes_1 = __importDefault(require(\"./IksaShoppingBagErrorCodes\"));\n/**\n * This class handles CRUD operations for IKSA shopping cart API.\n */\nclass IksaShoppingBagService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.consumer Consumer.\n * @param options.contract Contract.\n * @param options.endpoint Endpoint.\n */\n constructor(options) {\n this.consumer = options.consumer;\n this.contract = options.contract;\n this.endpoint = options.endpoint;\n }\n /**\n * Adds items to shopping cart.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.items Array of shopping items.\n * @returns Promise object.\n */\n addToCart(options) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this.addToBag({\n userId: options.userId,\n items: options.items,\n shoppingBagType: enums_1.IksaShoppingBagTypeEnum.cart\n });\n });\n }\n /**\n * Adds items to shopping list.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.items Array of shopping items.\n * @param options.shoppingListName List name.\n * @returns Promise object.\n */\n addToList(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const cart = yield this.addToBag({\n userId: options.userId,\n items: options.items,\n shoppingBagType: enums_1.IksaShoppingBagTypeEnum.list,\n shoppingListName: options.shoppingListName\n });\n return { listCount: cart.cartCount, errorList: cart.errorList };\n });\n }\n /**\n * Returns cart count for a shopping cart.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @returns Promise object.\n */\n getCartCount(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const cartInfo = yield this.getCartInfo({\n userId: options.userId,\n shoppingBagType: enums_1.IksaShoppingBagTypeEnum.cart\n });\n return cartInfo\n ? (yield this.getCart({\n userId: options.userId,\n shoppingBagType: enums_1.IksaShoppingBagTypeEnum.cart,\n cartId: cartInfo.id\n })).cartCount\n : 0;\n });\n }\n /**\n * Returns list count from a shopping list.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.shoppingListName List name.\n * @returns Promise object.\n */\n getListCount(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const cartInfo = yield this.getCartInfo({\n userId: options.userId,\n shoppingBagType: enums_1.IksaShoppingBagTypeEnum.list,\n shoppingListName: options.shoppingListName\n });\n return cartInfo\n ? (yield this.getCart({\n userId: options.userId,\n shoppingBagType: enums_1.IksaShoppingBagTypeEnum.list,\n cartId: cartInfo.id\n })).cartCount\n : 0;\n });\n }\n /**\n * Adds items to shopping bag.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.items Array of shopping items.\n * @param options.shoppingBagType Cart type.\n * @param options.shoppingListName List name.\n * @returns Promise of ICart.\n */\n addToBag(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const cartInfo = yield this.getCartInfo({\n userId: options.userId,\n shoppingBagType: options.shoppingBagType\n });\n if (cartInfo !== null) {\n return yield this.updateShoppingBagItems(Object.assign(Object.assign({}, options), { cartId: cartInfo.id }));\n }\n return yield this.createBag({\n items: options.items,\n userId: options.userId,\n shoppingBagType: options.shoppingBagType,\n shoppingListName: options.shoppingListName\n });\n });\n }\n /**\n * Returns cart information (name and id) if a cart exists.\n * Returns null if the cart doesn't exist.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.shoppingBagType Cart type.\n * @param options.shoppingListName List name.\n * @returns Promise of IIksaShoppingBagCartInfo or null.\n */\n getCartInfo(options) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield ServiceFetch_1.default.json(this.getEndpointUrl(options.userId, options.shoppingBagType), {\n headers: this.getHeaders(),\n credentials: 'include'\n });\n const iksaResponse = response;\n if (iksaResponse.length === 0) {\n return null;\n }\n const cart = iksaResponse[0];\n return {\n id: cart.bagId,\n type: cart.bagType,\n name: (_a = options.shoppingListName) !== null && _a !== void 0 ? _a : null\n };\n });\n }\n /**\n * Returns a shopping cart.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.cartId Cart id.\n * @param options.shoppingBagType Cart type.\n * @returns Promise object.\n */\n getCart(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const endpointUrl = this.getEndpointUrl(options.userId, options.shoppingBagType);\n const url = `${endpointUrl}/${options.cartId}`;\n const response = yield ServiceFetch_1.default.json(url, {\n headers: this.getHeaders(),\n credentials: 'include'\n });\n return this.parseShoppingBagResponse(response);\n });\n }\n /**\n * @param response The response to parse.\n * @returns ICart parsed from response.\n */\n parseShoppingBagResponse(response) {\n if ('errorList' in response) {\n return this.parseShoppingBagErrorResponse(response);\n }\n return this.parseShoppingBagSuccessResponse(response);\n }\n /**\n * @param response The error response to parse.\n * @returns ICart parsed from error response.\n */\n parseShoppingBagErrorResponse(response) {\n var _a, _b;\n const errorList = [];\n for (const error of response.errorList) {\n const items = [];\n for (const attributes of (_a = error.errorAttributeList) !== null && _a !== void 0 ? _a : []) {\n items.push(attributes.value);\n }\n const code = error.errorCode ? IksaShoppingBagErrorCodes_1.default[error.errorCode] : null;\n errorList.push({\n message: (_b = error.errorMessage) !== null && _b !== void 0 ? _b : '',\n code: code !== null && code !== void 0 ? code : '',\n items\n });\n }\n return {\n cartCount: null,\n errorList\n };\n }\n /**\n * @param response The success response to parse.\n * @returns ICart parsed from success response.\n */\n parseShoppingBagSuccessResponse(response) {\n var _a;\n const itemList = (_a = response.shoppingBagSectionList) === null || _a === void 0 ? void 0 : _a[0];\n if (!itemList || !itemList.shoppingBagItemList) {\n throw new exceptions_1.ServiceException('Unexpected shopping bag response!');\n }\n let cartCount = 0;\n const items = itemList.shoppingBagItemList;\n for (const item of items) {\n cartCount += Number(item.itemQty);\n }\n return { cartCount, errorList: [] };\n }\n /**\n * Updates shopping bag items.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.shoppingBagType Cart type.\n * @param options.cartId Cart id.\n * @param options.items Items to use.\n * @returns Promise object.\n */\n updateShoppingBagItems(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const endpointUrl = this.getEndpointUrl(options.userId, options.shoppingBagType);\n const url = `${endpointUrl}/${options.cartId}/items`;\n const response = yield ServiceFetch_1.default.text(url, {\n method: 'PUT',\n headers: this.getHeaders(),\n credentials: 'include',\n body: JSON.stringify(this.createUpdateShoppingBagItemsRequestBody(options.items))\n });\n if (typeof response === 'string' && response.startsWith('{\"errorList\"')) {\n return this.parseShoppingBagErrorResponse(JSON.parse(response));\n }\n return yield this.getCart(options);\n });\n }\n /**\n * @param items The shopping items to add to shopping bag.\n * @returns Request body including the shopping items.\n */\n createUpdateShoppingBagItemsRequestBody(items) {\n const itemList = [];\n for (const item of items) {\n this.validateItem(item);\n itemList.push({\n itemType: item.type,\n itemNo: item.id,\n itemQty: item.quantity\n });\n }\n return itemList;\n }\n /**\n * Creates a shopping bag.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.shoppingBagType Cart type.\n * @param options.items Items to use.\n * @param options.shoppingListName List name.\n * @returns Promise of ICart.\n */\n createBag(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const url = this.getEndpointUrl(options.userId, options.shoppingBagType);\n const modelOptions = {\n userId: options.userId,\n items: options.items,\n shoppingBagType: options.shoppingBagType,\n shoppingListName: options.shoppingListName\n };\n const response = yield ServiceFetch_1.default.json(url, {\n method: 'POST',\n headers: this.getHeaders(),\n credentials: 'include',\n body: JSON.stringify(this.createShoppingCartRequestBody(modelOptions))\n });\n return this.parseShoppingBagResponse(response);\n });\n }\n /**\n * Generates a shopping cart request body.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.shoppingBagType Cart type.\n * @param options.items Items to use.\n * @param options.shoppingListName List name.\n * @returns Shopping cart request body.\n */\n createShoppingCartRequestBody(options) {\n const shoppingListName = options.shoppingListName || options.shoppingBagType;\n return {\n bagType: options.shoppingBagType.toUpperCase(),\n bagSource: 'IRW',\n bagName: shoppingListName,\n customerSource: 'IRW',\n customerId: options.userId,\n createdDateTime: this.getCreatedTime(),\n shoppingBagSectionList: [\n {\n shoppingBagItemList: options.items.map((item) => {\n this.validateItem(item);\n return {\n itemType: item.type.toUpperCase(),\n itemNo: item.id,\n itemQty: item.quantity.toString()\n };\n })\n }\n ]\n };\n }\n /**\n * @param item A shopping item.\n * @throws ServiceException if item is invalid.\n */\n validateItem(item) {\n if (typeof item.id !== 'string' ||\n typeof item.type !== 'string' ||\n typeof item.quantity !== 'number') {\n throw new exceptions_1.ServiceException('Item was not in a valid format. Please use this format: { id: \"123456\", type: \"ART\", quantity: 1 }');\n }\n }\n /**\n * Returns headers to be used by requests.\n *\n * @returns Object as key value pairs of headers.\n */\n getHeaders() {\n return {\n accept: 'application/vnd.middleware-v1+json',\n contract: this.contract,\n consumer: this.consumer,\n 'content-type': 'application/json'\n };\n }\n /**\n * Returns endpoint URL.\n *\n * @param userId User id.\n * @param shoppingBagType Bag type.\n * @returns Endpoint url.\n */\n getEndpointUrl(userId, shoppingBagType) {\n return this.endpoint.replace('{userId}', userId).replace('{bagType}', shoppingBagType);\n }\n /**\n * Returns a date ISO string of the current time.\n *\n * @returns Date ISO string.\n */\n getCreatedTime() {\n return new Date().toISOString();\n }\n}\nexports.default = IksaShoppingBagService;\n//# sourceMappingURL=IksaShoppingBagService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst ServiceFetch_1 = __importDefault(require(\"../../../../utilities/ServiceFetch\"));\n/**\n * This class handles adding items to the One Web cart.\n *\n * GraphQL Playground: https://cart.oneweb.ingkadt.com/playground.\n */\nclass IngkaCartService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.locale Locale.\n * @param options.endpoint Endpoint.\n * @param options.clientId Client ID.\n * @param options.clientSecret Client secret.\n * @param options.itemGroupingInBagEnabled Setting if grouping in bag is enabled on the market.\n */\n constructor(options) {\n this.endpoint = options.endpoint;\n this.clientId = options.clientId;\n this.clientSecret = options.clientSecret;\n this.itemGroupingInBagEnabled = options.itemGroupingInBagEnabled;\n }\n /**\n * Adds items to the shopping cart.\n *\n * @param options Options.\n * @param options.items Array of shopping items.\n * @param options.token One web token.\n * @param options.designCode Design code (VPC-code) to group articles in checkout and assembly services.\n * @param options.addDesignCodeAsGroup Boolean to group the articles or not in cart.\n * @param options.singleItems Single items to be added individually outside the group.\n * @returns Promise object.\n */\n addToCart(options) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const { designCode, addDesignCodeAsGroup, items, token, singleItems } = options;\n if (!designCode && addDesignCodeAsGroup) {\n throw new exceptions_1.ServiceException(\"Can't add as a group to cart when no design code has been provided.\");\n }\n const addItemsAsGroup = !!designCode && !!addDesignCodeAsGroup && this.itemGroupingInBagEnabled;\n const response = yield ServiceFetch_1.default.json(this.endpoint, {\n credentials: 'same-origin',\n body: this.getAddToCartBody(items, addItemsAsGroup, designCode, singleItems),\n method: 'POST',\n headers: this.getHeaders(token)\n });\n return {\n cartCount: (_a = (yield this.getCartCount({ token }))) !== null && _a !== void 0 ? _a : null,\n errorList: this.getErrorList(response)\n };\n });\n }\n /**\n * Returns cart count for a shopping cart.\n *\n * @param options Options.\n * @param options.token One web token.\n * @returns Promise object.\n */\n getCartCount(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield ServiceFetch_1.default.json(this.endpoint, {\n credentials: 'same-origin',\n method: 'POST',\n headers: this.getHeaders(options.token),\n body: this.getCartCountBody()\n });\n return response['data'].cart.quantity;\n });\n }\n /**\n * Returns the body.\n *\n * @param items Items.\n * @param storedDesignCode Current design code.\n * @param designCode New design code to be stored.\n * @param addItemsAsGroup Boolean to group the articles or not in cart.\n * @param singleItems Single items to be added individually outside the group.\n * @returns Add to cart body.\n */\n getAddToCartBody(items, addItemsAsGroup, designCode, singleItems) {\n let mutation = '';\n if (!addItemsAsGroup) {\n mutation = this.getAddItemsMutation(items);\n }\n else if (singleItems) {\n mutation = this.getAddItemsMutation(singleItems);\n }\n if (designCode) {\n const addPlannersMutation = `addPlanners(input: {codes: [\"${designCode}\"], shouldExpand: ${addItemsAsGroup}}) {planners {code, created}}`;\n mutation = mutation\n ? `${mutation}\n\t\t\t${addPlannersMutation}`\n : addPlannersMutation;\n }\n return JSON.stringify({\n operationName: null,\n variables: {},\n query: `mutation {${mutation}}`\n });\n }\n getAddItemsMutation(items) {\n const itemsString = `[${items.map((item) => {\n return `{ itemNo: \"${item.id}\", quantity: ${item.quantity} }`;\n })}]`;\n return `addItems(items: ${itemsString}) { quantity }`;\n }\n /**\n * Returns cart count body.\n *\n * @returns Cart count body.\n */\n getCartCountBody() {\n return JSON.stringify({\n operationName: null,\n variables: {},\n query: '{cart{context{userId retailId isAnonymous}checksum quantity}}'\n });\n }\n /**\n * Returns an error list.\n *\n * @param response Response.\n * @returns Error list.\n */\n getErrorList(response) {\n const errors = response['errors'];\n if (errors) {\n return errors.map((error) => {\n return {\n code: error.extensions ? error.extensions.code : null,\n message: error.message,\n items: error.extensions && error.extensions.data && error.extensions.data.itemNos\n ? error.extensions.data.itemNos\n : null\n };\n });\n }\n return [];\n }\n /**\n * Returns headers.\n *\n * @param token Token.\n * @returns Headers.\n */\n getHeaders(token) {\n const headers = {\n 'Content-Type': 'application/json',\n Authorization: 'Bearer ' + token.value,\n Accept: 'application/json',\n 'x-client-id': this.clientId,\n 'x-client-secret': this.clientSecret\n // The below can be used for accessing GraphQL Playground:\n // 'x-user-id': '2008c852-8b33-48f6-b5ef-45add754cdf5',\n // 'x-is-anonymous': true,\n };\n return headers;\n }\n}\nexports.default = IngkaCartService;\n//# sourceMappingURL=IngkaCartService.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = {\n 10001: 'INVALID_ITEM_NUMBER'\n};\n//# sourceMappingURL=IowsShoppingBagErrorCodes.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst ServiceFetch_1 = __importDefault(require(\"../../../utilities/ServiceFetch\"));\nconst IowsShoppingBagErrorCodes_1 = __importDefault(require(\"./IowsShoppingBagErrorCodes\"));\n/**\n * This class handles CRUD operations for IOWS shopping cart API.\n */\nclass IowsShoppingBagService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.consumer Consumer.\n * @param options.contract Contract.\n * @param options.endpoint Endpoint.\n * @param options.clientId Client ID.\n * @param options.clientSecret Client secret.\n */\n constructor(options) {\n this.consumer = options.consumer;\n this.contract = options.contract;\n this.endpoint = options.endpoint;\n }\n /**\n * Adds items to shopping cart in IRW.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.items Array of shopping items.\n * @returns Promise object.\n */\n addToCart(options) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.addToBag({\n userId: options.userId,\n items: options.items,\n shoppingBagType: enums_1.IowsShoppingBagTypeEnum.cart\n });\n });\n }\n /**\n * Adds items to shopping list in IRW.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.items Array of shopping items.\n * @param options.shoppingListName List name.\n * @returns Promise object.\n */\n addToList(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const cart = yield this.addToBag({\n userId: options.userId,\n items: options.items,\n shoppingBagType: enums_1.IowsShoppingBagTypeEnum.list,\n shoppingListName: options.shoppingListName\n });\n return {\n errorList: cart.errorList,\n listCount: cart.cartCount\n };\n });\n }\n /**\n * Returns cart count for a shopping cart.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @returns Promise object.\n */\n getCartCount(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const cartInfo = yield this.getCartInfo({\n userId: options.userId,\n shoppingBagType: enums_1.IowsShoppingBagTypeEnum.cart\n });\n if (cartInfo === null) {\n return 0;\n }\n return this.getCartCountFromCart({\n userId: options.userId,\n shoppingBagType: enums_1.IowsShoppingBagTypeEnum.cart,\n cartId: cartInfo.id\n });\n });\n }\n /**\n * Returns list count from a shopping list.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.shoppingListName List name.\n * @returns Promise object.\n */\n getListCount(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const cartInfo = yield this.getCartInfo({\n userId: options.userId,\n shoppingBagType: enums_1.IowsShoppingBagTypeEnum.list,\n shoppingListName: options.shoppingListName\n });\n if (cartInfo === null) {\n return 0;\n }\n return this.getCartCountFromCart({\n userId: options.userId,\n shoppingBagType: enums_1.IowsShoppingBagTypeEnum.list,\n cartId: cartInfo.id\n });\n });\n }\n /**\n * Adds items to shopping cart in IRW.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.items Array of shopping items.\n * @param options.shoppingBagType Cart type. Valid values: \"cart\", \"list\".\n * @param options.shoppingListName List name.\n * @returns Promise object.\n */\n addToBag(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const cartInfo = yield this.getCartInfo(options);\n if (cartInfo !== null) {\n const updateOptions = Object.assign({}, options, { cartId: cartInfo.id });\n const updateInfo = yield this.updateCartItems(updateOptions);\n if (updateInfo.cartCount === null) {\n updateInfo.cartCount = yield this.getCartCountFromCart(updateOptions);\n }\n return updateInfo;\n }\n return yield this.createCart(options);\n });\n }\n /**\n * Returns cart count for a shopping cart.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.cartId Cart id.\n * @param options.shoppingBagType Cart type.\n * @returns Promise object.\n */\n getCartCountFromCart(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const cart = yield this.getCart(options);\n return cart.cartCount;\n });\n }\n /**\n * Returns cart information (name and id) if a cart exists.\n * Returns null if the cart doesn't exist.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.shoppingBagType Cart type.\n * @param [options.shoppingListName] List name.\n * @returns Promise object.\n */\n getCartInfo(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield ServiceFetch_1.default.json(this.getEndpointUrl(options.userId, options.shoppingBagType), {\n headers: this.getHeaders(),\n credentials: 'include'\n });\n return this.parseCartInfo({\n response: response,\n shoppingListName: options.shoppingListName\n });\n });\n }\n /**\n * Returns a shopping cart.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.cartId Cart id.\n * @param options.shoppingBagType Cart type.\n * @returns Promise object.\n */\n getCart(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const url = this.getEndpointUrl(options.userId, options.shoppingBagType) + '/' + options.cartId;\n const response = yield ServiceFetch_1.default.json(url, {\n headers: this.getHeaders(),\n credentials: 'include'\n });\n return {\n errorList: [],\n cartCount: this.calculateCartCountFromResponse(response)\n };\n });\n }\n /**\n * Creates a shopping cart.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.shoppingBagType Cart type.\n * @param options.items Items to use.\n * @param [options.shoppingListName] List name.\n * @returns Promise object.\n */\n createCart(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const url = this.getEndpointUrl(options.userId, options.shoppingBagType);\n const modelOptions = {\n userId: options.userId,\n items: options.items,\n shoppingBagType: options.shoppingBagType,\n shoppingListName: options.shoppingListName\n };\n const response = yield ServiceFetch_1.default.json(url, {\n method: 'POST',\n headers: this.getHeaders(),\n credentials: 'include',\n body: 'list=' + JSON.stringify(this.createShoppingCartModel(modelOptions))\n });\n return this.parseResponse(response);\n });\n }\n /**\n * Updates shopping cart items.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.shoppingBagType Cart type.\n * @param options.cartId Cart id.\n * @param options.items Items to use.\n * @returns Promise object.\n */\n updateCartItems(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const endpointUrl = this.getEndpointUrl(options.userId, options.shoppingBagType);\n const url = endpointUrl + '/' + options.cartId + '/items';\n const response = yield ServiceFetch_1.default.text(url, {\n method: 'PUT',\n headers: this.getHeaders(),\n credentials: 'include',\n body: 'list=' + JSON.stringify(this.createItemsAdjustmentListModel(options.items))\n });\n if (typeof response === 'string' && response.startsWith('{')) {\n return this.parseResponse(JSON.parse(response));\n }\n return {\n cartCount: null,\n errorList: []\n };\n });\n }\n /**\n * Parses response.\n *\n * @param response Response.\n * @returns Promise object.\n */\n parseResponse(response) {\n const cartCount = this.calculateCartCountFromResponse(response);\n const parsed = {\n cartCount,\n errorList: []\n };\n if (typeof response === 'object' && response !== null && response.ErrorList) {\n const errorObject = response.ErrorList.Error;\n const errorList = Array.isArray(errorObject) ? errorObject : [errorObject];\n for (const error of errorList) {\n const errorMessage = error.ErrorMessage || {};\n const errorCode = error.ErrorCode || {};\n const message = errorMessage.$ ? errorMessage.$ : null;\n const code = errorCode.$ ? errorCode.$ : null;\n const items = [];\n if (error.ErrorAttributeList && Array.isArray(error.ErrorAttributeList.ErrorAttribute)) {\n for (const attribute of error.ErrorAttributeList.ErrorAttribute) {\n if (attribute.Value && attribute.Value.$) {\n items.push(String(attribute.Value.$));\n }\n }\n }\n parsed.errorList.push({\n code: IowsShoppingBagErrorCodes_1.default[code] || String(code),\n message,\n items\n });\n }\n }\n return parsed;\n }\n /**\n * Calculates cart count from data.\n *\n * @param response Data returned from the response.\n * @returns Cart count or error object.\n */\n calculateCartCountFromResponse(response) {\n const bag = response.ShoppingBag || {};\n bag.ShoppingBagSectionList = bag.ShoppingBagSectionList || {};\n bag.ShoppingBagSectionList.ShoppingBagSection =\n bag.ShoppingBagSectionList.ShoppingBagSection || {};\n bag.BagType = bag.BagType || { $: '' };\n const isCart = bag.BagType.$ === 'ONLINESHOPPINGCART';\n const isList = bag.BagType.$ === 'ONLINESHOPPINGLIST';\n const itemList = bag.ShoppingBagSectionList.ShoppingBagSection.ShoppingBagItemList;\n let cartCount = null;\n if ((isCart || isList) && itemList) {\n const items = itemList.ShoppingBagItem;\n if (!items) {\n return null;\n }\n const array = Array.isArray(items) ? items : [items];\n cartCount = 0;\n for (const item of array) {\n if (item.ItemQty) {\n cartCount += item.ItemQty.$;\n }\n }\n }\n return cartCount;\n }\n /**\n * Parses cart data and returns cart info.\n *\n * @param options Options.\n * @param options.response Response.\n * @param [options.shoppingListName] List name.\n * @returns Parsed data.\n */\n parseCartInfo(options) {\n var _a, _b;\n const { response, shoppingListName } = options;\n let cartInfo = null;\n if (response.ShoppingBag && response.ShoppingBag.BagId) {\n cartInfo = {\n id: response.ShoppingBag.BagId.$,\n name: response.ShoppingBag.BagName && response.ShoppingBag.BagName.$\n ? response.ShoppingBag.BagName.$\n : null,\n type: response.ShoppingBag.BagType && response.ShoppingBag.BagType.$\n ? response.ShoppingBag.BagType.$.toLowerCase()\n : null\n };\n }\n else if (response.ShoppingBagRefList && response.ShoppingBagRefList.ShoppingBagRef) {\n if (Array.isArray(response.ShoppingBagRefList.ShoppingBagRef)) {\n for (const ref of response.ShoppingBagRefList.ShoppingBagRef) {\n if (ref.BagId &&\n (!ref.BagName ||\n !ref.BagName.$ ||\n !ref.BagType ||\n !ref.BagType.$ ||\n ref.BagName.$ === shoppingListName)) {\n cartInfo = {\n id: ref.BagId.$,\n name: ref.BagName && ref.BagName.$ ? ref.BagName.$ : null,\n type: ref.BagType && ref.BagType.$ ? ref.BagType.$.toLowerCase() : null\n };\n break;\n }\n }\n }\n else if (response.ShoppingBagRefList.ShoppingBagRef.BagId) {\n const ref = response.ShoppingBagRefList.ShoppingBagRef;\n cartInfo = {\n id: (_b = (_a = ref.BagId) === null || _a === void 0 ? void 0 : _a.$) !== null && _b !== void 0 ? _b : null,\n name: ref.BagName && ref.BagName.$ ? ref.BagName.$ : null,\n type: ref.BagType && ref.BagType.$ ? ref.BagType.$.toLowerCase() : null\n };\n }\n }\n if ((cartInfo === null || cartInfo === void 0 ? void 0 : cartInfo.type) && (cartInfo === null || cartInfo === void 0 ? void 0 : cartInfo.name) && (cartInfo === null || cartInfo === void 0 ? void 0 : cartInfo.name) !== shoppingListName) {\n return null;\n }\n return cartInfo;\n }\n /**\n * Generates a shopping cart model to be used as JSON.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.items Items to use.\n * @param options.shoppingBagType Cart type.\n * @param [options.shoppingListName] List name.\n * @param [options.cartId] Cart id.\n * @param options.bagId\n * @returns Shopping cart model.\n */\n createShoppingCartModel(options) {\n const shoppingListName = options.shoppingListName || options.shoppingBagType;\n const json = {\n ShoppingBag: {\n BagType: {\n $: options.shoppingBagType\n },\n BagSource: {\n $: 'IRW'\n },\n BagName: {\n $: shoppingListName\n },\n CustomerSource: {\n $: 'IRW'\n },\n CustomerId: {\n $: options.userId\n },\n CreatedDateTime: {\n $: this.getCreatedTime()\n },\n ShoppingBagSectionList: [\n {\n ShoppingBagSection: {\n ShoppingBagItemList: {\n ShoppingBagItem: []\n }\n }\n }\n ],\n '@xmlns': {\n $: 'ikea.com/cem/iows/ShoppingBagService/2.0/'\n }\n }\n };\n const list = json.ShoppingBag.ShoppingBagSectionList[0].ShoppingBagSection.ShoppingBagItemList\n .ShoppingBagItem;\n for (const item of options.items) {\n if (typeof item.id !== 'string' ||\n typeof item.type !== 'string' ||\n typeof item.quantity !== 'number') {\n throw new exceptions_1.ServiceException('Item was not in a valid format. Please use this format: { id: 123456, type: \"ART\", quantity: 1 }');\n }\n list.push({\n ItemType: {\n $: item.type.toUpperCase()\n },\n ItemNo: {\n $: item.id\n },\n ItemQty: {\n $: item.quantity\n }\n });\n }\n if (options.bagId) {\n json['BagId'] = {\n $: options.bagId\n };\n }\n return json;\n }\n /**\n * Generates a shopping cart adjustment list model to be used as JSON.\n *\n * @param items Items to use.\n * @returns Shopping cart model.\n */\n createItemsAdjustmentListModel(items) {\n const json = {\n ShoppingBagAdjustmentItemList: {\n ShoppingBagAdjustmentItem: [],\n '@xmlns': {\n $: 'ikea.com/cem/iows/ShoppingBagService/2.0/'\n }\n }\n };\n const list = json.ShoppingBagAdjustmentItemList.ShoppingBagAdjustmentItem;\n for (const item of items) {\n if (typeof item.id !== 'string' ||\n typeof item.type !== 'string' ||\n typeof item.quantity !== 'number') {\n throw new exceptions_1.ServiceException('Item was not in a valid format. Please use this format: { id: 123456, type: \"ART\", quantity: 1 }');\n }\n list.push({\n ItemType: {\n $: item.type.toUpperCase()\n },\n ItemNo: {\n $: item.id\n },\n ItemQty: {\n $: item.quantity\n },\n SectionId: {\n $: 0\n }\n });\n }\n return json;\n }\n /**\n * Returns headers to be used by requests.\n *\n * @returns Object as key value pairs of headers.\n */\n getHeaders() {\n return {\n accept: 'application/vnd.ikea.iows+json; version=2.0',\n 'auth-token': this.consumer + '-' + this.contract,\n contract: this.contract,\n consumer: this.consumer,\n 'content-type': 'application/x-www-form-urlencoded'\n };\n }\n /**\n * Returns endpoint URL.\n *\n * @param userId User id.\n * @param shoppingBagType Cart type. Valid values: \"cart\", \"list\".\n * @returns Endpoint url.\n */\n getEndpointUrl(userId, shoppingBagType) {\n return this.endpoint\n .replace('{userId}', userId)\n .replace('{bagType}', shoppingBagType.toLowerCase());\n }\n /**\n * Returns a date ISO string of the current time.\n *\n * @returns Date ISO string.\n */\n getCreatedTime() {\n return new Date().toISOString();\n }\n}\nexports.default = IowsShoppingBagService;\n//# sourceMappingURL=IowsShoppingBagService.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = {\n 10001: 'INVALID_ITEM_NUMBER'\n};\n//# sourceMappingURL=MvEcomShoppingBagErrorCodes.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst ServiceFetch_1 = __importDefault(require(\"../../../utilities/ServiceFetch\"));\nconst MvEcomShoppingBagErrorCodes_1 = __importDefault(require(\"./MvEcomShoppingBagErrorCodes\"));\n/**\n * This class handles CRUD operations for MvEcom shopping cart API.\n */\nclass MvEcomShoppingBagService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.endpoint Endpoint.\n * @param options.mvEcomApiKey\n */\n constructor(options) {\n this.endpoint = options.endpoint;\n this.mvEcomApiKey = options.mvEcomApiKey;\n }\n /**\n * Adds items to shopping cart in IRW.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.items Array of shopping items.\n * @returns Promise object.\n */\n addToCart(options) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.addToBag({\n irwBagType: enums_1.MvEcomIrwBagTypeEnum.irwCart,\n userId: options.userId,\n items: options.items,\n shoppingBagType: enums_1.MvEcomShoppingBagTypeEnum.cart\n });\n });\n }\n /**\n * Adds items to shopping list in IRW.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.items Array of shopping items.\n * @param options.shoppingListName List name.\n * @returns Promise object.\n */\n addToList(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const cart = yield this.addToBag({\n irwBagType: enums_1.MvEcomIrwBagTypeEnum.irwList,\n userId: options.userId,\n items: options.items,\n shoppingBagType: enums_1.MvEcomShoppingBagTypeEnum.list,\n shoppingListName: options.shoppingListName\n });\n return {\n errorList: cart.errorList,\n listCount: cart.cartCount\n };\n });\n }\n /**\n * Returns cart count for a shopping cart.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @returns Promise object.\n */\n getCartCount(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const cartInfo = yield this.getCartInfo({\n irwBagType: enums_1.MvEcomIrwBagTypeEnum.irwCart,\n userId: options.userId,\n shoppingBagType: enums_1.MvEcomShoppingBagTypeEnum.cart\n });\n if (cartInfo === null) {\n return 0;\n }\n return this.getCartCountFromCart({\n irwBagType: enums_1.MvEcomIrwBagTypeEnum.irwCart,\n userId: options.userId,\n shoppingBagType: enums_1.MvEcomShoppingBagTypeEnum.cart,\n cartId: cartInfo.id\n });\n });\n }\n /**\n * Returns list count from a shopping list.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.shoppingListName List name.\n * @returns Promise object.\n */\n getListCount(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const cartInfo = yield this.getCartInfo({\n irwBagType: enums_1.MvEcomIrwBagTypeEnum.irwList,\n userId: options.userId,\n shoppingBagType: enums_1.MvEcomShoppingBagTypeEnum.list,\n shoppingListName: options.shoppingListName\n });\n if (cartInfo === null) {\n return 0;\n }\n return this.getCartCountFromCart({\n irwBagType: enums_1.MvEcomIrwBagTypeEnum.irwList,\n userId: options.userId,\n shoppingBagType: enums_1.MvEcomShoppingBagTypeEnum.list,\n cartId: cartInfo.id\n });\n });\n }\n /**\n * Adds items to shopping cart in IRW.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.items Array of shopping items.\n * @param options.shoppingBagType Cart type. Valid values: \"cart\", \"list\".\n * @param options.shoppingListName List name.\n * @param options.irwBagType\n * @returns Promise object.\n */\n addToBag(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const cartInfo = yield this.getCartInfo(options);\n if (cartInfo !== null) {\n const updateOptions = Object.assign({}, options, { cartId: cartInfo.id });\n const updateInfo = yield this.updateCartItems(updateOptions);\n if (updateInfo.cartCount === null) {\n updateInfo.cartCount = yield this.getCartCountFromCart(updateOptions);\n }\n return updateInfo;\n }\n return yield this.createCart(options);\n });\n }\n /**\n * Returns cart count for a shopping cart.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.cartId Cart id.\n * @param options.shoppingBagType Cart type.\n * @param options.irwBagType\n * @returns Promise object.\n */\n getCartCountFromCart(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const cart = yield this.getCart(options);\n return cart.cartCount;\n });\n }\n /**\n * Returns cart information (name and id) if a cart exists.\n * Returns null if the cart does not exist.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.shoppingBagType Cart type.\n * @param [options.shoppingListName] List name.\n * @param options.irwBagType\n * @returns Promise object.\n */\n getCartInfo(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield ServiceFetch_1.default.json(this.getEndpointUrl(options.irwBagType, options.userId, options.shoppingBagType), {\n headers: this.getHeaders({ mvEcomApiKey: this.mvEcomApiKey }),\n credentials: 'include'\n });\n if (Object.keys(response).length === 0) {\n return null;\n }\n return {\n id: response[0].bagId,\n name: options.shoppingListName,\n type: response[0].bagType\n };\n });\n }\n /**\n * Returns a shopping cart.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.cartId Cart id.\n * @param options.shoppingBagType Cart type.\n * @param options.irwBagType\n * @returns Promise object.\n */\n getCart(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const url = this.getEndpointUrl(options.irwBagType, options.userId, options.shoppingBagType) +\n '/' +\n options.cartId;\n const response = yield ServiceFetch_1.default.json(url, {\n headers: this.getHeaders({ mvEcomApiKey: this.mvEcomApiKey }),\n credentials: 'include'\n });\n return {\n errorList: [],\n cartCount: this.calculateCartCountFromResponse(response)\n };\n });\n }\n /**\n * Creates a shopping cart.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.shoppingBagType Cart type.\n * @param options.items Items to use.\n * @param [options.shoppingListName] List name.\n * @param options.irwBagType\n * @returns Promise object.\n */\n createCart(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const url = this.getEndpointUrl(options.irwBagType, options.userId, options.shoppingBagType);\n const modelOptions = {\n customerId: options.userId,\n items: options.items,\n bagType: options.shoppingBagType,\n bagName: options.shoppingListName\n };\n const response = yield ServiceFetch_1.default.json(url, {\n method: 'POST',\n headers: this.getHeaders({ mvEcomApiKey: this.mvEcomApiKey }),\n credentials: 'include',\n body: JSON.stringify(this.createShoppingCartModel(modelOptions))\n });\n return this.parseResponse(response);\n });\n }\n /**\n * Updates shopping cart items.\n *\n * @param options Options.\n * @param options.userId User ID.\n * @param options.shoppingBagType Cart type.\n * @param options.cartId Cart id.\n * @param options.items Items to use.\n * @param options.irwBagType\n * @returns Promise object.\n */\n updateCartItems(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const endpointUrl = this.getEndpointUrl(options.irwBagType, options.userId, options.shoppingBagType);\n const url = endpointUrl + '/' + options.cartId + '/items';\n // TODO: Change this to a json service fetch in the future if we (or MvEcom) redoes this API.\n const response = yield ServiceFetch_1.default.text(url, {\n method: 'PUT',\n headers: this.getHeaders({ mvEcomApiKey: this.mvEcomApiKey }),\n credentials: 'include',\n body: JSON.stringify(this.createItemsAdjustmentListModel(options.items))\n });\n if (!response) {\n throw new exceptions_1.ServiceException('Could not update cart items. Make sure all parameters are correct.');\n }\n const isError = typeof response === 'string' && response.startsWith('[');\n const isValidResponse = typeof response === 'string' && response.startsWith('{');\n if (isError || isValidResponse) {\n return this.parseResponse(JSON.parse(response));\n }\n return {\n cartCount: null,\n errorList: []\n };\n });\n }\n /**\n * Parses response.\n *\n * @param response Response.\n * @returns Promise object.\n */\n parseResponse(response) {\n const cartCount = this.calculateCartCountFromResponse(response);\n const errorList = this.getErrorsFromResponse(response);\n return {\n cartCount,\n errorList\n };\n }\n /**\n * Checks if the response contains errors.\n *\n * @param response Response.\n * @returns Array of error objects.\n */\n getErrorsFromResponse(response) {\n var _a;\n const errors = [];\n if (typeof response === 'object' && response !== null && ((_a = response[0]) === null || _a === void 0 ? void 0 : _a.errorCode)) {\n const errorObjectList = Array.isArray(response) ? response : [response];\n for (const error of errorObjectList) {\n const errorMessage = error.errorMessage || {};\n const errorCode = error.errorCode || {};\n const message = errorMessage ? errorMessage : null;\n const code = errorCode ? errorCode : null;\n const items = [];\n if (error.errorAttributeList && Array.isArray(error.errorAttributeList)) {\n for (const attribute of error.errorAttributeList) {\n if (attribute.value) {\n items.push(String(attribute.value));\n }\n }\n }\n errors.push({\n code: MvEcomShoppingBagErrorCodes_1.default[code] || String(code),\n message,\n items\n });\n }\n }\n return errors;\n }\n /**\n * Calculates cart count from data.\n *\n * @param response Data returned from the response.\n * @returns Cart count or error object.\n */\n calculateCartCountFromResponse(response) {\n const bag = response || {};\n bag.shoppingBagSectionList = bag.shoppingBagSectionList || [{}];\n bag.bagType = bag.bagType || '';\n const isCart = response.bagType === 'ONLINESHOPPINGCART';\n const isList = response.bagType === 'ONLINESHOPPINGLIST';\n const itemList = bag.shoppingBagSectionList[0];\n let cartCount = null;\n if ((isCart || isList) && itemList) {\n const items = itemList.shoppingBagItemList;\n if (!items) {\n return null;\n }\n cartCount = 0;\n for (const item of items) {\n if (item.itemQty) {\n cartCount += Number(item.itemQty);\n }\n }\n }\n return cartCount;\n }\n /**\n * Generates a shopping cart model to be used as JSON.\n *\n * @param options Options.\n * @param options.bagId Bag Id.\n * @param options.customerId User id.\n * @param options.bagType Bag type.\n * @param options.bagName Bag name.\n * @param options.items Shopping items.\n * @param options.cartId Cart id.\n * @returns Shopping cart model.\n */\n createShoppingCartModel(options) {\n var _a, _b;\n const shoppingListName = options.bagName || options.bagType;\n const json = {\n bagType: options.bagType,\n bagSource: 'IRW',\n bagName: shoppingListName,\n customerSource: 'IRW',\n customerId: options.customerId,\n shoppingBagSectionList: [\n {\n shoppingBagItemList: []\n }\n ]\n };\n for (const item of options.items) {\n if (typeof item.id !== 'string' ||\n typeof item.type !== 'string' ||\n typeof item.quantity !== 'number') {\n throw new exceptions_1.ServiceException('Item was not in a valid format. Please use this format: { id: 123456, type: \"ART\", quantity: 1 }');\n }\n (_b = (_a = json.shoppingBagSectionList) === null || _a === void 0 ? void 0 : _a[0].shoppingBagItemList) === null || _b === void 0 ? void 0 : _b.push({\n itemType: item.type.toUpperCase(),\n itemNo: item.id,\n itemQty: item.quantity\n });\n }\n return json;\n }\n /**\n * Generates a shopping cart adjustment list model to be used as JSON.\n *\n * @param items Items to use.\n * @returns Shopping cart model.\n */\n createItemsAdjustmentListModel(items) {\n const list = [];\n for (const item of items) {\n if (typeof item.id !== 'string' ||\n typeof item.type !== 'string' ||\n typeof item.quantity !== 'number') {\n throw new exceptions_1.ServiceException('Item was not in a valid format. Please use this format: { id: 123456, type: \"ART\", quantity: 1 }');\n }\n list.push({\n itemType: item.type,\n itemNo: item.id,\n itemQty: item.quantity\n });\n }\n return list;\n }\n /**\n * Returns headers to be used by requests.\n *\n * @param options Options.\n * @param options.mvEcomApiKey X-client-id.\n * @returns Object as key value pairs of headers.\n */\n getHeaders(options) {\n return {\n accept: 'application/vnd.ikea.api+json; version=2',\n 'content-type': 'application/json',\n 'x-client-id': options.mvEcomApiKey\n };\n }\n /**\n * Returns endpoint URL.\n *\n * @param irwBagType\n * @param userId User id.\n * @param shoppingBagType Cart type. Valid values: \"cart\", \"list\".\n * @returns Endpoint url.\n */\n getEndpointUrl(irwBagType, userId, shoppingBagType) {\n return this.endpoint\n .replace('{irwBagType}', irwBagType)\n .replace('{userId}', userId)\n .replace('{bagType}', shoppingBagType.toLowerCase());\n }\n}\nexports.default = MvEcomShoppingBagService;\n//# sourceMappingURL=MvEcomShoppingBagService.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar NifUnitTypeEnum;\n(function (NifUnitTypeEnum) {\n NifUnitTypeEnum[\"retailUnit\"] = \"ru\";\n NifUnitTypeEnum[\"store\"] = \"sto\";\n})(NifUnitTypeEnum || (NifUnitTypeEnum = {}));\nexports.default = NifUnitTypeEnum;\n//# sourceMappingURL=NifUnitTypeEnum.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst ServiceFetch_1 = __importDefault(require(\"../../../utilities/ServiceFetch\"));\nconst NifUnitTypeEnum_1 = __importDefault(require(\"./enums/NifUnitTypeEnum\"));\n/**\n * This class is used for CRUD operations for NIF eCommerce API.\n */\nclass NifCartService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.locale Locale.\n * @param options.endpoint Endpoint.\n * @param options.clientId Client ID.\n * @param options.clientSecret Client secret.\n */\n constructor(options) {\n this.locale = options.locale;\n this.endpoint = options.endpoint;\n }\n /**\n * Adds items to shopping cart.\n *\n * @param options Options.\n * @param options.items Array of shopping items.\n * @returns Promise object.\n */\n addToCart(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const carts = yield this.getCarts();\n const cart = carts.length > 0 ? carts[0] : yield this.createCart(NifUnitTypeEnum_1.default.retailUnit);\n try {\n yield this.addCartItems({ items: options.items, cartId: cart.id });\n }\n catch (error) {\n const { serverResponse } = error;\n if ((serverResponse === null || serverResponse === void 0 ? void 0 : serverResponse.status) === 406) {\n const failedShoppingItems = yield this.getFailedShoppingItems(serverResponse);\n if (failedShoppingItems.length > 0) {\n throw new exceptions_1.ShoppingCartException(failedShoppingItems, []);\n }\n }\n }\n const cartCount = yield this.getCartCountById(cart.id);\n return {\n errorList: [],\n cartCount\n };\n });\n }\n /**\n * Fetches and returns the cart count.\n *\n * @returns Promise object.\n */\n getCartCount() {\n return __awaiter(this, void 0, void 0, function* () {\n const carts = yield this.getCarts();\n if (carts.length > 0) {\n return this.getCartCountById(carts[0].id);\n }\n return 0;\n });\n }\n /**\n * Parses Error ServerResponse and returns array of failed shopping items.\n *\n * @param serverResponse\n */\n getFailedShoppingItems(serverResponse) {\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield serverResponse.json();\n const items = Array();\n if (response) {\n for (const item of response) {\n if (item.itemNo && item.message) {\n items.push(item);\n }\n }\n }\n return items;\n });\n }\n /**\n * Fetches and returns the cart count.\n *\n * @param cartId Cart id.\n * @returns Promise object.\n */\n getCartCountById(cartId) {\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield ServiceFetch_1.default.json(`${this.endpoint}/carts/${cartId}`, {\n method: 'GET',\n credentials: 'include',\n headers: {\n Accept: 'application/json'\n }\n });\n return response['quantity'] || 0;\n });\n }\n /**\n * Fetches all carts and returns them. Returns an empty array if 0 (zero) carts.\n *\n * @returns Promise object.\n */\n getCarts() {\n return __awaiter(this, void 0, void 0, function* () {\n return yield ServiceFetch_1.default.json(`${this.endpoint}/carts`, {\n method: 'GET',\n credentials: 'include',\n headers: {\n Accept: 'application/json'\n }\n });\n });\n }\n /**\n * Creates a cart and returns the created cart.\n *\n * @param [retailUnitType] The type of unit (ru = Retail Unit/Market or sto = Store).\n * @returns Promise object.\n */\n createCart(retailUnitType) {\n return __awaiter(this, void 0, void 0, function* () {\n const { country, language } = utilities_1.LocaleUtility.getCountryAndLanguage(this.locale);\n return yield ServiceFetch_1.default.json(`${this.endpoint}/carts`, {\n method: 'POST',\n credentials: 'include',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n context: {\n id: country,\n type: retailUnitType\n },\n countryCode: country,\n languageCode: language\n })\n });\n });\n }\n /**\n * Add cart items to cart.\n *\n * @param options Configuration.\n * @param options.items Array of shopping items.\n * @param options.cartId Cart id.\n * @returns Promise object.\n */\n addCartItems(options) {\n return __awaiter(this, void 0, void 0, function* () {\n yield ServiceFetch_1.default.text(`${this.endpoint}/carts/${options.cartId}/items`, {\n method: 'POST',\n credentials: 'include',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n items: options.items.map((item) => {\n return {\n itemNo: item.id,\n type: item.type,\n quantity: item.quantity\n };\n })\n })\n });\n });\n }\n}\nexports.default = NifCartService;\n//# sourceMappingURL=NifCartService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst ServiceFetch_1 = __importDefault(require(\"../../../utilities/ServiceFetch\"));\n/**\n * This service handles IOWS authentication.\n */\nclass IowsAuthenticationService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.consumer Consumer.\n * @param options.contract Contract.\n * @param options.endpoint Endpoint.\n */\n constructor(options) {\n this.consumer = options.consumer;\n this.contract = options.contract;\n this.endpoint = options.endpoint;\n }\n /**\n * Authenticates and returns an IOWS user.\n *\n * @returns Promise.\n */\n getUser() {\n return __awaiter(this, void 0, void 0, function* () {\n let response;\n try {\n response = yield window.fetch(this.endpoint, {\n headers: this.getHeaders(),\n credentials: 'include'\n });\n }\n catch (error) {\n throw new exceptions_1.ConnectionProblemException(this.endpoint);\n }\n if (response.status === 419) {\n yield this.clearUser();\n return yield this.getUser();\n }\n let data;\n try {\n data = yield response.json();\n }\n catch (error) {\n throw new exceptions_1.UnableToParseServerResponseException(response);\n }\n if (!data['SessionContext']) {\n throw new exceptions_1.ServiceException('Failed to fetch user. Response data did not include SessionContext.');\n }\n return {\n id: String(data['SessionContext'].UserId.$)\n };\n });\n }\n /**\n * Clears user session.\n *\n * @returns Promise object.\n */\n clearUser() {\n return __awaiter(this, void 0, void 0, function* () {\n yield ServiceFetch_1.default.json(this.endpoint, {\n method: 'DELETE',\n headers: this.getHeaders(),\n credentials: 'include'\n });\n });\n }\n /**\n * Returns headers.\n *\n * @returns Headers.\n */\n getHeaders() {\n return {\n accept: 'application/vnd.ikea.iows+json;version=2',\n 'auth-token': this.consumer + '-' + this.contract,\n consumer: this.consumer,\n contract: this.contract\n };\n }\n}\nexports.default = IowsAuthenticationService;\n//# sourceMappingURL=IowsAuthenticationService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst ServiceFetch_1 = __importDefault(require(\"../../../utilities/ServiceFetch\"));\n/**\n * This service handles NIF authentication.\n */\nclass NifAuthenticationService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.settings Settings.\n * @param options.endpoint Endpoint.\n */\n constructor(options) {\n this.endpoint = options.endpoint;\n }\n /**\n * Authenticates the user.\n *\n * @returns Promise.\n */\n authenticate() {\n return __awaiter(this, void 0, void 0, function* () {\n yield ServiceFetch_1.default.text(`${this.endpoint}/context`, {\n method: 'GET',\n headers: {\n Accept: 'application/json'\n },\n credentials: 'include'\n });\n });\n }\n}\nexports.default = NifAuthenticationService;\n//# sourceMappingURL=NifAuthenticationService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst IframeManager_1 = __importDefault(require(\"../../../utilities/IframeManager\"));\n/**\n * This class is used for fetching authentication data.\n */\nclass OneWebAuthenticationService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.endpoint Endpoint.\n */\n constructor(options) {\n this.endpoint = options.endpoint;\n }\n /**\n * Authenticates and returns token.\n *\n * @returns Promise.\n */\n getToken() {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n // When the INGKA Javascript API is available on the same page, we can use it to retrieve the token.\n // This is the case when the footer fragment from INGKA is included using ESI include, or if INGKA includes the planner directly on the page using ESI include.\n if ((_b = (_a = window['ikea']) === null || _a === void 0 ? void 0 : _a.authentication) === null || _b === void 0 ? void 0 : _b.getTokens) {\n return yield this.getTokenFromInkgaApi(window);\n }\n // When a planner is running under /addon-app/, it is not possible to include the footer fragment from INGKA as we are not under a retail unit path (e.g. /gb/en/).\n // It is also not possible to include the necessary Javascript files as the INGKA API will not be able to read the cookies (as they are set under a retail unit path).\n // In this case, we need to use an iframe with a URL that contains a retail unit path to load the INGKA Javascript API and retrieve the token from there.\n // It is only possible to use this method if the planner is running on the same origin as the enpoint for the iframe as it will otherwise not be possible to access the content window.\n // It will for example not work if a subdomain (e.g. \"planner.ikea.com\") includes an iframe URL with the domain \"www.ikea.com\".\n const iframeManager = new IframeManager_1.default(this.endpoint);\n const iframe = yield iframeManager.getIframe();\n const token = yield this.getTokenFromInkgaApi(iframe.contentWindow);\n iframeManager.disconnect();\n return token;\n });\n }\n /**\n * Returns token from INGKA Javascript API.\n *\n * @param targetWindow Window.\n * @returns Token.\n */\n getTokenFromInkgaApi(targetWindow) {\n return new Promise((resolve, reject) => {\n var _a, _b;\n if (!((_b = (_a = targetWindow['ikea']) === null || _a === void 0 ? void 0 : _a.authentication) === null || _b === void 0 ? void 0 : _b.getTokens)) {\n reject(new exceptions_1.ServiceException('Failed to retrieve token from iframe. \"ikea.authentication.getTokens()\" is not defined.'));\n return;\n }\n targetWindow['ikea'].authentication.getTokens((error, tokens) => {\n if (error) {\n reject(new exceptions_1.ServiceException('Failed to retrieve token from iframe. Error: ' + error));\n return;\n }\n const token = tokens.auth ? tokens.auth : tokens.guest;\n resolve({\n value: token.value,\n isGuest: !tokens.auth\n });\n });\n });\n }\n}\nexports.default = OneWebAuthenticationService;\n//# sourceMappingURL=OneWebAuthenticationService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst CacheStoreType_1 = __importDefault(require(\"../../enums/CacheStoreType\"));\nconst ChinaAuthenticationService_1 = __importDefault(require(\"../../services/authentication/china/ChinaAuthenticationService\"));\nconst IowsAuthenticationService_1 = __importDefault(require(\"../../services/authentication/iows/IowsAuthenticationService\"));\nconst NifAuthenticationService_1 = __importDefault(require(\"../../services/authentication/nif/NifAuthenticationService\"));\nconst OneWebAuthenticationService_1 = __importDefault(require(\"../../services/authentication/one-web/OneWebAuthenticationService\"));\n/**\n * This class is used for storing items in a queue.\n */\nclass AuthenticationQueue {\n /**\n * Constructor.\n *\n * @param cache CacheStore.\n */\n constructor(cache) {\n this.cache = cache || new utilities_1.GlobalCacheStore();\n }\n /**\n * Creates user authentication.\n *\n * @param options Options.\n * @param options.consumer Consumer.\n * @param options.contract Contract.\n * @param options.endpoint IOWS authentication endpoint.\n * @returns Promise object.\n */\n getAuthenticationIows(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const cacheKey = 'iowsAuthenticationQueue';\n const cacheStore = this.cache.getStore(CacheStoreType_1.default.authentication);\n const queuedPromises = cacheStore.get(cacheKey);\n if (queuedPromises) {\n return new Promise((resolve, reject) => queuedPromises.push({ resolve, reject }));\n }\n const promiseQueue = [];\n const authService = new IowsAuthenticationService_1.default(options);\n let authentication;\n cacheStore.set(cacheKey, promiseQueue);\n try {\n authentication = yield authService.getUser();\n for (const promise of promiseQueue) {\n promise.resolve(authentication);\n }\n }\n catch (error) {\n for (const promise of promiseQueue) {\n promise.reject(error);\n }\n throw error;\n }\n cacheStore.delete(cacheKey);\n return authentication;\n });\n }\n /**\n * Gets or creates user token.\n *\n * @param options Options.\n * @param options.endpoint OneWeb authentication endpoint.\n * @returns Promise object.\n */\n getAuthTokenOneWeb(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const cacheKey = 'oneWebAuthenticationQueue';\n const cacheStore = this.cache.getStore(CacheStoreType_1.default.authentication);\n const queuedPromises = cacheStore.get(cacheKey);\n if (queuedPromises) {\n return new Promise((resolve, reject) => queuedPromises.push({ resolve, reject }));\n }\n const promiseQueue = [];\n const authService = new OneWebAuthenticationService_1.default(options);\n let authentication = undefined;\n cacheStore.set(cacheKey, promiseQueue);\n try {\n authentication = yield authService.getToken();\n for (const promise of promiseQueue) {\n promise.resolve(authentication);\n }\n }\n catch (error) {\n for (const promise of promiseQueue) {\n promise.reject(error);\n }\n }\n cacheStore.delete(cacheKey);\n return authentication;\n });\n }\n /**\n * Gets or creates user token.\n *\n * @param options Options.\n * @param options.refreshTokenEndpoint Refresh token endpoint.\n * @param options.loginPageEndpoint Login endpoint.\n * @param options.login Force login. If omitted trye fetch existing token.\n * @returns Promise object.\n */\n getAuthTokenChina(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const cacheKey = 'chinaAuthenticationQueue';\n const cacheStore = this.cache.getStore(CacheStoreType_1.default.authentication);\n const queuedPromises = cacheStore.get(cacheKey);\n if (queuedPromises) {\n return new Promise((resolve, reject) => queuedPromises.push({ resolve, reject }));\n }\n const promiseQueue = [];\n const authService = new ChinaAuthenticationService_1.default({\n refreshTokenEndpoint: options.refreshTokenEndpoint,\n loginPageEndpoint: options.loginPageEndpoint\n });\n let authentication;\n cacheStore.set(cacheKey, promiseQueue);\n try {\n authentication = yield (options.login ? authService.login() : authService.getToken());\n for (const promise of promiseQueue) {\n promise.resolve(authentication);\n }\n }\n catch (error) {\n for (const promise of promiseQueue) {\n promise.reject(error);\n }\n }\n cacheStore.delete(cacheKey);\n return authentication;\n });\n }\n /**\n * Creates user authentication.\n *\n * @param options Options.\n * @param options.endpoint Nif authentication endpoint.\n * @returns Promise object.\n */\n authenticateNif(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const cacheKey = 'nifAuthenticationQueue';\n const cacheStore = this.cache.getStore(CacheStoreType_1.default.authentication);\n const queuedPromises = cacheStore.get(cacheKey);\n if (queuedPromises) {\n return new Promise((resolve, reject) => queuedPromises.push({ resolve, reject }));\n }\n const promiseQueue = [];\n const authService = new NifAuthenticationService_1.default(options);\n let authentication;\n cacheStore.set(cacheKey, promiseQueue);\n try {\n authentication = yield authService.authenticate();\n for (const promise of promiseQueue) {\n promise.resolve(authentication);\n }\n }\n catch (error) {\n for (const promise of promiseQueue) {\n promise.reject(error);\n }\n }\n cacheStore.delete(cacheKey);\n return authentication;\n });\n }\n}\nexports.default = AuthenticationQueue;\n//# sourceMappingURL=AuthenticationQueue.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst ChinaAuthenticationService_1 = __importDefault(require(\"../../services/authentication/china/ChinaAuthenticationService\"));\nconst ChinaCartService_1 = __importDefault(require(\"../../services/shopping/china/cart/ChinaCartService\"));\nconst IksaShoppingBagService_1 = __importDefault(require(\"../../services/shopping/iksa/IksaShoppingBagService\"));\nconst IngkaCartService_1 = __importDefault(require(\"../../services/shopping/ingka/cart/IngkaCartService\"));\nconst IowsShoppingBagService_1 = __importDefault(require(\"../../services/shopping/iows/IowsShoppingBagService\"));\nconst MvEcomShoppingBagService_1 = __importDefault(require(\"../../services/shopping/mvecom/MvEcomShoppingBagService\"));\nconst NifCartService_1 = __importDefault(require(\"../../services/shopping/nif/NifCartService\"));\nconst DexfConfiguration_1 = __importDefault(require(\"../../utilities/DexfConfiguration\"));\nconst IrwPlatformCommunication_1 = __importDefault(require(\"../../utilities/platform-communication/IrwPlatformCommunication\"));\nconst RoigPlatformCommunication_1 = __importDefault(require(\"../../utilities/platform-communication/RoigPlatformCommunication\"));\nconst AuthenticationQueue_1 = __importDefault(require(\"./AuthenticationQueue\"));\n/**\n * This class is used as a simple interface for shopping services.\n */\nclass ShoppingCartService {\n /**\n * Constructor.\n *\n * @param options Options.\n */\n constructor(options) {\n this.consumer = options.consumer;\n this.contract = options.contract;\n this.applicationName = options.applicationName;\n this.locale = options.locale;\n this.cache = options.cache || new utilities_1.GlobalCacheStore();\n this.dexfConfiguration = new DexfConfiguration_1.default(options);\n }\n /**\n * Adds items to shopping cart.\n *\n * @param options Options.\n * @param options.items Array of shopping items.\n * @param options.designCode VPC code used to group articles as a planner purchase.\n * @param options.addDesignCodeAsGroup If true the articles will be added as a group in the markets where this is possible. This requires designCode to be set.\n * @param options.singleItems Single items to be added individually outside the group.\n * @returns Promise object containing ICart.\n */\n addToCart(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const eCommerceCartDataSource = kompis.serviceSettings.eCommerceCartDataSource;\n const apiPlatform = kompis.serviceSettings.apiPlatform;\n switch (eCommerceCartDataSource) {\n case enums_1.EcommerceCartDataSourceEnum.cartApi:\n return yield this.addToCartOneWeb({\n items: options.items,\n designCode: options.designCode,\n addDesignCodeAsGroup: options.addDesignCodeAsGroup,\n singleItems: options.singleItems\n });\n case enums_1.EcommerceCartDataSourceEnum.chinaCartApi:\n return yield this.addToCartChina({\n items: options.items,\n designCode: options.designCode\n });\n case enums_1.EcommerceCartDataSourceEnum.iows:\n return yield this.addToCartIows({\n items: options.items\n });\n case enums_1.EcommerceCartDataSourceEnum.mvecom:\n return yield this.addToCartMvEcom({\n items: options.items\n });\n case enums_1.EcommerceCartDataSourceEnum.nifApi:\n return yield this.addToCartNif({\n items: options.items\n });\n case enums_1.EcommerceCartDataSourceEnum.iksa:\n return yield this.addToCartIksa({\n items: options.items\n });\n case enums_1.EcommerceCartDataSourceEnum.default:\n switch (apiPlatform) {\n case enums_1.ApiPlatformEnum.irw:\n return yield this.addToCartIows({\n items: options.items\n });\n case enums_1.ApiPlatformEnum.roig:\n return yield this.addToCartNif({\n items: options.items\n });\n default:\n throw new exceptions_1.ServiceException(`Failed to add items to cart. Unknown api platform \"${apiPlatform}\".`);\n }\n default:\n throw new exceptions_1.ServiceException(`Failed to add items to cart. Unknown cart data source \"${eCommerceCartDataSource}\".`);\n }\n });\n }\n /**\n * Returns total amount of items in a shopping cart.\n *\n * @returns Promise object.\n */\n getCartCount() {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const eCommerceCartDataSource = kompis.serviceSettings.eCommerceCartDataSource;\n const apiPlatform = kompis.serviceSettings.apiPlatform;\n switch (eCommerceCartDataSource) {\n case enums_1.EcommerceCartDataSourceEnum.cartApi:\n return yield this.getCartCountOneWeb();\n case enums_1.EcommerceCartDataSourceEnum.chinaCartApi:\n return yield this.getCartCountChina();\n case enums_1.EcommerceCartDataSourceEnum.iows:\n return yield this.getCartCountIows();\n case enums_1.EcommerceCartDataSourceEnum.mvecom:\n return yield this.getCartCountMvEcom();\n case enums_1.EcommerceCartDataSourceEnum.nifApi:\n return yield this.getCartCountNif();\n case enums_1.EcommerceCartDataSourceEnum.iksa:\n return yield this.getCartCountIksa();\n case enums_1.EcommerceCartDataSourceEnum.default:\n switch (apiPlatform) {\n case enums_1.ApiPlatformEnum.irw:\n return yield this.getCartCountIows();\n default:\n throw new exceptions_1.ServiceException(`Failed to get cart count. Unknown api platform \"${apiPlatform}\".`);\n }\n default:\n throw new exceptions_1.ServiceException(`Failed to get cart count. Unknown cart data source \"${eCommerceCartDataSource}\".`);\n }\n });\n }\n /**\n * Adds items to shopping cart.\n *\n * @param options Options.\n * @param options.items Array of shopping items.\n * @returns Promise object.\n */\n addToCartIows(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const shoppingService = new IowsShoppingBagService_1.default({\n consumer: this.consumer,\n contract: this.contract,\n endpoint: kompis.endpoints.iowsShoppingBagService\n });\n const userId = yield this.getIowsUserId();\n const cart = yield shoppingService.addToCart({\n items: options.items,\n userId\n });\n const platform = new IrwPlatformCommunication_1.default({ applicationName: this.applicationName });\n platform.setCartCount(cart.cartCount);\n return cart;\n });\n }\n /**\n * Returns cart count for IOWS.\n *\n * @returns Promise object.\n */\n getCartCountIows() {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const shoppingService = new IowsShoppingBagService_1.default({\n consumer: this.consumer,\n contract: this.contract,\n endpoint: kompis.endpoints.iowsShoppingBagService\n });\n const userId = yield this.getIowsUserId();\n return yield shoppingService.getCartCount({\n userId\n });\n });\n }\n /**\n * Adds items to shopping cart.\n *\n * @param options Options.\n * @param options.items Array of shopping items.\n * @returns Promise object.\n */\n addToCartMvEcom(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const shoppingService = new MvEcomShoppingBagService_1.default({\n mvEcomApiKey: kompis.serviceSettings.mvEcomApiKey,\n endpoint: kompis.endpoints.mvEcomShoppingBagService\n });\n const userId = yield this.getIowsUserId();\n const cart = yield shoppingService.addToCart({\n items: options.items,\n userId\n });\n const platform = new IrwPlatformCommunication_1.default({ applicationName: this.applicationName });\n platform.setCartCount(cart.cartCount);\n return cart;\n });\n }\n /**\n * Returns cart count for MvEcom.\n *\n * @returns Promise object.\n */\n getCartCountMvEcom() {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const shoppingService = new MvEcomShoppingBagService_1.default({\n mvEcomApiKey: kompis.serviceSettings.mvEcomApiKey,\n endpoint: kompis.endpoints.mvEcomShoppingBagService\n });\n const userId = yield this.getIowsUserId();\n return yield shoppingService.getCartCount({\n userId\n });\n });\n }\n /**\n * Adds items to shopping cart.\n *\n * @param options Options.\n * @param options.items Array of shopping items.\n * @param options.designCode Design code (VPC-code) to group articles in checkout and assembly services.\n * @param options.addDesignCodeAsGroup Boolean to group the articles or not in cart.\n * @param options.singleItems Single items to be added individually outside the group.\n * @returns Promise object.\n */\n addToCartOneWeb(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const shoppingService = new IngkaCartService_1.default({\n endpoint: kompis.endpoints.ingkaCartService,\n clientId: kompis.serviceSettings.ingkaShoppingCartClientId,\n clientSecret: kompis.serviceSettings.ingkaShoppingCartClientSecret,\n itemGroupingInBagEnabled: kompis.serviceSettings.itemGroupingInBagEnabled\n });\n const authQueue = new AuthenticationQueue_1.default(this.cache);\n const token = yield authQueue.getAuthTokenOneWeb({\n endpoint: kompis.endpoints.oneWebAuthenticationToken\n });\n if (!token) {\n throw new exceptions_1.ServiceException('Token is not valid.');\n }\n const cart = yield shoppingService.addToCart({\n items: options.items,\n token,\n designCode: options.designCode,\n addDesignCodeAsGroup: options.addDesignCodeAsGroup,\n singleItems: options.singleItems\n });\n const platform = new IrwPlatformCommunication_1.default({ applicationName: this.applicationName });\n platform.setCartCount(cart.cartCount);\n return cart;\n });\n }\n /**\n * Returns cart count for one web.\n *\n * @returns Promise object.\n */\n getCartCountOneWeb() {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const shoppingService = new IngkaCartService_1.default({\n endpoint: kompis.endpoints.ingkaCartService,\n clientId: kompis.serviceSettings.ingkaShoppingCartClientId,\n clientSecret: kompis.serviceSettings.ingkaShoppingCartClientSecret,\n itemGroupingInBagEnabled: kompis.serviceSettings.itemGroupingInBagEnabled\n });\n const authQueue = new AuthenticationQueue_1.default(this.cache);\n const token = yield authQueue.getAuthTokenOneWeb({\n endpoint: kompis.endpoints.oneWebAuthenticationToken\n });\n if (!token) {\n throw new exceptions_1.ServiceException('Token is not valid.');\n }\n return yield shoppingService.getCartCount({\n token\n });\n });\n }\n /**\n * Adds items to shopping cart.\n *\n * @param options Options.\n * @param options.items Array of shopping items.\n * @param options.designCode VPC/design code to group articles in checkout.\n * @returns Promise object.\n */\n addToCartChina(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const shoppingService = new ChinaCartService_1.default({\n endpoint: kompis.endpoints.chinaCartService\n });\n const authQueue = new AuthenticationQueue_1.default(this.cache);\n const token = yield authQueue.getAuthTokenChina({\n refreshTokenEndpoint: kompis.endpoints.chinaAuthenticationRefreshToken,\n loginPageEndpoint: kompis.endpoints.chinaAuthenticationLoginPage\n });\n if (!token) {\n throw new exceptions_1.ServiceException('Token is not valid.');\n }\n try {\n return yield shoppingService.addToCart({\n items: options.items,\n token,\n designCode: options.designCode\n });\n }\n catch (error) {\n if (error.exceptionType === exceptions_1.ExceptionTypeEnum.serverErrorResponse &&\n error.serverResponse.status === 401) {\n const token = yield authQueue.getAuthTokenChina({\n refreshTokenEndpoint: kompis.endpoints.chinaAuthenticationRefreshToken,\n loginPageEndpoint: kompis.endpoints.chinaAuthenticationLoginPage,\n login: true\n });\n if (!token) {\n throw new exceptions_1.ServiceException('Token is not valid.');\n }\n return yield shoppingService.addToCart({\n items: options.items,\n token,\n designCode: options.designCode\n });\n }\n throw error;\n }\n });\n }\n /**\n * Returns cart count for china.\n *\n * @returns Promise object.\n */\n getCartCountChina() {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n if (!new ChinaAuthenticationService_1.default({\n refreshTokenEndpoint: kompis.endpoints.chinaAuthenticationRefreshToken,\n loginPageEndpoint: kompis.endpoints.chinaAuthenticationLoginPage\n }).hasCookie()) {\n return 0;\n }\n const shoppingService = new ChinaCartService_1.default({\n endpoint: kompis.endpoints.chinaCartService\n });\n const authQueue = new AuthenticationQueue_1.default(this.cache);\n const token = yield authQueue.getAuthTokenChina({\n refreshTokenEndpoint: kompis.endpoints.chinaAuthenticationRefreshToken,\n loginPageEndpoint: kompis.endpoints.chinaAuthenticationLoginPage\n });\n if (!token) {\n throw new exceptions_1.ServiceException('Token is not valid.');\n }\n try {\n return yield shoppingService.getCartCount({\n token\n });\n }\n catch (error) {\n if (error.exceptionType === exceptions_1.ExceptionTypeEnum.serverErrorResponse &&\n error.serverResponse.status === 401) {\n const token = yield authQueue.getAuthTokenChina({\n refreshTokenEndpoint: kompis.endpoints.chinaAuthenticationRefreshToken,\n loginPageEndpoint: kompis.endpoints.chinaAuthenticationLoginPage,\n login: true\n });\n if (!token) {\n throw new exceptions_1.ServiceException('Token is not valid.');\n }\n return yield shoppingService.getCartCount({\n token\n });\n }\n throw error;\n }\n });\n }\n /**\n * Adds items to shopping cart.\n *\n * @param options Options.\n * @param options.items Array of shopping items.\n * @returns Promise object.\n */\n addToCartNif(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const shoppingService = new NifCartService_1.default({\n endpoint: kompis.endpoints.nifECommerceApiEndpoint,\n locale: this.locale\n });\n const platform = new RoigPlatformCommunication_1.default();\n const authQueue = new AuthenticationQueue_1.default(this.cache);\n yield authQueue.authenticateNif({\n endpoint: kompis.endpoints.nifECommerceApiEndpoint\n });\n const cart = yield shoppingService.addToCart({\n items: options.items\n });\n platform.setCartCount(cart.cartCount);\n return cart;\n });\n }\n /**\n * Returns cart count for NIF.\n *\n * @returns Promise object.\n */\n getCartCountNif() {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const shoppingService = new NifCartService_1.default({\n endpoint: kompis.endpoints.nifECommerceApiEndpoint,\n locale: this.locale\n });\n const authQueue = new AuthenticationQueue_1.default(this.cache);\n yield authQueue.authenticateNif({\n endpoint: kompis.endpoints.nifECommerceApiEndpoint\n });\n return yield shoppingService.getCartCount();\n });\n }\n /**\n * Adds items to shopping cart.\n *\n * @param options Options.\n * @param options.items Array of shopping items.\n * @returns Promise object.\n */\n addToCartIksa(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const shoppingService = new IksaShoppingBagService_1.default({\n consumer: this.consumer,\n contract: this.contract,\n endpoint: kompis.endpoints.iksaShoppingBagService\n });\n const userId = yield this.getIowsUserId();\n const cart = yield shoppingService.addToCart({\n items: options.items,\n userId\n });\n const platform = new IrwPlatformCommunication_1.default({ applicationName: this.applicationName });\n platform.setCartCount(cart.cartCount);\n return cart;\n });\n }\n /**\n * Returns cart count for IKSA.\n *\n * @returns Promise object.\n */\n getCartCountIksa() {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const shoppingService = new IksaShoppingBagService_1.default({\n consumer: this.consumer,\n contract: this.contract,\n endpoint: kompis.endpoints.iksaShoppingBagService\n });\n const userId = yield this.getIowsUserId();\n return yield shoppingService.getCartCount({\n userId\n });\n });\n }\n /**\n * Returns authenticated IOWS user id.\n *\n * @returns Promise of user id as string.\n */\n getIowsUserId() {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const authQueue = new AuthenticationQueue_1.default(this.cache);\n const user = yield authQueue.getAuthenticationIows({\n consumer: this.consumer,\n contract: this.contract,\n endpoint: kompis.endpoints.iowsAuthenticationServiceV2\n });\n return user.id;\n });\n }\n}\nexports.default = ShoppingCartService;\n//# sourceMappingURL=ShoppingCartService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst ServiceFetch_1 = __importDefault(require(\"../../../../utilities/ServiceFetch\"));\n/**\n * This class handles adding items to the China shopping list.\n */\nclass ChinaShoppingListService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.endpoint Endpoint.\n */\n constructor(options) {\n this.endpoint = options.endpoint;\n }\n /**\n * Adds items to shopping list.\n *\n * @param options Options.\n * @param options.items Array of shopping items.\n * @param options.token Token.\n * @returns Promise object.\n */\n addToList(options) {\n return __awaiter(this, void 0, void 0, function* () {\n yield ServiceFetch_1.default.text(`${this.endpoint}/add-products-with-quantity`, {\n method: 'post',\n credentials: 'same-origin',\n headers: this.getHeaders(options.token),\n body: this.getAddToListBody(options.items)\n });\n const listCount = yield this.getListCount(options);\n return {\n listCount,\n errorList: []\n };\n });\n }\n /**\n * Returns list count for a shopping list.\n *\n * @param options Options.\n * @param options.token Token.\n * @returns Promise object.\n */\n getListCount(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield ServiceFetch_1.default.json(this.endpoint, {\n method: 'get',\n credentials: 'same-origin',\n headers: this.getHeaders(options.token)\n });\n return response['length'] || 0;\n });\n }\n /**\n * Returns the body.\n *\n * @param items Items.\n * @returns Add to cart body.\n */\n getAddToListBody(items) {\n return JSON.stringify({\n products: items.map((item) => ({\n productFullId: (item.type.toUpperCase() === 'SPR' ? 's' : '') + item.id,\n quantity: item.quantity\n }))\n });\n }\n /**\n * Returns headers.\n *\n * @param token Token.\n * @returns Headers.\n */\n getHeaders(token) {\n const headers = {\n 'content-type': 'application/json',\n 'x-client-channel': 'WEB',\n 'x-client-platform': 'PcWeb',\n authorization: 'Bearer ' + token\n };\n return headers;\n }\n}\nexports.default = ChinaShoppingListService;\n//# sourceMappingURL=ChinaShoppingListService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst ServiceFetch_1 = __importDefault(require(\"../../../../utilities/ServiceFetch\"));\n/**\n * This class handles adding items to the One Web cart.\n *\n * GraphQL Playground: https://dev.favs.oneweb.ingkadt.com/playground.\n */\nclass IngkaShoppingListService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.endpoint Endpoint.\n * @param options.clientId Client ID.\n * @param options.clientSecret Client secret.\n * @param options.itemGroupingInBagEnabled Setting if grouping in bag is enabled on the market.\n */\n constructor(options) {\n this.endpoint = options.endpoint;\n this.clientId = options.clientId;\n this.clientSecret = options.clientSecret;\n this.itemGroupingInBagEnabled = options.itemGroupingInBagEnabled;\n }\n /**\n * Adds items to shopping list.\n *\n * @param options Options.\n * @param options.items Array of shopping items.\n * @param options.token One web token.\n * @param options.shoppingListName List name.\n * @param options.designCode Design code (VPC-code) to group articles in checkout and assembly services.\n * @param options.singleItems Single items to be added individually outside the group.\n * @returns Promise object.\n */\n addToList(options) {\n return __awaiter(this, void 0, void 0, function* () {\n let listId = yield this.getListId({\n token: options.token,\n shoppingListName: options.shoppingListName\n });\n if (!listId) {\n listId = yield this.createList({\n token: options.token,\n shoppingListName: options.shoppingListName\n });\n }\n yield this.setSelectedList({ token: options.token, listId });\n return yield this.addItemsToList({\n items: options.items,\n token: options.token,\n listId,\n shoppingListName: options.shoppingListName,\n designCode: options.designCode,\n singleItems: options.singleItems\n });\n });\n }\n /**\n * Returns list count.\n *\n * @param options Options..\n * @param options.token One web token.\n * @param options.shoppingListName List name.\n * @returns Promise object.\n */\n getListCount(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield ServiceFetch_1.default.json(this.endpoint, {\n credentials: 'same-origin',\n method: 'POST',\n headers: this.getHeaders(options.token),\n body: this.getListQuantityBody()\n });\n const data = response['data'];\n if (!data || !Array.isArray(data.lists)) {\n throw new exceptions_1.ServiceException('Failed to get list count. No lists in response.');\n }\n const list = data.lists.find((list) => list.name === options.shoppingListName);\n return list ? list.quantity : 0;\n });\n }\n /**\n * Sets the shopping list which the latest item was added to as selected.\n *\n * @param options.token One web token.\n * @param options.listId List id.\n * @param options\n * @returns Promise object.\n */\n setSelectedList(options) {\n return __awaiter(this, void 0, void 0, function* () {\n yield ServiceFetch_1.default.json(this.endpoint, {\n credentials: 'same-origin',\n method: 'POST',\n headers: this.getHeaders(options.token),\n body: this.getSelectedListBody(options.listId)\n });\n });\n }\n /**\n * Returns list id.\n *\n * @param options Options.\n * @param options.token One web token.\n * @param options.shoppingListName List name.\n * @returns Promise object.\n */\n getListId(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield ServiceFetch_1.default.json(this.endpoint, {\n credentials: 'same-origin',\n method: 'POST',\n headers: this.getHeaders(options.token),\n body: this.getListIdBody()\n });\n const data = response['data'];\n if (!data || !Array.isArray(data.lists)) {\n throw new exceptions_1.ServiceException('Failed to get list id. No lists in response.');\n }\n const list = data.lists.find((list) => list.name === options.shoppingListName);\n return list ? list.listId : null;\n });\n }\n /**\n * Creates a list and returns the ID.\n *\n * @param options Options.\n * @param options.token One web token.\n * @param options.shoppingListName List name.\n * @returns Promise object.\n */\n createList(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield ServiceFetch_1.default.json(this.endpoint, {\n credentials: 'same-origin',\n method: 'POST',\n headers: this.getHeaders(options.token),\n body: this.getCreateListBody(options.shoppingListName)\n });\n const data = response['data'];\n if (!data || !data.createList || !data.createList.listId) {\n throw new exceptions_1.ServiceException('Failed to create list. Missing \"listId\" in response.');\n }\n return data.createList.listId;\n });\n }\n /**\n * Adds item to a shopping list.\n *\n * @param options Options.\n * @param options.items Array of shopping items.\n * @param options.token One web token.\n * @param options.listId List name.\n * @param options.designCode Design Code.\n * @param options.singleItems Single items to be added.\n * @param options.shoppingListName Name to fetch list count.\n * @returns Promise object.\n */\n addItemsToList(options) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield ServiceFetch_1.default.json(this.endpoint, {\n credentials: 'same-origin',\n method: 'POST',\n headers: this.getHeaders(options.token),\n body: this.getAddItemsBody(options.listId, options.items, options.designCode, options.singleItems)\n });\n const listCount = (_a = (yield this.getListCount({\n token: options.token,\n shoppingListName: options.shoppingListName\n }))) !== null && _a !== void 0 ? _a : null;\n return {\n listCount,\n errorList: this.getErrorList(response)\n };\n });\n }\n getListIdBody() {\n return JSON.stringify({\n operationName: null,\n variables: {},\n query: '{ lists {name, listId} }'\n });\n }\n getListQuantityBody() {\n return JSON.stringify({\n operationName: null,\n variables: {},\n query: '{ lists {name, quantity} }'\n });\n }\n getAddItemsBody(listId, items, designCode, singleItems) {\n let mutation = '';\n const addItemsAsGroup = !!designCode && this.itemGroupingInBagEnabled;\n if (!addItemsAsGroup) {\n mutation = this.getAddItemsMutation(items, listId);\n }\n else {\n if (singleItems) {\n mutation = this.getAddItemsMutation(singleItems, listId);\n }\n const addDesignsMutation = `addDesigns(designs: [{configurationId: \"${designCode}\", quantity: 1}], listId: \"${listId}\") { listId, name }`;\n mutation = mutation\n ? `${mutation}\n\t\t\t\t${addDesignsMutation}`\n : addDesignsMutation;\n }\n return JSON.stringify({\n operationName: null,\n variables: {},\n query: `mutation {${mutation}}`\n });\n }\n getAddItemsMutation(items, listId) {\n const itemsString = `[${items.map((item) => {\n return `{ itemNo: \"${item.id}\", quantity: ${item.quantity} }`;\n })}]`;\n return `addItems(items: ${itemsString}, listId: \"${listId}\" ) { quantity }`;\n }\n getSelectedListBody(id) {\n return JSON.stringify({\n operationName: null,\n variables: {},\n query: `mutation { setSelected(listId: \"${id}\" ) { context { userId } } }`\n });\n }\n getCreateListBody(name) {\n return JSON.stringify({\n operationName: null,\n variables: {},\n query: `mutation { createList(name: \"${name}\") { listId } }`\n });\n }\n /**\n * Returns an error list.\n *\n * @param response Response.\n * @returns Error list.\n */\n getErrorList(response) {\n const errors = response['errors'];\n if (errors) {\n return errors.map((error) => {\n return {\n code: error.extensions ? error.extensions.code : null,\n message: error.message,\n items: error.extensions && error.extensions.data && error.extensions.data.itemNos\n ? error.extensions.data.itemNos\n : null\n };\n });\n }\n return [];\n }\n getHeaders(token) {\n const headers = {\n 'Content-Type': 'application/json',\n Authorization: 'Bearer ' + token.value,\n Accept: 'application/json',\n 'x-client-id': this.clientId,\n 'x-client-secret': this.clientSecret\n // The below can be used for accessing GraphQL Playground:\n // 'x-user-id': '2008c852-8b33-48f6-b5ef-45add754cdf5',\n // 'x-is-anonymous': true,\n };\n return headers;\n }\n}\nexports.default = IngkaShoppingListService;\n//# sourceMappingURL=IngkaShoppingListService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst ChinaAuthenticationService_1 = __importDefault(require(\"../../services/authentication/china/ChinaAuthenticationService\"));\nconst ChinaShoppingListService_1 = __importDefault(require(\"../../services/shopping/china/shopping-list/ChinaShoppingListService\"));\nconst IksaShoppingBagService_1 = __importDefault(require(\"../../services/shopping/iksa/IksaShoppingBagService\"));\nconst IngkaShoppingListService_1 = __importDefault(require(\"../../services/shopping/ingka/shopping-list/IngkaShoppingListService\"));\nconst IowsShoppingBagService_1 = __importDefault(require(\"../../services/shopping/iows/IowsShoppingBagService\"));\nconst MvEcomShoppingBagService_1 = __importDefault(require(\"../../services/shopping/mvecom/MvEcomShoppingBagService\"));\nconst DexfConfiguration_1 = __importDefault(require(\"../../utilities/DexfConfiguration\"));\nconst LocalizationService_1 = __importDefault(require(\"../localization/LocalizationService\"));\nconst AuthenticationQueue_1 = __importDefault(require(\"./AuthenticationQueue\"));\n/**\n * This class is used as a simple interface for shopping services.\n */\nclass ShoppingListService {\n /**\n * Constructor.\n *\n * @param options Options.\n */\n constructor(options) {\n this.consumer = options.consumer;\n this.contract = options.contract;\n this.localizationPrefixApplication = options.localizationPrefixApplication;\n this.localizationEndpoints = options.localizationEndpoints;\n this.localizationOverrides = options.localizationOverrides;\n this.locale = options.locale;\n this.shoppingListName = options.shoppingListName;\n this.cache = options.cache || new utilities_1.GlobalCacheStore();\n this.dexfConfiguration = new DexfConfiguration_1.default(options);\n this.translations = options.translations;\n }\n /**\n * Adds items to shopping cart in IRW.\n *\n * @param options Options.\n * @param options.items Array of shopping items.\n * @param options.designCode VPC code used to group articles in the shopping list.\n * @param options.singleItems Single items to be added individually outside the group. Only applicable when a designCode has been set.\n * @returns Promise object.\n */\n addToList(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const eCommerceCartDataSource = kompis.serviceSettings.eCommerceCartDataSource;\n const eCommerceShoppingListDataSource = kompis.serviceSettings.eCommerceShoppingListDataSource;\n const apiPlatform = kompis.serviceSettings.apiPlatform;\n switch (eCommerceShoppingListDataSource) {\n case enums_1.EcommerceShoppingListDataSourceEnum.shoppingListApi:\n return yield this.addToListOneWeb({\n items: options.items,\n designCode: options.designCode,\n singleItems: options.singleItems\n });\n case enums_1.EcommerceShoppingListDataSourceEnum.chinaShoppingListApi:\n return yield this.addToListChina({\n items: options.items\n });\n case enums_1.EcommerceShoppingListDataSourceEnum.iows:\n return yield this.addToListIows({\n items: options.items\n });\n case enums_1.EcommerceShoppingListDataSourceEnum.mvecom:\n return yield this.addToListMvEcom({\n items: options.items\n });\n case enums_1.EcommerceShoppingListDataSourceEnum.iksa:\n return yield this.addToListIksa({\n items: options.items\n });\n case enums_1.EcommerceShoppingListDataSourceEnum.default:\n switch (eCommerceCartDataSource) {\n case enums_1.EcommerceCartDataSourceEnum.iows:\n case enums_1.EcommerceCartDataSourceEnum.cartApi:\n return yield this.addToListIows({\n items: options.items\n });\n case enums_1.EcommerceCartDataSourceEnum.default:\n switch (apiPlatform) {\n case enums_1.ApiPlatformEnum.irw:\n return yield this.addToListIows({\n items: options.items\n });\n default:\n throw new exceptions_1.ServiceException(`Failed to add items to shopping list. Unknown api platform \"${apiPlatform}\".`);\n }\n default:\n throw new exceptions_1.ServiceException(`Failed to add items to shopping list. Unknown shopping cart data source \"${eCommerceCartDataSource}\".`);\n }\n default:\n throw new exceptions_1.ServiceException(`Failed to add items to shopping list. Unknown shopping list data source \"${eCommerceShoppingListDataSource}\".`);\n }\n });\n }\n /**\n * Returns total amount of items in a shopping list.\n *\n * @returns Promise object.\n */\n getListCount() {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const eCommerceCartDataSource = kompis.serviceSettings.eCommerceCartDataSource;\n const eCommerceShoppingListDataSource = kompis.serviceSettings.eCommerceShoppingListDataSource;\n const apiPlatform = kompis.serviceSettings.apiPlatform;\n switch (eCommerceShoppingListDataSource) {\n case enums_1.EcommerceShoppingListDataSourceEnum.shoppingListApi:\n return yield this.getListCountOneWeb();\n case enums_1.EcommerceShoppingListDataSourceEnum.iows:\n return yield this.getListCountIows();\n case enums_1.EcommerceShoppingListDataSourceEnum.mvecom:\n return yield this.getListCountMvEcom();\n case enums_1.EcommerceShoppingListDataSourceEnum.chinaShoppingListApi:\n return yield this.getListCountChina();\n case enums_1.EcommerceShoppingListDataSourceEnum.iksa:\n return yield this.getListCountIksa();\n case enums_1.EcommerceShoppingListDataSourceEnum.default:\n switch (eCommerceCartDataSource) {\n case enums_1.EcommerceCartDataSourceEnum.iows:\n case enums_1.EcommerceCartDataSourceEnum.cartApi:\n return yield this.getListCountIows();\n case enums_1.EcommerceCartDataSourceEnum.default:\n switch (apiPlatform) {\n case enums_1.ApiPlatformEnum.irw:\n return yield this.getListCountIows();\n default:\n throw new exceptions_1.ServiceException(`Failed to get list count. Unknown api platform \"${apiPlatform}\".`);\n }\n default:\n throw new exceptions_1.ServiceException(`Failed to get list count. Unknown shopping cart data source \"${eCommerceCartDataSource}\".`);\n }\n default:\n throw new exceptions_1.ServiceException(`Failed to get list count. Unknown shopping list data source \"${eCommerceShoppingListDataSource}\".`);\n }\n });\n }\n /**\n * Returns shopping list name.\n */\n getShoppingListName() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.shoppingListName) {\n return this.shoppingListName;\n }\n else if (this.translations) {\n return this.translations.plannerShoppingListName;\n }\n else if (this.localizationEndpoints && this.locale) {\n const localizationService = new LocalizationService_1.default({\n localizationPrefixApplication: this.localizationPrefixApplication,\n localizationEndpoints: this.localizationEndpoints,\n localizationOverrides: this.localizationOverrides,\n locale: this.locale,\n cache: this.cache\n });\n const localizedInformation = yield localizationService.getLocalizedInformation();\n return localizedInformation.translations.plannerShoppingListName;\n }\n throw new Error('Shopping list name must be defined either through the \"shoppingListName\", \"translations\" option or \"localizedInformation\" props.');\n });\n }\n /**\n * Adds items to shopping cart.\n *\n * @param options Options.\n * @param options.items Array of shopping items.\n * @param options.localizedInformation Localized information.\n * @returns Promise object.\n */\n addToListIows(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const shoppingService = new IowsShoppingBagService_1.default({\n consumer: this.consumer,\n contract: this.contract,\n endpoint: kompis.endpoints.iowsShoppingBagService\n });\n const authQueue = new AuthenticationQueue_1.default(this.cache);\n const user = yield authQueue.getAuthenticationIows({\n consumer: this.consumer,\n contract: this.contract,\n endpoint: kompis.endpoints.iowsAuthenticationServiceV2\n });\n const shoppingList = yield shoppingService.addToList({\n items: options.items,\n userId: user.id,\n shoppingListName: yield this.getShoppingListName()\n });\n return shoppingList;\n });\n }\n /**\n * Returns list count for IOWS.\n *\n * @param options Options.\n * @param options.localizedInformation Localized information.\n * @returns Promise object.\n */\n getListCountIows() {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const shoppingService = new IowsShoppingBagService_1.default({\n consumer: this.consumer,\n contract: this.contract,\n endpoint: kompis.endpoints.iowsShoppingBagService\n });\n const authQueue = new AuthenticationQueue_1.default(this.cache);\n const user = yield authQueue.getAuthenticationIows({\n consumer: this.consumer,\n contract: this.contract,\n endpoint: kompis.endpoints.iowsAuthenticationServiceV2\n });\n return yield shoppingService.getListCount({\n userId: user.id,\n shoppingListName: yield this.getShoppingListName()\n });\n });\n }\n /**\n * Adds items to shopping list for MvEcom.\n *\n * @param options Options.\n * @param options.items Array of shopping items.\n * @param options.localizedInformation Localized information.\n * @returns Promise object.\n */\n addToListMvEcom(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const shoppingService = new MvEcomShoppingBagService_1.default({\n mvEcomApiKey: kompis.serviceSettings.mvEcomApiKey,\n endpoint: kompis.endpoints.mvEcomShoppingBagService\n });\n const authQueue = new AuthenticationQueue_1.default(this.cache);\n const user = yield authQueue.getAuthenticationIows({\n consumer: this.consumer,\n contract: this.contract,\n endpoint: kompis.endpoints.iowsAuthenticationServiceV2\n });\n const shoppingList = yield shoppingService.addToList({\n items: options.items,\n userId: user.id,\n shoppingListName: yield this.getShoppingListName()\n });\n return shoppingList;\n });\n }\n /**\n * Returns list count for MvEcom.\n *\n * @param options Options.\n * @param options.localizedInformation Localized information.\n * @returns Promise object.\n */\n getListCountMvEcom() {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const shoppingService = new MvEcomShoppingBagService_1.default({\n mvEcomApiKey: kompis.serviceSettings.mvEcomApiKey,\n endpoint: kompis.endpoints.mvEcomShoppingBagService\n });\n const authQueue = new AuthenticationQueue_1.default(this.cache);\n const user = yield authQueue.getAuthenticationIows({\n consumer: this.consumer,\n contract: this.contract,\n endpoint: kompis.endpoints.iowsAuthenticationServiceV2\n });\n return yield shoppingService.getListCount({\n userId: user.id,\n shoppingListName: yield this.getShoppingListName()\n });\n });\n }\n /**\n * Adds items to shopping list.\n *\n * @param options Options.\n * @param options.items Array of shopping items.\n * @param options.localizedInformation Localized information.\n * @param options.designCode\n * @param options.singleItems\n * @returns Promise object.\n */\n addToListOneWeb(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const shoppingService = new IngkaShoppingListService_1.default({\n endpoint: kompis.endpoints.ingkaShoppingListService,\n clientId: kompis.serviceSettings.ingkaShoppingListClientId,\n clientSecret: kompis.serviceSettings.ingkaShoppingListClientSecret,\n itemGroupingInBagEnabled: kompis.serviceSettings.itemGroupingInBagEnabled\n });\n const authQueue = new AuthenticationQueue_1.default(this.cache);\n const token = yield authQueue.getAuthTokenOneWeb({\n endpoint: kompis.endpoints.oneWebAuthenticationToken\n });\n if (!token) {\n throw new exceptions_1.ServiceException('Token is not valid.');\n }\n const shoppingList = yield shoppingService.addToList({\n items: options.items,\n token,\n shoppingListName: yield this.getShoppingListName(),\n designCode: options.designCode,\n singleItems: options.singleItems\n });\n return shoppingList;\n });\n }\n /**\n * Returns list count for One Web.\n *\n * @param options Options.\n * @param options.localizedInformation Localized information.\n * @returns Promise object.\n */\n getListCountOneWeb() {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const shoppingService = new IngkaShoppingListService_1.default({\n endpoint: kompis.endpoints.ingkaShoppingListService,\n clientId: kompis.serviceSettings.ingkaShoppingListClientId,\n clientSecret: kompis.serviceSettings.ingkaShoppingListClientSecret,\n itemGroupingInBagEnabled: kompis.serviceSettings.itemGroupingInBagEnabled\n });\n const authQueue = new AuthenticationQueue_1.default(this.cache);\n const token = yield authQueue.getAuthTokenOneWeb({\n endpoint: kompis.endpoints.oneWebAuthenticationToken\n });\n if (!token) {\n throw new exceptions_1.ServiceException('Token is not valid.');\n }\n return yield shoppingService.getListCount({\n token,\n shoppingListName: yield this.getShoppingListName()\n });\n });\n }\n /**\n * Adds items to shopping list.\n *\n * @param options Options.\n * @param options.items Array of shopping items.\n * @param options.localizedInformation Localized information.\n * @returns Promise object.\n */\n addToListChina(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const shoppingService = new ChinaShoppingListService_1.default({\n endpoint: kompis.endpoints.chinaShoppingListService\n });\n const authQueue = new AuthenticationQueue_1.default(this.cache);\n const token = yield authQueue.getAuthTokenChina({\n refreshTokenEndpoint: kompis.endpoints.chinaAuthenticationRefreshToken,\n loginPageEndpoint: kompis.endpoints.chinaAuthenticationLoginPage\n });\n if (!token) {\n throw new exceptions_1.ServiceException('Token is not valid.');\n }\n try {\n return yield shoppingService.addToList({\n items: options.items,\n token\n });\n }\n catch (error) {\n if (error.exceptionType === exceptions_1.ExceptionTypeEnum.serverErrorResponse &&\n error.serverResponse.status === 401) {\n const token = yield authQueue.getAuthTokenChina({\n refreshTokenEndpoint: kompis.endpoints.chinaAuthenticationRefreshToken,\n loginPageEndpoint: kompis.endpoints.chinaAuthenticationLoginPage,\n login: true\n });\n if (!token) {\n throw new exceptions_1.ServiceException('Token is not valid.');\n }\n return yield shoppingService.addToList({\n items: options.items,\n token\n });\n }\n throw error;\n }\n });\n }\n /**\n * Returns list count for China.\n *\n * @param options Options.\n * @param options.localizedInformation Localized information.\n * @returns Promise object.\n */\n getListCountChina() {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n if (!new ChinaAuthenticationService_1.default({\n refreshTokenEndpoint: kompis.endpoints.chinaAuthenticationRefreshToken,\n loginPageEndpoint: kompis.endpoints.chinaAuthenticationLoginPage\n }).hasCookie()) {\n return 0;\n }\n const shoppingService = new ChinaShoppingListService_1.default({\n endpoint: kompis.endpoints.chinaShoppingListService\n });\n const authQueue = new AuthenticationQueue_1.default(this.cache);\n const token = yield authQueue.getAuthTokenChina({\n refreshTokenEndpoint: kompis.endpoints.chinaAuthenticationRefreshToken,\n loginPageEndpoint: kompis.endpoints.chinaAuthenticationLoginPage\n });\n if (!token) {\n throw new exceptions_1.ServiceException('Token is not valid.');\n }\n try {\n return yield shoppingService.getListCount({\n token\n });\n }\n catch (error) {\n if (error.exceptionType === exceptions_1.ExceptionTypeEnum.serverErrorResponse &&\n error.serverResponse.status === 401) {\n const token = yield authQueue.getAuthTokenChina({\n refreshTokenEndpoint: kompis.endpoints.chinaAuthenticationRefreshToken,\n loginPageEndpoint: kompis.endpoints.chinaAuthenticationLoginPage,\n login: true\n });\n if (!token) {\n throw new exceptions_1.ServiceException('Token is not valid.');\n }\n return yield shoppingService.getListCount({\n token\n });\n }\n throw error;\n }\n });\n }\n /**\n * Adds items to shopping cart.\n *\n * @param options Options.\n * @param options.items Array of shopping items.\n * @param options.localizedInformation Localized information.\n * @returns Promise object.\n */\n addToListIksa(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const shoppingService = new IksaShoppingBagService_1.default({\n consumer: this.consumer,\n contract: this.contract,\n endpoint: kompis.endpoints.iksaShoppingBagService\n });\n const authQueue = new AuthenticationQueue_1.default(this.cache);\n const user = yield authQueue.getAuthenticationIows({\n consumer: this.consumer,\n contract: this.contract,\n endpoint: kompis.endpoints.iowsAuthenticationServiceV2\n });\n const shoppingList = yield shoppingService.addToList({\n items: options.items,\n userId: user.id,\n shoppingListName: yield this.getShoppingListName()\n });\n return shoppingList;\n });\n }\n /**\n * Returns list count for IKSA.\n *\n * @param options Options.\n * @param options.localizedInformation Localized information.\n * @returns Promise object.\n */\n getListCountIksa() {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const shoppingService = new IksaShoppingBagService_1.default({\n consumer: this.consumer,\n contract: this.contract,\n endpoint: kompis.endpoints.iksaShoppingBagService\n });\n const authQueue = new AuthenticationQueue_1.default(this.cache);\n const user = yield authQueue.getAuthenticationIows({\n consumer: this.consumer,\n contract: this.contract,\n endpoint: kompis.endpoints.iowsAuthenticationServiceV2\n });\n return yield shoppingService.getListCount({\n userId: user.id,\n shoppingListName: yield this.getShoppingListName()\n });\n });\n }\n}\nexports.default = ShoppingListService;\n//# sourceMappingURL=ShoppingListService.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst CacheStoreType_1 = __importDefault(require(\"../../enums/CacheStoreType\"));\n/**\n * This class is used for storing and loading stores from cache.\n */\nclass StoreCache {\n /**\n * Constructor.\n *\n * @param locale Locale.\n * @param cache Cache store.\n */\n constructor(locale, cache) {\n this.locale = locale;\n this.cache = cache || new utilities_1.GlobalCacheStore();\n }\n /**\n * Returns stores.\n *\n * @returns Stores.\n */\n getStores() {\n return this.cache.getStore(CacheStoreType_1.default.store).get(this.getCacheKey()) || null;\n }\n /**\n * Sets stores.\n *\n * @param stores Stores.\n */\n addStores(stores) {\n this.cache.getStore(CacheStoreType_1.default.store).set(this.getCacheKey(), stores);\n }\n /**\n * Removes stores.\n */\n clear() {\n this.cache.getStore(CacheStoreType_1.default.store).delete(this.getCacheKey());\n }\n /**\n * Returns cache key.\n *\n * @returns Cache key.\n */\n getCacheKey() {\n return this.locale + 'stores';\n }\n}\nexports.default = StoreCache;\n//# sourceMappingURL=StoreCache.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst ServiceFetch_1 = __importDefault(require(\"../../utilities/ServiceFetch\"));\n/**\n * This class is used for fetching a list of stores for a market.\n */\nclass DexfStoreService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.endpoint Endpoint.\n * @param options.dexfApiKey DEXF Api ket.\n */\n constructor(options) {\n this.endpoint = options.endpoint;\n this.dexfApiKey = options.dexfApiKey;\n }\n /**\n * Returns stores from a retail unit/market.\n *\n * @returns Promise.\n */\n getStores() {\n return __awaiter(this, void 0, void 0, function* () {\n const options = {\n credentials: 'same-origin',\n headers: {\n 'dexf-api-key': this.dexfApiKey\n }\n };\n const response = yield ServiceFetch_1.default.json(this.endpoint, options);\n if (!response) {\n return [];\n }\n const stores = [];\n for (const store of response.stores) {\n // Filtering the store types.\n if (store.buType === enums_1.StoreBuTypeEnum.store ||\n store.buType === enums_1.StoreBuTypeEnum.office ||\n store.buType === enums_1.StoreBuTypeEnum.smallStore ||\n store.buType === enums_1.StoreBuTypeEnum.shop) {\n stores.push(this.parseStoreItem(store));\n }\n }\n return stores;\n });\n }\n /**\n * Parses store data.\n *\n * @param store Response store.\n * @returns Item string.\n */\n parseStoreItem(store) {\n return {\n id: store.code,\n name: store.storeText,\n location: {\n latitude: store.latitude,\n longitude: store.longitude\n }\n };\n }\n}\nexports.default = DexfStoreService;\n//# sourceMappingURL=DexfStoreService.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * This class is used for transforming data from IRW into the format of the Store model.\n */\nclass IowsStoreTransformer {\n /**\n * Transforms data into format of StoreAvailability model.\n *\n * @param data Data to parse.\n * @returns Parsed data.\n */\n transform(data) {\n const stores = [];\n if (data['StoreRefList'] && data['StoreRefList'].StoreRef) {\n const items = Array.isArray(data['StoreRefList'].StoreRef)\n ? data['StoreRefList'].StoreRef\n : [data['StoreRefList'].StoreRef];\n for (const item of items) {\n stores.push({\n location: this.getLocation(item),\n name: item.StoreName && item.StoreName.$ ? item.StoreName.$ : null,\n id: item.StoreNo && item.StoreNo.$ ? String(item.StoreNo.$) : null,\n url: item.StoreUrl && item.StoreUrl.$ ? item.StoreUrl.$ : null\n });\n }\n }\n return stores;\n }\n /**\n * Returns location.\n *\n * @param item Store item.\n * @returns Parsed data.\n */\n getLocation(item) {\n if (item['StoreLocation'] &&\n item['StoreLocation'].Latitude &&\n item['StoreLocation'].Latitude.$) {\n return {\n latitude: item['StoreLocation'].Latitude.$,\n longitude: item['StoreLocation'].Longitude.$\n };\n }\n return null;\n }\n}\nexports.default = IowsStoreTransformer;\n//# sourceMappingURL=IowsStoreTransformer.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst ServiceFetch_1 = __importDefault(require(\"../../utilities/ServiceFetch\"));\nconst IowsStoreTransformer_1 = __importDefault(require(\"./IowsStoreTransformer\"));\n/**\n * This class is used for fetching and parsing store data for IRW.\n */\nclass IowsStoreService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.consumer Consumer.\n * @param options.contract Contract.\n * @param options.endpoint Endpoint.\n */\n constructor(options) {\n this.consumer = options.consumer;\n this.contract = options.contract;\n this.endpoint = options.endpoint;\n }\n /**\n * Fetches and returns stores.\n *\n * @returns Promise object.\n */\n getStores() {\n return __awaiter(this, void 0, void 0, function* () {\n const transformer = new IowsStoreTransformer_1.default();\n const response = yield ServiceFetch_1.default.json(this.endpoint, {\n credentials: 'same-origin',\n headers: {\n accept: 'application/vnd.ikea.irms+json; version=2',\n 'auth-token': this.consumer + '-' + this.contract,\n contract: this.contract,\n consumer: this.consumer\n }\n });\n return transformer.transform(response);\n });\n }\n}\nexports.default = IowsStoreService;\n//# sourceMappingURL=IowsStoreService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst CacheStoreType_1 = __importDefault(require(\"../../enums/CacheStoreType\"));\nconst DexfStoreService_1 = __importDefault(require(\"../../services/store/DexfStoreService\"));\nconst IowsStoreService_1 = __importDefault(require(\"../../services/store/IowsStoreService\"));\nconst DexfConfiguration_1 = __importDefault(require(\"../../utilities/DexfConfiguration\"));\nconst StoreCache_1 = __importDefault(require(\"./StoreCache\"));\n/**\n * This class is used as a simple interface for store services.\n */\nclass StoreService {\n /**\n * Constructor.\n *\n * @param options Options.\n */\n constructor(options) {\n this.dexfConfiguration = new DexfConfiguration_1.default(options);\n this.locale = options.locale;\n this.consumer = options.consumer;\n this.contract = options.contract;\n this.cache = options.cache || new utilities_1.GlobalCacheStore();\n }\n /**\n * Fetches and returns translations.\n *\n * @returns Promise object.\n */\n getStores() {\n return __awaiter(this, void 0, void 0, function* () {\n const cacheStore = this.cache.getStore(CacheStoreType_1.default.store);\n const storeCache = new StoreCache_1.default(this.locale, this.cache);\n const queueCacheKey = this.locale + 'queue';\n const cachedStores = storeCache.getStores();\n if (cachedStores) {\n return cachedStores;\n }\n const cachedQueue = cacheStore.get(queueCacheKey);\n if (cachedQueue) {\n return new Promise((resolve) => cachedQueue.push(resolve));\n }\n const newQueue = [];\n cacheStore.set(queueCacheKey, newQueue);\n const service = yield this.getService();\n const stores = yield service.getStores();\n storeCache.addStores(stores);\n cacheStore.delete(queueCacheKey);\n for (const callback of newQueue) {\n callback(stores);\n }\n return stores;\n });\n }\n /**\n * Returns service.\n *\n * @returns Service.\n */\n getService() {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n switch (kompis.serviceSettings.storeDataSource) {\n case enums_1.StoreDataSourceEnum.dexf: {\n const dexfApiKey = yield this.dexfConfiguration.getDexfApiKeyOrThrow();\n return new DexfStoreService_1.default({\n endpoint: kompis.endpoints.dexfStoreService,\n dexfApiKey: dexfApiKey\n });\n }\n default:\n if (!this.consumer || !this.contract) {\n throw new exceptions_1.ServiceException('Consumer and contract must be defined.');\n }\n return new IowsStoreService_1.default({\n consumer: this.consumer,\n contract: this.contract,\n endpoint: kompis.endpoints.iowsStoreService\n });\n }\n });\n }\n}\nexports.default = StoreService;\n//# sourceMappingURL=StoreService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst ServiceFetch_1 = __importDefault(require(\"../../../utilities/ServiceFetch\"));\nconst DEFAULT_CONFIGURATION_VERSION = '1.0';\nconst DEFAULT_ICF_VERSION = '1.0';\n/**\n * This class is used for saving planner configurations to the IKEA VPC service.\n */\nclass DexfVpcService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.dexfApplicationId DEXF application ID.\n * @param options.endpoint Endpoint.\n * @param options.dexfApiKey DEXF API key.\n * @param [options.dexfConfigurationVersion] Configuration version. Defaults to \"1.0\".\n * @param [options.dexfIcfVersion] Icf version. Defaults to \"1.0\".\n */\n constructor(options) {\n this.dexfConfigurationVersion = '1.0';\n this.dexfIcfVersion = '1.0';\n this.dexfApplicationId = options.dexfApplicationId;\n this.endpoint = options.endpoint;\n this.dexfApiKey = options.dexfApiKey;\n this.dexfConfigurationVersion =\n options.dexfConfigurationVersion || DEFAULT_CONFIGURATION_VERSION;\n this.dexfIcfVersion = options.dexfIcfVersion || DEFAULT_ICF_VERSION;\n }\n /**\n * Saves a planner configuration.\n *\n * @param configuration Configuration to save.\n * @param shoppingItems Product items.\n * @param [configurationImage] Configuration image as a base 64 string (e.g. \"data:image/jpeg;base64,abc..\").\n * @param insightsCombinationFormat Insights Combination Format.\n * @returns Promise object.\n */\n saveConfiguration(configuration, shoppingItems, configurationImage, insightsCombinationFormat) {\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield ServiceFetch_1.default.json(this.endpoint, {\n method: 'POST',\n body: this.getRequestBody(configuration, shoppingItems, insightsCombinationFormat),\n credentials: 'same-origin',\n headers: {\n 'dexf-api-key': this.dexfApiKey,\n 'content-type': 'application/json'\n }\n });\n if (response && response['configurationId']) {\n const configurationResponse = {\n configurationId: response['configurationId'],\n configurationVersion: this.dexfConfigurationVersion,\n application: this.dexfApplicationId,\n configuration\n };\n if (configurationImage) {\n const images = [];\n if (typeof configurationImage === 'string') {\n images.push({\n typeCode: 'main-design-image',\n image: configurationImage\n });\n }\n else if (Array.isArray(configurationImage)) {\n images.push(...configurationImage);\n }\n const imageResponse = yield Promise.all(images.map((image) => this.saveImage(response['_links'], image.image, image.typeCode)));\n return Object.assign(Object.assign({}, configurationResponse), { imageUrl: imageResponse });\n }\n return configurationResponse;\n }\n return null;\n });\n }\n /**\n * Save image to vpc dexf.\n *\n * @param url Configuration save vpc image url.\n * @param configurationImage Configuration image.\n * @param typeCode Type code.\n * @param links Links.\n * @returns Promise object.\n */\n saveImage(links, configurationImage, typeCode) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n const response = yield ServiceFetch_1.default.json(links[typeCode]['href'], {\n method: 'POST',\n body: configurationImage,\n credentials: 'same-origin',\n headers: {\n 'dexf-api-key': this.dexfApiKey,\n 'content-type': 'text/plain;charset=UTF-8'\n }\n });\n return {\n typeCode,\n url: response['url']\n };\n }\n catch (error) {\n throw new exceptions_1.ServiceException('Failed to save image. Error: ' + error);\n }\n });\n }\n /**\n * Fetches and returns a planner configuration.\n *\n * @param id Configuration ID (VPC Code).\n * @param options\n * @param options.includeIcfData Whether to include ICF data in the response or not.\n * @returns Promise object.\n */\n getConfiguration(id, options) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const url = this.endpoint + '/' + id.toUpperCase();\n const response = yield ServiceFetch_1.default.json(url, {\n credentials: 'same-origin',\n headers: {\n 'dexf-api-key': this.dexfApiKey\n }\n });\n if (response && response['configurationId']) {\n return Object.assign({ configurationId: response['configurationId'], configurationVersion: response['configuration'].version, application: response['application'].toUpperCase(), configuration: response['configuration'].content, imageUrl: response['image'], itemList: ((_a = response['itemList']) === null || _a === void 0 ? void 0 : _a.item) ? this.getItemList(response['itemList'].item) : null }, ((options === null || options === void 0 ? void 0 : options.includeIcfData) && { icf: response['icf'] }));\n }\n return null;\n });\n }\n /**\n * Return a list of shopping items.\n *\n * @param itemList ItemList.\n * @param itemList.itemType ItemType.\n * @param itemList.itemNo ItemNo.\n * @param itemList.quantity Quantity.\n */\n /**\n * @param itemList\n */\n getItemList(itemList) {\n return itemList.map((item) => ({\n id: item.itemNo,\n type: item.itemType,\n quantity: item.quantity\n }));\n }\n /**\n * Returns payload to be used when saving a configuration.\n *\n * @param configuration Configuration to save.\n * @param shoppingItems Product items.\n * @param insightsCombinationFormat Insights Combination Format.\n * @returns Parsed data.\n */\n getRequestBody(configuration, shoppingItems, insightsCombinationFormat) {\n const body = {\n application: this.dexfApplicationId,\n itemList: {\n item: shoppingItems.map((item) => {\n return { itemType: item.type, itemNo: item.id, quantity: item.quantity };\n })\n },\n configuration: {\n version: this.dexfConfigurationVersion,\n content: configuration\n }\n };\n if (insightsCombinationFormat) {\n Object.assign(body, {\n icf: {\n version: this.dexfIcfVersion,\n content: insightsCombinationFormat\n }\n });\n }\n return JSON.stringify(body);\n }\n}\nexports.default = DexfVpcService;\n//# sourceMappingURL=DexfVpcService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst DexfVpcService_1 = __importDefault(require(\"../../services/vpc/dexf/DexfVpcService\"));\nconst DexfConfiguration_1 = __importDefault(require(\"../../utilities/DexfConfiguration\"));\n/**\n * This class is used as a simple interface for VPC services.\n */\nclass VpcService {\n /**\n * Constructor.\n *\n * @param options Options.\n */\n constructor(options) {\n this.applicationName = options.applicationName;\n this.dexfApplicationId = options.dexfApplicationId || null;\n this.dexfConfigurationVersion = options.dexfConfigurationVersion;\n this.dexfIcfVersion = options.dexfIcfVersion;\n this.dexfConfiguration = new DexfConfiguration_1.default(options);\n }\n /**\n * Saves a planner configuration.\n *\n * @param configuration Configuration to save.\n * @param shoppingItems Product items.\n * @param [configurationImage] Configuration image as a base 64 string (e.g. \"data:image/jpeg;base64,abc..\").\n * @param insightsCombinationFormat Insights Combination Format.\n * @returns Promise object.\n */\n saveConfiguration(configuration, shoppingItems, configurationImage, insightsCombinationFormat) {\n return __awaiter(this, void 0, void 0, function* () {\n const service = yield this.getService();\n return yield service.saveConfiguration(configuration, shoppingItems, configurationImage, insightsCombinationFormat);\n });\n }\n /**\n * Fetches and returns a planner configuration.\n *\n * @param id Configuration ID (VPC Code).\n * @param options\n * @param options.includeIcfData Whether to include ICF data in the response or not.\n * @returns Promise object.\n */\n getConfiguration(id, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const service = yield this.getService();\n return yield service.getConfiguration(id, options);\n });\n }\n /**\n * Returns service.\n *\n * @returns Service.\n */\n getService() {\n return __awaiter(this, void 0, void 0, function* () {\n const { kompis } = yield this.dexfConfiguration.getSettings();\n const dexfApiKey = yield this.dexfConfiguration.getDexfApiKeyOrThrow();\n return new DexfVpcService_1.default({\n endpoint: kompis.endpoints.dexfVpcService,\n dexfApplicationId: this.dexfApplicationId || this.applicationName,\n dexfApiKey,\n dexfConfigurationVersion: this.dexfConfigurationVersion,\n dexfIcfVersion: this.dexfIcfVersion\n });\n });\n }\n}\nexports.default = VpcService;\n//# sourceMappingURL=VpcService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst ServiceFetch_1 = __importDefault(require(\"../../utilities/ServiceFetch\"));\n/**\n * This class is used for validating zip code .\n */\nclass DexfZipValidationService {\n /**\n * Constructor.\n *\n * @param options Options.\n * @param options.endpoint Endpoint.\n * @param options.dexfApiKey DEXF Api key.\n */\n constructor(options) {\n this.endpoint = options.endpoint;\n this.dexfApiKey = options.dexfApiKey;\n }\n /**\n * Fetches the validity of a given zip code.\n *\n * @param zipCode\n */\n getZipValidation(zipCode) {\n return __awaiter(this, void 0, void 0, function* () {\n const options = {\n credentials: 'same-origin',\n headers: {\n 'dexf-api-key': this.dexfApiKey\n }\n };\n const url = `${this.endpoint.replace('{zipCode}', encodeURIComponent(zipCode.replace(/ /g, '')))}`;\n const response = yield ServiceFetch_1.default.json(url, options);\n return response;\n });\n }\n}\nexports.default = DexfZipValidationService;\n//# sourceMappingURL=DexfZipValidationService.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst DexfZipValidationService_1 = __importDefault(require(\"../../services/zip-availability/DexfZipValidationService\"));\nconst DexfConfiguration_1 = __importDefault(require(\"../../utilities/DexfConfiguration\"));\n/**\n * This class is used as a simple interface for zip code validation services.\n */\nclass ZipValidationService {\n /**\n * @param options Options.\n */\n constructor(options) {\n this.dexfConfiguration = new DexfConfiguration_1.default(options);\n }\n /**\n * Fetches and returns zip code validity.\n *\n * @param zipCode Zip Code.\n * @returns Promise IZipValidation.\n */\n getZipValidation(zipCode) {\n return __awaiter(this, void 0, void 0, function* () {\n const service = yield this.getService();\n return yield service.getZipValidation(zipCode);\n });\n }\n /**\n * Returns DEXF service if the zipValidationDataSource setting for the locale is not set to 'disabled'.\n *\n * @returns Service | null.\n */\n getService() {\n return __awaiter(this, void 0, void 0, function* () {\n const settings = yield this.dexfConfiguration.getSettings();\n const dexfApiKey = yield this.dexfConfiguration.getDexfApiKeyOrThrow();\n switch (settings.kompis.serviceSettings.zipValidationDataSource) {\n case enums_1.ZipValidationDataSourceEnum.disabled:\n throw new exceptions_1.ServiceException('The zipValidationDataSource is set to \"disabled\". When it is, the ZipValidationService is not available on the market.');\n default:\n return new DexfZipValidationService_1.default({\n endpoint: settings.kompis.endpoints.dexfZipValidationService,\n dexfApiKey\n });\n }\n });\n }\n}\nexports.default = ZipValidationService;\n//# sourceMappingURL=ZipValidationService.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ZipValidationService = exports.ZipCodeCookieInformationService = exports.VpcService = exports.TranslationsService = exports.StoreService = exports.StoreIdCookieInformationService = exports.StoreCache = exports.ShoppingListService = exports.ShoppingCartService = exports.SettingsService = exports.ServiceFetch = exports.SaveService = exports.ProductService = exports.ProductCache = exports.PlatformService = exports.OversattaService = exports.OneWebCookieConsentService = exports.OneWebAuthenticationService = exports.NotificationService = exports.MvEcomShoppingBagService = exports.LocalizationServiceKompis1Migration = exports.LocalizationService = exports.KompisDefaultFields = exports.IowsStoreService = exports.IowsShoppingBagService = exports.IowsAuthenticationService = exports.IngkaShoppingListService = exports.IngkaCartService = exports.FinancingService = exports.DexfZipValidationService = exports.DexfZipAvailabilityService = exports.DexfWebplannerService = exports.DexfVpcService = exports.DexfStoreService = exports.DexfSettingsService = exports.DexfSaveService = exports.DexfNotificationService = exports.DexfAccountService = exports.CookieInformationService = exports.CookieConsentService = exports.ChinaShoppingListService = exports.ChinaCartService = exports.ChinaAuthenticationService = exports.CheckoutAvailabilityService = exports.CacheStoreType = exports.AssemblyServicesService = exports.ApplicationAvailabilityService = exports.AccountService = void 0;\n// Constants\nconst CacheStoreType_1 = __importDefault(require(\"./enums/CacheStoreType\"));\nexports.CacheStoreType = CacheStoreType_1.default;\nconst AccountService_1 = __importDefault(require(\"./facades/account-service/AccountService\"));\nexports.AccountService = AccountService_1.default;\nconst ApplicationAvailabilityService_1 = __importDefault(require(\"./facades/application-availability/ApplicationAvailabilityService\"));\nexports.ApplicationAvailabilityService = ApplicationAvailabilityService_1.default;\nconst AssemblyServicesService_1 = __importDefault(require(\"./facades/assembly-services/AssemblyServicesService\"));\nexports.AssemblyServicesService = AssemblyServicesService_1.default;\nconst CheckoutAvailabilityService_1 = __importDefault(require(\"./facades/checkout-availability/CheckoutAvailabilityService\"));\nexports.CheckoutAvailabilityService = CheckoutAvailabilityService_1.default;\nconst CookieConsentService_1 = __importDefault(require(\"./facades/cookie-consent/CookieConsentService\"));\nexports.CookieConsentService = CookieConsentService_1.default;\nconst CookieInformationService_1 = __importDefault(require(\"./facades/cookie-information/CookieInformationService\"));\nexports.CookieInformationService = CookieInformationService_1.default;\nconst StoreIdCookieInformationService_1 = __importDefault(require(\"./facades/cookie-information/StoreIdCookieInformationService\"));\nexports.StoreIdCookieInformationService = StoreIdCookieInformationService_1.default;\nconst ZipCodeCookieInformationService_1 = __importDefault(require(\"./facades/cookie-information/ZipCodeCookieInformationService\"));\nexports.ZipCodeCookieInformationService = ZipCodeCookieInformationService_1.default;\nconst FinancingService_1 = __importDefault(require(\"./facades/financing/FinancingService\"));\nexports.FinancingService = FinancingService_1.default;\nconst LocalizationService_1 = __importDefault(require(\"./facades/localization/LocalizationService\"));\nexports.LocalizationService = LocalizationService_1.default;\nconst LocalizationServiceKompis1Migration_1 = __importDefault(require(\"./facades/localization/LocalizationServiceKompis1Migration\"));\nexports.LocalizationServiceKompis1Migration = LocalizationServiceKompis1Migration_1.default;\nconst SettingsService_1 = __importDefault(require(\"./facades/localization/SettingsService\"));\nexports.SettingsService = SettingsService_1.default;\nconst TranslationsService_1 = __importDefault(require(\"./facades/localization/TranslationsService\"));\nexports.TranslationsService = TranslationsService_1.default;\nconst NotificationService_1 = __importDefault(require(\"./facades/notification/NotificationService\"));\nexports.NotificationService = NotificationService_1.default;\nconst PlatformService_1 = __importDefault(require(\"./facades/platform/PlatformService\"));\nexports.PlatformService = PlatformService_1.default;\nconst KompisDefaultFields_1 = __importDefault(require(\"./facades/product/KompisDefaultFields\"));\nexports.KompisDefaultFields = KompisDefaultFields_1.default;\nconst ProductCache_1 = __importDefault(require(\"./facades/product/ProductCache\"));\nexports.ProductCache = ProductCache_1.default;\nconst ProductService_1 = __importDefault(require(\"./facades/product/ProductService\"));\nexports.ProductService = ProductService_1.default;\nconst SaveService_1 = __importDefault(require(\"./facades/save-service/SaveService\"));\nexports.SaveService = SaveService_1.default;\nconst ShoppingCartService_1 = __importDefault(require(\"./facades/shopping/ShoppingCartService\"));\nexports.ShoppingCartService = ShoppingCartService_1.default;\nconst ShoppingListService_1 = __importDefault(require(\"./facades/shopping/ShoppingListService\"));\nexports.ShoppingListService = ShoppingListService_1.default;\nconst StoreCache_1 = __importDefault(require(\"./facades/store/StoreCache\"));\nexports.StoreCache = StoreCache_1.default;\nconst StoreService_1 = __importDefault(require(\"./facades/store/StoreService\"));\nexports.StoreService = StoreService_1.default;\nconst VpcService_1 = __importDefault(require(\"./facades/vpc/VpcService\"));\nexports.VpcService = VpcService_1.default;\nconst ZipValidationService_1 = __importDefault(require(\"./facades/zip-validation/ZipValidationService\"));\nexports.ZipValidationService = ZipValidationService_1.default;\nconst DexfAccountService_1 = __importDefault(require(\"./services/authentication/account-service/DexfAccountService\"));\nexports.DexfAccountService = DexfAccountService_1.default;\nconst ChinaAuthenticationService_1 = __importDefault(require(\"./services/authentication/china/ChinaAuthenticationService\"));\nexports.ChinaAuthenticationService = ChinaAuthenticationService_1.default;\nconst IowsAuthenticationService_1 = __importDefault(require(\"./services/authentication/iows/IowsAuthenticationService\"));\nexports.IowsAuthenticationService = IowsAuthenticationService_1.default;\nconst OneWebAuthenticationService_1 = __importDefault(require(\"./services/authentication/one-web/OneWebAuthenticationService\"));\nexports.OneWebAuthenticationService = OneWebAuthenticationService_1.default;\nconst OneWebCookieConsentService_1 = __importDefault(require(\"./services/cookie-consent/OneWebCookieConsentService\"));\nexports.OneWebCookieConsentService = OneWebCookieConsentService_1.default;\nconst DexfSettingsService_1 = __importDefault(require(\"./services/localization/DexfSettingsService\"));\nexports.DexfSettingsService = DexfSettingsService_1.default;\nconst OversattaService_1 = __importDefault(require(\"./services/localization/OversattaService\"));\nexports.OversattaService = OversattaService_1.default;\nconst DexfNotificationService_1 = __importDefault(require(\"./services/notification/DexfNotificationService\"));\nexports.DexfNotificationService = DexfNotificationService_1.default;\nconst DexfWebplannerService_1 = __importDefault(require(\"./services/product/DexfWebplannerService\"));\nexports.DexfWebplannerService = DexfWebplannerService_1.default;\nconst DexfSaveService_1 = __importDefault(require(\"./services/save-service/DexfSaveService\"));\nexports.DexfSaveService = DexfSaveService_1.default;\nconst ChinaCartService_1 = __importDefault(require(\"./services/shopping/china/cart/ChinaCartService\"));\nexports.ChinaCartService = ChinaCartService_1.default;\nconst ChinaShoppingListService_1 = __importDefault(require(\"./services/shopping/china/shopping-list/ChinaShoppingListService\"));\nexports.ChinaShoppingListService = ChinaShoppingListService_1.default;\nconst IngkaCartService_1 = __importDefault(require(\"./services/shopping/ingka/cart/IngkaCartService\"));\nexports.IngkaCartService = IngkaCartService_1.default;\nconst IngkaShoppingListService_1 = __importDefault(require(\"./services/shopping/ingka/shopping-list/IngkaShoppingListService\"));\nexports.IngkaShoppingListService = IngkaShoppingListService_1.default;\nconst IowsShoppingBagService_1 = __importDefault(require(\"./services/shopping/iows/IowsShoppingBagService\"));\nexports.IowsShoppingBagService = IowsShoppingBagService_1.default;\nconst MvEcomShoppingBagService_1 = __importDefault(require(\"./services/shopping/mvecom/MvEcomShoppingBagService\"));\nexports.MvEcomShoppingBagService = MvEcomShoppingBagService_1.default;\nconst DexfStoreService_1 = __importDefault(require(\"./services/store/DexfStoreService\"));\nexports.DexfStoreService = DexfStoreService_1.default;\nconst IowsStoreService_1 = __importDefault(require(\"./services/store/IowsStoreService\"));\nexports.IowsStoreService = IowsStoreService_1.default;\nconst DexfVpcService_1 = __importDefault(require(\"./services/vpc/dexf/DexfVpcService\"));\nexports.DexfVpcService = DexfVpcService_1.default;\nconst DexfZipAvailabilityService_1 = __importDefault(require(\"./services/zip-availability/DexfZipAvailabilityService\"));\nexports.DexfZipAvailabilityService = DexfZipAvailabilityService_1.default;\nconst DexfZipValidationService_1 = __importDefault(require(\"./services/zip-availability/DexfZipValidationService\"));\nexports.DexfZipValidationService = DexfZipValidationService_1.default;\n// Utilities\nconst ServiceFetch_1 = __importDefault(require(\"./utilities/ServiceFetch\"));\nexports.ServiceFetch = ServiceFetch_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar NavigationToEnum;\n(function (NavigationToEnum) {\n NavigationToEnum[\"ikeaMainPage\"] = \"ikea web main page\";\n NavigationToEnum[\"ikeaFavorites\"] = \"ikea web favorites\";\n NavigationToEnum[\"ikeaCart\"] = \"ikea web shopping cart\";\n NavigationToEnum[\"ikeaAssembly\"] = \"ikea assembly services info\";\n})(NavigationToEnum || (NavigationToEnum = {}));\nexports.default = NavigationToEnum;\n//# sourceMappingURL=NavigationToEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst KOMPIS_AB_TEST_KEY = 'kompisABTest';\n/**\n * A/B test variation utility.\n */\nclass ABTestUtility {\n /**\n * Returns AB test name and variation if there is an active test available in DEXF settings.\n * If no test is enabled it will return null.\n *\n * @param settings\n */\n static initializeABTests(settings) {\n const { abTest } = settings.kompis.localization;\n if (!(abTest && abTest in enums_1.ABTestNameEnum)) {\n return null;\n }\n const name = abTest;\n const variation = ABTestUtility.getVariation(name);\n return { name, variation };\n }\n /**\n * @param abTestId\n */\n static getVariation(abTestId) {\n var _a;\n return (_a = this.getLocalStorageTestVariation(abTestId)) !== null && _a !== void 0 ? _a : this.setNewTestVariation(abTestId);\n }\n /**\n * @param abTestId\n */\n static getLocalStorageTestVariation(abTestId) {\n const localStorageABTest = localStorage.getItem(KOMPIS_AB_TEST_KEY);\n const localStorageABTestKeys = localStorageABTest && JSON.parse(localStorageABTest);\n if (localStorageABTestKeys) {\n const currentABTest = localStorageABTestKeys[abTestId];\n if (currentABTest && currentABTest in enums_1.ABTestVariationEnum) {\n return currentABTest;\n }\n }\n return null;\n }\n /**\n * @param abTestId\n */\n static setNewTestVariation(abTestId) {\n const variation = Math.random() < 0.5 ? enums_1.ABTestVariationEnum.A : enums_1.ABTestVariationEnum.B;\n const localStorageABTest = localStorage.getItem(KOMPIS_AB_TEST_KEY);\n const value = Object.assign(Object.assign({}, (localStorageABTest && JSON.parse(localStorageABTest))), { [abTestId]: variation });\n localStorage.setItem(KOMPIS_AB_TEST_KEY, JSON.stringify(value));\n return variation;\n }\n}\nexports.default = ABTestUtility;\n//# sourceMappingURL=ABTestUtility.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Used for setting the instance of InsightsApi, so that components\n * with automatic analytics can access it, and send events through it.\n */\nclass AnalyticsManager {\n /**\n * Returns the set insightsApi instance, or null if it wasn't set.\n */\n static getInsightsApi() {\n return this.insightsApi;\n }\n /**\n * Planners should call this method as early as possible, before rendering\n * any components which have automatic analytics enabled.\n *\n * @param insightsApi The insightsApi instance created by the planner.\n */\n static setInsightsApi(insightsApi) {\n this.insightsApi = insightsApi;\n }\n}\nAnalyticsManager.insightsApi = null;\nexports.default = AnalyticsManager;\n//# sourceMappingURL=AnalyticsManager.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst services_1 = require(\"@inter-ikea-kompis/services\");\nconst ReporterManager_1 = __importDefault(require(\"../utilities/ReporterManager\"));\n/**\n * Provides the connection between a tracker and the Insights DPC.\n */\nclass InsightsReporter {\n constructor() {\n this.moduleClient = null;\n this.cookieConsentService = null;\n }\n /**\n * Connects the reporter to the Insights DPC.\n *\n * @param insightsApi\n * @param moduleMetaData\n * @param cookieConsentServiceOptions\n */\n connect(insightsApi, moduleMetaData, cookieConsentServiceOptions) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n // We consider the reporter connected regardless of if the module client was created or not.\n // We connect first, before any async stuff, to allow disconnecting while any async stuff is ongoing.\n ReporterManager_1.default.connect(this);\n this.cookieConsentService = new services_1.CookieConsentService(cookieConsentServiceOptions);\n const hasCookieConsent = yield ((_a = this.cookieConsentService) === null || _a === void 0 ? void 0 : _a.hasCookieConsent(2));\n if (hasCookieConsent) {\n if (!insightsApi) {\n throw Error(`InsightsApi is not found, did you forget to run AnalyticsManager.setInsightsApi before rendering ${moduleMetaData.moduleId}?`);\n }\n if (!insightsApi.isEnabled) {\n throw Error(`InsightsApi is not enabled, did you forget to run insightsApi.connectApplication before rendering ${moduleMetaData.moduleId}?`);\n }\n this.moduleClient = insightsApi.moduleClient(moduleMetaData);\n }\n });\n }\n /**\n * Returns whether the reporter has been connected or not.\n * It is still considered connected even if no module client could be created when trying to connect.\n *\n * @returns Whether the reporter has been connected or not.\n */\n isConnected() {\n return ReporterManager_1.default.isConnected(this);\n }\n /**\n * Disconnects the reporter.\n */\n disconnect() {\n ReporterManager_1.default.disconnect(this);\n }\n /**\n * Get the id of the the reporter, if connected. See {@link ReporterManager.getConnectedId}.\n */\n getConnectedId() {\n return ReporterManager_1.default.getConnectedId(this);\n }\n /**\n * Report a custom event to InsightsApi.\n *\n * @param event\n */\n report(event) {\n return this.reportIfCookieConsent(() => { var _a; return (_a = this.moduleClient) === null || _a === void 0 ? void 0 : _a.sendEvent(event); });\n }\n /**\n * @param data\n */\n addToCart(data) {\n return this.reportIfCookieConsent(() => { var _a; return (_a = this.moduleClient) === null || _a === void 0 ? void 0 : _a.addToCart(data); });\n }\n /**\n * @param data\n */\n addToWishList(data) {\n return this.reportIfCookieConsent(() => { var _a; return (_a = this.moduleClient) === null || _a === void 0 ? void 0 : _a.addToWishList(data); });\n }\n saveDesign(options, context) {\n const { type } = options;\n const vpcCode = 'vpcCode' in options ? options.vpcCode : undefined;\n const payload = {\n type,\n context\n };\n return this.reportIfCookieConsent(() => { var _a; return (_a = this.moduleClient) === null || _a === void 0 ? void 0 : _a.saveDesign(vpcCode, payload); });\n }\n /**\n * @param sendFunction Function to perform if the user has cookie consent.\n */\n reportIfCookieConsent(sendFunction) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const hasCookieConsent = yield ((_a = this.cookieConsentService) === null || _a === void 0 ? void 0 : _a.hasCookieConsent(2));\n if (hasCookieConsent) {\n sendFunction();\n }\n });\n }\n}\nexports.default = InsightsReporter;\n//# sourceMappingURL=InsightsReporter.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst InsightsReporter_1 = __importDefault(require(\"../reporters/InsightsReporter\"));\n/**\n * Used internally in Kompis for managing of {@link IAnalyticsReporter}s which are used to send analytics.\n *\n * Should NOT be used by planners.\n */\nclass ReporterManager {\n /**\n * Returns an existing connected reporter based on optional id, or creates a new one, or uses the platform reporter set from outside (only in the Kompis platform).\n *\n * @param id The id of an existing reporter, if any. Used to share the same instance of reporter across mutliple trackers.\n */\n static getReporter(id) {\n var _a;\n if (id) {\n const reporter = this.reporterMap.get(id);\n if (!reporter) {\n throw Error(`Expected to find reporter based on id ${id}, but found none.`);\n }\n return reporter;\n }\n return (_a = this.platformReporter) !== null && _a !== void 0 ? _a : new InsightsReporter_1.default();\n }\n /**\n * Store the reporter instance.\n * This makes it possible to access the same instance of the reporter across multiple components by passing an id to the reporter between components.\n *\n * @param reporter The reporter.\n */\n static connect(reporter) {\n const id = this.idGenerator.generateId();\n this.reporterMap.set(id, reporter);\n }\n /**\n * Attempts to remove the provided reporter from the reporter cache.\n * This will only have an effect if the reporter has been connected earlier.\n *\n * @param reporter The reporter.\n */\n static disconnect(reporter) {\n const id = this.getConnectedId(reporter);\n if (id) {\n this.reporterMap.delete(id);\n }\n }\n /**\n * Returns whether the reporter has been connected or not.\n *\n * @param reporter The reporter.\n */\n static isConnected(reporter) {\n return !!this.getConnectedId(reporter);\n }\n /**\n * Get the id of the provided reporter.\n * The id can only be found if the reporter is connected.\n *\n * @param reporter The reporter.\n */\n static getConnectedId(reporter) {\n for (const [id, reporterEntry] of this.reporterMap.entries()) {\n if (reporterEntry === reporter) {\n return id;\n }\n }\n return null;\n }\n /**\n * Used internally to make tracking in the platform work. Is always PlatformReporter.\n *\n * @param platformReporter\n */\n static setPlatformReporter(platformReporter) {\n this.platformReporter = platformReporter;\n }\n}\nReporterManager.platformReporter = null;\nReporterManager.reporterMap = new Map();\nReporterManager.idGenerator = new utilities_1.IdGenerator();\nexports.default = ReporterManager;\n//# sourceMappingURL=ReporterManager.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst ABTestUtility_1 = __importDefault(require(\"../utilities/ABTestUtility\"));\nconst AnalyticsManager_1 = __importDefault(require(\"../utilities/AnalyticsManager\"));\nconst ReporterManager_1 = __importDefault(require(\"../utilities/ReporterManager\"));\n/**\n * Base class for analytics trackers.\n * Handles the common connect / disconnect logic.\n */\nclass AbstractAnalyticsTracker {\n /**\n * @param options\n * @param options.moduleId The id of the module (for identification of events).\n * @param options.dev Should be true if application is in development mode, defaults to false.\n * @param options.ab If ab tests should be enabled or not.\n * @param options.settings DEXF settings needed for Cookie Consent service and AB tests.\n * @param options.locale Locale needed for Cookie Consent service.\n * @param options.reporterId The id of an already connected reporter instance which should be used by this tracker.\n */\n constructor(options) {\n this.reporter = ReporterManager_1.default.getReporter(options.reporterId);\n this.options = options;\n const { ab, settings } = options;\n this.abTest = ab ? ABTestUtility_1.default.initializeABTests(settings) : null;\n this.managesReporterLifecycle = !this.reporter.isConnected();\n }\n /**\n * Connects the reporter used by the tracker.\n * If the reporter is managed by another tracker, nothing will happen. The reporter is already connected and can be reused by this tracker.\n *\n * The trackers are responsible for the reporters' lifecycles, that is connecting and disconnecting them.\n * A reporter can be used by several trackers, but it should only be connected and disconnected once. This is the responsibility of the tracker of top level component.\n *\n * Example:\n * - Component_A has support for analytics.\n * - Component_B has support for analytics.\n * - Component_B can be rendered both from within Component_A and can be used stand alone.\n *\n * Scenarios:\n * - Component_A calls Tracker_A.connect. Tracker_A manages the reporter lifecycle, the reporter will be connected.\n * - Component_B (as stand alone) calls Tracker_B.connect. Tracker_B manages the reporter lifecycle, the reporter will be connected.\n * - Component_B (within Component_A) calls Tracker_B.connect. Tracker_A manages the reporter lifecycle, nothing will happen, the reporter is already connected.\n *\n */\n connect() {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.managesReporterLifecycle) {\n return;\n }\n const insightsApi = AnalyticsManager_1.default.getInsightsApi();\n const { moduleId, dev, locale, settings } = this.options;\n const cookieConsentServiceOptions = { locale, settings: settings };\n return this.reporter.connect(insightsApi, {\n moduleId,\n moduleVersion: this.getVersion(),\n dev,\n abVersionName: (_a = this.abTest) === null || _a === void 0 ? void 0 : _a.name,\n abVersionVariation: (_b = this.abTest) === null || _b === void 0 ? void 0 : _b.variation\n }, cookieConsentServiceOptions);\n });\n }\n /**\n * Disconnects the reporter used by tracker.\n * If the reporter is managed by another tracker, nothing will happen. The reporter can be used by several trackers and it should not be disconnected while still in use by another tracker.\n *\n * See {@link connect} for more information.\n */\n disconnect() {\n if (this.managesReporterLifecycle) {\n this.reporter.disconnect();\n }\n }\n /**\n * Get the id used to retrieve the connected reporter or null if the reporter is not connected yet.\n *\n * @returns The id or null.\n */\n getConnectedReporterId() {\n return this.reporter.getConnectedId();\n }\n /**\n * @returns AB test name and variation if there is an active test available in Översätta.\n */\n getABTest() {\n var _a;\n return (_a = this.abTest) !== null && _a !== void 0 ? _a : null;\n }\n /**\n * Returns the reporter.\n */\n getReporter() {\n return this.reporter;\n }\n /**\n * Returns the current version of the analytics package.\n */\n getVersion() {\n const packageJson = require('../../package.json');\n return packageJson.version;\n }\n}\nexports.default = AbstractAnalyticsTracker;\n//# sourceMappingURL=AbstractAnalyticsTracker.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ReporterManager = exports.NavigationToEnum = exports.AnalyticsManager = exports.ABTestUtility = exports.AbstractAnalyticsTracker = void 0;\nconst NavigationToEnum_1 = __importDefault(require(\"./enums/NavigationToEnum\"));\nexports.NavigationToEnum = NavigationToEnum_1.default;\nconst AbstractAnalyticsTracker_1 = __importDefault(require(\"./trackers/AbstractAnalyticsTracker\"));\nexports.AbstractAnalyticsTracker = AbstractAnalyticsTracker_1.default;\nconst ABTestUtility_1 = __importDefault(require(\"./utilities/ABTestUtility\"));\nexports.ABTestUtility = ABTestUtility_1.default;\nconst AnalyticsManager_1 = __importDefault(require(\"./utilities/AnalyticsManager\"));\nexports.AnalyticsManager = AnalyticsManager_1.default;\nconst ReporterManager_1 = __importDefault(require(\"./utilities/ReporterManager\"));\nexports.ReporterManager = ReporterManager_1.default;\n//# sourceMappingURL=index.js.map","// eslint-disable-next-line @typescript-eslint/unbound-method\nconst objectToString = Object.prototype.toString;\n\n/**\n * Checks whether given value's type is one of a few Error or Error-like\n * {@link isError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isError(wat) {\n switch (objectToString.call(wat)) {\n case '[object Error]':\n case '[object Exception]':\n case '[object DOMException]':\n return true;\n default:\n return isInstanceOf(wat, Error);\n }\n}\n/**\n * Checks whether given value is an instance of the given built-in class.\n *\n * @param wat The value to be checked\n * @param className\n * @returns A boolean representing the result.\n */\nfunction isBuiltin(wat, className) {\n return objectToString.call(wat) === `[object ${className}]`;\n}\n\n/**\n * Checks whether given value's type is ErrorEvent\n * {@link isErrorEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isErrorEvent(wat) {\n return isBuiltin(wat, 'ErrorEvent');\n}\n\n/**\n * Checks whether given value's type is DOMError\n * {@link isDOMError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isDOMError(wat) {\n return isBuiltin(wat, 'DOMError');\n}\n\n/**\n * Checks whether given value's type is DOMException\n * {@link isDOMException}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isDOMException(wat) {\n return isBuiltin(wat, 'DOMException');\n}\n\n/**\n * Checks whether given value's type is a string\n * {@link isString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isString(wat) {\n return isBuiltin(wat, 'String');\n}\n\n/**\n * Checks whether given string is parameterized\n * {@link isParameterizedString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isParameterizedString(wat) {\n return (\n typeof wat === 'object' &&\n wat !== null &&\n '__sentry_template_string__' in wat &&\n '__sentry_template_values__' in wat\n );\n}\n\n/**\n * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)\n * {@link isPrimitive}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isPrimitive(wat) {\n return wat === null || isParameterizedString(wat) || (typeof wat !== 'object' && typeof wat !== 'function');\n}\n\n/**\n * Checks whether given value's type is an object literal, or a class instance.\n * {@link isPlainObject}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isPlainObject(wat) {\n return isBuiltin(wat, 'Object');\n}\n\n/**\n * Checks whether given value's type is an Event instance\n * {@link isEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isEvent(wat) {\n return typeof Event !== 'undefined' && isInstanceOf(wat, Event);\n}\n\n/**\n * Checks whether given value's type is an Element instance\n * {@link isElement}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isElement(wat) {\n return typeof Element !== 'undefined' && isInstanceOf(wat, Element);\n}\n\n/**\n * Checks whether given value's type is an regexp\n * {@link isRegExp}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isRegExp(wat) {\n return isBuiltin(wat, 'RegExp');\n}\n\n/**\n * Checks whether given value has a then function.\n * @param wat A value to be checked.\n */\nfunction isThenable(wat) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return Boolean(wat && wat.then && typeof wat.then === 'function');\n}\n\n/**\n * Checks whether given value's type is a SyntheticEvent\n * {@link isSyntheticEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isSyntheticEvent(wat) {\n return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;\n}\n\n/**\n * Checks whether given value is NaN\n * {@link isNaN}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isNaN(wat) {\n return typeof wat === 'number' && wat !== wat;\n}\n\n/**\n * Checks whether given value's type is an instance of provided constructor.\n * {@link isInstanceOf}.\n *\n * @param wat A value to be checked.\n * @param base A constructor to be used in a check.\n * @returns A boolean representing the result.\n */\nfunction isInstanceOf(wat, base) {\n try {\n return wat instanceof base;\n } catch (_e) {\n return false;\n }\n}\n\n/**\n * Checks whether given value's type is a Vue ViewModel.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isVueViewModel(wat) {\n // Not using Object.prototype.toString because in Vue 3 it would read the instance's Symbol(Symbol.toStringTag) property.\n return !!(typeof wat === 'object' && wat !== null && ((wat ).__isVue || (wat )._isVue));\n}\n\nexport { isDOMError, isDOMException, isElement, isError, isErrorEvent, isEvent, isInstanceOf, isNaN, isParameterizedString, isPlainObject, isPrimitive, isRegExp, isString, isSyntheticEvent, isThenable, isVueViewModel };\n//# sourceMappingURL=is.js.map\n","import { isVueViewModel, isString, isRegExp } from './is.js';\n\n/**\n * Truncates given string to the maximum characters count\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string (0 = unlimited)\n * @returns string Encoded\n */\nfunction truncate(str, max = 0) {\n if (typeof str !== 'string' || max === 0) {\n return str;\n }\n return str.length <= max ? str : `${str.slice(0, max)}...`;\n}\n\n/**\n * This is basically just `trim_line` from\n * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string\n * @returns string Encoded\n */\nfunction snipLine(line, colno) {\n let newLine = line;\n const lineLength = newLine.length;\n if (lineLength <= 150) {\n return newLine;\n }\n if (colno > lineLength) {\n // eslint-disable-next-line no-param-reassign\n colno = lineLength;\n }\n\n let start = Math.max(colno - 60, 0);\n if (start < 5) {\n start = 0;\n }\n\n let end = Math.min(start + 140, lineLength);\n if (end > lineLength - 5) {\n end = lineLength;\n }\n if (end === lineLength) {\n start = Math.max(end - 140, 0);\n }\n\n newLine = newLine.slice(start, end);\n if (start > 0) {\n newLine = `'{snip} ${newLine}`;\n }\n if (end < lineLength) {\n newLine += ' {snip}';\n }\n\n return newLine;\n}\n\n/**\n * Join values in array\n * @param input array of values to be joined together\n * @param delimiter string to be placed in-between values\n * @returns Joined values\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction safeJoin(input, delimiter) {\n if (!Array.isArray(input)) {\n return '';\n }\n\n const output = [];\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < input.length; i++) {\n const value = input[i];\n try {\n // This is a hack to fix a Vue3-specific bug that causes an infinite loop of\n // console warnings. This happens when a Vue template is rendered with\n // an undeclared variable, which we try to stringify, ultimately causing\n // Vue to issue another warning which repeats indefinitely.\n // see: https://github.com/getsentry/sentry-javascript/pull/8981\n if (isVueViewModel(value)) {\n output.push('[VueViewModel]');\n } else {\n output.push(String(value));\n }\n } catch (e) {\n output.push('[value cannot be serialized]');\n }\n }\n\n return output.join(delimiter);\n}\n\n/**\n * Checks if the given value matches a regex or string\n *\n * @param value The string to test\n * @param pattern Either a regex or a string against which `value` will be matched\n * @param requireExactStringMatch If true, `value` must match `pattern` exactly. If false, `value` will match\n * `pattern` if it contains `pattern`. Only applies to string-type patterns.\n */\nfunction isMatchingPattern(\n value,\n pattern,\n requireExactStringMatch = false,\n) {\n if (!isString(value)) {\n return false;\n }\n\n if (isRegExp(pattern)) {\n return pattern.test(value);\n }\n if (isString(pattern)) {\n return requireExactStringMatch ? value === pattern : value.includes(pattern);\n }\n\n return false;\n}\n\n/**\n * Test the given string against an array of strings and regexes. By default, string matching is done on a\n * substring-inclusion basis rather than a strict equality basis\n *\n * @param testString The string to test\n * @param patterns The patterns against which to test the string\n * @param requireExactStringMatch If true, `testString` must match one of the given string patterns exactly in order to\n * count. If false, `testString` will match a string pattern if it contains that pattern.\n * @returns\n */\nfunction stringMatchesSomePattern(\n testString,\n patterns = [],\n requireExactStringMatch = false,\n) {\n return patterns.some(pattern => isMatchingPattern(testString, pattern, requireExactStringMatch));\n}\n\nexport { isMatchingPattern, safeJoin, snipLine, stringMatchesSomePattern, truncate };\n//# sourceMappingURL=string.js.map\n","import { isInstanceOf } from './is.js';\nimport { truncate } from './string.js';\n\n/**\n * Creates exceptions inside `event.exception.values` for errors that are nested on properties based on the `key` parameter.\n */\nfunction applyAggregateErrorsToEvent(\n exceptionFromErrorImplementation,\n parser,\n maxValueLimit = 250,\n key,\n limit,\n event,\n hint,\n) {\n if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n return;\n }\n\n // Generally speaking the last item in `event.exception.values` is the exception originating from the original Error\n const originalException =\n event.exception.values.length > 0 ? event.exception.values[event.exception.values.length - 1] : undefined;\n\n // We only create exception grouping if there is an exception in the event.\n if (originalException) {\n event.exception.values = truncateAggregateExceptions(\n aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n hint.originalException ,\n key,\n event.exception.values,\n originalException,\n 0,\n ),\n maxValueLimit,\n );\n }\n}\n\nfunction aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n error,\n key,\n prevExceptions,\n exception,\n exceptionId,\n) {\n if (prevExceptions.length >= limit + 1) {\n return prevExceptions;\n }\n\n let newExceptions = [...prevExceptions];\n\n // Recursively call this function in order to walk down a chain of errors\n if (isInstanceOf(error[key], Error)) {\n applyExceptionGroupFieldsForParentException(exception, exceptionId);\n const newException = exceptionFromErrorImplementation(parser, error[key]);\n const newExceptionId = newExceptions.length;\n applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId);\n newExceptions = aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n error[key],\n key,\n [newException, ...newExceptions],\n newException,\n newExceptionId,\n );\n }\n\n // This will create exception grouping for AggregateErrors\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError\n if (Array.isArray(error.errors)) {\n error.errors.forEach((childError, i) => {\n if (isInstanceOf(childError, Error)) {\n applyExceptionGroupFieldsForParentException(exception, exceptionId);\n const newException = exceptionFromErrorImplementation(parser, childError);\n const newExceptionId = newExceptions.length;\n applyExceptionGroupFieldsForChildException(newException, `errors[${i}]`, newExceptionId, exceptionId);\n newExceptions = aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n childError,\n key,\n [newException, ...newExceptions],\n newException,\n newExceptionId,\n );\n }\n });\n }\n\n return newExceptions;\n}\n\nfunction applyExceptionGroupFieldsForParentException(exception, exceptionId) {\n // Don't know if this default makes sense. The protocol requires us to set these values so we pick *some* default.\n exception.mechanism = exception.mechanism || { type: 'generic', handled: true };\n\n exception.mechanism = {\n ...exception.mechanism,\n ...(exception.type === 'AggregateError' && { is_exception_group: true }),\n exception_id: exceptionId,\n };\n}\n\nfunction applyExceptionGroupFieldsForChildException(\n exception,\n source,\n exceptionId,\n parentId,\n) {\n // Don't know if this default makes sense. The protocol requires us to set these values so we pick *some* default.\n exception.mechanism = exception.mechanism || { type: 'generic', handled: true };\n\n exception.mechanism = {\n ...exception.mechanism,\n type: 'chained',\n source,\n exception_id: exceptionId,\n parent_id: parentId,\n };\n}\n\n/**\n * Truncate the message (exception.value) of all exceptions in the event.\n * Because this event processor is ran after `applyClientOptions`,\n * we need to truncate the message of the added exceptions here.\n */\nfunction truncateAggregateExceptions(exceptions, maxValueLength) {\n return exceptions.map(exception => {\n if (exception.value) {\n exception.value = truncate(exception.value, maxValueLength);\n }\n return exception;\n });\n}\n\nexport { applyAggregateErrorsToEvent };\n//# sourceMappingURL=aggregate-errors.js.map\n","/** Internal global with common properties and Sentry extensions */\n\n// The code below for 'isGlobalObj' and 'GLOBAL_OBJ' was copied from core-js before modification\n// https://github.com/zloirock/core-js/blob/1b944df55282cdc99c90db5f49eb0b6eda2cc0a3/packages/core-js/internals/global.js\n// core-js has the following licence:\n//\n// Copyright (c) 2014-2022 Denis Pushkarev\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/** Returns 'obj' if it's the global object, otherwise returns undefined */\nfunction isGlobalObj(obj) {\n return obj && obj.Math == Math ? obj : undefined;\n}\n\n/** Get's the global object for the current JavaScript runtime */\nconst GLOBAL_OBJ =\n (typeof globalThis == 'object' && isGlobalObj(globalThis)) ||\n // eslint-disable-next-line no-restricted-globals\n (typeof window == 'object' && isGlobalObj(window)) ||\n (typeof self == 'object' && isGlobalObj(self)) ||\n (typeof global == 'object' && isGlobalObj(global)) ||\n (function () {\n return this;\n })() ||\n {};\n\n/**\n * @deprecated Use GLOBAL_OBJ instead or WINDOW from @sentry/browser. This will be removed in v8\n */\nfunction getGlobalObject() {\n return GLOBAL_OBJ ;\n}\n\n/**\n * Returns a global singleton contained in the global `__SENTRY__` object.\n *\n * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory\n * function and added to the `__SENTRY__` object.\n *\n * @param name name of the global singleton on __SENTRY__\n * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__`\n * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `GLOBAL_OBJ`'s return value\n * @returns the singleton\n */\nfunction getGlobalSingleton(name, creator, obj) {\n const gbl = (obj || GLOBAL_OBJ) ;\n const __SENTRY__ = (gbl.__SENTRY__ = gbl.__SENTRY__ || {});\n const singleton = __SENTRY__[name] || (__SENTRY__[name] = creator());\n return singleton;\n}\n\nexport { GLOBAL_OBJ, getGlobalObject, getGlobalSingleton };\n//# sourceMappingURL=worldwide.js.map\n","import { isString } from './is.js';\nimport { getGlobalObject } from './worldwide.js';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject();\n\nconst DEFAULT_MAX_STRING_LENGTH = 80;\n\n/**\n * Given a child DOM element, returns a query-selector statement describing that\n * and its ancestors\n * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nfunction htmlTreeAsString(\n elem,\n options = {},\n) {\n if (!elem) {\n return '';\n }\n\n // try/catch both:\n // - accessing event.target (see getsentry/raven-js#838, #768)\n // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly\n // - can throw an exception in some circumstances.\n try {\n let currentElem = elem ;\n const MAX_TRAVERSE_HEIGHT = 5;\n const out = [];\n let height = 0;\n let len = 0;\n const separator = ' > ';\n const sepLength = separator.length;\n let nextStr;\n const keyAttrs = Array.isArray(options) ? options : options.keyAttrs;\n const maxStringLength = (!Array.isArray(options) && options.maxStringLength) || DEFAULT_MAX_STRING_LENGTH;\n\n while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = _htmlElementAsString(currentElem, keyAttrs);\n // bail out if\n // - nextStr is the 'html' element\n // - the length of the string that would be created exceeds maxStringLength\n // (ignore this limit if we are on the first iteration)\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength)) {\n break;\n }\n\n out.push(nextStr);\n\n len += nextStr.length;\n currentElem = currentElem.parentNode;\n }\n\n return out.reverse().join(separator);\n } catch (_oO) {\n return '';\n }\n}\n\n/**\n * Returns a simple, query-selector representation of a DOM element\n * e.g. [HTMLElement] => input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nfunction _htmlElementAsString(el, keyAttrs) {\n const elem = el\n\n;\n\n const out = [];\n let className;\n let classes;\n let key;\n let attr;\n let i;\n\n if (!elem || !elem.tagName) {\n return '';\n }\n\n // @ts-expect-error WINDOW has HTMLElement\n if (WINDOW.HTMLElement) {\n // If using the component name annotation plugin, this value may be available on the DOM node\n if (elem instanceof HTMLElement && elem.dataset && elem.dataset['sentryComponent']) {\n return elem.dataset['sentryComponent'];\n }\n }\n\n out.push(elem.tagName.toLowerCase());\n\n // Pairs of attribute keys defined in `serializeAttribute` and their values on element.\n const keyAttrPairs =\n keyAttrs && keyAttrs.length\n ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)])\n : null;\n\n if (keyAttrPairs && keyAttrPairs.length) {\n keyAttrPairs.forEach(keyAttrPair => {\n out.push(`[${keyAttrPair[0]}=\"${keyAttrPair[1]}\"]`);\n });\n } else {\n if (elem.id) {\n out.push(`#${elem.id}`);\n }\n\n // eslint-disable-next-line prefer-const\n className = elem.className;\n if (className && isString(className)) {\n classes = className.split(/\\s+/);\n for (i = 0; i < classes.length; i++) {\n out.push(`.${classes[i]}`);\n }\n }\n }\n const allowedAttrs = ['aria-label', 'type', 'name', 'title', 'alt'];\n for (i = 0; i < allowedAttrs.length; i++) {\n key = allowedAttrs[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.push(`[${key}=\"${attr}\"]`);\n }\n }\n return out.join('');\n}\n\n/**\n * A safe form of location.href\n */\nfunction getLocationHref() {\n try {\n return WINDOW.document.location.href;\n } catch (oO) {\n return '';\n }\n}\n\n/**\n * Gets a DOM element by using document.querySelector.\n *\n * This wrapper will first check for the existance of the function before\n * actually calling it so that we don't have to take care of this check,\n * every time we want to access the DOM.\n *\n * Reason: DOM/querySelector is not available in all environments.\n *\n * We have to cast to any because utils can be consumed by a variety of environments,\n * and we don't want to break TS users. If you know what element will be selected by\n * `document.querySelector`, specify it as part of the generic call. For example,\n * `const element = getDomElement('selector');`\n *\n * @param selector the selector string passed on to document.querySelector\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction getDomElement(selector) {\n if (WINDOW.document && WINDOW.document.querySelector) {\n return WINDOW.document.querySelector(selector) ;\n }\n return null;\n}\n\n/**\n * Given a DOM element, traverses up the tree until it finds the first ancestor node\n * that has the `data-sentry-component` attribute. This attribute is added at build-time\n * by projects that have the component name annotation plugin installed.\n *\n * @returns a string representation of the component for the provided DOM element, or `null` if not found\n */\nfunction getComponentName(elem) {\n // @ts-expect-error WINDOW has HTMLElement\n if (!WINDOW.HTMLElement) {\n return null;\n }\n\n let currentElem = elem ;\n const MAX_TRAVERSE_HEIGHT = 5;\n for (let i = 0; i < MAX_TRAVERSE_HEIGHT; i++) {\n if (!currentElem) {\n return null;\n }\n\n if (currentElem instanceof HTMLElement && currentElem.dataset['sentryComponent']) {\n return currentElem.dataset['sentryComponent'];\n }\n\n currentElem = currentElem.parentNode;\n }\n\n return null;\n}\n\nexport { getComponentName, getDomElement, getLocationHref, htmlTreeAsString };\n//# sourceMappingURL=browser.js.map\n","/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nconst DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);\n\nexport { DEBUG_BUILD };\n//# sourceMappingURL=debug-build.js.map\n","import { DEBUG_BUILD } from './debug-build.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\n/** Prefix for logging strings */\nconst PREFIX = 'Sentry Logger ';\n\nconst CONSOLE_LEVELS = [\n 'debug',\n 'info',\n 'warn',\n 'error',\n 'log',\n 'assert',\n 'trace',\n] ;\n\n/** This may be mutated by the console instrumentation. */\nconst originalConsoleMethods\n\n = {};\n\n/** JSDoc */\n\n/**\n * Temporarily disable sentry console instrumentations.\n *\n * @param callback The function to run against the original `console` messages\n * @returns The results of the callback\n */\nfunction consoleSandbox(callback) {\n if (!('console' in GLOBAL_OBJ)) {\n return callback();\n }\n\n const console = GLOBAL_OBJ.console ;\n const wrappedFuncs = {};\n\n const wrappedLevels = Object.keys(originalConsoleMethods) ;\n\n // Restore all wrapped console methods\n wrappedLevels.forEach(level => {\n const originalConsoleMethod = originalConsoleMethods[level] ;\n wrappedFuncs[level] = console[level] ;\n console[level] = originalConsoleMethod;\n });\n\n try {\n return callback();\n } finally {\n // Revert restoration to wrapped state\n wrappedLevels.forEach(level => {\n console[level] = wrappedFuncs[level] ;\n });\n }\n}\n\nfunction makeLogger() {\n let enabled = false;\n const logger = {\n enable: () => {\n enabled = true;\n },\n disable: () => {\n enabled = false;\n },\n isEnabled: () => enabled,\n };\n\n if (DEBUG_BUILD) {\n CONSOLE_LEVELS.forEach(name => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n logger[name] = (...args) => {\n if (enabled) {\n consoleSandbox(() => {\n GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);\n });\n }\n };\n });\n } else {\n CONSOLE_LEVELS.forEach(name => {\n logger[name] = () => undefined;\n });\n }\n\n return logger ;\n}\n\nconst logger = makeLogger();\n\nexport { CONSOLE_LEVELS, consoleSandbox, logger, originalConsoleMethods };\n//# sourceMappingURL=logger.js.map\n","import { DEBUG_BUILD } from './debug-build.js';\nimport { consoleSandbox, logger } from './logger.js';\n\n/** Regular expression used to parse a Dsn. */\nconst DSN_REGEX = /^(?:(\\w+):)\\/\\/(?:(\\w+)(?::(\\w+)?)?@)([\\w.-]+)(?::(\\d+))?\\/(.+)/;\n\nfunction isValidProtocol(protocol) {\n return protocol === 'http' || protocol === 'https';\n}\n\n/**\n * Renders the string representation of this Dsn.\n *\n * By default, this will render the public representation without the password\n * component. To get the deprecated private representation, set `withPassword`\n * to true.\n *\n * @param withPassword When set to true, the password will be included.\n */\nfunction dsnToString(dsn, withPassword = false) {\n const { host, path, pass, port, projectId, protocol, publicKey } = dsn;\n return (\n `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ''}` +\n `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}`\n );\n}\n\n/**\n * Parses a Dsn from a given string.\n *\n * @param str A Dsn as string\n * @returns Dsn as DsnComponents or undefined if @param str is not a valid DSN string\n */\nfunction dsnFromString(str) {\n const match = DSN_REGEX.exec(str);\n\n if (!match) {\n // This should be logged to the console\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.error(`Invalid Sentry Dsn: ${str}`);\n });\n return undefined;\n }\n\n const [protocol, publicKey, pass = '', host, port = '', lastPath] = match.slice(1);\n let path = '';\n let projectId = lastPath;\n\n const split = projectId.split('/');\n if (split.length > 1) {\n path = split.slice(0, -1).join('/');\n projectId = split.pop() ;\n }\n\n if (projectId) {\n const projectMatch = projectId.match(/^\\d+/);\n if (projectMatch) {\n projectId = projectMatch[0];\n }\n }\n\n return dsnFromComponents({ host, pass, path, projectId, port, protocol: protocol , publicKey });\n}\n\nfunction dsnFromComponents(components) {\n return {\n protocol: components.protocol,\n publicKey: components.publicKey || '',\n pass: components.pass || '',\n host: components.host,\n port: components.port || '',\n path: components.path || '',\n projectId: components.projectId,\n };\n}\n\nfunction validateDsn(dsn) {\n if (!DEBUG_BUILD) {\n return true;\n }\n\n const { port, projectId, protocol } = dsn;\n\n const requiredComponents = ['protocol', 'publicKey', 'host', 'projectId'];\n const hasMissingRequiredComponent = requiredComponents.find(component => {\n if (!dsn[component]) {\n logger.error(`Invalid Sentry Dsn: ${component} missing`);\n return true;\n }\n return false;\n });\n\n if (hasMissingRequiredComponent) {\n return false;\n }\n\n if (!projectId.match(/^\\d+$/)) {\n logger.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);\n return false;\n }\n\n if (!isValidProtocol(protocol)) {\n logger.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);\n return false;\n }\n\n if (port && isNaN(parseInt(port, 10))) {\n logger.error(`Invalid Sentry Dsn: Invalid port ${port}`);\n return false;\n }\n\n return true;\n}\n\n/**\n * Creates a valid Sentry Dsn object, identifying a Sentry instance and project.\n * @returns a valid DsnComponents object or `undefined` if @param from is an invalid DSN source\n */\nfunction makeDsn(from) {\n const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from);\n if (!components || !validateDsn(components)) {\n return undefined;\n }\n return components;\n}\n\nexport { dsnFromString, dsnToString, makeDsn };\n//# sourceMappingURL=dsn.js.map\n","/** An error emitted by Sentry SDKs and related utilities. */\nclass SentryError extends Error {\n /** Display name of this error instance. */\n\n constructor( message, logLevel = 'warn') {\n super(message);this.message = message;\n this.name = new.target.prototype.constructor.name;\n // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line\n // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes\n // instances of `SentryError` fail `obj instanceof SentryError` checks.\n Object.setPrototypeOf(this, new.target.prototype);\n this.logLevel = logLevel;\n }\n}\n\nexport { SentryError };\n//# sourceMappingURL=error.js.map\n","import { htmlTreeAsString } from './browser.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { isError, isEvent, isInstanceOf, isElement, isPlainObject, isPrimitive } from './is.js';\nimport { logger } from './logger.js';\nimport { truncate } from './string.js';\n\n/**\n * Replace a method in an object with a wrapped version of itself.\n *\n * @param source An object that contains a method to be wrapped.\n * @param name The name of the method to be wrapped.\n * @param replacementFactory A higher-order function that takes the original version of the given method and returns a\n * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to\n * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, )` or `origMethod.apply(this, [])` (rather than being called directly), again to preserve `this`.\n * @returns void\n */\nfunction fill(source, name, replacementFactory) {\n if (!(name in source)) {\n return;\n }\n\n const original = source[name] ;\n const wrapped = replacementFactory(original) ;\n\n // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n if (typeof wrapped === 'function') {\n markFunctionWrapped(wrapped, original);\n }\n\n source[name] = wrapped;\n}\n\n/**\n * Defines a non-enumerable property on the given object.\n *\n * @param obj The object on which to set the property\n * @param name The name of the property to be set\n * @param value The value to which to set the property\n */\nfunction addNonEnumerableProperty(obj, name, value) {\n try {\n Object.defineProperty(obj, name, {\n // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it\n value: value,\n writable: true,\n configurable: true,\n });\n } catch (o_O) {\n DEBUG_BUILD && logger.log(`Failed to add non-enumerable property \"${name}\" to object`, obj);\n }\n}\n\n/**\n * Remembers the original function on the wrapped function and\n * patches up the prototype.\n *\n * @param wrapped the wrapper function\n * @param original the original function that gets wrapped\n */\nfunction markFunctionWrapped(wrapped, original) {\n try {\n const proto = original.prototype || {};\n wrapped.prototype = original.prototype = proto;\n addNonEnumerableProperty(wrapped, '__sentry_original__', original);\n } catch (o_O) {} // eslint-disable-line no-empty\n}\n\n/**\n * This extracts the original function if available. See\n * `markFunctionWrapped` for more information.\n *\n * @param func the function to unwrap\n * @returns the unwrapped version of the function if available.\n */\nfunction getOriginalFunction(func) {\n return func.__sentry_original__;\n}\n\n/**\n * Encodes given object into url-friendly format\n *\n * @param object An object that contains serializable values\n * @returns string Encoded\n */\nfunction urlEncode(object) {\n return Object.keys(object)\n .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`)\n .join('&');\n}\n\n/**\n * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their\n * non-enumerable properties attached.\n *\n * @param value Initial source that we have to transform in order for it to be usable by the serializer\n * @returns An Event or Error turned into an object - or the value argurment itself, when value is neither an Event nor\n * an Error.\n */\nfunction convertToPlainObject(\n value,\n)\n\n {\n if (isError(value)) {\n return {\n message: value.message,\n name: value.name,\n stack: value.stack,\n ...getOwnProperties(value),\n };\n } else if (isEvent(value)) {\n const newObj\n\n = {\n type: value.type,\n target: serializeEventTarget(value.target),\n currentTarget: serializeEventTarget(value.currentTarget),\n ...getOwnProperties(value),\n };\n\n if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) {\n newObj.detail = value.detail;\n }\n\n return newObj;\n } else {\n return value;\n }\n}\n\n/** Creates a string representation of the target of an `Event` object */\nfunction serializeEventTarget(target) {\n try {\n return isElement(target) ? htmlTreeAsString(target) : Object.prototype.toString.call(target);\n } catch (_oO) {\n return '';\n }\n}\n\n/** Filters out all but an object's own properties */\nfunction getOwnProperties(obj) {\n if (typeof obj === 'object' && obj !== null) {\n const extractedProps = {};\n for (const property in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, property)) {\n extractedProps[property] = (obj )[property];\n }\n }\n return extractedProps;\n } else {\n return {};\n }\n}\n\n/**\n * Given any captured exception, extract its keys and create a sorted\n * and truncated list that will be used inside the event message.\n * eg. `Non-error exception captured with keys: foo, bar, baz`\n */\nfunction extractExceptionKeysForMessage(exception, maxLength = 40) {\n const keys = Object.keys(convertToPlainObject(exception));\n keys.sort();\n\n if (!keys.length) {\n return '[object has no keys]';\n }\n\n if (keys[0].length >= maxLength) {\n return truncate(keys[0], maxLength);\n }\n\n for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) {\n const serialized = keys.slice(0, includedKeys).join(', ');\n if (serialized.length > maxLength) {\n continue;\n }\n if (includedKeys === keys.length) {\n return serialized;\n }\n return truncate(serialized, maxLength);\n }\n\n return '';\n}\n\n/**\n * Given any object, return a new object having removed all fields whose value was `undefined`.\n * Works recursively on objects and arrays.\n *\n * Attention: This function keeps circular references in the returned object.\n */\nfunction dropUndefinedKeys(inputValue) {\n // This map keeps track of what already visited nodes map to.\n // Our Set - based memoBuilder doesn't work here because we want to the output object to have the same circular\n // references as the input object.\n const memoizationMap = new Map();\n\n // This function just proxies `_dropUndefinedKeys` to keep the `memoBuilder` out of this function's API\n return _dropUndefinedKeys(inputValue, memoizationMap);\n}\n\nfunction _dropUndefinedKeys(inputValue, memoizationMap) {\n if (isPojo(inputValue)) {\n // If this node has already been visited due to a circular reference, return the object it was mapped to in the new object\n const memoVal = memoizationMap.get(inputValue);\n if (memoVal !== undefined) {\n return memoVal ;\n }\n\n const returnValue = {};\n // Store the mapping of this value in case we visit it again, in case of circular data\n memoizationMap.set(inputValue, returnValue);\n\n for (const key of Object.keys(inputValue)) {\n if (typeof inputValue[key] !== 'undefined') {\n returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap);\n }\n }\n\n return returnValue ;\n }\n\n if (Array.isArray(inputValue)) {\n // If this node has already been visited due to a circular reference, return the array it was mapped to in the new object\n const memoVal = memoizationMap.get(inputValue);\n if (memoVal !== undefined) {\n return memoVal ;\n }\n\n const returnValue = [];\n // Store the mapping of this value in case we visit it again, in case of circular data\n memoizationMap.set(inputValue, returnValue);\n\n inputValue.forEach((item) => {\n returnValue.push(_dropUndefinedKeys(item, memoizationMap));\n });\n\n return returnValue ;\n }\n\n return inputValue;\n}\n\nfunction isPojo(input) {\n if (!isPlainObject(input)) {\n return false;\n }\n\n try {\n const name = (Object.getPrototypeOf(input) ).constructor.name;\n return !name || name === 'Object';\n } catch (e) {\n return true;\n }\n}\n\n/**\n * Ensure that something is an object.\n *\n * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper\n * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives.\n *\n * @param wat The subject of the objectification\n * @returns A version of `wat` which can safely be used with `Object` class methods\n */\nfunction objectify(wat) {\n let objectified;\n switch (true) {\n case wat === undefined || wat === null:\n objectified = new String(wat);\n break;\n\n // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason\n // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as\n // an object in order to wrap it.\n case typeof wat === 'symbol' || typeof wat === 'bigint':\n objectified = Object(wat);\n break;\n\n // this will catch the remaining primitives: `String`, `Number`, and `Boolean`\n case isPrimitive(wat):\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n objectified = new (wat ).constructor(wat);\n break;\n\n // by process of elimination, at this point we know that `wat` must already be an object\n default:\n objectified = wat;\n break;\n }\n return objectified;\n}\n\nexport { addNonEnumerableProperty, convertToPlainObject, dropUndefinedKeys, extractExceptionKeysForMessage, fill, getOriginalFunction, markFunctionWrapped, objectify, urlEncode };\n//# sourceMappingURL=object.js.map\n","import { node } from './node-stack-trace.js';\nexport { filenameIsInApp } from './node-stack-trace.js';\n\nconst STACKTRACE_FRAME_LIMIT = 50;\n// Used to sanitize webpack (error: *) wrapped stack errors\nconst WEBPACK_ERROR_REGEXP = /\\(error: (.*)\\)/;\nconst STRIP_FRAME_REGEXP = /captureMessage|captureException/;\n\n/**\n * Creates a stack parser with the supplied line parsers\n *\n * StackFrames are returned in the correct order for Sentry Exception\n * frames and with Sentry SDK internal frames removed from the top and bottom\n *\n */\nfunction createStackParser(...parsers) {\n const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map(p => p[1]);\n\n return (stack, skipFirst = 0) => {\n const frames = [];\n const lines = stack.split('\\n');\n\n for (let i = skipFirst; i < lines.length; i++) {\n const line = lines[i];\n // Ignore lines over 1kb as they are unlikely to be stack frames.\n // Many of the regular expressions use backtracking which results in run time that increases exponentially with\n // input size. Huge strings can result in hangs/Denial of Service:\n // https://github.com/getsentry/sentry-javascript/issues/2286\n if (line.length > 1024) {\n continue;\n }\n\n // https://github.com/getsentry/sentry-javascript/issues/5459\n // Remove webpack (error: *) wrappers\n const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, '$1') : line;\n\n // https://github.com/getsentry/sentry-javascript/issues/7813\n // Skip Error: lines\n if (cleanedLine.match(/\\S*Error: /)) {\n continue;\n }\n\n for (const parser of sortedParsers) {\n const frame = parser(cleanedLine);\n\n if (frame) {\n frames.push(frame);\n break;\n }\n }\n\n if (frames.length >= STACKTRACE_FRAME_LIMIT) {\n break;\n }\n }\n\n return stripSentryFramesAndReverse(frames);\n };\n}\n\n/**\n * Gets a stack parser implementation from Options.stackParser\n * @see Options\n *\n * If options contains an array of line parsers, it is converted into a parser\n */\nfunction stackParserFromStackParserOptions(stackParser) {\n if (Array.isArray(stackParser)) {\n return createStackParser(...stackParser);\n }\n return stackParser;\n}\n\n/**\n * Removes Sentry frames from the top and bottom of the stack if present and enforces a limit of max number of frames.\n * Assumes stack input is ordered from top to bottom and returns the reverse representation so call site of the\n * function that caused the crash is the last frame in the array.\n * @hidden\n */\nfunction stripSentryFramesAndReverse(stack) {\n if (!stack.length) {\n return [];\n }\n\n const localStack = Array.from(stack);\n\n // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)\n if (/sentryWrapped/.test(localStack[localStack.length - 1].function || '')) {\n localStack.pop();\n }\n\n // Reversing in the middle of the procedure allows us to just pop the values off the stack\n localStack.reverse();\n\n // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call)\n if (STRIP_FRAME_REGEXP.test(localStack[localStack.length - 1].function || '')) {\n localStack.pop();\n\n // When using synthetic events, we will have a 2 levels deep stack, as `new Error('Sentry syntheticException')`\n // is produced within the hub itself, making it:\n //\n // Sentry.captureException()\n // getCurrentHub().captureException()\n //\n // instead of just the top `Sentry` call itself.\n // This forces us to possibly strip an additional frame in the exact same was as above.\n if (STRIP_FRAME_REGEXP.test(localStack[localStack.length - 1].function || '')) {\n localStack.pop();\n }\n }\n\n return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map(frame => ({\n ...frame,\n filename: frame.filename || localStack[localStack.length - 1].filename,\n function: frame.function || '?',\n }));\n}\n\nconst defaultFunctionName = '';\n\n/**\n * Safely extract function name from itself\n */\nfunction getFunctionName(fn) {\n try {\n if (!fn || typeof fn !== 'function') {\n return defaultFunctionName;\n }\n return fn.name || defaultFunctionName;\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n return defaultFunctionName;\n }\n}\n\n/**\n * Node.js stack line parser\n *\n * This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`.\n * This allows it to be used without referencing or importing any node specific code which causes bundlers to complain\n */\nfunction nodeStackLineParser(getModule) {\n return [90, node(getModule)];\n}\n\nexport { createStackParser, getFunctionName, nodeStackLineParser, stackParserFromStackParserOptions, stripSentryFramesAndReverse };\n//# sourceMappingURL=stacktrace.js.map\n","import { DEBUG_BUILD } from '../debug-build.js';\nimport { logger } from '../logger.js';\nimport { getFunctionName } from '../stacktrace.js';\n\n// We keep the handlers globally\nconst handlers = {};\nconst instrumented = {};\n\n/** Add a handler function. */\nfunction addHandler(type, handler) {\n handlers[type] = handlers[type] || [];\n (handlers[type] ).push(handler);\n}\n\n/**\n * Reset all instrumentation handlers.\n * This can be used by tests to ensure we have a clean slate of instrumentation handlers.\n */\nfunction resetInstrumentationHandlers() {\n Object.keys(handlers).forEach(key => {\n handlers[key ] = undefined;\n });\n}\n\n/** Maybe run an instrumentation function, unless it was already called. */\nfunction maybeInstrument(type, instrumentFn) {\n if (!instrumented[type]) {\n instrumentFn();\n instrumented[type] = true;\n }\n}\n\n/** Trigger handlers for a given instrumentation type. */\nfunction triggerHandlers(type, data) {\n const typeHandlers = type && handlers[type];\n if (!typeHandlers) {\n return;\n }\n\n for (const handler of typeHandlers) {\n try {\n handler(data);\n } catch (e) {\n DEBUG_BUILD &&\n logger.error(\n `Error while triggering instrumentation handler.\\nType: ${type}\\nName: ${getFunctionName(handler)}\\nError:`,\n e,\n );\n }\n }\n}\n\nexport { addHandler, maybeInstrument, resetInstrumentationHandlers, triggerHandlers };\n//# sourceMappingURL=_handlers.js.map\n","import { CONSOLE_LEVELS, originalConsoleMethods } from '../logger.js';\nimport { fill } from '../object.js';\nimport { GLOBAL_OBJ } from '../worldwide.js';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers.js';\n\n/**\n * Add an instrumentation handler for when a console.xxx method is called.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addConsoleInstrumentationHandler(handler) {\n const type = 'console';\n addHandler(type, handler);\n maybeInstrument(type, instrumentConsole);\n}\n\nfunction instrumentConsole() {\n if (!('console' in GLOBAL_OBJ)) {\n return;\n }\n\n CONSOLE_LEVELS.forEach(function (level) {\n if (!(level in GLOBAL_OBJ.console)) {\n return;\n }\n\n fill(GLOBAL_OBJ.console, level, function (originalConsoleMethod) {\n originalConsoleMethods[level] = originalConsoleMethod;\n\n return function (...args) {\n const handlerData = { args, level };\n triggerHandlers('console', handlerData);\n\n const log = originalConsoleMethods[level];\n log && log.apply(GLOBAL_OBJ.console, args);\n };\n });\n });\n}\n\nexport { addConsoleInstrumentationHandler };\n//# sourceMappingURL=console.js.map\n","import { addNonEnumerableProperty } from './object.js';\nimport { snipLine } from './string.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\n/**\n * UUID4 generator\n *\n * @returns string Generated UUID4.\n */\nfunction uuid4() {\n const gbl = GLOBAL_OBJ ;\n const crypto = gbl.crypto || gbl.msCrypto;\n\n let getRandomByte = () => Math.random() * 16;\n try {\n if (crypto && crypto.randomUUID) {\n return crypto.randomUUID().replace(/-/g, '');\n }\n if (crypto && crypto.getRandomValues) {\n getRandomByte = () => {\n // crypto.getRandomValues might return undefined instead of the typed array\n // in old Chromium versions (e.g. 23.0.1235.0 (151422))\n // However, `typedArray` is still filled in-place.\n // @see https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues#typedarray\n const typedArray = new Uint8Array(1);\n crypto.getRandomValues(typedArray);\n return typedArray[0];\n };\n }\n } catch (_) {\n // some runtimes can crash invoking crypto\n // https://github.com/getsentry/sentry-javascript/issues/8935\n }\n\n // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523\n // Concatenating the following numbers as strings results in '10000000100040008000100000000000'\n return (([1e7] ) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, c =>\n // eslint-disable-next-line no-bitwise\n ((c ) ^ ((getRandomByte() & 15) >> ((c ) / 4))).toString(16),\n );\n}\n\nfunction getFirstException(event) {\n return event.exception && event.exception.values ? event.exception.values[0] : undefined;\n}\n\n/**\n * Extracts either message or type+value from an event that can be used for user-facing logs\n * @returns event's description\n */\nfunction getEventDescription(event) {\n const { message, event_id: eventId } = event;\n if (message) {\n return message;\n }\n\n const firstException = getFirstException(event);\n if (firstException) {\n if (firstException.type && firstException.value) {\n return `${firstException.type}: ${firstException.value}`;\n }\n return firstException.type || firstException.value || eventId || '';\n }\n return eventId || '';\n}\n\n/**\n * Adds exception values, type and value to an synthetic Exception.\n * @param event The event to modify.\n * @param value Value of the exception.\n * @param type Type of the exception.\n * @hidden\n */\nfunction addExceptionTypeValue(event, value, type) {\n const exception = (event.exception = event.exception || {});\n const values = (exception.values = exception.values || []);\n const firstException = (values[0] = values[0] || {});\n if (!firstException.value) {\n firstException.value = value || '';\n }\n if (!firstException.type) {\n firstException.type = type || 'Error';\n }\n}\n\n/**\n * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed.\n *\n * @param event The event to modify.\n * @param newMechanism Mechanism data to add to the event.\n * @hidden\n */\nfunction addExceptionMechanism(event, newMechanism) {\n const firstException = getFirstException(event);\n if (!firstException) {\n return;\n }\n\n const defaultMechanism = { type: 'generic', handled: true };\n const currentMechanism = firstException.mechanism;\n firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism };\n\n if (newMechanism && 'data' in newMechanism) {\n const mergedData = { ...(currentMechanism && currentMechanism.data), ...newMechanism.data };\n firstException.mechanism.data = mergedData;\n }\n}\n\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nconst SEMVER_REGEXP =\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n\n/**\n * Represents Semantic Versioning object\n */\n\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\nfunction parseSemver(input) {\n const match = input.match(SEMVER_REGEXP) || [];\n const major = parseInt(match[1], 10);\n const minor = parseInt(match[2], 10);\n const patch = parseInt(match[3], 10);\n return {\n buildmetadata: match[5],\n major: isNaN(major) ? undefined : major,\n minor: isNaN(minor) ? undefined : minor,\n patch: isNaN(patch) ? undefined : patch,\n prerelease: match[4],\n };\n}\n\n/**\n * This function adds context (pre/post/line) lines to the provided frame\n *\n * @param lines string[] containing all lines\n * @param frame StackFrame that will be mutated\n * @param linesOfContext number of context lines we want to add pre/post\n */\nfunction addContextToFrame(lines, frame, linesOfContext = 5) {\n // When there is no line number in the frame, attaching context is nonsensical and will even break grouping\n if (frame.lineno === undefined) {\n return;\n }\n\n const maxLines = lines.length;\n const sourceLine = Math.max(Math.min(maxLines - 1, frame.lineno - 1), 0);\n\n frame.pre_context = lines\n .slice(Math.max(0, sourceLine - linesOfContext), sourceLine)\n .map((line) => snipLine(line, 0));\n\n frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);\n\n frame.post_context = lines\n .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)\n .map((line) => snipLine(line, 0));\n}\n\n/**\n * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object\n * in question), and marks it captured if not.\n *\n * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and\n * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so\n * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because\n * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not\n * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This\n * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we\n * see it.\n *\n * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on\n * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent\n * object wrapper forms so that this check will always work. However, because we need to flag the exact object which\n * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification\n * must be done before the exception captured.\n *\n * @param A thrown exception to check or flag as having been seen\n * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen)\n */\nfunction checkOrSetAlreadyCaught(exception) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (exception && (exception ).__sentry_captured__) {\n return true;\n }\n\n try {\n // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the\n // `ExtraErrorData` integration\n addNonEnumerableProperty(exception , '__sentry_captured__', true);\n } catch (err) {\n // `exception` is a primitive, so we can't mark it seen\n }\n\n return false;\n}\n\n/**\n * Checks whether the given input is already an array, and if it isn't, wraps it in one.\n *\n * @param maybeArray Input to turn into an array, if necessary\n * @returns The input, if already an array, or an array with the input as the only element, if not\n */\nfunction arrayify(maybeArray) {\n return Array.isArray(maybeArray) ? maybeArray : [maybeArray];\n}\n\nexport { addContextToFrame, addExceptionMechanism, addExceptionTypeValue, arrayify, checkOrSetAlreadyCaught, getEventDescription, parseSemver, uuid4 };\n//# sourceMappingURL=misc.js.map\n","import { uuid4 } from '../misc.js';\nimport { fill, addNonEnumerableProperty } from '../object.js';\nimport { GLOBAL_OBJ } from '../worldwide.js';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers.js';\n\nconst WINDOW = GLOBAL_OBJ ;\nconst DEBOUNCE_DURATION = 1000;\n\nlet debounceTimerID;\nlet lastCapturedEventType;\nlet lastCapturedEventTargetId;\n\n/**\n * Add an instrumentation handler for when a click or a keypress happens.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addClickKeypressInstrumentationHandler(handler) {\n const type = 'dom';\n addHandler(type, handler);\n maybeInstrument(type, instrumentDOM);\n}\n\n/** Exported for tests only. */\nfunction instrumentDOM() {\n if (!WINDOW.document) {\n return;\n }\n\n // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom\n // handlers. (Normally we have only one, which captures a breadcrumb for each click or keypress.) Do this before\n // we instrument `addEventListener` so that we don't end up attaching this handler twice.\n const triggerDOMHandler = triggerHandlers.bind(null, 'dom');\n const globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true);\n WINDOW.document.addEventListener('click', globalDOMEventHandler, false);\n WINDOW.document.addEventListener('keypress', globalDOMEventHandler, false);\n\n // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled\n // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That\n // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler\n // could potentially prevent the event from bubbling up to our global listeners. This way, our handler are still\n // guaranteed to fire at least once.)\n ['EventTarget', 'Node'].forEach((target) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const proto = (WINDOW )[target] && (WINDOW )[target].prototype;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function (originalAddEventListener) {\n return function (\n\n type,\n listener,\n options,\n ) {\n if (type === 'click' || type == 'keypress') {\n try {\n const el = this ;\n const handlers = (el.__sentry_instrumentation_handlers__ = el.__sentry_instrumentation_handlers__ || {});\n const handlerForType = (handlers[type] = handlers[type] || { refCount: 0 });\n\n if (!handlerForType.handler) {\n const handler = makeDOMEventHandler(triggerDOMHandler);\n handlerForType.handler = handler;\n originalAddEventListener.call(this, type, handler, options);\n }\n\n handlerForType.refCount++;\n } catch (e) {\n // Accessing dom properties is always fragile.\n // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n }\n }\n\n return originalAddEventListener.call(this, type, listener, options);\n };\n });\n\n fill(\n proto,\n 'removeEventListener',\n function (originalRemoveEventListener) {\n return function (\n\n type,\n listener,\n options,\n ) {\n if (type === 'click' || type == 'keypress') {\n try {\n const el = this ;\n const handlers = el.__sentry_instrumentation_handlers__ || {};\n const handlerForType = handlers[type];\n\n if (handlerForType) {\n handlerForType.refCount--;\n // If there are no longer any custom handlers of the current type on this element, we can remove ours, too.\n if (handlerForType.refCount <= 0) {\n originalRemoveEventListener.call(this, type, handlerForType.handler, options);\n handlerForType.handler = undefined;\n delete handlers[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete\n }\n\n // If there are no longer any custom handlers of any type on this element, cleanup everything.\n if (Object.keys(handlers).length === 0) {\n delete el.__sentry_instrumentation_handlers__;\n }\n }\n } catch (e) {\n // Accessing dom properties is always fragile.\n // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n }\n }\n\n return originalRemoveEventListener.call(this, type, listener, options);\n };\n },\n );\n });\n}\n\n/**\n * Check whether the event is similar to the last captured one. For example, two click events on the same button.\n */\nfunction isSimilarToLastCapturedEvent(event) {\n // If both events have different type, then user definitely performed two separate actions. e.g. click + keypress.\n if (event.type !== lastCapturedEventType) {\n return false;\n }\n\n try {\n // If both events have the same type, it's still possible that actions were performed on different targets.\n // e.g. 2 clicks on different buttons.\n if (!event.target || (event.target )._sentryId !== lastCapturedEventTargetId) {\n return false;\n }\n } catch (e) {\n // just accessing `target` property can throw an exception in some rare circumstances\n // see: https://github.com/getsentry/sentry-javascript/issues/838\n }\n\n // If both events have the same type _and_ same `target` (an element which triggered an event, _not necessarily_\n // to which an event listener was attached), we treat them as the same action, as we want to capture\n // only one breadcrumb. e.g. multiple clicks on the same button, or typing inside a user input box.\n return true;\n}\n\n/**\n * Decide whether an event should be captured.\n * @param event event to be captured\n */\nfunction shouldSkipDOMEvent(eventType, target) {\n // We are only interested in filtering `keypress` events for now.\n if (eventType !== 'keypress') {\n return false;\n }\n\n if (!target || !target.tagName) {\n return true;\n }\n\n // Only consider keypress events on actual input elements. This will disregard keypresses targeting body\n // e.g.tabbing through elements, hotkeys, etc.\n if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Wraps addEventListener to capture UI breadcrumbs\n */\nfunction makeDOMEventHandler(\n handler,\n globalListener = false,\n) {\n return (event) => {\n // It's possible this handler might trigger multiple times for the same\n // event (e.g. event propagation through node ancestors).\n // Ignore if we've already captured that event.\n if (!event || event['_sentryCaptured']) {\n return;\n }\n\n const target = getEventTarget(event);\n\n // We always want to skip _some_ events.\n if (shouldSkipDOMEvent(event.type, target)) {\n return;\n }\n\n // Mark event as \"seen\"\n addNonEnumerableProperty(event, '_sentryCaptured', true);\n\n if (target && !target._sentryId) {\n // Add UUID to event target so we can identify if\n addNonEnumerableProperty(target, '_sentryId', uuid4());\n }\n\n const name = event.type === 'keypress' ? 'input' : event.type;\n\n // If there is no last captured event, it means that we can safely capture the new event and store it for future comparisons.\n // If there is a last captured event, see if the new event is different enough to treat it as a unique one.\n // If that's the case, emit the previous event and store locally the newly-captured DOM event.\n if (!isSimilarToLastCapturedEvent(event)) {\n const handlerData = { event, name, global: globalListener };\n handler(handlerData);\n lastCapturedEventType = event.type;\n lastCapturedEventTargetId = target ? target._sentryId : undefined;\n }\n\n // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together.\n clearTimeout(debounceTimerID);\n debounceTimerID = WINDOW.setTimeout(() => {\n lastCapturedEventTargetId = undefined;\n lastCapturedEventType = undefined;\n }, DEBOUNCE_DURATION);\n };\n}\n\nfunction getEventTarget(event) {\n try {\n return event.target ;\n } catch (e) {\n // just accessing `target` property can throw an exception in some rare circumstances\n // see: https://github.com/getsentry/sentry-javascript/issues/838\n return null;\n }\n}\n\nexport { addClickKeypressInstrumentationHandler, instrumentDOM };\n//# sourceMappingURL=dom.js.map\n","import { DEBUG_BUILD } from './debug-build.js';\nimport { logger } from './logger.js';\nimport { getGlobalObject } from './worldwide.js';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject();\n\n/**\n * Tells whether current environment supports ErrorEvent objects\n * {@link supportsErrorEvent}.\n *\n * @returns Answer to the given question.\n */\nfunction supportsErrorEvent() {\n try {\n new ErrorEvent('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports DOMError objects\n * {@link supportsDOMError}.\n *\n * @returns Answer to the given question.\n */\nfunction supportsDOMError() {\n try {\n // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError':\n // 1 argument required, but only 0 present.\n // @ts-expect-error It really needs 1 argument, not 0.\n new DOMError('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports DOMException objects\n * {@link supportsDOMException}.\n *\n * @returns Answer to the given question.\n */\nfunction supportsDOMException() {\n try {\n new DOMException('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports Fetch API\n * {@link supportsFetch}.\n *\n * @returns Answer to the given question.\n */\nfunction supportsFetch() {\n if (!('fetch' in WINDOW)) {\n return false;\n }\n\n try {\n new Headers();\n new Request('http://www.example.com');\n new Response();\n return true;\n } catch (e) {\n return false;\n }\n}\n/**\n * isNativeFetch checks if the given function is a native implementation of fetch()\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isNativeFetch(func) {\n return func && /^function fetch\\(\\)\\s+\\{\\s+\\[native code\\]\\s+\\}$/.test(func.toString());\n}\n\n/**\n * Tells whether current environment supports Fetch API natively\n * {@link supportsNativeFetch}.\n *\n * @returns true if `window.fetch` is natively implemented, false otherwise\n */\nfunction supportsNativeFetch() {\n if (typeof EdgeRuntime === 'string') {\n return true;\n }\n\n if (!supportsFetch()) {\n return false;\n }\n\n // Fast path to avoid DOM I/O\n // eslint-disable-next-line @typescript-eslint/unbound-method\n if (isNativeFetch(WINDOW.fetch)) {\n return true;\n }\n\n // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension)\n // so create a \"pure\" iframe to see if that has native fetch\n let result = false;\n const doc = WINDOW.document;\n // eslint-disable-next-line deprecation/deprecation\n if (doc && typeof (doc.createElement ) === 'function') {\n try {\n const sandbox = doc.createElement('iframe');\n sandbox.hidden = true;\n doc.head.appendChild(sandbox);\n if (sandbox.contentWindow && sandbox.contentWindow.fetch) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n result = isNativeFetch(sandbox.contentWindow.fetch);\n }\n doc.head.removeChild(sandbox);\n } catch (err) {\n DEBUG_BUILD &&\n logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err);\n }\n }\n\n return result;\n}\n\n/**\n * Tells whether current environment supports ReportingObserver API\n * {@link supportsReportingObserver}.\n *\n * @returns Answer to the given question.\n */\nfunction supportsReportingObserver() {\n return 'ReportingObserver' in WINDOW;\n}\n\n/**\n * Tells whether current environment supports Referrer Policy API\n * {@link supportsReferrerPolicy}.\n *\n * @returns Answer to the given question.\n */\nfunction supportsReferrerPolicy() {\n // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'\n // (see https://caniuse.com/#feat=referrer-policy),\n // it doesn't. And it throws an exception instead of ignoring this parameter...\n // REF: https://github.com/getsentry/raven-js/issues/1233\n\n if (!supportsFetch()) {\n return false;\n }\n\n try {\n new Request('_', {\n referrerPolicy: 'origin' ,\n });\n return true;\n } catch (e) {\n return false;\n }\n}\n\nexport { isNativeFetch, supportsDOMError, supportsDOMException, supportsErrorEvent, supportsFetch, supportsNativeFetch, supportsReferrerPolicy, supportsReportingObserver };\n//# sourceMappingURL=supports.js.map\n","import { fill } from '../object.js';\nimport { supportsNativeFetch } from '../supports.js';\nimport { GLOBAL_OBJ } from '../worldwide.js';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers.js';\n\n/**\n * Add an instrumentation handler for when a fetch request happens.\n * The handler function is called once when the request starts and once when it ends,\n * which can be identified by checking if it has an `endTimestamp`.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addFetchInstrumentationHandler(handler) {\n const type = 'fetch';\n addHandler(type, handler);\n maybeInstrument(type, instrumentFetch);\n}\n\nfunction instrumentFetch() {\n if (!supportsNativeFetch()) {\n return;\n }\n\n fill(GLOBAL_OBJ, 'fetch', function (originalFetch) {\n return function (...args) {\n const { method, url } = parseFetchArgs(args);\n\n const handlerData = {\n args,\n fetchData: {\n method,\n url,\n },\n startTimestamp: Date.now(),\n };\n\n triggerHandlers('fetch', {\n ...handlerData,\n });\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return originalFetch.apply(GLOBAL_OBJ, args).then(\n (response) => {\n const finishedHandlerData = {\n ...handlerData,\n endTimestamp: Date.now(),\n response,\n };\n\n triggerHandlers('fetch', finishedHandlerData);\n return response;\n },\n (error) => {\n const erroredHandlerData = {\n ...handlerData,\n endTimestamp: Date.now(),\n error,\n };\n\n triggerHandlers('fetch', erroredHandlerData);\n // NOTE: If you are a Sentry user, and you are seeing this stack frame,\n // it means the sentry.javascript SDK caught an error invoking your application code.\n // This is expected behavior and NOT indicative of a bug with sentry.javascript.\n throw error;\n },\n );\n };\n });\n}\n\nfunction hasProp(obj, prop) {\n return !!obj && typeof obj === 'object' && !!(obj )[prop];\n}\n\nfunction getUrlFromResource(resource) {\n if (typeof resource === 'string') {\n return resource;\n }\n\n if (!resource) {\n return '';\n }\n\n if (hasProp(resource, 'url')) {\n return resource.url;\n }\n\n if (resource.toString) {\n return resource.toString();\n }\n\n return '';\n}\n\n/**\n * Parses the fetch arguments to find the used Http method and the url of the request.\n * Exported for tests only.\n */\nfunction parseFetchArgs(fetchArgs) {\n if (fetchArgs.length === 0) {\n return { method: 'GET', url: '' };\n }\n\n if (fetchArgs.length === 2) {\n const [url, options] = fetchArgs ;\n\n return {\n url: getUrlFromResource(url),\n method: hasProp(options, 'method') ? String(options.method).toUpperCase() : 'GET',\n };\n }\n\n const arg = fetchArgs[0];\n return {\n url: getUrlFromResource(arg ),\n method: hasProp(arg, 'method') ? String(arg.method).toUpperCase() : 'GET',\n };\n}\n\nexport { addFetchInstrumentationHandler, parseFetchArgs };\n//# sourceMappingURL=fetch.js.map\n","import { GLOBAL_OBJ } from '../worldwide.js';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers.js';\n\nlet _oldOnErrorHandler = null;\n\n/**\n * Add an instrumentation handler for when an error is captured by the global error handler.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addGlobalErrorInstrumentationHandler(handler) {\n const type = 'error';\n addHandler(type, handler);\n maybeInstrument(type, instrumentError);\n}\n\nfunction instrumentError() {\n _oldOnErrorHandler = GLOBAL_OBJ.onerror;\n\n GLOBAL_OBJ.onerror = function (\n msg,\n url,\n line,\n column,\n error,\n ) {\n const handlerData = {\n column,\n error,\n line,\n msg,\n url,\n };\n triggerHandlers('error', handlerData);\n\n if (_oldOnErrorHandler && !_oldOnErrorHandler.__SENTRY_LOADER__) {\n // eslint-disable-next-line prefer-rest-params\n return _oldOnErrorHandler.apply(this, arguments);\n }\n\n return false;\n };\n\n GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__ = true;\n}\n\nexport { addGlobalErrorInstrumentationHandler };\n//# sourceMappingURL=globalError.js.map\n","import { GLOBAL_OBJ } from '../worldwide.js';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers.js';\n\nlet _oldOnUnhandledRejectionHandler = null;\n\n/**\n * Add an instrumentation handler for when an unhandled promise rejection is captured.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addGlobalUnhandledRejectionInstrumentationHandler(\n handler,\n) {\n const type = 'unhandledrejection';\n addHandler(type, handler);\n maybeInstrument(type, instrumentUnhandledRejection);\n}\n\nfunction instrumentUnhandledRejection() {\n _oldOnUnhandledRejectionHandler = GLOBAL_OBJ.onunhandledrejection;\n\n GLOBAL_OBJ.onunhandledrejection = function (e) {\n const handlerData = e;\n triggerHandlers('unhandledrejection', handlerData);\n\n if (_oldOnUnhandledRejectionHandler && !_oldOnUnhandledRejectionHandler.__SENTRY_LOADER__) {\n // eslint-disable-next-line prefer-rest-params\n return _oldOnUnhandledRejectionHandler.apply(this, arguments);\n }\n\n return true;\n };\n\n GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;\n}\n\nexport { addGlobalUnhandledRejectionInstrumentationHandler };\n//# sourceMappingURL=globalUnhandledRejection.js.map\n","import { getGlobalObject } from '../worldwide.js';\n\n// Based on https://github.com/angular/angular.js/pull/13945/files\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject();\n\n/**\n * Tells whether current environment supports History API\n * {@link supportsHistory}.\n *\n * @returns Answer to the given question.\n */\nfunction supportsHistory() {\n // NOTE: in Chrome App environment, touching history.pushState, *even inside\n // a try/catch block*, will cause Chrome to output an error to console.error\n // borrowed from: https://github.com/angular/angular.js/pull/13945/files\n /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const chromeVar = (WINDOW ).chrome;\n const isChromePackagedApp = chromeVar && chromeVar.app && chromeVar.app.runtime;\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n const hasHistoryApi = 'history' in WINDOW && !!WINDOW.history.pushState && !!WINDOW.history.replaceState;\n\n return !isChromePackagedApp && hasHistoryApi;\n}\n\nexport { supportsHistory };\n//# sourceMappingURL=supportsHistory.js.map\n","import { fill } from '../object.js';\nimport '../debug-build.js';\nimport '../logger.js';\nimport { GLOBAL_OBJ } from '../worldwide.js';\nimport { supportsHistory } from '../vendor/supportsHistory.js';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers.js';\n\nconst WINDOW = GLOBAL_OBJ ;\n\nlet lastHref;\n\n/**\n * Add an instrumentation handler for when a fetch request happens.\n * The handler function is called once when the request starts and once when it ends,\n * which can be identified by checking if it has an `endTimestamp`.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addHistoryInstrumentationHandler(handler) {\n const type = 'history';\n addHandler(type, handler);\n maybeInstrument(type, instrumentHistory);\n}\n\nfunction instrumentHistory() {\n if (!supportsHistory()) {\n return;\n }\n\n const oldOnPopState = WINDOW.onpopstate;\n WINDOW.onpopstate = function ( ...args) {\n const to = WINDOW.location.href;\n // keep track of the current URL state, as we always receive only the updated state\n const from = lastHref;\n lastHref = to;\n const handlerData = { from, to };\n triggerHandlers('history', handlerData);\n if (oldOnPopState) {\n // Apparently this can throw in Firefox when incorrectly implemented plugin is installed.\n // https://github.com/getsentry/sentry-javascript/issues/3344\n // https://github.com/bugsnag/bugsnag-js/issues/469\n try {\n return oldOnPopState.apply(this, args);\n } catch (_oO) {\n // no-empty\n }\n }\n };\n\n function historyReplacementFunction(originalHistoryFunction) {\n return function ( ...args) {\n const url = args.length > 2 ? args[2] : undefined;\n if (url) {\n // coerce to string (this is what pushState does)\n const from = lastHref;\n const to = String(url);\n // keep track of the current URL state, as we always receive only the updated state\n lastHref = to;\n const handlerData = { from, to };\n triggerHandlers('history', handlerData);\n }\n return originalHistoryFunction.apply(this, args);\n };\n }\n\n fill(WINDOW.history, 'pushState', historyReplacementFunction);\n fill(WINDOW.history, 'replaceState', historyReplacementFunction);\n}\n\nexport { addHistoryInstrumentationHandler };\n//# sourceMappingURL=history.js.map\n","import { isString } from '../is.js';\nimport { fill } from '../object.js';\nimport { GLOBAL_OBJ } from '../worldwide.js';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers.js';\n\nconst WINDOW = GLOBAL_OBJ ;\n\nconst SENTRY_XHR_DATA_KEY = '__sentry_xhr_v3__';\n\n/**\n * Add an instrumentation handler for when an XHR request happens.\n * The handler function is called once when the request starts and once when it ends,\n * which can be identified by checking if it has an `endTimestamp`.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addXhrInstrumentationHandler(handler) {\n const type = 'xhr';\n addHandler(type, handler);\n maybeInstrument(type, instrumentXHR);\n}\n\n/** Exported only for tests. */\nfunction instrumentXHR() {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (!(WINDOW ).XMLHttpRequest) {\n return;\n }\n\n const xhrproto = XMLHttpRequest.prototype;\n\n fill(xhrproto, 'open', function (originalOpen) {\n return function ( ...args) {\n const startTimestamp = Date.now();\n\n // open() should always be called with two or more arguments\n // But to be on the safe side, we actually validate this and bail out if we don't have a method & url\n const method = isString(args[0]) ? args[0].toUpperCase() : undefined;\n const url = parseUrl(args[1]);\n\n if (!method || !url) {\n return originalOpen.apply(this, args);\n }\n\n this[SENTRY_XHR_DATA_KEY] = {\n method,\n url,\n request_headers: {},\n };\n\n // if Sentry key appears in URL, don't capture it as a request\n if (method === 'POST' && url.match(/sentry_key/)) {\n this.__sentry_own_request__ = true;\n }\n\n const onreadystatechangeHandler = () => {\n // For whatever reason, this is not the same instance here as from the outer method\n const xhrInfo = this[SENTRY_XHR_DATA_KEY];\n\n if (!xhrInfo) {\n return;\n }\n\n if (this.readyState === 4) {\n try {\n // touching statusCode in some platforms throws\n // an exception\n xhrInfo.status_code = this.status;\n } catch (e) {\n /* do nothing */\n }\n\n const handlerData = {\n args: [method, url],\n endTimestamp: Date.now(),\n startTimestamp,\n xhr: this,\n };\n triggerHandlers('xhr', handlerData);\n }\n };\n\n if ('onreadystatechange' in this && typeof this.onreadystatechange === 'function') {\n fill(this, 'onreadystatechange', function (original) {\n return function ( ...readyStateArgs) {\n onreadystatechangeHandler();\n return original.apply(this, readyStateArgs);\n };\n });\n } else {\n this.addEventListener('readystatechange', onreadystatechangeHandler);\n }\n\n // Intercepting `setRequestHeader` to access the request headers of XHR instance.\n // This will only work for user/library defined headers, not for the default/browser-assigned headers.\n // Request cookies are also unavailable for XHR, as `Cookie` header can't be defined by `setRequestHeader`.\n fill(this, 'setRequestHeader', function (original) {\n return function ( ...setRequestHeaderArgs) {\n const [header, value] = setRequestHeaderArgs;\n\n const xhrInfo = this[SENTRY_XHR_DATA_KEY];\n\n if (xhrInfo && isString(header) && isString(value)) {\n xhrInfo.request_headers[header.toLowerCase()] = value;\n }\n\n return original.apply(this, setRequestHeaderArgs);\n };\n });\n\n return originalOpen.apply(this, args);\n };\n });\n\n fill(xhrproto, 'send', function (originalSend) {\n return function ( ...args) {\n const sentryXhrData = this[SENTRY_XHR_DATA_KEY];\n\n if (!sentryXhrData) {\n return originalSend.apply(this, args);\n }\n\n if (args[0] !== undefined) {\n sentryXhrData.body = args[0];\n }\n\n const handlerData = {\n args: [sentryXhrData.method, sentryXhrData.url],\n startTimestamp: Date.now(),\n xhr: this,\n };\n triggerHandlers('xhr', handlerData);\n\n return originalSend.apply(this, args);\n };\n });\n}\n\nfunction parseUrl(url) {\n if (isString(url)) {\n return url;\n }\n\n try {\n // url can be a string or URL\n // but since URL is not available in IE11, we do not check for it,\n // but simply assume it is an URL and return `toString()` from it (which returns the full URL)\n // If that fails, we just return undefined\n return (url ).toString();\n } catch (e2) {} // eslint-disable-line no-empty\n\n return undefined;\n}\n\nexport { SENTRY_XHR_DATA_KEY, addXhrInstrumentationHandler, instrumentXHR };\n//# sourceMappingURL=xhr.js.map\n","/*\n * This module exists for optimizations in the build process through rollup and terser. We define some global\n * constants, which can be overridden during build. By guarding certain pieces of code with functions that return these\n * constants, we can control whether or not they appear in the final bundle. (Any code guarded by a false condition will\n * never run, and will hence be dropped during treeshaking.) The two primary uses for this are stripping out calls to\n * `logger` and preventing node-related code from appearing in browser bundles.\n *\n * Attention:\n * This file should not be used to define constants/flags that are intended to be used for tree-shaking conducted by\n * users. These flags should live in their respective packages, as we identified user tooling (specifically webpack)\n * having issues tree-shaking these constants across package boundaries.\n * An example for this is the __SENTRY_DEBUG__ constant. It is declared in each package individually because we want\n * users to be able to shake away expressions that it guards.\n */\n\n/**\n * Figures out if we're building a browser bundle.\n *\n * @returns true if this is a browser bundle build.\n */\nfunction isBrowserBundle() {\n return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__;\n}\n\n/**\n * Get source of SDK.\n */\nfunction getSDKSource() {\n // @ts-expect-error \"npm\" is injected by rollup during build process\n return \"npm\";\n}\n\nexport { getSDKSource, isBrowserBundle };\n//# sourceMappingURL=env.js.map\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/**\n * Helper to decycle json objects\n */\nfunction memoBuilder() {\n const hasWeakSet = typeof WeakSet === 'function';\n const inner = hasWeakSet ? new WeakSet() : [];\n function memoize(obj) {\n if (hasWeakSet) {\n if (inner.has(obj)) {\n return true;\n }\n inner.add(obj);\n return false;\n }\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < inner.length; i++) {\n const value = inner[i];\n if (value === obj) {\n return true;\n }\n }\n inner.push(obj);\n return false;\n }\n\n function unmemoize(obj) {\n if (hasWeakSet) {\n inner.delete(obj);\n } else {\n for (let i = 0; i < inner.length; i++) {\n if (inner[i] === obj) {\n inner.splice(i, 1);\n break;\n }\n }\n }\n }\n return [memoize, unmemoize];\n}\n\nexport { memoBuilder };\n//# sourceMappingURL=memo.js.map\n","import { isNaN, isVueViewModel, isSyntheticEvent } from './is.js';\nimport { memoBuilder } from './memo.js';\nimport { convertToPlainObject } from './object.js';\nimport { getFunctionName } from './stacktrace.js';\n\n/**\n * Recursively normalizes the given object.\n *\n * - Creates a copy to prevent original input mutation\n * - Skips non-enumerable properties\n * - When stringifying, calls `toJSON` if implemented\n * - Removes circular references\n * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format\n * - Translates known global objects/classes to a string representations\n * - Takes care of `Error` object serialization\n * - Optionally limits depth of final output\n * - Optionally limits number of properties/elements included in any single object/array\n *\n * @param input The object to be normalized.\n * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.)\n * @param maxProperties The max number of elements or properties to be included in any single array or\n * object in the normallized output.\n * @returns A normalized version of the object, or `\"**non-serializable**\"` if any errors are thrown during normalization.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction normalize(input, depth = 100, maxProperties = +Infinity) {\n try {\n // since we're at the outermost level, we don't provide a key\n return visit('', input, depth, maxProperties);\n } catch (err) {\n return { ERROR: `**non-serializable** (${err})` };\n }\n}\n\n/** JSDoc */\nfunction normalizeToSize(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n object,\n // Default Node.js REPL depth\n depth = 3,\n // 100kB, as 200kB is max payload size, so half sounds reasonable\n maxSize = 100 * 1024,\n) {\n const normalized = normalize(object, depth);\n\n if (jsonSize(normalized) > maxSize) {\n return normalizeToSize(object, depth - 1, maxSize);\n }\n\n return normalized ;\n}\n\n/**\n * Visits a node to perform normalization on it\n *\n * @param key The key corresponding to the given node\n * @param value The node to be visited\n * @param depth Optional number indicating the maximum recursion depth\n * @param maxProperties Optional maximum number of properties/elements included in any single object/array\n * @param memo Optional Memo class handling decycling\n */\nfunction visit(\n key,\n value,\n depth = +Infinity,\n maxProperties = +Infinity,\n memo = memoBuilder(),\n) {\n const [memoize, unmemoize] = memo;\n\n // Get the simple cases out of the way first\n if (\n value == null || // this matches null and undefined -> eqeq not eqeqeq\n (['number', 'boolean', 'string'].includes(typeof value) && !isNaN(value))\n ) {\n return value ;\n }\n\n const stringified = stringifyValue(key, value);\n\n // Anything we could potentially dig into more (objects or arrays) will have come back as `\"[object XXXX]\"`.\n // Everything else will have already been serialized, so if we don't see that pattern, we're done.\n if (!stringified.startsWith('[object ')) {\n return stringified;\n }\n\n // From here on, we can assert that `value` is either an object or an array.\n\n // Do not normalize objects that we know have already been normalized. As a general rule, the\n // \"__sentry_skip_normalization__\" property should only be used sparingly and only should only be set on objects that\n // have already been normalized.\n if ((value )['__sentry_skip_normalization__']) {\n return value ;\n }\n\n // We can set `__sentry_override_normalization_depth__` on an object to ensure that from there\n // We keep a certain amount of depth.\n // This should be used sparingly, e.g. we use it for the redux integration to ensure we get a certain amount of state.\n const remainingDepth =\n typeof (value )['__sentry_override_normalization_depth__'] === 'number'\n ? ((value )['__sentry_override_normalization_depth__'] )\n : depth;\n\n // We're also done if we've reached the max depth\n if (remainingDepth === 0) {\n // At this point we know `serialized` is a string of the form `\"[object XXXX]\"`. Clean it up so it's just `\"[XXXX]\"`.\n return stringified.replace('object ', '');\n }\n\n // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now.\n if (memoize(value)) {\n return '[Circular ~]';\n }\n\n // If the value has a `toJSON` method, we call it to extract more information\n const valueWithToJSON = value ;\n if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') {\n try {\n const jsonValue = valueWithToJSON.toJSON();\n // We need to normalize the return value of `.toJSON()` in case it has circular references\n return visit('', jsonValue, remainingDepth - 1, maxProperties, memo);\n } catch (err) {\n // pass (The built-in `toJSON` failed, but we can still try to do it ourselves)\n }\n }\n\n // At this point we know we either have an object or an array, we haven't seen it before, and we're going to recurse\n // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each\n // property/entry, and keep track of the number of items we add to it.\n const normalized = (Array.isArray(value) ? [] : {}) ;\n let numAdded = 0;\n\n // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant\n // properties are non-enumerable and otherwise would get missed.\n const visitable = convertToPlainObject(value );\n\n for (const visitKey in visitable) {\n // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.\n if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) {\n continue;\n }\n\n if (numAdded >= maxProperties) {\n normalized[visitKey] = '[MaxProperties ~]';\n break;\n }\n\n // Recursively visit all the child nodes\n const visitValue = visitable[visitKey];\n normalized[visitKey] = visit(visitKey, visitValue, remainingDepth - 1, maxProperties, memo);\n\n numAdded++;\n }\n\n // Once we've visited all the branches, remove the parent from memo storage\n unmemoize(value);\n\n // Return accumulated values\n return normalized;\n}\n\n/* eslint-disable complexity */\n/**\n * Stringify the given value. Handles various known special values and types.\n *\n * Not meant to be used on simple primitives which already have a string representation, as it will, for example, turn\n * the number 1231 into \"[Object Number]\", nor on `null`, as it will throw.\n *\n * @param value The value to stringify\n * @returns A stringified representation of the given value\n */\nfunction stringifyValue(\n key,\n // this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for\n // our internal use, it'll do\n value,\n) {\n try {\n if (key === 'domain' && value && typeof value === 'object' && (value )._events) {\n return '[Domain]';\n }\n\n if (key === 'domainEmitter') {\n return '[DomainEmitter]';\n }\n\n // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first\n // which won't throw if they are not present.\n\n if (typeof global !== 'undefined' && value === global) {\n return '[Global]';\n }\n\n // eslint-disable-next-line no-restricted-globals\n if (typeof window !== 'undefined' && value === window) {\n return '[Window]';\n }\n\n // eslint-disable-next-line no-restricted-globals\n if (typeof document !== 'undefined' && value === document) {\n return '[Document]';\n }\n\n if (isVueViewModel(value)) {\n return '[VueViewModel]';\n }\n\n // React's SyntheticEvent thingy\n if (isSyntheticEvent(value)) {\n return '[SyntheticEvent]';\n }\n\n if (typeof value === 'number' && value !== value) {\n return '[NaN]';\n }\n\n if (typeof value === 'function') {\n return `[Function: ${getFunctionName(value)}]`;\n }\n\n if (typeof value === 'symbol') {\n return `[${String(value)}]`;\n }\n\n // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion\n if (typeof value === 'bigint') {\n return `[BigInt: ${String(value)}]`;\n }\n\n // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting\n // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as\n // `\"[object Object]\"`. If we instead look at the constructor's name (which is the same as the name of the class),\n // we can make sure that only plain objects come out that way.\n const objName = getConstructorName(value);\n\n // Handle HTML Elements\n if (/^HTML(\\w*)Element$/.test(objName)) {\n return `[HTMLElement: ${objName}]`;\n }\n\n return `[object ${objName}]`;\n } catch (err) {\n return `**non-serializable** (${err})`;\n }\n}\n/* eslint-enable complexity */\n\nfunction getConstructorName(value) {\n const prototype = Object.getPrototypeOf(value);\n\n return prototype ? prototype.constructor.name : 'null prototype';\n}\n\n/** Calculates bytes size of input string */\nfunction utf8Length(value) {\n // eslint-disable-next-line no-bitwise\n return ~-encodeURI(value).split(/%..|./).length;\n}\n\n/** Calculates bytes size of input object */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction jsonSize(value) {\n return utf8Length(JSON.stringify(value));\n}\n\n/**\n * Normalizes URLs in exceptions and stacktraces to a base path so Sentry can fingerprint\n * across platforms and working directory.\n *\n * @param url The URL to be normalized.\n * @param basePath The application base path.\n * @returns The normalized URL.\n */\nfunction normalizeUrlToBase(url, basePath) {\n const escapedBase = basePath\n // Backslash to forward\n .replace(/\\\\/g, '/')\n // Escape RegExp special characters\n .replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&');\n\n let newUrl = url;\n try {\n newUrl = decodeURI(url);\n } catch (_Oo) {\n // Sometime this breaks\n }\n return (\n newUrl\n .replace(/\\\\/g, '/')\n .replace(/webpack:\\/?/g, '') // Remove intermediate base path\n // eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor\n .replace(new RegExp(`(file://)?/*${escapedBase}/*`, 'ig'), 'app:///')\n );\n}\n\nexport { normalize, normalizeToSize, normalizeUrlToBase, visit as walk };\n//# sourceMappingURL=normalize.js.map\n","import { isThenable } from './is.js';\n\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\n\n/** SyncPromise internal states */\nvar States; (function (States) {\n /** Pending */\n const PENDING = 0; States[States[\"PENDING\"] = PENDING] = \"PENDING\";\n /** Resolved / OK */\n const RESOLVED = 1; States[States[\"RESOLVED\"] = RESOLVED] = \"RESOLVED\";\n /** Rejected / Error */\n const REJECTED = 2; States[States[\"REJECTED\"] = REJECTED] = \"REJECTED\";\n})(States || (States = {}));\n\n// Overloads so we can call resolvedSyncPromise without arguments and generic argument\n\n/**\n * Creates a resolved sync promise.\n *\n * @param value the value to resolve the promise with\n * @returns the resolved sync promise\n */\nfunction resolvedSyncPromise(value) {\n return new SyncPromise(resolve => {\n resolve(value);\n });\n}\n\n/**\n * Creates a rejected sync promise.\n *\n * @param value the value to reject the promise with\n * @returns the rejected sync promise\n */\nfunction rejectedSyncPromise(reason) {\n return new SyncPromise((_, reject) => {\n reject(reason);\n });\n}\n\n/**\n * Thenable class that behaves like a Promise and follows it's interface\n * but is not async internally\n */\nclass SyncPromise {\n\n constructor(\n executor,\n ) {SyncPromise.prototype.__init.call(this);SyncPromise.prototype.__init2.call(this);SyncPromise.prototype.__init3.call(this);SyncPromise.prototype.__init4.call(this);\n this._state = States.PENDING;\n this._handlers = [];\n\n try {\n executor(this._resolve, this._reject);\n } catch (e) {\n this._reject(e);\n }\n }\n\n /** JSDoc */\n then(\n onfulfilled,\n onrejected,\n ) {\n return new SyncPromise((resolve, reject) => {\n this._handlers.push([\n false,\n result => {\n if (!onfulfilled) {\n // TODO: ¯\\_(ツ)_/¯\n // TODO: FIXME\n resolve(result );\n } else {\n try {\n resolve(onfulfilled(result));\n } catch (e) {\n reject(e);\n }\n }\n },\n reason => {\n if (!onrejected) {\n reject(reason);\n } else {\n try {\n resolve(onrejected(reason));\n } catch (e) {\n reject(e);\n }\n }\n },\n ]);\n this._executeHandlers();\n });\n }\n\n /** JSDoc */\n catch(\n onrejected,\n ) {\n return this.then(val => val, onrejected);\n }\n\n /** JSDoc */\n finally(onfinally) {\n return new SyncPromise((resolve, reject) => {\n let val;\n let isRejected;\n\n return this.then(\n value => {\n isRejected = false;\n val = value;\n if (onfinally) {\n onfinally();\n }\n },\n reason => {\n isRejected = true;\n val = reason;\n if (onfinally) {\n onfinally();\n }\n },\n ).then(() => {\n if (isRejected) {\n reject(val);\n return;\n }\n\n resolve(val );\n });\n });\n }\n\n /** JSDoc */\n __init() {this._resolve = (value) => {\n this._setResult(States.RESOLVED, value);\n };}\n\n /** JSDoc */\n __init2() {this._reject = (reason) => {\n this._setResult(States.REJECTED, reason);\n };}\n\n /** JSDoc */\n __init3() {this._setResult = (state, value) => {\n if (this._state !== States.PENDING) {\n return;\n }\n\n if (isThenable(value)) {\n void (value ).then(this._resolve, this._reject);\n return;\n }\n\n this._state = state;\n this._value = value;\n\n this._executeHandlers();\n };}\n\n /** JSDoc */\n __init4() {this._executeHandlers = () => {\n if (this._state === States.PENDING) {\n return;\n }\n\n const cachedHandlers = this._handlers.slice();\n this._handlers = [];\n\n cachedHandlers.forEach(handler => {\n if (handler[0]) {\n return;\n }\n\n if (this._state === States.RESOLVED) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n handler[1](this._value );\n }\n\n if (this._state === States.REJECTED) {\n handler[2](this._value);\n }\n\n handler[0] = true;\n });\n };}\n}\n\nexport { SyncPromise, rejectedSyncPromise, resolvedSyncPromise };\n//# sourceMappingURL=syncpromise.js.map\n","import { SentryError } from './error.js';\nimport { rejectedSyncPromise, SyncPromise, resolvedSyncPromise } from './syncpromise.js';\n\n/**\n * Creates an new PromiseBuffer object with the specified limit\n * @param limit max number of promises that can be stored in the buffer\n */\nfunction makePromiseBuffer(limit) {\n const buffer = [];\n\n function isReady() {\n return limit === undefined || buffer.length < limit;\n }\n\n /**\n * Remove a promise from the queue.\n *\n * @param task Can be any PromiseLike\n * @returns Removed promise.\n */\n function remove(task) {\n return buffer.splice(buffer.indexOf(task), 1)[0];\n }\n\n /**\n * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment.\n *\n * @param taskProducer A function producing any PromiseLike; In previous versions this used to be `task:\n * PromiseLike`, but under that model, Promises were instantly created on the call-site and their executor\n * functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By\n * requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer\n * limit check.\n * @returns The original promise.\n */\n function add(taskProducer) {\n if (!isReady()) {\n return rejectedSyncPromise(new SentryError('Not adding Promise because buffer limit was reached.'));\n }\n\n // start the task and add its promise to the queue\n const task = taskProducer();\n if (buffer.indexOf(task) === -1) {\n buffer.push(task);\n }\n void task\n .then(() => remove(task))\n // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike`\n // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't\n // have promises, so TS has to polyfill when down-compiling.)\n .then(null, () =>\n remove(task).then(null, () => {\n // We have to add another catch here because `remove()` starts a new promise chain.\n }),\n );\n return task;\n }\n\n /**\n * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first.\n *\n * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or\n * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to\n * `true`.\n * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and\n * `false` otherwise\n */\n function drain(timeout) {\n return new SyncPromise((resolve, reject) => {\n let counter = buffer.length;\n\n if (!counter) {\n return resolve(true);\n }\n\n // wait for `timeout` ms and then resolve to `false` (if not cancelled first)\n const capturedSetTimeout = setTimeout(() => {\n if (timeout && timeout > 0) {\n resolve(false);\n }\n }, timeout);\n\n // if all promises resolve in time, cancel the timer and resolve to `true`\n buffer.forEach(item => {\n void resolvedSyncPromise(item).then(() => {\n if (!--counter) {\n clearTimeout(capturedSetTimeout);\n resolve(true);\n }\n }, reject);\n });\n });\n }\n\n return {\n $: buffer,\n add,\n drain,\n };\n}\n\nexport { makePromiseBuffer };\n//# sourceMappingURL=promisebuffer.js.map\n","/**\n * Parses string form of URL into an object\n * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B\n * // intentionally using regex and not href parsing trick because React Native and other\n * // environments where DOM might not be available\n * @returns parsed URL object\n */\nfunction parseUrl(url) {\n if (!url) {\n return {};\n }\n\n const match = url.match(/^(([^:/?#]+):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n\n if (!match) {\n return {};\n }\n\n // coerce to undefined values to empty string so we don't get 'undefined'\n const query = match[6] || '';\n const fragment = match[8] || '';\n return {\n host: match[4],\n path: match[5],\n protocol: match[2],\n search: query,\n hash: fragment,\n relative: match[5] + query + fragment, // everything minus origin\n };\n}\n\n/**\n * Strip the query string and fragment off of a given URL or path (if present)\n *\n * @param urlPath Full URL or path, including possible query string and/or fragment\n * @returns URL or path without query string or fragment\n */\nfunction stripUrlQueryAndFragment(urlPath) {\n // eslint-disable-next-line no-useless-escape\n return urlPath.split(/[\\?#]/, 1)[0];\n}\n\n/**\n * Returns number of URL segments of a passed string URL.\n */\nfunction getNumberOfUrlSegments(url) {\n // split at '/' or at '\\/' to split regex urls correctly\n return url.split(/\\\\?\\//).filter(s => s.length > 0 && s !== ',').length;\n}\n\n/**\n * Takes a URL object and returns a sanitized string which is safe to use as span description\n * see: https://develop.sentry.dev/sdk/data-handling/#structuring-data\n */\nfunction getSanitizedUrlString(url) {\n const { protocol, host, path } = url;\n\n const filteredHost =\n (host &&\n host\n // Always filter out authority\n .replace(/^.*@/, '[filtered]:[filtered]@')\n // Don't show standard :80 (http) and :443 (https) ports to reduce the noise\n // TODO: Use new URL global if it exists\n .replace(/(:80)$/, '')\n .replace(/(:443)$/, '')) ||\n '';\n\n return `${protocol ? `${protocol}://` : ''}${filteredHost}${path}`;\n}\n\nexport { getNumberOfUrlSegments, getSanitizedUrlString, parseUrl, stripUrlQueryAndFragment };\n//# sourceMappingURL=url.js.map\n","// Note: Ideally the `SeverityLevel` type would be derived from `validSeverityLevels`, but that would mean either\n//\n// a) moving `validSeverityLevels` to `@sentry/types`,\n// b) moving the`SeverityLevel` type here, or\n// c) importing `validSeverityLevels` from here into `@sentry/types`.\n//\n// Option A would make `@sentry/types` a runtime dependency of `@sentry/utils` (not good), and options B and C would\n// create a circular dependency between `@sentry/types` and `@sentry/utils` (also not good). So a TODO accompanying the\n// type, reminding anyone who changes it to change this list also, will have to do.\n\nconst validSeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug'];\n\n/**\n * Converts a string-based level into a member of the deprecated {@link Severity} enum.\n *\n * @deprecated `severityFromString` is deprecated. Please use `severityLevelFromString` instead.\n *\n * @param level String representation of Severity\n * @returns Severity\n */\nfunction severityFromString(level) {\n return severityLevelFromString(level) ;\n}\n\n/**\n * Converts a string-based level into a `SeverityLevel`, normalizing it along the way.\n *\n * @param level String representation of desired `SeverityLevel`.\n * @returns The `SeverityLevel` corresponding to the given string, or 'log' if the string isn't a valid level.\n */\nfunction severityLevelFromString(level) {\n return (level === 'warn' ? 'warning' : validSeverityLevels.includes(level) ? level : 'log') ;\n}\n\nexport { severityFromString, severityLevelFromString, validSeverityLevels };\n//# sourceMappingURL=severity.js.map\n","import { GLOBAL_OBJ } from './worldwide.js';\n\nconst ONE_SECOND_IN_MS = 1000;\n\n/**\n * A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance}\n * for accessing a high-resolution monotonic clock.\n */\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using the Date API.\n *\n * TODO(v8): Return type should be rounded.\n */\nfunction dateTimestampInSeconds() {\n return Date.now() / ONE_SECOND_IN_MS;\n}\n\n/**\n * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not\n * support the API.\n *\n * Wrapping the native API works around differences in behavior from different browsers.\n */\nfunction createUnixTimestampInSecondsFunc() {\n const { performance } = GLOBAL_OBJ ;\n if (!performance || !performance.now) {\n return dateTimestampInSeconds;\n }\n\n // Some browser and environments don't have a timeOrigin, so we fallback to\n // using Date.now() to compute the starting time.\n const approxStartingTimeOrigin = Date.now() - performance.now();\n const timeOrigin = performance.timeOrigin == undefined ? approxStartingTimeOrigin : performance.timeOrigin;\n\n // performance.now() is a monotonic clock, which means it starts at 0 when the process begins. To get the current\n // wall clock time (actual UNIX timestamp), we need to add the starting time origin and the current time elapsed.\n //\n // TODO: This does not account for the case where the monotonic clock that powers performance.now() drifts from the\n // wall clock time, which causes the returned timestamp to be inaccurate. We should investigate how to detect and\n // correct for this.\n // See: https://github.com/getsentry/sentry-javascript/issues/2590\n // See: https://github.com/mdn/content/issues/4713\n // See: https://dev.to/noamr/when-a-millisecond-is-not-a-millisecond-3h6\n return () => {\n return (timeOrigin + performance.now()) / ONE_SECOND_IN_MS;\n };\n}\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the\n * availability of the Performance API.\n *\n * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is\n * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The\n * skew can grow to arbitrary amounts like days, weeks or months.\n * See https://github.com/getsentry/sentry-javascript/issues/2590.\n */\nconst timestampInSeconds = createUnixTimestampInSecondsFunc();\n\n/**\n * Re-exported with an old name for backwards-compatibility.\n * TODO (v8): Remove this\n *\n * @deprecated Use `timestampInSeconds` instead.\n */\nconst timestampWithMs = timestampInSeconds;\n\n/**\n * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only.\n */\nlet _browserPerformanceTimeOriginMode;\n\n/**\n * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the\n * performance API is available.\n */\nconst browserPerformanceTimeOrigin = (() => {\n // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or\n // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin\n // data as reliable if they are within a reasonable threshold of the current time.\n\n const { performance } = GLOBAL_OBJ ;\n if (!performance || !performance.now) {\n _browserPerformanceTimeOriginMode = 'none';\n return undefined;\n }\n\n const threshold = 3600 * 1000;\n const performanceNow = performance.now();\n const dateNow = Date.now();\n\n // if timeOrigin isn't available set delta to threshold so it isn't used\n const timeOriginDelta = performance.timeOrigin\n ? Math.abs(performance.timeOrigin + performanceNow - dateNow)\n : threshold;\n const timeOriginIsReliable = timeOriginDelta < threshold;\n\n // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin\n // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.\n // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always\n // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the\n // Date API.\n // eslint-disable-next-line deprecation/deprecation\n const navigationStart = performance.timing && performance.timing.navigationStart;\n const hasNavigationStart = typeof navigationStart === 'number';\n // if navigationStart isn't available set delta to threshold so it isn't used\n const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold;\n const navigationStartIsReliable = navigationStartDelta < threshold;\n\n if (timeOriginIsReliable || navigationStartIsReliable) {\n // Use the more reliable time origin\n if (timeOriginDelta <= navigationStartDelta) {\n _browserPerformanceTimeOriginMode = 'timeOrigin';\n return performance.timeOrigin;\n } else {\n _browserPerformanceTimeOriginMode = 'navigationStart';\n return navigationStart;\n }\n }\n\n // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date.\n _browserPerformanceTimeOriginMode = 'dateNow';\n return dateNow;\n})();\n\nexport { _browserPerformanceTimeOriginMode, browserPerformanceTimeOrigin, dateTimestampInSeconds, timestampInSeconds, timestampWithMs };\n//# sourceMappingURL=time.js.map\n","import { DEBUG_BUILD } from './debug-build.js';\nimport { isString } from './is.js';\nimport { logger } from './logger.js';\n\nconst BAGGAGE_HEADER_NAME = 'baggage';\n\nconst SENTRY_BAGGAGE_KEY_PREFIX = 'sentry-';\n\nconst SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/;\n\n/**\n * Max length of a serialized baggage string\n *\n * https://www.w3.org/TR/baggage/#limits\n */\nconst MAX_BAGGAGE_STRING_LENGTH = 8192;\n\n/**\n * Takes a baggage header and turns it into Dynamic Sampling Context, by extracting all the \"sentry-\" prefixed values\n * from it.\n *\n * @param baggageHeader A very bread definition of a baggage header as it might appear in various frameworks.\n * @returns The Dynamic Sampling Context that was found on `baggageHeader`, if there was any, `undefined` otherwise.\n */\nfunction baggageHeaderToDynamicSamplingContext(\n // Very liberal definition of what any incoming header might look like\n baggageHeader,\n) {\n if (!isString(baggageHeader) && !Array.isArray(baggageHeader)) {\n return undefined;\n }\n\n // Intermediary object to store baggage key value pairs of incoming baggage headers on.\n // It is later used to read Sentry-DSC-values from.\n let baggageObject = {};\n\n if (Array.isArray(baggageHeader)) {\n // Combine all baggage headers into one object containing the baggage values so we can later read the Sentry-DSC-values from it\n baggageObject = baggageHeader.reduce((acc, curr) => {\n const currBaggageObject = baggageHeaderToObject(curr);\n for (const key of Object.keys(currBaggageObject)) {\n acc[key] = currBaggageObject[key];\n }\n return acc;\n }, {});\n } else {\n // Return undefined if baggage header is an empty string (technically an empty baggage header is not spec conform but\n // this is how we choose to handle it)\n if (!baggageHeader) {\n return undefined;\n }\n\n baggageObject = baggageHeaderToObject(baggageHeader);\n }\n\n // Read all \"sentry-\" prefixed values out of the baggage object and put it onto a dynamic sampling context object.\n const dynamicSamplingContext = Object.entries(baggageObject).reduce((acc, [key, value]) => {\n if (key.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)) {\n const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length);\n acc[nonPrefixedKey] = value;\n }\n return acc;\n }, {});\n\n // Only return a dynamic sampling context object if there are keys in it.\n // A keyless object means there were no sentry values on the header, which means that there is no DSC.\n if (Object.keys(dynamicSamplingContext).length > 0) {\n return dynamicSamplingContext ;\n } else {\n return undefined;\n }\n}\n\n/**\n * Turns a Dynamic Sampling Object into a baggage header by prefixing all the keys on the object with \"sentry-\".\n *\n * @param dynamicSamplingContext The Dynamic Sampling Context to turn into a header. For convenience and compatibility\n * with the `getDynamicSamplingContext` method on the Transaction class ,this argument can also be `undefined`. If it is\n * `undefined` the function will return `undefined`.\n * @returns a baggage header, created from `dynamicSamplingContext`, or `undefined` either if `dynamicSamplingContext`\n * was `undefined`, or if `dynamicSamplingContext` didn't contain any values.\n */\nfunction dynamicSamplingContextToSentryBaggageHeader(\n // this also takes undefined for convenience and bundle size in other places\n dynamicSamplingContext,\n) {\n if (!dynamicSamplingContext) {\n return undefined;\n }\n\n // Prefix all DSC keys with \"sentry-\" and put them into a new object\n const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce(\n (acc, [dscKey, dscValue]) => {\n if (dscValue) {\n acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue;\n }\n return acc;\n },\n {},\n );\n\n return objectToBaggageHeader(sentryPrefixedDSC);\n}\n\n/**\n * Will parse a baggage header, which is a simple key-value map, into a flat object.\n *\n * @param baggageHeader The baggage header to parse.\n * @returns a flat object containing all the key-value pairs from `baggageHeader`.\n */\nfunction baggageHeaderToObject(baggageHeader) {\n return baggageHeader\n .split(',')\n .map(baggageEntry => baggageEntry.split('=').map(keyOrValue => decodeURIComponent(keyOrValue.trim())))\n .reduce((acc, [key, value]) => {\n acc[key] = value;\n return acc;\n }, {});\n}\n\n/**\n * Turns a flat object (key-value pairs) into a baggage header, which is also just key-value pairs.\n *\n * @param object The object to turn into a baggage header.\n * @returns a baggage header string, or `undefined` if the object didn't have any values, since an empty baggage header\n * is not spec compliant.\n */\nfunction objectToBaggageHeader(object) {\n if (Object.keys(object).length === 0) {\n // An empty baggage header is not spec compliant: We return undefined.\n return undefined;\n }\n\n return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => {\n const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`;\n const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`;\n if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) {\n DEBUG_BUILD &&\n logger.warn(\n `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`,\n );\n return baggageHeader;\n } else {\n return newBaggageHeader;\n }\n }, '');\n}\n\nexport { BAGGAGE_HEADER_NAME, MAX_BAGGAGE_STRING_LENGTH, SENTRY_BAGGAGE_KEY_PREFIX, SENTRY_BAGGAGE_KEY_PREFIX_REGEX, baggageHeaderToDynamicSamplingContext, dynamicSamplingContextToSentryBaggageHeader };\n//# sourceMappingURL=baggage.js.map\n","import { baggageHeaderToDynamicSamplingContext } from './baggage.js';\nimport { uuid4 } from './misc.js';\n\n// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor -- RegExp is used for readability here\nconst TRACEPARENT_REGEXP = new RegExp(\n '^[ \\\\t]*' + // whitespace\n '([0-9a-f]{32})?' + // trace_id\n '-?([0-9a-f]{16})?' + // span_id\n '-?([01])?' + // sampled\n '[ \\\\t]*$', // whitespace\n);\n\n/**\n * Extract transaction context data from a `sentry-trace` header.\n *\n * @param traceparent Traceparent string\n *\n * @returns Object containing data from the header, or undefined if traceparent string is malformed\n */\nfunction extractTraceparentData(traceparent) {\n if (!traceparent) {\n return undefined;\n }\n\n const matches = traceparent.match(TRACEPARENT_REGEXP);\n if (!matches) {\n return undefined;\n }\n\n let parentSampled;\n if (matches[3] === '1') {\n parentSampled = true;\n } else if (matches[3] === '0') {\n parentSampled = false;\n }\n\n return {\n traceId: matches[1],\n parentSampled,\n parentSpanId: matches[2],\n };\n}\n\n/**\n * Create tracing context from incoming headers.\n *\n * @deprecated Use `propagationContextFromHeaders` instead.\n */\n// TODO(v8): Remove this function\nfunction tracingContextFromHeaders(\n sentryTrace,\n baggage,\n)\n\n {\n const traceparentData = extractTraceparentData(sentryTrace);\n const dynamicSamplingContext = baggageHeaderToDynamicSamplingContext(baggage);\n\n const { traceId, parentSpanId, parentSampled } = traceparentData || {};\n\n if (!traceparentData) {\n return {\n traceparentData,\n dynamicSamplingContext: undefined,\n propagationContext: {\n traceId: traceId || uuid4(),\n spanId: uuid4().substring(16),\n },\n };\n } else {\n return {\n traceparentData,\n dynamicSamplingContext: dynamicSamplingContext || {}, // If we have traceparent data but no DSC it means we are not head of trace and we must freeze it\n propagationContext: {\n traceId: traceId || uuid4(),\n parentSpanId: parentSpanId || uuid4().substring(16),\n spanId: uuid4().substring(16),\n sampled: parentSampled,\n dsc: dynamicSamplingContext || {}, // If we have traceparent data but no DSC it means we are not head of trace and we must freeze it\n },\n };\n }\n}\n\n/**\n * Create a propagation context from incoming headers.\n */\nfunction propagationContextFromHeaders(\n sentryTrace,\n baggage,\n) {\n const traceparentData = extractTraceparentData(sentryTrace);\n const dynamicSamplingContext = baggageHeaderToDynamicSamplingContext(baggage);\n\n const { traceId, parentSpanId, parentSampled } = traceparentData || {};\n\n if (!traceparentData) {\n return {\n traceId: traceId || uuid4(),\n spanId: uuid4().substring(16),\n };\n } else {\n return {\n traceId: traceId || uuid4(),\n parentSpanId: parentSpanId || uuid4().substring(16),\n spanId: uuid4().substring(16),\n sampled: parentSampled,\n dsc: dynamicSamplingContext || {}, // If we have traceparent data but no DSC it means we are not head of trace and we must freeze it\n };\n }\n}\n\n/**\n * Create sentry-trace header from span context values.\n */\nfunction generateSentryTraceHeader(\n traceId = uuid4(),\n spanId = uuid4().substring(16),\n sampled,\n) {\n let sampledString = '';\n if (sampled !== undefined) {\n sampledString = sampled ? '-1' : '-0';\n }\n return `${traceId}-${spanId}${sampledString}`;\n}\n\nexport { TRACEPARENT_REGEXP, extractTraceparentData, generateSentryTraceHeader, propagationContextFromHeaders, tracingContextFromHeaders };\n//# sourceMappingURL=tracing.js.map\n","import { dsnToString } from './dsn.js';\nimport { normalize } from './normalize.js';\nimport { dropUndefinedKeys } from './object.js';\n\n/**\n * Creates an envelope.\n * Make sure to always explicitly provide the generic to this function\n * so that the envelope types resolve correctly.\n */\nfunction createEnvelope(headers, items = []) {\n return [headers, items] ;\n}\n\n/**\n * Add an item to an envelope.\n * Make sure to always explicitly provide the generic to this function\n * so that the envelope types resolve correctly.\n */\nfunction addItemToEnvelope(envelope, newItem) {\n const [headers, items] = envelope;\n return [headers, [...items, newItem]] ;\n}\n\n/**\n * Convenience function to loop through the items and item types of an envelope.\n * (This function was mostly created because working with envelope types is painful at the moment)\n *\n * If the callback returns true, the rest of the items will be skipped.\n */\nfunction forEachEnvelopeItem(\n envelope,\n callback,\n) {\n const envelopeItems = envelope[1];\n\n for (const envelopeItem of envelopeItems) {\n const envelopeItemType = envelopeItem[0].type;\n const result = callback(envelopeItem, envelopeItemType);\n\n if (result) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Returns true if the envelope contains any of the given envelope item types\n */\nfunction envelopeContainsItemType(envelope, types) {\n return forEachEnvelopeItem(envelope, (_, type) => types.includes(type));\n}\n\n/**\n * Encode a string to UTF8.\n */\nfunction encodeUTF8(input, textEncoder) {\n const utf8 = textEncoder || new TextEncoder();\n return utf8.encode(input);\n}\n\n/**\n * Serializes an envelope.\n */\nfunction serializeEnvelope(envelope, textEncoder) {\n const [envHeaders, items] = envelope;\n\n // Initially we construct our envelope as a string and only convert to binary chunks if we encounter binary data\n let parts = JSON.stringify(envHeaders);\n\n function append(next) {\n if (typeof parts === 'string') {\n parts = typeof next === 'string' ? parts + next : [encodeUTF8(parts, textEncoder), next];\n } else {\n parts.push(typeof next === 'string' ? encodeUTF8(next, textEncoder) : next);\n }\n }\n\n for (const item of items) {\n const [itemHeaders, payload] = item;\n\n append(`\\n${JSON.stringify(itemHeaders)}\\n`);\n\n if (typeof payload === 'string' || payload instanceof Uint8Array) {\n append(payload);\n } else {\n let stringifiedPayload;\n try {\n stringifiedPayload = JSON.stringify(payload);\n } catch (e) {\n // In case, despite all our efforts to keep `payload` circular-dependency-free, `JSON.strinify()` still\n // fails, we try again after normalizing it again with infinite normalization depth. This of course has a\n // performance impact but in this case a performance hit is better than throwing.\n stringifiedPayload = JSON.stringify(normalize(payload));\n }\n append(stringifiedPayload);\n }\n }\n\n return typeof parts === 'string' ? parts : concatBuffers(parts);\n}\n\nfunction concatBuffers(buffers) {\n const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0);\n\n const merged = new Uint8Array(totalLength);\n let offset = 0;\n for (const buffer of buffers) {\n merged.set(buffer, offset);\n offset += buffer.length;\n }\n\n return merged;\n}\n\n/**\n * Parses an envelope\n */\nfunction parseEnvelope(\n env,\n textEncoder,\n textDecoder,\n) {\n let buffer = typeof env === 'string' ? textEncoder.encode(env) : env;\n\n function readBinary(length) {\n const bin = buffer.subarray(0, length);\n // Replace the buffer with the remaining data excluding trailing newline\n buffer = buffer.subarray(length + 1);\n return bin;\n }\n\n function readJson() {\n let i = buffer.indexOf(0xa);\n // If we couldn't find a newline, we must have found the end of the buffer\n if (i < 0) {\n i = buffer.length;\n }\n\n return JSON.parse(textDecoder.decode(readBinary(i))) ;\n }\n\n const envelopeHeader = readJson();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const items = [];\n\n while (buffer.length) {\n const itemHeader = readJson();\n const binaryLength = typeof itemHeader.length === 'number' ? itemHeader.length : undefined;\n\n items.push([itemHeader, binaryLength ? readBinary(binaryLength) : readJson()]);\n }\n\n return [envelopeHeader, items];\n}\n\n/**\n * Creates attachment envelope items\n */\nfunction createAttachmentEnvelopeItem(\n attachment,\n textEncoder,\n) {\n const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data, textEncoder) : attachment.data;\n\n return [\n dropUndefinedKeys({\n type: 'attachment',\n length: buffer.length,\n filename: attachment.filename,\n content_type: attachment.contentType,\n attachment_type: attachment.attachmentType,\n }),\n buffer,\n ];\n}\n\nconst ITEM_TYPE_TO_DATA_CATEGORY_MAP = {\n session: 'session',\n sessions: 'session',\n attachment: 'attachment',\n transaction: 'transaction',\n event: 'error',\n client_report: 'internal',\n user_report: 'default',\n profile: 'profile',\n replay_event: 'replay',\n replay_recording: 'replay',\n check_in: 'monitor',\n feedback: 'feedback',\n span: 'span',\n statsd: 'metric_bucket',\n};\n\n/**\n * Maps the type of an envelope item to a data category.\n */\nfunction envelopeItemTypeToDataCategory(type) {\n return ITEM_TYPE_TO_DATA_CATEGORY_MAP[type];\n}\n\n/** Extracts the minimal SDK info from the metadata or an events */\nfunction getSdkMetadataForEnvelopeHeader(metadataOrEvent) {\n if (!metadataOrEvent || !metadataOrEvent.sdk) {\n return;\n }\n const { name, version } = metadataOrEvent.sdk;\n return { name, version };\n}\n\n/**\n * Creates event envelope headers, based on event, sdk info and tunnel\n * Note: This function was extracted from the core package to make it available in Replay\n */\nfunction createEventEnvelopeHeaders(\n event,\n sdkInfo,\n tunnel,\n dsn,\n) {\n const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata.dynamicSamplingContext;\n return {\n event_id: event.event_id ,\n sent_at: new Date().toISOString(),\n ...(sdkInfo && { sdk: sdkInfo }),\n ...(!!tunnel && dsn && { dsn: dsnToString(dsn) }),\n ...(dynamicSamplingContext && {\n trace: dropUndefinedKeys({ ...dynamicSamplingContext }),\n }),\n };\n}\n\nexport { addItemToEnvelope, createAttachmentEnvelopeItem, createEnvelope, createEventEnvelopeHeaders, envelopeContainsItemType, envelopeItemTypeToDataCategory, forEachEnvelopeItem, getSdkMetadataForEnvelopeHeader, parseEnvelope, serializeEnvelope };\n//# sourceMappingURL=envelope.js.map\n","import { createEnvelope } from './envelope.js';\nimport { dateTimestampInSeconds } from './time.js';\n\n/**\n * Creates client report envelope\n * @param discarded_events An array of discard events\n * @param dsn A DSN that can be set on the header. Optional.\n */\nfunction createClientReportEnvelope(\n discarded_events,\n dsn,\n timestamp,\n) {\n const clientReportItem = [\n { type: 'client_report' },\n {\n timestamp: timestamp || dateTimestampInSeconds(),\n discarded_events,\n },\n ];\n return createEnvelope(dsn ? { dsn } : {}, [clientReportItem]);\n}\n\nexport { createClientReportEnvelope };\n//# sourceMappingURL=clientreport.js.map\n","// Intentionally keeping the key broad, as we don't know for sure what rate limit headers get returned from backend\n\nconst DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds\n\n/**\n * Extracts Retry-After value from the request header or returns default value\n * @param header string representation of 'Retry-After' header\n * @param now current unix timestamp\n *\n */\nfunction parseRetryAfterHeader(header, now = Date.now()) {\n const headerDelay = parseInt(`${header}`, 10);\n if (!isNaN(headerDelay)) {\n return headerDelay * 1000;\n }\n\n const headerDate = Date.parse(`${header}`);\n if (!isNaN(headerDate)) {\n return headerDate - now;\n }\n\n return DEFAULT_RETRY_AFTER;\n}\n\n/**\n * Gets the time that the given category is disabled until for rate limiting.\n * In case no category-specific limit is set but a general rate limit across all categories is active,\n * that time is returned.\n *\n * @return the time in ms that the category is disabled until or 0 if there's no active rate limit.\n */\nfunction disabledUntil(limits, dataCategory) {\n return limits[dataCategory] || limits.all || 0;\n}\n\n/**\n * Checks if a category is rate limited\n */\nfunction isRateLimited(limits, dataCategory, now = Date.now()) {\n return disabledUntil(limits, dataCategory) > now;\n}\n\n/**\n * Update ratelimits from incoming headers.\n *\n * @return the updated RateLimits object.\n */\nfunction updateRateLimits(\n limits,\n { statusCode, headers },\n now = Date.now(),\n) {\n const updatedRateLimits = {\n ...limits,\n };\n\n // \"The name is case-insensitive.\"\n // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get\n const rateLimitHeader = headers && headers['x-sentry-rate-limits'];\n const retryAfterHeader = headers && headers['retry-after'];\n\n if (rateLimitHeader) {\n /**\n * rate limit headers are of the form\n *
,
,..\n * where each
is of the form\n * : : : : \n * where\n * is a delay in seconds\n * is the event type(s) (error, transaction, etc) being rate limited and is of the form\n * ;;...\n * is what's being limited (org, project, or key) - ignored by SDK\n * is an arbitrary string like \"org_quota\" - ignored by SDK\n * Semicolon-separated list of metric namespace identifiers. Defines which namespace(s) will be affected.\n * Only present if rate limit applies to the metric_bucket data category.\n */\n for (const limit of rateLimitHeader.trim().split(',')) {\n const [retryAfter, categories, , , namespaces] = limit.split(':', 5);\n const headerDelay = parseInt(retryAfter, 10);\n const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default\n if (!categories) {\n updatedRateLimits.all = now + delay;\n } else {\n for (const category of categories.split(';')) {\n if (category === 'metric_bucket') {\n // namespaces will be present when category === 'metric_bucket'\n if (!namespaces || namespaces.split(';').includes('custom')) {\n updatedRateLimits[category] = now + delay;\n }\n } else {\n updatedRateLimits[category] = now + delay;\n }\n }\n }\n }\n } else if (retryAfterHeader) {\n updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now);\n } else if (statusCode === 429) {\n updatedRateLimits.all = now + 60 * 1000;\n }\n\n return updatedRateLimits;\n}\n\nexport { DEFAULT_RETRY_AFTER, disabledUntil, isRateLimited, parseRetryAfterHeader, updateRateLimits };\n//# sourceMappingURL=ratelimit.js.map\n","/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nconst DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);\n\nexport { DEBUG_BUILD };\n//# sourceMappingURL=debug-build.js.map\n","const DEFAULT_ENVIRONMENT = 'production';\n\nexport { DEFAULT_ENVIRONMENT };\n//# sourceMappingURL=constants.js.map\n","import { SyncPromise, logger, isThenable, getGlobalSingleton } from '@sentry/utils';\nimport { DEBUG_BUILD } from './debug-build.js';\n\n/**\n * Returns the global event processors.\n * @deprecated Global event processors will be removed in v8.\n */\nfunction getGlobalEventProcessors() {\n return getGlobalSingleton('globalEventProcessors', () => []);\n}\n\n/**\n * Add a EventProcessor to be kept globally.\n * @deprecated Use `addEventProcessor` instead. Global event processors will be removed in v8.\n */\nfunction addGlobalEventProcessor(callback) {\n // eslint-disable-next-line deprecation/deprecation\n getGlobalEventProcessors().push(callback);\n}\n\n/**\n * Process an array of event processors, returning the processed event (or `null` if the event was dropped).\n */\nfunction notifyEventProcessors(\n processors,\n event,\n hint,\n index = 0,\n) {\n return new SyncPromise((resolve, reject) => {\n const processor = processors[index];\n if (event === null || typeof processor !== 'function') {\n resolve(event);\n } else {\n const result = processor({ ...event }, hint) ;\n\n DEBUG_BUILD && processor.id && result === null && logger.log(`Event processor \"${processor.id}\" dropped event`);\n\n if (isThenable(result)) {\n void result\n .then(final => notifyEventProcessors(processors, final, hint, index + 1).then(resolve))\n .then(null, reject);\n } else {\n void notifyEventProcessors(processors, result, hint, index + 1)\n .then(resolve)\n .then(null, reject);\n }\n }\n });\n}\n\nexport { addGlobalEventProcessor, getGlobalEventProcessors, notifyEventProcessors };\n//# sourceMappingURL=eventProcessors.js.map\n","import { timestampInSeconds, uuid4, dropUndefinedKeys } from '@sentry/utils';\n\n/**\n * Creates a new `Session` object by setting certain default parameters. If optional @param context\n * is passed, the passed properties are applied to the session object.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns a new `Session` object\n */\nfunction makeSession(context) {\n // Both timestamp and started are in seconds since the UNIX epoch.\n const startingTime = timestampInSeconds();\n\n const session = {\n sid: uuid4(),\n init: true,\n timestamp: startingTime,\n started: startingTime,\n duration: 0,\n status: 'ok',\n errors: 0,\n ignoreDuration: false,\n toJSON: () => sessionToJSON(session),\n };\n\n if (context) {\n updateSession(session, context);\n }\n\n return session;\n}\n\n/**\n * Updates a session object with the properties passed in the context.\n *\n * Note that this function mutates the passed object and returns void.\n * (Had to do this instead of returning a new and updated session because closing and sending a session\n * makes an update to the session after it was passed to the sending logic.\n * @see BaseClient.captureSession )\n *\n * @param session the `Session` to update\n * @param context the `SessionContext` holding the properties that should be updated in @param session\n */\n// eslint-disable-next-line complexity\nfunction updateSession(session, context = {}) {\n if (context.user) {\n if (!session.ipAddress && context.user.ip_address) {\n session.ipAddress = context.user.ip_address;\n }\n\n if (!session.did && !context.did) {\n session.did = context.user.id || context.user.email || context.user.username;\n }\n }\n\n session.timestamp = context.timestamp || timestampInSeconds();\n\n if (context.abnormal_mechanism) {\n session.abnormal_mechanism = context.abnormal_mechanism;\n }\n\n if (context.ignoreDuration) {\n session.ignoreDuration = context.ignoreDuration;\n }\n if (context.sid) {\n // Good enough uuid validation. — Kamil\n session.sid = context.sid.length === 32 ? context.sid : uuid4();\n }\n if (context.init !== undefined) {\n session.init = context.init;\n }\n if (!session.did && context.did) {\n session.did = `${context.did}`;\n }\n if (typeof context.started === 'number') {\n session.started = context.started;\n }\n if (session.ignoreDuration) {\n session.duration = undefined;\n } else if (typeof context.duration === 'number') {\n session.duration = context.duration;\n } else {\n const duration = session.timestamp - session.started;\n session.duration = duration >= 0 ? duration : 0;\n }\n if (context.release) {\n session.release = context.release;\n }\n if (context.environment) {\n session.environment = context.environment;\n }\n if (!session.ipAddress && context.ipAddress) {\n session.ipAddress = context.ipAddress;\n }\n if (!session.userAgent && context.userAgent) {\n session.userAgent = context.userAgent;\n }\n if (typeof context.errors === 'number') {\n session.errors = context.errors;\n }\n if (context.status) {\n session.status = context.status;\n }\n}\n\n/**\n * Closes a session by setting its status and updating the session object with it.\n * Internally calls `updateSession` to update the passed session object.\n *\n * Note that this function mutates the passed session (@see updateSession for explanation).\n *\n * @param session the `Session` object to be closed\n * @param status the `SessionStatus` with which the session was closed. If you don't pass a status,\n * this function will keep the previously set status, unless it was `'ok'` in which case\n * it is changed to `'exited'`.\n */\nfunction closeSession(session, status) {\n let context = {};\n if (status) {\n context = { status };\n } else if (session.status === 'ok') {\n context = { status: 'exited' };\n }\n\n updateSession(session, context);\n}\n\n/**\n * Serializes a passed session object to a JSON object with a slightly different structure.\n * This is necessary because the Sentry backend requires a slightly different schema of a session\n * than the one the JS SDKs use internally.\n *\n * @param session the session to be converted\n *\n * @returns a JSON object of the passed session\n */\nfunction sessionToJSON(session) {\n return dropUndefinedKeys({\n sid: `${session.sid}`,\n init: session.init,\n // Make sure that sec is converted to ms for date constructor\n started: new Date(session.started * 1000).toISOString(),\n timestamp: new Date(session.timestamp * 1000).toISOString(),\n status: session.status,\n errors: session.errors,\n did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined,\n duration: session.duration,\n abnormal_mechanism: session.abnormal_mechanism,\n attrs: {\n release: session.release,\n environment: session.environment,\n ip_address: session.ipAddress,\n user_agent: session.userAgent,\n },\n });\n}\n\nexport { closeSession, makeSession, updateSession };\n//# sourceMappingURL=session.js.map\n","import { dropUndefinedKeys, generateSentryTraceHeader, timestampInSeconds } from '@sentry/utils';\n\n// These are aligned with OpenTelemetry trace flags\nconst TRACE_FLAG_NONE = 0x0;\nconst TRACE_FLAG_SAMPLED = 0x1;\n\n/**\n * Convert a span to a trace context, which can be sent as the `trace` context in an event.\n */\nfunction spanToTraceContext(span) {\n const { spanId: span_id, traceId: trace_id } = span.spanContext();\n const { data, op, parent_span_id, status, tags, origin } = spanToJSON(span);\n\n return dropUndefinedKeys({\n data,\n op,\n parent_span_id,\n span_id,\n status,\n tags,\n trace_id,\n origin,\n });\n}\n\n/**\n * Convert a Span to a Sentry trace header.\n */\nfunction spanToTraceHeader(span) {\n const { traceId, spanId } = span.spanContext();\n const sampled = spanIsSampled(span);\n return generateSentryTraceHeader(traceId, spanId, sampled);\n}\n\n/**\n * Convert a span time input intp a timestamp in seconds.\n */\nfunction spanTimeInputToSeconds(input) {\n if (typeof input === 'number') {\n return ensureTimestampInSeconds(input);\n }\n\n if (Array.isArray(input)) {\n // See {@link HrTime} for the array-based time format\n return input[0] + input[1] / 1e9;\n }\n\n if (input instanceof Date) {\n return ensureTimestampInSeconds(input.getTime());\n }\n\n return timestampInSeconds();\n}\n\n/**\n * Converts a timestamp to second, if it was in milliseconds, or keeps it as second.\n */\nfunction ensureTimestampInSeconds(timestamp) {\n const isMs = timestamp > 9999999999;\n return isMs ? timestamp / 1000 : timestamp;\n}\n\n/**\n * Convert a span to a JSON representation.\n * Note that all fields returned here are optional and need to be guarded against.\n *\n * Note: Because of this, we currently have a circular type dependency (which we opted out of in package.json).\n * This is not avoidable as we need `spanToJSON` in `spanUtils.ts`, which in turn is needed by `span.ts` for backwards compatibility.\n * And `spanToJSON` needs the Span class from `span.ts` to check here.\n * TODO v8: When we remove the deprecated stuff from `span.ts`, we can remove the circular dependency again.\n */\nfunction spanToJSON(span) {\n if (spanIsSpanClass(span)) {\n return span.getSpanJSON();\n }\n\n // Fallback: We also check for `.toJSON()` here...\n // eslint-disable-next-line deprecation/deprecation\n if (typeof span.toJSON === 'function') {\n // eslint-disable-next-line deprecation/deprecation\n return span.toJSON();\n }\n\n return {};\n}\n\n/**\n * Sadly, due to circular dependency checks we cannot actually import the Span class here and check for instanceof.\n * :( So instead we approximate this by checking if it has the `getSpanJSON` method.\n */\nfunction spanIsSpanClass(span) {\n return typeof (span ).getSpanJSON === 'function';\n}\n\n/**\n * Returns true if a span is sampled.\n * In most cases, you should just use `span.isRecording()` instead.\n * However, this has a slightly different semantic, as it also returns false if the span is finished.\n * So in the case where this distinction is important, use this method.\n */\nfunction spanIsSampled(span) {\n // We align our trace flags with the ones OpenTelemetry use\n // So we also check for sampled the same way they do.\n const { traceFlags } = span.spanContext();\n // eslint-disable-next-line no-bitwise\n return Boolean(traceFlags & TRACE_FLAG_SAMPLED);\n}\n\nexport { TRACE_FLAG_NONE, TRACE_FLAG_SAMPLED, spanIsSampled, spanTimeInputToSeconds, spanToJSON, spanToTraceContext, spanToTraceHeader };\n//# sourceMappingURL=spanUtils.js.map\n","import { uuid4, dateTimestampInSeconds, addExceptionMechanism, truncate, GLOBAL_OBJ, normalize } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from '../constants.js';\nimport { getGlobalEventProcessors, notifyEventProcessors } from '../eventProcessors.js';\nimport { getGlobalScope, Scope } from '../scope.js';\nimport { mergeScopeData, applyScopeDataToEvent } from './applyScopeDataToEvent.js';\nimport { spanToJSON } from './spanUtils.js';\n\n/**\n * This type makes sure that we get either a CaptureContext, OR an EventHint.\n * It does not allow mixing them, which could lead to unexpected outcomes, e.g. this is disallowed:\n * { user: { id: '123' }, mechanism: { handled: false } }\n */\n\n/**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * Note: This also triggers callbacks for `addGlobalEventProcessor`, but not `beforeSend`.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n * @hidden\n */\nfunction prepareEvent(\n options,\n event,\n hint,\n scope,\n client,\n isolationScope,\n) {\n const { normalizeDepth = 3, normalizeMaxBreadth = 1000 } = options;\n const prepared = {\n ...event,\n event_id: event.event_id || hint.event_id || uuid4(),\n timestamp: event.timestamp || dateTimestampInSeconds(),\n };\n const integrations = hint.integrations || options.integrations.map(i => i.name);\n\n applyClientOptions(prepared, options);\n applyIntegrationsMetadata(prepared, integrations);\n\n // Only put debug IDs onto frames for error events.\n if (event.type === undefined) {\n applyDebugIds(prepared, options.stackParser);\n }\n\n // If we have scope given to us, use it as the base for further modifications.\n // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.\n const finalScope = getFinalScope(scope, hint.captureContext);\n\n if (hint.mechanism) {\n addExceptionMechanism(prepared, hint.mechanism);\n }\n\n const clientEventProcessors = client && client.getEventProcessors ? client.getEventProcessors() : [];\n\n // This should be the last thing called, since we want that\n // {@link Hub.addEventProcessor} gets the finished prepared event.\n // Merge scope data together\n const data = getGlobalScope().getScopeData();\n\n if (isolationScope) {\n const isolationData = isolationScope.getScopeData();\n mergeScopeData(data, isolationData);\n }\n\n if (finalScope) {\n const finalScopeData = finalScope.getScopeData();\n mergeScopeData(data, finalScopeData);\n }\n\n const attachments = [...(hint.attachments || []), ...data.attachments];\n if (attachments.length) {\n hint.attachments = attachments;\n }\n\n applyScopeDataToEvent(prepared, data);\n\n // TODO (v8): Update this order to be: Global > Client > Scope\n const eventProcessors = [\n ...clientEventProcessors,\n // eslint-disable-next-line deprecation/deprecation\n ...getGlobalEventProcessors(),\n // Run scope event processors _after_ all other processors\n ...data.eventProcessors,\n ];\n\n const result = notifyEventProcessors(eventProcessors, prepared, hint);\n\n return result.then(evt => {\n if (evt) {\n // We apply the debug_meta field only after all event processors have ran, so that if any event processors modified\n // file names (e.g.the RewriteFrames integration) the filename -> debug ID relationship isn't destroyed.\n // This should not cause any PII issues, since we're only moving data that is already on the event and not adding\n // any new data\n applyDebugMeta(evt);\n }\n\n if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {\n return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);\n }\n return evt;\n });\n}\n\n/**\n * Enhances event using the client configuration.\n * It takes care of all \"static\" values like environment, release and `dist`,\n * as well as truncating overly long values.\n * @param event event instance to be enhanced\n */\nfunction applyClientOptions(event, options) {\n const { environment, release, dist, maxValueLength = 250 } = options;\n\n if (!('environment' in event)) {\n event.environment = 'environment' in options ? environment : DEFAULT_ENVIRONMENT;\n }\n\n if (event.release === undefined && release !== undefined) {\n event.release = release;\n }\n\n if (event.dist === undefined && dist !== undefined) {\n event.dist = dist;\n }\n\n if (event.message) {\n event.message = truncate(event.message, maxValueLength);\n }\n\n const exception = event.exception && event.exception.values && event.exception.values[0];\n if (exception && exception.value) {\n exception.value = truncate(exception.value, maxValueLength);\n }\n\n const request = event.request;\n if (request && request.url) {\n request.url = truncate(request.url, maxValueLength);\n }\n}\n\nconst debugIdStackParserCache = new WeakMap();\n\n/**\n * Puts debug IDs into the stack frames of an error event.\n */\nfunction applyDebugIds(event, stackParser) {\n const debugIdMap = GLOBAL_OBJ._sentryDebugIds;\n\n if (!debugIdMap) {\n return;\n }\n\n let debugIdStackFramesCache;\n const cachedDebugIdStackFrameCache = debugIdStackParserCache.get(stackParser);\n if (cachedDebugIdStackFrameCache) {\n debugIdStackFramesCache = cachedDebugIdStackFrameCache;\n } else {\n debugIdStackFramesCache = new Map();\n debugIdStackParserCache.set(stackParser, debugIdStackFramesCache);\n }\n\n // Build a map of filename -> debug_id\n const filenameDebugIdMap = Object.keys(debugIdMap).reduce((acc, debugIdStackTrace) => {\n let parsedStack;\n const cachedParsedStack = debugIdStackFramesCache.get(debugIdStackTrace);\n if (cachedParsedStack) {\n parsedStack = cachedParsedStack;\n } else {\n parsedStack = stackParser(debugIdStackTrace);\n debugIdStackFramesCache.set(debugIdStackTrace, parsedStack);\n }\n\n for (let i = parsedStack.length - 1; i >= 0; i--) {\n const stackFrame = parsedStack[i];\n if (stackFrame.filename) {\n acc[stackFrame.filename] = debugIdMap[debugIdStackTrace];\n break;\n }\n }\n return acc;\n }, {});\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception.values.forEach(exception => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n exception.stacktrace.frames.forEach(frame => {\n if (frame.filename) {\n frame.debug_id = filenameDebugIdMap[frame.filename];\n }\n });\n });\n } catch (e) {\n // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n }\n}\n\n/**\n * Moves debug IDs from the stack frames of an error event into the debug_meta field.\n */\nfunction applyDebugMeta(event) {\n // Extract debug IDs and filenames from the stack frames on the event.\n const filenameDebugIdMap = {};\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception.values.forEach(exception => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n exception.stacktrace.frames.forEach(frame => {\n if (frame.debug_id) {\n if (frame.abs_path) {\n filenameDebugIdMap[frame.abs_path] = frame.debug_id;\n } else if (frame.filename) {\n filenameDebugIdMap[frame.filename] = frame.debug_id;\n }\n delete frame.debug_id;\n }\n });\n });\n } catch (e) {\n // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n }\n\n if (Object.keys(filenameDebugIdMap).length === 0) {\n return;\n }\n\n // Fill debug_meta information\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = event.debug_meta.images || [];\n const images = event.debug_meta.images;\n Object.keys(filenameDebugIdMap).forEach(filename => {\n images.push({\n type: 'sourcemap',\n code_file: filename,\n debug_id: filenameDebugIdMap[filename],\n });\n });\n}\n\n/**\n * This function adds all used integrations to the SDK info in the event.\n * @param event The event that will be filled with all integrations.\n */\nfunction applyIntegrationsMetadata(event, integrationNames) {\n if (integrationNames.length > 0) {\n event.sdk = event.sdk || {};\n event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationNames];\n }\n}\n\n/**\n * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.\n * Normalized keys:\n * - `breadcrumbs.data`\n * - `user`\n * - `contexts`\n * - `extra`\n * @param event Event\n * @returns Normalized event\n */\nfunction normalizeEvent(event, depth, maxBreadth) {\n if (!event) {\n return null;\n }\n\n const normalized = {\n ...event,\n ...(event.breadcrumbs && {\n breadcrumbs: event.breadcrumbs.map(b => ({\n ...b,\n ...(b.data && {\n data: normalize(b.data, depth, maxBreadth),\n }),\n })),\n }),\n ...(event.user && {\n user: normalize(event.user, depth, maxBreadth),\n }),\n ...(event.contexts && {\n contexts: normalize(event.contexts, depth, maxBreadth),\n }),\n ...(event.extra && {\n extra: normalize(event.extra, depth, maxBreadth),\n }),\n };\n\n // event.contexts.trace stores information about a Transaction. Similarly,\n // event.spans[] stores information about child Spans. Given that a\n // Transaction is conceptually a Span, normalization should apply to both\n // Transactions and Spans consistently.\n // For now the decision is to skip normalization of Transactions and Spans,\n // so this block overwrites the normalized event to add back the original\n // Transaction information prior to normalization.\n if (event.contexts && event.contexts.trace && normalized.contexts) {\n normalized.contexts.trace = event.contexts.trace;\n\n // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it\n if (event.contexts.trace.data) {\n normalized.contexts.trace.data = normalize(event.contexts.trace.data, depth, maxBreadth);\n }\n }\n\n // event.spans[].data may contain circular/dangerous data so we need to normalize it\n if (event.spans) {\n normalized.spans = event.spans.map(span => {\n const data = spanToJSON(span).data;\n\n if (data) {\n // This is a bit weird, as we generally have `Span` instances here, but to be safe we do not assume so\n // eslint-disable-next-line deprecation/deprecation\n span.data = normalize(data, depth, maxBreadth);\n }\n\n return span;\n });\n }\n\n return normalized;\n}\n\nfunction getFinalScope(scope, captureContext) {\n if (!captureContext) {\n return scope;\n }\n\n const finalScope = scope ? scope.clone() : new Scope();\n finalScope.update(captureContext);\n return finalScope;\n}\n\n/**\n * Parse either an `EventHint` directly, or convert a `CaptureContext` to an `EventHint`.\n * This is used to allow to update method signatures that used to accept a `CaptureContext` but should now accept an `EventHint`.\n */\nfunction parseEventHintOrCaptureContext(\n hint,\n) {\n if (!hint) {\n return undefined;\n }\n\n // If you pass a Scope or `() => Scope` as CaptureContext, we just return this as captureContext\n if (hintIsScopeOrFunction(hint)) {\n return { captureContext: hint };\n }\n\n if (hintIsScopeContext(hint)) {\n return {\n captureContext: hint,\n };\n }\n\n return hint;\n}\n\nfunction hintIsScopeOrFunction(\n hint,\n) {\n return hint instanceof Scope || typeof hint === 'function';\n}\n\nconst captureContextKeys = [\n 'user',\n 'level',\n 'extra',\n 'contexts',\n 'tags',\n 'fingerprint',\n 'requestSession',\n 'propagationContext',\n] ;\n\nfunction hintIsScopeContext(hint) {\n return Object.keys(hint).some(key => captureContextKeys.includes(key ));\n}\n\nexport { applyDebugIds, applyDebugMeta, parseEventHintOrCaptureContext, prepareEvent };\n//# sourceMappingURL=prepareEvent.js.map\n","import { logger, uuid4, timestampInSeconds, isThenable, GLOBAL_OBJ } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from './constants.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { getCurrentHub, runWithAsyncContext, getIsolationScope } from './hub.js';\nimport { makeSession, updateSession, closeSession } from './session.js';\nimport { parseEventHintOrCaptureContext } from './utils/prepareEvent.js';\n\n/**\n * Captures an exception event and sends it to Sentry.\n *\n * @param exception The exception to capture.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured Sentry event.\n */\nfunction captureException(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n exception,\n hint,\n) {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().captureException(exception, parseEventHintOrCaptureContext(hint));\n}\n\n/**\n * Captures a message event and sends it to Sentry.\n *\n * @param exception The exception to capture.\n * @param captureContext Define the level of the message or pass in additional data to attach to the message.\n * @returns the id of the captured message.\n */\nfunction captureMessage(\n message,\n // eslint-disable-next-line deprecation/deprecation\n captureContext,\n) {\n // This is necessary to provide explicit scopes upgrade, without changing the original\n // arity of the `captureMessage(message, level)` method.\n const level = typeof captureContext === 'string' ? captureContext : undefined;\n const context = typeof captureContext !== 'string' ? { captureContext } : undefined;\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().captureMessage(message, level, context);\n}\n\n/**\n * Captures a manually created event and sends it to Sentry.\n *\n * @param exception The event to send to Sentry.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured event.\n */\nfunction captureEvent(event, hint) {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().captureEvent(event, hint);\n}\n\n/**\n * Callback to set context information onto the scope.\n * @param callback Callback function that receives Scope.\n *\n * @deprecated Use getCurrentScope() directly.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction configureScope(callback) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().configureScope(callback);\n}\n\n/**\n * Records a new breadcrumb which will be attached to future events.\n *\n * Breadcrumbs will be added to subsequent events to provide more context on\n * user's actions prior to an error or crash.\n *\n * @param breadcrumb The breadcrumb to record.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction addBreadcrumb(breadcrumb, hint) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().addBreadcrumb(breadcrumb, hint);\n}\n\n/**\n * Sets context data with the given name.\n * @param name of the context\n * @param context Any kind of data. This data will be normalized.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, deprecation/deprecation\nfunction setContext(name, context) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setContext(name, context);\n}\n\n/**\n * Set an object that will be merged sent as extra data with the event.\n * @param extras Extras object to merge into current context.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction setExtras(extras) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setExtras(extras);\n}\n\n/**\n * Set key:value that will be sent as extra data with the event.\n * @param key String of extra\n * @param extra Any kind of data. This data will be normalized.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction setExtra(key, extra) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setExtra(key, extra);\n}\n\n/**\n * Set an object that will be merged sent as tags data with the event.\n * @param tags Tags context object to merge into current context.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction setTags(tags) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setTags(tags);\n}\n\n/**\n * Set key:value that will be sent as tags data with the event.\n *\n * Can also be used to unset a tag, by passing `undefined`.\n *\n * @param key String key of tag\n * @param value Value of tag\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction setTag(key, value) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setTag(key, value);\n}\n\n/**\n * Updates user context information for future events.\n *\n * @param user User context object to be set in the current context. Pass `null` to unset the user.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction setUser(user) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setUser(user);\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n * pushScope();\n * callback();\n * popScope();\n */\n\n/**\n * Either creates a new active scope, or sets the given scope as active scope in the given callback.\n */\nfunction withScope(\n ...rest\n) {\n // eslint-disable-next-line deprecation/deprecation\n const hub = getCurrentHub();\n\n // If a scope is defined, we want to make this the active scope instead of the default one\n if (rest.length === 2) {\n const [scope, callback] = rest;\n if (!scope) {\n // eslint-disable-next-line deprecation/deprecation\n return hub.withScope(callback);\n }\n\n // eslint-disable-next-line deprecation/deprecation\n return hub.withScope(() => {\n // eslint-disable-next-line deprecation/deprecation\n hub.getStackTop().scope = scope ;\n return callback(scope );\n });\n }\n\n // eslint-disable-next-line deprecation/deprecation\n return hub.withScope(rest[0]);\n}\n\n/**\n * Attempts to fork the current isolation scope and the current scope based on the current async context strategy. If no\n * async context strategy is set, the isolation scope and the current scope will not be forked (this is currently the\n * case, for example, in the browser).\n *\n * Usage of this function in environments without async context strategy is discouraged and may lead to unexpected behaviour.\n *\n * This function is intended for Sentry SDK and SDK integration development. It is not recommended to be used in \"normal\"\n * applications directly because it comes with pitfalls. Use at your own risk!\n *\n * @param callback The callback in which the passed isolation scope is active. (Note: In environments without async\n * context strategy, the currently active isolation scope may change within execution of the callback.)\n * @returns The same value that `callback` returns.\n */\nfunction withIsolationScope(callback) {\n return runWithAsyncContext(() => {\n return callback(getIsolationScope());\n });\n}\n\n/**\n * Forks the current scope and sets the provided span as active span in the context of the provided callback.\n *\n * @param span Spans started in the context of the provided callback will be children of this span.\n * @param callback Execution context in which the provided span will be active. Is passed the newly forked scope.\n * @returns the value returned from the provided callback function.\n */\nfunction withActiveSpan(span, callback) {\n return withScope(scope => {\n // eslint-disable-next-line deprecation/deprecation\n scope.setSpan(span);\n return callback(scope);\n });\n}\n\n/**\n * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.\n *\n * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a\n * new child span within the transaction or any span, call the respective `.startChild()` method.\n *\n * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.\n *\n * The transaction must be finished with a call to its `.end()` method, at which point the transaction with all its\n * finished child spans will be sent to Sentry.\n *\n * NOTE: This function should only be used for *manual* instrumentation. Auto-instrumentation should call\n * `startTransaction` directly on the hub.\n *\n * @param context Properties of the new `Transaction`.\n * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent\n * default values). See {@link Options.tracesSampler}.\n *\n * @returns The transaction which was just started\n *\n * @deprecated Use `startSpan()`, `startSpanManual()` or `startInactiveSpan()` instead.\n */\nfunction startTransaction(\n context,\n customSamplingContext,\n // eslint-disable-next-line deprecation/deprecation\n) {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().startTransaction({ ...context }, customSamplingContext);\n}\n\n/**\n * Create a cron monitor check in and send it to Sentry.\n *\n * @param checkIn An object that describes a check in.\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\nfunction captureCheckIn(checkIn, upsertMonitorConfig) {\n const scope = getCurrentScope();\n const client = getClient();\n if (!client) {\n DEBUG_BUILD && logger.warn('Cannot capture check-in. No client defined.');\n } else if (!client.captureCheckIn) {\n DEBUG_BUILD && logger.warn('Cannot capture check-in. Client does not support sending check-ins.');\n } else {\n return client.captureCheckIn(checkIn, upsertMonitorConfig, scope);\n }\n\n return uuid4();\n}\n\n/**\n * Wraps a callback with a cron monitor check in. The check in will be sent to Sentry when the callback finishes.\n *\n * @param monitorSlug The distinct slug of the monitor.\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\nfunction withMonitor(\n monitorSlug,\n callback,\n upsertMonitorConfig,\n) {\n const checkInId = captureCheckIn({ monitorSlug, status: 'in_progress' }, upsertMonitorConfig);\n const now = timestampInSeconds();\n\n function finishCheckIn(status) {\n captureCheckIn({ monitorSlug, status, checkInId, duration: timestampInSeconds() - now });\n }\n\n let maybePromiseResult;\n try {\n maybePromiseResult = callback();\n } catch (e) {\n finishCheckIn('error');\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n Promise.resolve(maybePromiseResult).then(\n () => {\n finishCheckIn('ok');\n },\n () => {\n finishCheckIn('error');\n },\n );\n } else {\n finishCheckIn('ok');\n }\n\n return maybePromiseResult;\n}\n\n/**\n * Call `flush()` on the current client, if there is one. See {@link Client.flush}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause\n * the client to wait until all events are sent before resolving the promise.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nasync function flush(timeout) {\n const client = getClient();\n if (client) {\n return client.flush(timeout);\n }\n DEBUG_BUILD && logger.warn('Cannot flush events. No client defined.');\n return Promise.resolve(false);\n}\n\n/**\n * Call `close()` on the current client, if there is one. See {@link Client.close}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this\n * parameter will cause the client to wait until all events are sent before disabling itself.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nasync function close(timeout) {\n const client = getClient();\n if (client) {\n return client.close(timeout);\n }\n DEBUG_BUILD && logger.warn('Cannot flush events and disable SDK. No client defined.');\n return Promise.resolve(false);\n}\n\n/**\n * This is the getter for lastEventId.\n *\n * @returns The last event id of a captured event.\n * @deprecated This function will be removed in the next major version of the Sentry SDK.\n */\nfunction lastEventId() {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().lastEventId();\n}\n\n/**\n * Get the currently active client.\n */\nfunction getClient() {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().getClient();\n}\n\n/**\n * Returns true if Sentry has been properly initialized.\n */\nfunction isInitialized() {\n return !!getClient();\n}\n\n/**\n * Get the currently active scope.\n */\nfunction getCurrentScope() {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().getScope();\n}\n\n/**\n * Start a session on the current isolation scope.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns the new active session\n */\nfunction startSession(context) {\n const client = getClient();\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n\n const { release, environment = DEFAULT_ENVIRONMENT } = (client && client.getOptions()) || {};\n\n // Will fetch userAgent if called from browser sdk\n const { userAgent } = GLOBAL_OBJ.navigator || {};\n\n const session = makeSession({\n release,\n environment,\n user: currentScope.getUser() || isolationScope.getUser(),\n ...(userAgent && { userAgent }),\n ...context,\n });\n\n // End existing session if there's one\n const currentSession = isolationScope.getSession();\n if (currentSession && currentSession.status === 'ok') {\n updateSession(currentSession, { status: 'exited' });\n }\n\n endSession();\n\n // Afterwards we set the new session on the scope\n isolationScope.setSession(session);\n\n // TODO (v8): Remove this and only use the isolation scope(?).\n // For v7 though, we can't \"soft-break\" people using getCurrentHub().getScope().setSession()\n currentScope.setSession(session);\n\n return session;\n}\n\n/**\n * End the session on the current isolation scope.\n */\nfunction endSession() {\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n\n const session = currentScope.getSession() || isolationScope.getSession();\n if (session) {\n closeSession(session);\n }\n _sendSessionUpdate();\n\n // the session is over; take it off of the scope\n isolationScope.setSession();\n\n // TODO (v8): Remove this and only use the isolation scope(?).\n // For v7 though, we can't \"soft-break\" people using getCurrentHub().getScope().setSession()\n currentScope.setSession();\n}\n\n/**\n * Sends the current Session on the scope\n */\nfunction _sendSessionUpdate() {\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n const client = getClient();\n // TODO (v8): Remove currentScope and only use the isolation scope(?).\n // For v7 though, we can't \"soft-break\" people using getCurrentHub().getScope().setSession()\n const session = currentScope.getSession() || isolationScope.getSession();\n if (session && client && client.captureSession) {\n client.captureSession(session);\n }\n}\n\n/**\n * Sends the current session on the scope to Sentry\n *\n * @param end If set the session will be marked as exited and removed from the scope.\n * Defaults to `false`.\n */\nfunction captureSession(end = false) {\n // both send the update and pull the session from the scope\n if (end) {\n endSession();\n return;\n }\n\n // only send the update\n _sendSessionUpdate();\n}\n\nexport { addBreadcrumb, captureCheckIn, captureEvent, captureException, captureMessage, captureSession, close, configureScope, endSession, flush, getClient, getCurrentScope, isInitialized, lastEventId, setContext, setExtra, setExtras, setTag, setTags, setUser, startSession, startTransaction, withActiveSpan, withIsolationScope, withMonitor, withScope };\n//# sourceMappingURL=exports.js.map\n","/**\n * Returns the root span of a given span.\n *\n * As long as we use `Transaction`s internally, the returned root span\n * will be a `Transaction` but be aware that this might change in the future.\n *\n * If the given span has no root span or transaction, `undefined` is returned.\n */\nfunction getRootSpan(span) {\n // TODO (v8): Remove this check and just return span\n // eslint-disable-next-line deprecation/deprecation\n return span.transaction;\n}\n\nexport { getRootSpan };\n//# sourceMappingURL=getRootSpan.js.map\n","import { dropUndefinedKeys } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from '../constants.js';\nimport { getClient, getCurrentScope } from '../exports.js';\nimport { getRootSpan } from '../utils/getRootSpan.js';\nimport { spanToJSON, spanIsSampled } from '../utils/spanUtils.js';\n\n/**\n * Creates a dynamic sampling context from a client.\n *\n * Dispatches the `createDsc` lifecycle hook as a side effect.\n */\nfunction getDynamicSamplingContextFromClient(\n trace_id,\n client,\n scope,\n) {\n const options = client.getOptions();\n\n const { publicKey: public_key } = client.getDsn() || {};\n // TODO(v8): Remove segment from User\n // eslint-disable-next-line deprecation/deprecation\n const { segment: user_segment } = (scope && scope.getUser()) || {};\n\n const dsc = dropUndefinedKeys({\n environment: options.environment || DEFAULT_ENVIRONMENT,\n release: options.release,\n user_segment,\n public_key,\n trace_id,\n }) ;\n\n client.emit && client.emit('createDsc', dsc);\n\n return dsc;\n}\n\n/**\n * A Span with a frozen dynamic sampling context.\n */\n\n/**\n * Creates a dynamic sampling context from a span (and client and scope)\n *\n * @param span the span from which a few values like the root span name and sample rate are extracted.\n *\n * @returns a dynamic sampling context\n */\nfunction getDynamicSamplingContextFromSpan(span) {\n const client = getClient();\n if (!client) {\n return {};\n }\n\n // passing emit=false here to only emit later once the DSC is actually populated\n const dsc = getDynamicSamplingContextFromClient(spanToJSON(span).trace_id || '', client, getCurrentScope());\n\n // TODO (v8): Remove v7FrozenDsc as a Transaction will no longer have _frozenDynamicSamplingContext\n const txn = getRootSpan(span) ;\n if (!txn) {\n return dsc;\n }\n\n // TODO (v8): Remove v7FrozenDsc as a Transaction will no longer have _frozenDynamicSamplingContext\n // For now we need to avoid breaking users who directly created a txn with a DSC, where this field is still set.\n // @see Transaction class constructor\n const v7FrozenDsc = txn && txn._frozenDynamicSamplingContext;\n if (v7FrozenDsc) {\n return v7FrozenDsc;\n }\n\n // TODO (v8): Replace txn.metadata with txn.attributes[]\n // We can't do this yet because attributes aren't always set yet.\n // eslint-disable-next-line deprecation/deprecation\n const { sampleRate: maybeSampleRate, source } = txn.metadata;\n if (maybeSampleRate != null) {\n dsc.sample_rate = `${maybeSampleRate}`;\n }\n\n // We don't want to have a transaction name in the DSC if the source is \"url\" because URLs might contain PII\n const jsonSpan = spanToJSON(txn);\n\n // after JSON conversion, txn.name becomes jsonSpan.description\n if (source && source !== 'url') {\n dsc.transaction = jsonSpan.description;\n }\n\n dsc.sampled = String(spanIsSampled(txn));\n\n client.emit && client.emit('createDsc', dsc);\n\n return dsc;\n}\n\nexport { getDynamicSamplingContextFromClient, getDynamicSamplingContextFromSpan };\n//# sourceMappingURL=dynamicSamplingContext.js.map\n","import { dropUndefinedKeys, arrayify } from '@sentry/utils';\nimport { getDynamicSamplingContextFromSpan } from '../tracing/dynamicSamplingContext.js';\nimport { getRootSpan } from './getRootSpan.js';\nimport { spanToTraceContext, spanToJSON } from './spanUtils.js';\n\n/**\n * Applies data from the scope to the event and runs all event processors on it.\n */\nfunction applyScopeDataToEvent(event, data) {\n const { fingerprint, span, breadcrumbs, sdkProcessingMetadata } = data;\n\n // Apply general data\n applyDataToEvent(event, data);\n\n // We want to set the trace context for normal events only if there isn't already\n // a trace context on the event. There is a product feature in place where we link\n // errors with transaction and it relies on that.\n if (span) {\n applySpanToEvent(event, span);\n }\n\n applyFingerprintToEvent(event, fingerprint);\n applyBreadcrumbsToEvent(event, breadcrumbs);\n applySdkMetadataToEvent(event, sdkProcessingMetadata);\n}\n\n/** Merge data of two scopes together. */\nfunction mergeScopeData(data, mergeData) {\n const {\n extra,\n tags,\n user,\n contexts,\n level,\n sdkProcessingMetadata,\n breadcrumbs,\n fingerprint,\n eventProcessors,\n attachments,\n propagationContext,\n // eslint-disable-next-line deprecation/deprecation\n transactionName,\n span,\n } = mergeData;\n\n mergeAndOverwriteScopeData(data, 'extra', extra);\n mergeAndOverwriteScopeData(data, 'tags', tags);\n mergeAndOverwriteScopeData(data, 'user', user);\n mergeAndOverwriteScopeData(data, 'contexts', contexts);\n mergeAndOverwriteScopeData(data, 'sdkProcessingMetadata', sdkProcessingMetadata);\n\n if (level) {\n data.level = level;\n }\n\n if (transactionName) {\n // eslint-disable-next-line deprecation/deprecation\n data.transactionName = transactionName;\n }\n\n if (span) {\n data.span = span;\n }\n\n if (breadcrumbs.length) {\n data.breadcrumbs = [...data.breadcrumbs, ...breadcrumbs];\n }\n\n if (fingerprint.length) {\n data.fingerprint = [...data.fingerprint, ...fingerprint];\n }\n\n if (eventProcessors.length) {\n data.eventProcessors = [...data.eventProcessors, ...eventProcessors];\n }\n\n if (attachments.length) {\n data.attachments = [...data.attachments, ...attachments];\n }\n\n data.propagationContext = { ...data.propagationContext, ...propagationContext };\n}\n\n/**\n * Merges certain scope data. Undefined values will overwrite any existing values.\n * Exported only for tests.\n */\nfunction mergeAndOverwriteScopeData\n\n(data, prop, mergeVal) {\n if (mergeVal && Object.keys(mergeVal).length) {\n // Clone object\n data[prop] = { ...data[prop] };\n for (const key in mergeVal) {\n if (Object.prototype.hasOwnProperty.call(mergeVal, key)) {\n data[prop][key] = mergeVal[key];\n }\n }\n }\n}\n\nfunction applyDataToEvent(event, data) {\n const {\n extra,\n tags,\n user,\n contexts,\n level,\n // eslint-disable-next-line deprecation/deprecation\n transactionName,\n } = data;\n\n const cleanedExtra = dropUndefinedKeys(extra);\n if (cleanedExtra && Object.keys(cleanedExtra).length) {\n event.extra = { ...cleanedExtra, ...event.extra };\n }\n\n const cleanedTags = dropUndefinedKeys(tags);\n if (cleanedTags && Object.keys(cleanedTags).length) {\n event.tags = { ...cleanedTags, ...event.tags };\n }\n\n const cleanedUser = dropUndefinedKeys(user);\n if (cleanedUser && Object.keys(cleanedUser).length) {\n event.user = { ...cleanedUser, ...event.user };\n }\n\n const cleanedContexts = dropUndefinedKeys(contexts);\n if (cleanedContexts && Object.keys(cleanedContexts).length) {\n event.contexts = { ...cleanedContexts, ...event.contexts };\n }\n\n if (level) {\n event.level = level;\n }\n\n if (transactionName) {\n event.transaction = transactionName;\n }\n}\n\nfunction applyBreadcrumbsToEvent(event, breadcrumbs) {\n const mergedBreadcrumbs = [...(event.breadcrumbs || []), ...breadcrumbs];\n event.breadcrumbs = mergedBreadcrumbs.length ? mergedBreadcrumbs : undefined;\n}\n\nfunction applySdkMetadataToEvent(event, sdkProcessingMetadata) {\n event.sdkProcessingMetadata = {\n ...event.sdkProcessingMetadata,\n ...sdkProcessingMetadata,\n };\n}\n\nfunction applySpanToEvent(event, span) {\n event.contexts = { trace: spanToTraceContext(span), ...event.contexts };\n const rootSpan = getRootSpan(span);\n if (rootSpan) {\n event.sdkProcessingMetadata = {\n dynamicSamplingContext: getDynamicSamplingContextFromSpan(span),\n ...event.sdkProcessingMetadata,\n };\n const transactionName = spanToJSON(rootSpan).description;\n if (transactionName) {\n event.tags = { transaction: transactionName, ...event.tags };\n }\n }\n}\n\n/**\n * Applies fingerprint from the scope to the event if there's one,\n * uses message if there's one instead or get rid of empty fingerprint\n */\nfunction applyFingerprintToEvent(event, fingerprint) {\n // Make sure it's an array first and we actually have something in place\n event.fingerprint = event.fingerprint ? arrayify(event.fingerprint) : [];\n\n // If we have something on the scope, then merge it with event\n if (fingerprint) {\n event.fingerprint = event.fingerprint.concat(fingerprint);\n }\n\n // If we have no data at all, remove empty array default\n if (event.fingerprint && !event.fingerprint.length) {\n delete event.fingerprint;\n }\n}\n\nexport { applyScopeDataToEvent, mergeAndOverwriteScopeData, mergeScopeData };\n//# sourceMappingURL=applyScopeDataToEvent.js.map\n","import { isPlainObject, dateTimestampInSeconds, uuid4, logger } from '@sentry/utils';\nimport { getGlobalEventProcessors, notifyEventProcessors } from './eventProcessors.js';\nimport { updateSession } from './session.js';\nimport { applyScopeDataToEvent } from './utils/applyScopeDataToEvent.js';\n\n/**\n * Default value for maximum number of breadcrumbs added to an event.\n */\nconst DEFAULT_MAX_BREADCRUMBS = 100;\n\n/**\n * The global scope is kept in this module.\n * When accessing this via `getGlobalScope()` we'll make sure to set one if none is currently present.\n */\nlet globalScope;\n\n/**\n * Holds additional event information. {@link Scope.applyToEvent} will be\n * called by the client before an event will be sent.\n */\nclass Scope {\n /** Flag if notifying is happening. */\n\n /** Callback for client to receive scope changes. */\n\n /** Callback list that will be called after {@link applyToEvent}. */\n\n /** Array of breadcrumbs. */\n\n /** User */\n\n /** Tags */\n\n /** Extra */\n\n /** Contexts */\n\n /** Attachments */\n\n /** Propagation Context for distributed tracing */\n\n /**\n * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get\n * sent to Sentry\n */\n\n /** Fingerprint */\n\n /** Severity */\n // eslint-disable-next-line deprecation/deprecation\n\n /**\n * Transaction Name\n */\n\n /** Span */\n\n /** Session */\n\n /** Request Mode Session Status */\n\n /** The client on this scope */\n\n // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method.\n\n constructor() {\n this._notifyingListeners = false;\n this._scopeListeners = [];\n this._eventProcessors = [];\n this._breadcrumbs = [];\n this._attachments = [];\n this._user = {};\n this._tags = {};\n this._extra = {};\n this._contexts = {};\n this._sdkProcessingMetadata = {};\n this._propagationContext = generatePropagationContext();\n }\n\n /**\n * Inherit values from the parent scope.\n * @deprecated Use `scope.clone()` and `new Scope()` instead.\n */\n static clone(scope) {\n return scope ? scope.clone() : new Scope();\n }\n\n /**\n * Clone this scope instance.\n */\n clone() {\n const newScope = new Scope();\n newScope._breadcrumbs = [...this._breadcrumbs];\n newScope._tags = { ...this._tags };\n newScope._extra = { ...this._extra };\n newScope._contexts = { ...this._contexts };\n newScope._user = this._user;\n newScope._level = this._level;\n newScope._span = this._span;\n newScope._session = this._session;\n newScope._transactionName = this._transactionName;\n newScope._fingerprint = this._fingerprint;\n newScope._eventProcessors = [...this._eventProcessors];\n newScope._requestSession = this._requestSession;\n newScope._attachments = [...this._attachments];\n newScope._sdkProcessingMetadata = { ...this._sdkProcessingMetadata };\n newScope._propagationContext = { ...this._propagationContext };\n newScope._client = this._client;\n\n return newScope;\n }\n\n /** Update the client on the scope. */\n setClient(client) {\n this._client = client;\n }\n\n /**\n * Get the client assigned to this scope.\n *\n * It is generally recommended to use the global function `Sentry.getClient()` instead, unless you know what you are doing.\n */\n getClient() {\n return this._client;\n }\n\n /**\n * Add internal on change listener. Used for sub SDKs that need to store the scope.\n * @hidden\n */\n addScopeListener(callback) {\n this._scopeListeners.push(callback);\n }\n\n /**\n * @inheritDoc\n */\n addEventProcessor(callback) {\n this._eventProcessors.push(callback);\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setUser(user) {\n // If null is passed we want to unset everything, but still define keys,\n // so that later down in the pipeline any existing values are cleared.\n this._user = user || {\n email: undefined,\n id: undefined,\n ip_address: undefined,\n segment: undefined,\n username: undefined,\n };\n\n if (this._session) {\n updateSession(this._session, { user });\n }\n\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n getUser() {\n return this._user;\n }\n\n /**\n * @inheritDoc\n */\n getRequestSession() {\n return this._requestSession;\n }\n\n /**\n * @inheritDoc\n */\n setRequestSession(requestSession) {\n this._requestSession = requestSession;\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setTags(tags) {\n this._tags = {\n ...this._tags,\n ...tags,\n };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setTag(key, value) {\n this._tags = { ...this._tags, [key]: value };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setExtras(extras) {\n this._extra = {\n ...this._extra,\n ...extras,\n };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setExtra(key, extra) {\n this._extra = { ...this._extra, [key]: extra };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setFingerprint(fingerprint) {\n this._fingerprint = fingerprint;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setLevel(\n // eslint-disable-next-line deprecation/deprecation\n level,\n ) {\n this._level = level;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Sets the transaction name on the scope for future events.\n */\n setTransactionName(name) {\n this._transactionName = name;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setContext(key, context) {\n if (context === null) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._contexts[key];\n } else {\n this._contexts[key] = context;\n }\n\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Sets the Span on the scope.\n * @param span Span\n * @deprecated Instead of setting a span on a scope, use `startSpan()`/`startSpanManual()` instead.\n */\n setSpan(span) {\n this._span = span;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Returns the `Span` if there is one.\n * @deprecated Use `getActiveSpan()` instead.\n */\n getSpan() {\n return this._span;\n }\n\n /**\n * Returns the `Transaction` attached to the scope (if there is one).\n * @deprecated You should not rely on the transaction, but just use `startSpan()` APIs instead.\n */\n getTransaction() {\n // Often, this span (if it exists at all) will be a transaction, but it's not guaranteed to be. Regardless, it will\n // have a pointer to the currently-active transaction.\n const span = this._span;\n // Cannot replace with getRootSpan because getRootSpan returns a span, not a transaction\n // Also, this method will be removed anyway.\n // eslint-disable-next-line deprecation/deprecation\n return span && span.transaction;\n }\n\n /**\n * @inheritDoc\n */\n setSession(session) {\n if (!session) {\n delete this._session;\n } else {\n this._session = session;\n }\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n getSession() {\n return this._session;\n }\n\n /**\n * @inheritDoc\n */\n update(captureContext) {\n if (!captureContext) {\n return this;\n }\n\n const scopeToMerge = typeof captureContext === 'function' ? captureContext(this) : captureContext;\n\n if (scopeToMerge instanceof Scope) {\n const scopeData = scopeToMerge.getScopeData();\n\n this._tags = { ...this._tags, ...scopeData.tags };\n this._extra = { ...this._extra, ...scopeData.extra };\n this._contexts = { ...this._contexts, ...scopeData.contexts };\n if (scopeData.user && Object.keys(scopeData.user).length) {\n this._user = scopeData.user;\n }\n if (scopeData.level) {\n this._level = scopeData.level;\n }\n if (scopeData.fingerprint.length) {\n this._fingerprint = scopeData.fingerprint;\n }\n if (scopeToMerge.getRequestSession()) {\n this._requestSession = scopeToMerge.getRequestSession();\n }\n if (scopeData.propagationContext) {\n this._propagationContext = scopeData.propagationContext;\n }\n } else if (isPlainObject(scopeToMerge)) {\n const scopeContext = captureContext ;\n this._tags = { ...this._tags, ...scopeContext.tags };\n this._extra = { ...this._extra, ...scopeContext.extra };\n this._contexts = { ...this._contexts, ...scopeContext.contexts };\n if (scopeContext.user) {\n this._user = scopeContext.user;\n }\n if (scopeContext.level) {\n this._level = scopeContext.level;\n }\n if (scopeContext.fingerprint) {\n this._fingerprint = scopeContext.fingerprint;\n }\n if (scopeContext.requestSession) {\n this._requestSession = scopeContext.requestSession;\n }\n if (scopeContext.propagationContext) {\n this._propagationContext = scopeContext.propagationContext;\n }\n }\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n clear() {\n this._breadcrumbs = [];\n this._tags = {};\n this._extra = {};\n this._user = {};\n this._contexts = {};\n this._level = undefined;\n this._transactionName = undefined;\n this._fingerprint = undefined;\n this._requestSession = undefined;\n this._span = undefined;\n this._session = undefined;\n this._notifyScopeListeners();\n this._attachments = [];\n this._propagationContext = generatePropagationContext();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n addBreadcrumb(breadcrumb, maxBreadcrumbs) {\n const maxCrumbs = typeof maxBreadcrumbs === 'number' ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS;\n\n // No data has been changed, so don't notify scope listeners\n if (maxCrumbs <= 0) {\n return this;\n }\n\n const mergedBreadcrumb = {\n timestamp: dateTimestampInSeconds(),\n ...breadcrumb,\n };\n\n const breadcrumbs = this._breadcrumbs;\n breadcrumbs.push(mergedBreadcrumb);\n this._breadcrumbs = breadcrumbs.length > maxCrumbs ? breadcrumbs.slice(-maxCrumbs) : breadcrumbs;\n\n this._notifyScopeListeners();\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n getLastBreadcrumb() {\n return this._breadcrumbs[this._breadcrumbs.length - 1];\n }\n\n /**\n * @inheritDoc\n */\n clearBreadcrumbs() {\n this._breadcrumbs = [];\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n addAttachment(attachment) {\n this._attachments.push(attachment);\n return this;\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `getScopeData()` instead.\n */\n getAttachments() {\n const data = this.getScopeData();\n\n return data.attachments;\n }\n\n /**\n * @inheritDoc\n */\n clearAttachments() {\n this._attachments = [];\n return this;\n }\n\n /** @inheritDoc */\n getScopeData() {\n const {\n _breadcrumbs,\n _attachments,\n _contexts,\n _tags,\n _extra,\n _user,\n _level,\n _fingerprint,\n _eventProcessors,\n _propagationContext,\n _sdkProcessingMetadata,\n _transactionName,\n _span,\n } = this;\n\n return {\n breadcrumbs: _breadcrumbs,\n attachments: _attachments,\n contexts: _contexts,\n tags: _tags,\n extra: _extra,\n user: _user,\n level: _level,\n fingerprint: _fingerprint || [],\n eventProcessors: _eventProcessors,\n propagationContext: _propagationContext,\n sdkProcessingMetadata: _sdkProcessingMetadata,\n transactionName: _transactionName,\n span: _span,\n };\n }\n\n /**\n * Applies data from the scope to the event and runs all event processors on it.\n *\n * @param event Event\n * @param hint Object containing additional information about the original exception, for use by the event processors.\n * @hidden\n * @deprecated Use `applyScopeDataToEvent()` directly\n */\n applyToEvent(\n event,\n hint = {},\n additionalEventProcessors = [],\n ) {\n applyScopeDataToEvent(event, this.getScopeData());\n\n // TODO (v8): Update this order to be: Global > Client > Scope\n const eventProcessors = [\n ...additionalEventProcessors,\n // eslint-disable-next-line deprecation/deprecation\n ...getGlobalEventProcessors(),\n ...this._eventProcessors,\n ];\n\n return notifyEventProcessors(eventProcessors, event, hint);\n }\n\n /**\n * Add data which will be accessible during event processing but won't get sent to Sentry\n */\n setSDKProcessingMetadata(newData) {\n this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...newData };\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setPropagationContext(context) {\n this._propagationContext = context;\n return this;\n }\n\n /**\n * @inheritDoc\n */\n getPropagationContext() {\n return this._propagationContext;\n }\n\n /**\n * Capture an exception for this scope.\n *\n * @param exception The exception to capture.\n * @param hint Optinal additional data to attach to the Sentry event.\n * @returns the id of the captured Sentry event.\n */\n captureException(exception, hint) {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture exception!');\n return eventId;\n }\n\n const syntheticException = new Error('Sentry syntheticException');\n\n this._client.captureException(\n exception,\n {\n originalException: exception,\n syntheticException,\n ...hint,\n event_id: eventId,\n },\n this,\n );\n\n return eventId;\n }\n\n /**\n * Capture a message for this scope.\n *\n * @param message The message to capture.\n * @param level An optional severity level to report the message with.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured message.\n */\n captureMessage(message, level, hint) {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture message!');\n return eventId;\n }\n\n const syntheticException = new Error(message);\n\n this._client.captureMessage(\n message,\n level,\n {\n originalException: message,\n syntheticException,\n ...hint,\n event_id: eventId,\n },\n this,\n );\n\n return eventId;\n }\n\n /**\n * Captures a manually created event for this scope and sends it to Sentry.\n *\n * @param exception The event to capture.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured event.\n */\n captureEvent(event, hint) {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture event!');\n return eventId;\n }\n\n this._client.captureEvent(event, { ...hint, event_id: eventId }, this);\n\n return eventId;\n }\n\n /**\n * This will be called on every set call.\n */\n _notifyScopeListeners() {\n // We need this check for this._notifyingListeners to be able to work on scope during updates\n // If this check is not here we'll produce endless recursion when something is done with the scope\n // during the callback.\n if (!this._notifyingListeners) {\n this._notifyingListeners = true;\n this._scopeListeners.forEach(callback => {\n callback(this);\n });\n this._notifyingListeners = false;\n }\n }\n}\n\n/**\n * Get the global scope.\n * This scope is applied to _all_ events.\n */\nfunction getGlobalScope() {\n if (!globalScope) {\n globalScope = new Scope();\n }\n\n return globalScope;\n}\n\n/**\n * This is mainly needed for tests.\n * DO NOT USE this, as this is an internal API and subject to change.\n * @hidden\n */\nfunction setGlobalScope(scope) {\n globalScope = scope;\n}\n\nfunction generatePropagationContext() {\n return {\n traceId: uuid4(),\n spanId: uuid4().substring(16),\n };\n}\n\nexport { Scope, getGlobalScope, setGlobalScope };\n//# sourceMappingURL=scope.js.map\n","const SDK_VERSION = '7.112.2';\n\nexport { SDK_VERSION };\n//# sourceMappingURL=version.js.map\n","import { isThenable, uuid4, dateTimestampInSeconds, consoleSandbox, logger, GLOBAL_OBJ, getGlobalSingleton } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from './constants.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { Scope } from './scope.js';\nimport { closeSession, makeSession, updateSession } from './session.js';\nimport { SDK_VERSION } from './version.js';\n\n/**\n * API compatibility version of this hub.\n *\n * WARNING: This number should only be increased when the global interface\n * changes and new methods are introduced.\n *\n * @hidden\n */\nconst API_VERSION = parseFloat(SDK_VERSION);\n\n/**\n * Default maximum number of breadcrumbs added to an event. Can be overwritten\n * with {@link Options.maxBreadcrumbs}.\n */\nconst DEFAULT_BREADCRUMBS = 100;\n\n/**\n * @deprecated The `Hub` class will be removed in version 8 of the SDK in favour of `Scope` and `Client` objects.\n *\n * If you previously used the `Hub` class directly, replace it with `Scope` and `Client` objects. More information:\n * - [Multiple Sentry Instances](https://docs.sentry.io/platforms/javascript/best-practices/multiple-sentry-instances/)\n * - [Browser Extensions](https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/)\n *\n * Some of our APIs are typed with the Hub class instead of the interface (e.g. `getCurrentHub`). Most of them are deprecated\n * themselves and will also be removed in version 8. More information:\n * - [Migration Guide](https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md#deprecate-hub)\n */\n// eslint-disable-next-line deprecation/deprecation\nclass Hub {\n /** Is a {@link Layer}[] containing the client and scope */\n\n /** Contains the last event id of a captured event. */\n\n /**\n * Creates a new instance of the hub, will push one {@link Layer} into the\n * internal stack on creation.\n *\n * @param client bound to the hub.\n * @param scope bound to the hub.\n * @param version number, higher number means higher priority.\n *\n * @deprecated Instantiation of Hub objects is deprecated and the constructor will be removed in version 8 of the SDK.\n *\n * If you are currently using the Hub for multi-client use like so:\n *\n * ```\n * // OLD\n * const hub = new Hub();\n * hub.bindClient(client);\n * makeMain(hub)\n * ```\n *\n * instead initialize the client as follows:\n *\n * ```\n * // NEW\n * Sentry.withIsolationScope(() => {\n * Sentry.setCurrentClient(client);\n * client.init();\n * });\n * ```\n *\n * If you are using the Hub to capture events like so:\n *\n * ```\n * // OLD\n * const client = new Client();\n * const hub = new Hub(client);\n * hub.captureException()\n * ```\n *\n * instead capture isolated events as follows:\n *\n * ```\n * // NEW\n * const client = new Client();\n * const scope = new Scope();\n * scope.setClient(client);\n * scope.captureException();\n * ```\n */\n constructor(\n client,\n scope,\n isolationScope,\n _version = API_VERSION,\n ) {this._version = _version;\n let assignedScope;\n if (!scope) {\n assignedScope = new Scope();\n assignedScope.setClient(client);\n } else {\n assignedScope = scope;\n }\n\n let assignedIsolationScope;\n if (!isolationScope) {\n assignedIsolationScope = new Scope();\n assignedIsolationScope.setClient(client);\n } else {\n assignedIsolationScope = isolationScope;\n }\n\n this._stack = [{ scope: assignedScope }];\n\n if (client) {\n // eslint-disable-next-line deprecation/deprecation\n this.bindClient(client);\n }\n\n this._isolationScope = assignedIsolationScope;\n }\n\n /**\n * Checks if this hub's version is older than the given version.\n *\n * @param version A version number to compare to.\n * @return True if the given version is newer; otherwise false.\n *\n * @deprecated This will be removed in v8.\n */\n isOlderThan(version) {\n return this._version < version;\n }\n\n /**\n * This binds the given client to the current scope.\n * @param client An SDK client (client) instance.\n *\n * @deprecated Use `initAndBind()` directly, or `setCurrentClient()` and/or `client.init()` instead.\n */\n bindClient(client) {\n // eslint-disable-next-line deprecation/deprecation\n const top = this.getStackTop();\n top.client = client;\n top.scope.setClient(client);\n // eslint-disable-next-line deprecation/deprecation\n if (client && client.setupIntegrations) {\n // eslint-disable-next-line deprecation/deprecation\n client.setupIntegrations();\n }\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `withScope` instead.\n */\n pushScope() {\n // We want to clone the content of prev scope\n // eslint-disable-next-line deprecation/deprecation\n const scope = this.getScope().clone();\n // eslint-disable-next-line deprecation/deprecation\n this.getStack().push({\n // eslint-disable-next-line deprecation/deprecation\n client: this.getClient(),\n scope,\n });\n return scope;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `withScope` instead.\n */\n popScope() {\n // eslint-disable-next-line deprecation/deprecation\n if (this.getStack().length <= 1) return false;\n // eslint-disable-next-line deprecation/deprecation\n return !!this.getStack().pop();\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.withScope()` instead.\n */\n withScope(callback) {\n // eslint-disable-next-line deprecation/deprecation\n const scope = this.pushScope();\n\n let maybePromiseResult;\n try {\n maybePromiseResult = callback(scope);\n } catch (e) {\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n // @ts-expect-error - isThenable returns the wrong type\n return maybePromiseResult.then(\n res => {\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n return res;\n },\n e => {\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n throw e;\n },\n );\n }\n\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n return maybePromiseResult;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.getClient()` instead.\n */\n getClient() {\n // eslint-disable-next-line deprecation/deprecation\n return this.getStackTop().client ;\n }\n\n /**\n * Returns the scope of the top stack.\n *\n * @deprecated Use `Sentry.getCurrentScope()` instead.\n */\n getScope() {\n // eslint-disable-next-line deprecation/deprecation\n return this.getStackTop().scope;\n }\n\n /**\n * @deprecated Use `Sentry.getIsolationScope()` instead.\n */\n getIsolationScope() {\n return this._isolationScope;\n }\n\n /**\n * Returns the scope stack for domains or the process.\n * @deprecated This will be removed in v8.\n */\n getStack() {\n return this._stack;\n }\n\n /**\n * Returns the topmost scope layer in the order domain > local > process.\n * @deprecated This will be removed in v8.\n */\n getStackTop() {\n return this._stack[this._stack.length - 1];\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.captureException()` instead.\n */\n captureException(exception, hint) {\n const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());\n const syntheticException = new Error('Sentry syntheticException');\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().captureException(exception, {\n originalException: exception,\n syntheticException,\n ...hint,\n event_id: eventId,\n });\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.captureMessage()` instead.\n */\n captureMessage(\n message,\n // eslint-disable-next-line deprecation/deprecation\n level,\n hint,\n ) {\n const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());\n const syntheticException = new Error(message);\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().captureMessage(message, level, {\n originalException: message,\n syntheticException,\n ...hint,\n event_id: eventId,\n });\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.captureEvent()` instead.\n */\n captureEvent(event, hint) {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n if (!event.type) {\n this._lastEventId = eventId;\n }\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().captureEvent(event, { ...hint, event_id: eventId });\n return eventId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated This will be removed in v8.\n */\n lastEventId() {\n return this._lastEventId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.addBreadcrumb()` instead.\n */\n addBreadcrumb(breadcrumb, hint) {\n // eslint-disable-next-line deprecation/deprecation\n const { scope, client } = this.getStackTop();\n\n if (!client) return;\n\n const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } =\n (client.getOptions && client.getOptions()) || {};\n\n if (maxBreadcrumbs <= 0) return;\n\n const timestamp = dateTimestampInSeconds();\n const mergedBreadcrumb = { timestamp, ...breadcrumb };\n const finalBreadcrumb = beforeBreadcrumb\n ? (consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) )\n : mergedBreadcrumb;\n\n if (finalBreadcrumb === null) return;\n\n if (client.emit) {\n client.emit('beforeAddBreadcrumb', finalBreadcrumb, hint);\n }\n\n // TODO(v8): I know this comment doesn't make much sense because the hub will be deprecated but I still wanted to\n // write it down. In theory, we would have to add the breadcrumbs to the isolation scope here, however, that would\n // duplicate all of the breadcrumbs. There was the possibility of adding breadcrumbs to both, the isolation scope\n // and the normal scope, and deduplicating it down the line in the event processing pipeline. However, that would\n // have been very fragile, because the breadcrumb objects would have needed to keep their identity all throughout\n // the event processing pipeline.\n // In the new implementation, the top level `Sentry.addBreadcrumb()` should ONLY write to the isolation scope.\n\n scope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setUser()` instead.\n */\n setUser(user) {\n // TODO(v8): The top level `Sentry.setUser()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setUser(user);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setUser(user);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setTags()` instead.\n */\n setTags(tags) {\n // TODO(v8): The top level `Sentry.setTags()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setTags(tags);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setTags(tags);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setExtras()` instead.\n */\n setExtras(extras) {\n // TODO(v8): The top level `Sentry.setExtras()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setExtras(extras);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setExtras(extras);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setTag()` instead.\n */\n setTag(key, value) {\n // TODO(v8): The top level `Sentry.setTag()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setTag(key, value);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setTag(key, value);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setExtra()` instead.\n */\n setExtra(key, extra) {\n // TODO(v8): The top level `Sentry.setExtra()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setExtra(key, extra);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setExtra(key, extra);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setContext()` instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setContext(name, context) {\n // TODO(v8): The top level `Sentry.setContext()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setContext(name, context);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setContext(name, context);\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `getScope()` directly.\n */\n configureScope(callback) {\n // eslint-disable-next-line deprecation/deprecation\n const { scope, client } = this.getStackTop();\n if (client) {\n callback(scope);\n }\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line deprecation/deprecation\n run(callback) {\n // eslint-disable-next-line deprecation/deprecation\n const oldHub = makeMain(this);\n try {\n callback(this);\n } finally {\n // eslint-disable-next-line deprecation/deprecation\n makeMain(oldHub);\n }\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.getClient().getIntegrationByName()` instead.\n */\n getIntegration(integration) {\n // eslint-disable-next-line deprecation/deprecation\n const client = this.getClient();\n if (!client) return null;\n try {\n // eslint-disable-next-line deprecation/deprecation\n return client.getIntegration(integration);\n } catch (_oO) {\n DEBUG_BUILD && logger.warn(`Cannot retrieve integration ${integration.id} from the current Hub`);\n return null;\n }\n }\n\n /**\n * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.\n *\n * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a\n * new child span within the transaction or any span, call the respective `.startChild()` method.\n *\n * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.\n *\n * The transaction must be finished with a call to its `.end()` method, at which point the transaction with all its\n * finished child spans will be sent to Sentry.\n *\n * @param context Properties of the new `Transaction`.\n * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent\n * default values). See {@link Options.tracesSampler}.\n *\n * @returns The transaction which was just started\n *\n * @deprecated Use `startSpan()`, `startSpanManual()` or `startInactiveSpan()` instead.\n */\n startTransaction(context, customSamplingContext) {\n const result = this._callExtensionMethod('startTransaction', context, customSamplingContext);\n\n if (DEBUG_BUILD && !result) {\n // eslint-disable-next-line deprecation/deprecation\n const client = this.getClient();\n if (!client) {\n logger.warn(\n \"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'\",\n );\n } else {\n logger.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n`);\n }\n }\n\n return result;\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `spanToTraceHeader()` instead.\n */\n traceHeaders() {\n return this._callExtensionMethod('traceHeaders');\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use top level `captureSession` instead.\n */\n captureSession(endSession = false) {\n // both send the update and pull the session from the scope\n if (endSession) {\n // eslint-disable-next-line deprecation/deprecation\n return this.endSession();\n }\n\n // only send the update\n this._sendSessionUpdate();\n }\n\n /**\n * @inheritDoc\n * @deprecated Use top level `endSession` instead.\n */\n endSession() {\n // eslint-disable-next-line deprecation/deprecation\n const layer = this.getStackTop();\n const scope = layer.scope;\n const session = scope.getSession();\n if (session) {\n closeSession(session);\n }\n this._sendSessionUpdate();\n\n // the session is over; take it off of the scope\n scope.setSession();\n }\n\n /**\n * @inheritDoc\n * @deprecated Use top level `startSession` instead.\n */\n startSession(context) {\n // eslint-disable-next-line deprecation/deprecation\n const { scope, client } = this.getStackTop();\n const { release, environment = DEFAULT_ENVIRONMENT } = (client && client.getOptions()) || {};\n\n // Will fetch userAgent if called from browser sdk\n const { userAgent } = GLOBAL_OBJ.navigator || {};\n\n const session = makeSession({\n release,\n environment,\n user: scope.getUser(),\n ...(userAgent && { userAgent }),\n ...context,\n });\n\n // End existing session if there's one\n const currentSession = scope.getSession && scope.getSession();\n if (currentSession && currentSession.status === 'ok') {\n updateSession(currentSession, { status: 'exited' });\n }\n // eslint-disable-next-line deprecation/deprecation\n this.endSession();\n\n // Afterwards we set the new session on the scope\n scope.setSession(session);\n\n return session;\n }\n\n /**\n * Returns if default PII should be sent to Sentry and propagated in ourgoing requests\n * when Tracing is used.\n *\n * @deprecated Use top-level `getClient().getOptions().sendDefaultPii` instead. This function\n * only unnecessarily increased API surface but only wrapped accessing the option.\n */\n shouldSendDefaultPii() {\n // eslint-disable-next-line deprecation/deprecation\n const client = this.getClient();\n const options = client && client.getOptions();\n return Boolean(options && options.sendDefaultPii);\n }\n\n /**\n * Sends the current Session on the scope\n */\n _sendSessionUpdate() {\n // eslint-disable-next-line deprecation/deprecation\n const { scope, client } = this.getStackTop();\n\n const session = scope.getSession();\n if (session && client && client.captureSession) {\n client.captureSession(session);\n }\n }\n\n /**\n * Calls global extension method and binding current instance to the function call\n */\n // @ts-expect-error Function lacks ending return statement and return type does not include 'undefined'. ts(2366)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _callExtensionMethod(method, ...args) {\n const carrier = getMainCarrier();\n const sentry = carrier.__SENTRY__;\n if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') {\n return sentry.extensions[method].apply(this, args);\n }\n DEBUG_BUILD && logger.warn(`Extension method ${method} couldn't be found, doing nothing.`);\n }\n}\n\n/**\n * Returns the global shim registry.\n *\n * FIXME: This function is problematic, because despite always returning a valid Carrier,\n * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check\n * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there.\n **/\nfunction getMainCarrier() {\n GLOBAL_OBJ.__SENTRY__ = GLOBAL_OBJ.__SENTRY__ || {\n extensions: {},\n hub: undefined,\n };\n return GLOBAL_OBJ;\n}\n\n/**\n * Replaces the current main hub with the passed one on the global object\n *\n * @returns The old replaced hub\n *\n * @deprecated Use `setCurrentClient()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction makeMain(hub) {\n const registry = getMainCarrier();\n const oldHub = getHubFromCarrier(registry);\n setHubOnCarrier(registry, hub);\n return oldHub;\n}\n\n/**\n * Returns the default hub instance.\n *\n * If a hub is already registered in the global carrier but this module\n * contains a more recent version, it replaces the registered version.\n * Otherwise, the currently registered hub will be returned.\n *\n * @deprecated Use the respective replacement method directly instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction getCurrentHub() {\n // Get main carrier (global for every environment)\n const registry = getMainCarrier();\n\n if (registry.__SENTRY__ && registry.__SENTRY__.acs) {\n const hub = registry.__SENTRY__.acs.getCurrentHub();\n\n if (hub) {\n return hub;\n }\n }\n\n // Return hub that lives on a global object\n return getGlobalHub(registry);\n}\n\n/**\n * Get the currently active isolation scope.\n * The isolation scope is active for the current exection context,\n * meaning that it will remain stable for the same Hub.\n */\nfunction getIsolationScope() {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().getIsolationScope();\n}\n\n// eslint-disable-next-line deprecation/deprecation\nfunction getGlobalHub(registry = getMainCarrier()) {\n // If there's no hub, or its an old API, assign a new one\n\n if (\n !hasHubOnCarrier(registry) ||\n // eslint-disable-next-line deprecation/deprecation\n getHubFromCarrier(registry).isOlderThan(API_VERSION)\n ) {\n // eslint-disable-next-line deprecation/deprecation\n setHubOnCarrier(registry, new Hub());\n }\n\n // Return hub that lives on a global object\n return getHubFromCarrier(registry);\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * If the carrier does not contain a hub, a new hub is created with the global hub client and scope.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction ensureHubOnCarrier(carrier, parent = getGlobalHub()) {\n // If there's no hub on current domain, or it's an old API, assign a new one\n if (\n !hasHubOnCarrier(carrier) ||\n // eslint-disable-next-line deprecation/deprecation\n getHubFromCarrier(carrier).isOlderThan(API_VERSION)\n ) {\n // eslint-disable-next-line deprecation/deprecation\n const client = parent.getClient();\n // eslint-disable-next-line deprecation/deprecation\n const scope = parent.getScope();\n // eslint-disable-next-line deprecation/deprecation\n const isolationScope = parent.getIsolationScope();\n // eslint-disable-next-line deprecation/deprecation\n setHubOnCarrier(carrier, new Hub(client, scope.clone(), isolationScope.clone()));\n }\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * Sets the global async context strategy\n */\nfunction setAsyncContextStrategy(strategy) {\n // Get main carrier (global for every environment)\n const registry = getMainCarrier();\n registry.__SENTRY__ = registry.__SENTRY__ || {};\n registry.__SENTRY__.acs = strategy;\n}\n\n/**\n * Runs the supplied callback in its own async context. Async Context strategies are defined per SDK.\n *\n * @param callback The callback to run in its own async context\n * @param options Options to pass to the async context strategy\n * @returns The result of the callback\n */\nfunction runWithAsyncContext(callback, options = {}) {\n const registry = getMainCarrier();\n\n if (registry.__SENTRY__ && registry.__SENTRY__.acs) {\n return registry.__SENTRY__.acs.runWithAsyncContext(callback, options);\n }\n\n // if there was no strategy, fallback to just calling the callback\n return callback();\n}\n\n/**\n * This will tell whether a carrier has a hub on it or not\n * @param carrier object\n */\nfunction hasHubOnCarrier(carrier) {\n return !!(carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub);\n}\n\n/**\n * This will create a new {@link Hub} and add to the passed object on\n * __SENTRY__.hub.\n * @param carrier object\n * @hidden\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction getHubFromCarrier(carrier) {\n // eslint-disable-next-line deprecation/deprecation\n return getGlobalSingleton('hub', () => new Hub(), carrier);\n}\n\n/**\n * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute\n * @param carrier object\n * @param hub Hub\n * @returns A boolean indicating success or failure\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction setHubOnCarrier(carrier, hub) {\n if (!carrier) return false;\n const __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {});\n __SENTRY__.hub = hub;\n return true;\n}\n\nexport { API_VERSION, Hub, ensureHubOnCarrier, getCurrentHub, getHubFromCarrier, getIsolationScope, getMainCarrier, makeMain, runWithAsyncContext, setAsyncContextStrategy, setHubOnCarrier };\n//# sourceMappingURL=hub.js.map\n","import { extractTraceparentData as extractTraceparentData$1 } from '@sentry/utils';\nexport { stripUrlQueryAndFragment } from '@sentry/utils';\nimport { getCurrentHub } from '../hub.js';\n\n/**\n * Grabs active transaction off scope.\n *\n * @deprecated You should not rely on the transaction, but just use `startSpan()` APIs instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction getActiveTransaction(maybeHub) {\n // eslint-disable-next-line deprecation/deprecation\n const hub = maybeHub || getCurrentHub();\n // eslint-disable-next-line deprecation/deprecation\n const scope = hub.getScope();\n // eslint-disable-next-line deprecation/deprecation\n return scope.getTransaction() ;\n}\n\n/**\n * The `extractTraceparentData` function and `TRACEPARENT_REGEXP` constant used\n * to be declared in this file. It was later moved into `@sentry/utils` as part of a\n * move to remove `@sentry/tracing` dependencies from `@sentry/node` (`extractTraceparentData`\n * is the only tracing function used by `@sentry/node`).\n *\n * These exports are kept here for backwards compatability's sake.\n *\n * See https://github.com/getsentry/sentry-javascript/issues/4642 for more details.\n *\n * @deprecated Import this function from `@sentry/utils` instead\n */\nconst extractTraceparentData = extractTraceparentData$1;\n\nexport { extractTraceparentData, getActiveTransaction };\n//# sourceMappingURL=utils.js.map\n","import { addGlobalErrorInstrumentationHandler, addGlobalUnhandledRejectionInstrumentationHandler, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { getActiveTransaction } from './utils.js';\n\nlet errorsInstrumented = false;\n\n/**\n * Configures global error listeners\n */\nfunction registerErrorInstrumentation() {\n if (errorsInstrumented) {\n return;\n }\n\n errorsInstrumented = true;\n addGlobalErrorInstrumentationHandler(errorCallback);\n addGlobalUnhandledRejectionInstrumentationHandler(errorCallback);\n}\n\n/**\n * If an error or unhandled promise occurs, we mark the active transaction as failed\n */\nfunction errorCallback() {\n // eslint-disable-next-line deprecation/deprecation\n const activeTransaction = getActiveTransaction();\n if (activeTransaction) {\n const status = 'internal_error';\n DEBUG_BUILD && logger.log(`[Tracing] Transaction: ${status} -> Global error occured`);\n activeTransaction.setStatus(status);\n }\n}\n\n// The function name will be lost when bundling but we need to be able to identify this listener later to maintain the\n// node.js default exit behaviour\nerrorCallback.tag = 'sentry_tracingErrorCallback';\n\nexport { registerErrorInstrumentation };\n//# sourceMappingURL=errors.js.map\n","/** The status of an Span.\n *\n * @deprecated Use string literals - if you require type casting, cast to SpanStatusType type\n */\nvar SpanStatus; (function (SpanStatus) {\n /** The operation completed successfully. */\n const Ok = 'ok'; SpanStatus[\"Ok\"] = Ok;\n /** Deadline expired before operation could complete. */\n const DeadlineExceeded = 'deadline_exceeded'; SpanStatus[\"DeadlineExceeded\"] = DeadlineExceeded;\n /** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */\n const Unauthenticated = 'unauthenticated'; SpanStatus[\"Unauthenticated\"] = Unauthenticated;\n /** 403 Forbidden */\n const PermissionDenied = 'permission_denied'; SpanStatus[\"PermissionDenied\"] = PermissionDenied;\n /** 404 Not Found. Some requested entity (file or directory) was not found. */\n const NotFound = 'not_found'; SpanStatus[\"NotFound\"] = NotFound;\n /** 429 Too Many Requests */\n const ResourceExhausted = 'resource_exhausted'; SpanStatus[\"ResourceExhausted\"] = ResourceExhausted;\n /** Client specified an invalid argument. 4xx. */\n const InvalidArgument = 'invalid_argument'; SpanStatus[\"InvalidArgument\"] = InvalidArgument;\n /** 501 Not Implemented */\n const Unimplemented = 'unimplemented'; SpanStatus[\"Unimplemented\"] = Unimplemented;\n /** 503 Service Unavailable */\n const Unavailable = 'unavailable'; SpanStatus[\"Unavailable\"] = Unavailable;\n /** Other/generic 5xx. */\n const InternalError = 'internal_error'; SpanStatus[\"InternalError\"] = InternalError;\n /** Unknown. Any non-standard HTTP status code. */\n const UnknownError = 'unknown_error'; SpanStatus[\"UnknownError\"] = UnknownError;\n /** The operation was cancelled (typically by the user). */\n const Cancelled = 'cancelled'; SpanStatus[\"Cancelled\"] = Cancelled;\n /** Already exists (409) */\n const AlreadyExists = 'already_exists'; SpanStatus[\"AlreadyExists\"] = AlreadyExists;\n /** Operation was rejected because the system is not in a state required for the operation's */\n const FailedPrecondition = 'failed_precondition'; SpanStatus[\"FailedPrecondition\"] = FailedPrecondition;\n /** The operation was aborted, typically due to a concurrency issue. */\n const Aborted = 'aborted'; SpanStatus[\"Aborted\"] = Aborted;\n /** Operation was attempted past the valid range. */\n const OutOfRange = 'out_of_range'; SpanStatus[\"OutOfRange\"] = OutOfRange;\n /** Unrecoverable data loss or corruption */\n const DataLoss = 'data_loss'; SpanStatus[\"DataLoss\"] = DataLoss;\n})(SpanStatus || (SpanStatus = {}));\n\n/**\n * Converts a HTTP status code into a {@link SpanStatusType}.\n *\n * @param httpStatus The HTTP response status code.\n * @returns The span status or unknown_error.\n */\nfunction getSpanStatusFromHttpCode(httpStatus) {\n if (httpStatus < 400 && httpStatus >= 100) {\n return 'ok';\n }\n\n if (httpStatus >= 400 && httpStatus < 500) {\n switch (httpStatus) {\n case 401:\n return 'unauthenticated';\n case 403:\n return 'permission_denied';\n case 404:\n return 'not_found';\n case 409:\n return 'already_exists';\n case 413:\n return 'failed_precondition';\n case 429:\n return 'resource_exhausted';\n default:\n return 'invalid_argument';\n }\n }\n\n if (httpStatus >= 500 && httpStatus < 600) {\n switch (httpStatus) {\n case 501:\n return 'unimplemented';\n case 503:\n return 'unavailable';\n case 504:\n return 'deadline_exceeded';\n default:\n return 'internal_error';\n }\n }\n\n return 'unknown_error';\n}\n\n/**\n * Converts a HTTP status code into a {@link SpanStatusType}.\n *\n * @deprecated Use {@link spanStatusFromHttpCode} instead.\n * This export will be removed in v8 as the signature contains a typo.\n *\n * @param httpStatus The HTTP response status code.\n * @returns The span status or unknown_error.\n */\nconst spanStatusfromHttpCode = getSpanStatusFromHttpCode;\n\n/**\n * Sets the Http status attributes on the current span based on the http code.\n * Additionally, the span's status is updated, depending on the http code.\n */\nfunction setHttpStatus(span, httpStatus) {\n // TODO (v8): Remove these calls\n // Relay does not require us to send the status code as a tag\n // For now, just because users might expect it to land as a tag we keep sending it.\n // Same with data.\n // In v8, we replace both, simply with\n // span.setAttribute('http.response.status_code', httpStatus);\n\n // eslint-disable-next-line deprecation/deprecation\n span.setTag('http.status_code', String(httpStatus));\n // eslint-disable-next-line deprecation/deprecation\n span.setData('http.response.status_code', httpStatus);\n\n const spanStatus = getSpanStatusFromHttpCode(httpStatus);\n if (spanStatus !== 'unknown_error') {\n span.setStatus(spanStatus);\n }\n}\n\nexport { SpanStatus, getSpanStatusFromHttpCode, setHttpStatus, spanStatusfromHttpCode };\n//# sourceMappingURL=spanstatus.js.map\n","import { getClient } from '../exports.js';\n\n// Treeshakable guard to remove all code related to tracing\n\n/**\n * Determines if tracing is currently enabled.\n *\n * Tracing is enabled when at least one of `tracesSampleRate` and `tracesSampler` is defined in the SDK config.\n */\nfunction hasTracingEnabled(\n maybeOptions,\n) {\n if (typeof __SENTRY_TRACING__ === 'boolean' && !__SENTRY_TRACING__) {\n return false;\n }\n\n const client = getClient();\n const options = maybeOptions || (client && client.getOptions());\n return !!options && (options.enableTracing || 'tracesSampleRate' in options || 'tracesSampler' in options);\n}\n\nexport { hasTracingEnabled };\n//# sourceMappingURL=hasTracingEnabled.js.map\n","import { tracingContextFromHeaders, logger, dropUndefinedKeys, addNonEnumerableProperty } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { getCurrentHub, runWithAsyncContext, getIsolationScope } from '../hub.js';\nimport { spanToJSON, spanIsSampled, spanTimeInputToSeconds } from '../utils/spanUtils.js';\nimport './errors.js';\nimport './spanstatus.js';\nimport { getDynamicSamplingContextFromSpan } from './dynamicSamplingContext.js';\nimport { getCurrentScope, withScope } from '../exports.js';\nimport { handleCallbackErrors } from '../utils/handleCallbackErrors.js';\nimport { hasTracingEnabled } from '../utils/hasTracingEnabled.js';\n\n/**\n * Wraps a function with a transaction/span and finishes the span after the function is done.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n *\n * This function is meant to be used internally and may break at any time. Use at your own risk.\n *\n * @internal\n * @private\n *\n * @deprecated Use `startSpan` instead.\n */\nfunction trace(\n context,\n callback,\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onError = () => {},\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n afterFinish = () => {},\n) {\n // eslint-disable-next-line deprecation/deprecation\n const hub = getCurrentHub();\n const scope = getCurrentScope();\n // eslint-disable-next-line deprecation/deprecation\n const parentSpan = scope.getSpan();\n\n const spanContext = normalizeContext(context);\n const activeSpan = createChildSpanOrTransaction(hub, {\n parentSpan,\n spanContext,\n forceTransaction: false,\n scope,\n });\n\n // eslint-disable-next-line deprecation/deprecation\n scope.setSpan(activeSpan);\n\n return handleCallbackErrors(\n () => callback(activeSpan),\n error => {\n activeSpan && activeSpan.setStatus('internal_error');\n onError(error, activeSpan);\n },\n () => {\n activeSpan && activeSpan.end();\n // eslint-disable-next-line deprecation/deprecation\n scope.setSpan(parentSpan);\n afterFinish();\n },\n );\n}\n\n/**\n * Wraps a function with a transaction/span and finishes the span after the function is done.\n * The created span is the active span and will be used as parent by other spans created inside the function\n * and can be accessed via `Sentry.getSpan()`, as long as the function is executed while the scope is active.\n *\n * If you want to create a span that is not set as active, use {@link startInactiveSpan}.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n */\nfunction startSpan(context, callback) {\n const spanContext = normalizeContext(context);\n\n return runWithAsyncContext(() => {\n return withScope(context.scope, scope => {\n // eslint-disable-next-line deprecation/deprecation\n const hub = getCurrentHub();\n // eslint-disable-next-line deprecation/deprecation\n const parentSpan = scope.getSpan();\n\n const shouldSkipSpan = context.onlyIfParent && !parentSpan;\n const activeSpan = shouldSkipSpan\n ? undefined\n : createChildSpanOrTransaction(hub, {\n parentSpan,\n spanContext,\n forceTransaction: context.forceTransaction,\n scope,\n });\n\n return handleCallbackErrors(\n () => callback(activeSpan),\n () => {\n // Only update the span status if it hasn't been changed yet\n if (activeSpan) {\n const { status } = spanToJSON(activeSpan);\n if (!status || status === 'ok') {\n activeSpan.setStatus('internal_error');\n }\n }\n },\n () => activeSpan && activeSpan.end(),\n );\n });\n });\n}\n\n/**\n * @deprecated Use {@link startSpan} instead.\n */\nconst startActiveSpan = startSpan;\n\n/**\n * Similar to `Sentry.startSpan`. Wraps a function with a transaction/span, but does not finish the span\n * after the function is done automatically. You'll have to call `span.end()` manually.\n *\n * The created span is the active span and will be used as parent by other spans created inside the function\n * and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n */\nfunction startSpanManual(\n context,\n callback,\n) {\n const spanContext = normalizeContext(context);\n\n return runWithAsyncContext(() => {\n return withScope(context.scope, scope => {\n // eslint-disable-next-line deprecation/deprecation\n const hub = getCurrentHub();\n // eslint-disable-next-line deprecation/deprecation\n const parentSpan = scope.getSpan();\n\n const shouldSkipSpan = context.onlyIfParent && !parentSpan;\n const activeSpan = shouldSkipSpan\n ? undefined\n : createChildSpanOrTransaction(hub, {\n parentSpan,\n spanContext,\n forceTransaction: context.forceTransaction,\n scope,\n });\n\n function finishAndSetSpan() {\n activeSpan && activeSpan.end();\n }\n\n return handleCallbackErrors(\n () => callback(activeSpan, finishAndSetSpan),\n () => {\n // Only update the span status if it hasn't been changed yet, and the span is not yet finished\n if (activeSpan && activeSpan.isRecording()) {\n const { status } = spanToJSON(activeSpan);\n if (!status || status === 'ok') {\n activeSpan.setStatus('internal_error');\n }\n }\n },\n );\n });\n });\n}\n\n/**\n * Creates a span. This span is not set as active, so will not get automatic instrumentation spans\n * as children or be able to be accessed via `Sentry.getSpan()`.\n *\n * If you want to create a span that is set as active, use {@link startSpan}.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate` or `tracesSampler`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n */\nfunction startInactiveSpan(context) {\n if (!hasTracingEnabled()) {\n return undefined;\n }\n\n const spanContext = normalizeContext(context);\n // eslint-disable-next-line deprecation/deprecation\n const hub = getCurrentHub();\n const parentSpan = context.scope\n ? // eslint-disable-next-line deprecation/deprecation\n context.scope.getSpan()\n : getActiveSpan();\n\n const shouldSkipSpan = context.onlyIfParent && !parentSpan;\n\n if (shouldSkipSpan) {\n return undefined;\n }\n\n const scope = context.scope || getCurrentScope();\n\n // Even though we don't actually want to make this span active on the current scope,\n // we need to make it active on a temporary scope that we use for event processing\n // as otherwise, it won't pick the correct span for the event when processing it\n const temporaryScope = (scope ).clone();\n\n return createChildSpanOrTransaction(hub, {\n parentSpan,\n spanContext,\n forceTransaction: context.forceTransaction,\n scope: temporaryScope,\n });\n}\n\n/**\n * Returns the currently active span.\n */\nfunction getActiveSpan() {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentScope().getSpan();\n}\n\nconst continueTrace = (\n {\n sentryTrace,\n baggage,\n }\n\n,\n callback,\n) => {\n // TODO(v8): Change this function so it doesn't do anything besides setting the propagation context on the current scope:\n /*\n return withScope((scope) => {\n const propagationContext = propagationContextFromHeaders(sentryTrace, baggage);\n scope.setPropagationContext(propagationContext);\n return callback();\n })\n */\n\n const currentScope = getCurrentScope();\n\n // eslint-disable-next-line deprecation/deprecation\n const { traceparentData, dynamicSamplingContext, propagationContext } = tracingContextFromHeaders(\n sentryTrace,\n baggage,\n );\n\n currentScope.setPropagationContext(propagationContext);\n\n if (DEBUG_BUILD && traceparentData) {\n logger.log(`[Tracing] Continuing trace ${traceparentData.traceId}.`);\n }\n\n const transactionContext = {\n ...traceparentData,\n metadata: dropUndefinedKeys({\n dynamicSamplingContext,\n }),\n };\n\n if (!callback) {\n return transactionContext;\n }\n\n return runWithAsyncContext(() => {\n return callback(transactionContext);\n });\n};\n\nfunction createChildSpanOrTransaction(\n // eslint-disable-next-line deprecation/deprecation\n hub,\n {\n parentSpan,\n spanContext,\n forceTransaction,\n scope,\n }\n\n,\n) {\n if (!hasTracingEnabled()) {\n return undefined;\n }\n\n const isolationScope = getIsolationScope();\n\n let span;\n if (parentSpan && !forceTransaction) {\n // eslint-disable-next-line deprecation/deprecation\n span = parentSpan.startChild(spanContext);\n } else if (parentSpan) {\n // If we forced a transaction but have a parent span, make sure to continue from the parent span, not the scope\n const dsc = getDynamicSamplingContextFromSpan(parentSpan);\n const { traceId, spanId: parentSpanId } = parentSpan.spanContext();\n const sampled = spanIsSampled(parentSpan);\n\n // eslint-disable-next-line deprecation/deprecation\n span = hub.startTransaction({\n traceId,\n parentSpanId,\n parentSampled: sampled,\n ...spanContext,\n metadata: {\n dynamicSamplingContext: dsc,\n // eslint-disable-next-line deprecation/deprecation\n ...spanContext.metadata,\n },\n });\n } else {\n const { traceId, dsc, parentSpanId, sampled } = {\n ...isolationScope.getPropagationContext(),\n ...scope.getPropagationContext(),\n };\n\n // eslint-disable-next-line deprecation/deprecation\n span = hub.startTransaction({\n traceId,\n parentSpanId,\n parentSampled: sampled,\n ...spanContext,\n metadata: {\n dynamicSamplingContext: dsc,\n // eslint-disable-next-line deprecation/deprecation\n ...spanContext.metadata,\n },\n });\n }\n\n // We always set this as active span on the scope\n // In the case of this being an inactive span, we ensure to pass a detached scope in here in the first place\n // But by having this here, we can ensure that the lookup through `getCapturedScopesOnSpan` results in the correct scope & span combo\n // eslint-disable-next-line deprecation/deprecation\n scope.setSpan(span);\n\n setCapturedScopesOnSpan(span, scope, isolationScope);\n\n return span;\n}\n\n/**\n * This converts StartSpanOptions to TransactionContext.\n * For the most part (for now) we accept the same options,\n * but some of them need to be transformed.\n *\n * Eventually the StartSpanOptions will be more aligned with OpenTelemetry.\n */\nfunction normalizeContext(context) {\n if (context.startTime) {\n const ctx = { ...context };\n ctx.startTimestamp = spanTimeInputToSeconds(context.startTime);\n delete ctx.startTime;\n return ctx;\n }\n\n return context;\n}\n\nconst SCOPE_ON_START_SPAN_FIELD = '_sentryScope';\nconst ISOLATION_SCOPE_ON_START_SPAN_FIELD = '_sentryIsolationScope';\n\nfunction setCapturedScopesOnSpan(span, scope, isolationScope) {\n if (span) {\n addNonEnumerableProperty(span, ISOLATION_SCOPE_ON_START_SPAN_FIELD, isolationScope);\n addNonEnumerableProperty(span, SCOPE_ON_START_SPAN_FIELD, scope);\n }\n}\n\n/**\n * Grabs the scope and isolation scope off a span that were active when the span was started.\n */\nfunction getCapturedScopesOnSpan(span) {\n return {\n scope: (span )[SCOPE_ON_START_SPAN_FIELD],\n isolationScope: (span )[ISOLATION_SCOPE_ON_START_SPAN_FIELD],\n };\n}\n\nexport { continueTrace, getActiveSpan, getCapturedScopesOnSpan, startActiveSpan, startInactiveSpan, startSpan, startSpanManual, trace };\n//# sourceMappingURL=trace.js.map\n","import { dropUndefinedKeys } from '@sentry/utils';\nimport '../debug-build.js';\nimport '../tracing/errors.js';\nimport '../tracing/spanstatus.js';\nimport { getActiveSpan } from '../tracing/trace.js';\n\n/**\n * key: bucketKey\n * value: [exportKey, MetricSummary]\n */\n\nlet SPAN_METRIC_SUMMARY;\n\nfunction getMetricStorageForSpan(span) {\n return SPAN_METRIC_SUMMARY ? SPAN_METRIC_SUMMARY.get(span) : undefined;\n}\n\n/**\n * Fetches the metric summary if it exists for the passed span\n */\nfunction getMetricSummaryJsonForSpan(span) {\n const storage = getMetricStorageForSpan(span);\n\n if (!storage) {\n return undefined;\n }\n const output = {};\n\n for (const [, [exportKey, summary]] of storage) {\n if (!output[exportKey]) {\n output[exportKey] = [];\n }\n\n output[exportKey].push(dropUndefinedKeys(summary));\n }\n\n return output;\n}\n\n/**\n * Updates the metric summary on the currently active span\n */\nfunction updateMetricSummaryOnActiveSpan(\n metricType,\n sanitizedName,\n value,\n unit,\n tags,\n bucketKey,\n) {\n const span = getActiveSpan();\n if (span) {\n const storage = getMetricStorageForSpan(span) || new Map();\n\n const exportKey = `${metricType}:${sanitizedName}@${unit}`;\n const bucketItem = storage.get(bucketKey);\n\n if (bucketItem) {\n const [, summary] = bucketItem;\n storage.set(bucketKey, [\n exportKey,\n {\n min: Math.min(summary.min, value),\n max: Math.max(summary.max, value),\n count: (summary.count += 1),\n sum: (summary.sum += value),\n tags: summary.tags,\n },\n ]);\n } else {\n storage.set(bucketKey, [\n exportKey,\n {\n min: value,\n max: value,\n count: 1,\n sum: value,\n tags,\n },\n ]);\n }\n\n if (!SPAN_METRIC_SUMMARY) {\n SPAN_METRIC_SUMMARY = new WeakMap();\n }\n\n SPAN_METRIC_SUMMARY.set(span, storage);\n }\n}\n\nexport { getMetricSummaryJsonForSpan, updateMetricSummaryOnActiveSpan };\n//# sourceMappingURL=metric-summary.js.map\n","/**\n * Use this attribute to represent the source of a span.\n * Should be one of: custom, url, route, view, component, task, unknown\n *\n */\nconst SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = 'sentry.source';\n\n/**\n * Use this attribute to represent the sample rate used for a span.\n */\nconst SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = 'sentry.sample_rate';\n\n/**\n * Use this attribute to represent the operation of a span.\n */\nconst SEMANTIC_ATTRIBUTE_SENTRY_OP = 'sentry.op';\n\n/**\n * Use this attribute to represent the origin of a span.\n */\nconst SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = 'sentry.origin';\n\n/**\n * The id of the profile that this span occured in.\n */\nconst SEMANTIC_ATTRIBUTE_PROFILE_ID = 'profile_id';\n\nexport { SEMANTIC_ATTRIBUTE_PROFILE_ID, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE };\n//# sourceMappingURL=semanticAttributes.js.map\n","import { uuid4, timestampInSeconds, logger, dropUndefinedKeys } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { getMetricSummaryJsonForSpan } from '../metrics/metric-summary.js';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_PROFILE_ID } from '../semanticAttributes.js';\nimport { getRootSpan } from '../utils/getRootSpan.js';\nimport { TRACE_FLAG_SAMPLED, TRACE_FLAG_NONE, spanToJSON, spanTimeInputToSeconds, spanToTraceHeader, spanToTraceContext } from '../utils/spanUtils.js';\nimport { setHttpStatus } from './spanstatus.js';\n\n/**\n * Keeps track of finished spans for a given transaction\n * @internal\n * @hideconstructor\n * @hidden\n */\nclass SpanRecorder {\n\n constructor(maxlen = 1000) {\n this._maxlen = maxlen;\n this.spans = [];\n }\n\n /**\n * This is just so that we don't run out of memory while recording a lot\n * of spans. At some point we just stop and flush out the start of the\n * trace tree (i.e.the first n spans with the smallest\n * start_timestamp).\n */\n add(span) {\n if (this.spans.length > this._maxlen) {\n // eslint-disable-next-line deprecation/deprecation\n span.spanRecorder = undefined;\n } else {\n this.spans.push(span);\n }\n }\n}\n\n/**\n * Span contains all data about a span\n */\nclass Span {\n /**\n * Tags for the span.\n * @deprecated Use `spanToJSON(span).atttributes` instead.\n */\n\n /**\n * Data for the span.\n * @deprecated Use `spanToJSON(span).atttributes` instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n /**\n * List of spans that were finalized\n *\n * @deprecated This property will no longer be public. Span recording will be handled internally.\n */\n\n /**\n * @inheritDoc\n * @deprecated Use top level `Sentry.getRootSpan()` instead\n */\n\n /**\n * The instrumenter that created this span.\n *\n * TODO (v8): This can probably be replaced by an `instanceOf` check of the span class.\n * the instrumenter can only be sentry or otel so we can check the span instance\n * to verify which one it is and remove this field entirely.\n *\n * @deprecated This field will be removed.\n */\n\n /** Epoch timestamp in seconds when the span started. */\n\n /** Epoch timestamp in seconds when the span ended. */\n\n /** Internal keeper of the status */\n\n /**\n * You should never call the constructor manually, always use `Sentry.startTransaction()`\n * or call `startChild()` on an existing span.\n * @internal\n * @hideconstructor\n * @hidden\n */\n constructor(spanContext = {}) {\n this._traceId = spanContext.traceId || uuid4();\n this._spanId = spanContext.spanId || uuid4().substring(16);\n this._startTime = spanContext.startTimestamp || timestampInSeconds();\n // eslint-disable-next-line deprecation/deprecation\n this.tags = spanContext.tags ? { ...spanContext.tags } : {};\n // eslint-disable-next-line deprecation/deprecation\n this.data = spanContext.data ? { ...spanContext.data } : {};\n // eslint-disable-next-line deprecation/deprecation\n this.instrumenter = spanContext.instrumenter || 'sentry';\n\n this._attributes = {};\n this.setAttributes({\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanContext.origin || 'manual',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: spanContext.op,\n ...spanContext.attributes,\n });\n\n // eslint-disable-next-line deprecation/deprecation\n this._name = spanContext.name || spanContext.description;\n\n if (spanContext.parentSpanId) {\n this._parentSpanId = spanContext.parentSpanId;\n }\n // We want to include booleans as well here\n if ('sampled' in spanContext) {\n this._sampled = spanContext.sampled;\n }\n if (spanContext.status) {\n this._status = spanContext.status;\n }\n if (spanContext.endTimestamp) {\n this._endTime = spanContext.endTimestamp;\n }\n if (spanContext.exclusiveTime !== undefined) {\n this._exclusiveTime = spanContext.exclusiveTime;\n }\n this._measurements = spanContext.measurements ? { ...spanContext.measurements } : {};\n }\n\n // This rule conflicts with another eslint rule :(\n /* eslint-disable @typescript-eslint/member-ordering */\n\n /**\n * An alias for `description` of the Span.\n * @deprecated Use `spanToJSON(span).description` instead.\n */\n get name() {\n return this._name || '';\n }\n\n /**\n * Update the name of the span.\n * @deprecated Use `spanToJSON(span).description` instead.\n */\n set name(name) {\n this.updateName(name);\n }\n\n /**\n * Get the description of the Span.\n * @deprecated Use `spanToJSON(span).description` instead.\n */\n get description() {\n return this._name;\n }\n\n /**\n * Get the description of the Span.\n * @deprecated Use `spanToJSON(span).description` instead.\n */\n set description(description) {\n this._name = description;\n }\n\n /**\n * The ID of the trace.\n * @deprecated Use `spanContext().traceId` instead.\n */\n get traceId() {\n return this._traceId;\n }\n\n /**\n * The ID of the trace.\n * @deprecated You cannot update the traceId of a span after span creation.\n */\n set traceId(traceId) {\n this._traceId = traceId;\n }\n\n /**\n * The ID of the span.\n * @deprecated Use `spanContext().spanId` instead.\n */\n get spanId() {\n return this._spanId;\n }\n\n /**\n * The ID of the span.\n * @deprecated You cannot update the spanId of a span after span creation.\n */\n set spanId(spanId) {\n this._spanId = spanId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `startSpan` functions instead.\n */\n set parentSpanId(string) {\n this._parentSpanId = string;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `spanToJSON(span).parent_span_id` instead.\n */\n get parentSpanId() {\n return this._parentSpanId;\n }\n\n /**\n * Was this span chosen to be sent as part of the sample?\n * @deprecated Use `isRecording()` instead.\n */\n get sampled() {\n return this._sampled;\n }\n\n /**\n * Was this span chosen to be sent as part of the sample?\n * @deprecated You cannot update the sampling decision of a span after span creation.\n */\n set sampled(sampled) {\n this._sampled = sampled;\n }\n\n /**\n * Attributes for the span.\n * @deprecated Use `spanToJSON(span).atttributes` instead.\n */\n get attributes() {\n return this._attributes;\n }\n\n /**\n * Attributes for the span.\n * @deprecated Use `setAttributes()` instead.\n */\n set attributes(attributes) {\n this._attributes = attributes;\n }\n\n /**\n * Timestamp in seconds (epoch time) indicating when the span started.\n * @deprecated Use `spanToJSON()` instead.\n */\n get startTimestamp() {\n return this._startTime;\n }\n\n /**\n * Timestamp in seconds (epoch time) indicating when the span started.\n * @deprecated In v8, you will not be able to update the span start time after creation.\n */\n set startTimestamp(startTime) {\n this._startTime = startTime;\n }\n\n /**\n * Timestamp in seconds when the span ended.\n * @deprecated Use `spanToJSON()` instead.\n */\n get endTimestamp() {\n return this._endTime;\n }\n\n /**\n * Timestamp in seconds when the span ended.\n * @deprecated Set the end time via `span.end()` instead.\n */\n set endTimestamp(endTime) {\n this._endTime = endTime;\n }\n\n /**\n * The status of the span.\n *\n * @deprecated Use `spanToJSON().status` instead to get the status.\n */\n get status() {\n return this._status;\n }\n\n /**\n * The status of the span.\n *\n * @deprecated Use `.setStatus()` instead to set or update the status.\n */\n set status(status) {\n this._status = status;\n }\n\n /**\n * Operation of the span\n *\n * @deprecated Use `spanToJSON().op` to read the op instead.\n */\n get op() {\n return this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] ;\n }\n\n /**\n * Operation of the span\n *\n * @deprecated Use `startSpan()` functions to set or `span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'op')\n * to update the span instead.\n */\n set op(op) {\n this.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, op);\n }\n\n /**\n * The origin of the span, giving context about what created the span.\n *\n * @deprecated Use `spanToJSON().origin` to read the origin instead.\n */\n get origin() {\n return this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] ;\n }\n\n /**\n * The origin of the span, giving context about what created the span.\n *\n * @deprecated Use `startSpan()` functions to set the origin instead.\n */\n set origin(origin) {\n this.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, origin);\n }\n\n /* eslint-enable @typescript-eslint/member-ordering */\n\n /** @inheritdoc */\n spanContext() {\n const { _spanId: spanId, _traceId: traceId, _sampled: sampled } = this;\n return {\n spanId,\n traceId,\n traceFlags: sampled ? TRACE_FLAG_SAMPLED : TRACE_FLAG_NONE,\n };\n }\n\n /**\n * Creates a new `Span` while setting the current `Span.id` as `parentSpanId`.\n * Also the `sampled` decision will be inherited.\n *\n * @deprecated Use `startSpan()`, `startSpanManual()` or `startInactiveSpan()` instead.\n */\n startChild(\n spanContext,\n ) {\n const childSpan = new Span({\n ...spanContext,\n parentSpanId: this._spanId,\n sampled: this._sampled,\n traceId: this._traceId,\n });\n\n // eslint-disable-next-line deprecation/deprecation\n childSpan.spanRecorder = this.spanRecorder;\n // eslint-disable-next-line deprecation/deprecation\n if (childSpan.spanRecorder) {\n // eslint-disable-next-line deprecation/deprecation\n childSpan.spanRecorder.add(childSpan);\n }\n\n const rootSpan = getRootSpan(this);\n // TODO: still set span.transaction here until we have a more permanent solution\n // Probably similarly to the weakmap we hold in node-experimental\n // eslint-disable-next-line deprecation/deprecation\n childSpan.transaction = rootSpan ;\n\n if (DEBUG_BUILD && rootSpan) {\n const opStr = (spanContext && spanContext.op) || '< unknown op >';\n const nameStr = spanToJSON(childSpan).description || '< unknown name >';\n const idStr = rootSpan.spanContext().spanId;\n\n const logMessage = `[Tracing] Starting '${opStr}' span on transaction '${nameStr}' (${idStr}).`;\n logger.log(logMessage);\n this._logMessage = logMessage;\n }\n\n return childSpan;\n }\n\n /**\n * Sets the tag attribute on the current span.\n *\n * Can also be used to unset a tag, by passing `undefined`.\n *\n * @param key Tag key\n * @param value Tag value\n * @deprecated Use `setAttribute()` instead.\n */\n setTag(key, value) {\n // eslint-disable-next-line deprecation/deprecation\n this.tags = { ...this.tags, [key]: value };\n return this;\n }\n\n /**\n * Sets the data attribute on the current span\n * @param key Data key\n * @param value Data value\n * @deprecated Use `setAttribute()` instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setData(key, value) {\n // eslint-disable-next-line deprecation/deprecation\n this.data = { ...this.data, [key]: value };\n return this;\n }\n\n /** @inheritdoc */\n setAttribute(key, value) {\n if (value === undefined) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._attributes[key];\n } else {\n this._attributes[key] = value;\n }\n }\n\n /** @inheritdoc */\n setAttributes(attributes) {\n Object.keys(attributes).forEach(key => this.setAttribute(key, attributes[key]));\n }\n\n /**\n * @inheritDoc\n */\n setStatus(value) {\n this._status = value;\n return this;\n }\n\n /**\n * @inheritDoc\n * @deprecated Use top-level `setHttpStatus()` instead.\n */\n setHttpStatus(httpStatus) {\n setHttpStatus(this, httpStatus);\n return this;\n }\n\n /**\n * @inheritdoc\n *\n * @deprecated Use `.updateName()` instead.\n */\n setName(name) {\n this.updateName(name);\n }\n\n /**\n * @inheritDoc\n */\n updateName(name) {\n this._name = name;\n return this;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `spanToJSON(span).status === 'ok'` instead.\n */\n isSuccess() {\n return this._status === 'ok';\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `.end()` instead.\n */\n finish(endTimestamp) {\n return this.end(endTimestamp);\n }\n\n /** @inheritdoc */\n end(endTimestamp) {\n // If already ended, skip\n if (this._endTime) {\n return;\n }\n const rootSpan = getRootSpan(this);\n if (\n DEBUG_BUILD &&\n // Don't call this for transactions\n rootSpan &&\n rootSpan.spanContext().spanId !== this._spanId\n ) {\n const logMessage = this._logMessage;\n if (logMessage) {\n logger.log((logMessage ).replace('Starting', 'Finishing'));\n }\n }\n\n this._endTime = spanTimeInputToSeconds(endTimestamp);\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `spanToTraceHeader()` instead.\n */\n toTraceparent() {\n return spanToTraceHeader(this);\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `spanToJSON()` or access the fields directly instead.\n */\n toContext() {\n return dropUndefinedKeys({\n data: this._getData(),\n description: this._name,\n endTimestamp: this._endTime,\n // eslint-disable-next-line deprecation/deprecation\n op: this.op,\n parentSpanId: this._parentSpanId,\n sampled: this._sampled,\n spanId: this._spanId,\n startTimestamp: this._startTime,\n status: this._status,\n // eslint-disable-next-line deprecation/deprecation\n tags: this.tags,\n traceId: this._traceId,\n });\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Update the fields directly instead.\n */\n updateWithContext(spanContext) {\n // eslint-disable-next-line deprecation/deprecation\n this.data = spanContext.data || {};\n // eslint-disable-next-line deprecation/deprecation\n this._name = spanContext.name || spanContext.description;\n this._endTime = spanContext.endTimestamp;\n // eslint-disable-next-line deprecation/deprecation\n this.op = spanContext.op;\n this._parentSpanId = spanContext.parentSpanId;\n this._sampled = spanContext.sampled;\n this._spanId = spanContext.spanId || this._spanId;\n this._startTime = spanContext.startTimestamp || this._startTime;\n this._status = spanContext.status;\n // eslint-disable-next-line deprecation/deprecation\n this.tags = spanContext.tags || {};\n this._traceId = spanContext.traceId || this._traceId;\n\n return this;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `spanToTraceContext()` util function instead.\n */\n getTraceContext() {\n return spanToTraceContext(this);\n }\n\n /**\n * Get JSON representation of this span.\n *\n * @hidden\n * @internal This method is purely for internal purposes and should not be used outside\n * of SDK code. If you need to get a JSON representation of a span,\n * use `spanToJSON(span)` instead.\n */\n getSpanJSON() {\n return dropUndefinedKeys({\n data: this._getData(),\n description: this._name,\n op: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] ,\n parent_span_id: this._parentSpanId,\n span_id: this._spanId,\n start_timestamp: this._startTime,\n status: this._status,\n // eslint-disable-next-line deprecation/deprecation\n tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,\n timestamp: this._endTime,\n trace_id: this._traceId,\n origin: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] ,\n _metrics_summary: getMetricSummaryJsonForSpan(this),\n profile_id: this._attributes[SEMANTIC_ATTRIBUTE_PROFILE_ID] ,\n exclusive_time: this._exclusiveTime,\n measurements: Object.keys(this._measurements).length > 0 ? this._measurements : undefined,\n });\n }\n\n /** @inheritdoc */\n isRecording() {\n return !this._endTime && !!this._sampled;\n }\n\n /**\n * Convert the object to JSON.\n * @deprecated Use `spanToJSON(span)` instead.\n */\n toJSON() {\n return this.getSpanJSON();\n }\n\n /**\n * Get the merged data for this span.\n * For now, this combines `data` and `attributes` together,\n * until eventually we can ingest `attributes` directly.\n */\n _getData()\n\n {\n // eslint-disable-next-line deprecation/deprecation\n const { data, _attributes: attributes } = this;\n\n const hasData = Object.keys(data).length > 0;\n const hasAttributes = Object.keys(attributes).length > 0;\n\n if (!hasData && !hasAttributes) {\n return undefined;\n }\n\n if (hasData && hasAttributes) {\n return {\n ...data,\n ...attributes,\n };\n }\n\n return hasData ? data : attributes;\n }\n}\n\nexport { Span, SpanRecorder };\n//# sourceMappingURL=span.js.map\n","import { dropUndefinedKeys, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { getCurrentHub } from '../hub.js';\nimport { getMetricSummaryJsonForSpan } from '../metrics/metric-summary.js';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE } from '../semanticAttributes.js';\nimport { spanTimeInputToSeconds, spanToJSON, spanToTraceContext } from '../utils/spanUtils.js';\nimport { getDynamicSamplingContextFromSpan } from './dynamicSamplingContext.js';\nimport { Span, SpanRecorder } from './span.js';\nimport { getCapturedScopesOnSpan } from './trace.js';\n\n/** JSDoc */\nclass Transaction extends Span {\n /**\n * The reference to the current hub.\n */\n // eslint-disable-next-line deprecation/deprecation\n\n // DO NOT yet remove this property, it is used in a hack for v7 backwards compatibility.\n\n /**\n * This constructor should never be called manually. Those instrumenting tracing should use\n * `Sentry.startTransaction()`, and internal methods should use `hub.startTransaction()`.\n * @internal\n * @hideconstructor\n * @hidden\n *\n * @deprecated Transactions will be removed in v8. Use spans instead.\n */\n // eslint-disable-next-line deprecation/deprecation\n constructor(transactionContext, hub) {\n super(transactionContext);\n this._contexts = {};\n\n // eslint-disable-next-line deprecation/deprecation\n this._hub = hub || getCurrentHub();\n\n this._name = transactionContext.name || '';\n\n this._metadata = {\n // eslint-disable-next-line deprecation/deprecation\n ...transactionContext.metadata,\n };\n\n this._trimEnd = transactionContext.trimEnd;\n\n // this is because transactions are also spans, and spans have a transaction pointer\n // TODO (v8): Replace this with another way to set the root span\n // eslint-disable-next-line deprecation/deprecation\n this.transaction = this;\n\n // If Dynamic Sampling Context is provided during the creation of the transaction, we freeze it as it usually means\n // there is incoming Dynamic Sampling Context. (Either through an incoming request, a baggage meta-tag, or other means)\n const incomingDynamicSamplingContext = this._metadata.dynamicSamplingContext;\n if (incomingDynamicSamplingContext) {\n // We shallow copy this in case anything writes to the original reference of the passed in `dynamicSamplingContext`\n this._frozenDynamicSamplingContext = { ...incomingDynamicSamplingContext };\n }\n }\n\n // This sadly conflicts with the getter/setter ordering :(\n /* eslint-disable @typescript-eslint/member-ordering */\n\n /**\n * Getter for `name` property.\n * @deprecated Use `spanToJSON(span).description` instead.\n */\n get name() {\n return this._name;\n }\n\n /**\n * Setter for `name` property, which also sets `source` as custom.\n * @deprecated Use `updateName()` and `setMetadata()` instead.\n */\n set name(newName) {\n // eslint-disable-next-line deprecation/deprecation\n this.setName(newName);\n }\n\n /**\n * Get the metadata for this transaction.\n * @deprecated Use `spanGetMetadata(transaction)` instead.\n */\n get metadata() {\n // We merge attributes in for backwards compatibility\n return {\n // Defaults\n // eslint-disable-next-line deprecation/deprecation\n source: 'custom',\n spanMetadata: {},\n\n // Legacy metadata\n ...this._metadata,\n\n // From attributes\n ...(this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] && {\n source: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] ,\n }),\n ...(this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE] && {\n sampleRate: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE] ,\n }),\n };\n }\n\n /**\n * Update the metadata for this transaction.\n * @deprecated Use `spanGetMetadata(transaction)` instead.\n */\n set metadata(metadata) {\n this._metadata = metadata;\n }\n\n /* eslint-enable @typescript-eslint/member-ordering */\n\n /**\n * Setter for `name` property, which also sets `source` on the metadata.\n *\n * @deprecated Use `.updateName()` and `.setAttribute()` instead.\n */\n setName(name, source = 'custom') {\n this._name = name;\n this.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, source);\n }\n\n /** @inheritdoc */\n updateName(name) {\n this._name = name;\n return this;\n }\n\n /**\n * Attaches SpanRecorder to the span itself\n * @param maxlen maximum number of spans that can be recorded\n */\n initSpanRecorder(maxlen = 1000) {\n // eslint-disable-next-line deprecation/deprecation\n if (!this.spanRecorder) {\n // eslint-disable-next-line deprecation/deprecation\n this.spanRecorder = new SpanRecorder(maxlen);\n }\n // eslint-disable-next-line deprecation/deprecation\n this.spanRecorder.add(this);\n }\n\n /**\n * Set the context of a transaction event.\n * @deprecated Use either `.setAttribute()`, or set the context on the scope before creating the transaction.\n */\n setContext(key, context) {\n if (context === null) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._contexts[key];\n } else {\n this._contexts[key] = context;\n }\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use top-level `setMeasurement()` instead.\n */\n setMeasurement(name, value, unit = '') {\n this._measurements[name] = { value, unit };\n }\n\n /**\n * Store metadata on this transaction.\n * @deprecated Use attributes or store data on the scope instead.\n */\n setMetadata(newMetadata) {\n this._metadata = { ...this._metadata, ...newMetadata };\n }\n\n /**\n * @inheritDoc\n */\n end(endTimestamp) {\n const timestampInS = spanTimeInputToSeconds(endTimestamp);\n const transaction = this._finishTransaction(timestampInS);\n if (!transaction) {\n return undefined;\n }\n // eslint-disable-next-line deprecation/deprecation\n return this._hub.captureEvent(transaction);\n }\n\n /**\n * @inheritDoc\n */\n toContext() {\n // eslint-disable-next-line deprecation/deprecation\n const spanContext = super.toContext();\n\n return dropUndefinedKeys({\n ...spanContext,\n name: this._name,\n trimEnd: this._trimEnd,\n });\n }\n\n /**\n * @inheritDoc\n */\n updateWithContext(transactionContext) {\n // eslint-disable-next-line deprecation/deprecation\n super.updateWithContext(transactionContext);\n\n this._name = transactionContext.name || '';\n this._trimEnd = transactionContext.trimEnd;\n\n return this;\n }\n\n /**\n * @inheritdoc\n *\n * @experimental\n *\n * @deprecated Use top-level `getDynamicSamplingContextFromSpan` instead.\n */\n getDynamicSamplingContext() {\n return getDynamicSamplingContextFromSpan(this);\n }\n\n /**\n * Override the current hub with a new one.\n * Used if you want another hub to finish the transaction.\n *\n * @internal\n */\n // eslint-disable-next-line deprecation/deprecation\n setHub(hub) {\n this._hub = hub;\n }\n\n /**\n * Get the profile id of the transaction.\n */\n getProfileId() {\n if (this._contexts !== undefined && this._contexts['profile'] !== undefined) {\n return this._contexts['profile'].profile_id ;\n }\n return undefined;\n }\n\n /**\n * Finish the transaction & prepare the event to send to Sentry.\n */\n _finishTransaction(endTimestamp) {\n // This transaction is already finished, so we should not flush it again.\n if (this._endTime !== undefined) {\n return undefined;\n }\n\n if (!this._name) {\n DEBUG_BUILD && logger.warn('Transaction has no name, falling back to ``.');\n this._name = '';\n }\n\n // just sets the end timestamp\n super.end(endTimestamp);\n\n // eslint-disable-next-line deprecation/deprecation\n const client = this._hub.getClient();\n if (client && client.emit) {\n client.emit('finishTransaction', this);\n }\n\n if (this._sampled !== true) {\n // At this point if `sampled !== true` we want to discard the transaction.\n DEBUG_BUILD && logger.log('[Tracing] Discarding transaction because its trace was not chosen to be sampled.');\n\n if (client) {\n client.recordDroppedEvent('sample_rate', 'transaction');\n }\n\n return undefined;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n const finishedSpans = this.spanRecorder\n ? // eslint-disable-next-line deprecation/deprecation\n this.spanRecorder.spans.filter(span => span !== this && spanToJSON(span).timestamp)\n : [];\n\n if (this._trimEnd && finishedSpans.length > 0) {\n const endTimes = finishedSpans.map(span => spanToJSON(span).timestamp).filter(Boolean) ;\n this._endTime = endTimes.reduce((prev, current) => {\n return prev > current ? prev : current;\n });\n }\n\n const { scope: capturedSpanScope, isolationScope: capturedSpanIsolationScope } = getCapturedScopesOnSpan(this);\n\n // eslint-disable-next-line deprecation/deprecation\n const { metadata } = this;\n // eslint-disable-next-line deprecation/deprecation\n const { source } = metadata;\n\n const transaction = {\n contexts: {\n ...this._contexts,\n // We don't want to override trace context\n trace: spanToTraceContext(this),\n },\n // TODO: Pass spans serialized via `spanToJSON()` here instead in v8.\n spans: finishedSpans,\n start_timestamp: this._startTime,\n // eslint-disable-next-line deprecation/deprecation\n tags: this.tags,\n timestamp: this._endTime,\n transaction: this._name,\n type: 'transaction',\n sdkProcessingMetadata: {\n ...metadata,\n capturedSpanScope,\n capturedSpanIsolationScope,\n ...dropUndefinedKeys({\n dynamicSamplingContext: getDynamicSamplingContextFromSpan(this),\n }),\n },\n _metrics_summary: getMetricSummaryJsonForSpan(this),\n ...(source && {\n transaction_info: {\n source,\n },\n }),\n };\n\n const hasMeasurements = Object.keys(this._measurements).length > 0;\n\n if (hasMeasurements) {\n DEBUG_BUILD &&\n logger.log(\n '[Measurements] Adding measurements to transaction',\n JSON.stringify(this._measurements, undefined, 2),\n );\n transaction.measurements = this._measurements;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n DEBUG_BUILD && logger.log(`[Tracing] Finishing ${this.op} transaction: ${this._name}.`);\n\n return transaction;\n }\n}\n\nexport { Transaction };\n//# sourceMappingURL=transaction.js.map\n","import { logger, timestampInSeconds } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { spanTimeInputToSeconds, spanToJSON } from '../utils/spanUtils.js';\nimport { SpanRecorder } from './span.js';\nimport { Transaction } from './transaction.js';\n\nconst TRACING_DEFAULTS = {\n idleTimeout: 1000,\n finalTimeout: 30000,\n heartbeatInterval: 5000,\n};\n\nconst FINISH_REASON_TAG = 'finishReason';\n\nconst IDLE_TRANSACTION_FINISH_REASONS = [\n 'heartbeatFailed',\n 'idleTimeout',\n 'documentHidden',\n 'finalTimeout',\n 'externalFinish',\n 'cancelled',\n];\n\n/**\n * @inheritDoc\n */\nclass IdleTransactionSpanRecorder extends SpanRecorder {\n constructor(\n _pushActivity,\n _popActivity,\n transactionSpanId,\n maxlen,\n ) {\n super(maxlen);this._pushActivity = _pushActivity;this._popActivity = _popActivity;this.transactionSpanId = transactionSpanId; }\n\n /**\n * @inheritDoc\n */\n add(span) {\n // We should make sure we do not push and pop activities for\n // the transaction that this span recorder belongs to.\n if (span.spanContext().spanId !== this.transactionSpanId) {\n // We patch span.end() to pop an activity after setting an endTimestamp.\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const originalEnd = span.end;\n span.end = (...rest) => {\n this._popActivity(span.spanContext().spanId);\n return originalEnd.apply(span, rest);\n };\n\n // We should only push new activities if the span does not have an end timestamp.\n if (spanToJSON(span).timestamp === undefined) {\n this._pushActivity(span.spanContext().spanId);\n }\n }\n\n super.add(span);\n }\n}\n\n/**\n * An IdleTransaction is a transaction that automatically finishes. It does this by tracking child spans as activities.\n * You can have multiple IdleTransactions active, but if the `onScope` option is specified, the idle transaction will\n * put itself on the scope on creation.\n */\nclass IdleTransaction extends Transaction {\n // Activities store a list of active spans\n\n // Track state of activities in previous heartbeat\n\n // Amount of times heartbeat has counted. Will cause transaction to finish after 3 beats.\n\n // We should not use heartbeat if we finished a transaction\n\n // Idle timeout was canceled and we should finish the transaction with the last span end.\n\n /**\n * Timer that tracks Transaction idleTimeout\n */\n\n /**\n * @deprecated Transactions will be removed in v8. Use spans instead.\n */\n constructor(\n transactionContext,\n // eslint-disable-next-line deprecation/deprecation\n _idleHub,\n /**\n * The time to wait in ms until the idle transaction will be finished. This timer is started each time\n * there are no active spans on this transaction.\n */\n _idleTimeout = TRACING_DEFAULTS.idleTimeout,\n /**\n * The final value in ms that a transaction cannot exceed\n */\n _finalTimeout = TRACING_DEFAULTS.finalTimeout,\n _heartbeatInterval = TRACING_DEFAULTS.heartbeatInterval,\n // Whether or not the transaction should put itself on the scope when it starts and pop itself off when it ends\n _onScope = false,\n /**\n * When set to `true`, will disable the idle timeout (`_idleTimeout` option) and heartbeat mechanisms (`_heartbeatInterval`\n * option) until the `sendAutoFinishSignal()` method is called. The final timeout mechanism (`_finalTimeout` option)\n * will not be affected by this option, meaning the transaction will definitely be finished when the final timeout is\n * reached, no matter what this option is configured to.\n *\n * Defaults to `false`.\n */\n delayAutoFinishUntilSignal = false,\n ) {\n super(transactionContext, _idleHub);this._idleHub = _idleHub;this._idleTimeout = _idleTimeout;this._finalTimeout = _finalTimeout;this._heartbeatInterval = _heartbeatInterval;this._onScope = _onScope;\n this.activities = {};\n this._heartbeatCounter = 0;\n this._finished = false;\n this._idleTimeoutCanceledPermanently = false;\n this._beforeFinishCallbacks = [];\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[4];\n this._autoFinishAllowed = !delayAutoFinishUntilSignal;\n\n if (_onScope) {\n // We set the transaction here on the scope so error events pick up the trace\n // context and attach it to the error.\n DEBUG_BUILD && logger.log(`Setting idle transaction on scope. Span ID: ${this.spanContext().spanId}`);\n // eslint-disable-next-line deprecation/deprecation\n _idleHub.getScope().setSpan(this);\n }\n\n if (!delayAutoFinishUntilSignal) {\n this._restartIdleTimeout();\n }\n\n setTimeout(() => {\n if (!this._finished) {\n this.setStatus('deadline_exceeded');\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[3];\n this.end();\n }\n }, this._finalTimeout);\n }\n\n /** {@inheritDoc} */\n end(endTimestamp) {\n const endTimestampInS = spanTimeInputToSeconds(endTimestamp);\n\n this._finished = true;\n this.activities = {};\n\n // eslint-disable-next-line deprecation/deprecation\n if (this.op === 'ui.action.click') {\n this.setAttribute(FINISH_REASON_TAG, this._finishReason);\n }\n\n // eslint-disable-next-line deprecation/deprecation\n if (this.spanRecorder) {\n DEBUG_BUILD &&\n // eslint-disable-next-line deprecation/deprecation\n logger.log('[Tracing] finishing IdleTransaction', new Date(endTimestampInS * 1000).toISOString(), this.op);\n\n for (const callback of this._beforeFinishCallbacks) {\n callback(this, endTimestampInS);\n }\n\n // eslint-disable-next-line deprecation/deprecation\n this.spanRecorder.spans = this.spanRecorder.spans.filter((span) => {\n // If we are dealing with the transaction itself, we just return it\n if (span.spanContext().spanId === this.spanContext().spanId) {\n return true;\n }\n\n // We cancel all pending spans with status \"cancelled\" to indicate the idle transaction was finished early\n if (!spanToJSON(span).timestamp) {\n span.setStatus('cancelled');\n span.end(endTimestampInS);\n DEBUG_BUILD &&\n logger.log('[Tracing] cancelling span since transaction ended early', JSON.stringify(span, undefined, 2));\n }\n\n const { start_timestamp: startTime, timestamp: endTime } = spanToJSON(span);\n const spanStartedBeforeTransactionFinish = startTime && startTime < endTimestampInS;\n\n // Add a delta with idle timeout so that we prevent false positives\n const timeoutWithMarginOfError = (this._finalTimeout + this._idleTimeout) / 1000;\n const spanEndedBeforeFinalTimeout = endTime && startTime && endTime - startTime < timeoutWithMarginOfError;\n\n if (DEBUG_BUILD) {\n const stringifiedSpan = JSON.stringify(span, undefined, 2);\n if (!spanStartedBeforeTransactionFinish) {\n logger.log('[Tracing] discarding Span since it happened after Transaction was finished', stringifiedSpan);\n } else if (!spanEndedBeforeFinalTimeout) {\n logger.log('[Tracing] discarding Span since it finished after Transaction final timeout', stringifiedSpan);\n }\n }\n\n return spanStartedBeforeTransactionFinish && spanEndedBeforeFinalTimeout;\n });\n\n DEBUG_BUILD && logger.log('[Tracing] flushing IdleTransaction');\n } else {\n DEBUG_BUILD && logger.log('[Tracing] No active IdleTransaction');\n }\n\n // if `this._onScope` is `true`, the transaction put itself on the scope when it started\n if (this._onScope) {\n // eslint-disable-next-line deprecation/deprecation\n const scope = this._idleHub.getScope();\n // eslint-disable-next-line deprecation/deprecation\n if (scope.getTransaction() === this) {\n // eslint-disable-next-line deprecation/deprecation\n scope.setSpan(undefined);\n }\n }\n\n return super.end(endTimestamp);\n }\n\n /**\n * Register a callback function that gets executed before the transaction finishes.\n * Useful for cleanup or if you want to add any additional spans based on current context.\n *\n * This is exposed because users have no other way of running something before an idle transaction\n * finishes.\n */\n registerBeforeFinishCallback(callback) {\n this._beforeFinishCallbacks.push(callback);\n }\n\n /**\n * @inheritDoc\n */\n initSpanRecorder(maxlen) {\n // eslint-disable-next-line deprecation/deprecation\n if (!this.spanRecorder) {\n const pushActivity = (id) => {\n if (this._finished) {\n return;\n }\n this._pushActivity(id);\n };\n const popActivity = (id) => {\n if (this._finished) {\n return;\n }\n this._popActivity(id);\n };\n\n // eslint-disable-next-line deprecation/deprecation\n this.spanRecorder = new IdleTransactionSpanRecorder(pushActivity, popActivity, this.spanContext().spanId, maxlen);\n\n // Start heartbeat so that transactions do not run forever.\n DEBUG_BUILD && logger.log('Starting heartbeat');\n this._pingHeartbeat();\n }\n // eslint-disable-next-line deprecation/deprecation\n this.spanRecorder.add(this);\n }\n\n /**\n * Cancels the existing idle timeout, if there is one.\n * @param restartOnChildSpanChange Default is `true`.\n * If set to false the transaction will end\n * with the last child span.\n */\n cancelIdleTimeout(\n endTimestamp,\n {\n restartOnChildSpanChange,\n }\n\n = {\n restartOnChildSpanChange: true,\n },\n ) {\n this._idleTimeoutCanceledPermanently = restartOnChildSpanChange === false;\n if (this._idleTimeoutID) {\n clearTimeout(this._idleTimeoutID);\n this._idleTimeoutID = undefined;\n\n if (Object.keys(this.activities).length === 0 && this._idleTimeoutCanceledPermanently) {\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[5];\n this.end(endTimestamp);\n }\n }\n }\n\n /**\n * Temporary method used to externally set the transaction's `finishReason`\n *\n * ** WARNING**\n * This is for the purpose of experimentation only and will be removed in the near future, do not use!\n *\n * @internal\n *\n */\n setFinishReason(reason) {\n this._finishReason = reason;\n }\n\n /**\n * Permits the IdleTransaction to automatically end itself via the idle timeout and heartbeat mechanisms when the `delayAutoFinishUntilSignal` option was set to `true`.\n */\n sendAutoFinishSignal() {\n if (!this._autoFinishAllowed) {\n DEBUG_BUILD && logger.log('[Tracing] Received finish signal for idle transaction.');\n this._restartIdleTimeout();\n this._autoFinishAllowed = true;\n }\n }\n\n /**\n * Restarts idle timeout, if there is no running idle timeout it will start one.\n */\n _restartIdleTimeout(endTimestamp) {\n this.cancelIdleTimeout();\n this._idleTimeoutID = setTimeout(() => {\n if (!this._finished && Object.keys(this.activities).length === 0) {\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[1];\n this.end(endTimestamp);\n }\n }, this._idleTimeout);\n }\n\n /**\n * Start tracking a specific activity.\n * @param spanId The span id that represents the activity\n */\n _pushActivity(spanId) {\n this.cancelIdleTimeout(undefined, { restartOnChildSpanChange: !this._idleTimeoutCanceledPermanently });\n DEBUG_BUILD && logger.log(`[Tracing] pushActivity: ${spanId}`);\n this.activities[spanId] = true;\n DEBUG_BUILD && logger.log('[Tracing] new activities count', Object.keys(this.activities).length);\n }\n\n /**\n * Remove an activity from usage\n * @param spanId The span id that represents the activity\n */\n _popActivity(spanId) {\n if (this.activities[spanId]) {\n DEBUG_BUILD && logger.log(`[Tracing] popActivity ${spanId}`);\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this.activities[spanId];\n DEBUG_BUILD && logger.log('[Tracing] new activities count', Object.keys(this.activities).length);\n }\n\n if (Object.keys(this.activities).length === 0) {\n const endTimestamp = timestampInSeconds();\n if (this._idleTimeoutCanceledPermanently) {\n if (this._autoFinishAllowed) {\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[5];\n this.end(endTimestamp);\n }\n } else {\n // We need to add the timeout here to have the real endtimestamp of the transaction\n // Remember timestampInSeconds is in seconds, timeout is in ms\n this._restartIdleTimeout(endTimestamp + this._idleTimeout / 1000);\n }\n }\n }\n\n /**\n * Checks when entries of this.activities are not changing for 3 beats.\n * If this occurs we finish the transaction.\n */\n _beat() {\n // We should not be running heartbeat if the idle transaction is finished.\n if (this._finished) {\n return;\n }\n\n const heartbeatString = Object.keys(this.activities).join('');\n\n if (heartbeatString === this._prevHeartbeatString) {\n this._heartbeatCounter++;\n } else {\n this._heartbeatCounter = 1;\n }\n\n this._prevHeartbeatString = heartbeatString;\n\n if (this._heartbeatCounter >= 3) {\n if (this._autoFinishAllowed) {\n DEBUG_BUILD && logger.log('[Tracing] Transaction finished because of no change for 3 heart beats');\n this.setStatus('deadline_exceeded');\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[0];\n this.end();\n }\n } else {\n this._pingHeartbeat();\n }\n }\n\n /**\n * Pings the heartbeat\n */\n _pingHeartbeat() {\n DEBUG_BUILD && logger.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`);\n setTimeout(() => {\n this._beat();\n }, this._heartbeatInterval);\n }\n}\n\nexport { IdleTransaction, IdleTransactionSpanRecorder, TRACING_DEFAULTS };\n//# sourceMappingURL=idletransaction.js.map\n","import { isNaN, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE } from '../semanticAttributes.js';\nimport { hasTracingEnabled } from '../utils/hasTracingEnabled.js';\nimport { spanToJSON } from '../utils/spanUtils.js';\n\n/**\n * Makes a sampling decision for the given transaction and stores it on the transaction.\n *\n * Called every time a transaction is created. Only transactions which emerge with a `sampled` value of `true` will be\n * sent to Sentry.\n *\n * This method muttes the given `transaction` and will set the `sampled` value on it.\n * It returns the same transaction, for convenience.\n */\nfunction sampleTransaction(\n transaction,\n options,\n samplingContext,\n) {\n // nothing to do if tracing is not enabled\n if (!hasTracingEnabled(options)) {\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // if the user has forced a sampling decision by passing a `sampled` value in their transaction context, go with that\n // eslint-disable-next-line deprecation/deprecation\n if (transaction.sampled !== undefined) {\n // eslint-disable-next-line deprecation/deprecation\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(transaction.sampled));\n return transaction;\n }\n\n // we would have bailed already if neither `tracesSampler` nor `tracesSampleRate` nor `enableTracing` were defined, so one of these should\n // work; prefer the hook if so\n let sampleRate;\n if (typeof options.tracesSampler === 'function') {\n sampleRate = options.tracesSampler(samplingContext);\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(sampleRate));\n } else if (samplingContext.parentSampled !== undefined) {\n sampleRate = samplingContext.parentSampled;\n } else if (typeof options.tracesSampleRate !== 'undefined') {\n sampleRate = options.tracesSampleRate;\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(sampleRate));\n } else {\n // When `enableTracing === true`, we use a sample rate of 100%\n sampleRate = 1;\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, sampleRate);\n }\n\n // Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The\n // only valid values are booleans or numbers between 0 and 1.)\n if (!isValidSampleRate(sampleRate)) {\n DEBUG_BUILD && logger.warn('[Tracing] Discarding transaction because of invalid sample rate.');\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // if the function returned 0 (or false), or if `tracesSampleRate` is 0, it's a sign the transaction should be dropped\n if (!sampleRate) {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Discarding transaction because ${\n typeof options.tracesSampler === 'function'\n ? 'tracesSampler returned 0 or false'\n : 'a negative sampling decision was inherited or tracesSampleRate is set to 0'\n }`,\n );\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is\n // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false.\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = Math.random() < (sampleRate );\n\n // if we're not going to keep it, we're done\n // eslint-disable-next-line deprecation/deprecation\n if (!transaction.sampled) {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(\n sampleRate,\n )})`,\n );\n return transaction;\n }\n\n DEBUG_BUILD &&\n // eslint-disable-next-line deprecation/deprecation\n logger.log(`[Tracing] starting ${transaction.op} transaction - ${spanToJSON(transaction).description}`);\n return transaction;\n}\n\n/**\n * Checks the given sample rate to make sure it is valid type and value (a boolean, or a number between 0 and 1).\n */\nfunction isValidSampleRate(rate) {\n // we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (isNaN(rate) || !(typeof rate === 'number' || typeof rate === 'boolean')) {\n DEBUG_BUILD &&\n logger.warn(\n `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(\n rate,\n )} of type ${JSON.stringify(typeof rate)}.`,\n );\n return false;\n }\n\n // in case sampleRate is a boolean, it will get automatically cast to 1 if it's true and 0 if it's false\n if (rate < 0 || rate > 1) {\n DEBUG_BUILD &&\n logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${rate}.`);\n return false;\n }\n return true;\n}\n\nexport { isValidSampleRate, sampleTransaction };\n//# sourceMappingURL=sampling.js.map\n","import { logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { getMainCarrier } from '../hub.js';\nimport { spanToTraceHeader } from '../utils/spanUtils.js';\nimport { registerErrorInstrumentation } from './errors.js';\nimport { IdleTransaction } from './idletransaction.js';\nimport { sampleTransaction } from './sampling.js';\nimport { Transaction } from './transaction.js';\n\n/** Returns all trace headers that are currently on the top scope. */\n// eslint-disable-next-line deprecation/deprecation\nfunction traceHeaders() {\n // eslint-disable-next-line deprecation/deprecation\n const scope = this.getScope();\n // eslint-disable-next-line deprecation/deprecation\n const span = scope.getSpan();\n\n return span\n ? {\n 'sentry-trace': spanToTraceHeader(span),\n }\n : {};\n}\n\n/**\n * Creates a new transaction and adds a sampling decision if it doesn't yet have one.\n *\n * The Hub.startTransaction method delegates to this method to do its work, passing the Hub instance in as `this`, as if\n * it had been called on the hub directly. Exists as a separate function so that it can be injected into the class as an\n * \"extension method.\"\n *\n * @param this: The Hub starting the transaction\n * @param transactionContext: Data used to configure the transaction\n * @param CustomSamplingContext: Optional data to be provided to the `tracesSampler` function (if any)\n *\n * @returns The new transaction\n *\n * @see {@link Hub.startTransaction}\n */\nfunction _startTransaction(\n // eslint-disable-next-line deprecation/deprecation\n\n transactionContext,\n customSamplingContext,\n) {\n // eslint-disable-next-line deprecation/deprecation\n const client = this.getClient();\n const options = (client && client.getOptions()) || {};\n\n const configInstrumenter = options.instrumenter || 'sentry';\n const transactionInstrumenter = transactionContext.instrumenter || 'sentry';\n\n if (configInstrumenter !== transactionInstrumenter) {\n DEBUG_BUILD &&\n logger.error(\n `A transaction was started with instrumenter=\\`${transactionInstrumenter}\\`, but the SDK is configured with the \\`${configInstrumenter}\\` instrumenter.\nThe transaction will not be sampled. Please use the ${configInstrumenter} instrumentation to start transactions.`,\n );\n\n // eslint-disable-next-line deprecation/deprecation\n transactionContext.sampled = false;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n let transaction = new Transaction(transactionContext, this);\n transaction = sampleTransaction(transaction, options, {\n name: transactionContext.name,\n parentSampled: transactionContext.parentSampled,\n transactionContext,\n attributes: {\n // eslint-disable-next-line deprecation/deprecation\n ...transactionContext.data,\n ...transactionContext.attributes,\n },\n ...customSamplingContext,\n });\n if (transaction.isRecording()) {\n transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans ));\n }\n if (client && client.emit) {\n client.emit('startTransaction', transaction);\n }\n return transaction;\n}\n\n/**\n * Create new idle transaction.\n */\nfunction startIdleTransaction(\n // eslint-disable-next-line deprecation/deprecation\n hub,\n transactionContext,\n idleTimeout,\n finalTimeout,\n onScope,\n customSamplingContext,\n heartbeatInterval,\n delayAutoFinishUntilSignal = false,\n) {\n // eslint-disable-next-line deprecation/deprecation\n const client = hub.getClient();\n const options = (client && client.getOptions()) || {};\n\n // eslint-disable-next-line deprecation/deprecation\n let transaction = new IdleTransaction(\n transactionContext,\n hub,\n idleTimeout,\n finalTimeout,\n heartbeatInterval,\n onScope,\n delayAutoFinishUntilSignal,\n );\n transaction = sampleTransaction(transaction, options, {\n name: transactionContext.name,\n parentSampled: transactionContext.parentSampled,\n transactionContext,\n attributes: {\n // eslint-disable-next-line deprecation/deprecation\n ...transactionContext.data,\n ...transactionContext.attributes,\n },\n ...customSamplingContext,\n });\n if (transaction.isRecording()) {\n transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans ));\n }\n if (client && client.emit) {\n client.emit('startTransaction', transaction);\n }\n return transaction;\n}\n\n/**\n * Adds tracing extensions to the global hub.\n */\nfunction addTracingExtensions() {\n const carrier = getMainCarrier();\n if (!carrier.__SENTRY__) {\n return;\n }\n carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};\n if (!carrier.__SENTRY__.extensions.startTransaction) {\n carrier.__SENTRY__.extensions.startTransaction = _startTransaction;\n }\n if (!carrier.__SENTRY__.extensions.traceHeaders) {\n carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;\n }\n\n registerErrorInstrumentation();\n}\n\nexport { addTracingExtensions, startIdleTransaction };\n//# sourceMappingURL=hubextensions.js.map\n","import { getActiveTransaction } from './utils.js';\n\n/**\n * Adds a measurement to the current active transaction.\n */\nfunction setMeasurement(name, value, unit) {\n // eslint-disable-next-line deprecation/deprecation\n const transaction = getActiveTransaction();\n if (transaction) {\n // eslint-disable-next-line deprecation/deprecation\n transaction.setMeasurement(name, value, unit);\n }\n}\n\nexport { setMeasurement };\n//# sourceMappingURL=measurement.js.map\n","import { getSdkMetadataForEnvelopeHeader, dsnToString, createEnvelope, createEventEnvelopeHeaders } from '@sentry/utils';\n\n/**\n * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.\n * Merge with existing data if any.\n **/\nfunction enhanceEventWithSdkInfo(event, sdkInfo) {\n if (!sdkInfo) {\n return event;\n }\n event.sdk = event.sdk || {};\n event.sdk.name = event.sdk.name || sdkInfo.name;\n event.sdk.version = event.sdk.version || sdkInfo.version;\n event.sdk.integrations = [...(event.sdk.integrations || []), ...(sdkInfo.integrations || [])];\n event.sdk.packages = [...(event.sdk.packages || []), ...(sdkInfo.packages || [])];\n return event;\n}\n\n/** Creates an envelope from a Session */\nfunction createSessionEnvelope(\n session,\n dsn,\n metadata,\n tunnel,\n) {\n const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);\n const envelopeHeaders = {\n sent_at: new Date().toISOString(),\n ...(sdkInfo && { sdk: sdkInfo }),\n ...(!!tunnel && dsn && { dsn: dsnToString(dsn) }),\n };\n\n const envelopeItem =\n 'aggregates' in session ? [{ type: 'sessions' }, session] : [{ type: 'session' }, session.toJSON()];\n\n return createEnvelope(envelopeHeaders, [envelopeItem]);\n}\n\n/**\n * Create an Envelope from an event.\n */\nfunction createEventEnvelope(\n event,\n dsn,\n metadata,\n tunnel,\n) {\n const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);\n\n /*\n Note: Due to TS, event.type may be `replay_event`, theoretically.\n In practice, we never call `createEventEnvelope` with `replay_event` type,\n and we'd have to adjut a looot of types to make this work properly.\n We want to avoid casting this around, as that could lead to bugs (e.g. when we add another type)\n So the safe choice is to really guard against the replay_event type here.\n */\n const eventType = event.type && event.type !== 'replay_event' ? event.type : 'event';\n\n enhanceEventWithSdkInfo(event, metadata && metadata.sdk);\n\n const envelopeHeaders = createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn);\n\n // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to\n // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may\n // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid\n // of this `delete`, lest we miss putting it back in the next time the property is in use.)\n delete event.sdkProcessingMetadata;\n\n const eventItem = [{ type: eventType }, event];\n return createEnvelope(envelopeHeaders, [eventItem]);\n}\n\nexport { createEventEnvelope, createSessionEnvelope };\n//# sourceMappingURL=envelope.js.map\n","import { makeDsn, dsnToString, urlEncode } from '@sentry/utils';\n\nconst SENTRY_API_VERSION = '7';\n\n/** Returns the prefix to construct Sentry ingestion API endpoints. */\nfunction getBaseApiEndpoint(dsn) {\n const protocol = dsn.protocol ? `${dsn.protocol}:` : '';\n const port = dsn.port ? `:${dsn.port}` : '';\n return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`;\n}\n\n/** Returns the ingest API endpoint for target. */\nfunction _getIngestEndpoint(dsn) {\n return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`;\n}\n\n/** Returns a URL-encoded string with auth config suitable for a query string. */\nfunction _encodedAuth(dsn, sdkInfo) {\n return urlEncode({\n // We send only the minimum set of required information. See\n // https://github.com/getsentry/sentry-javascript/issues/2572.\n sentry_key: dsn.publicKey,\n sentry_version: SENTRY_API_VERSION,\n ...(sdkInfo && { sentry_client: `${sdkInfo.name}/${sdkInfo.version}` }),\n });\n}\n\n/**\n * Returns the envelope endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\nfunction getEnvelopeEndpointWithUrlEncodedAuth(\n dsn,\n // TODO (v8): Remove `tunnelOrOptions` in favor of `options`, and use the substitute code below\n // options: ClientOptions = {} as ClientOptions,\n tunnelOrOptions = {} ,\n) {\n // TODO (v8): Use this code instead\n // const { tunnel, _metadata = {} } = options;\n // return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, _metadata.sdk)}`;\n\n const tunnel = typeof tunnelOrOptions === 'string' ? tunnelOrOptions : tunnelOrOptions.tunnel;\n const sdkInfo =\n typeof tunnelOrOptions === 'string' || !tunnelOrOptions._metadata ? undefined : tunnelOrOptions._metadata.sdk;\n\n return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`;\n}\n\n/** Returns the url to the report dialog endpoint. */\nfunction getReportDialogEndpoint(\n dsnLike,\n dialogOptions\n\n,\n) {\n const dsn = makeDsn(dsnLike);\n if (!dsn) {\n return '';\n }\n\n const endpoint = `${getBaseApiEndpoint(dsn)}embed/error-page/`;\n\n let encodedOptions = `dsn=${dsnToString(dsn)}`;\n for (const key in dialogOptions) {\n if (key === 'dsn') {\n continue;\n }\n\n if (key === 'onClose') {\n continue;\n }\n\n if (key === 'user') {\n const user = dialogOptions.user;\n if (!user) {\n continue;\n }\n if (user.name) {\n encodedOptions += `&name=${encodeURIComponent(user.name)}`;\n }\n if (user.email) {\n encodedOptions += `&email=${encodeURIComponent(user.email)}`;\n }\n } else {\n encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key] )}`;\n }\n }\n\n return `${endpoint}?${encodedOptions}`;\n}\n\nexport { getEnvelopeEndpointWithUrlEncodedAuth, getReportDialogEndpoint };\n//# sourceMappingURL=api.js.map\n","import { arrayify, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { addGlobalEventProcessor } from './eventProcessors.js';\nimport { getClient } from './exports.js';\nimport { getCurrentHub } from './hub.js';\n\nconst installedIntegrations = [];\n\n/** Map of integrations assigned to a client */\n\n/**\n * Remove duplicates from the given array, preferring the last instance of any duplicate. Not guaranteed to\n * preseve the order of integrations in the array.\n *\n * @private\n */\nfunction filterDuplicates(integrations) {\n const integrationsByName = {};\n\n integrations.forEach(currentInstance => {\n const { name } = currentInstance;\n\n const existingInstance = integrationsByName[name];\n\n // We want integrations later in the array to overwrite earlier ones of the same type, except that we never want a\n // default instance to overwrite an existing user instance\n if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) {\n return;\n }\n\n integrationsByName[name] = currentInstance;\n });\n\n return Object.keys(integrationsByName).map(k => integrationsByName[k]);\n}\n\n/** Gets integrations to install */\nfunction getIntegrationsToSetup(options) {\n const defaultIntegrations = options.defaultIntegrations || [];\n const userIntegrations = options.integrations;\n\n // We flag default instances, so that later we can tell them apart from any user-created instances of the same class\n defaultIntegrations.forEach(integration => {\n integration.isDefaultInstance = true;\n });\n\n let integrations;\n\n if (Array.isArray(userIntegrations)) {\n integrations = [...defaultIntegrations, ...userIntegrations];\n } else if (typeof userIntegrations === 'function') {\n integrations = arrayify(userIntegrations(defaultIntegrations));\n } else {\n integrations = defaultIntegrations;\n }\n\n const finalIntegrations = filterDuplicates(integrations);\n\n // The `Debug` integration prints copies of the `event` and `hint` which will be passed to `beforeSend` or\n // `beforeSendTransaction`. It therefore has to run after all other integrations, so that the changes of all event\n // processors will be reflected in the printed values. For lack of a more elegant way to guarantee that, we therefore\n // locate it and, assuming it exists, pop it out of its current spot and shove it onto the end of the array.\n const debugIndex = findIndex(finalIntegrations, integration => integration.name === 'Debug');\n if (debugIndex !== -1) {\n const [debugInstance] = finalIntegrations.splice(debugIndex, 1);\n finalIntegrations.push(debugInstance);\n }\n\n return finalIntegrations;\n}\n\n/**\n * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default\n * integrations are added unless they were already provided before.\n * @param integrations array of integration instances\n * @param withDefault should enable default integrations\n */\nfunction setupIntegrations(client, integrations) {\n const integrationIndex = {};\n\n integrations.forEach(integration => {\n // guard against empty provided integrations\n if (integration) {\n setupIntegration(client, integration, integrationIndex);\n }\n });\n\n return integrationIndex;\n}\n\n/**\n * Execute the `afterAllSetup` hooks of the given integrations.\n */\nfunction afterSetupIntegrations(client, integrations) {\n for (const integration of integrations) {\n // guard against empty provided integrations\n if (integration && integration.afterAllSetup) {\n integration.afterAllSetup(client);\n }\n }\n}\n\n/** Setup a single integration. */\nfunction setupIntegration(client, integration, integrationIndex) {\n if (integrationIndex[integration.name]) {\n DEBUG_BUILD && logger.log(`Integration skipped because it was already installed: ${integration.name}`);\n return;\n }\n integrationIndex[integration.name] = integration;\n\n // `setupOnce` is only called the first time\n if (installedIntegrations.indexOf(integration.name) === -1) {\n // eslint-disable-next-line deprecation/deprecation\n integration.setupOnce(addGlobalEventProcessor, getCurrentHub);\n installedIntegrations.push(integration.name);\n }\n\n // `setup` is run for each client\n if (integration.setup && typeof integration.setup === 'function') {\n integration.setup(client);\n }\n\n if (client.on && typeof integration.preprocessEvent === 'function') {\n const callback = integration.preprocessEvent.bind(integration) ;\n client.on('preprocessEvent', (event, hint) => callback(event, hint, client));\n }\n\n if (client.addEventProcessor && typeof integration.processEvent === 'function') {\n const callback = integration.processEvent.bind(integration) ;\n\n const processor = Object.assign((event, hint) => callback(event, hint, client), {\n id: integration.name,\n });\n\n client.addEventProcessor(processor);\n }\n\n DEBUG_BUILD && logger.log(`Integration installed: ${integration.name}`);\n}\n\n/** Add an integration to the current hub's client. */\nfunction addIntegration(integration) {\n const client = getClient();\n\n if (!client || !client.addIntegration) {\n DEBUG_BUILD && logger.warn(`Cannot add integration \"${integration.name}\" because no SDK Client is available.`);\n return;\n }\n\n client.addIntegration(integration);\n}\n\n// Polyfill for Array.findIndex(), which is not supported in ES5\nfunction findIndex(arr, callback) {\n for (let i = 0; i < arr.length; i++) {\n if (callback(arr[i]) === true) {\n return i;\n }\n }\n\n return -1;\n}\n\n/**\n * Convert a new integration function to the legacy class syntax.\n * In v8, we can remove this and instead export the integration functions directly.\n *\n * @deprecated This will be removed in v8!\n */\nfunction convertIntegrationFnToClass(\n name,\n fn,\n) {\n return Object.assign(\n function ConvertedIntegration(...args) {\n return fn(...args);\n },\n { id: name },\n ) ;\n}\n\n/**\n * Define an integration function that can be used to create an integration instance.\n * Note that this by design hides the implementation details of the integration, as they are considered internal.\n */\nfunction defineIntegration(fn) {\n return fn;\n}\n\nexport { addIntegration, afterSetupIntegrations, convertIntegrationFnToClass, defineIntegration, getIntegrationsToSetup, installedIntegrations, setupIntegration, setupIntegrations };\n//# sourceMappingURL=integration.js.map\n","import { dropUndefinedKeys } from '@sentry/utils';\n\n/**\n * Generate bucket key from metric properties.\n */\nfunction getBucketKey(\n metricType,\n name,\n unit,\n tags,\n) {\n const stringifiedTags = Object.entries(dropUndefinedKeys(tags)).sort((a, b) => a[0].localeCompare(b[0]));\n return `${metricType}${name}${unit}${stringifiedTags}`;\n}\n\n/* eslint-disable no-bitwise */\n/**\n * Simple hash function for strings.\n */\nfunction simpleHash(s) {\n let rv = 0;\n for (let i = 0; i < s.length; i++) {\n const c = s.charCodeAt(i);\n rv = (rv << 5) - rv + c;\n rv &= rv;\n }\n return rv >>> 0;\n}\n/* eslint-enable no-bitwise */\n\n/**\n * Serialize metrics buckets into a string based on statsd format.\n *\n * Example of format:\n * metric.name@second:1:1.2|d|#a:value,b:anothervalue|T12345677\n * Segments:\n * name: metric.name\n * unit: second\n * value: [1, 1.2]\n * type of metric: d (distribution)\n * tags: { a: value, b: anothervalue }\n * timestamp: 12345677\n */\nfunction serializeMetricBuckets(metricBucketItems) {\n let out = '';\n for (const item of metricBucketItems) {\n const tagEntries = Object.entries(item.tags);\n const maybeTags = tagEntries.length > 0 ? `|#${tagEntries.map(([key, value]) => `${key}:${value}`).join(',')}` : '';\n out += `${item.name}@${item.unit}:${item.metric}|${item.metricType}${maybeTags}|T${item.timestamp}\\n`;\n }\n return out;\n}\n\n/** Sanitizes units */\nfunction sanitizeUnit(unit) {\n return unit.replace(/[^\\w]+/gi, '_');\n}\n\n/** Sanitizes metric keys */\nfunction sanitizeMetricKey(key) {\n return key.replace(/[^\\w\\-.]+/gi, '_');\n}\n\nfunction sanitizeTagKey(key) {\n return key.replace(/[^\\w\\-./]+/gi, '');\n}\n\nconst tagValueReplacements = [\n ['\\n', '\\\\n'],\n ['\\r', '\\\\r'],\n ['\\t', '\\\\t'],\n ['\\\\', '\\\\\\\\'],\n ['|', '\\\\u{7c}'],\n [',', '\\\\u{2c}'],\n];\n\nfunction getCharOrReplacement(input) {\n for (const [search, replacement] of tagValueReplacements) {\n if (input === search) {\n return replacement;\n }\n }\n\n return input;\n}\n\nfunction sanitizeTagValue(value) {\n return [...value].reduce((acc, char) => acc + getCharOrReplacement(char), '');\n}\n\n/**\n * Sanitizes tags.\n */\nfunction sanitizeTags(unsanitizedTags) {\n const tags = {};\n for (const key in unsanitizedTags) {\n if (Object.prototype.hasOwnProperty.call(unsanitizedTags, key)) {\n const sanitizedKey = sanitizeTagKey(key);\n tags[sanitizedKey] = sanitizeTagValue(String(unsanitizedTags[key]));\n }\n }\n return tags;\n}\n\nexport { getBucketKey, sanitizeMetricKey, sanitizeTags, sanitizeUnit, serializeMetricBuckets, simpleHash };\n//# sourceMappingURL=utils.js.map\n","import { dsnToString, createEnvelope } from '@sentry/utils';\nimport { serializeMetricBuckets } from './utils.js';\n\n/**\n * Create envelope from a metric aggregate.\n */\nfunction createMetricEnvelope(\n metricBucketItems,\n dsn,\n metadata,\n tunnel,\n) {\n const headers = {\n sent_at: new Date().toISOString(),\n };\n\n if (metadata && metadata.sdk) {\n headers.sdk = {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n };\n }\n\n if (!!tunnel && dsn) {\n headers.dsn = dsnToString(dsn);\n }\n\n const item = createMetricEnvelopeItem(metricBucketItems);\n return createEnvelope(headers, [item]);\n}\n\nfunction createMetricEnvelopeItem(metricBucketItems) {\n const payload = serializeMetricBuckets(metricBucketItems);\n const metricHeaders = {\n type: 'statsd',\n length: payload.length,\n };\n return [metricHeaders, payload];\n}\n\nexport { createMetricEnvelope };\n//# sourceMappingURL=envelope.js.map\n","import { makeDsn, logger, checkOrSetAlreadyCaught, isParameterizedString, isPrimitive, resolvedSyncPromise, addItemToEnvelope, createAttachmentEnvelopeItem, SyncPromise, rejectedSyncPromise, SentryError, isThenable, isPlainObject } from '@sentry/utils';\nimport { getEnvelopeEndpointWithUrlEncodedAuth } from './api.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { createEventEnvelope, createSessionEnvelope } from './envelope.js';\nimport { getClient } from './exports.js';\nimport { getIsolationScope } from './hub.js';\nimport { setupIntegration, afterSetupIntegrations, setupIntegrations } from './integration.js';\nimport { createMetricEnvelope } from './metrics/envelope.js';\nimport { updateSession } from './session.js';\nimport { getDynamicSamplingContextFromClient } from './tracing/dynamicSamplingContext.js';\nimport { prepareEvent } from './utils/prepareEvent.js';\n\nconst ALREADY_SEEN_ERROR = \"Not capturing exception because it's already been captured.\";\n\n/**\n * Base implementation for all JavaScript SDK clients.\n *\n * Call the constructor with the corresponding options\n * specific to the client subclass. To access these options later, use\n * {@link Client.getOptions}.\n *\n * If a Dsn is specified in the options, it will be parsed and stored. Use\n * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is\n * invalid, the constructor will throw a {@link SentryException}. Note that\n * without a valid Dsn, the SDK will not send any events to Sentry.\n *\n * Before sending an event, it is passed through\n * {@link BaseClient._prepareEvent} to add SDK information and scope data\n * (breadcrumbs and context). To add more custom information, override this\n * method and extend the resulting prepared event.\n *\n * To issue automatically created events (e.g. via instrumentation), use\n * {@link Client.captureEvent}. It will prepare the event and pass it through\n * the callback lifecycle. To issue auto-breadcrumbs, use\n * {@link Client.addBreadcrumb}.\n *\n * @example\n * class NodeClient extends BaseClient {\n * public constructor(options: NodeOptions) {\n * super(options);\n * }\n *\n * // ...\n * }\n */\nclass BaseClient {\n /**\n * A reference to a metrics aggregator\n *\n * @experimental Note this is alpha API. It may experience breaking changes in the future.\n */\n\n /** Options passed to the SDK. */\n\n /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */\n\n /** Array of set up integrations. */\n\n /** Indicates whether this client's integrations have been set up. */\n\n /** Number of calls being processed */\n\n /** Holds flushable */\n\n // eslint-disable-next-line @typescript-eslint/ban-types\n\n /**\n * Initializes this client instance.\n *\n * @param options Options for the client.\n */\n constructor(options) {\n this._options = options;\n this._integrations = {};\n this._integrationsInitialized = false;\n this._numProcessing = 0;\n this._outcomes = {};\n this._hooks = {};\n this._eventProcessors = [];\n\n if (options.dsn) {\n this._dsn = makeDsn(options.dsn);\n } else {\n DEBUG_BUILD && logger.warn('No DSN provided, client will not send events.');\n }\n\n if (this._dsn) {\n const url = getEnvelopeEndpointWithUrlEncodedAuth(this._dsn, options);\n this._transport = options.transport({\n recordDroppedEvent: this.recordDroppedEvent.bind(this),\n ...options.transportOptions,\n url,\n });\n }\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n captureException(exception, hint, scope) {\n // ensure we haven't captured this very object before\n if (checkOrSetAlreadyCaught(exception)) {\n DEBUG_BUILD && logger.log(ALREADY_SEEN_ERROR);\n return;\n }\n\n let eventId = hint && hint.event_id;\n\n this._process(\n this.eventFromException(exception, hint)\n .then(event => this._captureEvent(event, hint, scope))\n .then(result => {\n eventId = result;\n }),\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n captureMessage(\n message,\n // eslint-disable-next-line deprecation/deprecation\n level,\n hint,\n scope,\n ) {\n let eventId = hint && hint.event_id;\n\n const eventMessage = isParameterizedString(message) ? message : String(message);\n\n const promisedEvent = isPrimitive(message)\n ? this.eventFromMessage(eventMessage, level, hint)\n : this.eventFromException(message, hint);\n\n this._process(\n promisedEvent\n .then(event => this._captureEvent(event, hint, scope))\n .then(result => {\n eventId = result;\n }),\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n captureEvent(event, hint, scope) {\n // ensure we haven't captured this very object before\n if (hint && hint.originalException && checkOrSetAlreadyCaught(hint.originalException)) {\n DEBUG_BUILD && logger.log(ALREADY_SEEN_ERROR);\n return;\n }\n\n let eventId = hint && hint.event_id;\n\n const sdkProcessingMetadata = event.sdkProcessingMetadata || {};\n const capturedSpanScope = sdkProcessingMetadata.capturedSpanScope;\n\n this._process(\n this._captureEvent(event, hint, capturedSpanScope || scope).then(result => {\n eventId = result;\n }),\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n captureSession(session) {\n if (!(typeof session.release === 'string')) {\n DEBUG_BUILD && logger.warn('Discarded session because of missing or non-string release');\n } else {\n this.sendSession(session);\n // After sending, we set init false to indicate it's not the first occurrence\n updateSession(session, { init: false });\n }\n }\n\n /**\n * @inheritDoc\n */\n getDsn() {\n return this._dsn;\n }\n\n /**\n * @inheritDoc\n */\n getOptions() {\n return this._options;\n }\n\n /**\n * @see SdkMetadata in @sentry/types\n *\n * @return The metadata of the SDK\n */\n getSdkMetadata() {\n return this._options._metadata;\n }\n\n /**\n * @inheritDoc\n */\n getTransport() {\n return this._transport;\n }\n\n /**\n * @inheritDoc\n */\n flush(timeout) {\n const transport = this._transport;\n if (transport) {\n if (this.metricsAggregator) {\n this.metricsAggregator.flush();\n }\n return this._isClientDoneProcessing(timeout).then(clientFinished => {\n return transport.flush(timeout).then(transportFlushed => clientFinished && transportFlushed);\n });\n } else {\n return resolvedSyncPromise(true);\n }\n }\n\n /**\n * @inheritDoc\n */\n close(timeout) {\n return this.flush(timeout).then(result => {\n this.getOptions().enabled = false;\n if (this.metricsAggregator) {\n this.metricsAggregator.close();\n }\n return result;\n });\n }\n\n /** Get all installed event processors. */\n getEventProcessors() {\n return this._eventProcessors;\n }\n\n /** @inheritDoc */\n addEventProcessor(eventProcessor) {\n this._eventProcessors.push(eventProcessor);\n }\n\n /**\n * This is an internal function to setup all integrations that should run on the client.\n * @deprecated Use `client.init()` instead.\n */\n setupIntegrations(forceInitialize) {\n if ((forceInitialize && !this._integrationsInitialized) || (this._isEnabled() && !this._integrationsInitialized)) {\n this._setupIntegrations();\n }\n }\n\n /** @inheritdoc */\n init() {\n if (this._isEnabled()) {\n this._setupIntegrations();\n }\n }\n\n /**\n * Gets an installed integration by its `id`.\n *\n * @returns The installed integration or `undefined` if no integration with that `id` was installed.\n * @deprecated Use `getIntegrationByName()` instead.\n */\n getIntegrationById(integrationId) {\n return this.getIntegrationByName(integrationId);\n }\n\n /**\n * Gets an installed integration by its name.\n *\n * @returns The installed integration or `undefined` if no integration with that `name` was installed.\n */\n getIntegrationByName(integrationName) {\n return this._integrations[integrationName] ;\n }\n\n /**\n * Returns the client's instance of the given integration class, it any.\n * @deprecated Use `getIntegrationByName()` instead.\n */\n getIntegration(integration) {\n try {\n return (this._integrations[integration.id] ) || null;\n } catch (_oO) {\n DEBUG_BUILD && logger.warn(`Cannot retrieve integration ${integration.id} from the current Client`);\n return null;\n }\n }\n\n /**\n * @inheritDoc\n */\n addIntegration(integration) {\n const isAlreadyInstalled = this._integrations[integration.name];\n\n // This hook takes care of only installing if not already installed\n setupIntegration(this, integration, this._integrations);\n // Here we need to check manually to make sure to not run this multiple times\n if (!isAlreadyInstalled) {\n afterSetupIntegrations(this, [integration]);\n }\n }\n\n /**\n * @inheritDoc\n */\n sendEvent(event, hint = {}) {\n this.emit('beforeSendEvent', event, hint);\n\n let env = createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel);\n\n for (const attachment of hint.attachments || []) {\n env = addItemToEnvelope(\n env,\n createAttachmentEnvelopeItem(\n attachment,\n this._options.transportOptions && this._options.transportOptions.textEncoder,\n ),\n );\n }\n\n const promise = this._sendEnvelope(env);\n if (promise) {\n promise.then(sendResponse => this.emit('afterSendEvent', event, sendResponse), null);\n }\n }\n\n /**\n * @inheritDoc\n */\n sendSession(session) {\n const env = createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel);\n\n // _sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._sendEnvelope(env);\n }\n\n /**\n * @inheritDoc\n */\n recordDroppedEvent(reason, category, _event) {\n // Note: we use `event` in replay, where we overwrite this hook.\n\n if (this._options.sendClientReports) {\n // We want to track each category (error, transaction, session, replay_event) separately\n // but still keep the distinction between different type of outcomes.\n // We could use nested maps, but it's much easier to read and type this way.\n // A correct type for map-based implementation if we want to go that route\n // would be `Partial>>>`\n // With typescript 4.1 we could even use template literal types\n const key = `${reason}:${category}`;\n DEBUG_BUILD && logger.log(`Adding outcome: \"${key}\"`);\n\n // The following works because undefined + 1 === NaN and NaN is falsy\n this._outcomes[key] = this._outcomes[key] + 1 || 1;\n }\n }\n\n /**\n * @inheritDoc\n */\n captureAggregateMetrics(metricBucketItems) {\n DEBUG_BUILD && logger.log(`Flushing aggregated metrics, number of metrics: ${metricBucketItems.length}`);\n const metricsEnvelope = createMetricEnvelope(\n metricBucketItems,\n this._dsn,\n this._options._metadata,\n this._options.tunnel,\n );\n\n // _sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._sendEnvelope(metricsEnvelope);\n }\n\n // Keep on() & emit() signatures in sync with types' client.ts interface\n /* eslint-disable @typescript-eslint/unified-signatures */\n\n /** @inheritdoc */\n\n /** @inheritdoc */\n on(hook, callback) {\n if (!this._hooks[hook]) {\n this._hooks[hook] = [];\n }\n\n // @ts-expect-error We assue the types are correct\n this._hooks[hook].push(callback);\n }\n\n /** @inheritdoc */\n\n /** @inheritdoc */\n emit(hook, ...rest) {\n if (this._hooks[hook]) {\n this._hooks[hook].forEach(callback => callback(...rest));\n }\n }\n\n /* eslint-enable @typescript-eslint/unified-signatures */\n\n /** Setup integrations for this client. */\n _setupIntegrations() {\n const { integrations } = this._options;\n this._integrations = setupIntegrations(this, integrations);\n afterSetupIntegrations(this, integrations);\n\n // TODO v8: We don't need this flag anymore\n this._integrationsInitialized = true;\n }\n\n /** Updates existing session based on the provided event */\n _updateSessionFromEvent(session, event) {\n let crashed = false;\n let errored = false;\n const exceptions = event.exception && event.exception.values;\n\n if (exceptions) {\n errored = true;\n\n for (const ex of exceptions) {\n const mechanism = ex.mechanism;\n if (mechanism && mechanism.handled === false) {\n crashed = true;\n break;\n }\n }\n }\n\n // A session is updated and that session update is sent in only one of the two following scenarios:\n // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update\n // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update\n const sessionNonTerminal = session.status === 'ok';\n const shouldUpdateAndSend = (sessionNonTerminal && session.errors === 0) || (sessionNonTerminal && crashed);\n\n if (shouldUpdateAndSend) {\n updateSession(session, {\n ...(crashed && { status: 'crashed' }),\n errors: session.errors || Number(errored || crashed),\n });\n this.captureSession(session);\n }\n }\n\n /**\n * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying\n * \"no\" (resolving to `false`) in order to give the client a chance to potentially finish first.\n *\n * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not\n * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to\n * `true`.\n * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and\n * `false` otherwise\n */\n _isClientDoneProcessing(timeout) {\n return new SyncPromise(resolve => {\n let ticked = 0;\n const tick = 1;\n\n const interval = setInterval(() => {\n if (this._numProcessing == 0) {\n clearInterval(interval);\n resolve(true);\n } else {\n ticked += tick;\n if (timeout && ticked >= timeout) {\n clearInterval(interval);\n resolve(false);\n }\n }\n }, tick);\n });\n }\n\n /** Determines whether this SDK is enabled and a transport is present. */\n _isEnabled() {\n return this.getOptions().enabled !== false && this._transport !== undefined;\n }\n\n /**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n */\n _prepareEvent(\n event,\n hint,\n scope,\n isolationScope = getIsolationScope(),\n ) {\n const options = this.getOptions();\n const integrations = Object.keys(this._integrations);\n if (!hint.integrations && integrations.length > 0) {\n hint.integrations = integrations;\n }\n\n this.emit('preprocessEvent', event, hint);\n\n return prepareEvent(options, event, hint, scope, this, isolationScope).then(evt => {\n if (evt === null) {\n return evt;\n }\n\n const propagationContext = {\n ...isolationScope.getPropagationContext(),\n ...(scope ? scope.getPropagationContext() : undefined),\n };\n\n const trace = evt.contexts && evt.contexts.trace;\n if (!trace && propagationContext) {\n const { traceId: trace_id, spanId, parentSpanId, dsc } = propagationContext;\n evt.contexts = {\n trace: {\n trace_id,\n span_id: spanId,\n parent_span_id: parentSpanId,\n },\n ...evt.contexts,\n };\n\n const dynamicSamplingContext = dsc ? dsc : getDynamicSamplingContextFromClient(trace_id, this, scope);\n\n evt.sdkProcessingMetadata = {\n dynamicSamplingContext,\n ...evt.sdkProcessingMetadata,\n };\n }\n return evt;\n });\n }\n\n /**\n * Processes the event and logs an error in case of rejection\n * @param event\n * @param hint\n * @param scope\n */\n _captureEvent(event, hint = {}, scope) {\n return this._processEvent(event, hint, scope).then(\n finalEvent => {\n return finalEvent.event_id;\n },\n reason => {\n if (DEBUG_BUILD) {\n // If something's gone wrong, log the error as a warning. If it's just us having used a `SentryError` for\n // control flow, log just the message (no stack) as a log-level log.\n const sentryError = reason ;\n if (sentryError.logLevel === 'log') {\n logger.log(sentryError.message);\n } else {\n logger.warn(sentryError);\n }\n }\n return undefined;\n },\n );\n }\n\n /**\n * Processes an event (either error or message) and sends it to Sentry.\n *\n * This also adds breadcrumbs and context information to the event. However,\n * platform specific meta data (such as the User's IP address) must be added\n * by the SDK implementor.\n *\n *\n * @param event The event to send to Sentry.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.\n */\n _processEvent(event, hint, scope) {\n const options = this.getOptions();\n const { sampleRate } = options;\n\n const isTransaction = isTransactionEvent(event);\n const isError = isErrorEvent(event);\n const eventType = event.type || 'error';\n const beforeSendLabel = `before send for type \\`${eventType}\\``;\n\n // 1.0 === 100% events are sent\n // 0.0 === 0% events are sent\n // Sampling for transaction happens somewhere else\n if (isError && typeof sampleRate === 'number' && Math.random() > sampleRate) {\n this.recordDroppedEvent('sample_rate', 'error', event);\n return rejectedSyncPromise(\n new SentryError(\n `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`,\n 'log',\n ),\n );\n }\n\n const dataCategory = eventType === 'replay_event' ? 'replay' : eventType;\n\n const sdkProcessingMetadata = event.sdkProcessingMetadata || {};\n const capturedSpanIsolationScope = sdkProcessingMetadata.capturedSpanIsolationScope;\n\n return this._prepareEvent(event, hint, scope, capturedSpanIsolationScope)\n .then(prepared => {\n if (prepared === null) {\n this.recordDroppedEvent('event_processor', dataCategory, event);\n throw new SentryError('An event processor returned `null`, will not send event.', 'log');\n }\n\n const isInternalException = hint.data && (hint.data ).__sentry__ === true;\n if (isInternalException) {\n return prepared;\n }\n\n const result = processBeforeSend(options, prepared, hint);\n return _validateBeforeSendResult(result, beforeSendLabel);\n })\n .then(processedEvent => {\n if (processedEvent === null) {\n this.recordDroppedEvent('before_send', dataCategory, event);\n throw new SentryError(`${beforeSendLabel} returned \\`null\\`, will not send event.`, 'log');\n }\n\n const session = scope && scope.getSession();\n if (!isTransaction && session) {\n this._updateSessionFromEvent(session, processedEvent);\n }\n\n // None of the Sentry built event processor will update transaction name,\n // so if the transaction name has been changed by an event processor, we know\n // it has to come from custom event processor added by a user\n const transactionInfo = processedEvent.transaction_info;\n if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) {\n const source = 'custom';\n processedEvent.transaction_info = {\n ...transactionInfo,\n source,\n };\n }\n\n this.sendEvent(processedEvent, hint);\n return processedEvent;\n })\n .then(null, reason => {\n if (reason instanceof SentryError) {\n throw reason;\n }\n\n this.captureException(reason, {\n data: {\n __sentry__: true,\n },\n originalException: reason,\n });\n throw new SentryError(\n `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\\nReason: ${reason}`,\n );\n });\n }\n\n /**\n * Occupies the client with processing and event\n */\n _process(promise) {\n this._numProcessing++;\n void promise.then(\n value => {\n this._numProcessing--;\n return value;\n },\n reason => {\n this._numProcessing--;\n return reason;\n },\n );\n }\n\n /**\n * @inheritdoc\n */\n _sendEnvelope(envelope) {\n this.emit('beforeEnvelope', envelope);\n\n if (this._isEnabled() && this._transport) {\n return this._transport.send(envelope).then(null, reason => {\n DEBUG_BUILD && logger.error('Error while sending event:', reason);\n });\n } else {\n DEBUG_BUILD && logger.error('Transport disabled');\n }\n }\n\n /**\n * Clears outcomes on this client and returns them.\n */\n _clearOutcomes() {\n const outcomes = this._outcomes;\n this._outcomes = {};\n return Object.keys(outcomes).map(key => {\n const [reason, category] = key.split(':') ;\n return {\n reason,\n category,\n quantity: outcomes[key],\n };\n });\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n\n}\n\n/**\n * Verifies that return value of configured `beforeSend` or `beforeSendTransaction` is of expected type, and returns the value if so.\n */\nfunction _validateBeforeSendResult(\n beforeSendResult,\n beforeSendLabel,\n) {\n const invalidValueError = `${beforeSendLabel} must return \\`null\\` or a valid event.`;\n if (isThenable(beforeSendResult)) {\n return beforeSendResult.then(\n event => {\n if (!isPlainObject(event) && event !== null) {\n throw new SentryError(invalidValueError);\n }\n return event;\n },\n e => {\n throw new SentryError(`${beforeSendLabel} rejected with ${e}`);\n },\n );\n } else if (!isPlainObject(beforeSendResult) && beforeSendResult !== null) {\n throw new SentryError(invalidValueError);\n }\n return beforeSendResult;\n}\n\n/**\n * Process the matching `beforeSendXXX` callback.\n */\nfunction processBeforeSend(\n options,\n event,\n hint,\n) {\n const { beforeSend, beforeSendTransaction } = options;\n\n if (isErrorEvent(event) && beforeSend) {\n return beforeSend(event, hint);\n }\n\n if (isTransactionEvent(event) && beforeSendTransaction) {\n return beforeSendTransaction(event, hint);\n }\n\n return event;\n}\n\nfunction isErrorEvent(event) {\n return event.type === undefined;\n}\n\nfunction isTransactionEvent(event) {\n return event.type === 'transaction';\n}\n\n/**\n * Add an event processor to the current client.\n * This event processor will run for all events processed by this client.\n */\nfunction addEventProcessor(callback) {\n const client = getClient();\n\n if (!client || !client.addEventProcessor) {\n return;\n }\n\n client.addEventProcessor(callback);\n}\n\nexport { BaseClient, addEventProcessor };\n//# sourceMappingURL=baseclient.js.map\n","import { logger, consoleSandbox } from '@sentry/utils';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { getCurrentScope } from './exports.js';\nimport { getCurrentHub } from './hub.js';\n\n/** A class object that can instantiate Client objects. */\n\n/**\n * Internal function to create a new SDK client instance. The client is\n * installed and then bound to the current scope.\n *\n * @param clientClass The client class to instantiate.\n * @param options Options to pass to the client.\n */\nfunction initAndBind(\n clientClass,\n options,\n) {\n if (options.debug === true) {\n if (DEBUG_BUILD) {\n logger.enable();\n } else {\n // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');\n });\n }\n }\n const scope = getCurrentScope();\n scope.update(options.initialScope);\n\n const client = new clientClass(options);\n setCurrentClient(client);\n initializeClient(client);\n}\n\n/**\n * Make the given client the current client.\n */\nfunction setCurrentClient(client) {\n // eslint-disable-next-line deprecation/deprecation\n const hub = getCurrentHub();\n // eslint-disable-next-line deprecation/deprecation\n const top = hub.getStackTop();\n top.client = client;\n top.scope.setClient(client);\n}\n\n/**\n * Initialize the client for the current scope.\n * Make sure to call this after `setCurrentClient()`.\n */\nfunction initializeClient(client) {\n if (client.init) {\n client.init();\n // TODO v8: Remove this fallback\n // eslint-disable-next-line deprecation/deprecation\n } else if (client.setupIntegrations) {\n // eslint-disable-next-line deprecation/deprecation\n client.setupIntegrations();\n }\n}\n\nexport { initAndBind, setCurrentClient };\n//# sourceMappingURL=sdk.js.map\n","import { makePromiseBuffer, forEachEnvelopeItem, envelopeItemTypeToDataCategory, isRateLimited, resolvedSyncPromise, createEnvelope, SentryError, logger, serializeEnvelope, updateRateLimits } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\n\nconst DEFAULT_TRANSPORT_BUFFER_SIZE = 30;\n\n/**\n * Creates an instance of a Sentry `Transport`\n *\n * @param options\n * @param makeRequest\n */\nfunction createTransport(\n options,\n makeRequest,\n buffer = makePromiseBuffer(\n options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE,\n ),\n) {\n let rateLimits = {};\n const flush = (timeout) => buffer.drain(timeout);\n\n function send(envelope) {\n const filteredEnvelopeItems = [];\n\n // Drop rate limited items from envelope\n forEachEnvelopeItem(envelope, (item, type) => {\n const dataCategory = envelopeItemTypeToDataCategory(type);\n if (isRateLimited(rateLimits, dataCategory)) {\n const event = getEventForEnvelopeItem(item, type);\n options.recordDroppedEvent('ratelimit_backoff', dataCategory, event);\n } else {\n filteredEnvelopeItems.push(item);\n }\n });\n\n // Skip sending if envelope is empty after filtering out rate limited events\n if (filteredEnvelopeItems.length === 0) {\n return resolvedSyncPromise();\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const filteredEnvelope = createEnvelope(envelope[0], filteredEnvelopeItems );\n\n // Creates client report for each item in an envelope\n const recordEnvelopeLoss = (reason) => {\n forEachEnvelopeItem(filteredEnvelope, (item, type) => {\n const event = getEventForEnvelopeItem(item, type);\n options.recordDroppedEvent(reason, envelopeItemTypeToDataCategory(type), event);\n });\n };\n\n const requestTask = () =>\n makeRequest({ body: serializeEnvelope(filteredEnvelope, options.textEncoder) }).then(\n response => {\n // We don't want to throw on NOK responses, but we want to at least log them\n if (response.statusCode !== undefined && (response.statusCode < 200 || response.statusCode >= 300)) {\n DEBUG_BUILD && logger.warn(`Sentry responded with status code ${response.statusCode} to sent event.`);\n }\n\n rateLimits = updateRateLimits(rateLimits, response);\n return response;\n },\n error => {\n recordEnvelopeLoss('network_error');\n throw error;\n },\n );\n\n return buffer.add(requestTask).then(\n result => result,\n error => {\n if (error instanceof SentryError) {\n DEBUG_BUILD && logger.error('Skipped sending event because buffer is full.');\n recordEnvelopeLoss('queue_overflow');\n return resolvedSyncPromise();\n } else {\n throw error;\n }\n },\n );\n }\n\n // We use this to identifify if the transport is the base transport\n // TODO (v8): Remove this again as we'll no longer need it\n send.__sentry__baseTransport__ = true;\n\n return {\n send,\n flush,\n };\n}\n\nfunction getEventForEnvelopeItem(item, type) {\n if (type !== 'event' && type !== 'transaction') {\n return undefined;\n }\n\n return Array.isArray(item) ? (item )[1] : undefined;\n}\n\nexport { DEFAULT_TRANSPORT_BUFFER_SIZE, createTransport };\n//# sourceMappingURL=base.js.map\n","import { dsnToString, createEnvelope } from '@sentry/utils';\n\n/**\n * Create envelope from Span item.\n */\nfunction createSpanEnvelope(spans, dsn) {\n const headers = {\n sent_at: new Date().toISOString(),\n };\n\n if (dsn) {\n headers.dsn = dsnToString(dsn);\n }\n\n const items = spans.map(createSpanItem);\n return createEnvelope(headers, items);\n}\n\nfunction createSpanItem(span) {\n const spanHeaders = {\n type: 'span',\n };\n return [spanHeaders, span];\n}\n\nexport { createSpanEnvelope };\n//# sourceMappingURL=span.js.map\n","import { SDK_VERSION } from '../version.js';\n\n/**\n * A builder for the SDK metadata in the options for the SDK initialization.\n *\n * Note: This function is identical to `buildMetadata` in Remix and NextJS and SvelteKit.\n * We don't extract it for bundle size reasons.\n * @see https://github.com/getsentry/sentry-javascript/pull/7404\n * @see https://github.com/getsentry/sentry-javascript/pull/4196\n *\n * If you make changes to this function consider updating the others as well.\n *\n * @param options SDK options object that gets mutated\n * @param names list of package names\n */\nfunction applySdkMetadata(options, name, names = [name], source = 'npm') {\n const metadata = options._metadata || {};\n\n if (!metadata.sdk) {\n metadata.sdk = {\n name: `sentry.javascript.${name}`,\n packages: names.map(name => ({\n name: `${source}:@sentry/${name}`,\n version: SDK_VERSION,\n })),\n version: SDK_VERSION,\n };\n }\n\n options._metadata = metadata;\n}\n\nexport { applySdkMetadata };\n//# sourceMappingURL=sdkMetadata.js.map\n","import { logger, getEventDescription, stringMatchesSomePattern } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { convertIntegrationFnToClass, defineIntegration } from '../integration.js';\n\n// \"Script error.\" is hard coded into browsers for errors that it can't read.\n// this is the result of a script being pulled in from an external domain and CORS.\nconst DEFAULT_IGNORE_ERRORS = [\n /^Script error\\.?$/,\n /^Javascript error: Script error\\.? on line 0$/,\n /^ResizeObserver loop completed with undelivered notifications.$/,\n /^Cannot redefine property: googletag$/,\n];\n\nconst DEFAULT_IGNORE_TRANSACTIONS = [\n /^.*\\/healthcheck$/,\n /^.*\\/healthy$/,\n /^.*\\/live$/,\n /^.*\\/ready$/,\n /^.*\\/heartbeat$/,\n /^.*\\/health$/,\n /^.*\\/healthz$/,\n];\n\n/** Options for the InboundFilters integration */\n\nconst INTEGRATION_NAME = 'InboundFilters';\nconst _inboundFiltersIntegration = ((options = {}) => {\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n processEvent(event, _hint, client) {\n const clientOptions = client.getOptions();\n const mergedOptions = _mergeOptions(options, clientOptions);\n return _shouldDropEvent(event, mergedOptions) ? null : event;\n },\n };\n}) ;\n\nconst inboundFiltersIntegration = defineIntegration(_inboundFiltersIntegration);\n\n/**\n * Inbound filters configurable by the user.\n * @deprecated Use `inboundFiltersIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst InboundFilters = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n inboundFiltersIntegration,\n)\n\n;\n\nfunction _mergeOptions(\n internalOptions = {},\n clientOptions = {},\n) {\n return {\n allowUrls: [...(internalOptions.allowUrls || []), ...(clientOptions.allowUrls || [])],\n denyUrls: [...(internalOptions.denyUrls || []), ...(clientOptions.denyUrls || [])],\n ignoreErrors: [\n ...(internalOptions.ignoreErrors || []),\n ...(clientOptions.ignoreErrors || []),\n ...(internalOptions.disableErrorDefaults ? [] : DEFAULT_IGNORE_ERRORS),\n ],\n ignoreTransactions: [\n ...(internalOptions.ignoreTransactions || []),\n ...(clientOptions.ignoreTransactions || []),\n ...(internalOptions.disableTransactionDefaults ? [] : DEFAULT_IGNORE_TRANSACTIONS),\n ],\n ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true,\n };\n}\n\nfunction _shouldDropEvent(event, options) {\n if (options.ignoreInternal && _isSentryError(event)) {\n DEBUG_BUILD &&\n logger.warn(`Event dropped due to being internal Sentry Error.\\nEvent: ${getEventDescription(event)}`);\n return true;\n }\n if (_isIgnoredError(event, options.ignoreErrors)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to being matched by \\`ignoreErrors\\` option.\\nEvent: ${getEventDescription(event)}`,\n );\n return true;\n }\n if (_isIgnoredTransaction(event, options.ignoreTransactions)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to being matched by \\`ignoreTransactions\\` option.\\nEvent: ${getEventDescription(event)}`,\n );\n return true;\n }\n if (_isDeniedUrl(event, options.denyUrls)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to being matched by \\`denyUrls\\` option.\\nEvent: ${getEventDescription(\n event,\n )}.\\nUrl: ${_getEventFilterUrl(event)}`,\n );\n return true;\n }\n if (!_isAllowedUrl(event, options.allowUrls)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to not being matched by \\`allowUrls\\` option.\\nEvent: ${getEventDescription(\n event,\n )}.\\nUrl: ${_getEventFilterUrl(event)}`,\n );\n return true;\n }\n return false;\n}\n\nfunction _isIgnoredError(event, ignoreErrors) {\n // If event.type, this is not an error\n if (event.type || !ignoreErrors || !ignoreErrors.length) {\n return false;\n }\n\n return _getPossibleEventMessages(event).some(message => stringMatchesSomePattern(message, ignoreErrors));\n}\n\nfunction _isIgnoredTransaction(event, ignoreTransactions) {\n if (event.type !== 'transaction' || !ignoreTransactions || !ignoreTransactions.length) {\n return false;\n }\n\n const name = event.transaction;\n return name ? stringMatchesSomePattern(name, ignoreTransactions) : false;\n}\n\nfunction _isDeniedUrl(event, denyUrls) {\n // TODO: Use Glob instead?\n if (!denyUrls || !denyUrls.length) {\n return false;\n }\n const url = _getEventFilterUrl(event);\n return !url ? false : stringMatchesSomePattern(url, denyUrls);\n}\n\nfunction _isAllowedUrl(event, allowUrls) {\n // TODO: Use Glob instead?\n if (!allowUrls || !allowUrls.length) {\n return true;\n }\n const url = _getEventFilterUrl(event);\n return !url ? true : stringMatchesSomePattern(url, allowUrls);\n}\n\nfunction _getPossibleEventMessages(event) {\n const possibleMessages = [];\n\n if (event.message) {\n possibleMessages.push(event.message);\n }\n\n let lastException;\n try {\n // @ts-expect-error Try catching to save bundle size\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n lastException = event.exception.values[event.exception.values.length - 1];\n } catch (e) {\n // try catching to save bundle size checking existence of variables\n }\n\n if (lastException) {\n if (lastException.value) {\n possibleMessages.push(lastException.value);\n if (lastException.type) {\n possibleMessages.push(`${lastException.type}: ${lastException.value}`);\n }\n }\n }\n\n if (DEBUG_BUILD && possibleMessages.length === 0) {\n logger.error(`Could not extract message for event ${getEventDescription(event)}`);\n }\n\n return possibleMessages;\n}\n\nfunction _isSentryError(event) {\n try {\n // @ts-expect-error can't be a sentry error if undefined\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return event.exception.values[0].type === 'SentryError';\n } catch (e) {\n // ignore\n }\n return false;\n}\n\nfunction _getLastValidUrl(frames = []) {\n for (let i = frames.length - 1; i >= 0; i--) {\n const frame = frames[i];\n\n if (frame && frame.filename !== '' && frame.filename !== '[native code]') {\n return frame.filename || null;\n }\n }\n\n return null;\n}\n\nfunction _getEventFilterUrl(event) {\n try {\n let frames;\n try {\n // @ts-expect-error we only care about frames if the whole thing here is defined\n frames = event.exception.values[0].stacktrace.frames;\n } catch (e) {\n // ignore\n }\n return frames ? _getLastValidUrl(frames) : null;\n } catch (oO) {\n DEBUG_BUILD && logger.error(`Cannot extract url for event ${getEventDescription(event)}`);\n return null;\n }\n}\n\nexport { InboundFilters, inboundFiltersIntegration };\n//# sourceMappingURL=inboundfilters.js.map\n","import { getOriginalFunction } from '@sentry/utils';\nimport { getClient } from '../exports.js';\nimport { convertIntegrationFnToClass, defineIntegration } from '../integration.js';\n\nlet originalFunctionToString;\n\nconst INTEGRATION_NAME = 'FunctionToString';\n\nconst SETUP_CLIENTS = new WeakMap();\n\nconst _functionToStringIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n originalFunctionToString = Function.prototype.toString;\n\n // intrinsics (like Function.prototype) might be immutable in some environments\n // e.g. Node with --frozen-intrinsics, XS (an embedded JavaScript engine) or SES (a JavaScript proposal)\n try {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Function.prototype.toString = function ( ...args) {\n const originalFunction = getOriginalFunction(this);\n const context =\n SETUP_CLIENTS.has(getClient() ) && originalFunction !== undefined ? originalFunction : this;\n return originalFunctionToString.apply(context, args);\n };\n } catch (e) {\n // ignore errors here, just don't patch this\n }\n },\n setup(client) {\n SETUP_CLIENTS.set(client, true);\n },\n };\n}) ;\n\n/**\n * Patch toString calls to return proper name for wrapped functions.\n *\n * ```js\n * Sentry.init({\n * integrations: [\n * functionToStringIntegration(),\n * ],\n * });\n * ```\n */\nconst functionToStringIntegration = defineIntegration(_functionToStringIntegration);\n\n/**\n * Patch toString calls to return proper name for wrapped functions.\n *\n * @deprecated Use `functionToStringIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst FunctionToString = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n functionToStringIntegration,\n) ;\n\n// eslint-disable-next-line deprecation/deprecation\n\nexport { FunctionToString, functionToStringIntegration };\n//# sourceMappingURL=functiontostring.js.map\n","/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nconst DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);\n\nexport { DEBUG_BUILD };\n//# sourceMappingURL=debug-build.js.map\n","import { GLOBAL_OBJ } from '@sentry/utils';\n\nconst WINDOW = GLOBAL_OBJ\n\n;\n\nexport { WINDOW };\n//# sourceMappingURL=types.js.map\n","import { getActiveTransaction, spanToJSON } from '@sentry/core';\nimport { logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../common/debug-build.js';\nimport { WINDOW } from './types.js';\n\n/**\n * Add a listener that cancels and finishes a transaction when the global\n * document is hidden.\n */\nfunction registerBackgroundTabDetection() {\n if (WINDOW.document) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n // eslint-disable-next-line deprecation/deprecation\n const activeTransaction = getActiveTransaction() ;\n if (WINDOW.document.hidden && activeTransaction) {\n const statusType = 'cancelled';\n\n const { op, status } = spanToJSON(activeTransaction);\n\n DEBUG_BUILD &&\n logger.log(`[Tracing] Transaction: ${statusType} -> since tab moved to the background, op: ${op}`);\n // We should not set status if it is already set, this prevent important statuses like\n // error or data loss from being overwritten on transaction.\n if (!status) {\n activeTransaction.setStatus(statusType);\n }\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n activeTransaction.setTag('visibilitychange', 'document.hidden');\n activeTransaction.end();\n }\n });\n } else {\n DEBUG_BUILD && logger.warn('[Tracing] Could not set up background tab detection due to lack of global document');\n }\n}\n\nexport { registerBackgroundTabDetection };\n//# sourceMappingURL=backgroundtab.js.map\n","const bindReporter = (\n callback,\n metric,\n reportAllChanges,\n) => {\n let prevValue;\n let delta;\n return (forceReport) => {\n if (metric.value >= 0) {\n if (forceReport || reportAllChanges) {\n delta = metric.value - (prevValue || 0);\n\n // Report the metric if there's a non-zero delta or if no previous\n // value exists (which can happen in the case of the document becoming\n // hidden when the metric value is 0).\n // See: https://github.com/GoogleChrome/web-vitals/issues/14\n if (delta || prevValue === undefined) {\n prevValue = metric.value;\n metric.delta = delta;\n callback(metric);\n }\n }\n }\n };\n};\n\nexport { bindReporter };\n//# sourceMappingURL=bindReporter.js.map\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Performantly generate a unique, 30-char string by combining a version\n * number, the current timestamp with a 13-digit number integer.\n * @return {string}\n */\nconst generateUniqueID = () => {\n return `v3-${Date.now()}-${Math.floor(Math.random() * (9e12 - 1)) + 1e12}`;\n};\n\nexport { generateUniqueID };\n//# sourceMappingURL=generateUniqueID.js.map\n","import { WINDOW } from '../../types.js';\n\n/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst getNavigationEntryFromPerformanceTiming = () => {\n // eslint-disable-next-line deprecation/deprecation\n const timing = WINDOW.performance.timing;\n // eslint-disable-next-line deprecation/deprecation\n const type = WINDOW.performance.navigation.type;\n\n const navigationEntry = {\n entryType: 'navigation',\n startTime: 0,\n type: type == 2 ? 'back_forward' : type === 1 ? 'reload' : 'navigate',\n };\n\n for (const key in timing) {\n if (key !== 'navigationStart' && key !== 'toJSON') {\n // eslint-disable-next-line deprecation/deprecation\n navigationEntry[key] = Math.max((timing[key ] ) - timing.navigationStart, 0);\n }\n }\n return navigationEntry ;\n};\n\nconst getNavigationEntry = () => {\n if (WINDOW.__WEB_VITALS_POLYFILL__) {\n return (\n WINDOW.performance &&\n ((performance.getEntriesByType && performance.getEntriesByType('navigation')[0]) ||\n getNavigationEntryFromPerformanceTiming())\n );\n } else {\n return WINDOW.performance && performance.getEntriesByType && performance.getEntriesByType('navigation')[0];\n }\n};\n\nexport { getNavigationEntry };\n//# sourceMappingURL=getNavigationEntry.js.map\n","import { getNavigationEntry } from './getNavigationEntry.js';\n\n/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst getActivationStart = () => {\n const navEntry = getNavigationEntry();\n return (navEntry && navEntry.activationStart) || 0;\n};\n\nexport { getActivationStart };\n//# sourceMappingURL=getActivationStart.js.map\n","import { WINDOW } from '../../types.js';\nimport { generateUniqueID } from './generateUniqueID.js';\nimport { getActivationStart } from './getActivationStart.js';\nimport { getNavigationEntry } from './getNavigationEntry.js';\n\n/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst initMetric = (name, value) => {\n const navEntry = getNavigationEntry();\n let navigationType = 'navigate';\n\n if (navEntry) {\n if ((WINDOW.document && WINDOW.document.prerendering) || getActivationStart() > 0) {\n navigationType = 'prerender';\n } else {\n navigationType = navEntry.type.replace(/_/g, '-') ;\n }\n }\n\n return {\n name,\n value: typeof value === 'undefined' ? -1 : value,\n rating: 'good', // Will be updated if the value changes.\n delta: 0,\n entries: [],\n id: generateUniqueID(),\n navigationType,\n };\n};\n\nexport { initMetric };\n//# sourceMappingURL=initMetric.js.map\n","/**\n * Takes a performance entry type and a callback function, and creates a\n * `PerformanceObserver` instance that will observe the specified entry type\n * with buffering enabled and call the callback _for each entry_.\n *\n * This function also feature-detects entry support and wraps the logic in a\n * try/catch to avoid errors in unsupporting browsers.\n */\nconst observe = (\n type,\n callback,\n opts,\n) => {\n try {\n if (PerformanceObserver.supportedEntryTypes.includes(type)) {\n const po = new PerformanceObserver(list => {\n callback(list.getEntries() );\n });\n po.observe(\n Object.assign(\n {\n type,\n buffered: true,\n },\n opts || {},\n ) ,\n );\n return po;\n }\n } catch (e) {\n // Do nothing.\n }\n return;\n};\n\nexport { observe };\n//# sourceMappingURL=observe.js.map\n","import { WINDOW } from '../../types.js';\n\n/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst onHidden = (cb, once) => {\n const onHiddenOrPageHide = (event) => {\n if (event.type === 'pagehide' || WINDOW.document.visibilityState === 'hidden') {\n cb(event);\n if (once) {\n removeEventListener('visibilitychange', onHiddenOrPageHide, true);\n removeEventListener('pagehide', onHiddenOrPageHide, true);\n }\n }\n };\n\n if (WINDOW.document) {\n addEventListener('visibilitychange', onHiddenOrPageHide, true);\n // Some browsers have buggy implementations of visibilitychange,\n // so we use pagehide in addition, just to be safe.\n addEventListener('pagehide', onHiddenOrPageHide, true);\n }\n};\n\nexport { onHidden };\n//# sourceMappingURL=onHidden.js.map\n","import { bindReporter } from './lib/bindReporter.js';\nimport { initMetric } from './lib/initMetric.js';\nimport { observe } from './lib/observe.js';\nimport { onHidden } from './lib/onHidden.js';\n\n/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Calculates the [CLS](https://web.dev/cls/) value for the current page and\n * calls the `callback` function once the value is ready to be reported, along\n * with all `layout-shift` performance entries that were used in the metric\n * value calculation. The reported value is a `double` (corresponding to a\n * [layout shift score](https://web.dev/cls/#layout-shift-score)).\n *\n * If the `reportAllChanges` configuration option is set to `true`, the\n * `callback` function will be called as soon as the value is initially\n * determined as well as any time the value changes throughout the page\n * lifespan.\n *\n * _**Important:** CLS should be continually monitored for changes throughout\n * the entire lifespan of a page—including if the user returns to the page after\n * it's been hidden/backgrounded. However, since browsers often [will not fire\n * additional callbacks once the user has backgrounded a\n * page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden),\n * `callback` is always called when the page's visibility state changes to\n * hidden. As a result, the `callback` function might be called multiple times\n * during the same page load._\n */\nconst onCLS = (onReport) => {\n const metric = initMetric('CLS', 0);\n let report;\n\n let sessionValue = 0;\n let sessionEntries = [];\n\n // const handleEntries = (entries: Metric['entries']) => {\n const handleEntries = (entries) => {\n entries.forEach(entry => {\n // Only count layout shifts without recent user input.\n if (!entry.hadRecentInput) {\n const firstSessionEntry = sessionEntries[0];\n const lastSessionEntry = sessionEntries[sessionEntries.length - 1];\n\n // If the entry occurred less than 1 second after the previous entry and\n // less than 5 seconds after the first entry in the session, include the\n // entry in the current session. Otherwise, start a new session.\n if (\n sessionValue &&\n sessionEntries.length !== 0 &&\n entry.startTime - lastSessionEntry.startTime < 1000 &&\n entry.startTime - firstSessionEntry.startTime < 5000\n ) {\n sessionValue += entry.value;\n sessionEntries.push(entry);\n } else {\n sessionValue = entry.value;\n sessionEntries = [entry];\n }\n\n // If the current session value is larger than the current CLS value,\n // update CLS and the entries contributing to it.\n if (sessionValue > metric.value) {\n metric.value = sessionValue;\n metric.entries = sessionEntries;\n if (report) {\n report();\n }\n }\n }\n });\n };\n\n const po = observe('layout-shift', handleEntries);\n if (po) {\n report = bindReporter(onReport, metric);\n\n const stopListening = () => {\n handleEntries(po.takeRecords() );\n report(true);\n };\n\n onHidden(stopListening);\n\n return stopListening;\n }\n\n return;\n};\n\nexport { onCLS };\n//# sourceMappingURL=getCLS.js.map\n","import { WINDOW } from '../../types.js';\nimport { onHidden } from './onHidden.js';\n\n/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nlet firstHiddenTime = -1;\n\nconst initHiddenTime = () => {\n // If the document is hidden and not prerendering, assume it was always\n // hidden and the page was loaded in the background.\n if (WINDOW.document && WINDOW.document.visibilityState) {\n firstHiddenTime = WINDOW.document.visibilityState === 'hidden' && !WINDOW.document.prerendering ? 0 : Infinity;\n }\n};\n\nconst trackChanges = () => {\n // Update the time if/when the document becomes hidden.\n onHidden(({ timeStamp }) => {\n firstHiddenTime = timeStamp;\n }, true);\n};\n\nconst getVisibilityWatcher = (\n\n) => {\n if (firstHiddenTime < 0) {\n // If the document is hidden when this code runs, assume it was hidden\n // since navigation start. This isn't a perfect heuristic, but it's the\n // best we can do until an API is available to support querying past\n // visibilityState.\n initHiddenTime();\n trackChanges();\n }\n return {\n get firstHiddenTime() {\n return firstHiddenTime;\n },\n };\n};\n\nexport { getVisibilityWatcher };\n//# sourceMappingURL=getVisibilityWatcher.js.map\n","import { bindReporter } from './lib/bindReporter.js';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher.js';\nimport { initMetric } from './lib/initMetric.js';\nimport { observe } from './lib/observe.js';\nimport { onHidden } from './lib/onHidden.js';\n\n/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Calculates the [FID](https://web.dev/fid/) value for the current page and\n * calls the `callback` function once the value is ready, along with the\n * relevant `first-input` performance entry used to determine the value. The\n * reported value is a `DOMHighResTimeStamp`.\n *\n * _**Important:** since FID is only reported after the user interacts with the\n * page, it's possible that it will not be reported for some page loads._\n */\nconst onFID = (onReport) => {\n const visibilityWatcher = getVisibilityWatcher();\n const metric = initMetric('FID');\n // eslint-disable-next-line prefer-const\n let report;\n\n const handleEntry = (entry) => {\n // Only report if the page wasn't hidden prior to the first input.\n if (entry.startTime < visibilityWatcher.firstHiddenTime) {\n metric.value = entry.processingStart - entry.startTime;\n metric.entries.push(entry);\n report(true);\n }\n };\n\n const handleEntries = (entries) => {\n (entries ).forEach(handleEntry);\n };\n\n const po = observe('first-input', handleEntries);\n report = bindReporter(onReport, metric);\n\n if (po) {\n onHidden(() => {\n handleEntries(po.takeRecords() );\n po.disconnect();\n }, true);\n }\n};\n\nexport { onFID };\n//# sourceMappingURL=getFID.js.map\n","import { observe } from '../observe.js';\n\nlet interactionCountEstimate = 0;\nlet minKnownInteractionId = Infinity;\nlet maxKnownInteractionId = 0;\n\nconst updateEstimate = (entries) => {\n (entries ).forEach(e => {\n if (e.interactionId) {\n minKnownInteractionId = Math.min(minKnownInteractionId, e.interactionId);\n maxKnownInteractionId = Math.max(maxKnownInteractionId, e.interactionId);\n\n interactionCountEstimate = maxKnownInteractionId ? (maxKnownInteractionId - minKnownInteractionId) / 7 + 1 : 0;\n }\n });\n};\n\nlet po;\n\n/**\n * Returns the `interactionCount` value using the native API (if available)\n * or the polyfill estimate in this module.\n */\nconst getInteractionCount = () => {\n return po ? interactionCountEstimate : performance.interactionCount || 0;\n};\n\n/**\n * Feature detects native support or initializes the polyfill if needed.\n */\nconst initInteractionCountPolyfill = () => {\n if ('interactionCount' in performance || po) return;\n\n po = observe('event', updateEstimate, {\n type: 'event',\n buffered: true,\n durationThreshold: 0,\n } );\n};\n\nexport { getInteractionCount, initInteractionCountPolyfill };\n//# sourceMappingURL=interactionCountPolyfill.js.map\n","import { bindReporter } from './lib/bindReporter.js';\nimport { initMetric } from './lib/initMetric.js';\nimport { observe } from './lib/observe.js';\nimport { onHidden } from './lib/onHidden.js';\nimport { initInteractionCountPolyfill, getInteractionCount } from './lib/polyfills/interactionCountPolyfill.js';\n\n/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Returns the interaction count since the last bfcache restore (or for the\n * full page lifecycle if there were no bfcache restores).\n */\nconst getInteractionCountForNavigation = () => {\n return getInteractionCount();\n};\n\n// To prevent unnecessary memory usage on pages with lots of interactions,\n// store at most 10 of the longest interactions to consider as INP candidates.\nconst MAX_INTERACTIONS_TO_CONSIDER = 10;\n\n// A list of longest interactions on the page (by latency) sorted so the\n// longest one is first. The list is as most MAX_INTERACTIONS_TO_CONSIDER long.\nconst longestInteractionList = [];\n\n// A mapping of longest interactions by their interaction ID.\n// This is used for faster lookup.\nconst longestInteractionMap = {};\n\n/**\n * Takes a performance entry and adds it to the list of worst interactions\n * if its duration is long enough to make it among the worst. If the\n * entry is part of an existing interaction, it is merged and the latency\n * and entries list is updated as needed.\n */\nconst processEntry = (entry) => {\n // The least-long of the 10 longest interactions.\n const minLongestInteraction = longestInteractionList[longestInteractionList.length - 1];\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const existingInteraction = longestInteractionMap[entry.interactionId];\n\n // Only process the entry if it's possibly one of the ten longest,\n // or if it's part of an existing interaction.\n if (\n existingInteraction ||\n longestInteractionList.length < MAX_INTERACTIONS_TO_CONSIDER ||\n entry.duration > minLongestInteraction.latency\n ) {\n // If the interaction already exists, update it. Otherwise create one.\n if (existingInteraction) {\n existingInteraction.entries.push(entry);\n existingInteraction.latency = Math.max(existingInteraction.latency, entry.duration);\n } else {\n const interaction = {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n id: entry.interactionId,\n latency: entry.duration,\n entries: [entry],\n };\n longestInteractionMap[interaction.id] = interaction;\n longestInteractionList.push(interaction);\n }\n\n // Sort the entries by latency (descending) and keep only the top ten.\n longestInteractionList.sort((a, b) => b.latency - a.latency);\n longestInteractionList.splice(MAX_INTERACTIONS_TO_CONSIDER).forEach(i => {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete longestInteractionMap[i.id];\n });\n }\n};\n\n/**\n * Returns the estimated p98 longest interaction based on the stored\n * interaction candidates and the interaction count for the current page.\n */\nconst estimateP98LongestInteraction = () => {\n const candidateInteractionIndex = Math.min(\n longestInteractionList.length - 1,\n Math.floor(getInteractionCountForNavigation() / 50),\n );\n\n return longestInteractionList[candidateInteractionIndex];\n};\n\n/**\n * Calculates the [INP](https://web.dev/responsiveness/) value for the current\n * page and calls the `callback` function once the value is ready, along with\n * the `event` performance entries reported for that interaction. The reported\n * value is a `DOMHighResTimeStamp`.\n *\n * A custom `durationThreshold` configuration option can optionally be passed to\n * control what `event-timing` entries are considered for INP reporting. The\n * default threshold is `40`, which means INP scores of less than 40 are\n * reported as 0. Note that this will not affect your 75th percentile INP value\n * unless that value is also less than 40 (well below the recommended\n * [good](https://web.dev/inp/#what-is-a-good-inp-score) threshold).\n *\n * If the `reportAllChanges` configuration option is set to `true`, the\n * `callback` function will be called as soon as the value is initially\n * determined as well as any time the value changes throughout the page\n * lifespan.\n *\n * _**Important:** INP should be continually monitored for changes throughout\n * the entire lifespan of a page—including if the user returns to the page after\n * it's been hidden/backgrounded. However, since browsers often [will not fire\n * additional callbacks once the user has backgrounded a\n * page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden),\n * `callback` is always called when the page's visibility state changes to\n * hidden. As a result, the `callback` function might be called multiple times\n * during the same page load._\n */\nconst onINP = (onReport, opts) => {\n // Set defaults\n // eslint-disable-next-line no-param-reassign\n opts = opts || {};\n\n // https://web.dev/inp/#what's-a-%22good%22-inp-value\n // const thresholds = [200, 500];\n\n // TODO(philipwalton): remove once the polyfill is no longer needed.\n initInteractionCountPolyfill();\n\n const metric = initMetric('INP');\n // eslint-disable-next-line prefer-const\n let report;\n\n const handleEntries = (entries) => {\n entries.forEach(entry => {\n if (entry.interactionId) {\n processEntry(entry);\n }\n\n // Entries of type `first-input` don't currently have an `interactionId`,\n // so to consider them in INP we have to first check that an existing\n // entry doesn't match the `duration` and `startTime`.\n // Note that this logic assumes that `event` entries are dispatched\n // before `first-input` entries. This is true in Chrome but it is not\n // true in Firefox; however, Firefox doesn't support interactionId, so\n // it's not an issue at the moment.\n // TODO(philipwalton): remove once crbug.com/1325826 is fixed.\n if (entry.entryType === 'first-input') {\n const noMatchingEntry = !longestInteractionList.some(interaction => {\n return interaction.entries.some(prevEntry => {\n return entry.duration === prevEntry.duration && entry.startTime === prevEntry.startTime;\n });\n });\n if (noMatchingEntry) {\n processEntry(entry);\n }\n }\n });\n\n const inp = estimateP98LongestInteraction();\n\n if (inp && inp.latency !== metric.value) {\n metric.value = inp.latency;\n metric.entries = inp.entries;\n report();\n }\n };\n\n const po = observe('event', handleEntries, {\n // Event Timing entries have their durations rounded to the nearest 8ms,\n // so a duration of 40ms would be any event that spans 2.5 or more frames\n // at 60Hz. This threshold is chosen to strike a balance between usefulness\n // and performance. Running this callback for any interaction that spans\n // just one or two frames is likely not worth the insight that could be\n // gained.\n durationThreshold: opts.durationThreshold || 40,\n } );\n\n report = bindReporter(onReport, metric, opts.reportAllChanges);\n\n if (po) {\n // Also observe entries of type `first-input`. This is useful in cases\n // where the first interaction is less than the `durationThreshold`.\n po.observe({ type: 'first-input', buffered: true });\n\n onHidden(() => {\n handleEntries(po.takeRecords() );\n\n // If the interaction count shows that there were interactions but\n // none were captured by the PerformanceObserver, report a latency of 0.\n if (metric.value < 0 && getInteractionCountForNavigation() > 0) {\n metric.value = 0;\n metric.entries = [];\n }\n\n report(true);\n });\n }\n};\n\nexport { onINP };\n//# sourceMappingURL=getINP.js.map\n","import { WINDOW } from '../types.js';\nimport { bindReporter } from './lib/bindReporter.js';\nimport { getActivationStart } from './lib/getActivationStart.js';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher.js';\nimport { initMetric } from './lib/initMetric.js';\nimport { observe } from './lib/observe.js';\nimport { onHidden } from './lib/onHidden.js';\n\n/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst reportedMetricIDs = {};\n\n/**\n * Calculates the [LCP](https://web.dev/lcp/) value for the current page and\n * calls the `callback` function once the value is ready (along with the\n * relevant `largest-contentful-paint` performance entry used to determine the\n * value). The reported value is a `DOMHighResTimeStamp`.\n */\nconst onLCP = (onReport) => {\n const visibilityWatcher = getVisibilityWatcher();\n const metric = initMetric('LCP');\n let report;\n\n const handleEntries = (entries) => {\n const lastEntry = entries[entries.length - 1] ;\n if (lastEntry) {\n // The startTime attribute returns the value of the renderTime if it is\n // not 0, and the value of the loadTime otherwise. The activationStart\n // reference is used because LCP should be relative to page activation\n // rather than navigation start if the page was prerendered.\n const value = Math.max(lastEntry.startTime - getActivationStart(), 0);\n\n // Only report if the page wasn't hidden prior to LCP.\n if (value < visibilityWatcher.firstHiddenTime) {\n metric.value = value;\n metric.entries = [lastEntry];\n report();\n }\n }\n };\n\n const po = observe('largest-contentful-paint', handleEntries);\n\n if (po) {\n report = bindReporter(onReport, metric);\n\n const stopListening = () => {\n if (!reportedMetricIDs[metric.id]) {\n handleEntries(po.takeRecords() );\n po.disconnect();\n reportedMetricIDs[metric.id] = true;\n report(true);\n }\n };\n\n // Stop listening after input. Note: while scrolling is an input that\n // stop LCP observation, it's unreliable since it can be programmatically\n // generated. See: https://github.com/GoogleChrome/web-vitals/issues/75\n ['keydown', 'click'].forEach(type => {\n if (WINDOW.document) {\n addEventListener(type, stopListening, { once: true, capture: true });\n }\n });\n\n onHidden(stopListening, true);\n\n return stopListening;\n }\n\n return;\n};\n\nexport { onLCP };\n//# sourceMappingURL=getLCP.js.map\n","import { WINDOW } from '../types.js';\nimport { bindReporter } from './lib/bindReporter.js';\nimport { getActivationStart } from './lib/getActivationStart.js';\nimport { getNavigationEntry } from './lib/getNavigationEntry.js';\nimport { initMetric } from './lib/initMetric.js';\n\n/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Runs in the next task after the page is done loading and/or prerendering.\n * @param callback\n */\nconst whenReady = (callback) => {\n if (!WINDOW.document) {\n return;\n }\n\n if (WINDOW.document.prerendering) {\n addEventListener('prerenderingchange', () => whenReady(callback), true);\n } else if (WINDOW.document.readyState !== 'complete') {\n addEventListener('load', () => whenReady(callback), true);\n } else {\n // Queue a task so the callback runs after `loadEventEnd`.\n setTimeout(callback, 0);\n }\n};\n\n/**\n * Calculates the [TTFB](https://web.dev/time-to-first-byte/) value for the\n * current page and calls the `callback` function once the page has loaded,\n * along with the relevant `navigation` performance entry used to determine the\n * value. The reported value is a `DOMHighResTimeStamp`.\n *\n * Note, this function waits until after the page is loaded to call `callback`\n * in order to ensure all properties of the `navigation` entry are populated.\n * This is useful if you want to report on other metrics exposed by the\n * [Navigation Timing API](https://w3c.github.io/navigation-timing/). For\n * example, the TTFB metric starts from the page's [time\n * origin](https://www.w3.org/TR/hr-time-2/#sec-time-origin), which means it\n * includes time spent on DNS lookup, connection negotiation, network latency,\n * and server processing time.\n */\nconst onTTFB = (onReport, opts) => {\n // Set defaults\n // eslint-disable-next-line no-param-reassign\n opts = opts || {};\n\n // https://web.dev/ttfb/#what-is-a-good-ttfb-score\n // const thresholds = [800, 1800];\n\n const metric = initMetric('TTFB');\n const report = bindReporter(onReport, metric, opts.reportAllChanges);\n\n whenReady(() => {\n const navEntry = getNavigationEntry() ;\n\n if (navEntry) {\n // The activationStart reference is used because TTFB should be\n // relative to page activation rather than navigation start if the\n // page was prerendered. But in cases where `activationStart` occurs\n // after the first byte is received, this time should be clamped at 0.\n metric.value = Math.max(navEntry.responseStart - getActivationStart(), 0);\n\n // In some cases the value reported is negative or is larger\n // than the current page time. Ignore these cases:\n // https://github.com/GoogleChrome/web-vitals/issues/137\n // https://github.com/GoogleChrome/web-vitals/issues/162\n if (metric.value < 0 || metric.value > performance.now()) return;\n\n metric.entries = [navEntry];\n\n report(true);\n }\n });\n};\n\nexport { onTTFB };\n//# sourceMappingURL=onTTFB.js.map\n","import { logger, getFunctionName } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../common/debug-build.js';\nimport { onCLS } from './web-vitals/getCLS.js';\nimport { onFID } from './web-vitals/getFID.js';\nimport { onINP } from './web-vitals/getINP.js';\nimport { onLCP } from './web-vitals/getLCP.js';\nimport { observe } from './web-vitals/lib/observe.js';\nimport { onTTFB } from './web-vitals/onTTFB.js';\n\nconst handlers = {};\nconst instrumented = {};\n\nlet _previousCls;\nlet _previousFid;\nlet _previousLcp;\nlet _previousTtfb;\nlet _previousInp;\n\n/**\n * Add a callback that will be triggered when a CLS metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n *\n * Pass `stopOnCallback = true` to stop listening for CLS when the cleanup callback is called.\n * This will lead to the CLS being finalized and frozen.\n */\nfunction addClsInstrumentationHandler(\n callback,\n stopOnCallback = false,\n) {\n return addMetricObserver('cls', callback, instrumentCls, _previousCls, stopOnCallback);\n}\n\n/**\n * Add a callback that will be triggered when a LCP metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n *\n * Pass `stopOnCallback = true` to stop listening for LCP when the cleanup callback is called.\n * This will lead to the LCP being finalized and frozen.\n */\nfunction addLcpInstrumentationHandler(\n callback,\n stopOnCallback = false,\n) {\n return addMetricObserver('lcp', callback, instrumentLcp, _previousLcp, stopOnCallback);\n}\n\n/**\n * Add a callback that will be triggered when a FID metric is available.\n */\nfunction addTtfbInstrumentationHandler(callback) {\n return addMetricObserver('ttfb', callback, instrumentTtfb, _previousTtfb);\n}\n\n/**\n * Add a callback that will be triggered when a FID metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n */\nfunction addFidInstrumentationHandler(callback) {\n return addMetricObserver('fid', callback, instrumentFid, _previousFid);\n}\n\n/**\n * Add a callback that will be triggered when a INP metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n */\nfunction addInpInstrumentationHandler(\n callback,\n) {\n return addMetricObserver('inp', callback, instrumentInp, _previousInp);\n}\n\n/**\n * Add a callback that will be triggered when a performance observer is triggered,\n * and receives the entries of the observer.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n */\nfunction addPerformanceInstrumentationHandler(\n type,\n callback,\n) {\n addHandler(type, callback);\n\n if (!instrumented[type]) {\n instrumentPerformanceObserver(type);\n instrumented[type] = true;\n }\n\n return getCleanupCallback(type, callback);\n}\n\n/** Trigger all handlers of a given type. */\nfunction triggerHandlers(type, data) {\n const typeHandlers = handlers[type];\n\n if (!typeHandlers || !typeHandlers.length) {\n return;\n }\n\n for (const handler of typeHandlers) {\n try {\n handler(data);\n } catch (e) {\n DEBUG_BUILD &&\n logger.error(\n `Error while triggering instrumentation handler.\\nType: ${type}\\nName: ${getFunctionName(handler)}\\nError:`,\n e,\n );\n }\n }\n}\n\nfunction instrumentCls() {\n return onCLS(metric => {\n triggerHandlers('cls', {\n metric,\n });\n _previousCls = metric;\n });\n}\n\nfunction instrumentFid() {\n return onFID(metric => {\n triggerHandlers('fid', {\n metric,\n });\n _previousFid = metric;\n });\n}\n\nfunction instrumentLcp() {\n return onLCP(metric => {\n triggerHandlers('lcp', {\n metric,\n });\n _previousLcp = metric;\n });\n}\n\nfunction instrumentTtfb() {\n return onTTFB(metric => {\n triggerHandlers('ttfb', {\n metric,\n });\n _previousTtfb = metric;\n });\n}\n\nfunction instrumentInp() {\n return onINP(metric => {\n triggerHandlers('inp', {\n metric,\n });\n _previousInp = metric;\n });\n}\n\nfunction addMetricObserver(\n type,\n callback,\n instrumentFn,\n previousValue,\n stopOnCallback = false,\n) {\n addHandler(type, callback);\n\n let stopListening;\n\n if (!instrumented[type]) {\n stopListening = instrumentFn();\n instrumented[type] = true;\n }\n\n if (previousValue) {\n callback({ metric: previousValue });\n }\n\n return getCleanupCallback(type, callback, stopOnCallback ? stopListening : undefined);\n}\n\nfunction instrumentPerformanceObserver(type) {\n const options = {};\n\n // Special per-type options we want to use\n if (type === 'event') {\n options.durationThreshold = 0;\n }\n\n observe(\n type,\n entries => {\n triggerHandlers(type, { entries });\n },\n options,\n );\n}\n\nfunction addHandler(type, handler) {\n handlers[type] = handlers[type] || [];\n (handlers[type] ).push(handler);\n}\n\n// Get a callback which can be called to remove the instrumentation handler\nfunction getCleanupCallback(\n type,\n callback,\n stopListening,\n) {\n return () => {\n if (stopListening) {\n stopListening();\n }\n\n const typeHandlers = handlers[type];\n\n if (!typeHandlers) {\n return;\n }\n\n const index = typeHandlers.indexOf(callback);\n if (index !== -1) {\n typeHandlers.splice(index, 1);\n }\n };\n}\n\nexport { addClsInstrumentationHandler, addFidInstrumentationHandler, addInpInstrumentationHandler, addLcpInstrumentationHandler, addPerformanceInstrumentationHandler, addTtfbInstrumentationHandler };\n//# sourceMappingURL=instrument.js.map\n","/**\n * Checks if a given value is a valid measurement value.\n */\nfunction isMeasurementValue(value) {\n return typeof value === 'number' && isFinite(value);\n}\n\n/**\n * Helper function to start child on transactions. This function will make sure that the transaction will\n * use the start timestamp of the created child span if it is earlier than the transactions actual\n * start timestamp.\n *\n * Note: this will not be possible anymore in v8,\n * unless we do some special handling for browser here...\n */\nfunction _startChild(transaction, { startTimestamp, ...ctx }) {\n // eslint-disable-next-line deprecation/deprecation\n if (startTimestamp && transaction.startTimestamp > startTimestamp) {\n // eslint-disable-next-line deprecation/deprecation\n transaction.startTimestamp = startTimestamp;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n return transaction.startChild({\n startTimestamp,\n ...ctx,\n });\n}\n\nexport { _startChild, isMeasurementValue };\n//# sourceMappingURL=utils.js.map\n","import { getActiveTransaction, spanToJSON, setMeasurement, getClient, Span, createSpanEnvelope, hasTracingEnabled, isValidSampleRate } from '@sentry/core';\nimport { browserPerformanceTimeOrigin, htmlTreeAsString, getComponentName, logger, parseUrl } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../../common/debug-build.js';\nimport { addPerformanceInstrumentationHandler, addClsInstrumentationHandler, addLcpInstrumentationHandler, addFidInstrumentationHandler, addTtfbInstrumentationHandler, addInpInstrumentationHandler } from '../instrument.js';\nimport { WINDOW } from '../types.js';\nimport { getVisibilityWatcher } from '../web-vitals/lib/getVisibilityWatcher.js';\nimport { _startChild, isMeasurementValue } from './utils.js';\nimport { getNavigationEntry } from '../web-vitals/lib/getNavigationEntry.js';\n\nconst MAX_INT_AS_BYTES = 2147483647;\n\n/**\n * Converts from milliseconds to seconds\n * @param time time in ms\n */\nfunction msToSec(time) {\n return time / 1000;\n}\n\nfunction getBrowserPerformanceAPI() {\n // @ts-expect-error we want to make sure all of these are available, even if TS is sure they are\n return WINDOW && WINDOW.addEventListener && WINDOW.performance;\n}\n\nlet _performanceCursor = 0;\n\nlet _measurements = {};\nlet _lcpEntry;\nlet _clsEntry;\n\n/**\n * Start tracking web vitals.\n * The callback returned by this function can be used to stop tracking & ensure all measurements are final & captured.\n *\n * @returns A function that forces web vitals collection\n */\nfunction startTrackingWebVitals() {\n const performance = getBrowserPerformanceAPI();\n if (performance && browserPerformanceTimeOrigin) {\n // @ts-expect-error we want to make sure all of these are available, even if TS is sure they are\n if (performance.mark) {\n WINDOW.performance.mark('sentry-tracing-init');\n }\n const fidCallback = _trackFID();\n const clsCallback = _trackCLS();\n const lcpCallback = _trackLCP();\n const ttfbCallback = _trackTtfb();\n\n return () => {\n fidCallback();\n clsCallback();\n lcpCallback();\n ttfbCallback();\n };\n }\n\n return () => undefined;\n}\n\n/**\n * Start tracking long tasks.\n */\nfunction startTrackingLongTasks() {\n addPerformanceInstrumentationHandler('longtask', ({ entries }) => {\n for (const entry of entries) {\n // eslint-disable-next-line deprecation/deprecation\n const transaction = getActiveTransaction() ;\n if (!transaction) {\n return;\n }\n const startTime = msToSec((browserPerformanceTimeOrigin ) + entry.startTime);\n const duration = msToSec(entry.duration);\n\n // eslint-disable-next-line deprecation/deprecation\n transaction.startChild({\n description: 'Main UI thread blocked',\n op: 'ui.long-task',\n origin: 'auto.ui.browser.metrics',\n startTimestamp: startTime,\n endTimestamp: startTime + duration,\n });\n }\n });\n}\n\n/**\n * Start tracking interaction events.\n */\nfunction startTrackingInteractions() {\n addPerformanceInstrumentationHandler('event', ({ entries }) => {\n for (const entry of entries) {\n // eslint-disable-next-line deprecation/deprecation\n const transaction = getActiveTransaction() ;\n if (!transaction) {\n return;\n }\n\n if (entry.name === 'click') {\n const startTime = msToSec((browserPerformanceTimeOrigin ) + entry.startTime);\n const duration = msToSec(entry.duration);\n\n const span = {\n description: htmlTreeAsString(entry.target),\n op: `ui.interaction.${entry.name}`,\n origin: 'auto.ui.browser.metrics',\n startTimestamp: startTime,\n endTimestamp: startTime + duration,\n };\n\n const componentName = getComponentName(entry.target);\n if (componentName) {\n span.attributes = { 'ui.component_name': componentName };\n }\n\n // eslint-disable-next-line deprecation/deprecation\n transaction.startChild(span);\n }\n }\n });\n}\n\n/**\n * Start tracking INP webvital events.\n */\nfunction startTrackingINP(\n interactionIdtoRouteNameMapping,\n interactionsSampleRate,\n) {\n const performance = getBrowserPerformanceAPI();\n if (performance && browserPerformanceTimeOrigin) {\n const inpCallback = _trackINP(interactionIdtoRouteNameMapping, interactionsSampleRate);\n\n return () => {\n inpCallback();\n };\n }\n\n return () => undefined;\n}\n\n/** Starts tracking the Cumulative Layout Shift on the current page. */\nfunction _trackCLS() {\n return addClsInstrumentationHandler(({ metric }) => {\n const entry = metric.entries[metric.entries.length - 1];\n if (!entry) {\n return;\n }\n\n DEBUG_BUILD && logger.log('[Measurements] Adding CLS');\n _measurements['cls'] = { value: metric.value, unit: '' };\n _clsEntry = entry ;\n }, true);\n}\n\n/** Starts tracking the Largest Contentful Paint on the current page. */\nfunction _trackLCP() {\n return addLcpInstrumentationHandler(({ metric }) => {\n const entry = metric.entries[metric.entries.length - 1];\n if (!entry) {\n return;\n }\n\n DEBUG_BUILD && logger.log('[Measurements] Adding LCP');\n _measurements['lcp'] = { value: metric.value, unit: 'millisecond' };\n _lcpEntry = entry ;\n }, true);\n}\n\n/** Starts tracking the First Input Delay on the current page. */\nfunction _trackFID() {\n return addFidInstrumentationHandler(({ metric }) => {\n const entry = metric.entries[metric.entries.length - 1];\n if (!entry) {\n return;\n }\n\n const timeOrigin = msToSec(browserPerformanceTimeOrigin );\n const startTime = msToSec(entry.startTime);\n DEBUG_BUILD && logger.log('[Measurements] Adding FID');\n _measurements['fid'] = { value: metric.value, unit: 'millisecond' };\n _measurements['mark.fid'] = { value: timeOrigin + startTime, unit: 'second' };\n });\n}\n\nfunction _trackTtfb() {\n return addTtfbInstrumentationHandler(({ metric }) => {\n const entry = metric.entries[metric.entries.length - 1];\n if (!entry) {\n return;\n }\n\n DEBUG_BUILD && logger.log('[Measurements] Adding TTFB');\n _measurements['ttfb'] = { value: metric.value, unit: 'millisecond' };\n });\n}\n\nconst INP_ENTRY_MAP = {\n click: 'click',\n pointerdown: 'click',\n pointerup: 'click',\n mousedown: 'click',\n mouseup: 'click',\n touchstart: 'click',\n touchend: 'click',\n mouseover: 'hover',\n mouseout: 'hover',\n mouseenter: 'hover',\n mouseleave: 'hover',\n pointerover: 'hover',\n pointerout: 'hover',\n pointerenter: 'hover',\n pointerleave: 'hover',\n dragstart: 'drag',\n dragend: 'drag',\n drag: 'drag',\n dragenter: 'drag',\n dragleave: 'drag',\n dragover: 'drag',\n drop: 'drag',\n keydown: 'press',\n keyup: 'press',\n keypress: 'press',\n input: 'press',\n};\n\n/** Starts tracking the Interaction to Next Paint on the current page. */\nfunction _trackINP(\n interactionIdToRouteNameMapping,\n interactionsSampleRate,\n) {\n return addInpInstrumentationHandler(({ metric }) => {\n if (metric.value === undefined) {\n return;\n }\n const entry = metric.entries.find(\n entry => entry.duration === metric.value && INP_ENTRY_MAP[entry.name] !== undefined,\n );\n const client = getClient();\n if (!entry || !client) {\n return;\n }\n const interactionType = INP_ENTRY_MAP[entry.name];\n const options = client.getOptions();\n /** Build the INP span, create an envelope from the span, and then send the envelope */\n const startTime = msToSec((browserPerformanceTimeOrigin ) + entry.startTime);\n const duration = msToSec(metric.value);\n const interaction =\n entry.interactionId !== undefined ? interactionIdToRouteNameMapping[entry.interactionId] : undefined;\n if (interaction === undefined) {\n return;\n }\n const { routeName, parentContext, activeTransaction, user, replayId } = interaction;\n const userDisplay = user !== undefined ? user.email || user.id || user.ip_address : undefined;\n // eslint-disable-next-line deprecation/deprecation\n const profileId = activeTransaction !== undefined ? activeTransaction.getProfileId() : undefined;\n const span = new Span({\n startTimestamp: startTime,\n endTimestamp: startTime + duration,\n op: `ui.interaction.${interactionType}`,\n name: htmlTreeAsString(entry.target),\n attributes: {\n release: options.release,\n environment: options.environment,\n transaction: routeName,\n ...(userDisplay !== undefined && userDisplay !== '' ? { user: userDisplay } : {}),\n ...(profileId !== undefined ? { profile_id: profileId } : {}),\n ...(replayId !== undefined ? { replay_id: replayId } : {}),\n },\n exclusiveTime: metric.value,\n measurements: {\n inp: { value: metric.value, unit: 'millisecond' },\n },\n });\n\n /** Check to see if the span should be sampled */\n const sampleRate = getSampleRate(parentContext, options, interactionsSampleRate);\n\n if (!sampleRate) {\n return;\n }\n\n if (Math.random() < (sampleRate )) {\n const envelope = span ? createSpanEnvelope([span], client.getDsn()) : undefined;\n const transport = client && client.getTransport();\n if (transport && envelope) {\n transport.send(envelope).then(null, reason => {\n DEBUG_BUILD && logger.error('Error while sending interaction:', reason);\n });\n }\n return;\n }\n });\n}\n\n/** Add performance related spans to a transaction */\nfunction addPerformanceEntries(transaction) {\n const performance = getBrowserPerformanceAPI();\n if (!performance || !WINDOW.performance.getEntries || !browserPerformanceTimeOrigin) {\n // Gatekeeper if performance API not available\n return;\n }\n\n DEBUG_BUILD && logger.log('[Tracing] Adding & adjusting spans using Performance API');\n const timeOrigin = msToSec(browserPerformanceTimeOrigin);\n\n const performanceEntries = performance.getEntries();\n\n const { op, start_timestamp: transactionStartTime } = spanToJSON(transaction);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n performanceEntries.slice(_performanceCursor).forEach((entry) => {\n const startTime = msToSec(entry.startTime);\n const duration = msToSec(entry.duration);\n\n // eslint-disable-next-line deprecation/deprecation\n if (transaction.op === 'navigation' && transactionStartTime && timeOrigin + startTime < transactionStartTime) {\n return;\n }\n\n switch (entry.entryType) {\n case 'navigation': {\n _addNavigationSpans(transaction, entry, timeOrigin);\n break;\n }\n case 'mark':\n case 'paint':\n case 'measure': {\n _addMeasureSpans(transaction, entry, startTime, duration, timeOrigin);\n\n // capture web vitals\n const firstHidden = getVisibilityWatcher();\n // Only report if the page wasn't hidden prior to the web vital.\n const shouldRecord = entry.startTime < firstHidden.firstHiddenTime;\n\n if (entry.name === 'first-paint' && shouldRecord) {\n DEBUG_BUILD && logger.log('[Measurements] Adding FP');\n _measurements['fp'] = { value: entry.startTime, unit: 'millisecond' };\n }\n if (entry.name === 'first-contentful-paint' && shouldRecord) {\n DEBUG_BUILD && logger.log('[Measurements] Adding FCP');\n _measurements['fcp'] = { value: entry.startTime, unit: 'millisecond' };\n }\n break;\n }\n case 'resource': {\n _addResourceSpans(transaction, entry, entry.name , startTime, duration, timeOrigin);\n break;\n }\n // Ignore other entry types.\n }\n });\n\n _performanceCursor = Math.max(performanceEntries.length - 1, 0);\n\n _trackNavigator(transaction);\n\n // Measurements are only available for pageload transactions\n if (op === 'pageload') {\n _addTtfbRequestTimeToMeasurements(_measurements);\n\n ['fcp', 'fp', 'lcp'].forEach(name => {\n if (!_measurements[name] || !transactionStartTime || timeOrigin >= transactionStartTime) {\n return;\n }\n // The web vitals, fcp, fp, lcp, and ttfb, all measure relative to timeOrigin.\n // Unfortunately, timeOrigin is not captured within the transaction span data, so these web vitals will need\n // to be adjusted to be relative to transaction.startTimestamp.\n const oldValue = _measurements[name].value;\n const measurementTimestamp = timeOrigin + msToSec(oldValue);\n\n // normalizedValue should be in milliseconds\n const normalizedValue = Math.abs((measurementTimestamp - transactionStartTime) * 1000);\n const delta = normalizedValue - oldValue;\n\n DEBUG_BUILD && logger.log(`[Measurements] Normalized ${name} from ${oldValue} to ${normalizedValue} (${delta})`);\n _measurements[name].value = normalizedValue;\n });\n\n const fidMark = _measurements['mark.fid'];\n if (fidMark && _measurements['fid']) {\n // create span for FID\n _startChild(transaction, {\n description: 'first input delay',\n endTimestamp: fidMark.value + msToSec(_measurements['fid'].value),\n op: 'ui.action',\n origin: 'auto.ui.browser.metrics',\n startTimestamp: fidMark.value,\n });\n\n // Delete mark.fid as we don't want it to be part of final payload\n delete _measurements['mark.fid'];\n }\n\n // If FCP is not recorded we should not record the cls value\n // according to the new definition of CLS.\n if (!('fcp' in _measurements)) {\n delete _measurements.cls;\n }\n\n Object.keys(_measurements).forEach(measurementName => {\n setMeasurement(measurementName, _measurements[measurementName].value, _measurements[measurementName].unit);\n });\n\n _tagMetricInfo(transaction);\n }\n\n _lcpEntry = undefined;\n _clsEntry = undefined;\n _measurements = {};\n}\n\n/** Create measure related spans */\nfunction _addMeasureSpans(\n transaction,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n entry,\n startTime,\n duration,\n timeOrigin,\n) {\n const measureStartTimestamp = timeOrigin + startTime;\n const measureEndTimestamp = measureStartTimestamp + duration;\n\n _startChild(transaction, {\n description: entry.name ,\n endTimestamp: measureEndTimestamp,\n op: entry.entryType ,\n origin: 'auto.resource.browser.metrics',\n startTimestamp: measureStartTimestamp,\n });\n\n return measureStartTimestamp;\n}\n\n/** Instrument navigation entries */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _addNavigationSpans(transaction, entry, timeOrigin) {\n ['unloadEvent', 'redirect', 'domContentLoadedEvent', 'loadEvent', 'connect'].forEach(event => {\n _addPerformanceNavigationTiming(transaction, entry, event, timeOrigin);\n });\n _addPerformanceNavigationTiming(transaction, entry, 'secureConnection', timeOrigin, 'TLS/SSL', 'connectEnd');\n _addPerformanceNavigationTiming(transaction, entry, 'fetch', timeOrigin, 'cache', 'domainLookupStart');\n _addPerformanceNavigationTiming(transaction, entry, 'domainLookup', timeOrigin, 'DNS');\n _addRequest(transaction, entry, timeOrigin);\n}\n\n/** Create performance navigation related spans */\nfunction _addPerformanceNavigationTiming(\n transaction,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n entry,\n event,\n timeOrigin,\n description,\n eventEnd,\n) {\n const end = eventEnd ? (entry[eventEnd] ) : (entry[`${event}End`] );\n const start = entry[`${event}Start`] ;\n if (!start || !end) {\n return;\n }\n _startChild(transaction, {\n op: 'browser',\n origin: 'auto.browser.browser.metrics',\n description: description || event,\n startTimestamp: timeOrigin + msToSec(start),\n endTimestamp: timeOrigin + msToSec(end),\n });\n}\n\n/** Create request and response related spans */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _addRequest(transaction, entry, timeOrigin) {\n if (entry.responseEnd) {\n // It is possible that we are collecting these metrics when the page hasn't finished loading yet, for example when the HTML slowly streams in.\n // In this case, ie. when the document request hasn't finished yet, `entry.responseEnd` will be 0.\n // In order not to produce faulty spans, where the end timestamp is before the start timestamp, we will only collect\n // these spans when the responseEnd value is available. The backend (Relay) would drop the entire transaction if it contained faulty spans.\n _startChild(transaction, {\n op: 'browser',\n origin: 'auto.browser.browser.metrics',\n description: 'request',\n startTimestamp: timeOrigin + msToSec(entry.requestStart ),\n endTimestamp: timeOrigin + msToSec(entry.responseEnd ),\n });\n\n _startChild(transaction, {\n op: 'browser',\n origin: 'auto.browser.browser.metrics',\n description: 'response',\n startTimestamp: timeOrigin + msToSec(entry.responseStart ),\n endTimestamp: timeOrigin + msToSec(entry.responseEnd ),\n });\n }\n}\n\n/** Create resource-related spans */\nfunction _addResourceSpans(\n transaction,\n entry,\n resourceUrl,\n startTime,\n duration,\n timeOrigin,\n) {\n // we already instrument based on fetch and xhr, so we don't need to\n // duplicate spans here.\n if (entry.initiatorType === 'xmlhttprequest' || entry.initiatorType === 'fetch') {\n return;\n }\n\n const parsedUrl = parseUrl(resourceUrl);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const data = {};\n setResourceEntrySizeData(data, entry, 'transferSize', 'http.response_transfer_size');\n setResourceEntrySizeData(data, entry, 'encodedBodySize', 'http.response_content_length');\n setResourceEntrySizeData(data, entry, 'decodedBodySize', 'http.decoded_response_content_length');\n\n if ('renderBlockingStatus' in entry) {\n data['resource.render_blocking_status'] = entry.renderBlockingStatus;\n }\n if (parsedUrl.protocol) {\n data['url.scheme'] = parsedUrl.protocol.split(':').pop(); // the protocol returned by parseUrl includes a :, but OTEL spec does not, so we remove it.\n }\n\n if (parsedUrl.host) {\n data['server.address'] = parsedUrl.host;\n }\n\n data['url.same_origin'] = resourceUrl.includes(WINDOW.location.origin);\n\n const startTimestamp = timeOrigin + startTime;\n const endTimestamp = startTimestamp + duration;\n\n _startChild(transaction, {\n description: resourceUrl.replace(WINDOW.location.origin, ''),\n endTimestamp,\n op: entry.initiatorType ? `resource.${entry.initiatorType}` : 'resource.other',\n origin: 'auto.resource.browser.metrics',\n startTimestamp,\n data,\n });\n}\n\n/**\n * Capture the information of the user agent.\n */\nfunction _trackNavigator(transaction) {\n const navigator = WINDOW.navigator ;\n if (!navigator) {\n return;\n }\n\n // track network connectivity\n const connection = navigator.connection;\n if (connection) {\n if (connection.effectiveType) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('effectiveConnectionType', connection.effectiveType);\n }\n\n if (connection.type) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('connectionType', connection.type);\n }\n\n if (isMeasurementValue(connection.rtt)) {\n _measurements['connection.rtt'] = { value: connection.rtt, unit: 'millisecond' };\n }\n }\n\n if (isMeasurementValue(navigator.deviceMemory)) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('deviceMemory', `${navigator.deviceMemory} GB`);\n }\n\n if (isMeasurementValue(navigator.hardwareConcurrency)) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('hardwareConcurrency', String(navigator.hardwareConcurrency));\n }\n}\n\n/** Add LCP / CLS data to transaction to allow debugging */\nfunction _tagMetricInfo(transaction) {\n if (_lcpEntry) {\n DEBUG_BUILD && logger.log('[Measurements] Adding LCP Data');\n\n // Capture Properties of the LCP element that contributes to the LCP.\n\n if (_lcpEntry.element) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('lcp.element', htmlTreeAsString(_lcpEntry.element));\n }\n\n if (_lcpEntry.id) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('lcp.id', _lcpEntry.id);\n }\n\n if (_lcpEntry.url) {\n // Trim URL to the first 200 characters.\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('lcp.url', _lcpEntry.url.trim().slice(0, 200));\n }\n\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('lcp.size', _lcpEntry.size);\n }\n\n // See: https://developer.mozilla.org/en-US/docs/Web/API/LayoutShift\n if (_clsEntry && _clsEntry.sources) {\n DEBUG_BUILD && logger.log('[Measurements] Adding CLS Data');\n _clsEntry.sources.forEach((source, index) =>\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag(`cls.source.${index + 1}`, htmlTreeAsString(source.node)),\n );\n }\n}\n\nfunction setResourceEntrySizeData(\n data,\n entry,\n key,\n dataKey,\n) {\n const entryVal = entry[key];\n if (entryVal != null && entryVal < MAX_INT_AS_BYTES) {\n data[dataKey] = entryVal;\n }\n}\n\n/**\n * Add ttfb request time information to measurements.\n *\n * ttfb information is added via vendored web vitals library.\n */\nfunction _addTtfbRequestTimeToMeasurements(_measurements) {\n const navEntry = getNavigationEntry();\n if (!navEntry) {\n return;\n }\n\n const { responseStart, requestStart } = navEntry;\n\n if (requestStart <= responseStart) {\n DEBUG_BUILD && logger.log('[Measurements] Adding TTFB Request Time');\n _measurements['ttfb.requestTime'] = {\n value: responseStart - requestStart,\n unit: 'millisecond',\n };\n }\n}\n\n/** Taken from @sentry/core sampling.ts */\nfunction getSampleRate(\n transactionContext,\n options,\n interactionsSampleRate,\n) {\n if (!hasTracingEnabled(options)) {\n return false;\n }\n let sampleRate;\n if (transactionContext !== undefined && typeof options.tracesSampler === 'function') {\n sampleRate = options.tracesSampler({\n transactionContext,\n name: transactionContext.name,\n parentSampled: transactionContext.parentSampled,\n attributes: {\n // eslint-disable-next-line deprecation/deprecation\n ...transactionContext.data,\n ...transactionContext.attributes,\n },\n location: WINDOW.location,\n });\n } else if (transactionContext !== undefined && transactionContext.sampled !== undefined) {\n sampleRate = transactionContext.sampled;\n } else if (typeof options.tracesSampleRate !== 'undefined') {\n sampleRate = options.tracesSampleRate;\n } else {\n sampleRate = 1;\n }\n if (!isValidSampleRate(sampleRate)) {\n DEBUG_BUILD && logger.warn('[Tracing] Discarding interaction span because of invalid sample rate.');\n return false;\n }\n if (sampleRate === true) {\n return interactionsSampleRate;\n } else if (sampleRate === false) {\n return 0;\n }\n return sampleRate * interactionsSampleRate;\n}\n\nexport { _addMeasureSpans, _addResourceSpans, addPerformanceEntries, startTrackingINP, startTrackingInteractions, startTrackingLongTasks, startTrackingWebVitals };\n//# sourceMappingURL=index.js.map\n","import { hasTracingEnabled, getCurrentScope, getClient, startInactiveSpan, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, getIsolationScope, spanToTraceHeader, getDynamicSamplingContextFromSpan, getDynamicSamplingContextFromClient, setHttpStatus } from '@sentry/core';\nimport { parseUrl, generateSentryTraceHeader, dynamicSamplingContextToSentryBaggageHeader, isInstanceOf, BAGGAGE_HEADER_NAME } from '@sentry/utils';\n\n/**\n * Create and track fetch request spans for usage in combination with `addInstrumentationHandler`.\n *\n * @returns Span if a span was created, otherwise void.\n */\nfunction instrumentFetchRequest(\n handlerData,\n shouldCreateSpan,\n shouldAttachHeaders,\n spans,\n spanOrigin = 'auto.http.browser',\n) {\n if (!hasTracingEnabled() || !handlerData.fetchData) {\n return undefined;\n }\n\n const shouldCreateSpanResult = shouldCreateSpan(handlerData.fetchData.url);\n\n if (handlerData.endTimestamp && shouldCreateSpanResult) {\n const spanId = handlerData.fetchData.__span;\n if (!spanId) return;\n\n const span = spans[spanId];\n if (span) {\n endSpan(span, handlerData);\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete spans[spanId];\n }\n return undefined;\n }\n\n const scope = getCurrentScope();\n const client = getClient();\n\n const { method, url } = handlerData.fetchData;\n\n const fullUrl = getFullURL(url);\n const host = fullUrl ? parseUrl(fullUrl).host : undefined;\n\n const span = shouldCreateSpanResult\n ? startInactiveSpan({\n name: `${method} ${url}`,\n onlyIfParent: true,\n attributes: {\n url,\n type: 'fetch',\n 'http.method': method,\n 'http.url': fullUrl,\n 'server.address': host,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin,\n },\n op: 'http.client',\n })\n : undefined;\n\n if (span) {\n handlerData.fetchData.__span = span.spanContext().spanId;\n spans[span.spanContext().spanId] = span;\n }\n\n if (shouldAttachHeaders(handlerData.fetchData.url) && client) {\n const request = handlerData.args[0];\n\n // In case the user hasn't set the second argument of a fetch call we default it to `{}`.\n handlerData.args[1] = handlerData.args[1] || {};\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const options = handlerData.args[1];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n options.headers = addTracingHeadersToFetchRequest(request, client, scope, options, span);\n }\n\n return span;\n}\n\n/**\n * Adds sentry-trace and baggage headers to the various forms of fetch headers\n */\nfunction addTracingHeadersToFetchRequest(\n request, // unknown is actually type Request but we can't export DOM types from this package,\n client,\n scope,\n options\n\n,\n requestSpan,\n) {\n // eslint-disable-next-line deprecation/deprecation\n const span = requestSpan || scope.getSpan();\n\n const isolationScope = getIsolationScope();\n\n const { traceId, spanId, sampled, dsc } = {\n ...isolationScope.getPropagationContext(),\n ...scope.getPropagationContext(),\n };\n\n const sentryTraceHeader = span ? spanToTraceHeader(span) : generateSentryTraceHeader(traceId, spanId, sampled);\n\n const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(\n dsc ||\n (span ? getDynamicSamplingContextFromSpan(span) : getDynamicSamplingContextFromClient(traceId, client, scope)),\n );\n\n const headers =\n options.headers ||\n (typeof Request !== 'undefined' && isInstanceOf(request, Request) ? (request ).headers : undefined);\n\n if (!headers) {\n return { 'sentry-trace': sentryTraceHeader, baggage: sentryBaggageHeader };\n } else if (typeof Headers !== 'undefined' && isInstanceOf(headers, Headers)) {\n const newHeaders = new Headers(headers );\n\n newHeaders.append('sentry-trace', sentryTraceHeader);\n\n if (sentryBaggageHeader) {\n // If the same header is appended multiple times the browser will merge the values into a single request header.\n // Its therefore safe to simply push a \"baggage\" entry, even though there might already be another baggage header.\n newHeaders.append(BAGGAGE_HEADER_NAME, sentryBaggageHeader);\n }\n\n return newHeaders ;\n } else if (Array.isArray(headers)) {\n const newHeaders = [...headers, ['sentry-trace', sentryTraceHeader]];\n\n if (sentryBaggageHeader) {\n // If there are multiple entries with the same key, the browser will merge the values into a single request header.\n // Its therefore safe to simply push a \"baggage\" entry, even though there might already be another baggage header.\n newHeaders.push([BAGGAGE_HEADER_NAME, sentryBaggageHeader]);\n }\n\n return newHeaders ;\n } else {\n const existingBaggageHeader = 'baggage' in headers ? headers.baggage : undefined;\n const newBaggageHeaders = [];\n\n if (Array.isArray(existingBaggageHeader)) {\n newBaggageHeaders.push(...existingBaggageHeader);\n } else if (existingBaggageHeader) {\n newBaggageHeaders.push(existingBaggageHeader);\n }\n\n if (sentryBaggageHeader) {\n newBaggageHeaders.push(sentryBaggageHeader);\n }\n\n return {\n ...(headers ),\n 'sentry-trace': sentryTraceHeader,\n baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(',') : undefined,\n };\n }\n}\n\nfunction getFullURL(url) {\n try {\n const parsed = new URL(url);\n return parsed.href;\n } catch (e) {\n return undefined;\n }\n}\n\nfunction endSpan(span, handlerData) {\n if (handlerData.response) {\n setHttpStatus(span, handlerData.response.status);\n\n const contentLength =\n handlerData.response && handlerData.response.headers && handlerData.response.headers.get('content-length');\n\n if (contentLength) {\n const contentLengthNum = parseInt(contentLength);\n if (contentLengthNum > 0) {\n span.setAttribute('http.response_content_length', contentLengthNum);\n }\n }\n } else if (handlerData.error) {\n span.setStatus('internal_error');\n }\n span.end();\n}\n\nexport { addTracingHeadersToFetchRequest, instrumentFetchRequest };\n//# sourceMappingURL=fetch.js.map\n","import { spanToJSON, hasTracingEnabled, setHttpStatus, getCurrentScope, getIsolationScope, startInactiveSpan, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, getClient, spanToTraceHeader, getDynamicSamplingContextFromSpan, getDynamicSamplingContextFromClient } from '@sentry/core';\nimport { addFetchInstrumentationHandler, parseUrl, addXhrInstrumentationHandler, SENTRY_XHR_DATA_KEY, generateSentryTraceHeader, dynamicSamplingContextToSentryBaggageHeader, BAGGAGE_HEADER_NAME, browserPerformanceTimeOrigin, stringMatchesSomePattern } from '@sentry/utils';\nimport { instrumentFetchRequest } from '../common/fetch.js';\nimport { addPerformanceInstrumentationHandler } from './instrument.js';\nimport { WINDOW } from './types.js';\n\n/* eslint-disable max-lines */\n\nconst DEFAULT_TRACE_PROPAGATION_TARGETS = ['localhost', /^\\/(?!\\/)/];\n\n/** Options for Request Instrumentation */\n\nconst defaultRequestInstrumentationOptions = {\n traceFetch: true,\n traceXHR: true,\n enableHTTPTimings: true,\n // TODO (v8): Remove this property\n tracingOrigins: DEFAULT_TRACE_PROPAGATION_TARGETS,\n tracePropagationTargets: DEFAULT_TRACE_PROPAGATION_TARGETS,\n};\n\n/** Registers span creators for xhr and fetch requests */\nfunction instrumentOutgoingRequests(_options) {\n const {\n traceFetch,\n traceXHR,\n // eslint-disable-next-line deprecation/deprecation\n tracePropagationTargets,\n // eslint-disable-next-line deprecation/deprecation\n tracingOrigins,\n shouldCreateSpanForRequest,\n enableHTTPTimings,\n } = {\n traceFetch: defaultRequestInstrumentationOptions.traceFetch,\n traceXHR: defaultRequestInstrumentationOptions.traceXHR,\n ..._options,\n };\n\n const shouldCreateSpan =\n typeof shouldCreateSpanForRequest === 'function' ? shouldCreateSpanForRequest : (_) => true;\n\n // TODO(v8) Remove tracingOrigins here\n // The only reason we're passing it in here is because this instrumentOutgoingRequests function is publicly exported\n // and we don't want to break the API. We can remove it in v8.\n const shouldAttachHeadersWithTargets = (url) =>\n shouldAttachHeaders(url, tracePropagationTargets || tracingOrigins);\n\n const spans = {};\n\n if (traceFetch) {\n addFetchInstrumentationHandler(handlerData => {\n const createdSpan = instrumentFetchRequest(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);\n // We cannot use `window.location` in the generic fetch instrumentation,\n // but we need it for reliable `server.address` attribute.\n // so we extend this in here\n if (createdSpan) {\n const fullUrl = getFullURL(handlerData.fetchData.url);\n const host = fullUrl ? parseUrl(fullUrl).host : undefined;\n createdSpan.setAttributes({\n 'http.url': fullUrl,\n 'server.address': host,\n });\n }\n\n if (enableHTTPTimings && createdSpan) {\n addHTTPTimings(createdSpan);\n }\n });\n }\n\n if (traceXHR) {\n addXhrInstrumentationHandler(handlerData => {\n const createdSpan = xhrCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);\n if (enableHTTPTimings && createdSpan) {\n addHTTPTimings(createdSpan);\n }\n });\n }\n}\n\nfunction isPerformanceResourceTiming(entry) {\n return (\n entry.entryType === 'resource' &&\n 'initiatorType' in entry &&\n typeof (entry ).nextHopProtocol === 'string' &&\n (entry.initiatorType === 'fetch' || entry.initiatorType === 'xmlhttprequest')\n );\n}\n\n/**\n * Creates a temporary observer to listen to the next fetch/xhr resourcing timings,\n * so that when timings hit their per-browser limit they don't need to be removed.\n *\n * @param span A span that has yet to be finished, must contain `url` on data.\n */\nfunction addHTTPTimings(span) {\n const { url } = spanToJSON(span).data || {};\n\n if (!url || typeof url !== 'string') {\n return;\n }\n\n const cleanup = addPerformanceInstrumentationHandler('resource', ({ entries }) => {\n entries.forEach(entry => {\n if (isPerformanceResourceTiming(entry) && entry.name.endsWith(url)) {\n const spanData = resourceTimingEntryToSpanData(entry);\n spanData.forEach(data => span.setAttribute(...data));\n // In the next tick, clean this handler up\n // We have to wait here because otherwise this cleans itself up before it is fully done\n setTimeout(cleanup);\n }\n });\n });\n}\n\n/**\n * Converts ALPN protocol ids to name and version.\n *\n * (https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids)\n * @param nextHopProtocol PerformanceResourceTiming.nextHopProtocol\n */\nfunction extractNetworkProtocol(nextHopProtocol) {\n let name = 'unknown';\n let version = 'unknown';\n let _name = '';\n for (const char of nextHopProtocol) {\n // http/1.1 etc.\n if (char === '/') {\n [name, version] = nextHopProtocol.split('/');\n break;\n }\n // h2, h3 etc.\n if (!isNaN(Number(char))) {\n name = _name === 'h' ? 'http' : _name;\n version = nextHopProtocol.split(_name)[1];\n break;\n }\n _name += char;\n }\n if (_name === nextHopProtocol) {\n // webrtc, ftp, etc.\n name = _name;\n }\n return { name, version };\n}\n\nfunction getAbsoluteTime(time = 0) {\n return ((browserPerformanceTimeOrigin || performance.timeOrigin) + time) / 1000;\n}\n\nfunction resourceTimingEntryToSpanData(resourceTiming) {\n const { name, version } = extractNetworkProtocol(resourceTiming.nextHopProtocol);\n\n const timingSpanData = [];\n\n timingSpanData.push(['network.protocol.version', version], ['network.protocol.name', name]);\n\n if (!browserPerformanceTimeOrigin) {\n return timingSpanData;\n }\n return [\n ...timingSpanData,\n ['http.request.redirect_start', getAbsoluteTime(resourceTiming.redirectStart)],\n ['http.request.fetch_start', getAbsoluteTime(resourceTiming.fetchStart)],\n ['http.request.domain_lookup_start', getAbsoluteTime(resourceTiming.domainLookupStart)],\n ['http.request.domain_lookup_end', getAbsoluteTime(resourceTiming.domainLookupEnd)],\n ['http.request.connect_start', getAbsoluteTime(resourceTiming.connectStart)],\n ['http.request.secure_connection_start', getAbsoluteTime(resourceTiming.secureConnectionStart)],\n ['http.request.connection_end', getAbsoluteTime(resourceTiming.connectEnd)],\n ['http.request.request_start', getAbsoluteTime(resourceTiming.requestStart)],\n ['http.request.response_start', getAbsoluteTime(resourceTiming.responseStart)],\n ['http.request.response_end', getAbsoluteTime(resourceTiming.responseEnd)],\n ];\n}\n\n/**\n * A function that determines whether to attach tracing headers to a request.\n * This was extracted from `instrumentOutgoingRequests` to make it easier to test shouldAttachHeaders.\n * We only export this fuction for testing purposes.\n */\nfunction shouldAttachHeaders(url, tracePropagationTargets) {\n return stringMatchesSomePattern(url, tracePropagationTargets || DEFAULT_TRACE_PROPAGATION_TARGETS);\n}\n\n/**\n * Create and track xhr request spans\n *\n * @returns Span if a span was created, otherwise void.\n */\n// eslint-disable-next-line complexity\nfunction xhrCallback(\n handlerData,\n shouldCreateSpan,\n shouldAttachHeaders,\n spans,\n) {\n const xhr = handlerData.xhr;\n const sentryXhrData = xhr && xhr[SENTRY_XHR_DATA_KEY];\n\n if (!hasTracingEnabled() || !xhr || xhr.__sentry_own_request__ || !sentryXhrData) {\n return undefined;\n }\n\n const shouldCreateSpanResult = shouldCreateSpan(sentryXhrData.url);\n\n // check first if the request has finished and is tracked by an existing span which should now end\n if (handlerData.endTimestamp && shouldCreateSpanResult) {\n const spanId = xhr.__sentry_xhr_span_id__;\n if (!spanId) return;\n\n const span = spans[spanId];\n if (span && sentryXhrData.status_code !== undefined) {\n setHttpStatus(span, sentryXhrData.status_code);\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete spans[spanId];\n }\n return undefined;\n }\n\n const scope = getCurrentScope();\n const isolationScope = getIsolationScope();\n\n const fullUrl = getFullURL(sentryXhrData.url);\n const host = fullUrl ? parseUrl(fullUrl).host : undefined;\n\n const span = shouldCreateSpanResult\n ? startInactiveSpan({\n name: `${sentryXhrData.method} ${sentryXhrData.url}`,\n onlyIfParent: true,\n attributes: {\n type: 'xhr',\n 'http.method': sentryXhrData.method,\n 'http.url': fullUrl,\n url: sentryXhrData.url,\n 'server.address': host,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.browser',\n },\n op: 'http.client',\n })\n : undefined;\n\n if (span) {\n xhr.__sentry_xhr_span_id__ = span.spanContext().spanId;\n spans[xhr.__sentry_xhr_span_id__] = span;\n }\n\n const client = getClient();\n\n if (xhr.setRequestHeader && shouldAttachHeaders(sentryXhrData.url) && client) {\n const { traceId, spanId, sampled, dsc } = {\n ...isolationScope.getPropagationContext(),\n ...scope.getPropagationContext(),\n };\n\n const sentryTraceHeader = span ? spanToTraceHeader(span) : generateSentryTraceHeader(traceId, spanId, sampled);\n\n const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(\n dsc ||\n (span ? getDynamicSamplingContextFromSpan(span) : getDynamicSamplingContextFromClient(traceId, client, scope)),\n );\n\n setHeaderOnXhr(xhr, sentryTraceHeader, sentryBaggageHeader);\n }\n\n return span;\n}\n\nfunction setHeaderOnXhr(\n xhr,\n sentryTraceHeader,\n sentryBaggageHeader,\n) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n xhr.setRequestHeader('sentry-trace', sentryTraceHeader);\n if (sentryBaggageHeader) {\n // From MDN: \"If this method is called several times with the same header, the values are merged into one single request header.\"\n // We can therefore simply set a baggage header without checking what was there before\n // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/setRequestHeader\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n xhr.setRequestHeader(BAGGAGE_HEADER_NAME, sentryBaggageHeader);\n }\n } catch (_) {\n // Error: InvalidStateError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.\n }\n}\n\nfunction getFullURL(url) {\n try {\n // By adding a base URL to new URL(), this will also work for relative urls\n // If `url` is a full URL, the base URL is ignored anyhow\n const parsed = new URL(url, WINDOW.location.origin);\n return parsed.href;\n } catch (e) {\n return undefined;\n }\n}\n\nexport { DEFAULT_TRACE_PROPAGATION_TARGETS, defaultRequestInstrumentationOptions, extractNetworkProtocol, instrumentOutgoingRequests, shouldAttachHeaders, xhrCallback };\n//# sourceMappingURL=request.js.map\n","import { logger, browserPerformanceTimeOrigin, addHistoryInstrumentationHandler } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../common/debug-build.js';\nimport { WINDOW } from './types.js';\n\n/**\n * Default function implementing pageload and navigation transactions\n */\nfunction instrumentRoutingWithDefaults(\n customStartTransaction,\n startTransactionOnPageLoad = true,\n startTransactionOnLocationChange = true,\n) {\n if (!WINDOW || !WINDOW.location) {\n DEBUG_BUILD && logger.warn('Could not initialize routing instrumentation due to invalid location');\n return;\n }\n\n let startingUrl = WINDOW.location.href;\n\n let activeTransaction;\n if (startTransactionOnPageLoad) {\n activeTransaction = customStartTransaction({\n name: WINDOW.location.pathname,\n // pageload should always start at timeOrigin (and needs to be in s, not ms)\n startTimestamp: browserPerformanceTimeOrigin ? browserPerformanceTimeOrigin / 1000 : undefined,\n op: 'pageload',\n origin: 'auto.pageload.browser',\n metadata: { source: 'url' },\n });\n }\n\n if (startTransactionOnLocationChange) {\n addHistoryInstrumentationHandler(({ to, from }) => {\n /**\n * This early return is there to account for some cases where a navigation transaction starts right after\n * long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't\n * create an uneccessary navigation transaction.\n *\n * This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also\n * only be caused in certain development environments where the usage of a hot module reloader is causing\n * errors.\n */\n if (from === undefined && startingUrl && startingUrl.indexOf(to) !== -1) {\n startingUrl = undefined;\n return;\n }\n\n if (from !== to) {\n startingUrl = undefined;\n if (activeTransaction) {\n DEBUG_BUILD && logger.log(`[Tracing] Finishing current transaction with op: ${activeTransaction.op}`);\n // If there's an open transaction on the scope, we need to finish it before creating an new one.\n activeTransaction.end();\n }\n activeTransaction = customStartTransaction({\n name: WINDOW.location.pathname,\n op: 'navigation',\n origin: 'auto.navigation.browser',\n metadata: { source: 'url' },\n });\n }\n });\n }\n}\n\nexport { instrumentRoutingWithDefaults };\n//# sourceMappingURL=router.js.map\n","import { TRACING_DEFAULTS, addTracingExtensions, startIdleTransaction, getActiveTransaction, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, getClient, getCurrentScope } from '@sentry/core';\nimport { logger, propagationContextFromHeaders, getDomElement } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../common/debug-build.js';\nimport { registerBackgroundTabDetection } from './backgroundtab.js';\nimport { addPerformanceInstrumentationHandler } from './instrument.js';\nimport { startTrackingWebVitals, startTrackingINP, startTrackingLongTasks, startTrackingInteractions, addPerformanceEntries } from './metrics/index.js';\nimport { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './request.js';\nimport { instrumentRoutingWithDefaults } from './router.js';\nimport { WINDOW } from './types.js';\n\nconst BROWSER_TRACING_INTEGRATION_ID = 'BrowserTracing';\n\n/** Options for Browser Tracing integration */\n\nconst DEFAULT_BROWSER_TRACING_OPTIONS = {\n ...TRACING_DEFAULTS,\n markBackgroundTransactions: true,\n routingInstrumentation: instrumentRoutingWithDefaults,\n startTransactionOnLocationChange: true,\n startTransactionOnPageLoad: true,\n enableLongTask: true,\n enableInp: false,\n interactionsSampleRate: 1,\n _experiments: {},\n ...defaultRequestInstrumentationOptions,\n};\n\n/** We store up to 10 interaction candidates max to cap memory usage. This is the same cap as getINP from web-vitals */\nconst MAX_INTERACTIONS = 10;\n\n/**\n * The Browser Tracing integration automatically instruments browser pageload/navigation\n * actions as transactions, and captures requests, metrics and errors as spans.\n *\n * The integration can be configured with a variety of options, and can be extended to use\n * any routing library. This integration uses {@see IdleTransaction} to create transactions.\n *\n * @deprecated Use `browserTracingIntegration()` instead.\n */\nclass BrowserTracing {\n // This class currently doesn't have a static `id` field like the other integration classes, because it prevented\n // @sentry/tracing from being treeshaken. Tree shakers do not like static fields, because they behave like side effects.\n // TODO: Come up with a better plan, than using static fields on integration classes, and use that plan on all\n // integrations.\n\n /** Browser Tracing integration options */\n\n /**\n * @inheritDoc\n */\n\n // eslint-disable-next-line deprecation/deprecation\n\n constructor(_options) {\n this.name = BROWSER_TRACING_INTEGRATION_ID;\n this._hasSetTracePropagationTargets = false;\n\n addTracingExtensions();\n\n if (DEBUG_BUILD) {\n this._hasSetTracePropagationTargets = !!(\n _options &&\n // eslint-disable-next-line deprecation/deprecation\n (_options.tracePropagationTargets || _options.tracingOrigins)\n );\n }\n\n this.options = {\n ...DEFAULT_BROWSER_TRACING_OPTIONS,\n ..._options,\n };\n\n // Special case: enableLongTask can be set in _experiments\n // TODO (v8): Remove this in v8\n if (this.options._experiments.enableLongTask !== undefined) {\n this.options.enableLongTask = this.options._experiments.enableLongTask;\n }\n\n // TODO (v8): remove this block after tracingOrigins is removed\n // Set tracePropagationTargets to tracingOrigins if specified by the user\n // In case both are specified, tracePropagationTargets takes precedence\n // eslint-disable-next-line deprecation/deprecation\n if (_options && !_options.tracePropagationTargets && _options.tracingOrigins) {\n // eslint-disable-next-line deprecation/deprecation\n this.options.tracePropagationTargets = _options.tracingOrigins;\n }\n\n this._collectWebVitals = startTrackingWebVitals();\n /** Stores a mapping of interactionIds from PerformanceEventTimings to the origin interaction path */\n this._interactionIdToRouteNameMapping = {};\n\n if (this.options.enableInp) {\n startTrackingINP(this._interactionIdToRouteNameMapping, this.options.interactionsSampleRate);\n }\n if (this.options.enableLongTask) {\n startTrackingLongTasks();\n }\n if (this.options._experiments.enableInteractions) {\n startTrackingInteractions();\n }\n\n this._latestRoute = {\n name: undefined,\n context: undefined,\n };\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line deprecation/deprecation\n setupOnce(_, getCurrentHub) {\n this._getCurrentHub = getCurrentHub;\n const hub = getCurrentHub();\n // eslint-disable-next-line deprecation/deprecation\n const client = hub.getClient();\n const clientOptions = client && client.getOptions();\n\n const {\n routingInstrumentation: instrumentRouting,\n startTransactionOnLocationChange,\n startTransactionOnPageLoad,\n markBackgroundTransactions,\n traceFetch,\n traceXHR,\n shouldCreateSpanForRequest,\n enableHTTPTimings,\n _experiments,\n } = this.options;\n\n const clientOptionsTracePropagationTargets = clientOptions && clientOptions.tracePropagationTargets;\n // There are three ways to configure tracePropagationTargets:\n // 1. via top level client option `tracePropagationTargets`\n // 2. via BrowserTracing option `tracePropagationTargets`\n // 3. via BrowserTracing option `tracingOrigins` (deprecated)\n //\n // To avoid confusion, favour top level client option `tracePropagationTargets`, and fallback to\n // BrowserTracing option `tracePropagationTargets` and then `tracingOrigins` (deprecated).\n // This is done as it minimizes bundle size (we don't have to have undefined checks).\n //\n // If both 1 and either one of 2 or 3 are set (from above), we log out a warning.\n // eslint-disable-next-line deprecation/deprecation\n const tracePropagationTargets = clientOptionsTracePropagationTargets || this.options.tracePropagationTargets;\n if (DEBUG_BUILD && this._hasSetTracePropagationTargets && clientOptionsTracePropagationTargets) {\n logger.warn(\n '[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used.',\n );\n }\n\n instrumentRouting(\n (context) => {\n const transaction = this._createRouteTransaction(context);\n\n this.options._experiments.onStartRouteTransaction &&\n this.options._experiments.onStartRouteTransaction(transaction, context, getCurrentHub);\n\n return transaction;\n },\n startTransactionOnPageLoad,\n startTransactionOnLocationChange,\n );\n\n if (markBackgroundTransactions) {\n registerBackgroundTabDetection();\n }\n\n if (_experiments.enableInteractions) {\n this._registerInteractionListener();\n }\n\n if (this.options.enableInp) {\n this._registerInpInteractionListener();\n }\n\n instrumentOutgoingRequests({\n traceFetch,\n traceXHR,\n tracePropagationTargets,\n shouldCreateSpanForRequest,\n enableHTTPTimings,\n });\n }\n\n /** Create routing idle transaction. */\n _createRouteTransaction(context) {\n if (!this._getCurrentHub) {\n DEBUG_BUILD &&\n logger.warn(`[Tracing] Did not create ${context.op} transaction because _getCurrentHub is invalid.`);\n return undefined;\n }\n\n const hub = this._getCurrentHub();\n\n const { beforeNavigate, idleTimeout, finalTimeout, heartbeatInterval } = this.options;\n\n const isPageloadTransaction = context.op === 'pageload';\n\n let expandedContext;\n if (isPageloadTransaction) {\n const sentryTrace = isPageloadTransaction ? getMetaContent('sentry-trace') : '';\n const baggage = isPageloadTransaction ? getMetaContent('baggage') : undefined;\n const { traceId, dsc, parentSpanId, sampled } = propagationContextFromHeaders(sentryTrace, baggage);\n expandedContext = {\n traceId,\n parentSpanId,\n parentSampled: sampled,\n ...context,\n metadata: {\n // eslint-disable-next-line deprecation/deprecation\n ...context.metadata,\n dynamicSamplingContext: dsc,\n },\n trimEnd: true,\n };\n } else {\n expandedContext = {\n trimEnd: true,\n ...context,\n };\n }\n\n const modifiedContext = typeof beforeNavigate === 'function' ? beforeNavigate(expandedContext) : expandedContext;\n\n // For backwards compatibility reasons, beforeNavigate can return undefined to \"drop\" the transaction (prevent it\n // from being sent to Sentry).\n const finalContext = modifiedContext === undefined ? { ...expandedContext, sampled: false } : modifiedContext;\n\n // If `beforeNavigate` set a custom name, record that fact\n // eslint-disable-next-line deprecation/deprecation\n finalContext.metadata =\n finalContext.name !== expandedContext.name\n ? // eslint-disable-next-line deprecation/deprecation\n { ...finalContext.metadata, source: 'custom' }\n : // eslint-disable-next-line deprecation/deprecation\n finalContext.metadata;\n\n this._latestRoute.name = finalContext.name;\n this._latestRoute.context = finalContext;\n\n // eslint-disable-next-line deprecation/deprecation\n if (finalContext.sampled === false) {\n DEBUG_BUILD && logger.log(`[Tracing] Will not send ${finalContext.op} transaction because of beforeNavigate.`);\n }\n\n DEBUG_BUILD && logger.log(`[Tracing] Starting ${finalContext.op} transaction on scope`);\n\n const { location } = WINDOW;\n\n const idleTransaction = startIdleTransaction(\n hub,\n finalContext,\n idleTimeout,\n finalTimeout,\n true,\n { location }, // for use in the tracesSampler\n heartbeatInterval,\n isPageloadTransaction, // should wait for finish signal if it's a pageload transaction\n );\n\n if (isPageloadTransaction) {\n if (WINDOW.document) {\n WINDOW.document.addEventListener('readystatechange', () => {\n if (['interactive', 'complete'].includes(WINDOW.document.readyState)) {\n idleTransaction.sendAutoFinishSignal();\n }\n });\n\n if (['interactive', 'complete'].includes(WINDOW.document.readyState)) {\n idleTransaction.sendAutoFinishSignal();\n }\n }\n }\n\n idleTransaction.registerBeforeFinishCallback(transaction => {\n this._collectWebVitals();\n addPerformanceEntries(transaction);\n });\n\n return idleTransaction ;\n }\n\n /** Start listener for interaction transactions */\n _registerInteractionListener() {\n let inflightInteractionTransaction;\n const registerInteractionTransaction = () => {\n const { idleTimeout, finalTimeout, heartbeatInterval } = this.options;\n const op = 'ui.action.click';\n\n // eslint-disable-next-line deprecation/deprecation\n const currentTransaction = getActiveTransaction();\n if (currentTransaction && currentTransaction.op && ['navigation', 'pageload'].includes(currentTransaction.op)) {\n DEBUG_BUILD &&\n logger.warn(\n `[Tracing] Did not create ${op} transaction because a pageload or navigation transaction is in progress.`,\n );\n return undefined;\n }\n\n if (inflightInteractionTransaction) {\n inflightInteractionTransaction.setFinishReason('interactionInterrupted');\n inflightInteractionTransaction.end();\n inflightInteractionTransaction = undefined;\n }\n\n if (!this._getCurrentHub) {\n DEBUG_BUILD && logger.warn(`[Tracing] Did not create ${op} transaction because _getCurrentHub is invalid.`);\n return undefined;\n }\n\n if (!this._latestRoute.name) {\n DEBUG_BUILD && logger.warn(`[Tracing] Did not create ${op} transaction because _latestRouteName is missing.`);\n return undefined;\n }\n\n const hub = this._getCurrentHub();\n const { location } = WINDOW;\n\n const context = {\n name: this._latestRoute.name,\n op,\n trimEnd: true,\n data: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: this._latestRoute.context\n ? getSource(this._latestRoute.context)\n : 'url',\n },\n };\n\n inflightInteractionTransaction = startIdleTransaction(\n hub,\n context,\n idleTimeout,\n finalTimeout,\n true,\n { location }, // for use in the tracesSampler\n heartbeatInterval,\n );\n };\n\n ['click'].forEach(type => {\n if (WINDOW.document) {\n addEventListener(type, registerInteractionTransaction, { once: false, capture: true });\n }\n });\n }\n\n /** Creates a listener on interaction entries, and maps interactionIds to the origin path of the interaction */\n _registerInpInteractionListener() {\n const handleEntries = ({ entries }) => {\n const client = getClient();\n // We need to get the replay, user, and activeTransaction from the current scope\n // so that we can associate replay id, profile id, and a user display to the span\n const replay =\n client !== undefined && client.getIntegrationByName !== undefined\n ? (client.getIntegrationByName('Replay') )\n : undefined;\n const replayId = replay !== undefined ? replay.getReplayId() : undefined;\n // eslint-disable-next-line deprecation/deprecation\n const activeTransaction = getActiveTransaction();\n const currentScope = getCurrentScope();\n const user = currentScope !== undefined ? currentScope.getUser() : undefined;\n entries.forEach(entry => {\n if (isPerformanceEventTiming(entry)) {\n const interactionId = entry.interactionId;\n if (interactionId === undefined) {\n return;\n }\n const existingInteraction = this._interactionIdToRouteNameMapping[interactionId];\n const duration = entry.duration;\n const startTime = entry.startTime;\n const keys = Object.keys(this._interactionIdToRouteNameMapping);\n const minInteractionId =\n keys.length > 0\n ? keys.reduce((a, b) => {\n return this._interactionIdToRouteNameMapping[a].duration <\n this._interactionIdToRouteNameMapping[b].duration\n ? a\n : b;\n })\n : undefined;\n // For a first input event to be considered, we must check that an interaction event does not already exist with the same duration and start time.\n // This is also checked in the web-vitals library.\n if (entry.entryType === 'first-input') {\n const matchingEntry = keys\n .map(key => this._interactionIdToRouteNameMapping[key])\n .some(interaction => {\n return interaction.duration === duration && interaction.startTime === startTime;\n });\n if (matchingEntry) {\n return;\n }\n }\n // Interactions with an id of 0 and are not first-input are not valid.\n if (!interactionId) {\n return;\n }\n // If the interaction already exists, we want to use the duration of the longest entry, since that is what the INP metric uses.\n if (existingInteraction) {\n existingInteraction.duration = Math.max(existingInteraction.duration, duration);\n } else if (\n keys.length < MAX_INTERACTIONS ||\n minInteractionId === undefined ||\n duration > this._interactionIdToRouteNameMapping[minInteractionId].duration\n ) {\n // If the interaction does not exist, we want to add it to the mapping if there is space, or if the duration is longer than the shortest entry.\n const routeName = this._latestRoute.name;\n const parentContext = this._latestRoute.context;\n if (routeName && parentContext) {\n if (minInteractionId && Object.keys(this._interactionIdToRouteNameMapping).length >= MAX_INTERACTIONS) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._interactionIdToRouteNameMapping[minInteractionId];\n }\n this._interactionIdToRouteNameMapping[interactionId] = {\n routeName,\n duration,\n parentContext,\n user,\n activeTransaction,\n replayId,\n startTime,\n };\n }\n }\n }\n });\n };\n addPerformanceInstrumentationHandler('event', handleEntries);\n addPerformanceInstrumentationHandler('first-input', handleEntries);\n }\n}\n\n/** Returns the value of a meta tag */\nfunction getMetaContent(metaName) {\n // Can't specify generic to `getDomElement` because tracing can be used\n // in a variety of environments, have to disable `no-unsafe-member-access`\n // as a result.\n const metaTag = getDomElement(`meta[name=${metaName}]`);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return metaTag ? metaTag.getAttribute('content') : undefined;\n}\n\nfunction getSource(context) {\n const sourceFromAttributes = context.attributes && context.attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];\n // eslint-disable-next-line deprecation/deprecation\n const sourceFromData = context.data && context.data[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];\n // eslint-disable-next-line deprecation/deprecation\n const sourceFromMetadata = context.metadata && context.metadata.source;\n\n return sourceFromAttributes || sourceFromData || sourceFromMetadata;\n}\n\nfunction isPerformanceEventTiming(entry) {\n return 'duration' in entry;\n}\n\nexport { BROWSER_TRACING_INTEGRATION_ID, BrowserTracing, getMetaContent };\n//# sourceMappingURL=browsertracing.js.map\n","import '@sentry-internal/tracing';\nimport { withScope, captureException } from '@sentry/core';\nimport { GLOBAL_OBJ, getOriginalFunction, markFunctionWrapped, addNonEnumerableProperty, addExceptionTypeValue, addExceptionMechanism } from '@sentry/utils';\n\nconst WINDOW = GLOBAL_OBJ ;\n\nlet ignoreOnError = 0;\n\n/**\n * @hidden\n */\nfunction shouldIgnoreOnError() {\n return ignoreOnError > 0;\n}\n\n/**\n * @hidden\n */\nfunction ignoreNextOnError() {\n // onerror should trigger before setTimeout\n ignoreOnError++;\n setTimeout(() => {\n ignoreOnError--;\n });\n}\n\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always\n * has a correct `this` context.\n * @returns The wrapped function.\n * @hidden\n */\nfunction wrap(\n fn,\n options\n\n = {},\n before,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n) {\n // for future readers what this does is wrap a function and then create\n // a bi-directional wrapping between them.\n //\n // example: wrapped = wrap(original);\n // original.__sentry_wrapped__ -> wrapped\n // wrapped.__sentry_original__ -> original\n\n if (typeof fn !== 'function') {\n return fn;\n }\n\n try {\n // if we're dealing with a function that was previously wrapped, return\n // the original wrapper.\n const wrapper = fn.__sentry_wrapped__;\n if (wrapper) {\n return wrapper;\n }\n\n // We don't wanna wrap it twice\n if (getOriginalFunction(fn)) {\n return fn;\n }\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n // Bail on wrapping and return the function as-is (defers to window.onerror).\n return fn;\n }\n\n /* eslint-disable prefer-rest-params */\n // It is important that `sentryWrapped` is not an arrow function to preserve the context of `this`\n const sentryWrapped = function () {\n const args = Array.prototype.slice.call(arguments);\n\n try {\n if (before && typeof before === 'function') {\n before.apply(this, arguments);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n const wrappedArguments = args.map((arg) => wrap(arg, options));\n\n // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n return fn.apply(this, wrappedArguments);\n } catch (ex) {\n ignoreNextOnError();\n\n withScope(scope => {\n scope.addEventProcessor(event => {\n if (options.mechanism) {\n addExceptionTypeValue(event, undefined, undefined);\n addExceptionMechanism(event, options.mechanism);\n }\n\n event.extra = {\n ...event.extra,\n arguments: args,\n };\n\n return event;\n });\n\n captureException(ex);\n });\n\n throw ex;\n }\n };\n /* eslint-enable prefer-rest-params */\n\n // Accessing some objects may throw\n // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n try {\n for (const property in fn) {\n if (Object.prototype.hasOwnProperty.call(fn, property)) {\n sentryWrapped[property] = fn[property];\n }\n }\n } catch (_oO) {} // eslint-disable-line no-empty\n\n // Signal that this function has been wrapped/filled already\n // for both debugging and to prevent it to being wrapped/filled twice\n markFunctionWrapped(sentryWrapped, fn);\n\n addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);\n\n // Restore original function name (not all browsers allow that)\n try {\n const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') ;\n if (descriptor.configurable) {\n Object.defineProperty(sentryWrapped, 'name', {\n get() {\n return fn.name;\n },\n });\n }\n // eslint-disable-next-line no-empty\n } catch (_oO) {}\n\n return sentryWrapped;\n}\n\nexport { WINDOW, ignoreNextOnError, shouldIgnoreOnError, wrap };\n//# sourceMappingURL=helpers.js.map\n","/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nconst DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);\n\nexport { DEBUG_BUILD };\n//# sourceMappingURL=debug-build.js.map\n","import { getClient } from '@sentry/core';\nimport { addExceptionMechanism, resolvedSyncPromise, isErrorEvent, isDOMError, isDOMException, addExceptionTypeValue, isError, isPlainObject, isEvent, isParameterizedString, normalizeToSize, extractExceptionKeysForMessage } from '@sentry/utils';\n\n/**\n * This function creates an exception from a JavaScript Error\n */\nfunction exceptionFromError(stackParser, ex) {\n // Get the frames first since Opera can lose the stack if we touch anything else first\n const frames = parseStackFrames(stackParser, ex);\n\n const exception = {\n type: ex && ex.name,\n value: extractMessage(ex),\n };\n\n if (frames.length) {\n exception.stacktrace = { frames };\n }\n\n if (exception.type === undefined && exception.value === '') {\n exception.value = 'Unrecoverable error caught';\n }\n\n return exception;\n}\n\n/**\n * @hidden\n */\nfunction eventFromPlainObject(\n stackParser,\n exception,\n syntheticException,\n isUnhandledRejection,\n) {\n const client = getClient();\n const normalizeDepth = client && client.getOptions().normalizeDepth;\n\n const event = {\n exception: {\n values: [\n {\n type: isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',\n value: getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }),\n },\n ],\n },\n extra: {\n __serialized__: normalizeToSize(exception, normalizeDepth),\n },\n };\n\n if (syntheticException) {\n const frames = parseStackFrames(stackParser, syntheticException);\n if (frames.length) {\n // event.exception.values[0] has been set above\n (event.exception ).values[0].stacktrace = { frames };\n }\n }\n\n return event;\n}\n\n/**\n * @hidden\n */\nfunction eventFromError(stackParser, ex) {\n return {\n exception: {\n values: [exceptionFromError(stackParser, ex)],\n },\n };\n}\n\n/** Parses stack frames from an error */\nfunction parseStackFrames(\n stackParser,\n ex,\n) {\n // Access and store the stacktrace property before doing ANYTHING\n // else to it because Opera is not very good at providing it\n // reliably in other circumstances.\n const stacktrace = ex.stacktrace || ex.stack || '';\n\n const popSize = getPopSize(ex);\n\n try {\n return stackParser(stacktrace, popSize);\n } catch (e) {\n // no-empty\n }\n\n return [];\n}\n\n// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108\nconst reactMinifiedRegexp = /Minified React error #\\d+;/i;\n\nfunction getPopSize(ex) {\n if (ex) {\n if (typeof ex.framesToPop === 'number') {\n return ex.framesToPop;\n }\n\n if (reactMinifiedRegexp.test(ex.message)) {\n return 1;\n }\n }\n\n return 0;\n}\n\n/**\n * There are cases where stacktrace.message is an Event object\n * https://github.com/getsentry/sentry-javascript/issues/1949\n * In this specific case we try to extract stacktrace.message.error.message\n */\nfunction extractMessage(ex) {\n const message = ex && ex.message;\n if (!message) {\n return 'No error message';\n }\n if (message.error && typeof message.error.message === 'string') {\n return message.error.message;\n }\n return message;\n}\n\n/**\n * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.\n * @hidden\n */\nfunction eventFromException(\n stackParser,\n exception,\n hint,\n attachStacktrace,\n) {\n const syntheticException = (hint && hint.syntheticException) || undefined;\n const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace);\n addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }\n event.level = 'error';\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n return resolvedSyncPromise(event);\n}\n\n/**\n * Builds and Event from a Message\n * @hidden\n */\nfunction eventFromMessage(\n stackParser,\n message,\n // eslint-disable-next-line deprecation/deprecation\n level = 'info',\n hint,\n attachStacktrace,\n) {\n const syntheticException = (hint && hint.syntheticException) || undefined;\n const event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n event.level = level;\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n return resolvedSyncPromise(event);\n}\n\n/**\n * @hidden\n */\nfunction eventFromUnknownInput(\n stackParser,\n exception,\n syntheticException,\n attachStacktrace,\n isUnhandledRejection,\n) {\n let event;\n\n if (isErrorEvent(exception ) && (exception ).error) {\n // If it is an ErrorEvent with `error` property, extract it to get actual Error\n const errorEvent = exception ;\n return eventFromError(stackParser, errorEvent.error );\n }\n\n // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name\n // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be\n // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.\n //\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMError\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n // https://webidl.spec.whatwg.org/#es-DOMException-specialness\n if (isDOMError(exception) || isDOMException(exception )) {\n const domException = exception ;\n\n if ('stack' in (exception )) {\n event = eventFromError(stackParser, exception );\n } else {\n const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');\n const message = domException.message ? `${name}: ${domException.message}` : name;\n event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n addExceptionTypeValue(event, message);\n }\n if ('code' in domException) {\n // eslint-disable-next-line deprecation/deprecation\n event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };\n }\n\n return event;\n }\n if (isError(exception)) {\n // we have a real Error object, do nothing\n return eventFromError(stackParser, exception);\n }\n if (isPlainObject(exception) || isEvent(exception)) {\n // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize\n // it manually. This will allow us to group events based on top-level keys which is much better than creating a new\n // group on any key/value change.\n const objectException = exception ;\n event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n return event;\n }\n\n // If none of previous checks were valid, then it means that it's not:\n // - an instance of DOMError\n // - an instance of DOMException\n // - an instance of Event\n // - an instance of Error\n // - a valid ErrorEvent (one with an error property)\n // - a plain Object\n //\n // So bail out and capture it as a simple message:\n event = eventFromString(stackParser, exception , syntheticException, attachStacktrace);\n addExceptionTypeValue(event, `${exception}`, undefined);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n\n return event;\n}\n\n/**\n * @hidden\n */\nfunction eventFromString(\n stackParser,\n message,\n syntheticException,\n attachStacktrace,\n) {\n const event = {};\n\n if (attachStacktrace && syntheticException) {\n const frames = parseStackFrames(stackParser, syntheticException);\n if (frames.length) {\n event.exception = {\n values: [{ value: message, stacktrace: { frames } }],\n };\n }\n }\n\n if (isParameterizedString(message)) {\n const { __sentry_template_string__, __sentry_template_values__ } = message;\n\n event.logentry = {\n message: __sentry_template_string__,\n params: __sentry_template_values__,\n };\n return event;\n }\n\n event.message = message;\n return event;\n}\n\nfunction getNonErrorObjectExceptionValue(\n exception,\n { isUnhandledRejection },\n) {\n const keys = extractExceptionKeysForMessage(exception);\n const captureType = isUnhandledRejection ? 'promise rejection' : 'exception';\n\n // Some ErrorEvent instances do not have an `error` property, which is why they are not handled before\n // We still want to try to get a decent message for these cases\n if (isErrorEvent(exception)) {\n return `Event \\`ErrorEvent\\` captured as ${captureType} with message \\`${exception.message}\\``;\n }\n\n if (isEvent(exception)) {\n const className = getObjectClassName(exception);\n return `Event \\`${className}\\` (type=${exception.type}) captured as ${captureType}`;\n }\n\n return `Object captured as ${captureType} with keys: ${keys}`;\n}\n\nfunction getObjectClassName(obj) {\n try {\n const prototype = Object.getPrototypeOf(obj);\n return prototype ? prototype.constructor.name : undefined;\n } catch (e) {\n // ignore errors here\n }\n}\n\nexport { eventFromError, eventFromException, eventFromMessage, eventFromPlainObject, eventFromString, eventFromUnknownInput, exceptionFromError, parseStackFrames };\n//# sourceMappingURL=eventbuilder.js.map\n","import { dsnToString, createEnvelope } from '@sentry/utils';\n\n/**\n * Creates an envelope from a user feedback.\n */\nfunction createUserFeedbackEnvelope(\n feedback,\n {\n metadata,\n tunnel,\n dsn,\n }\n\n,\n) {\n const headers = {\n event_id: feedback.event_id,\n sent_at: new Date().toISOString(),\n ...(metadata &&\n metadata.sdk && {\n sdk: {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n },\n }),\n ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),\n };\n const item = createUserFeedbackEnvelopeItem(feedback);\n\n return createEnvelope(headers, [item]);\n}\n\nfunction createUserFeedbackEnvelopeItem(feedback) {\n const feedbackHeaders = {\n type: 'user_report',\n };\n return [feedbackHeaders, feedback];\n}\n\nexport { createUserFeedbackEnvelope };\n//# sourceMappingURL=userfeedback.js.map\n","import { BaseClient, applySdkMetadata } from '@sentry/core';\nimport { getSDKSource, logger, createClientReportEnvelope, dsnToString } from '@sentry/utils';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { eventFromException, eventFromMessage } from './eventbuilder.js';\nimport { WINDOW } from './helpers.js';\nimport { createUserFeedbackEnvelope } from './userfeedback.js';\n\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see @sentry/types Options for more information.\n */\n\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nclass BrowserClient extends BaseClient {\n /**\n * Creates a new Browser SDK instance.\n *\n * @param options Configuration options for this SDK.\n */\n constructor(options) {\n const sdkSource = WINDOW.SENTRY_SDK_SOURCE || getSDKSource();\n applySdkMetadata(options, 'browser', ['browser'], sdkSource);\n\n super(options);\n\n if (options.sendClientReports && WINDOW.document) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n if (WINDOW.document.visibilityState === 'hidden') {\n this._flushOutcomes();\n }\n });\n }\n }\n\n /**\n * @inheritDoc\n */\n eventFromException(exception, hint) {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n eventFromMessage(\n message,\n // eslint-disable-next-line deprecation/deprecation\n level = 'info',\n hint,\n ) {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * Sends user feedback to Sentry.\n */\n captureUserFeedback(feedback) {\n if (!this._isEnabled()) {\n DEBUG_BUILD && logger.warn('SDK not enabled, will not capture user feedback.');\n return;\n }\n\n const envelope = createUserFeedbackEnvelope(feedback, {\n metadata: this.getSdkMetadata(),\n dsn: this.getDsn(),\n tunnel: this.getOptions().tunnel,\n });\n\n // _sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._sendEnvelope(envelope);\n }\n\n /**\n * @inheritDoc\n */\n _prepareEvent(event, hint, scope) {\n event.platform = event.platform || 'javascript';\n return super._prepareEvent(event, hint, scope);\n }\n\n /**\n * Sends client reports as an envelope.\n */\n _flushOutcomes() {\n const outcomes = this._clearOutcomes();\n\n if (outcomes.length === 0) {\n DEBUG_BUILD && logger.log('No outcomes to send');\n return;\n }\n\n // This is really the only place where we want to check for a DSN and only send outcomes then\n if (!this._dsn) {\n DEBUG_BUILD && logger.log('No dsn provided, will not send outcomes');\n return;\n }\n\n DEBUG_BUILD && logger.log('Sending outcomes:', outcomes);\n\n const envelope = createClientReportEnvelope(outcomes, this._options.tunnel && dsnToString(this._dsn));\n\n // _sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._sendEnvelope(envelope);\n }\n}\n\nexport { BrowserClient };\n//# sourceMappingURL=client.js.map\n","import { isNativeFetch, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { WINDOW } from '../helpers.js';\n\nlet cachedFetchImpl = undefined;\n\n/**\n * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers.\n * Whenever someone wraps the Fetch API and returns the wrong promise chain,\n * this chain becomes orphaned and there is no possible way to capture it's rejections\n * other than allowing it bubble up to this very handler. eg.\n *\n * const f = window.fetch;\n * window.fetch = function () {\n * const p = f.apply(this, arguments);\n *\n * p.then(function() {\n * console.log('hi.');\n * });\n *\n * return p;\n * }\n *\n * `p.then(function () { ... })` is producing a completely separate promise chain,\n * however, what's returned is `p` - the result of original `fetch` call.\n *\n * This mean, that whenever we use the Fetch API to send our own requests, _and_\n * some ad-blocker blocks it, this orphaned chain will _always_ reject,\n * effectively causing another event to be captured.\n * This makes a whole process become an infinite loop, which we need to somehow\n * deal with, and break it in one way or another.\n *\n * To deal with this issue, we are making sure that we _always_ use the real\n * browser Fetch API, instead of relying on what `window.fetch` exposes.\n * The only downside to this would be missing our own requests as breadcrumbs,\n * but because we are already not doing this, it should be just fine.\n *\n * Possible failed fetch error messages per-browser:\n *\n * Chrome: Failed to fetch\n * Edge: Failed to Fetch\n * Firefox: NetworkError when attempting to fetch resource\n * Safari: resource blocked by content blocker\n */\nfunction getNativeFetchImplementation() {\n if (cachedFetchImpl) {\n return cachedFetchImpl;\n }\n\n /* eslint-disable @typescript-eslint/unbound-method */\n\n // Fast path to avoid DOM I/O\n if (isNativeFetch(WINDOW.fetch)) {\n return (cachedFetchImpl = WINDOW.fetch.bind(WINDOW));\n }\n\n const document = WINDOW.document;\n let fetchImpl = WINDOW.fetch;\n // eslint-disable-next-line deprecation/deprecation\n if (document && typeof document.createElement === 'function') {\n try {\n const sandbox = document.createElement('iframe');\n sandbox.hidden = true;\n document.head.appendChild(sandbox);\n const contentWindow = sandbox.contentWindow;\n if (contentWindow && contentWindow.fetch) {\n fetchImpl = contentWindow.fetch;\n }\n document.head.removeChild(sandbox);\n } catch (e) {\n DEBUG_BUILD && logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', e);\n }\n }\n\n return (cachedFetchImpl = fetchImpl.bind(WINDOW));\n /* eslint-enable @typescript-eslint/unbound-method */\n}\n\n/** Clears cached fetch impl */\nfunction clearCachedFetchImplementation() {\n cachedFetchImpl = undefined;\n}\n\nexport { clearCachedFetchImplementation, getNativeFetchImplementation };\n//# sourceMappingURL=utils.js.map\n","import { createTransport } from '@sentry/core';\nimport { rejectedSyncPromise } from '@sentry/utils';\nimport { getNativeFetchImplementation, clearCachedFetchImplementation } from './utils.js';\n\n/**\n * Creates a Transport that uses the Fetch API to send events to Sentry.\n */\nfunction makeFetchTransport(\n options,\n nativeFetch = getNativeFetchImplementation(),\n) {\n let pendingBodySize = 0;\n let pendingCount = 0;\n\n function makeRequest(request) {\n const requestSize = request.body.length;\n pendingBodySize += requestSize;\n pendingCount++;\n\n const requestOptions = {\n body: request.body,\n method: 'POST',\n referrerPolicy: 'origin',\n headers: options.headers,\n // Outgoing requests are usually cancelled when navigating to a different page, causing a \"TypeError: Failed to\n // fetch\" error and sending a \"network_error\" client-outcome - in Chrome, the request status shows \"(cancelled)\".\n // The `keepalive` flag keeps outgoing requests alive, even when switching pages. We want this since we're\n // frequently sending events right before the user is switching pages (eg. whenfinishing navigation transactions).\n // Gotchas:\n // - `keepalive` isn't supported by Firefox\n // - As per spec (https://fetch.spec.whatwg.org/#http-network-or-cache-fetch):\n // If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error.\n // We will therefore only activate the flag when we're below that limit.\n // There is also a limit of requests that can be open at the same time, so we also limit this to 15\n // See https://github.com/getsentry/sentry-javascript/pull/7553 for details\n keepalive: pendingBodySize <= 60000 && pendingCount < 15,\n ...options.fetchOptions,\n };\n\n try {\n return nativeFetch(options.url, requestOptions).then(response => {\n pendingBodySize -= requestSize;\n pendingCount--;\n return {\n statusCode: response.status,\n headers: {\n 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),\n 'retry-after': response.headers.get('Retry-After'),\n },\n };\n });\n } catch (e) {\n clearCachedFetchImplementation();\n pendingBodySize -= requestSize;\n pendingCount--;\n return rejectedSyncPromise(e);\n }\n }\n\n return createTransport(options, makeRequest);\n}\n\nexport { makeFetchTransport };\n//# sourceMappingURL=fetch.js.map\n","import { createTransport } from '@sentry/core';\nimport { SyncPromise } from '@sentry/utils';\n\n/**\n * The DONE ready state for XmlHttpRequest\n *\n * Defining it here as a constant b/c XMLHttpRequest.DONE is not always defined\n * (e.g. during testing, it is `undefined`)\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState}\n */\nconst XHR_READYSTATE_DONE = 4;\n\n/**\n * Creates a Transport that uses the XMLHttpRequest API to send events to Sentry.\n */\nfunction makeXHRTransport(options) {\n function makeRequest(request) {\n return new SyncPromise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n\n xhr.onerror = reject;\n\n xhr.onreadystatechange = () => {\n if (xhr.readyState === XHR_READYSTATE_DONE) {\n resolve({\n statusCode: xhr.status,\n headers: {\n 'x-sentry-rate-limits': xhr.getResponseHeader('X-Sentry-Rate-Limits'),\n 'retry-after': xhr.getResponseHeader('Retry-After'),\n },\n });\n }\n };\n\n xhr.open('POST', options.url);\n\n for (const header in options.headers) {\n if (Object.prototype.hasOwnProperty.call(options.headers, header)) {\n xhr.setRequestHeader(header, options.headers[header]);\n }\n }\n\n xhr.send(request.body);\n });\n }\n\n return createTransport(options, makeRequest);\n}\n\nexport { makeXHRTransport };\n//# sourceMappingURL=xhr.js.map\n","import { createStackParser } from '@sentry/utils';\n\n// global reference to slice\nconst UNKNOWN_FUNCTION = '?';\n\nconst OPERA10_PRIORITY = 10;\nconst OPERA11_PRIORITY = 20;\nconst CHROME_PRIORITY = 30;\nconst WINJS_PRIORITY = 40;\nconst GECKO_PRIORITY = 50;\n\nfunction createFrame(filename, func, lineno, colno) {\n const frame = {\n filename,\n function: func,\n in_app: true, // All browser frames are considered in_app\n };\n\n if (lineno !== undefined) {\n frame.lineno = lineno;\n }\n\n if (colno !== undefined) {\n frame.colno = colno;\n }\n\n return frame;\n}\n\n// Chromium based browsers: Chrome, Brave, new Opera, new Edge\nconst chromeRegex =\n /^\\s*at (?:(.+?\\)(?: \\[.+\\])?|.*?) ?\\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\\/)?.*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\nconst chromeEvalRegex = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\n\n// We cannot call this variable `chrome` because it can conflict with global `chrome` variable in certain environments\n// See: https://github.com/getsentry/sentry-javascript/issues/6880\nconst chromeStackParserFn = line => {\n const parts = chromeRegex.exec(line);\n\n if (parts) {\n const isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n\n if (isEval) {\n const subMatch = chromeEvalRegex.exec(parts[2]);\n\n if (subMatch) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = subMatch[1]; // url\n parts[3] = subMatch[2]; // line\n parts[4] = subMatch[3]; // column\n }\n }\n\n // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now\n // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable)\n const [func, filename] = extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]);\n\n return createFrame(filename, func, parts[3] ? +parts[3] : undefined, parts[4] ? +parts[4] : undefined);\n }\n\n return;\n};\n\nconst chromeStackLineParser = [CHROME_PRIORITY, chromeStackParserFn];\n\n// gecko regex: `(?:bundle|\\d+\\.js)`: `bundle` is for react native, `\\d+\\.js` also but specifically for ram bundles because it\n// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js\n// We need this specific case for now because we want no other regex to match.\nconst geckoREgex =\n /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)?((?:[-a-z]+)?:\\/.*?|\\[native code\\]|[^@]*(?:bundle|\\d+\\.js)|\\/[\\w\\-. /=]+)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nconst geckoEvalRegex = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\n\nconst gecko = line => {\n const parts = geckoREgex.exec(line);\n\n if (parts) {\n const isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n if (isEval) {\n const subMatch = geckoEvalRegex.exec(parts[3]);\n\n if (subMatch) {\n // throw out eval line/column and use top-most line number\n parts[1] = parts[1] || 'eval';\n parts[3] = subMatch[1];\n parts[4] = subMatch[2];\n parts[5] = ''; // no column when eval\n }\n }\n\n let filename = parts[3];\n let func = parts[1] || UNKNOWN_FUNCTION;\n [func, filename] = extractSafariExtensionDetails(func, filename);\n\n return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined);\n }\n\n return;\n};\n\nconst geckoStackLineParser = [GECKO_PRIORITY, gecko];\n\nconst winjsRegex = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:[-a-z]+):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nconst winjs = line => {\n const parts = winjsRegex.exec(line);\n\n return parts\n ? createFrame(parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined)\n : undefined;\n};\n\nconst winjsStackLineParser = [WINJS_PRIORITY, winjs];\n\nconst opera10Regex = / line (\\d+).*script (?:in )?(\\S+)(?:: in function (\\S+))?$/i;\n\nconst opera10 = line => {\n const parts = opera10Regex.exec(line);\n return parts ? createFrame(parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined;\n};\n\nconst opera10StackLineParser = [OPERA10_PRIORITY, opera10];\n\nconst opera11Regex =\n / line (\\d+), column (\\d+)\\s*(?:in (?:]+)>|([^)]+))\\(.*\\))? in (.*):\\s*$/i;\n\nconst opera11 = line => {\n const parts = opera11Regex.exec(line);\n return parts ? createFrame(parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;\n};\n\nconst opera11StackLineParser = [OPERA11_PRIORITY, opera11];\n\nconst defaultStackLineParsers = [chromeStackLineParser, geckoStackLineParser, winjsStackLineParser];\n\nconst defaultStackParser = createStackParser(...defaultStackLineParsers);\n\n/**\n * Safari web extensions, starting version unknown, can produce \"frames-only\" stacktraces.\n * What it means, is that instead of format like:\n *\n * Error: wat\n * at function@url:row:col\n * at function@url:row:col\n * at function@url:row:col\n *\n * it produces something like:\n *\n * function@url:row:col\n * function@url:row:col\n * function@url:row:col\n *\n * Because of that, it won't be captured by `chrome` RegExp and will fall into `Gecko` branch.\n * This function is extracted so that we can use it in both places without duplicating the logic.\n * Unfortunately \"just\" changing RegExp is too complicated now and making it pass all tests\n * and fix this case seems like an impossible, or at least way too time-consuming task.\n */\nconst extractSafariExtensionDetails = (func, filename) => {\n const isSafariExtension = func.indexOf('safari-extension') !== -1;\n const isSafariWebExtension = func.indexOf('safari-web-extension') !== -1;\n\n return isSafariExtension || isSafariWebExtension\n ? [\n func.indexOf('@') !== -1 ? func.split('@')[0] : UNKNOWN_FUNCTION,\n isSafariExtension ? `safari-extension:${filename}` : `safari-web-extension:${filename}`,\n ]\n : [func, filename];\n};\n\nexport { chromeStackLineParser, defaultStackLineParsers, defaultStackParser, geckoStackLineParser, opera10StackLineParser, opera11StackLineParser, winjsStackLineParser };\n//# sourceMappingURL=stack-parsers.js.map\n","import { defineIntegration, convertIntegrationFnToClass, getClient, addBreadcrumb } from '@sentry/core';\nimport { addConsoleInstrumentationHandler, addClickKeypressInstrumentationHandler, addXhrInstrumentationHandler, addFetchInstrumentationHandler, addHistoryInstrumentationHandler, getEventDescription, logger, htmlTreeAsString, getComponentName, severityLevelFromString, safeJoin, SENTRY_XHR_DATA_KEY, parseUrl } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { WINDOW } from '../helpers.js';\n\n/* eslint-disable max-lines */\n\n/** maxStringLength gets capped to prevent 100 breadcrumbs exceeding 1MB event payload size */\nconst MAX_ALLOWED_STRING_LENGTH = 1024;\n\nconst INTEGRATION_NAME = 'Breadcrumbs';\n\nconst _breadcrumbsIntegration = ((options = {}) => {\n const _options = {\n console: true,\n dom: true,\n fetch: true,\n history: true,\n sentry: true,\n xhr: true,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n setup(client) {\n if (_options.console) {\n addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(client));\n }\n if (_options.dom) {\n addClickKeypressInstrumentationHandler(_getDomBreadcrumbHandler(client, _options.dom));\n }\n if (_options.xhr) {\n addXhrInstrumentationHandler(_getXhrBreadcrumbHandler(client));\n }\n if (_options.fetch) {\n addFetchInstrumentationHandler(_getFetchBreadcrumbHandler(client));\n }\n if (_options.history) {\n addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(client));\n }\n if (_options.sentry && client.on) {\n client.on('beforeSendEvent', _getSentryBreadcrumbHandler(client));\n }\n },\n };\n}) ;\n\nconst breadcrumbsIntegration = defineIntegration(_breadcrumbsIntegration);\n\n/**\n * Default Breadcrumbs instrumentations\n *\n * @deprecated Use `breadcrumbsIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst Breadcrumbs = convertIntegrationFnToClass(INTEGRATION_NAME, breadcrumbsIntegration)\n\n;\n\n/**\n * Adds a breadcrumb for Sentry events or transactions if this option is enabled.\n */\nfunction _getSentryBreadcrumbHandler(client) {\n return function addSentryBreadcrumb(event) {\n if (getClient() !== client) {\n return;\n }\n\n addBreadcrumb(\n {\n category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`,\n event_id: event.event_id,\n level: event.level,\n message: getEventDescription(event),\n },\n {\n event,\n },\n );\n };\n}\n\n/**\n * A HOC that creaes a function that creates breadcrumbs from DOM API calls.\n * This is a HOC so that we get access to dom options in the closure.\n */\nfunction _getDomBreadcrumbHandler(\n client,\n dom,\n) {\n return function _innerDomBreadcrumb(handlerData) {\n if (getClient() !== client) {\n return;\n }\n\n let target;\n let componentName;\n let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;\n\n let maxStringLength =\n typeof dom === 'object' && typeof dom.maxStringLength === 'number' ? dom.maxStringLength : undefined;\n if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) {\n DEBUG_BUILD &&\n logger.warn(\n `\\`dom.maxStringLength\\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`,\n );\n maxStringLength = MAX_ALLOWED_STRING_LENGTH;\n }\n\n if (typeof keyAttrs === 'string') {\n keyAttrs = [keyAttrs];\n }\n\n // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n try {\n const event = handlerData.event ;\n const element = _isEvent(event) ? event.target : event;\n\n target = htmlTreeAsString(element, { keyAttrs, maxStringLength });\n componentName = getComponentName(element);\n } catch (e) {\n target = '';\n }\n\n if (target.length === 0) {\n return;\n }\n\n const breadcrumb = {\n category: `ui.${handlerData.name}`,\n message: target,\n };\n\n if (componentName) {\n breadcrumb.data = { 'ui.component_name': componentName };\n }\n\n addBreadcrumb(breadcrumb, {\n event: handlerData.event,\n name: handlerData.name,\n global: handlerData.global,\n });\n };\n}\n\n/**\n * Creates breadcrumbs from console API calls\n */\nfunction _getConsoleBreadcrumbHandler(client) {\n return function _consoleBreadcrumb(handlerData) {\n if (getClient() !== client) {\n return;\n }\n\n const breadcrumb = {\n category: 'console',\n data: {\n arguments: handlerData.args,\n logger: 'console',\n },\n level: severityLevelFromString(handlerData.level),\n message: safeJoin(handlerData.args, ' '),\n };\n\n if (handlerData.level === 'assert') {\n if (handlerData.args[0] === false) {\n breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'}`;\n breadcrumb.data.arguments = handlerData.args.slice(1);\n } else {\n // Don't capture a breadcrumb for passed assertions\n return;\n }\n }\n\n addBreadcrumb(breadcrumb, {\n input: handlerData.args,\n level: handlerData.level,\n });\n };\n}\n\n/**\n * Creates breadcrumbs from XHR API calls\n */\nfunction _getXhrBreadcrumbHandler(client) {\n return function _xhrBreadcrumb(handlerData) {\n if (getClient() !== client) {\n return;\n }\n\n const { startTimestamp, endTimestamp } = handlerData;\n\n const sentryXhrData = handlerData.xhr[SENTRY_XHR_DATA_KEY];\n\n // We only capture complete, non-sentry requests\n if (!startTimestamp || !endTimestamp || !sentryXhrData) {\n return;\n }\n\n const { method, url, status_code, body } = sentryXhrData;\n\n const data = {\n method,\n url,\n status_code,\n };\n\n const hint = {\n xhr: handlerData.xhr,\n input: body,\n startTimestamp,\n endTimestamp,\n };\n\n addBreadcrumb(\n {\n category: 'xhr',\n data,\n type: 'http',\n },\n hint,\n );\n };\n}\n\n/**\n * Creates breadcrumbs from fetch API calls\n */\nfunction _getFetchBreadcrumbHandler(client) {\n return function _fetchBreadcrumb(handlerData) {\n if (getClient() !== client) {\n return;\n }\n\n const { startTimestamp, endTimestamp } = handlerData;\n\n // We only capture complete fetch requests\n if (!endTimestamp) {\n return;\n }\n\n if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') {\n // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests)\n return;\n }\n\n if (handlerData.error) {\n const data = handlerData.fetchData;\n const hint = {\n data: handlerData.error,\n input: handlerData.args,\n startTimestamp,\n endTimestamp,\n };\n\n addBreadcrumb(\n {\n category: 'fetch',\n data,\n level: 'error',\n type: 'http',\n },\n hint,\n );\n } else {\n const response = handlerData.response ;\n const data = {\n ...handlerData.fetchData,\n status_code: response && response.status,\n };\n const hint = {\n input: handlerData.args,\n response,\n startTimestamp,\n endTimestamp,\n };\n addBreadcrumb(\n {\n category: 'fetch',\n data,\n type: 'http',\n },\n hint,\n );\n }\n };\n}\n\n/**\n * Creates breadcrumbs from history API calls\n */\nfunction _getHistoryBreadcrumbHandler(client) {\n return function _historyBreadcrumb(handlerData) {\n if (getClient() !== client) {\n return;\n }\n\n let from = handlerData.from;\n let to = handlerData.to;\n const parsedLoc = parseUrl(WINDOW.location.href);\n let parsedFrom = from ? parseUrl(from) : undefined;\n const parsedTo = parseUrl(to);\n\n // Initial pushState doesn't provide `from` information\n if (!parsedFrom || !parsedFrom.path) {\n parsedFrom = parsedLoc;\n }\n\n // Use only the path component of the URL if the URL matches the current\n // document (almost all the time when using pushState)\n if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {\n to = parsedTo.relative;\n }\n if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {\n from = parsedFrom.relative;\n }\n\n addBreadcrumb({\n category: 'navigation',\n data: {\n from,\n to,\n },\n });\n };\n}\n\nfunction _isEvent(event) {\n return !!event && !!(event ).target;\n}\n\nexport { Breadcrumbs, breadcrumbsIntegration };\n//# sourceMappingURL=breadcrumbs.js.map\n","import { defineIntegration, convertIntegrationFnToClass } from '@sentry/core';\nimport { logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\n\nconst INTEGRATION_NAME = 'Dedupe';\n\nconst _dedupeIntegration = (() => {\n let previousEvent;\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n processEvent(currentEvent) {\n // We want to ignore any non-error type events, e.g. transactions or replays\n // These should never be deduped, and also not be compared against as _previousEvent.\n if (currentEvent.type) {\n return currentEvent;\n }\n\n // Juuust in case something goes wrong\n try {\n if (_shouldDropEvent(currentEvent, previousEvent)) {\n DEBUG_BUILD && logger.warn('Event dropped due to being a duplicate of previously captured event.');\n return null;\n }\n } catch (_oO) {} // eslint-disable-line no-empty\n\n return (previousEvent = currentEvent);\n },\n };\n}) ;\n\nconst dedupeIntegration = defineIntegration(_dedupeIntegration);\n\n/**\n * Deduplication filter.\n * @deprecated Use `dedupeIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst Dedupe = convertIntegrationFnToClass(INTEGRATION_NAME, dedupeIntegration)\n\n;\n\nfunction _shouldDropEvent(currentEvent, previousEvent) {\n if (!previousEvent) {\n return false;\n }\n\n if (_isSameMessageEvent(currentEvent, previousEvent)) {\n return true;\n }\n\n if (_isSameExceptionEvent(currentEvent, previousEvent)) {\n return true;\n }\n\n return false;\n}\n\nfunction _isSameMessageEvent(currentEvent, previousEvent) {\n const currentMessage = currentEvent.message;\n const previousMessage = previousEvent.message;\n\n // If neither event has a message property, they were both exceptions, so bail out\n if (!currentMessage && !previousMessage) {\n return false;\n }\n\n // If only one event has a stacktrace, but not the other one, they are not the same\n if ((currentMessage && !previousMessage) || (!currentMessage && previousMessage)) {\n return false;\n }\n\n if (currentMessage !== previousMessage) {\n return false;\n }\n\n if (!_isSameFingerprint(currentEvent, previousEvent)) {\n return false;\n }\n\n if (!_isSameStacktrace(currentEvent, previousEvent)) {\n return false;\n }\n\n return true;\n}\n\nfunction _isSameExceptionEvent(currentEvent, previousEvent) {\n const previousException = _getExceptionFromEvent(previousEvent);\n const currentException = _getExceptionFromEvent(currentEvent);\n\n if (!previousException || !currentException) {\n return false;\n }\n\n if (previousException.type !== currentException.type || previousException.value !== currentException.value) {\n return false;\n }\n\n if (!_isSameFingerprint(currentEvent, previousEvent)) {\n return false;\n }\n\n if (!_isSameStacktrace(currentEvent, previousEvent)) {\n return false;\n }\n\n return true;\n}\n\nfunction _isSameStacktrace(currentEvent, previousEvent) {\n let currentFrames = _getFramesFromEvent(currentEvent);\n let previousFrames = _getFramesFromEvent(previousEvent);\n\n // If neither event has a stacktrace, they are assumed to be the same\n if (!currentFrames && !previousFrames) {\n return true;\n }\n\n // If only one event has a stacktrace, but not the other one, they are not the same\n if ((currentFrames && !previousFrames) || (!currentFrames && previousFrames)) {\n return false;\n }\n\n currentFrames = currentFrames ;\n previousFrames = previousFrames ;\n\n // If number of frames differ, they are not the same\n if (previousFrames.length !== currentFrames.length) {\n return false;\n }\n\n // Otherwise, compare the two\n for (let i = 0; i < previousFrames.length; i++) {\n const frameA = previousFrames[i];\n const frameB = currentFrames[i];\n\n if (\n frameA.filename !== frameB.filename ||\n frameA.lineno !== frameB.lineno ||\n frameA.colno !== frameB.colno ||\n frameA.function !== frameB.function\n ) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction _isSameFingerprint(currentEvent, previousEvent) {\n let currentFingerprint = currentEvent.fingerprint;\n let previousFingerprint = previousEvent.fingerprint;\n\n // If neither event has a fingerprint, they are assumed to be the same\n if (!currentFingerprint && !previousFingerprint) {\n return true;\n }\n\n // If only one event has a fingerprint, but not the other one, they are not the same\n if ((currentFingerprint && !previousFingerprint) || (!currentFingerprint && previousFingerprint)) {\n return false;\n }\n\n currentFingerprint = currentFingerprint ;\n previousFingerprint = previousFingerprint ;\n\n // Otherwise, compare the two\n try {\n return !!(currentFingerprint.join('') === previousFingerprint.join(''));\n } catch (_oO) {\n return false;\n }\n}\n\nfunction _getExceptionFromEvent(event) {\n return event.exception && event.exception.values && event.exception.values[0];\n}\n\nfunction _getFramesFromEvent(event) {\n const exception = event.exception;\n\n if (exception) {\n try {\n // @ts-expect-error Object could be undefined\n return exception.values[0].stacktrace.frames;\n } catch (_oO) {\n return undefined;\n }\n }\n return undefined;\n}\n\nexport { Dedupe, dedupeIntegration };\n//# sourceMappingURL=dedupe.js.map\n","import { defineIntegration, convertIntegrationFnToClass, getClient, captureEvent } from '@sentry/core';\nimport { addGlobalErrorInstrumentationHandler, isString, addGlobalUnhandledRejectionInstrumentationHandler, isPrimitive, isErrorEvent, getLocationHref, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { eventFromUnknownInput } from '../eventbuilder.js';\nimport { shouldIgnoreOnError } from '../helpers.js';\n\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n\nconst INTEGRATION_NAME = 'GlobalHandlers';\n\nconst _globalHandlersIntegration = ((options = {}) => {\n const _options = {\n onerror: true,\n onunhandledrejection: true,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n Error.stackTraceLimit = 50;\n },\n setup(client) {\n if (_options.onerror) {\n _installGlobalOnErrorHandler(client);\n globalHandlerLog('onerror');\n }\n if (_options.onunhandledrejection) {\n _installGlobalOnUnhandledRejectionHandler(client);\n globalHandlerLog('onunhandledrejection');\n }\n },\n };\n}) ;\n\nconst globalHandlersIntegration = defineIntegration(_globalHandlersIntegration);\n\n/**\n * Global handlers.\n * @deprecated Use `globalHandlersIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst GlobalHandlers = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n globalHandlersIntegration,\n)\n\n;\n\nfunction _installGlobalOnErrorHandler(client) {\n addGlobalErrorInstrumentationHandler(data => {\n const { stackParser, attachStacktrace } = getOptions();\n\n if (getClient() !== client || shouldIgnoreOnError()) {\n return;\n }\n\n const { msg, url, line, column, error } = data;\n\n const event =\n error === undefined && isString(msg)\n ? _eventFromIncompleteOnError(msg, url, line, column)\n : _enhanceEventWithInitialFrame(\n eventFromUnknownInput(stackParser, error || msg, undefined, attachStacktrace, false),\n url,\n line,\n column,\n );\n\n event.level = 'error';\n\n captureEvent(event, {\n originalException: error,\n mechanism: {\n handled: false,\n type: 'onerror',\n },\n });\n });\n}\n\nfunction _installGlobalOnUnhandledRejectionHandler(client) {\n addGlobalUnhandledRejectionInstrumentationHandler(e => {\n const { stackParser, attachStacktrace } = getOptions();\n\n if (getClient() !== client || shouldIgnoreOnError()) {\n return;\n }\n\n const error = _getUnhandledRejectionError(e );\n\n const event = isPrimitive(error)\n ? _eventFromRejectionWithPrimitive(error)\n : eventFromUnknownInput(stackParser, error, undefined, attachStacktrace, true);\n\n event.level = 'error';\n\n captureEvent(event, {\n originalException: error,\n mechanism: {\n handled: false,\n type: 'onunhandledrejection',\n },\n });\n });\n}\n\nfunction _getUnhandledRejectionError(error) {\n if (isPrimitive(error)) {\n return error;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const e = error ;\n\n // dig the object of the rejection out of known event types\n try {\n // PromiseRejectionEvents store the object of the rejection under 'reason'\n // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent\n if ('reason' in e) {\n return e.reason;\n }\n\n // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents\n // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into\n // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec\n // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and\n // https://github.com/getsentry/sentry-javascript/issues/2380\n else if ('detail' in e && 'reason' in e.detail) {\n return e.detail.reason;\n }\n } catch (e2) {} // eslint-disable-line no-empty\n\n return error;\n}\n\n/**\n * Create an event from a promise rejection where the `reason` is a primitive.\n *\n * @param reason: The `reason` property of the promise rejection\n * @returns An Event object with an appropriate `exception` value\n */\nfunction _eventFromRejectionWithPrimitive(reason) {\n return {\n exception: {\n values: [\n {\n type: 'UnhandledRejection',\n // String() is needed because the Primitive type includes symbols (which can't be automatically stringified)\n value: `Non-Error promise rejection captured with value: ${String(reason)}`,\n },\n ],\n },\n };\n}\n\n/**\n * This function creates a stack from an old, error-less onerror handler.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _eventFromIncompleteOnError(msg, url, line, column) {\n const ERROR_TYPES_RE =\n /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;\n\n // If 'message' is ErrorEvent, get real message from inside\n let message = isErrorEvent(msg) ? msg.message : msg;\n let name = 'Error';\n\n const groups = message.match(ERROR_TYPES_RE);\n if (groups) {\n name = groups[1];\n message = groups[2];\n }\n\n const event = {\n exception: {\n values: [\n {\n type: name,\n value: message,\n },\n ],\n },\n };\n\n return _enhanceEventWithInitialFrame(event, url, line, column);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _enhanceEventWithInitialFrame(event, url, line, column) {\n // event.exception\n const e = (event.exception = event.exception || {});\n // event.exception.values\n const ev = (e.values = e.values || []);\n // event.exception.values[0]\n const ev0 = (ev[0] = ev[0] || {});\n // event.exception.values[0].stacktrace\n const ev0s = (ev0.stacktrace = ev0.stacktrace || {});\n // event.exception.values[0].stacktrace.frames\n const ev0sf = (ev0s.frames = ev0s.frames || []);\n\n const colno = isNaN(parseInt(column, 10)) ? undefined : column;\n const lineno = isNaN(parseInt(line, 10)) ? undefined : line;\n const filename = isString(url) && url.length > 0 ? url : getLocationHref();\n\n // event.exception.values[0].stacktrace.frames\n if (ev0sf.length === 0) {\n ev0sf.push({\n colno,\n filename,\n function: '?',\n in_app: true,\n lineno,\n });\n }\n\n return event;\n}\n\nfunction globalHandlerLog(type) {\n DEBUG_BUILD && logger.log(`Global Handler attached: ${type}`);\n}\n\nfunction getOptions() {\n const client = getClient();\n const options = (client && client.getOptions()) || {\n stackParser: () => [],\n attachStacktrace: false,\n };\n return options;\n}\n\nexport { GlobalHandlers, globalHandlersIntegration };\n//# sourceMappingURL=globalhandlers.js.map\n","import { defineIntegration, convertIntegrationFnToClass } from '@sentry/core';\nimport { WINDOW } from '../helpers.js';\n\nconst INTEGRATION_NAME = 'HttpContext';\n\nconst _httpContextIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n preprocessEvent(event) {\n // if none of the information we want exists, don't bother\n if (!WINDOW.navigator && !WINDOW.location && !WINDOW.document) {\n return;\n }\n\n // grab as much info as exists and add it to the event\n const url = (event.request && event.request.url) || (WINDOW.location && WINDOW.location.href);\n const { referrer } = WINDOW.document || {};\n const { userAgent } = WINDOW.navigator || {};\n\n const headers = {\n ...(event.request && event.request.headers),\n ...(referrer && { Referer: referrer }),\n ...(userAgent && { 'User-Agent': userAgent }),\n };\n const request = { ...event.request, ...(url && { url }), headers };\n\n event.request = request;\n },\n };\n}) ;\n\nconst httpContextIntegration = defineIntegration(_httpContextIntegration);\n\n/**\n * HttpContext integration collects information about HTTP request headers.\n * @deprecated Use `httpContextIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst HttpContext = convertIntegrationFnToClass(INTEGRATION_NAME, httpContextIntegration)\n\n;\n\nexport { HttpContext, httpContextIntegration };\n//# sourceMappingURL=httpcontext.js.map\n","import { defineIntegration, convertIntegrationFnToClass } from '@sentry/core';\nimport { applyAggregateErrorsToEvent } from '@sentry/utils';\nimport { exceptionFromError } from '../eventbuilder.js';\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\nconst INTEGRATION_NAME = 'LinkedErrors';\n\nconst _linkedErrorsIntegration = ((options = {}) => {\n const limit = options.limit || DEFAULT_LIMIT;\n const key = options.key || DEFAULT_KEY;\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n preprocessEvent(event, hint, client) {\n const options = client.getOptions();\n\n applyAggregateErrorsToEvent(\n // This differs from the LinkedErrors integration in core by using a different exceptionFromError function\n exceptionFromError,\n options.stackParser,\n options.maxValueLength,\n key,\n limit,\n event,\n hint,\n );\n },\n };\n}) ;\n\nconst linkedErrorsIntegration = defineIntegration(_linkedErrorsIntegration);\n\n/**\n * Aggregrate linked errors in an event.\n * @deprecated Use `linkedErrorsIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst LinkedErrors = convertIntegrationFnToClass(INTEGRATION_NAME, linkedErrorsIntegration)\n\n;\n\nexport { LinkedErrors, linkedErrorsIntegration };\n//# sourceMappingURL=linkederrors.js.map\n","import { defineIntegration, convertIntegrationFnToClass } from '@sentry/core';\nimport { fill, getFunctionName, getOriginalFunction } from '@sentry/utils';\nimport { WINDOW, wrap } from '../helpers.js';\n\nconst DEFAULT_EVENT_TARGET = [\n 'EventTarget',\n 'Window',\n 'Node',\n 'ApplicationCache',\n 'AudioTrackList',\n 'BroadcastChannel',\n 'ChannelMergerNode',\n 'CryptoOperation',\n 'EventSource',\n 'FileReader',\n 'HTMLUnknownElement',\n 'IDBDatabase',\n 'IDBRequest',\n 'IDBTransaction',\n 'KeyOperation',\n 'MediaController',\n 'MessagePort',\n 'ModalWindow',\n 'Notification',\n 'SVGElementInstance',\n 'Screen',\n 'SharedWorker',\n 'TextTrack',\n 'TextTrackCue',\n 'TextTrackList',\n 'WebSocket',\n 'WebSocketWorker',\n 'Worker',\n 'XMLHttpRequest',\n 'XMLHttpRequestEventTarget',\n 'XMLHttpRequestUpload',\n];\n\nconst INTEGRATION_NAME = 'TryCatch';\n\nconst _browserApiErrorsIntegration = ((options = {}) => {\n const _options = {\n XMLHttpRequest: true,\n eventTarget: true,\n requestAnimationFrame: true,\n setInterval: true,\n setTimeout: true,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n // TODO: This currently only works for the first client this is setup\n // We may want to adjust this to check for client etc.\n setupOnce() {\n if (_options.setTimeout) {\n fill(WINDOW, 'setTimeout', _wrapTimeFunction);\n }\n\n if (_options.setInterval) {\n fill(WINDOW, 'setInterval', _wrapTimeFunction);\n }\n\n if (_options.requestAnimationFrame) {\n fill(WINDOW, 'requestAnimationFrame', _wrapRAF);\n }\n\n if (_options.XMLHttpRequest && 'XMLHttpRequest' in WINDOW) {\n fill(XMLHttpRequest.prototype, 'send', _wrapXHR);\n }\n\n const eventTargetOption = _options.eventTarget;\n if (eventTargetOption) {\n const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET;\n eventTarget.forEach(_wrapEventTarget);\n }\n },\n };\n}) ;\n\nconst browserApiErrorsIntegration = defineIntegration(_browserApiErrorsIntegration);\n\n/**\n * Wrap timer functions and event targets to catch errors and provide better meta data.\n * @deprecated Use `browserApiErrorsIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst TryCatch = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n browserApiErrorsIntegration,\n)\n\n;\n\nfunction _wrapTimeFunction(original) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function ( ...args) {\n const originalCallback = args[0];\n args[0] = wrap(originalCallback, {\n mechanism: {\n data: { function: getFunctionName(original) },\n handled: false,\n type: 'instrument',\n },\n });\n return original.apply(this, args);\n };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _wrapRAF(original) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function ( callback) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return original.apply(this, [\n wrap(callback, {\n mechanism: {\n data: {\n function: 'requestAnimationFrame',\n handler: getFunctionName(original),\n },\n handled: false,\n type: 'instrument',\n },\n }),\n ]);\n };\n}\n\nfunction _wrapXHR(originalSend) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function ( ...args) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const xhr = this;\n const xmlHttpRequestProps = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];\n\n xmlHttpRequestProps.forEach(prop => {\n if (prop in xhr && typeof xhr[prop] === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n fill(xhr, prop, function (original) {\n const wrapOptions = {\n mechanism: {\n data: {\n function: prop,\n handler: getFunctionName(original),\n },\n handled: false,\n type: 'instrument',\n },\n };\n\n // If Instrument integration has been called before TryCatch, get the name of original function\n const originalFunction = getOriginalFunction(original);\n if (originalFunction) {\n wrapOptions.mechanism.data.handler = getFunctionName(originalFunction);\n }\n\n // Otherwise wrap directly\n return wrap(original, wrapOptions);\n });\n }\n });\n\n return originalSend.apply(this, args);\n };\n}\n\nfunction _wrapEventTarget(target) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const globalObject = WINDOW ;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const proto = globalObject[target] && globalObject[target].prototype;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function (original,)\n\n {\n return function (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n eventName,\n fn,\n options,\n ) {\n try {\n if (typeof fn.handleEvent === 'function') {\n // ESlint disable explanation:\n // First, it is generally safe to call `wrap` with an unbound function. Furthermore, using `.bind()` would\n // introduce a bug here, because bind returns a new function that doesn't have our\n // flags(like __sentry_original__) attached. `wrap` checks for those flags to avoid unnecessary wrapping.\n // Without those flags, every call to addEventListener wraps the function again, causing a memory leak.\n // eslint-disable-next-line @typescript-eslint/unbound-method\n fn.handleEvent = wrap(fn.handleEvent, {\n mechanism: {\n data: {\n function: 'handleEvent',\n handler: getFunctionName(fn),\n target,\n },\n handled: false,\n type: 'instrument',\n },\n });\n }\n } catch (err) {\n // can sometimes get 'Permission denied to access property \"handle Event'\n }\n\n return original.apply(this, [\n eventName,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wrap(fn , {\n mechanism: {\n data: {\n function: 'addEventListener',\n handler: getFunctionName(fn),\n target,\n },\n handled: false,\n type: 'instrument',\n },\n }),\n options,\n ]);\n };\n });\n\n fill(\n proto,\n 'removeEventListener',\n function (\n originalRemoveEventListener,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ) {\n return function (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n eventName,\n fn,\n options,\n ) {\n /**\n * There are 2 possible scenarios here:\n *\n * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified\n * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function\n * as a pass-through, and call original `removeEventListener` with it.\n *\n * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using\n * our wrapped version of `addEventListener`, which internally calls `wrap` helper.\n * This helper \"wraps\" whole callback inside a try/catch statement, and attached appropriate metadata to it,\n * in order for us to make a distinction between wrapped/non-wrapped functions possible.\n * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler.\n *\n * When someone adds a handler prior to initialization, and then do it again, but after,\n * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible\n * to get rid of the initial handler and it'd stick there forever.\n */\n const wrappedEventHandler = fn ;\n try {\n const originalEventHandler = wrappedEventHandler && wrappedEventHandler.__sentry_wrapped__;\n if (originalEventHandler) {\n originalRemoveEventListener.call(this, eventName, originalEventHandler, options);\n }\n } catch (e) {\n // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments\n }\n return originalRemoveEventListener.call(this, eventName, wrappedEventHandler, options);\n };\n },\n );\n}\n\nexport { TryCatch, browserApiErrorsIntegration };\n//# sourceMappingURL=trycatch.js.map\n","import { inboundFiltersIntegration, functionToStringIntegration, getIntegrationsToSetup, initAndBind, getReportDialogEndpoint, getCurrentHub, startSession, captureSession, getClient } from '@sentry/core';\nimport { stackParserFromStackParserOptions, supportsFetch, logger, addHistoryInstrumentationHandler } from '@sentry/utils';\nimport { BrowserClient } from './client.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { WINDOW, wrap as wrap$1 } from './helpers.js';\nimport { breadcrumbsIntegration } from './integrations/breadcrumbs.js';\nimport { dedupeIntegration } from './integrations/dedupe.js';\nimport { globalHandlersIntegration } from './integrations/globalhandlers.js';\nimport { httpContextIntegration } from './integrations/httpcontext.js';\nimport { linkedErrorsIntegration } from './integrations/linkederrors.js';\nimport { browserApiErrorsIntegration } from './integrations/trycatch.js';\nimport { defaultStackParser } from './stack-parsers.js';\nimport { makeFetchTransport } from './transports/fetch.js';\nimport { makeXHRTransport } from './transports/xhr.js';\n\n/** @deprecated Use `getDefaultIntegrations(options)` instead. */\nconst defaultIntegrations = [\n inboundFiltersIntegration(),\n functionToStringIntegration(),\n browserApiErrorsIntegration(),\n breadcrumbsIntegration(),\n globalHandlersIntegration(),\n linkedErrorsIntegration(),\n dedupeIntegration(),\n httpContextIntegration(),\n];\n\n/** Get the default integrations for the browser SDK. */\nfunction getDefaultIntegrations(_options) {\n // We return a copy of the defaultIntegrations here to avoid mutating this\n return [\n // eslint-disable-next-line deprecation/deprecation\n ...defaultIntegrations,\n ];\n}\n\n/**\n * A magic string that build tooling can leverage in order to inject a release value into the SDK.\n */\n\n/**\n * The Sentry Browser SDK Client.\n *\n * To use this SDK, call the {@link init} function as early as possible when\n * loading the web page. To set context information or send manual events, use\n * the provided methods.\n *\n * @example\n *\n * ```\n *\n * import { init } from '@sentry/browser';\n *\n * init({\n * dsn: '__DSN__',\n * // ...\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { configureScope } from '@sentry/browser';\n * configureScope((scope: Scope) => {\n * scope.setExtra({ battery: 0.7 });\n * scope.setTag({ user_mode: 'admin' });\n * scope.setUser({ id: '4711' });\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { addBreadcrumb } from '@sentry/browser';\n * addBreadcrumb({\n * message: 'My Breadcrumb',\n * // ...\n * });\n * ```\n *\n * @example\n *\n * ```\n *\n * import * as Sentry from '@sentry/browser';\n * Sentry.captureMessage('Hello, world!');\n * Sentry.captureException(new Error('Good bye'));\n * Sentry.captureEvent({\n * message: 'Manual',\n * stacktrace: [\n * // ...\n * ],\n * });\n * ```\n *\n * @see {@link BrowserOptions} for documentation on configuration options.\n */\nfunction init(options = {}) {\n if (options.defaultIntegrations === undefined) {\n options.defaultIntegrations = getDefaultIntegrations();\n }\n if (options.release === undefined) {\n // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value\n if (typeof __SENTRY_RELEASE__ === 'string') {\n options.release = __SENTRY_RELEASE__;\n }\n\n // This supports the variable that sentry-webpack-plugin injects\n if (WINDOW.SENTRY_RELEASE && WINDOW.SENTRY_RELEASE.id) {\n options.release = WINDOW.SENTRY_RELEASE.id;\n }\n }\n if (options.autoSessionTracking === undefined) {\n options.autoSessionTracking = true;\n }\n if (options.sendClientReports === undefined) {\n options.sendClientReports = true;\n }\n\n const clientOptions = {\n ...options,\n stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),\n integrations: getIntegrationsToSetup(options),\n transport: options.transport || (supportsFetch() ? makeFetchTransport : makeXHRTransport),\n };\n\n initAndBind(BrowserClient, clientOptions);\n\n if (options.autoSessionTracking) {\n startSessionTracking();\n }\n}\n\nconst showReportDialog = (\n // eslint-disable-next-line deprecation/deprecation\n options = {},\n // eslint-disable-next-line deprecation/deprecation\n hub = getCurrentHub(),\n) => {\n // doesn't work without a document (React Native)\n if (!WINDOW.document) {\n DEBUG_BUILD && logger.error('Global document not defined in showReportDialog call');\n return;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n const { client, scope } = hub.getStackTop();\n const dsn = options.dsn || (client && client.getDsn());\n if (!dsn) {\n DEBUG_BUILD && logger.error('DSN not configured for showReportDialog call');\n return;\n }\n\n if (scope) {\n options.user = {\n ...scope.getUser(),\n ...options.user,\n };\n }\n\n // TODO(v8): Remove this entire if statement. `eventId` will be a required option.\n // eslint-disable-next-line deprecation/deprecation\n if (!options.eventId) {\n // eslint-disable-next-line deprecation/deprecation\n options.eventId = hub.lastEventId();\n }\n\n const script = WINDOW.document.createElement('script');\n script.async = true;\n script.crossOrigin = 'anonymous';\n script.src = getReportDialogEndpoint(dsn, options);\n\n if (options.onLoad) {\n script.onload = options.onLoad;\n }\n\n const { onClose } = options;\n if (onClose) {\n const reportDialogClosedMessageHandler = (event) => {\n if (event.data === '__sentry_reportdialog_closed__') {\n try {\n onClose();\n } finally {\n WINDOW.removeEventListener('message', reportDialogClosedMessageHandler);\n }\n }\n };\n WINDOW.addEventListener('message', reportDialogClosedMessageHandler);\n }\n\n const injectionPoint = WINDOW.document.head || WINDOW.document.body;\n if (injectionPoint) {\n injectionPoint.appendChild(script);\n } else {\n DEBUG_BUILD && logger.error('Not injecting report dialog. No injection point found in HTML');\n }\n};\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nfunction forceLoad() {\n // Noop\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nfunction onLoad(callback) {\n callback();\n}\n\n/**\n * Wrap code within a try/catch block so the SDK is able to capture errors.\n *\n * @deprecated This function will be removed in v8.\n * It is not part of Sentry's official API and it's easily replaceable by using a try/catch block\n * and calling Sentry.captureException.\n *\n * @param fn A function to wrap.\n *\n * @returns The result of wrapped function call.\n */\n// TODO(v8): Remove this function\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction wrap(fn) {\n return wrap$1(fn)();\n}\n\n/**\n * Enable automatic Session Tracking for the initial page load.\n */\nfunction startSessionTracking() {\n if (typeof WINDOW.document === 'undefined') {\n DEBUG_BUILD && logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');\n return;\n }\n\n // The session duration for browser sessions does not track a meaningful\n // concept that can be used as a metric.\n // Automatically captured sessions are akin to page views, and thus we\n // discard their duration.\n startSession({ ignoreDuration: true });\n captureSession();\n\n // We want to create a session for every navigation as well\n addHistoryInstrumentationHandler(({ from, to }) => {\n // Don't create an additional session for the initial route or if the location did not change\n if (from !== undefined && from !== to) {\n startSession({ ignoreDuration: true });\n captureSession();\n }\n });\n}\n\n/**\n * Captures user feedback and sends it to Sentry.\n */\nfunction captureUserFeedback(feedback) {\n const client = getClient();\n if (client) {\n client.captureUserFeedback(feedback);\n }\n}\n\nexport { captureUserFeedback, defaultIntegrations, forceLoad, getDefaultIntegrations, init, onLoad, showReportDialog, wrap };\n//# sourceMappingURL=sdk.js.map\n","import { defineIntegration, convertIntegrationFnToClass, getClient, withScope, captureMessage, captureException } from '@sentry/core';\nimport { CONSOLE_LEVELS, GLOBAL_OBJ, addConsoleInstrumentationHandler, severityLevelFromString, addExceptionMechanism, safeJoin } from '@sentry/utils';\n\nconst INTEGRATION_NAME = 'CaptureConsole';\n\nconst _captureConsoleIntegration = ((options = {}) => {\n const levels = options.levels || CONSOLE_LEVELS;\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n setup(client) {\n if (!('console' in GLOBAL_OBJ)) {\n return;\n }\n\n addConsoleInstrumentationHandler(({ args, level }) => {\n if (getClient() !== client || !levels.includes(level)) {\n return;\n }\n\n consoleHandler(args, level);\n });\n },\n };\n}) ;\n\nconst captureConsoleIntegration = defineIntegration(_captureConsoleIntegration);\n\n/**\n * Send Console API calls as Sentry Events.\n * @deprecated Use `captureConsoleIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst CaptureConsole = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n captureConsoleIntegration,\n)\n\n;\n\nfunction consoleHandler(args, level) {\n const captureContext = {\n level: severityLevelFromString(level),\n extra: {\n arguments: args,\n },\n };\n\n withScope(scope => {\n scope.addEventProcessor(event => {\n event.logger = 'console';\n\n addExceptionMechanism(event, {\n handled: false,\n type: 'console',\n });\n\n return event;\n });\n\n if (level === 'assert' && args[0] === false) {\n const message = `Assertion failed: ${safeJoin(args.slice(1), ' ') || 'console.assert'}`;\n scope.setExtra('arguments', args.slice(1));\n captureMessage(message, captureContext);\n return;\n }\n\n const error = args.find(arg => arg instanceof Error);\n if (level === 'error' && error) {\n captureException(error, captureContext);\n return;\n }\n\n const message = safeJoin(args, ' ');\n captureMessage(message, captureContext);\n });\n}\n\nexport { CaptureConsole, captureConsoleIntegration };\n//# sourceMappingURL=captureconsole.js.map\n","import { init as init$1 } from '@sentry/browser';\nimport { applySdkMetadata } from '@sentry/core';\n\n/**\n * Inits the React SDK\n */\nfunction init(options) {\n const opts = {\n ...options,\n };\n\n applySdkMetadata(opts, 'react');\n\n init$1(opts);\n}\n\nexport { init };\n//# sourceMappingURL=sdk.js.map\n","import { getGlobalScope, getCurrentScope, getClient } from '@sentry/core';\nimport { addNonEnumerableProperty } from '@sentry/utils';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nconst ACTION_BREADCRUMB_CATEGORY = 'redux.action';\nconst ACTION_BREADCRUMB_TYPE = 'info';\n\nconst defaultOptions = {\n attachReduxState: true,\n actionTransformer: action => action,\n stateTransformer: state => state || null,\n};\n\n/**\n * Creates an enhancer that would be passed to Redux's createStore to log actions and the latest state to Sentry.\n *\n * @param enhancerOptions Options to pass to the enhancer\n */\nfunction createReduxEnhancer(enhancerOptions) {\n // Note: We return an any type as to not have type conflicts.\n const options = {\n ...defaultOptions,\n ...enhancerOptions,\n };\n\n return (next) =>\n (reducer, initialState) => {\n options.attachReduxState &&\n getGlobalScope().addEventProcessor((event, hint) => {\n try {\n // @ts-expect-error try catch to reduce bundle size\n if (event.type === undefined && event.contexts.state.state.type === 'redux') {\n hint.attachments = [\n ...(hint.attachments || []),\n // @ts-expect-error try catch to reduce bundle size\n { filename: 'redux_state.json', data: JSON.stringify(event.contexts.state.state.value) },\n ];\n }\n } catch (_) {\n // empty\n }\n return event;\n });\n\n const sentryReducer = (state, action) => {\n const newState = reducer(state, action);\n\n const scope = getCurrentScope();\n\n /* Action breadcrumbs */\n const transformedAction = options.actionTransformer(action);\n if (typeof transformedAction !== 'undefined' && transformedAction !== null) {\n scope.addBreadcrumb({\n category: ACTION_BREADCRUMB_CATEGORY,\n data: transformedAction,\n type: ACTION_BREADCRUMB_TYPE,\n });\n }\n\n /* Set latest state to scope */\n const transformedState = options.stateTransformer(newState);\n if (typeof transformedState !== 'undefined' && transformedState !== null) {\n const client = getClient();\n const options = client && client.getOptions();\n const normalizationDepth = (options && options.normalizeDepth) || 3; // default state normalization depth to 3\n\n // Set the normalization depth of the redux state to the configured `normalizeDepth` option or a sane number as a fallback\n const newStateContext = { state: { type: 'redux', value: transformedState } };\n addNonEnumerableProperty(\n newStateContext,\n '__sentry_override_normalization_depth__',\n 3 + // 3 layers for `state.value.transformedState`\n normalizationDepth, // rest for the actual state\n );\n\n scope.setContext('state', newStateContext);\n } else {\n scope.setContext('state', null);\n }\n\n /* Allow user to configure scope with latest state */\n const { configureScopeWithState } = options;\n if (typeof configureScopeWithState === 'function') {\n configureScopeWithState(scope, newState);\n }\n\n return newState;\n };\n\n return next(sentryReducer, initialState);\n };\n}\n\nexport { createReduxEnhancer };\n//# sourceMappingURL=redux.js.map\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar REPLACERS = [[/yyyy|YYYY/, function (date) {\n return date.getFullYear();\n}], [/yy|YY/, function (date) {\n return date.getFullYear().toString().slice(2);\n}], ['MM', function (date) {\n return DateFormatter._addLeadingZeros(date.getMonth() + 1);\n}], ['M', function (date) {\n return date.getMonth() + 1;\n}], ['DD', function (date) {\n return DateFormatter._addLeadingZeros(date.getDate());\n}], ['D', function (date) {\n return date.getDate();\n}], ['HH', function (date) {\n return DateFormatter._addLeadingZeros(date.getHours());\n}], ['H', function (date) {\n return date.getHours();\n}], ['mm', function (date) {\n return DateFormatter._addLeadingZeros(date.getMinutes());\n}], ['m', function (date) {\n return date.getMinutes();\n}], ['ss', function (date) {\n return DateFormatter._addLeadingZeros(date.getSeconds());\n}], ['s', function (date) {\n return date.getSeconds();\n}], ['SSS', function (date) {\n return date.getMilliseconds();\n}], ['SS', function (date) {\n return Math.floor(date.getMilliseconds() / 10);\n}], ['S', function (date) {\n return Math.floor(date.getMilliseconds() / 100);\n}]];\n/**\n * Handles formatting of dates.\n */\n\nvar DateFormatter = /*#__PURE__*/function () {\n function DateFormatter() {\n _classCallCheck(this, DateFormatter);\n }\n\n _createClass(DateFormatter, null, [{\n key: \"isoStringToDate\",\n\n /**\n * Formats a date.\n *\n * @param {string} dateString Date string.\n * @returns {Date} Formatted date.\n */\n value: function isoStringToDate(dateString) {\n return new Date(dateString.replace('Z', ''));\n }\n /**\n * Formats a date object to a date string.\n *\n * @param {Date|string|number} date Date object, or string/number to pass into the date constructor.\n * @param {string} [format] Format to use. Default is \"YYYY-MM-DD\".\n * @returns {string} Formatted date.\n */\n\n }, {\n key: \"dateToString\",\n value: function dateToString(date) {\n var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'YYYY-MM-DD';\n\n if (!(date instanceof Date)) {\n date = new Date(date);\n }\n\n if (isNaN(date.getTime())) {\n return date.toString();\n }\n\n return REPLACERS.reduce(function (str, _ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n pattern = _ref2[0],\n fnc = _ref2[1];\n\n var arr = str.split(pattern);\n\n if (arr.length === 1) {\n return arr[0];\n }\n\n return arr.join(fnc(date));\n }, format);\n }\n /**\n * Adds leading zeross to a number.\n *\n * @param {number|string} value Number to add leading zeros to.\n * @returns {string} Number with leading zeros converted to a string.\n */\n\n }, {\n key: \"_addLeadingZeros\",\n value: function _addLeadingZeros(value) {\n value = String(value);\n\n while (value.length < 2) {\n value = '0' + value;\n }\n\n return value;\n }\n }]);\n\n return DateFormatter;\n}();\n\nexports.default = DateFormatter;","/* FileSaver.js\n * A saveAs() FileSaver implementation.\n * 1.3.2\n * 2016-06-16 18:25:19\n *\n * By Eli Grey, http://eligrey.com\n * License: MIT\n * See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md\n */\n\n/*global self */\n/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */\n\n/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */\n\nvar saveAs = saveAs || (function(view) {\n\t\"use strict\";\n\t// IE <10 is explicitly unsupported\n\tif (typeof view === \"undefined\" || typeof navigator !== \"undefined\" && /MSIE [1-9]\\./.test(navigator.userAgent)) {\n\t\treturn;\n\t}\n\tvar\n\t\t doc = view.document\n\t\t // only get URL when necessary in case Blob.js hasn't overridden it yet\n\t\t, get_URL = function() {\n\t\t\treturn view.URL || view.webkitURL || view;\n\t\t}\n\t\t, save_link = doc.createElementNS(\"http://www.w3.org/1999/xhtml\", \"a\")\n\t\t, can_use_save_link = \"download\" in save_link\n\t\t, click = function(node) {\n\t\t\tvar event = new MouseEvent(\"click\");\n\t\t\tnode.dispatchEvent(event);\n\t\t}\n\t\t, is_safari = /constructor/i.test(view.HTMLElement) || view.safari\n\t\t, is_chrome_ios =/CriOS\\/[\\d]+/.test(navigator.userAgent)\n\t\t, throw_outside = function(ex) {\n\t\t\t(view.setImmediate || view.setTimeout)(function() {\n\t\t\t\tthrow ex;\n\t\t\t}, 0);\n\t\t}\n\t\t, force_saveable_type = \"application/octet-stream\"\n\t\t// the Blob API is fundamentally broken as there is no \"downloadfinished\" event to subscribe to\n\t\t, arbitrary_revoke_timeout = 1000 * 40 // in ms\n\t\t, revoke = function(file) {\n\t\t\tvar revoker = function() {\n\t\t\t\tif (typeof file === \"string\") { // file is an object URL\n\t\t\t\t\tget_URL().revokeObjectURL(file);\n\t\t\t\t} else { // file is a File\n\t\t\t\t\tfile.remove();\n\t\t\t\t}\n\t\t\t};\n\t\t\tsetTimeout(revoker, arbitrary_revoke_timeout);\n\t\t}\n\t\t, dispatch = function(filesaver, event_types, event) {\n\t\t\tevent_types = [].concat(event_types);\n\t\t\tvar i = event_types.length;\n\t\t\twhile (i--) {\n\t\t\t\tvar listener = filesaver[\"on\" + event_types[i]];\n\t\t\t\tif (typeof listener === \"function\") {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlistener.call(filesaver, event || filesaver);\n\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\tthrow_outside(ex);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t, auto_bom = function(blob) {\n\t\t\t// prepend BOM for UTF-8 XML and text/* types (including HTML)\n\t\t\t// note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF\n\t\t\tif (/^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(blob.type)) {\n\t\t\t\treturn new Blob([String.fromCharCode(0xFEFF), blob], {type: blob.type});\n\t\t\t}\n\t\t\treturn blob;\n\t\t}\n\t\t, FileSaver = function(blob, name, no_auto_bom) {\n\t\t\tif (!no_auto_bom) {\n\t\t\t\tblob = auto_bom(blob);\n\t\t\t}\n\t\t\t// First try a.download, then web filesystem, then object URLs\n\t\t\tvar\n\t\t\t\t filesaver = this\n\t\t\t\t, type = blob.type\n\t\t\t\t, force = type === force_saveable_type\n\t\t\t\t, object_url\n\t\t\t\t, dispatch_all = function() {\n\t\t\t\t\tdispatch(filesaver, \"writestart progress write writeend\".split(\" \"));\n\t\t\t\t}\n\t\t\t\t// on any filesys errors revert to saving with object URLs\n\t\t\t\t, fs_error = function() {\n\t\t\t\t\tif ((is_chrome_ios || (force && is_safari)) && view.FileReader) {\n\t\t\t\t\t\t// Safari doesn't allow downloading of blob urls\n\t\t\t\t\t\tvar reader = new FileReader();\n\t\t\t\t\t\treader.onloadend = function() {\n\t\t\t\t\t\t\tvar url = is_chrome_ios ? reader.result : reader.result.replace(/^data:[^;]*;/, 'data:attachment/file;');\n\t\t\t\t\t\t\tvar popup = view.open(url, '_blank');\n\t\t\t\t\t\t\tif(!popup) view.location.href = url;\n\t\t\t\t\t\t\turl=undefined; // release reference before dispatching\n\t\t\t\t\t\t\tfilesaver.readyState = filesaver.DONE;\n\t\t\t\t\t\t\tdispatch_all();\n\t\t\t\t\t\t};\n\t\t\t\t\t\treader.readAsDataURL(blob);\n\t\t\t\t\t\tfilesaver.readyState = filesaver.INIT;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// don't create more object URLs than needed\n\t\t\t\t\tif (!object_url) {\n\t\t\t\t\t\tobject_url = get_URL().createObjectURL(blob);\n\t\t\t\t\t}\n\t\t\t\t\tif (force) {\n\t\t\t\t\t\tview.location.href = object_url;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar opened = view.open(object_url, \"_blank\");\n\t\t\t\t\t\tif (!opened) {\n\t\t\t\t\t\t\t// Apple does not allow window.open, see https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWindowsandTabs/WorkingwithWindowsandTabs.html\n\t\t\t\t\t\t\tview.location.href = object_url;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfilesaver.readyState = filesaver.DONE;\n\t\t\t\t\tdispatch_all();\n\t\t\t\t\trevoke(object_url);\n\t\t\t\t}\n\t\t\t;\n\t\t\tfilesaver.readyState = filesaver.INIT;\n\n\t\t\tif (can_use_save_link) {\n\t\t\t\tobject_url = get_URL().createObjectURL(blob);\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tsave_link.href = object_url;\n\t\t\t\t\tsave_link.download = name;\n\t\t\t\t\tclick(save_link);\n\t\t\t\t\tdispatch_all();\n\t\t\t\t\trevoke(object_url);\n\t\t\t\t\tfilesaver.readyState = filesaver.DONE;\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfs_error();\n\t\t}\n\t\t, FS_proto = FileSaver.prototype\n\t\t, saveAs = function(blob, name, no_auto_bom) {\n\t\t\treturn new FileSaver(blob, name || blob.name || \"download\", no_auto_bom);\n\t\t}\n\t;\n\t// IE 10+ (native saveAs)\n\tif (typeof navigator !== \"undefined\" && navigator.msSaveOrOpenBlob) {\n\t\treturn function(blob, name, no_auto_bom) {\n\t\t\tname = name || blob.name || \"download\";\n\n\t\t\tif (!no_auto_bom) {\n\t\t\t\tblob = auto_bom(blob);\n\t\t\t}\n\t\t\treturn navigator.msSaveOrOpenBlob(blob, name);\n\t\t};\n\t}\n\n\tFS_proto.abort = function(){};\n\tFS_proto.readyState = FS_proto.INIT = 0;\n\tFS_proto.WRITING = 1;\n\tFS_proto.DONE = 2;\n\n\tFS_proto.error =\n\tFS_proto.onwritestart =\n\tFS_proto.onprogress =\n\tFS_proto.onwrite =\n\tFS_proto.onabort =\n\tFS_proto.onerror =\n\tFS_proto.onwriteend =\n\t\tnull;\n\n\treturn saveAs;\n}(\n\t typeof self !== \"undefined\" && self\n\t|| typeof window !== \"undefined\" && window\n\t|| this.content\n));\n// `self` is undefined in Firefox for Android content script context\n// while `this` is nsIContentFrameMessageManager\n// with an attribute `content` that corresponds to the window\n\nif (typeof module !== \"undefined\" && module.exports) {\n module.exports.saveAs = saveAs;\n} else if ((typeof define !== \"undefined\" && define !== null) && (define.amd !== null)) {\n define(\"FileSaver.js\", function() {\n return saveAs;\n });\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _fileSaver = _interopRequireDefault(require(\"file-saver\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * Handles file utilities.\n */\nvar FileUtility = /*#__PURE__*/function () {\n function FileUtility() {\n _classCallCheck(this, FileUtility);\n }\n\n _createClass(FileUtility, null, [{\n key: \"saveAsJson\",\n\n /**\n * Saves data as JSON to a file.\n *\n * @param {string} filename Filename to use.\n * @param {object} data Data to export.\n */\n value: function saveAsJson(filename, data) {\n var blob = new Blob([JSON.stringify(data, null, 4)], {\n type: 'application/json; charset=utf-8'\n });\n this.saveAs(filename, blob);\n }\n /**\n * Saves data as any file type.\n *\n * @param {string} filename Filename to use.\n * @param {object} blob Blob object.\n */\n\n }, {\n key: \"saveAs\",\n value: function saveAs(filename, blob) {\n _fileSaver.default.saveAs(blob, filename);\n }\n /**\n * Opens a file dialog and returns the file buffer result.\n *\n * @example FileSaver.openFileDialog().then(result => { }).catch(error => { });\n * @param {string} type File type to open.\n * @param {boolean} [readAsText] TRUE to read the data as text. Default is FALSE.\n * @returns {Promise} Promise object.\n */\n\n }, {\n key: \"openFileDialog\",\n value: function openFileDialog(type) {\n var readAsText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n return new Promise(function (resolve, reject) {\n var label;\n var input = document.createElement('input'); //Fix for IE - It will trick IE to open the dialog if standard input.click() does not work\n\n var ieTimeout = setTimeout(function () {\n input.id = 'file_input';\n label = document.createElement('label');\n label.setAttribute('for', 'file_input');\n label.click();\n document.body.appendChild(label);\n }, 100);\n input.style.cssText = 'position:absolute;left:0;top:-999rem;';\n input.type = 'file';\n input.setAttribute('accept', '.' + type);\n input.addEventListener('change', function (event) {\n var files = event.target.files;\n clearTimeout(ieTimeout);\n\n if (files && files.length > 0) {\n var file = files[0];\n\n if (file.name.endsWith(type)) {\n var reader = new FileReader();\n\n reader.onload = function (event) {\n resolve(event.target.result || null);\n };\n\n if (readAsText) {\n reader.readAsText(file);\n } else {\n reader.readAsDataURL(file);\n }\n } else {\n reject(new Error('The file is not of type ' + type + '. Please select a file with valid type.'));\n }\n } else {\n resolve(null);\n }\n\n document.body.removeChild(input);\n\n if (label) {\n document.body.removeChild(label);\n }\n });\n document.body.appendChild(input);\n input.click();\n setTimeout(function () {\n input.focus();\n input.blur();\n }, 0);\n });\n }\n }]);\n\n return FileUtility;\n}();\n\nexports.default = FileUtility;","module.exports = {\n \"orientation\": {\n \"landscape\": \"landscape\",\n \"portrait\": \"portrait\"\n },\n \"maxWidth\": 1280,\n \"maxHeightLandscape\": 800,\n \"minWidthLandscape\": 800,\n \"minHeightLandscape\": 560,\n \"maxRatioLandscape\": 2,\n \"deviceType\": {\n \"desktop\": \"desktop\",\n \"tablet\": \"tablet\",\n \"mobile\": \"mobile\"\n },\n \"preferredRatio\": {\n \"landscape\": \"16/10\",\n \"portrait\": \"9/16\"\n },\n \"screenWidthLimits\": {\n \"landscape\": {\n \"mobile\": 860,\n \"tablet\": 1280\n },\n \"portrait\": {\n \"mobile\": 480,\n \"tablet\": 800\n }\n },\n \"nwpHeaders\": {\n \"desktop\": 82,\n \"tablet\": 72,\n \"mobile\": 56\n },\n \"unavailableHeight\": {\n \"desktop\": 100,\n \"tablet\": 80,\n \"mobile\": 60\n }\n}\n;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * Easings are taken from: https://gist.github.com/gre/1650294\n */\nvar EASINGS = {\n easeInOutCubic: function easeInOutCubic(t) {\n return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;\n }\n};\n/**\n * This class is used for creating an animation with an easing.\n */\n\nvar EasingAnimation = /*#__PURE__*/function () {\n /**\n * Class constructor.\n */\n function EasingAnimation() {\n _classCallCheck(this, EasingAnimation);\n\n this.startValue = 0; // Start value\n\n this.endValue = 20; // End value\n\n this.callback = function () {}; // Callback to be called between each iteration\n\n\n this.easingType = 'easeInOutCubic'; // Type of easing\n\n this.animationDuration = 500; // Animation duration in ms\n\n this.frameInterval = 20; // Min time between frames in ms\n\n this._value = 0;\n this._animationStartTime = 0;\n this._lastFrame = 0;\n this._animationFrameId = null;\n this._events = {\n frame: [],\n end: []\n };\n }\n /**\n * Adds an event listener.\n *\n * @param {string} eventName Event name (frame, end).\n * @param {Function} callback Callback to be called.\n */\n\n\n _createClass(EasingAnimation, [{\n key: \"on\",\n value: function on(eventName, callback) {\n this._events[eventName].push(callback);\n }\n /**\n * Removes an event listener.\n *\n * @param {string} eventName Event name (frame, end).\n * @param {Function} callback Callback to be called.\n */\n\n }, {\n key: \"off\",\n value: function off(eventName, callback) {\n var index = this._events[eventName].indexOf(callback);\n\n if (index > -1) {\n this._events[eventName].splice(index, 1);\n }\n }\n /**\n * Triggers an event.\n *\n * @param {string} eventName Event name (frame, end).\n * @param {string} data Data to send to the callback.\n */\n\n }, {\n key: \"trigger\",\n value: function trigger(eventName, data) {\n var _iterator = _createForOfIteratorHelper(this._events[eventName]),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var callback = _step.value;\n callback(data);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n /**\n * Starts the animation.\n */\n\n }, {\n key: \"start\",\n value: function start() {\n cancelAnimationFrame(this._animationFrameId);\n this._value = this.startValue;\n this._animationStartTime = performance.now();\n this._animationFrameId = requestAnimationFrame(this._animate.bind(this));\n }\n /**\n * Stops the animation.\n */\n\n }, {\n key: \"stop\",\n value: function stop() {\n cancelAnimationFrame(this._animationFrameId);\n this.trigger('end', this._value);\n }\n /**\n * Calculate eased value, from start value to end value, based on percent of progress.\n *\n * @param {number} startValue Initial value for easing.\n * @param {number} endValue Final value for easing.\n * @param {number} progress Progress of animation [0 to 1].\n * @returns {number} New value based on easing and progress.\n */\n\n }, {\n key: \"_calculateValue\",\n value: function _calculateValue(startValue, endValue, progress) {\n var newValue = 0;\n\n if (startValue < endValue) {\n newValue = startValue + (endValue - startValue) * EASINGS[this.easingType](progress);\n } else {\n newValue = startValue - (startValue - endValue) * EASINGS[this.easingType](progress);\n }\n\n if (startValue === Math.round(startValue) && endValue === Math.round(endValue)) {\n newValue = Math.round(newValue);\n }\n\n if (progress > 1) {\n newValue = endValue;\n }\n\n return newValue;\n }\n /**\n * Animation frame - callback passed to rAF.\n *\n * @param {DOMHighResTimeStamp} now Current time when rAF start to fire callback.\n */\n\n }, {\n key: \"_animate\",\n value: function _animate(now) {\n var animationElapsedTime = now - this._animationStartTime;\n var frameElapsedTime = now - this._lastFrame;\n this._value = this._calculateValue(this.startValue, this.endValue, animationElapsedTime / this.animationDuration);\n\n if (animationElapsedTime > this.animationDuration) {\n this.trigger('frame', this.endValue);\n this.stop();\n } else {\n this._animationFrameId = requestAnimationFrame(this._animate.bind(this));\n\n if (frameElapsedTime > this.frameInterval) {\n this.trigger('frame', this._value);\n this._lastFrame = now - frameElapsedTime % this.frameInterval;\n }\n }\n }\n }]);\n\n return EasingAnimation;\n}();\n\nexports.default = EasingAnimation;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _IframeConfigJson = _interopRequireDefault(require(\"./IframeConfig.json.js\"));\n\nvar _EasingAnimation = _interopRequireDefault(require(\"../animation/EasingAnimation\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar DEFAULT_SCROLL_OPTIONS = {\n element: null,\n platform: null,\n animate: true,\n center: true,\n minDistance: 200,\n scrollTopMargin: 10\n};\n/**\n * This class is used for calculating the application size when inside an iframe.\n */\n\nvar IframeUtility = /*#__PURE__*/function () {\n function IframeUtility() {\n _classCallCheck(this, IframeUtility);\n }\n\n _createClass(IframeUtility, null, [{\n key: \"calculateHeight\",\n\n /**\n * Calculates the application height based on width and platform.\n *\n * @param {object} width Application width.\n * @param {string} [platform] Application plattform (nwp or irw). Default is \"irw\".\n * @returns {number} Calculated height.\n */\n value: function calculateHeight(width) {\n var platform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'irw';\n\n var screen = this._getScreen(width);\n\n var deviceType = this._calculateDeviceType(screen.width, screen.orientation);\n\n var appWidth = Math.min(width, _IframeConfigJson.default.maxWidth);\n\n var availableHeight = this._getAvailableHeight(screen.height, platform, deviceType);\n\n var height = appWidth / this._getRatio(screen.orientation);\n\n height = Math.min(height, availableHeight, _IframeConfigJson.default.maxHeightLandscape);\n\n if (screen.orientation === _IframeConfigJson.default.orientation.landscape) {\n height = Math.max(height, this._getMinHeightLandscape(deviceType, appWidth));\n }\n\n return Math.floor(height);\n }\n /**\n * Returns the device type based on the application size.\n *\n * @returns {string} Device type (mobile, desktop or tablet).\n */\n\n }, {\n key: \"getDeviceType\",\n value: function getDeviceType() {\n var minMeasurement = Math.min(window.screen.availWidth, window.screen.availHeight);\n return this._calculateDeviceType(minMeasurement, _IframeConfigJson.default.orientation.portrait);\n }\n /**\n * Returns the current orientation based on width.\n *\n * @param {number} width Application width.\n * @returns {string} Orientation (landscape or portrait).\n */\n\n }, {\n key: \"getOrientation\",\n value: function getOrientation(width) {\n return this._getScreen(width).orientation;\n }\n /**\n * Returns the header height.\n *\n * @param {string} platform Platform (nwp, irw, m2, mobile etc.).\n * @returns {number} Available height.\n */\n\n }, {\n key: \"getHeaderHeight\",\n value: function getHeaderHeight(platform) {\n // Is KOMPIS\n if (window.getIframeComponent) {\n return window.screen.width < 1024 ? 52 : 72;\n }\n\n return platform === 'nwp' ? _IframeConfigJson.default.nwpHeaders[this.getDeviceType()] : 0;\n }\n /**\n * Scrolls the parent window to make the element visible.\n *\n * @param {object} options Options object.\n * @param {Element} options.element Element to scroll into view.\n * @param {string} options.platform Platform (nwp, irw, m2, mobile etc.).\n * @param {boolean} [options.animate] TRUE to animate. Default is TRUE.\n * @param {boolean} [options.center] TRUE to center the element. Default is TRUE.\n * @param {number} [options.minDistance] Minimal distance before scroll will be activated. Default is \"200\" (px).\n * @param {number} [options.scrollTopMargin] Scroll top margin that will be offset from the top of the element when the element height is greater than the screen height. Default is \"10\" (px);.\n * @returns {EasingAnimation|null} Returns the easing animation if \"animate\" has been set to \"true\".\n */\n\n }, {\n key: \"scrollToElement\",\n value: function scrollToElement(options) {\n options = Object.assign({}, DEFAULT_SCROLL_OPTIONS, options);\n\n if (this.isInsideIframe()) {\n var screenHeight = window.parent.innerHeight;\n var headerHeight = this.getHeaderHeight(options.platform);\n var availableScreenHeight = screenHeight - headerHeight;\n\n var parentScrollPosition = this._getScrollPosition(window.parent);\n\n var scrollY = parentScrollPosition.y;\n var iframeTop = window.frameElement.getBoundingClientRect().top + scrollY - headerHeight;\n var elementTop = options.element.getBoundingClientRect().top + this._getScrollPosition().y + iframeTop;\n var elementHeight = options.element.offsetHeight;\n var centeredElementScrollY = elementHeight > availableScreenHeight ? elementTop - options.scrollTopMargin : elementTop - screenHeight / 2 + headerHeight + elementHeight / 2 - options.scrollTopMargin;\n var elementScrollY = options.center ? centeredElementScrollY : elementTop + headerHeight - options.scrollTopMargin;\n var newScrollY = elementScrollY > 0 ? elementScrollY : 0;\n var distanceY = newScrollY < scrollY ? scrollY - newScrollY : newScrollY - scrollY;\n\n if (options.animate) {\n var frames = Math.floor(distanceY / 10);\n\n if (distanceY > options.minDistance || elementHeight > availableScreenHeight) {\n var animation = new _EasingAnimation.default();\n animation.on('frame', function (y) {\n return window.parent.scrollTo(parentScrollPosition.x, y);\n });\n animation.startValue = scrollY;\n animation.endValue = newScrollY;\n animation.frames = frames;\n animation.start();\n return animation;\n }\n } else {\n window.parent.scrollTo(parentScrollPosition.x, newScrollY);\n }\n }\n\n return null;\n }\n /**\n * Checks if the application is inside an iframe.\n *\n * @returns {boolean} TRUE if inside an iframe.\n */\n\n }, {\n key: \"isInsideIframe\",\n value: function isInsideIframe() {\n try {\n if (window.parent && window.parent.innerHeight && window.frameElement && window.self !== window.top) {\n return true;\n }\n } catch (error) {// Ignore error\n }\n\n return false;\n }\n /**\n * Returns parent scroll position.\n *\n * @param {object} frame Frame object. Defaults to \"window\".\n * @returns {{y: number, x: number}} Scroll position.\n */\n\n }, {\n key: \"_getScrollPosition\",\n value: function _getScrollPosition() {\n var frame = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;\n return {\n y: frame.pageYOffset !== undefined ? frame.pageYOffset : frame.document.documentElement.scrollTop,\n x: frame.pageXOffset !== undefined ? frame.pageXOffset : frame.document.documentElement.scrollLeft\n };\n }\n /**\n * Returns the current screen data: width, height and orientation.\n *\n * @param {number} width Application width.\n * @returns {object} Screen setup.\n */\n\n }, {\n key: \"_getScreen\",\n value: function _getScreen(width) {\n var screen = {};\n /*\n * Some devices may return same availWidth/availHeight despite rotation\n * using given iframe width and assuming that it will not be greater that the actual screen width,\n * we can assume that we are in portrait if the iframe width is smaller or same as the smallest of the values\n */\n\n if (width <= Math.min(window.screen.availWidth, window.screen.availHeight, _IframeConfigJson.default.minWidthLandscape)) {\n screen.width = Math.min(window.screen.availWidth, window.screen.availHeight);\n screen.height = Math.max(window.screen.availWidth, window.screen.availHeight);\n screen.orientation = _IframeConfigJson.default.orientation.portrait;\n } else {\n screen.width = Math.max(window.screen.availWidth, window.screen.availHeight);\n screen.height = Math.min(window.screen.availWidth, window.screen.availHeight);\n screen.orientation = _IframeConfigJson.default.orientation.landscape;\n }\n\n return screen;\n }\n /**\n * Returns the available height.\n *\n * @param {number} screenHeight The screen height.\n * @param {string} platform Platform (nwp or irw).\n * @param {string} deviceType Device type (mobile, desktop or tablet).\n * @returns {number} Available height.\n */\n\n }, {\n key: \"_getAvailableHeight\",\n value: function _getAvailableHeight(screenHeight, platform, deviceType) {\n var bannerHeight = platform === 'nwp' ? _IframeConfigJson.default.nwpHeaders[deviceType] : 0;\n return screenHeight - _IframeConfigJson.default.unavailableHeight[deviceType] - bannerHeight;\n }\n /**\n * Calculates the device type.\n *\n * @param {number} screenWidth The screen width.\n * @param {string} orientation Orientation (portrait or landscape).\n * @returns {string} Device type (mobile, desktop or tablet).\n */\n\n }, {\n key: \"_calculateDeviceType\",\n value: function _calculateDeviceType(screenWidth, orientation) {\n if (screenWidth < _IframeConfigJson.default.screenWidthLimits[orientation][_IframeConfigJson.default.deviceType.mobile]) {\n // largest known phone is 736 (iPhone 6+), smallest known tablet is 1024 (iPad)\n return _IframeConfigJson.default.deviceType.mobile;\n }\n\n if (screenWidth <= _IframeConfigJson.default.screenWidthLimits[orientation][_IframeConfigJson.default.deviceType.tablet]) {\n // tablets larger than this may use full desktop ui\n return _IframeConfigJson.default.deviceType.tablet;\n }\n\n return _IframeConfigJson.default.deviceType.desktop;\n }\n /**\n * Returns the minimal possible height when in landscape.\n *\n * @param {string} deviceType Device type (mobile, desktop or tablet).\n * @param {number} appWidth Application width.\n * @returns {number} Minimal height for landscape.\n */\n\n }, {\n key: \"_getMinHeightLandscape\",\n value: function _getMinHeightLandscape(deviceType, appWidth) {\n if (deviceType == _IframeConfigJson.default.deviceType.mobile) {\n return appWidth / _IframeConfigJson.default.maxRatioLandscape;\n }\n\n return _IframeConfigJson.default.minHeightLandscape;\n }\n /**\n * Returns the current ratio.\n *\n * @param {string} orientation Orientation (portrait or landscape).\n * @returns {number} Ratio.\n */\n\n }, {\n key: \"_getRatio\",\n value: function _getRatio(orientation) {\n var ratio = _IframeConfigJson.default.preferredRatio[orientation].split('/');\n\n return parseInt(ratio[0]) / parseInt(ratio[1]);\n }\n }]);\n\n return IframeUtility;\n}();\n\nexports.default = IframeUtility;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * Provide with helpful JSON utility functions.\n */\nvar JsonUtility = /*#__PURE__*/function () {\n function JsonUtility() {\n _classCallCheck(this, JsonUtility);\n }\n\n _createClass(JsonUtility, null, [{\n key: \"toSortedJson\",\n\n /**\n * Converts an object to sorted JSON.\n *\n * @param {object} object Object.\n * @returns {string} Sorted JSON.\n */\n value: function toSortedJson(object) {\n var _this = this;\n\n if (_typeof(object) === 'object') {\n return '{' + Object.keys(object).sort().map(function (key) {\n return '\"' + key + '\":' + _this.toSortedJson(object[key]);\n }).join(',') + '}';\n }\n\n return JSON.stringify(object);\n }\n }]);\n\n return JsonUtility;\n}();\n\nexports.default = JsonUtility;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar THOUSAND_SEPERATOR_REGEXP = /(\\d+)(\\d{3})/;\n/**\n * Handles formatting of prices.\n */\n\nvar PriceFormatter = /*#__PURE__*/function () {\n function PriceFormatter() {\n _classCallCheck(this, PriceFormatter);\n }\n\n _createClass(PriceFormatter, null, [{\n key: \"format\",\n\n /**\n * Formats a price.\n *\n * @param {number} amount Price amount.\n * @param {object} config Configuration to use. Usually recieved from common translations under the \"prices\" property.\n * @param {number} config.currencyCode Currency code used.\n * @param {number} config.numberOfDecimals Number of decimals.\n * @param {boolean} config.thousandSeparatorEnabled TRUE to enable thousand separator.\n * @param {string} config.thousandSeparator Thousand separator.\n * @param {boolean} config.replaceNoValueDecimals TRUE to replace no value decimals.\n * @param {string} config.noValueDecimalsString No value decimals string.\n * @param {string} config.decimalSeparator Decimal separator.\n * @param {number} config.numberOfDecimals Number of decimals.\n * @param {string} config.symbolSpacing Symbol spacing.\n * @param {string} config.currencySymbol Currency symbol.\n * @param {string} config.currencyPosition Currency position (\"before\" or \"after\").\n * @param {boolean} [useHtml] TRUE to use HTML. This will add a span with dir=\"ltr\", so that '1 400' wont get reversed in morocco. Default is TRUE.\n * @returns {string} Formatted price with currency.\n */\n value: function format(amount, config) {\n var useHtml = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n if (typeof amount !== 'number' || isNaN(amount)) {\n return '';\n }\n\n config.numberOfDecimals = parseInt(config.numberOfDecimals);\n\n if (isNaN(config.numberOfDecimals)) {\n config.numberOfDecimals = 2;\n }\n\n config.thousandSeparator = config.thousandSeparator || ' ';\n\n if (config.noValueDecimalsString === ' ') {\n config.noValueDecimalsString = '';\n }\n\n var priceString, integer; // Since the number of trailing zeroes is set with the toFixed,\n // The values cannot be integers\n\n amount = amount.toFixed(config.numberOfDecimals).split('.');\n integer = amount[0];\n var fraction = amount.length === 2 ? amount[1] : 0;\n\n if (config.currencyCode === 'INR') {\n var result = [];\n var thousand = '';\n\n if (integer.length > 3) {\n thousand = ',' + integer.substr(integer.length - 3);\n integer = integer.substr(0, integer.length - 3);\n\n while (integer.length > 2) {\n result.unshift(integer.substr(integer.length - 2));\n integer = integer.substr(0, integer.length - 2);\n }\n }\n\n if (integer.length > 0) {\n result.unshift(integer);\n }\n\n integer = result.join(',') + thousand;\n } else if (config.thousandSeparatorEnabled && integer.length > 3) {\n while (THOUSAND_SEPERATOR_REGEXP.test(integer)) {\n integer = integer.replace(THOUSAND_SEPERATOR_REGEXP, '$1' + config.thousandSeparator + '$2');\n }\n }\n\n if (config.replaceNoValueDecimals && typeof config.noValueDecimalsString === 'string' && Number(fraction) === 0) {\n priceString = integer + config.noValueDecimalsString;\n } else if (config.decimalSeparator && config.numberOfDecimals !== 0) {\n priceString = integer + config.decimalSeparator + fraction;\n } else {\n priceString = integer;\n } // Add ltr so that '1 400' wont get reversed in morocco\n\n\n if (useHtml) {\n priceString = '' + priceString + '';\n }\n\n var priceWithCurrency = [priceString, config.symbolSpacing ? ' ' : '', config.currencySymbol];\n\n if (config.currencyPosition === 'before') {\n priceWithCurrency.reverse();\n }\n\n return useHtml ? '' + priceWithCurrency.join('') + '' : priceWithCurrency.join('');\n }\n /**\n * Formats a price to be used for a single article.\n *\n * @param {number} amount Price amount.\n * @param {object} config Configuration to use. Usually recieved from common translations under the \"prices\" property.\n * @param {number} config.currencyCode Currency code used.\n * @param {number} config.numberOfDecimals Number of decimals.\n * @param {boolean} config.thousandSeparatorEnabled TRUE to enable thousand separator.\n * @param {string} config.thousandSeparator Thousand separator.\n * @param {boolean} config.replaceNoValueDecimals TRUE to replace no value decimals.\n * @param {string} config.noValueDecimalsString No value decimals string.\n * @param {string} config.decimalSeparator Decimal separator.\n * @param {number} config.numberOfDecimals Number of decimals.\n * @param {string} config.symbolSpacing Symbol spacing.\n * @param {string} config.currencySymbol Currency symbol.\n * @param {string} config.currencyPosition Currency position (\"before\" or \"after\").\n * @param {object} article An article object returned from ArticleServiceFacade when formatting is done on a single item. Additional information like package information will be added.\n * @param {boolean} [useHtml] TRUE to use HTML. This will add a span with dir=\"ltr\", so that '1 400' wont get reversed in morocco. Default is TRUE.\n * @returns {string} Formatted price with currency.\n */\n\n }, {\n key: \"formatForArticle\",\n value: function formatForArticle(amount, config, article) {\n var useHtml = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n var priceWithCurrency = this.format(amount, config, useHtml);\n var priceUnitFactor = parseFloat(article.PriceUnitFactor);\n\n if (priceWithCurrency === '') {\n return '';\n }\n\n if (!isNaN(priceUnitFactor) && typeof article.PriceUnitText === 'string' && (priceUnitFactor > 1 || article.PriceUnitTextEn && article.PriceUnitTextEn !== 'pack')) {\n if (useHtml) {\n return priceWithCurrency.slice(0, -7) + '/' + article.PriceUnitFactor + ' ' + article.PriceUnitText + '';\n }\n\n return priceWithCurrency + '/' + article.PriceUnitFactor + ' ' + article.PriceUnitText;\n }\n\n return priceWithCurrency;\n }\n }]);\n\n return PriceFormatter;\n}();\n\nexports.default = PriceFormatter;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar DEFAULT_COUNTRY = 'se';\nvar DEFAULT_LANGUAGE = 'sv';\nvar DEFAULT_UI_PLATFORM = 'irw';\n/**\n * Provide with URL utility functions.\n */\n\nvar UrlUtility = /*#__PURE__*/function () {\n function UrlUtility() {\n _classCallCheck(this, UrlUtility);\n }\n\n _createClass(UrlUtility, null, [{\n key: \"getAppInfo\",\n\n /**\n * Returns application information from query string.\n *\n * @returns {{ country: string, language: string, uiPlatform: string }} Country, Language and UI platform in an object. Default values: { country: 'se', language: 'sv', uiPlatform: 'irw' }.\n */\n value: function getAppInfo() {\n if (this._appInfo) {\n return this._appInfo;\n }\n\n var query = this.getCombinedQuery();\n var country = DEFAULT_COUNTRY;\n var language = DEFAULT_LANGUAGE;\n\n if (query.locale) {\n var locale = query.locale.split('_');\n\n if (locale.length > 1 && locale[0].length === 2 && locale[1].length === 2) {\n country = locale[1].toLowerCase();\n language = locale[0].toLowerCase();\n }\n }\n\n this._appInfo = {\n country: country,\n language: language,\n uiPlatform: query.uiPlatform || DEFAULT_UI_PLATFORM,\n storeId: query.storeId || null,\n applicationName: query.applicationName || null,\n seriesGallery: {\n applications: query.applications ? query.applications.split(',') : [],\n defaultApplication: query.defaultApplication || null\n }\n };\n return this._appInfo;\n }\n /**\n * Returns the query string merged with both search and hash as variables.\n *\n * @returns {object} Object with key value pairs of the data in the query string.\n */\n\n }, {\n key: \"getCombinedQuery\",\n value: function getCombinedQuery() {\n return Object.assign(this.getSearchQuery(), this.getHashQuery());\n }\n /**\n * Returns the query string as variables.\n *\n * @returns {object} Object with key value pairs of the data in the query string.\n */\n\n }, {\n key: \"getSearchQuery\",\n value: function getSearchQuery() {\n var search = window.location.search ? window.location.search.substring(1) : '';\n return this._parseQueryString(search);\n }\n /**\n * Sets search query.\n *\n * @param {object} query Query to set.\n */\n\n }, {\n key: \"setSearchQuery\",\n value: function setSearchQuery(query) {\n window.location.href = window.location.href.split('?')[0] + this.buildQueryString(query);\n }\n /**\n * Returns the query string defined in hash as variables.\n *\n * @returns {object} Object with key value pairs of the data in the query string.\n */\n\n }, {\n key: \"getHashQuery\",\n value: function getHashQuery() {\n var hash = window.location.hash ? window.location.hash.split('?').reverse()[0] : '';\n return this._parseQueryString(hash);\n }\n /**\n * Sets hash query.\n *\n * @param {object} query Query to set.\n */\n\n }, {\n key: \"setHashQuery\",\n value: function setHashQuery(query) {\n window.location.hash = '#' + window.location.hash.split('?')[0].replace('#', '') + this.buildQueryString(query);\n }\n /**\n * Builds search query.\n *\n * @param {object} query Query to build.\n * @returns {string} Query string.\n */\n\n }, {\n key: \"buildQueryString\",\n value: function buildQueryString(query) {\n var queryString = [];\n\n for (var _i = 0, _Object$keys = Object.keys(query); _i < _Object$keys.length; _i++) {\n var key = _Object$keys[_i];\n queryString.push(key + '=' + query[key]);\n }\n\n return '?' + queryString.join('&');\n }\n /**\n * Clears cache.\n */\n\n }, {\n key: \"clearCache\",\n value: function clearCache() {\n delete this._appInfo;\n }\n /**\n * Parses a query.\n *\n * @param {string} queryString Query string.\n * @returns {object} Object with key value pairs of the data in the query string.\n */\n\n }, {\n key: \"_parseQueryString\",\n value: function _parseQueryString(queryString) {\n var variables = queryString.split('&');\n var query = {};\n\n var _iterator = _createForOfIteratorHelper(variables),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var variable = _step.value;\n\n if (variable) {\n var pair = variable.split('=');\n query[pair[0]] = pair[1];\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return query;\n }\n }]);\n\n return UrlUtility;\n}();\n\nexports.default = UrlUtility;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * Handles string utilities.\n */\nvar StringUtility = /*#__PURE__*/function () {\n function StringUtility() {\n _classCallCheck(this, StringUtility);\n }\n\n _createClass(StringUtility, null, [{\n key: \"capitalizeFirstLetter\",\n\n /**\n * Capitalizes first letter.\n *\n * @param {string} string String to use.\n * @returns {string} String with first letter capitalized.\n */\n value: function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }\n /**\n * Converts a camel case string to separate words with space inbetween.\n *\n * @param {string} string String to use.\n * @returns {string} Converted string.\n */\n\n }, {\n key: \"camelCaseToWords\",\n value: function camelCaseToWords(string) {\n return this.capitalizeFirstLetter(string.replace(/([A-Z0-9])/g, ' $1'));\n }\n /**\n * Converts a camel case string to kebab case.\n *\n * @example \"buttonEnabled\" will be converted to \"button-enabled\".\n * @param {string} string String to use.\n * @returns {string} Converted string.\n */\n\n }, {\n key: \"camelToKebabCase\",\n value: function camelToKebabCase(string) {\n return string.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n }\n /**\n * Converts a kebab case string to words.\n *\n * @example \"button-enabled\" will be converted to \"Button Enabled\".\n * @param {string} string String to use.\n * @returns {string} Converted string.\n */\n\n }, {\n key: \"kebabCaseToWords\",\n value: function kebabCaseToWords(string) {\n string = string.split('-');\n\n for (var i = 0, max = string.length; i < max; i++) {\n string[i] = this.capitalizeFirstLetter(string[i]);\n }\n\n return string.join(' ');\n }\n }]);\n\n return StringUtility;\n}();\n\nexports.default = StringUtility;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar deprecatedIcons = ['threstles', 'threstle', 'arrow-right', 'arrow-left', 'arrow_down', 'arrow_up', 'select-all_2', 'chair_bar', 'chair_long', 'storage_accessories', 'extractor_hood', 'landscape_to_portrait'].map(function (iconName) {\n return 'IKEA--icon-' + iconName;\n});\n/**\n * StyleUtility\n */\n\nvar StyleUtility = /*#__PURE__*/function () {\n function StyleUtility() {\n _classCallCheck(this, StyleUtility);\n }\n\n _createClass(StyleUtility, null, [{\n key: \"getIconClasses\",\n\n /**\n * Gets all IKEA icons css classes.\n *\n * @returns {Array} - IKEA icons css classes.\n */\n value: function getIconClasses() {\n var icons = [];\n var sheet = document.styleSheets;\n var rule = null,\n i = sheet.length,\n j;\n\n while (0 <= --i) {\n try {\n rule = sheet[i].rules || sheet[i].cssRules || [];\n } catch (error) {\n rule = [];\n }\n\n j = rule.length;\n\n while (0 <= --j) {\n if (rule[j].constructor === CSSStyleRule && rule[j].selectorText.includes('.IKEA--icon')) {\n var selectorText = rule[j].selectorText.match(/(.ikea--icon-.*)::before/gi);\n\n if (selectorText) {\n var icon = selectorText[0].replace('::before', '').replace('.', '');\n\n if (!icons.includes(icon) && !deprecatedIcons.includes(icon)) {\n icons.push(icon);\n }\n }\n }\n }\n }\n\n return icons.sort();\n }\n /**\n * Get Icons names.\n *\n * @returns {Array} - IKEA icons names.\n */\n\n }, {\n key: \"getIconNames\",\n value: function getIconNames() {\n return this.getIconClasses().map(function (value) {\n return value.replace('IKEA--icon-', '');\n });\n }\n }]);\n\n return StyleUtility;\n}();\n\nexports.default = StyleUtility;","module.exports = {\n \"40\": \"xxu\",\n \"80\": \"xu\",\n \"160\": \"u\",\n \"300\": \"xxxs\",\n \"400\": \"xxs\",\n \"500\": \"xs\",\n \"600\": \"s\",\n \"700\": \"m\",\n \"750\": \"l\",\n \"900\": \"xl\",\n \"1100\": \"xxl\",\n \"1400\": \"xxxl\"\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _AkamaiImageSizesJson = _interopRequireDefault(require(\"./AkamaiImageSizes.json.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar SIZE_NUMBERS = Object.keys(_AkamaiImageSizesJson.default).map(function (size) {\n return parseInt(size);\n});\nvar POLICY = 'f';\n/**\n * This class is used for Image utility function.s\n */\n\nvar ImageUtility = /*#__PURE__*/function () {\n function ImageUtility() {\n _classCallCheck(this, ImageUtility);\n }\n\n _createClass(ImageUtility, null, [{\n key: \"getAkamaiQueryString\",\n\n /**\n * Returns an Akamai query string based on size.\n *\n * @param {number} size Size of the image.\n * @returns {string} Query string.\n */\n value: function getAkamaiQueryString(size) {\n return \"?\".concat(POLICY, \"=\").concat(this._getAkamaiSize(size));\n }\n /**\n * Get Akamai formatted size.\n *\n * @param {number} size Image size.\n * @returns {string} Size.\n */\n\n }, {\n key: \"_getAkamaiSize\",\n value: function _getAkamaiSize(size) {\n var _iterator = _createForOfIteratorHelper(SIZE_NUMBERS),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var akamaiSize = _step.value;\n\n if (size <= akamaiSize) {\n return _AkamaiImageSizesJson.default[akamaiSize.toString()];\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return _AkamaiImageSizesJson.default[SIZE_NUMBERS[SIZE_NUMBERS.length - 1].toString()];\n }\n }]);\n\n return ImageUtility;\n}();\n\nexports.default = ImageUtility;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = {\n UNKNOWN: 'UNKNOWN',\n CODE: 'CODE',\n SERVER: 'SERVER',\n CONNECTION: 'CONNECTION'\n};\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _ExceptionTypeConstant = _interopRequireDefault(require(\"../constant/ExceptionTypeConstant\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n/**\n * Custom exception.\n */\nvar Exception = /*#__PURE__*/function (_Error) {\n _inherits(Exception, _Error);\n\n var _super = _createSuper(Exception);\n\n /**\n * Class constructor.\n *\n * @param {string} message The error message.\n * @param {string} [exceptionType] The exception type.\n */\n function Exception(message) {\n var _this;\n\n var exceptionType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'Exception';\n\n _classCallCheck(this, Exception);\n\n _this = _super.call(this, message);\n _this.message = 'Uncaught ' + exceptionType + ': ' + message;\n _this.name = _this.constructor.name;\n _this.stack = new Error().stack;\n _this.thrownBy = 'UNKNOWN';\n _this.type = _ExceptionTypeConstant.default.UNKNOWN;\n _this.exceptionType = exceptionType;\n return _this;\n }\n\n return Exception;\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n\nexports.default = Exception;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _Exception2 = _interopRequireDefault(require(\"./Exception\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n/**\n * Custom exception.\n */\nvar ComponentException = /*#__PURE__*/function (_Exception) {\n _inherits(ComponentException, _Exception);\n\n var _super = _createSuper(ComponentException);\n\n /**\n * Class constructor.\n *\n * @param {string} message The error message.\n * @param {AbstractComponent|string} [component] The component instance throwing the error.\n */\n function ComponentException(message) {\n var _this;\n\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n _classCallCheck(this, ComponentException);\n\n _this = _super.call(this, message, 'ComponentException');\n _this.thrownBy = component !== null && _typeof(component) === 'object' && component.constructor.componentName ? component.constructor.componentName : typeof component === 'string' ? component : 'UNKNOWN';\n _this.message = 'Uncaught ComponentException: ' + (_this.thrownBy !== 'UNKNOWN' ? _this.thrownBy + ': ' : '') + message;\n return _this;\n }\n\n return ComponentException;\n}(_Exception2.default);\n\nexports.default = ComponentException;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _ComponentException = _interopRequireDefault(require(\"../exception/ComponentException\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * Component Event Handler.\n */\nvar EventHandler = /*#__PURE__*/function () {\n /**\n * Class constructor.\n *\n * @param {object} options Options object.\n * @param {string[]} options.supportedEvents Supported events.\n * @param {string} options.componentName Component name.\n * @param {object} [options.scope] Scope to call callback in.\n */\n function EventHandler(options) {\n _classCallCheck(this, EventHandler);\n\n this.supportedEvents = options.supportedEvents;\n this._events = {};\n this._componentName = options.componentName;\n this._scope = options.scope || this;\n }\n /**\n * Adds an event listener.\n *\n * @param {string} name Event name.\n * @param {Function} listener The listener.\n */\n\n\n _createClass(EventHandler, [{\n key: \"on\",\n value: function on(name, listener) {\n if (!this.supportedEvents.includes(name)) {\n throw new _ComponentException.default('Event with name \"' + name + '\" is not supported.', this._componentName);\n }\n\n this._events[name] = this._events[name] || [];\n\n this._events[name].push(listener);\n }\n /**\n * Removes an event listener.\n *\n * @param {string} name Event name.\n * @param {Function} [listener] The listener. Will remove all listeners if not defined.\n */\n\n }, {\n key: \"off\",\n value: function off(name) {\n var listener = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (!this.supportedEvents.includes(name)) {\n throw new _ComponentException.default('Event with name \"' + name + '\" is not supported.', this._componentName);\n }\n\n this._events[name] = this._events[name] || [];\n\n if (listener === null) {\n delete this._events[name];\n } else {\n var index = this._events[name].indexOf(listener);\n\n if (index !== -1) {\n this._events[name].splice(index, 1);\n }\n }\n }\n /**\n * Triggers an event.\n *\n * @param {string} name Event name.\n * @param {...object} args Arguments to send.\n */\n\n }, {\n key: \"trigger\",\n value: function trigger(name) {\n if (!this.supportedEvents.includes(name)) {\n throw new _ComponentException.default('Event with name \"' + name + '\" is not supported.', this._componentName);\n }\n\n this._events[name] = this._events[name] || [];\n this._events[name].isTriggered = true;\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 var _iterator = _createForOfIteratorHelper(this._events[name]),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var listener = _step.value;\n listener.apply(this._scope, args);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n /**\n * Checks if an event has been triggered before.\n *\n * @param {string} name Event name.\n * @returns {boolean} TRUE if triggered before.\n */\n\n }, {\n key: \"isTriggered\",\n value: function isTriggered(name) {\n return Array.isArray(this._events[name]) && this._events[name].isTriggered === true;\n }\n /**\n * Returns changed events based on an object with new events.\n *\n * @param {object} newEvents Events to set as key/value. Example: { click: () => {} }.\n * @returns {object} Changed events.\n */\n\n }, {\n key: \"getChangedEvents\",\n value: function getChangedEvents(newEvents) {\n var changedEvents = {};\n\n if (newEvents) {\n for (var _i = 0, _Object$keys = Object.keys(newEvents); _i < _Object$keys.length; _i++) {\n var key = _Object$keys[_i];\n\n if (!this._events[name] || !this._events[name].includes(newEvents[key])) {\n changedEvents[name] = newEvents[name];\n }\n }\n }\n\n return changedEvents;\n }\n }]);\n\n return EventHandler;\n}();\n\nexports.default = EventHandler;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _EventHandler2 = _interopRequireDefault(require(\"../event/EventHandler\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n/**\n * This class is used for observer changes to the size of the window and send it to the iframe.\n */\nvar ApplicationResizeObserver = /*#__PURE__*/function (_EventHandler) {\n _inherits(ApplicationResizeObserver, _EventHandler);\n\n var _super = _createSuper(ApplicationResizeObserver);\n\n /**\n * Clas constructor.\n *\n * @param {Element} [context] Context to watch.\n */\n function ApplicationResizeObserver() {\n var _this;\n\n var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n _classCallCheck(this, ApplicationResizeObserver);\n\n _this = _super.call(this, {\n supportedEvents: ['resize'],\n componentName: 'ApplicationResizeObserver'\n });\n _this.context = context || document.body;\n _this._images = _this.context.getElementsByTagName('img');\n _this._observer = null;\n _this._size = {\n height: 0,\n width: 0\n };\n _this._updateTimeout = null;\n\n _this._updateListener = function (event) {\n clearTimeout(_this._updateTimeout);\n _this._updateTimeout = setTimeout(_this.update.bind(_assertThisInitialized(_this)));\n\n if (event && event.target && event.target && event.target.tagName === 'IMG') {\n event.target.removeEventListener('load', _this._updateListener);\n }\n };\n\n return _this;\n }\n /**\n * Handles an update.\n */\n\n\n _createClass(ApplicationResizeObserver, [{\n key: \"update\",\n value: function update() {\n var newHeight = this.context.scrollHeight;\n var newWidth = this.context.scrollWidth;\n\n if (this._size.height !== newHeight && this._size.width !== newWidth) {\n this._size.height = newHeight;\n this._size.width = newWidth;\n this.trigger('resize', Object.assign({}, this._size));\n\n for (var _i = 0, _Array$from = Array.from(this._images); _i < _Array$from.length; _i++) {\n var image = _Array$from[_i];\n\n if (!image.complete) {\n image.addEventListener('load', this._updateListener);\n }\n }\n }\n }\n /**\n * Connects observer and adds a listener for resize.\n */\n\n }, {\n key: \"connect\",\n value: function connect() {\n if (this._observer === null) {\n this._observer = new MutationObserver(this._updateListener);\n\n this._observer.observe(this.context, {\n attributes: true,\n childList: true,\n characterData: true,\n subtree: true\n });\n\n window.addEventListener('resize', this._updateListener);\n this.update();\n }\n }\n /**\n * Disconnects observer and removes listener for resize.\n */\n\n }, {\n key: \"disconnect\",\n value: function disconnect() {\n if (this._observer !== null) {\n clearTimeout(this._updateTimeout);\n\n this._observer.disconnect();\n\n this._observer = null;\n window.removeEventListener('resize', this._updateListener);\n }\n }\n }]);\n\n return ApplicationResizeObserver;\n}(_EventHandler2.default);\n\nexports.default = ApplicationResizeObserver;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * This class is used for retireving supported events.\n */\nvar EventSupport = /*#__PURE__*/function () {\n function EventSupport() {\n _classCallCheck(this, EventSupport);\n }\n\n _createClass(EventSupport, null, [{\n key: \"getSupportedPointerEvents\",\n\n /**\n * Returns the supported pointer events.\n *\n * @returns {{start: string, move: string, end: string, leave: string}[]} Supported pointer events.\n */\n value: function getSupportedPointerEvents() {\n if (window.navigator.pointerEnabled) {\n return [{\n start: 'pointerdown',\n move: 'pointermove',\n end: 'pointerup',\n leave: 'pointerleave'\n }];\n } else if (window.navigator.msPointerEnabled) {\n return [{\n start: 'MSPointerDown',\n move: 'MSPointerMove',\n end: 'MSPointerUp',\n leave: 'MSPointerLeave'\n }];\n }\n\n return [{\n start: 'touchstart',\n move: 'touchmove',\n end: 'touchend',\n leave: 'touchleave'\n }, {\n start: 'mousedown',\n move: 'mousemove',\n end: 'mouseup',\n leave: 'mouseleave'\n }];\n }\n }]);\n\n return EventSupport;\n}();\n\nexports.default = EventSupport;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * Cache store manager.\n */\nvar CacheStore = /*#__PURE__*/function () {\n /**\n * Class constructor.\n *\n * @param {String} name Store name.\n */\n function CacheStore(name) {\n _classCallCheck(this, CacheStore);\n\n this.constructor.store[name] = this.constructor.store[name] || new Map();\n this.store = this.constructor.store[name];\n }\n /**\n * Sets a cache item.\n *\n * @param {Object} key Cache key.\n * @param {Object} value Cache value.\n */\n\n\n _createClass(CacheStore, [{\n key: \"set\",\n value: function set(key, value) {\n this.store.set(key, value);\n }\n /**\n * Returns a cache item.\n *\n * @param {Object} key Cache key.\n * @return {Object|Null} Cache value.\n */\n\n }, {\n key: \"get\",\n value: function get(key) {\n return this.store.get(key);\n }\n /**\n * Deletes a cache item.\n *\n * @param {Object} key Cache key.\n */\n\n }, {\n key: \"delete\",\n value: function _delete(key) {\n this.store.delete(key);\n }\n /**\n * Clears the cache.\n */\n\n }, {\n key: \"clear\",\n value: function clear() {\n this.store.clear();\n }\n /**\n * Returns all keys.\n *\n * @return {Object[]} Cache keys.\n */\n\n }, {\n key: \"keys\",\n value: function keys() {\n return this.store.keys();\n }\n /**\n * Returns all values.\n *\n * @return {Object[]} Cache values.\n */\n\n }, {\n key: \"values\",\n value: function values() {\n return this.store.values();\n }\n /**\n * Returns the amount of values stored in the cache.\n *\n * @return {Number} Amount of values.\n */\n\n }, {\n key: \"size\",\n get: function get() {\n return this.store.size;\n }\n /**\n * Returns the store.\n *\n * @return {Object} Cache store.\n */\n\n }], [{\n key: \"clearAll\",\n\n /**\n * Clears all cache.\n */\n value: function clearAll() {\n window.IkeaComponent = window.IkeaComponent || {};\n window.IkeaComponent.$cacheStore = {};\n }\n }, {\n key: \"store\",\n get: function get() {\n window.IkeaComponent = window.IkeaComponent || {};\n window.IkeaComponent.$cacheStore = window.IkeaComponent.$cacheStore || {};\n return window.IkeaComponent.$cacheStore;\n }\n }]);\n\n return CacheStore;\n}();\n\nexports.default = CacheStore;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _Exception2 = _interopRequireDefault(require(\"./Exception\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n/**\n * Custom exception.\n */\nvar UnsupportedException = /*#__PURE__*/function (_Exception) {\n _inherits(UnsupportedException, _Exception);\n\n var _super = _createSuper(UnsupportedException);\n\n /**\n * Class constructor.\n *\n * @param {string} message The error message.\n */\n function UnsupportedException(message) {\n _classCallCheck(this, UnsupportedException);\n\n return _super.call(this, message, 'UnsupportedException');\n }\n\n return UnsupportedException;\n}(_Exception2.default);\n\nexports.default = UnsupportedException;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _Exception2 = _interopRequireDefault(require(\"./Exception\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n/**\n * Custom exception.\n */\nvar AbstractMethodException = /*#__PURE__*/function (_Exception) {\n _inherits(AbstractMethodException, _Exception);\n\n var _super = _createSuper(AbstractMethodException);\n\n /**\n * Class constructor.\n *\n * @param {string} [message] The error message.\n */\n function AbstractMethodException() {\n var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Class method is abstract cannot be called directly.';\n\n _classCallCheck(this, AbstractMethodException);\n\n return _super.call(this, message, 'AbstractMethodException');\n }\n\n return AbstractMethodException;\n}(_Exception2.default);\n\nexports.default = AbstractMethodException;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _CacheStore = _interopRequireDefault(require(\"../CacheStore\"));\n\nvar _UnsupportedException = _interopRequireDefault(require(\"../exception/UnsupportedException\"));\n\nvar _AbstractMethodException = _interopRequireDefault(require(\"../exception/AbstractMethodException\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * Settings manager.\n */\nvar AbstractSettingsManager = /*#__PURE__*/function () {\n function AbstractSettingsManager() {\n _classCallCheck(this, AbstractSettingsManager);\n }\n\n _createClass(AbstractSettingsManager, null, [{\n key: \"applySettings\",\n\n /**\n * Applies multiple service settings.\n *\n * @param {object} settings Settings object.\n */\n value: function applySettings(settings) {\n var defaultSettings = this.getDefaultSettings();\n\n for (var _i = 0, _Object$keys = Object.keys(settings); _i < _Object$keys.length; _i++) {\n var key = _Object$keys[_i];\n\n if (defaultSettings[key] !== undefined) {\n if (settings[key] !== undefined) {\n this[key] = settings[key];\n }\n } else {\n throw new _UnsupportedException.default('The setting with key \"' + key + '\" is not supported in \"' + this.name + '\".');\n }\n }\n }\n /**\n * Returns all settings as an object.\n *\n * @returns {object} All settings.\n */\n\n }, {\n key: \"getAllSettings\",\n value: function getAllSettings() {\n var settings = {};\n\n var _iterator = _createForOfIteratorHelper(this.settings.store),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _step$value = _slicedToArray(_step.value, 2),\n key = _step$value[0],\n value = _step$value[1];\n\n settings[key] = value;\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return settings;\n }\n /**\n * Returns the default settings.\n *\n * @abstract\n * @returns {object} Default settings as an object.\n */\n\n }, {\n key: \"getDefaultSettings\",\n value: function getDefaultSettings() {\n throw new _AbstractMethodException.default();\n }\n /**\n * Applies properties for the settings.\n */\n\n }, {\n key: \"setupProperties\",\n value: function setupProperties() {\n var _this = this;\n\n var defaultSettings = this.getDefaultSettings();\n\n var _loop = function _loop() {\n var key = _Object$keys2[_i2];\n\n if (_this[key] === undefined) {\n Object.defineProperty(_this, key, {\n set: function set(value) {\n _this.settings.set(key, value);\n },\n get: function get() {\n return _this.settings.get(key);\n }\n });\n }\n };\n\n for (var _i2 = 0, _Object$keys2 = Object.keys(defaultSettings); _i2 < _Object$keys2.length; _i2++) {\n _loop();\n }\n }\n /**\n * Returns the settings manager name.\n *\n * @abstract\n * @returns {string} Settings manager name.\n */\n\n }, {\n key: \"settingsName\",\n get: function get() {\n throw new _AbstractMethodException.default();\n }\n /**\n * Returns the settings.\n *\n * @returns {CacheStore} Settings cache store.\n */\n\n }, {\n key: \"settings\",\n get: function get() {\n if (!this._cacheStore) {\n this._cacheStore = new _CacheStore.default(this.settingsName);\n\n if (this._cacheStore.size === 0) {\n var defaultSettings = this.getDefaultSettings();\n\n for (var _i3 = 0, _Object$keys3 = Object.keys(defaultSettings); _i3 < _Object$keys3.length; _i3++) {\n var key = _Object$keys3[_i3];\n\n this._cacheStore.set(key, defaultSettings[key]);\n }\n }\n }\n\n return this._cacheStore;\n }\n }]);\n\n return AbstractSettingsManager;\n}();\n\nexports.default = AbstractSettingsManager;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _AbstractSettingsManager = _interopRequireDefault(require(\"./AbstractSettingsManager\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n/**\n * Manages component settings.\n */\nvar ComponentSettings = /*#__PURE__*/function (_AbstractSettingsMana) {\n _inherits(ComponentSettings, _AbstractSettingsMana);\n\n var _super = _createSuper(ComponentSettings);\n\n function ComponentSettings() {\n _classCallCheck(this, ComponentSettings);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(ComponentSettings, null, [{\n key: \"getDefaultSettings\",\n\n /**\n * Returns the default settings.\n *\n * @override\n * @returns {object} Default settings as an object.\n */\n value: function getDefaultSettings() {\n return {\n uiPlatform: null\n };\n }\n /**\n * Returns the settings manager name.\n *\n * @override\n * @returns {string} Settings manager name.\n */\n\n }, {\n key: \"settingsName\",\n get: function get() {\n return 'ComponentSettings';\n }\n }]);\n\n return ComponentSettings;\n}(_AbstractSettingsManager.default);\n\nexports.default = ComponentSettings;\nComponentSettings.setupProperties();","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _IframeUtility = _interopRequireDefault(require(\"./IframeUtility\"));\n\nvar _EasingAnimation = _interopRequireDefault(require(\"../animation/EasingAnimation\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * Window scrolling utility\n */\nvar ScrollUtility = /*#__PURE__*/function () {\n function ScrollUtility() {\n _classCallCheck(this, ScrollUtility);\n }\n\n _createClass(ScrollUtility, null, [{\n key: \"scrollToElement\",\n\n /**\n * Scrolls the window to make the element visible.\n *\n * @param {object} options Options object.\n * @param {Element} options.element Element to scroll into view.\n * @param {string} options.platform Platform (nwp, irw, m2, mobile etc.).\n * @param {boolean} [options.animate] TRUE to animate. Default is TRUE.\n * @param {boolean} [options.center] TRUE to center the element. Default is TRUE.\n * @param {number} [options.minDistance] Minimal distance before scroll will be activated. Default is \"200\" (px).\n * @param {number} [options.scrollTopMargin] Scroll top margin that will be offset from the top of the element when the element height is greater than the screen height. Default is \"10\" (px);.\n */\n value: function scrollToElement(options) {\n if (_IframeUtility.default.isInsideIframe()) {\n this._scrollToElement(options);\n } else {\n _IframeUtility.default.scrollToElement(options);\n }\n }\n /**\n * Scrolls the window to make the element visible.\n *\n * @param {object} options Options object.\n * @param {Element} options.element Element to scroll into view.\n * @param {string} options.platform Platform (nwp, irw, m2, mobile etc.).\n * @param {boolean} [options.animate] TRUE to animate. Default is TRUE.\n * @param {boolean} [options.center] TRUE to center the element. Default is TRUE.\n * @param {number} [options.minDistance] Minimal distance before scroll will be activated. Default is \"200\" (px).\n * @param {number} [options.scrollTopMargin] Scroll top margin that will be offset from the top of the element when the element height is greater than the screen height. Default is \"10\" (px);.\n */\n\n }, {\n key: \"_scrollToElement\",\n value: function _scrollToElement(options) {\n var element = options.element,\n scrollTopMargin = options.scrollTopMargin,\n _options$center = options.center,\n center = _options$center === void 0 ? true : _options$center,\n _options$minDistance = options.minDistance,\n minDistance = _options$minDistance === void 0 ? 200 : _options$minDistance,\n _options$animate = options.animate,\n animate = _options$animate === void 0 ? true : _options$animate;\n var screenHeight = window.parent.innerHeight;\n var bodyRect = document.body.getBoundingClientRect();\n var elemRect = element.getBoundingClientRect();\n var elementTopY = elemRect.top - bodyRect.top;\n var elementCenterY = elemRect.height > screenHeight ? elementTopY : elementTopY - screenHeight / 2 + elemRect.height / 2;\n var endPositionY = center ? elementCenterY - scrollTopMargin : elementTopY - scrollTopMargin;\n var startY = window.pageYOffset !== undefined ? window.pageYOffset : window.document.documentElement.scrollTop;\n var currentX = window.pageXOffset !== undefined ? window.pageXOffset : 0;\n var distanceY = Math.abs(startY - endPositionY);\n\n if (distanceY > minDistance) {\n if (animate) {\n var animation = new _EasingAnimation.default();\n animation.on('frame', function (y) {\n return window.parent.scrollTo(0, y);\n });\n animation.startValue = startY;\n animation.endValue = endPositionY;\n var frames = Math.floor(distanceY / 10);\n animation.frames = frames;\n animation.start();\n } else {\n window.scrollTo(currentX, endPositionY);\n }\n }\n }\n }]);\n\n return ScrollUtility;\n}();\n\nexports.default = ScrollUtility;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * ResourceTagLoader\n */\nvar ResourceTagLoader = /*#__PURE__*/function () {\n function ResourceTagLoader() {\n _classCallCheck(this, ResourceTagLoader);\n }\n\n _createClass(ResourceTagLoader, null, [{\n key: \"loadCss\",\n\n /**\n * Load a script by adding a script tag.\n *\n * @param {object} args Args.\n * @param {string} args.url What to load.\n * @param {HTMLElement} args.parent Where to add tag.\n * @returns {Promise} - Resolved when ready.\n */\n value: function loadCss(_ref) {\n var url = _ref.url,\n _ref$parent = _ref.parent,\n parent = _ref$parent === void 0 ? document.head : _ref$parent;\n var element = document.createElement('link');\n var promise = this.waitForTagLoad(element);\n element.href = url;\n element.setAttribute('type', 'text/css');\n element.setAttribute('rel', 'stylesheet');\n parent.appendChild(element);\n return promise;\n }\n /**\n * Load a script by adding a script tag.\n *\n * @param {object} args Args.\n * @param {string} args.url What to load.\n * @param {HTMLElement} args.parent Where to add tag.\n * @returns {Promise} - Resolved when ready.\n */\n\n }, {\n key: \"loadScript\",\n value: function loadScript(_ref2) {\n var url = _ref2.url,\n _ref2$parent = _ref2.parent,\n parent = _ref2$parent === void 0 ? document.head : _ref2$parent;\n var element = document.createElement('script');\n var promise = this.waitForTagLoad(element);\n element.src = url;\n element.async = 1;\n parent.appendChild(element);\n return promise;\n }\n /**\n * Promizify tag load.\n *\n * @param {HTMLElement} htmlElement What to load.\n * @returns {Promise} - Resolved when ready.\n */\n\n }, {\n key: \"waitForTagLoad\",\n value: function waitForTagLoad(htmlElement) {\n return new Promise(function (resolve, reject) {\n htmlElement.addEventListener('load', resolve);\n htmlElement.addEventListener('error', reject);\n });\n }\n }]);\n\n return ResourceTagLoader;\n}();\n\nexports.default = ResourceTagLoader;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * Mutex\n */\nvar Mutex = /*#__PURE__*/function () {\n /**\n * Creates a new Mutex.\n *\n * @param {number} maxCount Number of simultaneous locks to allow before other callers must wait.\n */\n function Mutex() {\n var _this = this;\n\n var maxCount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;\n\n _classCallCheck(this, Mutex);\n\n this.queue = [];\n this.count = 0; // Number currently running\n\n this.maxCount = maxCount;\n\n this.addToQueue = function (release) {\n _this.queue.push(release);\n };\n }\n /**\n * Takes a lock, causing execution to wait if number of callers exceeds maxCount.\n *\n * @returns {void|Promise} Promise resolved or not depending on if caller must wait.\n */\n\n\n _createClass(Mutex, [{\n key: \"lock\",\n value: function lock() {\n // Do we event need to wait?\n if (this.count < this.maxCount) {\n // No\n this.count++;\n return Promise.resolve();\n } // Yes, we have to wait for our turn\n\n\n return new Promise(this.addToQueue);\n }\n /**\n * Releases a previously taken lock.\n */\n\n }, {\n key: \"release\",\n value: function release() {\n this.count--;\n\n this._update();\n }\n /**\n * Resolves promises (locks) down to maxCount.\n */\n\n }, {\n key: \"_update\",\n value: function _update() {\n while (this.count < this.maxCount && // We still have space\n this.queue.length !== 0 // We have executers in line\n ) {\n var release = this.queue.shift();\n this.count++;\n release();\n }\n }\n }]);\n\n return Mutex;\n}();\n\nexports.default = Mutex;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar emptyFunction = function emptyFunction() {};\n\nvar returnEmptyFunction = function returnEmptyFunction() {\n return emptyFunction;\n};\n/**\n * Latch\n */\n\n\nvar Latch = /*#__PURE__*/function () {\n /**\n * Creates a new Latch.\n */\n function Latch() {\n _classCallCheck(this, Latch);\n\n this.isFirstRun = true;\n this.isFinished = false;\n this.list = [];\n }\n /**\n * Takes a lock, causing execution to wait if number of callers exceeds maxCount.\n *\n * @returns {Promise} Promise resolved or not depending on if caller must wait.\n */\n\n\n _createClass(Latch, [{\n key: \"aquire\",\n value: function aquire() {\n if (this.isFinished) {\n return Promise.resolve().then(returnEmptyFunction);\n } else if (this.isFirstRun) {\n this.isFirstRun = false;\n return Promise.resolve().then(this._getFirstReleaseFunction.bind(this));\n } else {\n return new Promise(this._addResolveToList.bind(this)).then(returnEmptyFunction);\n }\n }\n /**\n * Add promise resolve to list.\n *\n * @param {Function} resolve Argument from Promise constructor.\n */\n\n }, {\n key: \"_addResolveToList\",\n value: function _addResolveToList(resolve) {\n this.list.push(resolve);\n }\n /**\n *\n * @returns {Function} - A function for release.\n */\n\n }, {\n key: \"_getFirstReleaseFunction\",\n value: function _getFirstReleaseFunction() {\n var _this = this;\n\n return function () {\n return _this._firstRelease();\n };\n }\n /**\n * First release.\n */\n\n }, {\n key: \"_firstRelease\",\n value: function _firstRelease() {\n this.isFinished = true;\n\n this._releaseAll();\n }\n /**\n * Release all promises.\n */\n\n }, {\n key: \"_releaseAll\",\n value: function _releaseAll() {\n this.list.forEach(function (fun) {\n return fun();\n });\n this.list = [];\n }\n }]);\n\n return Latch;\n}();\n\nexports.default = Latch;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"DateFormatter\", {\n enumerable: true,\n get: function get() {\n return _DateFormatter.default;\n }\n});\nObject.defineProperty(exports, \"FileUtility\", {\n enumerable: true,\n get: function get() {\n return _FileUtility.default;\n }\n});\nObject.defineProperty(exports, \"IframeUtility\", {\n enumerable: true,\n get: function get() {\n return _IframeUtility.default;\n }\n});\nObject.defineProperty(exports, \"JsonUtility\", {\n enumerable: true,\n get: function get() {\n return _JsonUtility.default;\n }\n});\nObject.defineProperty(exports, \"PriceFormatter\", {\n enumerable: true,\n get: function get() {\n return _PriceFormatter.default;\n }\n});\nObject.defineProperty(exports, \"UrlUtility\", {\n enumerable: true,\n get: function get() {\n return _UrlUtility.default;\n }\n});\nObject.defineProperty(exports, \"StringUtility\", {\n enumerable: true,\n get: function get() {\n return _StringUtility.default;\n }\n});\nObject.defineProperty(exports, \"StyleUtility\", {\n enumerable: true,\n get: function get() {\n return _StyleUtility.default;\n }\n});\nObject.defineProperty(exports, \"ImageUtility\", {\n enumerable: true,\n get: function get() {\n return _ImageUtility.default;\n }\n});\nObject.defineProperty(exports, \"ApplicationResizeObserver\", {\n enumerable: true,\n get: function get() {\n return _ApplicationResizeObserver.default;\n }\n});\nObject.defineProperty(exports, \"EventHandler\", {\n enumerable: true,\n get: function get() {\n return _EventHandler.default;\n }\n});\nObject.defineProperty(exports, \"EventSupport\", {\n enumerable: true,\n get: function get() {\n return _EventSupport.default;\n }\n});\nObject.defineProperty(exports, \"ComponentSettings\", {\n enumerable: true,\n get: function get() {\n return _ComponentSettings.default;\n }\n});\nObject.defineProperty(exports, \"ScrollUtility\", {\n enumerable: true,\n get: function get() {\n return _ScrollUtility.default;\n }\n});\nObject.defineProperty(exports, \"ResourceTagLoader\", {\n enumerable: true,\n get: function get() {\n return _ResourceTagLoader.default;\n }\n});\nObject.defineProperty(exports, \"Mutex\", {\n enumerable: true,\n get: function get() {\n return _Mutex.default;\n }\n});\nObject.defineProperty(exports, \"Latch\", {\n enumerable: true,\n get: function get() {\n return _Latch.default;\n }\n});\n\nvar _DateFormatter = _interopRequireDefault(require(\"./util/DateFormatter\"));\n\nvar _FileUtility = _interopRequireDefault(require(\"./util/FileUtility\"));\n\nvar _IframeUtility = _interopRequireDefault(require(\"./util/IframeUtility\"));\n\nvar _JsonUtility = _interopRequireDefault(require(\"./util/JsonUtility\"));\n\nvar _PriceFormatter = _interopRequireDefault(require(\"./util/PriceFormatter\"));\n\nvar _UrlUtility = _interopRequireDefault(require(\"./util/UrlUtility\"));\n\nvar _StringUtility = _interopRequireDefault(require(\"./util/StringUtility\"));\n\nvar _StyleUtility = _interopRequireDefault(require(\"./util/StyleUtility\"));\n\nvar _ImageUtility = _interopRequireDefault(require(\"./util/ImageUtility\"));\n\nvar _ApplicationResizeObserver = _interopRequireDefault(require(\"./util/ApplicationResizeObserver\"));\n\nvar _EventHandler = _interopRequireDefault(require(\"./event/EventHandler\"));\n\nvar _EventSupport = _interopRequireDefault(require(\"./util/EventSupport\"));\n\nvar _ComponentSettings = _interopRequireDefault(require(\"./settings/ComponentSettings\"));\n\nvar _ScrollUtility = _interopRequireDefault(require(\"./util/ScrollUtility\"));\n\nvar _ResourceTagLoader = _interopRequireDefault(require(\"./util/ResourceTagLoader\"));\n\nvar _Mutex = _interopRequireDefault(require(\"./util/Mutex\"));\n\nvar _Latch = _interopRequireDefault(require(\"./util/Latch\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isDirective = exports.directive = void 0;\nconst directives = new WeakMap();\nconst directive = (f) => ((...args) => {\n const d = f(...args);\n directives.set(d, true);\n return d;\n});\nexports.directive = directive;\nconst isDirective = (o) => {\n return typeof o === 'function' && directives.has(o);\n};\nexports.isDirective = isDirective;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.removeNodes = exports.reparentNodes = exports.isCEPolyfill = void 0;\nexports.isCEPolyfill = typeof window !== 'undefined' &&\n window.customElements != null &&\n window.customElements.polyfillWrapFlushCallback !==\n undefined;\nconst reparentNodes = (container, start, end = null, before = null) => {\n while (start !== end) {\n const n = start.nextSibling;\n container.insertBefore(start, before);\n start = n;\n }\n};\nexports.reparentNodes = reparentNodes;\nconst removeNodes = (container, start, end = null) => {\n while (start !== end) {\n const n = start.nextSibling;\n container.removeChild(start);\n start = n;\n }\n};\nexports.removeNodes = removeNodes;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.nothing = exports.noChange = void 0;\nexports.noChange = {};\nexports.nothing = {};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lastAttributeNameRegex = exports.createMarker = exports.isTemplatePartActive = exports.Template = exports.boundAttributeSuffix = exports.markerRegex = exports.nodeMarker = exports.marker = void 0;\nexports.marker = `{{lit-${String(Math.random()).slice(2)}}}`;\nexports.nodeMarker = ``;\nexports.markerRegex = new RegExp(`${exports.marker}|${exports.nodeMarker}`);\nexports.boundAttributeSuffix = '$lit$';\nclass Template {\n constructor(result, element) {\n this.parts = [];\n this.element = element;\n const nodesToRemove = [];\n const stack = [];\n const walker = document.createTreeWalker(element.content, 133, null, false);\n let lastPartIndex = 0;\n let index = -1;\n let partIndex = 0;\n const { strings, values: { length } } = result;\n while (partIndex < length) {\n const node = walker.nextNode();\n if (node === null) {\n walker.currentNode = stack.pop();\n continue;\n }\n index++;\n if (node.nodeType === 1) {\n if (node.hasAttributes()) {\n const attributes = node.attributes;\n const { length } = attributes;\n let count = 0;\n for (let i = 0; i < length; i++) {\n if (endsWith(attributes[i].name, exports.boundAttributeSuffix)) {\n count++;\n }\n }\n while (count-- > 0) {\n const stringForPart = strings[partIndex];\n const name = exports.lastAttributeNameRegex.exec(stringForPart)[2];\n const attributeLookupName = name.toLowerCase() + exports.boundAttributeSuffix;\n const attributeValue = node.getAttribute(attributeLookupName);\n node.removeAttribute(attributeLookupName);\n const statics = attributeValue.split(exports.markerRegex);\n this.parts.push({ type: 'attribute', index, name, strings: statics });\n partIndex += statics.length - 1;\n }\n }\n if (node.tagName === 'TEMPLATE') {\n stack.push(node);\n walker.currentNode = node.content;\n }\n }\n else if (node.nodeType === 3) {\n const data = node.data;\n if (data.indexOf(exports.marker) >= 0) {\n const parent = node.parentNode;\n const strings = data.split(exports.markerRegex);\n const lastIndex = strings.length - 1;\n for (let i = 0; i < lastIndex; i++) {\n let insert;\n let s = strings[i];\n if (s === '') {\n insert = (0, exports.createMarker)();\n }\n else {\n const match = exports.lastAttributeNameRegex.exec(s);\n if (match !== null && endsWith(match[2], exports.boundAttributeSuffix)) {\n s = s.slice(0, match.index) + match[1] +\n match[2].slice(0, -exports.boundAttributeSuffix.length) + match[3];\n }\n insert = document.createTextNode(s);\n }\n parent.insertBefore(insert, node);\n this.parts.push({ type: 'node', index: ++index });\n }\n if (strings[lastIndex] === '') {\n parent.insertBefore((0, exports.createMarker)(), node);\n nodesToRemove.push(node);\n }\n else {\n node.data = strings[lastIndex];\n }\n partIndex += lastIndex;\n }\n }\n else if (node.nodeType === 8) {\n if (node.data === exports.marker) {\n const parent = node.parentNode;\n if (node.previousSibling === null || index === lastPartIndex) {\n index++;\n parent.insertBefore((0, exports.createMarker)(), node);\n }\n lastPartIndex = index;\n this.parts.push({ type: 'node', index });\n if (node.nextSibling === null) {\n node.data = '';\n }\n else {\n nodesToRemove.push(node);\n index--;\n }\n partIndex++;\n }\n else {\n let i = -1;\n while ((i = node.data.indexOf(exports.marker, i + 1)) !== -1) {\n this.parts.push({ type: 'node', index: -1 });\n partIndex++;\n }\n }\n }\n }\n for (const n of nodesToRemove) {\n n.parentNode.removeChild(n);\n }\n }\n}\nexports.Template = Template;\nconst endsWith = (str, suffix) => {\n const index = str.length - suffix.length;\n return index >= 0 && str.slice(index) === suffix;\n};\nconst isTemplatePartActive = (part) => part.index !== -1;\nexports.isTemplatePartActive = isTemplatePartActive;\nconst createMarker = () => document.createComment('');\nexports.createMarker = createMarker;\nexports.lastAttributeNameRegex = /([ \\x09\\x0a\\x0c\\x0d])([^\\0-\\x1F\\x7F-\\x9F \"'>=/]+)([ \\x09\\x0a\\x0c\\x0d]*=[ \\x09\\x0a\\x0c\\x0d]*(?:[^ \\x09\\x0a\\x0c\\x0d\"'`<>=]*|\"[^\"]*|'[^']*))$/;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TemplateInstance = void 0;\nconst dom_js_1 = require(\"./dom.js\");\nconst template_js_1 = require(\"./template.js\");\nclass TemplateInstance {\n constructor(template, processor, options) {\n this.__parts = [];\n this.template = template;\n this.processor = processor;\n this.options = options;\n }\n update(values) {\n let i = 0;\n for (const part of this.__parts) {\n if (part !== undefined) {\n part.setValue(values[i]);\n }\n i++;\n }\n for (const part of this.__parts) {\n if (part !== undefined) {\n part.commit();\n }\n }\n }\n _clone() {\n const fragment = dom_js_1.isCEPolyfill ?\n this.template.element.content.cloneNode(true) :\n document.importNode(this.template.element.content, true);\n const stack = [];\n const parts = this.template.parts;\n const walker = document.createTreeWalker(fragment, 133, null, false);\n let partIndex = 0;\n let nodeIndex = 0;\n let part;\n let node = walker.nextNode();\n while (partIndex < parts.length) {\n part = parts[partIndex];\n if (!(0, template_js_1.isTemplatePartActive)(part)) {\n this.__parts.push(undefined);\n partIndex++;\n continue;\n }\n while (nodeIndex < part.index) {\n nodeIndex++;\n if (node.nodeName === 'TEMPLATE') {\n stack.push(node);\n walker.currentNode = node.content;\n }\n if ((node = walker.nextNode()) === null) {\n walker.currentNode = stack.pop();\n node = walker.nextNode();\n }\n }\n if (part.type === 'node') {\n const part = this.processor.handleTextExpression(this.options);\n part.insertAfterNode(node.previousSibling);\n this.__parts.push(part);\n }\n else {\n this.__parts.push(...this.processor.handleAttributeExpressions(node, part.name, part.strings, this.options));\n }\n partIndex++;\n }\n if (dom_js_1.isCEPolyfill) {\n document.adoptNode(fragment);\n customElements.upgrade(fragment);\n }\n return fragment;\n }\n}\nexports.TemplateInstance = TemplateInstance;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SVGTemplateResult = exports.TemplateResult = void 0;\nconst dom_js_1 = require(\"./dom.js\");\nconst template_js_1 = require(\"./template.js\");\nconst policy = window.trustedTypes &&\n trustedTypes.createPolicy('lit-html', { createHTML: (s) => s });\nconst commentMarker = ` ${template_js_1.marker} `;\nclass TemplateResult {\n constructor(strings, values, type, processor) {\n this.strings = strings;\n this.values = values;\n this.type = type;\n this.processor = processor;\n }\n getHTML() {\n const l = this.strings.length - 1;\n let html = '';\n let isCommentBinding = false;\n for (let i = 0; i < l; i++) {\n const s = this.strings[i];\n const commentOpen = s.lastIndexOf('', commentOpen + 1) === -1;\n const attributeMatch = template_js_1.lastAttributeNameRegex.exec(s);\n if (attributeMatch === null) {\n html += s + (isCommentBinding ? commentMarker : template_js_1.nodeMarker);\n }\n else {\n html += s.substr(0, attributeMatch.index) + attributeMatch[1] +\n attributeMatch[2] + template_js_1.boundAttributeSuffix + attributeMatch[3] +\n template_js_1.marker;\n }\n }\n html += this.strings[l];\n return html;\n }\n getTemplateElement() {\n const template = document.createElement('template');\n let value = this.getHTML();\n if (policy !== undefined) {\n value = policy.createHTML(value);\n }\n template.innerHTML = value;\n return template;\n }\n}\nexports.TemplateResult = TemplateResult;\nclass SVGTemplateResult extends TemplateResult {\n getHTML() {\n return `${super.getHTML()}`;\n }\n getTemplateElement() {\n const template = super.getTemplateElement();\n const content = template.content;\n const svgElement = content.firstChild;\n content.removeChild(svgElement);\n (0, dom_js_1.reparentNodes)(content, svgElement.firstChild);\n return template;\n }\n}\nexports.SVGTemplateResult = SVGTemplateResult;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EventPart = exports.PropertyPart = exports.PropertyCommitter = exports.BooleanAttributePart = exports.NodePart = exports.AttributePart = exports.AttributeCommitter = exports.isIterable = exports.isPrimitive = void 0;\nconst directive_js_1 = require(\"./directive.js\");\nconst dom_js_1 = require(\"./dom.js\");\nconst part_js_1 = require(\"./part.js\");\nconst template_instance_js_1 = require(\"./template-instance.js\");\nconst template_result_js_1 = require(\"./template-result.js\");\nconst template_js_1 = require(\"./template.js\");\nconst isPrimitive = (value) => {\n return (value === null ||\n !(typeof value === 'object' || typeof value === 'function'));\n};\nexports.isPrimitive = isPrimitive;\nconst isIterable = (value) => {\n return Array.isArray(value) ||\n !!(value && value[Symbol.iterator]);\n};\nexports.isIterable = isIterable;\nclass AttributeCommitter {\n constructor(element, name, strings) {\n this.dirty = true;\n this.element = element;\n this.name = name;\n this.strings = strings;\n this.parts = [];\n for (let i = 0; i < strings.length - 1; i++) {\n this.parts[i] = this._createPart();\n }\n }\n _createPart() {\n return new AttributePart(this);\n }\n _getValue() {\n const strings = this.strings;\n const l = strings.length - 1;\n const parts = this.parts;\n if (l === 1 && strings[0] === '' && strings[1] === '') {\n const v = parts[0].value;\n if (typeof v === 'symbol') {\n return String(v);\n }\n if (typeof v === 'string' || !(0, exports.isIterable)(v)) {\n return v;\n }\n }\n let text = '';\n for (let i = 0; i < l; i++) {\n text += strings[i];\n const part = parts[i];\n if (part !== undefined) {\n const v = part.value;\n if ((0, exports.isPrimitive)(v) || !(0, exports.isIterable)(v)) {\n text += typeof v === 'string' ? v : String(v);\n }\n else {\n for (const t of v) {\n text += typeof t === 'string' ? t : String(t);\n }\n }\n }\n }\n text += strings[l];\n return text;\n }\n commit() {\n if (this.dirty) {\n this.dirty = false;\n this.element.setAttribute(this.name, this._getValue());\n }\n }\n}\nexports.AttributeCommitter = AttributeCommitter;\nclass AttributePart {\n constructor(committer) {\n this.value = undefined;\n this.committer = committer;\n }\n setValue(value) {\n if (value !== part_js_1.noChange && (!(0, exports.isPrimitive)(value) || value !== this.value)) {\n this.value = value;\n if (!(0, directive_js_1.isDirective)(value)) {\n this.committer.dirty = true;\n }\n }\n }\n commit() {\n while ((0, directive_js_1.isDirective)(this.value)) {\n const directive = this.value;\n this.value = part_js_1.noChange;\n directive(this);\n }\n if (this.value === part_js_1.noChange) {\n return;\n }\n this.committer.commit();\n }\n}\nexports.AttributePart = AttributePart;\nclass NodePart {\n constructor(options) {\n this.value = undefined;\n this.__pendingValue = undefined;\n this.options = options;\n }\n appendInto(container) {\n this.startNode = container.appendChild((0, template_js_1.createMarker)());\n this.endNode = container.appendChild((0, template_js_1.createMarker)());\n }\n insertAfterNode(ref) {\n this.startNode = ref;\n this.endNode = ref.nextSibling;\n }\n appendIntoPart(part) {\n part.__insert(this.startNode = (0, template_js_1.createMarker)());\n part.__insert(this.endNode = (0, template_js_1.createMarker)());\n }\n insertAfterPart(ref) {\n ref.__insert(this.startNode = (0, template_js_1.createMarker)());\n this.endNode = ref.endNode;\n ref.endNode = this.startNode;\n }\n setValue(value) {\n this.__pendingValue = value;\n }\n commit() {\n if (this.startNode.parentNode === null) {\n return;\n }\n while ((0, directive_js_1.isDirective)(this.__pendingValue)) {\n const directive = this.__pendingValue;\n this.__pendingValue = part_js_1.noChange;\n directive(this);\n }\n const value = this.__pendingValue;\n if (value === part_js_1.noChange) {\n return;\n }\n if ((0, exports.isPrimitive)(value)) {\n if (value !== this.value) {\n this.__commitText(value);\n }\n }\n else if (value instanceof template_result_js_1.TemplateResult) {\n this.__commitTemplateResult(value);\n }\n else if (value instanceof Node) {\n this.__commitNode(value);\n }\n else if ((0, exports.isIterable)(value)) {\n this.__commitIterable(value);\n }\n else if (value === part_js_1.nothing) {\n this.value = part_js_1.nothing;\n this.clear();\n }\n else {\n this.__commitText(value);\n }\n }\n __insert(node) {\n this.endNode.parentNode.insertBefore(node, this.endNode);\n }\n __commitNode(value) {\n if (this.value === value) {\n return;\n }\n this.clear();\n this.__insert(value);\n this.value = value;\n }\n __commitText(value) {\n const node = this.startNode.nextSibling;\n value = value == null ? '' : value;\n const valueAsString = typeof value === 'string' ? value : String(value);\n if (node === this.endNode.previousSibling &&\n node.nodeType === 3) {\n node.data = valueAsString;\n }\n else {\n this.__commitNode(document.createTextNode(valueAsString));\n }\n this.value = value;\n }\n __commitTemplateResult(value) {\n const template = this.options.templateFactory(value);\n if (this.value instanceof template_instance_js_1.TemplateInstance &&\n this.value.template === template) {\n this.value.update(value.values);\n }\n else {\n const instance = new template_instance_js_1.TemplateInstance(template, value.processor, this.options);\n const fragment = instance._clone();\n instance.update(value.values);\n this.__commitNode(fragment);\n this.value = instance;\n }\n }\n __commitIterable(value) {\n if (!Array.isArray(this.value)) {\n this.value = [];\n this.clear();\n }\n const itemParts = this.value;\n let partIndex = 0;\n let itemPart;\n for (const item of value) {\n itemPart = itemParts[partIndex];\n if (itemPart === undefined) {\n itemPart = new NodePart(this.options);\n itemParts.push(itemPart);\n if (partIndex === 0) {\n itemPart.appendIntoPart(this);\n }\n else {\n itemPart.insertAfterPart(itemParts[partIndex - 1]);\n }\n }\n itemPart.setValue(item);\n itemPart.commit();\n partIndex++;\n }\n if (partIndex < itemParts.length) {\n itemParts.length = partIndex;\n this.clear(itemPart && itemPart.endNode);\n }\n }\n clear(startNode = this.startNode) {\n (0, dom_js_1.removeNodes)(this.startNode.parentNode, startNode.nextSibling, this.endNode);\n }\n}\nexports.NodePart = NodePart;\nclass BooleanAttributePart {\n constructor(element, name, strings) {\n this.value = undefined;\n this.__pendingValue = undefined;\n if (strings.length !== 2 || strings[0] !== '' || strings[1] !== '') {\n throw new Error('Boolean attributes can only contain a single expression');\n }\n this.element = element;\n this.name = name;\n this.strings = strings;\n }\n setValue(value) {\n this.__pendingValue = value;\n }\n commit() {\n while ((0, directive_js_1.isDirective)(this.__pendingValue)) {\n const directive = this.__pendingValue;\n this.__pendingValue = part_js_1.noChange;\n directive(this);\n }\n if (this.__pendingValue === part_js_1.noChange) {\n return;\n }\n const value = !!this.__pendingValue;\n if (this.value !== value) {\n if (value) {\n this.element.setAttribute(this.name, '');\n }\n else {\n this.element.removeAttribute(this.name);\n }\n this.value = value;\n }\n this.__pendingValue = part_js_1.noChange;\n }\n}\nexports.BooleanAttributePart = BooleanAttributePart;\nclass PropertyCommitter extends AttributeCommitter {\n constructor(element, name, strings) {\n super(element, name, strings);\n this.single =\n (strings.length === 2 && strings[0] === '' && strings[1] === '');\n }\n _createPart() {\n return new PropertyPart(this);\n }\n _getValue() {\n if (this.single) {\n return this.parts[0].value;\n }\n return super._getValue();\n }\n commit() {\n if (this.dirty) {\n this.dirty = false;\n this.element[this.name] = this._getValue();\n }\n }\n}\nexports.PropertyCommitter = PropertyCommitter;\nclass PropertyPart extends AttributePart {\n}\nexports.PropertyPart = PropertyPart;\nlet eventOptionsSupported = false;\n(() => {\n try {\n const options = {\n get capture() {\n eventOptionsSupported = true;\n return false;\n }\n };\n window.addEventListener('test', options, options);\n window.removeEventListener('test', options, options);\n }\n catch (_e) {\n }\n})();\nclass EventPart {\n constructor(element, eventName, eventContext) {\n this.value = undefined;\n this.__pendingValue = undefined;\n this.element = element;\n this.eventName = eventName;\n this.eventContext = eventContext;\n this.__boundHandleEvent = (e) => this.handleEvent(e);\n }\n setValue(value) {\n this.__pendingValue = value;\n }\n commit() {\n while ((0, directive_js_1.isDirective)(this.__pendingValue)) {\n const directive = this.__pendingValue;\n this.__pendingValue = part_js_1.noChange;\n directive(this);\n }\n if (this.__pendingValue === part_js_1.noChange) {\n return;\n }\n const newListener = this.__pendingValue;\n const oldListener = this.value;\n const shouldRemoveListener = newListener == null ||\n oldListener != null &&\n (newListener.capture !== oldListener.capture ||\n newListener.once !== oldListener.once ||\n newListener.passive !== oldListener.passive);\n const shouldAddListener = newListener != null && (oldListener == null || shouldRemoveListener);\n if (shouldRemoveListener) {\n this.element.removeEventListener(this.eventName, this.__boundHandleEvent, this.__options);\n }\n if (shouldAddListener) {\n this.__options = getOptions(newListener);\n this.element.addEventListener(this.eventName, this.__boundHandleEvent, this.__options);\n }\n this.value = newListener;\n this.__pendingValue = part_js_1.noChange;\n }\n handleEvent(event) {\n if (typeof this.value === 'function') {\n this.value.call(this.eventContext || this.element, event);\n }\n else {\n this.value.handleEvent(event);\n }\n }\n}\nexports.EventPart = EventPart;\nconst getOptions = (o) => o &&\n (eventOptionsSupported ?\n { capture: o.capture, passive: o.passive, once: o.once } :\n o.capture);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultTemplateProcessor = exports.DefaultTemplateProcessor = void 0;\nconst parts_js_1 = require(\"./parts.js\");\nclass DefaultTemplateProcessor {\n handleAttributeExpressions(element, name, strings, options) {\n const prefix = name[0];\n if (prefix === '.') {\n const committer = new parts_js_1.PropertyCommitter(element, name.slice(1), strings);\n return committer.parts;\n }\n if (prefix === '@') {\n return [new parts_js_1.EventPart(element, name.slice(1), options.eventContext)];\n }\n if (prefix === '?') {\n return [new parts_js_1.BooleanAttributePart(element, name.slice(1), strings)];\n }\n const committer = new parts_js_1.AttributeCommitter(element, name, strings);\n return committer.parts;\n }\n handleTextExpression(options) {\n return new parts_js_1.NodePart(options);\n }\n}\nexports.DefaultTemplateProcessor = DefaultTemplateProcessor;\nexports.defaultTemplateProcessor = new DefaultTemplateProcessor();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.templateCaches = exports.templateFactory = void 0;\nconst template_js_1 = require(\"./template.js\");\nfunction templateFactory(result) {\n let templateCache = exports.templateCaches.get(result.type);\n if (templateCache === undefined) {\n templateCache = {\n stringsArray: new WeakMap(),\n keyString: new Map()\n };\n exports.templateCaches.set(result.type, templateCache);\n }\n let template = templateCache.stringsArray.get(result.strings);\n if (template !== undefined) {\n return template;\n }\n const key = result.strings.join(template_js_1.marker);\n template = templateCache.keyString.get(key);\n if (template === undefined) {\n template = new template_js_1.Template(result, result.getTemplateElement());\n templateCache.keyString.set(key, template);\n }\n templateCache.stringsArray.set(result.strings, template);\n return template;\n}\nexports.templateFactory = templateFactory;\nexports.templateCaches = new Map();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.render = exports.parts = void 0;\nconst dom_js_1 = require(\"./dom.js\");\nconst parts_js_1 = require(\"./parts.js\");\nconst template_factory_js_1 = require(\"./template-factory.js\");\nexports.parts = new WeakMap();\nconst render = (result, container, options) => {\n let part = exports.parts.get(container);\n if (part === undefined) {\n (0, dom_js_1.removeNodes)(container, container.firstChild);\n exports.parts.set(container, part = new parts_js_1.NodePart(Object.assign({ templateFactory: template_factory_js_1.templateFactory }, options)));\n part.appendInto(container);\n }\n part.setValue(result);\n part.commit();\n};\nexports.render = render;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.svg = exports.html = exports.Template = exports.isTemplatePartActive = exports.createMarker = exports.TemplateResult = exports.SVGTemplateResult = exports.TemplateInstance = exports.templateFactory = exports.templateCaches = exports.render = exports.parts = exports.PropertyPart = exports.PropertyCommitter = exports.NodePart = exports.isPrimitive = exports.isIterable = exports.EventPart = exports.BooleanAttributePart = exports.AttributePart = exports.AttributeCommitter = exports.nothing = exports.noChange = exports.reparentNodes = exports.removeNodes = exports.isDirective = exports.directive = exports.defaultTemplateProcessor = exports.DefaultTemplateProcessor = void 0;\nconst default_template_processor_js_1 = require(\"./lib/default-template-processor.js\");\nconst template_result_js_1 = require(\"./lib/template-result.js\");\nvar default_template_processor_js_2 = require(\"./lib/default-template-processor.js\");\nObject.defineProperty(exports, \"DefaultTemplateProcessor\", { enumerable: true, get: function () { return default_template_processor_js_2.DefaultTemplateProcessor; } });\nObject.defineProperty(exports, \"defaultTemplateProcessor\", { enumerable: true, get: function () { return default_template_processor_js_2.defaultTemplateProcessor; } });\nvar directive_js_1 = require(\"./lib/directive.js\");\nObject.defineProperty(exports, \"directive\", { enumerable: true, get: function () { return directive_js_1.directive; } });\nObject.defineProperty(exports, \"isDirective\", { enumerable: true, get: function () { return directive_js_1.isDirective; } });\nvar dom_js_1 = require(\"./lib/dom.js\");\nObject.defineProperty(exports, \"removeNodes\", { enumerable: true, get: function () { return dom_js_1.removeNodes; } });\nObject.defineProperty(exports, \"reparentNodes\", { enumerable: true, get: function () { return dom_js_1.reparentNodes; } });\nvar part_js_1 = require(\"./lib/part.js\");\nObject.defineProperty(exports, \"noChange\", { enumerable: true, get: function () { return part_js_1.noChange; } });\nObject.defineProperty(exports, \"nothing\", { enumerable: true, get: function () { return part_js_1.nothing; } });\nvar parts_js_1 = require(\"./lib/parts.js\");\nObject.defineProperty(exports, \"AttributeCommitter\", { enumerable: true, get: function () { return parts_js_1.AttributeCommitter; } });\nObject.defineProperty(exports, \"AttributePart\", { enumerable: true, get: function () { return parts_js_1.AttributePart; } });\nObject.defineProperty(exports, \"BooleanAttributePart\", { enumerable: true, get: function () { return parts_js_1.BooleanAttributePart; } });\nObject.defineProperty(exports, \"EventPart\", { enumerable: true, get: function () { return parts_js_1.EventPart; } });\nObject.defineProperty(exports, \"isIterable\", { enumerable: true, get: function () { return parts_js_1.isIterable; } });\nObject.defineProperty(exports, \"isPrimitive\", { enumerable: true, get: function () { return parts_js_1.isPrimitive; } });\nObject.defineProperty(exports, \"NodePart\", { enumerable: true, get: function () { return parts_js_1.NodePart; } });\nObject.defineProperty(exports, \"PropertyCommitter\", { enumerable: true, get: function () { return parts_js_1.PropertyCommitter; } });\nObject.defineProperty(exports, \"PropertyPart\", { enumerable: true, get: function () { return parts_js_1.PropertyPart; } });\nvar render_js_1 = require(\"./lib/render.js\");\nObject.defineProperty(exports, \"parts\", { enumerable: true, get: function () { return render_js_1.parts; } });\nObject.defineProperty(exports, \"render\", { enumerable: true, get: function () { return render_js_1.render; } });\nvar template_factory_js_1 = require(\"./lib/template-factory.js\");\nObject.defineProperty(exports, \"templateCaches\", { enumerable: true, get: function () { return template_factory_js_1.templateCaches; } });\nObject.defineProperty(exports, \"templateFactory\", { enumerable: true, get: function () { return template_factory_js_1.templateFactory; } });\nvar template_instance_js_1 = require(\"./lib/template-instance.js\");\nObject.defineProperty(exports, \"TemplateInstance\", { enumerable: true, get: function () { return template_instance_js_1.TemplateInstance; } });\nvar template_result_js_2 = require(\"./lib/template-result.js\");\nObject.defineProperty(exports, \"SVGTemplateResult\", { enumerable: true, get: function () { return template_result_js_2.SVGTemplateResult; } });\nObject.defineProperty(exports, \"TemplateResult\", { enumerable: true, get: function () { return template_result_js_2.TemplateResult; } });\nvar template_js_1 = require(\"./lib/template.js\");\nObject.defineProperty(exports, \"createMarker\", { enumerable: true, get: function () { return template_js_1.createMarker; } });\nObject.defineProperty(exports, \"isTemplatePartActive\", { enumerable: true, get: function () { return template_js_1.isTemplatePartActive; } });\nObject.defineProperty(exports, \"Template\", { enumerable: true, get: function () { return template_js_1.Template; } });\nif (typeof window !== 'undefined') {\n (window['litHtmlVersions'] || (window['litHtmlVersions'] = [])).push('1.4.1');\n}\nconst html = (strings, ...values) => new template_result_js_1.TemplateResult(strings, values, 'html', default_template_processor_js_1.defaultTemplateProcessor);\nexports.html = html;\nconst svg = (strings, ...values) => new template_result_js_1.SVGTemplateResult(strings, values, 'svg', default_template_processor_js_1.defaultTemplateProcessor);\nexports.svg = svg;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.classMap = void 0;\nconst lit_html_js_1 = require(\"../lit-html.js\");\nclass ClassList {\n constructor(element) {\n this.classes = new Set();\n this.changed = false;\n this.element = element;\n const classList = (element.getAttribute('class') || '').split(/\\s+/);\n for (const cls of classList) {\n this.classes.add(cls);\n }\n }\n add(cls) {\n this.classes.add(cls);\n this.changed = true;\n }\n remove(cls) {\n this.classes.delete(cls);\n this.changed = true;\n }\n commit() {\n if (this.changed) {\n let classString = '';\n this.classes.forEach((cls) => classString += cls + ' ');\n this.element.setAttribute('class', classString);\n }\n }\n}\nconst previousClassesCache = new WeakMap();\nexports.classMap = (0, lit_html_js_1.directive)((classInfo) => (part) => {\n if (!(part instanceof lit_html_js_1.AttributePart) || (part instanceof lit_html_js_1.PropertyPart) ||\n part.committer.name !== 'class' || part.committer.parts.length > 1) {\n throw new Error('The `classMap` directive must be used in the `class` attribute ' +\n 'and must be the only part in the attribute.');\n }\n const { committer } = part;\n const { element } = committer;\n let previousClasses = previousClassesCache.get(part);\n if (previousClasses === undefined) {\n element.setAttribute('class', committer.strings.join(' '));\n previousClassesCache.set(part, previousClasses = new Set());\n }\n const classList = (element.classList || new ClassList(element));\n previousClasses.forEach((name) => {\n if (!(name in classInfo)) {\n classList.remove(name);\n previousClasses.delete(name);\n }\n });\n for (const name in classInfo) {\n const value = classInfo[name];\n if (value != previousClasses.has(name)) {\n if (value) {\n classList.add(name);\n previousClasses.add(name);\n }\n else {\n classList.remove(name);\n previousClasses.delete(name);\n }\n }\n }\n if (typeof classList.commit === 'function') {\n classList.commit();\n }\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.repeat = void 0;\nconst lit_html_js_1 = require(\"../lit-html.js\");\nconst createAndInsertPart = (containerPart, beforePart) => {\n const container = containerPart.startNode.parentNode;\n const beforeNode = beforePart === undefined ? containerPart.endNode :\n beforePart.startNode;\n const startNode = container.insertBefore((0, lit_html_js_1.createMarker)(), beforeNode);\n container.insertBefore((0, lit_html_js_1.createMarker)(), beforeNode);\n const newPart = new lit_html_js_1.NodePart(containerPart.options);\n newPart.insertAfterNode(startNode);\n return newPart;\n};\nconst updatePart = (part, value) => {\n part.setValue(value);\n part.commit();\n return part;\n};\nconst insertPartBefore = (containerPart, part, ref) => {\n const container = containerPart.startNode.parentNode;\n const beforeNode = ref ? ref.startNode : containerPart.endNode;\n const endNode = part.endNode.nextSibling;\n if (endNode !== beforeNode) {\n (0, lit_html_js_1.reparentNodes)(container, part.startNode, endNode, beforeNode);\n }\n};\nconst removePart = (part) => {\n (0, lit_html_js_1.removeNodes)(part.startNode.parentNode, part.startNode, part.endNode.nextSibling);\n};\nconst generateMap = (list, start, end) => {\n const map = new Map();\n for (let i = start; i <= end; i++) {\n map.set(list[i], i);\n }\n return map;\n};\nconst partListCache = new WeakMap();\nconst keyListCache = new WeakMap();\nexports.repeat = (0, lit_html_js_1.directive)((items, keyFnOrTemplate, template) => {\n let keyFn;\n if (template === undefined) {\n template = keyFnOrTemplate;\n }\n else if (keyFnOrTemplate !== undefined) {\n keyFn = keyFnOrTemplate;\n }\n return (containerPart) => {\n if (!(containerPart instanceof lit_html_js_1.NodePart)) {\n throw new Error('repeat can only be used in text bindings');\n }\n const oldParts = partListCache.get(containerPart) || [];\n const oldKeys = keyListCache.get(containerPart) || [];\n const newParts = [];\n const newValues = [];\n const newKeys = [];\n let index = 0;\n for (const item of items) {\n newKeys[index] = keyFn ? keyFn(item, index) : index;\n newValues[index] = template(item, index);\n index++;\n }\n let newKeyToIndexMap;\n let oldKeyToIndexMap;\n let oldHead = 0;\n let oldTail = oldParts.length - 1;\n let newHead = 0;\n let newTail = newValues.length - 1;\n while (oldHead <= oldTail && newHead <= newTail) {\n if (oldParts[oldHead] === null) {\n oldHead++;\n }\n else if (oldParts[oldTail] === null) {\n oldTail--;\n }\n else if (oldKeys[oldHead] === newKeys[newHead]) {\n newParts[newHead] =\n updatePart(oldParts[oldHead], newValues[newHead]);\n oldHead++;\n newHead++;\n }\n else if (oldKeys[oldTail] === newKeys[newTail]) {\n newParts[newTail] =\n updatePart(oldParts[oldTail], newValues[newTail]);\n oldTail--;\n newTail--;\n }\n else if (oldKeys[oldHead] === newKeys[newTail]) {\n newParts[newTail] =\n updatePart(oldParts[oldHead], newValues[newTail]);\n insertPartBefore(containerPart, oldParts[oldHead], newParts[newTail + 1]);\n oldHead++;\n newTail--;\n }\n else if (oldKeys[oldTail] === newKeys[newHead]) {\n newParts[newHead] =\n updatePart(oldParts[oldTail], newValues[newHead]);\n insertPartBefore(containerPart, oldParts[oldTail], oldParts[oldHead]);\n oldTail--;\n newHead++;\n }\n else {\n if (newKeyToIndexMap === undefined) {\n newKeyToIndexMap = generateMap(newKeys, newHead, newTail);\n oldKeyToIndexMap = generateMap(oldKeys, oldHead, oldTail);\n }\n if (!newKeyToIndexMap.has(oldKeys[oldHead])) {\n removePart(oldParts[oldHead]);\n oldHead++;\n }\n else if (!newKeyToIndexMap.has(oldKeys[oldTail])) {\n removePart(oldParts[oldTail]);\n oldTail--;\n }\n else {\n const oldIndex = oldKeyToIndexMap.get(newKeys[newHead]);\n const oldPart = oldIndex !== undefined ? oldParts[oldIndex] : null;\n if (oldPart === null) {\n const newPart = createAndInsertPart(containerPart, oldParts[oldHead]);\n updatePart(newPart, newValues[newHead]);\n newParts[newHead] = newPart;\n }\n else {\n newParts[newHead] =\n updatePart(oldPart, newValues[newHead]);\n insertPartBefore(containerPart, oldPart, oldParts[oldHead]);\n oldParts[oldIndex] = null;\n }\n newHead++;\n }\n }\n }\n while (newHead <= newTail) {\n const newPart = createAndInsertPart(containerPart, newParts[newTail + 1]);\n updatePart(newPart, newValues[newHead]);\n newParts[newHead++] = newPart;\n }\n while (oldHead <= oldTail) {\n const oldPart = oldParts[oldHead++];\n if (oldPart !== null) {\n removePart(oldPart);\n }\n }\n partListCache.set(containerPart, newParts);\n keyListCache.set(containerPart, newKeys);\n };\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.styleMap = void 0;\nconst lit_html_js_1 = require(\"../lit-html.js\");\nconst previousStylePropertyCache = new WeakMap();\nexports.styleMap = (0, lit_html_js_1.directive)((styleInfo) => (part) => {\n if (!(part instanceof lit_html_js_1.AttributePart) || (part instanceof lit_html_js_1.PropertyPart) ||\n part.committer.name !== 'style' || part.committer.parts.length > 1) {\n throw new Error('The `styleMap` directive must be used in the style attribute ' +\n 'and must be the only part in the attribute.');\n }\n const { committer } = part;\n const { style } = committer.element;\n let previousStyleProperties = previousStylePropertyCache.get(part);\n if (previousStyleProperties === undefined) {\n style.cssText = committer.strings.join(' ');\n previousStylePropertyCache.set(part, previousStyleProperties = new Set());\n }\n previousStyleProperties.forEach((name) => {\n if (!(name in styleInfo)) {\n previousStyleProperties.delete(name);\n if (name.indexOf('-') === -1) {\n style[name] = null;\n }\n else {\n style.removeProperty(name);\n }\n }\n });\n for (const name in styleInfo) {\n previousStyleProperties.add(name);\n if (name.indexOf('-') === -1) {\n style[name] = styleInfo[name];\n }\n else {\n style.setProperty(name, styleInfo[name]);\n }\n }\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unsafeHTML = void 0;\nconst parts_js_1 = require(\"../lib/parts.js\");\nconst lit_html_js_1 = require(\"../lit-html.js\");\nconst previousValues = new WeakMap();\nexports.unsafeHTML = (0, lit_html_js_1.directive)((value) => (part) => {\n if (!(part instanceof lit_html_js_1.NodePart)) {\n throw new Error('unsafeHTML can only be used in text bindings');\n }\n const previousValue = previousValues.get(part);\n if (previousValue !== undefined && (0, parts_js_1.isPrimitive)(value) &&\n value === previousValue.value && part.value === previousValue.fragment) {\n return;\n }\n const template = document.createElement('template');\n template.innerHTML = value;\n const fragment = document.importNode(template.content, true);\n part.setValue(fragment);\n previousValues.set(part, { value, fragment });\n});\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * DOM diffing utility.\n */\nclass DomDiff {\n /**\n * Renders the DOM.\n *\n * @param fromNode From Node.\n * @param toNode To Node.\n */\n static applyDiff(fromNode, toNode) {\n var _a;\n this.removeWhiteSpaceNodes(toNode.childNodes);\n const fromChildren = Array.from(fromNode.childNodes);\n const toChildren = Array.from(toNode.childNodes);\n for (let i = 0, max = toChildren.length; i < max; i++) {\n if (i < fromChildren.length) {\n if (this.nodeTypeChanged(fromChildren[i], toChildren[i])) {\n this.replaceNode(fromChildren[i], toChildren[i]);\n }\n else {\n this.setNodeAttributes(fromChildren[i], toChildren[i]);\n this.setNodeValue(fromChildren[i], toChildren[i]);\n this.applyDiff(fromChildren[i], toChildren[i]);\n }\n }\n else {\n fromNode.appendChild(toChildren[i]);\n if (toChildren[i].nodeType === Node.ELEMENT_NODE) {\n this.evaluateCode(this.getScriptCode(toChildren[i]));\n }\n }\n }\n for (let i = toChildren.length, max = fromChildren.length; i < max; i++) {\n (_a = fromChildren[i].parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(fromChildren[i]);\n }\n }\n /**\n * Checks if a node type has changed.\n *\n * @param fromNode From Node.\n * @param toNode To Node.\n * @returns If node has changed.\n */\n static nodeTypeChanged(fromNode, toNode) {\n return fromNode.nodeType !== toNode.nodeType || fromNode.tagName !== toNode.tagName;\n }\n /**\n * Replaces a node.\n *\n * @param fromNode From Node.\n * @param toNode To Node.\n */\n static replaceNode(fromNode, toNode) {\n var _a;\n (_a = fromNode.parentNode) === null || _a === void 0 ? void 0 : _a.replaceChild(toNode, fromNode);\n if (toNode.nodeType === Node.ELEMENT_NODE) {\n this.evaluateCode(this.getScriptCode(toNode));\n }\n }\n /**\n * Updates node attributes.\n *\n * @param fromNode From Node.\n * @param toNode To Node.\n */\n static setNodeAttributes(fromNode, toNode) {\n if (fromNode instanceof Element) {\n const childrenAttr = [];\n for (let a = 0, max = fromNode.attributes.length; a < max; a++) {\n childrenAttr.push(fromNode.attributes[a].name);\n }\n if (toNode instanceof Element) {\n for (let a = 0, max = toNode.attributes.length; a < max; a++) {\n const attr = toNode.attributes[a].name;\n const value = toNode.attributes[a].value;\n if (fromNode.getAttribute(attr) !== value) {\n this.setAttribute(fromNode, attr, value);\n }\n const indexOf = childrenAttr.indexOf(attr);\n if (indexOf !== -1) {\n childrenAttr.splice(indexOf, 1);\n }\n }\n for (const attr of childrenAttr) {\n this.removeAttribute(fromNode, attr);\n }\n }\n }\n }\n /**\n * Updates node value.\n *\n * @param fromNode From Node.\n * @param toNode To Node.\n */\n static setNodeValue(fromNode, toNode) {\n if (fromNode.nodeValue !== toNode.nodeValue) {\n fromNode.nodeValue = toNode.nodeValue;\n if (toNode.nodeValue &&\n toNode.parentNode &&\n toNode.parentNode.tagName === 'SCRIPT') {\n this.evaluateCode(toNode.nodeValue);\n }\n }\n }\n /**\n * Sets attribute on an element.\n *\n * @param element Element.\n * @param attr Attribute name.\n * @param value Attribute value.\n */\n static setAttribute(element, attr, value) {\n // Handle selected value in select box\n if (element instanceof HTMLOptionElement &&\n element.parentNode &&\n element.parentNode instanceof HTMLSelectElement &&\n attr === 'selected') {\n element.parentNode.selectedIndex = Array.from(element.parentNode.options).indexOf(element);\n }\n // Handle selected value in input\n if (element.tagName && element instanceof HTMLInputElement) {\n if (attr === 'value') {\n element.value = value;\n }\n else if (element.type === 'checkbox' && attr === 'checked') {\n element.checked = true;\n }\n }\n element.setAttribute(attr, value);\n }\n /**\n * Removes an attribute on an element.\n *\n * @param element Element.\n * @param attr Attribute name.\n */\n static removeAttribute(element, attr) {\n element.removeAttribute(attr);\n // Handle selected value in input\n if (element.tagName && element instanceof HTMLInputElement) {\n if (attr === 'value') {\n element.value = '';\n }\n else if (element.type === 'checkbox' && attr === 'checked') {\n element.checked = false;\n }\n }\n }\n /**\n * Removes white space nodes from a NodeList.\n *\n * @param nodeList Nodes.\n */\n static removeWhiteSpaceNodes(nodeList) {\n var _a, _b;\n const nodes = Array.from(nodeList);\n for (let i = 0, max = nodes.length; i < max; i++) {\n const isWhiteSpace = nodes[i].nodeType === Node.TEXT_NODE && ((_a = nodes[i].nodeValue) === null || _a === void 0 ? void 0 : _a.replace(/\\s+/gm, '')) === '';\n if (!nodes[i].parentNode || isWhiteSpace) {\n if (nodes[i].parentNode && isWhiteSpace) {\n (_b = nodes[i].parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(nodes[i]);\n }\n }\n else {\n this.removeWhiteSpaceNodes(nodes[i].childNodes);\n }\n }\n }\n /**\n * Evaluates script code.\n *\n * @param code Code.\n */\n static evaluateCode(code) {\n if (code) {\n eval(code);\n }\n }\n /**\n * Returns script code.\n *\n * @param element Element.\n * @returns Script code.\n */\n static getScriptCode(element) {\n var _a, _b;\n if (element.tagName === 'SCRIPT') {\n const content = (_a = element.textContent) === null || _a === void 0 ? void 0 : _a.trim();\n if (content) {\n return content;\n }\n }\n else {\n const scripts = Array.from(element.querySelectorAll('script'));\n let code = '';\n for (const script of scripts) {\n const content = (_b = script.textContent) === null || _b === void 0 ? void 0 : _b.trim();\n if (content) {\n code += content;\n }\n }\n return code;\n }\n return null;\n }\n}\nexports.default = DomDiff;\n//# sourceMappingURL=DomDiff.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction KompisElementCustomElementDecorator(tagName) {\n return function (target) {\n customElements.define(tagName, target);\n };\n}\nexports.default = KompisElementCustomElementDecorator;\n//# sourceMappingURL=KompisElementCustomElementDecorator.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Utility for equality check.\n */\nclass EqualsUtility {\n /**\n * Performs a deep equals check on the two values.\n *\n * @param value1 The first value.\n * @param value2 The second value.\n */\n static deepEquals(value1, value2) {\n // Check if same values or object references before other more expensive checks.\n if (value1 === value2) {\n return true;\n }\n if (this.isObject(value1) && this.isObject(value2)) {\n return this.deepEqualObjects(value1, value2);\n }\n return value1 === value2;\n }\n /**\n * Performs a deep equals check on the two objects.\n *\n * @param object1\n * @param object2\n */\n static deepEqualObjects(object1, object2) {\n if (Object.keys(object1).length !== Object.keys(object2).length) {\n return false;\n }\n // Compare objects with same number of keys\n for (const key in object1) {\n if (!(key in object2)) {\n return false;\n }\n // Recurse through the keys.\n if (!this.deepEquals(object1[key], object2[key])) {\n return false;\n }\n }\n return true;\n }\n /**\n * Checks whether the value is of type object.\n *\n * @param value\n */\n static isObject(value) {\n return !!value && value === Object(value);\n }\n}\nexports.default = EqualsUtility;\n//# sourceMappingURL=EqualsUtility.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst EqualsUtility_1 = __importDefault(require(\"../../utilties/EqualsUtility\"));\nfunction KompisElementPropertyDecorator(descriptor) {\n return function (target, propertyName) {\n const constructor = target.constructor;\n // For some reason the constructor is pointing to the same object\n // Therefore we create new objects\n if (constructor.propertyConstructor !== constructor) {\n constructor.propertyConstructor = constructor;\n constructor.propertyAttributeMap = new Map();\n constructor.propertyDeclarations = new Map();\n constructor.requiredProperties = [];\n }\n const attributeName = propertyName.toLowerCase();\n if (!constructor.propertyAttributeMap.get(attributeName)) {\n constructor.propertyAttributeMap.set(attributeName, propertyName);\n }\n if (!constructor.propertyDeclarations.get(propertyName)) {\n constructor.propertyDeclarations.set(propertyName, {\n type: descriptor.type || String,\n required: descriptor.required || false,\n synchronous: descriptor.synchronous || false,\n defaultValue: descriptor.required ? null : undefined\n });\n if (descriptor.required) {\n constructor.requiredProperties.push(propertyName);\n }\n }\n Object.defineProperty(target, propertyName, {\n get: function () {\n const value = this.properties.get(propertyName);\n return value !== undefined ? value : null;\n },\n set: function (value) {\n if (this.isRendering) {\n throw new Error('Failed to set property as the component is rendering. Do not change properties internally.');\n }\n // We assume that propertyDeclaration is NOT undefined here.\n const propertyDeclaration = (this.constructor.propertyDeclarations.get(propertyName));\n if (!this.properties) {\n // HAPPY-DOM BUG: Setter called on shadowed property initialisation. (i.e: \"prefix\"): https://github.com/capricorn86/happy-dom/issues/654\n return;\n }\n const previousValue = this.properties.get(propertyName) !== undefined\n ? this.properties.get(propertyName)\n : null;\n const isDefaultValue = propertyDeclaration.defaultValue === undefined;\n if (propertyDeclaration.defaultValue === undefined) {\n propertyDeclaration.defaultValue = value !== undefined ? value : null;\n }\n const newValue = value === null || value === undefined\n ? propertyDeclaration.defaultValue !== null\n ? propertyDeclaration.defaultValue\n : null\n : value;\n this.properties.set(propertyName, newValue);\n if (!isDefaultValue && !EqualsUtility_1.default.deepEquals(newValue, previousValue)) {\n if (this.changedProperties.get(propertyName) === undefined) {\n this.changedProperties.set(propertyName, previousValue);\n }\n if (propertyDeclaration.synchronous) {\n this.update();\n }\n else {\n this.requestUpdate();\n }\n }\n }\n });\n };\n}\nexports.default = KompisElementPropertyDecorator;\n//# sourceMappingURL=KompisElementPropertyDecorator.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SkapaDelayEnum;\n(function (SkapaDelayEnum) {\n SkapaDelayEnum[\"tight\"] = \"33ms\";\n SkapaDelayEnum[\"standard\"] = \"100ms\";\n SkapaDelayEnum[\"emphasised\"] = \"150ms\";\n})(SkapaDelayEnum || (SkapaDelayEnum = {}));\nexports.default = SkapaDelayEnum;\n//# sourceMappingURL=SkapaDelayEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SkapaDurationEnum;\n(function (SkapaDurationEnum) {\n SkapaDurationEnum[\"instant\"] = \"0ms\";\n SkapaDurationEnum[\"quick\"] = \"100ms\";\n SkapaDurationEnum[\"standard\"] = \"200ms\";\n SkapaDurationEnum[\"slow\"] = \"250ms\";\n})(SkapaDurationEnum || (SkapaDurationEnum = {}));\nexports.default = SkapaDurationEnum;\n//# sourceMappingURL=SkapaDurationEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SkapaFontSizeEnum;\n(function (SkapaFontSizeEnum) {\n SkapaFontSizeEnum[SkapaFontSizeEnum[\"fontSize50\"] = 12] = \"fontSize50\";\n SkapaFontSizeEnum[SkapaFontSizeEnum[\"fontSize75\"] = 14] = \"fontSize75\";\n SkapaFontSizeEnum[SkapaFontSizeEnum[\"fontSize100\"] = 16] = \"fontSize100\";\n SkapaFontSizeEnum[SkapaFontSizeEnum[\"fontSize200\"] = 18] = \"fontSize200\";\n SkapaFontSizeEnum[SkapaFontSizeEnum[\"fontSize300\"] = 20] = \"fontSize300\";\n SkapaFontSizeEnum[SkapaFontSizeEnum[\"fontSize400\"] = 22] = \"fontSize400\";\n SkapaFontSizeEnum[SkapaFontSizeEnum[\"fontSize500\"] = 25] = \"fontSize500\";\n SkapaFontSizeEnum[SkapaFontSizeEnum[\"fontSize600\"] = 28] = \"fontSize600\";\n SkapaFontSizeEnum[SkapaFontSizeEnum[\"fontSize700\"] = 32] = \"fontSize700\";\n SkapaFontSizeEnum[SkapaFontSizeEnum[\"fontSize800\"] = 36] = \"fontSize800\";\n SkapaFontSizeEnum[SkapaFontSizeEnum[\"fontSize1000\"] = 45] = \"fontSize1000\";\n SkapaFontSizeEnum[SkapaFontSizeEnum[\"fontSize1100\"] = 50] = \"fontSize1100\";\n})(SkapaFontSizeEnum || (SkapaFontSizeEnum = {}));\nexports.default = SkapaFontSizeEnum;\n//# sourceMappingURL=SkapaFontSizeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SkapaIconDurationEnum;\n(function (SkapaIconDurationEnum) {\n SkapaIconDurationEnum[\"simple\"] = \"150ms\";\n SkapaIconDurationEnum[\"average\"] = \"300ms\";\n SkapaIconDurationEnum[\"complex\"] = \"600ms\";\n})(SkapaIconDurationEnum || (SkapaIconDurationEnum = {}));\nexports.default = SkapaIconDurationEnum;\n//# sourceMappingURL=SkapaIconDurationEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst SkapaDelayEnum_1 = __importDefault(require(\"./enums/SkapaDelayEnum\"));\nconst SkapaDurationEnum_1 = __importDefault(require(\"./enums/SkapaDurationEnum\"));\nconst SkapaFontSizeEnum_1 = __importDefault(require(\"./enums/SkapaFontSizeEnum\"));\nconst SkapaIconDurationEnum_1 = __importDefault(require(\"./enums/SkapaIconDurationEnum\"));\nexports.default = {\n /** @deprecated Use Skapas way of scaling instead. */\n scale: 1,\n color: {\n accent: {\n primaryAccent: '#0058a3',\n primaryAccentDark: '#004f93',\n primaryAccentDarkest: '#003e72',\n secondaryAccent: '#ffdb00',\n secondaryAccentDark: '#e6c200',\n secondaryAccentDarker: '#ccad00'\n },\n neutral: {\n white: '#ffffff',\n grey100: '#f5f5f5',\n grey200: '#dfdfdf',\n grey300: '#cccccc',\n grey500: '#929292',\n grey700: '#484848',\n grey900: '#111111'\n },\n commercialMessage: {\n newLowerPrice: '#cc0008',\n new: '#ca5008',\n btiYellow: '#ffdb00',\n btiRed: '#cc0008',\n family: '#007cc1'\n },\n semantic: {\n positive: '#0a8a00',\n negative: '#e00751',\n caution: '#f26a2f',\n informative: '#0058a3'\n },\n component: {\n dangerDefault: '#e00751',\n dangerHover: '#cc003d',\n dangerPress: '#b80029',\n primaryDefault: '#111111',\n primaryHover: '#333333',\n primaryPress: '#000000',\n inverseBorderPress: '#ffffff',\n primaryEmphasisedDefault: '#0058a3',\n primaryEmphasisedHover: '#004f93',\n primaryEmphasisedPress: '#003e72',\n switchOff: '#808080'\n },\n background: {\n default: '#ffffff',\n alt: '#f5f5f5',\n inverse: '#111111',\n accent: '#0058a3'\n },\n text: {\n default: '#484848',\n dark: '#111111',\n lightest: '#767676',\n inverse: '#ffffff'\n },\n border: {\n default: '#929292',\n dark: '#111111',\n light: '#dfdfdf',\n inverse: '#ffffff'\n },\n icon: {\n default: '#111111',\n favorite: '#e00751',\n light: '#929292',\n inverse: '#ffffff'\n },\n disabled: {\n default: '#dfdfdf'\n },\n transparency: {\n default: 'rgba(255,255,255,0)',\n light: 'rgba(0,0,0,0.15)',\n dark: 'rgba(0,0,0,0.7)'\n },\n campaign: {\n sustainability: '#00853e'\n }\n },\n border: {\n thickness: {\n thin: 1,\n thick: 2\n },\n radius: {\n radius4: 4,\n radius8: 8,\n radius12: 12,\n radius20: 20,\n radius64: 64\n }\n },\n fontFace: {\n family: 'notoIKEAlatin',\n fallbacks: ['Noto Sans', 'Roboto', 'Open Sans', 'sans-serif'],\n sources: [\n {\n formats: {\n ttf: {\n url: '/addon-app/components/resources/fonts/44/noto/NotoSansIKEA-BoldItalic.ttf',\n format: 'truetype'\n },\n woff: {\n url: '/addon-app/components/resources/fonts/44/noto/NotoSansIKEA-BoldItalic.woff',\n format: 'woff'\n },\n woff2: {\n url: '/addon-app/components/resources/fonts/44/noto/NotoSansIKEA-BoldItalic.woff2',\n format: 'woff2'\n }\n },\n weight: 700,\n style: 'italic'\n },\n {\n formats: {\n ttf: {\n url: '/addon-app/components/resources/fonts/44/noto/NotoSansIKEA-Bold.ttf',\n format: 'truetype'\n },\n woff: {\n url: '/addon-app/components/resources/fonts/44/noto/NotoSansIKEA-Bold.woff',\n format: 'woff'\n },\n woff2: {\n url: '/addon-app/components/resources/fonts/44/noto/NotoSansIKEA-Bold.woff2',\n format: 'woff2'\n }\n },\n weight: 700,\n style: 'normal'\n },\n {\n formats: {\n ttf: {\n url: '/addon-app/components/resources/fonts/44/noto/NotoSansIKEA-Italic.ttf',\n format: 'truetype'\n },\n woff: {\n url: '/addon-app/components/resources/fonts/44/noto/NotoSansIKEA-Italic.woff',\n format: 'woff'\n },\n woff2: {\n url: '/addon-app/components/resources/fonts/44/noto/NotoSansIKEA-Italic.woff2',\n format: 'woff2'\n }\n },\n weight: 400,\n style: 'italic'\n },\n {\n formats: {\n ttf: {\n url: '/addon-app/components/resources/fonts/44/noto/NotoSansIKEA-Regular.ttf',\n format: 'truetype'\n },\n woff: {\n url: '/addon-app/components/resources/fonts/44/noto/NotoSansIKEA-Regular.woff',\n format: 'woff'\n },\n woff2: {\n url: '/addon-app/components/resources/fonts/44/noto/NotoSansIKEA-Regular.woff2',\n format: 'woff2'\n }\n },\n weight: 400,\n style: 'normal'\n }\n ]\n },\n focusOutline: {\n offset: 4,\n width: 2,\n color: '#111111',\n transitionTime: 0.2,\n borderRadius: 2\n },\n spacing: {\n space25: 4,\n space50: 8,\n space75: 12,\n space100: 16,\n space125: 20,\n space150: 24,\n space200: 32,\n space250: 40,\n space300: 48,\n space400: 64,\n space550: 88,\n space750: 120\n },\n elevation: {\n size: {\n default: '0px 4px 16px'\n },\n color: {\n default: 'rgba(0,0,0,0.1)'\n }\n },\n motion: {\n ease: {\n easy: 'cubic-bezier(0.4, 0.0, 0.4, 1.0)',\n expressive: 'cubic-bezier(0.8, 0.0, 0.0, 1.0)',\n enter: 'cubic-bezier(0.0, 0.0, 0.1, 1.0)',\n exit: 'cubic-bezier(0.9, 0.0, 1.0, 1.0)',\n bob: 'cubic-bezier(0.45, 1.45, 0.65, 1.0)',\n linear: 'cubic-bezier(0,0,1,1)'\n },\n duration: {\n xsmall: SkapaDurationEnum_1.default.instant,\n small: SkapaDurationEnum_1.default.quick,\n medium: SkapaDurationEnum_1.default.standard,\n large: SkapaDurationEnum_1.default.slow\n },\n iconDuration: {\n small: SkapaIconDurationEnum_1.default.simple,\n medium: SkapaIconDurationEnum_1.default.average,\n large: SkapaIconDurationEnum_1.default.complex\n },\n delay: {\n small: SkapaDelayEnum_1.default.tight,\n medium: SkapaDelayEnum_1.default.standard,\n large: SkapaDelayEnum_1.default.emphasised\n }\n },\n breakpoint: {\n small: {\n width: 0,\n gridSpacing: {\n column: 4,\n gutter: 12\n },\n fontStyle: {\n bodyXLarge: { size: SkapaFontSizeEnum_1.default.fontSize300, lineHeight: 32 },\n bodyLarge: { size: SkapaFontSizeEnum_1.default.fontSize100, lineHeight: 26 },\n bodyMedium: { size: SkapaFontSizeEnum_1.default.fontSize75, lineHeight: 22 },\n bodySmall: { size: SkapaFontSizeEnum_1.default.fontSize50, lineHeight: 18 },\n headingXSmall: {\n size: SkapaFontSizeEnum_1.default.fontSize75,\n lineHeight: 22,\n weight: 700\n },\n headingSmall: {\n size: SkapaFontSizeEnum_1.default.fontSize100,\n lineHeight: 24,\n weight: 700\n },\n headingMedium: {\n size: SkapaFontSizeEnum_1.default.fontSize200,\n lineHeight: 26,\n weight: 700\n },\n headingLarge: {\n size: SkapaFontSizeEnum_1.default.fontSize500,\n lineHeight: 34,\n letterSpacing: -0.42,\n weight: 700\n },\n headingXLarge: {\n size: SkapaFontSizeEnum_1.default.fontSize700,\n lineHeight: 44,\n letterSpacing: -0.56,\n weight: 700\n },\n priceXSmall: { size: SkapaFontSizeEnum_1.default.fontSize50, lineHeight: 12 },\n priceSmall: { size: SkapaFontSizeEnum_1.default.fontSize75, lineHeight: 14 },\n priceMedium: { size: SkapaFontSizeEnum_1.default.fontSize200, lineHeight: 18 },\n priceLarge: { size: SkapaFontSizeEnum_1.default.fontSize500, lineHeight: 25 },\n priceXLarge: { size: SkapaFontSizeEnum_1.default.fontSize600, lineHeight: 28 },\n priceXXLarge: { size: SkapaFontSizeEnum_1.default.fontSize1000, lineHeight: 45 }\n }\n },\n medium: {\n width: 600,\n gridSpacing: {\n column: 6,\n gutter: 16\n },\n fontStyle: {\n bodyXLarge: { size: SkapaFontSizeEnum_1.default.fontSize300, lineHeight: 32 },\n bodyLarge: { size: SkapaFontSizeEnum_1.default.fontSize100, lineHeight: 26 },\n bodyMedium: { size: SkapaFontSizeEnum_1.default.fontSize75, lineHeight: 22 },\n bodySmall: { size: SkapaFontSizeEnum_1.default.fontSize50, lineHeight: 18 },\n headingXSmall: {\n size: SkapaFontSizeEnum_1.default.fontSize75,\n lineHeight: 22,\n weight: 700\n },\n headingSmall: {\n size: SkapaFontSizeEnum_1.default.fontSize100,\n lineHeight: 24,\n weight: 700\n },\n headingMedium: {\n size: SkapaFontSizeEnum_1.default.fontSize200,\n lineHeight: 26,\n weight: 700\n },\n headingLarge: {\n size: SkapaFontSizeEnum_1.default.fontSize500,\n lineHeight: 34,\n letterSpacing: -0.42,\n weight: 700\n },\n headingXLarge: {\n size: SkapaFontSizeEnum_1.default.fontSize700,\n lineHeight: 44,\n letterSpacing: -0.56,\n weight: 700\n },\n priceXSmall: { size: SkapaFontSizeEnum_1.default.fontSize50, lineHeight: 12 },\n priceSmall: { size: SkapaFontSizeEnum_1.default.fontSize75, lineHeight: 14 },\n priceMedium: { size: SkapaFontSizeEnum_1.default.fontSize200, lineHeight: 18 },\n priceLarge: { size: SkapaFontSizeEnum_1.default.fontSize500, lineHeight: 25 },\n priceXLarge: { size: SkapaFontSizeEnum_1.default.fontSize600, lineHeight: 28 },\n priceXXLarge: { size: SkapaFontSizeEnum_1.default.fontSize1000, lineHeight: 45 }\n }\n },\n large: {\n width: 900,\n gridSpacing: {\n column: 12,\n gutter: 24\n },\n fontStyle: {\n bodyXLarge: { size: SkapaFontSizeEnum_1.default.fontSize300, lineHeight: 32 },\n bodyLarge: { size: SkapaFontSizeEnum_1.default.fontSize100, lineHeight: 26 },\n bodyMedium: { size: SkapaFontSizeEnum_1.default.fontSize75, lineHeight: 22 },\n bodySmall: { size: SkapaFontSizeEnum_1.default.fontSize50, lineHeight: 18 },\n headingXSmall: {\n size: SkapaFontSizeEnum_1.default.fontSize75,\n lineHeight: 22,\n weight: 700\n },\n headingSmall: {\n size: SkapaFontSizeEnum_1.default.fontSize100,\n lineHeight: 24,\n weight: 700\n },\n headingMedium: {\n size: SkapaFontSizeEnum_1.default.fontSize200,\n lineHeight: 26,\n weight: 700\n },\n headingLarge: {\n size: SkapaFontSizeEnum_1.default.fontSize500,\n lineHeight: 34,\n letterSpacing: -0.42,\n weight: 700\n },\n headingXLarge: {\n size: SkapaFontSizeEnum_1.default.fontSize700,\n lineHeight: 44,\n letterSpacing: -0.56,\n weight: 700\n },\n priceXSmall: { size: SkapaFontSizeEnum_1.default.fontSize50, lineHeight: 12 },\n priceSmall: { size: SkapaFontSizeEnum_1.default.fontSize75, lineHeight: 14 },\n priceMedium: { size: SkapaFontSizeEnum_1.default.fontSize200, lineHeight: 18 },\n priceLarge: { size: SkapaFontSizeEnum_1.default.fontSize500, lineHeight: 25 },\n priceXLarge: { size: SkapaFontSizeEnum_1.default.fontSize600, lineHeight: 28 },\n priceXXLarge: { size: SkapaFontSizeEnum_1.default.fontSize1000, lineHeight: 45 }\n }\n },\n xlarge: {\n width: 1200,\n gridSpacing: {\n column: 12,\n gutter: 24\n },\n fontStyle: {\n bodyXLarge: { size: SkapaFontSizeEnum_1.default.fontSize300, lineHeight: 32 },\n bodyLarge: { size: SkapaFontSizeEnum_1.default.fontSize100, lineHeight: 26 },\n bodyMedium: { size: SkapaFontSizeEnum_1.default.fontSize75, lineHeight: 22 },\n bodySmall: { size: SkapaFontSizeEnum_1.default.fontSize50, lineHeight: 18 },\n headingXSmall: {\n size: SkapaFontSizeEnum_1.default.fontSize75,\n lineHeight: 22,\n weight: 700\n },\n headingSmall: {\n size: SkapaFontSizeEnum_1.default.fontSize100,\n lineHeight: 24,\n weight: 700\n },\n headingMedium: {\n size: SkapaFontSizeEnum_1.default.fontSize500,\n lineHeight: 34,\n letterSpacing: -0.42,\n weight: 700\n },\n headingLarge: {\n size: SkapaFontSizeEnum_1.default.fontSize800,\n lineHeight: 48,\n letterSpacing: -0.63,\n weight: 700\n },\n headingXLarge: {\n size: SkapaFontSizeEnum_1.default.fontSize1100,\n lineHeight: 66,\n letterSpacing: -0.87,\n weight: 700\n },\n priceXSmall: { size: SkapaFontSizeEnum_1.default.fontSize50, lineHeight: 12 },\n priceSmall: { size: SkapaFontSizeEnum_1.default.fontSize75, lineHeight: 14 },\n priceMedium: { size: SkapaFontSizeEnum_1.default.fontSize200, lineHeight: 18 },\n priceLarge: { size: SkapaFontSizeEnum_1.default.fontSize500, lineHeight: 25 },\n priceXLarge: { size: SkapaFontSizeEnum_1.default.fontSize600, lineHeight: 28 },\n priceXXLarge: { size: SkapaFontSizeEnum_1.default.fontSize1000, lineHeight: 45 }\n }\n },\n xxlarge: {\n width: 1920,\n gridSpacing: {\n column: 12,\n gutter: 24\n },\n fontStyle: {\n bodyXLarge: { size: SkapaFontSizeEnum_1.default.fontSize300, lineHeight: 32 },\n bodyLarge: { size: SkapaFontSizeEnum_1.default.fontSize100, lineHeight: 26 },\n bodyMedium: { size: SkapaFontSizeEnum_1.default.fontSize75, lineHeight: 22 },\n bodySmall: { size: SkapaFontSizeEnum_1.default.fontSize50, lineHeight: 18 },\n headingXSmall: {\n size: SkapaFontSizeEnum_1.default.fontSize75,\n lineHeight: 22,\n weight: 700\n },\n headingSmall: {\n size: SkapaFontSizeEnum_1.default.fontSize100,\n lineHeight: 24,\n weight: 700\n },\n headingMedium: {\n size: SkapaFontSizeEnum_1.default.fontSize500,\n lineHeight: 34,\n letterSpacing: -0.42,\n weight: 700\n },\n headingLarge: {\n size: SkapaFontSizeEnum_1.default.fontSize800,\n lineHeight: 48,\n letterSpacing: -0.63,\n weight: 700\n },\n headingXLarge: {\n size: SkapaFontSizeEnum_1.default.fontSize1100,\n lineHeight: 66,\n letterSpacing: -0.87,\n weight: 700\n },\n priceXSmall: { size: SkapaFontSizeEnum_1.default.fontSize50, lineHeight: 12 },\n priceSmall: { size: SkapaFontSizeEnum_1.default.fontSize75, lineHeight: 14 },\n priceMedium: { size: SkapaFontSizeEnum_1.default.fontSize200, lineHeight: 18 },\n priceLarge: { size: SkapaFontSizeEnum_1.default.fontSize500, lineHeight: 25 },\n priceXLarge: { size: SkapaFontSizeEnum_1.default.fontSize600, lineHeight: 28 },\n priceXXLarge: { size: SkapaFontSizeEnum_1.default.fontSize1000, lineHeight: 45 }\n }\n }\n }\n};\n//# sourceMappingURL=SkapaTheme.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * This utility is used for generating font-face CSS code for a specified theme.\n */\nclass FontFace {\n /**\n * Returns font faces.\n *\n * @param theme Theme.\n * @returns Css code.\n */\n static getFontFaces(theme) {\n return theme.fontFace.sources\n .map((source) => {\n const properties = [\n `font-family: ${theme.fontFace.family};`,\n `src: url('${source.formats.woff2.url}') format('${source.formats.woff2.format}'), \n\t\t\t\t\turl('${source.formats.woff.url}') format('${source.formats.woff.format}'), \n\t\t\t\t\turl('${source.formats.ttf.url}') format('${source.formats.ttf.format}');`,\n `font-display: swap;`\n ];\n if (source.weight) {\n properties.push(`font-weight: ${source.weight};`);\n }\n if (source.style) {\n properties.push(`font-style: ${source.style};`);\n }\n return `\n\t\t\t\t@font-face {\n\t\t\t\t\t${properties.join('\\n')}\n\t\t\t\t}\n\t\t\t`;\n })\n .join('\\n');\n }\n}\nexports.default = FontFace;\n//# sourceMappingURL=FontFace.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst FontFace_1 = __importDefault(require(\"./FontFace\"));\n/**\n * Class for inserting font-face styles to the head of the document.\n * All components extending the KompisElement class uses the FontLoader.\n */\nclass FontLoader {\n /**\n * Appends style element to head of document.\n *\n * @param theme Theme.\n * @param [cacheStore] Cache store.\n */\n static loadFont(theme, cacheStore = new utilities_1.GlobalCacheStore()) {\n if (cacheStore.getStore('fontLoader').get(theme.fontFace.family)) {\n return;\n }\n cacheStore.getStore('fontLoader').set(theme.fontFace.family, true);\n const styleElement = document.createElement('style');\n styleElement.innerHTML = `\n /* Added by @inter-ikea-kompis/themes/lib/utilities/FontLoader.js */\n ${FontFace_1.default.getFontFaces(theme)}\n `;\n document.head.appendChild(styleElement);\n }\n}\nexports.default = FontLoader;\n//# sourceMappingURL=FontLoader.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\n/**\n * Class providing font styles depending on font style.\n */\nclass FontStyle {\n /**\n * Returns font styles.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @param options.type \"title76\", \"title60\" etc.\n * @param [options.bold] Bold.\n * @param [options.italic] Italic.\n * @param [options.underline] Underline.\n * @param [options.querySelector] Defaults to \":host\".\n * @returns CSS code.\n */\n static getStyle(options) {\n const querySelector = options.querySelector || ':host';\n // \"small\" is the default style, so therefore we want to always add it.\n return `\n\t\t\t${this.getComment(options)}\n\t\t\t${querySelector} {\n\t\t\t\tfont-family: ${this.getFontFamily(options.theme)};\n\t\t\t\t${this.getTextStyle(Object.assign(Object.assign({}, options), { breakpoint: options.theme.breakpoint.small }))}\n\t\t\t}\n\t\t\t${this.getMediaQueryStyles(options)}\n\t\t`;\n }\n /**\n * Returns font styles.\n *\n * @param theme Theme.\n * @returns Font family.\n */\n static getFontFamily(theme) {\n const fontTypes = ['sans-serif'];\n return [theme.fontFace.family, ...theme.fontFace.fallbacks]\n .map((font) => (fontTypes.includes(font) ? font : `'${font}'`))\n .join(',');\n }\n /**\n * Returns media queries.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @param options.type \"bodySmall\", \"bodySmall\" etc.\n * @param [options.bold] Bold.\n * @param [options.italic] Italic.\n * @param [options.underline] Underline.\n * @param [options.querySelector] Defaults to \":host\".\n * @returns CSS code.\n */\n static getMediaQueryStyles(options) {\n const breakpoints = Object.values(options.theme.breakpoint).sort((a, b) => a.width - b.width);\n const querySelector = options.querySelector || ':host';\n const mediaQueries = [];\n let previousStyle = this.getTextStyle(Object.assign(Object.assign({}, options), { breakpoint: options.theme.breakpoint.small }));\n for (const breakpoint of breakpoints) {\n // We want to exclude \"small\" as it is the default style, which is added in getStyle().\n if (breakpoint !== options.theme.breakpoint.small) {\n const style = this.getTextStyle(Object.assign(Object.assign({}, options), { breakpoint }));\n if (previousStyle !== style) {\n previousStyle = style;\n mediaQueries.push(`\n\t\t\t@media screen and (min-width: ${breakpoint.width / 16}rem) {\n\t\t\t\t${querySelector} {\n\t\t\t\t\t${style}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t`);\n }\n }\n }\n return mediaQueries.join('\\n');\n }\n /**\n * Returns text style.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @param options.breakpoint Breakpoint.\n * @param options.type \"bodySmall\", \"bodySmall\" etc.\n * @param [options.bold] Bold.\n * @param [options.italic] Italic.\n * @param [options.underline] Underline.\n * @param options.querySelector\n * @returns CSS code.\n */\n static getTextStyle(options) {\n if (!enums_1.ThemeFontStyleTypeEnum[options.type]) {\n throw new Error(`Failed to generate font style. The type \"${options.type}\" does not exist.`);\n }\n const font = options.breakpoint.fontStyle[options.type];\n const styles = [`font-size: ${font.size / 16}rem;`, `line-height: ${font.lineHeight / 16}rem;`];\n if (font.letterSpacing) {\n styles.push(`letter-spacing: ${font.letterSpacing / 16}rem;`);\n }\n if (options.bold || font.weight !== undefined) {\n styles.push(`font-weight: ${options.bold ? 'bold' : font.weight};`);\n }\n if (options.italic) {\n styles.push(`font-style: italic;`);\n }\n if (options.underline) {\n styles.push(`text-decoration: underline;`);\n }\n return styles.join('\\n\\t\\t\\t\\t');\n }\n /**\n * Returns a CSS comment that describes what options that are applied.\n *\n * @param options Options.\n * @param options.type \"title76\", \"title60\" etc.\n * @param options.bold Bold.\n * @param options.italic Italic.\n * @param options.underline Underline.\n * @returns CSS code.\n */\n static getComment(options) {\n let comment = `\\t\\t\\t Generated by @inter-ikea-kompis/themes/lib/utilities/FontStyle.ts:\\n\\t\\t\\t type: ${options.type}`;\n for (const option of ['bold', 'italic', 'underline']) {\n if (options[option]) {\n comment += `\\n\\t\\t\\t ${option}: ${options[option]}`;\n }\n }\n return `/*\\n${comment}\\n\\t\\t\\t*/`;\n }\n}\nexports.default = FontStyle;\n//# sourceMappingURL=FontStyle.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Theme breakpoint observer.\n */\nclass ThemeBreakpointObserver {\n /**\n * Constructor.\n *\n * @param callback Function.\n * @param [element] Element.\n */\n constructor(callback, element = null) {\n this.breakpoints = null;\n this.currentBreakpointIndex = null;\n this.timeout = null;\n this.listeners = {\n resize: this.onResize.bind(this)\n };\n this.callback = null;\n this.element = null;\n this.resizeObserver = null;\n this.callback = callback;\n this.element = element;\n }\n /**\n * Starts listening for resize events and emits events when the viewport size changes.\n *\n * @param theme Theme.\n */\n observe(theme) {\n if (this.currentBreakpointIndex === null) {\n if (this.element) {\n this.resizeObserver = new ResizeObserver(this.listeners.resize);\n this.resizeObserver.observe(this.element);\n }\n else {\n window.addEventListener('resize', this.listeners.resize);\n }\n }\n this.breakpoints = Object.values(theme.breakpoint).sort((a, b) => {\n return a.width - b.width;\n });\n // As the element usually isn't rendered here it will not have any CSS that gives it a size.\n // By setting display to \"block\" it will become 100% in width of its parent, which most likely will be the size it will become once it is rendered.\n // If it is not the same size when rendered, the ResizeObserver will trigger the callback for re-rendering and it will correct itself.\n // However, when a re-rendering occurr we will unfortunately get a re-paint, but hopefully it is unlikely.\n if (this.element && !this.element.style.display) {\n this.element.style.display = 'block';\n }\n const width = this.element ? this.element.offsetWidth : window.innerWidth;\n this.currentBreakpointIndex = this.findBreakpointIndex(width);\n if (this.element && this.element.style.display) {\n this.element.style.removeProperty('display');\n }\n }\n /**\n * Disconnects the observer.\n */\n disconnect() {\n this.currentBreakpointIndex = null;\n clearTimeout(this.timeout);\n this.currentBreakpointIndex = null;\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n this.resizeObserver = null;\n }\n else {\n window.removeEventListener('resize', this.listeners.resize);\n }\n }\n /**\n * Returns the current breakpoint breakpoint specification.\n *\n * @returns Breakpoint.\n */\n getBreakpoint() {\n var _a, _b;\n if (this.currentBreakpointIndex === null) {\n return null;\n }\n return (_b = (_a = this.breakpoints) === null || _a === void 0 ? void 0 : _a[this.currentBreakpointIndex]) !== null && _b !== void 0 ? _b : null;\n }\n /**\n * Returns the current breakpoint index.\n *\n * @returns Breakpoint index.\n */\n getBreakpointIndex() {\n return this.currentBreakpointIndex;\n }\n /**\n * Triggered on resize.\n */\n onResize() {\n clearTimeout(this.timeout);\n this.timeout = setTimeout(() => {\n var _a;\n const width = this.element ? this.element.offsetWidth : window.innerWidth;\n const breakpointIndex = this.findBreakpointIndex(width);\n if (breakpointIndex !== this.currentBreakpointIndex) {\n this.currentBreakpointIndex = breakpointIndex;\n (_a = this.callback) === null || _a === void 0 ? void 0 : _a.call(this, { breakpointIndex, breakpoint: this.getBreakpoint() });\n }\n });\n }\n /**\n * Finds and returns the breakpoint index matching a width.\n *\n * @param width Width.\n * @returns Breakpoint index.\n */\n findBreakpointIndex(width) {\n if (!this.breakpoints || this.breakpoints.length === 0) {\n return 0;\n }\n const xxlarge = this.breakpoints[this.breakpoints.length - 1];\n if (width >= xxlarge.width) {\n return this.breakpoints.length - 1;\n }\n for (let i = this.breakpoints.length - 1; i >= 0; i--) {\n if (this.breakpoints[i].width <= width) {\n return i;\n }\n }\n return 0;\n }\n}\nexports.default = ThemeBreakpointObserver;\n//# sourceMappingURL=ThemeBreakpointObserver.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ThemeBreakpointObserver = exports.SkapaTheme = exports.FontStyle = exports.FontLoader = exports.FontFace = void 0;\nconst SkapaTheme_1 = __importDefault(require(\"./themes/skapa/SkapaTheme\"));\nexports.SkapaTheme = SkapaTheme_1.default;\nconst FontFace_1 = __importDefault(require(\"./utilities/FontFace\"));\nexports.FontFace = FontFace_1.default;\nconst FontLoader_1 = __importDefault(require(\"./utilities/FontLoader\"));\nexports.FontLoader = FontLoader_1.default;\nconst FontStyle_1 = __importDefault(require(\"./utilities/FontStyle\"));\nexports.FontStyle = FontStyle_1.default;\nconst ThemeBreakpointObserver_1 = __importDefault(require(\"./utilities/ThemeBreakpointObserver\"));\nexports.ThemeBreakpointObserver = ThemeBreakpointObserver_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst lit_html_1 = require(\"../../lib/lit-html/lit-html\");\nconst fontCache = [];\nfunction generateFontStyle(theme) {\n const fontFamily = themes_1.FontStyle.getFontFamily(theme);\n if (!fontCache[fontFamily]) {\n themes_1.FontLoader.loadFont(theme); // Built in deduplication.\n fontCache[fontFamily] = `\n\t\t*, *:before, *:after {\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\n\t\t:host {\n\t\t\tfont-family: ${fontFamily};\n\t\t}`;\n }\n return fontCache[fontFamily];\n}\n/**\n * Components should extend this class.\n */\nclass KompisElement extends HTMLElement {\n /**\n * @override\n */\n static get observedAttributes() {\n return Array.from(this.propertyAttributeMap.keys());\n }\n /**\n * Class constructor.\n */\n constructor() {\n super();\n this.isRendering = false;\n this.properties = new Map();\n this.changedProperties = new Map();\n this.updateCallbacks = [];\n this.updateTimeout = null;\n this.attachShadow({\n mode: 'open'\n });\n }\n /**\n * Requests an update.\n *\n * @returns Promise.\n */\n requestUpdate() {\n if (!this.isConnected) {\n return Promise.resolve();\n }\n return new Promise((resolve) => {\n if (this.updateTimeout !== null) {\n clearTimeout(this.updateTimeout);\n }\n this.updateCallbacks.push(resolve);\n this.updateTimeout = setTimeout(() => this.update());\n });\n }\n /**\n * Requests an update.\n */\n cancelUpdate() {\n if (this.updateTimeout !== null) {\n clearTimeout(this.updateTimeout);\n this.updateTimeout = null;\n }\n if (this.updateCallbacks.length > 0) {\n const callbacks = this.updateCallbacks;\n this.updateCallbacks = [];\n for (const callback of callbacks) {\n callback();\n }\n }\n }\n /**\n * Updates the component synchronous.\n */\n update() {\n this.cancelUpdate();\n if (!this.isConnected) {\n return;\n }\n for (const requiredPropertyName of this.constructor\n .requiredProperties) {\n const value = this.properties.get(requiredPropertyName);\n if (value === undefined || value === null) {\n return;\n }\n }\n const changedProperties = this.changedProperties;\n this.changedProperties = new Map();\n this.isRendering = true;\n if (this.shouldUpdate(changedProperties)) {\n try {\n this.renderToDom();\n }\n catch (error) {\n this.isRendering = false;\n throw error;\n }\n }\n this.isRendering = false;\n }\n /**\n * @override\n */\n dispatchEvent(event) {\n var _a;\n const result = super.dispatchEvent(event);\n if (this['on' + event.type.toLowerCase()] === undefined &&\n this.getAttribute('on' + event.type)) {\n eval((_a = this.getAttribute('on' + event.type)) !== null && _a !== void 0 ? _a : '');\n }\n return result;\n }\n /**\n * Renders the component.\n *\n * @returns Template result.\n */\n render() {\n return undefined;\n }\n /**\n * Triggered when properties has changed.\n *\n * @param _changedProperties Changed properties.\n * @returns \"true\" if the component should update.\n */\n shouldUpdate(_changedProperties) {\n return true;\n }\n /**\n * Called when the component is inserted to DOM.\n */\n connectedCallback() {\n const propertyDeclarations = this.constructor.propertyDeclarations;\n this.changedProperties = new Map();\n for (const [propertyName, propertyDeclaration] of Array.from(propertyDeclarations)) {\n const attributeValue = this.getAttribute(propertyName);\n if (attributeValue !== null) {\n this.properties.set(propertyName, this.parseAttributeValue(propertyDeclaration.type, attributeValue));\n }\n const propertyValue = this.properties.get(propertyName);\n if (propertyValue !== undefined && propertyValue !== propertyDeclaration.defaultValue) {\n this.changedProperties.set(propertyName, propertyDeclaration.defaultValue);\n }\n }\n this.update();\n }\n /**\n * Called when the component is inserted to DOM.\n */\n disconnectedCallback() {\n if (this.updateTimeout !== null) {\n clearTimeout(this.updateTimeout);\n this.updateTimeout = null;\n }\n }\n /**\n * Attribute changed callback triggered by HTMLElement.\n *\n * @param attributeName Attribute name.\n * @param _oldValue Old value.\n * @param newValue New value.\n */\n attributeChangedCallback(attributeName, _oldValue, newValue) {\n const propertyName = this.constructor.propertyAttributeMap.get(attributeName.toLowerCase());\n if (propertyName === undefined) {\n return;\n }\n const propertyDeclaration = this.constructor.propertyDeclarations.get(propertyName);\n if (propertyDeclaration) {\n this[propertyName] = this.parseAttributeValue(propertyDeclaration.type, newValue);\n }\n }\n /**\n * Renders to dom.\n */\n renderToDom() {\n (0, lit_html_1.render)((0, lit_html_1.html) `\n\t\t\t\t${this.render()}`, this.shadowRoot);\n }\n /**\n * Parses an attribute value.\n *\n * @param type Type.\n * @param attributeValue Attribute value.\n * @param value\n * @returns Property value.\n */\n parseAttributeValue(type, value) {\n if (value === null) {\n return null;\n }\n switch (type) {\n case String:\n return value;\n case Boolean:\n return value !== null;\n case Number: {\n const parsedValue = Number(value);\n return !isNaN(parsedValue) ? parsedValue : null;\n }\n case Array:\n case Object:\n return JSON.parse(value);\n }\n return null;\n }\n}\nKompisElement.propertyConstructor = null;\nKompisElement.propertyAttributeMap = new Map();\nKompisElement.propertyDeclarations = new Map();\nKompisElement.requiredProperties = [];\nexports.default = KompisElement;\n//# sourceMappingURL=KompisElement.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Handles converting a template literal tag to string.\n */\nclass CssTemplateLiteralTag {\n /**\n * Converts a template literal to string.\n *\n * @param strings Strings.\n * @param values Expressions.\n * @returns Result as string.\n */\n static templateToString(strings, ...values) {\n let result = '';\n for (let i = 0, max = strings.length; i < max; i++) {\n result += strings[i];\n if (i < max - 1 && values[i] !== null) {\n result += String(values[i]);\n }\n }\n return result;\n }\n}\nexports.default = CssTemplateLiteralTag;\n//# sourceMappingURL=CssTemplateLiteralTag.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\n/**\n * Handles converting a template literal tag to string.\n */\nclass HtmlTemplateLiteralTag {\n /**\n * Converts a template literal to string.\n *\n * @param strings Strings.\n * @param values Expressions.\n * @returns Result as string.\n */\n static templateToString(strings, ...values) {\n let result = '';\n for (let i = 0, max = strings.length; i < max; i++) {\n result += strings[i];\n if (i < max - 1 && values[i] !== null) {\n if (result.endsWith('=\"') || result.endsWith(\"='\")) {\n result += utilities_1.HtmlEncoder.encodeForAttribute(String(values[i]));\n }\n else {\n result += String(values[i]);\n }\n }\n }\n return result;\n }\n}\nexports.default = HtmlTemplateLiteralTag;\n//# sourceMappingURL=HtmlTemplateLiteralTag.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unsafeHTML = exports.TemplateResult = exports.styleMap = exports.repeat = exports.render = exports.property = exports.KompisElement = exports.htmlString = exports.html = exports.DomDiff = exports.customElement = exports.css = exports.classMap = void 0;\nconst class_map_js_1 = require(\"../lib/lit-html/directives/class-map.js\");\nObject.defineProperty(exports, \"classMap\", { enumerable: true, get: function () { return class_map_js_1.classMap; } });\nconst repeat_js_1 = require(\"../lib/lit-html/directives/repeat.js\");\nObject.defineProperty(exports, \"repeat\", { enumerable: true, get: function () { return repeat_js_1.repeat; } });\nconst style_map_js_1 = require(\"../lib/lit-html/directives/style-map.js\");\nObject.defineProperty(exports, \"styleMap\", { enumerable: true, get: function () { return style_map_js_1.styleMap; } });\nconst unsafe_html_js_1 = require(\"../lib/lit-html/directives/unsafe-html.js\");\nObject.defineProperty(exports, \"unsafeHTML\", { enumerable: true, get: function () { return unsafe_html_js_1.unsafeHTML; } });\nconst lit_html_1 = require(\"../lib/lit-html/lit-html\");\nObject.defineProperty(exports, \"html\", { enumerable: true, get: function () { return lit_html_1.html; } });\nObject.defineProperty(exports, \"render\", { enumerable: true, get: function () { return lit_html_1.render; } });\nObject.defineProperty(exports, \"TemplateResult\", { enumerable: true, get: function () { return lit_html_1.TemplateResult; } });\nconst DomDiff_1 = __importDefault(require(\"./dom-diff/DomDiff\"));\nexports.DomDiff = DomDiff_1.default;\nconst KompisElementCustomElementDecorator_1 = __importDefault(require(\"./kompis-element/decorators/KompisElementCustomElementDecorator\"));\nconst KompisElementPropertyDecorator_1 = __importDefault(require(\"./kompis-element/decorators/KompisElementPropertyDecorator\"));\nconst KompisElement_1 = __importDefault(require(\"./kompis-element/KompisElement\"));\nexports.KompisElement = KompisElement_1.default;\nconst CssTemplateLiteralTag_1 = __importDefault(require(\"./template/CssTemplateLiteralTag\"));\nconst HtmlTemplateLiteralTag_1 = __importDefault(require(\"./template/HtmlTemplateLiteralTag\"));\nconst css = CssTemplateLiteralTag_1.default.templateToString;\nexports.css = css;\nconst htmlString = HtmlTemplateLiteralTag_1.default.templateToString;\nexports.htmlString = htmlString;\nconst property = KompisElementPropertyDecorator_1.default;\nexports.property = property;\nconst customElement = KompisElementCustomElementDecorator_1.default;\nexports.customElement = customElement;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\n/**\n * Component that can render in an opened or closed state.\n */\nlet AccordionItemPadding = class AccordionItemPadding extends web_component_1.KompisElement {\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t`;\n }\n};\nAccordionItemPadding = __decorate([\n (0, web_component_1.customElement)('kompis-accordion-item-padding')\n], AccordionItemPadding);\nexports.default = AccordionItemPadding;\n//# sourceMappingURL=AccordionItemPadding.js.map","import \"@inter-ikea-kompis/component-accordion/lib/components/accordion-item-padding/AccordionItemPadding\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisAccordionItemPadding extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-accordion-item-padding\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) { }\n updateAllEventListeners(element, props) { }\n}\nKompisAccordionItemPadding.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any\n};\nexport default KompisAccordionItemPadding;\n","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nlet Text = class Text extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // What type of text it is. e.g. bodyMedium, bodyLarge, bodyXLarge\n this.type = enums_1.ThemeFontStyleTypeEnum.bodyMedium;\n // Activate italic style\n this.italic = false;\n // Activate bold style\n this.bold = false;\n // Activate underline style\n this.underline = false;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n if (!this.theme) {\n return (0, web_component_1.html) ``;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t`;\n }\n};\n// A flag preventing the stylesheet to be added more than once\nText.hasAddedStylesheet = false;\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Text.prototype, \"type\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Text.prototype, \"italic\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Text.prototype, \"bold\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Text.prototype, \"underline\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Text.prototype, \"theme\", void 0);\nText = __decorate([\n (0, web_component_1.customElement)('kompis-text')\n], Text);\nexports.default = Text;\n//# sourceMappingURL=Text.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Text = void 0;\nconst Text_1 = __importDefault(require(\"./components/text/Text\"));\nexports.Text = Text_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Icon Svg Calculator Component.\n */\nclass IconSizeCalculator {\n /**\n * Calculate the actual size of the icon (in pixels).\n *\n * @param svgCode Code of the SVG.\n * @param baseSize\n * @returns Measurements object containing width and height.\n */\n static getMeasuredSize(svgCode, baseSize) {\n if (!svgCode) {\n return {\n width: 0,\n height: 0\n };\n }\n const viewboxSize = this.getSvgViewbox(svgCode);\n if (viewboxSize.width > baseSize || viewboxSize.height > baseSize) {\n if (viewboxSize.width > viewboxSize.height) {\n return {\n width: baseSize,\n height: baseSize * (viewboxSize.height / viewboxSize.width)\n };\n }\n else {\n return {\n width: baseSize * (viewboxSize.width / viewboxSize.height),\n height: baseSize\n };\n }\n }\n return {\n width: (baseSize * viewboxSize.width) / baseSize,\n height: (baseSize * viewboxSize.height) / baseSize\n };\n }\n /**\n * Rounds the value uppwards nearest number of decimals.\n *\n * @param value Value to round.\n * @param numberOfDecimals Number of decimals.\n * @returns The value rounded uppwards to closest number of decimals.\n */\n static round(value, numberOfDecimals = 2) {\n const factor = Math.pow(10, numberOfDecimals);\n return Math.round(value * factor) / factor;\n }\n /**\n * @param svgCode Code of the SVG.\n * @returns Viewbox of the svg code.\n */\n static getSvgViewbox(svgCode) {\n const htmlElement = document.createElement('div');\n htmlElement.innerHTML = svgCode;\n const svgElement = htmlElement.querySelector('svg');\n if (!svgElement) {\n throw new Error(`Failed to parse SVG. Invalid SVG code: ${svgCode}`);\n }\n return {\n width: svgElement.viewBox.baseVal.width,\n height: svgElement.viewBox.baseVal.height\n };\n }\n}\nexports.default = IconSizeCalculator;\n//# sourceMappingURL=IconSizeCalculator.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst IconSizeCalculator_1 = __importDefault(require(\"../../utilities/IconSizeCalculator\"));\n// The base size UX uses when designing icons\nconst BASE_SIZE = 24;\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n *\n * Icon component.\n */\nlet Icon = class Icon extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Flip the icon horizontally in RTL context\n this.flipIconRtl = false;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n if (!this.icon) {\n return null;\n }\n const { width, height } = IconSizeCalculator_1.default.getMeasuredSize(this.icon, BASE_SIZE);\n const direction = utilities_1.SafariWriteDirectionUtility.getWriteDirection(this);\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${(0, web_component_1.unsafeHTML)(this.icon.replace('= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst CollapsibleStyle_1 = __importDefault(require(\"./CollapsibleStyle\"));\n/**\n * This component collapse and open content with a transition.\n *\n * @event animationEnd When area has been fully expanded or fully collapsed\n */\nlet Collapsible = class Collapsible extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Open state. true => height 0. false => size of its content\n this.expanded = false;\n // If true, it will expand horizontally instead of vertically\n this.horizontal = false;\n this.isAnimationCompleted = true;\n this.listeners = {\n animationend: this.onAnimationEnd.bind(this)\n };\n this.elements = {\n slot: document.createElement('slot'),\n container: document.createElement('div'),\n style: document.createElement('style')\n };\n this.isRendered = false;\n }\n /**\n * @override\n */\n connectedCallback() {\n var _a, _b;\n super.connectedCallback();\n this.elements.container.classList.add('container');\n this.elements.container.appendChild(this.elements.slot);\n (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.appendChild(this.elements.style);\n (_b = this.shadowRoot) === null || _b === void 0 ? void 0 : _b.appendChild(this.elements.container);\n this.elements.container.addEventListener('animationend', this.listeners.animationend);\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.isRendered = false;\n this.removeEventListener('animationend', this.listeners.animationend);\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('expanded') && this.isRendered) {\n this.isAnimationCompleted = false;\n }\n if (changedProperties.has('expanded')) {\n this.elements.container.appendChild(this.elements.slot);\n }\n this.isRendered = true;\n this.updateStyles();\n return false;\n }\n /**\n * Update CSS code in the style tag.\n */\n updateStyles() {\n this.elements.style.innerHTML = CollapsibleStyle_1.default.getStyle({\n isAnimationCompleted: this.isAnimationCompleted,\n expanded: this.expanded,\n horizontal: this.horizontal,\n contentSize: this.horizontal\n ? this.elements.container.scrollWidth\n : this.elements.container.scrollHeight\n });\n }\n /**\n * Callback for animationend.\n */\n onAnimationEnd() {\n this.isAnimationCompleted = true;\n this.updateStyles();\n if (!this.expanded) {\n this.elements.container.removeChild(this.elements.slot);\n }\n this.dispatchEvent(new CustomEvent('animationEnd', { bubbles: true }));\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Collapsible.prototype, \"expanded\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Collapsible.prototype, \"horizontal\", void 0);\nCollapsible = __decorate([\n (0, web_component_1.customElement)('kompis-collapsible')\n], Collapsible);\nexports.default = Collapsible;\n//# sourceMappingURL=Collapsible.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Collapsible = void 0;\nconst Collapsible_1 = __importDefault(require(\"./components/collapsible/Collapsible\"));\nexports.Collapsible = Collapsible_1.default;\n//# sourceMappingURL=index.js.map","/**\n * Focus Visible Polyfill created for Skapa Web Components\n *\n * The advantage of this implementation compared to the well known 'focus-visible' package is\n * that it automatically penetrates the shadowDom by using the event's composedPath method.\n * It sets the 'focus-visible' class on the interactive element\n * which has been focused by keyboard navigation.\n *\n * It automatically detects if the 'focus-visible' polyfill has been loaded, and will not\n * interfere with its behaviour, by setting itself to `shadowDomOnly` mode.\n *\n * It can also be imported multiple times and will not create duplicate instances.\n *\n * This implementation will not set the \".focus-visible\" class on input elements and textareas\n * which have been interacted with via mouse.\n */\nconst INITIALIZED_FLAG = 'skapa-shadow-focus-feature';\n/** Helper flag, prevents multiple initialization. */\nlet inited = false;\n/** Helper flag, true if mouse is down. */\nlet isMouseDown = false;\n/** If true, the polyfill will only apply to elements within shadow doms. */\nlet shadowDomOnly = false;\n/** Stores if the last interaction with the page used keyboard. All focus events will be considered keyboard controlled as long as the value is true. */\nlet hadKeyboardEvent = false;\n// For testing and benchmarking\nlet listenerCount = 0;\nconst activeShadowDoms = [];\nfunction handleKey(event) {\n if (!(event.ctrlKey || event.altKey || event.metaKey)) {\n hadKeyboardEvent = true;\n if (event.type === 'keydown') {\n const target = event.composedPath()[0];\n if (['input', 'textarea'].includes(target.tagName.toLowerCase()) || target.hasAttribute('tabIndex') && target.tabIndex >= 0) {\n fVisible([target], true);\n }\n }\n }\n}\nfunction purgeAllFocus() {\n activeShadowDoms.map(ignoreFocusEvents);\n}\nfunction handleMouse(event) {\n hadKeyboardEvent = false;\n isMouseDown = event.type === 'pointerdown'; // pointerTypes.includes(event.type);\n purgeAllFocus();\n // The nested event listener chain has to be updated on pointer induced focus shift.\n const path = event.composedPath();\n const shadows = getShadowDomsFromChain(path[0]);\n shadows.map(listenForFocusEvents);\n}\nfunction fVisible(elements, on = true) {\n // add checks and conversions here\n if (elements) {\n elements.forEach(element => element.classList.toggle('focus-visible', on));\n }\n}\nfunction getShadowDomsFromChain(leafNode) {\n // the path will not point down to the document, only until the listener that catched it.\n // so we manually need to create the chain\n const result = []; // path.filter(element => (element.nodeType === 11) && (element !== document)) as Array;\n let leaf = leafNode;\n let shadow;\n while (((shadow = leaf.getRootNode()) !== document) && (shadow.nodeType === 11)) {\n result.push(shadow);\n leaf = shadow.host;\n }\n return result;\n}\nfunction listenForFocusEvents(shadow) {\n shadow.addEventListener('focusin', microHandleFocus);\n shadow.addEventListener('focusout', microHandleFocus);\n activeShadowDoms.push(shadow);\n listenerCount += 2;\n}\nfunction ignoreFocusEvents(shadow) {\n shadow.removeEventListener('focusin', microHandleFocus);\n shadow.removeEventListener('focusout', microHandleFocus);\n activeShadowDoms.splice(activeShadowDoms.indexOf(shadow), 1);\n listenerCount -= 2;\n}\n/** Called whenever there has been a focus shift dispatched.\n * However, focus shifts within a shadow DOM will not leave the shadowDom.\n * Which means that if a shadowDom has multiple interactive elements, the document event listener will never know.\n *\n * The solution is to add/remove an event listener to each shadowDom that connects the document with the nested (final) event target.\n */\nfunction handleFocus(event) {\n const eventChainTip = event.path[0];\n if (event.type === 'focusin') {\n // focusing in on new element\n const shadows = getShadowDomsFromChain(event.path[0]);\n const newShadows = shadows.filter(e => !activeShadowDoms.includes(e));\n const garbageShadows = activeShadowDoms.filter(e => !shadows.includes(e));\n // This removes the out of scope listeners created in the previous focus-in.\n garbageShadows.map(ignoreFocusEvents);\n // Adds listeners to the shadowDoms that are part of the new branch\n newShadows.map(listenForFocusEvents);\n // Note: Do not merge this condition with the parent condition.\n if (hadKeyboardEvent && !isMouseDown) {\n // show focus visible\n if ((shadowDomOnly && shadows.length) // if it is in shadowDomOnly mode then it checks if the tip of the event chain is inside at least one shadowDom.\n || !shadowDomOnly // Or if it is not shadowDomOnly mode.\n )\n fVisible([eventChainTip], true); // Then apply the `focus-visible` class.\n }\n }\n else {\n // focusing out\n // remove focus visible form the current\n fVisible([eventChainTip], false);\n // The listeners will be managed on the new focusin, unless there is no new focusin.\n if (!event.relatedTarget) {\n // no new focus, remove all listeners except root;\n purgeAllFocus();\n }\n }\n}\n// Non debouncing micro wrapper\nconst micro = (callback) => (event) => {\n // Potentially some checks needs to be made to ignore focus events artifically dispatched by non DOM elements.. Not even sure if its possible\n // Need to save the event path and some details as they might not be available later.\n const duplicateEvent = { relatedTarget: event.relatedTarget, target: event.target, type: event.type, path: event.composedPath() };\n setTimeout(() => callback(duplicateEvent));\n};\nconst microHandleFocus = micro(handleFocus);\nexport default function applyFocusVisible(listenerBase) {\n // TODO: Add a test if the environment supports :focus-visible, then probably do nothing.\n // However, need to check how :focus-visible behaves with custom elements.\n // Does the :host also get the pseudo class or only the interactive element?\n // If already initalized then do nothing;\n if (inited)\n return;\n // If focus-visible polyfill is present in the document then just extend the feature into the shadowDom;\n if ((typeof window !== 'undefined') && window.hasOwnProperty('applyFocusVisiblePolyfill'))\n shadowDomOnly = true;\n if (!shadowDomOnly) {\n window.addEventListener('focus-visible-polyfill-ready', // Based on: https://github.com/WICG/focus-visible#lazy-loading\n () => shadowDomOnly = true, // Make sure that the tool sets itself to complementary mode if the conventional polyfill is loaded.\n { once: true });\n }\n listenerBase = listenerBase || document.documentElement; // Potentially need to check with some SSR render environments\n // This polyfill has been already loaded from a different source. Exit\n if (listenerBase.hasAttribute(INITIALIZED_FLAG))\n return;\n // Register key state\n listenerBase.addEventListener('keydown', handleKey);\n listenerBase.addEventListener('keyup', handleKey);\n // Register mouse or input state, pointer interaction will clear all focus visible class declarations additions.\n listenerBase.addEventListener('pointerdown', handleMouse);\n listenerBase.addEventListener('pointerup', handleMouse);\n listenerBase.addEventListener('drag', handleMouse); // required to disable on accidental drag events that may not fire pointerup properly.\n // These needs to be wrapped inside micro tasks to synchronise keyboard state check when calling `.focus()` before the keydown listener triggers here.\n listenerBase.addEventListener('focusin', microHandleFocus);\n listenerBase.addEventListener('focusout', microHandleFocus);\n if (!listenerBase.toggleAttribute) {\n // Some virtual environments don't support toggleAttribute\n listenerBase.toggleAttribute = (qualifiedName, force) => {\n if (force)\n listenerBase === null || listenerBase === void 0 ? void 0 : listenerBase.setAttribute(qualifiedName, '');\n else\n listenerBase === null || listenerBase === void 0 ? void 0 : listenerBase.removeAttribute(qualifiedName);\n return Boolean(force);\n };\n }\n // Mark as initialized\n listenerBase.toggleAttribute(INITIALIZED_FLAG, true);\n listenerBase.classList.add('js-focus-visible'); // This will enable compatiblity with styles targeted for the `focus-visible` package.\n inited = true;\n}\n","/**\n * An instance of a CachedValue is able to store an otherwise expensive calculation result until the user marks it ready for update.\n * To use, create a function the yields the cacheable value:\n * function valueGetterFunction() {\n * // some expensive calculation\n * return resultOfExpensiveCalculation;\n * }\n *\n * // and create an instance of CachedValue with the calculation function passed to its constructor.\n * const myCachedValue = new CachedValue(valueGetterFunction);\n *\n * // To get the value\n * myCachedValue.value;\n *\n * // To refresh the cached value, in case the stored value is likely outdated:\n * myCachedValue.updateCache = true;\n */\nclass CachedValue {\n constructor(refresh) {\n this.updateCache = true;\n this.refresh = refresh;\n }\n get value() {\n if (this.updateCache || this.__value === undefined) {\n this.__value = this.refresh();\n this.updateCache = false;\n }\n return this.__value;\n }\n}\nexport default CachedValue;\n","const attachShadowCache = HTMLElement.prototype.attachShadow;\nconst focusCache = HTMLElement.prototype.focus;\nexport const applyDelegateFocusPolyfill = () => {\n var _a, _b, _c;\n if ((_c = (_b = (_a = document.createElement('div')).attachShadow) === null || _b === void 0 ? void 0 : _b.call(_a, { mode: 'open', delegatesFocus: true })) === null || _c === void 0 ? void 0 : _c.delegatesFocus)\n return; // browser support or already applied, no need to apply.\n // Some JS Dom environments (used for testing) have limited features. Seems best to disable the polyfill in these cases\n if ((typeof attachShadowCache !== 'function') || (typeof focusCache !== 'function'))\n return;\n // Need to extend the prototype\n Object.defineProperty(HTMLElement.prototype, 'attachShadow', {\n value(shadowConfig) {\n const shadowRoot = attachShadowCache.bind(this)(shadowConfig);\n if (shadowConfig.delegatesFocus === true) {\n // @ts-expect-error 2540. delegatesFocus override.\n shadowRoot.delegatesFocus = true;\n // Override focus behaviour if delegateFocus is set to true\n this.focus = () => {\n var _a;\n focusCache.bind(this)();\n (_a = shadowRoot.querySelector('button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])')) === null || _a === void 0 ? void 0 : _a.focus();\n };\n }\n return shadowRoot;\n }\n });\n};\n","/**\n * Polyfill created for the Element.toggleAttribute feature.\n * https://developer.mozilla.org/en-US/docs/Web/API/Element/toggleAttribute\n *\n * The feature is well supported by the target browsers however many JSDOM environments still do not support it\n * To prevent\n *\n */\nexport function applyToggleAttributePolyFill() {\n if (!('toggleAttribute' in Element.prototype)) {\n // Legacy environment, load toggleAttribute polyfill.\n Element.prototype.toggleAttribute = function (attributeName, forceValue) {\n if (typeof forceValue === 'undefined') {\n if (this.hasAttribute(attributeName))\n this.removeAttribute(attributeName);\n else\n this.setAttribute(attributeName, '');\n }\n else if (forceValue)\n this.setAttribute(attributeName, '');\n else\n this.removeAttribute(attributeName);\n return this.hasAttribute(attributeName);\n };\n }\n}\n","export function isRTL(scope) {\n if (typeof window === 'undefined')\n return false;\n if (!scope)\n scope = document.documentElement;\n return window.getComputedStyle(scope).direction === 'rtl';\n}\n","const listeners = new Set();\nlet reportActive = false;\nlet lastReport = Date.now();\nfunction reportResize() {\n // The listeners will be called with the single boolean parameter reporting if the resizing is assumed finished.\n listeners.forEach(listener => listener(!reportActive));\n}\nconst MIN_REPORT_INTERVAL = 100; // min 100ms ~ max 10fps\nfunction resizeReporterThread() {\n if (Date.now() - lastReport >= MIN_REPORT_INTERVAL) {\n reportResize();\n lastReport = Date.now();\n }\n else if (!reportActive) {\n // Make sure to report that the resize process has probably finished.\n reportResize();\n }\n if (reportActive)\n requestAnimationFrame(resizeReporterThread);\n}\nlet debounceID = -1;\nfunction handleResizeEvent() {\n clearTimeout(debounceID);\n if (!reportActive)\n requestAnimationFrame(resizeReporterThread);\n reportActive = true;\n debounceID = window.setTimeout(() => reportActive = false, MIN_REPORT_INTERVAL * 2); // Stop reporting.\n}\nexport function addResizeListener(listener) {\n if (listeners.has(listener))\n return;\n if (listeners.size === 0)\n window.addEventListener('resize', handleResizeEvent);\n listeners.add(listener);\n}\nexport function removeResizeListener(listener) {\n if (!listeners.has(listener))\n return;\n listeners.delete(listener);\n if (listeners.size === 0)\n window.removeEventListener('resize', handleResizeEvent);\n}\n","import { isRTL } from './isRTL.js';\nconst targets = new Set();\nconst queuedTargets = new Set();\nfunction processQueue() {\n queuedTargets.forEach(updateTarget);\n queuedTargets.clear();\n}\nexport function addTarget(target, immediateEvaluation = false) {\n if (immediateEvaluation) {\n // If the `skapa-rtl` attribute needs to set before the first render. For example an animation is triggered immediately.\n updateTarget(target);\n }\n else {\n // Let's wait for the stack to finish configuring the elements and their styles before determining the writing direction of the target.\n queuedTargets.add(target);\n if (queuedTargets.size === 1) {\n queueMicrotask(processQueue);\n }\n }\n targets.add(target);\n}\nexport function removeTarget(target) {\n target.removeAttribute('skapa-rtl');\n targets.delete(target);\n}\nfunction updateTarget(target) {\n target.toggleAttribute('skapa-rtl', isRTL(target));\n}\nlet notificationDebounceID = -1;\nexport function notifyListeners() {\n // debounce the update as there may be multiple observers in the dom triggering this function\n cancelAnimationFrame(notificationDebounceID);\n notificationDebounceID = requestAnimationFrame(() => {\n Array.from(targets).map(updateTarget);\n });\n}\n","// Should be called in constructor after super()\nexport function gatherProperties(propertyList, host) {\n const ownProperties = Object.getOwnPropertyNames(host); // list of property names that have been defined on the instance and not inherited.\n propertyList.forEach(propertyName => {\n const hasPreInitValue = ownProperties.includes(propertyName.toString());\n // if a watched property name has a pre-initialization value.\n if (hasPreInitValue) {\n if (host.preDefinitionProperties === undefined)\n host.preDefinitionProperties = {};\n // then save the value on a cache object and apply it again in the `initGatheredProperties`.\n host.preDefinitionProperties[propertyName] = host[propertyName];\n delete host[propertyName];\n }\n });\n}\n// Should be called in connectedCallback() (after super() if super exists).\nexport function initGatheredProperties(host) {\n if (host.preDefinitionProperties) {\n // By this time the setters have been initialized so the component can react according to its preinit properties.\n Object.assign(host, host.preDefinitionProperties);\n // Clean up.\n delete host.preDefinitionProperties;\n }\n}\n","import { config } from '@ingka/webc-tools';\n// This pattern will find each 'skapa-' that are not preceeded by \"-\" (to ignore css variables) and not preceeded by \"[\" (to ignore attribute names).\nconst pattern = /(?:([^-\\[\\.])|^)skapa-/g;\nexport function prefixReplacer(rawHTML) {\n return rawHTML.replace(pattern, `$1${config.prefix}-`);\n}\n","function anyAssignedElements(slot) {\n return slot.assignedElements({ flatten: true }).length > 0;\n}\nfunction anyNonEmptyTextAssigned(slot) {\n const temp = slot\n .assignedNodes({ flatten: true }) // all assigned nodes\n .filter(node => node.nodeType === 3) // all text nodes\n .filter(node => { var _a; return (_a = node.nodeValue) === null || _a === void 0 ? void 0 : _a.trim(); }); // Not sure about this one, but it is meant to remove tabs and new lines of html formatting.\n return temp\n .length > 0;\n}\nexport function checkSlot(slot) {\n slot.classList.toggle('skapa-empty', !(anyAssignedElements(slot) || anyNonEmptyTextAssigned(slot)) // if there are assigned elements or non empty text then its NOT empty.\n );\n}\nexport function slotChange(event) {\n const slot = event.target;\n checkSlot(slot);\n}\n","export const breakpoints = {\n m: '37.5em',\n l: '56.25em',\n xl: '75em'\n};\nconst listeners = new Set();\nlet initialized = false;\nlet mediaRules;\nconst createRules = () => {\n if (initialized || typeof window === 'undefined')\n return; // SSR without proper JSDOM environment\n mediaRules = {\n md: window.matchMedia(`(min-width: ${breakpoints.m})`),\n lg: window.matchMedia(`(min-width: ${breakpoints.l})`),\n xl: window.matchMedia(`(min-width: ${breakpoints.xl})`),\n portrait: window.matchMedia('(orientation: portrait)')\n };\n initialized = true;\n};\nlet breakpoint = 'sm';\nlet orientation = 'portrait';\nfunction handleBreakpointChange() {\n if (!initialized)\n return;\n let newBreakpoint = 'sm';\n let newOrientation = 'portrait';\n if (mediaRules.xl.matches)\n newBreakpoint = 'xl';\n else if (mediaRules.lg.matches)\n newBreakpoint = 'lg';\n else if (mediaRules.md.matches)\n newBreakpoint = 'md';\n newOrientation = (mediaRules.portrait.matches) ? 'portrait' : 'landscape';\n if (newBreakpoint !== breakpoint || newOrientation !== orientation) {\n breakpoint = newBreakpoint;\n orientation = newOrientation;\n listeners.forEach(listener => listener(breakpoint, orientation));\n }\n}\nconst addBreakpointListeners = () => {\n if (!initialized)\n initializeRules();\n Object.values(mediaRules).forEach(rule => typeof mediaRules.md.addEventListener === 'function'\n ? rule.addEventListener('change', handleBreakpointChange)\n : rule.addListener(handleBreakpointChange) // Safari v13 Fallback\n );\n};\nconst removeBreakpointListeners = () => {\n Object.values(mediaRules).forEach(rule => typeof mediaRules.md.removeEventListener === 'function'\n ? rule.removeEventListener('change', handleBreakpointChange)\n : rule.removeListener(handleBreakpointChange) // Safari v13 Fallback\n );\n};\nexport function addBreakpointListener(listener) {\n if (listeners.has(listener))\n return;\n if (listeners.size === 0) {\n addBreakpointListeners();\n }\n listeners.add(listener);\n}\nexport function removeBreakpointListener(listener) {\n if (!listeners.has(listener))\n return;\n listeners.delete(listener);\n if (listeners.size === 0)\n removeBreakpointListeners();\n}\nfunction initializeRules() {\n if (!initialized) {\n createRules();\n handleBreakpointChange();\n }\n}\nexport function getCurrentBreakpoint() {\n if (!initialized)\n initializeRules();\n return breakpoint;\n}\nexport function getCurrentOrientation() {\n if (!initialized)\n initializeRules();\n return orientation;\n}\n","export { default as stringAttribute } from './src/features/stringAttribute.js';\nimport { default as focusVisiblePoly } from './src/features/focus-visible-poly.js';\nexport { default as CachedValue } from './src/features/cachedValue.js';\nimport { applyDelegateFocusPolyfill } from './src/features/delegateFocusPolyfill.js';\nimport { applyToggleAttributePolyFill } from './src/features/toggleAttributePolyfill.js';\nexport { isRTL } from './src/features/isRTL.js';\nimport * as ResizeListener_1 from './src/features/resizeListener.js';\nexport { ResizeListener_1 as ResizeListener };\nimport * as RTLObserver_1 from './src/features/rtlObserver.js';\nexport { RTLObserver_1 as RTLObserver };\nimport * as PredefinitionPropertyHandler_1 from './src/features/preDefinitionProperties.js';\nexport { PredefinitionPropertyHandler_1 as PredefinitionPropertyHandler };\nexport { prefixReplacer } from './src/features/prefixReplacer.js';\nimport * as SlotTools_1 from './src/features/evaluateSlot.js';\nexport { SlotTools_1 as SlotTools };\nimport * as BreakpointInfo_1 from './src/features/breakpointInfo.js';\nexport { BreakpointInfo_1 as BreakpointInfo };\n/**\n * This file provides the infrastructure for a custom prefixed custom element component library.\n * It aims to ensure that the correct customised tag names are registered.\n */\nconst DEFAULT_PREFIX = 'skapa';\n// Lookup map, custom element class => custom clement tagname\nconst tagNames = new Map();\nconst requestQueue = new Array();\n/**\n * Skapa custom elements shared configuration object.\n * It's main feature is helping custom element tag name prefix management.\n */\nexport const config = {\n __inited: false,\n __prefixSet: false,\n __prefix: DEFAULT_PREFIX,\n get prefix() {\n this.__inited = true;\n return this.__prefix;\n },\n set prefix(val) {\n if (this.__inited && this.__prefix !== val)\n console.error('Skapa Web components tag prefix was set after init!\\nMake sure to set the prefix **before** initialising any of the skapa web components');\n this.__prefix = val;\n this.__prefixSet = true;\n // Prefix is set, let process the request que:\n requestQueue.forEach(registerSkapaElement);\n requestQueue.length = 0; // reset Que\n }\n};\n/**\n * Registers tag name in the hosts Custom Elements Registry.\n */\nfunction registerSkapaElement({ tag, skapaElementClass }) {\n const tagName = `${config.prefix}-${tag}`;\n if (typeof window !== 'undefined') {\n const defined = customElements.get(tagName);\n if (defined) {\n if (defined !== skapaElementClass) {\n // TODO, better way to handle this?\n console.error(`Skapa Web Component!\\n\"${tagName}\": Different versions using the same name. Please set a unique prefix!`);\n }\n }\n else {\n customElements.define(tagName, skapaElementClass);\n tagNames.set(skapaElementClass, tagName);\n }\n }\n else {\n // TODO: No SSR Environment?\n }\n return tagName;\n}\n/**\n * Skapa custom element register request, the request will be processed once the prefix is set.\n *\n * @export\n * @param {string} tag\n * @param {CustomElementConstructor} skapaElementClass\n * @return {*} {()=>string}\n */\nexport default function requestRegister(tag, skapaElementClass) {\n if (config.__prefixSet) {\n registerSkapaElement({ tag, skapaElementClass });\n }\n else {\n requestQueue.push({ tag, skapaElementClass });\n }\n // Return a function that provides the final registered tag name. Assuming it is called after the initalization phase\n return () => getTagFor(skapaElementClass);\n}\n/**\n * Helper tool to provide better debug experience with custom element registry.\n * @param customElementConstructor\n * @returns prefixed custom element tag name\n */\nexport function getTagFor(customElementConstructor) {\n if (!config.__prefixSet) {\n console.error('Requested custom element tag name before the custom prefix was set.\\nMake sure the prefix is set in the configuration prior.');\n }\n const tagName = tagNames.get(customElementConstructor);\n if (!tagName) {\n console.error(`Requesting tag name for an unregistered custom element!\\nMake sure you register the element: ${customElementConstructor.name} before using it.`);\n // probably throw error?\n }\n return tagName || '';\n}\n/**\n * Apply polyfills on load\n */\napplyDelegateFocusPolyfill();\napplyToggleAttributePolyFill();\nfocusVisiblePoly();\n// Microtask: Auto fallback to default prefix, for environments that don't need custom prefix\nsetTimeout(() => {\n if (!config.__prefixSet) {\n config.prefix = DEFAULT_PREFIX;\n }\n});\n","import { PredefinitionPropertyHandler } from '@ingka/webc-tools';\nconst DEFAULT_TASK_ID = '__skapa_default_task';\nexport default class SkapaElement extends HTMLElement {\n constructor() {\n super(...arguments);\n this.tasks = new Map();\n this.__updateTaskID = -1;\n this.gatherProperties = PredefinitionPropertyHandler.gatherProperties;\n this.initGatheredProperties = PredefinitionPropertyHandler.initGatheredProperties;\n this.micro = (task, taskName = DEFAULT_TASK_ID, delay) => {\n if (typeof window !== 'undefined') {\n clearTimeout(this.tasks.get(taskName));\n this.tasks.set(taskName, window.setTimeout(task, delay));\n }\n };\n }\n connectedCallback() {\n this.initGatheredProperties(this);\n }\n disconnectedCallback() {\n if (typeof window !== 'undefined') {\n this.tasks.forEach(taskID => window.clearTimeout(taskID));\n this.tasks.clear();\n }\n }\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getStore = void 0;\nconst storeCollection = new Map();\n// This is the ensure that the storeCollection won't get overridden or manipulated.\nfunction getStore(storeName, initialValue) {\n // Initialize if its not available yet.\n if (!storeCollection.get(storeName)) {\n storeCollection.set(storeName, initialValue || new Map());\n }\n return storeCollection.get(storeName);\n}\nexports.getStore = getStore;\n","import { getStore } from '@ingka/singleton-store';\nconst ICON_STORE_ID = 'skapa-icon-store';\n// The store will be initialized with a generic Map inside the getStore on first request.\nconst iconStore = getStore(ICON_STORE_ID);\nexport const registerIcon = (name, paths) => {\n if (!iconStore.has(name))\n iconStore.set(name, paths);\n};\nexport const getPaths = (name) => {\n if (!name)\n return;\n const result = iconStore.get(name);\n if (!result)\n console.error(`The icon: '${name}' has not been loaded yet!\\nDid you forget to import '@ingka/icon-store/${name}'?`);\n return result;\n};\n","import { getPaths } from '@ingka/icon-store';\nconst SVGNS = 'http://www.w3.org/2000/svg';\nexport function svgNodeRenderer(nodes) {\n if (!nodes)\n return;\n return nodes.map(node => {\n const res = document.createElementNS(SVGNS, node.tag);\n Object.keys(node.att).map(attrName => res.setAttribute(attrName, node.att[attrName]));\n const children = svgNodeRenderer(node.nds);\n if (children === null || children === void 0 ? void 0 : children.length)\n res.append(...children);\n return res;\n });\n}\nexport function renderIconDOM(icon) {\n return svgNodeRenderer(getPaths(icon));\n}\n","import SkapaElement from '@ingka/skapa-webc-element';\n// @ts-ignore\nconst styles = ':host{--skapa-icon-rotate:0deg;display:inline-block;height:1.5rem;transform:rotate(var(--skapa-icon-rotate));transition-duration:.25s;transition-property:fill;transition-timing-function:cubic-bezier(.4,0,.4,1);vertical-align:middle;width:1.5rem}:host ::slotted(svg),:host svg{fill:currentColor;max-height:100%;max-width:100%}:host svg{display:none}:host([icon]) svg{display:unset}:host([icon]) slot{display:none}:host([rotate]){transition-property:transform,fill}:host([skapa-rtl][flip-rtl]) ::slotted(svg),:host([skapa-rtl][flip-rtl]) svg{transform:scaleX(-1)}@media (prefers-reduced-motion){:host([rotate]){transition-property:none}}:host([rotate=\"45\"]){--skapa-icon-rotate:45deg}:host([rotate=\"-45\"]){--skapa-icon-rotate:-45deg}:host([rotate=\"-135\"]){--skapa-icon-rotate:-135deg}:host([rotate=\"135\"]){--skapa-icon-rotate:135deg}:host([rotate=\"180\"]){--skapa-icon-rotate:180deg}:host([rotate=\"-180\"]){--skapa-icon-rotate:-180deg}:host([rotate=loop]){animation:icon-rotate 1.5s linear infinite}@keyframes icon-rotate{0%{transform:rotate(0deg)}to{transform:rotate(359deg)}}';\nimport { getPaths } from '@ingka/icon-store';\nimport { RTLObserver } from '@ingka/webc-tools';\nimport { svgNodeRenderer } from './tools/svg-renderer.js';\nconst stylesTemplate = document.createElement('template');\nstylesTemplate.innerHTML = ``;\nconst svgTemplate = document.createElement('template');\nsvgTemplate.innerHTML = '';\nexport class Icon extends SkapaElement {\n constructor() {\n super();\n this.__paths = [];\n this.updatePaths = () => {\n this.paths = getPaths(this.icon);\n };\n this.render = () => {\n const paths = svgNodeRenderer(this.__paths); // don't rerender if it's rendered and the same\n this.__svg.innerHTML = '';\n if (paths)\n this.__svg.append(...paths);\n };\n this.gatherProperties(['paths', 'flipRTL', 'icon', 'viewBox'], this); // Manages inherited pre-definition properties.\n const shadow = this.attachShadow({ mode: 'open' });\n shadow.append(stylesTemplate.content.cloneNode(true), svgTemplate.content.cloneNode(true));\n this.__svg = shadow.querySelector('svg');\n }\n get paths() {\n return this.__paths;\n }\n set paths(val) {\n if (val !== this.__paths && Array.isArray(val)) {\n this.__paths = val || [];\n if (this.isConnected)\n this.micro(this.render, 'skapa-icon-render');\n }\n }\n get icon() {\n return this.getAttribute('icon');\n }\n set icon(name) {\n if (name)\n this.setAttribute('icon', name);\n else\n this.removeAttribute('icon');\n }\n get flipRTL() {\n return this.hasAttribute('flip-rtl');\n }\n set flipRTL(value) {\n this.toggleAttribute('flip-rtl', !!value);\n }\n /**\n * Warning! This is an internal feature, it's not meant to be used by the user.\n * The implementation may change without notice!\n * @param val - The value to set as the viewBox attribute.\n */\n set viewBox(val) {\n this.__svg.setAttribute('viewBox', val);\n }\n get viewBox() {\n return this.__svg.getAttribute('viewBox') || '';\n }\n attributeChangedCallback(attrName) {\n if (!this.isConnected)\n return; // Any work that's done here will be done again when the component is connected.\n if (attrName === 'icon')\n this.updatePaths();\n if (attrName === 'flip-rtl') {\n if (this.flipRTL)\n RTLObserver.addTarget(this);\n else\n RTLObserver.removeTarget(this);\n }\n }\n // This feature ensures that the clonded node will display the icon as well\n cloneNode(deep) {\n const clone = super.cloneNode(deep);\n clone.paths = this.paths;\n return clone;\n }\n connectedCallback() {\n super.connectedCallback();\n if (!this.hasAttribute('aria-hidden') && !this.ariaHidden) {\n this.setAttribute('aria-hidden', 'true');\n }\n if (this.icon)\n this.updatePaths();\n if (this.flipRTL)\n RTLObserver.addTarget(this);\n this.render();\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n RTLObserver.removeTarget(this);\n }\n}\nIcon.observedAttributes = ['icon', 'flip-rtl'];\nexport default Icon;\n","import define from '@ingka/webc-tools';\nimport Icon from './src/Icon.js';\nimport { renderIconDOM } from './src/tools/svg-renderer.js';\nexport { Icon, renderIconDOM };\nexport const iconTagName = define('icon', Icon);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getPaths = exports.registerIcon = void 0;\nconst singleton_store_1 = require(\"@ingka/singleton-store\");\nconst ICON_STORE_ID = 'skapa-icon-store';\n// The store will be initialized with a generic Map inside the getStore on first request.\nconst iconStore = (0, singleton_store_1.getStore)(ICON_STORE_ID);\nconst registerIcon = (name, paths) => {\n if (!iconStore.has(name))\n iconStore.set(name, paths);\n};\nexports.registerIcon = registerIcon;\nconst getPaths = (name) => {\n if (!name)\n return;\n const result = iconStore.get(name);\n if (!result)\n console.error(`The icon: '${name}' has not been loaded yet!\\nDid you forget to import '@ingka/icon-store/${name}'?`);\n return result;\n};\nexports.getPaths = getPaths;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('chevron-down-small', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'm12.0003 15.5996-5.7857-5.785 1.414-1.4143 4.3717 4.3711 4.3717-4.3711 1.4141 1.4143-5.7858 5.785z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AccordionItemAriaDisabledEnum;\n(function (AccordionItemAriaDisabledEnum) {\n AccordionItemAriaDisabledEnum[\"true\"] = \"true\";\n AccordionItemAriaDisabledEnum[\"false\"] = \"false\";\n})(AccordionItemAriaDisabledEnum || (AccordionItemAriaDisabledEnum = {}));\nexports.default = AccordionItemAriaDisabledEnum;\n//# sourceMappingURL=AccordionItemAriaDisabledEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst MIN_HEIGHT = 88;\n/**\n * A class with style.\n */\nclass AccordionItemStyle {\n /**\n * Returns styles.\n *\n * @param options The props.\n * @param options.showOutline Show outline.\n * @param options.expanded Open state.\n * @param options.accordionLayout Layout state.\n * @param options.theme Theme.\n * @param options.disabled\n * @returns Styles.\n */\n static getStyle(options) {\n const { color, spacing, focusOutline, motion } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t\tborder-width: ${1 / 16}rem;\n\t\t\t\tborder-top-style: solid;\n\t\t\t\tborder-color: ${options.disabled ? color.disabled.default : color.border.light};\n\t\t\t}\n\t\t\t:host(:last-of-type) {\n\t\t\t\tborder-bottom-style: solid;\n\t\t\t}\n\t\t\tbutton {\n\t\t\t\t/* Disable user agent styling */\n\t\t\t\tbackground: none;\n\t\t\t\toutline: none;\n\t\t\t\tborder: none;\n\t\t\t\tbox-shadow: none;\n\t\t\t\tposition: relative;\n\t\t\t\ttext-align: initial;\n\t\t\t\twidth: 100%;\n\t\t\t\tpadding: ${spacing.space150 / 16}rem ${this.getPadding(options) / 16}rem;\n\t\t\t\tmin-height: ${MIN_HEIGHT / 16}rem;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: space-between;\n\t\t\t\tcolor: ${options.disabled ? color.disabled.default : color.text.dark};\n\t\t\t}\n\t\t\tbutton::-moz-focus-inner {\n\t\t\t\tborder: 0;\n\t\t\t}\n\t\t\t.outline {\n\t\t\t\tposition: absolute;\n\t\t\t\tpointer-events: none;\n\t\t\t\topacity: 0;\n\t\t\t\ttransition-duration: ${focusOutline.transitionTime}s;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\tright: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\ttransition-property: opacity, top, left, right, bottom;\n\t\t\t\tborder-radius: ${focusOutline.borderRadius}px;\n\t\t\t\tbox-shadow: 0 0 0 ${focusOutline.width}px ${focusOutline.color};\n\t\t\t}\n\t\t\tbutton.focus-visible .outline {\n\t\t\t\topacity: 1;\n\t\t\t\ttop: -${focusOutline.offset / 16}rem;\n\t\t\t\tleft: -${focusOutline.offset / 16}rem;\n\t\t\t\tright: -${focusOutline.offset / 16}rem;\n\t\t\t\tbottom: -${focusOutline.offset / 16}rem;\n\t\t\t}\n\t\t\tbutton:hover {\n\t\t\t\tcursor: ${options.disabled ? 'initial' : 'pointer'};\n\t\t\t}\n\t\t\t@media (pointer: fine) {\n\t\t\t\tbutton:hover .header {\n\t\t\t\t\ttext-decoration: ${options.disabled ? 'inital' : 'underline'};\n\t\t\t\t}\n\t\t\t}\n\t\t\t.textContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\t\t\t.spacing {\n\t\t\t\twidth: ${spacing.space50 / 16}rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t}\n\t\t\t.icon {\n\t\t\t\ttransform: rotate(${options.expanded ? '180deg' : '0deg'});\n\t\t\t\ttransition: transform ${motion.duration.medium} ${motion.ease.easy};\n\t\t\t\ttransition-duration: ${motion.duration.medium};\n\t\t\t\tcolor: ${options.disabled ? color.disabled.default : color.icon.default};\n\t\t\t}\n\t\t\t::slotted(kompis-accordion-item-padding) {\n\t\t\t\tdisplay: block;\n\t\t\t\tpadding: ${spacing.space150 / 16}rem ${this.getPadding(options) / 16}rem;\n\t\t\t}\n\t\t\t${this.getRtlRules(options)}\n\t\t`;\n }\n /**\n * Returns styles.\n *\n * @param options The props.\n * @param options.accordionLayout Layout state.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getPadding(options) {\n if (options.noHorizontalPadding) {\n return 0;\n }\n return options.theme.spacing.space150;\n }\n /**\n * Returns styles.\n *\n * @param options The props.\n * @param options.accordionLayout Layout state.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getRtlRules(options) {\n if (!options.expanded) {\n return (0, web_component_1.css) ``;\n }\n // I don't think these are needed. The icon is vertically symmetrical and the the selectors do not cover all browsers.\n return (0, web_component_1.css) `\n\t\t\t:host(:dir(rtl)) .icon {\n\t\t\t\ttransform: rotate(-180deg);\n\t\t\t}\n\t\t\t:host-context([dir='rtl']) .icon {\n\t\t\t\ttransform: rotate(-180deg);\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = AccordionItemStyle;\n//# sourceMappingURL=AccordionItemStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@inter-ikea-kompis/component-icon\");\nrequire(\"@inter-ikea-kompis/component-collapsible\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/icon-store/chevron-down-small\");\nconst AccordionItemAriaDisabledEnum_1 = __importDefault(require(\"../../enums/AccordionItemAriaDisabledEnum\"));\nconst AccordionItemStyle_1 = __importDefault(require(\"./AccordionItemStyle\"));\n/**\n * Component that can render in an opened or closed state.\n *\n * @event expand Emits when clicking on the accordion item\n */\nlet AccordionItem = class AccordionItem extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // The title of the accordion item\n this.label = null;\n // The caption of the accordion item\n this.caption = null;\n // Removes horizontal padding\n this.noHorizontalPadding = false;\n // Expands the accordion item and reveals the content within the slot\n this.expanded = false;\n // Should be set to true when an expanded accordion item is not allowed to be minimized again until another item is expanded, in which case the previous item, now minimized, should be set to false and the current expanded item should now be set to true\n this.ariaDisabled = AccordionItemAriaDisabledEnum_1.default.false;\n // Disables you from interacting with the accordion item\n this.disabled = false;\n this.accordionUniqueId = new utilities_1.IdGenerator().generateId();\n this.collapsibleUniqueId = new utilities_1.IdGenerator().generateId();\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t this.dispatchEvent(new CustomEvent('expand', { bubbles: true, detail: { expanded: !this.expanded } }))}\n\t\t\t>\n\t\t\t\t
\n\t\t\t\t\t${this.label}\n\t\t\t\t\t${this.getCaption()}\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n /**\n * When focusing the accordion item the button should receive the focus.\n */\n focus() {\n var _a, _b;\n (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('button')) === null || _b === void 0 ? void 0 : _b.focus();\n }\n getCaption() {\n if (!this.caption) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t${this.caption}\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], AccordionItem.prototype, \"label\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], AccordionItem.prototype, \"caption\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], AccordionItem.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], AccordionItem.prototype, \"noHorizontalPadding\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], AccordionItem.prototype, \"expanded\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], AccordionItem.prototype, \"ariaDisabled\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], AccordionItem.prototype, \"disabled\", void 0);\nAccordionItem = __decorate([\n (0, web_component_1.customElement)('kompis-accordion-item')\n], AccordionItem);\nexports.default = AccordionItem;\n//# sourceMappingURL=AccordionItem.js.map","import \"@inter-ikea-kompis/component-accordion/lib/components/accordion-item/AccordionItem\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisAccordionItem extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-accordion-item\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.ariaDisabled = props.ariaDisabled;\n element.caption = props.caption;\n element.disabled = props.disabled;\n element.expanded = props.expanded;\n element.label = props.label;\n element.noHorizontalPadding = props.noHorizontalPadding;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onExpand, \"expand\");\n }\n}\nKompisAccordionItem.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n ariaDisabled: PropTypes.string,\n caption: PropTypes.string,\n disabled: PropTypes.bool,\n expanded: PropTypes.bool,\n label: PropTypes.string,\n noHorizontalPadding: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n onExpand: PropTypes.func\n};\nexport default KompisAccordionItem;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\n/**\n * A class with style.\n */\nclass AccordionStyle {\n /**\n * Returns styles.\n *\n * @param options The props.\n * @returns Styles.\n */\n static getStyle() {\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = AccordionStyle;\n//# sourceMappingURL=AccordionStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst AccordionStyle_1 = __importDefault(require(\"./AccordionStyle\"));\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n *\n * Component that renders a list of {AccordionItem}.\n */\nlet Accordion = class Accordion extends web_component_1.KompisElement {\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
this.onKeyDown(event)}\">\n\t\t\t\t\n\t\t\t
\n\t\t`;\n }\n /**\n * When key down.\n *\n * @param event Keyboard event.\n */\n onKeyDown(event) {\n var _a, _b;\n if (event.target.tagName.toLowerCase() === 'kompis-accordion-item') {\n const accordionItem = Array.from(this.querySelectorAll('kompis-accordion-item'));\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n this.changeButtonFocus(+1);\n break;\n case 'ArrowUp':\n event.preventDefault();\n this.changeButtonFocus(-1);\n break;\n case 'Home':\n // Focus the first AccordionItem\n event.preventDefault();\n (_a = accordionItem[0]) === null || _a === void 0 ? void 0 : _a.focus();\n break;\n case 'End':\n // Focus the last AccordionItem\n event.preventDefault();\n (_b = accordionItem[accordionItem.length - 1]) === null || _b === void 0 ? void 0 : _b.focus();\n break;\n }\n }\n }\n /**\n * @param increment\n */\n changeButtonFocus(increment) {\n var _a;\n const buttons = Array.from(this.querySelectorAll('kompis-accordion-item'))\n .filter((node) => !node.disabled)\n .map((accordionItem) => accordionItem.shadowRoot.querySelector('button'));\n const focusedButton = this.findFocusedButton();\n if (buttons) {\n const index = buttons.findIndex((element) => element === focusedButton);\n (_a = buttons[(buttons.length + index + increment) % buttons.length]) === null || _a === void 0 ? void 0 : _a.focus();\n }\n }\n /**\n * @returns The focused button within this shadow dom or null if there isn't one in focus.\n */\n findFocusedButton() {\n var _a, _b;\n const rootNode = this.getRootNode();\n if (this.isShadowRoot(rootNode)) {\n return ((_b = (_a = rootNode.activeElement) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('button')) || null;\n }\n return null;\n }\n /**\n * @param target\n */\n isShadowRoot(target) {\n return 'activeElement' in target;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Accordion.prototype, \"theme\", void 0);\nAccordion = __decorate([\n (0, web_component_1.customElement)('kompis-accordion')\n], Accordion);\nexports.default = Accordion;\n//# sourceMappingURL=Accordion.js.map","import \"@inter-ikea-kompis/component-accordion/lib/components/accordion/Accordion\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisAccordion extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-accordion\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisAccordion.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisAccordion;\n","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","module.exports = '';","const AccessibilityIcon = require('./icons/AccessibilityIcon.js');\nconst AccessibleDisabledIcon = require('./icons/AccessibleDisabledIcon.js');\nconst AddOnIcon = require('./icons/AddOnIcon.js');\nconst AdjustableBackrestIcon = require('./icons/AdjustableBackrestIcon.js');\nconst AirIcon = require('./icons/AirIcon.js');\nconst AllenKeyIcon = require('./icons/AllenKeyIcon.js');\nconst AluminiumCanIcon = require('./icons/AluminiumCanIcon.js');\nconst EnergyAIcon = require('./icons/EnergyAIcon.js');\nconst EnergyApIcon = require('./icons/EnergyApIcon.js');\nconst EnergyAppIcon = require('./icons/EnergyAppIcon.js');\nconst EnergyApppIcon = require('./icons/EnergyApppIcon.js');\nconst EnergyBIcon = require('./icons/EnergyBIcon.js');\nconst EnergyBlankIcon = require('./icons/EnergyBlankIcon.js');\nconst EnergyCIcon = require('./icons/EnergyCIcon.js');\nconst EnergyDIcon = require('./icons/EnergyDIcon.js');\nconst EnergyEIcon = require('./icons/EnergyEIcon.js');\nconst EnergyFIcon = require('./icons/EnergyFIcon.js');\nconst CheckmarkIcon = require('./icons/CheckmarkIcon.js');\nconst ChevronDownSmallIcon = require('./icons/ChevronDownSmallIcon.js');\nconst ChevronDownIcon = require('./icons/ChevronDownIcon.js');\nconst MinusSmallIcon = require('./icons/MinusSmallIcon.js');\nconst AppleIcon = require('./icons/AppleIcon.js');\nconst ARIcon = require('./icons/ARIcon.js');\nconst ArchiveBoxIcon = require('./icons/ArchiveBoxIcon.js');\nconst ArrowClockwiseIcon = require('./icons/ArrowClockwiseIcon.js');\nconst ArrowCloudInIcon = require('./icons/ArrowCloudInIcon.js');\nconst ArrowCloudOutIcon = require('./icons/ArrowCloudOutIcon.js');\nconst ArrowCounterclockwiseIcon = require('./icons/ArrowCounterclockwiseIcon.js');\nconst ArrowDownIcon = require('./icons/ArrowDownIcon.js');\nconst ArrowDownBackwardsIcon = require('./icons/ArrowDownBackwardsIcon.js');\nconst ArrowDownForwardsIcon = require('./icons/ArrowDownForwardsIcon.js');\nconst ArrowDownfromBaseIcon = require('./icons/ArrowDownfromBaseIcon.js');\nconst ArrowDowntoBaseIcon = require('./icons/ArrowDowntoBaseIcon.js');\nconst ArrowDowntoLineIcon = require('./icons/ArrowDowntoLineIcon.js');\nconst ArrowDowntoLineSmallIcon = require('./icons/ArrowDowntoLineSmallIcon.js');\nconst ArrowForkRightIcon = require('./icons/ArrowForkRightIcon.js');\nconst ArrowLeftIcon = require('./icons/ArrowLeftIcon.js');\nconst ArrowLeftArrowRightIcon = require('./icons/ArrowLeftArrowRightIcon.js');\nconst ArrowLeftfromBaseIcon = require('./icons/ArrowLeftfromBaseIcon.js');\nconst ArrowLeftRightIcon = require('./icons/ArrowLeftRightIcon.js');\nconst ArrowLefttoBaseIcon = require('./icons/ArrowLefttoBaseIcon.js');\nconst ArrowLefttoLineIcon = require('./icons/ArrowLefttoLineIcon.js');\nconst ArrowLefttoLineSmallIcon = require('./icons/ArrowLefttoLineSmallIcon.js');\nconst ArrowLevelDownIcon = require('./icons/ArrowLevelDownIcon.js');\nconst ArrowLevelUpIcon = require('./icons/ArrowLevelUpIcon.js');\nconst ArrowonPathIcon = require('./icons/ArrowonPathIcon.js');\nconst ArrowPairSquarepathIcon = require('./icons/ArrowPairSquarepathIcon.js');\nconst ArrowRightIcon = require('./icons/ArrowRightIcon.js');\nconst ArrowRightfromBaseIcon = require('./icons/ArrowRightfromBaseIcon.js');\nconst ArrowRighttoBaseIcon = require('./icons/ArrowRighttoBaseIcon.js');\nconst ArrowRighttoLineIcon = require('./icons/ArrowRighttoLineIcon.js');\nconst ArrowRighttoLineSmallIcon = require('./icons/ArrowRighttoLineSmallIcon.js');\nconst ArrowsInwardIcon = require('./icons/ArrowsInwardIcon.js');\nconst ArrowUTurnBackwardsIcon = require('./icons/ArrowUTurnBackwardsIcon.js');\nconst ArrowUTurnForwardsIcon = require('./icons/ArrowUTurnForwardsIcon.js');\nconst ArrowUpIcon = require('./icons/ArrowUpIcon.js');\nconst ArrowUpArrowDownIcon = require('./icons/ArrowUpArrowDownIcon.js');\nconst ArrowUpBackwardsIcon = require('./icons/ArrowUpBackwardsIcon.js');\nconst ArrowUpDownIcon = require('./icons/ArrowUpDownIcon.js');\nconst ArrowUpForwardsIcon = require('./icons/ArrowUpForwardsIcon.js');\nconst ArrowUpfromBaseIcon = require('./icons/ArrowUpfromBaseIcon.js');\nconst ArrowUptoBaseIcon = require('./icons/ArrowUptoBaseIcon.js');\nconst ArrowUptoLineIcon = require('./icons/ArrowUptoLineIcon.js');\nconst ArrowUptoLineSmallIcon = require('./icons/ArrowUptoLineSmallIcon.js');\nconst ATMIcon = require('./icons/ATMIcon.js');\nconst BabyStrollerIcon = require('./icons/BabyStrollerIcon.js');\nconst BackwardEndIcon = require('./icons/BackwardEndIcon.js');\nconst BandaidIcon = require('./icons/BandaidIcon.js');\nconst BarChartDowntrendIcon = require('./icons/BarChartDowntrendIcon.js');\nconst BarChartUptrendIcon = require('./icons/BarChartUptrendIcon.js');\nconst Battery0Icon = require('./icons/Battery0Icon.js');\nconst Battery100Icon = require('./icons/Battery100Icon.js');\nconst Battery25Icon = require('./icons/Battery25Icon.js');\nconst Battery50Icon = require('./icons/Battery50Icon.js');\nconst Battery75Icon = require('./icons/Battery75Icon.js');\nconst BatteryChargingIcon = require('./icons/BatteryChargingIcon.js');\nconst BeamAngleIcon = require('./icons/BeamAngleIcon.js');\nconst BedIcon = require('./icons/BedIcon.js');\nconst BedsideTableIcon = require('./icons/BedsideTableIcon.js');\nconst BeefIcon = require('./icons/BeefIcon.js');\nconst BellIcon = require('./icons/BellIcon.js');\nconst BikeIcon = require('./icons/BikeIcon.js');\nconst BlockOutIcon = require('./icons/BlockOutIcon.js');\nconst BluetoothIcon = require('./icons/BluetoothIcon.js');\nconst BoardIcon = require('./icons/BoardIcon.js');\nconst BoldIcon = require('./icons/BoldIcon.js');\nconst BookcaseIcon = require('./icons/BookcaseIcon.js');\nconst BookmarkIcon = require('./icons/BookmarkIcon.js');\nconst BookmarkFilledIcon = require('./icons/BookmarkFilledIcon.js');\nconst BoxIcon = require('./icons/BoxIcon.js');\nconst BoxCancelIcon = require('./icons/BoxCancelIcon.js');\nconst BoxExchangeIcon = require('./icons/BoxExchangeIcon.js');\nconst BoxExpressIcon = require('./icons/BoxExpressIcon.js');\nconst BoxRepeatIcon = require('./icons/BoxRepeatIcon.js');\nconst BoxReturnIcon = require('./icons/BoxReturnIcon.js');\nconst BriefcaseIcon = require('./icons/BriefcaseIcon.js');\nconst BriefcaseCheckmarkIcon = require('./icons/BriefcaseCheckmarkIcon.js');\nconst BriefcaseSmallIcon = require('./icons/BriefcaseSmallIcon.js');\nconst BrightnessDownIcon = require('./icons/BrightnessDownIcon.js');\nconst BrightnessUpIcon = require('./icons/BrightnessUpIcon.js');\nconst BucketIcon = require('./icons/BucketIcon.js');\nconst BulldozerIcon = require('./icons/BulldozerIcon.js');\nconst BulletIcon = require('./icons/BulletIcon.js');\nconst CalculatorFinancialIcon = require('./icons/CalculatorFinancialIcon.js');\nconst CalendarIcon = require('./icons/CalendarIcon.js');\nconst Calendar90Icon = require('./icons/Calendar90Icon.js');\nconst CameraIcon = require('./icons/CameraIcon.js');\nconst CandleLight1800Icon = require('./icons/CandleLight1800Icon.js');\nconst CandleLight1800DMIcon = require('./icons/CandleLight1800DMIcon.js');\nconst CanvasIcon = require('./icons/CanvasIcon.js');\nconst CarIcon = require('./icons/CarIcon.js');\nconst CarElectricIcon = require('./icons/CarElectricIcon.js');\nconst CarFittingBoldIcon = require('./icons/CarFittingBoldIcon.js');\nconst CargoBikeIcon = require('./icons/CargoBikeIcon.js');\nconst CartonIcon = require('./icons/CartonIcon.js');\nconst CeilingHeightReducerIcon = require('./icons/CeilingHeightReducerIcon.js');\nconst CertificateIcon = require('./icons/CertificateIcon.js');\nconst ChairIcon = require('./icons/ChairIcon.js');\nconst ChargingIcon = require('./icons/ChargingIcon.js');\nconst ChatIcon = require('./icons/ChatIcon.js');\nconst CheckmarkBoxIcon = require('./icons/CheckmarkBoxIcon.js');\nconst CheckmarkCircleIcon = require('./icons/CheckmarkCircleIcon.js');\nconst CheckmarkSmallIcon = require('./icons/CheckmarkSmallIcon.js');\nconst ChestofDrawersIcon = require('./icons/ChestofDrawersIcon.js');\nconst ChevronDoubleDownIcon = require('./icons/ChevronDoubleDownIcon.js');\nconst ChevronDoubleDownSmallIcon = require('./icons/ChevronDoubleDownSmallIcon.js');\nconst ChevronDoubleLeftIcon = require('./icons/ChevronDoubleLeftIcon.js');\nconst ChevronDoubleLeftSmallIcon = require('./icons/ChevronDoubleLeftSmallIcon.js');\nconst ChevronDoubleRightIcon = require('./icons/ChevronDoubleRightIcon.js');\nconst ChevronDoubleRightSmallIcon = require('./icons/ChevronDoubleRightSmallIcon.js');\nconst ChevronDoubleUpIcon = require('./icons/ChevronDoubleUpIcon.js');\nconst ChevronDoubleUpSmallIcon = require('./icons/ChevronDoubleUpSmallIcon.js');\nconst ChevronLeftIcon = require('./icons/ChevronLeftIcon.js');\nconst ChevronLeftSlashChevronRightIcon = require('./icons/ChevronLeftSlashChevronRightIcon.js');\nconst ChevronLeftSmallIcon = require('./icons/ChevronLeftSmallIcon.js');\nconst ChevronRightIcon = require('./icons/ChevronRightIcon.js');\nconst ChevronRightSmallIcon = require('./icons/ChevronRightSmallIcon.js');\nconst ChevronUpIcon = require('./icons/ChevronUpIcon.js');\nconst ChevronUpChevronDownIcon = require('./icons/ChevronUpChevronDownIcon.js');\nconst ChevronUpChevronDownSmallIcon = require('./icons/ChevronUpChevronDownSmallIcon.js');\nconst ChevronUpSmallIcon = require('./icons/ChevronUpSmallIcon.js');\nconst ChickenIcon = require('./icons/ChickenIcon.js');\nconst CircleIcon = require('./icons/CircleIcon.js');\nconst CircleFilledIcon = require('./icons/CircleFilledIcon.js');\nconst CircleFourSegmentsIcon = require('./icons/CircleFourSegmentsIcon.js');\nconst CircleFourSegmentsFilledIcon = require('./icons/CircleFourSegmentsFilledIcon.js');\nconst CircleHalfIcon = require('./icons/CircleHalfIcon.js');\nconst CirclepathThreeTrianglesIcon = require('./icons/CirclepathThreeTrianglesIcon.js');\nconst CirclepathTwoTrianglesIcon = require('./icons/CirclepathTwoTrianglesIcon.js');\nconst CircleThreeSegmentsIcon = require('./icons/CircleThreeSegmentsIcon.js');\nconst CircleThreeSegmentsFilledIcon = require('./icons/CircleThreeSegmentsFilledIcon.js');\nconst CleanSparklesIcon = require('./icons/CleanSparklesIcon.js');\nconst ClickandCollectIcon = require('./icons/ClickandCollectIcon.js');\nconst ClickandCollectStrikethroughIcon = require('./icons/ClickandCollectStrikethroughIcon.js');\nconst ClipboardIcon = require('./icons/ClipboardIcon.js');\nconst ClipboardCheckmarkIcon = require('./icons/ClipboardCheckmarkIcon.js');\nconst ClipboardStrikethroughIcon = require('./icons/ClipboardStrikethroughIcon.js');\nconst ClockIcon = require('./icons/ClockIcon.js');\nconst ClosedCaptionsIcon = require('./icons/ClosedCaptionsIcon.js');\nconst CoatHangerIcon = require('./icons/CoatHangerIcon.js');\nconst CoffeeTableIcon = require('./icons/CoffeeTableIcon.js');\nconst CoffeeWasteIcon = require('./icons/CoffeeWasteIcon.js');\nconst ColdDrinkIcon = require('./icons/ColdDrinkIcon.js');\nconst ColdDrinkContentsIcon = require('./icons/ColdDrinkContentsIcon.js');\nconst ColourfanIcon = require('./icons/ColourfanIcon.js');\nconst ColourSpectrumIcon = require('./icons/ColourSpectrumIcon.js');\nconst ColourSpectrumDMIcon = require('./icons/ColourSpectrumDMIcon.js');\nconst CommandLineIcon = require('./icons/CommandLineIcon.js');\nconst ContactlessPaymentIcon = require('./icons/ContactlessPaymentIcon.js');\nconst ContractIcon = require('./icons/ContractIcon.js');\nconst CoolDaylight5000Icon = require('./icons/CoolDaylight5000Icon.js');\nconst CoolDaylight5000DMIcon = require('./icons/CoolDaylight5000DMIcon.js');\nconst CoolDaylight5200Icon = require('./icons/CoolDaylight5200Icon.js');\nconst CoolDaylight5200DMIcon = require('./icons/CoolDaylight5200DMIcon.js');\nconst CoolingIcon = require('./icons/CoolingIcon.js');\nconst CoolSky6000Icon = require('./icons/CoolSky6000Icon.js');\nconst CoolSky6000DMIcon = require('./icons/CoolSky6000DMIcon.js');\nconst CoolWhite4000Icon = require('./icons/CoolWhite4000Icon.js');\nconst CoolWhite4000DMIcon = require('./icons/CoolWhite4000DMIcon.js');\nconst CopyIcon = require('./icons/CopyIcon.js');\nconst CouponIcon = require('./icons/CouponIcon.js');\nconst CoverIcon = require('./icons/CoverIcon.js');\nconst CreateNewIcon = require('./icons/CreateNewIcon.js');\nconst CreditCardIcon = require('./icons/CreditCardIcon.js');\nconst CropIcon = require('./icons/CropIcon.js');\nconst CrossIcon = require('./icons/CrossIcon.js');\nconst CrossBoxIcon = require('./icons/CrossBoxIcon.js');\nconst CrossCircleIcon = require('./icons/CrossCircleIcon.js');\nconst CrosshairIcon = require('./icons/CrosshairIcon.js');\nconst CrossSmallIcon = require('./icons/CrossSmallIcon.js');\nconst Cube3DIcon = require('./icons/Cube3DIcon.js');\nconst Cube3DBottomFilledIcon = require('./icons/Cube3DBottomFilledIcon.js');\nconst Cube3DLeftFilledIcon = require('./icons/Cube3DLeftFilledIcon.js');\nconst Cube3DRightFilledIcon = require('./icons/Cube3DRightFilledIcon.js');\nconst Cube3DTopFilledIcon = require('./icons/Cube3DTopFilledIcon.js');\nconst CupIcon = require('./icons/CupIcon.js');\nconst CupFilledIcon = require('./icons/CupFilledIcon.js');\nconst CurtainsIcon = require('./icons/CurtainsIcon.js');\nconst CutleryIcon = require('./icons/CutleryIcon.js');\nconst DarkModeIcon = require('./icons/DarkModeIcon.js');\nconst DatabaseIcon = require('./icons/DatabaseIcon.js');\nconst DataChartIcon = require('./icons/DataChartIcon.js');\nconst DefineSpaceIcon = require('./icons/DefineSpaceIcon.js');\nconst DeliveryTruckIcon = require('./icons/DeliveryTruckIcon.js');\nconst DeliveryTruckStrikethroughIcon = require('./icons/DeliveryTruckStrikethroughIcon.js');\nconst DepthIcon = require('./icons/DepthIcon.js');\nconst DimmableIcon = require('./icons/DimmableIcon.js');\nconst DirtIcon = require('./icons/DirtIcon.js');\nconst DiscountTagIcon = require('./icons/DiscountTagIcon.js');\nconst DisplayIcon = require('./icons/DisplayIcon.js');\nconst DocumentIcon = require('./icons/DocumentIcon.js');\nconst DocumentAddIcon = require('./icons/DocumentAddIcon.js');\nconst DocumentAlertIcon = require('./icons/DocumentAlertIcon.js');\nconst DocumentCheckmarkIcon = require('./icons/DocumentCheckmarkIcon.js');\nconst DocumentFinancialIcon = require('./icons/DocumentFinancialIcon.js');\nconst DocumentMagnifyingGlassIcon = require('./icons/DocumentMagnifyingGlassIcon.js');\nconst DocumentPencilIcon = require('./icons/DocumentPencilIcon.js');\nconst DocumentUploadIcon = require('./icons/DocumentUploadIcon.js');\nconst DogIcon = require('./icons/DogIcon.js');\nconst DoorIcon = require('./icons/DoorIcon.js');\nconst DoorLayoutIcon = require('./icons/DoorLayoutIcon.js');\nconst DoubleDoorsIcon = require('./icons/DoubleDoorsIcon.js');\nconst DresserIcon = require('./icons/DresserIcon.js');\nconst DressingTableIcon = require('./icons/DressingTableIcon.js');\nconst DrillIcon = require('./icons/DrillIcon.js');\nconst DuvetDoubleIcon = require('./icons/DuvetDoubleIcon.js');\nconst DuvetSingleIcon = require('./icons/DuvetSingleIcon.js');\nconst EarIcon = require('./icons/EarIcon.js');\nconst EarStrikethroughIcon = require('./icons/EarStrikethroughIcon.js');\nconst EggIcon = require('./icons/EggIcon.js');\nconst EggStrikethroughIcon = require('./icons/EggStrikethroughIcon.js');\nconst ElectronicCircleIcon = require('./icons/ElectronicCircleIcon.js');\nconst EllipsesHorizontalIcon = require('./icons/EllipsesHorizontalIcon.js');\nconst EllipsesVerticalIcon = require('./icons/EllipsesVerticalIcon.js');\nconst EscalatorDownIcon = require('./icons/EscalatorDownIcon.js');\nconst EscalatorUpIcon = require('./icons/EscalatorUpIcon.js');\nconst EscalatorUpDownIcon = require('./icons/EscalatorUpDownIcon.js');\nconst ExpandIcon = require('./icons/ExpandIcon.js');\nconst ExtraSoftIcon = require('./icons/ExtraSoftIcon.js');\nconst FabricIcon = require('./icons/FabricIcon.js');\nconst FactoryIcon = require('./icons/FactoryIcon.js');\nconst FallingboxesIcon = require('./icons/FallingboxesIcon.js');\nconst FamilyGenderMenIcon = require('./icons/FamilyGenderMenIcon.js');\nconst FamilyGenderMixedIcon = require('./icons/FamilyGenderMixedIcon.js');\nconst FamilyGenderWomenIcon = require('./icons/FamilyGenderWomenIcon.js');\nconst FanIcon = require('./icons/FanIcon.js');\nconst FastForwardIcon = require('./icons/FastForwardIcon.js');\nconst FauxLeatherIcon = require('./icons/FauxLeatherIcon.js');\nconst FeedbackDissatisfiedIcon = require('./icons/FeedbackDissatisfiedIcon.js');\nconst FeedbackHappyIcon = require('./icons/FeedbackHappyIcon.js');\nconst FeedbackNeutralIcon = require('./icons/FeedbackNeutralIcon.js');\nconst FeedbackSadIcon = require('./icons/FeedbackSadIcon.js');\nconst FeedbackSatisfiedIcon = require('./icons/FeedbackSatisfiedIcon.js');\nconst FillBucketIcon = require('./icons/FillBucketIcon.js');\nconst FiltersIcon = require('./icons/FiltersIcon.js');\nconst FinancingIcon = require('./icons/FinancingIcon.js');\nconst FirstAidRoomCrescentIcon = require('./icons/FirstAidRoomCrescentIcon.js');\nconst FirstAidRoomCrossIcon = require('./icons/FirstAidRoomCrossIcon.js');\nconst FirstPersonIcon = require('./icons/FirstPersonIcon.js');\nconst FishIcon = require('./icons/FishIcon.js');\nconst FlagIcon = require('./icons/FlagIcon.js');\nconst FlameIcon = require('./icons/FlameIcon.js');\nconst FlipHorizontalIcon = require('./icons/FlipHorizontalIcon.js');\nconst FloorLampIcon = require('./icons/FloorLampIcon.js');\nconst FlowerIcon = require('./icons/FlowerIcon.js');\nconst FluorescentLampIcon = require('./icons/FluorescentLampIcon.js');\nconst FolderIcon = require('./icons/FolderIcon.js');\nconst FootprintIcon = require('./icons/FootprintIcon.js');\nconst ForkliftIcon = require('./icons/ForkliftIcon.js');\nconst ForkliftLoadedIcon = require('./icons/ForkliftLoadedIcon.js');\nconst ForwardEndIcon = require('./icons/ForwardEndIcon.js');\nconst FrameIcon = require('./icons/FrameIcon.js');\nconst FramewithLegsIcon = require('./icons/FramewithLegsIcon.js');\nconst FullscreenIcon = require('./icons/FullscreenIcon.js');\nconst FurnitureSetIcon = require('./icons/FurnitureSetIcon.js');\nconst FurnitureTrolleyIcon = require('./icons/FurnitureTrolleyIcon.js');\nconst FurnitureTrolleyLoadedIcon = require('./icons/FurnitureTrolleyLoadedIcon.js');\nconst GalleryLayoutAlternativesIcon = require('./icons/GalleryLayoutAlternativesIcon.js');\nconst GarbageTruckIcon = require('./icons/GarbageTruckIcon.js');\nconst GearIcon = require('./icons/GearIcon.js');\nconst GiftBagIcon = require('./icons/GiftBagIcon.js');\nconst GiftBagActiveIcon = require('./icons/GiftBagActiveIcon.js');\nconst GiftBagActiveDMIcon = require('./icons/GiftBagActiveDMIcon.js');\nconst GiftBagAddIcon = require('./icons/GiftBagAddIcon.js');\nconst GiftBoxIcon = require('./icons/GiftBoxIcon.js');\nconst GiftBoxActiveIcon = require('./icons/GiftBoxActiveIcon.js');\nconst GiftBoxActiveDMIcon = require('./icons/GiftBoxActiveDMIcon.js');\nconst GiftBoxFilledIcon = require('./icons/GiftBoxFilledIcon.js');\nconst GiftCardIcon = require('./icons/GiftCardIcon.js');\nconst GlobeIcon = require('./icons/GlobeIcon.js');\nconst GlobeStrikethroughIcon = require('./icons/GlobeStrikethroughIcon.js');\nconst GroupIcon = require('./icons/GroupIcon.js');\nconst Guarantee10Icon = require('./icons/Guarantee10Icon.js');\nconst Guarantee15Icon = require('./icons/Guarantee15Icon.js');\nconst Guarantee2Icon = require('./icons/Guarantee2Icon.js');\nconst Guarantee25Icon = require('./icons/Guarantee25Icon.js');\nconst Guarantee3Icon = require('./icons/Guarantee3Icon.js');\nconst Guarantee5Icon = require('./icons/Guarantee5Icon.js');\nconst HandIcon = require('./icons/HandIcon.js');\nconst HandgesturesIcon = require('./icons/HandgesturesIcon.js');\nconst HandleIcon = require('./icons/HandleIcon.js');\nconst HandMoveIcon = require('./icons/HandMoveIcon.js');\nconst HandPointIcon = require('./icons/HandPointIcon.js');\nconst HandStrikethroughIcon = require('./icons/HandStrikethroughIcon.js');\nconst HandTouchIcon = require('./icons/HandTouchIcon.js');\nconst HandwithBagIcon = require('./icons/HandwithBagIcon.js');\nconst HandwithBoxIcon = require('./icons/HandwithBoxIcon.js');\nconst HandwithDiscountIcon = require('./icons/HandwithDiscountIcon.js');\nconst HandwithDropIcon = require('./icons/HandwithDropIcon.js');\nconst HandwithDropsIcon = require('./icons/HandwithDropsIcon.js');\nconst HandwithHeartIcon = require('./icons/HandwithHeartIcon.js');\nconst HandwithKeyIcon = require('./icons/HandwithKeyIcon.js');\nconst HandwithPlateIcon = require('./icons/HandwithPlateIcon.js');\nconst HandwithSparklesIcon = require('./icons/HandwithSparklesIcon.js');\nconst HeadphonesIcon = require('./icons/HeadphonesIcon.js');\nconst HeartIcon = require('./icons/HeartIcon.js');\nconst HeartFilledIcon = require('./icons/HeartFilledIcon.js');\nconst HeatPumpIcon = require('./icons/HeatPumpIcon.js');\nconst HeightIcon = require('./icons/HeightIcon.js');\nconst HistoryIcon = require('./icons/HistoryIcon.js');\nconst HomeIcon = require('./icons/HomeIcon.js');\nconst HotDogIcon = require('./icons/HotDogIcon.js');\nconst HotDrinkIcon = require('./icons/HotDrinkIcon.js');\nconst HourglassIcon = require('./icons/HourglassIcon.js');\nconst IceCreamIcon = require('./icons/IceCreamIcon.js');\nconst IDIcon = require('./icons/IDIcon.js');\nconst ImageIcon = require('./icons/ImageIcon.js');\nconst ImageStackIcon = require('./icons/ImageStackIcon.js');\nconst ImageStrikethroughIcon = require('./icons/ImageStrikethroughIcon.js');\nconst IncorrectIcon = require('./icons/IncorrectIcon.js');\nconst InformationIcon = require('./icons/InformationIcon.js');\nconst InformationCircleIcon = require('./icons/InformationCircleIcon.js');\nconst InformationCircleSmallIcon = require('./icons/InformationCircleSmallIcon.js');\nconst InstitutionIcon = require('./icons/InstitutionIcon.js');\nconst InteriorsIcon = require('./icons/InteriorsIcon.js');\nconst InverterIcon = require('./icons/InverterIcon.js');\nconst ItalicIcon = require('./icons/ItalicIcon.js');\nconst KickScooterIcon = require('./icons/KickScooterIcon.js');\nconst KitchenIcon = require('./icons/KitchenIcon.js');\nconst LambIcon = require('./icons/LambIcon.js');\nconst LaptopIcon = require('./icons/LaptopIcon.js');\nconst LaptopCheckmarkIcon = require('./icons/LaptopCheckmarkIcon.js');\nconst LaptopMagnifyingGlassIcon = require('./icons/LaptopMagnifyingGlassIcon.js');\nconst LaptopPencilIcon = require('./icons/LaptopPencilIcon.js');\nconst LayoutIcon = require('./icons/LayoutIcon.js');\nconst LayoutAlternativeIcon = require('./icons/LayoutAlternativeIcon.js');\nconst LeafIcon = require('./icons/LeafIcon.js');\nconst LeatherIcon = require('./icons/LeatherIcon.js');\nconst LeatherandFauxLeatherIcon = require('./icons/LeatherandFauxLeatherIcon.js');\nconst LiftDownIcon = require('./icons/LiftDownIcon.js');\nconst LiftFurnitureTrolleyIcon = require('./icons/LiftFurnitureTrolleyIcon.js');\nconst LiftShoppingTrolleyIcon = require('./icons/LiftShoppingTrolleyIcon.js');\nconst LiftUpIcon = require('./icons/LiftUpIcon.js');\nconst LiftUpDownIcon = require('./icons/LiftUpDownIcon.js');\nconst LightbulbIncandescentIcon = require('./icons/LightbulbIncandescentIcon.js');\nconst LightbulbLEDIcon = require('./icons/LightbulbLEDIcon.js');\nconst LightbulbLEDAlternativeIcon = require('./icons/LightbulbLEDAlternativeIcon.js');\nconst LightbulbwithRaysIcon = require('./icons/LightbulbwithRaysIcon.js');\nconst LightFilteringIcon = require('./icons/LightFilteringIcon.js');\nconst LinkIcon = require('./icons/LinkIcon.js');\nconst LinkOutIcon = require('./icons/LinkOutIcon.js');\nconst LinkStrikethroughIcon = require('./icons/LinkStrikethroughIcon.js');\nconst ListIcon = require('./icons/ListIcon.js');\nconst LiveVideoIcon = require('./icons/LiveVideoIcon.js');\nconst LocationPinIcon = require('./icons/LocationPinIcon.js');\nconst LocationPinFilledIcon = require('./icons/LocationPinFilledIcon.js');\nconst LocationPinSmallIcon = require('./icons/LocationPinSmallIcon.js');\nconst LocationPinSmallFilledIcon = require('./icons/LocationPinSmallFilledIcon.js');\nconst LocationPointerIcon = require('./icons/LocationPointerIcon.js');\nconst LocationPointerFilledIcon = require('./icons/LocationPointerFilledIcon.js');\nconst LockIcon = require('./icons/LockIcon.js');\nconst LockersIcon = require('./icons/LockersIcon.js');\nconst LockOpenIcon = require('./icons/LockOpenIcon.js');\nconst LockSmallIcon = require('./icons/LockSmallIcon.js');\nconst MagnifyingGlassIcon = require('./icons/MagnifyingGlassIcon.js');\nconst MagnifyingGlassListIcon = require('./icons/MagnifyingGlassListIcon.js');\nconst MailIcon = require('./icons/MailIcon.js');\nconst MapIcon = require('./icons/MapIcon.js');\nconst MattressComfortZonesIcon = require('./icons/MattressComfortZonesIcon.js');\nconst MattressExtraFirmIcon = require('./icons/MattressExtraFirmIcon.js');\nconst MattressFeatherIcon = require('./icons/MattressFeatherIcon.js');\nconst MattressFirmIcon = require('./icons/MattressFirmIcon.js');\nconst MattressFoamIcon = require('./icons/MattressFoamIcon.js');\nconst MattressHybridIcon = require('./icons/MattressHybridIcon.js');\nconst MattressLatexIcon = require('./icons/MattressLatexIcon.js');\nconst MattressMaterialGenericIcon = require('./icons/MattressMaterialGenericIcon.js');\nconst MattressMaterialNaturalIcon = require('./icons/MattressMaterialNaturalIcon.js');\nconst MattressMaterialVeganIcon = require('./icons/MattressMaterialVeganIcon.js');\nconst MattressMediumFirmIcon = require('./icons/MattressMediumFirmIcon.js');\nconst MattressMemoryFoamIcon = require('./icons/MattressMemoryFoamIcon.js');\nconst MattressPlushIcon = require('./icons/MattressPlushIcon.js');\nconst MattressRollPackedIcon = require('./icons/MattressRollPackedIcon.js');\nconst MattressSilkIcon = require('./icons/MattressSilkIcon.js');\nconst MattressSpringsBonnellIcon = require('./icons/MattressSpringsBonnellIcon.js');\nconst MattressSpringsMiniIcon = require('./icons/MattressSpringsMiniIcon.js');\nconst MattressSpringsPocketIcon = require('./icons/MattressSpringsPocketIcon.js');\nconst MattressTopperIcon = require('./icons/MattressTopperIcon.js');\nconst MattressWoolIcon = require('./icons/MattressWoolIcon.js');\nconst MedicIcon = require('./icons/MedicIcon.js');\nconst MedicCrescentIcon = require('./icons/MedicCrescentIcon.js');\nconst MembershipCardIcon = require('./icons/MembershipCardIcon.js');\nconst MembershipDigitalCardIcon = require('./icons/MembershipDigitalCardIcon.js');\nconst MenuIcon = require('./icons/MenuIcon.js');\nconst MetalSawIcon = require('./icons/MetalSawIcon.js');\nconst MicrophoneIcon = require('./icons/MicrophoneIcon.js');\nconst MilkBottleIcon = require('./icons/MilkBottleIcon.js');\nconst MilkBottleStrikethroughIcon = require('./icons/MilkBottleStrikethroughIcon.js');\nconst MinusIcon = require('./icons/MinusIcon.js');\nconst MirrorIcon = require('./icons/MirrorIcon.js');\nconst MissingIcon = require('./icons/MissingIcon.js');\nconst MobileIcon = require('./icons/MobileIcon.js');\nconst MobileHandoverIcon = require('./icons/MobileHandoverIcon.js');\nconst MoneyBillsIcon = require('./icons/MoneyBillsIcon.js');\nconst MoneyCashIcon = require('./icons/MoneyCashIcon.js');\nconst MoneyCoinsIcon = require('./icons/MoneyCoinsIcon.js');\nconst MotionSensorIcon = require('./icons/MotionSensorIcon.js');\nconst MotorBikeIcon = require('./icons/MotorBikeIcon.js');\nconst NetworkIcon = require('./icons/NetworkIcon.js');\nconst NoteIcon = require('./icons/NoteIcon.js');\nconst NoticeIcon = require('./icons/NoticeIcon.js');\nconst NoticeCircleIcon = require('./icons/NoticeCircleIcon.js');\nconst NoticeSmallIcon = require('./icons/NoticeSmallIcon.js');\nconst NursingIcon = require('./icons/NursingIcon.js');\nconst OfficeChairIcon = require('./icons/OfficeChairIcon.js');\nconst OilContainerIcon = require('./icons/OilContainerIcon.js');\nconst OpenDoorIcon = require('./icons/OpenDoorIcon.js');\nconst OpeningsIcon = require('./icons/OpeningsIcon.js');\nconst OrderedListIcon = require('./icons/OrderedListIcon.js');\nconst OvalIcon = require('./icons/OvalIcon.js');\nconst PaintbrushIcon = require('./icons/PaintbrushIcon.js');\nconst PairingIcon = require('./icons/PairingIcon.js');\nconst PalletLoadedIcon = require('./icons/PalletLoadedIcon.js');\nconst PalletMixedIcon = require('./icons/PalletMixedIcon.js');\nconst PalletwithBoxesIcon = require('./icons/PalletwithBoxesIcon.js');\nconst PanIcon = require('./icons/PanIcon.js');\nconst PanelsIcon = require('./icons/PanelsIcon.js');\nconst PaperclipIcon = require('./icons/PaperclipIcon.js');\nconst PaperTowelsIcon = require('./icons/PaperTowelsIcon.js');\nconst ParasolIcon = require('./icons/ParasolIcon.js');\nconst ParkingIcon = require('./icons/ParkingIcon.js');\nconst ParkingGarageIcon = require('./icons/ParkingGarageIcon.js');\nconst PassIcon = require('./icons/PassIcon.js');\nconst PauseIcon = require('./icons/PauseIcon.js');\nconst PedestrianIcon = require('./icons/PedestrianIcon.js');\nconst PedestrianwithWalkingStickIcon = require('./icons/PedestrianwithWalkingStickIcon.js');\nconst PencilIcon = require('./icons/PencilIcon.js');\nconst PeopleIcon = require('./icons/PeopleIcon.js');\nconst PersonIcon = require('./icons/PersonIcon.js');\nconst PersonActiveIcon = require('./icons/PersonActiveIcon.js');\nconst PersonActiveDMIcon = require('./icons/PersonActiveDMIcon.js');\nconst PersonHeightIcon = require('./icons/PersonHeightIcon.js');\nconst PersoninBedIcon = require('./icons/PersoninBedIcon.js');\nconst PersonSmallIcon = require('./icons/PersonSmallIcon.js');\nconst PersonwithBackgroundIcon = require('./icons/PersonwithBackgroundIcon.js');\nconst PhoneIcon = require('./icons/PhoneIcon.js');\nconst PhonePaymentIcon = require('./icons/PhonePaymentIcon.js');\nconst PhoneRotationIcon = require('./icons/PhoneRotationIcon.js');\nconst PickingIcon = require('./icons/PickingIcon.js');\nconst PictureFrameIcon = require('./icons/PictureFrameIcon.js');\nconst PictureFramesIcon = require('./icons/PictureFramesIcon.js');\nconst PictureFramewithImageIcon = require('./icons/PictureFramewithImageIcon.js');\nconst PictureinPictureIcon = require('./icons/PictureinPictureIcon.js');\nconst PieChartIcon = require('./icons/PieChartIcon.js');\nconst PillowIcon = require('./icons/PillowIcon.js');\nconst PillowHighIcon = require('./icons/PillowHighIcon.js');\nconst PillowLowIcon = require('./icons/PillowLowIcon.js');\nconst PinIcon = require('./icons/PinIcon.js');\nconst PlantinPotIcon = require('./icons/PlantinPotIcon.js');\nconst PlasticBagIcon = require('./icons/PlasticBagIcon.js');\nconst PlasticBottleIcon = require('./icons/PlasticBottleIcon.js');\nconst PlasticBottleCapIcon = require('./icons/PlasticBottleCapIcon.js');\nconst PlayIcon = require('./icons/PlayIcon.js');\nconst PlayAreaIcon = require('./icons/PlayAreaIcon.js');\nconst PlusIcon = require('./icons/PlusIcon.js');\nconst PlusCircleIcon = require('./icons/PlusCircleIcon.js');\nconst PlusSmallIcon = require('./icons/PlusSmallIcon.js');\nconst PodcastIcon = require('./icons/PodcastIcon.js');\nconst PorkIcon = require('./icons/PorkIcon.js');\nconst PotwithLidIcon = require('./icons/PotwithLidIcon.js');\nconst PowerIcon = require('./icons/PowerIcon.js');\nconst PramIcon = require('./icons/PramIcon.js');\nconst PriceTagIcon = require('./icons/PriceTagIcon.js');\nconst PriceTagDigitalIcon = require('./icons/PriceTagDigitalIcon.js');\nconst PrinterIcon = require('./icons/PrinterIcon.js');\nconst QuestionMarkIcon = require('./icons/QuestionMarkIcon.js');\nconst QuestionMarkCircleIcon = require('./icons/QuestionMarkCircleIcon.js');\nconst QuietRoomIcon = require('./icons/QuietRoomIcon.js');\nconst ReceiptIcon = require('./icons/ReceiptIcon.js');\nconst ReceiptAlertIcon = require('./icons/ReceiptAlertIcon.js');\nconst RectangleHorizontalIcon = require('./icons/RectangleHorizontalIcon.js');\nconst RectangleHorizontalDoubleIcon = require('./icons/RectangleHorizontalDoubleIcon.js');\nconst RectangleHorizontalThinIcon = require('./icons/RectangleHorizontalThinIcon.js');\nconst RectangleHorizontalThinTrippleIcon = require('./icons/RectangleHorizontalThinTrippleIcon.js');\nconst RectanglePairUnevenIcon = require('./icons/RectanglePairUnevenIcon.js');\nconst RectangleVerticalIcon = require('./icons/RectangleVerticalIcon.js');\nconst RectangleVerticalDoubleIcon = require('./icons/RectangleVerticalDoubleIcon.js');\nconst RectangleVerticalThinIcon = require('./icons/RectangleVerticalThinIcon.js');\nconst RecycleIcon = require('./icons/RecycleIcon.js');\nconst RefillingIcon = require('./icons/RefillingIcon.js');\nconst ReplaceMeIcon = require('./icons/ReplaceMeIcon.js');\nconst ReplaceMeSmallIcon = require('./icons/ReplaceMeSmallIcon.js');\nconst ResizeIcon = require('./icons/ResizeIcon.js');\nconst RestroomIcon = require('./icons/RestroomIcon.js');\nconst RestroomBabyCareIcon = require('./icons/RestroomBabyCareIcon.js');\nconst RestroomManIcon = require('./icons/RestroomManIcon.js');\nconst RestroomManandChildIcon = require('./icons/RestroomManandChildIcon.js');\nconst RestroomWomanIcon = require('./icons/RestroomWomanIcon.js');\nconst RestroomWomanandChildIcon = require('./icons/RestroomWomanandChildIcon.js');\nconst ReturnsIcon = require('./icons/ReturnsIcon.js');\nconst RewardIcon = require('./icons/RewardIcon.js');\nconst RewindIcon = require('./icons/RewindIcon.js');\nconst RobotArmIcon = require('./icons/RobotArmIcon.js');\nconst RoomDarkeningIcon = require('./icons/RoomDarkeningIcon.js');\nconst RoomLayoutIcon = require('./icons/RoomLayoutIcon.js');\nconst RoomWithoutFurnitureIcon = require('./icons/RoomWithoutFurnitureIcon.js');\nconst RotateIcon = require('./icons/RotateIcon.js');\nconst RotateDownIcon = require('./icons/RotateDownIcon.js');\nconst RotateLeftIcon = require('./icons/RotateLeftIcon.js');\nconst RotateRightIcon = require('./icons/RotateRightIcon.js');\nconst RotateUpIcon = require('./icons/RotateUpIcon.js');\nconst RugIcon = require('./icons/RugIcon.js');\nconst RulerIcon = require('./icons/RulerIcon.js');\nconst ScanBarcodeIcon = require('./icons/ScanBarcodeIcon.js');\nconst ScanQRCodeIcon = require('./icons/ScanQRCodeIcon.js');\nconst ScissorsIcon = require('./icons/ScissorsIcon.js');\nconst ScooterIcon = require('./icons/ScooterIcon.js');\nconst ScrewIcon = require('./icons/ScrewIcon.js');\nconst SeafoodIcon = require('./icons/SeafoodIcon.js');\nconst SeatHeightIcon = require('./icons/SeatHeightIcon.js');\nconst SeatLumbarSupportIcon = require('./icons/SeatLumbarSupportIcon.js');\nconst SeatTensionIcon = require('./icons/SeatTensionIcon.js');\nconst SeatTiltIcon = require('./icons/SeatTiltIcon.js');\nconst SectionsIcon = require('./icons/SectionsIcon.js');\nconst SecurityCameraIcon = require('./icons/SecurityCameraIcon.js');\nconst SelectionAddIcon = require('./icons/SelectionAddIcon.js');\nconst SelectionHiddenIcon = require('./icons/SelectionHiddenIcon.js');\nconst SewingMachineIcon = require('./icons/SewingMachineIcon.js');\nconst ShapeCornerIcon = require('./icons/ShapeCornerIcon.js');\nconst ShapeFreeIcon = require('./icons/ShapeFreeIcon.js');\nconst ShapeLIcon = require('./icons/ShapeLIcon.js');\nconst ShapeOrganicIcon = require('./icons/ShapeOrganicIcon.js');\nconst ShapeUIcon = require('./icons/ShapeUIcon.js');\nconst ShareNetworkIcon = require('./icons/ShareNetworkIcon.js');\nconst SheerFabricIcon = require('./icons/SheerFabricIcon.js');\nconst ShelvesIcon = require('./icons/ShelvesIcon.js');\nconst ShelvingUnitIcon = require('./icons/ShelvingUnitIcon.js');\nconst ShieldCheckmarkIcon = require('./icons/ShieldCheckmarkIcon.js');\nconst ShoppingBagIcon = require('./icons/ShoppingBagIcon.js');\nconst ShoppingBagActiveIcon = require('./icons/ShoppingBagActiveIcon.js');\nconst ShoppingBagActiveDMIcon = require('./icons/ShoppingBagActiveDMIcon.js');\nconst ShoppingBagAddIcon = require('./icons/ShoppingBagAddIcon.js');\nconst ShoppingBagPrideIcon = require('./icons/ShoppingBagPrideIcon.js');\nconst ShoppingBagPrideActiveIcon = require('./icons/ShoppingBagPrideActiveIcon.js');\nconst ShoppingBagPrideActiveDMIcon = require('./icons/ShoppingBagPrideActiveDMIcon.js');\nconst ShoppingBagPrideDMIcon = require('./icons/ShoppingBagPrideDMIcon.js');\nconst ShoppingBagTrolleyIcon = require('./icons/ShoppingBagTrolleyIcon.js');\nconst ShoppingBasketIcon = require('./icons/ShoppingBasketIcon.js');\nconst ShoppingTrolleyIcon = require('./icons/ShoppingTrolleyIcon.js');\nconst ShoppingTrolleyFilledIcon = require('./icons/ShoppingTrolleyFilledIcon.js');\nconst ShowerIcon = require('./icons/ShowerIcon.js');\nconst ShuffleIcon = require('./icons/ShuffleIcon.js');\nconst SinkIcon = require('./icons/SinkIcon.js');\nconst SkipNextIcon = require('./icons/SkipNextIcon.js');\nconst SkipPreviousIcon = require('./icons/SkipPreviousIcon.js');\nconst SleepingPositionBackIcon = require('./icons/SleepingPositionBackIcon.js');\nconst SleepingPositionMixedIcon = require('./icons/SleepingPositionMixedIcon.js');\nconst SleepingPositionSideIcon = require('./icons/SleepingPositionSideIcon.js');\nconst SleepingPositionStomachIcon = require('./icons/SleepingPositionStomachIcon.js');\nconst SmokingIcon = require('./icons/SmokingIcon.js');\nconst SmokingStrikethroughIcon = require('./icons/SmokingStrikethroughIcon.js');\nconst SofaIcon = require('./icons/SofaIcon.js');\nconst SofaBedIcon = require('./icons/SofaBedIcon.js');\nconst SofaStorageIcon = require('./icons/SofaStorageIcon.js');\nconst SolarEnergyIcon = require('./icons/SolarEnergyIcon.js');\nconst SolarPanelsIcon = require('./icons/SolarPanelsIcon.js');\nconst SolarStorageBatteryIcon = require('./icons/SolarStorageBatteryIcon.js');\nconst SortAscendingIcon = require('./icons/SortAscendingIcon.js');\nconst SortDescendingIcon = require('./icons/SortDescendingIcon.js');\nconst SoundAbsorptionIcon = require('./icons/SoundAbsorptionIcon.js');\nconst SoundBlockingIcon = require('./icons/SoundBlockingIcon.js');\nconst SpeechBubbleIcon = require('./icons/SpeechBubbleIcon.js');\nconst SpeechBubbleActiveIcon = require('./icons/SpeechBubbleActiveIcon.js');\nconst SpeechBubbleActiveDMIcon = require('./icons/SpeechBubbleActiveDMIcon.js');\nconst SquareIcon = require('./icons/SquareIcon.js');\nconst SquareCutIcon = require('./icons/SquareCutIcon.js');\nconst SquareGrid2x2Icon = require('./icons/SquareGrid2x2Icon.js');\nconst SquareGrid3x3FilledIcon = require('./icons/SquareGrid3x3FilledIcon.js');\nconst SquareSmallIcon = require('./icons/SquareSmallIcon.js');\nconst StackIcon = require('./icons/StackIcon.js');\nconst StackStrikethroughIcon = require('./icons/StackStrikethroughIcon.js');\nconst StairsIcon = require('./icons/StairsIcon.js');\nconst StairsDownIcon = require('./icons/StairsDownIcon.js');\nconst StairsUpIcon = require('./icons/StairsUpIcon.js');\nconst StarIcon = require('./icons/StarIcon.js');\nconst StarFilledIcon = require('./icons/StarFilledIcon.js');\nconst StarFilledSmallIcon = require('./icons/StarFilledSmallIcon.js');\nconst StarHalfFilledIcon = require('./icons/StarHalfFilledIcon.js');\nconst StarHalfFilledRTLIcon = require('./icons/StarHalfFilledRTLIcon.js');\nconst StarHalfFilledSmallIcon = require('./icons/StarHalfFilledSmallIcon.js');\nconst StarHalfFilledSmallRTLIcon = require('./icons/StarHalfFilledSmallRTLIcon.js');\nconst StarSmallIcon = require('./icons/StarSmallIcon.js');\nconst StopIcon = require('./icons/StopIcon.js');\nconst StopbarsIcon = require('./icons/StopbarsIcon.js');\nconst StoreIcon = require('./icons/StoreIcon.js');\nconst StoreStrikethroughIcon = require('./icons/StoreStrikethroughIcon.js');\nconst SubtitlesIcon = require('./icons/SubtitlesIcon.js');\nconst SuitcaseIcon = require('./icons/SuitcaseIcon.js');\nconst Sunrise3000Icon = require('./icons/Sunrise3000Icon.js');\nconst Sunrise3000DMIcon = require('./icons/Sunrise3000DMIcon.js');\nconst SurgicalMaskIcon = require('./icons/SurgicalMaskIcon.js');\nconst SurgicalMaskonFaceIcon = require('./icons/SurgicalMaskonFaceIcon.js');\nconst TShirtIcon = require('./icons/TShirtIcon.js');\nconst TableIcon = require('./icons/TableIcon.js');\nconst TagIcon = require('./icons/TagIcon.js');\nconst TagFilledIcon = require('./icons/TagFilledIcon.js');\nconst TakeBackIcon = require('./icons/TakeBackIcon.js');\nconst TextIcon = require('./icons/TextIcon.js');\nconst ThemeIcon = require('./icons/ThemeIcon.js');\nconst ThermometerIcon = require('./icons/ThermometerIcon.js');\nconst ThermometerExtraWarmIcon = require('./icons/ThermometerExtraWarmIcon.js');\nconst ThermometerExtraWarmDMIcon = require('./icons/ThermometerExtraWarmDMIcon.js');\nconst ThermometerLightIcon = require('./icons/ThermometerLightIcon.js');\nconst ThermometerLightDMIcon = require('./icons/ThermometerLightDMIcon.js');\nconst ThermometerWarmIcon = require('./icons/ThermometerWarmIcon.js');\nconst ThermometerWarmDMIcon = require('./icons/ThermometerWarmDMIcon.js');\nconst ThermoregulationIcon = require('./icons/ThermoregulationIcon.js');\nconst ThumbsDownIcon = require('./icons/ThumbsDownIcon.js');\nconst ThumbsDownFilledIcon = require('./icons/ThumbsDownFilledIcon.js');\nconst ThumbsUpIcon = require('./icons/ThumbsUpIcon.js');\nconst ThumbsUpFilledIcon = require('./icons/ThumbsUpFilledIcon.js');\nconst TinCanIcon = require('./icons/TinCanIcon.js');\nconst ToiletIcon = require('./icons/ToiletIcon.js');\nconst TonerCartridgeIcon = require('./icons/TonerCartridgeIcon.js');\nconst TouchscreenIcon = require('./icons/TouchscreenIcon.js');\nconst TrailerIcon = require('./icons/TrailerIcon.js');\nconst TransportBusIcon = require('./icons/TransportBusIcon.js');\nconst TransportTaxiIcon = require('./icons/TransportTaxiIcon.js');\nconst TransportTrainIcon = require('./icons/TransportTrainIcon.js');\nconst TransportTramIcon = require('./icons/TransportTramIcon.js');\nconst TransportTrolleybusIcon = require('./icons/TransportTrolleybusIcon.js');\nconst TrashCanIcon = require('./icons/TrashCanIcon.js');\nconst TrolleyIcon = require('./icons/TrolleyIcon.js');\nconst UnderscoreIcon = require('./icons/UnderscoreIcon.js');\nconst UngroupIcon = require('./icons/UngroupIcon.js');\nconst USBPoweredIcon = require('./icons/USBPoweredIcon.js');\nconst UtilityKnifeIcon = require('./icons/UtilityKnifeIcon.js');\nconst VaseIcon = require('./icons/VaseIcon.js');\nconst VideoIcon = require('./icons/VideoIcon.js');\nconst VideoCameraIcon = require('./icons/VideoCameraIcon.js');\nconst VisibilityHideIcon = require('./icons/VisibilityHideIcon.js');\nconst VisibilityShowIcon = require('./icons/VisibilityShowIcon.js');\nconst VoiceIcon = require('./icons/VoiceIcon.js');\nconst VolumeMuteIcon = require('./icons/VolumeMuteIcon.js');\nconst VolumeOffIcon = require('./icons/VolumeOffIcon.js');\nconst VolumeUpIcon = require('./icons/VolumeUpIcon.js');\nconst WallIcon = require('./icons/WallIcon.js');\nconst WallDividerIcon = require('./icons/WallDividerIcon.js');\nconst WallRailsIcon = require('./icons/WallRailsIcon.js');\nconst WardrobeIcon = require('./icons/WardrobeIcon.js');\nconst WarehouseIcon = require('./icons/WarehouseIcon.js');\nconst WarmGlow2200Icon = require('./icons/WarmGlow2200Icon.js');\nconst WarmGlow2200DMIcon = require('./icons/WarmGlow2200DMIcon.js');\nconst WarmWhite2500Icon = require('./icons/WarmWhite2500Icon.js');\nconst WarmWhite2500DMIcon = require('./icons/WarmWhite2500DMIcon.js');\nconst WarmWhite2700Icon = require('./icons/WarmWhite2700Icon.js');\nconst WarmWhite2700DMIcon = require('./icons/WarmWhite2700DMIcon.js');\nconst WarningTriangleIcon = require('./icons/WarningTriangleIcon.js');\nconst WarningTriangleColourIcon = require('./icons/WarningTriangleColourIcon.js');\nconst WarningTriangleColourDMIcon = require('./icons/WarningTriangleColourDMIcon.js');\nconst WarningTriangleSmallIcon = require('./icons/WarningTriangleSmallIcon.js');\nconst WashableCoverIcon = require('./icons/WashableCoverIcon.js');\nconst WashingMachineIcon = require('./icons/WashingMachineIcon.js');\nconst WaterdropIcon = require('./icons/WaterdropIcon.js');\nconst WaterproofIcon = require('./icons/WaterproofIcon.js');\nconst WeightIcon = require('./icons/WeightIcon.js');\nconst WeightsIcon = require('./icons/WeightsIcon.js');\nconst WheatIcon = require('./icons/WheatIcon.js');\nconst WheatStrikethroughIcon = require('./icons/WheatStrikethroughIcon.js');\nconst WheelIcon = require('./icons/WheelIcon.js');\nconst WhiteSpectrumIcon = require('./icons/WhiteSpectrumIcon.js');\nconst WhiteSpectrumDMIcon = require('./icons/WhiteSpectrumDMIcon.js');\nconst WidthIcon = require('./icons/WidthIcon.js');\nconst WifiIcon = require('./icons/WifiIcon.js');\nconst WindFarmIcon = require('./icons/WindFarmIcon.js');\nconst WindowIcon = require('./icons/WindowIcon.js');\nconst WineBottleIcon = require('./icons/WineBottleIcon.js');\nconst WineBottleFilledIcon = require('./icons/WineBottleFilledIcon.js');\nconst WineGlassIcon = require('./icons/WineGlassIcon.js');\nconst WirelessChargingIcon = require('./icons/WirelessChargingIcon.js');\nconst WirelessDimmingIcon = require('./icons/WirelessDimmingIcon.js');\nconst WoodIcon = require('./icons/WoodIcon.js');\nconst WrenchIcon = require('./icons/WrenchIcon.js');\nconst ZoomInIcon = require('./icons/ZoomInIcon.js');\nconst ZoomOutIcon = require('./icons/ZoomOutIcon.js');\nmodule.exports = {\n\tAccessibilityIcon,\n\tAccessibleDisabledIcon,\n\tAddOnIcon,\n\tAdjustableBackrestIcon,\n\tAirIcon,\n\tAllenKeyIcon,\n\tAluminiumCanIcon,\n\tEnergyAIcon,\n\tEnergyApIcon,\n\tEnergyAppIcon,\n\tEnergyApppIcon,\n\tEnergyBIcon,\n\tEnergyBlankIcon,\n\tEnergyCIcon,\n\tEnergyDIcon,\n\tEnergyEIcon,\n\tEnergyFIcon,\n\tCheckmarkIcon,\n\tChevronDownSmallIcon,\n\tChevronDownIcon,\n\tMinusSmallIcon,\n\tAppleIcon,\n\tARIcon,\n\tArchiveBoxIcon,\n\tArrowClockwiseIcon,\n\tArrowCloudInIcon,\n\tArrowCloudOutIcon,\n\tArrowCounterclockwiseIcon,\n\tArrowDownIcon,\n\tArrowDownBackwardsIcon,\n\tArrowDownForwardsIcon,\n\tArrowDownfromBaseIcon,\n\tArrowDowntoBaseIcon,\n\tArrowDowntoLineIcon,\n\tArrowDowntoLineSmallIcon,\n\tArrowForkRightIcon,\n\tArrowLeftIcon,\n\tArrowLeftArrowRightIcon,\n\tArrowLeftfromBaseIcon,\n\tArrowLeftRightIcon,\n\tArrowLefttoBaseIcon,\n\tArrowLefttoLineIcon,\n\tArrowLefttoLineSmallIcon,\n\tArrowLevelDownIcon,\n\tArrowLevelUpIcon,\n\tArrowonPathIcon,\n\tArrowPairSquarepathIcon,\n\tArrowRightIcon,\n\tArrowRightfromBaseIcon,\n\tArrowRighttoBaseIcon,\n\tArrowRighttoLineIcon,\n\tArrowRighttoLineSmallIcon,\n\tArrowsInwardIcon,\n\tArrowUTurnBackwardsIcon,\n\tArrowUTurnForwardsIcon,\n\tArrowUpIcon,\n\tArrowUpArrowDownIcon,\n\tArrowUpBackwardsIcon,\n\tArrowUpDownIcon,\n\tArrowUpForwardsIcon,\n\tArrowUpfromBaseIcon,\n\tArrowUptoBaseIcon,\n\tArrowUptoLineIcon,\n\tArrowUptoLineSmallIcon,\n\tATMIcon,\n\tBabyStrollerIcon,\n\tBackwardEndIcon,\n\tBandaidIcon,\n\tBarChartDowntrendIcon,\n\tBarChartUptrendIcon,\n\tBattery0Icon,\n\tBattery100Icon,\n\tBattery25Icon,\n\tBattery50Icon,\n\tBattery75Icon,\n\tBatteryChargingIcon,\n\tBeamAngleIcon,\n\tBedIcon,\n\tBedsideTableIcon,\n\tBeefIcon,\n\tBellIcon,\n\tBikeIcon,\n\tBlockOutIcon,\n\tBluetoothIcon,\n\tBoardIcon,\n\tBoldIcon,\n\tBookcaseIcon,\n\tBookmarkIcon,\n\tBookmarkFilledIcon,\n\tBoxIcon,\n\tBoxCancelIcon,\n\tBoxExchangeIcon,\n\tBoxExpressIcon,\n\tBoxRepeatIcon,\n\tBoxReturnIcon,\n\tBriefcaseIcon,\n\tBriefcaseCheckmarkIcon,\n\tBriefcaseSmallIcon,\n\tBrightnessDownIcon,\n\tBrightnessUpIcon,\n\tBucketIcon,\n\tBulldozerIcon,\n\tBulletIcon,\n\tCalculatorFinancialIcon,\n\tCalendarIcon,\n\tCalendar90Icon,\n\tCameraIcon,\n\tCandleLight1800Icon,\n\tCandleLight1800DMIcon,\n\tCanvasIcon,\n\tCarIcon,\n\tCarElectricIcon,\n\tCarFittingBoldIcon,\n\tCargoBikeIcon,\n\tCartonIcon,\n\tCeilingHeightReducerIcon,\n\tCertificateIcon,\n\tChairIcon,\n\tChargingIcon,\n\tChatIcon,\n\tCheckmarkBoxIcon,\n\tCheckmarkCircleIcon,\n\tCheckmarkSmallIcon,\n\tChestofDrawersIcon,\n\tChevronDoubleDownIcon,\n\tChevronDoubleDownSmallIcon,\n\tChevronDoubleLeftIcon,\n\tChevronDoubleLeftSmallIcon,\n\tChevronDoubleRightIcon,\n\tChevronDoubleRightSmallIcon,\n\tChevronDoubleUpIcon,\n\tChevronDoubleUpSmallIcon,\n\tChevronLeftIcon,\n\tChevronLeftSlashChevronRightIcon,\n\tChevronLeftSmallIcon,\n\tChevronRightIcon,\n\tChevronRightSmallIcon,\n\tChevronUpIcon,\n\tChevronUpChevronDownIcon,\n\tChevronUpChevronDownSmallIcon,\n\tChevronUpSmallIcon,\n\tChickenIcon,\n\tCircleIcon,\n\tCircleFilledIcon,\n\tCircleFourSegmentsIcon,\n\tCircleFourSegmentsFilledIcon,\n\tCircleHalfIcon,\n\tCirclepathThreeTrianglesIcon,\n\tCirclepathTwoTrianglesIcon,\n\tCircleThreeSegmentsIcon,\n\tCircleThreeSegmentsFilledIcon,\n\tCleanSparklesIcon,\n\tClickandCollectIcon,\n\tClickandCollectStrikethroughIcon,\n\tClipboardIcon,\n\tClipboardCheckmarkIcon,\n\tClipboardStrikethroughIcon,\n\tClockIcon,\n\tClosedCaptionsIcon,\n\tCoatHangerIcon,\n\tCoffeeTableIcon,\n\tCoffeeWasteIcon,\n\tColdDrinkIcon,\n\tColdDrinkContentsIcon,\n\tColourfanIcon,\n\tColourSpectrumIcon,\n\tColourSpectrumDMIcon,\n\tCommandLineIcon,\n\tContactlessPaymentIcon,\n\tContractIcon,\n\tCoolDaylight5000Icon,\n\tCoolDaylight5000DMIcon,\n\tCoolDaylight5200Icon,\n\tCoolDaylight5200DMIcon,\n\tCoolingIcon,\n\tCoolSky6000Icon,\n\tCoolSky6000DMIcon,\n\tCoolWhite4000Icon,\n\tCoolWhite4000DMIcon,\n\tCopyIcon,\n\tCouponIcon,\n\tCoverIcon,\n\tCreateNewIcon,\n\tCreditCardIcon,\n\tCropIcon,\n\tCrossIcon,\n\tCrossBoxIcon,\n\tCrossCircleIcon,\n\tCrosshairIcon,\n\tCrossSmallIcon,\n\tCube3DIcon,\n\tCube3DBottomFilledIcon,\n\tCube3DLeftFilledIcon,\n\tCube3DRightFilledIcon,\n\tCube3DTopFilledIcon,\n\tCupIcon,\n\tCupFilledIcon,\n\tCurtainsIcon,\n\tCutleryIcon,\n\tDarkModeIcon,\n\tDatabaseIcon,\n\tDataChartIcon,\n\tDefineSpaceIcon,\n\tDeliveryTruckIcon,\n\tDeliveryTruckStrikethroughIcon,\n\tDepthIcon,\n\tDimmableIcon,\n\tDirtIcon,\n\tDiscountTagIcon,\n\tDisplayIcon,\n\tDocumentIcon,\n\tDocumentAddIcon,\n\tDocumentAlertIcon,\n\tDocumentCheckmarkIcon,\n\tDocumentFinancialIcon,\n\tDocumentMagnifyingGlassIcon,\n\tDocumentPencilIcon,\n\tDocumentUploadIcon,\n\tDogIcon,\n\tDoorIcon,\n\tDoorLayoutIcon,\n\tDoubleDoorsIcon,\n\tDresserIcon,\n\tDressingTableIcon,\n\tDrillIcon,\n\tDuvetDoubleIcon,\n\tDuvetSingleIcon,\n\tEarIcon,\n\tEarStrikethroughIcon,\n\tEggIcon,\n\tEggStrikethroughIcon,\n\tElectronicCircleIcon,\n\tEllipsesHorizontalIcon,\n\tEllipsesVerticalIcon,\n\tEscalatorDownIcon,\n\tEscalatorUpIcon,\n\tEscalatorUpDownIcon,\n\tExpandIcon,\n\tExtraSoftIcon,\n\tFabricIcon,\n\tFactoryIcon,\n\tFallingboxesIcon,\n\tFamilyGenderMenIcon,\n\tFamilyGenderMixedIcon,\n\tFamilyGenderWomenIcon,\n\tFanIcon,\n\tFastForwardIcon,\n\tFauxLeatherIcon,\n\tFeedbackDissatisfiedIcon,\n\tFeedbackHappyIcon,\n\tFeedbackNeutralIcon,\n\tFeedbackSadIcon,\n\tFeedbackSatisfiedIcon,\n\tFillBucketIcon,\n\tFiltersIcon,\n\tFinancingIcon,\n\tFirstAidRoomCrescentIcon,\n\tFirstAidRoomCrossIcon,\n\tFirstPersonIcon,\n\tFishIcon,\n\tFlagIcon,\n\tFlameIcon,\n\tFlipHorizontalIcon,\n\tFloorLampIcon,\n\tFlowerIcon,\n\tFluorescentLampIcon,\n\tFolderIcon,\n\tFootprintIcon,\n\tForkliftIcon,\n\tForkliftLoadedIcon,\n\tForwardEndIcon,\n\tFrameIcon,\n\tFramewithLegsIcon,\n\tFullscreenIcon,\n\tFurnitureSetIcon,\n\tFurnitureTrolleyIcon,\n\tFurnitureTrolleyLoadedIcon,\n\tGalleryLayoutAlternativesIcon,\n\tGarbageTruckIcon,\n\tGearIcon,\n\tGiftBagIcon,\n\tGiftBagActiveIcon,\n\tGiftBagActiveDMIcon,\n\tGiftBagAddIcon,\n\tGiftBoxIcon,\n\tGiftBoxActiveIcon,\n\tGiftBoxActiveDMIcon,\n\tGiftBoxFilledIcon,\n\tGiftCardIcon,\n\tGlobeIcon,\n\tGlobeStrikethroughIcon,\n\tGroupIcon,\n\tGuarantee10Icon,\n\tGuarantee15Icon,\n\tGuarantee2Icon,\n\tGuarantee25Icon,\n\tGuarantee3Icon,\n\tGuarantee5Icon,\n\tHandIcon,\n\tHandgesturesIcon,\n\tHandleIcon,\n\tHandMoveIcon,\n\tHandPointIcon,\n\tHandStrikethroughIcon,\n\tHandTouchIcon,\n\tHandwithBagIcon,\n\tHandwithBoxIcon,\n\tHandwithDiscountIcon,\n\tHandwithDropIcon,\n\tHandwithDropsIcon,\n\tHandwithHeartIcon,\n\tHandwithKeyIcon,\n\tHandwithPlateIcon,\n\tHandwithSparklesIcon,\n\tHeadphonesIcon,\n\tHeartIcon,\n\tHeartFilledIcon,\n\tHeatPumpIcon,\n\tHeightIcon,\n\tHistoryIcon,\n\tHomeIcon,\n\tHotDogIcon,\n\tHotDrinkIcon,\n\tHourglassIcon,\n\tIceCreamIcon,\n\tIDIcon,\n\tImageIcon,\n\tImageStackIcon,\n\tImageStrikethroughIcon,\n\tIncorrectIcon,\n\tInformationIcon,\n\tInformationCircleIcon,\n\tInformationCircleSmallIcon,\n\tInstitutionIcon,\n\tInteriorsIcon,\n\tInverterIcon,\n\tItalicIcon,\n\tKickScooterIcon,\n\tKitchenIcon,\n\tLambIcon,\n\tLaptopIcon,\n\tLaptopCheckmarkIcon,\n\tLaptopMagnifyingGlassIcon,\n\tLaptopPencilIcon,\n\tLayoutIcon,\n\tLayoutAlternativeIcon,\n\tLeafIcon,\n\tLeatherIcon,\n\tLeatherandFauxLeatherIcon,\n\tLiftDownIcon,\n\tLiftFurnitureTrolleyIcon,\n\tLiftShoppingTrolleyIcon,\n\tLiftUpIcon,\n\tLiftUpDownIcon,\n\tLightbulbIncandescentIcon,\n\tLightbulbLEDIcon,\n\tLightbulbLEDAlternativeIcon,\n\tLightbulbwithRaysIcon,\n\tLightFilteringIcon,\n\tLinkIcon,\n\tLinkOutIcon,\n\tLinkStrikethroughIcon,\n\tListIcon,\n\tLiveVideoIcon,\n\tLocationPinIcon,\n\tLocationPinFilledIcon,\n\tLocationPinSmallIcon,\n\tLocationPinSmallFilledIcon,\n\tLocationPointerIcon,\n\tLocationPointerFilledIcon,\n\tLockIcon,\n\tLockersIcon,\n\tLockOpenIcon,\n\tLockSmallIcon,\n\tMagnifyingGlassIcon,\n\tMagnifyingGlassListIcon,\n\tMailIcon,\n\tMapIcon,\n\tMattressComfortZonesIcon,\n\tMattressExtraFirmIcon,\n\tMattressFeatherIcon,\n\tMattressFirmIcon,\n\tMattressFoamIcon,\n\tMattressHybridIcon,\n\tMattressLatexIcon,\n\tMattressMaterialGenericIcon,\n\tMattressMaterialNaturalIcon,\n\tMattressMaterialVeganIcon,\n\tMattressMediumFirmIcon,\n\tMattressMemoryFoamIcon,\n\tMattressPlushIcon,\n\tMattressRollPackedIcon,\n\tMattressSilkIcon,\n\tMattressSpringsBonnellIcon,\n\tMattressSpringsMiniIcon,\n\tMattressSpringsPocketIcon,\n\tMattressTopperIcon,\n\tMattressWoolIcon,\n\tMedicIcon,\n\tMedicCrescentIcon,\n\tMembershipCardIcon,\n\tMembershipDigitalCardIcon,\n\tMenuIcon,\n\tMetalSawIcon,\n\tMicrophoneIcon,\n\tMilkBottleIcon,\n\tMilkBottleStrikethroughIcon,\n\tMinusIcon,\n\tMirrorIcon,\n\tMissingIcon,\n\tMobileIcon,\n\tMobileHandoverIcon,\n\tMoneyBillsIcon,\n\tMoneyCashIcon,\n\tMoneyCoinsIcon,\n\tMotionSensorIcon,\n\tMotorBikeIcon,\n\tNetworkIcon,\n\tNoteIcon,\n\tNoticeIcon,\n\tNoticeCircleIcon,\n\tNoticeSmallIcon,\n\tNursingIcon,\n\tOfficeChairIcon,\n\tOilContainerIcon,\n\tOpenDoorIcon,\n\tOpeningsIcon,\n\tOrderedListIcon,\n\tOvalIcon,\n\tPaintbrushIcon,\n\tPairingIcon,\n\tPalletLoadedIcon,\n\tPalletMixedIcon,\n\tPalletwithBoxesIcon,\n\tPanIcon,\n\tPanelsIcon,\n\tPaperclipIcon,\n\tPaperTowelsIcon,\n\tParasolIcon,\n\tParkingIcon,\n\tParkingGarageIcon,\n\tPassIcon,\n\tPauseIcon,\n\tPedestrianIcon,\n\tPedestrianwithWalkingStickIcon,\n\tPencilIcon,\n\tPeopleIcon,\n\tPersonIcon,\n\tPersonActiveIcon,\n\tPersonActiveDMIcon,\n\tPersonHeightIcon,\n\tPersoninBedIcon,\n\tPersonSmallIcon,\n\tPersonwithBackgroundIcon,\n\tPhoneIcon,\n\tPhonePaymentIcon,\n\tPhoneRotationIcon,\n\tPickingIcon,\n\tPictureFrameIcon,\n\tPictureFramesIcon,\n\tPictureFramewithImageIcon,\n\tPictureinPictureIcon,\n\tPieChartIcon,\n\tPillowIcon,\n\tPillowHighIcon,\n\tPillowLowIcon,\n\tPinIcon,\n\tPlantinPotIcon,\n\tPlasticBagIcon,\n\tPlasticBottleIcon,\n\tPlasticBottleCapIcon,\n\tPlayIcon,\n\tPlayAreaIcon,\n\tPlusIcon,\n\tPlusCircleIcon,\n\tPlusSmallIcon,\n\tPodcastIcon,\n\tPorkIcon,\n\tPotwithLidIcon,\n\tPowerIcon,\n\tPramIcon,\n\tPriceTagIcon,\n\tPriceTagDigitalIcon,\n\tPrinterIcon,\n\tQuestionMarkIcon,\n\tQuestionMarkCircleIcon,\n\tQuietRoomIcon,\n\tReceiptIcon,\n\tReceiptAlertIcon,\n\tRectangleHorizontalIcon,\n\tRectangleHorizontalDoubleIcon,\n\tRectangleHorizontalThinIcon,\n\tRectangleHorizontalThinTrippleIcon,\n\tRectanglePairUnevenIcon,\n\tRectangleVerticalIcon,\n\tRectangleVerticalDoubleIcon,\n\tRectangleVerticalThinIcon,\n\tRecycleIcon,\n\tRefillingIcon,\n\tReplaceMeIcon,\n\tReplaceMeSmallIcon,\n\tResizeIcon,\n\tRestroomIcon,\n\tRestroomBabyCareIcon,\n\tRestroomManIcon,\n\tRestroomManandChildIcon,\n\tRestroomWomanIcon,\n\tRestroomWomanandChildIcon,\n\tReturnsIcon,\n\tRewardIcon,\n\tRewindIcon,\n\tRobotArmIcon,\n\tRoomDarkeningIcon,\n\tRoomLayoutIcon,\n\tRoomWithoutFurnitureIcon,\n\tRotateIcon,\n\tRotateDownIcon,\n\tRotateLeftIcon,\n\tRotateRightIcon,\n\tRotateUpIcon,\n\tRugIcon,\n\tRulerIcon,\n\tScanBarcodeIcon,\n\tScanQRCodeIcon,\n\tScissorsIcon,\n\tScooterIcon,\n\tScrewIcon,\n\tSeafoodIcon,\n\tSeatHeightIcon,\n\tSeatLumbarSupportIcon,\n\tSeatTensionIcon,\n\tSeatTiltIcon,\n\tSectionsIcon,\n\tSecurityCameraIcon,\n\tSelectionAddIcon,\n\tSelectionHiddenIcon,\n\tSewingMachineIcon,\n\tShapeCornerIcon,\n\tShapeFreeIcon,\n\tShapeLIcon,\n\tShapeOrganicIcon,\n\tShapeUIcon,\n\tShareNetworkIcon,\n\tSheerFabricIcon,\n\tShelvesIcon,\n\tShelvingUnitIcon,\n\tShieldCheckmarkIcon,\n\tShoppingBagIcon,\n\tShoppingBagActiveIcon,\n\tShoppingBagActiveDMIcon,\n\tShoppingBagAddIcon,\n\tShoppingBagPrideIcon,\n\tShoppingBagPrideActiveIcon,\n\tShoppingBagPrideActiveDMIcon,\n\tShoppingBagPrideDMIcon,\n\tShoppingBagTrolleyIcon,\n\tShoppingBasketIcon,\n\tShoppingTrolleyIcon,\n\tShoppingTrolleyFilledIcon,\n\tShowerIcon,\n\tShuffleIcon,\n\tSinkIcon,\n\tSkipNextIcon,\n\tSkipPreviousIcon,\n\tSleepingPositionBackIcon,\n\tSleepingPositionMixedIcon,\n\tSleepingPositionSideIcon,\n\tSleepingPositionStomachIcon,\n\tSmokingIcon,\n\tSmokingStrikethroughIcon,\n\tSofaIcon,\n\tSofaBedIcon,\n\tSofaStorageIcon,\n\tSolarEnergyIcon,\n\tSolarPanelsIcon,\n\tSolarStorageBatteryIcon,\n\tSortAscendingIcon,\n\tSortDescendingIcon,\n\tSoundAbsorptionIcon,\n\tSoundBlockingIcon,\n\tSpeechBubbleIcon,\n\tSpeechBubbleActiveIcon,\n\tSpeechBubbleActiveDMIcon,\n\tSquareIcon,\n\tSquareCutIcon,\n\tSquareGrid2x2Icon,\n\tSquareGrid3x3FilledIcon,\n\tSquareSmallIcon,\n\tStackIcon,\n\tStackStrikethroughIcon,\n\tStairsIcon,\n\tStairsDownIcon,\n\tStairsUpIcon,\n\tStarIcon,\n\tStarFilledIcon,\n\tStarFilledSmallIcon,\n\tStarHalfFilledIcon,\n\tStarHalfFilledRTLIcon,\n\tStarHalfFilledSmallIcon,\n\tStarHalfFilledSmallRTLIcon,\n\tStarSmallIcon,\n\tStopIcon,\n\tStopbarsIcon,\n\tStoreIcon,\n\tStoreStrikethroughIcon,\n\tSubtitlesIcon,\n\tSuitcaseIcon,\n\tSunrise3000Icon,\n\tSunrise3000DMIcon,\n\tSurgicalMaskIcon,\n\tSurgicalMaskonFaceIcon,\n\tTShirtIcon,\n\tTableIcon,\n\tTagIcon,\n\tTagFilledIcon,\n\tTakeBackIcon,\n\tTextIcon,\n\tThemeIcon,\n\tThermometerIcon,\n\tThermometerExtraWarmIcon,\n\tThermometerExtraWarmDMIcon,\n\tThermometerLightIcon,\n\tThermometerLightDMIcon,\n\tThermometerWarmIcon,\n\tThermometerWarmDMIcon,\n\tThermoregulationIcon,\n\tThumbsDownIcon,\n\tThumbsDownFilledIcon,\n\tThumbsUpIcon,\n\tThumbsUpFilledIcon,\n\tTinCanIcon,\n\tToiletIcon,\n\tTonerCartridgeIcon,\n\tTouchscreenIcon,\n\tTrailerIcon,\n\tTransportBusIcon,\n\tTransportTaxiIcon,\n\tTransportTrainIcon,\n\tTransportTramIcon,\n\tTransportTrolleybusIcon,\n\tTrashCanIcon,\n\tTrolleyIcon,\n\tUnderscoreIcon,\n\tUngroupIcon,\n\tUSBPoweredIcon,\n\tUtilityKnifeIcon,\n\tVaseIcon,\n\tVideoIcon,\n\tVideoCameraIcon,\n\tVisibilityHideIcon,\n\tVisibilityShowIcon,\n\tVoiceIcon,\n\tVolumeMuteIcon,\n\tVolumeOffIcon,\n\tVolumeUpIcon,\n\tWallIcon,\n\tWallDividerIcon,\n\tWallRailsIcon,\n\tWardrobeIcon,\n\tWarehouseIcon,\n\tWarmGlow2200Icon,\n\tWarmGlow2200DMIcon,\n\tWarmWhite2500Icon,\n\tWarmWhite2500DMIcon,\n\tWarmWhite2700Icon,\n\tWarmWhite2700DMIcon,\n\tWarningTriangleIcon,\n\tWarningTriangleColourIcon,\n\tWarningTriangleColourDMIcon,\n\tWarningTriangleSmallIcon,\n\tWashableCoverIcon,\n\tWashingMachineIcon,\n\tWaterdropIcon,\n\tWaterproofIcon,\n\tWeightIcon,\n\tWeightsIcon,\n\tWheatIcon,\n\tWheatStrikethroughIcon,\n\tWheelIcon,\n\tWhiteSpectrumIcon,\n\tWhiteSpectrumDMIcon,\n\tWidthIcon,\n\tWifiIcon,\n\tWindFarmIcon,\n\tWindowIcon,\n\tWineBottleIcon,\n\tWineBottleFilledIcon,\n\tWineGlassIcon,\n\tWirelessChargingIcon,\n\tWirelessDimmingIcon,\n\tWoodIcon,\n\tWrenchIcon,\n\tZoomInIcon,\n\tZoomOutIcon\n};","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar CheckboxAlignButtonEnum;\n(function (CheckboxAlignButtonEnum) {\n CheckboxAlignButtonEnum[\"left\"] = \"left\";\n CheckboxAlignButtonEnum[\"right\"] = \"right\";\n})(CheckboxAlignButtonEnum || (CheckboxAlignButtonEnum = {}));\nexports.default = CheckboxAlignButtonEnum;\n//# sourceMappingURL=CheckboxAlignButtonEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar CheckboxLayoutEnum;\n(function (CheckboxLayoutEnum) {\n CheckboxLayoutEnum[\"subtle\"] = \"subtle\";\n CheckboxLayoutEnum[\"emphasised\"] = \"emphasised\";\n})(CheckboxLayoutEnum || (CheckboxLayoutEnum = {}));\nexports.default = CheckboxLayoutEnum;\n//# sourceMappingURL=CheckboxLayoutEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst CheckboxAlignButtonEnum_1 = __importDefault(require(\"../../enums/CheckboxAlignButtonEnum\"));\nconst CheckboxLayoutEnum_1 = __importDefault(require(\"../../enums/CheckboxLayoutEnum\"));\nconst INPUT_SIZE = {\n horizontal: 10,\n vertical: 44\n};\nclass CheckboxStyle {\n /**\n * Returns style.\n *\n * @param options Options.\n * @param options.isDisabled Disabled.\n * @param options.isChecked Checked.\n * @param options.theme Theme.\n * @param options.alignButton Label position.\n * @param options.layout Layout.\n * @returns Styles.\n */\n static getStyle(options) {\n const { color, border, spacing, focusOutline } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t${themes_1.FontStyle.getStyle({\n type: enums_1.ThemeFontStyleTypeEnum.bodyMedium,\n theme: options.theme\n })}\n\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\n\t\t\tlabel {\n\t\t\t\tcursor: ${options.isDisabled ? 'default' : 'pointer'};\n\t\t\t}\n\t\t\tinput[type='checkbox'] {\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: -${INPUT_SIZE.horizontal / 16}rem;\n\t\t\t\twidth: ${INPUT_SIZE.vertical / 16}rem;\n\t\t\t\theight: ${INPUT_SIZE.vertical / 16}rem;\n\t\t\t\tdisplay: block;\n\t\t\t\topacity: 0;\n\t\t\t\toutline: 0;\n\t\t\t\tmargin: 0;\n\t\t\t\tpadding: 0;\n\t\t\t\tcursor: ${options.isDisabled ? 'default' : 'pointer'};\n\t\t\t\tpointer-events: all;\n\t\t\t\t-webkit-appearance: none;\n\t\t\t}\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tposition: relative;\n\t\t\t\talign-items: flex-start;\n\t\t\t\tflex-direction: ${options.alignButton === CheckboxAlignButtonEnum_1.default.left\n ? 'row'\n : 'row-reverse'};\n\t\t\t}\n\t\t\t.container label {\n\t\t\t\tmargin-top: ${2 / 16}rem;\n\t\t\t}\n\t\t\t.checkbox {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-shrink: 0;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\tposition: relative;\n\t\t\t\twidth: ${spacing.space150 / 16}rem;\n\t\t\t\theight: ${spacing.space150 / 16}rem;\n\t\t\t\tbackground: ${color.neutral.white};\n\t\t\t\tborder-color: ${options.invalid ? color.component.dangerDefault : color.neutral.grey500};\n\t\t\t\tborder-width: ${1 / 16}rem;\n\t\t\t\tborder-radius: ${spacing.space25 / 16}rem;\n\t\t\t\tborder-style: solid;\n\t\t\t\tprint-color-adjust: exact;\n\t\t\t\t-webkit-print-color-adjust: exact;\n\t\t\t}\n\t\t\t.container:focus-within .checkbox,\n\t\t\t.container .checkbox {\n\t\t\t\tbackground-color: ${options.isChecked ? color.accent.primaryAccent : 'initial'};\n\t\t\t\tborder-color: ${options.isChecked ? color.accent.primaryAccent : color.neutral.grey500};\n\t\t\t\tborder-radius: ${border.radius.radius4 / 16}rem;\n\t\t\t\tprint-color-adjust: exact;\n\t\t\t\t-webkit-print-color-adjust: exact;\n\t\t\t}\n\t\t\t.outline {\n\t\t\t\tposition: absolute;\n\t\t\t\tleft: 0;\n\t\t\t\ttop: 0;\n\t\t\t\tright: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\tz-index: inherit;\n\t\t\t\tborder-radius: ${focusOutline.borderRadius / 16}rem;\n\t\t\t\ttransition-property: top, left, right, bottom, opacity;\n\t\t\t\ttransition-duration: ${focusOutline.transitionTime}s;\n\t\t\t\topacity: ${options.showOutline ? 1 : 0};\n\t\t\t}\n\t\t\tkompis-icon {\n\t\t\t\tcolor: ${options.isChecked ? color.neutral.white : color.transparency.default};\n\t\t\t\tflex-shrink: 0;\n\t\t\t}\n\t\t\t.labelDivider {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-shrink: 0;\n\t\t\t\twidth: ${spacing.space100 / 16}rem;\n\t\t\t}\n\t\t\tlabel kompis-text {\n\t\t\t\tcolor: ${color.neutral.grey700};\n\t\t\t}\n\n\t\t\t${this.getFocusStyle(options)}\n\t\t\t${!options.isDisabled && !options.isChecked ? this.getHoverStyle(options) : ''}\n\t\t\t${options.layout === CheckboxLayoutEnum_1.default.subtle ? this.getSubtleStyle(options) : ''}\n\t\t\t${this.getInvalidStyle(options)}\n\t\t\t${options.isDisabled ? this.getDisabled(options) : ''}\n\t\t\t${this.checkHover(options)}\n\t\t`;\n }\n /**\n * Returns the style for focusing the button.\n *\n * @param options Options.\n * @returns Styles.\n */\n static getInvalidStyle(options) {\n if (!options.invalid) {\n return '';\n }\n const { color, spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t.errorMessage {\n\t\t\t\tcolor: ${color.neutral.grey700};\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: flex-start;\n\t\t\t\tjustify-content: ${options.alignButton === CheckboxAlignButtonEnum_1.default.left\n ? 'flex-start'\n : 'flex-end'};\n\t\t\t\tmargin-top: ${spacing.space50 / 16}rem;\n\t\t\t}\n\t\t\t.errorMessage kompis-text {\n\t\t\t\tcolor: ${color.component.dangerDefault};\n\t\t\t}\n\t\t\t.errorDivider {\n\t\t\t\twidth: ${spacing.space50 / 16}rem;\n\t\t\t}\n\t\t\t.container:focus-within .checkbox,\n\t\t\t.container .checkbox {\n\t\t\t\tborder-color: ${!options.isChecked ? color.component.dangerDefault : ''};\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns the style for focusing the button.\n *\n * @param options Options.\n * @returns Styles.\n */\n static getFocusStyle(options) {\n if (!options.showOutline) {\n return '';\n }\n const { focusOutline } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t.outline {\n\t\t\t\tbox-shadow: 0 0 0 ${focusOutline.width / 16}rem ${focusOutline.color};\n\t\t\t\tleft: -${focusOutline.offset / 16}rem;\n\t\t\t\ttop: -${focusOutline.offset / 16}rem;\n\t\t\t\tright: -${focusOutline.offset / 16}rem;\n\t\t\t\tbottom: -${focusOutline.offset / 16}rem;\n\t\t\t}\n\t\t`;\n }\n /**\n * Style for button disabled.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @param options.disabled\n * @returns Style for button disabled.\n */\n static getDisabled(options) {\n const { color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\tlabel kompis-text {\n\t\t\t\tcolor: ${color.disabled.default};\n\t\t\t}\n\t\t\t.container:focus-within .checkbox,\n\t\t\t.container .checkbox {\n\t\t\t\tbackground-color: ${options.isChecked ? color.disabled.default : color.background.default};\n\t\t\t\tborder-color: ${color.disabled.default};\n\t\t\t}\n\t\t\tkompis-icon {\n\t\t\t\tcolor: ${options.isChecked ? color.neutral.grey500 : color.background.default};\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns css rules for hoverStyle.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @returns Css cssrule.\n */\n static getHoverStyle(options) {\n const { color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t@media not all and (pointer: coarse) {\n\t\t\t\t.container:hover .checkbox {\n\t\t\t\t\tborder-color: ${color.neutral.grey900};\n\t\t\t\t}\n\t\t\t\t.container:hover kompis-icon {\n\t\t\t\t\tcolor: ${color.neutral.grey200};\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns css rules for Subtle layout Style.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getSubtleStyle(options) {\n const { color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t.container:focus-within .checkbox,\n\t\t\t.container .checkbox {\n\t\t\t\tbackground-color: ${options.isChecked ? color.neutral.grey900 : 'initial'};\n\t\t\t\tborder-color: ${options.isChecked ? color.neutral.grey900 : color.neutral.grey500};\n\t\t\t}\n\t\t`;\n }\n /**\n * @param option\n * @param options\n */\n static checkHover(options) {\n const { color } = options.theme;\n if (options.hover && !options.isChecked) {\n return (0, web_component_1.css) `\n\t\t\t\t@media not all and (pointer: coarse) {\n\t\t\t\t\t.container .checkbox {\n\t\t\t\t\t\tborder-color: ${color.neutral.grey900};\n\t\t\t\t\t}\n\t\t\t\t\t.container kompis-icon {\n\t\t\t\t\t\tcolor: ${color.neutral.grey200};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t`;\n }\n return '';\n }\n}\nexports.default = CheckboxStyle;\n//# sourceMappingURL=CheckboxStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst icons_1 = require(\"@inter-ikea-kompis/icons\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@inter-ikea-kompis/component-icon\");\nrequire(\"@inter-ikea-kompis/component-text\");\nconst CheckboxAlignButtonEnum_1 = __importDefault(require(\"../../enums/CheckboxAlignButtonEnum\"));\nconst CheckboxLayoutEnum_1 = __importDefault(require(\"../../enums/CheckboxLayoutEnum\"));\nconst CheckboxStyle_1 = __importDefault(require(\"./CheckboxStyle\"));\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n \n * @event change When the checkbox is checked or unchecked\n */\nlet Checkbox = class Checkbox extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // A text that describes the action of the checkbox.\n this.label = null;\n // Like a native input element.\n this.required = false;\n // Like a native input element.\n this.disabled = false;\n // Applicable when type is switch or checkbox.\n this.checked = false;\n // Error message.\n this.errorMessage = null;\n // Is input invalid.\n this.invalid = false;\n // Where the label should be.\n this.alignButton = CheckboxAlignButtonEnum_1.default.left;\n // Changes the style of the checkbox.\n this.layout = CheckboxLayoutEnum_1.default.emphasised;\n // Enables the hovered styling.\n this.hovered = false;\n this.showOutline = false; // State to show outline\n this.pointerIsDown = false; // To distinguish between how focus have been captured\n this.uniqueId = new utilities_1.IdGenerator().generateId();\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n const direction = window.getComputedStyle(this).direction;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getCheckbox()}\n\t\t`;\n }\n /**\n * @returns Template.\n */\n getCheckbox() {\n return (0, web_component_1.html) `\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t${this.getCheckableInputElement()} ${this.getLabel()}\n\t\t\t
\n\t\t\t${this.getErrorMessage()}\n\t\t`;\n }\n /**\n * @returns Template.\n */\n getCheckableInputElement() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n \t`;\n }\n /**\n * @returns Template.\n */\n getErrorMessage() {\n if (!this.invalid) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${this.errorMessage}\n\t\t\t\n\t\t`;\n }\n /**\n * HTML event handler.\n */\n onFocusOut() {\n this.showOutline = false;\n this.pointerIsDown = false;\n this.update();\n }\n /**\n * HTML event handler.\n */\n onFocusIn() {\n this.showOutline = !this.pointerIsDown;\n this.update();\n }\n /**\n * HTML event handler.\n *\n * @param event Pointer event.\n */\n onPointerDown(event) {\n event.preventDefault();\n this.pointerIsDown = true;\n this.showOutline = false;\n }\n /**\n * Runs when input event occurs.\n *\n * @param event HTMLEvent.\n */\n onChange(event) {\n event.stopPropagation();\n event.preventDefault();\n this.dispatchEvent(new CustomEvent('change', {\n bubbles: true,\n detail: {\n checked: event.target.checked\n }\n }));\n }\n /**\n * @returns Template.\n */\n getLabel() {\n if (!this.label) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t${this.label}\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Checkbox.prototype, \"label\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Checkbox.prototype, \"required\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Checkbox.prototype, \"disabled\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Checkbox.prototype, \"checked\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Checkbox.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Checkbox.prototype, \"errorMessage\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Checkbox.prototype, \"invalid\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Checkbox.prototype, \"alignButton\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Checkbox.prototype, \"layout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Checkbox.prototype, \"hovered\", void 0);\nCheckbox = __decorate([\n (0, web_component_1.customElement)('kompis-checkbox')\n], Checkbox);\nexports.default = Checkbox;\n//# sourceMappingURL=Checkbox.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass CheckboxGroupStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing, color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\t\t\t::slotted(kompis-checkbox) {\n\t\t\t\tmargin-bottom: ${spacing.space150 / 16}rem;\n\t\t\t}\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: flex-start;\n\t\t\t}\n\t\t\t.heading {\n\t\t\t\tmargin-bottom: ${spacing.space75 / 16}rem;\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\t\t\t.help {\n\t\t\t\tcolor: ${color.neutral.grey700};\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = CheckboxGroupStyle;\n//# sourceMappingURL=CheckboxGroupStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nrequire(\"@inter-ikea-kompis/component-text\");\nconst CheckboxGroupStyle_1 = __importDefault(require(\"./CheckboxGroupStyle\"));\n/**\n * This component should be used for adding some styles around checkboxes.\n */\nlet CheckboxGroup = class CheckboxGroup extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Help text describing the purpose of this checkbox group.\n this.helpText = null;\n // Heading.\n this.heading = null;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getHeading()}\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t${this.getHelpText()}\n\t\t\t\n\t\t`;\n }\n /**\n * Render the group name.\n *\n * @returns Template.\n */\n getHeading() {\n if (!this.heading) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
\n\t\t\t\t${this.heading}\n\t\t\t
\n\t\t`;\n }\n /**\n * Render the group name.\n *\n * @returns Template.\n */\n getHelpText() {\n if (!this.helpText) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
\n\t\t\t\t${this.helpText}\n\t\t\t
\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], CheckboxGroup.prototype, \"helpText\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], CheckboxGroup.prototype, \"heading\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], CheckboxGroup.prototype, \"theme\", void 0);\nCheckboxGroup = __decorate([\n (0, web_component_1.customElement)('kompis-checkbox-group')\n], CheckboxGroup);\nexports.default = CheckboxGroup;\n//# sourceMappingURL=CheckboxGroup.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CheckboxLayoutEnum = exports.CheckboxGroup = exports.CheckboxAlignButtonEnum = exports.Checkbox = void 0;\nconst Checkbox_1 = __importDefault(require(\"./components/checkbox/Checkbox\"));\nexports.Checkbox = Checkbox_1.default;\nconst CheckboxGroup_1 = __importDefault(require(\"./components/checkbox-group/CheckboxGroup\"));\nexports.CheckboxGroup = CheckboxGroup_1.default;\nconst CheckboxAlignButtonEnum_1 = __importDefault(require(\"./enums/CheckboxAlignButtonEnum\"));\nexports.CheckboxAlignButtonEnum = CheckboxAlignButtonEnum_1.default;\nconst CheckboxLayoutEnum_1 = __importDefault(require(\"./enums/CheckboxLayoutEnum\"));\nexports.CheckboxLayoutEnum = CheckboxLayoutEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar RadioLayoutEnum;\n(function (RadioLayoutEnum) {\n RadioLayoutEnum[\"subtle\"] = \"subtle\";\n RadioLayoutEnum[\"emphasised\"] = \"emphasised\";\n})(RadioLayoutEnum || (RadioLayoutEnum = {}));\nexports.default = RadioLayoutEnum;\n//# sourceMappingURL=RadioLayoutEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst component_checkbox_1 = require(\"@inter-ikea-kompis/component-checkbox\");\nconst RadioLayoutEnum_1 = __importDefault(require(\"../../enums/RadioLayoutEnum\"));\nconst INPUT_SIZE = 44;\nconst INPUT_POSITION_OFFSET = 10;\nclass RadioButtonStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.isDisabled Viewport layout.\n * @param options.isChecked \"true\" if checked.\n * @param options.direction Direction.\n * @param options.layout Layout.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { isDisabled } = options;\n const { spacing, color, motion, border } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t${themes_1.FontStyle.getStyle({\n type: enums_1.ThemeFontStyleTypeEnum.bodyMedium,\n theme: options.theme\n })}\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tcolor: ${color.neutral.grey700};\n\t\t\t}\n\t\t\tinput[type='number'] {\n\t\t\t\t/* remove default arrows in input type=number in Firefox*/\n\t\t\t\t-moz-appearance: textfield;\n\t\t\t}\n\t\t\tinput[type='radio'] {\n\t\t\t\tposition: absolute;\n\t\t\t\twidth: ${INPUT_SIZE / 16}rem;\n\t\t\t\theight: ${INPUT_SIZE / 16}rem;\n\t\t\t\tfont-size: inherit;\n\t\t\t\t-webkit-appearance: none;\n\t\t\t\topacity: 0;\n\t\t\t\tmargin: 0;\n\t\t\t\toutline: 0;\n\t\t\t\tpadding: 0;\n\t\t\t\tcursor: pointer;\n\t\t\t\ttop: ${'-' + INPUT_POSITION_OFFSET / 16 + 'rem'};\n\t\t\t\t${this.getRTLStyling(options)}\n\t\t\t}\n\t\t\tinput:active {\n\t\t\t\tborder-color: ${color.semantic.positive};\n\t\t\t}\n\t\t\tkompis-text {\n\t\t\t\tfont-size: inherit;\n\t\t\t\tline-height: inherit;\n\t\t\t\tcolor: currentColor;\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\ttransition-property: color;\n\t\t\t\ttransition-duration: ${motion.duration.small};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t}\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: ${options.alignButton === component_checkbox_1.CheckboxAlignButtonEnum.left\n ? 'row'\n : 'row-reverse'};\n\t\t\t\talign-items: flex-start;\n\t\t\t\tposition: relative;\n\t\t\t\tcursor: ${isDisabled ? 'default' : 'pointer'};\n\t\t\t\toutline: none;\n\t\t\t}\n\t\t\t.container label {\n\t\t\t\tmargin-top: ${2 / 16}rem;\n\t\t\t}\n\t\t\t.outline {\n\t\t\t\tposition: absolute;\n\t\t\t\twidth: ${spacing.space200 / 16}rem;\n\t\t\t\theight: ${spacing.space200 / 16}rem;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\tright: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\tborder-radius: ${border.radius.radius64 / 16}rem;\n\t\t\t\ttransition-property: utline, border, opacity;\n\t\t\t\ttransition-duration: ${motion.duration.small};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t\topacity: ${options.hasFocus ? 1 : 0};\n\t\t\t}\n\t\t\t.radioSymbol {\n\t\t\t\twidth: 1.5rem;\n\t\t\t\theight: 1.5rem;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\tbackground: ${color.neutral.white};\n\t\t\t\tborder-width: ${1 / 16}rem;\n\t\t\t\tborder-style: solid;\n\t\t\t\tborder-color: ${color.neutral.grey500};\n\t\t\t\tborder-radius: ${border.radius.radius64 / 16}rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t\toutline: none;\n\t\t\t\ttransition-property: color, border, width, height;\n\t\t\t\ttransition-duration: ${motion.duration.small};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t}\n\t\t\t.radioSymbol:after {\n\t\t\t\tcontent: '';\n\t\t\t\tdisplay: block;\n\t\t\t\twidth: ${spacing.space50 / 16}rem;\n\t\t\t\theight: ${spacing.space50 / 16}rem;\n\t\t\t\tborder-radius: ${border.radius.radius64 / 16}rem;\n\t\t\t\ttransition-property: color, width, height;\n\t\t\t\ttransition-duration: ${motion.duration.small};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t}\n\t\t\t.container:hover .radioSymbol {\n\t\t\t\tborder-color: ${color.neutral.grey900};\n\t\t\t}\n\t\t\t.divider {\n\t\t\t\twidth: ${spacing.space100 / 16}rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t}\n\t\t\t.radioButtonContainer {\n\t\t\t\tposition: relative;\n\t\t\t\twidth: ${spacing.space150 / 16}rem;\n\t\t\t\theight: ${spacing.space150 / 16}rem;\n\t\t\t\toutline: none;\n\t\t\t}\n\n\t\t\t${options.isChecked ? this.getChecked(options) : ''}\n\t\t\t${this.getFocusStyle(options)}\n\t\t\t${!options.isDisabled ? this.getHoverStyle(options) : ''}\n\t\t\t${options.layout === RadioLayoutEnum_1.default.subtle ? this.getSubtleStyle(options) : ''}\n\t\t\t${options.isDisabled ? this.getDisabled(options) : ''}\n\t\t\t${this.checkHover(options)}\n\t\t`;\n }\n /**\n * Returns css rules for hoverStyle.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @returns Css cssrule.\n */\n static getHoverStyle(options) {\n const { color, spacing, border } = options.theme;\n if (options.hasFocus || options.isChecked) {\n return '';\n }\n return (0, web_component_1.css) `\n\t\t\t/* Prevents hover effect on touch. */\n\t\t\t@media (-moz-touch-enabled: 0), (pointer: fine) {\n\t\t\t\t.container:hover > .radioButtonContainer > .radioSymbol:after {\n\t\t\t\t\tcontent: '';\n\t\t\t\t\tdisplay: block;\n\t\t\t\t\tbackground: ${color.neutral.grey200};\n\t\t\t\t\tborder-color: ${color.neutral.grey900};\n\t\t\t\t\tborder-radius: ${border.radius.radius64 / 16}rem;\n\t\t\t\t\twidth: ${spacing.space50 / 16}rem;\n\t\t\t\t\theight: ${spacing.space50 / 16}rem;\n\t\t\t\t}\n\t\t\t\t.container:hover > .radioSymbol {\n\t\t\t\t\tborder-color: ${color.neutral.grey900};\n\t\t\t\t}\n\t\t\t\t.radioSymbol:hover:after {\n\t\t\t\t\tbackground: ${color.neutral.grey200};\n\t\t\t\t\tborder-radius: ${border.radius.radius64 / 16}rem;\n\t\t\t\t}\n\t\t\t\t.radioSymbol:focus {\n\t\t\t\t\tborder-color: ${color.component.primaryHover};\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns css rules for Subtle layout Style.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getSubtleStyle(options) {\n if (!options.isChecked) {\n return '';\n }\n const { color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t.radioSymbol {\n\t\t\t\tborder-color: ${options.hasFocus ? color.neutral.grey500 : color.neutral.grey900};\n\t\t\t}\n\t\t\t.radioSymbol:after {\n\t\t\t\tbackground: ${color.neutral.grey900};\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.isDisabled Viewport layout.\n * @param options.isChecked \"true\" if checked.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getChecked(options) {\n const { color, border } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t.radioSymbol {\n\t\t\t\tborder-color: ${color.accent.primaryAccent};\n\t\t\t}\n\t\t\t.radioSymbol:after {\n\t\t\t\tbackground: ${color.accent.primaryAccent};\n\t\t\t\tborder-radius: ${border.radius.radius64 / 16}rem;\n\t\t\t\tcontent: '';\n\t\t\t\twidth: 1rem;\n\t\t\t\theight: 1rem;\n\t\t\t\tdisplay: block;\n\t\t\t}\n\t\t`;\n }\n /**\n * Style for button disabled.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @param options.disabled\n * @returns Style for button disabled.\n */\n static getDisabled(options) {\n const { color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t.radioSymbol {\n\t\t\t\tborder-color: ${color.disabled.default};\n\t\t\t}\n\t\t\t.radioSymbol:after {\n\t\t\t\tbackground: ${color.disabled.default};\n\t\t\t}\n\t\t\tkompis-text {\n\t\t\t\tcolor: ${color.disabled.default};\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns the style for focusing the button.\n *\n * @param options Options.\n * @returns Styles.\n */\n static getFocusStyle(options) {\n if (!options.hasFocus) {\n return '';\n }\n return (0, web_component_1.css) `\n\t\t\t${this.getOutlineStyle(options)}\n\t\t`;\n }\n /**\n * Returns the outline style when focusing.\n *\n * @param options Options.\n * @returns Styles.\n */\n static getOutlineStyle(options) {\n const { focusOutline } = options.theme;\n if (!options.hasFocus) {\n return '';\n }\n return (0, web_component_1.css) `\n\t\t\t.outline {\n\t\t\t\tbox-shadow: 0 0 0 ${1 / 16}rem ${focusOutline.color};\n\t\t\t\tleft: -${focusOutline.offset / 16}rem;\n\t\t\t\ttop: -${focusOutline.offset / 16}rem;\n\t\t\t\tright: -${focusOutline.offset / 16}rem;\n\t\t\t\tbottom: -${focusOutline.offset / 16}rem;\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns styling for options.hover.\n *\n * @param options\n * @returns Styles.\n */\n static checkHover(options) {\n const { color, spacing, border } = options.theme;\n if (options.hover && !options.isChecked) {\n return (0, web_component_1.css) `\n\t\t\t\t/* Prevents hover effect on touch. */\n\t\t\t\t@media (-moz-touch-enabled: 0), (pointer: fine) {\n\t\t\t\t\t.container > .radioSymbol:after {\n\t\t\t\t\t\tcontent: '';\n\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t\tbackground: ${color.neutral.grey200};\n\t\t\t\t\t\tborder-color: ${color.neutral.grey900};\n\t\t\t\t\t\twidth: ${spacing.space50 / 16}rem;\n\t\t\t\t\t\theight: ${spacing.space50 / 16}rem;\n\t\t\t\t\t}\n\t\t\t\t\t.container > .radioSymbol {\n\t\t\t\t\t\tborder-color: ${color.neutral.grey900};\n\t\t\t\t\t}\n\t\t\t\t\t.radioSymbol:after {\n\t\t\t\t\t\tcontent: '';\n\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t\tbackground: ${color.neutral.grey200};\n\t\t\t\t\t\twidth: ${spacing.space50 / 16}rem;\n\t\t\t\t\t\theight: ${spacing.space50 / 16}rem;\n\t\t\t\t\t\tborder-radius: ${border.radius.radius64 / 16}rem;\n\t\t\t\t\t}\n\t\t\t\t\t.radioSymbol:focus {\n\t\t\t\t\t\tborder-color: ${color.component.primaryHover};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t`;\n }\n return '';\n }\n /**\n * Returns RTL styling for input element.\n *\n * @param options\n * @returns Styles.\n */\n static getRTLStyling(options) {\n if (options.direction === 'rtl') {\n if (options.alignButton === component_checkbox_1.CheckboxAlignButtonEnum.right) {\n return (0, web_component_1.css) `\n\t\t\t\t\tright: ${'-' + INPUT_POSITION_OFFSET / 16 + 'rem'};\n\t\t\t\t\tleft: auto;\n\t\t\t\t`;\n }\n else {\n return (0, web_component_1.css) `\n\t\t\t\t\tright: auto;\n\t\t\t\t\tleft: ${'-' + INPUT_POSITION_OFFSET / 16 + 'rem'};\n\t\t\t\t`;\n }\n }\n else {\n if (options.alignButton === component_checkbox_1.CheckboxAlignButtonEnum.right) {\n return (0, web_component_1.css) `\n\t\t\t\t\tright: ${'-' + INPUT_POSITION_OFFSET / 16 + 'rem'};\n\t\t\t\t\tleft: auto;\n\t\t\t\t`;\n }\n else {\n return (0, web_component_1.css) `\n\t\t\t\t\tright: auto;\n\t\t\t\t\tleft: ${'-' + INPUT_POSITION_OFFSET / 16 + 'rem'};\n\t\t\t\t`;\n }\n }\n }\n}\nexports.default = RadioButtonStyle;\n//# sourceMappingURL=RadioButtonStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst component_checkbox_1 = require(\"@inter-ikea-kompis/component-checkbox\");\nrequire(\"@inter-ikea-kompis/component-icon\");\nrequire(\"@inter-ikea-kompis/component-text\");\nconst RadioLayoutEnum_1 = __importDefault(require(\"../../enums/RadioLayoutEnum\"));\nconst RadioButtonStyle_1 = __importDefault(require(\"./RadioButtonStyle\"));\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n * This component should be used for radio buttons.\n *\n * @event select Emits when a radio button is selected\n */\nlet RadioButton = class RadioButton extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // \"true\" if checked.\n this.checked = false;\n // \"true\" if disabled.\n this.disabled = false;\n // Layout.\n this.layout = RadioLayoutEnum_1.default.emphasised;\n // Index for radio input\n this.name = '';\n this.label = null;\n // Where the label should be.\n this.alignButton = component_checkbox_1.CheckboxAlignButtonEnum.left;\n this.hovered = false;\n this.hasFocus = false;\n this.pointerIsDown = false;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n const direction = window.getComputedStyle(this).direction;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getRadioButton()}\n\t\t`;\n }\n /**\n * When focusing.\n */\n focus() {\n var _a, _b;\n (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('input')) === null || _b === void 0 ? void 0 : _b.focus();\n }\n getRadioButton() {\n // The keyup is necessary to enable Enter input on Chromium browsers.\n return (0, web_component_1.html) `\n\t\t\t event.key === 'Enter' && this.click()}\"\n\t\t\t>\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t${this.getLabel()}\n\t\t\t\n\t\t`;\n }\n getLabel() {\n if (!this.label) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
\n\t\t\t ${this.label} \n\t\t`;\n }\n /**\n * Called when radio button checked value has changed.\n */\n onClick() {\n if (!this.disabled) {\n this.dispatchEvent(new CustomEvent('select', {\n bubbles: true,\n detail: {\n checked: !this.checked\n }\n }));\n }\n }\n /**\n * HTML event handler.\n */\n onFocusOut() {\n this.hasFocus = false;\n this.pointerIsDown = false;\n this.update();\n }\n /**\n * HTML event handler.\n */\n onFocus() {\n if (this.pointerIsDown) {\n return;\n }\n this.hasFocus = true;\n this.update();\n }\n /**\n * HTML event handler.\n *\n * @param event HTMLEvent.\n */\n onPointerDown() {\n this.pointerIsDown = true;\n if (this.hasFocus) {\n this.hasFocus = false;\n this.update();\n }\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], RadioButton.prototype, \"checked\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], RadioButton.prototype, \"disabled\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], RadioButton.prototype, \"layout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], RadioButton.prototype, \"name\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], RadioButton.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], RadioButton.prototype, \"label\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], RadioButton.prototype, \"alignButton\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], RadioButton.prototype, \"hovered\", void 0);\nRadioButton = __decorate([\n (0, web_component_1.customElement)('kompis-radio-button')\n], RadioButton);\nexports.default = RadioButton;\n//# sourceMappingURL=RadioButton.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst TOP_PADDING = 4.8;\nclass RadioGroupStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.layout\n * @param options.state\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing, color, motion } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t\tpadding-top: ${TOP_PADDING / 16}rem;\n\t\t\t}\n\t\t\t::slotted(kompis-radio-button) {\n\t\t\t\tmargin-bottom: ${spacing.space150 / 16}rem;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\t.heading {\n\t\t\t\tdisplay: block;\n\t\t\t\tmargin-bottom: ${spacing.space75 / 16}rem;\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-wrap: wrap;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\t\t\t.help {\n\t\t\t\tcolor: ${color.neutral.grey700};\n\t\t\t}\n\t\t\t.errorMessage kompis-text {\n\t\t\t\tcolor: ${color.component.dangerDefault};\n\t\t\t\ttransition-property: color;\n\t\t\t\ttransition-duration: ${motion.duration.small};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = RadioGroupStyle;\n//# sourceMappingURL=RadioGroupStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nrequire(\"@inter-ikea-kompis/component-text\");\nconst RadioGroupStyle_1 = __importDefault(require(\"./RadioGroupStyle\"));\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n * This component should be used for adding some styles around radio buttons.\n */\nlet RadioGroup = class RadioGroup extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Help text describing the purpose of this radio button group.\n this.helpText = null;\n // Heading.\n this.heading = null;\n // When invalid, an invalid message will be shown\n this.invalid = false;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getHeading()}\n\t\t\t
this.onKeyDown(event)}\">\n\t\t\t\t\n\t\t\t
\n\t\t\t${this.getHelpText()}\n\t\t\t${this.getErrorMessage()}\n\t\t\t\n\t\t`;\n }\n /**\n * When key down.\n *\n * @param event Keyboard event.\n */\n onKeyDown(event) {\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n event.preventDefault();\n this.changeButtonFocus(+1);\n break;\n case 'ArrowLeft':\n case 'ArrowUp':\n event.preventDefault();\n this.changeButtonFocus(-1);\n break;\n }\n }\n /**\n * @param increment\n */\n changeButtonFocus(increment) {\n var _a;\n const radioButtons = Array.from(this.querySelectorAll('kompis-radio-button')).filter((node) => !node.disabled);\n const matchedRadioButton = radioButtons.find((element) => element.matches(':focus-within'));\n if (matchedRadioButton) {\n const index = radioButtons.indexOf(matchedRadioButton);\n (_a = radioButtons[(radioButtons.length + index + increment) % radioButtons.length]) === null || _a === void 0 ? void 0 : _a.focus();\n }\n }\n /**\n * @returns Template.\n */\n getErrorMessage() {\n if (!this.helpText) {\n return null;\n }\n if (this.invalid) {\n return (0, web_component_1.html) `\n\t\t\t\t\n\t\t\t\t\t${this.helpText}\n\t\t\t\t\n\t\t\t`;\n }\n return null;\n }\n /**\n * Render the group name.\n *\n * @returns Template.\n */\n getHeading() {\n if (!this.heading) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
\n\t\t\t\t${this.heading}\n\t\t\t
\n\t\t`;\n }\n /**\n * Render the group name.\n *\n * @returns Template.\n */\n getHelpText() {\n if (!this.helpText) {\n return null;\n }\n if (!this.invalid) {\n return (0, web_component_1.html) `\n\t\t\t\t
\n\t\t\t\t\t${this.helpText}\n\t\t\t\t
\n\t\t\t`;\n }\n return null;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], RadioGroup.prototype, \"helpText\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], RadioGroup.prototype, \"heading\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], RadioGroup.prototype, \"invalid\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], RadioGroup.prototype, \"theme\", void 0);\nRadioGroup = __decorate([\n (0, web_component_1.customElement)('kompis-radio-group')\n], RadioGroup);\nexports.default = RadioGroup;\n//# sourceMappingURL=RadioGroup.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RadioLayoutEnum = exports.RadioGroup = exports.RadioButton = void 0;\nconst RadioButton_1 = __importDefault(require(\"./components/radio-button/RadioButton\"));\nexports.RadioButton = RadioButton_1.default;\nconst RadioGroup_1 = __importDefault(require(\"./components/radio-group/RadioGroup\"));\nexports.RadioGroup = RadioGroup_1.default;\nconst RadioLayoutEnum_1 = __importDefault(require(\"./enums/RadioLayoutEnum\"));\nexports.RadioLayoutEnum = RadioLayoutEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SwitchLayoutTypeEnum;\n(function (SwitchLayoutTypeEnum) {\n SwitchLayoutTypeEnum[\"subtle\"] = \"subtle\";\n SwitchLayoutTypeEnum[\"emphasized\"] = \"emphasized\";\n})(SwitchLayoutTypeEnum || (SwitchLayoutTypeEnum = {}));\nexports.default = SwitchLayoutTypeEnum;\n//# sourceMappingURL=SwitchLayoutTypeEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst SwitchLayoutTypeEnum_1 = __importDefault(require(\"../../enums/SwitchLayoutTypeEnum\"));\nconst HEIGHT = 24;\nconst WIDTH = 48;\nconst PADDING = 2;\nconst SLIDER_RADIUS = HEIGHT - PADDING * 2;\nconst SLIDER_DISTANCE = WIDTH - SLIDER_RADIUS - PADDING * 2;\nclass SwitchStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.layout Layout.\n * @param options.isDisabled Disabled.\n * @param options.showOutline Outline.\n * @param options.isChecked Checked.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n var _a;\n const { color, spacing, motion } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t${themes_1.FontStyle.getStyle({\n type: enums_1.ThemeFontStyleTypeEnum.bodyLarge,\n theme: options.theme\n })}\n\t\t\tlabel,\n\t\t\tinput {\n\t\t\t\toutline: none;\n\t\t\t\twidth: auto;\n\t\t\t\tfont-size: inherit;\n\t\t\t\t-webkit-appearance: none;\n\t\t\t}\n\t\t\tlabel {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tuser-select: none;\n\t\t\t\tmargin: 0 ${spacing.space100 / 16}rem;\n\t\t\t\tcolor: ${color.text.default};\n\t\t\t}\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tcursor: pointer;\n\t\t\t}\n\t\t\t.container {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\talign-items: center;\n\t\t\t\tposition: relative;\n\t\t\t}\n\t\t\tinput {\n\t\t\t\topacity: 0;\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tmargin: 0;\n\t\t\t\toutline: 0;\n\t\t\t\tpadding: 0;\n\t\t\t\tcursor: ${options.isDisabled ? 'default' : 'pointer'};\n\t\t\t}\n\t\t\t.background {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tpointer-events: none;\n\t\t\t\tposition: relative;\n\t\t\t\theight: ${HEIGHT / 16}rem;\n\t\t\t\twidth: ${WIDTH / 16}rem;\n\t\t\t\tborder-radius: ${HEIGHT / 2 / 16}rem;\n\t\t\t\tbackground-color: ${color.neutral.grey500};\n\t\t\t\ttransition-property: background-color, opacity, outline;\n\t\t\t\ttransition-duration: ${motion.duration.medium};\n\t\t\t\ttransition-timing-function: ${motion.ease.linear};\n\t\t\t}\n\t\t\t.container:hover .background {\n\t\t\t\tbackground-color: ${color.component.switchOff};\n\t\t\t}\n\t\t\t.icon-holder-checkmark {\n\t\t\t\tposition: absolute;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t}\n\t\t\t.slider {\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: ${PADDING / 16}rem;\n\t\t\t\tleft: ${PADDING / 16}rem;\n\t\t\t\ttransition: transform ${motion.duration.medium};\n\t\t\t\tborder-radius: 50%;\n\t\t\t\twidth: ${SLIDER_RADIUS / 16}rem;\n\t\t\t\theight: ${SLIDER_RADIUS / 16}rem;\n\t\t\t\tbackground-color: ${color.neutral.white};\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t}\n\t\t\t:host(:dir(rtl)) .slider {\n\t\t\t\tleft: auto;\n\t\t\t\tright: ${PADDING / 16}rem;\n\t\t\t}\n\t\t\t:host-context([dir='rtl']) .slider {\n\t\t\t\tleft: auto;\n\t\t\t\tright: ${PADDING / 16}rem;\n\t\t\t}\n\t\t\t${this.getChecked(options)}\n\t\t\t${(_a = this.getOutline(options)) !== null && _a !== void 0 ? _a : ''}\n\t\t\t${this.getDisabled(options)}\n\t\t`;\n }\n /**\n * Returns styles.\n *\n * @param options\n * @param options.isDisabled\n * @param options.theme\n * @returns Styles.\n */\n static getDisabled(options) {\n if (!options.isDisabled) {\n return '';\n }\n const { color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t.container .background {\n\t\t\t\tbackground-color: ${color.disabled.default};\n\t\t\t}\n\t\t\tlabel,\n\t\t\tkompis-icon {\n\t\t\t\tcolor: ${color.disabled.default};\n\t\t\t}\n\t\t\t.container:hover .background {\n\t\t\t\tbackground-color: ${color.disabled.default};\n\t\t\t}\n\t\t\t.container:hover kompis-icon {\n\t\t\t\tcolor: ${color.disabled.default};\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.layout Layout.\n * @param options.showOutline Outline.\n * @param options.isChecked Checked.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getOutline(options) {\n if (!options.showOutline) {\n return null;\n }\n const { focusOutline, border, color, motion } = options.theme;\n const hoverColor = options.isChecked ? this.getHoverColor(options) : color.component.switchOff;\n return (0, web_component_1.css) `\n\t\t\t.outline {\n\t\t\t\tz-index: inherit;\n\t\t\t\tborder-radius: ${border.radius.radius64 / 16}rem;\n\t\t\t\tpointer-events: none;\n\t\t\t\ttransition-property: top, left, right, bottom, opacity;\n\t\t\t\ttransition-duration: ${motion.duration.medium};\n\t\t\t\tposition: absolute;\n\t\t\t\tbox-shadow: 0 0 0 ${focusOutline.width / 16}rem ${focusOutline.color};\n\t\t\t\tleft: -${focusOutline.offset / 16}rem;\n\t\t\t\ttop: -${focusOutline.offset / 16}rem;\n\t\t\t\tright: -${focusOutline.offset / 16}rem;\n\t\t\t\tbottom: -${focusOutline.offset / 16}rem;\n\t\t\t}\n\t\t\t.container .background {\n\t\t\t\t${hoverColor ? `background-color: ${hoverColor}` : ''};\n\t\t\t}\n\t\t\tkompis-icon {\n\t\t\t\t${hoverColor ? `color: ${hoverColor}` : ''};\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.layout Layout.\n * @param options.isChecked Checked.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getChecked(options) {\n const { motion } = options.theme;\n if (!options.isChecked) {\n return (0, web_component_1.css) `\n\t\t\t\t.icon-holder-checkmark {\n\t\t\t\t\ttransition-property: opacity;\n\t\t\t\t\ttransition-duration: ${motion.duration.medium};\n\t\t\t\t\ttransition-timing-function: ${motion.ease.linear};\n\t\t\t\t\topacity: 0;\n\t\t\t\t}\n\t\t\t`;\n }\n const activeColor = this.getActiveColor(options);\n const hoverColor = this.getHoverColor(options);\n return (0, web_component_1.css) `\n\t\t\t.container .slider {\n\t\t\t\ttransform: translateX(${SLIDER_DISTANCE / 16}rem);\n\t\t\t}\n\t\t\t:host(:dir(rtl)) .container .slider {\n\t\t\t\ttransform: translateX(-${SLIDER_DISTANCE / 16}rem);\n\t\t\t}\n\t\t\t:host-context([dir='rtl']) .container .slider {\n\t\t\t\ttransform: translateX(-${SLIDER_DISTANCE / 16}rem);\n\t\t\t}\n\t\t\t.background {\n\t\t\t\t${activeColor ? `background-color: ${activeColor};` : ''};\n\t\t\t}\n\t\t\t.container:hover .background {\n\t\t\t\t${hoverColor ? `background-color: ${hoverColor}` : ''};\n\t\t\t}\n\t\t\t.container:hover kompis-icon {\n\t\t\t\t${hoverColor ? `color: ${hoverColor}` : ''};\n\t\t\t}\n\t\t\t.icon-holder-checkmark {\n\t\t\t\ttransition-property: opacity;\n\t\t\t\ttransition-duration: ${motion.duration.medium};\n\t\t\t\ttransition-timing-function: ${motion.ease.linear};\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t\tkompis-icon {\n\t\t\t\t${activeColor ? `color: ${activeColor}` : ''};\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns active color.\n *\n * @param options Options.\n * @param options.layout Layout.\n * @param options.theme Theme.\n * @returns Active color.\n */\n static getActiveColor(options) {\n const { color } = options.theme;\n switch (options.layout) {\n case SwitchLayoutTypeEnum_1.default.emphasized:\n return color.accent.primaryAccent;\n case SwitchLayoutTypeEnum_1.default.subtle:\n return color.component.primaryDefault;\n }\n return null;\n }\n /**\n * Returns hover color.\n *\n * @param options Options.\n * @param options.layout Layout.\n * @param options.theme Theme.\n * @returns Hover color.\n */\n static getHoverColor(options) {\n const { color } = options.theme;\n switch (options.layout) {\n case SwitchLayoutTypeEnum_1.default.emphasized:\n return color.accent.primaryAccentDark;\n case SwitchLayoutTypeEnum_1.default.subtle:\n return color.component.primaryHover;\n }\n return null;\n }\n}\nexports.default = SwitchStyle;\n//# sourceMappingURL=SwitchStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst icons_1 = require(\"@inter-ikea-kompis/icons\");\nrequire(\"@inter-ikea-kompis/component-icon\");\nrequire(\"@inter-ikea-kompis/component-text\");\nconst SwitchLayoutTypeEnum_1 = __importDefault(require(\"../../enums/SwitchLayoutTypeEnum\"));\nconst SwitchStyle_1 = __importDefault(require(\"./SwitchStyle\"));\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n *\n * @event change When the switch is toggled.\n */\nlet Switch = class Switch extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // A text that describes the action of the switch control.\n this.label = null;\n // ID of the input element.\n this.id = '';\n // Changes the style of the switch control.\n this.layout = SwitchLayoutTypeEnum_1.default.emphasized;\n // Like a native input element.\n this.disabled = false;\n // Applicable when type is switch or checkbox.\n this.checked = false;\n this.showOutline = false; // State to show outline\n this.pointerIsDown = false; // To distinguish between how focus have been captured\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getSwitch()}\n\t\t`;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n getSwitch() {\n return (0, web_component_1.html) `\n\t\t\t
\n\t\t\t\t${this.getCheckableInputElement()}\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t${this.getSwitchSlider()}\n\t\t\t\t
\n\t\t\t\t${this.getLabel()}\n\t\t\t
\n\t\t`;\n }\n /**\n * HTML event handler.\n */\n onFocusOut() {\n this.showOutline = false;\n this.pointerIsDown = false;\n this.requestUpdate();\n }\n /**\n * HTML event handler.\n */\n onFocus() {\n this.showOutline = !this.pointerIsDown;\n this.requestUpdate();\n }\n /**\n * HTML event handler.\n */\n onPointerDown() {\n this.pointerIsDown = true;\n }\n /**\n * @returns Template.\n */\n getCheckableInputElement() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n `;\n }\n /**\n * Runs when change event occurs.\n *\n * @param event HTMLEvent.\n */\n onChange(event) {\n event.stopPropagation();\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, detail: { checked: !this.checked } }));\n }\n /**\n * Runs when input event occurs.\n *\n * @param event HTMLEvent.\n */\n onInput(event) {\n event.stopPropagation();\n }\n /**\n * @returns Template.\n */\n getSwitchSlider() {\n return (0, web_component_1.html) `\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t`;\n }\n /**\n * @returns Template.\n */\n getLabel() {\n if (!this.label) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Switch.prototype, \"label\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Switch.prototype, \"id\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Switch.prototype, \"layout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Switch.prototype, \"disabled\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Switch.prototype, \"checked\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Switch.prototype, \"theme\", void 0);\nSwitch = __decorate([\n (0, web_component_1.customElement)('kompis-switch')\n], Switch);\nexports.default = Switch;\n//# sourceMappingURL=Switch.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SwitchLayoutTypeEnum = exports.Switch = void 0;\nconst Switch_1 = __importDefault(require(\"./components/switch/Switch\"));\nexports.Switch = Switch_1.default;\nconst SwitchLayoutTypeEnum_1 = __importDefault(require(\"./enums/SwitchLayoutTypeEnum\"));\nexports.SwitchLayoutTypeEnum = SwitchLayoutTypeEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ActionListBorderEnum;\n(function (ActionListBorderEnum) {\n ActionListBorderEnum[\"none\"] = \"none\";\n ActionListBorderEnum[\"top\"] = \"top\";\n ActionListBorderEnum[\"bottom\"] = \"bottom\";\n})(ActionListBorderEnum || (ActionListBorderEnum = {}));\nexports.default = ActionListBorderEnum;\n//# sourceMappingURL=ActionListBorderEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ActionListControlEnum;\n(function (ActionListControlEnum) {\n ActionListControlEnum[\"checkbox\"] = \"Checkbox\";\n ActionListControlEnum[\"chevron\"] = \"Chevron\";\n ActionListControlEnum[\"radioButton\"] = \"RadioButton\";\n ActionListControlEnum[\"switch\"] = \"Switch\";\n})(ActionListControlEnum || (ActionListControlEnum = {}));\nexports.default = ActionListControlEnum;\n//# sourceMappingURL=ActionListControlEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst MIN_HEIGHT = 92;\nconst COMPACT_MIN_HEIGHT = 48;\n/**\n * A class with style.\n */\nclass ActionListItemStyle {\n /**\n * Returns styles.\n *\n * @param options The props.\n * @param options.theme Theme.\n * @param options.disabled Disabled.\n * @param options.compact For compact version.\n * @param options.hovered Hovered.\n * @param options.checked Checked.\n * @param options.actionListBorder Border.\n * @returns Styles.\n */\n static getStyle(options) {\n const { color, spacing, focusOutline, motion } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t\tpointer-events: ${options.disabled ? 'none' : 'initial'};\n\t\t\t}\n\n\t\t\tbutton {\n\t\t\t\t/* Disable user agent styling */\n\t\t\t\tbackground: none;\n\t\t\t\toutline: none;\n\t\t\t\tborder: none;\n\t\t\t\tbox-shadow: none;\n\t\t\t\tposition: relative;\n\t\t\t\ttext-align: initial;\n\t\t\t\twidth: 100%;\n\t\t\t\tpadding: ${options.compact ? spacing.space50 / 16 : spacing.space150 / 16}rem\n\t\t\t\t\t${this.getPadding(options) / 16}rem;\n\t\t\t\tmin-height: ${options.compact ? COMPACT_MIN_HEIGHT / 16 : MIN_HEIGHT / 16}rem;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: space-between;\n\t\t\t\tcolor: ${options.disabled ? color.disabled.default : color.text.dark};\n\t\t\t}\n\t\t\tbutton::-moz-focus-inner {\n\t\t\t\tborder: 0;\n\t\t\t}\n\t\t\t.outline {\n\t\t\t\tposition: absolute;\n\t\t\t\tpointer-events: none;\n\t\t\t\topacity: 0;\n\t\t\t\ttransition-duration: ${focusOutline.transitionTime}s;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\tright: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\ttransition-property: opacity, top, left, right, bottom;\n\t\t\t\tborder-radius: ${focusOutline.borderRadius / 16}rem;\n\t\t\t\tbox-shadow: 0 0 0 ${focusOutline.width / 16}rem;\n\t\t\t}\n\t\t\tbutton:focus-visible .outline {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t\tbutton:hover {\n\t\t\t\tcursor: ${options.disabled ? 'initial' : 'pointer'};\n\t\t\t}\n\t\t\t@media (pointer: fine) {\n\t\t\t\tbutton:hover .header {\n\t\t\t\t\ttext-decoration: ${options.disabled ? 'inital' : 'underline'};\n\t\t\t\t}\n\t\t\t}\n\t\t\t.textContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\t\t\t.spacing {\n\t\t\t\twidth: ${spacing.space125 / 16}rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t}\n\t\t\t.icon {\n\t\t\t\ttransition: transform ${motion.duration.medium} ${motion.ease.easy};\n\t\t\t\ttransition-duration: ${motion.duration.medium};\n\t\t\t\tcolor: ${options.disabled ? color.disabled.default : color.icon.default};\n\t\t\t}\n\t\t\timg {\n\t\t\t\twidth: ${48 / 16}rem;\n\t\t\t\theight: ${48 / 16}rem;\n\t\t\t\topacity: ${options.disabled ? 0.5 : 1};\n\t\t\t}\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tmargin-inline-end: ${spacing.space125 / 16}rem;\n\t\t\t}\n\t\t\t${this.getBorder(options)}\n\t\t\t${this.getRtlRules()}\n\t\t\t${this.getHoveredStyle(options)}\n\t\t`;\n }\n /**\n * Returns styles.\n *\n * @param options The props.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getPadding(options) {\n if (!options.horizontalPadding) {\n return 0;\n }\n return options.theme.spacing.space150;\n }\n /**\n * Returns styles.\n *\n * @returns Styles.\n */\n static getRtlRules() {\n return (0, web_component_1.css) `\n\t\t\t:host(:dir(rtl)) .icon {\n\t\t\t\ttransform: rotate(-180deg);\n\t\t\t}\n\t\t\t:host-context([dir='rtl']) .icon {\n\t\t\t\ttransform: rotate(-180deg);\n\t\t\t\tmargin-right: auto;\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\t\t`;\n }\n /**\n * @param options\n */\n static getHoveredStyle(options) {\n if (options.hovered && !options.checked) {\n return (0, web_component_1.css) `\n\t\t\t\t@media (pointer: fine) {\n\t\t\t\t\tbutton .header {\n\t\t\t\t\t\ttext-decoration: ${options.disabled ? 'inital' : 'underline'};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t`;\n }\n return '';\n }\n /**\n * Returns styles.\n *\n * @param options The props.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getBorder(options) {\n if (options.actionListBorder !== 'none') {\n return (0, web_component_1.css) `\n\t\t\t\t:host {\n\t\t\t\t\tborder-${options.actionListBorder}: ${options.theme.border.thickness.thin / 16}rem solid\n\t\t\t\t\t${options.disabled ? options.theme.color.disabled.default : options.theme.color.border.light};\n\t\t\t\t}\n\t\t\t`;\n }\n return '';\n }\n}\nexports.default = ActionListItemStyle;\n//# sourceMappingURL=ActionListItemStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst icons_1 = require(\"@inter-ikea-kompis/icons\");\nconst component_checkbox_1 = require(\"@inter-ikea-kompis/component-checkbox\");\nconst component_checkbox_2 = require(\"@inter-ikea-kompis/component-checkbox\");\nconst component_radio_button_1 = require(\"@inter-ikea-kompis/component-radio-button\");\nconst component_switch_1 = require(\"@inter-ikea-kompis/component-switch\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@inter-ikea-kompis/component-icon\");\nrequire(\"@inter-ikea-kompis/component-checkbox\");\nrequire(\"@inter-ikea-kompis/component-radio-button\");\nrequire(\"@inter-ikea-kompis/component-switch\");\nrequire(\"@inter-ikea-kompis/component-text\");\nconst ActionListBorderEnum_1 = __importDefault(require(\"../../enums/ActionListBorderEnum\"));\nconst ActionListControlEnum_1 = __importDefault(require(\"../../enums/ActionListControlEnum\"));\nconst ActionListItemStyle_1 = __importDefault(require(\"./ActionListItemStyle\"));\n/**\n * Component that can render in an opened or closed state.\n *\n * @event select Triggered when action list or input control is clicked.\n */\nlet ActionListItem = class ActionListItem extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Label\n this.label = null;\n // Caption\n this.caption = null;\n // Leading icon\n this.leadingIcon = null;\n // Leading Image\n this.imageSrc = null;\n // Horizontal padding\n this.horizontalPadding = false;\n // Disabled\n this.disabled = false;\n // For the compact variant\n this.compact = false;\n // Controls\n this.control = null;\n // Border for the action list\n this.actionListBorder = ActionListBorderEnum_1.default.bottom;\n // Label of the checkbox or radio button control\n this.controlLabel = null;\n // Is \"true\" if a control is checked\n this.checked = false;\n // Selected index\n this.selectedIndex = null;\n this.hovered = false;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t${this.getIcon()} ${this.getImage()}\n\t\t\t\t\t
\n\t\t\t\t\t\t${this.label}\n\t\t\t\t\t\t${this.getCaption()}\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t${this.getControl()}\n\t\t\t\t
\n\t\t\t\n\t\t\t\n\t\t`;\n }\n onMouseOver() {\n if (this.hovered) {\n return;\n }\n this.hovered = true;\n this.requestUpdate();\n }\n onMouseOut() {\n if (!this.hovered) {\n return;\n }\n this.hovered = false;\n this.requestUpdate();\n }\n /**\n * Returns the caption if provided.\n */\n getCaption() {\n if (!this.caption) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t${this.caption}\n\t\t`;\n }\n /**\n * Returns an icon if provided.\n */\n getIcon() {\n if (!this.leadingIcon) {\n return null;\n }\n else if (!this.imageSrc) {\n return (0, web_component_1.html) `\n\t\t\t\t\n\t\t\t\t
\n\t\t\t`;\n }\n else {\n return null;\n }\n }\n /**\n * Returns an image if provided.\n */\n getImage() {\n if (!this.imageSrc) {\n return null;\n }\n else if (!this.leadingIcon) {\n return (0, web_component_1.html) `\"${this.label}\"\n\t\t\t\t
`;\n }\n else {\n return null;\n }\n }\n /**\n * Returns a control if provided.\n */\n getControl() {\n switch (this.control) {\n case ActionListControlEnum_1.default.checkbox:\n return (0, web_component_1.html) ` this.onClick(event)}\"\n\t\t\t\t\t.checked=\"${this.checked}\"\n\t\t\t\t\t.disabled=\"${this.disabled}\"\n\t\t\t\t\t.label=\"${this.controlLabel ? String(this.controlLabel) : null}\"\n\t\t\t\t\t.alignButton=\"${component_checkbox_1.CheckboxAlignButtonEnum.right}\"\n\t\t\t\t\t.layout=\"${component_checkbox_2.CheckboxLayoutEnum.subtle}\"\n\t\t\t\t\t.hovered=\"${this.hovered}\"\n\t\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t>`;\n case ActionListControlEnum_1.default.chevron:\n return (0, web_component_1.html) `\n\t\t\t\t\t\n\t\t\t\t`;\n case ActionListControlEnum_1.default.radioButton:\n return (0, web_component_1.html) `\n\t\t\t\t\t\n\t\t\t\t`;\n case ActionListControlEnum_1.default.switch:\n return (0, web_component_1.html) `\n\t\t\t\t\t this.onClick(event)}\"\n\t\t\t\t\t\t.checked=\"${this.checked}\"\n\t\t\t\t\t\t.disabled=\"${this.disabled}\"\n\t\t\t\t\t\t.layout=\"${component_switch_1.SwitchLayoutTypeEnum.subtle}\"\n\t\t\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t\t>\n\t\t\t\t`;\n default:\n return null;\n }\n }\n /**\n * Called when radio button checked value has changed.\n *\n * @param event Event data.\n */\n onClick(event) {\n event.stopPropagation();\n event.preventDefault();\n if (this.control === ActionListControlEnum_1.default.radioButton && this.checked) {\n return;\n }\n const enumsToCheck = [\n ActionListControlEnum_1.default.checkbox,\n ActionListControlEnum_1.default.radioButton,\n ActionListControlEnum_1.default.switch\n ];\n this.dispatchEvent(new CustomEvent('select', {\n bubbles: true,\n detail: {\n checked: this.control && enumsToCheck.includes(this.control) ? this.checked : null,\n selectedIndex: this.selectedIndex\n }\n }));\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ActionListItem.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ActionListItem.prototype, \"label\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ActionListItem.prototype, \"caption\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ActionListItem.prototype, \"leadingIcon\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ActionListItem.prototype, \"imageSrc\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ActionListItem.prototype, \"horizontalPadding\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ActionListItem.prototype, \"disabled\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ActionListItem.prototype, \"compact\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ActionListItem.prototype, \"control\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ActionListItem.prototype, \"actionListBorder\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], ActionListItem.prototype, \"controlLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ActionListItem.prototype, \"checked\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], ActionListItem.prototype, \"selectedIndex\", void 0);\nActionListItem = __decorate([\n (0, web_component_1.customElement)('kompis-action-list-item')\n], ActionListItem);\nexports.default = ActionListItem;\n//# sourceMappingURL=ActionListItem.js.map","import \"@inter-ikea-kompis/component-action-list/lib/components/action-list-item/ActionListItem\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisActionListItem extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-action-list-item\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.actionListBorder = props.actionListBorder;\n element.caption = props.caption;\n element.checked = props.checked;\n element.compact = props.compact;\n element.control = props.control;\n element.controlLabel = props.controlLabel;\n element.disabled = props.disabled;\n element.horizontalPadding = props.horizontalPadding;\n element.imageSrc = props.imageSrc;\n element.label = props.label;\n element.leadingIcon = props.leadingIcon;\n element.selectedIndex = props.selectedIndex;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onSelect, \"select\");\n }\n}\nKompisActionListItem.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n actionListBorder: PropTypes.string,\n caption: PropTypes.string,\n checked: PropTypes.bool,\n compact: PropTypes.bool,\n control: PropTypes.string,\n controlLabel: PropTypes.number,\n disabled: PropTypes.bool,\n horizontalPadding: PropTypes.bool,\n imageSrc: PropTypes.string,\n label: PropTypes.string,\n leadingIcon: PropTypes.string,\n selectedIndex: PropTypes.number,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n onSelect: PropTypes.func\n};\nexport default KompisActionListItem;\n","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nrequire(\"@inter-ikea-kompis/component-radio-button\");\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n *\n * Component that renders a list of {ActionListItem}.\n */\nlet ActionList = class ActionList extends web_component_1.KompisElement {\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
this.onKeyDown(event)}\">\n\t\t\t\t\n\t\t\t
\n\t\t`;\n }\n /**\n * When key down.\n *\n * @param event Keyboard event.\n */\n onKeyDown(event) {\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n event.preventDefault();\n this.changeButtonFocus(+1);\n break;\n case 'ArrowLeft':\n case 'ArrowUp':\n event.preventDefault();\n this.changeButtonFocus(-1);\n break;\n }\n }\n /**\n * Normally there would be just one kind of control of ActionListItems within the ActionList, for example only radio buttons, or only checkboxes, but it's possible to have a mix.\n * There can theoretically be several groups of radio buttons which is what this logic deals with.\n * Navigation using the arrow keys should only navigate within one group of radio buttons.\n */\n getRadioButtonGroups() {\n const radioButtons = Array.from(this.querySelectorAll('kompis-action-list-item')).map((actionItem) => { var _a; return (_a = actionItem.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('kompis-radio-button'); });\n return radioButtons\n .reduce((groups, radioButton) => {\n if (radioButton && !radioButton.disabled) {\n groups[groups.length - 1].push(radioButton);\n }\n else if (!radioButton) {\n // Not a radio button control? Create a new group.\n groups.push([]);\n }\n return groups;\n }, [[]])\n .filter((group) => group.length);\n }\n /**\n * @returns The focused kompis radio button within this shadow dom or null if there isn't one in focus.\n */\n findFocusedRadioButton() {\n var _a, _b;\n const rootNode = this.getRootNode();\n if (this.isShadowRoot(rootNode)) {\n return ((_b = (_a = rootNode.activeElement) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('kompis-radio-button')) || null;\n }\n return null;\n }\n /**\n * @param increment\n */\n changeButtonFocus(increment) {\n var _a;\n const groups = this.getRadioButtonGroups();\n const focusedRadioButton = this.findFocusedRadioButton();\n const group = groups.find((group) => group.some((element) => element === focusedRadioButton));\n if (group) {\n const focusedElement = group.find((element) => element === focusedRadioButton);\n if (focusedElement) {\n const index = group.indexOf(focusedElement);\n (_a = group[(group.length + index + increment) % group.length]) === null || _a === void 0 ? void 0 : _a.focus();\n }\n }\n }\n /**\n * @param target\n */\n isShadowRoot(target) {\n return 'activeElement' in target;\n }\n};\nActionList = __decorate([\n (0, web_component_1.customElement)('kompis-action-list')\n], ActionList);\nexports.default = ActionList;\n//# sourceMappingURL=ActionList.js.map","import \"@inter-ikea-kompis/component-action-list/lib/components/action-list/ActionList\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisActionList extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-action-list\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) { }\n updateAllEventListeners(element, props) { }\n}\nKompisActionList.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any\n};\nexport default KompisActionList;\n","function getFeatures(flagMap, source) {\n const result = [];\n Object.keys(flagMap).forEach(key => {\n const val = flagMap[key];\n const sourceVal = source[key];\n if (typeof val === 'object' && typeof sourceVal === 'object') {\n result.push(getFeatures(val, sourceVal));\n }\n else if (typeof sourceVal === 'string' && Boolean(val)) {\n result.push(sourceVal);\n }\n });\n return result.join(' ');\n}\nexport function createFeatureMapper(feature) {\n return function (flagMap) {\n return [feature.base, flagMap ? getFeatures(flagMap, feature) : ''].join(' ').trim();\n };\n}\n","// @ts-ignore\nconst CSS = 'hr.divider{border-block-start:1px solid rgb(var(--colour-neutral-3,223,223,223))}';\nimport { createFeatureMapper } from './utils/feature-configurator.js';\nconst features = {\n base: 'divider'\n};\nexport default { CSS, classnames: createFeatureMapper(features) };\n","// @ts-ignore\nconst CSS = '.focus-visible{box-shadow:0 0 0 4px var(--skapa-focus-ring-internal,rgb(var(--colour-neutral-1,255,255,255)));outline:2px solid var(--skapa-focus-ring-external,rgb(var(--colour-neutral-7,17,17,17)));outline-offset:4px;transition:outline .2s ease-out,box-shadow .2s ease-out}';\nexport default { CSS, CSSWithHost: `:host(.focus-visible),${CSS}` };\n","// @ts-ignore\nconst CSS = '.link{color:rgb(var(--colour-text-and-icon-2,72,72,72));font-weight:400;text-decoration:underline}.link:active,.link:focus,.link:hover{color:rgb(var(--colour-text-and-icon-1,17,17,17))}.link--disabled{cursor:default;opacity:.4;pointer-events:none}.link--disabled:focus:before{border:0}.link--black{color:rgb(var(--colour-text-and-icon-1,17,17,17))}.link--black:active,.link--black:focus,.link--black:hover{color:rgb(var(--colour-text-and-icon-2,72,72,72))}.link--black.link--disabled{color:rgb(var(--colour-text-and-icon-1,17,17,17));cursor:default;opacity:.4;pointer-events:none}.link--black.link--disabled:focus:before{border:0}.link--black.link--disabled:active,.link--black.link--disabled:focus,.link--black.link--disabled:hover{color:rgb(var(--colour-text-and-icon-1,17,17,17))}.link--grey{color:rgb(var(--colour-text-and-icon-3,118,118,118))}.link--grey:active,.link--grey:focus,.link--grey:hover{color:rgb(var(--colour-text-and-icon-1,17,17,17))}.link--grey.link--disabled{color:rgb(var(--colour-text-and-icon-2,72,72,72));cursor:default;opacity:.4;pointer-events:none}.link--grey.link--disabled:focus:before{border:0}.link--grey.link--disabled:active,.link--grey.link--disabled:focus,.link--grey.link--disabled:hover{color:rgb(var(--colour-text-and-icon-2,72,72,72))}.link--white{color:rgb(var(--colour-static-white,255,255,255))}.link--white:active,.link--white:focus,.link--white:hover{color:rgb(var(--colour-static-light-grey,245,245,245))}.link--white.link--disabled{color:rgb(var(--colour-static-white,255,255,255));cursor:default;opacity:.4;pointer-events:none}.link--white.link--disabled:focus:before{border:0}.link--white.link--disabled:active,.link--white.link--disabled:focus,.link--white.link--disabled:hover{color:rgb(var(--colour-static-white,255,255,255))}.link--subtle{text-decoration:none}.link--subtle:active,.link--subtle:focus,.link--subtle:hover{text-decoration:underline}h1 .link,h2 .link,h3 .link,h4 .link,h5 .link,h6 .link,p .link{margin-bottom:0;text-decoration:underline}h1 .link .svg-icon,h2 .link .svg-icon,h3 .link .svg-icon,h4 .link .svg-icon,h5 .link .svg-icon,h6 .link .svg-icon,p .link .svg-icon{vertical-align:middle}h1 .link:active,h1 .link:focus,h1 .link:hover,h2 .link:active,h2 .link:focus,h2 .link:hover,h3 .link:active,h3 .link:focus,h3 .link:hover,h4 .link:active,h4 .link:focus,h4 .link:hover,h5 .link:active,h5 .link:focus,h5 .link:hover,h6 .link:active,h6 .link:focus,h6 .link:hover,p .link:active,p .link:focus,p .link:hover{text-decoration:underline}h1 .link--subtle,h2 .link--subtle,h3 .link--subtle,h4 .link--subtle,h5 .link--subtle,h6 .link--subtle,p .link--subtle{text-decoration:none}h1 .link--subtle:active,h1 .link--subtle:focus,h1 .link--subtle:hover,h2 .link--subtle:active,h2 .link--subtle:focus,h2 .link--subtle:hover,h3 .link--subtle:active,h3 .link--subtle:focus,h3 .link--subtle:hover,h4 .link--subtle:active,h4 .link--subtle:focus,h4 .link--subtle:hover,h5 .link--subtle:active,h5 .link--subtle:focus,h5 .link--subtle:hover,h6 .link--subtle:active,h6 .link--subtle:focus,h6 .link--subtle:hover,p .link--subtle:active,p .link--subtle:focus,p .link--subtle:hover{text-decoration:underline}a{outline:none}';\nimport { createFeatureMapper } from './utils/feature-configurator.js';\nconst baseClass = 'link';\nconst features = {\n base: baseClass,\n black: `${baseClass}--black`,\n grey: `${baseClass}--grey`,\n white: `${baseClass}--white`,\n subtle: `${baseClass}--subtle`,\n disabled: `${baseClass}--disabled`\n};\nexport default { CSS, classnames: createFeatureMapper(features) };\n","// @ts-ignore\nconst CSS = '.list{font-size:var(--skapa-list-font-size,.875rem);list-style-position:outside;padding-inline-start:var(--skapa-list-padding-start,1.9375rem)}.list ul.list{list-style-type:circle}.list ol.list{list-style-type:upper-alpha}.list ol,.list ul{padding-inline-start:var(--skapa-list-nested-padding-start,1.1875rem)}.list ol li,.list ul li{margin-top:var(--skapa-list-nested-item-margin-top,.5rem)}.list li:not(:first-child){margin-top:var(--skapa-list-item-margin-top,.75rem)}.list--small{--skapa-list-font-size:0.75rem;--skapa-list-padding-start:1.375rem;--skapa-list-item-margin-top:0.5rem;--skapa-list-nested-padding-start:0.875rem;--skapa-list-nested-item-margin-top:0.25rem}.list--large{--skapa-list-font-size:1rem;--skapa-list-padding-start:2rem;--skapa-list-item-margin-top:0.75rem;--skapa-list-nested-padding-start:1.25rem;--skapa-list-nested-item-margin-top:0.5rem}.list--xlarge{--skapa-list-font-size:1.25rem;--skapa-list-padding-start:2.5625rem;--skapa-list-item-margin-top:1rem;--skapa-list-nested-padding-start:1.5625rem;--skapa-list-nested-item-margin-top:0.75rem}';\nimport { createFeatureMapper } from './utils/feature-configurator.js';\nconst baseClass = 'list';\nconst features = {\n base: baseClass,\n small: `${baseClass}--small`,\n large: `${baseClass}--large`,\n xlarge: `${baseClass}--xlarge`\n};\nexport default { CSS, classnames: createFeatureMapper(features) };\n","// @ts-ignore\nconst CSS = '.table th{background-color:rgb(var(--colour-neutral-1,255,255,255));color:rgb(var(--colour-text-and-icon-2,72,72,72));font-size:.75rem;font-weight:400}.table a,.table td{color:rgb(var(--colour-text-and-icon-1,17,17,17))}.table a:hover{color:rgb(var(--colour-text-and-icon-2,72,72,72))}.table a:active,.table a:focus{color:rgb(var(--colour-text-and-icon-1,17,17,17))}.table td,.table th{border-bottom:1px solid rgb(var(--colour-neutral-3,223,223,223));padding-bottom:.75rem;padding-inline-end:1.5rem;padding-top:.75rem;padding-inline-start:0;text-align:initial}.table-header--sticky th{position:sticky;top:0;z-index:100}.table--inset td,.table--inset th{padding-inline-start:1.5rem}.table-body--striped tr:nth-child(odd){background-color:rgb(var(--colour-neutral-2,245,245,245))}.table tbody td,.table tbody th{padding-bottom:1.25rem;padding-top:1.25rem}.table:not(table){max-width:100%;overflow:auto}.table:not(table) table,table.table{border-collapse:initial;border-spacing:0;font-variant-numeric:tabular-nums;position:relative}.table--full-width:not(table) table,table.table--full-width{width:100%}';\nimport { createFeatureMapper } from './utils/feature-configurator.js';\nconst baseClass = 'table';\nconst features = {\n base: baseClass,\n inset: `${baseClass}--inset`,\n striped: `${baseClass}-body--striped`,\n fullWidth: `${baseClass}--full-width`,\n sticky: `${baseClass}-header--sticky`\n};\nexport default { CSS, classnames: createFeatureMapper(features) };\n","// @ts-ignore\nconst CSS = 'small{display:inline-block;font-size:.75rem}.h1{color:rgb(var(--colour-text-and-icon-1,17,17,17));font-size:1.5rem;font-weight:700;letter-spacing:-.0042em;line-height:1.45}@media (min-width:37.5em){.h1{font-size:2.25rem;letter-spacing:-.0063em;line-height:1.333}}.h2{color:rgb(var(--colour-text-and-icon-1,17,17,17));font-size:1.125rem;font-weight:700;line-height:1.444}@media (min-width:37.5em){.h2{font-size:1.5rem;letter-spacing:-.0042em;line-height:1.45}}.h3{font-size:1rem;line-height:1.5}.h3,.h4,.h5,.h6{color:rgb(var(--colour-text-and-icon-1,17,17,17));font-weight:700}.h4,.h5,.h6{font-size:.875rem;line-height:1.571}.text--heading-xl{color:rgb(var(--colour-text-and-icon-1,17,17,17));font-size:2rem;font-weight:700;letter-spacing:-.0056em;line-height:1.375}@media (min-width:37.5em){.text--heading-xl{font-size:3.25rem;letter-spacing:-.0091em;line-height:1.32}}.text--heading-l{color:rgb(var(--colour-text-and-icon-1,17,17,17));font-size:1.5rem;font-weight:700;letter-spacing:-.0042em;line-height:1.45}@media (min-width:37.5em){.text--heading-l{font-size:2.25rem;letter-spacing:-.0063em;line-height:1.333}}.text--heading-m{color:rgb(var(--colour-text-and-icon-1,17,17,17));font-size:1.125rem;font-weight:700;line-height:1.444}@media (min-width:37.5em){.text--heading-m{font-size:1.5rem;letter-spacing:-.0042em;line-height:1.45}}.text--heading-s{font-size:1rem;line-height:1.5}.text--heading-s,.text--heading-xs{color:rgb(var(--colour-text-and-icon-1,17,17,17));font-weight:700}.text--heading-xs{font-size:.875rem;line-height:1.571}.text--body-xl{font-size:1.25rem;line-height:1.6}.text--body-l,.text--body-xl{color:rgb(var(--colour-text-and-icon-2,72,72,72))}.text--body-l{font-size:1rem;line-height:1.625}.text--body-m{font-size:.875rem;line-height:1.571}.text--body-m,.text--body-s{color:rgb(var(--colour-text-and-icon-2,72,72,72))}.text--body-s{font-size:.75rem;line-height:1.5}';\nimport { createFeatureMapper } from './utils/feature-configurator.js';\nconst baseClass = 'text';\nconst features = {\n base: baseClass,\n heading: {\n xs: `${baseClass}--heading-xs`,\n s: `${baseClass}--heading-s`,\n m: `${baseClass}--heading-m`,\n l: `${baseClass}--heading-l`,\n xl: `${baseClass}--heading-xl`\n },\n body: {\n s: `${baseClass}--body-s`,\n m: `${baseClass}--body-m`,\n l: `${baseClass}--body-l`,\n xl: `${baseClass}--body-xl`\n }\n};\nexport default { CSS, classnames: createFeatureMapper(features) };\n","// @ts-ignore\nconst CSS = 'p:not(:last-of-type){margin-bottom:.75rem}small{display:inline-block;font-size:.75rem}h1{color:rgb(var(--colour-text-and-icon-1,17,17,17));font-size:1.5rem;font-weight:700;letter-spacing:-.0042em;line-height:1.45}@media (min-width:37.5em){h1{font-size:2.25rem;letter-spacing:-.0063em;line-height:1.333}}h2{color:rgb(var(--colour-text-and-icon-1,17,17,17));font-size:1.125rem;font-weight:700;line-height:1.444}@media (min-width:37.5em){h2{font-size:1.5rem;letter-spacing:-.0042em;line-height:1.45}}h3{font-size:1rem;line-height:1.5}h3,h4,h5,h6{color:rgb(var(--colour-text-and-icon-1,17,17,17));font-weight:700}h4,h5,h6{font-size:.875rem;line-height:1.571}.h1{color:rgb(var(--colour-text-and-icon-1,17,17,17));font-size:1.5rem;font-weight:700;letter-spacing:-.0042em;line-height:1.45}@media (min-width:37.5em){.h1{font-size:2.25rem;letter-spacing:-.0063em;line-height:1.333}}.h2{color:rgb(var(--colour-text-and-icon-1,17,17,17));font-size:1.125rem;font-weight:700;line-height:1.444}@media (min-width:37.5em){.h2{font-size:1.5rem;letter-spacing:-.0042em;line-height:1.45}}.h3{font-size:1rem;line-height:1.5}.h3,.h4,.h5,.h6{color:rgb(var(--colour-text-and-icon-1,17,17,17));font-weight:700}.h4,.h5,.h6{font-size:.875rem;line-height:1.571}';\nexport default { CSS };\n","import { getStore } from '@ingka/singleton-store';\nconst ICON_STORE_ID = 'skapa-icon-store';\n// The store will be initialized with a generic Map inside the getStore on first request.\nconst iconStore = getStore(ICON_STORE_ID);\nexport const registerIcon = (name, paths) => {\n if (!iconStore.has(name))\n iconStore.set(name, paths);\n};\nexport const getPaths = (name) => {\n if (!name)\n return;\n const result = iconStore.get(name);\n if (!result)\n console.error(`The icon: '${name}' has not been loaded yet!\\nDid you forget to import '@ingka/icon-store/${name}'?`);\n return result;\n};\n","import { registerIcon } from './index.js';\nregisterIcon('warning-triangle', [{ tag: 'path', att: { d: 'M11.0036 14.2499h2v-6h-2v6zm1 1.5c-.6904 0-1.25.5596-1.25 1.25 0 .6903.5596 1.25 1.25 1.25.6903 0 1.25-.5597 1.25-1.25 0-.6904-.5597-1.25-1.25-1.25z' } }, { tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'm1.1152 20.5341 10-19h1.7699l10 19-.8849 1.4658h-20l-.885-1.4658zm2.5413-.5342h16.6873l-8.3436-15.853L3.6565 20z' } }]);\n","import { iconTagName } from '@ingka/icon-webc';\nimport '@ingka/icon-store/warning-triangle';\nlet dangerButton;\nlet __inited = false;\nexport const generateDangerIcon = () => {\n if (!__inited) {\n dangerButton = document.createElement(iconTagName());\n dangerButton.icon = 'warning-triangle';\n __inited = true;\n }\n return dangerButton.cloneNode();\n};\n","import { config } from '@ingka/webc-tools';\n// @ts-ignore\nconst styles = '@keyframes skapa-message-in{0%{opacity:0;transform:translateY(1.5rem)}to{opacity:1;transform:translateY(0)}}@keyframes skapa-message-out{0%{opacity:1;transform:translateY(0);visibility:visible}99%{opacity:0;transform:translateY(-1.5rem);visibility:visible}to{opacity:0;transform:translateY(-1.5rem);visibility:hidden}}:host{align-items:center;display:flex;flex-direction:column;justify-content:center;min-height:5rem;position:relative}slot[name=message]{--skapa-loading-transition-duration:100ms;display:block;position:relative;text-align:center;width:100%}slot[name=message]::slotted(*){font-size:1rem;left:0;line-height:1.625;position:absolute;text-align:center;width:100%}slot[name=message]::slotted(:not(:last-of-type)){animation:skapa-message-out var(--skapa-loading-transition-duration) cubic-bezier(.4,0,.4,1) both}slot[name=message]::slotted(:last-of-type){animation:skapa-message-in var(--skapa-loading-transition-duration) cubic-bezier(.4,0,.4,1) backwards;animation-delay:var(--skapa-loading-transition-duration)}:host([leading]) slot[name=message]{text-align:start}:host([leading]) slot[name=message]::slotted(*){text-align:start}@media (prefers-reduced-motion:reduce){slot[name=message]{--skapa-loading-transition-duration:0ms}}';\n// @ts-ignore\nconst lightStyleRaw = '@keyframes skapa-message-in{0%{opacity:0;transform:translateY(1.5rem)}to{opacity:1;transform:translateY(0)}}@keyframes skapa-message-out{0%{opacity:1;transform:translateY(0);visibility:visible}99%{opacity:0;transform:translateY(-1.5rem);visibility:visible}to{opacity:0;transform:translateY(-1.5rem);visibility:hidden}}skapa-loading skapa-loading-ball{--skapa-loader-message-margin:2.5rem}skapa-loading skapa-loading-linear{--skapa-loader-message-margin:1rem}';\nimport SkapaElement from '@ingka/skapa-webc-element';\nconst skapaPrefixRegex = /(?:([^-])|^)skapa-/g;\nlet lightStyle = lightStyleRaw.toString();\nlet template;\nfunction getTemplate() {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = `\n \n \n `\n .replace(skapaPrefixRegex, `$1${config.prefix}-`);\n lightStyle = lightStyle.replace(skapaPrefixRegex, `$1${config.prefix}-`);\n }\n return template;\n}\nexport class Loading extends SkapaElement {\n constructor() {\n super();\n this.gatherProperties(['leading'], this);\n const shadow = this.attachShadow({ mode: 'open' });\n shadow.append(getTemplate().content.cloneNode(true));\n }\n connectedCallback() {\n super.connectedCallback();\n const lightStyles = document.createElement('style');\n lightStyles.slot = 'light-styles';\n lightStyles.innerHTML = lightStyle;\n this.append(lightStyles);\n }\n get leading() {\n return this.hasAttribute('leading');\n }\n set leading(enable) {\n this.toggleAttribute('leading', !!enable);\n }\n}\n","import SkapaElement from '@ingka/skapa-webc-element';\n// @ts-ignore\nconst styles = '@keyframes loading-bounce-small{0%,to{animation-timing-function:ease-in;transform:translateY(-160%)}40%{animation-timing-function:cubic-bezier(0,0,0,1);transform:translateY(20%)}}@keyframes loading-bounce{0%{animation-timing-function:ease-in;transform:translateY(0)}40%{animation-timing-function:ease-in;transform:translateY(2rem) scaleY(1)}50%{animation-timing-function:ease-out;transform:translateY(2rem) scaleY(.75)}60%{animation-timing-function:cubic-bezier(0,0,0,1);transform:translateY(2rem) scaleY(1)}to{transform:translateY(0)}}:host{animation:loading-bounce .7s infinite;border:var(--skapa-loading-ball-size,.5rem) solid var(--skapa-loading-ball-colour,rgb(var(--colour-semantic-informative,0,88,163)));border-radius:64px;display:inline-block;height:0;margin-bottom:calc(2rem + var(--skapa-loader-message-margin, 0rem));transform-origin:bottom;width:0}:host([medium]),:host([small]){animation-name:loading-bounce-small;margin-bottom:0}:host([small]){--skapa-loading-ball-size:0.125rem}:host([medium]){--skapa-loading-ball-size:0.25rem}:host([primary]){--skapa-loading-ball-colour:rgb(var(--colour-neutral-7,17,17,17))}:host([secondary]){--skapa-loading-ball-colour:currentColor}';\nconst sizes = ['small', 'medium', 'large'];\nconst colours = ['emphasized', 'primary', 'secondary'];\nexport class LoadingBall extends SkapaElement {\n constructor() {\n super();\n this.gatherProperties(['size', 'colour'], this);\n const shadow = this.attachShadow({ mode: 'open' });\n shadow.innerHTML = ``;\n }\n connectedCallback() {\n super.connectedCallback();\n if (!this.hasAttribute('aria-label'))\n this.setAttribute('aria-hidden', 'true');\n }\n get size() {\n return sizes.find(s => this.hasAttribute(s)) || 'large';\n }\n set size(value) {\n const target = sizes.find(s => s === value);\n if (target) {\n sizes.forEach(s => this.removeAttribute(s));\n if (target !== 'large')\n this.setAttribute(target, '');\n }\n }\n get colour() {\n return colours.find(s => this.hasAttribute(s)) || 'emphasized';\n }\n set colour(value) {\n const target = colours.find(s => s === value);\n if (target) {\n colours.forEach(s => this.removeAttribute(s));\n if (target !== 'emphasized')\n this.setAttribute(target, '');\n }\n }\n}\n","import SkapaElement from '@ingka/skapa-webc-element';\n// @ts-ignore\nconst styles = ':host{display:flex;height:.3125rem;margin-bottom:var(--skapa-loader-message-margin,0);position:relative;width:100%}label{clip:rect(1px,1px,1px,1px);height:1px;margin:-1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}progress{-webkit-appearance:none;appearance:none;background:rgb(var(--colour-neutral-2,245,245,245));border:0;border-radius:.375rem;height:100%;width:100%}progress::-webkit-progress-bar{background:rgb(var(--colour-neutral-2,245,245,245));border-radius:.375rem}progress::-moz-progress-bar{background:rgb(var(--colour-semantic-informative,0,88,163));border-radius:.375rem}progress::-webkit-progress-value{background:rgb(var(--colour-semantic-informative,0,88,163));border-radius:.375rem}@media (forced-colors:active){progress{appearance:revert;background:revert;border:revert;border-radius:revert;height:revert}}';\nlet template;\nfunction getTemplate() {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = `\n \n \n \n `;\n }\n return template;\n}\nconst properties = ['value', 'max'];\nexport class LoadingLinear extends SkapaElement {\n constructor() {\n super();\n this.gatherProperties([...properties], this);\n const shadow = this.attachShadow({ mode: 'open' });\n shadow.append(getTemplate().content.cloneNode(true));\n this.progressElement = shadow.querySelector('progress');\n }\n attributeChangedCallback(name, old, _new) {\n this.progressElement[name] = Number(_new);\n }\n get value() {\n return Number(this.getAttribute('value')) || 0;\n }\n set value(val) {\n this.setAttribute('value', val.toString());\n }\n get max() {\n return Number(this.getAttribute('max')) || 100;\n }\n set max(val) {\n this.setAttribute('max', val.toString());\n }\n}\nLoadingLinear.observedAttributes = properties;\n","import define from '@ingka/webc-tools';\nimport { Loading } from './src/Loading.js';\nimport { LoadingBall } from './src/LoadingBall.js';\nimport { LoadingLinear } from './src/LoadingLinear.js';\nexport { Loading, LoadingBall, LoadingLinear };\nexport const loadingTagName = define('loading', Loading);\nexport const loadingBallTagName = define('loading-ball', LoadingBall);\nexport const loadingBarTagName = define('loading-linear', LoadingLinear);\n","import { loadingBallTagName } from '@ingka/loading-webc';\nlet loading;\nlet __inited = false;\nexport const generateLoadingBall = () => {\n if (!__inited) {\n loading = document.createElement(loadingBallTagName());\n loading.id = 'loader';\n loading.size = 'medium';\n loading.colour = 'secondary';\n __inited = true;\n }\n return loading.cloneNode(true);\n};\n","import SkapaElement from '@ingka/skapa-webc-element';\nimport { generateDangerIcon } from './DangerIcon.js';\nimport { generateLoadingBall } from './LoadingBall.js';\nconst buttonPartsInitializer = { iconSlot: undefined, gap: undefined, label: undefined, loading: undefined };\nexport class ButtonAbstraction extends SkapaElement {\n constructor() {\n super();\n this.parts = { ...buttonPartsInitializer };\n this.hasIcon = false;\n this.__loadingAriaLabel = 'loading';\n this.disableClick = (ev) => {\n if (this.loading || this.disabled) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n };\n this.handleSlotChange = (ev) => {\n if (ev.target && (ev.target instanceof HTMLSlotElement)) {\n if (ev.target.name === 'icon') {\n this.inspectIconState();\n }\n }\n };\n this.handleFormControl = () => {\n if (!this.type || this.loading || this.disabled)\n return;\n const form = this.closest('form');\n if (form && this.type) {\n if (this.type === 'reset')\n return form.reset();\n else if (this.type === 'submit') {\n const event = new SubmitEvent('submit', { submitter: this, cancelable: true });\n form.reportValidity();\n form.dispatchEvent(event);\n setTimeout(() => {\n if (event.defaultPrevented)\n return;\n if (form.checkValidity())\n form.submit();\n });\n }\n }\n };\n this.syncDecorative = () => {\n var _a;\n if ((_a = this.spanBase) === null || _a === void 0 ? void 0 : _a.parentNode) {\n this.spanBase.id = 'btn';\n }\n };\n this.syncAnchor = () => {\n var _a;\n if ((_a = this.anchorBase) === null || _a === void 0 ? void 0 : _a.parentNode) {\n this.anchorBase.id = 'btn';\n this.syncAriaStates();\n if (!this.disabled && this.href)\n this.anchorBase.setAttribute('href', this.href);\n if (this.newWindow)\n this.anchorBase.setAttribute('target', '_blank');\n else\n this.anchorBase.removeAttribute('target');\n this.anchorBase.addEventListener('keyup', this._onKeyUpHandler);\n }\n };\n this.syncButton = () => {\n if (this.buttonBase.parentNode) {\n this.syncAriaStates();\n this.buttonBase.disabled = this.disabled;\n this.buttonBase.addEventListener('click', this.handleFormControl);\n }\n };\n this.syncAriaStates = () => {\n if (this.a11yLabel)\n this.currentBase.setAttribute('aria-label', this.a11yLabel);\n else\n this.currentBase.removeAttribute('aria-label');\n this.currentBase.setAttribute('aria-disabled', (this.loading || this.disabled).toString());\n };\n this.syncState = () => {\n if (this.href) {\n // Use anchor base\n if (!this.anchorBase)\n this.anchorBase = document.createElement('a');\n if (!this.anchorBase.parentNode) {\n // If the root element is not the right type\n this.switchBaseTo(this.anchorBase);\n }\n // Synchronize the properties\n this.syncAnchor();\n }\n else if (this.decorativeOnly) {\n // Use a span base\n if (!this.spanBase)\n this.spanBase = document.createElement('span');\n if (!this.spanBase.parentNode) {\n // If the root element is not the right type\n this.switchBaseTo(this.spanBase);\n }\n // Synchronize the properties\n this.syncDecorative();\n }\n else {\n if (!this.buttonBase.parentNode) {\n // If the root element is not the right type\n this.switchBaseTo(this.buttonBase);\n }\n // Synchronize the properties\n this.syncButton();\n }\n // Update the content\n const root = this.currentBase;\n const innerContent = this.innerContent; // Elements to be rendered\n // first let's remove all elements that shouldn't be there\n Array.from(root.children).forEach(element => !innerContent.includes(element) && element.remove());\n // Only touch those elements that are missing or not in order.\n innerContent.forEach((element, index) => {\n if (root.children.item(index) !== element) {\n // order issue or element is not added\n if (index === 0)\n root.prepend(element);\n else\n innerContent[index - 1].after(element);\n }\n });\n };\n this.gatherProperties(['disabled', 'href', 'inverse', 'loading', 'small', 'newWindow', 'decorativeOnly', 'variant', 'a11yLabel', 'type'], this);\n const shadow = this.attachShadow({ mode: 'open', delegatesFocus: true });\n this.currentBase = this.buttonBase = document.createElement('button');\n this.currentBase.id = 'btn';\n this.currentBase.append(...this.innerContent);\n shadow.append(this.buttonBase);\n }\n get disabled() {\n return this.hasAttribute('disabled');\n }\n set disabled(toggle) {\n this.toggleAttribute('disabled', !!toggle);\n }\n get href() {\n return this.getAttribute('href');\n }\n set href(url) {\n if (url)\n this.setAttribute('href', url);\n else\n this.removeAttribute('href');\n }\n get inverse() {\n return this.hasAttribute('inverse');\n }\n set inverse(toggle) {\n this.toggleAttribute('inverse', !!toggle);\n }\n get loading() {\n return this.hasAttribute('loading');\n }\n set loading(toggle) {\n this.toggleAttribute('loading', !!toggle);\n }\n get small() {\n return this.hasAttribute('small');\n }\n set small(toggle) {\n this.toggleAttribute('small', !!toggle);\n }\n get newWindow() {\n return this.hasAttribute('new-window');\n }\n set newWindow(toggle) {\n this.toggleAttribute('new-window', !!toggle);\n }\n get decorativeOnly() {\n return this.hasAttribute('decorative-only');\n }\n set decorativeOnly(toggle) {\n this.toggleAttribute('decorative-only', !!toggle);\n }\n get variant() {\n return this.getAttribute('variant') || 'primary';\n }\n set variant(variant) {\n if (variant)\n this.setAttribute('variant', variant);\n else\n this.removeAttribute('variant');\n }\n get a11yLabel() {\n return this.getAttribute('a11y-label') || '';\n }\n set a11yLabel(label) {\n if (label)\n this.setAttribute('a11y-label', label);\n else\n this.removeAttribute('a11y-label');\n }\n get type() {\n return this.getAttribute('type');\n }\n set type(type) {\n if (type)\n this.setAttribute('type', type);\n else\n this.removeAttribute('type');\n }\n get loadingSrText() {\n return this.__loadingAriaLabel || '';\n }\n set loadingSrText(ariaLabel) {\n if (this.loading && this.parts.loading) {\n // update existing loading\n this.buttonBase.setAttribute('aria-label', ariaLabel || '');\n }\n this.__loadingAriaLabel = ariaLabel;\n }\n get control() {\n return this.currentBase;\n }\n connectedCallback() {\n super.connectedCallback();\n this.inspectIconState();\n this.syncState();\n this.shadowRoot.addEventListener('slotchange', this.handleSlotChange);\n this.addEventListener('click', this.disableClick, { capture: true });\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.shadowRoot.removeEventListener('slotchange', this.handleSlotChange);\n this.removeEventListener('click', this.disableClick, { capture: true });\n if (this.anchorBase)\n this.anchorBase.removeEventListener('keyup', this._onKeyUpHandler);\n this.buttonBase.removeEventListener('click', this.handleFormControl);\n }\n inspectIconState() {\n if (this.parts.iconSlot && this.parts.iconSlot.assignedElements().length > 0 !== this.hasIcon) {\n // Icon state changed\n this.hasIcon = this.parts.iconSlot.assignedElements().length > 0;\n this.micro(this.syncState, 'synchronize wrapper');\n }\n }\n // role=\"button\" space bar activation polyfill. I'm not sure if the browsers don't support this by default by now.\n _onKeyUpHandler(e) {\n // Return early if not spacebar, e.g. 32.\n if (this.disabled || this.loading || e.key !== ' ')\n return;\n e.target.click();\n }\n get iconFragment() {\n var _a;\n if (!this.parts.iconSlot) {\n const slot = this.parts.iconSlot = document.createElement('slot');\n slot.id = 'icon';\n slot.name = 'icon';\n }\n if (this.variant === 'danger') {\n if (!this.dangerIcon)\n this.dangerIcon = generateDangerIcon();\n this.parts.iconSlot.append(this.dangerIcon);\n }\n else if ((_a = this.dangerIcon) === null || _a === void 0 ? void 0 : _a.parentNode) {\n this.dangerIcon.remove();\n }\n return this.parts.iconSlot;\n }\n get gapFragment() {\n if ((this.hasIcon || this.variant === 'danger')) {\n if (!this.parts.gap) {\n const gap = this.parts.gap = document.createElement('span');\n gap.id = 'gap';\n }\n return this.parts.gap;\n }\n }\n get labelFragment() {\n if (!this.parts.label) {\n const label = this.parts.label = document.createElement('slot');\n label.id = 'label';\n }\n return this.parts.label;\n }\n get loadingFragment() {\n if (this.loading) {\n // Initialise loading fragment if does not yet exist.\n if (!this.parts.loading)\n this.parts.loading = generateLoadingBall();\n this.buttonBase.setAttribute('aria-label', this.loadingSrText);\n return this.parts.loading;\n }\n }\n get innerContent() {\n return [this.iconFragment, this.gapFragment, this.labelFragment, this.loadingFragment].filter(Boolean);\n }\n attributeChangedCallback(name, oldVal, newVal) {\n this.micro(this.syncState, 'synchronize wrapper'); // Microtask the update to prevent intensive initialisations.\n }\n switchBaseTo(base) {\n // restructure the shadowdom.\n this.currentBase.remove();\n this.shadowRoot.append(base);\n this.currentBase = base;\n }\n}\nButtonAbstraction.observedAttributes = ['disabled', 'href', 'loading', 'new-window', 'decorative-only', 'type', 'a11y-label'];\nexport default ButtonAbstraction;\n","import ButtonAbstract from './common/ButtonAbstract.js';\n// @ts-ignore\nconst styles = ':host{--background:rgb(var(--colour-interactive-primary-bg-default,17,17,17));--background-hover:rgb(var(--colour-interactive-primary-bg-hover,51,51,51));--background-press:rgb(var(--colour-interactive-primary-bg-pressed,0,0,0));--foreground:rgb(var(--colour-text-and-icon-5,255,255,255));--border:none;--border-hover:none;--border-press:none;--disabled-foreground:rgb(var(--colour-interactive-disabled-2,146,146,146));--disabled-background:rgb(var(--colour-interactive-disabled-1,204,204,204));--border-width:0rem;--border-width-hover:0rem;--border-width-press:0rem;--padding-start:2rem;--padding-end:2rem;--height:3.5rem;--border-radius:64px;border-radius:var(--border-radius);display:inline-block}#label{display:inline}:host([decorative-only]){pointer-events:none}#btn{align-items:center;background:var(--background);border:var(--border);border-radius:var(--border-radius);box-sizing:border-box;color:var(--foreground);cursor:pointer;display:inline-flex;font-family:inherit;font-size:.875rem;font-weight:700;justify-content:center;line-height:1.4285714286;margin:0;min-height:var(--height);outline:0;padding:0;padding-inline-end:calc(var(--padding-end) - var(--border-width));padding-inline-start:calc(var(--padding-start) - var(--border-width));position:relative;text-align:center;transition-duration:.25s;transition-property:transform;transition-property:opacity,transform,box-shadow;transition-timing-function:cubic-bezier(.4,0,.4,1);vertical-align:top;width:100%}#btn,#btn:active,#btn:focus,#btn:hover{text-decoration:none}#btn:active,:host(:active) #btn{--border-width:var(--border-width-press);background:var(--background-press);border:var(--border-press)}#btn:active:not(:disabled),:host(:active) #btn:not(:disabled){transform:scale(.97)}#btn:hover{--border-width:var(--border-width-hover);background:var(--background-hover);border:var(--border-hover)}:host([disabled]){pointer-events:none}:host([disabled]) #btn{background:var(--disabled-background);color:var(--disabled-foreground);cursor:default}:host([small]) #btn{font-size:.75rem;line-height:1.3333333333}:host([small]) #btn:after{bottom:-.125rem;content:\"\";display:block;left:-.125rem;position:absolute;right:-.125rem;top:-.125rem}:host([small]){--padding-start:1.5rem;--padding-end:1.5rem;--height:2.5rem}@media (forced-colors:active){#btn,#btn:active,#btn:hover{border:1px solid #0000}#btn:disabled{border-color:GrayText;color:GrayText}}:host([variant=emphasised]){--background:rgb(var(--colour-interactive-emphasised-bg-default,0,88,163));--background-hover:rgb(var(--colour-interactive-emphasised-bg-hover,0,79,147));--background-press:rgb(var(--colour-interactive-emphasised-bg-pressed,0,62,114));--foreground:rgb(var(--colour-static-white,255,255,255))}:host([variant=danger]){--background:rgb(var(--colour-interactive-destructive-bg-default,224,7,81));--background-hover:rgb(var(--colour-interactive-destructive-bg-hover,204,0,61));--background-press:rgb(var(--colour-interactive-destructive-bg-pressed,184,0,41));--foreground:rgb(var(--colour-static-white,255,255,255))}:host([variant=tertiary]){--foreground:rgb(var(--colour-text-and-icon-1,17,17,17));--background:#0000;--background-hover:rgb(var(--colour-interactive-secondary-bg-hover,223,223,223));--background-press:rgb(var(--colour-interactive-secondary-bg-pressed,204,204,204));--disabled-foreground:rgb(var(--colour-interactive-disabled-1,204,204,204));--disabled-background:#0000}:host([variant=tertiary][inverse]){--background:#0000;--background-hover:rgba(var(--colour-static-white,255,255,255),.15);--background-press:rgba(var(--colour-static-white,255,255,255),.3);--foreground:rgb(var(--colour-static-white,255,255,255))}:host([variant=image-overlay]){--background:rgba(var(--colour-static-black,17,17,17),.75);--background-hover:rgba(var(--colour-static-black,17,17,17),.85);--background-press:rgba(var(--colour-static-black,17,17,17),.95);--foreground:rgb(var(--colour-static-white,255,255,255));text-decoration:none}:host([variant=secondary]){--background:none;--background-hover:none;--background-press:rgba(var(--colour-interactive-secondary-bg-pressed,204,204,204),.05);--foreground:rgb(var(--colour-text-and-icon-1,17,17,17));--border-width:1px;--border-width-hover:2px;--border-width-press:2px;--border:var(--border-width) solid rgb(var(--colour-neutral-7,17,17,17));--border-hover:var(--border-width-hover) solid rgb(var(--colour-neutral-7,17,17,17));--border-press:var(--border-width-press) solid rgb(var(--colour-neutral-7,17,17,17))}:host([variant=secondary][inverse]){--foreground:rgb(var(--colour-static-white,255,255,255));--border:var(--border-width) solid rgb(var(--colour-static-white,255,255,255));--border-hover:var(--border-width-hover) solid rgb(var(--colour-static-white,255,255,255));--border-press:var(--border-width-press) solid rgb(var(--colour-static-white,255,255,255));--background:none;--background-hover:none;--background-press:rgba(var(--colour-static-white,255,255,255),.1)}:host([variant=secondary][disabled]){--border:1px solid #0000}:host([inverse]){--background:rgb(var(--colour-static-white,255,255,255));--background-hover:rgb(var(--colour-static-light-grey,245,245,245));--background-press:rgb(var(--colour-static-grey,223,223,223));--foreground:rgb(var(--colour-static-black,17,17,17));--disabled-foreground:rgba(var(--colour-static-white,255,255,255),.15);--disabled-background:rgba(var(--colour-static-white,255,255,255),.15)}:host([fluid]){display:block;width:100%}#icon *,#icon::slotted(*),#label{transition-duration:.2s;transition-property:opacity,transform;transition-timing-function:cubic-bezier(.4,0,.4,1)}#loader{left:50%;margin-left:-.25rem;position:absolute;top:50%}:host([loading]){pointer-events:none}:host([loading]) #icon *,:host([loading]) #icon::slotted(*),:host([loading]) #label{opacity:0;transform:translateY(50%);visibility:hidden}#icon *,#icon::slotted(*){flex-shrink:0}#icon *,#icon::slotted(*){margin-inline-start:-.5rem}:host([icon-position=trailing]:not([variant=danger])) #icon *,:host([icon-position=trailing]:not([variant=danger])) #icon::slotted(*){margin-inline-end:-.5rem;margin-inline-start:0}:host([icon-position=trailing]:not([variant=danger])) #btn{flex-direction:row-reverse}#btn #gap{display:inline-block;transition-duration:.25s;transition-property:width;transition-timing-function:cubic-bezier(.4,0,.4,1);width:.5rem}#btn.focus-visible{box-shadow:0 0 0 4px var(--skapa-focus-ring-internal,rgb(var(--colour-neutral-1,255,255,255)));outline:2px solid var(--skapa-focus-ring-external,rgb(var(--colour-neutral-7,17,17,17)));outline-offset:4px;transition:outline .2s ease-out,box-shadow .2s ease-out}:host([inverse]) #btn.focus-visible{box-shadow:0 0 0 4px var(--skapa-focus-ring-internal,rgb(var(--colour-neutral-7,17,17,17)));outline:2px solid var(--skapa-focus-ring-external,rgb(var(--colour-neutral-1,255,255,255)));outline-offset:4px;transition:outline .2s ease-out,box-shadow .2s ease-out}';\nimport { prefixReplacer } from '@ingka/webc-tools';\nlet template;\nfunction getTemplate() {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = prefixReplacer(``);\n }\n return template;\n}\nexport class Button extends ButtonAbstract {\n constructor() {\n super();\n this.gatherProperties(['fluid', 'iconPosition'], this);\n this.shadowRoot.append(getTemplate().content.cloneNode(true));\n }\n get fluid() {\n return this.hasAttribute('fluid');\n }\n set fluid(toggle) {\n this.toggleAttribute('fluid', !!toggle);\n }\n get iconPosition() {\n return this.getAttribute('icon-position') || 'leading';\n }\n set iconPosition(position) {\n if (position === 'trailing')\n this.setAttribute('icon-position', position);\n else\n this.removeAttribute('icon-position');\n }\n}\nexport default Button;\n","import ButtonAbstract from './common/ButtonAbstract.js';\nimport { prefixReplacer } from '@ingka/webc-tools';\n// @ts-ignore\nconst styles = ':host{--background:rgb(var(--colour-interactive-primary-bg-default,17,17,17));--background-hover:rgb(var(--colour-interactive-primary-bg-hover,51,51,51));--background-press:rgb(var(--colour-interactive-primary-bg-pressed,0,0,0));--foreground:rgb(var(--colour-text-and-icon-5,255,255,255));--border:none;--border-hover:none;--border-press:none;--disabled-foreground:rgb(var(--colour-interactive-disabled-2,146,146,146));--disabled-background:rgb(var(--colour-interactive-disabled-1,204,204,204));--border-width:0rem;--border-width-hover:0rem;--border-width-press:0rem;--padding-start:2rem;--padding-end:2rem;--height:3.5rem;--border-radius:64px;border-radius:var(--border-radius);display:inline-block}#label{display:inline}:host([decorative-only]){pointer-events:none}#btn{align-items:center;background:var(--background);border:var(--border);border-radius:var(--border-radius);box-sizing:border-box;color:var(--foreground);cursor:pointer;display:inline-flex;font-family:inherit;font-size:.875rem;font-weight:700;justify-content:center;line-height:1.4285714286;margin:0;min-height:var(--height);outline:0;padding:0;padding-inline-end:calc(var(--padding-end) - var(--border-width));padding-inline-start:calc(var(--padding-start) - var(--border-width));position:relative;text-align:center;transition-duration:.25s;transition-property:transform;transition-property:opacity,transform,box-shadow;transition-timing-function:cubic-bezier(.4,0,.4,1);vertical-align:top;width:100%}#btn,#btn:active,#btn:focus,#btn:hover{text-decoration:none}#btn:active,:host(:active) #btn{--border-width:var(--border-width-press);background:var(--background-press);border:var(--border-press)}#btn:active:not(:disabled),:host(:active) #btn:not(:disabled){transform:scale(.97)}#btn:hover{--border-width:var(--border-width-hover);background:var(--background-hover);border:var(--border-hover)}:host([disabled]){pointer-events:none}:host([disabled]) #btn{background:var(--disabled-background);color:var(--disabled-foreground);cursor:default}:host([small]) #btn{font-size:.75rem;line-height:1.3333333333}:host([small]) #btn:after{bottom:-.125rem;content:\"\";display:block;left:-.125rem;position:absolute;right:-.125rem;top:-.125rem}:host([small]){--padding-start:1.5rem;--padding-end:1.5rem;--height:2.5rem}@media (forced-colors:active){#btn,#btn:active,#btn:hover{border:1px solid #0000}#btn:disabled{border-color:GrayText;color:GrayText}}:host([variant=emphasised]){--background:rgb(var(--colour-interactive-emphasised-bg-default,0,88,163));--background-hover:rgb(var(--colour-interactive-emphasised-bg-hover,0,79,147));--background-press:rgb(var(--colour-interactive-emphasised-bg-pressed,0,62,114));--foreground:rgb(var(--colour-static-white,255,255,255))}:host([variant=danger]){--background:rgb(var(--colour-interactive-destructive-bg-default,224,7,81));--background-hover:rgb(var(--colour-interactive-destructive-bg-hover,204,0,61));--background-press:rgb(var(--colour-interactive-destructive-bg-pressed,184,0,41));--foreground:rgb(var(--colour-static-white,255,255,255))}:host([variant=tertiary]){--foreground:rgb(var(--colour-text-and-icon-1,17,17,17));--background:#0000;--background-hover:rgb(var(--colour-interactive-secondary-bg-hover,223,223,223));--background-press:rgb(var(--colour-interactive-secondary-bg-pressed,204,204,204));--disabled-foreground:rgb(var(--colour-interactive-disabled-1,204,204,204));--disabled-background:#0000}:host([variant=tertiary][inverse]){--background:#0000;--background-hover:rgba(var(--colour-static-white,255,255,255),.15);--background-press:rgba(var(--colour-static-white,255,255,255),.3);--foreground:rgb(var(--colour-static-white,255,255,255))}:host([variant=image-overlay]){--background:rgba(var(--colour-static-black,17,17,17),.75);--background-hover:rgba(var(--colour-static-black,17,17,17),.85);--background-press:rgba(var(--colour-static-black,17,17,17),.95);--foreground:rgb(var(--colour-static-white,255,255,255));text-decoration:none}:host([variant=secondary]){--background:none;--background-hover:none;--background-press:rgba(var(--colour-interactive-secondary-bg-pressed,204,204,204),.05);--foreground:rgb(var(--colour-text-and-icon-1,17,17,17));--border-width:1px;--border-width-hover:2px;--border-width-press:2px;--border:var(--border-width) solid rgb(var(--colour-neutral-7,17,17,17));--border-hover:var(--border-width-hover) solid rgb(var(--colour-neutral-7,17,17,17));--border-press:var(--border-width-press) solid rgb(var(--colour-neutral-7,17,17,17))}:host([variant=secondary][inverse]){--foreground:rgb(var(--colour-static-white,255,255,255));--border:var(--border-width) solid rgb(var(--colour-static-white,255,255,255));--border-hover:var(--border-width-hover) solid rgb(var(--colour-static-white,255,255,255));--border-press:var(--border-width-press) solid rgb(var(--colour-static-white,255,255,255));--background:none;--background-hover:none;--background-press:rgba(var(--colour-static-white,255,255,255),.1)}:host([variant=secondary][disabled]){--border:1px solid #0000}:host([inverse]){--background:rgb(var(--colour-static-white,255,255,255));--background-hover:rgb(var(--colour-static-light-grey,245,245,245));--background-press:rgb(var(--colour-static-grey,223,223,223));--foreground:rgb(var(--colour-static-black,17,17,17));--disabled-foreground:rgba(var(--colour-static-white,255,255,255),.15);--disabled-background:rgba(var(--colour-static-white,255,255,255),.15)}#loader{left:50%;margin-left:-.25rem;position:absolute;top:50%}:host([loading]){pointer-events:none}:host([loading]) #icon *,:host([loading]) #icon::slotted(*),:host([loading]) #label{opacity:0;transform:translateY(50%);visibility:hidden}#btn{max-width:16rem;transition-property:opacity,transform,padding,max-width,box-shadow}#btn #label{flex-shrink:1;overflow:hidden;white-space:nowrap}:host(:not([show-expanded])) #btn:not(:hover):not(.focus-visible){--padding-start:1.5rem;--padding-end:1rem;max-width:3.5rem}:host([icon-position=trailing]:not([show-expanded])) #btn:not(:hover):not(.focus-visible){--padding-start:1rem;--padding-end:1.5rem}:host(:not([show-expanded])) #btn:not(:hover):not(.focus-visible) #gap{width:0}:host([small]:not([show-expanded])) #btn:not(:hover):not(.focus-visible){--padding-start:1rem;--padding-end:0.5rem;max-width:2.5rem}:host([icon-position=trailing][small]:not([show-expanded])) #btn:not(:hover):not(.focus-visible){--padding-start:0.5rem;--padding-end:1rem}#icon *,#icon::slotted(*),#label{transition-duration:.2s;transition-property:opacity,transform;transition-timing-function:cubic-bezier(.4,0,.4,1)}#icon *,#icon::slotted(*){flex-shrink:0}#icon *,#icon::slotted(*){margin-inline-start:-.5rem}:host([icon-position=trailing]:not([variant=danger])) #icon *,:host([icon-position=trailing]:not([variant=danger])) #icon::slotted(*){margin-inline-end:-.5rem;margin-inline-start:0}:host([icon-position=trailing]:not([variant=danger])) #btn{flex-direction:row-reverse}#btn #gap{display:inline-block;transition-duration:.25s;transition-property:width;transition-timing-function:cubic-bezier(.4,0,.4,1);width:.5rem}#btn.focus-visible{box-shadow:0 0 0 4px var(--skapa-focus-ring-internal,rgb(var(--colour-neutral-1,255,255,255)));outline:2px solid var(--skapa-focus-ring-external,rgb(var(--colour-neutral-7,17,17,17)));outline-offset:4px;transition:outline .2s ease-out,box-shadow .2s ease-out}:host([inverse]) #btn.focus-visible{box-shadow:0 0 0 4px var(--skapa-focus-ring-internal,rgb(var(--colour-neutral-7,17,17,17)));outline:2px solid var(--skapa-focus-ring-external,rgb(var(--colour-neutral-1,255,255,255)));outline-offset:4px;transition:outline .2s ease-out,box-shadow .2s ease-out}';\n// Returns information about client touch device match, evaluates only once.\nconst mediaInfo = { touchDevice: false, inited: false };\nconst isTouchDevice = () => {\n if (!mediaInfo.inited && typeof window !== 'undefined') {\n mediaInfo.touchDevice = window.matchMedia('(any-pointer: coarse)').matches;\n mediaInfo.inited = true;\n }\n return mediaInfo.touchDevice;\n};\nlet template;\nfunction getTemplate() {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = prefixReplacer(``);\n }\n return template;\n}\nexport class ExpandingButton extends ButtonAbstract {\n constructor() {\n super();\n this.shadowRoot.append(getTemplate().content.cloneNode(true));\n }\n get expandedOnTouchDevice() {\n return this.hasAttribute('expanded-on-touch-device');\n }\n set expandedOnTouchDevice(toggle) {\n this.toggleAttribute('expanded-on-touch-device', !!toggle);\n }\n get iconPosition() {\n return this.getAttribute('icon-position') || 'leading';\n }\n set iconPosition(position) {\n if (position === 'trailing')\n this.setAttribute('icon-position', position);\n else\n this.removeAttribute('icon-position');\n }\n updateExpandedStatus() {\n if (this.expandedOnTouchDevice && isTouchDevice()) {\n this.setAttribute('show-expanded', '');\n }\n else {\n this.removeAttribute('show-expanded');\n }\n }\n connectedCallback() {\n super.connectedCallback();\n this.updateExpandedStatus();\n }\n attributeChangedCallback(name, oldVal, newVal) {\n super.attributeChangedCallback(name, oldVal, newVal);\n if (name === 'expanded-on-touch-device')\n this.updateExpandedStatus();\n }\n}\nExpandingButton.observedAttributes = [...ButtonAbstract.observedAttributes, 'expanded-on-touch-device'];\nexport default ExpandingButton;\n","import ButtonAbstract from './common/ButtonAbstract.js';\nimport { prefixReplacer } from '@ingka/webc-tools';\n// @ts-ignore\nconst styles = ':host{--background:rgb(var(--colour-interactive-primary-bg-default,17,17,17));--background-hover:rgb(var(--colour-interactive-primary-bg-hover,51,51,51));--background-press:rgb(var(--colour-interactive-primary-bg-pressed,0,0,0));--foreground:rgb(var(--colour-text-and-icon-5,255,255,255));--border:none;--border-hover:none;--border-press:none;--disabled-foreground:rgb(var(--colour-interactive-disabled-2,146,146,146));--disabled-background:rgb(var(--colour-interactive-disabled-1,204,204,204));--border-width:0rem;--border-width-hover:0rem;--border-width-press:0rem;--padding-start:2rem;--padding-end:2rem;--height:3.5rem;--border-radius:64px;border-radius:var(--border-radius);display:inline-block}#label{display:inline}:host([decorative-only]){pointer-events:none}#btn{align-items:center;background:var(--background);border:var(--border);border-radius:var(--border-radius);box-sizing:border-box;color:var(--foreground);cursor:pointer;display:inline-flex;font-family:inherit;font-size:.875rem;font-weight:700;justify-content:center;line-height:1.4285714286;margin:0;min-height:var(--height);outline:0;padding:0;padding-inline-end:calc(var(--padding-end) - var(--border-width));padding-inline-start:calc(var(--padding-start) - var(--border-width));position:relative;text-align:center;transition-duration:.25s;transition-property:transform;transition-property:opacity,transform,box-shadow;transition-timing-function:cubic-bezier(.4,0,.4,1);vertical-align:top;width:100%}#btn,#btn:active,#btn:focus,#btn:hover{text-decoration:none}#btn:active,:host(:active) #btn{--border-width:var(--border-width-press);background:var(--background-press);border:var(--border-press)}#btn:active:not(:disabled),:host(:active) #btn:not(:disabled){transform:scale(.97)}#btn:hover{--border-width:var(--border-width-hover);background:var(--background-hover);border:var(--border-hover)}:host([disabled]){pointer-events:none}:host([disabled]) #btn{background:var(--disabled-background);color:var(--disabled-foreground);cursor:default}:host([small]) #btn{font-size:.75rem;line-height:1.3333333333}:host([small]) #btn:after{bottom:-.125rem;content:\"\";display:block;left:-.125rem;position:absolute;right:-.125rem;top:-.125rem}:host([small]){--padding-start:1.5rem;--padding-end:1.5rem;--height:2.5rem}@media (forced-colors:active){#btn,#btn:active,#btn:hover{border:1px solid #0000}#btn:disabled{border-color:GrayText;color:GrayText}}:host([variant=emphasised]){--background:rgb(var(--colour-interactive-emphasised-bg-default,0,88,163));--background-hover:rgb(var(--colour-interactive-emphasised-bg-hover,0,79,147));--background-press:rgb(var(--colour-interactive-emphasised-bg-pressed,0,62,114));--foreground:rgb(var(--colour-static-white,255,255,255))}:host([variant=danger]){--background:rgb(var(--colour-interactive-destructive-bg-default,224,7,81));--background-hover:rgb(var(--colour-interactive-destructive-bg-hover,204,0,61));--background-press:rgb(var(--colour-interactive-destructive-bg-pressed,184,0,41));--foreground:rgb(var(--colour-static-white,255,255,255))}:host([variant=tertiary]){--foreground:rgb(var(--colour-text-and-icon-1,17,17,17));--background:#0000;--background-hover:rgb(var(--colour-interactive-secondary-bg-hover,223,223,223));--background-press:rgb(var(--colour-interactive-secondary-bg-pressed,204,204,204));--disabled-foreground:rgb(var(--colour-interactive-disabled-1,204,204,204));--disabled-background:#0000}:host([variant=tertiary][inverse]){--background:#0000;--background-hover:rgba(var(--colour-static-white,255,255,255),.15);--background-press:rgba(var(--colour-static-white,255,255,255),.3);--foreground:rgb(var(--colour-static-white,255,255,255))}:host([variant=image-overlay]){--background:rgba(var(--colour-static-black,17,17,17),.75);--background-hover:rgba(var(--colour-static-black,17,17,17),.85);--background-press:rgba(var(--colour-static-black,17,17,17),.95);--foreground:rgb(var(--colour-static-white,255,255,255));text-decoration:none}:host([variant=secondary]){--background:none;--background-hover:none;--background-press:rgba(var(--colour-interactive-secondary-bg-pressed,204,204,204),.05);--foreground:rgb(var(--colour-text-and-icon-1,17,17,17));--border-width:1px;--border-width-hover:2px;--border-width-press:2px;--border:var(--border-width) solid rgb(var(--colour-neutral-7,17,17,17));--border-hover:var(--border-width-hover) solid rgb(var(--colour-neutral-7,17,17,17));--border-press:var(--border-width-press) solid rgb(var(--colour-neutral-7,17,17,17))}:host([variant=secondary][inverse]){--foreground:rgb(var(--colour-static-white,255,255,255));--border:var(--border-width) solid rgb(var(--colour-static-white,255,255,255));--border-hover:var(--border-width-hover) solid rgb(var(--colour-static-white,255,255,255));--border-press:var(--border-width-press) solid rgb(var(--colour-static-white,255,255,255));--background:none;--background-hover:none;--background-press:rgba(var(--colour-static-white,255,255,255),.1)}:host([variant=secondary][disabled]){--border:1px solid #0000}:host([inverse]){--background:rgb(var(--colour-static-white,255,255,255));--background-hover:rgb(var(--colour-static-light-grey,245,245,245));--background-press:rgb(var(--colour-static-grey,223,223,223));--foreground:rgb(var(--colour-static-black,17,17,17));--disabled-foreground:rgba(var(--colour-static-white,255,255,255),.15);--disabled-background:rgba(var(--colour-static-white,255,255,255),.15)}#icon *,#icon::slotted(*),#label{transition-duration:.2s;transition-property:opacity,transform;transition-timing-function:cubic-bezier(.4,0,.4,1)}#loader{left:50%;margin-left:-.25rem;position:absolute;top:50%}:host([loading]){pointer-events:none}:host([loading]) #icon *,:host([loading]) #icon::slotted(*),:host([loading]) #label{opacity:0;transform:translateY(50%);visibility:hidden}#icon *,#icon::slotted(*){flex-shrink:0}:host([small]:not([xsmall])){--padding-start:0.5rem;--padding-end:0.5rem;--height:2.5rem}:host([small]:not([xsmall])) #btn{font-size:.75rem;line-height:1.3333333333}:host([xsmall]){--padding-start:0.25rem;--padding-end:0.25rem;--height:2rem}:host([xsmall]) #btn:after{bottom:-.375rem;content:\"\";display:block;left:-.375rem;position:absolute;right:-.375rem;top:-.375rem}:host([xsmall]) #btn #icon *,:host([xsmall]) #btn #icon::slotted(*){margin:0}#btn.focus-visible{box-shadow:0 0 0 4px var(--skapa-focus-ring-internal,rgb(var(--colour-neutral-1,255,255,255)));outline:2px solid var(--skapa-focus-ring-external,rgb(var(--colour-neutral-7,17,17,17)));outline-offset:4px;transition:outline .2s ease-out,box-shadow .2s ease-out}:host([inverse]) #btn.focus-visible{box-shadow:0 0 0 4px var(--skapa-focus-ring-internal,rgb(var(--colour-neutral-7,17,17,17)));outline:2px solid var(--skapa-focus-ring-external,rgb(var(--colour-neutral-1,255,255,255)));outline-offset:4px;transition:outline .2s ease-out,box-shadow .2s ease-out}:host{--padding-start:1rem;--padding-end:1rem}:host #label{clip:rect(1px,1px,1px,1px);height:1px;margin:-1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}';\nlet template;\nfunction getTemplate() {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = prefixReplacer(``);\n }\n return template;\n}\nexport class IconButton extends ButtonAbstract {\n constructor() {\n super();\n this.gatherProperties(['xsmall'], this);\n this.shadowRoot.append(getTemplate().content.cloneNode(true));\n }\n get xsmall() {\n return this.hasAttribute('xsmall');\n }\n set xsmall(toggle) {\n this.toggleAttribute('xsmall', !!toggle);\n }\n get innerContent() {\n return [this.iconFragment, this.labelFragment, this.loadingFragment].filter(Boolean);\n }\n}\nexport default IconButton;\n","import define from '@ingka/webc-tools';\nimport Button from './src/Button.js';\nimport ExpandingButton from './src/Expanding.js';\nimport IconButton from './src/IconButton.js';\nexport { Button, ExpandingButton, IconButton };\nexport const buttonTagName = define('button', Button);\nexport const expandingButtonTagName = define('expanding-button', ExpandingButton);\nexport const iconButtonTagName = define('icon-button', IconButton);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('checkmark', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M16.5591 7.5 18 8.9608 10.5636 16.5 6 11.8732l1.4409-1.4608 3.1227 3.166L16.5591 7.5z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('heart', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M19.205 5.599c.9541.954 1.4145 2.2788 1.4191 3.6137 0 3.0657-2.2028 5.7259-4.1367 7.5015-1.2156 1.1161-2.5544 2.1393-3.9813 2.9729L12 20.001l-.501-.3088c-.9745-.5626-1.8878-1.2273-2.7655-1.9296-1.1393-.9117-2.4592-2.1279-3.5017-3.5531-1.0375-1.4183-1.8594-3.1249-1.8597-4.9957-.0025-1.2512.3936-2.5894 1.419-3.6149 1.8976-1.8975 4.974-1.8975 6.8716 0l.3347.3347.336-.3347c1.8728-1.8722 4.9989-1.8727 6.8716 0zm-7.2069 12.0516c.6695-.43 1.9102-1.2835 3.1366-2.4096 1.8786-1.7247 3.4884-3.8702 3.4894-6.0264-.0037-.849-.2644-1.6326-.8333-2.2015-1.1036-1.1035-2.9413-1.0999-4.0445.0014l-1.7517 1.7448-1.7461-1.7462c-1.1165-1.1164-2.9267-1.1164-4.0431 0-1.6837 1.6837-.5313 4.4136.6406 6.0156.8996 1.2298 2.0728 2.3207 3.137 3.1722a24.3826 24.3826 0 0 0 2.0151 1.4497z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('warning-triangle', [{ tag: 'path', att: { d: 'M11.0036 14.1337h2v-6h-2v6zm1 1.5c-.6904 0-1.25.5597-1.25 1.25 0 .6904.5596 1.25 1.25 1.25.6903 0 1.25-.5596 1.25-1.25 0-.6903-.5597-1.25-1.25-1.25z' } }, { tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'm1.1152 20.418 10-19h1.7699l10 19-.8849 1.4657h-20l-.885-1.4657zm2.5413-.5343h16.6873L12.0002 4.0308 3.6565 19.8837z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AddToListLayoutEnum;\n(function (AddToListLayoutEnum) {\n AddToListLayoutEnum[\"text\"] = \"text\";\n AddToListLayoutEnum[\"icon\"] = \"icon\";\n AddToListLayoutEnum[\"iconSmall\"] = \"iconSmall\";\n})(AddToListLayoutEnum || (AddToListLayoutEnum = {}));\nexports.default = AddToListLayoutEnum;\n//# sourceMappingURL=AddToListLayoutEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AddToListStateEnum;\n(function (AddToListStateEnum) {\n AddToListStateEnum[\"default\"] = \"default\";\n AddToListStateEnum[\"loading\"] = \"loading\";\n AddToListStateEnum[\"confirmation\"] = \"confirmation\";\n})(AddToListStateEnum || (AddToListStateEnum = {}));\nexports.default = AddToListStateEnum;\n//# sourceMappingURL=AddToListStateEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst analytics_1 = require(\"@inter-ikea-kompis/analytics\");\nconst insights_data_provider_1 = require(\"@insights/insights-data-provider\");\nconst moduleId = 'add_to_list';\n/**\n * Tracks events from Add to list and sends them to a reporter.\n *\n * @event click When add to cart or add to wishlist buttons are clicked.\n */\nclass AddToListTracker extends analytics_1.AbstractAnalyticsTracker {\n constructor(options) {\n super(Object.assign({ moduleId }, options));\n this.context = options.context;\n }\n /**\n * Call to report when clicking to add products to the shopping list.\n */\n sendAddToListClick() {\n const payload = {\n common: { component: moduleId },\n data: {\n action: 'add_to_wishlist'\n },\n context: this.context\n };\n this.getReporter().report({\n event: 'click',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.giveMe,\n payload\n });\n }\n}\nexports.default = AddToListTracker;\n//# sourceMappingURL=AddToListTracker.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst AddToListLayoutEnum_1 = __importDefault(require(\"../../enums/AddToListLayoutEnum\"));\nclass AddToListStyle {\n static getStyle(options) {\n if (options.addToListLayout === AddToListLayoutEnum_1.default.text) {\n return (0, web_component_1.css) `\n\t\t\t\t/* This reflects how Skapa styles their fluid buttons. */\n\t\t\t\t:host {\n\t\t\t\t\tdisplay: block;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t}\n\t\t\t`;\n }\n return '';\n }\n}\nexports.default = AddToListStyle;\n//# sourceMappingURL=AddToListStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/icon-store/checkmark\");\nrequire(\"@ingka/icon-store/heart\");\nrequire(\"@ingka/icon-store/warning-triangle\");\nconst AddToListLayoutEnum_1 = __importDefault(require(\"../../enums/AddToListLayoutEnum\"));\nconst AddToListStateEnum_1 = __importDefault(require(\"../../enums/AddToListStateEnum\"));\nconst AddToListTracker_1 = __importDefault(require(\"../../trackers/AddToListTracker\"));\nconst AddToListStyle_1 = __importDefault(require(\"./AddToListStyle\"));\n/**\n * View component for adding products to shopping list.\n *\n * @event addToList Start adding products to shopping list.\n * @event resetState Sent after 3 seconds after addToListState confirmation to be able to reset the state of the button.\n */\nlet AddToList = class AddToList extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Defines the state for add to list button\n this.state = AddToListStateEnum_1.default.default;\n // Disables the button.\n this.disabled = false;\n // Layout\n this.layout = AddToListLayoutEnum_1.default.icon;\n // Icon variant\n this.iconVariant = 'secondary';\n // Used for automatic analytics. If null or not set, analytics is turned off.\n this.analytics = null;\n this.triggerElement = null;\n this.tracker = null;\n this.timeout = null;\n this.dexfSettings = null;\n }\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t${this.getListButton()}\n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.disconnectTracker();\n if (this.timeout) {\n clearTimeout(this.timeout);\n }\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n // Once the add to list-button have been set with the state 'confirmation' there should be an event sent after 3 seconds to make it possible to reset its state to 'default' again.\n if (changedProperties.has('state') && this.state === AddToListStateEnum_1.default.confirmation) {\n this.dispatchResetState();\n }\n if (changedProperties.has('analytics') && this.hasTranslationsAndSettings()) {\n this.disconnectTracker();\n this.connectTracker();\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getSettings() {\n return this.dexfSettings;\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n dispatchResetState() {\n if (this.timeout) {\n clearTimeout(this.timeout);\n }\n this.timeout = setTimeout(() => {\n this.dispatchEvent(new CustomEvent('resetState', { bubbles: true }));\n }, 3000);\n }\n connectTracker() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n if (this.analytics) {\n // eslint-disable-next-line no-underscore-dangle\n const reporter = this.analytics.__INTERNAL__reporter;\n if ((reporter === null || reporter === void 0 ? void 0 : reporter.connected) === false) {\n // Should use an existing reporter, but wait for it to be connected\n return;\n }\n // Use existing connected reporter, or the tracker should create a new one.\n const reporterId = reporter ? reporter.id : undefined;\n this.tracker = new AddToListTracker_1.default(Object.assign(Object.assign({}, this.analytics), { settings: this.getSettings(), reporterId }));\n yield ((_a = this.tracker) === null || _a === void 0 ? void 0 : _a.connect());\n }\n });\n }\n disconnectTracker() {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.disconnect();\n this.tracker = null;\n }\n getListButton() {\n if (!utilities_1.ShoppingSupport.hasListSupport(this.getSettings())) {\n return null;\n }\n const { addToShoppingListButtonSuccess, addToShoppingListButton, loading } = this.getTranslations();\n const primaryVariant = 'primary';\n const success = this.state === AddToListStateEnum_1.default.confirmation;\n const label = success ? addToShoppingListButtonSuccess : addToShoppingListButton;\n if (this.layout === AddToListLayoutEnum_1.default.text) {\n return (0, web_component_1.html) `\n\t\t\t\t\n\t\t\t\t\t${label}\n\t\t\t\t\n\t\t\t`;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${label}\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n getListButtonIcon() {\n if (this.disabled || !this.hasPositiveQuantity()) {\n return 'heart';\n }\n switch (this.state) {\n case AddToListStateEnum_1.default.confirmation:\n return 'checkmark';\n default:\n return 'heart';\n }\n }\n setTriggerElement(target) {\n if (target instanceof Element) {\n this.triggerElement = this.getTriggerElement();\n }\n return this.triggerElement;\n }\n getTriggerElement() {\n var _a, _b, _c;\n return ((_c = (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('skapa-button, skapa-icon-button')) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('button'));\n }\n getValidShoppingProducts() {\n return this.shoppingProducts\n .filter((shoppingProduct) => shoppingProduct.quantity > 0)\n .filter((shoppingProduct) => shoppingProduct.product.content);\n }\n onAddToList(event) {\n var _a;\n const shoppingProducts = this.getValidShoppingProducts();\n const shoppingItems = utilities_1.ProductUtility.getShoppingItems(shoppingProducts);\n const triggerElement = this.setTriggerElement(event.currentTarget);\n this.dispatchEvent(new CustomEvent('addToList', {\n bubbles: true,\n detail: { shoppingItems, triggerElement }\n }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendAddToListClick();\n }\n hasPositiveQuantity() {\n return this.shoppingProducts.some((shoppingProduct) => shoppingProduct.quantity > 0);\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], AddToList.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], AddToList.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], AddToList.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], AddToList.prototype, \"state\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], AddToList.prototype, \"shoppingProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], AddToList.prototype, \"disabled\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], AddToList.prototype, \"layout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], AddToList.prototype, \"iconVariant\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], AddToList.prototype, \"analytics\", void 0);\nAddToList = __decorate([\n (0, web_component_1.customElement)('kompis-add-to-list')\n], AddToList);\nexports.default = AddToList;\n//# sourceMappingURL=AddToList.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass AddToListToastMessage {\n static getAddToListSuccess(localizedInformationOrTranslations, urls) {\n const { addToShoppingListSuccessHeadline, addToShoppingListName } = this.getToastTranslations(localizedInformationOrTranslations);\n if ('urls' in localizedInformationOrTranslations) {\n return {\n label: addToShoppingListSuccessHeadline,\n actionHref: localizedInformationOrTranslations.urls.shoppingListLink,\n actionLabel: addToShoppingListName\n };\n }\n else if (urls) {\n return {\n label: addToShoppingListSuccessHeadline,\n actionHref: urls.shoppingListLink,\n actionLabel: addToShoppingListName\n };\n }\n throw new Error(\"URLs must either be provided through the 'urls' parameter or by using the ILocalizedInformation type for the 'localizedInformationOrTranslations' parameter.\");\n }\n static getAddToListFailure(localizedInformationOrTranslations, urls) {\n const { addToShoppingListFailureHeadline, addToShoppingListName } = this.getToastTranslations(localizedInformationOrTranslations);\n if ('urls' in localizedInformationOrTranslations) {\n return {\n label: addToShoppingListFailureHeadline,\n actionHref: localizedInformationOrTranslations.urls.shoppingListLink,\n actionLabel: addToShoppingListName\n };\n }\n else if (urls) {\n return {\n label: addToShoppingListFailureHeadline,\n actionHref: urls.shoppingListLink,\n actionLabel: addToShoppingListName\n };\n }\n throw new Error(\"URLs must either be provided through the 'urls' parameter or by using the ILocalizedInformation type for the 'localizedInformationOrTranslations' parameter.\");\n }\n static getAddToListFail(localizedInformationOrTranslations, urls) {\n const { addToShoppingBagAndListErrorMessage, addToShoppingListName } = this.getToastTranslations(localizedInformationOrTranslations);\n if ('urls' in localizedInformationOrTranslations) {\n return {\n label: addToShoppingBagAndListErrorMessage,\n actionHref: localizedInformationOrTranslations.urls.shoppingListLink,\n actionLabel: addToShoppingListName\n };\n }\n else if (urls) {\n return {\n label: addToShoppingBagAndListErrorMessage,\n actionHref: urls.shoppingListLink,\n actionLabel: addToShoppingListName\n };\n }\n throw new Error(\"URLs must either be provided through the 'urls' parameter or by using the ILocalizedInformation type for the 'localizedInformationOrTranslations' parameter.\");\n }\n static getToastTranslations(localizedInformationOrTranslations) {\n if ('translations' in localizedInformationOrTranslations) {\n return localizedInformationOrTranslations.translations;\n }\n return localizedInformationOrTranslations;\n }\n}\nexports.default = AddToListToastMessage;\n//# sourceMappingURL=AddToListToastMessage.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AddToListToastMessage = exports.AddToListStateEnum = exports.AddToListLayoutEnum = exports.AddToList = void 0;\nconst AddToList_1 = __importDefault(require(\"./components/add-to-list/AddToList\"));\nexports.AddToList = AddToList_1.default;\nconst AddToListLayoutEnum_1 = __importDefault(require(\"./enums/AddToListLayoutEnum\"));\nexports.AddToListLayoutEnum = AddToListLayoutEnum_1.default;\nconst AddToListStateEnum_1 = __importDefault(require(\"./enums/AddToListStateEnum\"));\nexports.AddToListStateEnum = AddToListStateEnum_1.default;\nconst AddToListToastMessage_1 = __importDefault(require(\"./utilities/AddToListToastMessage\"));\nexports.AddToListToastMessage = AddToListToastMessage_1.default;\n//# sourceMappingURL=index.js.map","import { prefixReplacer } from '@ingka/webc-tools';\nimport SkapaElement from '@ingka/skapa-webc-element';\n// @ts-ignore\nconst styles = ':host{--skapa-inline-message-colour:rgb(var(--colour-semantic-informative,0,88,163));background-color:rgb(var(--colour-elevation-1,255,255,255));border:0 solid rgb(var(--colour-elevation-1-border,223,223,223));border-inline-start:.25rem solid var(--skapa-inline-message-colour);border-radius:4px;box-shadow:0 4px 16px #0000001a;box-sizing:border-box;display:flex;font-size:.875rem;min-height:1.5rem;overflow:hidden;padding:1rem 0;padding-inline-end:.5rem;position:relative;text-align:start}slot[name=message-icon]{color:var(--skapa-inline-message-colour);display:flex;flex-basis:3rem;flex-shrink:0;justify-content:center}slot[name=message-icon].skapa-empty{flex-basis:1rem}slot[name=close-button]{display:inline;margin-top:-.5rem;pointer-events:none}slot[name=close-button].skapa-empty{min-width:1.5rem}slot[name=close-button]::slotted(*){pointer-events:auto}#actions{display:flex;flex-wrap:wrap;justify-content:flex-end;margin-top:.5rem}#actions.skapa-empty{display:none}#actions::slotted(:not(:first-of-type)){margin-inline-start:.25rem}:host([subtle]){background:none;border:none;box-shadow:none;overflow:visible;padding:0}:host([subtle]) slot[name=message-icon]{flex-basis:2rem;justify-content:start}:host([subtle]) slot[name=message-icon].skapa-empty{display:none}:host([subtle]) slot[name=close-button]{margin-top:-.25rem;max-width:1.5rem;min-width:1.5rem}:host([subtle]) #actions{display:none}:host([subtle]) slot::slotted(skapa-button),:host([subtle]) slot[name=title]{display:none}:host([dismissed]){min-height:0;opacity:0;overflow:hidden;padding-bottom:0;padding-top:0;transition:all .2s cubic-bezier(.4,0,.4,1);visibility:hidden}:host([variant=cautionary]){--skapa-inline-message-colour:rgb(var(--colour-semantic-caution,242,106,47))}:host([variant=positive]){--skapa-inline-message-colour:rgb(var(--colour-semantic-positive,10,138,0))}:host([variant=negative]){--skapa-inline-message-colour:rgb(var(--colour-semantic-negative,224,7,81))}.content{flex-grow:1}slot[name=body]{color:rgb(var(--colour-text-and-icon-2,72,72,72));font-size:.875rem;line-height:1.571}slot[name=body]::slotted(*){font-size:inherit}slot[name=title]{color:rgb(var(--colour-text-and-icon-1,17,17,17));display:block;font-weight:700;line-height:1.571;margin:0;padding-bottom:.25rem}slot[name=title].skapa-empty{display:contents}slot[name=title]::slotted(*){font-size:inherit}@media (prefers-reduced-motion){:host([dismissed]){transition-duration:0ms}}@media (prefers-contrast:more){:host{border-block-end-width:1px;border-block-start-width:1px;border-inline-end-width:1px}}';\nlet template;\nfunction getTemplate() {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = prefixReplacer(`\n \n \n
\n \n \n \n
\n \n `);\n }\n return template;\n}\nfunction evaluateSlot(event) {\n const slot = event.target;\n checkSlot(slot);\n}\nfunction checkSlot(slot) {\n slot.classList.toggle('skapa-empty', !slot.assignedElements({ flatten: true }).length);\n}\nexport class InlineMessage extends SkapaElement {\n constructor() {\n super();\n this.handleClick = () => {\n if (!this.dismissed)\n this.dismissed = true;\n };\n this.gatherProperties(['subtle', 'variant', 'dismissed'], this);\n const shadow = this.shadow = this.attachShadow({ mode: 'open' });\n shadow.append(getTemplate().content.cloneNode(true));\n this.closeButtonSlot = shadow.querySelector('slot[name=close-button]');\n }\n static get observedAttributes() {\n return ['dismissed'];\n }\n connectedCallback() {\n super.connectedCallback();\n Array.from(this.shadow.querySelectorAll('slot')).map(checkSlot);\n this.shadow.addEventListener('slotchange', evaluateSlot);\n this.setAttribute('aria-hidden', (this.dismissed).toString());\n this.closeButtonSlot.addEventListener('click', this.handleClick);\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.shadow.removeEventListener('slotchange', evaluateSlot);\n this.closeButtonSlot.removeEventListener('click', this.handleClick);\n }\n attributeChangedCallback(attributeName, oldValue, newValue) {\n if (newValue !== null) {\n this.style.height = `${this.clientHeight}px`;\n requestAnimationFrame(() => this.style.height = '0px');\n }\n else {\n this.style.removeProperty('height');\n }\n this.setAttribute('aria-hidden', (!(newValue === null)).toString());\n }\n get subtle() {\n return this.hasAttribute('subtle');\n }\n set subtle(value) {\n this.toggleAttribute('subtle', !!value);\n }\n get dismissed() {\n return this.hasAttribute('dismissed');\n }\n set dismissed(value) {\n this.toggleAttribute('dismissed', !!value);\n }\n get variant() {\n return this.getAttribute('variant') || 'informative';\n }\n set variant(value) {\n if (!value)\n this.removeAttribute('variant');\n else\n this.setAttribute('variant', value);\n }\n}\nexport default InlineMessage;\n","import define from '@ingka/webc-tools';\nimport { InlineMessage } from './src/InlineMessage.js';\nexport { InlineMessage };\nexport const inlineMessageTagName = define('inline-message', InlineMessage);\n","const BODYLOCK_CLASSNAME = 'skapa-modal-scroll-block-active';\n// @ts-ignore\nconst someCSS = 'body.skapa-modal-scroll-block-active{overflow:hidden;padding-inline-end:var(--skapa-scrollbar-width)!important}';\nconst tempNode = document.createElement('style');\ntempNode.innerHTML = someCSS;\nconst lockers = new WeakSet();\nexport function lockBody(caller) {\n if (typeof window === 'undefined')\n return; // SSR\n if (lockers.has(caller))\n return;\n const body = document.body;\n body.dataset.skapaModals = (getOpenModals() + 1).toString();\n lockers.add(caller);\n if ((!body.classList.contains(BODYLOCK_CLASSNAME))) {\n const beforePadding = window.getComputedStyle(body).paddingInlineEnd;\n const beforeWidth = body.clientWidth;\n body.classList.add(BODYLOCK_CLASSNAME);\n body.append(tempNode);\n const scrollbarWidth = body.clientWidth - beforeWidth;\n if (scrollbarWidth)\n caller.style.setProperty('--skapa-body-scrollbar-width', `${scrollbarWidth}px`);\n body.style.setProperty('--skapa-scrollbar-width', `calc(${scrollbarWidth}px + ${beforePadding})`);\n }\n}\nexport function releaseBody(caller) {\n if (!lockers.has(caller))\n return false;\n const body = document.body;\n body.dataset.skapaModals = (getOpenModals() - 1).toString();\n if (getOpenModals() > 1)\n return false; // there are open modals still, don't release\n lockers.delete(caller);\n if (body.classList.contains(BODYLOCK_CLASSNAME)) {\n body.classList.remove(BODYLOCK_CLASSNAME);\n body.style.removeProperty('--skapa-scrollbar-width');\n tempNode.remove();\n return true;\n }\n return true;\n}\nfunction getOpenModals() {\n var _a;\n return (Number((_a = document.body) === null || _a === void 0 ? void 0 : _a.dataset.skapaModals) || 0);\n}\n","export const Events = {\n Enable: 'skapa-focus-lock-enable',\n Disable: 'skapa-focus-lock-disable',\n Escape: 'skapa-focus-lock-escape-hotkey'\n};\nexport class SkapaFocusLockEvent extends Event {\n constructor(type, ref) {\n super(type);\n this.SkapaFocusLockReference = ref;\n }\n}\n","import { Events } from './focus-lock-event.js';\nconst instances = new Set();\nexport function getNodeHost(node) {\n if (!node)\n return;\n const root = node.getRootNode();\n if ('host' in root)\n return root.host;\n}\nfunction getParentOfLeaf(leafNode) {\n return leafNode.parentElement\n || (leafNode.getRootNode() && leafNode.getRootNode().host);\n}\n// Build an ancestor tree similar to event.composedPath();\nexport function getComposedPathForLeaf(leafNode) {\n const result = [leafNode];\n let leaf = leafNode;\n let parent;\n while ((parent = getParentOfLeaf(leaf))) {\n result.push(leaf = parent);\n }\n return result;\n}\n// Missing support for SVG embedded content support in general. Focusable elements such that have `focusable=true` attribute, foreginObject embeds.\nexport function getFirstFocusable(elementArray, reverse, root) {\n var _a;\n const all = [...elementArray];\n if (reverse)\n all.reverse();\n const windowDefined = typeof window !== 'undefined';\n for (let i = 0; i < all.length; i++) {\n const el = all[i];\n // perform some basic tests on the element and it's parents style applied visibility\n if (windowDefined && !recursiveVisibilityCheck(el, root))\n continue;\n // Don't consider disabled, hidden elements at all.\n if (el.matches('[disabled], [hidden], [inert]'))\n continue;\n if (el.matches('button, a[href], input:not([type=\"hidden\"]), select, textarea, audio, video, details, [tabindex], [contenteditable]:not([contenteditable=\"false\"])')\n && el.matches(':not([tabindex=\"-1\"])')) {\n if ((_a = el.closest('fieldset')) === null || _a === void 0 ? void 0 : _a.hasAttribute('disabled'))\n continue; // if its part of a disabled fieldset.\n return el;\n }\n if (el.shadowRoot) {\n const embedded = getFirstFocusable(Array.from(el.shadowRoot.querySelectorAll('*')), reverse, el); // Let's find potential focusables within the shadowroot.\n if (embedded)\n return embedded;\n }\n if (el.tagName === 'SLOT') {\n const slotted = getFirstFocusable(Array.from(el.assignedElements({ flatten: true })), reverse, el); // Let's find potential slot-assigned focusable element.\n if (slotted)\n return slotted;\n }\n }\n}\nfunction registerLockChange(ev) {\n const ref = ev.SkapaFocusLockReference;\n if (ev.type === Events.Enable) {\n // Lock enabled on an instance.\n const previousActive = [...instances.values()].reverse()[0]; // The active focus lock that was activated before the current one.\n if (previousActive)\n previousActive.passive = true;\n instances.add(ref);\n }\n else {\n // Lock disabled on an instance.\n instances.delete(ref);\n // We need to remove the passive state\n const previousActive = [...instances.values()].reverse()[0]; // The active focus lock that was activated before the current one.\n if (previousActive)\n previousActive.passive = false;\n }\n}\n// Single notifier\nfunction notifyPointerEvent(ev) {\n instances.forEach(instance => instance.handlePointer(ev));\n}\nfunction notifyKeyEvent(ev) {\n if (ev.key === 'Escape') {\n // Maybe the locks should automatically break if escape is pressed?! Uncomment next line if yes. Currently the framework implementations are expected to handle this.\n // instances.forEach(instance => instance.disabled = true);\n }\n instances.forEach(instance => instance.handleKeyboard(ev));\n}\nconst uiEvents = ['mousedown', 'pointerup', 'touchstart', 'click'];\nconst keyEvents = ['keydown', 'keyup'];\nconst focusLockEvents = [Events.Enable, Events.Disable];\nlet listenersSet = false;\nexport function setDocumentListeners(on = true) {\n if (listenersSet === on)\n return; // if no change\n if (!on && instances.size)\n return; // keep the listeners as long as there are registered instances available.\n const listenerBind = (on ? document.addEventListener : document.removeEventListener).bind(document);\n uiEvents.forEach(eventType => listenerBind(eventType, notifyPointerEvent, { capture: true }));\n keyEvents.forEach(eventType => listenerBind(eventType, notifyKeyEvent));\n focusLockEvents.forEach(eventType => listenerBind(eventType, registerLockChange));\n listenersSet = on;\n}\n/** This caching helper lessens performance hit by caching the visibility results of elements for the length of a frame. */\nlet resetID = -1;\nconst visibilityCache = { cache: new WeakMap() };\nfunction resetVisibilityCache() {\n resetID = -1;\n visibilityCache.cache = new WeakMap();\n}\n/** This function checks the element ancestry for applied hidden visibility\n * @returns `true` if visible and `false` if hidden.\n */\nfunction recursiveVisibilityCheck(el, root) {\n if (!el)\n return false;\n if (el === root)\n return true;\n // Local reference to actual cache Map.\n const cache = visibilityCache.cache;\n // If the element has already been inspected in this frame.\n if (cache.has(el))\n return !!cache.get(el);\n // If the cache reset has not been triggered, then request it.\n if (resetID === -1) {\n resetID = requestAnimationFrame(resetVisibilityCache);\n }\n const { display, visibility } = window.getComputedStyle(el); // This may be an expensive call, but no alternative solution to test the rendering of the element is available. Perhaps some ARIA internal check?\n // Tested in chrome and its around a 10th of a milisecond. results are cached in an attemp to prevent overwhelming checks.\n if (display === 'none' || visibility === 'hidden') {\n cache.set(el, false);\n return false; // Not visible\n }\n const parent = el.parentNode;\n if (parent && parent === root) {\n // parent is already the focus lock region container, assume its visible.\n cache.set(el, true);\n return true;\n }\n if (parent && parent.nodeType === 1) {\n // If the parent is an element\n const result = recursiveVisibilityCheck(parent, root); // check for its visibility\n cache.set(el, result); // store it\n return result;\n }\n if (parent && parent.nodeType === 11 && ('host' in parent)) {\n // if the parent is a shadowDom\n const result = recursiveVisibilityCheck(parent.host, root); // check for its visibility\n cache.set(el, result); // store it\n return result;\n }\n cache.set(el, true);\n return true;\n}\nexport function getActiveLeaf(base = document) {\n if (!base.activeElement)\n return;\n if (!base.activeElement.shadowRoot)\n return base.activeElement;\n return getActiveLeaf(base.activeElement.shadowRoot) || base.activeElement;\n}\n","import { getFirstFocusable } from './helpers.js';\n/**\n * This helper tool is created to surround the focus locked container with focusable elemnets.\n * By doing so it ensures that the user does not accidentally navigate out of the frame if otherwise\n * there would be no other focusable elements.\n */\nexport const CATCHER_ATTRIBUTE_NAME = 'skapa-focus-region-boundary';\nlet elementTemplate;\nfunction getCatcherElement() {\n if (!elementTemplate) {\n elementTemplate = document.createElement('div');\n elementTemplate.tabIndex = 0;\n elementTemplate.toggleAttribute(CATCHER_ATTRIBUTE_NAME, true);\n elementTemplate.style.position = 'fixed';\n elementTemplate.style.top = '0';\n elementTemplate.style.left = '0';\n elementTemplate.style.width = '1px';\n }\n return elementTemplate.cloneNode(true);\n}\nconst catchers = new Map();\n// Since we are immediately refocusing, the event should be cancelled to prevent event listener race condition related pitfalls.\nfunction cancelEventAndRefocus(ev, target) {\n ev.preventDefault();\n ev.stopImmediatePropagation();\n target.focus();\n}\nexport function createCatchers(host) {\n const container = host.container;\n if (container.isConnected && container.parentElement) {\n if (catchers.has(host))\n removeCatchers(host);\n const elementBefore = getCatcherElement();\n const elementAfter = getCatcherElement();\n const focusedBefore = function (ev) {\n // Refocus the last element of the container.\n const target = getFirstFocusable(Array.from(container.querySelectorAll('*')), true, container);\n if (target)\n cancelEventAndRefocus(ev, target);\n };\n const focusedAfter = function (ev) {\n // Refocus the first element of the container.\n const target = getFirstFocusable(Array.from(container.querySelectorAll('*')), false, container);\n if (target)\n cancelEventAndRefocus(ev, target);\n };\n elementBefore.addEventListener('focusin', focusedBefore, { capture: true });\n elementAfter.addEventListener('focusin', focusedAfter, { capture: true });\n container.before(elementBefore);\n container.after(elementAfter);\n catchers.set(host, { nodes: [elementBefore, elementAfter], listeners: [focusedBefore, focusedAfter] });\n }\n}\nexport function removeCatchers(host) {\n const containerBoundFocusCatchers = catchers.get(host);\n if (containerBoundFocusCatchers) {\n containerBoundFocusCatchers.nodes.forEach((catcher, i) => {\n catcher.removeEventListener('focusin', containerBoundFocusCatchers.listeners[i], { capture: true });\n if (catcher && catcher.isConnected)\n catcher.remove();\n });\n catchers.delete(host);\n }\n}\n","import { Events, SkapaFocusLockEvent } from './utils/focus-lock-event.js';\nimport { getFirstFocusable, setDocumentListeners, getNodeHost, getComposedPathForLeaf, getActiveLeaf } from './utils/helpers.js';\nimport { createCatchers, removeCatchers, CATCHER_ATTRIBUTE_NAME } from './utils/focus-catcher.js';\nexport { Events, SkapaFocusLockEvent };\n// Since the effects of SkapaFocusLock are so very intrusive, it will have to be manually and explicitly activated.\nexport class SkapaFocusLock extends EventTarget {\n constructor(container) {\n super();\n // Controls if any `data-autofocus` flagged nested focusable element should be focused on lock.\n this.autoFocus = false;\n // Internal feature control - Sets the focus lock feature into a temporary disabled state to prevent race conditions when multiple active focus regions are activated.\n this.passive = false;\n // Controls if pointer events outside the focus regions should be cancelled when the compoennt is on.\n this.capturePointerEvents = true;\n // Controls if the focus should be returned after deactivation\n this.autoFocusReturn = true;\n this.__active = false;\n this.__disableKeyConfig = { key: 'Escape', shift: false, ctrl: false };\n this.__shiftKeyDown = false;\n this.handleKeyboard = (ev) => {\n if (this.passive)\n return;\n // Self disable if disable hotkey is pressed.\n if ((ev.type === 'keydown') && (typeof ev.key === 'string') && (ev.key.toLowerCase() === this.__disableKeyConfig.key.toLowerCase())) {\n const { shift, ctrl } = this.__disableKeyConfig;\n if (shift === ev.shiftKey && ctrl === ev.ctrlKey) {\n // Disable hotkey pressed.\n this.active = false;\n // should dispatch an event to let the implementer know what happened?\n this.dispatchEvent(new SkapaFocusLockEvent(Events.Escape, this));\n return;\n }\n }\n if (ev.key !== 'Shift')\n return;\n this.__shiftKeyDown = ev.type === 'keydown';\n };\n this.disconnectedLockWrapper = () => {\n const isDisconnected = !(this.container && this.container.isConnected);\n if (isDisconnected)\n console.warn('Focus lock feature was not disabled before removing the container from the DOM tree.');\n return isDisconnected;\n };\n this.handlePointer = (ev) => {\n if (this.passive || !this.capturePointerEvents)\n return;\n if (this.disconnectedLockWrapper())\n return;\n const cPath = ev.composedPath();\n if (!(cPath.includes(this.container) // this can save some manual calculation time\n || cPath.find(el => Element.prototype.isPrototypeOf(el) && (el.classList.contains('skapa-focus-portal')))\n || this.isElementWithin(cPath[0]))) {\n // then don't click or touch scroll\n if (ev.cancelable)\n ev.preventDefault();\n if (ev.type === 'click')\n ev.stopImmediatePropagation();\n }\n };\n this.enableLock = () => {\n // perhaps some safety cleanup?\n this.container.addEventListener('focusout', this.handleFocus);\n setDocumentListeners(true);\n createCatchers(this);\n // The event dispatch should come after setting the document listeners and before the capturing of the focus.\n document.dispatchEvent(new SkapaFocusLockEvent(Events.Enable, this));\n this.captureFocus();\n };\n this.disableLock = () => {\n removeCatchers(this);\n setDocumentListeners(false);\n this.container.removeEventListener('focusout', this.handleFocus);\n this.returnFocus();\n // The event dispatch should come before removing the document listeners and after the returning of the focus.\n document.dispatchEvent(new SkapaFocusLockEvent(Events.Disable, this));\n };\n /** Capture and return initial focus */\n this.captureFocus = () => {\n if (document.activeElement)\n this._activeElementBeforeFocusLock = getActiveLeaf();\n // Init focus\n // Implement these for retrocompatibility with the react-focus-trap package: https://github.com/theKashey/focus-lock#declarative-control\n const autofocus = this.autoFocus && this.container.querySelector('*[data-autofocus]:not([tabindex=\"-1\"]):not(:disabled)');\n const focuses = Array.from(this.container.querySelectorAll('*'));\n const focusTarget = getFirstFocusable(autofocus ? [autofocus] : focuses, false, this.container);\n if (focusTarget)\n focusControl(focusTarget); // Capturing with a slight delay for better screenreader UX.\n else\n this.noFocusTargetException();\n };\n this.returnFocus = () => {\n if (!this.autoFocusReturn)\n return;\n if (this._activeElementBeforeFocusLock && this._activeElementBeforeFocusLock.isConnected) {\n focusControl(this._activeElementBeforeFocusLock); // Returning with a slight delay for better screenreader UX.\n }\n };\n /** Internal - handle focus event callback. */\n this.handleFocus = (ev) => {\n if (this.passive)\n return;\n // If the container has been removed from the DOM tree.\n if (!this.container.isConnected)\n return;\n // Couple of check if the event is an aritifical event that does not follow the relevant API standards.\n const relatedTarget = (ev.relatedTarget && ('nodeType' in ev.relatedTarget) && (ev.relatedTarget.nodeType === 1)) ? ev.relatedTarget : null;\n if (!relatedTarget || relatedTarget.hasAttribute(CATCHER_ATTRIBUTE_NAME))\n return;\n if (!this.isElementWithin(relatedTarget) // If the newly focused element is not a descendant of the focus-lock region.\n ) {\n // then recapture focus\n ev.preventDefault();\n const dispatcher = ev.composedPath()[0];\n const focusTarget = dispatcher || getFirstFocusable(Array.from(this.container.querySelectorAll('*')), this.__shiftKeyDown, this.container);\n if (focusTarget)\n focusTarget.focus();\n else\n this.noFocusTargetException();\n }\n };\n this.isElementWithin = (el, container = this.container) => {\n var _a;\n return Boolean(el && (container.contains(el)\n || (container.shadowRoot && container.shadowRoot.contains(el))\n || ((_a = getNodeHost(container)) === null || _a === void 0 ? void 0 : _a.contains(el))\n || getComposedPathForLeaf(el).includes(container)));\n };\n this.noFocusTargetException = () => {\n // Nothing to focus on. Disable?\n console.warn(`Warning! Skapa Focus-lock found no focusable elements on ${this.container}.\\nFocus lock remains disabled.`);\n this.disableLock();\n };\n this.container = container;\n }\n get active() {\n return this.__active;\n }\n // Controls the focus lock feature\n set active(value) {\n if (this.__active === value)\n return; // prevent multiple initialisations and event dispatches.\n this.__active = value;\n if (value)\n this.enableLock();\n else\n this.disableLock();\n }\n get disableKey() {\n return this.__disableKeyConfig;\n }\n // Override the hotkey for disabling the lock.\n setDisableKey(config) {\n this.__disableKeyConfig = Object.assign({ key: 'Escape', shift: false, ctrl: false }, config);\n }\n}\nlet focusControlTaskID = -1;\nfunction focusControl(target) {\n clearTimeout(focusControlTaskID);\n if (typeof window === 'undefined')\n return;\n focusControlTaskID = window.setTimeout(() => {\n if (target && target.isConnected)\n target.focus();\n }, 50); // Slight delay improves screen reader compatiblity.\n}\n","// @ts-ignore\nconst styles = ':host{--modal-body-padding-inline:1.5rem}.modal-body{flex-grow:1;overflow-x:hidden;overflow-y:auto;padding:0 var(--modal-body-padding-inline,1.5rem)}.modal-body::slotted(skapa-modal-edge){display:block;margin-left:calc(var(--modal-body-padding-inline, 1.5rem)*-1);margin-right:calc(var(--modal-body-padding-inline, 1.5rem)*-1);width:calc(100% + var(--modal-body-padding-inline, 1.5rem)*2)}@media (min-width:37.5em){:host(:not([size=small])){--modal-body-padding-inline:2rem}}@media (min-width:75em){:host .modal-body{--modal-body-padding-inline:2.5rem}}:host{--skapa-modal-transition-duration:100ms;--skapa-modal-transition-function:cubic-bezier(0.9,0,1,1);bottom:0;left:0;position:fixed;right:0;top:0;transition:visibility var(--skapa-modal-transition-duration) step-end;visibility:hidden;z-index:3}:host([open]){--skapa-modal-transition-duration:200ms;--skapa-modal-transition-function:cubic-bezier(0.8,0,0,1);pointer-events:unset;transition-timing-function:step-start;visibility:visible}:host([open]) .backdrop{opacity:1}.backdrop{background:rgba(var(--colour-static-black,17,17,17),.4);bottom:0;left:0;opacity:0;position:absolute;right:0;top:0;transition:opacity var(--skapa-modal-transition-duration) var(--skapa-modal-transition-function)}*{box-sizing:border-box}slot{display:block}.modal{background:rgb(var(--colour-elevation-2,255,255,255));display:none;flex-basis:auto;flex-direction:column;min-height:0;overflow:hidden;visibility:hidden;z-index:1}.modal.visible,:host([open]) .modal{display:flex}.modal.visible{visibility:visible}slot[name=header]{z-index:1}@media (prefers-reduced-motion){:host{--skapa-modal-transition-duration:1ms!important}}';\nimport SkapaElement from '@ingka/skapa-webc-element';\nimport { lockBody, releaseBody } from './utils/scroll-lock.js';\nimport { prefixReplacer } from '@ingka/webc-tools';\nimport { SkapaFocusLock } from '@ingka/focus-lock-shared';\nlet template;\nfunction getTemplate() {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = prefixReplacer(`\n \n
\n `);\n }\n return template;\n}\nexport class ModalAbstract extends SkapaElement {\n constructor(finalTemplate) {\n super();\n this.reportCloseAnimationFinished = (ev) => {\n if (!this.open && ev.target === this) {\n cancelAnimationFrame(this.__animationHelperID);\n this.panel.classList.remove('visible');\n this.dispatchEvent(new Event('closed'));\n }\n };\n this.handleEscapeRequest = () => {\n const closeEvent = new CustomEvent('closerequest');\n this.dispatchEvent(closeEvent);\n if (!closeEvent.defaultPrevented)\n this.open = false;\n };\n this.__animationHelperID = -1;\n this.updateAssitiveTools = () => {\n cancelAnimationFrame(this.__animationHelperID);\n // Disable automatic focus return if requested.\n this.focusTrap.autoFocusReturn = !this.noAutoReturn;\n // Only set open internal state of the modal if its connected to the DOM.\n if (this.open && this.isConnected) {\n // This is required to ensure chrome and firefox calculates the transform value before the `visible` class is applied. Which class triggers the animation.\n const initialTransform = window.getComputedStyle(this).transform;\n // Let's wrap the dialog launch tasks.\n const lockAndAnimateDialog = () => {\n // Setting the `visible` class on the panel will trigger its opening animation.\n // It has to be added a one frame late.\n this.panel.classList.add('visible');\n this.enableFocuslock();\n // The body manipulation must come after the focusTrap activation otherwise the focus return may be lost in some browsers (Safari).\n // Lock the document's body element and disable scrollbar.\n if (!this.unlockedScroll)\n lockBody(this);\n else\n releaseBody(this);\n };\n // If the focus lock is requested to be disabled, then it should be done immediately.\n if (this.freeFocus)\n this.focusTrap.active = false;\n // Turning it on should wait until the Styles and DOM elements have safely been mounted / calculated.\n this.__animationHelperID = requestAnimationFrame(lockAndAnimateDialog);\n }\n else {\n releaseBody(this);\n this.disableFocusLock();\n }\n };\n this.gatherProperties(['open', 'freeFocus', 'unlockedScroll', 'noAutoReturn'], this);\n const shadow = this.attachShadow({ mode: 'open' });\n shadow.append(getTemplate().content.cloneNode(true), finalTemplate.content.cloneNode(true));\n this.backdrop = shadow.querySelector('div.backdrop');\n this.panel = shadow.querySelector('div.modal');\n this.focusTrap = new SkapaFocusLock(this);\n this.focusTrap.autoFocus = true;\n }\n connectedCallback() {\n super.connectedCallback();\n // Probably only set these if the modal is open\n this.setAttribute('aria-hidden', (!this.open).toString());\n this.backdrop.addEventListener('click', this.handleEscapeRequest);\n this.addEventListener('transitionend', this.reportCloseAnimationFinished);\n this.updateAssitiveTools();\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.backdrop.removeEventListener('click', this.handleEscapeRequest);\n this.updateAssitiveTools();\n this.removeEventListener('transitionend', this.reportCloseAnimationFinished);\n }\n get open() {\n return this.hasAttribute('open');\n }\n set open(val) {\n this.toggleAttribute('open', !!val);\n }\n get freeFocus() {\n return this.hasAttribute('free-focus');\n }\n set freeFocus(toggle) {\n this.toggleAttribute('free-focus', !!toggle);\n }\n get noAutoReturn() {\n return this.hasAttribute('no-auto-return');\n }\n set noAutoReturn(toggle) {\n this.toggleAttribute('no-auto-return', !!toggle);\n }\n get unlockedScroll() {\n return this.hasAttribute('unlocked-scroll');\n }\n set unlockedScroll(toggle) {\n this.toggleAttribute('unlocked-scroll', !!toggle);\n }\n enableFocuslock() {\n this.focusTrap.active = !this.freeFocus;\n this.focusTrap.removeEventListener('skapa-focus-lock-escape-hotkey', this.handleEscapeRequest); // make sure to prevent duplicate listeners.\n this.focusTrap.addEventListener('skapa-focus-lock-escape-hotkey', this.handleEscapeRequest);\n }\n disableFocusLock() {\n this.focusTrap.active = false;\n this.focusTrap.removeEventListener('skapa-focus-lock-escape-hotkey', this.handleEscapeRequest);\n }\n attributeChangedCallback(name, oldVal, newVal) {\n if (name === 'open') {\n const isOpen = newVal !== null;\n this.setAttribute('role', isOpen ? 'dialog' : 'none'); // This is required for NVDA to refresh itself on second view.\n this.setAttribute('aria-modal', isOpen.toString());\n this.setAttribute('aria-hidden', (!isOpen).toString());\n this.updateAssitiveTools();\n }\n else if (['no-auto-return', 'free-focus', 'unlocked-scroll'].includes(name)) {\n this.updateAssitiveTools();\n }\n }\n}\nModalAbstract.observedAttributes = ['open', 'free-focus', 'unlocked-scroll', 'no-auto-return'];\n","// @ts-ignore\nconst styles = ':host{--sheet-size-small:30rem;--sheet-size-medium:45rem;--sheet-size-large:67.5rem;--border-outer:calc(max(var(--skapa-modal-align-start, 1) * var(--skapa-modal-rtl, 1), 0)*0.5rem);--border-inner:calc(max(-1 * var(--skapa-modal-align-start, 1) * var(--skapa-modal-rtl, 1), 0)*0.5rem);--border-for-side:var(--border-outer) var(--border-inner) var(--border-inner) var(--border-outer);--current-sheet-size:var(--sheet-size-medium);display:flex;flex-direction:column}:host([align-to-start]){--skapa-modal-align-start:-1;--skapa-modal-footer-alignment:flex-end}:host([skapa-rtl]){--skapa-modal-rtl:-1}:host([size=small]){--current-sheet-size:var(--sheet-size-small)}:host([size=large]){--current-sheet-size:var(--sheet-size-large)}:host:before{content:\"\";flex-grow:1;min-height:3rem;min-width:3rem}.modal{border-radius:.5rem .5rem 0 0;transform:translateY(100%)}.modal.visible{transition:transform var(--skapa-modal-transition-duration) var(--skapa-modal-transition-function)}:host([full-height]) .modal{flex-basis:100%}:host([preserve-alignment]){flex-direction:row}:host([preserve-alignment]):host:before{order:calc(2 + var(--skapa-modal-align-start, -2))}:host([preserve-alignment]) .modal{border-radius:var(--border-for-side);transform:translateX(calc(var(--skapa-modal-align-start, 1)*var(--skapa-modal-rtl, 1)*100%))}:host([open]) .modal.visible{transform:translate(0)!important}:host(:not([open])) .modal.visible{--null-if-startaligned:calc(var(--skapa-modal-align-start, 0) + 1);left:calc(var(--null-if-startaligned, 1)*var(--skapa-modal-rtl, 1)*var(--skapa-body-scrollbar-width, 0px));position:relative}slot[name=footer].skapa-empty{min-height:2rem}@media (min-width:37.5em){:host,:host([full-height]){flex-direction:row}:host .modal,:host([full-height]) .modal{border-radius:var(--border-for-side);flex-basis:var(--current-sheet-size);transform:translateX(calc(var(--skapa-modal-align-start, 1)*var(--skapa-modal-rtl, 1)*100%))}:host:before{order:calc(2 + var(--skapa-modal-align-start, -2))}}';\nimport { ModalAbstract } from './ModalAbstract.js';\nimport { prefixReplacer, RTLObserver, SlotTools } from '@ingka/webc-tools';\nlet template;\nfunction getTemplate() {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = prefixReplacer(`\n \n
\n \n \n \n
\n `);\n }\n return template;\n}\n// https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/dialog/\nexport class Sheet extends ModalAbstract {\n constructor() {\n super(getTemplate());\n this.handleSlotChange = (event) => {\n if (event.target) {\n const target = event.target;\n if (target.name === 'footer')\n this.updateAssignedFooter();\n }\n };\n this.updateAssignedFooter = () => {\n const footer = this.querySelector(prefixReplacer('skapa-modal-footer'));\n if (footer) {\n footer.toggleAttribute('small', this.size === 'small');\n footer.toggleAttribute('auto-size', this.size === 'large');\n }\n };\n this.gatherProperties(['size', 'fullHeight', 'alignToStart', 'preserveAlignment'], this);\n }\n connectedCallback() {\n super.connectedCallback();\n RTLObserver.addTarget(this, true); // Immediate evaluation of RTL is required to prevent invalid initial values for transition effects.\n Array.from(this.shadowRoot.querySelectorAll('slot')).map(SlotTools.checkSlot);\n this.shadowRoot.addEventListener('slotchange', SlotTools.slotChange);\n this.shadowRoot.addEventListener('slotchange', this.handleSlotChange);\n this.updateAssignedFooter();\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n RTLObserver.removeTarget(this);\n this.shadowRoot.removeEventListener('slotchange', this.handleSlotChange);\n this.shadowRoot.removeEventListener('slotchange', SlotTools.slotChange);\n }\n get size() {\n return (this.getAttribute('size') || null) || 'medium';\n }\n set size(size) {\n if (size === 'medium')\n this.removeAttribute('size');\n else\n this.setAttribute('size', size);\n }\n get fullHeight() {\n return this.hasAttribute('full-height');\n }\n set fullHeight(toggle) {\n this.toggleAttribute('full-height', !!toggle);\n }\n get alignToStart() {\n return this.hasAttribute('align-to-start');\n }\n set alignToStart(toggle) {\n this.toggleAttribute('align-to-start', !!toggle);\n }\n get preserveAlignment() {\n return this.hasAttribute('preserve-alignment');\n }\n set preserveAlignment(toggle) {\n this.toggleAttribute('preserve-alignment', !!toggle);\n }\n attributeChangedCallback(name, oldVal, newVal) {\n super.attributeChangedCallback(name, oldVal, newVal);\n if (name === 'size') {\n this.updateAssignedFooter();\n }\n }\n}\nSheet.observedAttributes = [...ModalAbstract.observedAttributes, 'size', 'full-height'];\n","// @ts-ignore\nconst styles = ':host{align-items:center;display:flex;flex-direction:column;justify-content:center}.modal{border-radius:.5rem;margin:1.5rem;max-height:75vh;max-width:31.5rem;opacity:0;transform:scale(90%);transition:transform var(--skapa-modal-transition-duration) var(--skapa-modal-transition-function);transition-property:transform,opacity}:host([open]) .modal.visible{opacity:1;transform:scale(100%)}slot[name=header]{--skapa-modal-header-padding:0.5rem 0.5rem 0 0.5rem;min-height:2rem}div.modal-body{overflow:unset}slot[name=title]:not([skapa-empty]){margin-bottom:.75rem}@media (orientation:landscape){.modal{max-height:unset}}@media (min-width:37.5em){.modal-body{font-size:1rem;line-height:1.625}.modal-body::slotted(:not(:first-child)){margin-top:1rem}slot[name=title]:not([skapa-empty]){margin-bottom:1rem}}';\nimport { ModalAbstract } from './ModalAbstract.js';\nimport { prefixReplacer, SlotTools } from '@ingka/webc-tools';\nlet template;\nfunction getTemplate() {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = prefixReplacer(`\n \n
\n \n
\n \n \n
\n `);\n }\n return template;\n}\nexport class Prompt extends ModalAbstract {\n constructor() {\n super(getTemplate());\n this.handleSlotChange = (event) => {\n SlotTools.slotChange(event);\n if (event.target) {\n const target = event.target;\n if (target.name === 'footer')\n this.updateAssignedFooter();\n }\n };\n this.updateAssignedFooter = () => {\n const footer = this.querySelector(prefixReplacer('skapa-modal-footer'));\n if (footer)\n footer.setAttribute('small', '');\n };\n }\n connectedCallback() {\n super.connectedCallback();\n Array.from(this.shadowRoot.querySelectorAll('slot')).map(SlotTools.checkSlot);\n this.shadowRoot.addEventListener('slotchange', this.handleSlotChange);\n this.updateAssignedFooter();\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.shadowRoot.removeEventListener('slotchange', this.handleSlotChange);\n }\n}\n","import { getStore } from '@ingka/singleton-store';\nconst ICON_STORE_ID = 'skapa-icon-store';\n// The store will be initialized with a generic Map inside the getStore on first request.\nconst iconStore = getStore(ICON_STORE_ID);\nexport const registerIcon = (name, paths) => {\n if (!iconStore.has(name))\n iconStore.set(name, paths);\n};\nexport const getPaths = (name) => {\n if (!name)\n return;\n const result = iconStore.get(name);\n if (!result)\n console.error(`The icon: '${name}' has not been loaded yet!\\nDid you forget to import '@ingka/icon-store/${name}'?`);\n return result;\n};\n","import { registerIcon } from './index.js';\nregisterIcon('cross', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'm12 13.4142 4.9498 4.9497 1.4142-1.4142L13.4142 12l4.9498-4.9498-1.4142-1.4142L12 10.5857 7.0503 5.636 5.636 7.0502 10.5859 12l-4.9497 4.9497 1.4142 1.4142L12 13.4142z' } }]);\n","import { registerIcon } from './index.js';\nregisterIcon('arrow-left', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'm3.999 11.9997 8 8.0011 1.4143-1.4141-5.5859-5.5866H20v-2H7.8273l5.5871-5.5868-1.4142-1.4143-8.0012 8.0007z' } }]);\n","// @ts-ignore\nconst styles = '*{box-sizing:border-box}slot.skapa-empty{pointer-events:none}:host{display:block;position:relative}.header{--skapa-modal-header-default-padding:0.5rem;color:rgb(var(--colour-text-and-icon-1,17,17,17));display:flex;flex-direction:row;padding:var(--skapa-modal-header-padding,var(--skapa-modal-header-default-padding));position:relative;width:100%}.header slot[name]{--skapa-focus-ring-internal:rgb(var(--colour-neutral-1,255,255,255));--skapa-focus-ring-external:rgb(var(--colour-neutral-7,17,17,17));display:block;flex-basis:2.5rem;min-width:2.5rem}.header slot:not([name]){margin:0 .5rem}:host([floating]) .header{--skapa-modal-header-default-padding:1rem;position:absolute}:host([floating]) slot:not([name]){visibility:hidden}slot:not([name]){align-items:center;display:flex;flex-grow:1;font-weight:700;justify-content:center;text-align:center}@media (min-width:37.5em){.header{--skapa-modal-header-default-padding:1rem}:host([floating]) .header{--skapa-modal-header-default-padding:1.5rem}}';\nimport SkapaElement from '@ingka/skapa-webc-element';\nimport { SlotTools } from '@ingka/webc-tools';\nimport '@ingka/icon-webc';\nimport '@ingka/button-webc';\nimport '@ingka/icon-store/cross';\nimport '@ingka/icon-store/arrow-left';\nimport { prefixReplacer } from '@ingka/webc-tools';\nlet template;\nfunction getTemplate() {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = prefixReplacer(`\n \n
\n \n \n \n \n \n Close dialog\n \n \n
\n `);\n }\n return template;\n}\nexport class ModalHeader extends SkapaElement {\n constructor() {\n super();\n this.handleInteraction = (ev) => {\n const composedPath = ev.composedPath();\n if (composedPath.includes(this.closebuttonSlot)) {\n this.dispatchEvent(new Event('closerequest', { bubbles: true, composed: true }));\n }\n else if (composedPath.includes(this.backbuttonSlot)) {\n this.dispatchEvent(new Event('backrequest'));\n }\n };\n this.gatherProperties(['floating'], this);\n const shadow = this.attachShadow({ mode: 'open' });\n shadow.append(getTemplate().content.cloneNode(true));\n this.closebuttonSlot = shadow.querySelector('[name=close-button]');\n this.backbuttonSlot = shadow.querySelector('[name=back-button]');\n }\n connectedCallback() {\n super.connectedCallback();\n Array.from(this.shadowRoot.querySelectorAll('slot')).map(SlotTools.checkSlot);\n this.shadowRoot.addEventListener('slotchange', SlotTools.slotChange);\n this.addEventListener('click', this.handleInteraction);\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.shadowRoot.removeEventListener('slotchange', SlotTools.slotChange);\n this.removeEventListener('click', this.handleInteraction);\n }\n get floating() {\n return this.hasAttribute('floating');\n }\n set floating(value) {\n this.toggleAttribute('floating', !!value);\n }\n}\n","// @ts-ignore\nconst styles = '*{box-sizing:border-box}slot{display:block}slot[name=primary-button]{order:var(--primary-order,2)}slot[name=secondary-button]{order:var(--secondary-order,0)}:host([primary-lead]){--primary-order:0;--secondary-order:2}.gap{height:.75rem;order:1;width:.75rem}slot[name=secondary-button]:not([visible]),slot[name=secondary-button]:not([visible])+.gap{display:none}.footer{display:flex;flex-direction:column;padding:1.5rem 1rem}skapa-button,slot::slotted(*){width:100%}:host([compact]) .footer{flex-direction:row}:host([compact]) .footer slot{flex:1 50%}:host([border]) .footer{border-block-start:1px solid rgb(var(--colour-neutral-3,223,223,223))}@media (min-width:37.5em){:host .footer{padding:1.5rem}:host slot{flex-basis:50%}:host(:not([small])) .footer{flex-direction:row;justify-content:var(--skapa-modal-footer-alignment,flex-start)}:host(:not([small])) slot{flex-grow:1}:host(:not([small])) slot[name=secondary-button]:not([visible])~slot,:host([auto-size]) slot{flex:initial}.gap{height:1rem;width:1rem}}@media (orientation:landscape){.footer{flex-direction:row}:host([stacked][small]) .footer{flex-direction:column}slot{flex-grow:1}}';\nimport SkapaElement from '@ingka/skapa-webc-element';\nimport { SlotTools, prefixReplacer, BreakpointInfo } from '@ingka/webc-tools';\nimport '@ingka/icon-webc';\nimport '@ingka/button-webc';\nimport '@ingka/icon-store/cross';\nimport '@ingka/icon-store/arrow-left';\nlet template;\nfunction getTemplate() {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = prefixReplacer(`\n \n
\n \n \n \n \n \n
\n \n \n \n \n \n
\n `);\n }\n return template;\n}\nexport class ModalFooter extends SkapaElement {\n constructor() {\n super();\n this.handleSlotChange = (ev) => {\n const target = ev.target; // (w/c)ould this bubble from another slotted custom element?\n SlotTools.slotChange(ev);\n if (target.name === 'secondary') {\n // has title provided to secondary\n this.checkSecondary();\n }\n updateButtons(this);\n };\n this.checkSecondary = () => {\n const hasTitle = !this.secondaryButtonSlot.querySelector('slot').classList.contains('skapa-empty');\n const assignedElements = this.secondaryButtonSlot.assignedElements().length;\n this.secondaryButtonSlot.toggleAttribute('visible', Boolean(assignedElements || hasTitle));\n };\n this.handleInteraction = (ev) => {\n const composedPath = ev.composedPath();\n if (composedPath.includes(this.primaryButtonSlot)) {\n this.dispatchEvent(new Event('primary'));\n }\n else if (composedPath.includes(this.secondaryButtonSlot)) {\n this.dispatchEvent(new Event('secondary'));\n }\n };\n this.handleBreakpointChange = () => {\n updateButtons(this);\n };\n const shadow = this.attachShadow({ mode: 'open' });\n shadow.append(getTemplate().content.cloneNode(true));\n this.gatherProperties(['small', 'autoSize', 'compact', 'primaryLead', 'stacked'], this);\n this.primaryButtonSlot = shadow.querySelector('[name=primary-button]');\n this.secondaryButtonSlot = shadow.querySelector('[name=secondary-button]');\n }\n connectedCallback() {\n super.connectedCallback();\n this.shadowRoot.addEventListener('slotchange', this.handleSlotChange);\n this.addEventListener('click', this.handleInteraction);\n Array.from(this.shadowRoot.querySelectorAll('slot')).map(SlotTools.checkSlot);\n this.checkSecondary();\n BreakpointInfo.addBreakpointListener(this.handleBreakpointChange);\n updateButtons(this);\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.handleInteraction);\n BreakpointInfo.removeBreakpointListener(this.handleBreakpointChange);\n }\n get small() {\n return this.hasAttribute('small');\n }\n set small(small) {\n this.toggleAttribute('small', !!small);\n }\n get autoSize() {\n return this.hasAttribute('auto-size');\n }\n set autoSize(toggle) {\n this.toggleAttribute('auto-size', !!toggle);\n }\n get compact() {\n return this.hasAttribute('compact');\n }\n set compact(toggle) {\n this.toggleAttribute('compact', !!toggle);\n }\n get primaryLead() {\n return this.hasAttribute('primary-lead');\n }\n set primaryLead(toggle) {\n this.toggleAttribute('primary-lead', !!toggle);\n }\n get stacked() {\n return this.hasAttribute('stacked');\n }\n set stacked(toggle) {\n this.toggleAttribute('stacked', !!toggle);\n }\n}\nfunction updateButtons(host) {\n const isSmall = BreakpointInfo.getCurrentBreakpoint() === 'sm';\n const buttonTag = prefixReplacer('skapa-button');\n [...Array.from(host.querySelectorAll(buttonTag)),\n ...Array.from(host.shadowRoot.querySelectorAll(buttonTag))]\n .forEach(button => button.toggleAttribute('small', isSmall));\n}\n","import define from '@ingka/webc-tools';\nimport { Sheet } from './src/Sheet.js';\nimport { Prompt } from './src/Prompt.js';\nimport { ModalHeader } from './src/ModalHeader.js';\nimport { ModalFooter } from './src/ModalFooter.js';\nexport { Sheet, Prompt, ModalHeader, ModalFooter };\nexport const modalTagName = define('sheet', Sheet);\nexport const modalHeaderTagName = define('modal-header', ModalHeader);\nexport const modalFooterTagName = define('modal-footer', ModalFooter);\nexport const promptTagName = define('prompt', Prompt);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('shopping-bag-add', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M10.4372 4h3.1244l.2922.4801 3.3574 5.517h5.0694l-.3104 1.2425L21.5303 13h-2.0615l.2506-1.0029H4.2808l1.3106 5.2426a1 1 0 0 0 .9702.7574H15v2H6.5616c-1.3766 0-2.5766-.9369-2.9105-2.2724L2.03 11.2397l-.3107-1.2426H6.788l3.357-5.517L10.4372 4zm2.0003 2L14.87 9.9971H9.1291L11.5614 6h.8761zm5.5586 10v-2h2v2h2v2h-2v2h-2v-2h-2v-2h2z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar FocusOutlinePositionWatcherEnum;\n(function (FocusOutlinePositionWatcherEnum) {\n FocusOutlinePositionWatcherEnum[\"auto\"] = \"auto\";\n FocusOutlinePositionWatcherEnum[\"enabled\"] = \"enabled\";\n FocusOutlinePositionWatcherEnum[\"disabled\"] = \"disabled\";\n})(FocusOutlinePositionWatcherEnum || (FocusOutlinePositionWatcherEnum = {}));\nexports.default = FocusOutlinePositionWatcherEnum;\n//# sourceMappingURL=FocusOutlinePositionWatcherEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar FocusOutlineStyleTypeEnum;\n(function (FocusOutlineStyleTypeEnum) {\n FocusOutlineStyleTypeEnum[\"block\"] = \"block\";\n FocusOutlineStyleTypeEnum[\"inline\"] = \"inline\";\n})(FocusOutlineStyleTypeEnum || (FocusOutlineStyleTypeEnum = {}));\nexports.default = FocusOutlineStyleTypeEnum;\n//# sourceMappingURL=FocusOutlineStyleTypeEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst FocusOutlineStyleTypeEnum_1 = __importDefault(require(\"../../enums/FocusOutlineStyleTypeEnum\"));\nclass FocusOutlineStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.theme Theme.\n * @param options.hasFocus Has focus.\n * @param options.invertedColors Inverted colors.\n * @param options.styleType Inline or block.\n * @returns Styles.\n */\n static getStyle(options) {\n var _a;\n const { motion, focusOutline, color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\toutline: none;\n\t\t\t\tdisplay: ${options.styleType === FocusOutlineStyleTypeEnum_1.default.block\n ? 'inline-block'\n : 'inline'};\n\t\t\t\tborder-radius: ${focusOutline.borderRadius / 16}rem;\n\t\t\t\tposition: relative;\n\t\t\t}\n\n\t\t\t.outlineContainer {\n\t\t\t\tposition: absolute;\n\t\t\t\tz-index: inherit;\n\t\t\t\tborder-radius: inherit;\n\t\t\t\tpointer-events: none;\n\t\t\t\tleft: ${options.hasFocus ? '0' : '-10000px'};\n\t\t\t\ttop: ${options.hasFocus ? '0' : '-10000px'};\n\t\t\t\tright: ${options.hasFocus ? '0' : 'auto'};\n\t\t\t\tbottom: ${options.hasFocus ? '0' : 'auto'};\n\t\t\t}\n\n\t\t\t.outline {\n\t\t\t\tposition: absolute;\n\t\t\t\tz-index: inherit;\n\t\t\t\ttransition-property: ${options.hasFocus ? 'opacity' : 'none'};\n\t\t\t\ttransition-duration: ${motion.duration.large};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t\tborder-radius: inherit;\n\t\t\t\tbox-shadow: 0 0 0 ${focusOutline.offset / 16}rem\n\t\t\t\t\t\t${options.invertedColors ? focusOutline.color : color.border.inverse},\n\t\t\t\t\t0 0 0 ${(focusOutline.width + focusOutline.offset) / 16}rem\n\t\t\t\t\t\t${options.invertedColors ? color.border.inverse : focusOutline.color};\n\t\t\t\tleft: 0;\n\t\t\t\ttop: 0;\n\t\t\t\tright: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\topacity: ${options.hasFocus ? 1 : 0};\n\t\t\t}\n\n\t\t\t${(_a = this.getInlineStyle(options)) !== null && _a !== void 0 ? _a : ''}\n\t\t`;\n }\n /**\n * @param options Options.\n * @param options.styleType StyleType.\n * @param options.hasFocus\n */\n static getInlineStyle(options) {\n const { focusOutline, motion } = options.theme;\n if (options.styleType === FocusOutlineStyleTypeEnum_1.default.inline) {\n return (0, web_component_1.css) `\n\t\t\t\tslot {\n\t\t\t\t\ttransition-property: outline-color, outline-offset;\n\t\t\t\t\ttransition-duration: ${motion.duration.large};\n\t\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t\t\toutline-width: ${focusOutline.width / 16}rem;\n\t\t\t\t\toutline-style: solid;\n\t\t\t\t\tdisplay: inline;\n\t\t\t\t\tborder-radius: inherit;\n\t\t\t\t\t${this.getInlineFocusStyle(options)}\n\t\t\t\t}\n\t\t\t`;\n }\n return null;\n }\n /**\n * @param options\n */\n static getInlineFocusStyle(options) {\n const { color, focusOutline } = options.theme;\n if (options.hasFocus) {\n return (0, web_component_1.css) `\n\t\t\t\toutline-offset: ${focusOutline.offset / 16}rem;\n\t\t\t\toutline-color: ${options.invertedColors ? color.border.inverse : focusOutline.color};\n\t\t\t`;\n }\n return (0, web_component_1.css) `\n\t\t\ttransition-property: none;\n\t\t\toutline-color: transparent;\n\t\t\toutline-offset: 0rem;\n\t\t`;\n }\n}\nexports.default = FocusOutlineStyle;\n//# sourceMappingURL=FocusOutlineStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst FocusOutlinePositionWatcherEnum_1 = __importDefault(require(\"../../enums/FocusOutlinePositionWatcherEnum\"));\nconst FocusOutlineStyleTypeEnum_1 = __importDefault(require(\"../../enums/FocusOutlineStyleTypeEnum\"));\nconst FocusOutlineStyle_1 = __importDefault(require(\"./FocusOutlineStyle\"));\nconst OUTLINE_ELEMENT_SET_STYLE_PROPERTIES = ['top', 'left', 'width', 'height'];\nconst OUTLINE_ELEMENT_CLEAR_STYLE_PROPERTIES = OUTLINE_ELEMENT_SET_STYLE_PROPERTIES.concat([\n 'right',\n 'position'\n]);\n/**\n * This component should be used when focusing an element.\n *\n */\nlet FocusOutline = class FocusOutline extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Force the outline to be visible.\n this.focused = false;\n // Sets the styling of display for the component, either acting as a block or inline element.\n this.type = FocusOutlineStyleTypeEnum_1.default.block;\n // Invert color of the outline.\n this.invertedColors = false;\n // Sets the behaviour of the position watcher. The position watcher is useful when the component is inside an overflown element where it can become cropped. When enabled it will be set itself to be position fixed and update the position of itself live. However, updating the position live can be slow and result in lag on slower computers. Be wary of using 'auto' or 'enabled' if the component have any ancestors with transform styling.\n this.positionWatcher = FocusOutlinePositionWatcherEnum_1.default.auto;\n this.outlineElement = null;\n this.hasFocus = false;\n this.blockFocus = false;\n this.listeners = {\n mousedown: this.onMouseDown.bind(this),\n focusin: this.onFocusIn.bind(this),\n focusout: this.onFocusOut.bind(this)\n };\n this.position = {\n top: 0,\n left: 0,\n width: 0,\n height: 0\n };\n this.resizeObserver = new ResizeObserver(() => this.requestUpdate());\n }\n /**\n * @override\n */\n render() {\n return (0, web_component_1.html) ``,\n (0, web_component_1.html) `${this.getIcon()}`,\n (0, web_component_1.html) `${this.getLink()}`\n ];\n }\n /**\n * Get link.\n */\n getLink() {\n return (0, web_component_1.html) `\n\t\t\t${this.text}`;\n }\n /**\n * Get icon.\n */\n getIcon() {\n if (!this.icon) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
`;\n }\n /**\n * Click event.\n *\n * @param event Event.\n */\n onLinkClick(event) {\n event.stopPropagation();\n this.dispatchEvent(new CustomEvent('linkClick', { bubbles: true }));\n }\n /**\n * Event handler.\n *\n * @param event Event.\n */\n onKeyDown(event) {\n var _a, _b;\n if (event.key === ' ') {\n // Prevent scrolling.\n event.preventDefault();\n }\n if (event.key === ' ') {\n (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('a')) === null || _b === void 0 ? void 0 : _b.click();\n }\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Hyperlink.prototype, \"href\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Hyperlink.prototype, \"target\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Hyperlink.prototype, \"underline\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Hyperlink.prototype, \"color\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Hyperlink.prototype, \"text\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Hyperlink.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Hyperlink.prototype, \"icon\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Hyperlink.prototype, \"ariaLabel\", void 0);\nHyperlink = __decorate([\n (0, web_component_1.customElement)('kompis-hyperlink')\n], Hyperlink);\nexports.default = Hyperlink;\n//# sourceMappingURL=Hyperlink.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HyperlinkTargetEnum = exports.HyperlinkColorEnum = exports.Hyperlink = void 0;\nconst Hyperlink_1 = __importDefault(require(\"./components/hyperlink/Hyperlink\"));\nexports.Hyperlink = Hyperlink_1.default;\nconst HyperlinkColorEnum_1 = __importDefault(require(\"./enums/HyperlinkColorEnum\"));\nexports.HyperlinkColorEnum = HyperlinkColorEnum_1.default;\nconst HyperlinkTargetEnum_1 = __importDefault(require(\"./enums/HyperlinkTargetEnum\"));\nexports.HyperlinkTargetEnum = HyperlinkTargetEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst icons_1 = require(\"@inter-ikea-kompis/icons\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst EnergyClassIcon = Object.freeze({\n 'A+++': icons_1.EnergyApppIcon,\n 'A++': icons_1.EnergyAppIcon,\n 'A+': icons_1.EnergyApIcon,\n A: icons_1.EnergyAIcon,\n B: icons_1.EnergyBIcon,\n C: icons_1.EnergyCIcon,\n D: icons_1.EnergyDIcon,\n E: icons_1.EnergyEIcon\n});\nconst EnergyClassColor = Object.freeze({\n 'A+++': '#00a651',\n 'A++': '#50b848',\n 'A+': '#bfd730',\n A: '#fff200',\n B: '#fdb913',\n C: '#f37021',\n D: '#ed1c24',\n E: '#ed1c24'\n});\n/**\n * This component will only exist for a certain time.\n */\nlet EnergyEfficiencyNonRescaled = class EnergyEfficiencyNonRescaled extends web_component_1.KompisElement {\n /**\n * @returns Template.\n */\n render() {\n const energyClass = utilities_1.EnergyClassParser.parseProduct(this.product);\n if (!energyClass) {\n return null;\n }\n const icon = EnergyClassIcon[energyClass];\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${(0, web_component_1.unsafeHTML)(icon)}\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], EnergyEfficiencyNonRescaled.prototype, \"product\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], EnergyEfficiencyNonRescaled.prototype, \"theme\", void 0);\nEnergyEfficiencyNonRescaled = __decorate([\n (0, web_component_1.customElement)('kompis-energy-efficiency-non-rescaled')\n], EnergyEfficiencyNonRescaled);\nexports.default = EnergyEfficiencyNonRescaled;\n//# sourceMappingURL=EnergyEfficiencyNonRescaled.js.map","// can-promise has a crash in some versions of react native that dont have\n// standard global objects\n// https://github.com/soldair/node-qrcode/issues/157\n\nmodule.exports = function () {\n return typeof Promise === 'function' && Promise.prototype && Promise.prototype.then\n}\n","let toSJISFunction\nconst CODEWORDS_COUNT = [\n 0, // Not used\n 26, 44, 70, 100, 134, 172, 196, 242, 292, 346,\n 404, 466, 532, 581, 655, 733, 815, 901, 991, 1085,\n 1156, 1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185,\n 2323, 2465, 2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706\n]\n\n/**\n * Returns the QR Code size for the specified version\n *\n * @param {Number} version QR Code version\n * @return {Number} size of QR code\n */\nexports.getSymbolSize = function getSymbolSize (version) {\n if (!version) throw new Error('\"version\" cannot be null or undefined')\n if (version < 1 || version > 40) throw new Error('\"version\" should be in range from 1 to 40')\n return version * 4 + 17\n}\n\n/**\n * Returns the total number of codewords used to store data and EC information.\n *\n * @param {Number} version QR Code version\n * @return {Number} Data length in bits\n */\nexports.getSymbolTotalCodewords = function getSymbolTotalCodewords (version) {\n return CODEWORDS_COUNT[version]\n}\n\n/**\n * Encode data with Bose-Chaudhuri-Hocquenghem\n *\n * @param {Number} data Value to encode\n * @return {Number} Encoded value\n */\nexports.getBCHDigit = function (data) {\n let digit = 0\n\n while (data !== 0) {\n digit++\n data >>>= 1\n }\n\n return digit\n}\n\nexports.setToSJISFunction = function setToSJISFunction (f) {\n if (typeof f !== 'function') {\n throw new Error('\"toSJISFunc\" is not a valid function.')\n }\n\n toSJISFunction = f\n}\n\nexports.isKanjiModeEnabled = function () {\n return typeof toSJISFunction !== 'undefined'\n}\n\nexports.toSJIS = function toSJIS (kanji) {\n return toSJISFunction(kanji)\n}\n","exports.L = { bit: 1 }\nexports.M = { bit: 0 }\nexports.Q = { bit: 3 }\nexports.H = { bit: 2 }\n\nfunction fromString (string) {\n if (typeof string !== 'string') {\n throw new Error('Param is not a string')\n }\n\n const lcStr = string.toLowerCase()\n\n switch (lcStr) {\n case 'l':\n case 'low':\n return exports.L\n\n case 'm':\n case 'medium':\n return exports.M\n\n case 'q':\n case 'quartile':\n return exports.Q\n\n case 'h':\n case 'high':\n return exports.H\n\n default:\n throw new Error('Unknown EC Level: ' + string)\n }\n}\n\nexports.isValid = function isValid (level) {\n return level && typeof level.bit !== 'undefined' &&\n level.bit >= 0 && level.bit < 4\n}\n\nexports.from = function from (value, defaultValue) {\n if (exports.isValid(value)) {\n return value\n }\n\n try {\n return fromString(value)\n } catch (e) {\n return defaultValue\n }\n}\n","function BitBuffer () {\n this.buffer = []\n this.length = 0\n}\n\nBitBuffer.prototype = {\n\n get: function (index) {\n const bufIndex = Math.floor(index / 8)\n return ((this.buffer[bufIndex] >>> (7 - index % 8)) & 1) === 1\n },\n\n put: function (num, length) {\n for (let i = 0; i < length; i++) {\n this.putBit(((num >>> (length - i - 1)) & 1) === 1)\n }\n },\n\n getLengthInBits: function () {\n return this.length\n },\n\n putBit: function (bit) {\n const bufIndex = Math.floor(this.length / 8)\n if (this.buffer.length <= bufIndex) {\n this.buffer.push(0)\n }\n\n if (bit) {\n this.buffer[bufIndex] |= (0x80 >>> (this.length % 8))\n }\n\n this.length++\n }\n}\n\nmodule.exports = BitBuffer\n","/**\n * Helper class to handle QR Code symbol modules\n *\n * @param {Number} size Symbol size\n */\nfunction BitMatrix (size) {\n if (!size || size < 1) {\n throw new Error('BitMatrix size must be defined and greater than 0')\n }\n\n this.size = size\n this.data = new Uint8Array(size * size)\n this.reservedBit = new Uint8Array(size * size)\n}\n\n/**\n * Set bit value at specified location\n * If reserved flag is set, this bit will be ignored during masking process\n *\n * @param {Number} row\n * @param {Number} col\n * @param {Boolean} value\n * @param {Boolean} reserved\n */\nBitMatrix.prototype.set = function (row, col, value, reserved) {\n const index = row * this.size + col\n this.data[index] = value\n if (reserved) this.reservedBit[index] = true\n}\n\n/**\n * Returns bit value at specified location\n *\n * @param {Number} row\n * @param {Number} col\n * @return {Boolean}\n */\nBitMatrix.prototype.get = function (row, col) {\n return this.data[row * this.size + col]\n}\n\n/**\n * Applies xor operator at specified location\n * (used during masking process)\n *\n * @param {Number} row\n * @param {Number} col\n * @param {Boolean} value\n */\nBitMatrix.prototype.xor = function (row, col, value) {\n this.data[row * this.size + col] ^= value\n}\n\n/**\n * Check if bit at specified location is reserved\n *\n * @param {Number} row\n * @param {Number} col\n * @return {Boolean}\n */\nBitMatrix.prototype.isReserved = function (row, col) {\n return this.reservedBit[row * this.size + col]\n}\n\nmodule.exports = BitMatrix\n","/**\n * Alignment pattern are fixed reference pattern in defined positions\n * in a matrix symbology, which enables the decode software to re-synchronise\n * the coordinate mapping of the image modules in the event of moderate amounts\n * of distortion of the image.\n *\n * Alignment patterns are present only in QR Code symbols of version 2 or larger\n * and their number depends on the symbol version.\n */\n\nconst getSymbolSize = require('./utils').getSymbolSize\n\n/**\n * Calculate the row/column coordinates of the center module of each alignment pattern\n * for the specified QR Code version.\n *\n * The alignment patterns are positioned symmetrically on either side of the diagonal\n * running from the top left corner of the symbol to the bottom right corner.\n *\n * Since positions are simmetrical only half of the coordinates are returned.\n * Each item of the array will represent in turn the x and y coordinate.\n * @see {@link getPositions}\n *\n * @param {Number} version QR Code version\n * @return {Array} Array of coordinate\n */\nexports.getRowColCoords = function getRowColCoords (version) {\n if (version === 1) return []\n\n const posCount = Math.floor(version / 7) + 2\n const size = getSymbolSize(version)\n const intervals = size === 145 ? 26 : Math.ceil((size - 13) / (2 * posCount - 2)) * 2\n const positions = [size - 7] // Last coord is always (size - 7)\n\n for (let i = 1; i < posCount - 1; i++) {\n positions[i] = positions[i - 1] - intervals\n }\n\n positions.push(6) // First coord is always 6\n\n return positions.reverse()\n}\n\n/**\n * Returns an array containing the positions of each alignment pattern.\n * Each array's element represent the center point of the pattern as (x, y) coordinates\n *\n * Coordinates are calculated expanding the row/column coordinates returned by {@link getRowColCoords}\n * and filtering out the items that overlaps with finder pattern\n *\n * @example\n * For a Version 7 symbol {@link getRowColCoords} returns values 6, 22 and 38.\n * The alignment patterns, therefore, are to be centered on (row, column)\n * positions (6,22), (22,6), (22,22), (22,38), (38,22), (38,38).\n * Note that the coordinates (6,6), (6,38), (38,6) are occupied by finder patterns\n * and are not therefore used for alignment patterns.\n *\n * let pos = getPositions(7)\n * // [[6,22], [22,6], [22,22], [22,38], [38,22], [38,38]]\n *\n * @param {Number} version QR Code version\n * @return {Array} Array of coordinates\n */\nexports.getPositions = function getPositions (version) {\n const coords = []\n const pos = exports.getRowColCoords(version)\n const posLength = pos.length\n\n for (let i = 0; i < posLength; i++) {\n for (let j = 0; j < posLength; j++) {\n // Skip if position is occupied by finder patterns\n if ((i === 0 && j === 0) || // top-left\n (i === 0 && j === posLength - 1) || // bottom-left\n (i === posLength - 1 && j === 0)) { // top-right\n continue\n }\n\n coords.push([pos[i], pos[j]])\n }\n }\n\n return coords\n}\n","const getSymbolSize = require('./utils').getSymbolSize\nconst FINDER_PATTERN_SIZE = 7\n\n/**\n * Returns an array containing the positions of each finder pattern.\n * Each array's element represent the top-left point of the pattern as (x, y) coordinates\n *\n * @param {Number} version QR Code version\n * @return {Array} Array of coordinates\n */\nexports.getPositions = function getPositions (version) {\n const size = getSymbolSize(version)\n\n return [\n // top-left\n [0, 0],\n // top-right\n [size - FINDER_PATTERN_SIZE, 0],\n // bottom-left\n [0, size - FINDER_PATTERN_SIZE]\n ]\n}\n","/**\n * Data mask pattern reference\n * @type {Object}\n */\nexports.Patterns = {\n PATTERN000: 0,\n PATTERN001: 1,\n PATTERN010: 2,\n PATTERN011: 3,\n PATTERN100: 4,\n PATTERN101: 5,\n PATTERN110: 6,\n PATTERN111: 7\n}\n\n/**\n * Weighted penalty scores for the undesirable features\n * @type {Object}\n */\nconst PenaltyScores = {\n N1: 3,\n N2: 3,\n N3: 40,\n N4: 10\n}\n\n/**\n * Check if mask pattern value is valid\n *\n * @param {Number} mask Mask pattern\n * @return {Boolean} true if valid, false otherwise\n */\nexports.isValid = function isValid (mask) {\n return mask != null && mask !== '' && !isNaN(mask) && mask >= 0 && mask <= 7\n}\n\n/**\n * Returns mask pattern from a value.\n * If value is not valid, returns undefined\n *\n * @param {Number|String} value Mask pattern value\n * @return {Number} Valid mask pattern or undefined\n */\nexports.from = function from (value) {\n return exports.isValid(value) ? parseInt(value, 10) : undefined\n}\n\n/**\n* Find adjacent modules in row/column with the same color\n* and assign a penalty value.\n*\n* Points: N1 + i\n* i is the amount by which the number of adjacent modules of the same color exceeds 5\n*/\nexports.getPenaltyN1 = function getPenaltyN1 (data) {\n const size = data.size\n let points = 0\n let sameCountCol = 0\n let sameCountRow = 0\n let lastCol = null\n let lastRow = null\n\n for (let row = 0; row < size; row++) {\n sameCountCol = sameCountRow = 0\n lastCol = lastRow = null\n\n for (let col = 0; col < size; col++) {\n let module = data.get(row, col)\n if (module === lastCol) {\n sameCountCol++\n } else {\n if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5)\n lastCol = module\n sameCountCol = 1\n }\n\n module = data.get(col, row)\n if (module === lastRow) {\n sameCountRow++\n } else {\n if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5)\n lastRow = module\n sameCountRow = 1\n }\n }\n\n if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5)\n if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5)\n }\n\n return points\n}\n\n/**\n * Find 2x2 blocks with the same color and assign a penalty value\n *\n * Points: N2 * (m - 1) * (n - 1)\n */\nexports.getPenaltyN2 = function getPenaltyN2 (data) {\n const size = data.size\n let points = 0\n\n for (let row = 0; row < size - 1; row++) {\n for (let col = 0; col < size - 1; col++) {\n const last = data.get(row, col) +\n data.get(row, col + 1) +\n data.get(row + 1, col) +\n data.get(row + 1, col + 1)\n\n if (last === 4 || last === 0) points++\n }\n }\n\n return points * PenaltyScores.N2\n}\n\n/**\n * Find 1:1:3:1:1 ratio (dark:light:dark:light:dark) pattern in row/column,\n * preceded or followed by light area 4 modules wide\n *\n * Points: N3 * number of pattern found\n */\nexports.getPenaltyN3 = function getPenaltyN3 (data) {\n const size = data.size\n let points = 0\n let bitsCol = 0\n let bitsRow = 0\n\n for (let row = 0; row < size; row++) {\n bitsCol = bitsRow = 0\n for (let col = 0; col < size; col++) {\n bitsCol = ((bitsCol << 1) & 0x7FF) | data.get(row, col)\n if (col >= 10 && (bitsCol === 0x5D0 || bitsCol === 0x05D)) points++\n\n bitsRow = ((bitsRow << 1) & 0x7FF) | data.get(col, row)\n if (col >= 10 && (bitsRow === 0x5D0 || bitsRow === 0x05D)) points++\n }\n }\n\n return points * PenaltyScores.N3\n}\n\n/**\n * Calculate proportion of dark modules in entire symbol\n *\n * Points: N4 * k\n *\n * k is the rating of the deviation of the proportion of dark modules\n * in the symbol from 50% in steps of 5%\n */\nexports.getPenaltyN4 = function getPenaltyN4 (data) {\n let darkCount = 0\n const modulesCount = data.data.length\n\n for (let i = 0; i < modulesCount; i++) darkCount += data.data[i]\n\n const k = Math.abs(Math.ceil((darkCount * 100 / modulesCount) / 5) - 10)\n\n return k * PenaltyScores.N4\n}\n\n/**\n * Return mask value at given position\n *\n * @param {Number} maskPattern Pattern reference value\n * @param {Number} i Row\n * @param {Number} j Column\n * @return {Boolean} Mask value\n */\nfunction getMaskAt (maskPattern, i, j) {\n switch (maskPattern) {\n case exports.Patterns.PATTERN000: return (i + j) % 2 === 0\n case exports.Patterns.PATTERN001: return i % 2 === 0\n case exports.Patterns.PATTERN010: return j % 3 === 0\n case exports.Patterns.PATTERN011: return (i + j) % 3 === 0\n case exports.Patterns.PATTERN100: return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 === 0\n case exports.Patterns.PATTERN101: return (i * j) % 2 + (i * j) % 3 === 0\n case exports.Patterns.PATTERN110: return ((i * j) % 2 + (i * j) % 3) % 2 === 0\n case exports.Patterns.PATTERN111: return ((i * j) % 3 + (i + j) % 2) % 2 === 0\n\n default: throw new Error('bad maskPattern:' + maskPattern)\n }\n}\n\n/**\n * Apply a mask pattern to a BitMatrix\n *\n * @param {Number} pattern Pattern reference number\n * @param {BitMatrix} data BitMatrix data\n */\nexports.applyMask = function applyMask (pattern, data) {\n const size = data.size\n\n for (let col = 0; col < size; col++) {\n for (let row = 0; row < size; row++) {\n if (data.isReserved(row, col)) continue\n data.xor(row, col, getMaskAt(pattern, row, col))\n }\n }\n}\n\n/**\n * Returns the best mask pattern for data\n *\n * @param {BitMatrix} data\n * @return {Number} Mask pattern reference number\n */\nexports.getBestMask = function getBestMask (data, setupFormatFunc) {\n const numPatterns = Object.keys(exports.Patterns).length\n let bestPattern = 0\n let lowerPenalty = Infinity\n\n for (let p = 0; p < numPatterns; p++) {\n setupFormatFunc(p)\n exports.applyMask(p, data)\n\n // Calculate penalty\n const penalty =\n exports.getPenaltyN1(data) +\n exports.getPenaltyN2(data) +\n exports.getPenaltyN3(data) +\n exports.getPenaltyN4(data)\n\n // Undo previously applied mask\n exports.applyMask(p, data)\n\n if (penalty < lowerPenalty) {\n lowerPenalty = penalty\n bestPattern = p\n }\n }\n\n return bestPattern\n}\n","const ECLevel = require('./error-correction-level')\r\n\r\nconst EC_BLOCKS_TABLE = [\r\n// L M Q H\r\n 1, 1, 1, 1,\r\n 1, 1, 1, 1,\r\n 1, 1, 2, 2,\r\n 1, 2, 2, 4,\r\n 1, 2, 4, 4,\r\n 2, 4, 4, 4,\r\n 2, 4, 6, 5,\r\n 2, 4, 6, 6,\r\n 2, 5, 8, 8,\r\n 4, 5, 8, 8,\r\n 4, 5, 8, 11,\r\n 4, 8, 10, 11,\r\n 4, 9, 12, 16,\r\n 4, 9, 16, 16,\r\n 6, 10, 12, 18,\r\n 6, 10, 17, 16,\r\n 6, 11, 16, 19,\r\n 6, 13, 18, 21,\r\n 7, 14, 21, 25,\r\n 8, 16, 20, 25,\r\n 8, 17, 23, 25,\r\n 9, 17, 23, 34,\r\n 9, 18, 25, 30,\r\n 10, 20, 27, 32,\r\n 12, 21, 29, 35,\r\n 12, 23, 34, 37,\r\n 12, 25, 34, 40,\r\n 13, 26, 35, 42,\r\n 14, 28, 38, 45,\r\n 15, 29, 40, 48,\r\n 16, 31, 43, 51,\r\n 17, 33, 45, 54,\r\n 18, 35, 48, 57,\r\n 19, 37, 51, 60,\r\n 19, 38, 53, 63,\r\n 20, 40, 56, 66,\r\n 21, 43, 59, 70,\r\n 22, 45, 62, 74,\r\n 24, 47, 65, 77,\r\n 25, 49, 68, 81\r\n]\r\n\r\nconst EC_CODEWORDS_TABLE = [\r\n// L M Q H\r\n 7, 10, 13, 17,\r\n 10, 16, 22, 28,\r\n 15, 26, 36, 44,\r\n 20, 36, 52, 64,\r\n 26, 48, 72, 88,\r\n 36, 64, 96, 112,\r\n 40, 72, 108, 130,\r\n 48, 88, 132, 156,\r\n 60, 110, 160, 192,\r\n 72, 130, 192, 224,\r\n 80, 150, 224, 264,\r\n 96, 176, 260, 308,\r\n 104, 198, 288, 352,\r\n 120, 216, 320, 384,\r\n 132, 240, 360, 432,\r\n 144, 280, 408, 480,\r\n 168, 308, 448, 532,\r\n 180, 338, 504, 588,\r\n 196, 364, 546, 650,\r\n 224, 416, 600, 700,\r\n 224, 442, 644, 750,\r\n 252, 476, 690, 816,\r\n 270, 504, 750, 900,\r\n 300, 560, 810, 960,\r\n 312, 588, 870, 1050,\r\n 336, 644, 952, 1110,\r\n 360, 700, 1020, 1200,\r\n 390, 728, 1050, 1260,\r\n 420, 784, 1140, 1350,\r\n 450, 812, 1200, 1440,\r\n 480, 868, 1290, 1530,\r\n 510, 924, 1350, 1620,\r\n 540, 980, 1440, 1710,\r\n 570, 1036, 1530, 1800,\r\n 570, 1064, 1590, 1890,\r\n 600, 1120, 1680, 1980,\r\n 630, 1204, 1770, 2100,\r\n 660, 1260, 1860, 2220,\r\n 720, 1316, 1950, 2310,\r\n 750, 1372, 2040, 2430\r\n]\r\n\r\n/**\r\n * Returns the number of error correction block that the QR Code should contain\r\n * for the specified version and error correction level.\r\n *\r\n * @param {Number} version QR Code version\r\n * @param {Number} errorCorrectionLevel Error correction level\r\n * @return {Number} Number of error correction blocks\r\n */\r\nexports.getBlocksCount = function getBlocksCount (version, errorCorrectionLevel) {\r\n switch (errorCorrectionLevel) {\r\n case ECLevel.L:\r\n return EC_BLOCKS_TABLE[(version - 1) * 4 + 0]\r\n case ECLevel.M:\r\n return EC_BLOCKS_TABLE[(version - 1) * 4 + 1]\r\n case ECLevel.Q:\r\n return EC_BLOCKS_TABLE[(version - 1) * 4 + 2]\r\n case ECLevel.H:\r\n return EC_BLOCKS_TABLE[(version - 1) * 4 + 3]\r\n default:\r\n return undefined\r\n }\r\n}\r\n\r\n/**\r\n * Returns the number of error correction codewords to use for the specified\r\n * version and error correction level.\r\n *\r\n * @param {Number} version QR Code version\r\n * @param {Number} errorCorrectionLevel Error correction level\r\n * @return {Number} Number of error correction codewords\r\n */\r\nexports.getTotalCodewordsCount = function getTotalCodewordsCount (version, errorCorrectionLevel) {\r\n switch (errorCorrectionLevel) {\r\n case ECLevel.L:\r\n return EC_CODEWORDS_TABLE[(version - 1) * 4 + 0]\r\n case ECLevel.M:\r\n return EC_CODEWORDS_TABLE[(version - 1) * 4 + 1]\r\n case ECLevel.Q:\r\n return EC_CODEWORDS_TABLE[(version - 1) * 4 + 2]\r\n case ECLevel.H:\r\n return EC_CODEWORDS_TABLE[(version - 1) * 4 + 3]\r\n default:\r\n return undefined\r\n }\r\n}\r\n","const EXP_TABLE = new Uint8Array(512)\nconst LOG_TABLE = new Uint8Array(256)\n/**\n * Precompute the log and anti-log tables for faster computation later\n *\n * For each possible value in the galois field 2^8, we will pre-compute\n * the logarithm and anti-logarithm (exponential) of this value\n *\n * ref {@link https://en.wikiversity.org/wiki/Reed%E2%80%93Solomon_codes_for_coders#Introduction_to_mathematical_fields}\n */\n;(function initTables () {\n let x = 1\n for (let i = 0; i < 255; i++) {\n EXP_TABLE[i] = x\n LOG_TABLE[x] = i\n\n x <<= 1 // multiply by 2\n\n // The QR code specification says to use byte-wise modulo 100011101 arithmetic.\n // This means that when a number is 256 or larger, it should be XORed with 0x11D.\n if (x & 0x100) { // similar to x >= 256, but a lot faster (because 0x100 == 256)\n x ^= 0x11D\n }\n }\n\n // Optimization: double the size of the anti-log table so that we don't need to mod 255 to\n // stay inside the bounds (because we will mainly use this table for the multiplication of\n // two GF numbers, no more).\n // @see {@link mul}\n for (let i = 255; i < 512; i++) {\n EXP_TABLE[i] = EXP_TABLE[i - 255]\n }\n}())\n\n/**\n * Returns log value of n inside Galois Field\n *\n * @param {Number} n\n * @return {Number}\n */\nexports.log = function log (n) {\n if (n < 1) throw new Error('log(' + n + ')')\n return LOG_TABLE[n]\n}\n\n/**\n * Returns anti-log value of n inside Galois Field\n *\n * @param {Number} n\n * @return {Number}\n */\nexports.exp = function exp (n) {\n return EXP_TABLE[n]\n}\n\n/**\n * Multiplies two number inside Galois Field\n *\n * @param {Number} x\n * @param {Number} y\n * @return {Number}\n */\nexports.mul = function mul (x, y) {\n if (x === 0 || y === 0) return 0\n\n // should be EXP_TABLE[(LOG_TABLE[x] + LOG_TABLE[y]) % 255] if EXP_TABLE wasn't oversized\n // @see {@link initTables}\n return EXP_TABLE[LOG_TABLE[x] + LOG_TABLE[y]]\n}\n","const GF = require('./galois-field')\n\n/**\n * Multiplies two polynomials inside Galois Field\n *\n * @param {Uint8Array} p1 Polynomial\n * @param {Uint8Array} p2 Polynomial\n * @return {Uint8Array} Product of p1 and p2\n */\nexports.mul = function mul (p1, p2) {\n const coeff = new Uint8Array(p1.length + p2.length - 1)\n\n for (let i = 0; i < p1.length; i++) {\n for (let j = 0; j < p2.length; j++) {\n coeff[i + j] ^= GF.mul(p1[i], p2[j])\n }\n }\n\n return coeff\n}\n\n/**\n * Calculate the remainder of polynomials division\n *\n * @param {Uint8Array} divident Polynomial\n * @param {Uint8Array} divisor Polynomial\n * @return {Uint8Array} Remainder\n */\nexports.mod = function mod (divident, divisor) {\n let result = new Uint8Array(divident)\n\n while ((result.length - divisor.length) >= 0) {\n const coeff = result[0]\n\n for (let i = 0; i < divisor.length; i++) {\n result[i] ^= GF.mul(divisor[i], coeff)\n }\n\n // remove all zeros from buffer head\n let offset = 0\n while (offset < result.length && result[offset] === 0) offset++\n result = result.slice(offset)\n }\n\n return result\n}\n\n/**\n * Generate an irreducible generator polynomial of specified degree\n * (used by Reed-Solomon encoder)\n *\n * @param {Number} degree Degree of the generator polynomial\n * @return {Uint8Array} Buffer containing polynomial coefficients\n */\nexports.generateECPolynomial = function generateECPolynomial (degree) {\n let poly = new Uint8Array([1])\n for (let i = 0; i < degree; i++) {\n poly = exports.mul(poly, new Uint8Array([1, GF.exp(i)]))\n }\n\n return poly\n}\n","const Polynomial = require('./polynomial')\n\nfunction ReedSolomonEncoder (degree) {\n this.genPoly = undefined\n this.degree = degree\n\n if (this.degree) this.initialize(this.degree)\n}\n\n/**\n * Initialize the encoder.\n * The input param should correspond to the number of error correction codewords.\n *\n * @param {Number} degree\n */\nReedSolomonEncoder.prototype.initialize = function initialize (degree) {\n // create an irreducible generator polynomial\n this.degree = degree\n this.genPoly = Polynomial.generateECPolynomial(this.degree)\n}\n\n/**\n * Encodes a chunk of data\n *\n * @param {Uint8Array} data Buffer containing input data\n * @return {Uint8Array} Buffer containing encoded data\n */\nReedSolomonEncoder.prototype.encode = function encode (data) {\n if (!this.genPoly) {\n throw new Error('Encoder not initialized')\n }\n\n // Calculate EC for this data block\n // extends data size to data+genPoly size\n const paddedData = new Uint8Array(data.length + this.degree)\n paddedData.set(data)\n\n // The error correction codewords are the remainder after dividing the data codewords\n // by a generator polynomial\n const remainder = Polynomial.mod(paddedData, this.genPoly)\n\n // return EC data blocks (last n byte, where n is the degree of genPoly)\n // If coefficients number in remainder are less than genPoly degree,\n // pad with 0s to the left to reach the needed number of coefficients\n const start = this.degree - remainder.length\n if (start > 0) {\n const buff = new Uint8Array(this.degree)\n buff.set(remainder, start)\n\n return buff\n }\n\n return remainder\n}\n\nmodule.exports = ReedSolomonEncoder\n","/**\n * Check if QR Code version is valid\n *\n * @param {Number} version QR Code version\n * @return {Boolean} true if valid version, false otherwise\n */\nexports.isValid = function isValid (version) {\n return !isNaN(version) && version >= 1 && version <= 40\n}\n","const numeric = '[0-9]+'\nconst alphanumeric = '[A-Z $%*+\\\\-./:]+'\nlet kanji = '(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|' +\n '[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|' +\n '[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|' +\n '[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+'\nkanji = kanji.replace(/u/g, '\\\\u')\n\nconst byte = '(?:(?![A-Z0-9 $%*+\\\\-./:]|' + kanji + ')(?:.|[\\r\\n]))+'\n\nexports.KANJI = new RegExp(kanji, 'g')\nexports.BYTE_KANJI = new RegExp('[^A-Z0-9 $%*+\\\\-./:]+', 'g')\nexports.BYTE = new RegExp(byte, 'g')\nexports.NUMERIC = new RegExp(numeric, 'g')\nexports.ALPHANUMERIC = new RegExp(alphanumeric, 'g')\n\nconst TEST_KANJI = new RegExp('^' + kanji + '$')\nconst TEST_NUMERIC = new RegExp('^' + numeric + '$')\nconst TEST_ALPHANUMERIC = new RegExp('^[A-Z0-9 $%*+\\\\-./:]+$')\n\nexports.testKanji = function testKanji (str) {\n return TEST_KANJI.test(str)\n}\n\nexports.testNumeric = function testNumeric (str) {\n return TEST_NUMERIC.test(str)\n}\n\nexports.testAlphanumeric = function testAlphanumeric (str) {\n return TEST_ALPHANUMERIC.test(str)\n}\n","const VersionCheck = require('./version-check')\nconst Regex = require('./regex')\n\n/**\n * Numeric mode encodes data from the decimal digit set (0 - 9)\n * (byte values 30HEX to 39HEX).\n * Normally, 3 data characters are represented by 10 bits.\n *\n * @type {Object}\n */\nexports.NUMERIC = {\n id: 'Numeric',\n bit: 1 << 0,\n ccBits: [10, 12, 14]\n}\n\n/**\n * Alphanumeric mode encodes data from a set of 45 characters,\n * i.e. 10 numeric digits (0 - 9),\n * 26 alphabetic characters (A - Z),\n * and 9 symbols (SP, $, %, *, +, -, ., /, :).\n * Normally, two input characters are represented by 11 bits.\n *\n * @type {Object}\n */\nexports.ALPHANUMERIC = {\n id: 'Alphanumeric',\n bit: 1 << 1,\n ccBits: [9, 11, 13]\n}\n\n/**\n * In byte mode, data is encoded at 8 bits per character.\n *\n * @type {Object}\n */\nexports.BYTE = {\n id: 'Byte',\n bit: 1 << 2,\n ccBits: [8, 16, 16]\n}\n\n/**\n * The Kanji mode efficiently encodes Kanji characters in accordance with\n * the Shift JIS system based on JIS X 0208.\n * The Shift JIS values are shifted from the JIS X 0208 values.\n * JIS X 0208 gives details of the shift coded representation.\n * Each two-byte character value is compacted to a 13-bit binary codeword.\n *\n * @type {Object}\n */\nexports.KANJI = {\n id: 'Kanji',\n bit: 1 << 3,\n ccBits: [8, 10, 12]\n}\n\n/**\n * Mixed mode will contain a sequences of data in a combination of any of\n * the modes described above\n *\n * @type {Object}\n */\nexports.MIXED = {\n bit: -1\n}\n\n/**\n * Returns the number of bits needed to store the data length\n * according to QR Code specifications.\n *\n * @param {Mode} mode Data mode\n * @param {Number} version QR Code version\n * @return {Number} Number of bits\n */\nexports.getCharCountIndicator = function getCharCountIndicator (mode, version) {\n if (!mode.ccBits) throw new Error('Invalid mode: ' + mode)\n\n if (!VersionCheck.isValid(version)) {\n throw new Error('Invalid version: ' + version)\n }\n\n if (version >= 1 && version < 10) return mode.ccBits[0]\n else if (version < 27) return mode.ccBits[1]\n return mode.ccBits[2]\n}\n\n/**\n * Returns the most efficient mode to store the specified data\n *\n * @param {String} dataStr Input data string\n * @return {Mode} Best mode\n */\nexports.getBestModeForData = function getBestModeForData (dataStr) {\n if (Regex.testNumeric(dataStr)) return exports.NUMERIC\n else if (Regex.testAlphanumeric(dataStr)) return exports.ALPHANUMERIC\n else if (Regex.testKanji(dataStr)) return exports.KANJI\n else return exports.BYTE\n}\n\n/**\n * Return mode name as string\n *\n * @param {Mode} mode Mode object\n * @returns {String} Mode name\n */\nexports.toString = function toString (mode) {\n if (mode && mode.id) return mode.id\n throw new Error('Invalid mode')\n}\n\n/**\n * Check if input param is a valid mode object\n *\n * @param {Mode} mode Mode object\n * @returns {Boolean} True if valid mode, false otherwise\n */\nexports.isValid = function isValid (mode) {\n return mode && mode.bit && mode.ccBits\n}\n\n/**\n * Get mode object from its name\n *\n * @param {String} string Mode name\n * @returns {Mode} Mode object\n */\nfunction fromString (string) {\n if (typeof string !== 'string') {\n throw new Error('Param is not a string')\n }\n\n const lcStr = string.toLowerCase()\n\n switch (lcStr) {\n case 'numeric':\n return exports.NUMERIC\n case 'alphanumeric':\n return exports.ALPHANUMERIC\n case 'kanji':\n return exports.KANJI\n case 'byte':\n return exports.BYTE\n default:\n throw new Error('Unknown mode: ' + string)\n }\n}\n\n/**\n * Returns mode from a value.\n * If value is not a valid mode, returns defaultValue\n *\n * @param {Mode|String} value Encoding mode\n * @param {Mode} defaultValue Fallback value\n * @return {Mode} Encoding mode\n */\nexports.from = function from (value, defaultValue) {\n if (exports.isValid(value)) {\n return value\n }\n\n try {\n return fromString(value)\n } catch (e) {\n return defaultValue\n }\n}\n","const Utils = require('./utils')\nconst ECCode = require('./error-correction-code')\nconst ECLevel = require('./error-correction-level')\nconst Mode = require('./mode')\nconst VersionCheck = require('./version-check')\n\n// Generator polynomial used to encode version information\nconst G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0)\nconst G18_BCH = Utils.getBCHDigit(G18)\n\nfunction getBestVersionForDataLength (mode, length, errorCorrectionLevel) {\n for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {\n if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, mode)) {\n return currentVersion\n }\n }\n\n return undefined\n}\n\nfunction getReservedBitsCount (mode, version) {\n // Character count indicator + mode indicator bits\n return Mode.getCharCountIndicator(mode, version) + 4\n}\n\nfunction getTotalBitsFromDataArray (segments, version) {\n let totalBits = 0\n\n segments.forEach(function (data) {\n const reservedBits = getReservedBitsCount(data.mode, version)\n totalBits += reservedBits + data.getBitsLength()\n })\n\n return totalBits\n}\n\nfunction getBestVersionForMixedData (segments, errorCorrectionLevel) {\n for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {\n const length = getTotalBitsFromDataArray(segments, currentVersion)\n if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, Mode.MIXED)) {\n return currentVersion\n }\n }\n\n return undefined\n}\n\n/**\n * Returns version number from a value.\n * If value is not a valid version, returns defaultValue\n *\n * @param {Number|String} value QR Code version\n * @param {Number} defaultValue Fallback value\n * @return {Number} QR Code version number\n */\nexports.from = function from (value, defaultValue) {\n if (VersionCheck.isValid(value)) {\n return parseInt(value, 10)\n }\n\n return defaultValue\n}\n\n/**\n * Returns how much data can be stored with the specified QR code version\n * and error correction level\n *\n * @param {Number} version QR Code version (1-40)\n * @param {Number} errorCorrectionLevel Error correction level\n * @param {Mode} mode Data mode\n * @return {Number} Quantity of storable data\n */\nexports.getCapacity = function getCapacity (version, errorCorrectionLevel, mode) {\n if (!VersionCheck.isValid(version)) {\n throw new Error('Invalid QR Code version')\n }\n\n // Use Byte mode as default\n if (typeof mode === 'undefined') mode = Mode.BYTE\n\n // Total codewords for this QR code version (Data + Error correction)\n const totalCodewords = Utils.getSymbolTotalCodewords(version)\n\n // Total number of error correction codewords\n const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n\n // Total number of data codewords\n const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8\n\n if (mode === Mode.MIXED) return dataTotalCodewordsBits\n\n const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode, version)\n\n // Return max number of storable codewords\n switch (mode) {\n case Mode.NUMERIC:\n return Math.floor((usableBits / 10) * 3)\n\n case Mode.ALPHANUMERIC:\n return Math.floor((usableBits / 11) * 2)\n\n case Mode.KANJI:\n return Math.floor(usableBits / 13)\n\n case Mode.BYTE:\n default:\n return Math.floor(usableBits / 8)\n }\n}\n\n/**\n * Returns the minimum version needed to contain the amount of data\n *\n * @param {Segment} data Segment of data\n * @param {Number} [errorCorrectionLevel=H] Error correction level\n * @param {Mode} mode Data mode\n * @return {Number} QR Code version\n */\nexports.getBestVersionForData = function getBestVersionForData (data, errorCorrectionLevel) {\n let seg\n\n const ecl = ECLevel.from(errorCorrectionLevel, ECLevel.M)\n\n if (Array.isArray(data)) {\n if (data.length > 1) {\n return getBestVersionForMixedData(data, ecl)\n }\n\n if (data.length === 0) {\n return 1\n }\n\n seg = data[0]\n } else {\n seg = data\n }\n\n return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl)\n}\n\n/**\n * Returns version information with relative error correction bits\n *\n * The version information is included in QR Code symbols of version 7 or larger.\n * It consists of an 18-bit sequence containing 6 data bits,\n * with 12 error correction bits calculated using the (18, 6) Golay code.\n *\n * @param {Number} version QR Code version\n * @return {Number} Encoded version info bits\n */\nexports.getEncodedBits = function getEncodedBits (version) {\n if (!VersionCheck.isValid(version) || version < 7) {\n throw new Error('Invalid QR Code version')\n }\n\n let d = version << 12\n\n while (Utils.getBCHDigit(d) - G18_BCH >= 0) {\n d ^= (G18 << (Utils.getBCHDigit(d) - G18_BCH))\n }\n\n return (version << 12) | d\n}\n","const Utils = require('./utils')\n\nconst G15 = (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0)\nconst G15_MASK = (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1)\nconst G15_BCH = Utils.getBCHDigit(G15)\n\n/**\n * Returns format information with relative error correction bits\n *\n * The format information is a 15-bit sequence containing 5 data bits,\n * with 10 error correction bits calculated using the (15, 5) BCH code.\n *\n * @param {Number} errorCorrectionLevel Error correction level\n * @param {Number} mask Mask pattern\n * @return {Number} Encoded format information bits\n */\nexports.getEncodedBits = function getEncodedBits (errorCorrectionLevel, mask) {\n const data = ((errorCorrectionLevel.bit << 3) | mask)\n let d = data << 10\n\n while (Utils.getBCHDigit(d) - G15_BCH >= 0) {\n d ^= (G15 << (Utils.getBCHDigit(d) - G15_BCH))\n }\n\n // xor final data with mask pattern in order to ensure that\n // no combination of Error Correction Level and data mask pattern\n // will result in an all-zero data string\n return ((data << 10) | d) ^ G15_MASK\n}\n","const Mode = require('./mode')\n\nfunction NumericData (data) {\n this.mode = Mode.NUMERIC\n this.data = data.toString()\n}\n\nNumericData.getBitsLength = function getBitsLength (length) {\n return 10 * Math.floor(length / 3) + ((length % 3) ? ((length % 3) * 3 + 1) : 0)\n}\n\nNumericData.prototype.getLength = function getLength () {\n return this.data.length\n}\n\nNumericData.prototype.getBitsLength = function getBitsLength () {\n return NumericData.getBitsLength(this.data.length)\n}\n\nNumericData.prototype.write = function write (bitBuffer) {\n let i, group, value\n\n // The input data string is divided into groups of three digits,\n // and each group is converted to its 10-bit binary equivalent.\n for (i = 0; i + 3 <= this.data.length; i += 3) {\n group = this.data.substr(i, 3)\n value = parseInt(group, 10)\n\n bitBuffer.put(value, 10)\n }\n\n // If the number of input digits is not an exact multiple of three,\n // the final one or two digits are converted to 4 or 7 bits respectively.\n const remainingNum = this.data.length - i\n if (remainingNum > 0) {\n group = this.data.substr(i)\n value = parseInt(group, 10)\n\n bitBuffer.put(value, remainingNum * 3 + 1)\n }\n}\n\nmodule.exports = NumericData\n","const Mode = require('./mode')\n\n/**\n * Array of characters available in alphanumeric mode\n *\n * As per QR Code specification, to each character\n * is assigned a value from 0 to 44 which in this case coincides\n * with the array index\n *\n * @type {Array}\n */\nconst ALPHA_NUM_CHARS = [\n '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',\n ' ', '$', '%', '*', '+', '-', '.', '/', ':'\n]\n\nfunction AlphanumericData (data) {\n this.mode = Mode.ALPHANUMERIC\n this.data = data\n}\n\nAlphanumericData.getBitsLength = function getBitsLength (length) {\n return 11 * Math.floor(length / 2) + 6 * (length % 2)\n}\n\nAlphanumericData.prototype.getLength = function getLength () {\n return this.data.length\n}\n\nAlphanumericData.prototype.getBitsLength = function getBitsLength () {\n return AlphanumericData.getBitsLength(this.data.length)\n}\n\nAlphanumericData.prototype.write = function write (bitBuffer) {\n let i\n\n // Input data characters are divided into groups of two characters\n // and encoded as 11-bit binary codes.\n for (i = 0; i + 2 <= this.data.length; i += 2) {\n // The character value of the first character is multiplied by 45\n let value = ALPHA_NUM_CHARS.indexOf(this.data[i]) * 45\n\n // The character value of the second digit is added to the product\n value += ALPHA_NUM_CHARS.indexOf(this.data[i + 1])\n\n // The sum is then stored as 11-bit binary number\n bitBuffer.put(value, 11)\n }\n\n // If the number of input data characters is not a multiple of two,\n // the character value of the final character is encoded as a 6-bit binary number.\n if (this.data.length % 2) {\n bitBuffer.put(ALPHA_NUM_CHARS.indexOf(this.data[i]), 6)\n }\n}\n\nmodule.exports = AlphanumericData\n","'use strict'\n\nmodule.exports = function encodeUtf8 (input) {\n var result = []\n var size = input.length\n\n for (var index = 0; index < size; index++) {\n var point = input.charCodeAt(index)\n\n if (point >= 0xD800 && point <= 0xDBFF && size > index + 1) {\n var second = input.charCodeAt(index + 1)\n\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n point = (point - 0xD800) * 0x400 + second - 0xDC00 + 0x10000\n index += 1\n }\n }\n\n // US-ASCII\n if (point < 0x80) {\n result.push(point)\n continue\n }\n\n // 2-byte UTF-8\n if (point < 0x800) {\n result.push((point >> 6) | 192)\n result.push((point & 63) | 128)\n continue\n }\n\n // 3-byte UTF-8\n if (point < 0xD800 || (point >= 0xE000 && point < 0x10000)) {\n result.push((point >> 12) | 224)\n result.push(((point >> 6) & 63) | 128)\n result.push((point & 63) | 128)\n continue\n }\n\n // 4-byte UTF-8\n if (point >= 0x10000 && point <= 0x10FFFF) {\n result.push((point >> 18) | 240)\n result.push(((point >> 12) & 63) | 128)\n result.push(((point >> 6) & 63) | 128)\n result.push((point & 63) | 128)\n continue\n }\n\n // Invalid character\n result.push(0xEF, 0xBF, 0xBD)\n }\n\n return new Uint8Array(result).buffer\n}\n","const encodeUtf8 = require('encode-utf8')\nconst Mode = require('./mode')\n\nfunction ByteData (data) {\n this.mode = Mode.BYTE\n if (typeof (data) === 'string') {\n data = encodeUtf8(data)\n }\n this.data = new Uint8Array(data)\n}\n\nByteData.getBitsLength = function getBitsLength (length) {\n return length * 8\n}\n\nByteData.prototype.getLength = function getLength () {\n return this.data.length\n}\n\nByteData.prototype.getBitsLength = function getBitsLength () {\n return ByteData.getBitsLength(this.data.length)\n}\n\nByteData.prototype.write = function (bitBuffer) {\n for (let i = 0, l = this.data.length; i < l; i++) {\n bitBuffer.put(this.data[i], 8)\n }\n}\n\nmodule.exports = ByteData\n","const Mode = require('./mode')\nconst Utils = require('./utils')\n\nfunction KanjiData (data) {\n this.mode = Mode.KANJI\n this.data = data\n}\n\nKanjiData.getBitsLength = function getBitsLength (length) {\n return length * 13\n}\n\nKanjiData.prototype.getLength = function getLength () {\n return this.data.length\n}\n\nKanjiData.prototype.getBitsLength = function getBitsLength () {\n return KanjiData.getBitsLength(this.data.length)\n}\n\nKanjiData.prototype.write = function (bitBuffer) {\n let i\n\n // In the Shift JIS system, Kanji characters are represented by a two byte combination.\n // These byte values are shifted from the JIS X 0208 values.\n // JIS X 0208 gives details of the shift coded representation.\n for (i = 0; i < this.data.length; i++) {\n let value = Utils.toSJIS(this.data[i])\n\n // For characters with Shift JIS values from 0x8140 to 0x9FFC:\n if (value >= 0x8140 && value <= 0x9FFC) {\n // Subtract 0x8140 from Shift JIS value\n value -= 0x8140\n\n // For characters with Shift JIS values from 0xE040 to 0xEBBF\n } else if (value >= 0xE040 && value <= 0xEBBF) {\n // Subtract 0xC140 from Shift JIS value\n value -= 0xC140\n } else {\n throw new Error(\n 'Invalid SJIS character: ' + this.data[i] + '\\n' +\n 'Make sure your charset is UTF-8')\n }\n\n // Multiply most significant byte of result by 0xC0\n // and add least significant byte to product\n value = (((value >>> 8) & 0xff) * 0xC0) + (value & 0xff)\n\n // Convert result to a 13-bit binary string\n bitBuffer.put(value, 13)\n }\n}\n\nmodule.exports = KanjiData\n","'use strict';\n\n/******************************************************************************\n * Created 2008-08-19.\n *\n * Dijkstra path-finding functions. Adapted from the Dijkstar Python project.\n *\n * Copyright (C) 2008\n * Wyatt Baldwin \n * All rights reserved\n *\n * Licensed under the MIT license.\n *\n * http://www.opensource.org/licenses/mit-license.php\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *****************************************************************************/\nvar dijkstra = {\n single_source_shortest_paths: function(graph, s, d) {\n // Predecessor map for each node that has been encountered.\n // node ID => predecessor node ID\n var predecessors = {};\n\n // Costs of shortest paths from s to all nodes encountered.\n // node ID => cost\n var costs = {};\n costs[s] = 0;\n\n // Costs of shortest paths from s to all nodes encountered; differs from\n // `costs` in that it provides easy access to the node that currently has\n // the known shortest path from s.\n // XXX: Do we actually need both `costs` and `open`?\n var open = dijkstra.PriorityQueue.make();\n open.push(s, 0);\n\n var closest,\n u, v,\n cost_of_s_to_u,\n adjacent_nodes,\n cost_of_e,\n cost_of_s_to_u_plus_cost_of_e,\n cost_of_s_to_v,\n first_visit;\n while (!open.empty()) {\n // In the nodes remaining in graph that have a known cost from s,\n // find the node, u, that currently has the shortest path from s.\n closest = open.pop();\n u = closest.value;\n cost_of_s_to_u = closest.cost;\n\n // Get nodes adjacent to u...\n adjacent_nodes = graph[u] || {};\n\n // ...and explore the edges that connect u to those nodes, updating\n // the cost of the shortest paths to any or all of those nodes as\n // necessary. v is the node across the current edge from u.\n for (v in adjacent_nodes) {\n if (adjacent_nodes.hasOwnProperty(v)) {\n // Get the cost of the edge running from u to v.\n cost_of_e = adjacent_nodes[v];\n\n // Cost of s to u plus the cost of u to v across e--this is *a*\n // cost from s to v that may or may not be less than the current\n // known cost to v.\n cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;\n\n // If we haven't visited v yet OR if the current known cost from s to\n // v is greater than the new cost we just found (cost of s to u plus\n // cost of u to v across e), update v's cost in the cost list and\n // update v's predecessor in the predecessor list (it's now u).\n cost_of_s_to_v = costs[v];\n first_visit = (typeof costs[v] === 'undefined');\n if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {\n costs[v] = cost_of_s_to_u_plus_cost_of_e;\n open.push(v, cost_of_s_to_u_plus_cost_of_e);\n predecessors[v] = u;\n }\n }\n }\n }\n\n if (typeof d !== 'undefined' && typeof costs[d] === 'undefined') {\n var msg = ['Could not find a path from ', s, ' to ', d, '.'].join('');\n throw new Error(msg);\n }\n\n return predecessors;\n },\n\n extract_shortest_path_from_predecessor_list: function(predecessors, d) {\n var nodes = [];\n var u = d;\n var predecessor;\n while (u) {\n nodes.push(u);\n predecessor = predecessors[u];\n u = predecessors[u];\n }\n nodes.reverse();\n return nodes;\n },\n\n find_path: function(graph, s, d) {\n var predecessors = dijkstra.single_source_shortest_paths(graph, s, d);\n return dijkstra.extract_shortest_path_from_predecessor_list(\n predecessors, d);\n },\n\n /**\n * A very naive priority queue implementation.\n */\n PriorityQueue: {\n make: function (opts) {\n var T = dijkstra.PriorityQueue,\n t = {},\n key;\n opts = opts || {};\n for (key in T) {\n if (T.hasOwnProperty(key)) {\n t[key] = T[key];\n }\n }\n t.queue = [];\n t.sorter = opts.sorter || T.default_sorter;\n return t;\n },\n\n default_sorter: function (a, b) {\n return a.cost - b.cost;\n },\n\n /**\n * Add a new item to the queue and ensure the highest priority element\n * is at the front of the queue.\n */\n push: function (value, cost) {\n var item = {value: value, cost: cost};\n this.queue.push(item);\n this.queue.sort(this.sorter);\n },\n\n /**\n * Return the highest priority element in the queue.\n */\n pop: function () {\n return this.queue.shift();\n },\n\n empty: function () {\n return this.queue.length === 0;\n }\n }\n};\n\n\n// node.js module exports\nif (typeof module !== 'undefined') {\n module.exports = dijkstra;\n}\n","const Mode = require('./mode')\nconst NumericData = require('./numeric-data')\nconst AlphanumericData = require('./alphanumeric-data')\nconst ByteData = require('./byte-data')\nconst KanjiData = require('./kanji-data')\nconst Regex = require('./regex')\nconst Utils = require('./utils')\nconst dijkstra = require('dijkstrajs')\n\n/**\n * Returns UTF8 byte length\n *\n * @param {String} str Input string\n * @return {Number} Number of byte\n */\nfunction getStringByteLength (str) {\n return unescape(encodeURIComponent(str)).length\n}\n\n/**\n * Get a list of segments of the specified mode\n * from a string\n *\n * @param {Mode} mode Segment mode\n * @param {String} str String to process\n * @return {Array} Array of object with segments data\n */\nfunction getSegments (regex, mode, str) {\n const segments = []\n let result\n\n while ((result = regex.exec(str)) !== null) {\n segments.push({\n data: result[0],\n index: result.index,\n mode: mode,\n length: result[0].length\n })\n }\n\n return segments\n}\n\n/**\n * Extracts a series of segments with the appropriate\n * modes from a string\n *\n * @param {String} dataStr Input string\n * @return {Array} Array of object with segments data\n */\nfunction getSegmentsFromString (dataStr) {\n const numSegs = getSegments(Regex.NUMERIC, Mode.NUMERIC, dataStr)\n const alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode.ALPHANUMERIC, dataStr)\n let byteSegs\n let kanjiSegs\n\n if (Utils.isKanjiModeEnabled()) {\n byteSegs = getSegments(Regex.BYTE, Mode.BYTE, dataStr)\n kanjiSegs = getSegments(Regex.KANJI, Mode.KANJI, dataStr)\n } else {\n byteSegs = getSegments(Regex.BYTE_KANJI, Mode.BYTE, dataStr)\n kanjiSegs = []\n }\n\n const segs = numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs)\n\n return segs\n .sort(function (s1, s2) {\n return s1.index - s2.index\n })\n .map(function (obj) {\n return {\n data: obj.data,\n mode: obj.mode,\n length: obj.length\n }\n })\n}\n\n/**\n * Returns how many bits are needed to encode a string of\n * specified length with the specified mode\n *\n * @param {Number} length String length\n * @param {Mode} mode Segment mode\n * @return {Number} Bit length\n */\nfunction getSegmentBitsLength (length, mode) {\n switch (mode) {\n case Mode.NUMERIC:\n return NumericData.getBitsLength(length)\n case Mode.ALPHANUMERIC:\n return AlphanumericData.getBitsLength(length)\n case Mode.KANJI:\n return KanjiData.getBitsLength(length)\n case Mode.BYTE:\n return ByteData.getBitsLength(length)\n }\n}\n\n/**\n * Merges adjacent segments which have the same mode\n *\n * @param {Array} segs Array of object with segments data\n * @return {Array} Array of object with segments data\n */\nfunction mergeSegments (segs) {\n return segs.reduce(function (acc, curr) {\n const prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null\n if (prevSeg && prevSeg.mode === curr.mode) {\n acc[acc.length - 1].data += curr.data\n return acc\n }\n\n acc.push(curr)\n return acc\n }, [])\n}\n\n/**\n * Generates a list of all possible nodes combination which\n * will be used to build a segments graph.\n *\n * Nodes are divided by groups. Each group will contain a list of all the modes\n * in which is possible to encode the given text.\n *\n * For example the text '12345' can be encoded as Numeric, Alphanumeric or Byte.\n * The group for '12345' will contain then 3 objects, one for each\n * possible encoding mode.\n *\n * Each node represents a possible segment.\n *\n * @param {Array} segs Array of object with segments data\n * @return {Array} Array of object with segments data\n */\nfunction buildNodes (segs) {\n const nodes = []\n for (let i = 0; i < segs.length; i++) {\n const seg = segs[i]\n\n switch (seg.mode) {\n case Mode.NUMERIC:\n nodes.push([seg,\n { data: seg.data, mode: Mode.ALPHANUMERIC, length: seg.length },\n { data: seg.data, mode: Mode.BYTE, length: seg.length }\n ])\n break\n case Mode.ALPHANUMERIC:\n nodes.push([seg,\n { data: seg.data, mode: Mode.BYTE, length: seg.length }\n ])\n break\n case Mode.KANJI:\n nodes.push([seg,\n { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }\n ])\n break\n case Mode.BYTE:\n nodes.push([\n { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }\n ])\n }\n }\n\n return nodes\n}\n\n/**\n * Builds a graph from a list of nodes.\n * All segments in each node group will be connected with all the segments of\n * the next group and so on.\n *\n * At each connection will be assigned a weight depending on the\n * segment's byte length.\n *\n * @param {Array} nodes Array of object with segments data\n * @param {Number} version QR Code version\n * @return {Object} Graph of all possible segments\n */\nfunction buildGraph (nodes, version) {\n const table = {}\n const graph = { start: {} }\n let prevNodeIds = ['start']\n\n for (let i = 0; i < nodes.length; i++) {\n const nodeGroup = nodes[i]\n const currentNodeIds = []\n\n for (let j = 0; j < nodeGroup.length; j++) {\n const node = nodeGroup[j]\n const key = '' + i + j\n\n currentNodeIds.push(key)\n table[key] = { node: node, lastCount: 0 }\n graph[key] = {}\n\n for (let n = 0; n < prevNodeIds.length; n++) {\n const prevNodeId = prevNodeIds[n]\n\n if (table[prevNodeId] && table[prevNodeId].node.mode === node.mode) {\n graph[prevNodeId][key] =\n getSegmentBitsLength(table[prevNodeId].lastCount + node.length, node.mode) -\n getSegmentBitsLength(table[prevNodeId].lastCount, node.mode)\n\n table[prevNodeId].lastCount += node.length\n } else {\n if (table[prevNodeId]) table[prevNodeId].lastCount = node.length\n\n graph[prevNodeId][key] = getSegmentBitsLength(node.length, node.mode) +\n 4 + Mode.getCharCountIndicator(node.mode, version) // switch cost\n }\n }\n }\n\n prevNodeIds = currentNodeIds\n }\n\n for (let n = 0; n < prevNodeIds.length; n++) {\n graph[prevNodeIds[n]].end = 0\n }\n\n return { map: graph, table: table }\n}\n\n/**\n * Builds a segment from a specified data and mode.\n * If a mode is not specified, the more suitable will be used.\n *\n * @param {String} data Input data\n * @param {Mode | String} modesHint Data mode\n * @return {Segment} Segment\n */\nfunction buildSingleSegment (data, modesHint) {\n let mode\n const bestMode = Mode.getBestModeForData(data)\n\n mode = Mode.from(modesHint, bestMode)\n\n // Make sure data can be encoded\n if (mode !== Mode.BYTE && mode.bit < bestMode.bit) {\n throw new Error('\"' + data + '\"' +\n ' cannot be encoded with mode ' + Mode.toString(mode) +\n '.\\n Suggested mode is: ' + Mode.toString(bestMode))\n }\n\n // Use Mode.BYTE if Kanji support is disabled\n if (mode === Mode.KANJI && !Utils.isKanjiModeEnabled()) {\n mode = Mode.BYTE\n }\n\n switch (mode) {\n case Mode.NUMERIC:\n return new NumericData(data)\n\n case Mode.ALPHANUMERIC:\n return new AlphanumericData(data)\n\n case Mode.KANJI:\n return new KanjiData(data)\n\n case Mode.BYTE:\n return new ByteData(data)\n }\n}\n\n/**\n * Builds a list of segments from an array.\n * Array can contain Strings or Objects with segment's info.\n *\n * For each item which is a string, will be generated a segment with the given\n * string and the more appropriate encoding mode.\n *\n * For each item which is an object, will be generated a segment with the given\n * data and mode.\n * Objects must contain at least the property \"data\".\n * If property \"mode\" is not present, the more suitable mode will be used.\n *\n * @param {Array} array Array of objects with segments data\n * @return {Array} Array of Segments\n */\nexports.fromArray = function fromArray (array) {\n return array.reduce(function (acc, seg) {\n if (typeof seg === 'string') {\n acc.push(buildSingleSegment(seg, null))\n } else if (seg.data) {\n acc.push(buildSingleSegment(seg.data, seg.mode))\n }\n\n return acc\n }, [])\n}\n\n/**\n * Builds an optimized sequence of segments from a string,\n * which will produce the shortest possible bitstream.\n *\n * @param {String} data Input string\n * @param {Number} version QR Code version\n * @return {Array} Array of segments\n */\nexports.fromString = function fromString (data, version) {\n const segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled())\n\n const nodes = buildNodes(segs)\n const graph = buildGraph(nodes, version)\n const path = dijkstra.find_path(graph.map, 'start', 'end')\n\n const optimizedSegs = []\n for (let i = 1; i < path.length - 1; i++) {\n optimizedSegs.push(graph.table[path[i]].node)\n }\n\n return exports.fromArray(mergeSegments(optimizedSegs))\n}\n\n/**\n * Splits a string in various segments with the modes which\n * best represent their content.\n * The produced segments are far from being optimized.\n * The output of this function is only used to estimate a QR Code version\n * which may contain the data.\n *\n * @param {string} data Input string\n * @return {Array} Array of segments\n */\nexports.rawSplit = function rawSplit (data) {\n return exports.fromArray(\n getSegmentsFromString(data, Utils.isKanjiModeEnabled())\n )\n}\n","const Utils = require('./utils')\nconst ECLevel = require('./error-correction-level')\nconst BitBuffer = require('./bit-buffer')\nconst BitMatrix = require('./bit-matrix')\nconst AlignmentPattern = require('./alignment-pattern')\nconst FinderPattern = require('./finder-pattern')\nconst MaskPattern = require('./mask-pattern')\nconst ECCode = require('./error-correction-code')\nconst ReedSolomonEncoder = require('./reed-solomon-encoder')\nconst Version = require('./version')\nconst FormatInfo = require('./format-info')\nconst Mode = require('./mode')\nconst Segments = require('./segments')\n\n/**\n * QRCode for JavaScript\n *\n * modified by Ryan Day for nodejs support\n * Copyright (c) 2011 Ryan Day\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/mit-license.php\n *\n//---------------------------------------------------------------------\n// QRCode for JavaScript\n//\n// Copyright (c) 2009 Kazuhiko Arase\n//\n// URL: http://www.d-project.com/\n//\n// Licensed under the MIT license:\n// http://www.opensource.org/licenses/mit-license.php\n//\n// The word \"QR Code\" is registered trademark of\n// DENSO WAVE INCORPORATED\n// http://www.denso-wave.com/qrcode/faqpatent-e.html\n//\n//---------------------------------------------------------------------\n*/\n\n/**\n * Add finder patterns bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Number} version QR Code version\n */\nfunction setupFinderPattern (matrix, version) {\n const size = matrix.size\n const pos = FinderPattern.getPositions(version)\n\n for (let i = 0; i < pos.length; i++) {\n const row = pos[i][0]\n const col = pos[i][1]\n\n for (let r = -1; r <= 7; r++) {\n if (row + r <= -1 || size <= row + r) continue\n\n for (let c = -1; c <= 7; c++) {\n if (col + c <= -1 || size <= col + c) continue\n\n if ((r >= 0 && r <= 6 && (c === 0 || c === 6)) ||\n (c >= 0 && c <= 6 && (r === 0 || r === 6)) ||\n (r >= 2 && r <= 4 && c >= 2 && c <= 4)) {\n matrix.set(row + r, col + c, true, true)\n } else {\n matrix.set(row + r, col + c, false, true)\n }\n }\n }\n }\n}\n\n/**\n * Add timing pattern bits to matrix\n *\n * Note: this function must be called before {@link setupAlignmentPattern}\n *\n * @param {BitMatrix} matrix Modules matrix\n */\nfunction setupTimingPattern (matrix) {\n const size = matrix.size\n\n for (let r = 8; r < size - 8; r++) {\n const value = r % 2 === 0\n matrix.set(r, 6, value, true)\n matrix.set(6, r, value, true)\n }\n}\n\n/**\n * Add alignment patterns bits to matrix\n *\n * Note: this function must be called after {@link setupTimingPattern}\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Number} version QR Code version\n */\nfunction setupAlignmentPattern (matrix, version) {\n const pos = AlignmentPattern.getPositions(version)\n\n for (let i = 0; i < pos.length; i++) {\n const row = pos[i][0]\n const col = pos[i][1]\n\n for (let r = -2; r <= 2; r++) {\n for (let c = -2; c <= 2; c++) {\n if (r === -2 || r === 2 || c === -2 || c === 2 ||\n (r === 0 && c === 0)) {\n matrix.set(row + r, col + c, true, true)\n } else {\n matrix.set(row + r, col + c, false, true)\n }\n }\n }\n }\n}\n\n/**\n * Add version info bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Number} version QR Code version\n */\nfunction setupVersionInfo (matrix, version) {\n const size = matrix.size\n const bits = Version.getEncodedBits(version)\n let row, col, mod\n\n for (let i = 0; i < 18; i++) {\n row = Math.floor(i / 3)\n col = i % 3 + size - 8 - 3\n mod = ((bits >> i) & 1) === 1\n\n matrix.set(row, col, mod, true)\n matrix.set(col, row, mod, true)\n }\n}\n\n/**\n * Add format info bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level\n * @param {Number} maskPattern Mask pattern reference value\n */\nfunction setupFormatInfo (matrix, errorCorrectionLevel, maskPattern) {\n const size = matrix.size\n const bits = FormatInfo.getEncodedBits(errorCorrectionLevel, maskPattern)\n let i, mod\n\n for (i = 0; i < 15; i++) {\n mod = ((bits >> i) & 1) === 1\n\n // vertical\n if (i < 6) {\n matrix.set(i, 8, mod, true)\n } else if (i < 8) {\n matrix.set(i + 1, 8, mod, true)\n } else {\n matrix.set(size - 15 + i, 8, mod, true)\n }\n\n // horizontal\n if (i < 8) {\n matrix.set(8, size - i - 1, mod, true)\n } else if (i < 9) {\n matrix.set(8, 15 - i - 1 + 1, mod, true)\n } else {\n matrix.set(8, 15 - i - 1, mod, true)\n }\n }\n\n // fixed module\n matrix.set(size - 8, 8, 1, true)\n}\n\n/**\n * Add encoded data bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Uint8Array} data Data codewords\n */\nfunction setupData (matrix, data) {\n const size = matrix.size\n let inc = -1\n let row = size - 1\n let bitIndex = 7\n let byteIndex = 0\n\n for (let col = size - 1; col > 0; col -= 2) {\n if (col === 6) col--\n\n while (true) {\n for (let c = 0; c < 2; c++) {\n if (!matrix.isReserved(row, col - c)) {\n let dark = false\n\n if (byteIndex < data.length) {\n dark = (((data[byteIndex] >>> bitIndex) & 1) === 1)\n }\n\n matrix.set(row, col - c, dark)\n bitIndex--\n\n if (bitIndex === -1) {\n byteIndex++\n bitIndex = 7\n }\n }\n }\n\n row += inc\n\n if (row < 0 || size <= row) {\n row -= inc\n inc = -inc\n break\n }\n }\n }\n}\n\n/**\n * Create encoded codewords from data input\n *\n * @param {Number} version QR Code version\n * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level\n * @param {ByteData} data Data input\n * @return {Uint8Array} Buffer containing encoded codewords\n */\nfunction createData (version, errorCorrectionLevel, segments) {\n // Prepare data buffer\n const buffer = new BitBuffer()\n\n segments.forEach(function (data) {\n // prefix data with mode indicator (4 bits)\n buffer.put(data.mode.bit, 4)\n\n // Prefix data with character count indicator.\n // The character count indicator is a string of bits that represents the\n // number of characters that are being encoded.\n // The character count indicator must be placed after the mode indicator\n // and must be a certain number of bits long, depending on the QR version\n // and data mode\n // @see {@link Mode.getCharCountIndicator}.\n buffer.put(data.getLength(), Mode.getCharCountIndicator(data.mode, version))\n\n // add binary data sequence to buffer\n data.write(buffer)\n })\n\n // Calculate required number of bits\n const totalCodewords = Utils.getSymbolTotalCodewords(version)\n const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8\n\n // Add a terminator.\n // If the bit string is shorter than the total number of required bits,\n // a terminator of up to four 0s must be added to the right side of the string.\n // If the bit string is more than four bits shorter than the required number of bits,\n // add four 0s to the end.\n if (buffer.getLengthInBits() + 4 <= dataTotalCodewordsBits) {\n buffer.put(0, 4)\n }\n\n // If the bit string is fewer than four bits shorter, add only the number of 0s that\n // are needed to reach the required number of bits.\n\n // After adding the terminator, if the number of bits in the string is not a multiple of 8,\n // pad the string on the right with 0s to make the string's length a multiple of 8.\n while (buffer.getLengthInBits() % 8 !== 0) {\n buffer.putBit(0)\n }\n\n // Add pad bytes if the string is still shorter than the total number of required bits.\n // Extend the buffer to fill the data capacity of the symbol corresponding to\n // the Version and Error Correction Level by adding the Pad Codewords 11101100 (0xEC)\n // and 00010001 (0x11) alternately.\n const remainingByte = (dataTotalCodewordsBits - buffer.getLengthInBits()) / 8\n for (let i = 0; i < remainingByte; i++) {\n buffer.put(i % 2 ? 0x11 : 0xEC, 8)\n }\n\n return createCodewords(buffer, version, errorCorrectionLevel)\n}\n\n/**\n * Encode input data with Reed-Solomon and return codewords with\n * relative error correction bits\n *\n * @param {BitBuffer} bitBuffer Data to encode\n * @param {Number} version QR Code version\n * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level\n * @return {Uint8Array} Buffer containing encoded codewords\n */\nfunction createCodewords (bitBuffer, version, errorCorrectionLevel) {\n // Total codewords for this QR code version (Data + Error correction)\n const totalCodewords = Utils.getSymbolTotalCodewords(version)\n\n // Total number of error correction codewords\n const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n\n // Total number of data codewords\n const dataTotalCodewords = totalCodewords - ecTotalCodewords\n\n // Total number of blocks\n const ecTotalBlocks = ECCode.getBlocksCount(version, errorCorrectionLevel)\n\n // Calculate how many blocks each group should contain\n const blocksInGroup2 = totalCodewords % ecTotalBlocks\n const blocksInGroup1 = ecTotalBlocks - blocksInGroup2\n\n const totalCodewordsInGroup1 = Math.floor(totalCodewords / ecTotalBlocks)\n\n const dataCodewordsInGroup1 = Math.floor(dataTotalCodewords / ecTotalBlocks)\n const dataCodewordsInGroup2 = dataCodewordsInGroup1 + 1\n\n // Number of EC codewords is the same for both groups\n const ecCount = totalCodewordsInGroup1 - dataCodewordsInGroup1\n\n // Initialize a Reed-Solomon encoder with a generator polynomial of degree ecCount\n const rs = new ReedSolomonEncoder(ecCount)\n\n let offset = 0\n const dcData = new Array(ecTotalBlocks)\n const ecData = new Array(ecTotalBlocks)\n let maxDataSize = 0\n const buffer = new Uint8Array(bitBuffer.buffer)\n\n // Divide the buffer into the required number of blocks\n for (let b = 0; b < ecTotalBlocks; b++) {\n const dataSize = b < blocksInGroup1 ? dataCodewordsInGroup1 : dataCodewordsInGroup2\n\n // extract a block of data from buffer\n dcData[b] = buffer.slice(offset, offset + dataSize)\n\n // Calculate EC codewords for this data block\n ecData[b] = rs.encode(dcData[b])\n\n offset += dataSize\n maxDataSize = Math.max(maxDataSize, dataSize)\n }\n\n // Create final data\n // Interleave the data and error correction codewords from each block\n const data = new Uint8Array(totalCodewords)\n let index = 0\n let i, r\n\n // Add data codewords\n for (i = 0; i < maxDataSize; i++) {\n for (r = 0; r < ecTotalBlocks; r++) {\n if (i < dcData[r].length) {\n data[index++] = dcData[r][i]\n }\n }\n }\n\n // Apped EC codewords\n for (i = 0; i < ecCount; i++) {\n for (r = 0; r < ecTotalBlocks; r++) {\n data[index++] = ecData[r][i]\n }\n }\n\n return data\n}\n\n/**\n * Build QR Code symbol\n *\n * @param {String} data Input string\n * @param {Number} version QR Code version\n * @param {ErrorCorretionLevel} errorCorrectionLevel Error level\n * @param {MaskPattern} maskPattern Mask pattern\n * @return {Object} Object containing symbol data\n */\nfunction createSymbol (data, version, errorCorrectionLevel, maskPattern) {\n let segments\n\n if (Array.isArray(data)) {\n segments = Segments.fromArray(data)\n } else if (typeof data === 'string') {\n let estimatedVersion = version\n\n if (!estimatedVersion) {\n const rawSegments = Segments.rawSplit(data)\n\n // Estimate best version that can contain raw splitted segments\n estimatedVersion = Version.getBestVersionForData(rawSegments, errorCorrectionLevel)\n }\n\n // Build optimized segments\n // If estimated version is undefined, try with the highest version\n segments = Segments.fromString(data, estimatedVersion || 40)\n } else {\n throw new Error('Invalid data')\n }\n\n // Get the min version that can contain data\n const bestVersion = Version.getBestVersionForData(segments, errorCorrectionLevel)\n\n // If no version is found, data cannot be stored\n if (!bestVersion) {\n throw new Error('The amount of data is too big to be stored in a QR Code')\n }\n\n // If not specified, use min version as default\n if (!version) {\n version = bestVersion\n\n // Check if the specified version can contain the data\n } else if (version < bestVersion) {\n throw new Error('\\n' +\n 'The chosen QR Code version cannot contain this amount of data.\\n' +\n 'Minimum version required to store current data is: ' + bestVersion + '.\\n'\n )\n }\n\n const dataBits = createData(version, errorCorrectionLevel, segments)\n\n // Allocate matrix buffer\n const moduleCount = Utils.getSymbolSize(version)\n const modules = new BitMatrix(moduleCount)\n\n // Add function modules\n setupFinderPattern(modules, version)\n setupTimingPattern(modules)\n setupAlignmentPattern(modules, version)\n\n // Add temporary dummy bits for format info just to set them as reserved.\n // This is needed to prevent these bits from being masked by {@link MaskPattern.applyMask}\n // since the masking operation must be performed only on the encoding region.\n // These blocks will be replaced with correct values later in code.\n setupFormatInfo(modules, errorCorrectionLevel, 0)\n\n if (version >= 7) {\n setupVersionInfo(modules, version)\n }\n\n // Add data codewords\n setupData(modules, dataBits)\n\n if (isNaN(maskPattern)) {\n // Find best mask pattern\n maskPattern = MaskPattern.getBestMask(modules,\n setupFormatInfo.bind(null, modules, errorCorrectionLevel))\n }\n\n // Apply mask pattern\n MaskPattern.applyMask(maskPattern, modules)\n\n // Replace format info bits with correct values\n setupFormatInfo(modules, errorCorrectionLevel, maskPattern)\n\n return {\n modules: modules,\n version: version,\n errorCorrectionLevel: errorCorrectionLevel,\n maskPattern: maskPattern,\n segments: segments\n }\n}\n\n/**\n * QR Code\n *\n * @param {String | Array} data Input data\n * @param {Object} options Optional configurations\n * @param {Number} options.version QR Code version\n * @param {String} options.errorCorrectionLevel Error correction level\n * @param {Function} options.toSJISFunc Helper func to convert utf8 to sjis\n */\nexports.create = function create (data, options) {\n if (typeof data === 'undefined' || data === '') {\n throw new Error('No input text')\n }\n\n let errorCorrectionLevel = ECLevel.M\n let version\n let mask\n\n if (typeof options !== 'undefined') {\n // Use higher error correction level as default\n errorCorrectionLevel = ECLevel.from(options.errorCorrectionLevel, ECLevel.M)\n version = Version.from(options.version)\n mask = MaskPattern.from(options.maskPattern)\n\n if (options.toSJISFunc) {\n Utils.setToSJISFunction(options.toSJISFunc)\n }\n }\n\n return createSymbol(data, version, errorCorrectionLevel, mask)\n}\n","function hex2rgba (hex) {\n if (typeof hex === 'number') {\n hex = hex.toString()\n }\n\n if (typeof hex !== 'string') {\n throw new Error('Color should be defined as hex string')\n }\n\n let hexCode = hex.slice().replace('#', '').split('')\n if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) {\n throw new Error('Invalid hex color: ' + hex)\n }\n\n // Convert from short to long form (fff -> ffffff)\n if (hexCode.length === 3 || hexCode.length === 4) {\n hexCode = Array.prototype.concat.apply([], hexCode.map(function (c) {\n return [c, c]\n }))\n }\n\n // Add default alpha value\n if (hexCode.length === 6) hexCode.push('F', 'F')\n\n const hexValue = parseInt(hexCode.join(''), 16)\n\n return {\n r: (hexValue >> 24) & 255,\n g: (hexValue >> 16) & 255,\n b: (hexValue >> 8) & 255,\n a: hexValue & 255,\n hex: '#' + hexCode.slice(0, 6).join('')\n }\n}\n\nexports.getOptions = function getOptions (options) {\n if (!options) options = {}\n if (!options.color) options.color = {}\n\n const margin = typeof options.margin === 'undefined' ||\n options.margin === null ||\n options.margin < 0\n ? 4\n : options.margin\n\n const width = options.width && options.width >= 21 ? options.width : undefined\n const scale = options.scale || 4\n\n return {\n width: width,\n scale: width ? 4 : scale,\n margin: margin,\n color: {\n dark: hex2rgba(options.color.dark || '#000000ff'),\n light: hex2rgba(options.color.light || '#ffffffff')\n },\n type: options.type,\n rendererOpts: options.rendererOpts || {}\n }\n}\n\nexports.getScale = function getScale (qrSize, opts) {\n return opts.width && opts.width >= qrSize + opts.margin * 2\n ? opts.width / (qrSize + opts.margin * 2)\n : opts.scale\n}\n\nexports.getImageWidth = function getImageWidth (qrSize, opts) {\n const scale = exports.getScale(qrSize, opts)\n return Math.floor((qrSize + opts.margin * 2) * scale)\n}\n\nexports.qrToImageData = function qrToImageData (imgData, qr, opts) {\n const size = qr.modules.size\n const data = qr.modules.data\n const scale = exports.getScale(size, opts)\n const symbolSize = Math.floor((size + opts.margin * 2) * scale)\n const scaledMargin = opts.margin * scale\n const palette = [opts.color.light, opts.color.dark]\n\n for (let i = 0; i < symbolSize; i++) {\n for (let j = 0; j < symbolSize; j++) {\n let posDst = (i * symbolSize + j) * 4\n let pxColor = opts.color.light\n\n if (i >= scaledMargin && j >= scaledMargin &&\n i < symbolSize - scaledMargin && j < symbolSize - scaledMargin) {\n const iSrc = Math.floor((i - scaledMargin) / scale)\n const jSrc = Math.floor((j - scaledMargin) / scale)\n pxColor = palette[data[iSrc * size + jSrc] ? 1 : 0]\n }\n\n imgData[posDst++] = pxColor.r\n imgData[posDst++] = pxColor.g\n imgData[posDst++] = pxColor.b\n imgData[posDst] = pxColor.a\n }\n }\n}\n","const Utils = require('./utils')\n\nfunction clearCanvas (ctx, canvas, size) {\n ctx.clearRect(0, 0, canvas.width, canvas.height)\n\n if (!canvas.style) canvas.style = {}\n canvas.height = size\n canvas.width = size\n canvas.style.height = size + 'px'\n canvas.style.width = size + 'px'\n}\n\nfunction getCanvasElement () {\n try {\n return document.createElement('canvas')\n } catch (e) {\n throw new Error('You need to specify a canvas element')\n }\n}\n\nexports.render = function render (qrData, canvas, options) {\n let opts = options\n let canvasEl = canvas\n\n if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {\n opts = canvas\n canvas = undefined\n }\n\n if (!canvas) {\n canvasEl = getCanvasElement()\n }\n\n opts = Utils.getOptions(opts)\n const size = Utils.getImageWidth(qrData.modules.size, opts)\n\n const ctx = canvasEl.getContext('2d')\n const image = ctx.createImageData(size, size)\n Utils.qrToImageData(image.data, qrData, opts)\n\n clearCanvas(ctx, canvasEl, size)\n ctx.putImageData(image, 0, 0)\n\n return canvasEl\n}\n\nexports.renderToDataURL = function renderToDataURL (qrData, canvas, options) {\n let opts = options\n\n if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {\n opts = canvas\n canvas = undefined\n }\n\n if (!opts) opts = {}\n\n const canvasEl = exports.render(qrData, canvas, opts)\n\n const type = opts.type || 'image/png'\n const rendererOpts = opts.rendererOpts || {}\n\n return canvasEl.toDataURL(type, rendererOpts.quality)\n}\n","const Utils = require('./utils')\n\nfunction getColorAttrib (color, attrib) {\n const alpha = color.a / 255\n const str = attrib + '=\"' + color.hex + '\"'\n\n return alpha < 1\n ? str + ' ' + attrib + '-opacity=\"' + alpha.toFixed(2).slice(1) + '\"'\n : str\n}\n\nfunction svgCmd (cmd, x, y) {\n let str = cmd + x\n if (typeof y !== 'undefined') str += ' ' + y\n\n return str\n}\n\nfunction qrToPath (data, size, margin) {\n let path = ''\n let moveBy = 0\n let newRow = false\n let lineLength = 0\n\n for (let i = 0; i < data.length; i++) {\n const col = Math.floor(i % size)\n const row = Math.floor(i / size)\n\n if (!col && !newRow) newRow = true\n\n if (data[i]) {\n lineLength++\n\n if (!(i > 0 && col > 0 && data[i - 1])) {\n path += newRow\n ? svgCmd('M', col + margin, 0.5 + row + margin)\n : svgCmd('m', moveBy, 0)\n\n moveBy = 0\n newRow = false\n }\n\n if (!(col + 1 < size && data[i + 1])) {\n path += svgCmd('h', lineLength)\n lineLength = 0\n }\n } else {\n moveBy++\n }\n }\n\n return path\n}\n\nexports.render = function render (qrData, options, cb) {\n const opts = Utils.getOptions(options)\n const size = qrData.modules.size\n const data = qrData.modules.data\n const qrcodesize = size + opts.margin * 2\n\n const bg = !opts.color.light.a\n ? ''\n : ''\n\n const path =\n ''\n\n const viewBox = 'viewBox=\"' + '0 0 ' + qrcodesize + ' ' + qrcodesize + '\"'\n\n const width = !opts.width ? '' : 'width=\"' + opts.width + '\" height=\"' + opts.width + '\" '\n\n const svgTag = '' + bg + path + '\\n'\n\n if (typeof cb === 'function') {\n cb(null, svgTag)\n }\n\n return svgTag\n}\n","\nconst canPromise = require('./can-promise')\n\nconst QRCode = require('./core/qrcode')\nconst CanvasRenderer = require('./renderer/canvas')\nconst SvgRenderer = require('./renderer/svg-tag.js')\n\nfunction renderCanvas (renderFunc, canvas, text, opts, cb) {\n const args = [].slice.call(arguments, 1)\n const argsNum = args.length\n const isLastArgCb = typeof args[argsNum - 1] === 'function'\n\n if (!isLastArgCb && !canPromise()) {\n throw new Error('Callback required as last argument')\n }\n\n if (isLastArgCb) {\n if (argsNum < 2) {\n throw new Error('Too few arguments provided')\n }\n\n if (argsNum === 2) {\n cb = text\n text = canvas\n canvas = opts = undefined\n } else if (argsNum === 3) {\n if (canvas.getContext && typeof cb === 'undefined') {\n cb = opts\n opts = undefined\n } else {\n cb = opts\n opts = text\n text = canvas\n canvas = undefined\n }\n }\n } else {\n if (argsNum < 1) {\n throw new Error('Too few arguments provided')\n }\n\n if (argsNum === 1) {\n text = canvas\n canvas = opts = undefined\n } else if (argsNum === 2 && !canvas.getContext) {\n opts = text\n text = canvas\n canvas = undefined\n }\n\n return new Promise(function (resolve, reject) {\n try {\n const data = QRCode.create(text, opts)\n resolve(renderFunc(data, canvas, opts))\n } catch (e) {\n reject(e)\n }\n })\n }\n\n try {\n const data = QRCode.create(text, opts)\n cb(null, renderFunc(data, canvas, opts))\n } catch (e) {\n cb(e)\n }\n}\n\nexports.create = QRCode.create\nexports.toCanvas = renderCanvas.bind(null, CanvasRenderer.render)\nexports.toDataURL = renderCanvas.bind(null, CanvasRenderer.renderToDataURL)\n\n// only svg for now.\nexports.toString = renderCanvas.bind(null, function (data, _, opts) {\n return SvgRenderer.render(data, opts)\n})\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst QrImage = __importStar(require(\"qrcode\"));\n/**\n * QrCode component.\n */\nlet QrCode = class QrCode extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // A title representing the QR code both for accessibility reasons and used as a tooltip, e.g. \"QR code to www.ikea.com\". The title is used as a tooltip for pointing devices, and can also be read by e.g. screen readers.\n this.qrCodeTitle = null;\n }\n /**\n * Renders component.\n *\n * @returns HTML.\n */\n render() {\n this.generateQr();\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
\n\t\t`;\n }\n generateQr() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const image = yield QrImage.toString(this.url, {\n type: 'svg',\n margin: 1,\n color: { dark: '#111' }\n });\n const container = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.container');\n if (container) {\n container.innerHTML = image;\n if (this.qrCodeTitle) {\n const titleElement = document.createElementNS('http://www.w3.org/2000/svg', 'title');\n titleElement.textContent = this.qrCodeTitle;\n container.children[0].prepend(titleElement);\n container.children[0].setAttribute('role', 'img');\n }\n }\n });\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String, required: true })\n], QrCode.prototype, \"url\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], QrCode.prototype, \"qrCodeTitle\", void 0);\nQrCode = __decorate([\n (0, web_component_1.customElement)('kompis-qr-code')\n], QrCode);\nexports.default = QrCode;\n//# sourceMappingURL=QrCode.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.QrCode = void 0;\nconst QrCode_1 = __importDefault(require(\"./components/qr-code/QrCode\"));\nexports.QrCode = QrCode_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar TextToggleLayoutEnum;\n(function (TextToggleLayoutEnum) {\n TextToggleLayoutEnum[\"emphasized\"] = \"emphasized\";\n TextToggleLayoutEnum[\"subtle\"] = \"subtle\";\n})(TextToggleLayoutEnum || (TextToggleLayoutEnum = {}));\nexports.default = TextToggleLayoutEnum;\n//# sourceMappingURL=TextToggleLayoutEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar TextToggleSizeEnum;\n(function (TextToggleSizeEnum) {\n TextToggleSizeEnum[\"small\"] = \"small\";\n TextToggleSizeEnum[\"medium\"] = \"medium\";\n})(TextToggleSizeEnum || (TextToggleSizeEnum = {}));\nexports.default = TextToggleSizeEnum;\n//# sourceMappingURL=TextToggleSizeEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nconst TextToggleLayoutEnum_1 = __importDefault(require(\"../../enums/TextToggleLayoutEnum\"));\n/**\n * A class with style.\n */\nclass TextToggleStyle {\n /**\n * Returns styles.\n *\n * @param options Args.\n * @param options.expanded Is it open.\n * @param options.layout Text layout.\n * @param options.theme Theme.\n * @param options.printLabel Label displayed when printing.\n * @param options.hasFocus\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing, color, motion } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.FocusRing.CSS}\n\n\t\t\tbutton {\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\talign-items: flex-start;\n\t\t\t\tcolor: ${options.layout === TextToggleLayoutEnum_1.default.emphasized\n ? color.accent.primaryAccent\n : color.neutral.grey900};\n\t\t\t\tborder: none;\n\t\t\t\tbackground: none;\n\t\t\t\tcursor: pointer;\n\t\t\t\tmargin: 0;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tbutton:hover {\n\t\t\t\ttext-decoration: underline;\n\t\t\t}\n\t\t\tbutton kompis-icon {\n\t\t\t\tmargin-top: ${6 / 16}rem;\n\t\t\t}\n\t\t\t.divider {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-shrink: 0;\n\t\t\t\twidth: ${spacing.space75 / 16}rem;\n\t\t\t}\n\t\t\tkompis-icon {\n\t\t\t\ttransform: rotate(${options.expanded ? 180 : 0}deg);\n\t\t\t\ttransition-property: transform;\n\t\t\t\ttransition-duration: ${motion.duration.medium};\n\t\t\t}\n\n\t\t\t.visuallyHidden {\n\t\t\t\tborder: 0 !important;\n\t\t\t\tclip: rect(${1 / 16}rem, ${1 / 16}rem, ${1 / 16}rem, ${1 / 16}rem) !important;\n\t\t\t\t-webkit-clip-path: inset(50%) !important;\n\t\t\t\tclip-path: inset(50%) !important;\n\t\t\t\theight: ${1 / 16}rem !important;\n\t\t\t\tmargin: -${1 / 16}rem !important;\n\t\t\t\toverflow: hidden !important;\n\t\t\t\tpadding: 0 !important;\n\t\t\t\tposition: absolute !important;\n\t\t\t\twidth: ${1 / 16}rem !important;\n\t\t\t\twhite-space: nowrap !important;\n\t\t\t\ttop: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\tleft: 0;\n\t\t\t\tright: 0;\n\t\t\t}\n\n\t\t\t${this.getRtlRules(options)}\n\t\t\t${this.getPrintStyle(options)}\n\t\t`;\n }\n /**\n * Returns styles.\n *\n * @param options The props.\n * @param options.theme Theme.\n * @param options.expanded\n * @returns Styles.\n */\n static getRtlRules(options) {\n if (!options.expanded) {\n return (0, web_component_1.css) ``;\n }\n return (0, web_component_1.css) `\n\t\t\t:host(:dir(rtl)) kompis-icon {\n\t\t\t\ttransform: rotate(-180deg);\n\t\t\t}\n\t\t\t:host-context([dir='rtl']) kompis-icon {\n\t\t\t\ttransform: rotate(-180deg);\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.printLabel Label displayed when printing.\n * @returns Styles.\n */\n static getPrintStyle(options) {\n return (0, web_component_1.css) `\n\t\t\t@media print {\n\t\t\t\tkompis-icon,\n\t\t\t\t.divider {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\t\t\t\t${options.printLabel\n ? (0, web_component_1.css) `\n\t\t\t\t\t\t\tkompis-text span {\n\t\t\t\t\t\t\t\tdisplay: none;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tkompis-text:after {\n\t\t\t\t\t\t\t\tcontent: '${options.printLabel}';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t `\n : ''}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = TextToggleStyle;\n//# sourceMappingURL=TextToggleStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst icons_1 = require(\"@inter-ikea-kompis/icons\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@inter-ikea-kompis/component-focus-outline\");\nrequire(\"@inter-ikea-kompis/component-icon\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@inter-ikea-kompis/component-collapsible\");\nconst TextToggleLayoutEnum_1 = __importDefault(require(\"../../enums/TextToggleLayoutEnum\"));\nconst TextToggleSizeEnum_1 = __importDefault(require(\"../../enums/TextToggleSizeEnum\"));\nconst TextToggleStyle_1 = __importDefault(require(\"./TextToggleStyle\"));\n/**\n * Text toggle.\n *\n * @event expand Triggered when toggle is clicked\n * @event animationEnd Triggered when animation ends\n */\nlet TextToggle = class TextToggle extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Layout\n this.layout = TextToggleLayoutEnum_1.default.subtle;\n // Label\n this.label = null;\n // Label displayed when printing\n this.printLabel = null;\n // Label explaining the text toggle further for screen readers. If supplied, \"label\" won't be read by screen readers.\n this.ariaLabel = null;\n // Expanded\n this.expanded = false;\n // Size\n this.size = TextToggleSizeEnum_1.default.medium;\n this.uniqueId = new utilities_1.IdGenerator().generateId();\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t${this.getLabel()}\n\t\t\t\t\n\t\t\t\n\t\t\t this.dispatchEvent(new CustomEvent('animationEnd', { bubbles: true }))}\"\n\t\t\t>\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n getLabel() {\n if (!this.ariaLabel) {\n return (0, web_component_1.html) `${this.label}`;\n }\n else {\n return (0, web_component_1.html) `${this.ariaLabel}${this.label}`;\n }\n }\n /**\n * On click.\n */\n onClick() {\n this.dispatchEvent(new CustomEvent('expand', {\n bubbles: true,\n detail: {\n expanded: !this.expanded\n }\n }));\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], TextToggle.prototype, \"layout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], TextToggle.prototype, \"label\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], TextToggle.prototype, \"printLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], TextToggle.prototype, \"ariaLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], TextToggle.prototype, \"expanded\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], TextToggle.prototype, \"size\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], TextToggle.prototype, \"theme\", void 0);\nTextToggle = __decorate([\n (0, web_component_1.customElement)('kompis-text-toggle')\n], TextToggle);\nexports.default = TextToggle;\n//# sourceMappingURL=TextToggle.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TextToggleSizeEnum = exports.TextToggleLayoutEnum = exports.TextToggle = void 0;\nconst TextToggle_1 = __importDefault(require(\"./components/text-toggle/TextToggle\"));\nexports.TextToggle = TextToggle_1.default;\nconst TextToggleLayoutEnum_1 = __importDefault(require(\"./enums/TextToggleLayoutEnum\"));\nexports.TextToggleLayoutEnum = TextToggleLayoutEnum_1.default;\nconst TextToggleSizeEnum_1 = __importDefault(require(\"./enums/TextToggleSizeEnum\"));\nexports.TextToggleSizeEnum = TextToggleSizeEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass EprelQrStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.theme\n * @returns Styles.\n */\n static getStyle(options) {\n return (0, web_component_1.css) `\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tposition: relative;\n\t\t\t}\n\t\t\tkompis-text {\n\t\t\t\tmargin-bottom: ${options.theme.spacing.space150 / 16}rem;\n\t\t\t\tmargin-top: ${options.theme.spacing.space100 / 16}rem;\n\t\t\t}\n\t\t\tkompis-qr-code {\n\t\t\t\tdisplay: contents;\n\t\t\t\twidth: 80%;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = EprelQrStyle;\n//# sourceMappingURL=EprelQrStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@inter-ikea-kompis/component-qr-code\");\nconst EprelQrStyle_1 = __importDefault(require(\"./EprelQrStyle\"));\n/**\n * Data-driven information listing.\n */\nlet EprelQr = class EprelQr extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n }\n /**\n * @returns Template.\n */\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n const link = utilities_1.ProductUtility.getProductInformationSheetLink(this.product);\n if (!link) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t${this.getTranslations().energyClassEprelQrDescription}\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t`;\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], EprelQr.prototype, \"product\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], EprelQr.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], EprelQr.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], EprelQr.prototype, \"translations\", void 0);\nEprelQr = __decorate([\n (0, web_component_1.customElement)('kompis-eprel-qr')\n], EprelQr);\nexports.default = EprelQr;\n//# sourceMappingURL=EprelQr.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@inter-ikea-kompis/component-text-toggle\");\nrequire(\"../eprel-qr/EprelQr\");\n/**\n * Data-driven information listing.\n *\n * @event expand Triggered when toggle is clicked\n * @event animationEnd Triggered when animation ends\n */\nlet EprelQrToggle = class EprelQrToggle extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // Expanded\n this.expanded = false;\n }\n /**\n * @returns Template.\n */\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n const link = utilities_1.ProductUtility.getProductInformationSheetLink(this.product);\n if (!link) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('animationEnd', { bubbles: true, detail: event.detail }))}\"\n\t\t\t\t@expand=\"${(event) => this.dispatchEvent(new CustomEvent('expand', { bubbles: true, detail: event.detail }))}\"\n\t\t\t>\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], EprelQrToggle.prototype, \"product\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], EprelQrToggle.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], EprelQrToggle.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], EprelQrToggle.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], EprelQrToggle.prototype, \"expanded\", void 0);\nEprelQrToggle = __decorate([\n (0, web_component_1.customElement)('kompis-eprel-qr-toggle')\n], EprelQrToggle);\nexports.default = EprelQrToggle;\n//# sourceMappingURL=EprelQrToggle.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst lib_1 = require(\"@inter-ikea-kompis/enums/lib\");\nclass EnergyLabelCardStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.theme\n * @param options.rescaled\n * @param options.energyType\n * @returns Styles.\n */\n static getStyle(options) {\n var _a;\n return (0, web_component_1.css) `\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\t\t\t.labels {\n\t\t\t\tflex-wrap: wrap;\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t\timg {\n\t\t\t\toutline: none;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\t.labels > * {\n\t\t\t\tmargin: ${options.theme.spacing.space50 / 16}rem;\n\t\t\t\toverflow: hidden;\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\t\t\t}\n\n\t\t\t${(_a = this.getImageWidth({ rescaled: options.rescaled, energyType: options.energyType })) !== null && _a !== void 0 ? _a : ''}\n\t\t`;\n }\n /**\n * @param options\n * @param options.rescaled\n * @param options.energyType\n */\n static getImageWidth(options) {\n if (options.energyType === lib_1.ProductComplianceTechnicalHeadingTypeEnum.energyEfficiencyClass &&\n options.rescaled) {\n return (0, web_component_1.css) `\n\t\t\t\timg {\n\t\t\t\t\twidth: 74%;\n\t\t\t\t}\n\t\t\t`;\n }\n return null;\n }\n}\nexports.default = EnergyLabelCardStyle;\n//# sourceMappingURL=EnergyLabelCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_hyperlink_1 = require(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@inter-ikea-kompis/component-qr-code\");\nrequire(\"@inter-ikea-kompis/component-text-toggle\");\nrequire(\"../eprel-qr-toggle/EprelQrToggle\");\nconst EnergyLabelCardStyle_1 = __importDefault(require(\"./EnergyLabelCardStyle\"));\nconst LABEL_FILE_TYPE = 'svg';\n/* eslint-disable lit-a11y/alt-text */\n/**\n * Data-driven information listing.\n */\nlet EnergyLabelCard = class EnergyLabelCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // Filter the energy labels to be shown. By default, all labels are visible.\n this.labelFilter = null;\n this.expandedTextToggle = false;\n }\n /**\n * @returns Template.\n */\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n const rescaled = !!utilities_1.ProductUtility.getProductInformationSheetLink(this.product);\n const energyType = utilities_1.ProductUtility.getProductComplianceType(this.product);\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
${this.getCard()}
\n\t\t`;\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n /**\n * Returns either Eprel card or Fiche card depending on what data comes from DEXF.\n */\n getCard() {\n return (0, web_component_1.html) `\n\t\t\t
${this.getLabels()}
\n\t\t\t${this.getEprelLink()}\n\t\t`;\n }\n getLabels() {\n return this.getLabelUrls().map((url) => (0, web_component_1.html) `\"${this.getImageAlt()}\"`);\n }\n /**\n * Return url to the label SVGs.\n */\n getLabelUrls() {\n var _a, _b;\n if ((_b = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.complianceLabel) === null || _b === void 0 ? void 0 : _b.length) {\n return this.product.content.complianceLabel\n .filter((label) => {\n if (this.labelFilter) {\n return this.labelFilter.includes(label);\n }\n return true;\n })\n .filter((label) => label.fileType === LABEL_FILE_TYPE)\n .map((label) => label.url);\n }\n return [];\n }\n /**\n * Returns corresponding alt text for the energy efficiency class image.\n *\n * @param complianceLabelType\n */\n getImageAlt() {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;\n const complianceLabelType = utilities_1.ProductUtility.getProductComplianceType(this.product);\n switch (complianceLabelType) {\n case enums_1.ProductComplianceTechnicalHeadingTypeEnum.energyEfficiencyClass: {\n const eecObject = (_c = (_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.complianceTechnical) === null || _c === void 0 ? void 0 : _c.find((obj) => obj.headingType === 'ENERGY_EFFICIENCY_CLASS');\n if (!eecObject) {\n return '';\n }\n const { headingText, text } = eecObject;\n return `${headingText} ${text}`;\n }\n case enums_1.ProductComplianceTechnicalHeadingTypeEnum.hyperlink: {\n return (_h = (_g = (_f = (_e = (_d = this.product) === null || _d === void 0 ? void 0 : _d.content) === null || _e === void 0 ? void 0 : _e.complianceLabel) === null || _f === void 0 ? void 0 : _f.find((obj) => obj.labelType)) === null || _g === void 0 ? void 0 : _g.typeName) !== null && _h !== void 0 ? _h : '';\n }\n case enums_1.ProductComplianceTechnicalHeadingTypeEnum.nonRescaled: {\n const eecObject = (_l = (_k = (_j = this.product) === null || _j === void 0 ? void 0 : _j.content) === null || _k === void 0 ? void 0 : _k.technicalInformation) === null || _l === void 0 ? void 0 : _l.find((obj) => obj.typeCode === '00026');\n if (!eecObject) {\n return '';\n }\n const { typeName, valueMetric } = eecObject;\n return `${typeName} ${valueMetric}`;\n }\n default: {\n return '';\n }\n }\n }\n /**\n * Get EPREL link.\n */\n getEprelLink() {\n const link = this.product ? utilities_1.ProductUtility.getProductInformationSheetLink(this.product) : null;\n if (!link) {\n return null;\n }\n if (this.disableLinks) {\n return (0, web_component_1.html) ` {\n if (this.expandedTextToggle) {\n event.target.scrollIntoView({\n behavior: 'smooth'\n });\n }\n }}\"\n\t\t\t\t@expand=\"${(event) => {\n this.expandedTextToggle = event.detail.expanded;\n this.update();\n }}\"\n\t\t\t>`;\n }\n return (0, web_component_1.html) ` \n\t\t\t\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], EnergyLabelCard.prototype, \"product\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], EnergyLabelCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], EnergyLabelCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], EnergyLabelCard.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], EnergyLabelCard.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], EnergyLabelCard.prototype, \"labelFilter\", void 0);\nEnergyLabelCard = __decorate([\n (0, web_component_1.customElement)('kompis-energy-label-card')\n], EnergyLabelCard);\nexports.default = EnergyLabelCard;\n//# sourceMappingURL=EnergyLabelCard.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar EnergyEfficiencyClassMediaEnum;\n(function (EnergyEfficiencyClassMediaEnum) {\n EnergyEfficiencyClassMediaEnum[\"svg\"] = \"00017\";\n EnergyEfficiencyClassMediaEnum[\"jpeg\"] = \"00001\";\n})(EnergyEfficiencyClassMediaEnum || (EnergyEfficiencyClassMediaEnum = {}));\nexports.default = EnergyEfficiencyClassMediaEnum;\n//# sourceMappingURL=EnergyEfficiencyClassMediaEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar EnergyEfficiencyClassModalEnum;\n(function (EnergyEfficiencyClassModalEnum) {\n EnergyEfficiencyClassModalEnum[\"energyLabelCard\"] = \"energyLabelCard\";\n})(EnergyEfficiencyClassModalEnum || (EnergyEfficiencyClassModalEnum = {}));\nexports.default = EnergyEfficiencyClassModalEnum;\n//# sourceMappingURL=EnergyEfficiencyClassModalEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst MIN_ICON_SIZE = 24;\nclass EnergyEfficiencyClassStyle {\n /**\n * Returns styles.\n *\n * @param options\n * @param options.energyType\n \n * @returns Styles.\n */\n static getStyle(options) {\n const imageWidth = this.getImageWidth(options.energyType);\n return (0, web_component_1.css) `\n\t\t\t:host,\n\t\t\tkompis-focus-outline {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\t\t\tkompis-energy-efficiency-non-rescaled,\n\t\t\timg {\n\t\t\t\t${imageWidth ? `width: ${imageWidth};` : ''};\n\t\t\t\tmin-width: 2.5rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t}\n\t\t\tkompis-hyperlink {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\t\t\t.imageContainer {\n\t\t\t\tcursor: pointer;\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\t\t\t\talign-items: center;\n\t\t\t\tmin-height: ${MIN_ICON_SIZE / 16}rem;\n\t\t\t\tmin-width: ${MIN_ICON_SIZE / 16}rem;\n\t\t\t\toutline: none;\n\t\t\t}\n\t\t`;\n }\n /**\n * @param energyType\n */\n static getImageWidth(energyType) {\n switch (energyType) {\n case enums_1.ProductComplianceTechnicalHeadingTypeEnum.energyEfficiencyClass:\n return '2.7em';\n case enums_1.ProductComplianceTechnicalHeadingTypeEnum.hyperlink:\n return '100%';\n default:\n return null;\n }\n }\n}\nexports.default = EnergyEfficiencyClassStyle;\n//# sourceMappingURL=EnergyEfficiencyClassStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@inter-ikea-kompis/component-focus-outline\");\nrequire(\"@ingka/modal-webc\");\nrequire(\"../energy-efficiency-non-rescaled/EnergyEfficiencyNonRescaled\");\nrequire(\"../energy-label-card/EnergyLabelCard\");\nconst EnergyEfficiencyClassMediaEnum_1 = __importDefault(require(\"../../enums/EnergyEfficiencyClassMediaEnum\"));\nconst EnergyEfficiencyClassModalEnum_1 = __importDefault(require(\"../../enums/EnergyEfficiencyClassModalEnum\"));\nconst EnergyEfficiencyClassStyle_1 = __importDefault(require(\"./EnergyEfficiencyClassStyle\"));\n/* eslint-disable lit-a11y/alt-text */\n/**\n * Energy Efficiency Class component.\n *\n * @event modalOpen Triggered when opening a modal\n * @event modalClose Triggered when closing a modal\n */\nlet EnergyEfficiencyClass = class EnergyEfficiencyClass extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // Visible modal.\n this.visibleModal = null;\n this.sheetElement = null;\n this.dexfSettings = null;\n }\n /**\n * Renders the energy icons/flags.\n */\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return this.getEnergyImages();\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.closeSheet();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n if (changedProperties.has('visibleModal')) {\n if (this.visibleModal) {\n this.openSheet();\n }\n else {\n this.closeSheet();\n }\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n getSettings() {\n return this.dexfSettings;\n }\n getEnergyImages() {\n const imageUrls = this.getImageUrls();\n let renderResult;\n if (imageUrls != null && imageUrls.length) {\n renderResult = this.showEnergyImages(imageUrls);\n }\n // Use non rescaled energy class for EU - fallback if complianceTechnical is missing and non rescaled should be shown\n else if (this.getSettings().kompis.localization.useNonRescaledEnergyLabel) {\n renderResult = this.showLegacyEuEnergyNonRescaledImage();\n }\n return renderResult\n ? renderResult\n : (0, web_component_1.html) `\n\t\t\t\t\t\n\t\t\t `;\n }\n /**\n * Extract image URL from product.\n */\n getImageUrls() {\n var _a, _b;\n if ((_b = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.complianceTechnical) === null || _b === void 0 ? void 0 : _b.length) {\n const energyEfficiencyClasses = this.product.content.complianceTechnical.filter((complianceTechnicalItem) => complianceTechnicalItem.headingType ===\n enums_1.ProductComplianceTechnicalHeadingTypeEnum.energyEfficiencyClass ||\n (complianceTechnicalItem.headingType ===\n enums_1.ProductComplianceTechnicalHeadingTypeEnum.hyperlink &&\n complianceTechnicalItem.text !== 'SEC'));\n const labelsUrls = [];\n energyEfficiencyClasses.forEach((energyClass) => {\n var _a;\n const find = (fileTypeCode) => {\n var _a, _b, _c;\n return ((_c = (_b = (_a = energyClass.media) === null || _a === void 0 ? void 0 : _a.find((mediaType) => mediaType.fileTypeCode === fileTypeCode)) === null || _b === void 0 ? void 0 : _b.url) !== null && _c !== void 0 ? _c : null);\n };\n const url = (_a = find(EnergyEfficiencyClassMediaEnum_1.default.svg)) !== null && _a !== void 0 ? _a : find(EnergyEfficiencyClassMediaEnum_1.default.jpeg);\n if (url != null) {\n labelsUrls.push(url);\n }\n });\n return labelsUrls;\n }\n return null;\n }\n /**\n * Fetches the energy images.\n *\n * @param imageUrls\n */\n showEnergyImages(imageUrls) {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${imageUrls.map((imageUrl) => (0, web_component_1.html) `\n\t\t\t\t\t\n\t\t\t\t\t\t {\n if (event.key === 'Enter' || event.key === ' ') {\n this.sendModalOpen();\n }\n }}\n\t\t\t\t\t\t\t@click=\"${(event) => {\n event.preventDefault();\n event.stopPropagation();\n this.sendModalOpen();\n }}\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\"${this.getImageAlt()}\"\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t`)}\n\t\t`;\n }\n /**\n * Fetches the non rescaled energy image (EU) if the svg is not provided with the product data.\n * Exists as a fallback if the data is not available but should show the non rescaled flag.\n */\n showLegacyEuEnergyNonRescaledImage() {\n if (utilities_1.EnergyClassParser.parseProduct(this.product)) {\n return (0, web_component_1.html) ` \n\t\t\t\t {\n if (event.key === 'Enter' || event.key === ' ') {\n this.sendModalOpen();\n }\n }}\n\t\t\t\t\t@click=\"${(event) => {\n event.preventDefault();\n event.stopPropagation();\n this.sendModalOpen();\n }}\"\n\t\t\t\t\t.product=\"${this.product}\"\n\t\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t>\n\t\t\t`;\n }\n return null;\n }\n sendModalOpen() {\n this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: {\n visibleModal: EnergyEfficiencyClassModalEnum_1.default.energyLabelCard,\n triggerElement: this.getTriggerElement()\n }\n }));\n }\n getTriggerElement() {\n var _a, _b, _c;\n return (((_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.imageContainer')) !== null && _b !== void 0 ? _b : (_c = this.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('kompis-energy-efficiency-non-rescaled')));\n }\n closeSheet() {\n if (this.sheetElement) {\n this.sheetElement.open = false;\n this.sheetElement = null;\n }\n }\n openSheet() {\n if (this.sheetElement) {\n return;\n }\n const sheetElement = this.createSheetElement();\n this.sheetElement = sheetElement;\n const parent = document.querySelector('kompis-keyboard-injector') || document.body;\n parent.appendChild(sheetElement);\n sheetElement.open = true;\n }\n createSheetElement() {\n const sheetElement = this.createSheet();\n const sheetHeaderElement = this.createSheetHeader();\n const cardElement = this.createCard();\n sheetElement.appendChild(sheetHeaderElement);\n sheetElement.appendChild(cardElement);\n return sheetElement;\n }\n createSheet() {\n const sheetElement = document.createElement('skapa-sheet');\n sheetElement.size = 'small';\n sheetElement.fullHeight = true;\n sheetElement.style.fontFamily = themes_1.FontStyle.getFontFamily(this.theme);\n sheetElement.style.zIndex = '500';\n sheetElement.addEventListener('closerequest', () => {\n if (this.sheetElement) {\n this.dispatchEvent(new CustomEvent('modalClose', {\n bubbles: true,\n detail: {\n visibleModal: null,\n triggerElement: this.getTriggerElement()\n }\n }));\n }\n });\n sheetElement.addEventListener('closed', () => {\n var _a;\n (_a = sheetElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(sheetElement);\n });\n return sheetElement;\n }\n createSheetHeader() {\n const sheetHeaderElement = document.createElement('skapa-modal-header');\n sheetHeaderElement.slot = 'header';\n const headerSpan = document.createElement('span');\n headerSpan.slot = 'closebutton-label';\n headerSpan.innerText = this.getTranslations().modalAriaLabelButtonClose;\n sheetHeaderElement.appendChild(headerSpan);\n return sheetHeaderElement;\n }\n createCard() {\n var _a, _b, _c;\n const cardElement = document.createElement('kompis-energy-label-card');\n cardElement.theme = this.theme;\n cardElement.product = this.product;\n const labelTypes = [\n enums_1.ProductComplianceLabelTypeEnum.euEnergy,\n enums_1.ProductComplianceLabelTypeEnum.usEnergy,\n enums_1.ProductComplianceLabelTypeEnum.chileEnergyCompliance\n ];\n cardElement.labelFilter =\n (_c = (_b = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.complianceLabel) === null || _b === void 0 ? void 0 : _b.filter((label) => labelTypes.includes(label.labelType))) !== null && _c !== void 0 ? _c : null;\n cardElement.localizedInformation = this.localizedInformation;\n cardElement.translations = this.translations;\n if (this.disableLinks) {\n cardElement.disableLinks = true;\n }\n return cardElement;\n }\n /**\n * Returns corresponding alt text for the energy efficiency class image.\n */\n getImageAlt() {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n const complianceLabelType = utilities_1.ProductUtility.getProductComplianceType(this.product);\n switch (complianceLabelType) {\n case enums_1.ProductComplianceTechnicalHeadingTypeEnum.energyEfficiencyClass: {\n const eecObject = (_b = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.complianceTechnical) === null || _b === void 0 ? void 0 : _b.find((obj) => obj.headingType === 'ENERGY_EFFICIENCY_CLASS');\n if (!eecObject) {\n return '';\n }\n const { headingText, text } = eecObject;\n return `${headingText} ${text}`;\n }\n case enums_1.ProductComplianceTechnicalHeadingTypeEnum.hyperlink: {\n return (_f = (_e = (_d = (_c = this.product.content) === null || _c === void 0 ? void 0 : _c.complianceLabel) === null || _d === void 0 ? void 0 : _d.find((obj) => obj.labelType)) === null || _e === void 0 ? void 0 : _e.typeName) !== null && _f !== void 0 ? _f : '';\n }\n case enums_1.ProductComplianceTechnicalHeadingTypeEnum.nonRescaled: {\n const eecObject = (_h = (_g = this.product.content) === null || _g === void 0 ? void 0 : _g.technicalInformation) === null || _h === void 0 ? void 0 : _h.find((obj) => obj.typeCode === '00026');\n if (!eecObject) {\n return '';\n }\n const { typeName, valueMetric } = eecObject;\n return `${typeName} ${valueMetric}`;\n }\n default: {\n return '';\n }\n }\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], EnergyEfficiencyClass.prototype, \"product\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], EnergyEfficiencyClass.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], EnergyEfficiencyClass.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], EnergyEfficiencyClass.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], EnergyEfficiencyClass.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], EnergyEfficiencyClass.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], EnergyEfficiencyClass.prototype, \"visibleModal\", void 0);\nEnergyEfficiencyClass = __decorate([\n (0, web_component_1.customElement)('kompis-energy-efficiency-class')\n], EnergyEfficiencyClass);\nexports.default = EnergyEfficiencyClass;\n//# sourceMappingURL=EnergyEfficiencyClass.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nclass EnergyFicheCardStyle {\n static getStyle() {\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Table.CSS}\n\t\t\t${common_styles_webc_1.Text.CSS}\n\n\t\t\t/* TODO vertical-align is overriding user agent stylesheet, Skapa doesn't expose this yet. */\n\t\t\ttd {\n\t\t\t\tvertical-align: top;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = EnergyFicheCardStyle;\n//# sourceMappingURL=EnergyFicheCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nconst EnergyFicheCardStyle_1 = __importDefault(require(\"./EnergyFicheCardStyle\"));\n/**\n * Data-driven fiche card.\n */\nlet EnergyFicheCard = class EnergyFicheCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n }\n render() {\n const tableClassName = common_styles_webc_1.Table.classnames({ fullWidth: true });\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t${this.getDataRows()}\n\t\t\t\t\n\t\t\t
\n\t\t`;\n }\n /**\n * Retrieves data from complianceTechnical and technicalInformation.\n */\n getDataRows() {\n const complianceTechnicalItems = this.getComplianceTechnical();\n const technicalInformationitems = this.getFilteredTechnicalInformation(complianceTechnicalItems);\n const bodyTextClass = common_styles_webc_1.Text.classnames({ body: { m: true } });\n return [\n ...technicalInformationitems.map(({ typeName, valueMetric, unitMetric = null }) => (0, web_component_1.html) `\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t${typeName}\n\t\t\t\t\t\t\t${unitMetric ? `${valueMetric} ${unitMetric}` : valueMetric}\n\t\t\t\t\t\t\n\t\t\t\t\t`),\n ...complianceTechnicalItems.map(({ headingText, text }) => (0, web_component_1.html) `\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t${headingText}\n\t\t\t\t\t\t\t${text}\n\t\t\t\t\t\t\n\t\t\t\t\t`)\n ];\n }\n /**\n * Retreives all objects in complianceTechnical.\n */\n getComplianceTechnical() {\n var _a, _b, _c;\n return ((_c = (_b = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.complianceTechnical) === null || _b === void 0 ? void 0 : _b.filter((complianceItem) => complianceItem.headingType !== enums_1.ProductComplianceTechnicalHeadingTypeEnum.nonRescaled)) !== null && _c !== void 0 ? _c : []);\n }\n /**\n * Retreives all objects in technicalInformation which are not already present in complianceTechnical.\n *\n * @param complianceTechnicalItems\n */\n getFilteredTechnicalInformation(complianceTechnicalItems) {\n var _a, _b, _c;\n // Uses 'toUpperCase' as typeName could have the value 'Brand name', where headingText have 'Brand Name'\n return ((_c = (_b = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.technicalInformation) === null || _b === void 0 ? void 0 : _b.filter((technicalInformationItem) => !complianceTechnicalItems.some((complianceTechnicalItem) => technicalInformationItem.typeName.toUpperCase() ===\n complianceTechnicalItem.headingText.toUpperCase()))) !== null && _c !== void 0 ? _c : []);\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], EnergyFicheCard.prototype, \"product\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], EnergyFicheCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], EnergyFicheCard.prototype, \"disableLinks\", void 0);\nEnergyFicheCard = __decorate([\n (0, web_component_1.customElement)('kompis-energy-fiche-card')\n], EnergyFicheCard);\nexports.default = EnergyFicheCard;\n//# sourceMappingURL=EnergyFicheCard.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar EprelLinkModalEnum;\n(function (EprelLinkModalEnum) {\n EprelLinkModalEnum[\"energyFicheCard\"] = \"energyFicheCard\";\n})(EprelLinkModalEnum || (EprelLinkModalEnum = {}));\nexports.default = EprelLinkModalEnum;\n//# sourceMappingURL=EprelLinkModalEnum.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst enums_2 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_hyperlink_1 = require(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@ingka/modal-webc\");\nrequire(\"../eprel-qr/EprelQr\");\nrequire(\"../energy-fiche-card/EnergyFicheCard\");\nconst EprelLinkModalEnum_1 = __importDefault(require(\"../../enums/EprelLinkModalEnum\"));\n/**\n * Data-driven information listing.\n *\n * @event modalOpen Triggered when opening energy fiche card\n * @event modalClose Triggered when closing energy fiche card\n */\nlet EprelLink = class EprelLink extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // Visible modal.\n this.visibleModal = null;\n this.sheetElement = null;\n }\n /**\n * @returns Template.\n */\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return this.getLink();\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.closeSheet();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('visibleModal') && this.hasSheetSupport()) {\n if (this.visibleModal === EprelLinkModalEnum_1.default.energyFicheCard) {\n this.openSheet();\n }\n else {\n this.closeSheet();\n }\n }\n if (changedProperties.has('product')) {\n if (!this.hasSheetSupport) {\n this.closeSheet();\n }\n }\n return true;\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n /**\n * If eprel link has support for opening a fiche card or eprel qr.\n */\n hasSheetSupport() {\n const link = utilities_1.ProductUtility.getProductInformationSheetLink(this.product);\n return (link === null && !!this.getFicheHeader()) || (link !== null && this.disableLinks);\n }\n /**\n * Retrieves eprel link and handles.\n */\n getLink() {\n var _a;\n const link = utilities_1.ProductUtility.getProductInformationSheetLink(this.product);\n if (link === null && !this.getFicheHeader()) {\n return null;\n }\n else if (link === null) {\n // Non-rescaled\n return (0, web_component_1.html) `\n\t\t\t\t\n\t\t\t\t\t {\n event.preventDefault();\n this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: { visibleModal: EprelLinkModalEnum_1.default.energyFicheCard }\n }));\n }}\"\n\t\t\t\t\t>\n\t\t\t\t\n\t\t\t`;\n }\n else if (this.disableLinks) {\n return (0, web_component_1.html) `\n\t\t\t\t\n\t\t\t\t\t {\n event.preventDefault();\n this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: { visibleModal: EprelLinkModalEnum_1.default.energyFicheCard }\n }));\n }}\"\n\t\t\t\t\t>\n\t\t\t\t\n\t\t\t`;\n }\n else {\n return (0, web_component_1.html) `\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t`;\n }\n }\n /**\n * Return Fiche header if exists.\n */\n getFicheHeader() {\n var _a, _b, _c, _d;\n return ((_d = (_c = (_b = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.complianceTechnical) === null || _b === void 0 ? void 0 : _b.find((info) => info.headingType === enums_1.ProductComplianceTechnicalHeadingTypeEnum.nonRescaled)) === null || _c === void 0 ? void 0 : _c.headingText) !== null && _d !== void 0 ? _d : null);\n }\n closeSheet() {\n if (this.sheetElement) {\n this.sheetElement.open = false;\n this.sheetElement = null;\n }\n }\n openSheet() {\n if (this.sheetElement) {\n return;\n }\n const sheetElement = this.createSheetElement();\n this.sheetElement = sheetElement;\n const parent = document.querySelector('kompis-keyboard-injector') || document.body;\n parent.appendChild(sheetElement);\n sheetElement.open = true;\n }\n createSheetElement() {\n const sheetElement = this.createSheet();\n const sheetHeaderElement = this.createSheetHeader();\n const cardElement = this.createCard();\n sheetElement.appendChild(sheetHeaderElement);\n sheetElement.appendChild(cardElement);\n return sheetElement;\n }\n createSheet() {\n const sheetElement = document.createElement('skapa-sheet');\n sheetElement.size = 'small';\n sheetElement.fullHeight = true;\n sheetElement.style.fontFamily = themes_1.FontStyle.getFontFamily(this.theme);\n sheetElement.style.zIndex = '500';\n sheetElement.addEventListener('closerequest', () => {\n if (this.sheetElement) {\n this.dispatchEvent(new CustomEvent('modalClose', {\n bubbles: true,\n detail: {\n visibleModal: null\n }\n }));\n }\n });\n sheetElement.addEventListener('closed', () => {\n var _a;\n (_a = sheetElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(sheetElement);\n });\n return sheetElement;\n }\n createSheetHeader() {\n const sheetHeaderElement = document.createElement('skapa-modal-header');\n sheetHeaderElement.slot = 'header';\n const headerSpan = document.createElement('span');\n headerSpan.slot = 'closebutton-label';\n headerSpan.innerText = this.getTranslations().modalAriaLabelButtonClose;\n sheetHeaderElement.appendChild(headerSpan);\n return sheetHeaderElement;\n }\n createCard() {\n const link = utilities_1.ProductUtility.getProductInformationSheetLink(this.product);\n if (link === null) {\n const element = document.createElement('kompis-energy-fiche-card');\n element.theme = this.theme;\n element.product = this.product;\n return element;\n }\n else {\n const element = document.createElement('kompis-eprel-qr');\n element.theme = this.theme;\n element.localizedInformation = this.localizedInformation;\n element.translations = this.translations;\n element.product = this.product;\n return element;\n }\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], EprelLink.prototype, \"product\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], EprelLink.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], EprelLink.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], EprelLink.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], EprelLink.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], EprelLink.prototype, \"visibleModal\", void 0);\nEprelLink = __decorate([\n (0, web_component_1.customElement)('kompis-eprel-link')\n], EprelLink);\nexports.default = EprelLink;\n//# sourceMappingURL=EprelLink.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ChileSecLinkModalEnum;\n(function (ChileSecLinkModalEnum) {\n ChileSecLinkModalEnum[\"energySecCard\"] = \"energySecCard\";\n})(ChileSecLinkModalEnum || (ChileSecLinkModalEnum = {}));\nexports.default = ChileSecLinkModalEnum;\n//# sourceMappingURL=ChileSecLinkModalEnum.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst component_hyperlink_1 = require(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@ingka/modal-webc\");\nrequire(\"../energy-label-card/EnergyLabelCard\");\nconst ChileSecLinkModalEnum_1 = __importDefault(require(\"../../enums/ChileSecLinkModalEnum\"));\n/**\n * Data-driven information listing.\n *\n * @event modalOpen Triggered when opening energy Sec card\n * @event modalClose Triggered when closing energy Sec card\n */\nlet SecLink = class SecLink extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // Visible modal.\n this.visibleModal = null;\n this.sheetElement = null;\n }\n /**\n * @returns Template.\n */\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return this.getLink();\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.closeSheet();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('visibleModal')) {\n if (this.visibleModal) {\n this.openSheet();\n }\n else {\n this.closeSheet();\n }\n }\n return true;\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n /**\n * Retrieves Sec link and handles.\n */\n getLink() {\n var _a, _b, _c, _d, _e, _f, _g;\n const secLabels = (_b = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.complianceLabel) === null || _b === void 0 ? void 0 : _b.filter((complianceLabelItem) => complianceLabelItem.labelType === enums_1.ProductComplianceLabelTypeEnum.chileSecLabel);\n const secText = (_e = (_d = (_c = this.product.content) === null || _c === void 0 ? void 0 : _c.complianceTechnical) === null || _d === void 0 ? void 0 : _d.find((complianceLabelItem) => complianceLabelItem.headingType === enums_1.ProductComplianceTechnicalHeadingTypeEnum.hyperlink &&\n complianceLabelItem.text === 'SEC')) === null || _e === void 0 ? void 0 : _e.text;\n if (secLabels != null && secLabels.length) {\n return (0, web_component_1.html) ` \n\t\t\t\t {\n event.preventDefault();\n this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: {\n visibleModal: ChileSecLinkModalEnum_1.default.energySecCard,\n triggerElement: this.getTriggerElement()\n }\n }));\n }}\"\n\t\t\t\t>\n\t\t\t`;\n }\n return null;\n }\n getTriggerElement() {\n var _a, _b, _c;\n return ((_c = (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('kompis-hyperlink')) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('kompis-focus-outline > a'));\n }\n closeSheet() {\n if (this.sheetElement) {\n this.sheetElement.open = false;\n this.sheetElement = null;\n }\n }\n openSheet() {\n if (this.sheetElement) {\n return;\n }\n const sheetElement = this.createSheetElement();\n this.sheetElement = sheetElement;\n const parent = document.querySelector('kompis-keyboard-injector') || document.body;\n parent.appendChild(sheetElement);\n sheetElement.open = true;\n }\n createSheetElement() {\n const sheetElement = this.createSheet();\n const sheetHeaderElement = this.createSheetHeader();\n const cardElement = this.createCard();\n sheetElement.appendChild(sheetHeaderElement);\n sheetElement.appendChild(cardElement);\n return sheetElement;\n }\n createSheet() {\n const sheetElement = document.createElement('skapa-sheet');\n sheetElement.size = 'small';\n sheetElement.fullHeight = true;\n sheetElement.style.fontFamily = themes_1.FontStyle.getFontFamily(this.theme);\n sheetElement.style.zIndex = '500';\n sheetElement.addEventListener('closerequest', () => {\n if (this.sheetElement) {\n this.dispatchEvent(new CustomEvent('modalClose', {\n bubbles: true,\n detail: {\n visibleModal: null,\n triggerElement: this.getTriggerElement()\n }\n }));\n }\n });\n sheetElement.addEventListener('closed', () => {\n var _a;\n (_a = sheetElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(sheetElement);\n });\n return sheetElement;\n }\n createSheetHeader() {\n const sheetHeaderElement = document.createElement('skapa-modal-header');\n sheetHeaderElement.slot = 'header';\n const headerSpan = document.createElement('span');\n headerSpan.slot = 'closebutton-label';\n headerSpan.innerText = this.getTranslations().modalAriaLabelButtonClose;\n sheetHeaderElement.appendChild(headerSpan);\n return sheetHeaderElement;\n }\n createCard() {\n var _a, _b, _c;\n const cardElement = document.createElement('kompis-energy-label-card');\n cardElement.theme = this.theme;\n cardElement.product = this.product;\n cardElement.labelFilter =\n (_c = (_b = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.complianceLabel) === null || _b === void 0 ? void 0 : _b.filter((label) => label.labelType === enums_1.ProductComplianceLabelTypeEnum.chileSecLabel)) !== null && _c !== void 0 ? _c : null;\n cardElement.localizedInformation = this.localizedInformation;\n cardElement.translations = this.translations;\n if (this.disableLinks) {\n cardElement.disableLinks = true;\n }\n return cardElement;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SecLink.prototype, \"product\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SecLink.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SecLink.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SecLink.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SecLink.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SecLink.prototype, \"visibleModal\", void 0);\nSecLink = __decorate([\n (0, web_component_1.customElement)('kompis-sec-link')\n], SecLink);\nexports.default = SecLink;\n//# sourceMappingURL=SecLink.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SecLink = exports.EprelQrToggle = exports.EprelQr = exports.EprelLinkModalEnum = exports.EprelLink = exports.EnergyLabelCard = exports.EnergyFicheCard = exports.EnergyEfficiencyClassModalEnum = exports.EnergyEfficiencyClassMediaEnum = exports.EnergyEfficiencyClass = exports.ChileSecLinkModalEnum = void 0;\nconst EnergyEfficiencyClass_1 = __importDefault(require(\"./components/energy-efficiency-class/EnergyEfficiencyClass\"));\nexports.EnergyEfficiencyClass = EnergyEfficiencyClass_1.default;\nconst EnergyFicheCard_1 = __importDefault(require(\"./components/energy-fiche-card/EnergyFicheCard\"));\nexports.EnergyFicheCard = EnergyFicheCard_1.default;\nconst EnergyLabelCard_1 = __importDefault(require(\"./components/energy-label-card/EnergyLabelCard\"));\nexports.EnergyLabelCard = EnergyLabelCard_1.default;\nconst EprelLink_1 = __importDefault(require(\"./components/eprel-link/EprelLink\"));\nexports.EprelLink = EprelLink_1.default;\nconst EprelQr_1 = __importDefault(require(\"./components/eprel-qr/EprelQr\"));\nexports.EprelQr = EprelQr_1.default;\nconst EprelQrToggle_1 = __importDefault(require(\"./components/eprel-qr-toggle/EprelQrToggle\"));\nexports.EprelQrToggle = EprelQrToggle_1.default;\nconst SecLink_1 = __importDefault(require(\"./components/sec-link/SecLink\"));\nexports.SecLink = SecLink_1.default;\nconst ChileSecLinkModalEnum_1 = __importDefault(require(\"./enums/ChileSecLinkModalEnum\"));\nexports.ChileSecLinkModalEnum = ChileSecLinkModalEnum_1.default;\nconst EnergyEfficiencyClassMediaEnum_1 = __importDefault(require(\"./enums/EnergyEfficiencyClassMediaEnum\"));\nexports.EnergyEfficiencyClassMediaEnum = EnergyEfficiencyClassMediaEnum_1.default;\nconst EnergyEfficiencyClassModalEnum_1 = __importDefault(require(\"./enums/EnergyEfficiencyClassModalEnum\"));\nexports.EnergyEfficiencyClassModalEnum = EnergyEfficiencyClassModalEnum_1.default;\nconst EprelLinkModalEnum_1 = __importDefault(require(\"./enums/EprelLinkModalEnum\"));\nexports.EprelLinkModalEnum = EprelLinkModalEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass WaterLabelCardStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.theme\n * @returns Styles.\n */\n static getStyle(options) {\n return (0, web_component_1.css) `\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\t\t\t.labels {\n\t\t\t\tflex-wrap: wrap;\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t\timg {\n\t\t\t\toutline: none;\n\t\t\t\twidth: 90%;\n\t\t\t}\n\t\t\t.labels > * {\n\t\t\t\tmargin: ${options.theme.spacing.space50 / 16}rem;\n\t\t\t\toverflow: hidden;\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = WaterLabelCardStyle;\n//# sourceMappingURL=WaterLabelCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst WaterLabelCardStyle_1 = __importDefault(require(\"./WaterLabelCardStyle\"));\nconst LABEL_FILE_TYPE = 'svg';\n/* eslint-disable lit-a11y/alt-text */\n/**\n * Data-driven information listing.\n */\nlet WaterLabelCard = class WaterLabelCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated (never used).\n this.localizedInformation = null;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n }\n /**\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
${this.getCard()}
\n\t\t`;\n }\n getCard() {\n return (0, web_component_1.html) `
${this.getLabels()}
`;\n }\n getLabels() {\n return this.getLabelUrls().map((url) => (0, web_component_1.html) `\"${this.getImageAlt()}\"`);\n }\n /**\n * Return url to the label SVGs.\n */\n getLabelUrls() {\n var _a, _b;\n if ((_b = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.complianceLabel) === null || _b === void 0 ? void 0 : _b.length) {\n return this.product.content.complianceLabel\n .filter((obj) => obj.fileType === LABEL_FILE_TYPE)\n .map((obj) => obj.url);\n }\n return [];\n }\n /**\n * Returns corresponding text to the water efficiency class image.\n */\n getImageAlt() {\n var _a, _b, _c;\n const complianceType = utilities_1.ProductUtility.getProductComplianceType(this.product);\n switch (complianceType) {\n case enums_1.ProductComplianceTechnicalHeadingTypeEnum.unifiedWaterLabel: {\n const eecObject = (_b = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.complianceTechnical) === null || _b === void 0 ? void 0 : _b.find((obj) => obj.headingType === complianceType);\n const { headingText, text } = eecObject !== null && eecObject !== void 0 ? eecObject : {};\n return (_c = `${headingText} ${text}`) !== null && _c !== void 0 ? _c : '';\n }\n default:\n return '';\n }\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], WaterLabelCard.prototype, \"product\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], WaterLabelCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], WaterLabelCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], WaterLabelCard.prototype, \"disableLinks\", void 0);\nWaterLabelCard = __decorate([\n (0, web_component_1.customElement)('kompis-water-label-card')\n], WaterLabelCard);\nexports.default = WaterLabelCard;\n//# sourceMappingURL=WaterLabelCard.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar WaterEfficiencyClassMediaEnum;\n(function (WaterEfficiencyClassMediaEnum) {\n WaterEfficiencyClassMediaEnum[\"svg\"] = \"00017\";\n WaterEfficiencyClassMediaEnum[\"jpeg\"] = \"00001\";\n})(WaterEfficiencyClassMediaEnum || (WaterEfficiencyClassMediaEnum = {}));\nexports.default = WaterEfficiencyClassMediaEnum;\n//# sourceMappingURL=WaterEfficiencyClassMediaEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar WaterEfficiencyClassModalEnum;\n(function (WaterEfficiencyClassModalEnum) {\n WaterEfficiencyClassModalEnum[\"waterLabelCard\"] = \"waterLabelCard\";\n})(WaterEfficiencyClassModalEnum || (WaterEfficiencyClassModalEnum = {}));\nexports.default = WaterEfficiencyClassModalEnum;\n//# sourceMappingURL=WaterEfficiencyClassModalEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst LABEL_WIDTH = 64;\nclass WaterEfficiencyClassStyle {\n static getStyle() {\n return (0, web_component_1.css) `\n\t\t\t:host,\n\t\t\tkompis-focus-outline {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\timg {\n\t\t\t\tcursor: pointer;\n\t\t\t\twidth: ${LABEL_WIDTH / 16}rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t\toutline: none;\n\t\t\t}\n\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t}\n\n\t\t\tkompis-text {\n\t\t\t\tmargin: 2rem;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = WaterEfficiencyClassStyle;\n//# sourceMappingURL=WaterEfficiencyClassStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@inter-ikea-kompis/component-focus-outline\");\nrequire(\"@ingka/modal-webc\");\nrequire(\"../water-label-card/WaterLabelCard\");\nconst WaterEfficiencyClassMediaEnum_1 = __importDefault(require(\"../../enums/WaterEfficiencyClassMediaEnum\"));\nconst WaterEfficiencyClassModalEnum_1 = __importDefault(require(\"../../enums/WaterEfficiencyClassModalEnum\"));\nconst WaterEfficiencyClassStyle_1 = __importDefault(require(\"./WaterEfficiencyClassStyle\"));\n/* eslint-disable lit-a11y/alt-text */\n/**\n * Water Efficiency Class component.\n *\n * @event modalOpen Triggered when opening a modal\n * @event modalClose Triggered when closing a modal\n */\nlet WaterEfficiencyClass = class WaterEfficiencyClass extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // Visible modal.\n this.visibleModal = null;\n this.sheetElement = null;\n }\n /**\n * Renders the water label.\n */\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return this.getWaterImages();\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.closeSheet();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('visibleModal')) {\n if (this.visibleModal) {\n this.openSheet();\n }\n else {\n this.closeSheet();\n }\n }\n return true;\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n getWaterImages() {\n const imageUrl = this.getImageUrl();\n if (imageUrl !== null) {\n return this.showWaterImage(imageUrl);\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n }\n /**\n * Extract image URL from product.\n */\n getImageUrl() {\n var _a, _b, _c;\n const waterEfficiencyClass = (_b = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.complianceTechnical) === null || _b === void 0 ? void 0 : _b.find((complianceTechnicalItem) => complianceTechnicalItem.headingType ===\n enums_1.ProductComplianceTechnicalHeadingTypeEnum.unifiedWaterLabel);\n if (!waterEfficiencyClass) {\n return null;\n }\n const find = (fileTypeCode) => {\n var _a, _b;\n return (((_b = (_a = waterEfficiencyClass.media) === null || _a === void 0 ? void 0 : _a.find((mediaType) => mediaType.fileTypeCode === fileTypeCode)) === null || _b === void 0 ? void 0 : _b.url) || '');\n };\n const url = (_c = find(WaterEfficiencyClassMediaEnum_1.default.svg)) !== null && _c !== void 0 ? _c : find(WaterEfficiencyClassMediaEnum_1.default.jpeg);\n return url || null;\n }\n /**\n * Renders the water label image.\n *\n * @param imageUrl\n */\n showWaterImage(imageUrl) {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t\t\t {\n if (event.key === 'Enter' || event.key === ' ') {\n this.sendModalOpen();\n }\n }}\n\t\t\t\t\t@click=\"${(event) => {\n event.preventDefault();\n event.stopPropagation();\n this.sendModalOpen();\n }}\"\n\t\t\t\t\tsrc=\"${imageUrl}\"\n\t\t\t\t/>\n\t\t\t\n\t\t`;\n }\n sendModalOpen() {\n const triggerElement = this.queryTriggerElement();\n this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: { visibleModal: WaterEfficiencyClassModalEnum_1.default.waterLabelCard, triggerElement }\n }));\n }\n closeSheet() {\n if (this.sheetElement) {\n this.sheetElement.open = false;\n this.sheetElement = null;\n }\n }\n openSheet() {\n if (this.sheetElement) {\n return;\n }\n const sheetElement = this.createSheetElement();\n this.sheetElement = sheetElement;\n const parent = document.querySelector('kompis-keyboard-injector') || document.body;\n parent.appendChild(sheetElement);\n sheetElement.open = true;\n }\n createSheetElement() {\n const sheetElement = this.createSheet();\n const sheetHeaderElement = this.createSheetHeader();\n const cardElement = this.createCard();\n sheetElement.appendChild(sheetHeaderElement);\n sheetElement.appendChild(cardElement);\n return sheetElement;\n }\n createSheet() {\n const sheetElement = document.createElement('skapa-sheet');\n sheetElement.size = 'small';\n sheetElement.fullHeight = true;\n sheetElement.style.fontFamily = themes_1.FontStyle.getFontFamily(this.theme);\n sheetElement.style.zIndex = '500';\n sheetElement.addEventListener('closerequest', () => {\n if (this.sheetElement) {\n this.dispatchEvent(new CustomEvent('modalClose', {\n bubbles: true,\n detail: {\n visibleModal: null,\n triggerElement: this.queryTriggerElement()\n }\n }));\n }\n });\n sheetElement.addEventListener('closed', () => {\n var _a;\n (_a = sheetElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(sheetElement);\n });\n return sheetElement;\n }\n createSheetHeader() {\n const sheetHeaderElement = document.createElement('skapa-modal-header');\n sheetHeaderElement.slot = 'header';\n const headerSpan = document.createElement('span');\n headerSpan.slot = 'closebutton-label';\n headerSpan.innerText = this.getTranslations().modalAriaLabelButtonClose;\n sheetHeaderElement.appendChild(headerSpan);\n return sheetHeaderElement;\n }\n createCard() {\n const cardElement = document.createElement('kompis-water-label-card');\n cardElement.theme = this.theme;\n cardElement.product = this.product;\n cardElement.localizedInformation = this.localizedInformation;\n return cardElement;\n }\n queryTriggerElement() {\n var _a;\n return (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('img');\n }\n /**\n * Returns corresponding text to the water efficiency class image.\n */\n getImageAlt() {\n var _a, _b, _c;\n const complianceType = utilities_1.ProductUtility.getProductComplianceType(this.product);\n switch (complianceType) {\n case enums_1.ProductComplianceTechnicalHeadingTypeEnum.unifiedWaterLabel: {\n const eecObject = (_b = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.complianceTechnical) === null || _b === void 0 ? void 0 : _b.find((obj) => obj.headingType === complianceType);\n const { headingText, text } = eecObject || {};\n return (_c = `${headingText} ${text}`) !== null && _c !== void 0 ? _c : '';\n }\n default:\n return '';\n }\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], WaterEfficiencyClass.prototype, \"product\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], WaterEfficiencyClass.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], WaterEfficiencyClass.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], WaterEfficiencyClass.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], WaterEfficiencyClass.prototype, \"visibleModal\", void 0);\nWaterEfficiencyClass = __decorate([\n (0, web_component_1.customElement)('kompis-water-efficiency-class')\n], WaterEfficiencyClass);\nexports.default = WaterEfficiencyClass;\n//# sourceMappingURL=WaterEfficiencyClass.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WaterLabelCard = exports.WaterEfficiencyClassModalEnum = exports.WaterEfficiencyClassMediaEnum = exports.WaterEfficiencyClass = void 0;\nconst WaterEfficiencyClass_1 = __importDefault(require(\"./components/water-efficiency-class/WaterEfficiencyClass\"));\nexports.WaterEfficiencyClass = WaterEfficiencyClass_1.default;\nconst WaterLabelCard_1 = __importDefault(require(\"./components/water-label-card/WaterLabelCard\"));\nexports.WaterLabelCard = WaterLabelCard_1.default;\nconst WaterEfficiencyClassMediaEnum_1 = __importDefault(require(\"./enums/WaterEfficiencyClassMediaEnum\"));\nexports.WaterEfficiencyClassMediaEnum = WaterEfficiencyClassMediaEnum_1.default;\nconst WaterEfficiencyClassModalEnum_1 = __importDefault(require(\"./enums/WaterEfficiencyClassModalEnum\"));\nexports.WaterEfficiencyClassModalEnum = WaterEfficiencyClassModalEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar VerticalAlignmentEnum;\n(function (VerticalAlignmentEnum) {\n VerticalAlignmentEnum[\"base\"] = \"base\";\n VerticalAlignmentEnum[\"super\"] = \"super\";\n})(VerticalAlignmentEnum || (VerticalAlignmentEnum = {}));\nexports.default = VerticalAlignmentEnum;\n//# sourceMappingURL=VerticalAlignmentEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst VerticalAlignmentEnum_1 = __importDefault(require(\"../../enums/VerticalAlignmentEnum\"));\nclass PriceFormatterStyle {\n /**\n * Returns styles.\n *\n * @param options\n */\n static getStyle(options) {\n var _a;\n return (0, web_component_1.css) `\n\t\t\t${(_a = this.getMixedSizeStyle(options)) !== null && _a !== void 0 ? _a : ''}\n\t\t\t.currencySpacing {\n\t\t\t\twidth: ${options.mixedSize ? '0.12em' : '0.06em'};\n\t\t\t}\n\t\t\t.price {\n\t\t\t\tdisplay: flex;\n\t\t\t\ttext-decoration: ${options.strikeThrough ? 'line-through' : 'initial'};\n\t\t\t}\n\t\t\t.visuallyHidden:not(:focus):not(:active) {\n\t\t\t\tclip: rect(0 0 0 0);\n\t\t\t\tclip-path: inset(50%);\n\t\t\t\theight: ${1 / 16}rem;\n\t\t\t\toverflow: hidden;\n\t\t\t\tposition: absolute;\n\t\t\t\twhite-space: nowrap;\n\t\t\t\twidth: ${1 / 16}rem;\n\t\t\t}\n\t\t`;\n }\n /**\n * @param options\n */\n static getMixedSizeStyle(options) {\n if (!options.mixedSize) {\n return null;\n }\n return (0, web_component_1.css) `\n\t\t\t.currency,\n\t\t\t.spacing,\n\t\t\t.decimalPart {\n\t\t\t\tposition: relative;\n\t\t\t\tfont-size: 0.6em;\n\t\t\t}\n\t\t\t.currency {\n\t\t\t\tbottom: ${options.currencyVerticalAlignment === VerticalAlignmentEnum_1.default.super\n ? '0.2em'\n : '-0.26em'};\n\t\t\t}\n\t\t\t.decimalPart {\n\t\t\t\tbottom: ${options.decimalVerticalAlignment === VerticalAlignmentEnum_1.default.super\n ? '0.2em'\n : '-0.26em'};\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = PriceFormatterStyle;\n//# sourceMappingURL=PriceFormatterStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst utilities_2 = require(\"@inter-ikea-kompis/utilities\");\nconst PriceFormatterStyle_1 = __importDefault(require(\"./PriceFormatterStyle\"));\n/**\n * Price View component that formats price.\n */\nlet PriceFormatter = class PriceFormatter extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"settings\" instead.\n this.localizedInformation = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Mixed sizes.\n this.mixedSize = false;\n // Strikethrough.\n this.strikeThrough = false;\n // Set price to be animated\n this.animated = false;\n // Label used to describe the price Example: Regular price.\n this.ariaLabelPrice = null;\n // Overrides the currencySymbol in the Price Settings of DEXF settings. Used in PriceModule when dual currencies are provided where DEXF settings keys such as currencySymbolAlt and currencyCodeAlt are taken into consideration.\n this.currencySymbol = null;\n this.animation = null;\n this.animatedAmount = 0;\n this.dexfSettings = null;\n }\n render() {\n // We want settings to be required, but since both props to provide settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n const settings = this.getSettings();\n const { localisation, kompis: { priceSettings } } = settings;\n if (this.currencySymbol) {\n localisation.currencySymbol = this.currencySymbol;\n }\n const items = utilities_1.PriceFormatter.format(this.animatedAmount || 0, settings);\n const currencySymbol = this.currencySymbol === priceSettings.currencySymbolAlt\n ? priceSettings.currencyCodeAlt\n : localisation.currencyCode;\n const parts = [];\n const srText = items\n .filter(({ type }) => type !== 'currency')\n .map(({ value }) => value)\n .join('') + currencySymbol;\n for (let i = 0; i < items.length; i++) {\n if (i !== 0 && items[i].type === 'currency') {\n parts.push((0, web_component_1.html) ``);\n }\n parts.push((0, web_component_1.html) `${this.handleBreakingSpace(items[i])}`);\n if (i === 0 && items[i].type === 'currency') {\n parts.push((0, web_component_1.html) ``);\n }\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t${parts}\n\t\t\t\t\n\t\t\t\t\t${this.ariaLabelPrice ? this.ariaLabelPrice + ' ' + srText : srText}\n\t\t\t\t\n\t\t\t
\n\t\t`;\n }\n /**\n * Triggered when the component is removed from DOM.\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n if (this.animation) {\n this.animation.stop();\n this.animation = null;\n }\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('amount') || changedProperties.has('animated')) {\n const animate = this.animated && this.hasAnimationSupport();\n if (animate) {\n this.startAnimation();\n }\n else {\n if (this.animation) {\n this.animation.stop();\n this.animation = null;\n }\n this.animatedAmount = this.amount || 0;\n }\n }\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = (utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation));\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = {\n kompis: this.settings.kompis,\n localisation: Object.assign({}, this.settings.localisation)\n };\n }\n return true;\n }\n hasSettings() {\n return !!this.dexfSettings || !!this.localizedInformation;\n }\n getSettings() {\n return this.dexfSettings;\n }\n /**\n * Replace ' ' with   to avoid RTL issues.\n *\n * @param text\n * @param priceFormat\n */\n handleBreakingSpace(priceFormat) {\n return this.addOddIndexes(priceFormat.value.split(' '), (0, web_component_1.html) ` `).filter((value) => value !== '');\n }\n /**\n * Adds something between all elements in a string array. Similar to Array.prototype.join().\n *\n * @param list\n * @param value\n */\n addOddIndexes(list, value) {\n if (list.length === 0) {\n return [value];\n }\n if (list.length === 1) {\n return list;\n }\n const newList = [];\n for (let index = 0; index < list.length; index++) {\n newList.push(list[index]);\n if (index !== list.length - 1) {\n newList.push(value);\n }\n }\n return newList;\n }\n /**\n * Resets and start animation this.__animation.\n */\n startAnimation() {\n const newAnimation = this.getAnimation();\n newAnimation.startValue = this.animatedAmount;\n newAnimation.endValue = this.amount || 0;\n newAnimation.start();\n if (this.animation) {\n this.animation.stop();\n }\n this.animation = newAnimation;\n }\n /**\n * Checks if the device has JavaScript animation support.\n * IOS9 and less runs animations very slow so therefore it will considered as not having support.\n *\n * @returns TRUE if the device has animation support.\n */\n hasAnimationSupport() {\n const regexp = /(iPhone|iPad)*CPU OS ([0-9]+)_/;\n const match = navigator.userAgent.match(regexp);\n const iosVersion = match && match.length > 2 ? parseFloat(match[2]) : null;\n return iosVersion === null || iosVersion > 9;\n }\n /**\n * Creates Animation.\n *\n * @returns An animation object.\n */\n getAnimation() {\n const animation = new utilities_2.EasingAnimation();\n animation.on('frame', (amount) => {\n this.animatedAmount = amount;\n this.requestUpdate();\n });\n animation.on('end', () => {\n this.animatedAmount = this.amount || 0;\n this.animation = null;\n this.requestUpdate();\n });\n return animation;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], PriceFormatter.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], PriceFormatter.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PriceFormatter.prototype, \"mixedSize\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PriceFormatter.prototype, \"strikeThrough\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PriceFormatter.prototype, \"animated\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], PriceFormatter.prototype, \"ariaLabelPrice\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number, required: true })\n], PriceFormatter.prototype, \"amount\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], PriceFormatter.prototype, \"currencySymbol\", void 0);\nPriceFormatter = __decorate([\n (0, web_component_1.customElement)('kompis-price-formatter')\n], PriceFormatter);\nexports.default = PriceFormatter;\n//# sourceMappingURL=PriceFormatter.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VerticalAlignmentEnum = exports.PriceFormatter = void 0;\nconst PriceFormatter_1 = __importDefault(require(\"./components/price-formatter/PriceFormatter\"));\nexports.PriceFormatter = PriceFormatter_1.default;\nconst VerticalAlignmentEnum_1 = __importDefault(require(\"./enums/VerticalAlignmentEnum\"));\nexports.VerticalAlignmentEnum = VerticalAlignmentEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nclass EcoFeeCardStyle {\n static getStyle(options) {\n const { color, spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\n\t\t\th4 {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t.headline:not(:first-child) {\n\t\t\t\tmargin-top: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.headline {\n\t\t\t\tmargin-bottom: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\n\t\t\t.link {\n\t\t\t\tmargin-top: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.details > *:not(:first-child) {\n\t\t\t\tmargin-top: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.details {\n\t\t\t\tmargin-top: ${spacing.space250 / 16}rem;\n\t\t\t}\n\n\t\t\t.row {\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: space-between;\n\t\t\t}\n\n\t\t\t.line {\n\t\t\t\theight: ${1 / 16}rem;\n\t\t\t\tbackground-color: ${color.border.light};\n\t\t\t}\n\n\t\t\t.no-margin {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = EcoFeeCardStyle;\n//# sourceMappingURL=EcoFeeCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_hyperlink_1 = require(\"@inter-ikea-kompis/component-hyperlink\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@inter-ikea-kompis/component-price-formatter\");\nrequire(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@inter-ikea-kompis/component-text\");\nconst EcoFeeCardStyle_1 = __importDefault(require(\"./EcoFeeCardStyle\"));\n/**\n * Eco fee card component.\n */\nlet EcoFeeCard = class EcoFeeCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Accepts a object format corresponding to { ShoppingProduct } from '@inter-ikea-kompis/types';\n this.totalPrice = null;\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n this.dexfSettings = null;\n }\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n if (!this.totalPrice || !this.getSettings().kompis.localization.hasEcoPart) {\n return null;\n }\n const translations = this.getTranslations();\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t
\n\t\t\t\t${this.getEcoText(translations)} ${this.getElectronicEcoText(translations)}\n\t\t\t\t${this.getLink()}\n\n\t\t\t\t
\n\t\t\t\t\t${this.getEcoExcludingTaxPrice(translations)} ${this.getEcoPrice(translations)}\n\t\t\t\t\t${this.getWeeePrice(translations)}\n\t\t\t\t\t
\n\t\t\t\t\t${this.getEcoTotalPrice(translations)}\n\t\t\t\t
\n\t\t\t
\n\t\t`;\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getSettings() {\n return this.dexfSettings;\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n getEcoText(translations) {\n var _a;\n if (!((_a = this.totalPrice) === null || _a === void 0 ? void 0 : _a.ecoPrice)) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t

\n\t\t\t\t${translations.ecoTextHeadline}\n\t\t\t

\n\t\t\t

\n\t\t\t\t${translations.ecoText}\n\t\t\t

\n\t\t`;\n }\n getElectronicEcoText(translations) {\n var _a;\n if (!((_a = this.totalPrice) === null || _a === void 0 ? void 0 : _a.weeePrice)) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t

\n\t\t\t\t${translations.ecoHeadlineElectronics}\n\t\t\t

\n\t\t\t

\n\t\t\t\t${translations.ecoTextElectronics}\n\t\t\t

\n\t\t`;\n }\n getLink() {\n const ecoLinkText = this.getTranslations().ecoLinkText;\n const urls = this.getSettings().kompis.urls;\n if (this.disableLinks || !urls.ecoLinkURL) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n getEcoExcludingTaxPrice(translations) {\n if (!this.totalPrice) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t${translations.ecoPriceExcluding}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t`;\n }\n getEcoPrice(translations) {\n var _a;\n if (!((_a = this.totalPrice) === null || _a === void 0 ? void 0 : _a.ecoPrice)) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t${translations.ecoPrice}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t`;\n }\n getWeeePrice(translations) {\n var _a;\n if (!((_a = this.totalPrice) === null || _a === void 0 ? void 0 : _a.weeePrice)) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t${translations.ecoHeadlineElectronics}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t`;\n }\n getEcoTotalPrice(translations) {\n var _a;\n if (!((_a = this.totalPrice) === null || _a === void 0 ? void 0 : _a.inclTax)) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t${translations.ecoPriceTotal}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t`;\n }\n /**\n * Calculates price for eco & weee price, weee price or eco price.\n *\n * @param totalPrice The non-null total price property.\n * @returns Price.\n */\n getPrice(totalPrice) {\n if (totalPrice.ecoPrice && totalPrice.weeePrice) {\n return totalPrice.inclTax - totalPrice.ecoPrice - totalPrice.weeePrice; // Weee and eco price\n }\n if (totalPrice.weeePrice) {\n return totalPrice.inclTax - totalPrice.weeePrice; // Weee price\n }\n return totalPrice.inclTax - totalPrice.ecoPrice; // Eco price\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], EcoFeeCard.prototype, \"totalPrice\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], EcoFeeCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], EcoFeeCard.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], EcoFeeCard.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], EcoFeeCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], EcoFeeCard.prototype, \"disableLinks\", void 0);\nEcoFeeCard = __decorate([\n (0, web_component_1.customElement)('kompis-eco-fee-card')\n], EcoFeeCard);\nexports.default = EcoFeeCard;\n//# sourceMappingURL=EcoFeeCard.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar EcoFeeModalEnum;\n(function (EcoFeeModalEnum) {\n EcoFeeModalEnum[\"ecoFeeCard\"] = \"ecoFeeCard\";\n})(EcoFeeModalEnum || (EcoFeeModalEnum = {}));\nexports.default = EcoFeeModalEnum;\n//# sourceMappingURL=EcoFeeModalEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass EcoFeeStyle {\n static getStyle(options) {\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\t.link {\n\t\t\t\tcursor: pointer;\n\t\t\t\toutline: none;\n\t\t\t\ttext-decoration: underline;\n\t\t\t\tcolor: ${options.theme.color.text.default};\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = EcoFeeStyle;\n//# sourceMappingURL=EcoFeeStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@ingka/modal-webc\");\nrequire(\"../eco-fee-card/EcoFeeCard\");\nconst EcoFeeModalEnum_1 = __importDefault(require(\"../../enums/EcoFeeModalEnum\"));\nconst EcoFeeStyle_1 = __importDefault(require(\"./EcoFeeStyle\"));\n/**\n * Eco fee component.\n *\n * @event modalOpen Triggered when the user clicks on the eco fee link\n * @event modalClose Triggered when the user clicks on the sheet close button.\n */\nlet EcoFee = class EcoFee extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Accepts a object format corresponding to { ShoppingProduct } from '@inter-ikea-kompis/types';\n this.totalPrice = null;\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Visible modal\n this.visibleModal = null;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n this.sheetElement = null;\n this.triggerElement = null;\n this.dexfSettings = null;\n }\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n if (!this.totalPrice || !this.getSettings().kompis.localization.hasEcoPart) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t${this.getFurnitureDisclaimer()} ${this.getElectronicsDisclaimer()}\n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.closeSheet();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n if (this.dexfSettings &&\n this.dexfSettings.kompis.localization.hasEcoPart &&\n changedProperties.has('visibleModal')) {\n if (this.visibleModal === EcoFeeModalEnum_1.default.ecoFeeCard) {\n this.openSheet();\n }\n else {\n this.closeSheet();\n }\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getSettings() {\n return this.dexfSettings;\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n getFurnitureDisclaimer() {\n var _a;\n if (!((_a = this.totalPrice) === null || _a === void 0 ? void 0 : _a.ecoPrice)) {\n return null;\n }\n const { ecoOfWhich, ecoArticleFurnitureShort } = this.getTranslations();\n const formattedPrice = utilities_1.PriceFormatter.format(this.totalPrice.ecoPrice, this.getSettings())\n .map((item) => item.value)\n .join('');\n const disclaimer = [ecoOfWhich, ecoArticleFurnitureShort].join(' ');\n const linkText = `${disclaimer} ${formattedPrice}`;\n return this.getLink(linkText);\n }\n getElectronicsDisclaimer() {\n var _a;\n if (!((_a = this.totalPrice) === null || _a === void 0 ? void 0 : _a.weeePrice)) {\n return null;\n }\n const { ecoOfWhich, ecoArticleElectronicsShort } = this.getTranslations();\n const formattedPrice = utilities_1.PriceFormatter.format(this.totalPrice.weeePrice, this.getSettings())\n .map((item) => item.value)\n .join('');\n const disclaimer = [ecoOfWhich, ecoArticleElectronicsShort].join(' ');\n const linkText = `${disclaimer} ${formattedPrice}`;\n return this.getLink(linkText);\n }\n getLink(text) {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t this.onLinkClick(event)}\"\n\t\t\t\t>\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n onLinkClick(event) {\n var _a, _b, _c;\n this.triggerElement = (_c = (_b = (_a = event.target) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('a')) !== null && _c !== void 0 ? _c : null;\n this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: {\n visibleModal: EcoFeeModalEnum_1.default.ecoFeeCard,\n triggerElement: this.triggerElement\n }\n }));\n }\n closeSheet() {\n if (this.sheetElement) {\n this.sheetElement.open = false;\n this.sheetElement = null;\n }\n }\n openSheet() {\n if (this.sheetElement) {\n return;\n }\n const sheetElement = this.createSheetElement();\n this.sheetElement = sheetElement;\n const parent = document.querySelector('kompis-keyboard-injector') || document.body;\n parent.appendChild(sheetElement);\n sheetElement.open = true;\n }\n createSheetElement() {\n const sheetElement = this.createSheet();\n const sheetHeaderElement = this.createSheetHeader();\n const ecoFeeCardElement = this.createCard();\n sheetElement.appendChild(sheetHeaderElement);\n sheetElement.appendChild(ecoFeeCardElement);\n return sheetElement;\n }\n createSheet() {\n const sheetElement = document.createElement('skapa-sheet');\n const ecoHeadline = this.getTranslations().ecoHeadline;\n sheetElement.setAttribute('aria-label', ecoHeadline);\n sheetElement.size = 'small';\n sheetElement.fullHeight = true;\n sheetElement.style.fontFamily = themes_1.FontStyle.getFontFamily(this.theme);\n sheetElement.style.zIndex = '500';\n sheetElement.addEventListener('closerequest', () => {\n if (this.sheetElement) {\n this.dispatchEvent(new CustomEvent('modalClose', {\n bubbles: true,\n detail: {\n visibleModal: null,\n triggerElement: this.triggerElement\n }\n }));\n }\n });\n sheetElement.addEventListener('closed', () => {\n var _a;\n (_a = sheetElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(sheetElement);\n });\n return sheetElement;\n }\n createSheetHeader() {\n const sheetHeaderElement = document.createElement('skapa-modal-header');\n sheetHeaderElement.slot = 'header';\n const { ecoHeadline, modalAriaLabelButtonClose } = this.getTranslations();\n const heading = document.createElement('h2');\n heading.innerText = ecoHeadline;\n heading.className = common_styles_webc_1.Text.classnames({ heading: { s: true } });\n heading.style.margin = '0';\n const style = document.createElement('style');\n style.textContent = common_styles_webc_1.Text.CSS;\n heading.appendChild(style);\n const headerSpan = document.createElement('span');\n headerSpan.slot = 'closebutton-label';\n headerSpan.innerText = modalAriaLabelButtonClose;\n sheetHeaderElement.appendChild(heading);\n sheetHeaderElement.appendChild(headerSpan);\n return sheetHeaderElement;\n }\n createCard() {\n const cardElement = document.createElement('kompis-eco-fee-card');\n cardElement.theme = this.theme;\n cardElement.settings = this.settings;\n cardElement.translations = this.translations;\n cardElement.localizedInformation = this.localizedInformation;\n cardElement.totalPrice = this.totalPrice;\n if (this.disableLinks) {\n cardElement.disableLinks = true;\n }\n return cardElement;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], EcoFee.prototype, \"totalPrice\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], EcoFee.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], EcoFee.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], EcoFee.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], EcoFee.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], EcoFee.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], EcoFee.prototype, \"disableLinks\", void 0);\nEcoFee = __decorate([\n (0, web_component_1.customElement)('kompis-eco-fee')\n], EcoFee);\nexports.default = EcoFee;\n//# sourceMappingURL=EcoFee.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EcoFeeModalEnum = exports.EcoFeeCard = exports.EcoFee = void 0;\nconst EcoFee_1 = __importDefault(require(\"./components/eco-fee/EcoFee\"));\nexports.EcoFee = EcoFee_1.default;\nconst EcoFeeCard_1 = __importDefault(require(\"./components/eco-fee-card/EcoFeeCard\"));\nexports.EcoFeeCard = EcoFeeCard_1.default;\nconst EcoFeeModalEnum_1 = __importDefault(require(\"./enums/EcoFeeModalEnum\"));\nexports.EcoFeeModalEnum = EcoFeeModalEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nclass RepairabilityIndexUtility {\n /**\n * Get the URL to the repairability index document with a specific fileType.\n *\n * @param product The product.\n * @param fileType The specific fileType of the document.\n * @returns The URL to the repairability index document, or null if not found.\n */\n static getDocumentUrl(product, fileType) {\n var _a, _b, _c, _d;\n return ((_d = (_c = (_b = (_a = product.content) === null || _a === void 0 ? void 0 : _a.complianceLabel) === null || _b === void 0 ? void 0 : _b.find((label) => label.labelType === enums_1.ProductComplianceLabelTypeEnum.repairabilityIndexDocument &&\n label.fileType === fileType)) === null || _c === void 0 ? void 0 : _c.url) !== null && _d !== void 0 ? _d : null);\n }\n /**\n * Get the URL to the repairability index image with a specific fileType.\n *\n * @param product The product.\n * @param fileType The specific fileType of the image.\n * @returns The URL to the repairability index image, or null if not found.\n */\n static getImageUrl(product, fileType) {\n var _a, _b, _c, _d;\n return ((_d = (_c = (_b = (_a = product.content) === null || _a === void 0 ? void 0 : _a.complianceLabel) === null || _b === void 0 ? void 0 : _b.find((label) => label.labelType === enums_1.ProductComplianceLabelTypeEnum.repairabilityIndexImage &&\n label.fileType === fileType)) === null || _c === void 0 ? void 0 : _c.url) !== null && _d !== void 0 ? _d : null);\n }\n /**\n * Get an alt text which represents the repairability index.\n *\n * @param product The product.\n * @returns An alt text.\n */\n static getImageAltText(product) {\n var _a, _b;\n const repairabilityIndex = (_b = (_a = product.content) === null || _a === void 0 ? void 0 : _a.complianceTechnical) === null || _b === void 0 ? void 0 : _b.find((item) => item.headingType === enums_1.ProductComplianceTechnicalHeadingTypeEnum.repairabilityIndex);\n if (!repairabilityIndex) {\n return '';\n }\n return `${repairabilityIndex.headingText}: ${repairabilityIndex.text}`;\n }\n}\nexports.default = RepairabilityIndexUtility;\n//# sourceMappingURL=RepairabilityIndexUtility.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass RepairabilityIndexCardStyle {\n static getStyle() {\n return (0, web_component_1.css) `\n\t\t\timg {\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = RepairabilityIndexCardStyle;\n//# sourceMappingURL=RepairabilityIndexCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst RepairabilityIndexUtility_1 = __importDefault(require(\"../../utilities/RepairabilityIndexUtility\"));\nconst RepairabilityIndexCardStyle_1 = __importDefault(require(\"./RepairabilityIndexCardStyle\"));\nlet RepairabilityIndexCard = class RepairabilityIndexCard extends web_component_1.KompisElement {\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t${this.getRepairabilityIndexDocument()}\n\t\t`;\n }\n getRepairabilityIndexDocument() {\n var _a;\n // The PDF version is lower file size, but using PDF requires an iframe (or some other solution) which is why the image file formats are used instead.\n const documentUrl = (_a = RepairabilityIndexUtility_1.default.getDocumentUrl(this.product, 'svg')) !== null && _a !== void 0 ? _a : RepairabilityIndexUtility_1.default.getDocumentUrl(this.product, 'png');\n if (!documentUrl) {\n return null;\n }\n return (0, web_component_1.html) ``;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], RepairabilityIndexCard.prototype, \"product\", void 0);\nRepairabilityIndexCard = __decorate([\n (0, web_component_1.customElement)('kompis-repairability-index-card')\n], RepairabilityIndexCard);\nexports.default = RepairabilityIndexCard;\n//# sourceMappingURL=RepairabilityIndexCard.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar RepairabilityIndexModalEnum;\n(function (RepairabilityIndexModalEnum) {\n RepairabilityIndexModalEnum[\"repairabilityIndexCard\"] = \"repairabilityIndexCard\";\n})(RepairabilityIndexModalEnum || (RepairabilityIndexModalEnum = {}));\nexports.default = RepairabilityIndexModalEnum;\n//# sourceMappingURL=RepairabilityIndexModalEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst MIN_ICON_SIZE = 24;\nclass RepairabilityIndexStyle {\n static getStyle() {\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\t\t\timg {\n\t\t\t\theight: 2em;\n\t\t\t}\n\t\t\t.imageContainer {\n\t\t\t\tcursor: pointer;\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\t\t\t\talign-items: center;\n\t\t\t\tmin-height: ${MIN_ICON_SIZE / 16}rem;\n\t\t\t\tmin-width: ${MIN_ICON_SIZE / 16}rem;\n\t\t\t\toutline: none;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = RepairabilityIndexStyle;\n//# sourceMappingURL=RepairabilityIndexStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nrequire(\"@inter-ikea-kompis/component-focus-outline\");\nrequire(\"@ingka/modal-webc\");\nrequire(\"../repairability-index-card/RepairabilityIndexCard\");\nconst RepairabilityIndexModalEnum_1 = __importDefault(require(\"../../enums/RepairabilityIndexModalEnum\"));\nconst RepairabilityIndexUtility_1 = __importDefault(require(\"../../utilities/RepairabilityIndexUtility\"));\nconst RepairabilityIndexStyle_1 = __importDefault(require(\"./RepairabilityIndexStyle\"));\n/**\n * @event modalOpen Triggered when a modal should be opened.\n * @event modalClose Triggered when a modal should be closed.\n */\nlet RepairabilityIndex = class RepairabilityIndex extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // Visible modal.\n this.visibleModal = null;\n this.sheetElement = null;\n }\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t${this.disableLinks ? this.getImageAsButton() : this.getImageAsLink()}\n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.closeSheet();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('visibleModal')) {\n if (this.visibleModal === RepairabilityIndexModalEnum_1.default.repairabilityIndexCard) {\n this.openSheet();\n }\n else {\n this.closeSheet();\n }\n }\n return true;\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n getImageAsButton() {\n const imageElement = this.getImageElement();\n if (!imageElement) {\n return this.getHiddenElement();\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t {\n if (event.key === 'Enter' || event.key === ' ') {\n this.sendModalOpen();\n }\n }}\n\t\t\t\t\t@click=\"${(event) => {\n event.preventDefault();\n event.stopPropagation();\n this.sendModalOpen();\n }}\"\n\t\t\t\t>\n\t\t\t\t\t${imageElement}\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n getImageAsLink() {\n var _a;\n const imageElement = this.getImageElement();\n if (!imageElement) {\n return this.getHiddenElement();\n }\n const documentUrl = (_a = RepairabilityIndexUtility_1.default.getDocumentUrl(this.product, 'pdf')) !== null && _a !== void 0 ? _a : RepairabilityIndexUtility_1.default.getDocumentUrl(this.product, 'svg');\n if (!documentUrl) {\n return this.getHiddenElement();\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t
${imageElement}\n\t\t\t\n\t\t`;\n }\n /**\n * Used when nothing should be rendered.\n * The benefit compared to returning null, is that any padding/margin applied to this component by parents components is disregarded.\n *\n * @returns Template result for a hidden element.\n */\n getHiddenElement() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n }\n getImageElement() {\n var _a;\n const imageUrl = (_a = RepairabilityIndexUtility_1.default.getImageUrl(this.product, 'svg')) !== null && _a !== void 0 ? _a : RepairabilityIndexUtility_1.default.getImageUrl(this.product, 'png');\n if (!imageUrl) {\n return null;\n }\n return (0, web_component_1.html) ``;\n }\n sendModalOpen() {\n this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: {\n visibleModal: RepairabilityIndexModalEnum_1.default.repairabilityIndexCard\n }\n }));\n }\n closeSheet() {\n if (this.sheetElement) {\n this.sheetElement.open = false;\n this.sheetElement = null;\n }\n }\n openSheet() {\n if (this.sheetElement) {\n return;\n }\n const sheetElement = this.createSheetElement();\n this.sheetElement = sheetElement;\n const parent = document.querySelector('kompis-keyboard-injector') || document.body;\n parent.appendChild(sheetElement);\n sheetElement.open = true;\n }\n createSheetElement() {\n const sheetElement = this.createSheet();\n const sheetHeaderElement = this.createSheetHeader();\n const cardElement = this.createCard();\n sheetElement.appendChild(sheetHeaderElement);\n sheetElement.appendChild(cardElement);\n return sheetElement;\n }\n createSheet() {\n const sheetElement = document.createElement('skapa-sheet');\n sheetElement.size = 'large';\n sheetElement.fullHeight = true;\n sheetElement.style.fontFamily = themes_1.FontStyle.getFontFamily(this.theme);\n sheetElement.style.zIndex = '500';\n sheetElement.addEventListener('closerequest', () => {\n if (this.sheetElement) {\n this.dispatchEvent(new CustomEvent('modalClose', {\n bubbles: true,\n detail: {\n visibleModal: null\n }\n }));\n }\n });\n sheetElement.addEventListener('closed', () => {\n var _a;\n (_a = sheetElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(sheetElement);\n });\n return sheetElement;\n }\n createSheetHeader() {\n const sheetHeaderElement = document.createElement('skapa-modal-header');\n sheetHeaderElement.slot = 'header';\n const headerSpan = document.createElement('span');\n headerSpan.slot = 'closebutton-label';\n headerSpan.innerText = this.getTranslations().modalAriaLabelButtonClose;\n sheetHeaderElement.appendChild(headerSpan);\n return sheetHeaderElement;\n }\n createCard() {\n const cardElement = document.createElement('kompis-repairability-index-card');\n cardElement.product = this.product;\n return cardElement;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], RepairabilityIndex.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], RepairabilityIndex.prototype, \"product\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], RepairabilityIndex.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], RepairabilityIndex.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], RepairabilityIndex.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], RepairabilityIndex.prototype, \"visibleModal\", void 0);\nRepairabilityIndex = __decorate([\n (0, web_component_1.customElement)('kompis-repairability-index')\n], RepairabilityIndex);\nexports.default = RepairabilityIndex;\n//# sourceMappingURL=RepairabilityIndex.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RepairabilityIndexModalEnum = exports.RepairabilityIndex = void 0;\nconst RepairabilityIndex_1 = __importDefault(require(\"./components/repairability-index/RepairabilityIndex\"));\nexports.RepairabilityIndex = RepairabilityIndex_1.default;\nconst RepairabilityIndexModalEnum_1 = __importDefault(require(\"./enums/RepairabilityIndexModalEnum\"));\nexports.RepairabilityIndexModalEnum = RepairabilityIndexModalEnum_1.default;\n//# sourceMappingURL=index.js.map","// @ts-ignore\nconst styles = ':host{--skapa-commercial-message-colour:rgb(var(--colour-commercial-message-new,202,80,8));background-color:var(--skapa-commercial-message-colour);color:rgb(var(--colour-text-and-icon-5,255,255,255));display:inline-block;font-size:.75rem;font-weight:700;line-height:1.1233;padding:.3333em .5em}:host([variant=nlp]){--skapa-commercial-message-colour:rgb(var(--colour-commercial-message-new-lower-price,204,0,8))}:host([variant=family]){--skapa-commercial-message-colour:rgb(var(--colour-commercial-message-ikea-family,0,124,193))}:host([subtle]){background-color:initial;color:var(--skapa-commercial-message-colour);line-height:1.5;padding:0}';\nconst styles_template = document.createElement('template');\nstyles_template.innerHTML = ``;\nimport { PredefinitionPropertyHandler } from '@ingka/webc-tools';\nexport class CommercialMessage extends HTMLElement {\n constructor() {\n super();\n PredefinitionPropertyHandler.gatherProperties(['subtle', 'variant'], this);\n const shadow = this.attachShadow({ mode: 'open' });\n shadow.append(styles_template.content.cloneNode(true));\n }\n connectedCallback() {\n PredefinitionPropertyHandler.initGatheredProperties(this);\n }\n get subtle() {\n return this.hasAttribute('subtle');\n }\n set subtle(toggle) {\n this.toggleAttribute('subtle', !!toggle);\n }\n get variant() {\n return this.getAttribute('variant') || 'new';\n }\n set variant(value) {\n this.setAttribute('variant', value || 'new');\n }\n}\n","import define from '@ingka/webc-tools';\nimport { CommercialMessage } from './src/CommercialMessage.js';\nexport { CommercialMessage };\nexport const commercialMessageTagName = define('commercial-message', CommercialMessage);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar PriceModuleLayoutTypeEnum;\n(function (PriceModuleLayoutTypeEnum) {\n PriceModuleLayoutTypeEnum[\"subtle\"] = \"subtle\";\n PriceModuleLayoutTypeEnum[\"default\"] = \"default\";\n PriceModuleLayoutTypeEnum[\"emphasized\"] = \"emphasized\";\n PriceModuleLayoutTypeEnum[\"rowPrice\"] = \"rowPrice\";\n PriceModuleLayoutTypeEnum[\"listPrice\"] = \"listPrice\";\n})(PriceModuleLayoutTypeEnum || (PriceModuleLayoutTypeEnum = {}));\nexports.default = PriceModuleLayoutTypeEnum;\n//# sourceMappingURL=PriceModuleLayoutTypeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar PriceModuleModalEnum;\n(function (PriceModuleModalEnum) {\n PriceModuleModalEnum[\"energyLabelCard\"] = \"energyLabelCard\";\n PriceModuleModalEnum[\"ecoFeeCard\"] = \"ecoFeeCard\";\n PriceModuleModalEnum[\"energyFicheCard\"] = \"energyFicheCard\";\n PriceModuleModalEnum[\"energySecCard\"] = \"energySecCard\";\n PriceModuleModalEnum[\"unifiedWaterLabelCard\"] = \"waterLabelCard\";\n PriceModuleModalEnum[\"repairabilityIndexCard\"] = \"repairabilityIndexCard\";\n})(PriceModuleModalEnum || (PriceModuleModalEnum = {}));\nexports.default = PriceModuleModalEnum;\n//# sourceMappingURL=PriceModuleModalEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar PriceModuleProductLinkEnum;\n(function (PriceModuleProductLinkEnum) {\n PriceModuleProductLinkEnum[\"disabled\"] = \"disabled\";\n PriceModuleProductLinkEnum[\"productInformationPage\"] = \"productInformationPage\";\n PriceModuleProductLinkEnum[\"eventOnly\"] = \"eventOnly\";\n})(PriceModuleProductLinkEnum || (PriceModuleProductLinkEnum = {}));\nexports.default = PriceModuleProductLinkEnum;\n//# sourceMappingURL=PriceModuleProductLinkEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst PriceModuleProductLinkEnum_1 = __importDefault(require(\"../enums/PriceModuleProductLinkEnum\"));\nclass PriceModuleUtility {\n /**\n * Whether the Price Module should render an interactive product name or not.\n *\n * @param linkType The link type.\n * @param disableLinks Whether links are disabled or not.\n */\n static showInteractiveProductName(linkType, disableLinks) {\n if (linkType === PriceModuleProductLinkEnum_1.default.disabled) {\n return false;\n }\n if (linkType === PriceModuleProductLinkEnum_1.default.productInformationPage) {\n return !disableLinks;\n }\n return true;\n }\n}\nexports.default = PriceModuleUtility;\n//# sourceMappingURL=PriceModuleUtility.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nconst PriceModuleLayoutTypeEnum_1 = __importDefault(require(\"../../enums/PriceModuleLayoutTypeEnum\"));\nconst PriceModuleProductLinkEnum_1 = __importDefault(require(\"../../enums/PriceModuleProductLinkEnum\"));\nclass PriceModuleStyle {\n /**\n * Returns style.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @param options.isBti Is breath taking item.\n * @param options.layout Layout.\n * @param options.productLink\n * @param options.disableLinks\n * @param options.complianceType\n * @param options.underline\n * @param options.loyaltyProgramEqualFontSize\n * @param options.withoutPrice\n * @param options.disableFocusStyle\n * @param options.isComponentListTotalPriceChild\n * @returns Css.\n */\n static getStyle(options) {\n var _a, _b, _c, _d, _e, _f;\n const { theme: { color, spacing }, isComponentListTotalPriceChild, loyaltyProgramEqualFontSize, productLink, disableLinks, layout, underline, isBti } = options;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\t\t\t:host {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: flex-start;\n\t\t\t}\n\n\t\t\tp {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\tbutton {\n\t\t\t\tbackground: none;\n\t\t\t\tcolor: inherit;\n\t\t\t\tborder: none;\n\t\t\t\tpadding: 0;\n\t\t\t\tfont: inherit;\n\t\t\t\tcursor: pointer;\n\t\t\t\toutline: inherit;\n\t\t\t\ttext-decoration: ${underline ? 'underline' : 'none'};\n\t\t\t}\n\n\t\t\t.productName button {\n\t\t\t\ttext-align: left;\n\t\t\t}\n\n\t\t\ta {\n\t\t\t\tcolor: inherit;\n\t\t\t\toutline: 0;\n\t\t\t\ttext-decoration: ${underline ? 'underline' : 'none'};\n\t\t\t}\n\n\t\t\t.productContent:hover .actionElement {\n\t\t\t\ttext-decoration: underline;\n\t\t\t}\n\n\t\t\t.productName,\n\t\t\t.regularPrice,\n\t\t\t.price,\n\t\t\t.secondaryPrice,\n\t\t\t.priceUnit {\n\t\t\t\tcolor: ${color.neutral.grey900};\n\t\t\t}\n\n\t\t\t.productName {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t.productContent {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\ttext-decoration: none;\n\t\t\t\tcursor: ${productLink !== PriceModuleProductLinkEnum_1.default.disabled && !disableLinks\n ? 'pointer'\n : 'auto'};\n\t\t\t\toverflow-wrap: anywhere;\n\t\t\t}\n\n\t\t\t.productDescription {\n\t\t\t\tcolor: ${color.text.default};\n\t\t\t}\n\n\t\t\t.regularPrice {\n\t\t\t\tmargin-top: ${this.getPriceMargins(options)}rem;\n\t\t\t}\n\n\t\t\t.visuallyHidden:not(:focus):not(:active) {\n\t\t\t\tclip: rect(0 0 0 0);\n\t\t\t\tclip-path: inset(50%);\n\t\t\t\theight: ${1 / 16}rem;\n\t\t\t\toverflow: hidden;\n\t\t\t\tposition: absolute;\n\t\t\t\twhite-space: nowrap;\n\t\t\t\twidth: ${1 / 16}rem;\n\t\t\t}\n\n\t\t\t.price,\n\t\t\t.secondaryPrice {\n\t\t\t\tdisplay: flex;\n\t\t\t\t${(_a = this.getEnergyAlignment(options)) !== null && _a !== void 0 ? _a : ''}\n\t\t\t\t${(_b = this.getPriceFlexDirection(options)) !== null && _b !== void 0 ? _b : ''};\n\t\t\t\tmargin-top: ${this.getPriceMargins(options)}rem;\n\t\t\t\tmargin-bottom: ${isBti ? this.getBtiMargins(options) : this.getPriceMargins(options)}rem;\n\t\t\t}\n\n\t\t\t.secondaryPrice {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\n\t\t\t.priceContainer {\n\t\t\t\tfont-weight: bold;\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-wrap: wrap;\n\t\t\t}\n\n\t\t\t.divider {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\twidth: ${(layout === PriceModuleLayoutTypeEnum_1.default.emphasized\n ? spacing.space50\n : spacing.space25) / 16}rem;\n\t\t\t}\n\n\t\t\t.priceText,\n\t\t\t.priceExclTax {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n\n\t\t\t.lowestPreviousSalesPrice {\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\n\t\t\t.priceUnit,\n\t\t\t.priceContainer span {\n\t\t\t\tdisplay: flex;\n\t\t\t\tline-height: ${this.getPriceUnitLineHeight(layout)};\n\t\t\t\talign-self: ${this.getPriceUnitAlignment(layout)};\n\t\t\t\tfont-size: ${this.getPriceUnitFontSize(layout)};\n\t\t\t}\n\n\t\t\t.priceText {\n\t\t\t\tflex-direction: column;\n\t\t\t\tcolor: ${color.neutral.grey700};\n\t\t\t}\n\n\t\t\tkompis-text:last-child .priceContainer:not(:only-child) {\n\t\t\t\tpadding-bottom: 0;\n\t\t\t}\n\n\t\t\tskapa-commercial-message {\n\t\t\t\tmargin-bottom: ${(loyaltyProgramEqualFontSize || isComponentListTotalPriceChild\n ? 0\n : spacing.space25) / 16}rem;\n\t\t\t\tfont-size: ${14 / 16}rem;\n\t\t\t}\n\n\t\t\tkompis-repairability-index {\n\t\t\t\tmargin-top: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t${(_c = this.getBreathTakingItem(options)) !== null && _c !== void 0 ? _c : ''}\n\t\t\t${(_d = this.getEnergyMargins(options)) !== null && _d !== void 0 ? _d : ''}\n\t\t\t${(_e = this.getWithoutPriceStyling(options)) !== null && _e !== void 0 ? _e : ''}\n\t\t\t${(_f = this.getOutlineStyle(options)) !== null && _f !== void 0 ? _f : ''}\n\n\t\t\t.priceText .price:last-of-type {\n\t\t\t\tmargin-top: 0rem;\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns price unit line-height.\n *\n * @param layout\n * @returns Price unit line-height.\n */\n static getPriceUnitLineHeight(layout) {\n switch (layout) {\n case PriceModuleLayoutTypeEnum_1.default.subtle:\n case PriceModuleLayoutTypeEnum_1.default.rowPrice:\n return 1;\n case PriceModuleLayoutTypeEnum_1.default.default:\n case PriceModuleLayoutTypeEnum_1.default.emphasized:\n case PriceModuleLayoutTypeEnum_1.default.listPrice:\n return 1.15;\n }\n }\n /**\n * Returns price unit alignment.\n *\n * @param layout\n * @returns Price unit alignment.\n */\n static getPriceUnitAlignment(layout) {\n switch (layout) {\n case PriceModuleLayoutTypeEnum_1.default.subtle:\n case PriceModuleLayoutTypeEnum_1.default.rowPrice:\n return 'auto';\n case PriceModuleLayoutTypeEnum_1.default.default:\n case PriceModuleLayoutTypeEnum_1.default.emphasized:\n case PriceModuleLayoutTypeEnum_1.default.listPrice:\n return 'flex-end';\n }\n }\n /**\n * Returns price unit font size.\n *\n * @param layout\n * @returns Price unit font size.\n */\n static getPriceUnitFontSize(layout) {\n switch (layout) {\n case PriceModuleLayoutTypeEnum_1.default.subtle:\n case PriceModuleLayoutTypeEnum_1.default.rowPrice:\n return '100%';\n case PriceModuleLayoutTypeEnum_1.default.default:\n case PriceModuleLayoutTypeEnum_1.default.emphasized:\n case PriceModuleLayoutTypeEnum_1.default.listPrice:\n return '60%';\n }\n }\n /**\n * Returns bti style.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @param options.isBti Is breath taking item.\n * @param options.layout Layout.\n * @returns Css.\n */\n static getBreathTakingItem(options) {\n if (!options.isBti) {\n return null;\n }\n const { color, spacing } = options.theme;\n const btiSize = this.getBreathTakingItemSize(options.layout);\n const boxShadowSize = Math.ceil(btiSize * 0.125);\n return (0, web_component_1.css) `\n\t\t\t.priceContainer {\n\t\t\t\tbackground-color: ${color.commercialMessage.btiYellow};\n\t\t\t\tbox-shadow: ${boxShadowSize / 16}rem ${boxShadowSize / 16}rem\n\t\t\t\t\t${color.commercialMessage.btiRed};\n\t\t\t\tpadding: ${Math.ceil(btiSize * 0.2) / 16}rem ${Math.ceil(btiSize * 0.3) / 16}rem;\n\t\t\t\tmargin-bottom: ${this.getBtiMargins(options)}rem;\n\t\t\t}\n\n\t\t\tkompis-energy-efficiency-class {\n\t\t\t\tmargin-bottom: ${options.theme.spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.price,\n\t\t\t.secondaryPrice .priceContainer {\n\t\t\t\tmargin-bottom: 0;\n\t\t\t}\n\n\t\t\t.price:nth-child(even) {\n\t\t\t\tmargin-top: ${spacing.space25 / 16}rem;\n\t\t\t}\n\n\t\t\t.price:nth-child(even):not(:last-child) {\n\t\t\t\tmargin-bottom: ${this.getBtiMargins(options)}rem;\n\t\t\t}\n\t\t`;\n }\n /**\n * @param options\n * @param options.theme\n * @param options.layout\n */\n static getPriceMargins(options) {\n const { spacing } = options.theme;\n switch (options.layout) {\n case PriceModuleLayoutTypeEnum_1.default.subtle:\n case PriceModuleLayoutTypeEnum_1.default.rowPrice:\n case PriceModuleLayoutTypeEnum_1.default.listPrice:\n return spacing.space25 / 16;\n case PriceModuleLayoutTypeEnum_1.default.default:\n case PriceModuleLayoutTypeEnum_1.default.emphasized:\n return spacing.space50 / 16;\n }\n }\n /**\n * @param options\n * @param options.theme\n * @param options.layout\n */\n static getBtiMargins(options) {\n const { spacing } = options.theme;\n switch (options.layout) {\n case PriceModuleLayoutTypeEnum_1.default.subtle:\n case PriceModuleLayoutTypeEnum_1.default.rowPrice:\n return spacing.space50 / 16;\n case PriceModuleLayoutTypeEnum_1.default.default:\n case PriceModuleLayoutTypeEnum_1.default.listPrice:\n return spacing.space75 / 16;\n case PriceModuleLayoutTypeEnum_1.default.emphasized:\n return spacing.space100 / 16;\n }\n }\n /**\n * Returns bti size.\n *\n * @param options.layout Layout.\n * @param layout\n * @returns Bti size.\n */\n static getBreathTakingItemSize(layout) {\n switch (layout) {\n case PriceModuleLayoutTypeEnum_1.default.subtle:\n return 12;\n case PriceModuleLayoutTypeEnum_1.default.default:\n return 28;\n case PriceModuleLayoutTypeEnum_1.default.emphasized:\n return 45;\n case PriceModuleLayoutTypeEnum_1.default.rowPrice:\n return 14;\n case PriceModuleLayoutTypeEnum_1.default.listPrice:\n return 25;\n }\n }\n /**\n * Returns energy class margin.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @param options.layout Layout.\n * @returns Energy class margin.\n */\n static getEnergyClassMargin(options) {\n const { spacing } = options.theme;\n switch (options.layout) {\n case PriceModuleLayoutTypeEnum_1.default.subtle:\n case PriceModuleLayoutTypeEnum_1.default.rowPrice:\n return spacing.space25 / 16;\n case PriceModuleLayoutTypeEnum_1.default.default:\n case PriceModuleLayoutTypeEnum_1.default.listPrice:\n return spacing.space50 / 16;\n case PriceModuleLayoutTypeEnum_1.default.emphasized:\n return spacing.space75 / 16;\n }\n }\n /**\n * Returns compliance icon alignment.\n *\n * @param options\n * @param options.complianceType\n */\n static getEnergyAlignment(options) {\n if (!options.complianceType) {\n return null;\n }\n switch (options.complianceType) {\n case enums_1.ProductComplianceTechnicalHeadingTypeEnum.energyEfficiencyClass:\n return 'align-items: center; flex-wrap: wrap;';\n case enums_1.ProductComplianceTechnicalHeadingTypeEnum.unifiedWaterLabel:\n case enums_1.ProductComplianceTechnicalHeadingTypeEnum.hyperlink:\n return 'align-items: stretch;';\n }\n return null;\n }\n static getPriceFlexDirection(options) {\n const { complianceType, layout } = options;\n const isListPriceLayout = layout === PriceModuleLayoutTypeEnum_1.default.listPrice;\n if (!complianceType && !isListPriceLayout) {\n return null;\n }\n if (isListPriceLayout) {\n return 'flex-direction: row-reverse';\n }\n switch (complianceType) {\n case enums_1.ProductComplianceTechnicalHeadingTypeEnum.energyEfficiencyClass:\n return 'flex-direction: row';\n case enums_1.ProductComplianceTechnicalHeadingTypeEnum.hyperlink:\n case enums_1.ProductComplianceTechnicalHeadingTypeEnum.unifiedWaterLabel:\n return 'flex-direction: column';\n }\n return null;\n }\n /**\n * Returns margin for energy compliance icon based on its type (EU/US).\n *\n * @param options\n * @param options.theme\n * @param options.isBti\n * @param options.layout\n * @param options.complianceType\n */\n static getEnergyMargins(options) {\n switch (options.complianceType) {\n case enums_1.ProductComplianceTechnicalHeadingTypeEnum.energyEfficiencyClass: {\n const energyClassMargin = this.getEnergyClassMargin(options);\n return (0, web_component_1.css) `\n\t\t\t\t\t.price {\n\t\t\t\t\t\t${options.isBti\n ? (0, web_component_1.css) `\n\t\t\t\t\t\t\t\t\tcolumn-gap: ${this.getBtiMargins(options)}rem;\n\t\t\t\t\t\t\t `\n : (0, web_component_1.css) `\n\t\t\t\t\t\t\t\t\tcolumn-gap: ${energyClassMargin}rem;\n\t\t\t\t\t\t\t\t\trow-gap: ${energyClassMargin}rem;\n\t\t\t\t\t\t\t `}\n\t\t\t\t\t}\n\t\t\t\t`;\n }\n case enums_1.ProductComplianceTechnicalHeadingTypeEnum.hyperlink:\n return (0, web_component_1.css) `\n\t\t\t\t\tkompis-energy-efficiency-class {\n\t\t\t\t\t\tmargin-top: ${options.theme.spacing.space50 / 16}rem;\n\t\t\t\t\t\twidth: ${options.theme.spacing.space400 / 16}rem;\n\t\t\t\t\t}\n\t\t\t\t`;\n case enums_1.ProductComplianceTechnicalHeadingTypeEnum.unifiedWaterLabel:\n return (0, web_component_1.css) `\n\t\t\t\t\tkompis-water-efficiency-class {\n\t\t\t\t\t\tmargin-top: ${options.theme.spacing.space50 / 16}rem;\n\t\t\t\t\t}\n\t\t\t\t`;\n }\n return null;\n }\n /**\n * Return styling for when there is no price.\n *\n * @param options\n * @param options.withoutPrice\n * @param options.theme\n */\n static getWithoutPriceStyling(options) {\n if (!options.withoutPrice) {\n return null;\n }\n return (0, web_component_1.css) `\n\t\t\tkompis-water-efficiency-class,\n\t\t\tkompis-energy-efficiency-class {\n\t\t\t\tmargin-top: ${options.theme.spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.priceText {\n\t\t\t\tmargin-top: ${options.theme.spacing.space25 / 16}rem;\n\t\t\t}\n\t\t`;\n }\n static getOutlineStyle(options) {\n if (options.disableFocusStyle) {\n return null;\n }\n const { focusOutline, color, motion } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t.productContent:focus-within {\n\t\t\t\tz-index: 1;\n\t\t\t\tbox-shadow: 0 0 0 ${focusOutline.offset / 16}rem ${color.border.inverse};\n\t\t\t\toutline: ${focusOutline.width / 16}rem solid ${focusOutline.color};\n\t\t\t\toutline-offset: ${focusOutline.offset / 16}rem;\n\t\t\t\ttransition: outline ${motion.duration.medium} ease-out,\n\t\t\t\t\tbox-shadow ${motion.duration.medium} ease-out;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = PriceModuleStyle;\n//# sourceMappingURL=PriceModuleStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_energy_efficiency_class_1 = require(\"@inter-ikea-kompis/component-energy-efficiency-class\");\nconst component_water_efficiency_class_1 = require(\"@inter-ikea-kompis/component-water-efficiency-class\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@inter-ikea-kompis/component-price-formatter\");\nrequire(\"@inter-ikea-kompis/component-eco-fee\");\nrequire(\"@inter-ikea-kompis/component-repairability-index\");\nrequire(\"@inter-ikea-kompis/component-energy-efficiency-class\");\nrequire(\"@inter-ikea-kompis/component-water-efficiency-class\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@ingka/commercial-message-webc\");\nconst PriceModuleLayoutTypeEnum_1 = __importDefault(require(\"../../enums/PriceModuleLayoutTypeEnum\"));\nconst PriceModuleModalEnum_1 = __importDefault(require(\"../../enums/PriceModuleModalEnum\"));\nconst PriceModuleProductLinkEnum_1 = __importDefault(require(\"../../enums/PriceModuleProductLinkEnum\"));\nconst PriceModuleUtility_1 = __importDefault(require(\"../../utilities/PriceModuleUtility\"));\nconst PriceModuleStyle_1 = __importDefault(require(\"./PriceModuleStyle\"));\n/**\n * Price module component.\n *\n * @event productNameClick Triggered when product name is clicked\n * @event modalClose Triggered when the modal has been closed\n * @event modalOpen Triggered when a modal has been opened. event.detail.modalType tells you the type\n */\nlet PriceModule = class PriceModule extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Layout\n this.layout = PriceModuleLayoutTypeEnum_1.default.default;\n // Name of the product of product set\n this.productName = null;\n // Product name text underline effect\n this.underline = false;\n // Set price to be animated\n this.animated = false;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // Disables focus style. Should be used if a parent element is holding the focus style for the price module.\n this.disableFocusStyle = false;\n // Show eco fee\n this.showEcoFee = false;\n // Show price unit.\n this.showPriceUnit = false;\n // Show energy and water compliance labels.\n this.showEnergyLabel = false;\n // Show repairability index.\n this.showRepairabilityIndex = false;\n // Show price excl tax.\n this.showPriceExclTax = false;\n // Show a modal.\n this.visibleModal = null;\n // Sets the product link behaviour. This attribute should be set to \"disabled\" when in a Kiosk.\n this.productLink = PriceModuleProductLinkEnum_1.default.disabled;\n // If true will display the price indicator 'From' price which is the lowest main/regular price for that product, not including all price/legal/business rules and should only be used for auto adapt products.\n this.isFromPrice = false;\n // Applicable when shoppingProducts is more than 1. If true, the products will be treated as one product. If one product has a new lower price then the whole product will as well.\n this.isCombinedProduct = false;\n // Show lowest price in 30 days for reduced prices. Only for single items. If there are several shopping items available an error will be thrown.\n this.showLowestPreviousSalesPrice = false;\n this.dexfSettings = null;\n this.getPricesFromTotalPrice = (totalPrice, text) => {\n return (0, web_component_1.html) `\n\t\t\t
\n\t\t\t\t${text}:\n\n\t\t\t\t${totalPrice.map((price, index) => {\n const lastPriceToShow = index === totalPrice.length - 1;\n return (0, web_component_1.html) `\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t${lastPriceToShow ? null : (0, web_component_1.html) `/`}\n\t\t\t\t\t`;\n })}\n\t\t\t
\n\t\t`;\n };\n }\n /**\n * Renders view.\n *\n * @returns Template.\n */\n render() {\n var _a, _b;\n if (!this.shoppingProducts || !this.hasTranslationsAndSettings()) {\n return null;\n }\n const totalPrice = utilities_1.TotalPriceCalculator.calculateMultiple(this.shoppingProducts, this.getSettings().localisation.dateFormat, this.isCombinedProduct);\n const primaryCurrency = totalPrice[0];\n const loyaltyProgramEqualFontSize = this.getSettings().kompis.priceSettings.loyaltyProgramEqualFontSize;\n // Hacky solution used to remove margin-bottom from commercial message when not needed.\n const isComponentListTotalPriceChild = ((_a = this.parentElement) === null || _a === void 0 ? void 0 : _a.className) === 'priceDisplay';\n const styleOptions = {\n theme: this.theme,\n isBti: primaryCurrency && utilities_1.PriceUtility.isBreathTakingItem(primaryCurrency),\n layout: this.layout,\n productLink: this.productLink,\n disableLinks: this.disableLinks,\n underline: this.underline,\n complianceType: utilities_1.ProductUtility.getProductComplianceType((_b = this.shoppingProducts[0]) === null || _b === void 0 ? void 0 : _b.product),\n loyaltyProgramEqualFontSize,\n withoutPrice: !primaryCurrency,\n disableFocusStyle: this.disableFocusStyle,\n isComponentListTotalPriceChild\n };\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t${!primaryCurrency\n ? this.getPriceModuleWithoutPrice()\n : this.isFromPrice\n ? this.getFromPrice(totalPrice)\n : this.getPriceModule(totalPrice)}\n\t\t`;\n }\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.dexfSettings) || !!this.localizedInformation;\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n getSettings() {\n return this.dexfSettings;\n }\n /**\n * HTML for from price.\n *\n * @param totalPrice\n * @returns HTML for from price.\n */\n getFromPrice(totalPrice) {\n const productName = PriceModuleUtility_1.default.showInteractiveProductName(this.productLink, this.disableLinks)\n ? this.getInteractiveProductName()\n : this.getNonInteractiveProductName();\n return (0, web_component_1.html) `\n\t\t\t${productName} ${this.getProductDescription()}\n\t\t\t${totalPrice.map((price, index) => {\n const isPrimaryCurrency = index < 1;\n return this.getPrice(price, isPrimaryCurrency);\n })}\n\t\t`;\n }\n /**\n * HTML for PriceModule.\n * If \"loyaltyProgramEqualFontSize\" is present, we shift order of the commercial message.\n *\n * @param totalPrice\n * @returns HTML for price module.\n */\n getPriceModule(totalPrice) {\n var _a;\n const primaryCurrency = totalPrice[0];\n const loyaltyProgramEqualFontSize = (_a = this.getSettings().kompis.priceSettings.loyaltyProgramEqualFontSize) !== null && _a !== void 0 ? _a : false;\n return (0, web_component_1.html) `\n\t\t\t${loyaltyProgramEqualFontSize ? null : this.getCommercialMessage(primaryCurrency)}\n\t\t\t${this.getProductContent()}\n\t\t\t${loyaltyProgramEqualFontSize ? this.getCommercialMessage(primaryCurrency) : null}\n\t\t\t${totalPrice.map((price, index) => {\n const isPrimaryCurrency = index < 1;\n return (0, web_component_1.html) ` ${this.getRegularPrice(price)} ${this.getPrice(price, isPrimaryCurrency)} `;\n })}\n\t\t\t${this.getText(totalPrice)} ${this.getEcoFee(primaryCurrency)} ${this.getRepairabilityIndex()}\n\t\t\t${this.getWaterEfficiencyClass()}\n\t\t\t${this.isHyperlinkComplianceType(this.shoppingProducts[0])\n ? this.getEnergyEfficiencyClass()\n : null}\n\t\t`;\n }\n /**\n * HTML for PriceModule but the price information is not available.\n *\n * @returns HTML for price module.\n */\n getPriceModuleWithoutPrice() {\n if (this.shoppingProducts.length !== 1) {\n throw new exceptions_1.ComponentElementException(this, 'There is more than one article and at least one of them does not contain price information which means that it is not possible to calculate a total price. This operation is not allowed.');\n }\n return (0, web_component_1.html) `\n\t\t\t${this.getProductContent()} ${this.getEnergyEfficiencyClass()} ${this.getText()}\n\t\t\t${this.getRepairabilityIndex()} ${this.getWaterEfficiencyClass()}\n\t\t`;\n }\n /**\n * Returns true if the compliance type is hyperlink (US energy/US lighting).\n *\n * @param shoppingProduct\n */\n isHyperlinkComplianceType(shoppingProduct) {\n var _a;\n return ((_a = utilities_1.ProductUtility.getProductComplianceType(shoppingProduct === null || shoppingProduct === void 0 ? void 0 : shoppingProduct.product) ===\n enums_1.ProductComplianceTechnicalHeadingTypeEnum.hyperlink) !== null && _a !== void 0 ? _a : false);\n }\n /**\n * Returns commercial message.\n *\n * @returns Template.\n * @param totalPrice Price model.\n */\n getCommercialMessage(totalPrice) {\n const commercialMessage = this.getCommercialMessageInput(totalPrice);\n if (!commercialMessage) {\n return null;\n }\n const { label, variant } = commercialMessage;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${label}\n\t\t\t\n\t\t`;\n }\n /**\n * Returns the commercial message label and type, or null if it should not be shown.\n *\n * @param totalPrice Price modal.\n */\n getCommercialMessageInput(totalPrice) {\n const translations = this.getTranslations();\n const { kompis: { priceSettings } } = this.getSettings();\n if (utilities_1.PriceUtility.isFamily(totalPrice)) {\n const family = 'family';\n return {\n label: translations.priceInfoIkeaFamilyPrice,\n variant: family\n };\n }\n if (utilities_1.PriceUtility.isNewLowerPrice(totalPrice) &&\n priceSettings.showNewLowerPriceCommercialMessage) {\n const nlp = 'nlp';\n return {\n label: translations.productListNewLowerPrice,\n variant: nlp\n };\n }\n return null;\n }\n /**\n * This function wraps the name and description because of A11y, making it easier to hit the link to PIP.\n */\n getProductContent() {\n if (PriceModuleUtility_1.default.showInteractiveProductName(this.productLink, this.disableLinks)) {\n return (0, web_component_1.html) `\n\t\t\t\t${this.getInteractiveProductName()} ${this.getProductDescription()}\n\t\t\t`;\n }\n return (0, web_component_1.html) `
\n\t\t\t${this.getNonInteractiveProductName()} ${this.getProductDescription()}\n\t\t
`;\n }\n /**\n * Returns non-interactive product name.\n *\n * @returns Template.\n */\n getNonInteractiveProductName() {\n if (this.productName === null) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${this.productName.toUpperCase()}\n\t\t\t\n\t\t`;\n }\n /**\n * Returns interactive product name.\n *\n * @returns Template.\n */\n getInteractiveProductName() {\n if (this.productName === null) {\n return null;\n }\n if (this.productLink === PriceModuleProductLinkEnum_1.default.productInformationPage) {\n return (0, web_component_1.html) `\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t${this.productName.toUpperCase()} ${this.getVisuallyHiddenLinkText()}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t`;\n }\n else {\n return (0, web_component_1.html) `\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t${this.productName.toUpperCase()}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t`;\n }\n }\n getVisuallyHiddenLinkText() {\n const text = this.getTranslations()\n .ariaLabelProductPageLink.replace('[[productName]]', ' ')\n .replace('{{productName}}', ' ');\n return (0, web_component_1.html) `${text}.`;\n }\n getProductDescription() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t\n\t\t\t

\n\t\t`;\n }\n /**\n * Get the regular price.\n *\n * @param totalPrice Price model.\n * @param isPrimaryCurrency\n * @returns Regular price.\n */\n getRegularPrice(totalPrice) {\n if (!utilities_1.PriceUtility.isTro(totalPrice)) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n /**\n * Returns price.\n *\n * @param totalPrice Price model.\n * @param isPrimaryCurrency\n * @returns Template.\n */\n getPrice(totalPrice, isPrimaryCurrency) {\n const { priceInfoFromPrice, priceInfoCurrentPrice } = this.getTranslations();\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t${this.isFromPrice\n ? (0, web_component_1.html) `\n\t\t\t\t\t\t\t\t${priceInfoFromPrice}\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t `\n : null}\n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${this.getPriceUnit()}\n\t\t\t\t
\n\n\t\t\t\t${!this.isFromPrice &&\n isPrimaryCurrency &&\n !this.isHyperlinkComplianceType(this.shoppingProducts[0])\n ? this.getEnergyEfficiencyClass()\n : null}\n\t\t\t\n\t\t`;\n }\n /**\n * Returns price unit.\n *\n * @returns Template.\n */\n getPriceUnit() {\n if (!this.showPriceUnit) {\n return null;\n }\n if (!utilities_1.PriceUtility.isIndividualProduct(this.shoppingProducts)) {\n throw new exceptions_1.ComponentElementException(this, 'There are more than one product in combination with price unit, which is not allowed.');\n }\n const text = utilities_1.PriceUtility.getPriceUnit(this.shoppingProducts, this.getSettings().localisation.useMetricMeasures);\n if (!text) {\n return null;\n }\n return (0, web_component_1.html) `
 /${text}
`;\n }\n /**\n * Gets the energy class.\n *\n * @returns Template.\n */\n getEprelLink() {\n if (!this.showEnergyLabel) {\n return null;\n }\n if (this.shoppingProducts.length !== 1) {\n throw new exceptions_1.ComponentElementException(this, 'There are more than one product in combination with energy label, which is not allowed.');\n }\n const link = utilities_1.ProductUtility.getProductInformationSheetLink(this.shoppingProducts[0].product);\n if (link === null && !this.getFicheHeader(this.shoppingProducts[0].product)) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: { visibleModal: PriceModuleModalEnum_1.default.energyFicheCard }\n }))}\"\n\t\t\t\t@modalClose=\"${() => this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }))}\"\n\t\t\t>\n\t\t\t\n\t\t`;\n }\n /**\n * Gets the water efficiency class.\n *\n * @returns Template.\n */\n getWaterEfficiencyClass() {\n if (!this.showEnergyLabel) {\n return null;\n }\n if (this.shoppingProducts.length !== 1) {\n throw new exceptions_1.ComponentElementException(this, 'There are more than one product in combination with water compliance, which is not allowed.');\n }\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }))}\"\n\t\t\t\t@modalOpen=\"${() => this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: { visibleModal: PriceModuleModalEnum_1.default.unifiedWaterLabelCard }\n }))}\"\n\t\t\t>\n\t\t\t\n\t\t`;\n }\n /**\n * Gets the Chile SEC link.\n *\n * @returns Template.\n */\n getChileSecLink() {\n var _a, _b, _c;\n if (!this.showEnergyLabel) {\n return null;\n }\n if (this.shoppingProducts.length !== 1) {\n throw new exceptions_1.ComponentElementException(this, 'There are more than one product in combination with energy label, which is not allowed.');\n }\n const secLabels = (_c = (_b = (_a = this.shoppingProducts[0].product) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.complianceLabel) === null || _c === void 0 ? void 0 : _c.filter((complianceLabelItem) => complianceLabelItem.labelType === enums_1.ProductComplianceLabelTypeEnum.chileSecLabel);\n if (!secLabels || secLabels.length === 0) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: { visibleModal: PriceModuleModalEnum_1.default.energySecCard }\n }))}\"\n\t\t\t\t@modalClose=\"${() => this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }))}\"\n\t\t\t>\n\t\t\t\n\t\t`;\n }\n /**\n * Return Fiche header if exists.\n *\n * @param product\n */\n getFicheHeader(product) {\n var _a, _b, _c;\n return ((_c = (_b = (_a = product === null || product === void 0 ? void 0 : product.content) === null || _a === void 0 ? void 0 : _a.complianceTechnical) === null || _b === void 0 ? void 0 : _b.find((info) => info.headingType === enums_1.ProductComplianceTechnicalHeadingTypeEnum.nonRescaled)) === null || _c === void 0 ? void 0 : _c.headingText);\n }\n /**\n * Gets the energy class.\n *\n * @returns Template.\n */\n getEnergyEfficiencyClass() {\n if (!this.showEnergyLabel) {\n return null;\n }\n if (this.shoppingProducts.length !== 1) {\n throw new exceptions_1.ComponentElementException(this, 'There are more than one product in combination with energy label, which is not allowed.');\n }\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }))}\"\n\t\t\t\t@modalOpen=\"${() => this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: { visibleModal: PriceModuleModalEnum_1.default.energyLabelCard }\n }))}\"\n\t\t\t>\n\t\t\t\n\t\t`;\n }\n /**\n * Returns text.\n *\n * @param totalPrice Price model.\n * @returns Template.\n */\n getText(totalPrice) {\n let elements = [];\n if (totalPrice) {\n const primaryCurrency = totalPrice[0];\n const baseElements = [\n this.getPreviousPriceText(totalPrice),\n this.getValidInterval(primaryCurrency),\n this.getGeneralPriceDisclaimer()\n ];\n const loyaltyProgramEqualFontSize = this.getSettings().kompis.priceSettings.loyaltyProgramEqualFontSize;\n if (loyaltyProgramEqualFontSize) {\n elements = [\n this.getLowestPreviousSalesPrice(totalPrice[0]),\n this.getRegularPriceText(totalPrice),\n this.getPriceExclTax(primaryCurrency),\n ...baseElements\n ];\n }\n else {\n elements = [\n this.getLowestPreviousSalesPrice(totalPrice[0]),\n this.getPriceExclTax(primaryCurrency),\n this.getRegularPriceText(totalPrice),\n ...baseElements\n ];\n }\n }\n elements.push([this.getEprelLink(), this.getChileSecLink()]);\n if (elements.some((element) => element !== null)) {\n return (0, web_component_1.html) `\n\t\t\t\t\n\t\t\t\t\t${elements}\n\t\t\t\t\n\t\t\t`;\n }\n return null;\n }\n getLowestPreviousSalesPriceInclTax() {\n var _a, _b, _c;\n if (!this.showLowestPreviousSalesPrice) {\n return null;\n }\n if (this.shoppingProducts.length !== 1) {\n throw new exceptions_1.ComponentElementException(this, 'There are more than one product in combination with lowest previous sales price, which is not allowed.');\n }\n return ((_c = (_b = (_a = this.shoppingProducts[0].product.content) === null || _a === void 0 ? void 0 : _a.priceInformation) === null || _b === void 0 ? void 0 : _b.salesPrice.map((price) => { var _a; return (_a = price.lowestPreviousSalesPrice) === null || _a === void 0 ? void 0 : _a.priceInclTax; }).find((lowestPreviousSalesPriceInclTax) => !!lowestPreviousSalesPriceInclTax)) !== null && _c !== void 0 ? _c : null);\n }\n getLowestPreviousSalesPrice(totalPrice) {\n const lowestPreviousSalesPriceInclTax = this.getLowestPreviousSalesPriceInclTax();\n if (lowestPreviousSalesPriceInclTax === null) {\n return null;\n }\n const { priceInfoLowestPreviousSalesPrice } = this.getTranslations();\n if (this.shoppingProducts.length) {\n return (0, web_component_1.html) `
\n\t\t\t\t${priceInfoLowestPreviousSalesPrice}\n\t\t\t\t\n\t\t\t
`;\n }\n return null;\n }\n /**\n * Returns price excl tax.\n *\n * @param totalPrice Price model.\n * @returns Template.\n */\n getPriceExclTax(totalPrice) {\n if (!this.showPriceExclTax) {\n return null;\n }\n const excludingTax = this.getTranslations().excludingTax;\n if (!this.getSettings().kompis.priceSettings.showPriceExcludingTax) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t${excludingTax}\n\t\t\t
\n\t\t`;\n }\n /**\n * Returns regular price.\n * If \"loyaltyProgramEqualFontSize\" is true, the font size is the same as for the loyalty program price.\n *\n * @param totalPrice Price model.\n * @returns Template.\n */\n getRegularPriceText(totalPrice) {\n if (!utilities_1.PriceUtility.isFamily(totalPrice[0])) {\n return null;\n }\n const translations = this.getTranslations();\n if (this.getSettings().kompis.priceSettings.loyaltyProgramEqualFontSize) {\n return (0, web_component_1.html) `\n\t\t\t\t\n\t\t\t\t\t${translations.priceInfoRegularPrice}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t${this.getPriceUnit()}\n\t\t\t\t\t
\n\t\t\t\t\n\t\t\t`;\n }\n return this.getPricesFromTotalPrice(totalPrice, translations.priceInfoRegularPrice);\n }\n /**\n * Returns previous price.\n *\n * @param totalPrice Price model.\n * @returns Template.\n */\n getPreviousPriceText(totalPrice) {\n const lowestPreviousSalesPriceInclTax = this.getLowestPreviousSalesPriceInclTax();\n if ((utilities_1.PriceUtility.isNewLowerPrice(totalPrice[0]) && utilities_1.PriceUtility.isFamily(totalPrice[0])) ||\n !utilities_1.PriceUtility.isNewLowerPrice(totalPrice[0]) ||\n lowestPreviousSalesPriceInclTax) {\n return null;\n }\n const priceInfoPreviousPrice = this.getTranslations().priceInfoPreviousPrice;\n return this.getPricesFromTotalPrice(totalPrice, priceInfoPreviousPrice);\n }\n /**\n * Returns valid interval.\n *\n * @param totalPrice Price model.\n * @returns Template.\n */\n getValidInterval(totalPrice) {\n const validInterval = utilities_1.PriceUtility.getValidInterval(totalPrice, undefined, this.getTranslations(), this.getSettings());\n return validInterval ? (0, web_component_1.html) `
${validInterval}
` : null;\n }\n /**\n * Returns general price disclaimer.\n *\n * @returns Template.\n */\n getGeneralPriceDisclaimer() {\n const { kompis: { priceSettings } } = this.getSettings();\n if (!priceSettings.showGeneralPriceDisclaimer) {\n return null;\n }\n return (0, web_component_1.html) `
${this.getTranslations().generalPriceDisclaimer}
`;\n }\n /**\n * Returns eco fee.\n *\n * @param totalPrice Price model.\n * @returns Template.\n */\n getEcoFee(totalPrice) {\n if (!this.showEcoFee || (!totalPrice.ecoPrice && !totalPrice.weeePrice)) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t {\n var _a, _b;\n this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }));\n (_b = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.triggerElement) === null || _b === void 0 ? void 0 : _b.focus();\n }}\"\n\t\t\t\t@modalOpen=\"${() => this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: { visibleModal: PriceModuleModalEnum_1.default.ecoFeeCard }\n }))}\"\n\t\t\t>\n\t\t\t\n\t\t`;\n }\n getRepairabilityIndex() {\n if (!this.showRepairabilityIndex) {\n return null;\n }\n if (this.shoppingProducts.length !== 1) {\n throw new exceptions_1.ComponentElementException(this, 'There are more than one product in combination with repairability index, which is not allowed.');\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t {\n this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }));\n }}\"\n\t\t\t\t\t@modalOpen=\"${() => this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: { visibleModal: PriceModuleModalEnum_1.default.repairabilityIndexCard }\n }))}\"\n\t\t\t\t>\n\t\t\t\n\t\t`;\n }\n /**\n * @param product Product.\n */\n onProductNameClick() {\n if (this.productLink !== PriceModuleProductLinkEnum_1.default.disabled) {\n this.dispatchEvent(new CustomEvent('productNameClick', { bubbles: true }));\n }\n }\n onKeyDown(event) {\n if (event.key === 'Enter' || event.key === ' ') {\n this.onClick(event);\n }\n }\n onClick(event) {\n const productNameActionElement = this.shadowRoot.querySelector('.actionElement');\n if (productNameActionElement !== event.target) {\n productNameActionElement === null || productNameActionElement === void 0 ? void 0 : productNameActionElement.click();\n }\n }\n /**\n * Returns product description Skapa class.\n *\n * @returns Class type.\n */\n getProductDescriptionClass() {\n switch (this.layout) {\n case PriceModuleLayoutTypeEnum_1.default.subtle:\n return { body: { s: true } };\n case PriceModuleLayoutTypeEnum_1.default.default:\n case PriceModuleLayoutTypeEnum_1.default.rowPrice:\n case PriceModuleLayoutTypeEnum_1.default.listPrice:\n return { body: { m: true } };\n case PriceModuleLayoutTypeEnum_1.default.emphasized:\n return { body: { l: true } };\n }\n }\n /**\n * Returns product name Skapa class.\n *\n * @returns Class type.\n */\n getProductNameClass() {\n switch (this.layout) {\n case PriceModuleLayoutTypeEnum_1.default.subtle:\n return { body: { s: true } };\n case PriceModuleLayoutTypeEnum_1.default.default:\n case PriceModuleLayoutTypeEnum_1.default.rowPrice:\n case PriceModuleLayoutTypeEnum_1.default.listPrice:\n return { heading: { xs: true } };\n case PriceModuleLayoutTypeEnum_1.default.emphasized:\n return { heading: { s: true } };\n }\n }\n /**\n * Returns price text type.\n *\n * @param isPrimaryCurrency\n * @param isTRO\n * @returns Text type.\n */\n getPriceTextType(isPrimaryCurrency, isTRO) {\n switch (this.layout) {\n case PriceModuleLayoutTypeEnum_1.default.subtle:\n return enums_1.ThemeFontStyleTypeEnum.priceXSmall;\n case PriceModuleLayoutTypeEnum_1.default.default:\n return isPrimaryCurrency || isTRO\n ? enums_1.ThemeFontStyleTypeEnum.priceXLarge\n : enums_1.ThemeFontStyleTypeEnum.priceMedium;\n case PriceModuleLayoutTypeEnum_1.default.emphasized:\n return isPrimaryCurrency || isTRO\n ? enums_1.ThemeFontStyleTypeEnum.priceXXLarge\n : enums_1.ThemeFontStyleTypeEnum.priceLarge;\n case PriceModuleLayoutTypeEnum_1.default.rowPrice:\n return enums_1.ThemeFontStyleTypeEnum.priceSmall;\n case PriceModuleLayoutTypeEnum_1.default.listPrice:\n return isPrimaryCurrency || isTRO\n ? enums_1.ThemeFontStyleTypeEnum.priceLarge\n : enums_1.ThemeFontStyleTypeEnum.priceSmall;\n }\n }\n /**\n * Returns if price is mixed size.\n *\n * @param isPrimaryCurrency\n * @param isTRO\n * @returns Mixed size.\n */\n getPriceMixedSize(isPrimaryCurrency, isTRO) {\n switch (this.layout) {\n case PriceModuleLayoutTypeEnum_1.default.subtle:\n case PriceModuleLayoutTypeEnum_1.default.rowPrice:\n return false;\n case PriceModuleLayoutTypeEnum_1.default.listPrice:\n if (!isPrimaryCurrency && !isTRO) {\n return false;\n }\n }\n return true;\n }\n /**\n * Returns regular price text type.\n *\n * @returns Text type.\n */\n getRegularPriceTextType() {\n switch (this.layout) {\n case PriceModuleLayoutTypeEnum_1.default.subtle:\n case PriceModuleLayoutTypeEnum_1.default.default:\n case PriceModuleLayoutTypeEnum_1.default.rowPrice:\n case PriceModuleLayoutTypeEnum_1.default.listPrice:\n return enums_1.ThemeFontStyleTypeEnum.priceXSmall;\n case PriceModuleLayoutTypeEnum_1.default.emphasized:\n return enums_1.ThemeFontStyleTypeEnum.priceSmall;\n }\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], PriceModule.prototype, \"shoppingProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], PriceModule.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], PriceModule.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], PriceModule.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], PriceModule.prototype, \"layout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], PriceModule.prototype, \"productName\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], PriceModule.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PriceModule.prototype, \"underline\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PriceModule.prototype, \"animated\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PriceModule.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PriceModule.prototype, \"disableFocusStyle\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PriceModule.prototype, \"showEcoFee\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PriceModule.prototype, \"showPriceUnit\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PriceModule.prototype, \"showEnergyLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PriceModule.prototype, \"showRepairabilityIndex\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PriceModule.prototype, \"showPriceExclTax\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], PriceModule.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], PriceModule.prototype, \"productLink\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PriceModule.prototype, \"isFromPrice\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PriceModule.prototype, \"isCombinedProduct\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PriceModule.prototype, \"showLowestPreviousSalesPrice\", void 0);\nPriceModule = __decorate([\n (0, web_component_1.customElement)('kompis-price-module')\n], PriceModule);\nexports.default = PriceModule;\n//# sourceMappingURL=PriceModule.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PriceModuleUtility = exports.PriceModuleProductLinkEnum = exports.PriceModuleModalEnum = exports.PriceModuleLayoutTypeEnum = exports.PriceModule = void 0;\nconst PriceModule_1 = __importDefault(require(\"./components/price-module/PriceModule\"));\nexports.PriceModule = PriceModule_1.default;\nconst PriceModuleLayoutTypeEnum_1 = __importDefault(require(\"./enums/PriceModuleLayoutTypeEnum\"));\nexports.PriceModuleLayoutTypeEnum = PriceModuleLayoutTypeEnum_1.default;\nconst PriceModuleModalEnum_1 = __importDefault(require(\"./enums/PriceModuleModalEnum\"));\nexports.PriceModuleModalEnum = PriceModuleModalEnum_1.default;\nconst PriceModuleProductLinkEnum_1 = __importDefault(require(\"./enums/PriceModuleProductLinkEnum\"));\nexports.PriceModuleProductLinkEnum = PriceModuleProductLinkEnum_1.default;\nconst PriceModuleUtility_1 = __importDefault(require(\"./utilities/PriceModuleUtility\"));\nexports.PriceModuleUtility = PriceModuleUtility_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\n/**\n * Quantity style.\n */\nclass QuantityStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.isDisabled Disabled.\n * @param options.position Position.\n * @param options.direction Direction.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n return (0, web_component_1.css) `\n\t\t\t${themes_1.FontStyle.getStyle({\n type: enums_1.ThemeFontStyleTypeEnum.bodyMedium,\n theme: options.theme\n })}\n\t\t\t${this.getHover(options)}\n\t\t\t${this.getTypeStyle(options)}\n\t\t\t${this.getRtlStyle(options)}\n\t\t\t${this.getFocusStyle(options)}\n\t\t\t${options.isDisabled ? this.getDisabled(options) : ''}\n\t\t\t${this.getPrintStyle()}\n\t\t`;\n }\n /**\n * @param options Options object.\n * @param options.theme Theme.\n * @param options.position Position.\n * @param options.isDisabled\n * @returns Styles.\n */\n static getTypeStyle(options) {\n const { color, border, spacing, motion } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\tselect {\n\t\t\t\tdisplay: block;\n\t\t\t\t-webkit-appearance: none;\n\t\t\t\t-moz-appearance: none;\n\t\t\t\tappearance: none;\n\t\t\t\tmargin: 0;\n\t\t\t\toutline: 0;\n\t\t\t\ttext-indent: 0;\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t\twidth: ${90 / 16}rem;\n\t\t\t\tpadding: ${spacing.space50 / 16}rem ${36 / 16}rem ${spacing.space50 / 16}rem\n\t\t\t\t\t${spacing.space125 / 16}rem;\n\t\t\t\tbackground: ${color.neutral.white};\n\t\t\t\t-moz-border-radius: ${border.radius.radius64 / 16}rem;\n\t\t\t\t-webkit-border-radius: ${border.radius.radius64 / 16}rem;\n\t\t\t\tborder-radius: ${border.radius.radius64 / 16}rem;\n\t\t\t\tborder: ${1 / 16}rem solid ${color.border.light};\n\t\t\t\tline-height: ${22 / 16}rem;\n\t\t\t\tfont-size: inherit;\n\t\t\t\ttransition-property: color, border, transform;\n\t\t\t\ttransition-duration: ${motion.duration.small};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t}\n\t\t\tselect:active {\n\t\t\t\tborder-color: ${color.border.dark};\n\t\t\t}\n\t\t\tselect:focus {\n\t\t\t\tborder-color: ${color.border.dark};\n\t\t\t}\n\t\t\tkompis-icon {\n\t\t\t\tposition: absolute;\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\ttop: calc(50% - ${3 / 16}rem);\n\t\t\t\tright: ${spacing.space125 / 16}rem;\n\n\t\t\t\tpointer-events: none;\n\t\t\t\ttransition-property: color, transform;\n\t\t\t\ttransition-duration: ${motion.duration.small};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t\tcolor: ${color.icon.default};\n\t\t\t}\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\t\t\t.dropdown {\n\t\t\t\tposition: relative;\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n\t\t\t.dropdown:focus {\n\t\t\t\toutline: none;\n\t\t\t}\n\t\t\t.outline {\n\t\t\t\tposition: absolute;\n\t\t\t\tleft: 0;\n\t\t\t\ttop: 0;\n\t\t\t\tright: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\tz-index: inherit;\n\t\t\t\tborder-radius: ${border.radius.radius64 / 16}rem;\n\t\t\t\tpointer-events: none;\n\t\t\t\ttransition-property: top, left, right, bottom, opacity;\n\t\t\t\ttransition-duration: ${motion.duration.small};\n\t\t\t\topacity: ${options.hasFocus ? 1 : 0};\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns hover effect.\n *\n * @param options Options object.\n * @param options.theme Theme.\n * @returns Css code.\n */\n static getHover(options) {\n const { color } = options.theme;\n if (options.hasFocus) {\n return '';\n }\n return (0, web_component_1.css) `\n\t\t\t@media (pointer: fine) {\n\t\t\t\tselect:hover {\n\t\t\t\t\tborder-color: ${color.neutral.grey500};\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n /**\n * @param options\n * @param options.theme\n * @param options.isDisabled\n */\n static getRtlStyle(options) {\n const { spacing } = options.theme;\n const { direction } = options;\n if (direction === 'rtl') {\n return (0, web_component_1.css) `\n\t\t\t\t:host kompis-icon {\n\t\t\t\t\tleft: ${spacing.space125 / 16}rem;\n\t\t\t\t\tright: auto;\n\t\t\t\t}\n\t\t\t\t:host select {\n\t\t\t\t\tpadding: ${spacing.space50 / 16}rem ${spacing.space125 / 16}rem ${spacing.space50 / 16}rem\n\t\t\t\t\t\t${36 / 16}rem;\n\t\t\t\t}\n\t\t\t\t:host-context kompis-icon {\n\t\t\t\t\tleft: ${spacing.space125 / 16}rem;\n\t\t\t\t\tright: auto;\n\t\t\t\t}\n\t\t\t\t:host-context select {\n\t\t\t\t\tpadding: ${spacing.space50 / 16}rem ${spacing.space125 / 16}rem ${spacing.space50 / 16}rem\n\t\t\t\t\t\t${36 / 16}rem;\n\t\t\t\t}\n\t\t\t`;\n }\n return (0, web_component_1.css) `\n\t\t\t:host(:dir(rtl)) kompis-icon {\n\t\t\t\tright: auto;\n\t\t\t\tleft: ${spacing.space125 / 16}rem;\n\t\t\t}\n\t\t\t:host(:dir(rtl)) select {\n\t\t\t\tpadding: ${spacing.space50 / 16}rem ${spacing.space125 / 16}rem ${spacing.space50 / 16}rem\n\t\t\t\t\t${36 / 16}rem;\n\t\t\t\tdirection: rtl;\n\t\t\t}\n\t\t\t:host-context([dir='rtl']) kompis-icon {\n\t\t\t\tright: auto;\n\t\t\t\tleft: ${spacing.space125 / 16}rem;\n\t\t\t}\n\t\t\t:host-context([dir='rtl']) select {\n\t\t\t\tpadding: ${spacing.space50 / 16}rem ${spacing.space125 / 16}rem ${spacing.space50 / 16}rem\n\t\t\t\t\t${36 / 16}rem;\n\t\t\t\tdirection: rtl;\n\t\t\t}\n\t\t`;\n }\n /**\n * @param options\n * @param options.theme\n * @param options.isDisabled\n */\n static getDisabled(options) {\n const { color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\tselect {\n\t\t\t\tborder-color: ${color.neutral.grey200};\n\t\t\t\tcolor: ${color.neutral.grey200};\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\tkompis-icon {\n\t\t\t\tcolor: ${color.neutral.grey200};\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns the style for focusing the button.\n *\n * @param options Options.\n * @returns Styles.\n */\n static getFocusStyle(options) {\n if (!options.hasFocus) {\n return '';\n }\n return (0, web_component_1.css) `\n\t\t\t${this.getOutlineStyle(options)}\n\t\t`;\n }\n /**\n * Returns the outline style when focusing.\n *\n * @param options Options.\n * @returns Styles.\n */\n static getOutlineStyle(options) {\n const { focusOutline } = options.theme;\n if (!options.hasFocus) {\n return '';\n }\n return (0, web_component_1.css) `\n\t\t\t.outline {\n\t\t\t\tbox-shadow: 0 0 0 0.1rem ${focusOutline.color};\n\t\t\t\tleft: -${focusOutline.offset / 16}rem;\n\t\t\t\ttop: -${focusOutline.offset / 16}rem;\n\t\t\t\tright: -${focusOutline.offset / 16}rem;\n\t\t\t\tbottom: -${focusOutline.offset / 16}rem;\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns the outline style when focusing.\n *\n * @returns Styles.\n */\n static getPrintStyle() {\n return (0, web_component_1.css) `\n\t\t\t@media print {\n\t\t\t\tselect,\n\t\t\t\tselect:active,\n\t\t\t\tselect:hover,\n\t\t\t\tselect:focus {\n\t\t\t\t\tborder: 0;\n\t\t\t\t\tfont-weight: bold;\n\t\t\t\t\tpadding: 0;\n\t\t\t\t\twidth: auto;\n\t\t\t\t\tflex-direction: column;\n\t\t\t\t\talign-items: flex-end;\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t}\n\n\t\t\t\t:host(:dir(rtl)) select {\n\t\t\t\t\tpadding: 0;\n\t\t\t\t}\n\n\t\t\t\t:host-context([dir='rtl']) select {\n\t\t\t\t\tpadding: 0;\n\t\t\t\t}\n\n\t\t\t\t.outline,\n\t\t\t\tkompis-icon,\n\t\t\t\tselect * {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\n\t\t\t\t.dropdown:after {\n\t\t\t\t\tcontent: 'x';\n\t\t\t\t\tfont-weight: bold;\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = QuantityStyle;\n//# sourceMappingURL=QuantityStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst icons_1 = require(\"@inter-ikea-kompis/icons\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@inter-ikea-kompis/component-icon\");\nrequire(\"@inter-ikea-kompis/component-text\");\nconst QuantityStyle_1 = __importDefault(require(\"./QuantityStyle\"));\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n *\n * @event change Emits when the quantity value changes\n */\nlet Quantity = class Quantity extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Set the select to disabled state.\n this.disabled = false;\n // Minimum selectable value.\n this.min = 0;\n // Maximum selectable value.\n this.max = 100;\n // Set the value of the field.\n this.value = 0;\n this.hasFocus = false;\n this.pointerIsDown = false;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n const direction = utilities_1.SafariWriteDirectionUtility.getWriteDirection(this);\n const values = [];\n for (let i = this.min; i <= this.max; i++) {\n values.push(i);\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t${values.map((value) => (0, web_component_1.html) ``)}\n\t\t\t\t\t\n\t\t\t\t\t${this.getChevronIcon()}\n\t\t\t\t
\n\t\t\t
\n\t\t`;\n }\n /**\n * Runs when change event occurs.\n *\n * @param event HTMLEvent.\n */\n onChange(event) {\n const target = event.target;\n const value = Number(target.value);\n this.dispatchEvent(new CustomEvent('change', {\n bubbles: true,\n detail: {\n value\n }\n }));\n }\n /**\n * Gets the chevron icon.\n *\n * @returns Template.\n */\n getChevronIcon() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n }\n /**\n * HTML event handler.\n */\n onFocusOut() {\n this.hasFocus = false;\n this.pointerIsDown = false;\n this.update();\n }\n /**\n * HTML event handler.\n */\n onFocus() {\n if (this.pointerIsDown) {\n return;\n }\n this.hasFocus = true;\n this.update();\n }\n /**\n * HTML event handler.\n *\n * @param event HTMLEvent.\n */\n onPointerDown() {\n this.pointerIsDown = true;\n if (this.hasFocus) {\n this.hasFocus = false;\n this.update();\n }\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Quantity.prototype, \"disabled\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], Quantity.prototype, \"min\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], Quantity.prototype, \"max\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], Quantity.prototype, \"value\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Quantity.prototype, \"theme\", void 0);\nQuantity = __decorate([\n (0, web_component_1.customElement)('kompis-quantity')\n], Quantity);\nexports.default = Quantity;\n//# sourceMappingURL=Quantity.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Quantity = void 0;\nconst Quantity_1 = __importDefault(require(\"./components/quantity/Quantity\"));\nexports.Quantity = Quantity_1.default;\n//# sourceMappingURL=index.js.map","// @ts-ignore\nconst style = '@keyframes skapa-shine{to{background-position:0 100%}}:host{animation:skapa-shine 2s 20;background-color:rgb(var(--colour-neutral-3,223,223,223));background-image:linear-gradient(90deg,rgba(var(--colour-neutral-1,255,255,255),0) 40%,rgba(var(--colour-neutral-2,245,245,245),.5) 50%,rgba(var(--colour-neutral-1,255,255,255),0) 60%);background-origin:border-box;background-position:100% 0;background-repeat:no-repeat;background-size:250% 100%;border:1px solid #0000;box-sizing:border-box;cursor:progress;display:inline-block;height:1em;line-height:inherit;width:100%}:host([skapa-rtl]){animation-direction:reverse}';\n// @ts-ignore\nconst lightStyles = '@keyframes skapa-shine{to{background-position:0 100%}}';\nimport { prefixReplacer, RTLObserver, PredefinitionPropertyHandler } from '@ingka/webc-tools';\nlet template;\nlet lightStyle;\nfunction getTemplate() {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = prefixReplacer(`\n \n \n \n `);\n lightStyle = document.createElement('style');\n lightStyle.slot = 'light-styles';\n lightStyle.innerHTML = prefixReplacer(lightStyles.toString());\n }\n return template;\n}\nexport class Skeleton extends HTMLElement {\n constructor() {\n super();\n PredefinitionPropertyHandler.gatherProperties(['width', 'height'], this);\n const shadow = this.attachShadow({ mode: 'open' });\n shadow.append(getTemplate().content.cloneNode(true));\n this.lightStyleNode = lightStyle.cloneNode(true);\n }\n connectedCallback() {\n PredefinitionPropertyHandler.initGatheredProperties(this);\n this.append(this.lightStyleNode);\n RTLObserver.addTarget(this);\n }\n disconnectedCallback() {\n RTLObserver.removeTarget(this);\n }\n get width() {\n return this.getAttribute('width') || '100%';\n }\n set width(value) {\n this.setAttribute('width', value);\n }\n get height() {\n return this.getAttribute('height') || '1em';\n }\n set height(value) {\n this.setAttribute('height', value);\n }\n attributeChangedCallback(name, oldValue, newValue) {\n if (newValue !== null)\n this.style.setProperty(name, newValue);\n else\n this.style.removeProperty(name);\n }\n}\nSkeleton.observedAttributes = ['width', 'height'];\n","import define from '@ingka/webc-tools';\nimport { Skeleton } from './src/Skeleton.js';\nexport { Skeleton };\nexport const skeletonTagName = define('skeleton', Skeleton);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ImageAspectRatioEnum;\n(function (ImageAspectRatioEnum) {\n ImageAspectRatioEnum[\"ORIGINAL\"] = \"original\";\n ImageAspectRatioEnum[\"SQUARE\"] = \"square\";\n})(ImageAspectRatioEnum || (ImageAspectRatioEnum = {}));\nexports.default = ImageAspectRatioEnum;\n//# sourceMappingURL=ImageAspectRatioEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst ImageAspectRatioEnum_1 = __importDefault(require(\"../../enums/ImageAspectRatioEnum\"));\n/**\n * ImageStyle.\n */\nclass ImageStyle {\n /**\n * Returns style.\n *\n * @param imageStyleOptions\n * @param imageStyleOptions.isProductImage True if the image is from Ric.\n * @param imageStyleOptions.isLoading True if loading.\n * @param imageStyleOptions.aspectRatio\n * @param imageStyleOptions.offsetWidth\n * @returns Style.\n */\n static getStyle(imageStyleOptions) {\n var _a;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\twidth: 100%;\n\t\t\t\tobject-fit: contain;\n\t\t\t}\n\n\t\t\timg {\n\t\t\t\tobject-fit: inherit;\n\t\t\t\twidth: inherit;\n\t\t\t\theight: inherit;\n\t\t\t\topacity: ${imageStyleOptions.isLoading ? '0' : '1'};\n\t\t\t}\n\n\t\t\t${imageStyleOptions.isProductImage ? this.getProductImage() : ''}\n\t\t\t${(_a = this.getImageAspectRatioStyle(imageStyleOptions)) !== null && _a !== void 0 ? _a : ''}\n\t\t`;\n }\n /**\n * Returns RIC style.\n *\n * @returns Ric style.\n */\n static getProductImage() {\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t\tposition: relative;\n\t\t\t\tpadding-top: 100%;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\t\t\timg {\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\tright: 0;\n\t\t\t}\n\t\t`;\n }\n /**\n * @param options\n * @param options.aspectRatio\n * @param options.offsetWidth\n */\n static getImageAspectRatioStyle({ aspectRatio, offsetWidth }) {\n if (aspectRatio === ImageAspectRatioEnum_1.default.SQUARE) {\n return (0, web_component_1.css) `\n\t\t\t\t:host {\n\t\t\t\t\tobject-fit: cover;\n\t\t\t\t}\n\t\t\t\timg {\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\theight: ${offsetWidth}px;\n\t\t\t\t\tobject-position: center;\n\t\t\t\t}\n\t\t\t`;\n }\n return null;\n }\n}\nexports.default = ImageStyle;\n//# sourceMappingURL=ImageStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst utilities_2 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@ingka/skeleton-webc\");\nconst ImageAspectRatioEnum_1 = __importDefault(require(\"../../enums/ImageAspectRatioEnum\"));\nconst ImageStyle_1 = __importDefault(require(\"./ImageStyle\"));\nconst TRANSPARENT_PIXEL_DATA_URL = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=';\n/**\n *\n * Image class.\n */\nlet Image = class Image extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Image source.\n this.src = null;\n // Alternative text for the image.\n this.alt = null;\n // The aspect ratio that the image should adopt.\n this.aspectRatio = ImageAspectRatioEnum_1.default.ORIGINAL;\n // The quality of the image compression done in Akamai. This is currently only supported by images under \"/addon-app/\".\n this.quality = null;\n // \tApplies cropping to the image in order to prevent white borders on certain product images. The image will also be placed in a square container, while still keeping its original aspect ratio.\n this.productImage = false;\n // \tAdds a square skeleton animation while the image is loading.\n this.enableSkeletonLoading = false;\n this.resizeObserver = new ResizeObserver(this.onResize.bind(this));\n this.debounce = new utilities_1.DebounceManager();\n this.currentSrc = null;\n this.imageWidth = 0;\n this.loadingImage = null;\n this.loadedSrc = null;\n this.listeners = {\n onResize: this.onResize.bind(this)\n };\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n const styleOptions = {\n isProductImage: this.productImage,\n isLoading: !!this.loadingImage,\n aspectRatio: this.aspectRatio,\n offsetWidth: this.offsetWidth\n };\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getImage()}\n\t\t`;\n }\n /**\n * Triggered when the component is inserted to DOM.\n */\n connectedCallback() {\n super.connectedCallback();\n /**\n *\tThis listener was added because of a bug with ResizeListener in Chromium.\n *\tIt should be removed when Chromium fixes this bug.\n */\n window.addEventListener('resize', this.listeners.onResize);\n this.resizeObserver.observe(this);\n }\n /**\n * Triggered when the component is removed from DOM.\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n window.removeEventListener('resize', this.listeners.onResize);\n this.resizeObserver.unobserve(this);\n this.debounce.clearAll();\n this.loadedSrc = null;\n if (this.loadingImage) {\n this.loadingImage.onload = null;\n this.loadingImage.onerror = null;\n this.loadingImage = null;\n }\n }\n /**\n * Returns skeleton HTML.\n *\n * @returns Template.\n */\n getSkeleton() {\n if (!this.loadingImage || !this.enableSkeletonLoading) {\n return null;\n }\n const imageWidth = this.getImageWidth();\n return (0, web_component_1.html) ``;\n }\n /**\n * Returns image HTML.\n *\n * @returns Template.\n */\n getImage() {\n const src = this.getSrc();\n if (!src) {\n return null;\n }\n this.loadImage(src);\n const skeleton = this.getSkeleton();\n return skeleton !== null && skeleton !== void 0 ? skeleton : (0, web_component_1.html) `${this.alt`;\n }\n /**\n * Loads an image.\n *\n * @param src Source.\n */\n loadImage(src) {\n if (src !== this.loadedSrc) {\n if (this.loadingImage) {\n this.loadingImage.onload = null;\n this.loadingImage.onerror = null;\n this.loadingImage = null;\n }\n this.loadedSrc = src;\n this.loadingImage = new window.Image();\n this.loadingImage.onload = () => this.onLoad();\n this.loadingImage.onerror = () => this.onLoad();\n this.loadingImage.src = src;\n }\n }\n /**\n * Handles img load event.\n */\n onLoad() {\n this.loadingImage = null;\n this.update();\n }\n /**\n * Listener for resize events.\n */\n onResize() {\n if (this.offsetWidth !== 0) {\n this.debounce.set('resize', () => this.update(), 10);\n }\n }\n /**\n * Returns the image width.\n *\n * Calculating offset width is a quite expensive operation, so we only want to do it once when needed.\n *\n * @returns Image width in px.\n */\n getImageWidth() {\n return this.productImage ? this.offsetWidth * 1.14 : this.offsetWidth;\n }\n /**\n * Returns the source of the image.\n *\n * @returns Source.\n */\n getSrc() {\n var _a, _b;\n if (!this.src || this.src.startsWith('data:')) {\n return this.src;\n }\n const imageWidth = this.getImageWidth();\n if (!imageWidth) {\n // In order for the image to still get a size, we will return a transparent pixel.\n return TRANSPARENT_PIXEL_DATA_URL;\n }\n if (imageWidth > this.imageWidth || this.src !== this.currentSrc) {\n this.imageWidth = imageWidth;\n this.currentSrc = this.src;\n return utilities_2.ImageUtility.getAkamaiImageUrl(this.src, imageWidth, (_a = this.quality) !== null && _a !== void 0 ? _a : undefined);\n }\n return utilities_2.ImageUtility.getAkamaiImageUrl(this.src, this.imageWidth, (_b = this.quality) !== null && _b !== void 0 ? _b : undefined);\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Image.prototype, \"src\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Image.prototype, \"alt\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Image.prototype, \"aspectRatio\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Image.prototype, \"quality\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Image.prototype, \"productImage\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Image.prototype, \"enableSkeletonLoading\", void 0);\nImage = __decorate([\n (0, web_component_1.customElement)('kompis-image')\n], Image);\nexports.default = Image;\n//# sourceMappingURL=Image.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Image = void 0;\nconst Image_1 = __importDefault(require(\"./components/image/Image\"));\nexports.Image = Image_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass DoNotDiyStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle() {\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\n\t\t\timg {\n\t\t\t\theight: ${64 / 16}rem;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = DoNotDiyStyle;\n//# sourceMappingURL=DoNotDiyStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst DoNotDiyStyle_1 = __importDefault(require(\"./DoNotDiyStyle\"));\n/**\n * Do not DIY component.\n */\nlet DoNotDiy = class DoNotDiy extends web_component_1.KompisElement {\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n const doNotDiyComplianceData = this.getDoNotDiyInfo();\n const svgUrl = doNotDiyComplianceData && this.getSvgUrl(doNotDiyComplianceData);\n if (!svgUrl || !doNotDiyComplianceData) {\n return (0, web_component_1.html) `\n\t\t\t\t\n\t\t\t`;\n }\n const { text: altText } = doNotDiyComplianceData;\n return (0, web_component_1.html) `\n\n\t\t\t${this.getImage(svgUrl, altText)} `;\n }\n getDoNotDiyInfo() {\n var _a, _b;\n const complianceData = (_b = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.complianceTechnical) === null || _b === void 0 ? void 0 : _b.filter((complianceTechnicalItem) => complianceTechnicalItem.headingType === enums_1.ProductComplianceTechnicalHeadingTypeEnum.doNotDiy);\n return complianceData && complianceData[0];\n }\n getSvgUrl(complianceInfo) {\n let MediaEnum;\n (function (MediaEnum) {\n MediaEnum[\"svg\"] = \"00017\";\n })(MediaEnum || (MediaEnum = {}));\n const find = (fileTypeCode) => {\n var _a, _b, _c;\n return ((_c = (_b = (_a = complianceInfo.media) === null || _a === void 0 ? void 0 : _a.find((mediaType) => mediaType.fileTypeCode === fileTypeCode)) === null || _b === void 0 ? void 0 : _b.url) !== null && _c !== void 0 ? _c : null);\n };\n return find(MediaEnum.svg);\n }\n getImage(svgUrl, altText) {\n return (0, web_component_1.html) `\"${altText}\"`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], DoNotDiy.prototype, \"product\", void 0);\nDoNotDiy = __decorate([\n (0, web_component_1.customElement)('kompis-do-not-diy')\n], DoNotDiy);\nexports.default = DoNotDiy;\n//# sourceMappingURL=DoNotDiy.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DoNotDiy = void 0;\nconst DoNotDiy_1 = __importDefault(require(\"./components/do-not-diy/DoNotDiy\"));\nexports.DoNotDiy = DoNotDiy_1.default;\n//# sourceMappingURL=index.js.map","export const indeterminatePath = '';\nexport const unavailablePath = '';\nexport const lowAvailabilityPath = '';\nexport const availablePath = '';\n","// @ts-ignore\nconst styles = ':host{--skapa-status-inner-margin:max(0.5rem,.4em);--min-size:0.75rem;--size:max(var(--min-size),.4em);--border-width:calc(var(--size)/6);align-items:baseline;display:flex}:host svg{background:none;border-radius:var(--size);bottom:max(1ex - var(--size) + var(--border-width)/4,-1 * var(--border-width)/4);color:var(--skapa-status-colour);display:inline-block;flex-basis:var(--size);flex-grow:0;flex-shrink:0;margin-inline-end:var(--skapa-status-inner-margin);order:-1;position:relative;transform:scale(.999);width:var(--size)}:host([position=inline]) svg,:host([position=trailing]) svg{margin-inline-end:unset;margin-inline-start:var(--skapa-status-inner-margin);order:1}:host([position=inline]){display:inline;white-space:nowrap}:host([position=inline]) slot{display:inline;white-space:normal}.glue{font-size:0;white-space:nowrap}:host([small]){--min-size:0.5rem;--border-width:0}:host([small]) svg{background:currentColor}:host([colour=green]){--skapa-status-colour:rgb(var(--colour-semantic-positive,10,138,0))}:host([colour=orange]){--skapa-status-colour:rgb(var(--colour-semantic-caution,242,106,47))}:host([colour=red]){--skapa-status-colour:rgb(var(--colour-semantic-negative,224,7,81))}:host([colour=grey]){--skapa-status-colour:rgb(var(--colour-text-and-icon-4,146,146,146))}';\nimport * as Icons from './elements/icons.js';\nimport { PredefinitionPropertyHandler } from '@ingka/webc-tools';\nconst iconForColour = {\n green: Icons.availablePath,\n orange: Icons.lowAvailabilityPath,\n red: Icons.unavailablePath,\n grey: Icons.indeterminatePath\n};\nlet template;\nfunction getTemplate() {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = ` `;\n }\n return template;\n}\nexport default class Status extends HTMLElement {\n constructor() {\n super();\n this.updateIcon = () => {\n if (this.colour && iconForColour[this.colour])\n this.embeddedSVG.innerHTML = iconForColour[this.colour];\n };\n PredefinitionPropertyHandler.gatherProperties(['colour', 'small', 'position'], this);\n const shadow = this.attachShadow({ mode: 'open' });\n shadow.append(getTemplate().content.cloneNode(true));\n this.embeddedSVG = shadow.querySelector('svg');\n }\n connectedCallback() {\n PredefinitionPropertyHandler.initGatheredProperties(this);\n this.updateIcon();\n }\n get colour() {\n return this.getAttribute('colour');\n }\n set colour(value) {\n if (value)\n this.setAttribute('colour', value);\n else\n this.removeAttribute('colour');\n }\n get small() {\n return this.hasAttribute('small');\n }\n set small(toggle) {\n this.toggleAttribute('small', !!toggle);\n }\n get position() {\n return this.getAttribute('position') || 'leading';\n }\n set position(value) {\n this.setAttribute('position', value || 'leading');\n }\n attributeChangedCallback() {\n // no other observed attributes, but colour\n this.updateIcon();\n }\n}\nStatus.observedAttributes = ['colour'];\n","import define from '@ingka/webc-tools';\nimport Status from './src/Status.js';\nexport { Status };\nexport const statusTagName = define('status', Status);\n","import SkapaElement from '@ingka/skapa-webc-element';\nimport { prefixReplacer, SlotTools } from '@ingka/webc-tools';\n// @ts-ignore\nconst styles = ':host([disabled]){--skapa-form-disabled:rgb(var(--colour-interactive-disabled-1,204,204,204));pointer-events:none}:host([disabled]) *,:host([disabled]) ::slotted(*){color:var(--skapa-form-disabled)}fieldset{border:0}fieldset,legend{margin:0;padding:0}legend{color:rgb(var(--colour-text-and-icon-1,17,17,17));font-weight:700}slot[name=helper-text]:not(.skapa-empty){display:block;padding-top:.5rem}slot[name=group-title]:not(.skapa-empty){display:block;padding-bottom:1rem}@media (forced-colors:active){:host([disabled]){--skapa-form-disabled:GrayText}}';\n// The fieldset will not show up on Form Elements but will be recognised by screen readers.\n// The function of fieldset within Form Elements is as to this day seemingly negligable.\nlet template;\nfunction getTemplate() {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = prefixReplacer(`\n \n
\n \n \n \n
\n `);\n }\n return template;\n}\nconst cacheAttributeName = 'data-skapa-cache-disabled';\nexport class Fieldset extends SkapaElement {\n constructor() {\n super();\n this.handleSlotChange = (ev) => {\n SlotTools.slotChange(ev);\n this.micro(this.syncState, 'sync assigned elements state');\n };\n this.syncState = () => {\n // Get all input and helper-text elements.\n const allAssignedElements = [this.embeddedFieldset, ...this.mainSlot.assignedElements({ flatten: true }).map(el => [el, ...Array.from(el.querySelectorAll(`input, ${prefixReplacer('skapa-helper-text')}`))]).flat(2), ...this.helperSlot.assignedElements({ flatten: true })];\n const syncDisableStateFunction = this.disabled ? disableAndCache : restoreCache;\n allAssignedElements.forEach(el => {\n // and toggle the disabled attribute on them.\n syncDisableStateFunction(el);\n el.toggleAttribute('subtle', this.subtle);\n });\n };\n this.gatherProperties(['subtle', 'disabled'], this);\n const shadow = this.shadow = this.attachShadow({ mode: 'open' });\n shadow.append(getTemplate().content.cloneNode(true));\n this.mainSlot = shadow.querySelector('#main-slot');\n this.helperSlot = shadow.querySelector('slot[name=helper-text]');\n this.embeddedFieldset = shadow.querySelector('fieldset');\n }\n static get observedAttributes() {\n return ['disabled'];\n }\n connectedCallback() {\n super.connectedCallback();\n Array.from(this.shadow.querySelectorAll('slot')).map(SlotTools.checkSlot);\n this.shadow.addEventListener('slotchange', this.handleSlotChange);\n this.syncState();\n }\n attributeChangedCallback(name, oldVal, newVal) {\n if (name === 'disabled') {\n if (!(newVal === null) === !(oldVal === null))\n return; // don't bother if its all the same.\n this.syncState();\n }\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.shadow.removeEventListener('slotchange', SlotTools.slotChange);\n }\n get subtle() {\n return this.hasAttribute('subtle');\n }\n set subtle(value) {\n this.toggleAttribute('subtle', !!value);\n }\n get disabled() {\n return this.hasAttribute('disabled');\n }\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n}\nfunction disableAndCache(el) {\n // If the field is disabled, do nothing.\n if (el.hasAttribute('disabled'))\n return;\n // Flag the field as disabled by the fieldset.\n el.toggleAttribute(cacheAttributeName, true);\n // disable field.\n el.toggleAttribute('disabled', true);\n}\nfunction restoreCache(el) {\n if (el.hasAttribute(cacheAttributeName)) {\n // enable field if and only if it was disabled by the fieldset.\n el.removeAttribute('disabled');\n el.removeAttribute(cacheAttributeName);\n }\n}\n","import define from '@ingka/webc-tools';\nimport { Fieldset } from './src/Fieldset.js';\nexport { Fieldset };\nexport const fieldSetTagName = define('fieldset', Fieldset);\n","import SkapaElement from '@ingka/skapa-webc-element';\nimport '@ingka/fieldset-webc';\nimport { prefixReplacer } from '@ingka/webc-tools';\n// @ts-ignore\nconst styles = ':host{--skapa-checkbox-label:rgb(var(--colour-text-and-icon-2,72,72,72));--skapa-checkbox-background:rgb(var(--colour-neutral-1,255,255,255));--skapa-checkbox-background-checked:rgb(var(--colour-interactive-emphasised-bg-default,0,88,163));--skapa-checkbox-background-checked-hover:rgb(var(--colour-interactive-emphasised-bg-hover,0,79,147));--skapa-checkbox-background-active:rgb(var(--colour-interactive-emphasised-bg-pressed,0,62,114));--skapa-checkbox-border:rgb(var(--colour-interactive-subtle-border-default,146,146,146));--skapa-checkbox-border-hover:rgb(var(--colour-interactive-subtle-border-hover,17,17,17));--skapa-checkbox-border-checked:rgb(var(--colour-interactive-emphasised-bg-default,0,88,163));--skapa-checkbox-border-checked-hover:rgb(var(--colour-interactive-emphasised-bg-hover,0,79,147));--skapa-checkbox-border-active:rgb(var(--colour-interactive-emphasised-bg-pressed,0,62,114));--skapa-checkbox-tick-colour:#0000;font-size:.875rem;line-height:1.571}:host([subtle]){--skapa-checkbox-background-subtle:rgb(var(--colour-interactive-primary-bg-default,17,17,17))}.container{column-gap:var(--skapa-input-group-column-gap,1rem);display:grid;grid-template-columns:1.5rem 1fr;position:relative;row-gap:var(--skapa-input-group-row-gap,1.5rem)}:host([disabled]){--skapa-checkbox-disabled:rgb(var(--colour-interactive-disabled-1,204,204,204));--skapa-checkbox-tick-colour:#0000;pointer-events:none}:host([disabled]) ::slotted(input:checked),:host([disabled]) ::slotted(input:indeterminate){--skapa-checkbox-tick-colour:rgb(var(--colour-interactive-disabled-2,146,146,146))}::slotted(input),::slotted(label){cursor:pointer}::slotted(input[type=checkbox].focus-visible){box-shadow:0 0 0 4px var(--skapa-focus-ring-internal,rgb(var(--colour-neutral-1,255,255,255)));outline:2px solid var(--skapa-focus-ring-external,rgb(var(--colour-neutral-7,17,17,17)));outline:2px solid rgb(var(--colour-neutral-7,17,17,17))!important;outline-offset:4px;transition:outline .2s ease-out,box-shadow .2s ease-out}::slotted(input){-webkit-appearance:none;appearance:none;background-color:var(--skapa-checkbox-background);border:.0625rem solid var(--skapa-checkbox-disabled,var(--skapa-checkbox-border));border-radius:.25rem;box-sizing:border-box;display:block;height:1.5rem;margin:0;margin-inline-end:1rem;position:relative;width:1.5rem}::slotted(input):after{border:.125rem solid var(--skapa-checkbox-tick-colour,#0000);border-right:none;border-top:none;box-sizing:border-box;content:\"\";display:block;height:.40625rem;left:.375rem;margin-top:-.0625rem;position:absolute;top:.46875rem;transform:rotate(-45deg);transition:opacity .1s cubic-bezier(.4,0,.4,1);transition-property:border-color,opacity;width:.663125rem}::slotted(input:indeterminate):after{border-left-width:0;height:0;top:.6875rem;transform:rotate(0)}::slotted(input:hover:not([disabled])){--skapa-checkbox-border:var(--skapa-checkbox-border-hover);--skapa-checkbox-tick-colour:rgb(var(--colour-neutral-3,223,223,223))}::slotted(input:checked),::slotted(input:indeterminate){--skapa-checkbox-border:var(--skapa-checkbox-background-subtle,var(--skapa-checkbox-border-checked));--skapa-checkbox-background:var(--skapa-checkbox-disabled,var(--skapa-checkbox-background-subtle,var(--skapa-checkbox-background-checked)));--skapa-checkbox-tick-colour:rgb(var(--colour-neutral-1,255,255,255))}:host(:not([subtle])) ::slotted(input:checked),:host(:not([subtle])) ::slotted(input:indeterminate){--skapa-checkbox-tick-colour:rgb(var(--colour-static-white,255,255,255))}::slotted(input:checked:hover:not([disabled])),::slotted(input:indeterminate:hover:not([disabled])){--skapa-checkbox-border:var(--skapa-checkbox-background-subtle,var(--skapa-checkbox-border-checked-hover));--skapa-checkbox-background:var(--skapa-checkbox-disabled,var(--skapa-checkbox-background-subtle,var(--skapa-checkbox-background-checked-hover)));--skapa-checkbox-tick-colour:rgb(var(--colour-neutral-1,255,255,255))}:host(:not([subtle])) ::slotted(input:checked:hover:not([disabled])),:host(:not([subtle])) ::slotted(input:indeterminate:hover:not([disabled])){--skapa-checkbox-tick-colour:rgb(var(--colour-static-white,255,255,255))}::slotted(input:active:not([disabled])){--skapa-checkbox-border:var(--skapa-checkbox-background-subtle,var(--skapa-checkbox-border-active));--skapa-checkbox-background:var(--skapa-checkbox-background-subtle,var(--skapa-checkbox-background-active))}::slotted(input):before{box-sizing:border-box;content:\"\";cursor:pointer;height:2.75rem;margin:-.6875rem;position:absolute;width:2.75rem;z-index:2}::slotted(label){color:var(--skapa-checkbox-disabled,var(--skapa-checkbox-label));display:inline-block;line-height:1.571}@media (forced-colors:active){:host([disabled]){--skapa-checkbox-disabled:GrayText}}';\n// @ts-ignore\nconst lightStylesRaw = 'skapa-checkbox-group>input:disabled,skapa-checkbox-group>input:disabled+label{--skapa-radio-button-disabled:rgb(var(--colour-interactive-disabled-1,204,204,204));--skapa-checkbox-disabled:rgb(var(--colour-interactive-disabled-1,204,204,204));color:rgb(var(--colour-interactive-disabled-1,204,204,204));pointer-events:none}@media (forced-colors:active){skapa-checkbox-group>input:disabled,skapa-checkbox-group>input:disabled+label{--skapa-radio-button-disabled:GrayText;--skapa-checkbox-disabled:GrayText;color:GrayText}}skapa-checkbox-group>label>skapa-caption{color:rgb(var(--colour-text-and-icon-2,72,72,72));color:rgb(var(--colour-text-and-icon-3,118,118,118));display:block;font-family:inherit;font-size:.75rem;line-height:1.5;padding-top:.25rem}skapa-checkbox-group[disabled]>label>skapa-caption{color:rgb(var(--colour-interactive-disabled-1,204,204,204))}';\nlet template;\nlet lightNode;\nfunction getTemplate() {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = prefixReplacer(`\n \n \n \n \n \n \n \n `);\n lightNode = document.createElement('style');\n lightNode.slot = 'light-styles';\n lightNode.textContent = prefixReplacer(lightStylesRaw.toString());\n }\n return template;\n}\nexport class CheckboxGroup extends SkapaElement {\n constructor() {\n super();\n this.handleSlotChange = (ev) => {\n var _a;\n if (((_a = ev.target) === null || _a === void 0 ? void 0 : _a.name) === 'light-styles')\n return;\n this.syncFieldset();\n this.syncAutoId();\n };\n this.syncFieldset = () => {\n this.fieldSet.toggleAttribute('disabled', this.disabled);\n };\n this.syncAutoId = () => {\n if (this.autoID) {\n const idPrefix = this.autoID;\n const labels = Array.from(this.querySelectorAll('label'));\n const inputs = Array.from(this.querySelectorAll('input'));\n const helper = this.querySelector(prefixReplacer('skapa-helper-text'));\n if (inputs.length && labels.length) {\n if (helper)\n helper.id = `${idPrefix}-helper`;\n inputs.forEach((input, i) => {\n if (!input.hasAttribute('type'))\n input.type = 'checkbox';\n input.id = `${idPrefix}-${i}`;\n if (helper)\n input.setAttribute('aria-describedby', helper.id);\n const label = labels[i];\n if (label)\n label.setAttribute('for', input.id);\n });\n }\n }\n };\n this.gatherProperties(['subtle', 'disabled', 'autoID'], this);\n const shadow = this.shadow = this.attachShadow({ mode: 'open' });\n shadow.append(getTemplate().content.cloneNode(true));\n this.fieldSet = shadow.querySelector(prefixReplacer('skapa-fieldset'));\n this.lightCSS = lightNode.cloneNode(true);\n this.safariFix = document.createElement('style');\n this.safariFix.slot = 'light-styles';\n this.safariFix.innerHTML = 'input[type=checkbox]:checked {}'; // Bug filed at: https://bugs.webkit.org/show_bug.cgi?id=249706\n }\n static get observedAttributes() {\n return ['disabled', 'auto-id'];\n }\n connectedCallback() {\n super.connectedCallback();\n this.append(this.safariFix); // Since there is a single local instance of it, there always only be one added.\n this.syncFieldset();\n this.syncAutoId();\n this.shadow.addEventListener('slotchange', this.handleSlotChange);\n this.append(this.lightCSS);\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.shadow.removeEventListener('slotchange', this.handleSlotChange);\n }\n attributeChangedCallback(name) {\n if (name === 'disabled')\n this.syncFieldset();\n else if (name === 'auto-id')\n this.syncAutoId();\n }\n get subtle() {\n return this.hasAttribute('subtle');\n }\n set subtle(value) {\n this.toggleAttribute('subtle', !!value);\n }\n get disabled() {\n return this.hasAttribute('disabled');\n }\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n get autoID() {\n return this.getAttribute('auto-id');\n }\n set autoID(value) {\n if (value)\n this.setAttribute('auto-id', value);\n else\n this.removeAttribute('auto-id');\n }\n}\n","import define from '@ingka/webc-tools';\nimport { CheckboxGroup } from './src/CheckboxGroup.js';\nexport { CheckboxGroup };\nexport const radioButtonTagName = define('checkbox-group', CheckboxGroup);\n","// @ts-ignore\nconst styles = ':host{display:inline-block;font-size:.75rem}:host([label]:not([label=\"\"])):before{color:rgb(var(--colour-text-and-icon-2,72,72,72));content:attr(label);display:block;line-height:1.5;margin-bottom:.5rem}:host([value]:not([value=\"\"])):after,slot{background-color:rgb(var(--colour-neutral-7,17,17,17));border:1px solid rgb(var(--colour-neutral-7,17,17,17));color:rgb(var(--colour-text-and-icon-5,255,255,255));content:attr(value);display:inline-block;font-weight:700;line-height:1.25;padding:calc(.25rem - 1px) calc(.75rem - 1px)}@media print{:host([value]:not([value=\"\"])):after,slot{background-color:initial;border-color:rgb(var(--colour-static-black,17,17,17));color:rgb(var(--colour-static-black,17,17,17))}}:host([subtle]) slot,:host([subtle][value]:not([value=\"\"])):after{background-color:rgb(var(--colour-neutral-2,245,245,245));border-color:rgb(var(--colour-neutral-2,245,245,245));color:rgb(var(--colour-text-and-icon-1,17,17,17))}:host([value]:not([value=\"\"])) slot{display:none}';\nconst _template = document.createElement('template');\n_template.innerHTML = ``;\nimport { PredefinitionPropertyHandler } from '@ingka/webc-tools';\nexport class ProductIdentifier extends HTMLElement {\n constructor() {\n super();\n PredefinitionPropertyHandler.gatherProperties(['label', 'value', 'subtle'], this);\n const shadow = this.attachShadow({ mode: 'open' });\n shadow.appendChild(_template.content.cloneNode(true));\n }\n connectedCallback() {\n PredefinitionPropertyHandler.initGatheredProperties(this);\n }\n get label() {\n return this.getAttribute('label');\n }\n set label(label) {\n if (label)\n this.setAttribute('label', label);\n else\n this.removeAttribute('label');\n }\n get value() {\n return this.getAttribute('value');\n }\n set value(value) {\n if (value)\n this.setAttribute('value', value);\n else\n this.removeAttribute('value');\n }\n get subtle() {\n return this.hasAttribute('subtle');\n }\n set subtle(toggle) {\n this.toggleAttribute('subtle', !!toggle);\n }\n}\nexport default ProductIdentifier;\n","import define from '@ingka/webc-tools';\nimport ProductIdentifier from './src/ProductIdentifier.js';\nexport { ProductIdentifier };\nexport const productIdentifierTagName = define('product-identifier', ProductIdentifier);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('trash-can', [{ tag: 'path', att: { d: 'M13 9h2v8h-2V9zm-2 0H9v8h2V9z' } }, { tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M15.4892 5c-.0258-.577-.1265-1.2552-.5198-1.819C14.3653 2.315 13.3219 2 11.9981 2c-1.3531 0-2.4193.3063-3.0168 1.1953-.2761.4109-.3861.8584-.4359 1.2488-.0234.1833-.0352.3719-.0412.5559H3v2h2v14h14V7h2V5h-5.5108zm-4.9598-.303a3.551 3.551 0 0 0-.0239.303h2.9782c-.0229-.371-.0736-.5586-.1546-.6747C13.284 4.2607 13.0774 4 11.9981 4c-1.1451 0-1.3289.2693-1.3568.311-.0367.0545-.0833.161-.1119.386zM17 7H7v12h10V7z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('plus-small', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M10.998 13v4h2v-4h4v-2h-4V7h-2v4h-4v2h4z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@ingka/product-identifier-webc\");\nclass ProductRowUtility {\n static getStoreAvailability(options) {\n const { product, storeAvailabilities } = options;\n if (!product.content || !product.valid || !storeAvailabilities) {\n return null;\n }\n return (storeAvailabilities.find((storeAvailability) => {\n var _a, _b;\n return (((_a = product.content) === null || _a === void 0 ? void 0 : _a.itemNoLocal) === storeAvailability.content.itemNo ||\n ((_b = product.content) === null || _b === void 0 ? void 0 : _b.itemNoGlobal) === storeAvailability.content.itemNo);\n }) || null);\n }\n static getQuantityField(options) {\n const { shoppingProduct, isCompactLayout, translations } = options;\n const quantity = `${shoppingProduct.quantity}`;\n return (0, web_component_1.html) `\n\t\t\t
\n\t\t\t\t

\n\t\t\t\t\t${translations.quantity + ', ' + quantity}\n\t\t\t\t\t${quantity}x\n\t\t\t\t

\n\t\t\t
\n\t\t`;\n }\n static getArticleNumber(options) {\n const { product, isSpr, isCompactLayout, showItemNo, translations } = options;\n if (!showItemNo && !isCompactLayout) {\n return null;\n }\n const { content, itemId } = product;\n const { productArticleNo } = translations;\n let formattedItemNo;\n if (content === null || content === void 0 ? void 0 : content.ruItemNo) {\n formattedItemNo = utilities_1.ProductUtility.formatItemNo(content.ruItemNo);\n }\n else {\n formattedItemNo = utilities_1.ProductUtility.formatItemNo(itemId.split('-').reverse()[0]);\n }\n return (0, web_component_1.html) `\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t${formattedItemNo}\n\t\t\t\t\n\t\t\t\t${this.getVisuallyHiddenProductIdentifier({ formattedItemNo, translations })}\n\t\t\t
\n\t\t`;\n }\n static getVisuallyHiddenProductIdentifier(options) {\n const { translations, formattedItemNo } = options;\n const productArticleNo = translations.productArticleNo;\n return (0, web_component_1.html) `${productArticleNo + ' ' + formattedItemNo}`;\n }\n static getLocation(options) {\n var _a, _b, _c;\n const { storeAvailability, displayStoreAvailability, isCompactLayout, translations } = options;\n if (!storeAvailability && !displayStoreAvailability) {\n return null;\n }\n const salesLocation = ((_c = (_b = (_a = storeAvailability === null || storeAvailability === void 0 ? void 0 : storeAvailability.content) === null || _a === void 0 ? void 0 : _a.cashCarry) === null || _b === void 0 ? void 0 : _b.salesLocations) === null || _c === void 0 ? void 0 : _c[0]) || {};\n const isDepartment = salesLocation.type === enums_1.SalesTypeCodeEnum.department && (salesLocation === null || salesLocation === void 0 ? void 0 : salesLocation.departmentName);\n if (salesLocation.type === enums_1.SalesTypeCodeEnum.aisleAndBin &&\n salesLocation.aisle &&\n salesLocation.bin) {\n return this.getSelfServeLocation({ salesLocation, translations, isCompactLayout });\n }\n const { productSalesLocation, contactCoWorker } = translations;\n const text = isDepartment ? salesLocation.departmentName : contactCoWorker;\n return (0, web_component_1.html) `\n\t\t\t
\n\t\t\t\t${productSalesLocation + ' ' + text}\n\t\t\t\t${!isCompactLayout\n ? (0, web_component_1.html) `

\n\t\t\t\t\t\t\t${productSalesLocation}\n\t\t\t\t\t

`\n : null}\n\t\t\t\t

${text}

\n\t\t\t
\n\t\t`;\n }\n static getSelfServeLocation(options) {\n const { salesLocation, translations, isCompactLayout } = options;\n const { productSalesAisle, productSalesLocation } = translations;\n return (0, web_component_1.html) `\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t${`${productSalesAisle} ${salesLocation.aisle}. ${productSalesLocation} ${salesLocation.bin}.`}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t${salesLocation.aisle}\n\t\t\t\t\n\n\t\t\t\t
\n\n\t\t\t\t\n\t\t\t\t\t${salesLocation.bin}\n\t\t\t\t\n\t\t\t
\n\t\t`;\n }\n}\nexports.default = ProductRowUtility;\n//# sourceMappingURL=ProductRowUtility.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nclass CompactProductRowStyle {\n static getStyle(options) {\n const { theme } = options;\n const { spacing, color } = theme;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\n\t\t\tp {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\tkompis-price-formatter,\n\t\t\tskapa-product-identifier,\n\t\t\tp {\n\t\t\t\tfont-size: ${10 / 16}rem !important;\n\t\t\t}\n\n\t\t\t.visuallyHidden {\n\t\t\t\tborder: 0 !important;\n\t\t\t\tclip: rect(${1 / 16}rem, ${1 / 16}rem, ${1 / 16}rem, ${1 / 16}rem) !important;\n\t\t\t\t-webkit-clip-path: inset(50%) !important;\n\t\t\t\tclip-path: inset(50%) !important;\n\t\t\t\theight: ${1 / 16}rem !important;\n\t\t\t\tmargin: -${1 / 16}rem !important;\n\t\t\t\toverflow: hidden !important;\n\t\t\t\tpadding: 0 !important;\n\t\t\t\tposition: absolute !important;\n\t\t\t\twidth: ${1 / 16}rem !important;\n\t\t\t\twhite-space: nowrap !important;\n\t\t\t\ttop: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\tleft: 0;\n\t\t\t\tright: 0;\n\t\t\t\t-webkit-user-select: none;\n\t\t\t\tuser-select: none;\n\t\t\t}\n\t\t\t.compactPrice,\n\t\t\t.quantity p {\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\n\t\t\t.selfServeLocationContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\n\t\t\t.locationText {\n\t\t\t\tmargin: 0;\n\t\t\t\tfont-weight: bold;\n\t\t\t\tmargin-top: ${3 / 20}rem;\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\n\t\t\t.productIdentifiers {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\n\t\t\t.productIdentifierDivider {\n\t\t\t\twidth: ${spacing.space75 / 16}rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t}\n\n\t\t\t.compactWrapper {\n\t\t\t\tdisplay: grid;\n\t\t\t\t/* This style is the same as in product list, to make the grid match the product list headers. */\n\t\t\t\tgrid-template-columns: ${30 / 16}rem 1fr ${83 / 16}rem ${86 / 16}rem ${60 / 16}rem ${80 /\n 16}rem ${80 / 16}rem;\n\t\t\t\tgap: 0 ${spacing.space75 / 16}rem;\n\t\t\t\talign-items: center;\n\t\t\t\tfont-size: ${12 / 16}rem;\n\t\t\t}\n\t\t\t.compactPriceWrapper:last-of-type {\n\t\t\t\ttext-align: end;\n\t\t\t}\n\t\t\tkompis-price-formatter:last-of-type {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tjustify-self: end;\n\t\t\t}\n\t\t\t.compactCommercialMessage,\n\t\t\t.productName {\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t\tfont-weight: bold;\n\t\t\t}\n\t\t\t.quantity {\n\t\t\t\tfont-weight: unset;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = CompactProductRowStyle;\n//# sourceMappingURL=CompactProductRowStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@inter-ikea-kompis/component-price-formatter\");\nconst ProductRowUtility_1 = __importDefault(require(\"../../utilities/ProductRowUtility\"));\nconst CompactProductRowStyle_1 = __importDefault(require(\"./CompactProductRowStyle\"));\n/**\n * Compact Product row component.\n */\nlet CompactProductRow = class CompactProductRow extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Store availabilities.\n this.storeAvailabilities = null;\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n this.dexfSettings = null;\n }\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n const product = this.shoppingProduct.product;\n const storeAvailability = ProductRowUtility_1.default.getStoreAvailability({\n product: product,\n storeAvailabilities: this.storeAvailabilities\n });\n return (0, web_component_1.html) ` \n\t\t\t
\n\t\t\t\t${ProductRowUtility_1.default.getQuantityField({\n shoppingProduct: this.shoppingProduct,\n isCompactLayout: true,\n translations: this.getTranslations()\n })}${this.getProductNameAndDescription(product)}${ProductRowUtility_1.default.getLocation({\n storeAvailability,\n displayStoreAvailability: true,\n isCompactLayout: true,\n translations: this.getTranslations()\n })}\n\t\t\t\t${ProductRowUtility_1.default.getArticleNumber({\n product,\n isSpr: false,\n isCompactLayout: true,\n showItemNo: true,\n translations: this.getTranslations()\n })}\n\t\t\t\t${this.getWeight(product)} ${this.getCompactPrice({ quantity: 1, product })}\n\t\t\t\t${this.getCompactPrice(this.shoppingProduct)}\n\t\t\t
`;\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n getSettings() {\n return this.dexfSettings;\n }\n getProductNameAndDescription(product) {\n var _a;\n return (0, web_component_1.html) `\n\t\t\t

\n\t\t\t\t${(_a = product.content) === null || _a === void 0 ? void 0 : _a.name}\n\t\t\t\t${this.getProductDescription(product)}\n\t\t\t

\n\t\t`;\n }\n getProductDescription(product) {\n const description = utilities_1.ProductDescriptionUtility.getDescription({\n settings: this.getSettings(),\n translations: this.getTranslations(),\n product,\n include: {\n productMeasures: utilities_1.ProductDescriptionProductMeasureEnum.short,\n designText: true\n }\n });\n return description;\n }\n getWeight(product) {\n const productWeight = utilities_1.ProductDescriptionUtility.getProductWeight({\n settings: this.getSettings(),\n translations: this.getTranslations(),\n product\n });\n return (0, web_component_1.html) `

${productWeight}

`;\n }\n getCompactPrice(shoppingProduct) {\n var _a;\n const priceInformation = (_a = shoppingProduct.product.content) === null || _a === void 0 ? void 0 : _a.priceInformation;\n if (priceInformation) {\n const totalPrice = utilities_1.TotalPriceCalculator.calculate([shoppingProduct], this.getSettings().localisation.dateFormat);\n const isSingleProduct = shoppingProduct.quantity === 1;\n const { priceInfoIkeaFamilyPrice, priceInfoRegularPrice, productListTotalPriceSummary } = this.getTranslations();\n const rowUnitPrice = totalPrice.inclTax;\n const rowTotalPrice = utilities_1.PriceUtility.getPrice(totalPrice);\n if (totalPrice.family) {\n return (0, web_component_1.html) `\n\t\t\t\t\t
\n\t\t\t\t\t\t${!isSingleProduct\n ? (0, web_component_1.html) ` ${productListTotalPriceSummary}. `\n : null}\n\t\t\t\t\t\t

${priceInfoIkeaFamilyPrice}

\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t

\n\t\t\t\t\t\t

${priceInfoRegularPrice}

\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t`;\n }\n return (0, web_component_1.html) `\n\t\t\t\t
\n\t\t\t\t\t${isSingleProduct ? priceInfoRegularPrice : productListTotalPriceSummary}\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t`;\n }\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], CompactProductRow.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], CompactProductRow.prototype, \"shoppingProduct\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], CompactProductRow.prototype, \"storeAvailabilities\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], CompactProductRow.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], CompactProductRow.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], CompactProductRow.prototype, \"settings\", void 0);\nCompactProductRow = __decorate([\n (0, web_component_1.customElement)('kompis-compact-product-row')\n], CompactProductRow);\nexports.default = CompactProductRow;\n//# sourceMappingURL=CompactProductRow.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ProductRowLayoutEnum;\n(function (ProductRowLayoutEnum) {\n ProductRowLayoutEnum[\"default\"] = \"default\";\n ProductRowLayoutEnum[\"compactPrint\"] = \"compactPrint\";\n})(ProductRowLayoutEnum || (ProductRowLayoutEnum = {}));\nexports.default = ProductRowLayoutEnum;\n//# sourceMappingURL=ProductRowLayoutEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ProductRowOptionalStateEnum;\n(function (ProductRowOptionalStateEnum) {\n ProductRowOptionalStateEnum[\"mandatory\"] = \"mandatory\";\n ProductRowOptionalStateEnum[\"addable\"] = \"addable\";\n ProductRowOptionalStateEnum[\"removableFromList\"] = \"removableFromList\";\n ProductRowOptionalStateEnum[\"removableFromTab\"] = \"removableFromTab\";\n})(ProductRowOptionalStateEnum || (ProductRowOptionalStateEnum = {}));\nexports.default = ProductRowOptionalStateEnum;\n//# sourceMappingURL=ProductRowOptionalStateEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ProductRowProductLinkEnum;\n(function (ProductRowProductLinkEnum) {\n ProductRowProductLinkEnum[\"disabled\"] = \"disabled\";\n ProductRowProductLinkEnum[\"productInformationPage\"] = \"productInformationPage\";\n ProductRowProductLinkEnum[\"eventOnly\"] = \"eventOnly\";\n})(ProductRowProductLinkEnum || (ProductRowProductLinkEnum = {}));\nexports.default = ProductRowProductLinkEnum;\n//# sourceMappingURL=ProductRowProductLinkEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ProductRowProductMeasureEnum;\n(function (ProductRowProductMeasureEnum) {\n ProductRowProductMeasureEnum[\"none\"] = \"none\";\n ProductRowProductMeasureEnum[\"short\"] = \"short\";\n ProductRowProductMeasureEnum[\"long\"] = \"long\";\n})(ProductRowProductMeasureEnum || (ProductRowProductMeasureEnum = {}));\nexports.default = ProductRowProductMeasureEnum;\n//# sourceMappingURL=ProductRowProductMeasureEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nconst ProductRowOptionalStateEnum_1 = __importDefault(require(\"../../enums/ProductRowOptionalStateEnum\"));\nconst IMAGE_SIZE = 64;\nclass ProductRowStyle {\n static getStyle(options) {\n const { theme, optionalState, isDiscontinued, hasDualCurrencies, isMobile, showStockStatusOnPrint, isSpr } = options;\n const { spacing, color, breakpoint } = theme;\n const { headingXSmall } = breakpoint.small.fontStyle;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\t\t\t${common_styles_webc_1.FocusRing.CSS}\n\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t\tpage-break-inside: avoid;\n\t\t\t\tbreak-inside: avoid;\n\t\t\t}\n\n\t\t\tp {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t.visuallyHidden {\n\t\t\t\tborder: 0 !important;\n\t\t\t\tclip: rect(${1 / 16}rem, ${1 / 16}rem, ${1 / 16}rem, ${1 / 16}rem) !important;\n\t\t\t\t-webkit-clip-path: inset(50%) !important;\n\t\t\t\tclip-path: inset(50%) !important;\n\t\t\t\theight: ${1 / 16}rem !important;\n\t\t\t\tmargin: -${1 / 16}rem !important;\n\t\t\t\toverflow: hidden !important;\n\t\t\t\tpadding: 0 !important;\n\t\t\t\tposition: absolute !important;\n\t\t\t\twidth: ${1 / 16}rem !important;\n\t\t\t\twhite-space: nowrap !important;\n\t\t\t\ttop: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\tleft: 0;\n\t\t\t\tright: 0;\n\t\t\t\t-webkit-user-select: none;\n\t\t\t\tuser-select: none;\n\t\t\t}\n\n\t\t\tli {\n\t\t\t\tlist-style-type: none;\n\t\t\t}\n\t\t\tul {\n\t\t\t\tmargin: 0;\n\t\t\t\tpadding: 0;\n\t\t\t\tflex: 1;\n\t\t\t}\n\n\t\t\ta.productContent {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\t.productContent {\n\t\t\t\ttext-decoration: none;\n\t\t\t\tposition: relative;\n\t\t\t\tcursor: pointer;\n\t\t\t}\n\n\t\t\t.productName {\n\t\t\t\tfont-weight: bold;\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\n\t\t\t.productContent:hover .productName {\n\t\t\t\ttext-decoration: underline;\n\t\t\t}\n\n\t\t\t.mainProduct .row {\n\t\t\t\tdisplay: grid;\n\t\t\t\tgrid-gap: 0 ${spacing.space100 / 16}rem;\n\t\t\t\tgrid-template-columns: ${IMAGE_SIZE / 16}rem 2.5fr min-content ${optionalState !==\n ProductRowOptionalStateEnum_1.default.addable &&\n optionalState !== ProductRowOptionalStateEnum_1.default.removableFromTab\n ? '1fr'\n : ''};\n\t\t\t\tpadding-bottom: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.mainProduct .row:last-child {\n\t\t\t\tpadding-bottom: 0;\n\t\t\t}\n\n\t\t\t.mainProduct .row .quantityContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: ${optionalState === ProductRowOptionalStateEnum_1.default.removableFromList\n ? 'center'\n : 'start'};\n\t\t\t}\n\n\t\t\t.checkboxLabel {\n\t\t\t\tmargin-right: 1rem;\n\t\t\t\tmargin-left: 1rem;\n\t\t\t\tmargin-top: ${2 / 16}rem;\n\t\t\t\tfont-size: ${headingXSmall.size / 16}rem;\n\t\t\t\tcolor: ${color.text.default};\n\t\t\t}\n\n\t\t\t.quantity {\n\t\t\t\twhite-space: nowrap;\n\t\t\t\tfont-weight: bold;\n\t\t\t}\n\n\t\t\t.selfServeLocationContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\n\t\t\t.mainProduct .row > *:last-child {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\t.mainProduct .row:first-child skapa-product-identifier {\n\t\t\t\tpadding-top: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.mainProduct .row > .totalPrice {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: ${hasDualCurrencies ? 'column' : 'row-reverse'};\n\t\t\t\t${hasDualCurrencies ? 'align-items: flex-end' : ''};\n\t\t\t}\n\n\t\t\t.mainProduct .availabilityStatusIndicators {\n\t\t\t\tmargin-top: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.includedProducts {\n\t\t\t\tbackground-color: ${color.background.alt};\n\t\t\t\tmargin-top: ${spacing.space150 / 16}rem;\n\t\t\t}\n\n\t\t\t.includedProducts .includedProductsExpander {\n\t\t\t\tpadding: ${spacing.space50 / 16}rem ${spacing.space75 / 16}rem;\n\t\t\t}\n\n\t\t\t.includedProducts .spaceContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\n\t\t\t.includedProducts .spaceContainer > div:first-child {\n\t\t\t\twidth: ${spacing.space200 / 16}rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tflex-grow: 0;\n\t\t\t}\n\n\t\t\t.includedProducts .spaceContainer > div:last-child {\n\t\t\t\tflex-shrink: 1;\n\t\t\t\tflex-grow: 1;\n\t\t\t\tpadding: ${spacing.space75 / 16}rem 0;\n\t\t\t}\n\n\t\t\t.includedProducts .includedProduct {\n\t\t\t\tpadding: ${spacing.space75 / 16}rem ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.includedProducts .includedProduct .row {\n\t\t\t\tdisplay: grid;\n\t\t\t\tgrid-gap: ${spacing.space100 / 16}rem;\n\t\t\t\tgrid-template-columns: 1fr min-content;\n\t\t\t\tpadding-bottom: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.includedProducts .includedProduct .row:last-child {\n\t\t\t\tpadding-bottom: 0;\n\t\t\t}\n\n\t\t\t.mainProduct.discontinued .productName,\n\t\t\t.includedProduct.discontinued .productName,\n\t\t\t.mainProduct.discontinued .productDescription,\n\t\t\t.includedProduct.discontinued .productDescription,\n\t\t\t.mainProduct.discontinued .productImage,\n\t\t\t.includedProduct.discontinued .productImage,\n\t\t\t.mainProduct.discontinued .quantity {\n\t\t\t\topacity: 0.4;\n\t\t\t}\n\n\t\t\t.productImage {\n\t\t\t\theight: fit-content;\n\t\t\t}\n\n\t\t\t.productImageEventOnly {\n\t\t\t\theight: fit-content;\n\t\t\t}\n\n\t\t\t.productImageEventOnly:hover {\n\t\t\t\tcursor: pointer;\n\t\t\t}\n\n\t\t\t.includedProducts .includedProduct .collect,\n\t\t\t.mainProduct .collect {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: flex-end;\n\t\t\t\tjustify-content: flex-end;\n\t\t\t\twhite-space: nowrap;\n\t\t\t}\n\n\t\t\t.mainProduct .row .removeFromListButton {\n\t\t\t\tpadding: 0 ${spacing.space125 / 16}rem;\n\t\t\t}\n\n\t\t\t.productDescription {\n\t\t\t\tcolor: ${color.text.default};\n\t\t\t}\n\n\t\t\t.includedProductsExpander {\n\t\t\t\tcursor: pointer;\n\t\t\t}\n\n\t\t\t.totalPrice kompis-text,\n\t\t\t.quantity p {\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\n\t\t\t.totalPrice kompis-text:nth-child(odd):not(:last-child) {\n\t\t\t\tmargin-bottom: ${spacing.space25 / 16}rem;\n\t\t\t}\n\n\t\t\t${isDiscontinued ? this.getDisabledStyle(isSpr, color) : ''}\n\t\t\t${isMobile ? this.getMobileStyle(theme) : ''}\n\t\t\t${this.getPrintStyle(theme, showStockStatusOnPrint)}\n\n\t\t\t.locationLabel {\n\t\t\t\tmargin-bottom: ${spacing.space50 / 16}rem;\n\t\t\t\tcolor: ${color.text.default};\n\t\t\t}\n\n\t\t\t.locationText {\n\t\t\t\tfont-weight: bold;\n\t\t\t\tmargin-top: ${3 / 20}rem;\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\n\t\t\t.productIdentifiers {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\n\t\t\t.locationContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\t.productIdentifierDivider {\n\t\t\t\twidth: ${spacing.space75 / 16}rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t}\n\n\t\t\t${options.isMobile ? this.getMobileStyle(theme) : ''}\n\t\t\t${this.getPrintStyle(theme, showStockStatusOnPrint)}\n\n\t\t\t.checkboxWrapper {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\n\t\t\tskapa-status {\n\t\t\t\tmin-height: ${22 / 16}rem;\n\t\t\t}\n\n\t\t\tkompis-do-not-diy {\n\t\t\t\tmargin-top: ${spacing.space25 / 16}rem;\n\t\t\t}\n\t\t`;\n }\n static getDisabledStyle(isSpr = false, color) {\n const fontColor = isSpr ? color.disabled.default : color.neutral.white;\n const backgroundColor = isSpr ? color.background.alt : color.disabled.default;\n return (0, web_component_1.css) `\n\t\t\tskapa-product-identifier::after {\n\t\t\t\tcolor: ${fontColor};\n\t\t\t\tbackground-color: ${backgroundColor};\n\t\t\t\tborder-color: ${backgroundColor};\n\t\t\t}\n\t\t`;\n }\n static getMobileStyle(theme) {\n const { spacing } = theme;\n return (0, web_component_1.css) `\n\t\t\t.mainProduct .row {\n\t\t\t\tgrid-template-columns: ${IMAGE_SIZE / 16}rem 2fr;\n\t\t\t\tgrid-gap: 0 ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.mainProduct > *:last-child {\n\t\t\t\tpadding-bottom: 0;\n\t\t\t}\n\n\t\t\t.mainProduct .row > .totalPrice {\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: flex-end;\n\t\t\t\tjustify-content: center;\n\t\t\t}\n\n\t\t\t.mainProduct kompis-collapsible {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\t.includedProducts {\n\t\t\t\tmargin-top: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.includedProducts .includedProduct .row {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\t.mainProduct .addButton,\n\t\t\t.mainProduct .removeFromTabButton {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: flex-end;\n\t\t\t\tjustify-content: flex-end;\n\t\t\t}\n\t\t`;\n }\n static getPrintStyle(theme, showStockStatusOnPrint) {\n const { color, spacing } = theme;\n return (0, web_component_1.css) `\n\t\t\t@media print {\n\t\t\t\t.mainProduct .row {\n\t\t\t\t\tgrid-gap: ${spacing.space100 / 16}rem ${spacing.space100 / 16}rem;\n\t\t\t\t}\n\n\t\t\t\t.includedProducts .includedProduct,\n\t\t\t\t.includedProducts .includedProduct .row:last-child {\n\t\t\t\t\tpadding-bottom: 0;\n\t\t\t\t}\n\n\t\t\t\tskapa-status {\n\t\t\t\t\tdisplay: ${showStockStatusOnPrint ? 'flex' : 'none'};\n\t\t\t\t}\n\n\t\t\t\t.includedProducts {\n\t\t\t\t\tbackground-color: ${color.background.default};\n\t\t\t\t\tmargin-top: ${spacing.space100 / 16}rem;\n\t\t\t\t\tpadding: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = ProductRowStyle;\n//# sourceMappingURL=ProductRowStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_price_module_1 = require(\"@inter-ikea-kompis/component-price-module\");\nconst component_text_toggle_1 = require(\"@inter-ikea-kompis/component-text-toggle\");\nrequire(\"@inter-ikea-kompis/component-price-formatter\");\nrequire(\"@inter-ikea-kompis/component-quantity\");\nrequire(\"@inter-ikea-kompis/component-text-toggle\");\nrequire(\"@inter-ikea-kompis/component-collapsible\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@inter-ikea-kompis/component-image\");\nrequire(\"@inter-ikea-kompis/component-price-module\");\nrequire(\"@inter-ikea-kompis/component-do-not-diy\");\nrequire(\"@ingka/status-webc\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/checkbox-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/product-identifier-webc\");\nrequire(\"@ingka/inline-message-webc\");\nrequire(\"@ingka/icon-store/trash-can\");\nrequire(\"@ingka/icon-store/plus-small\");\nrequire(\"@ingka/icon-store/warning-triangle\");\nrequire(\"../compact-product-row/CompactProductRow\");\nconst ProductRowLayoutEnum_1 = __importDefault(require(\"../../enums/ProductRowLayoutEnum\"));\nconst ProductRowOptionalStateEnum_1 = __importDefault(require(\"../../enums/ProductRowOptionalStateEnum\"));\nconst ProductRowProductLinkEnum_1 = __importDefault(require(\"../../enums/ProductRowProductLinkEnum\"));\nconst ProductRowProductMeasureEnum_1 = __importDefault(require(\"../../enums/ProductRowProductMeasureEnum\"));\nconst ProductRowUtility_1 = __importDefault(require(\"../../utilities/ProductRowUtility\"));\nconst ProductRowStyle_1 = __importDefault(require(\"./ProductRowStyle\"));\n/**\n * Product row component.\n *\n * @event quantity Triggered when the quantity is changed.\n * @event expand Triggered when included shopping products gets expanded.\n * @event collect Triggered when a product is collected.\n * @event add Triggered when a product is added.\n * @event remove Triggered when a product is removed.\n * @event productImageClick Triggered when the user clicks on a product image.\n * @event productNameClick Triggered when the user clicks on a product name.\n * @event modalClose Triggered when the modal has been closed\n * @event modalOpen Triggered when a modal has been opened. event.detail.type tells you the type\n */\nlet ProductRow = class ProductRow extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Included shopping product.\n this.includedProducts = null;\n // Store availabilities.\n this.storeAvailabilities = null;\n // Online availabilities.\n this.zipAvailabilities = null;\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Show product package weight info.\n this.showWeight = false;\n // Show status indicator on print.\n this.showStockStatusOnPrint = false;\n // Show product id.\n this.showItemNo = false;\n // Product measures.\n this.productMeasures = ProductRowProductMeasureEnum_1.default.none;\n // Enable to be able to edit the quantity.\n this.editableQuantity = false;\n // Show product package measures.\n this.showPackageMeasures = false;\n // Stores.\n this.stores = null;\n // Selected store id.\n this.storeId = null;\n // Show text describing the color and/or material of the product.\n this.showDesignText = false;\n // Show total price.\n this.showTotalPrice = false;\n // Sets the product link behaviour. This attribute should be set to \"disabled\" when in a Kiosk.\n this.productLink = ProductRowProductLinkEnum_1.default.productInformationPage;\n // Expands the included articles section.\n this.expanded = false;\n // Whether to show the collect checkbox or not.\n this.collectable = false;\n // A list of product ids that are collected.\n this.collected = null;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // Optional product state\n this.optionalState = ProductRowOptionalStateEnum_1.default.mandatory;\n // Sets the minimum quantity value.\n this.quantityMinValue = 0;\n // Disables online saleable verification. Deprecated - No longer in use.\n this.disableOnlineSaleableVerification = false;\n // Show a modal of type ProductCardModalEnum.\n this.visibleModal = null;\n // Layout for product row. NOTE: ProductRowLayoutEnum.compactPrint should only be used during print.\n this.layout = null;\n this.breakpointObserver = new themes_1.ThemeBreakpointObserver(() => this.requestUpdate(), this);\n this.dexfSettings = null;\n }\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
${this.getLayout()}
\n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.breakpointObserver.disconnect();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n if (changedProperties.has('theme')) {\n this.breakpointObserver.observe(this.theme);\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n getSettings() {\n return this.dexfSettings;\n }\n getLayout() {\n switch (this.layout) {\n case ProductRowLayoutEnum_1.default.compactPrint:\n return (0, web_component_1.html) ``;\n default:\n return (0, web_component_1.html) `${this.getMainProduct()} ${this.getIncludedProducts()}`;\n }\n }\n /**\n * @returns Template.\n */\n getMainProduct() {\n const product = this.shoppingProduct.product;\n const storeAvailability = ProductRowUtility_1.default.getStoreAvailability({\n product,\n storeAvailabilities: this.storeAvailabilities\n });\n const zipAvailability = this.getZipAvailability(product);\n const mainProductCssClass = product.valid ? 'mainProduct' : 'mainProduct discontinued';\n const rows = [];\n if (!product.content) {\n return null;\n }\n if (this.isMobile()) {\n rows.push((0, web_component_1.html) `\n\t\t\t\t\t${this.getImage(product)}\n\t\t\t\t\t
\n\t\t\t\t\t\t${this.getUnitPrice(product)} ${this.getDoNotDiy(product)}\n\t\t\t\t\t\t${!this.shouldDisplayStoreAvailability(product)\n ? this.getIdentifiersForProduct(product, null)\n : null}\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t${this.shouldDisplayZipAvailability(product)\n ? this.getZipAvailabilityStatusIndicator(product, zipAvailability)\n : this.getZipAvailabilityStatusIndicator(product, null)}\n\t\t\t\t\t\t\t${this.getStoreAvailabilityStatusIndicator(product, storeAvailability)}\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t`);\n if (this.optionalState !== ProductRowOptionalStateEnum_1.default.addable &&\n this.optionalState !== ProductRowOptionalStateEnum_1.default.removableFromTab) {\n rows.push((0, web_component_1.html) `
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t${this.getQuantityField(this.shoppingProduct)}\n\t\t\t\t\t\t\t${!this.isDiscontinuedProduct(product) ? this.getRemoveFromListButton() : null}\n\t\t\t\t\t\t
\n\t\t\t\t\t\t${this.getTotalPrice(this.shoppingProduct)}\n\t\t\t\t\t
`);\n }\n if (this.shouldDisplayStoreAvailability(product)) {\n rows.push(this.getIdentifiersForProduct(product, storeAvailability));\n }\n if (this.isCollectable(product)) {\n rows.push((0, web_component_1.html) `
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t${this.getCollectCheckbox(product)}\n\t\t\t\t\t
`);\n }\n if (this.optionalState !== ProductRowOptionalStateEnum_1.default.mandatory &&\n this.optionalState !== ProductRowOptionalStateEnum_1.default.removableFromList &&\n !this.isDiscontinuedProduct(product)) {\n rows.push((0, web_component_1.html) `
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t${this.getAddButton()} ${this.getRemoveFromTabButton()}\n\t\t\t\t\t
`);\n }\n rows.push(this.getDiscontinuedProductDisclaimer(product));\n }\n else {\n rows.push((0, web_component_1.html) `\n\t\t\t\t
\n\t\t\t\t\t${this.getImage(product)}\n\t\t\t\t\t
\n\t\t\t\t\t\t${this.getUnitPrice(product)} ${this.getDoNotDiy(product)}\n\t\t\t\t\t\t${!this.shouldDisplayStoreAvailability(product)\n ? this.getIdentifiersForProduct(product, null)\n : null}\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t${this.shouldDisplayZipAvailability(product)\n ? this.getZipAvailabilityStatusIndicator(product, zipAvailability)\n : this.getZipAvailabilityStatusIndicator(product, null)}\n\t\t\t\t\t\t\t${this.getStoreAvailabilityStatusIndicator(product, storeAvailability)}\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t${this.optionalState !== ProductRowOptionalStateEnum_1.default.addable &&\n this.optionalState !== ProductRowOptionalStateEnum_1.default.removableFromTab\n ? (0, web_component_1.html) `
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t${this.getQuantityField(this.shoppingProduct)}\n\t\t\t\t\t\t\t\t\t${!this.isDiscontinuedProduct(product) ? this.getRemoveFromListButton() : null}\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
`\n : null}\n\t\t\t\t\t${!this.isDiscontinuedProduct(product) ? this.getTotalPrice(this.shoppingProduct) : null}\n\t\t\t\t\t${!this.isDiscontinuedProduct(product) ? this.getAddButton() : null}\n\t\t\t\t\t${!this.isDiscontinuedProduct(product) ? this.getRemoveFromTabButton() : null}\n\t\t\t\t
\n\t\t\t`);\n if (!this.isDiscontinuedProduct(product) &&\n (this.shouldDisplayStoreAvailability(product) || this.isCollectable(product))) {\n rows.push((0, web_component_1.html) `\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t${this.shouldDisplayStoreAvailability(product)\n ? this.getIdentifiersForProduct(product, storeAvailability)\n : null}\n\t\t\t\t\t\t
\n\t\t\t\t\t\t${this.optionalState !== ProductRowOptionalStateEnum_1.default.addable ? (0, web_component_1.html) `
` : null}\n\t\t\t\t\t\t${!this.isDiscontinuedProduct(product) ? this.getCollectCheckbox(product) : null}\n\t\t\t\t\t
\n\t\t\t\t`);\n }\n if (this.isDiscontinuedProduct(product)) {\n rows.push((0, web_component_1.html) `\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
${this.getDiscontinuedProductDisclaimer(product)}
\n\t\t\t\t\t
\n\t\t\t\t`);\n }\n }\n return (0, web_component_1.html) `
${rows}
`;\n }\n /**\n * @returns Template.\n */\n getIncludedProducts() {\n if (!this.includedProducts) {\n return null;\n }\n const shoppingProducts = utilities_1.ProductUtility.getIncludedShoppingProducts({\n product: this.shoppingProduct.product,\n includedProducts: this.includedProducts\n });\n if (shoppingProducts.length === 0) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
\n\t\t\t\t event.key === 'Enter' && this.click()}\"\n\t\t\t\t\t@click=\"${this.onIncludedProductsExpanderClick.bind(this)}\"\n\t\t\t\t>\n\t\t\t\t\t
\n\t\t\t\t\t this.dispatchEvent(new CustomEvent('expand', { bubbles: true, detail: { expanded: !this.expanded } }))}\"\n\t\t\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t\t\t.label=\"${this.getTranslations().productRowExpander}\"\n\t\t\t\t\t\t.ariaLabel=\"${this.getTranslations()\n .includedArticlesNrOfArticles.replace('[[nr_of_articles]]', String(shoppingProducts.length))\n .replace('{{nr_of_articles}}', String(shoppingProducts.length))}\"\n\t\t\t\t\t\t.printLabel=\"${this.getTranslations().productRowExpander +\n ' (' +\n shoppingProducts.length +\n ')'}\"\n\t\t\t\t\t\t.expanded=\"${this.expanded}\"\n\t\t\t\t\t\t.layout=\"${component_text_toggle_1.TextToggleLayoutEnum.subtle}\"\n\t\t\t\t\t\t.size=\"${enums_1.ThemeFontStyleTypeEnum.bodyMedium}\"\n\t\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t${this.getA11yList(shoppingProducts.map((shoppingProduct) => this.getIncludedProduct(shoppingProduct)))}\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\n\t\t`;\n }\n /**\n * @param listItems Content within a list.\n */\n getA11yList(listItems) {\n /* eslint-disable lit-a11y/no-redundant-role */\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${listItems}\n\t\t\t
\n\t\t`;\n /* eslint-enable lit-a11y/no-redundant-role */\n }\n /**\n * @param shoppingProduct Shopping product.\n * @returns Template.\n */\n getIncludedProduct(shoppingProduct) {\n var _a, _b;\n const product = shoppingProduct.product;\n if (!product.content) {\n return null;\n }\n const includedProductCssClass = product.valid\n ? 'includedProduct'\n : 'includedProduct discontinued';\n const storeAvailability = ProductRowUtility_1.default.getStoreAvailability({\n product,\n storeAvailabilities: this.storeAvailabilities\n });\n const rows = [];\n if (this.isMobile()) {\n rows.push((0, web_component_1.html) `\n\t\t\t\t
\n\t\t\t\t\t${this.getProductContent(shoppingProduct)}\n\t\t\t\t\t${((_a = this.shoppingProduct.product.content) === null || _a === void 0 ? void 0 : _a.itemType) != 'SPR'\n ? this.getStoreAvailabilityStatusIndicator(product, storeAvailability)\n : null}\n\t\t\t\t
\n\t\t\t`);\n if (this.shouldDisplayStoreAvailability(product)) {\n rows.push((0, web_component_1.html) `\n\t\t\t\t\t
${this.getIdentifiersForProduct(product, storeAvailability)}
\n\t\t\t\t`);\n }\n if (this.isCollectable(product)) {\n rows.push((0, web_component_1.html) `
${this.getCollectCheckbox(product)}
`);\n }\n if (this.isDiscontinuedProduct(product)) {\n rows.push((0, web_component_1.html) `
${this.getDiscontinuedProductDisclaimer(product)}
`);\n }\n }\n else {\n rows.push((0, web_component_1.html) `\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t${this.getProductContent(shoppingProduct)}\n\t\t\t\t\t\t${((_b = this.shoppingProduct.product.content) === null || _b === void 0 ? void 0 : _b.itemType) != 'SPR'\n ? this.getStoreAvailabilityStatusIndicator(product, storeAvailability)\n : null}\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t`);\n if (this.shouldDisplayStoreAvailability(product) || this.isCollectable(product)) {\n rows.push((0, web_component_1.html) `\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t${this.shouldDisplayStoreAvailability(product)\n ? this.getIdentifiersForProduct(product, storeAvailability)\n : null}\n\t\t\t\t\t\t
\n\t\t\t\t\t\t${this.getCollectCheckbox(product)}\n\t\t\t\t\t
\n\t\t\t\t`);\n }\n if (this.isDiscontinuedProduct(product)) {\n rows.push((0, web_component_1.html) `
${this.getDiscontinuedProductDisclaimer(product)}
`);\n }\n }\n return (0, web_component_1.html) `
  • ${rows}
  • `;\n }\n /**\n * @param product Product.\n * @returns Template.\n */\n getImage(product) {\n var _a;\n const productImage = utilities_1.ProductUtility.getMainImages(product).find((productImage) => productImage.size === enums_1.ImageSizeTypeEnum.S4);\n if (!productImage) {\n return (0, web_component_1.html) `
    `;\n }\n if (this.isDiscontinuedProduct(product)) {\n return (0, web_component_1.html) `\n\t\t\t\t\n\t\t\t`;\n }\n if (this.productLink === ProductRowProductLinkEnum_1.default.productInformationPage &&\n !this.disableLinks) {\n return (0, web_component_1.html) `\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t`;\n }\n else if (this.productLink === ProductRowProductLinkEnum_1.default.eventOnly && !this.disableLinks) {\n return (0, web_component_1.html) `\n\t\t\t\t\n\t\t\t`;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n }\n getDoNotDiy(product) {\n return (0, web_component_1.html) ``;\n }\n /**\n * @param product\n */\n getProductImageAltText(product) {\n var _a;\n if (!((_a = product.content) === null || _a === void 0 ? void 0 : _a.name)) {\n return null;\n }\n return this.getTranslations()\n .ariaLabelProductPageLink.replace('[[productName]]', product.content.name.toLowerCase())\n .replace('{{productName}}', product.content.name.toLowerCase());\n }\n /**\n * @param product Product.\n * @returns Template.\n */\n getDiscontinuedProductDisclaimer(product) {\n if (!this.isDiscontinuedProduct(product)) {\n return null;\n }\n const bodyText = this.getTranslations().discontinuedProductDisclaimer;\n const cautionaryVariant = 'cautionary';\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${bodyText}\n\t\t`;\n }\n /**\n * @param shoppingProduct Shopping product.\n * @returns Template.\n */\n getQuantityField(shoppingProduct) {\n if (this.optionalState === ProductRowOptionalStateEnum_1.default.addable ||\n this.optionalState === ProductRowOptionalStateEnum_1.default.removableFromTab) {\n return null;\n }\n if (!this.editableQuantity || !shoppingProduct.product.valid) {\n return (0, web_component_1.html) `\n\t\t\t\t${ProductRowUtility_1.default.getQuantityField({\n shoppingProduct: this.shoppingProduct,\n translations: this.getTranslations()\n })}\n\t\t\t`;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * @returns Template.\n */\n getAddButton() {\n if (this.optionalState !== ProductRowOptionalStateEnum_1.default.addable) {\n return null;\n }\n const secondaryVariant = 'secondary';\n if (this.isMobile()) {\n return (0, web_component_1.html) `\n\t\t\t\t
    \n\t\t\t\t\t this.dispatchEvent(new CustomEvent('add', { bubbles: true }))}\"\n\t\t\t\t\t\tvariant=\"${secondaryVariant}\"\n\t\t\t\t\t\tsmall\n\t\t\t\t\t>\n\t\t\t\t\t\t${this.getTranslations().productListAddButton}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t`;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t this.dispatchEvent(new CustomEvent('add', { bubbles: true }))}\"\n\t\t\t\t\tvariant=\"${secondaryVariant}\"\n\t\t\t\t\tsmall\n\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\t${this.getTranslations().productListAddButton}\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * @returns Template.\n */\n getRemoveFromTabButton() {\n if (this.optionalState !== ProductRowOptionalStateEnum_1.default.removableFromTab) {\n return null;\n }\n const secondaryVariant = 'secondary';\n if (this.isMobile()) {\n return (0, web_component_1.html) `\n\t\t\t\t
    \n\t\t\t\t\t this.dispatchEvent(new CustomEvent('remove', { bubbles: true }))}\"\n\t\t\t\t\t\tvariant=\"${secondaryVariant}\"\n\t\t\t\t\t\tsmall\n\t\t\t\t\t>\n\t\t\t\t\t\t${this.getTranslations().productListRemoveButton}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t`;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t this.dispatchEvent(new CustomEvent('remove', { bubbles: true }))}\"\n\t\t\t\t\tvariant=\"${secondaryVariant}\"\n\t\t\t\t\tsmall\n\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\t${this.getTranslations().productListRemoveButton}\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * @returns Template.\n */\n getRemoveFromListButton() {\n if (this.optionalState !== ProductRowOptionalStateEnum_1.default.removableFromList) {\n return null;\n }\n const tertiaryVariant = 'tertiary';\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t this.dispatchEvent(new CustomEvent('remove', { bubbles: true }))}\"\n\t\t\t\t\tvariant=\"${tertiaryVariant}\"\n\t\t\t\t\tsmall\n\t\t\t\t>\n\t\t\t\t\t${this.getTranslations().productListRemoveButton}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * @param shoppingProduct Shopping product.\n * @returns Template.\n */\n getTotalPrice(shoppingProduct) {\n if (this.optionalState === ProductRowOptionalStateEnum_1.default.addable ||\n this.optionalState === ProductRowOptionalStateEnum_1.default.removableFromTab ||\n !shoppingProduct.product.valid ||\n !this.showTotalPrice ||\n this.isDiscontinuedProduct(this.shoppingProduct.product)) {\n return null;\n }\n const totalPrice = utilities_1.TotalPriceCalculator.calculateMultiple([shoppingProduct], this.getSettings().localisation.dateFormat);\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${totalPrice.map((price, index) => {\n const isPrimaryCurrency = index < 1;\n return (0, web_component_1.html) `\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t`;\n })}\n\t\t\t
    \n\t\t`;\n }\n /**\n * @param product Product.\n * @returns Template.\n */\n getCollectCheckbox(product) {\n if (!this.isCollectable(product)) {\n return null;\n }\n const { productCheckboxCollected, productCheckboxCollect } = this.getTranslations();\n const isCollected = this.isCollected(product);\n const checkboxId = `product-${product.itemId}`;\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t
    \n\t\t`;\n }\n /**\n * Returns the article number and where to get the product inside the store.\n * Where to get the product could either be aisle & bin, a department or \"contact coworker\".\n *\n * @param product Product.\n * @param storeAvailability Store availability.\n * @returns Template.\n */\n getIdentifiersForProduct(product, storeAvailability) {\n if (!this.storeAvailabilities && !this.showItemNo) {\n return null;\n }\n const isSpr = utilities_1.ProductUtility.isProductSPR(product);\n const { content, itemId, valid } = product;\n const itemNo = content ? content.ruItemNo : itemId.split('-').reverse[0];\n // If no store has been selected or product is discontinued, render article number only without label.\n if (!this.storeAvailabilities || this.isDiscontinuedProduct(product)) {\n const formattedItemNo = utilities_1.ProductUtility.formatItemNo(itemNo);\n return this.showItemNo\n ? (0, web_component_1.html) `
    \n\t\t\t\t\t\t\n\t\t\t\t\t\t\t${formattedItemNo}\n\t\t\t\t\t\t\n\t\t\t\t\t\t${ProductRowUtility_1.default.getVisuallyHiddenProductIdentifier({\n formattedItemNo,\n translations: this.getTranslations()\n })}\n\t\t\t\t
    `\n : null;\n }\n const displayStoreAvailability = this.shouldDisplayStoreAvailability(product);\n const withStoreAvailability = displayStoreAvailability ? storeAvailability : null;\n const articleNumber = ProductRowUtility_1.default.getArticleNumber({\n product,\n isSpr,\n showItemNo: this.showItemNo,\n translations: this.getTranslations()\n });\n const locationCode = ProductRowUtility_1.default.getLocation({\n storeAvailability: withStoreAvailability,\n displayStoreAvailability,\n translations: this.getTranslations()\n });\n const productIdentifiers = (0, web_component_1.html) `
    \n\t\t\t${articleNumber}\n\t\t\t
    \n\t\t\t${locationCode}\n\t\t
    `;\n if (!valid || !content || utilities_1.ProductUtility.isProductSPR(product)) {\n return productIdentifiers;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${productIdentifiers}\n\t\t\t\n\t\t`;\n }\n /**\n * @param product Product.\n * @param storeAvailability Store availability.\n * @returns Template.\n */\n getStoreAvailabilityStatusIndicator(product, storeAvailability) {\n var _a, _b, _c, _d;\n const store = ((_a = this.stores) === null || _a === void 0 ? void 0 : _a.find((store) => store.id === this.storeId)) || null;\n if (!storeAvailability ||\n !product.valid ||\n !product.content ||\n !this.storeId ||\n !this.stores ||\n !store) {\n return null;\n }\n const statusColor = utilities_1.AvailabilityUtility.getStoreAvailabilityStatusColor(storeAvailability);\n if (!statusColor) {\n return null;\n }\n const statusLabel = (_b = utilities_1.AvailabilityUtility.getStoreAvailabilityLabel({\n translations: this.getTranslations(),\n storeAvailability\n })) === null || _b === void 0 ? void 0 : _b.replace('[[store]]', (_c = store.name) !== null && _c !== void 0 ? _c : '').replace('{{store}}', (_d = store.name) !== null && _d !== void 0 ? _d : '');\n return (0, web_component_1.html) `\n\t\t\t${statusLabel}\n\t\t`;\n }\n /**\n * @param product Product.\n * @param zipAvailability Zip Availability.\n * @returns Template.\n */\n getZipAvailabilityStatusIndicator(product, zipAvailability) {\n if (!product.valid || !product.content) {\n return null;\n }\n if (!this.zipAvailabilities) {\n return null;\n }\n return this.getStatusIndicator(utilities_1.ZipAvailabilityUtility.getLabel({\n translations: this.getTranslations(),\n zipAvailability\n }), utilities_1.ZipAvailabilityUtility.getColor({\n zipAvailability\n }));\n }\n /**\n * @param statusLabel\n * @param statusColor\n * @returns Template.\n */\n getStatusIndicator(statusLabel, statusColor) {\n if (!statusColor) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t${statusLabel}\n\t\t`;\n }\n /**\n * @param product Product.\n * @returns Template.\n */\n getUnitPrice(product) {\n var _a, _b;\n if (!this.hasTranslationsAndSettings()) {\n return null;\n }\n if (!product.valid) {\n return (0, web_component_1.html) `\n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t\t\t${(_a = product.content) === null || _a === void 0 ? void 0 : _a.name}\n\t\t\t\t\t

    \n\t\t\t\t\t

    \n\t\t\t\t\t\t${this.getProductDescription(product)}\n\t\t\t\t\t

    \n\t\t\t\t
    \n\t\t\t`;\n }\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('modalOpen', { bubbles: true, detail: event.detail }))}\"\n\t\t\t\t@modalClose=\"${(event) => this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: event.detail }))}\"\n\t\t\t\t@productNameClick=\"${this.onProductNameClick.bind(this, product)}\"\n\t\t\t\t.shoppingProducts=\"${[{ quantity: 1, product }]}\"\n\t\t\t\t.settings=\"${this.settings}\"\n\t\t\t\t.translations=\"${this.translations}\"\n\t\t\t\t.localizedInformation=\"${this.localizedInformation}\"\n\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t.layout=\"${component_price_module_1.PriceModuleLayoutTypeEnum.rowPrice}\"\n\t\t\t\t.productName=\"${(_b = product.content) === null || _b === void 0 ? void 0 : _b.name}\"\n\t\t\t\t.showEnergyLabel=\"${true}\"\n\t\t\t\t.showRepairabilityIndex=\"${true}\"\n\t\t\t\t.visibleModal=\"${this.visibleModal}\"\n\t\t\t\t.disableLinks=\"${this.disableLinks}\"\n\t\t\t\t.productLink=\"${this.productLink}\"\n\t\t\t\t.showPriceUnit=\"${true}\"\n\t\t\t\t.showEcoFee=\"${true}\"\n\t\t\t\tshowLowestPreviousSalesPrice\n\t\t\t\t>${this.getProductDescription(product)}\n\t\t`;\n }\n /**\n * This function wraps the name and description because of A11y, making it easier to hit the link to PIP.\n *\n * @param shoppingProduct ShoppingProduct.\n */\n getProductContent(shoppingProduct) {\n const content = (0, web_component_1.html) `\n\t\t\t${this.getVisuallyHiddenProductPageText(shoppingProduct)}\n\t\t\t${this.getIncludedProductName(shoppingProduct)}\n\t\t\t${this.getIncludedProductDescription(shoppingProduct)}\n\t\t`;\n if (this.productLink === ProductRowProductLinkEnum_1.default.productInformationPage &&\n !this.disableLinks) {\n return (0, web_component_1.html) `\n\t\t\t\t\n\t\t\t\t\t${content}\n\t\t\t\t\n\t\t\t`;\n }\n else if (this.productLink === ProductRowProductLinkEnum_1.default.eventOnly && !this.disableLinks) {\n return (0, web_component_1.html) `\n\t\t\t\t {\n event.key === 'Enter' && this.onProductNameClick(shoppingProduct.product);\n }}\"\n\t\t\t\t\tclass=\"productContent\"\n\t\t\t\t>\n\t\t\t\t\t${content}\n\t\t\t\t\n\t\t\t`;\n }\n return content;\n }\n getVisuallyHiddenProductPageText(shoppingProduct) {\n var _a, _b;\n const productName = (_b = (_a = shoppingProduct === null || shoppingProduct === void 0 ? void 0 : shoppingProduct.product) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.name;\n if (!productName) {\n return null;\n }\n const { ariaLabelProductPageLink, quantity } = this.getTranslations();\n const text = ariaLabelProductPageLink\n .replace('[[productName]]', productName.toLowerCase())\n .replace('{{productName}}', productName.toLowerCase()) +\n '. ' +\n quantity +\n ' ' +\n shoppingProduct.quantity +\n '.';\n return (0, web_component_1.html) ` ${text} `;\n }\n /**\n * @param shoppingProduct Shopping product.\n * @returns Template.\n */\n getIncludedProductName(shoppingProduct) {\n if (!shoppingProduct.product.content) {\n return null;\n }\n const text = `${shoppingProduct.quantity}x ${shoppingProduct.product.content.name}`;\n return (0, web_component_1.html) `

    ${text}

    `;\n }\n /**\n * Returns product description.\n *\n * @param product\n * @returns Product description.\n */\n getProductDescription(product) {\n if (!this.hasTranslationsAndSettings()) {\n return null;\n }\n const description = utilities_1.ProductDescriptionUtility.getDescription({\n settings: this.getSettings(),\n translations: this.getTranslations(),\n product,\n include: {\n productMeasures: this.getProductMeasures(),\n designText: this.showDesignText,\n packageMeasures: this.showPackageMeasures,\n weight: this.showWeight\n }\n });\n return description;\n }\n /**\n * @param shoppingProduct Shopping product.\n * @returns Template.\n */\n getIncludedProductDescription(shoppingProduct) {\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t

    \n\t\t\t\t\t${utilities_1.ProductDescriptionUtility.getDescription({\n settings: this.getSettings(),\n translations: this.getTranslations(),\n product: shoppingProduct.product,\n include: {\n productMeasures: this.getProductMeasures(),\n designText: this.showDesignText,\n packageMeasures: this.showPackageMeasures,\n weight: this.showWeight\n }\n })}\n\t\t\t\t

    \n\t\t\t
    \n\t\t`;\n }\n /**\n * Returns product measures with a type that can be used with ProductDescriptionUtility.\n *\n * @returns Product measures.\n */\n getProductMeasures() {\n switch (this.productMeasures) {\n case ProductRowProductMeasureEnum_1.default.long:\n return utilities_1.ProductDescriptionProductMeasureEnum.long;\n case ProductRowProductMeasureEnum_1.default.short:\n return utilities_1.ProductDescriptionProductMeasureEnum.short;\n default:\n case ProductRowProductMeasureEnum_1.default.none:\n return utilities_1.ProductDescriptionProductMeasureEnum.none;\n }\n }\n /**\n * @param shoppingProduct Shopping product.\n * @param event Event.\n */\n onQuantityInput(shoppingProduct, event) {\n this.dispatchEvent(new CustomEvent('quantity', {\n bubbles: true,\n detail: {\n shoppingProduct: Object.assign(Object.assign({}, shoppingProduct), { quantity: event.detail.value })\n }\n }));\n }\n /**\n * @param product Product.\n */\n onCollectCheckboxChange(product) {\n const collected = (this.collected || []).slice();\n const collectId = this.getCollectId(product);\n if (collected.includes(collectId)) {\n const index = collected.indexOf(collectId);\n if (index !== -1) {\n collected.splice(index, 1);\n }\n }\n else {\n collected.push(collectId);\n }\n this.dispatchEvent(new CustomEvent('collect', {\n bubbles: true,\n detail: {\n collected,\n collectId\n }\n }));\n }\n /**\n * @param product Product.\n */\n onProductImageClick(product) {\n var _a;\n if (this.productLink !== ProductRowProductLinkEnum_1.default.disabled) {\n this.dispatchEvent(new CustomEvent('productImageClick', {\n bubbles: true,\n detail: {\n itemNo: (_a = product.content) === null || _a === void 0 ? void 0 : _a.ruItemNo,\n productId: this.getCollectId(product)\n }\n }));\n }\n }\n /**\n * @param product Product.\n */\n onProductNameClick(product) {\n var _a;\n if (this.productLink !== ProductRowProductLinkEnum_1.default.disabled) {\n this.dispatchEvent(new CustomEvent('productNameClick', {\n bubbles: true,\n detail: {\n itemNo: (_a = product.content) === null || _a === void 0 ? void 0 : _a.ruItemNo,\n productId: this.getCollectId(product)\n }\n }));\n }\n }\n /**\n * @param event\n */\n onIncludedProductsExpanderClick(event) {\n var _a;\n const includedProductsExpander = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.includedProductsExpander');\n if (event.target !== includedProductsExpander) {\n return;\n }\n this.dispatchEvent(new CustomEvent('expand', { bubbles: true, detail: { expanded: !this.expanded } }));\n }\n /**\n * @param product Product.\n * @returns \"true\" if collected.\n */\n isCollected(product) {\n return (this.collected || []).includes(this.getCollectId(product));\n }\n /**\n * @param product Product.\n * @returns \"true\" if collected.\n */\n isDiscontinuedProduct(product) {\n if (!product.valid) {\n for (const reason of product.reason) {\n if (reason.code === enums_1.InvalidProductReasonEnum.retailItemNotAvailable) {\n return true;\n }\n }\n }\n return false;\n }\n /**\n * @param product Product.\n * @returns Collect ID.\n */\n getCollectId(product) {\n var _a, _b;\n const parentItemNo = (_a = this.shoppingProduct.product.content) === null || _a === void 0 ? void 0 : _a.ruItemNo;\n const childItemNo = (_b = product.content) === null || _b === void 0 ? void 0 : _b.ruItemNo;\n return parentItemNo !== childItemNo ? `${parentItemNo}/${childItemNo}` : parentItemNo !== null && parentItemNo !== void 0 ? parentItemNo : '';\n }\n /**\n * @param product Product.\n * @returns Zip availability.\n */\n getZipAvailability(product) {\n if (!product.content || !product.valid || !this.zipAvailabilities) {\n return null;\n }\n return (this.zipAvailabilities.find((zipAvailability) => {\n var _a, _b;\n return (((_a = product.content) === null || _a === void 0 ? void 0 : _a.itemNoLocal) === zipAvailability.content.itemNo ||\n ((_b = product.content) === null || _b === void 0 ? void 0 : _b.itemNoGlobal) === zipAvailability.content.itemNo);\n }) || null);\n }\n /**\n * @returns Returns \"true\" if mobile.\n */\n isMobile() {\n var _a;\n return (((_a = this.breakpointObserver.getBreakpointIndex()) !== null && _a !== void 0 ? _a : enums_1.ThemeBreakpointIndexEnum.small) <=\n enums_1.ThemeBreakpointIndexEnum.small);\n }\n /**\n * @returns Returns \"true\" if the shopping product has dual currencies.\n */\n isDualCurrency() {\n var _a, _b;\n return (new Set((_b = (_a = this.shoppingProduct.product.content) === null || _a === void 0 ? void 0 : _a.priceInformation) === null || _b === void 0 ? void 0 : _b.salesPrice.map((price) => price.currencyCode)).size > 1);\n }\n /**\n * @param product Product.\n * @returns Returns \"true\" if collectable.\n */\n isCollectable(product) {\n return (!!this.collectable &&\n !utilities_1.ProductUtility.isProductSPR(product) &&\n !!product.valid &&\n !!product.content &&\n this.optionalState !== ProductRowOptionalStateEnum_1.default.addable &&\n this.optionalState !== ProductRowOptionalStateEnum_1.default.removableFromTab);\n }\n /**\n * @param product Product.\n * @returns Returns \"true\" if store availability information should be displayed.\n */\n shouldDisplayStoreAvailability(product) {\n return (product.valid &&\n !this.isDiscontinuedProduct(product) &&\n !utilities_1.ProductUtility.isProductSPR(product) &&\n !!this.storeAvailabilities);\n }\n /**\n * @param product Product.\n * @returns Returns \"true\" if zip availability information should be displayed.\n */\n shouldDisplayZipAvailability(product) {\n return product.valid && !this.isDiscontinuedProduct(product);\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ProductRow.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ProductRow.prototype, \"shoppingProduct\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductRow.prototype, \"includedProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductRow.prototype, \"storeAvailabilities\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductRow.prototype, \"zipAvailabilities\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductRow.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductRow.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductRow.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductRow.prototype, \"showWeight\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductRow.prototype, \"showStockStatusOnPrint\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductRow.prototype, \"showItemNo\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductRow.prototype, \"productMeasures\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductRow.prototype, \"editableQuantity\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductRow.prototype, \"showPackageMeasures\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductRow.prototype, \"stores\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductRow.prototype, \"storeId\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductRow.prototype, \"showDesignText\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductRow.prototype, \"showTotalPrice\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductRow.prototype, \"productLink\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductRow.prototype, \"expanded\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductRow.prototype, \"collectable\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductRow.prototype, \"collected\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductRow.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductRow.prototype, \"optionalState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], ProductRow.prototype, \"quantityMinValue\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductRow.prototype, \"disableOnlineSaleableVerification\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductRow.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductRow.prototype, \"layout\", void 0);\nProductRow = __decorate([\n (0, web_component_1.customElement)('kompis-product-row')\n], ProductRow);\nexports.default = ProductRow;\n//# sourceMappingURL=ProductRow.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = void 0;\nvar component_price_module_1 = require(\"@inter-ikea-kompis/component-price-module\");\nObject.defineProperty(exports, \"default\", { enumerable: true, get: function () { return component_price_module_1.PriceModuleModalEnum; } });\n//# sourceMappingURL=ProductRowModalEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProductRowProductMeasureEnum = exports.ProductRowProductLinkEnum = exports.ProductRowOptionalStateEnum = exports.ProductRowModalEnum = exports.ProductRowLayoutEnum = exports.ProductRow = exports.ProductDescriptionProductMeasureEnum = void 0;\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nObject.defineProperty(exports, \"ProductDescriptionProductMeasureEnum\", { enumerable: true, get: function () { return utilities_1.ProductDescriptionProductMeasureEnum; } });\nconst ProductRow_1 = __importDefault(require(\"./components/product-row/ProductRow\"));\nexports.ProductRow = ProductRow_1.default;\nconst ProductRowLayoutEnum_1 = __importDefault(require(\"./enums/ProductRowLayoutEnum\"));\nexports.ProductRowLayoutEnum = ProductRowLayoutEnum_1.default;\nconst ProductRowModalEnum_1 = __importDefault(require(\"./enums/ProductRowModalEnum\"));\nexports.ProductRowModalEnum = ProductRowModalEnum_1.default;\nconst ProductRowOptionalStateEnum_1 = __importDefault(require(\"./enums/ProductRowOptionalStateEnum\"));\nexports.ProductRowOptionalStateEnum = ProductRowOptionalStateEnum_1.default;\nconst ProductRowProductLinkEnum_1 = __importDefault(require(\"./enums/ProductRowProductLinkEnum\"));\nexports.ProductRowProductLinkEnum = ProductRowProductLinkEnum_1.default;\nconst ProductRowProductMeasureEnum_1 = __importDefault(require(\"./enums/ProductRowProductMeasureEnum\"));\nexports.ProductRowProductMeasureEnum = ProductRowProductMeasureEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AccordionItemPadding = exports.AccordionItemAriaDisabledEnum = exports.AccordionItem = exports.Accordion = void 0;\nconst Accordion_1 = __importDefault(require(\"./components/accordion/Accordion\"));\nexports.Accordion = Accordion_1.default;\nconst AccordionItem_1 = __importDefault(require(\"./components/accordion-item/AccordionItem\"));\nexports.AccordionItem = AccordionItem_1.default;\nconst AccordionItemPadding_1 = __importDefault(require(\"./components/accordion-item-padding/AccordionItemPadding\"));\nexports.AccordionItemPadding = AccordionItemPadding_1.default;\nconst AccordionItemAriaDisabledEnum_1 = __importDefault(require(\"./enums/AccordionItemAriaDisabledEnum\"));\nexports.AccordionItemAriaDisabledEnum = AccordionItemAriaDisabledEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass UnavailableProductsCardStyle {\n static getStyle(options) {\n const { color, spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\tkompis-product-row {\n\t\t\t\tmargin-bottom: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.checkboxLabel {\n\t\t\t\tmargin-top: ${1 / 16}rem;\n\t\t\t}\n\n\t\t\t.card {\n\t\t\t\tmargin-top: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.unavailable-list {\n\t\t\t\tlist-style: none;\n\t\t\t\tpadding: 0;\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t.productRowContainer {\n\t\t\t\tmargin-bottom: ${spacing.space100 / 16}rem;\n\t\t\t\tborder-bottom: ${1 / 16}rem solid ${color.neutral.grey200};\n\t\t\t}\n\n\t\t\t.productRowContainer:last-child {\n\t\t\t\tborder: none;\n\t\t\t}\n\n\t\t\t.help > :not(:last-child) {\n\t\t\t\tmargin-bottom: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.help {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\tmargin-bottom: ${spacing.space150 / 16}rem;\n\t\t\t\tmargin-top: ${spacing.space150 / 16}rem;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = UnavailableProductsCardStyle;\n//# sourceMappingURL=UnavailableProductsCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@inter-ikea-kompis/component-product-row\");\nrequire(\"@inter-ikea-kompis/component-accordion\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@ingka/checkbox-webc\");\nconst UnavailableProductsCardStyle_1 = __importDefault(require(\"./UnavailableProductsCardStyle\"));\n/**\n * Card to notify users that some items are not sold online.\n *\n * @event addToShoppingList Emits when checking/unchecking the checkbox for adding unavailable items to the shopping list\n */\nlet UnavailableProductsCard = class UnavailableProductsCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Shopping products\n this.shoppingProducts = null;\n // Add unavailable items to shopping list\n this.addToShoppingList = false;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // List of failed shopping products returned when trying to add to cart.\n this.failedShoppingItems = null;\n // If the accordion with unavailable products list is expanded\n this.expandedList = false;\n this.dexfSettings = null;\n }\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t
    \n\t\t\t\t${this.getCheckbox()} ${this.getHelperText()} ${this.getUnavailableProductsAccordion()}\n\t\t\t
    \n\t\t`;\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getSettings() {\n return this.dexfSettings;\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n getHelperText() {\n const { addToShoppingCartUnavailableDialogueNoListHelpText, addToShoppingCartUnavailableDialogueListHelpText } = this.getTranslations();\n if (!utilities_1.ShoppingSupport.hasListSupport(this.getSettings())) {\n return (0, web_component_1.html) `\n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t\t\t${addToShoppingCartUnavailableDialogueNoListHelpText}\n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t`;\n }\n return (0, web_component_1.html) `
    \n\t\t\t\n\t\t\t\t${addToShoppingCartUnavailableDialogueListHelpText}\n\t\t\t\n\t\t\t\n\t\t\t\t${addToShoppingCartUnavailableDialogueNoListHelpText}\n\t\t\t\n\t\t
    `;\n }\n getCheckbox() {\n if (!utilities_1.ShoppingSupport.hasListSupport(this.getSettings())) {\n return null;\n }\n const addToShoppingCartUnavailableDialogueOption = this.getTranslations().addToShoppingCartUnavailableDialogueOption;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t this.dispatchEvent(new CustomEvent('addToShoppingList', {\n bubbles: true,\n detail: {\n addToShoppingList: !this.addToShoppingList\n }\n }))}\"\n\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n getA11yList() {\n /* eslint-disable lit-a11y/no-redundant-role */\n return (0, web_component_1.html) `\n\t\t\t
      \n\t\t\t\t${this.getUnavailableShoppingProducts().map((shoppingProduct) => this.getRow(shoppingProduct))}\n\t\t\t
    \n\t\t`;\n /* eslint-enable lit-a11y/no-redundant-role */\n }\n getExpandableLabel() {\n const addToShoppingCartUnavailableDialogueUnavailableItems = this.getTranslations().addToShoppingCartUnavailableDialogueUnavailableItems;\n return `${addToShoppingCartUnavailableDialogueUnavailableItems} (${this.getUnavailableShoppingProducts().reduce((sum, product) => sum + product.quantity, 0)})`;\n }\n toggleExpanded() {\n this.expandedList = !this.expandedList;\n this.requestUpdate();\n }\n getUnavailableProductsAccordion() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t {\n this.toggleExpanded();\n }}\"\n\t\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t\t.label=\"${this.getExpandableLabel()}\"\n\t\t\t\t\t.expanded=\"${this.expandedList}\"\n\t\t\t\t\tnoHorizontalPadding\n\t\t\t\t>\n\t\t\t\t\t${this.getA11yList()}\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n getUnavailableShoppingProducts() {\n var _a, _b, _c, _d;\n if (((_b = (_a = this.failedShoppingItems) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0) {\n const failedShoppingItems = this.getFailedShoppingItems(this.shoppingProducts);\n return failedShoppingItems;\n }\n return ((_d = (_c = this.shoppingProducts) === null || _c === void 0 ? void 0 : _c.filter((shoppingProduct) => shoppingProduct.quantity > 0).filter((shoppingProduct) => {\n var _a, _b, _c, _d;\n return !((_b = (_a = shoppingProduct.product.content) === null || _a === void 0 ? void 0 : _a.priceInformation) === null || _b === void 0 ? void 0 : _b.availableForHomeDelivery) &&\n !((_d = (_c = shoppingProduct.product.content) === null || _c === void 0 ? void 0 : _c.priceInformation) === null || _d === void 0 ? void 0 : _d.availableForClickCollect);\n })) !== null && _d !== void 0 ? _d : []);\n }\n /**\n * Returns ShoppingProducts that has a reference in FailedShoppingItems.\n *\n * @param shoppingProducts Shopping products.\n * @returns List on unavailable shopping products.\n */\n getFailedShoppingItems(shoppingProducts) {\n var _a;\n return (_a = shoppingProducts === null || shoppingProducts === void 0 ? void 0 : shoppingProducts.filter((product) => this.isFailedShoppingItem(product))) !== null && _a !== void 0 ? _a : [];\n }\n /**\n * Validates if a shopping product is present in the failed shopping items.\n *\n * @param shoppingProduct Single shopping product.\n * @returns Boolean.\n */\n isFailedShoppingItem(shoppingProduct) {\n var _a;\n const foundFailedShoppingItem = (_a = this.failedShoppingItems) === null || _a === void 0 ? void 0 : _a.find((failedShoppingProduct) => {\n var _a, _b;\n const firstCheck = failedShoppingProduct.itemNo === ((_a = shoppingProduct.product.content) === null || _a === void 0 ? void 0 : _a.ruItemNo);\n const secondCheck = failedShoppingProduct.itemNo === ((_b = shoppingProduct.product.content) === null || _b === void 0 ? void 0 : _b.itemNoLocal);\n return firstCheck || secondCheck;\n });\n if (foundFailedShoppingItem) {\n return true;\n }\n return false;\n }\n getRow(shoppingProduct) {\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], UnavailableProductsCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], UnavailableProductsCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], UnavailableProductsCard.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], UnavailableProductsCard.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], UnavailableProductsCard.prototype, \"shoppingProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], UnavailableProductsCard.prototype, \"addToShoppingList\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], UnavailableProductsCard.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], UnavailableProductsCard.prototype, \"failedShoppingItems\", void 0);\nUnavailableProductsCard = __decorate([\n (0, web_component_1.customElement)('kompis-unavailable-products-card')\n], UnavailableProductsCard);\nexports.default = UnavailableProductsCard;\n//# sourceMappingURL=UnavailableProductsCard.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AddToBagLayoutEnum;\n(function (AddToBagLayoutEnum) {\n AddToBagLayoutEnum[\"text\"] = \"text\";\n AddToBagLayoutEnum[\"icon\"] = \"icon\";\n})(AddToBagLayoutEnum || (AddToBagLayoutEnum = {}));\nexports.default = AddToBagLayoutEnum;\n//# sourceMappingURL=AddToBagLayoutEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AddToBagModalEnum;\n(function (AddToBagModalEnum) {\n AddToBagModalEnum[\"unavailableProductCard\"] = \"unavailableProductCard\";\n})(AddToBagModalEnum || (AddToBagModalEnum = {}));\nexports.default = AddToBagModalEnum;\n//# sourceMappingURL=AddToBagModalEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AddToBagStateEnum;\n(function (AddToBagStateEnum) {\n AddToBagStateEnum[\"default\"] = \"default\";\n AddToBagStateEnum[\"loading\"] = \"loading\";\n AddToBagStateEnum[\"confirmation\"] = \"confirmation\";\n})(AddToBagStateEnum || (AddToBagStateEnum = {}));\nexports.default = AddToBagStateEnum;\n//# sourceMappingURL=AddToBagStateEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AddToListLayoutEnum;\n(function (AddToListLayoutEnum) {\n AddToListLayoutEnum[\"text\"] = \"text\";\n AddToListLayoutEnum[\"icon\"] = \"icon\";\n AddToListLayoutEnum[\"iconSmall\"] = \"iconSmall\";\n})(AddToListLayoutEnum || (AddToListLayoutEnum = {}));\nexports.default = AddToListLayoutEnum;\n//# sourceMappingURL=AddToListLayoutEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar UnavailableOnlineBehaviourEnum;\n(function (UnavailableOnlineBehaviourEnum) {\n UnavailableOnlineBehaviourEnum[\"blockPurchase\"] = \"blockPurchase\";\n UnavailableOnlineBehaviourEnum[\"continueByShoppingList\"] = \"continueByShoppingList\";\n})(UnavailableOnlineBehaviourEnum || (UnavailableOnlineBehaviourEnum = {}));\nexports.default = UnavailableOnlineBehaviourEnum;\n//# sourceMappingURL=UnavailableOnlineBehaviourEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst analytics_1 = require(\"@inter-ikea-kompis/analytics\");\nconst insights_data_provider_1 = require(\"@insights/insights-data-provider\");\nconst moduleId = 'add_to_bag';\n/**\n * Tracks events from Add to bag and sends them to a reporter.\n *\n * @event click When add to cart or add to wishlist buttons are clicked.\n * @event handle_unavailable_items Triggered when clicking an action in the unavailable products dialog\n */\nclass AddToBagTracker extends analytics_1.AbstractAnalyticsTracker {\n constructor(options) {\n super(Object.assign({ moduleId }, options));\n this.context = options.context;\n }\n /**\n * Call to report when clicking to add products to the shopping cart.\n */\n sendAddToCartClick() {\n const payload = {\n common: { component: moduleId },\n data: {\n action: 'add_to_cart'\n },\n context: this.context\n };\n this.getReporter().report({\n event: 'click',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.giveMe,\n payload\n });\n }\n /**\n * Call to report when clicking an action in the unavailable products dialog.\n *\n * @param unavailableArticles\n * @param addUnavailableToWishList\n * @param action\n */\n sendHandleUnavailableItems(unavailableArticles, addUnavailableToWishList, action) {\n const payload = {\n common: { component: moduleId },\n data: {\n // eslint-disable-next-line camelcase\n add_unavailable_to_wishlist: addUnavailableToWishList,\n articles: unavailableArticles,\n action\n },\n context: this.context\n };\n this.getReporter().report({\n event: 'handle_unavailable_items',\n ipexMoment: action === 'continue' ? insights_data_provider_1.IpexMomentEnum.giveMe : insights_data_provider_1.IpexMomentEnum.whatIsMe,\n payload\n });\n }\n}\nexports.default = AddToBagTracker;\n//# sourceMappingURL=AddToBagTracker.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass AddToBagStyle {\n static getStyle(options) {\n const { spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t.divider {\n\t\t\t\twidth: ${spacing.space50 / 16}rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t}\n\n\t\t\t.buyOnlineUnavailableIcon {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\t.buttonContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: flex-end;\n\t\t\t}\n\n\t\t\t.shoppingCartUnavailableMessage {\n\t\t\t\tmargin-bottom: ${spacing.space200 / 16}rem;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = AddToBagStyle;\n//# sourceMappingURL=AddToBagStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@inter-ikea-kompis/component-add-to-list\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/inline-message-webc\");\nrequire(\"@ingka/modal-webc\");\nrequire(\"@ingka/icon-store/checkmark\");\nrequire(\"@ingka/icon-store/shopping-bag-add\");\nrequire(\"@ingka/icon-store/warning-triangle\");\nrequire(\"../unavailable-products-card/UnavailableProductsCard\");\nconst AddToBagLayoutEnum_1 = __importDefault(require(\"../../enums/AddToBagLayoutEnum\"));\nconst AddToBagModalEnum_1 = __importDefault(require(\"../../enums/AddToBagModalEnum\"));\nconst AddToBagStateEnum_1 = __importDefault(require(\"../../enums/AddToBagStateEnum\"));\nconst AddToListLayoutEnum_1 = __importDefault(require(\"../../enums/AddToListLayoutEnum\"));\nconst UnavailableOnlineBehaviourEnum_1 = __importDefault(require(\"../../enums/UnavailableOnlineBehaviourEnum\"));\nconst AddToBagTracker_1 = __importDefault(require(\"../../trackers/AddToBagTracker\"));\nconst AddToBagStyle_1 = __importDefault(require(\"./AddToBagStyle\"));\n/**\n * View component for adding products to shopping list and shopping cart.\n *\n * @event addToCart Start adding products to shopping cart.\n * @event addToList Start adding products to shopping list.\n * @event addToCartClick User clicks on add to cart button.\n * @event modalClose Modal close\n * @event modalOpen Modal open\n * @event addUnavailableProductsToListChange Changes the option \"addUnavailableProductsToList\". Tiggered by user clicking the checkbox\n * @event addUnavailableToCartAndList Start adding unavailable products to shopping cart and shopping list\n * @event unavailableProductsModalContinue Click on continue in the unavailable products modal.\n * @event unavailableProductsCardCancelClick User click cancel in the unavailbleProductsCard dialog.\n * @event resetAddToCartState Sent after 3 seconds after addToCartState confirmation to be able to reset the state of the button.\n * @event resetAddToListState Sent after 3 seconds after addToListState confirmation to be able to reset the state of the button.\n */\nlet AddToBag = class AddToBag extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Defines the state for add to bag button\n this.unavailableOnlineBehaviour = UnavailableOnlineBehaviourEnum_1.default.blockPurchase;\n // Layout\n this.layout = AddToBagLayoutEnum_1.default.text;\n // Defines the state for add to bag button\n this.addToCartState = AddToBagStateEnum_1.default.default;\n // Defines the state for add to list button\n this.addToListState = AddToBagStateEnum_1.default.default;\n // Disables the buttons.\n this.disabled = false;\n // Modal visible\n this.visibleModal = null;\n // Selects the checkbox for the UnavailableProductsCard that adds unavailable items when user clicks \"continue\". Only available if markets supports shopping lists.\n this.addUnavailableProductsToList = false;\n // List of failed shopping products returned when trying to add to cart.\n this.failedShoppingItems = null;\n // Used for automatic analytics. If null or not set, analytics is turned off.\n this.analytics = null;\n // Hides the add to list button.\n this.hideListButton = false;\n this.promptElement = null;\n this.cardElement = null;\n this.triggerElement = null;\n this.tracker = null;\n this.addToCartTimeout = null;\n this.addToListTimeout = null;\n this.dexfSettings = null;\n }\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t${this.getInlineMessage()}\n\t\t\t
    ${this.getButtons()}
    \n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.closePrompt();\n this.disconnectTracker();\n if (this.addToCartTimeout) {\n clearTimeout(this.addToCartTimeout);\n }\n if (this.addToListTimeout) {\n clearTimeout(this.addToListTimeout);\n }\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n // Once the add to bag-button have been set with the state 'confirmation' there should be an event sent after 3 seconds to make it possible to reset its state to 'default' again.\n if (changedProperties.has('addToCartState') &&\n this.addToCartState === AddToBagStateEnum_1.default.confirmation) {\n this.dispatchResetAddToCartState();\n }\n // Once the add to list-button have been set with the state 'confirmation' there should be an event sent after 3 seconds to make it possible to reset its state to 'default' again.\n if (changedProperties.has('addToListState') &&\n this.addToListState === AddToBagStateEnum_1.default.confirmation) {\n this.dispatchResetAddToListState();\n }\n if (changedProperties.has('visibleModal')) {\n if (this.visibleModal === AddToBagModalEnum_1.default.unavailableProductCard) {\n this.openPrompt();\n }\n else {\n this.closePrompt();\n }\n }\n if (changedProperties.has('analytics') && this.hasTranslationsAndSettings()) {\n this.disconnectTracker();\n this.connectTracker();\n }\n this.forwardPropsToCard();\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getSettings() {\n return this.dexfSettings;\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n dispatchResetAddToCartState() {\n if (this.addToCartTimeout) {\n clearTimeout(this.addToCartTimeout);\n }\n this.addToCartTimeout = setTimeout(() => {\n this.dispatchEvent(new CustomEvent('resetAddToCartState', { bubbles: true }));\n }, 3000);\n }\n dispatchResetAddToListState() {\n if (this.addToListTimeout) {\n clearTimeout(this.addToListTimeout);\n }\n this.addToListTimeout = setTimeout(() => {\n this.dispatchEvent(new CustomEvent('resetAddToListState', { bubbles: true }));\n }, 3000);\n }\n connectTracker() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n if (this.analytics) {\n // eslint-disable-next-line no-underscore-dangle\n const reporter = this.analytics.__INTERNAL__reporter;\n if ((reporter === null || reporter === void 0 ? void 0 : reporter.connected) === false) {\n // Should use an existing reporter, but wait for it to be connected\n return;\n }\n // Use existing connected reporter, or the tracker should create a new one.\n const reporterId = reporter ? reporter.id : undefined;\n this.tracker = new AddToBagTracker_1.default(Object.assign(Object.assign({}, this.analytics), { settings: this.getSettings(), reporterId }));\n yield ((_a = this.tracker) === null || _a === void 0 ? void 0 : _a.connect());\n }\n });\n }\n disconnectTracker() {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.disconnect();\n this.tracker = null;\n }\n closePrompt() {\n if (this.promptElement) {\n this.promptElement.open = false;\n this.promptElement = null;\n this.cardElement = null;\n }\n }\n getButtons() {\n const isOnlineSaleable = this.isOnlineSaleable();\n if (this.layout === AddToBagLayoutEnum_1.default.text) {\n return (0, web_component_1.html) `${this.getCartButton({ isOnlineSaleable })} ${this.getDivider()}\n\t\t\t${this.getListButton()}`;\n }\n return (0, web_component_1.html) `\n\t\t\t${this.getListButton()} ${this.getDivider()} ${this.getCartButton({ isOnlineSaleable })}\n\t\t`;\n }\n getListButton() {\n if (!this.shouldShowAddToList()) {\n return null;\n }\n const layout = this.getAddToListLayout();\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t`;\n }\n /**\n * Get analytics object to pass on to sub components.\n */\n getSubComponentAnalytics() {\n var _a;\n const reporterId = (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.getConnectedReporterId();\n return this.analytics\n ? Object.assign(Object.assign({}, this.analytics), { \n // eslint-disable-next-line camelcase\n __INTERNAL__reporter: reporterId\n ? { connected: true, id: reporterId }\n : { connected: false } }) : null;\n }\n getAddToListLayout() {\n if (this.layout === AddToBagLayoutEnum_1.default.icon) {\n return AddToListLayoutEnum_1.default.iconSmall;\n }\n if (utilities_1.ShoppingSupport.hasCartSupport(this.getSettings())) {\n return AddToListLayoutEnum_1.default.icon;\n }\n return AddToListLayoutEnum_1.default.text;\n }\n getCartButton(options) {\n if (!utilities_1.ShoppingSupport.hasCartSupport(this.getSettings())) {\n return null;\n }\n const { loading, addToShoppingCartButtonSuccess, addToShoppingBagButton } = this.getTranslations();\n const disabled = this.disabled || !options.isOnlineSaleable || !this.hasPositiveQuantity();\n const isLoading = !disabled && this.addToCartState === AddToBagStateEnum_1.default.loading;\n const success = this.addToCartState === AddToBagStateEnum_1.default.confirmation;\n const label = success ? addToShoppingCartButtonSuccess : addToShoppingBagButton;\n const emphasisedVariant = 'emphasised';\n const icon = !disabled && this.addToCartState === AddToBagStateEnum_1.default.confirmation ? 'checkmark' : null;\n if (this.layout === AddToBagLayoutEnum_1.default.icon) {\n // Potential accessibility issue? Buttons should always have some sort of label or description\n return (0, web_component_1.html) `\n\t\t\t\t\n\t\t\t\t\t${label}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t`;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${icon ? (0, web_component_1.html) `` : null} ${label}\n\t\t\t\n\t\t`;\n }\n shouldShowAddToList() {\n return utilities_1.ShoppingSupport.hasListSupport(this.getSettings()) && !this.hideListButton;\n }\n getDivider() {\n if (!utilities_1.ShoppingSupport.hasCartSupport(this.getSettings()) || !this.shouldShowAddToList()) {\n return null;\n }\n return (0, web_component_1.html) `
    `;\n }\n setTriggerElement(target) {\n if (target instanceof Element) {\n this.triggerElement = this.getTriggerElement();\n }\n return this.triggerElement;\n }\n getTriggerElement() {\n var _a, _b, _c;\n return ((_c = (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('skapa-button, skapa-icon-button')) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('button'));\n }\n onAddToCart(event) {\n var _a;\n const triggerElement = this.setTriggerElement(event.currentTarget);\n const shoppingItems = utilities_1.ProductUtility.getShoppingItems(this.getValidShoppingProducts());\n this.dispatchEvent(new CustomEvent('addToCartClick', {\n bubbles: true,\n detail: {\n shoppingItems,\n triggerElement\n }\n }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendAddToCartClick();\n if (this.includesUnavailableProducts()) {\n this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: {\n visibleModal: AddToBagModalEnum_1.default.unavailableProductCard,\n shoppingItems,\n triggerElement\n }\n }));\n if (utilities_1.ShoppingSupport.hasListSupport(this.getSettings())) {\n this.dispatchEvent(new CustomEvent('addUnavailableProductsToListChange', {\n bubbles: true,\n detail: {\n addUnavailableProductsToList: true\n }\n }));\n }\n }\n else {\n this.dispatchEvent(new CustomEvent('addToCart', {\n bubbles: true,\n detail: {\n shoppingItems,\n completeConfiguration: true\n }\n }));\n }\n }\n onAddToList(event) {\n this.dispatchEvent(new CustomEvent('addToList', {\n bubbles: true,\n detail: Object.assign({}, event.detail)\n }));\n this.triggerElement = event.detail.triggerElement;\n }\n getInlineMessage() {\n return (0, web_component_1.html) `
    ${this.getCartUnavailableDisclaimer()}
    `;\n }\n getCartUnavailableDisclaimer() {\n if (this.isOnlineSaleable() ||\n !utilities_1.ShoppingSupport.hasCartSupport(this.getSettings()) ||\n (this.unavailableOnlineBehaviour === UnavailableOnlineBehaviourEnum_1.default.blockPurchase &&\n this.layout === AddToBagLayoutEnum_1.default.icon)) {\n return null;\n }\n const { addToShoppingCartUnavailable, addToShoppingCartUnavailableShort } = this.getTranslations();\n const text = this.layout === AddToBagLayoutEnum_1.default.text\n ? addToShoppingCartUnavailable\n : addToShoppingCartUnavailableShort;\n const cautionaryVariant = 'cautionary';\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${text}\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n getValidShoppingProducts() {\n return this.shoppingProducts\n .filter((shoppingProduct) => shoppingProduct.quantity > 0)\n .filter((shoppingProduct) => shoppingProduct.product.content);\n }\n getUnavailableShoppingProducts() {\n return this.shoppingProducts\n .filter((shoppingProduct) => shoppingProduct.quantity > 0)\n .filter((shoppingProduct) => !this.isShoppingProductOnlineSaleable(shoppingProduct));\n }\n isShoppingProductOnlineSaleable(shoppingProduct) {\n var _a, _b, _c, _d;\n const disableOnlineSaleableVerification = this.getSettings().kompis.localization.disableOnlineSaleableVerification;\n return Boolean(((_b = (_a = shoppingProduct.product.content) === null || _a === void 0 ? void 0 : _a.priceInformation) === null || _b === void 0 ? void 0 : _b.availableForHomeDelivery) ||\n ((_d = (_c = shoppingProduct.product.content) === null || _c === void 0 ? void 0 : _c.priceInformation) === null || _d === void 0 ? void 0 : _d.availableForClickCollect) ||\n disableOnlineSaleableVerification);\n }\n isOnlineSaleable() {\n const disableOnlineSaleableVerification = this.getSettings().kompis.localization.disableOnlineSaleableVerification;\n if (disableOnlineSaleableVerification ||\n this.unavailableOnlineBehaviour === UnavailableOnlineBehaviourEnum_1.default.continueByShoppingList) {\n return true;\n }\n return !this.includesUnavailableProducts();\n }\n includesUnavailableProducts() {\n return this.shoppingProducts\n .filter((shoppingProduct) => shoppingProduct.quantity > 0)\n .some((shoppingProduct) => !this.isShoppingProductOnlineSaleable(shoppingProduct));\n }\n hasPositiveQuantity() {\n return this.shoppingProducts.some((shoppingProduct) => shoppingProduct.quantity > 0);\n }\n openPrompt() {\n if (this.promptElement) {\n return;\n }\n const promptElement = this.createPromptElement();\n this.promptElement = promptElement;\n document.body.appendChild(promptElement);\n promptElement.open = true;\n }\n forwardPropsToCard() {\n if (this.cardElement) {\n this.cardElement.theme = this.theme;\n this.cardElement.shoppingProducts = this.shoppingProducts;\n this.cardElement.addToShoppingList = this.addUnavailableProductsToList;\n this.cardElement.localizedInformation = this.localizedInformation;\n this.cardElement.settings = this.settings;\n this.cardElement.translations = this.translations;\n this.cardElement.failedShoppingItems = this.failedShoppingItems;\n }\n }\n createPromptElement() {\n const promptElement = this.createPrompt();\n const heading = this.createPromptHeading();\n const cardElement = this.createCard();\n const promptFooterElement = this.createPromptFooter();\n promptElement.appendChild(heading);\n promptElement.appendChild(cardElement);\n promptElement.appendChild(promptFooterElement);\n return promptElement;\n }\n createPrompt() {\n const promptElement = document.createElement('skapa-prompt');\n promptElement.setAttribute('aria-label', this.getTranslations().addToShoppingCartUnavailableDialogueHeader);\n promptElement.style.fontFamily = themes_1.FontStyle.getFontFamily(this.theme);\n promptElement.style.zIndex = '500';\n promptElement.addEventListener('closerequest', () => {\n if (this.promptElement) {\n this.dispatchEvent(new CustomEvent('modalClose', {\n bubbles: true,\n detail: {\n visibleModal: null\n }\n }));\n }\n });\n promptElement.addEventListener('closed', () => {\n var _a;\n (_a = promptElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(promptElement);\n });\n return promptElement;\n }\n createPromptHeading() {\n const heading = document.createElement('h2');\n heading.slot = 'title';\n heading.innerText = this.getTranslations().addToShoppingCartUnavailableDialogueHeader;\n heading.className = common_styles_webc_1.Text.classnames({ heading: { m: true } });\n heading.style.margin = '0';\n const style = document.createElement('style');\n style.textContent = common_styles_webc_1.Text.CSS;\n heading.appendChild(style);\n return heading;\n }\n createCard() {\n this.cardElement = document.createElement('kompis-unavailable-products-card');\n this.forwardPropsToCard();\n this.cardElement.addEventListener('addToShoppingList', (event) => {\n this.dispatchEvent(new CustomEvent('addUnavailableProductsToListChange', {\n bubbles: true,\n detail: {\n addUnavailableProductsToList: event['detail'].addToShoppingList\n }\n }));\n });\n return this.cardElement;\n }\n getShoppingItems() {\n var _a, _b;\n const failedShoppingItemNos = (_b = (_a = this.failedShoppingItems) === null || _a === void 0 ? void 0 : _a.map(({ itemNo }) => itemNo)) !== null && _b !== void 0 ? _b : [];\n const shoppingItems = utilities_1.ProductUtility.getShoppingItems(this.getValidShoppingProducts()\n .filter(this.isShoppingProductOnlineSaleable.bind(this))\n .filter((sp) => { var _a, _b; return !failedShoppingItemNos.includes((_b = (_a = sp.product.content) === null || _a === void 0 ? void 0 : _a.ruItemNo) !== null && _b !== void 0 ? _b : ''); }));\n const failedShoppingProducts = this.shoppingProducts.filter((sp) => { var _a, _b; return failedShoppingItemNos.includes((_b = (_a = sp.product.content) === null || _a === void 0 ? void 0 : _a.ruItemNo) !== null && _b !== void 0 ? _b : ''); });\n const shoppingListItems = utilities_1.ProductUtility.getShoppingItems([\n ...this.getUnavailableShoppingProducts(),\n ...failedShoppingProducts\n ]);\n return { shoppingListItems, shoppingCartItems: shoppingItems };\n }\n createPromptFooter() {\n const { buttonCancel, buttonContinue } = this.getTranslations();\n const promptFooterElement = document.createElement('skapa-modal-footer');\n promptFooterElement.slot = 'footer';\n promptFooterElement.innerText = buttonContinue;\n const secondaryButtonSpan = document.createElement('span');\n secondaryButtonSpan.slot = 'secondary';\n secondaryButtonSpan.innerText = buttonCancel;\n promptFooterElement.appendChild(secondaryButtonSpan);\n promptFooterElement.addEventListener('primary', () => {\n var _a;\n this.dispatchEvent(new CustomEvent('modalClose', {\n bubbles: true,\n detail: {\n visibleModal: null,\n triggerElement: this.triggerElement\n }\n }));\n const { shoppingCartItems, shoppingListItems } = this.getShoppingItems();\n this.dispatchEvent(new CustomEvent('unavailableProductsModalContinue', {\n bubbles: true,\n detail: {\n shoppingItems: shoppingCartItems\n }\n }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendHandleUnavailableItems(shoppingListItems, this.addUnavailableProductsToList, 'continue');\n if (this.addUnavailableProductsToList) {\n const detail = {\n shoppingCartItems,\n shoppingListItems\n };\n this.dispatchEvent(new CustomEvent('addUnavailableToCartAndList', { bubbles: true, detail }));\n }\n else {\n this.dispatchEvent(new CustomEvent('addToCart', {\n bubbles: true,\n detail: {\n shoppingItems: shoppingCartItems,\n triggerElement: this.getTriggerElement()\n }\n }));\n }\n });\n promptFooterElement.addEventListener('secondary', () => {\n var _a;\n this.dispatchEvent(new CustomEvent('modalClose', {\n bubbles: true,\n detail: {\n visibleModal: null,\n triggerElement: this.triggerElement\n }\n }));\n this.dispatchEvent(new CustomEvent('unavailableProductsCardCancelClick', {\n bubbles: true\n }));\n const { shoppingListItems } = this.getShoppingItems();\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendHandleUnavailableItems(shoppingListItems, this.addUnavailableProductsToList, 'cancel');\n });\n return promptFooterElement;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], AddToBag.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], AddToBag.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], AddToBag.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], AddToBag.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], AddToBag.prototype, \"unavailableOnlineBehaviour\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], AddToBag.prototype, \"layout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], AddToBag.prototype, \"addToCartState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], AddToBag.prototype, \"addToListState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], AddToBag.prototype, \"shoppingProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], AddToBag.prototype, \"disabled\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], AddToBag.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], AddToBag.prototype, \"addUnavailableProductsToList\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], AddToBag.prototype, \"failedShoppingItems\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], AddToBag.prototype, \"analytics\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], AddToBag.prototype, \"hideListButton\", void 0);\nAddToBag = __decorate([\n (0, web_component_1.customElement)('kompis-add-to-bag')\n], AddToBag);\nexports.default = AddToBag;\n//# sourceMappingURL=AddToBag.js.map","import \"@inter-ikea-kompis/component-add-to-bag/lib/components/add-to-bag/AddToBag\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisAddToBag extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-add-to-bag\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.addToCartState = props.addToCartState;\n element.addToListState = props.addToListState;\n element.addUnavailableProductsToList = props.addUnavailableProductsToList;\n element.analytics = props.analytics;\n element.disabled = props.disabled;\n element.failedShoppingItems = props.failedShoppingItems;\n element.hideListButton = props.hideListButton;\n element.layout = props.layout;\n element.localizedInformation = props.localizedInformation;\n element.settings = props.settings;\n element.shoppingProducts = props.shoppingProducts;\n element.theme = props.theme;\n element.translations = props.translations;\n element.unavailableOnlineBehaviour = props.unavailableOnlineBehaviour;\n element.visibleModal = props.visibleModal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onAddToCart, \"addToCart\");\n this.updateEventListener(element, props.onAddToCartClick, \"addToCartClick\");\n this.updateEventListener(element, props.onAddToList, \"addToList\");\n this.updateEventListener(element, props.onAddUnavailableProductsToListChange, \"addUnavailableProductsToListChange\");\n this.updateEventListener(element, props.onAddUnavailableToCartAndList, \"addUnavailableToCartAndList\");\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n this.updateEventListener(element, props.onResetAddToCartState, \"resetAddToCartState\");\n this.updateEventListener(element, props.onResetAddToListState, \"resetAddToListState\");\n this.updateEventListener(element, props.onUnavailableProductsCardCancelClick, \"unavailableProductsCardCancelClick\");\n this.updateEventListener(element, props.onUnavailableProductsModalContinue, \"unavailableProductsModalContinue\");\n }\n}\nKompisAddToBag.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n addToCartState: PropTypes.string,\n addToListState: PropTypes.string,\n addUnavailableProductsToList: PropTypes.bool,\n analytics: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n disabled: PropTypes.bool,\n failedShoppingItems: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n hideListButton: PropTypes.bool,\n layout: PropTypes.string,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n shoppingProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n unavailableOnlineBehaviour: PropTypes.string,\n visibleModal: PropTypes.string,\n onAddToCart: PropTypes.func,\n onAddToList: PropTypes.func,\n onAddToCartClick: PropTypes.func,\n onModalClose: PropTypes.func,\n onModalOpen: PropTypes.func,\n onAddUnavailableProductsToListChange: PropTypes.func,\n onAddUnavailableToCartAndList: PropTypes.func,\n onUnavailableProductsModalContinue: PropTypes.func,\n onUnavailableProductsCardCancelClick: PropTypes.func,\n onResetAddToCartState: PropTypes.func,\n onResetAddToListState: PropTypes.func\n};\nexport default KompisAddToBag;\n","import \"@inter-ikea-kompis/component-add-to-bag/lib/components/unavailable-products-card/UnavailableProductsCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisUnavailableProductsCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-unavailable-products-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.addToShoppingList = props.addToShoppingList;\n element.disableLinks = props.disableLinks;\n element.failedShoppingItems = props.failedShoppingItems;\n element.localizedInformation = props.localizedInformation;\n element.settings = props.settings;\n element.shoppingProducts = props.shoppingProducts;\n element.theme = props.theme;\n element.translations = props.translations;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onAddToShoppingList, \"addToShoppingList\");\n }\n}\nKompisUnavailableProductsCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n addToShoppingList: PropTypes.bool,\n disableLinks: PropTypes.bool,\n failedShoppingItems: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n shoppingProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n onAddToShoppingList: PropTypes.func\n};\nexport default KompisUnavailableProductsCard;\n","import \"@inter-ikea-kompis/component-add-to-list/lib/components/add-to-list/AddToList\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisAddToList extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-add-to-list\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.analytics = props.analytics;\n element.disabled = props.disabled;\n element.iconVariant = props.iconVariant;\n element.layout = props.layout;\n element.localizedInformation = props.localizedInformation;\n element.settings = props.settings;\n element.shoppingProducts = props.shoppingProducts;\n element.state = props.state;\n element.translations = props.translations;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onAddToList, \"addToList\");\n this.updateEventListener(element, props.onResetState, \"resetState\");\n }\n}\nKompisAddToList.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n analytics: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n disabled: PropTypes.bool,\n iconVariant: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n layout: PropTypes.string,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n shoppingProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n state: PropTypes.string,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n onAddToList: PropTypes.func,\n onResetState: PropTypes.func\n};\nexport default KompisAddToList;\n","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@ingka/product-identifier-webc\");\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n *\n * Article number component.\n */\nlet ArticleNumber = class ArticleNumber extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Label text.\n this.label = null;\n // Item number.\n this.itemNo = null;\n // Subtle product identifier appearance\n this.subtle = false;\n }\n /**\n * @returns Template.\n */\n render() {\n if (this.itemNo === null) {\n return null;\n }\n const { color, spacing } = this.theme;\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t
    \n\t\t\t\t${this.getLabel()}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t${utilities_1.ProductUtility.formatItemNo(this.itemNo)}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * Returns label.\n *\n * @returns Template.\n */\n getLabel() {\n if (!this.label) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${this.label}\n\t\t\t\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ArticleNumber.prototype, \"label\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ArticleNumber.prototype, \"itemNo\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ArticleNumber.prototype, \"subtle\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ArticleNumber.prototype, \"theme\", void 0);\nArticleNumber = __decorate([\n (0, web_component_1.customElement)('kompis-article-number')\n], ArticleNumber);\nexports.default = ArticleNumber;\n//# sourceMappingURL=ArticleNumber.js.map","import \"@inter-ikea-kompis/component-article-number/lib/components/article-number/ArticleNumber\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisArticleNumber extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-article-number\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.itemNo = props.itemNo;\n element.label = props.label;\n element.subtle = props.subtle;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisArticleNumber.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n itemNo: PropTypes.string,\n label: PropTypes.string,\n subtle: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisArticleNumber;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass AssemblyServicesStatusButtonStyle {\n static getStyle(options) {\n var _a, _b;\n const { color } = options.theme;\n // Using small as breakpoint since fontStyle is the same for all of theme\n const { bodyMedium } = options.theme.breakpoint.small.fontStyle;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\tbutton {\n\t\t\t\toutline: none; /* Not to show default focus outline before Skapa focus outline */\n\t\t\t}\n\n\t\t\tspan {\n\t\t\t\tline-height: ${(_a = bodyMedium.lineHeight / 16) !== null && _a !== void 0 ? _a : ''}rem;\n\t\t\t\tfont-size: ${(_b = bodyMedium.size / 16) !== null && _b !== void 0 ? _b : ''}rem;\n\t\t\t\tcolor: ${color.neutral.grey700};\n\t\t\t}\n\n\t\t\t.buttonAsLinkResets {\n\t\t\t\talign-items: normal;\n\t\t\t\tbackground-color: rgba(0, 0, 0, 0);\n\t\t\t\tborder-style: none;\n\t\t\t\tbox-sizing: content-box;\n\t\t\t\tcursor: pointer;\n\t\t\t\tdisplay: inline;\n\t\t\t\tfont: inherit;\n\t\t\t\tpadding: 0;\n\t\t\t\tperspective-origin: 0 0;\n\t\t\t\ttext-align: start;\n\t\t\t\ttext-decoration: underline;\n\t\t\t\ttransform-origin: 0 0;\n\t\t\t\twidth: auto;\n\t\t\t\t-moz-appearance: none;\n\t\t\t\t-webkit-logical-height: 1em;\n\t\t\t\t-webkit-logical-width: auto;\n\t\t\t}\n\n\t\t\t.buttonAsLinkStyling {\n\t\t\t\tcolor: ${color.neutral.grey700};\n\t\t\t\theight: fit-content;\n\t\t\t}\n\n\t\t\tskapa-status.status-hidden {\n\t\t\t\t--size: 0;\n\t\t\t\t--skapa-status-inner-margin: 0;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = AssemblyServicesStatusButtonStyle;\n//# sourceMappingURL=AssemblyServicesStatusButtonStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@ingka/status-webc\");\nconst AssemblyServicesStatusButtonStyle_1 = __importDefault(require(\"./AssemblyServicesStatusButtonStyle\"));\n/**\n * @event statusButtonClick User clicks on the assembly services status button.\n */\nlet AssemblyServicesStatusButton = class AssemblyServicesStatusButton extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Assembly services data, containing if assembly services are available or not.\n this.assemblyServicesData = null;\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // Submitted and validated ZIP code.\n this.zipCode = null;\n }\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t${this.getContent()}\n\t\t`;\n }\n hasTranslations() {\n return !!this.localizedInformation || !!this.translations;\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n getContent() {\n const position = 'leading';\n const color = this.getStatusIndicatorColor();\n // Status needs to be the same element between states for focus to be put back when setting or forgetting a zip code.\n return (0, web_component_1.html) `${this.getLabel()}`;\n }\n getStatusIndicatorColor() {\n var _a;\n if (!this.zipCode || !this.assemblyServicesData) {\n return null;\n }\n return ((_a = this.assemblyServicesData) === null || _a === void 0 ? void 0 : _a.valid) ? 'green' : 'red';\n }\n getLabel() {\n return (0, web_component_1.html) `${this.getAvailabilityText()}${this.getButton()}`;\n }\n getAvailabilityText() {\n const { assemblyServicesStatusAvailableZip, assemblyServicesStatusUnavailableZip } = this.getTranslations();\n if (!this.zipCode || !this.assemblyServicesData) {\n return null;\n }\n if (this.assemblyServicesData.valid) {\n return assemblyServicesStatusAvailableZip.replace('{{zip_code}}', '');\n }\n return assemblyServicesStatusUnavailableZip.replace('{{zip_code}}', '');\n }\n getButton() {\n return (0, web_component_1.html) ` {\n this.dispatchEvent(new CustomEvent('statusButtonClick', { bubbles: true }));\n }}\"\n\t\t>\n\t\t\t${this.zipCode && this.assemblyServicesData\n ? this.zipCode\n : this.getTranslations().assemblyServicesStatusDefault}\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], AssemblyServicesStatusButton.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], AssemblyServicesStatusButton.prototype, \"assemblyServicesData\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], AssemblyServicesStatusButton.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], AssemblyServicesStatusButton.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], AssemblyServicesStatusButton.prototype, \"zipCode\", void 0);\nAssemblyServicesStatusButton = __decorate([\n (0, web_component_1.customElement)('kompis-assembly-services-status-button')\n], AssemblyServicesStatusButton);\nexports.default = AssemblyServicesStatusButton;\n//# sourceMappingURL=AssemblyServicesStatusButton.js.map","import \"@inter-ikea-kompis/component-assembly-services/lib/components/assembly-services-status-button/AssemblyServicesStatusButton\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisAssemblyServicesStatusButton extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-assembly-services-status-button\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.assemblyServicesData = props.assemblyServicesData;\n element.localizedInformation = props.localizedInformation;\n element.theme = props.theme;\n element.translations = props.translations;\n element.zipCode = props.zipCode;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onStatusButtonClick, \"statusButtonClick\");\n }\n}\nKompisAssemblyServicesStatusButton.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n assemblyServicesData: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n zipCode: PropTypes.string,\n onStatusButtonClick: PropTypes.func\n};\nexport default KompisAssemblyServicesStatusButton;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar InputModeEnum;\n(function (InputModeEnum) {\n // Keyboard for letters and numbers - no special characters.\n InputModeEnum[\"text\"] = \"text\";\n // Keypad for number inputs with decimals.\n InputModeEnum[\"decimal\"] = \"decimal\";\n // Keypad for number inputs without decimals.\n InputModeEnum[\"numeric\"] = \"numeric\";\n // Keypad for phone number inputs, including plus sign.\n InputModeEnum[\"tel\"] = \"tel\";\n // Keyboard for search inputs - same keyboard layout as text.\n InputModeEnum[\"search\"] = \"search\";\n // Keyboard for email inputs, including at sign, period, underscore, and dash.\n InputModeEnum[\"email\"] = \"email\";\n // Keyboard for URL inputs - same keyboard layout as text.\n InputModeEnum[\"url\"] = \"url\";\n // Keyboard for measurement inputs, including prime symbols, slash, and decimals.\n InputModeEnum[\"measurement\"] = \"measurement\";\n})(InputModeEnum || (InputModeEnum = {}));\nexports.default = InputModeEnum;\n//# sourceMappingURL=InputModeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar KeyboardTypeEnum;\n(function (KeyboardTypeEnum) {\n // Keyboard for letters and numbers - no special characters.\n KeyboardTypeEnum[\"text\"] = \"text\";\n // Keyboard for emails, including at sign, period, underscore, and dash.\n KeyboardTypeEnum[\"email\"] = \"email\";\n // Keypad for numbers with decimals.\n KeyboardTypeEnum[\"decimal\"] = \"decimal\";\n // Keypad for numbers without decimals.\n KeyboardTypeEnum[\"number\"] = \"number\";\n // Keypad for phone numbers, including plus sign.\n KeyboardTypeEnum[\"tel\"] = \"tel\";\n // Keyboard for measurement inputs, including prime symbols, slash, and decimals.\n KeyboardTypeEnum[\"measurement\"] = \"measurement\";\n})(KeyboardTypeEnum || (KeyboardTypeEnum = {}));\nexports.default = KeyboardTypeEnum;\n//# sourceMappingURL=KeyboardTypeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\n/**\n * Keyboard manager.\n */\nclass KeyboardManager {\n /**\n * Constructor.\n *\n * @param [cacheStore] Cache store.\n */\n constructor(cacheStore = new utilities_1.GlobalCacheStore()) {\n this.cache = cacheStore.getStore('keyboardManager');\n }\n /**\n * Adds a keyboard.\n *\n * @param keyboard Keyboard.\n */\n addKeyboard(keyboard) {\n this.getKeyboards().add(keyboard);\n }\n /**\n * @param keyboard Keyboard.\n *\n * Removes the keyboard.\n */\n removeKeyboard(keyboard) {\n this.getKeyboards().delete(keyboard);\n }\n /**\n * Show keyboard.\n *\n * @param inputElement Input Element.\n */\n setFocus(inputElement) {\n this.getKeyboards().forEach((keyboard) => keyboard.setFocus(inputElement));\n }\n /**\n * Hides the keyboard.\n *\n */\n removeFocus() {\n this.getKeyboards().forEach((keyboard) => keyboard.removeFocus());\n }\n /**\n * Gets keyboards from cache store.\n *\n * @returns Keyboard set.\n */\n getKeyboards() {\n const keyboards = this.cache.get('keyboards');\n if (keyboards) {\n return keyboards;\n }\n this.cache.set('keyboards', new Set());\n return this.cache.get('keyboards');\n }\n}\nexports.default = KeyboardManager;\n//# sourceMappingURL=KeyboardManager.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.KeyboardTypeEnum = exports.KeyboardManager = exports.InputModeEnum = void 0;\nconst InputModeEnum_1 = __importDefault(require(\"./enums/InputModeEnum\"));\nexports.InputModeEnum = InputModeEnum_1.default;\nconst KeyboardTypeEnum_1 = __importDefault(require(\"./enums/KeyboardTypeEnum\"));\nexports.KeyboardTypeEnum = KeyboardTypeEnum_1.default;\nconst KeyboardManager_1 = __importDefault(require(\"./KeyboardManager\"));\nexports.KeyboardManager = KeyboardManager_1.default;\n//# sourceMappingURL=index.js.map","import { getStore } from '@ingka/singleton-store';\nconst ICON_STORE_ID = 'skapa-icon-store';\n// The store will be initialized with a generic Map inside the getStore on first request.\nconst iconStore = getStore(ICON_STORE_ID);\nexport const registerIcon = (name, paths) => {\n if (!iconStore.has(name))\n iconStore.set(name, paths);\n};\nexport const getPaths = (name) => {\n if (!name)\n return;\n const result = iconStore.get(name);\n if (!result)\n console.error(`The icon: '${name}' has not been loaded yet!\\nDid you forget to import '@ingka/icon-store/${name}'?`);\n return result;\n};\n","import { registerIcon } from './index.js';\nregisterIcon('warning-triangle-orange-small', [{ tag: 'path', att: { d: 'M1.0154 15.457 8.3515 1.5342h1.304l7.3599 13.9291-.6598 1.0709H1.6672l-.6518-1.0772z', fill: 'rgb(var(--colour-semantic-caution, 242, 106, 47))' } }, { tag: 'path', att: { d: 'M10.2485 13.25c0 .6904-.5596 1.25-1.25 1.25-.6903 0-1.25-.5596-1.25-1.25S8.3082 12 8.9985 12c.6904 0 1.25.5596 1.25 1.25z', fill: 'rgb(var(--colour-text-and-icon-5, 255, 255, 255))' } }, { tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M8 10.5V6h2v4.5H8z', fill: 'rgb(var(--colour-text-and-icon-5, 255, 255, 255))' } }]);\n","import { registerIcon } from './index.js';\nregisterIcon('checkmark-green-small', [{ tag: 'path', att: { d: 'M17 9c0 4.4183-3.5817 8-8 8s-8-3.5817-8-8 3.5817-8 8-8 8 3.5817 8 8z', fill: 'rgb(var(--colour-semantic-positive, 10, 138, 0))' } }, { tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'm13.7083 7.207-5.7086 5.7062-3.7069-3.707L5.7071 7.792 8 10.085l4.2942-4.2925 1.414 1.4145z', fill: 'rgb(var(--colour-text-and-icon-5, 255, 255, 255))' } }]);\n","import { registerIcon } from './index.js';\nregisterIcon('notice-red-small', [{ tag: 'path', att: { d: 'M17 9c0 4.4183-3.5817 8-8 8s-8-3.5817-8-8 3.5817-8 8-8 8 3.5817 8 8z', fill: 'rgb(var(--colour-semantic-negative, 224, 7, 81))' } }, { tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M8 9.5V5h2v4.5H8z', fill: 'rgb(var(--colour-text-and-icon-5, 255, 255, 255))' } }, { tag: 'path', att: { d: 'M10.25 12.25c0 .6904-.5596 1.25-1.25 1.25s-1.25-.5596-1.25-1.25S8.3096 11 9 11s1.25.5596 1.25 1.25z', fill: 'rgb(var(--colour-text-and-icon-5, 255, 255, 255))' } }]);\n","// @ts-ignore\nconst styles = ':host{color:rgb(var(--colour-text-and-icon-3,118,118,118));display:inline-flex;font-size:.75rem;line-height:1.5}skapa-icon{flex:0 0 auto;height:1.125rem;margin-inline-end:.25rem;vertical-align:bottom;width:1.125rem}skapa-icon:not([icon]),skapa-icon[icon=\"\"]{display:none}:host([state=error]){color:rgb(var(--colour-semantic-negative,224,7,81))}:host([state=success]){color:rgb(var(--colour-semantic-positive,10,138,0))}:host([state=warning]){color:rgb(var(--colour-semantic-caution-text,202,80,8))}:host([text-only]) skapa-icon{display:none}:host([disabled]){display:none}';\nimport SkapaElement from '@ingka/skapa-webc-element';\nimport { prefixReplacer } from '@ingka/webc-tools';\nimport '@ingka/icon-webc';\nimport '@ingka/icon-store/warning-triangle-orange-small';\nimport '@ingka/icon-store/checkmark-green-small';\nimport '@ingka/icon-store/notice-red-small';\nlet styles_template;\nfunction getTemplate() {\n if (!styles_template) {\n styles_template = document.createElement('template');\n styles_template.innerHTML = prefixReplacer(`\n \n \n `);\n }\n return styles_template.content.cloneNode(true);\n}\nconst stateToIcon = {\n regular: '',\n success: 'checkmark-green-small',\n error: 'notice-red-small',\n warning: 'warning-triangle-orange-small'\n};\nexport class HelperText extends SkapaElement {\n constructor() {\n super();\n this.gatherProperties(['state', 'textOnly', 'disabled'], this);\n const shadow = this.attachShadow({ mode: 'open' });\n shadow.append(getTemplate());\n this.stateIcon = shadow.getElementById('icon');\n this.stateIcon.viewBox = '0 0 18 18';\n }\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'state') {\n const state = newValue || 'regular';\n this.stateIcon.icon = stateToIcon[state] || null;\n }\n }\n get state() {\n const attribute = this.getAttribute('state');\n return attribute || 'regular';\n }\n /** Validation state */\n set state(val) {\n if (val === 'regular') {\n this.removeAttribute('state');\n }\n else {\n this.setAttribute('state', val);\n }\n }\n get textOnly() {\n return this.hasAttribute('text-only');\n }\n set textOnly(val) {\n this.toggleAttribute('text-only', !!val);\n }\n get disabled() {\n return this.hasAttribute('disabled');\n }\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n}\nHelperText.observedAttributes = ['state'];\n","import { HelperText } from './HelperText.js';\nexport class CharacterCounter extends HelperText {\n constructor() {\n super();\n this.updateCount = () => {\n var _a;\n const content = ((_a = this.targetField) === null || _a === void 0 ? void 0 : _a.value) || '';\n const len = content.length;\n this.textContent = len.toString() + '/' + this.limit.toString();\n this.state = len > this.limit ? 'error' : 'regular';\n };\n this.bindTarget = () => {\n this.releaseTarget();\n let newTarget;\n if (!this.isConnected)\n return; // Will be triggered again on connect.\n if ((!this.for) || !(newTarget = this.getRootNode().getElementById(this.for)))\n return;\n this.targetField = newTarget; // forced assignment, maybe should stick with HTMLElement.\n if (this.targetField) {\n this.targetField.addEventListener('input', this.updateCount, { passive: true });\n this.targetField.addEventListener('change', this.updateCount, { passive: true });\n }\n this.updateCount();\n };\n this.releaseTarget = () => {\n if (this.targetField) {\n this.targetField.removeEventListener('input', this.updateCount);\n this.targetField.removeEventListener('change', this.updateCount);\n }\n };\n this.gatherProperties(['for', 'limit'], this);\n this.targetField = null;\n this.textOnly = true;\n }\n get for() {\n return this.getAttribute('for');\n }\n set for(target) {\n if (target)\n this.setAttribute('for', target);\n else\n this.removeAttribute('for');\n }\n get limit() {\n const _limit = Number(this.getAttribute('limit'));\n return typeof _limit === 'number' ? _limit : 0;\n }\n set limit(value) {\n this.setAttribute('limit', value.toString());\n }\n connectedCallback() {\n super.connectedCallback();\n this.bindTarget();\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.releaseTarget();\n }\n attributeChangedCallback(name, oldVal, newVal) {\n if (name === 'for')\n this.bindTarget();\n if (name === 'limit')\n this.updateCount();\n }\n}\nCharacterCounter.observedAttributes = ['for', 'limit'];\n","import define from '@ingka/webc-tools';\nimport { HelperText } from './src/HelperText.js';\nimport { CharacterCounter } from './src/CharacterCount.js';\nexport { HelperText, CharacterCounter };\nexport const helperTextTagName = define('helper-text', HelperText);\nexport const characterCounterTagName = define('character-counter', CharacterCounter);\n","// @ts-ignore\nconst styles = '*{box-sizing:border-box}:host{box-sizing:border-box;display:inline-block}:host([state=error]){--skapa-form-validation-colour:rgb(var(--colour-semantic-negative,224,7,81))}:host([state=success]){--skapa-form-validation-colour:rgb(var(--colour-semantic-positive,10,138,0))}:host([state=warning]){--skapa-form-validation-colour:rgb(var(--colour-semantic-caution,242,106,47))}:host([disabled]){--skapa-form-validation-colour:rgb(var(--colour-interactive-disabled-1,204,204,204));color:rgb(var(--colour-interactive-disabled-1,204,204,204));pointer-events:none}:host([disabled]) slot{color:inherit}:host([disabled]) slot::slotted(*){color:inherit}:host([disabled]) slot:not([name])::slotted(input:-webkit-autofill){-webkit-text-fill-color:rgb(var(--colour-interactive-disabled-1,204,204,204))}:host([disabled]) slot[name=helper]{display:none}.wrapper{align-items:center;background:rgb(var(--colour-neutral-1,255,255,255));border-radius:4px;display:flex;flex-direction:row;padding:0 .5rem;position:relative;width:100%}:host([read-only]) .wrapper{background-color:rgb(var(--colour-neutral-2,245,245,245))}slot{display:inline-flex}slot:not([name]){flex-grow:1}slot:not([name])::slotted(input){-webkit-appearance:none;appearance:none;background:none;border:0;color:rgb(var(--colour-text-and-icon-1,17,17,17));font-size:1rem;height:3rem;line-height:1.5;outline:none;overflow:hidden;width:100%}slot:not([name])::slotted(input:-webkit-autofill){-webkit-text-fill-color:rgb(var(--colour-text-and-icon-1,17,17,17));-webkit-box-shadow:0 0 0 3rem rgb(var(--colour-neutral-1,255,255,255)) inset}::slotted(input){flex-grow:1}slot[name=prefix]{margin-inline-end:.25rem}slot[name=suffix]{margin-inline-start:.25rem}slot[name=prefix],slot[name=suffix]{color:rgb(var(--colour-text-and-icon-3,118,118,118));flex-basis:0;font-size:1rem;line-height:1.5;opacity:0;overflow:hidden;text-overflow:ellipsis;transition:opacity .1s cubic-bezier(.4,0,.4,1),visibility .1s cubic-bezier(.4,0,.4,1);visibility:hidden;white-space:nowrap;z-index:100}slot[name=label]{display:block}:host([filled]) slot[name=prefix],:host([filled]) slot[name=suffix],:host([focused]) slot[name=prefix],:host([focused]) slot[name=suffix]{flex-basis:auto;opacity:1;transition-delay:33ms;visibility:visible}.wrapper:after{border:1px solid var(--skapa-form-validation-colour,rgb(var(--colour-interactive-subtle-border-default,146,146,146)));border-radius:4px;bottom:0;box-sizing:border-box;content:\" \";display:block;left:0;pointer-events:none;position:absolute;top:0;transition:box-shadow .1s cubic-bezier(.4,0,.4,1),border .1s cubic-bezier(.4,0,.4,1);width:100%}:host([read-only]) .wrapper:after{border-color:rgb(var(--colour-neutral-2,245,245,245))}:host([focused]) .wrapper:after{border:2px solid var(--skapa-form-validation-colour,rgb(var(--colour-interactive-emphasised-border-selected,0,88,163)))}:host([focused][read-only]) .wrapper:after{border:2px solid rgb(var(--colour-neutral-5,146,146,146))}slot[name=action]{margin-inline-start:.25rem}slot[name=icon]{margin-inline-end:.25rem}slot[name=label]::slotted(label){display:block;font-size:.875rem;line-height:1.571;margin:0 0 .125rem}slot[name=helper]{display:flex;margin-top:.25rem}slot[name=helper]::slotted(*){flex-grow:1}slot[name=helper]::slotted(skapa-character-counter){justify-content:end;padding-inline-start:.5rem}@media (forced-colors:active){:host([disabled]){--skapa-form-validation-colour:GrayText;color:GrayText}}';\nimport SkapaElement from '@ingka/skapa-webc-element';\nimport '@ingka/helper-text-webc';\nimport { prefixReplacer } from '@ingka/webc-tools';\nlet template;\nfunction getTemplate() {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = prefixReplacer(`\n \n \n
    \n \n \n \n \n \n
    \n \n `);\n }\n return template;\n}\nexport class InputField extends SkapaElement {\n constructor() {\n super();\n this.helperText = null;\n this.handleFocus = (ev) => {\n this.toggleAttribute('focused', ev.type === 'focusin');\n };\n this.updateState = (ev) => {\n const target = ev.target;\n if (target && ('nodeType' in target)) {\n this.toggleAttribute('filled', (Boolean(target.value) && (target.value !== '')));\n }\n };\n this.onSlotChange = ({ target }) => {\n if (target.name === 'helper') {\n // Update in helper\n this.helperText = this.querySelector(prefixReplacer('skapa-helper-text'));\n }\n else if (target.name === 'action') {\n const assignedButton = this.querySelector(prefixReplacer('skapa-icon-button[slot=action]'));\n if (assignedButton) {\n assignedButton.setAttribute('xsmall', '');\n assignedButton.setAttribute('variant', 'tertiary');\n }\n }\n this.micro(this.updateHelper, 'reflect properties and attributes on assigned elements');\n };\n this.updateHelper = () => {\n var _a;\n if (this.helperText) {\n this.helperText.state = this.state;\n }\n if (this.autoID) {\n const assignedInput = this.querySelector('input');\n const assignedLabel = this.querySelector('label');\n const characterCounter = this.querySelector(prefixReplacer('skapa-character-counter'));\n if (assignedInput) {\n assignedInput.id = this.autoID;\n if (!assignedInput.hasAttribute('type'))\n assignedInput.type = 'text';\n }\n if (assignedLabel)\n assignedLabel.htmlFor = this.autoID;\n if (this.helperText) {\n if (!this.helperText.id)\n this.helperText.id = `${this.autoID}-helper`;\n if (assignedInput)\n assignedInput.setAttribute('aria-describedby', this.helperText.id);\n }\n if (characterCounter)\n characterCounter.setAttribute('for', this.autoID);\n }\n this.querySelectorAll('*').forEach(e => e.toggleAttribute('disabled', this.disabled));\n (_a = this.querySelector('input')) === null || _a === void 0 ? void 0 : _a.toggleAttribute('readonly', this.readOnly);\n };\n this.gatherProperties(['state', 'disabled', 'readOnly', 'autoID'], this);\n const shadow = this.attachShadow({ mode: 'open' });\n shadow.append(getTemplate().content.cloneNode(true));\n shadow.addEventListener('slotchange', this.onSlotChange, { passive: true });\n }\n connectedCallback() {\n super.connectedCallback();\n this.addEventListener('focusin', this.handleFocus);\n this.addEventListener('focusout', this.handleFocus);\n this.addEventListener('input', this.updateState);\n this.addEventListener('change', this.updateState);\n this.micro(this.updateHelper, 'reflect properties and attributes on assigned elements');\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('focusin', this.handleFocus);\n this.removeEventListener('focusout', this.handleFocus);\n this.removeEventListener('change', this.updateState);\n this.removeEventListener('input', this.updateState);\n }\n get state() {\n return this.getAttribute('state') || 'regular';\n }\n set state(value) {\n if (value === 'regular') {\n this.removeAttribute('state');\n return;\n }\n this.setAttribute('state', value);\n }\n get disabled() {\n return this.hasAttribute('disabled');\n }\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n get readOnly() {\n return this.hasAttribute('read-only');\n }\n set readOnly(value) {\n this.toggleAttribute('read-only', !!value);\n }\n get autoID() {\n return this.getAttribute('auto-id');\n }\n set autoID(value) {\n if (value)\n this.setAttribute('auto-id', value);\n else\n this.removeAttribute('auto-id');\n }\n attributeChangedCallback(name) {\n this.micro(this.updateHelper, 'reflect properties and attributes on assigned elements');\n }\n}\nInputField.observedAttributes = ['state', 'disabled', 'read-only', 'auto-id'];\n","import define from '@ingka/webc-tools';\nimport { InputField } from './src/InputField.js';\nexport { InputField };\nexport const inputFieldTagName = define('input-field', InputField);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ZipInCardStateEnum;\n(function (ZipInCardStateEnum) {\n ZipInCardStateEnum[\"default\"] = \"default\";\n ZipInCardStateEnum[\"loading\"] = \"loading\";\n ZipInCardStateEnum[\"invalidInput\"] = \"invalidInput\";\n ZipInCardStateEnum[\"emptyInput\"] = \"emptyInput\";\n ZipInCardStateEnum[\"noZipInfo\"] = \"noZipInfo\";\n ZipInCardStateEnum[\"submitted\"] = \"submitted\";\n})(ZipInCardStateEnum || (ZipInCardStateEnum = {}));\nexports.default = ZipInCardStateEnum;\n//# sourceMappingURL=ZipInCardStateEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nclass ZipInCardStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing, color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\n\t\t\t:host {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\theight: 100%;\n\t\t\t}\n\n\t\t\th2 {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\n\t\t\tskapa-input-field {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\tfont-family: inherit;\n\t\t\t}\n\n\t\t\tlabel {\n\t\t\t\tcolor: ${color.text.default};\n\t\t\t}\n\n\t\t\tskapa-inline-message {\n\t\t\t\tmargin-top: ${spacing.space250 / 16}rem;\n\t\t\t}\n\n\t\t\tinput {\n\t\t\t\tfont-family: inherit;\n\t\t\t}\n\n\t\t\t.visuallyHidden:not(:focus):not(:active) {\n\t\t\t\tclip: rect(0 0 0 0);\n\t\t\t\tclip-path: inset(50%);\n\t\t\t\theight: ${1 / 16}rem;\n\t\t\t\toverflow: hidden;\n\t\t\t\tposition: absolute;\n\t\t\t\twhite-space: nowrap;\n\t\t\t\twidth: ${1 / 16}rem;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = ZipInCardStyle;\n//# sourceMappingURL=ZipInCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst keyboard_manager_1 = require(\"@inter-ikea-kompis/keyboard-manager\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@ingka/input-field-webc\");\nrequire(\"@ingka/inline-message-webc\");\nconst ZipInCardStateEnum_1 = __importDefault(require(\"../../enums/ZipInCardStateEnum\"));\nconst ZipInCardStyle_1 = __importDefault(require(\"./ZipInCardStyle\"));\n/**\n * Generic component for handling zip code input. Is intended for use inside the ZipIn component.\n *\n * @event save Triggered when the save button is clicked.\n * @event input Triggered when the zip code is changed.\n */\nlet ZipInCard = class ZipInCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // Current zip code. Changing this will update the value of the input field.\n this.zipCode = null;\n // Card state. Use ZipInCardStateEnum.\n this.state = ZipInCardStateEnum_1.default.default;\n this.keyboardManager = new keyboard_manager_1.KeyboardManager();\n }\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getHeading()} ${this.getBody()} ${this.getInput()} ${this.getInlineMessage()}\n\t\t`;\n }\n /**\n * Internal method to retrieve zip code directly from input field. When using\n * this component internally, prefer this over listening on the `input` event.\n */\n getZipCode() {\n var _a, _b;\n return (_b = (_a = this.getInputElement()) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '';\n }\n shouldUpdate(changedProperties) {\n var _a;\n if (changedProperties.has('zipCode')) {\n const input = this.getInputElement();\n if (input) {\n input.value = (_a = this.zipCode) !== null && _a !== void 0 ? _a : '';\n }\n }\n return true;\n }\n getInputElement() {\n var _a;\n return (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('input');\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n getHeading() {\n return (0, web_component_1.html) `\n\t\t\t

    \n\t\t\t\t${this.getTranslations().useLocationHeader}\n\t\t\t

    \n\t\t`;\n }\n getBody() {\n return (0, web_component_1.html) `\n\t\t\t

    \n\t\t\t\t${this.getTranslations().useLocationDescription}\n\t\t\t

    \n\t\t`;\n }\n getInput() {\n var _a;\n const isInvalid = this.state === ZipInCardStateEnum_1.default.emptyInput ||\n this.state === ZipInCardStateEnum_1.default.invalidInput;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t${this.getHelperText()}\n\t\t\t\t\t${isInvalid ? this.getHelperText() : null}\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n getInputState() {\n switch (this.state) {\n case ZipInCardStateEnum_1.default.invalidInput:\n case ZipInCardStateEnum_1.default.emptyInput:\n return 'error';\n default:\n return 'regular';\n }\n }\n onInputFocusIn() {\n const inputElement = this.getInputElement();\n if (inputElement) {\n this.keyboardManager.setFocus(inputElement);\n }\n }\n onInputFocusOut() {\n this.keyboardManager.removeFocus();\n }\n onInputValue(e) {\n e.stopPropagation();\n this.dispatchEvent(new CustomEvent('input', {\n bubbles: true,\n detail: {\n value: this.getZipCode()\n }\n }));\n }\n onInputKeydown(event) {\n if (event.key !== 'Enter') {\n return;\n }\n this.dispatchEvent(new CustomEvent('save', {\n bubbles: true,\n detail: {\n zipCode: this.getZipCode()\n }\n }));\n }\n getHelperText() {\n switch (this.state) {\n case ZipInCardStateEnum_1.default.invalidInput:\n return this.getTranslations().zipCodeInvalidError;\n case ZipInCardStateEnum_1.default.emptyInput:\n return this.getTranslations().zipCodeEmptyError;\n default:\n return this.getTranslations().zipCodeHelpText;\n }\n }\n getInlineMessage() {\n return (0, web_component_1.html) `
    ${this.getErrorMessage()}
    `;\n }\n getErrorMessage() {\n if (this.state !== ZipInCardStateEnum_1.default.noZipInfo) {\n return null;\n }\n const cautionaryVariant = 'cautionary';\n const { ikeaErrorTitleShort, ikeaGenericErrorTryAgain } = this.getTranslations();\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t\n\t\t\t\t${ikeaErrorTitleShort}\n\t\t\t\t${ikeaGenericErrorTryAgain}\n\t\t\t\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ZipInCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ZipInCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ZipInCard.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ZipInCard.prototype, \"zipCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ZipInCard.prototype, \"state\", void 0);\nZipInCard = __decorate([\n (0, web_component_1.customElement)('kompis-zip-in-card')\n], ZipInCard);\nexports.default = ZipInCard;\n//# sourceMappingURL=ZipInCard.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ZipInActionEnum;\n(function (ZipInActionEnum) {\n ZipInActionEnum[\"save\"] = \"save\";\n ZipInActionEnum[\"forget\"] = \"forget\";\n})(ZipInActionEnum || (ZipInActionEnum = {}));\nexports.default = ZipInActionEnum;\n//# sourceMappingURL=ZipInActionEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ZipInModalEnum;\n(function (ZipInModalEnum) {\n ZipInModalEnum[\"zipIn\"] = \"zipIn\";\n})(ZipInModalEnum || (ZipInModalEnum = {}));\nexports.default = ZipInModalEnum;\n//# sourceMappingURL=ZipInModalEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst analytics_1 = require(\"@inter-ikea-kompis/analytics\");\nconst insights_data_provider_1 = require(\"@insights/insights-data-provider\");\nconst moduleId = 'zip_in';\n/**\n * @event zip_code_action When an action is performed in the zip in sheet.\n */\nclass ZipInTracker extends analytics_1.AbstractAnalyticsTracker {\n constructor(options) {\n super(Object.assign({ moduleId }, options));\n }\n sendZipCodeAction(action) {\n const payload = {\n common: { component: moduleId },\n data: {\n action\n }\n };\n this.getReporter().report({\n event: 'zip_code_action',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe,\n payload\n });\n }\n}\nexports.default = ZipInTracker;\n//# sourceMappingURL=ZipInTracker.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@ingka/modal-webc\");\nrequire(\"@ingka/button-webc\");\nrequire(\"../zip-in-card/ZipInCard\");\nconst ZipInActionEnum_1 = __importDefault(require(\"../../enums/ZipInActionEnum\"));\nconst ZipInCardStateEnum_1 = __importDefault(require(\"../../enums/ZipInCardStateEnum\"));\nconst ZipInModalEnum_1 = __importDefault(require(\"../../enums/ZipInModalEnum\"));\nconst ZipInTracker_1 = __importDefault(require(\"../../trackers/ZipInTracker\"));\n/**\n * This component is used where users can enter their postcode.\n *\n * @event modalClose Modal close.\n * @event modalOpen Modal open.\n * @event save Triggered when the save button is clicked.\n * @event forget Triggered when the forget button is clicked.\n */\nlet ZipIn = class ZipIn extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service. Required for analytics.\n this.settings = null;\n // Visible modal. Use ZipInModalEnum.\n this.visibleModal = null;\n // Current zip code. Changing this will update the value of the input field.\n this.zipCode = null;\n // Card state. Use ZipInCardStateEnum.\n this.state = ZipInCardStateEnum_1.default.default;\n // Where the sheet will open. The values are flipped in RTL, meaning \"right\" will open to the left and vice versa.\n this.sheetAlignment = enums_1.SheetAlignmentEnum.right;\n // Used for automatic analytics. If null or not set, analytics is turned off.\n this.analytics = null;\n this.tracker = null;\n this.dexfSettings = null;\n this.sheetElement = null;\n this.cardElement = null;\n this.sheetFooterElement = null;\n }\n render() {\n return null;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.closeSheet();\n this.disconnectTracker();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('visibleModal')) {\n if (this.visibleModal === ZipInModalEnum_1.default.zipIn) {\n this.openSheet();\n }\n else {\n this.closeSheet();\n }\n }\n if (this.cardElement) {\n this.setCardProperties(this.cardElement);\n }\n if (changedProperties.has('state')) {\n this.recreateSheetFooter();\n }\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n if (changedProperties.has('analytics') && this.hasTranslationsAndSettings()) {\n this.disconnectTracker();\n this.connectTracker();\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getSettings() {\n return this.dexfSettings;\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n if (!translations) {\n throw new Error('Translations must be defined either through the \"translations\" or \"localizedInformation\" prop.');\n }\n return translations;\n }\n connectTracker() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n if (this.analytics) {\n // eslint-disable-next-line no-underscore-dangle\n const reporter = this.analytics.__INTERNAL__reporter;\n if ((reporter === null || reporter === void 0 ? void 0 : reporter.connected) === false) {\n // Should use an existing reporter, but wait for it to be connected\n return;\n }\n // Use existing connected reporter, or the tracker should create a new one.\n const reporterId = reporter ? reporter.id : undefined;\n this.tracker = new ZipInTracker_1.default(Object.assign(Object.assign({}, this.analytics), { settings: this.getSettings(), reporterId }));\n yield ((_a = this.tracker) === null || _a === void 0 ? void 0 : _a.connect());\n }\n });\n }\n disconnectTracker() {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.disconnect();\n this.tracker = null;\n }\n closeSheet() {\n if (this.sheetElement) {\n this.sheetElement.open = false;\n this.sheetElement = null;\n this.cardElement = null;\n this.sheetFooterElement = null;\n }\n }\n openSheet() {\n if (this.sheetElement) {\n return;\n }\n const sheetElement = this.createSheetElement();\n sheetElement.addEventListener('closed', () => {\n var _a;\n (_a = sheetElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(sheetElement);\n });\n this.sheetElement = sheetElement;\n this.cardElement = sheetElement.querySelector('kompis-zip-in-card');\n this.sheetFooterElement = sheetElement.querySelector('skapa-modal-footer');\n const parent = document.querySelector('kompis-keyboard-injector') || document.body;\n parent.appendChild(sheetElement);\n sheetElement.open = true;\n this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: {\n visibleModal: ZipInModalEnum_1.default.zipIn\n }\n }));\n }\n createSheetElement() {\n const sheetElement = this.createSheet();\n const sheetHeaderElement = this.createSheetHeader();\n const saveDesignToProfileCard = this.createCard();\n const sheetFooterElement = this.createSheetFooter();\n sheetElement.appendChild(sheetHeaderElement);\n sheetElement.appendChild(saveDesignToProfileCard);\n sheetElement.appendChild(sheetFooterElement);\n return sheetElement;\n }\n createSheet() {\n const sheetElement = document.createElement('skapa-sheet');\n sheetElement.setAttribute('aria-label', this.getTranslations().useLocationHeader);\n sheetElement.size = 'small';\n sheetElement.style.zIndex = '500';\n sheetElement.fullHeight = true;\n sheetElement.alignToStart = this.sheetAlignment === enums_1.SheetAlignmentEnum.left;\n sheetElement.style.fontFamily = themes_1.FontStyle.getFontFamily(this.theme);\n sheetElement.addEventListener('closerequest', () => {\n if (this.sheetElement) {\n this.dispatchEvent(new CustomEvent('modalClose', {\n bubbles: true,\n detail: {\n visibleModal: null\n }\n }));\n }\n });\n return sheetElement;\n }\n createSheetHeader() {\n const sheetHeaderElement = document.createElement('skapa-modal-header');\n sheetHeaderElement.slot = 'header';\n const headerSpan = document.createElement('span');\n headerSpan.slot = 'closebutton-label';\n headerSpan.innerText = this.getTranslations().modalAriaLabelButtonClose;\n sheetHeaderElement.appendChild(headerSpan);\n return sheetHeaderElement;\n }\n createCard() {\n const zipInCard = document.createElement('kompis-zip-in-card');\n this.setCardProperties(zipInCard);\n zipInCard.addEventListener('save', this.onSave.bind(this));\n return zipInCard;\n }\n onSave() {\n if (!this.cardElement) {\n return;\n }\n const zipCode = this.cardElement.getZipCode();\n this.dispatchEvent(new CustomEvent('save', {\n bubbles: true,\n detail: {\n visibleModal: null,\n zipCode\n }\n }));\n this.sendZipCodeActionEnter();\n }\n setCardProperties(cardElement) {\n cardElement.theme = this.theme;\n cardElement.localizedInformation = this.localizedInformation;\n cardElement.translations = this.translations;\n cardElement.zipCode = this.zipCode;\n cardElement.state = this.state;\n }\n recreateSheetFooter() {\n if (!this.sheetElement) {\n return;\n }\n if (this.sheetFooterElement) {\n this.sheetElement.removeChild(this.sheetFooterElement);\n this.sheetFooterElement = null;\n }\n const footer = this.createSheetFooter();\n this.sheetElement.appendChild(footer);\n this.sheetFooterElement = footer;\n }\n createSheetFooter() {\n const sheetFooterElement = document.createElement('skapa-modal-footer');\n sheetFooterElement.slot = 'footer';\n const saveButton = this.getSaveButton();\n const forgetButton = this.getForgetButton();\n if (forgetButton) {\n sheetFooterElement.appendChild(forgetButton);\n }\n sheetFooterElement.appendChild(saveButton);\n return sheetFooterElement;\n }\n getSaveButton() {\n const button = document.createElement('skapa-button');\n button.slot = 'primary-button';\n button.variant = 'primary';\n button.textContent = this.getTranslations().save;\n button.loading = this.state === ZipInCardStateEnum_1.default.loading;\n button.loadingSrText = this.getTranslations().loading;\n button.addEventListener('click', () => {\n this.onSave();\n });\n return button;\n }\n getForgetButton() {\n if (this.state !== ZipInCardStateEnum_1.default.submitted) {\n return null;\n }\n const forgetLinkTranslation = this.getTranslations().zipCodeForget;\n const button = document.createElement('skapa-button');\n button.slot = 'secondary-button';\n button.variant = 'secondary';\n button.textContent = forgetLinkTranslation;\n button.addEventListener('click', () => {\n this.dispatchEvent(new CustomEvent('forget', {\n bubbles: true,\n detail: {\n visibleModal: null,\n state: ZipInCardStateEnum_1.default.default,\n zipCode: ''\n }\n }));\n this.sendZipCodeActionRemove();\n });\n return button;\n }\n sendZipCodeActionEnter() {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendZipCodeAction(ZipInActionEnum_1.default.save);\n }\n sendZipCodeActionRemove() {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendZipCodeAction(ZipInActionEnum_1.default.forget);\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ZipIn.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ZipIn.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ZipIn.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ZipIn.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ZipIn.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ZipIn.prototype, \"zipCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ZipIn.prototype, \"state\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ZipIn.prototype, \"sheetAlignment\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ZipIn.prototype, \"analytics\", void 0);\nZipIn = __decorate([\n (0, web_component_1.customElement)('kompis-zip-in')\n], ZipIn);\nexports.default = ZipIn;\n//# sourceMappingURL=ZipIn.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ZipInButtonStateEnum;\n(function (ZipInButtonStateEnum) {\n ZipInButtonStateEnum[\"defaultButton\"] = \"zip_default_button\";\n ZipInButtonStateEnum[\"zipAvailableButton\"] = \"zip_available_button\";\n ZipInButtonStateEnum[\"zipUnavailableButton\"] = \"zip_unavailable_button\";\n})(ZipInButtonStateEnum || (ZipInButtonStateEnum = {}));\nexports.default = ZipInButtonStateEnum;\n//# sourceMappingURL=ZipInButtonStateEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass ZipInToastMessage {\n /**\n * @param localizedInformationOrTranslations\n * @param zipCode\n */\n static getZipCodeToastLabel(localizedInformationOrTranslations, zipCode) {\n const zipCodeLabel = 'translations' in localizedInformationOrTranslations\n ? localizedInformationOrTranslations.translations.zipCodeSelectedMessage\n : localizedInformationOrTranslations.zipCodeSelectedMessage;\n const stringToReplace = 'zip_code';\n const zipCodeToUpperCase = zipCode.toUpperCase();\n const label = zipCodeLabel\n .replace(`[[${stringToReplace}]]`, zipCodeToUpperCase)\n .replace(`{{${stringToReplace}}}`, zipCodeToUpperCase);\n return {\n label\n };\n }\n}\nexports.default = ZipInToastMessage;\n//# sourceMappingURL=ZipInToastMessage.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ZipInToastMessage = exports.ZipInModalEnum = exports.ZipInCardStateEnum = exports.ZipInCard = exports.ZipInButtonStateEnum = exports.ZipInActionEnum = exports.ZipIn = void 0;\nconst ZipIn_1 = __importDefault(require(\"./components/zip-in/ZipIn\"));\nexports.ZipIn = ZipIn_1.default;\nconst ZipInCard_1 = __importDefault(require(\"./components/zip-in-card/ZipInCard\"));\nexports.ZipInCard = ZipInCard_1.default;\nconst ZipInActionEnum_1 = __importDefault(require(\"./enums/ZipInActionEnum\"));\nexports.ZipInActionEnum = ZipInActionEnum_1.default;\nconst ZipInButtonStateEnum_1 = __importDefault(require(\"./enums/ZipInButtonStateEnum\"));\nexports.ZipInButtonStateEnum = ZipInButtonStateEnum_1.default;\nconst ZipInCardStateEnum_1 = __importDefault(require(\"./enums/ZipInCardStateEnum\"));\nexports.ZipInCardStateEnum = ZipInCardStateEnum_1.default;\nconst ZipInModalEnum_1 = __importDefault(require(\"./enums/ZipInModalEnum\"));\nexports.ZipInModalEnum = ZipInModalEnum_1.default;\nconst ZipInToastMessage_1 = __importDefault(require(\"./utilities/ZipInToastMessage\"));\nexports.ZipInToastMessage = ZipInToastMessage_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('drill', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M14 6H5v3h9V6zM3 4v7h3.983l-2.3093 4H3v6h11v-6h-3.5445l2.3094-4H16V9h2V8h3V6h-3V5h-2V4H3zm7.4555 7-2.3094 4H6.983l2.3094-4h1.163zM5 17h7v2H5v-2z' } }]);\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst analytics_1 = require(\"@inter-ikea-kompis/analytics\");\nconst ZipInButtonStateEnum_1 = __importDefault(require(\"@inter-ikea-kompis/component-zip-in/lib/enums/ZipInButtonStateEnum\"));\nconst insights_data_provider_1 = require(\"@insights/insights-data-provider\");\nconst moduleId = 'assembly_services';\n/**\n * @event click When the button to open the zip in flow is clicked.\n * @event navigation When the read more link is clicked.\n * {@nestedTracker component-zip-in/src/trackers/ZipInTracker.ts}.\n */\nclass AssemblyServicesTracker extends analytics_1.AbstractAnalyticsTracker {\n constructor(options) {\n super(Object.assign({ moduleId }, options));\n }\n sendLearnMoreNavigation() {\n const payload = {\n common: { component: moduleId },\n data: {\n to: analytics_1.NavigationToEnum.ikeaAssembly\n }\n };\n this.getReporter().report({\n event: 'navigation',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.helpMe,\n payload\n });\n }\n sendOpenZipFlowClick(item) {\n const action = item === ZipInButtonStateEnum_1.default.defaultButton ? 'add_zip_code' : 'change_zip_code';\n const payload = {\n common: { component: moduleId },\n data: {\n item,\n action\n }\n };\n this.getReporter().report({\n event: 'click',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe,\n payload\n });\n }\n}\nexports.default = AssemblyServicesTracker;\n//# sourceMappingURL=AssemblyServicesTracker.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass AssemblyServicesStyle {\n static getStyle(options) {\n var _a, _b, _c, _d, _e;\n const { spacing, color } = options.theme;\n // Using small as breakpoint since fontStyle is the same for all of theme\n const { headingSmall, bodyMedium } = options.theme.breakpoint.small.fontStyle;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: row;\n\t\t\t\tjustify-content: flex-start;\n\t\t\t\tgap: ${spacing.space100 / 16}rem;\n\n\t\t\t\twidth: 100%;\n\t\t\t\tpadding: ${spacing.space100 / 16}rem;\n\t\t\t\tborder: ${1 / 16}rem solid ${color.neutral.grey500};\n\t\t\t\tborder-radius: ${6 / 16}rem;\n\t\t\t}\n\n\t\t\th4 {\n\t\t\t\tfont-weight: ${(_a = headingSmall.weight) !== null && _a !== void 0 ? _a : ''};\n\t\t\t\tfont-size: ${(_b = headingSmall.size / 16) !== null && _b !== void 0 ? _b : ''}rem;\n\t\t\t\tline-height: ${(_c = headingSmall.lineHeight / 16) !== null && _c !== void 0 ? _c : ''}rem;\n\t\t\t\tcolor: ${color.neutral.grey900};\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\tp {\n\t\t\t\tcolor: ${color.neutral.grey700};\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\tp,\n\t\t\ta {\n\t\t\t\tline-height: ${(_d = bodyMedium.lineHeight / 16) !== null && _d !== void 0 ? _d : ''}rem;\n\t\t\t\tfont-size: ${(_e = bodyMedium.size / 16) !== null && _e !== void 0 ? _e : ''}rem;\n\t\t\t}\n\n\t\t\ta {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\toverflow: overlay;\n\t\t\t}\n\n\t\t\ta,\n\t\t\tkompis-assembly-services-status-button {\n\t\t\t\tmargin-top: ${spacing.space75 / 16}rem;\n\t\t\t}\n\n\t\t\tskapa-icon {\n\t\t\t\tflex-shrink: 0;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = AssemblyServicesStyle;\n//# sourceMappingURL=AssemblyServicesStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_zip_in_1 = require(\"@inter-ikea-kompis/component-zip-in\");\nconst component_zip_in_2 = require(\"@inter-ikea-kompis/component-zip-in\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@inter-ikea-kompis/component-zip-in\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/icon-store/drill\");\nrequire(\"../assembly-services-status-button/AssemblyServicesStatusButton\");\nconst AssemblyServicesTracker_1 = __importDefault(require(\"../../trackers/AssemblyServicesTracker\"));\nconst AssemblyServicesStyle_1 = __importDefault(require(\"./AssemblyServicesStyle\"));\n/**\n * @event assemblyServicesClick User clicks on the assembly services status.\n * @event modalClose Modal close.\n * @event modalOpen Modal open.\n * @event forgetZipCode User clicks to forget zip code.\n * @event saveZipCode User clicks to save zip code.\n */\nlet AssemblyServices = class AssemblyServices extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Assembly services data, containing if assembly services are available or not.\n this.assemblyServicesData = null;\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Submitted and validated ZIP code.\n this.zipCode = null;\n // Visible modal. Use ZipInModalEnum from the Zip in component.\n this.visibleModal = null;\n // Card state. Use ZipInCardStateEnum from the Zip in component.\n this.state = component_zip_in_2.ZipInCardStateEnum.default;\n // Where the sheet will open. The values are flipped in RTL, meaning \"right\" will open to the left and vice versa.\n this.sheetAlignment = enums_1.SheetAlignmentEnum.right;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // Used for automatic analytics. If null or not set, analytics is turned off.\n this.analytics = null;\n this.tracker = null;\n this.abTest = null;\n this.dexfSettings = null;\n }\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n if (this.isHiddenByAbTest()) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t${this.getIcon()}\n\n\t\t\t
    \n\t\t\t\t${this.getTitle()} ${this.getAssemblyServicesStatusButton()} ${this.getInfoLink()}\n\t\t\t\t${this.getZipIn()}\n\t\t\t
    \n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.disconnectTracker();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n if (changedProperties.has('analytics') && this.hasTranslationsAndSettings()) {\n this.disconnectTracker();\n this.connectTracker();\n }\n return true;\n }\n isHiddenByAbTest() {\n var _a;\n const { name, variation } = (_a = this.abTest) !== null && _a !== void 0 ? _a : {};\n return name === enums_1.ABTestNameEnum.assemblyServicesHidden && variation === enums_1.ABTestVariationEnum.B;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getSettings() {\n return this.dexfSettings;\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n connectTracker() {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n if (this.analytics) {\n this.tracker = new AssemblyServicesTracker_1.default(Object.assign(Object.assign({}, this.analytics), { settings: this.getSettings() }));\n // eslint-disable-next-line no-underscore-dangle\n this.abTest = (_a = this.analytics.__INTERNAL__overrideABTest) !== null && _a !== void 0 ? _a : this.tracker.getABTest();\n yield ((_b = this.tracker) === null || _b === void 0 ? void 0 : _b.connect());\n // Make sure child components with analytics connect their trackers when the id is available.\n this.requestUpdate();\n }\n });\n }\n disconnectTracker() {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.disconnect();\n this.tracker = null;\n }\n getIcon() {\n return (0, web_component_1.html) ` `;\n }\n getTitle() {\n return (0, web_component_1.html) `

    ${this.getTranslations().assemblyServicesTitle}

    `;\n }\n getAssemblyServicesStatusButton() {\n return (0, web_component_1.html) ` {\n this.dispatchEvent(new CustomEvent('assemblyServicesClick', { bubbles: true }));\n this.sendOpenZipFlowClick();\n }}\"\n\t\t>`;\n }\n getInfoLink() {\n const url = this.getSettings().kompis.urls.assemblyServicesLink;\n if (!url || this.disableLinks || !this.assemblyServicesData || !this.zipCode) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t { var _a; return (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendLearnMoreNavigation(); }}\"\n\t\t\t\t>${this.getTranslations().assemblyServicesLearnMore}\n\t\t`;\n }\n getZipIn() {\n return (0, web_component_1.html) ` {\n this.dispatchEvent(new CustomEvent('forgetZipCode', { bubbles: true, detail: event.detail }));\n }}\"\n\t\t\t@modalClose=\"${(event) => {\n this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: event.detail }));\n }}\"\n\t\t\t@modalOpen=\"${(event) => {\n this.dispatchEvent(new CustomEvent('modalOpen', { bubbles: true, detail: event.detail }));\n }}\"\n\t\t\t@save=\"${(event) => {\n this.dispatchEvent(new CustomEvent('saveZipCode', { bubbles: true, detail: event.detail }));\n }}\"\n\t\t>`;\n }\n getSubComponentAnalytics() {\n var _a;\n const reporterId = (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.getConnectedReporterId();\n return this.analytics\n ? Object.assign(Object.assign({}, this.analytics), { \n // eslint-disable-next-line camelcase\n __INTERNAL__reporter: reporterId\n ? { connected: true, id: reporterId }\n : { connected: false } }) : null;\n }\n getZipButtonState() {\n if (this.assemblyServicesData && this.zipCode) {\n if (this.assemblyServicesData.valid) {\n return component_zip_in_1.ZipInButtonStateEnum.zipAvailableButton;\n }\n return component_zip_in_1.ZipInButtonStateEnum.zipUnavailableButton;\n }\n return component_zip_in_1.ZipInButtonStateEnum.defaultButton;\n }\n sendOpenZipFlowClick() {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendOpenZipFlowClick(this.getZipButtonState());\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], AssemblyServices.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], AssemblyServices.prototype, \"assemblyServicesData\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], AssemblyServices.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], AssemblyServices.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], AssemblyServices.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], AssemblyServices.prototype, \"zipCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], AssemblyServices.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], AssemblyServices.prototype, \"state\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], AssemblyServices.prototype, \"sheetAlignment\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], AssemblyServices.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], AssemblyServices.prototype, \"analytics\", void 0);\nAssemblyServices = __decorate([\n (0, web_component_1.customElement)('kompis-assembly-services')\n], AssemblyServices);\nexports.default = AssemblyServices;\n//# sourceMappingURL=AssemblyServices.js.map","import \"@inter-ikea-kompis/component-assembly-services/lib/components/assembly-services/AssemblyServices\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisAssemblyServices extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-assembly-services\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.analytics = props.analytics;\n element.assemblyServicesData = props.assemblyServicesData;\n element.disableLinks = props.disableLinks;\n element.localizedInformation = props.localizedInformation;\n element.settings = props.settings;\n element.sheetAlignment = props.sheetAlignment;\n element.state = props.state;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n element.zipCode = props.zipCode;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onAssemblyServicesClick, \"assemblyServicesClick\");\n this.updateEventListener(element, props.onForgetZipCode, \"forgetZipCode\");\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n this.updateEventListener(element, props.onSaveZipCode, \"saveZipCode\");\n }\n}\nKompisAssemblyServices.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n analytics: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n assemblyServicesData: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n disableLinks: PropTypes.bool,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n sheetAlignment: PropTypes.string,\n state: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n zipCode: PropTypes.string,\n onAssemblyServicesClick: PropTypes.func,\n onModalClose: PropTypes.func,\n onModalOpen: PropTypes.func,\n onForgetZipCode: PropTypes.func,\n onSaveZipCode: PropTypes.func\n};\nexport default KompisAssemblyServices;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('laptop-checkmark', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M22 19H2.0723v-2H22v2z' } }, { tag: 'path', att: { d: 'M22 7.4608 20.5591 6l-5.9955 6.0784-3.1227-3.166L10 10.3732 14.5636 15 22 7.4608z' } }, { tag: 'path', att: { d: 'M14.0312 5H4v10h2V7h8.0312V5z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('speech-bubble', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M19 4c1.6569 0 3 1.3431 3 3v7c0 1.6569-1.3431 3-3 3h-6.5895l-3.9968 4H6v-4H5c-1.6568 0-3-1.3431-3-3V7c0-1.6569 1.3432-3 3-3h14zm1 3c0-.5523-.4477-1-1-1H5c-.5523 0-1 .4477-1 1v7c0 .5523.4477 1 1 1h3v3.5845L11.5817 15H19c.5523 0 1-.4477 1-1V7z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass AssistanceCardStyle {\n static getStyle(options) {\n var _a, _b, _c, _d, _e;\n const { spacing, color } = options.theme;\n // Using small as breakpoint since fontStyle is the same for all of theme\n const { headingXSmall, bodyMedium } = options.theme.breakpoint.small.fontStyle;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: row;\n\t\t\t\tjustify-content: flex-start;\n\t\t\t\tgap: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\tskapa-icon {\n\t\t\t\tflex-shrink: 0;\n\t\t\t}\n\n\t\t\th4 {\n\t\t\t\tfont-weight: ${(_a = headingXSmall.weight) !== null && _a !== void 0 ? _a : ''};\n\t\t\t\tfont-size: ${(_b = headingXSmall.size / 16) !== null && _b !== void 0 ? _b : ''}rem;\n\t\t\t\tline-height: ${(_c = headingXSmall.lineHeight / 16) !== null && _c !== void 0 ? _c : ''}rem;\n\t\t\t\tcolor: ${color.neutral.grey900};\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\tp {\n\t\t\t\tcolor: ${color.neutral.grey700};\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\tp,\n\t\t\ta,\n\t\t\tdiv {\n\t\t\t\tline-height: ${(_d = bodyMedium.lineHeight / 16) !== null && _d !== void 0 ? _d : ''}rem;\n\t\t\t\tfont-size: ${(_e = bodyMedium.size / 16) !== null && _e !== void 0 ? _e : ''}rem;\n\t\t\t}\n\n\t\t\t.body {\n\t\t\t\tmargin: ${spacing.space25 / 16}rem 0 0 0;\n\t\t\t}\n\n\t\t\ta {\n\t\t\t\tdisplay: inline;\n\t\t\t\toverflow: overlay;\n\t\t\t}\n\n\t\t\t.hint,\n\t\t\t.link-wrapper {\n\t\t\t\tmargin: ${spacing.space100 / 16}rem 0 0 0;\n\t\t\t}\n\n\t\t\t*,\n\t\t\t*:before,\n\t\t\t*:after {\n\t\t\t\toutline: none;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = AssistanceCardStyle;\n//# sourceMappingURL=AssistanceCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/icon-store/laptop-checkmark\");\nrequire(\"@ingka/icon-store/speech-bubble\");\nconst AssistanceCardStyle_1 = __importDefault(require(\"./AssistanceCardStyle\"));\n/**\n * @event linkClick Triggered when the link is clicked.\n */\nlet AssistanceCard = class AssistanceCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // The VPC code for the saved design.\n this.vpcCode = null;\n // The name of the application, e.g. \"pax\". Used in the booking url.\n this.applicationName = null;\n // Disables links and presents a different message. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n this.dexfSettings = null;\n }\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.disableLinks ? this.getKioskVersion() : this.getStandardVersion()}\n\t\t`;\n }\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n return true;\n }\n getSettings() {\n return this.dexfSettings;\n }\n hasTranslationsAndSettings() {\n return !!this.localizedInformation || !!(this.translations && this.settings);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n getKioskVersion() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t

    ${this.getTranslations().assistanceCardKioskHeader}

    \n\t\t\t\t

    ${this.getTranslations().assistanceCardKioskBody}

    \n\t\t\t\t${this.vpcCode &&\n (0, web_component_1.html) `\n\t\t\t\t\t

    ${this.getTranslations().designCodeTitle} ${this.vpcCode}

    \n\t\t\t\t`}\n\t\t\t
    \n\t\t`;\n }\n getStandardVersion() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t

    ${this.getTranslations().assistanceCardWebHeader}

    \n\t\t\t\t

    ${this.getTranslations().assistanceCardWebBody}

    \n\t\t\t\t${this.getLink()}\n\t\t\t\t${this.vpcCode &&\n (0, web_component_1.html) `\n\t\t\t\t\t

    \n\t\t\t\t\t\t${this.getTranslations().assistanceCardWebCodeHint}\n\t\t\t\t\t\t${this.vpcCode}\n\t\t\t\t\t

    \n\t\t\t\t`}\n\t\t\t
    \n\t\t`;\n }\n /**\n * Renders a link using the old Kompis hyperlink clone.\n * Should be replaced by styling from Skapa in the future (@ingka/focus and @ingka/hyperlink-shared).\n */\n getLink() {\n const url = this.constructUrl();\n if (!url) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n }\n constructUrl() {\n var _a;\n if (!this.applicationName) {\n return null;\n }\n return this.getSettings()\n .kompis.urls.supportBookingLink.replace('{applicationName}', this.applicationName)\n .replace('{vpcCode}', (_a = this.vpcCode) !== null && _a !== void 0 ? _a : '');\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], AssistanceCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], AssistanceCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], AssistanceCard.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], AssistanceCard.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], AssistanceCard.prototype, \"vpcCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], AssistanceCard.prototype, \"applicationName\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], AssistanceCard.prototype, \"disableLinks\", void 0);\nAssistanceCard = __decorate([\n (0, web_component_1.customElement)('kompis-assistance-card')\n], AssistanceCard);\nexports.default = AssistanceCard;\n//# sourceMappingURL=AssistanceCard.js.map","import \"@inter-ikea-kompis/component-assistance-card/lib/components/assistance-card/AssistanceCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisAssistanceCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-assistance-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.applicationName = props.applicationName;\n element.disableLinks = props.disableLinks;\n element.localizedInformation = props.localizedInformation;\n element.settings = props.settings;\n element.theme = props.theme;\n element.translations = props.translations;\n element.vpcCode = props.vpcCode;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onLinkClick, \"linkClick\");\n }\n}\nKompisAssistanceCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n applicationName: PropTypes.string,\n disableLinks: PropTypes.bool,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n vpcCode: PropTypes.string,\n onLinkClick: PropTypes.func\n};\nexport default KompisAssistanceCard;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('cross-small', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'm12.0006 13.4148 2.8283 2.8283 1.4142-1.4142-2.8283-2.8283 2.8283-2.8283-1.4142-1.4142-2.8283 2.8283L9.172 7.7578 7.7578 9.172l2.8286 2.8286-2.8286 2.8285 1.4142 1.4143 2.8286-2.8286z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar BannerLayoutEnum;\n(function (BannerLayoutEnum) {\n BannerLayoutEnum[\"default\"] = \"default\";\n BannerLayoutEnum[\"emergency\"] = \"emergency\";\n})(BannerLayoutEnum || (BannerLayoutEnum = {}));\nexports.default = BannerLayoutEnum;\n//# sourceMappingURL=BannerLayoutEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst BannerLayoutEnum_1 = __importDefault(require(\"../../enums/BannerLayoutEnum\"));\nconst ICON_PADDING = 2;\n/**\n * A class with style.\n */\nclass BannerStyle {\n /**\n * @param options\n * @param options.layout\n * @param options.theme\n * @param options.direction\n * @param options.closable\n * @param options.visible\n */\n static getStyle(options) {\n const { spacing, motion, color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: flex;\n\t\t\t\twidth: 100%;\n\t\t\t\tmin-height: ${spacing.space300 / 16}rem;\n\t\t\t\tjustify-content: center;\n\t\t\t\talign-items: center;\n\t\t\t\tbackground-color: ${this.getTypeColor(options)};\n\t\t\t\tanimation-name: ${options.visible ? 'none' : 'closing'};\n\t\t\t\tanimation-fill-mode: forwards;\n\t\t\t\tanimation-duration: ${motion.duration.medium};\n\t\t\t\tanimation-timing-function: ${motion.ease.easy};\n\t\t\t\t${this.getBannerPadding(options)}\n\t\t\t\t${this.getClosedStyle(options)}\n\t\t\t}\n\n\t\t\t@keyframes closing {\n\t\t\t\t0% {\n\t\t\t\t\ttransform: translateY(0);\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t}\n\t\t\t\t95% {\n\t\t\t\t\ttransform: translateY(-100%);\n\t\t\t\t\toverflow: hidden;\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t}\n\t\t\t\t100% {\n\t\t\t\t\tmin-height: 0;\n\t\t\t\t\theight: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.crossIcon {\n\t\t\t\tmargin: '0';\n\t\t\t\tpadding: 0;\n\t\t\t\talign-self: flex-start;\n\t\t\t\tposition: absolute;\n\t\t\t\t${this.getCrossIconRtlStyling(options)};\n\t\t\t\tmargin-top: -0.25rem;\n\t\t\t}\n\n\t\t\tkompis-text,\n\t\t\tskapa-icon {\n\t\t\t\tcolor: ${options.layout === BannerLayoutEnum_1.default.default\n ? color.text.inverse\n : color.text.dark};\n\t\t\t}\n\n\t\t\tkompis-text {\n\t\t\t\tword-break: break-word;\n\t\t\t}\n\n\t\t\t.infoIcon {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-self: flex-start;\n\t\t\t\tpadding-top: ${ICON_PADDING / 16}rem;\n\t\t\t}\n\n\t\t\t.divider {\n\t\t\t\twidth: ${spacing.space50 / 16}rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t}\n\t\t`;\n }\n /**\n * Get padding for the banner.\n *\n * @param options\n */\n static getBannerPadding(options) {\n if (options.closable) {\n if (options.direction === 'rtl') {\n return (0, web_component_1.css) `\n\t\t\t\t\tpadding: ${options.theme.spacing.space75 / 16}rem\n\t\t\t\t\t\t${options.theme.spacing.space150 / 16}rem ${options.theme.spacing.space75 / 16}rem\n\t\t\t\t\t\t${options.theme.spacing.space250 / 16}rem;\n\t\t\t\t`;\n }\n return (0, web_component_1.css) `\n\t\t\t\tpadding: ${options.theme.spacing.space75 / 16}rem ${options.theme.spacing.space250 / 16}rem\n\t\t\t\t\t${options.theme.spacing.space75 / 16}rem ${options.theme.spacing.space150 / 16}rem;\n\t\t\t`;\n }\n return (0, web_component_1.css) `\n\t\t\tpadding: ${options.theme.spacing.space75 / 16}rem ${options.theme.spacing.space150 / 16}rem;\n\t\t`;\n }\n /**\n * Get color for layout.\n *\n * @param options Options.\n */\n static getTypeColor(options) {\n switch (options.layout) {\n case BannerLayoutEnum_1.default.emergency:\n return options.theme.color.semantic.caution;\n default:\n return options.theme.color.neutral.grey900;\n }\n }\n /**\n * Get styling for when banner is closed.\n *\n * @param options\n */\n static getClosedStyle(options) {\n if (!options.visible) {\n return (0, web_component_1.css) `\n\t\t\t\ttransition: all ${options.theme.motion.duration.medium} ${options.theme.motion.ease.easy};\n\t\t\t\tpadding-top: 0;\n\t\t\t\tpadding-bottom: 0;\n\t\t\t\tvisibility: hidden;\n\t\t\t\topacity: 0;\n\t\t\t\toverflow: hidden;\n\t\t\t\theight: 0;\n\t\t\t`;\n }\n return ``;\n }\n /**\n * @param options\n */\n static getCrossIconRtlStyling(options) {\n if (options.direction === 'rtl') {\n return (0, web_component_1.css) `\n\t\t\t\tleft: ${options.theme.spacing.space100 / 16 + 'rem'};\n\t\t\t\tmargin-right: ${options.theme.spacing.space50 / 16 + 'rem'};\n\t\t\t`;\n }\n else {\n return (0, web_component_1.css) `\n\t\t\t\tright: ${options.theme.spacing.space100 / 16 + 'rem'};\n\t\t\t\tmargin-left: ${options.theme.spacing.space50 / 16 + 'rem'};\n\t\t\t`;\n }\n }\n}\nexports.default = BannerStyle;\n//# sourceMappingURL=BannerStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nrequire(\"@inter-ikea-kompis/component-icon\");\nrequire(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/icon-store/cross-small\");\nconst BannerLayoutEnum_1 = __importDefault(require(\"../../enums/BannerLayoutEnum\"));\nconst BannerStyle_1 = __importDefault(require(\"./BannerStyle\"));\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n \n * @event close When dismissing banner message.\n */\nlet Banner = class Banner extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Style\n this.layout = BannerLayoutEnum_1.default.default;\n // Custom icon\n this.icon = null;\n // Closable\n this.closable = false;\n // Visible\n this.visible = false;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n const direction = window.getComputedStyle(this).direction;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.icon ? (0, web_component_1.html) `
    ${this.getIcon()}
    ` : null}\n\t\t\t
    \n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t
    \n\t\t\t
    ${this.getCloseIconButton()}
    \n\t\t`;\n }\n /**\n * Retrieves correct icon.\n *\n * @returns Html.\n */\n getIcon() {\n return (0, web_component_1.html) `${(0, web_component_1.unsafeHTML)(this.icon)} `;\n }\n /**\n * Returns icon button if closable.\n */\n getCloseIconButton() {\n if (!this.closable) {\n return null;\n }\n const tertiaryVariant = 'tertiary';\n // Potential accessbility issue. All interactive elements should have some sort of label or descriptor.\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('close', { bubbles: true }))}\n\t\t\t>\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Banner.prototype, \"layout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Banner.prototype, \"icon\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Banner.prototype, \"closable\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Banner.prototype, \"visible\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Banner.prototype, \"theme\", void 0);\nBanner = __decorate([\n (0, web_component_1.customElement)('kompis-banner')\n], Banner);\nexports.default = Banner;\n//# sourceMappingURL=Banner.js.map","import \"@inter-ikea-kompis/component-banner/lib/components/banner/Banner\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisBanner extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-banner\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.closable = props.closable;\n element.icon = props.icon;\n element.layout = props.layout;\n element.theme = props.theme;\n element.visible = props.visible;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onClose, \"close\");\n }\n}\nKompisBanner.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n closable: PropTypes.bool,\n icon: PropTypes.string,\n layout: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n visible: PropTypes.bool,\n onClose: PropTypes.func\n};\nexport default KompisBanner;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar LoadingIndicatorColorEnum;\n(function (LoadingIndicatorColorEnum) {\n LoadingIndicatorColorEnum[\"emphasised\"] = \"emphasised\";\n LoadingIndicatorColorEnum[\"primary\"] = \"primary\";\n LoadingIndicatorColorEnum[\"secondary\"] = \"secondary\";\n})(LoadingIndicatorColorEnum || (LoadingIndicatorColorEnum = {}));\nexports.default = LoadingIndicatorColorEnum;\n//# sourceMappingURL=LoadingIndicatorColorEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar LoadingIndicatorSizeEnum;\n(function (LoadingIndicatorSizeEnum) {\n LoadingIndicatorSizeEnum[\"small\"] = \"small\";\n LoadingIndicatorSizeEnum[\"medium\"] = \"medium\";\n LoadingIndicatorSizeEnum[\"large\"] = \"large\";\n})(LoadingIndicatorSizeEnum || (LoadingIndicatorSizeEnum = {}));\nexports.default = LoadingIndicatorSizeEnum;\n//# sourceMappingURL=LoadingIndicatorSizeEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst LoadingIndicatorColorEnum_1 = __importDefault(require(\"../../enums/LoadingIndicatorColorEnum\"));\nconst LoadingIndicatorSizeEnum_1 = __importDefault(require(\"../../enums/LoadingIndicatorSizeEnum\"));\nconst MAX_TRANSFORM = 140; // Percentage\n/**\n * Style for Loading indicator.\n */\nclass LoadingIndicatorStyle {\n /**\n * Get the styles.\n *\n * @param options Options.\n * @param options.type Divider type.\n * @param options.theme Theme.\n * @param options.color Color.\n * @param options.size\n * @returns Styles.\n */\n static getStyle(options) {\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\twidth: ${this.getSize(options)};\n\t\t\t\tdisplay: block;\n\t\t\t}\n\t\t\t.dot {\n\t\t\t\tmargin-top: ${MAX_TRANSFORM}%;\n\t\t\t\tpadding-top: 100%;\n\t\t\t\tborder-radius: 50%;\n\t\t\t\tbackground-color: ${this.getDotBackground(options)};\n\t\t\t\tanimation-duration: 0.35s;\n\t\t\t\tanimation-name: bounce;\n\t\t\t\tanimation-iteration-count: infinite;\n\t\t\t\tanimation-timing-function: ease-in;\n\t\t\t\tanimation-direction: alternate;\n\t\t\t}\n\t\t\t@keyframes bounce {\n\t\t\t\t0% {\n\t\t\t\t\ttransform: translateY(-${MAX_TRANSFORM}%);\n\t\t\t\t}\n\t\t\t\t30% {\n\t\t\t\t\ttransform: translateY(-130%);\n\t\t\t\t}\n\t\t\t\t85% {\n\t\t\t\t\ttransform: translateY(-15%) scaleY(1);\n\t\t\t\t}\n\t\t\t\t100% {\n\t\t\t\t\ttransform: translateY(0) scaleY(0.75);\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n /**\n * Get dot size.\n *\n * @param options Options.\n * @param options.theme\n * @param options.size\n * @returns Css.\n */\n static getSize(options) {\n const { theme: { spacing }, size } = options;\n switch (size) {\n case LoadingIndicatorSizeEnum_1.default.small:\n return `${spacing.space25 / 16}rem`;\n case LoadingIndicatorSizeEnum_1.default.medium:\n return `${spacing.space50 / 16}rem`;\n case LoadingIndicatorSizeEnum_1.default.large:\n return `${spacing.space100 / 16}rem`;\n default:\n return '';\n }\n }\n /**\n * Get dot background color.\n *\n * @param options\n * @param options.theme\n * @param options.color\n * @returns Style.\n */\n static getDotBackground(options) {\n const { color } = options.theme;\n switch (options.color) {\n case LoadingIndicatorColorEnum_1.default.emphasised:\n return color.accent.primaryAccent;\n case LoadingIndicatorColorEnum_1.default.primary:\n return color.background.inverse;\n case LoadingIndicatorColorEnum_1.default.secondary:\n return color.background.default;\n default:\n return '';\n }\n }\n}\nexports.default = LoadingIndicatorStyle;\n//# sourceMappingURL=LoadingIndicatorStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@inter-ikea-kompis/component-icon\");\nconst LoadingIndicatorColorEnum_1 = __importDefault(require(\"../../enums/LoadingIndicatorColorEnum\"));\nconst LoadingIndicatorSizeEnum_1 = __importDefault(require(\"../../enums/LoadingIndicatorSizeEnum\"));\nconst LoadingIndicatorStyle_1 = __importDefault(require(\"./LoadingIndicatorStyle\"));\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n *\n * Divider class.\n */\nlet LoadingIndicator = class LoadingIndicator extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Color\n this.color = LoadingIndicatorColorEnum_1.default.emphasised;\n // Size\n this.size = LoadingIndicatorSizeEnum_1.default.medium;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], LoadingIndicator.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], LoadingIndicator.prototype, \"color\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], LoadingIndicator.prototype, \"size\", void 0);\nLoadingIndicator = __decorate([\n (0, web_component_1.customElement)('kompis-loading-indicator')\n], LoadingIndicator);\nexports.default = LoadingIndicator;\n//# sourceMappingURL=LoadingIndicator.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LoadingIndicatorSizeEnum = exports.LoadingIndicatorColorEnum = exports.LoadingIndicator = void 0;\nconst LoadingIndicator_1 = __importDefault(require(\"./components/loading-indicator/LoadingIndicator\"));\nexports.LoadingIndicator = LoadingIndicator_1.default;\nconst LoadingIndicatorColorEnum_1 = __importDefault(require(\"./enums/LoadingIndicatorColorEnum\"));\nexports.LoadingIndicatorColorEnum = LoadingIndicatorColorEnum_1.default;\nconst LoadingIndicatorSizeEnum_1 = __importDefault(require(\"./enums/LoadingIndicatorSizeEnum\"));\nexports.LoadingIndicatorSizeEnum = LoadingIndicatorSizeEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/** @deprecated Use button type from Skapa instead. */\nvar ButtonAlignEnum;\n(function (ButtonAlignEnum) {\n ButtonAlignEnum[\"left\"] = \"left\";\n ButtonAlignEnum[\"right\"] = \"right\";\n})(ButtonAlignEnum || (ButtonAlignEnum = {}));\nexports.default = ButtonAlignEnum;\n//# sourceMappingURL=ButtonAlignEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/** @deprecated Skapa has a boolean called \"small\". Use this to set \"medium\" or \"small\" size for buttons. */\nvar ButtonSizeEnum;\n(function (ButtonSizeEnum) {\n ButtonSizeEnum[\"small\"] = \"small\";\n ButtonSizeEnum[\"medium\"] = \"medium\";\n})(ButtonSizeEnum || (ButtonSizeEnum = {}));\nexports.default = ButtonSizeEnum;\n//# sourceMappingURL=ButtonSizeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/** @deprecated Use button type from Skapa instead. */\nvar ButtonTypeEnum;\n(function (ButtonTypeEnum) {\n ButtonTypeEnum[\"primary\"] = \"primary\";\n ButtonTypeEnum[\"emphasised\"] = \"emphasised\";\n ButtonTypeEnum[\"secondary\"] = \"secondary\";\n ButtonTypeEnum[\"tertiary\"] = \"tertiary\";\n ButtonTypeEnum[\"danger\"] = \"danger\";\n ButtonTypeEnum[\"imageOverlay\"] = \"imageOverlay\";\n})(ButtonTypeEnum || (ButtonTypeEnum = {}));\nexports.default = ButtonTypeEnum;\n//# sourceMappingURL=ButtonTypeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/** @deprecated Use button type from Skapa instead. */\nvar ButtonOverlayColorEnum;\n(function (ButtonOverlayColorEnum) {\n ButtonOverlayColorEnum[\"IMAGE_OVERLAY_DARKEST\"] = \"IMAGE_OVERLAY_DARKEST\";\n ButtonOverlayColorEnum[\"IMAGE_OVERLAY_COLOR\"] = \"IMAGE_OVERLAY_COLOR\";\n ButtonOverlayColorEnum[\"IMAGE_OVERLAY_DARK\"] = \"IMAGE_OVERLAY_DARK\";\n ButtonOverlayColorEnum[\"BUTTON_COLOR_DARK\"] = \"BUTTON_COLOR_DARK\";\n ButtonOverlayColorEnum[\"BUTTON_COLOR_LIGHT\"] = \"BUTTON_COLOR_LIGHT\";\n ButtonOverlayColorEnum[\"BUTTON_COLOR_LIGHT_DARK\"] = \"BUTTON_COLOR_LIGHT_DARK\";\n ButtonOverlayColorEnum[\"BUTTON_COLOR_SECONDARY_INVERSE\"] = \"BUTTON_COLOR_SECONDARY_INVERSE\";\n ButtonOverlayColorEnum[\"BUTTON_COLOR_SECONDARY\"] = \"BUTTON_COLOR_SECONDARY\";\n})(ButtonOverlayColorEnum || (ButtonOverlayColorEnum = {}));\nexports.default = ButtonOverlayColorEnum;\n//# sourceMappingURL=ButtonOverlayColorEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst ButtonAlignEnum_1 = __importDefault(require(\"../../enums/ButtonAlignEnum\"));\nconst ButtonOverlayColorEnum_1 = __importDefault(require(\"../../enums/ButtonOverlayColorEnum\"));\nconst ButtonSizeEnum_1 = __importDefault(require(\"../../enums/ButtonSizeEnum\"));\nconst ButtonTypeEnum_1 = __importDefault(require(\"../../enums/ButtonTypeEnum\"));\nconst BUTTON_HEIGHT = {\n small: 40,\n medium: 56\n};\nclass ButtonStyle {\n /**\n * Returns overlay color styles.\n *\n * @param options Options.\n * @param color\n * @returns Styles.\n */\n static getColor(options, color) {\n const { neutral } = options.theme.color;\n switch (color) {\n case ButtonOverlayColorEnum_1.default.IMAGE_OVERLAY_DARKEST:\n return utilities_1.ColorConverter.multiplyOpacity(neutral.grey900, 0.7);\n case ButtonOverlayColorEnum_1.default.IMAGE_OVERLAY_COLOR:\n return utilities_1.ColorConverter.multiplyOpacity(neutral.grey900, 0.6);\n case ButtonOverlayColorEnum_1.default.IMAGE_OVERLAY_DARK:\n return utilities_1.ColorConverter.multiplyOpacity(neutral.grey900, 0.65);\n case ButtonOverlayColorEnum_1.default.BUTTON_COLOR_DARK:\n return utilities_1.ColorConverter.multiplyOpacity(neutral.white, 0.15);\n case ButtonOverlayColorEnum_1.default.BUTTON_COLOR_LIGHT:\n return utilities_1.ColorConverter.multiplyOpacity(neutral.white, 0.5);\n case ButtonOverlayColorEnum_1.default.BUTTON_COLOR_LIGHT_DARK:\n return utilities_1.ColorConverter.multiplyOpacity(neutral.white, 0.3);\n case ButtonOverlayColorEnum_1.default.BUTTON_COLOR_SECONDARY_INVERSE:\n return utilities_1.ColorConverter.multiplyOpacity(neutral.white, 0.1);\n case ButtonOverlayColorEnum_1.default.BUTTON_COLOR_SECONDARY:\n return utilities_1.ColorConverter.multiplyOpacity(neutral.grey900, 0.1);\n }\n }\n /**\n * Returns styles.\n *\n * @param options Options.\n * @returns Styles.\n */\n static getStyle(options) {\n return (0, web_component_1.css) `\n\t\t\t${this.getCommonStyle(options)}\n\t\t\t${this.getLayoutStyle(options)}\n ${options.isDisabled ? this.getDisabled(options) : ''}\n\t\t`;\n }\n /**\n * Returns styles.\n *\n * @param options Options.\n * @returns Styles.\n */\n static getCommonStyle(options) {\n const { spacing, border, motion } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tline-height: 0;\n\t\t\t\tdisplay: inline-block;\n\t\t\t\t${options.isDisabled || options.isLoading\n ? 'pointer-events: none;'\n : 'pointer-events: auto;'}\n\t\t\t}\n\n\t\t\tbutton {\n\t\t\t\tposition: relative;\n\t\t\t\tpointer-events: initial;\n\t\t\t\ttransition-property: background, transform;\n\t\t\t\ttransition-duration: ${motion.duration.small};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t\theight: ${(options.size === ButtonSizeEnum_1.default.small\n ? BUTTON_HEIGHT.small\n : BUTTON_HEIGHT.medium) / 16}rem;\n\t\t\t\tborder-radius: ${border.radius.radius64 / 16}rem;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tcursor: pointer;\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\t\t\t\twidth: 100%;\n\t\t\t\toverflow: visible;\n\t\t\t\talign-items: stretch;\n\t\t\t\t/* Override user agent styling */\n\t\t\t\tpadding: 0;\n\t\t\t\tborder: 0;\n\t\t\t\toutline: none;\n\t\t\t\tfont-weight: bold;\n\t\t\t}\n\n\t\t\tbutton:active {\n\t\t\t\ttransform: scale(0.98);\n\t\t\t}\n\n\t\t\tkompis-focus-outline {\n\t\t\t\tdisplay: flex;\n\t\t\t\tborder-radius: ${border.radius.radius64 / 16}rem;\n\t\t\t}\n\n\t\t\tbutton::-moz-focus-inner {\n\t\t\t\tborder: 0;\n\t\t\t}\n\n\t\t\t.container {\n\t\t\t\tflex-direction: ${options.alignIcon === 'right' ? 'row-reverse' : 'row'};\n\t\t\t\tpadding: 0\n\t\t\t\t\t${options.expanding\n ? (options.size === ButtonSizeEnum_1.default.small ? spacing.space75 : spacing.space125) / 16\n : (options.size === ButtonSizeEnum_1.default.small ? spacing.space150 : spacing.space200) /\n 16}rem;\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tjustify-content: center;\n\t\t\t\ttransition-duration: ${options.isLoading ? motion.duration.xsmall : motion.duration.large};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t\ttransform: ${options.isLoading ? 'translateY(30%)' : 'none'};\n\t\t\t\topacity: ${options.isLoading ? 0 : 1};\n\t\t\t\toverflow: hidden;\n\t\t\t\talign-items: center;\n\t\t\t\tposition: relative;\n\t\t\t}\n\n\t\t\t.loading-indicator-container {\n\t\t\t\ttransition-duration: ${motion.duration.large};\n\t\t\t\ttransition-property: opacity;\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t\topacity: ${options.isLoading ? 1 : 0};\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\t\t\t\talign-items: center;\n\t\t\t}\n\t\t\tloading-indicator {\n\t\t\t\twidth: ${6 / 16}rem;\n\t\t\t}\n\n\t\t\t.container kompis-icon {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tflex-grow: 0;\n\t\t\t}\n\n\t\t\t.divider {\n\t\t\t\ttransition: width ${motion.duration.large} ${motion.ease.easy};\n\t\t\t\twidth: ${options.expanding ? 0 : spacing.space50 / 16}rem;\n\t\t\t}\n\t\t\t@media (hover: hover) and (pointer: fine) {\n\t\t\t\tbutton:hover .divider {\n\t\t\t\t\twidth: ${spacing.space50 / 16}rem;\n\t\t\t\t}\n\t\t\t\tbutton:hover .container kompis-text {\n\t\t\t\t\tmax-width: ${options.expanding ? (spacing.space750 * 2) / 16 + 'rem' : 'initial'};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.container kompis-text {\n\t\t\t\tflex-shrink: 1;\n\t\t\t\toverflow: ${options.expanding ? 'hidden' : 'none'};\n\t\t\t\twhite-space: ${options.expanding ? 'nowrap' : 'normal'};\n\t\t\t\ttransition-property: max-width;\n\t\t\t\ttransition-duration: ${motion.duration.large};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t\ttransform-origin: ${options.alignIcon === ButtonAlignEnum_1.default.left ? 'left' : 'right'};\n\t\t\t\tmax-width: ${options.expanding ? 0 : '100%'};\n\t\t\t\tuser-select: none;\n\t\t\t}\n\n\t\t\t${this.getFocusStyle(options)}\n\n\t\t\t${!options.isDisabled && options.isLoading ? this.getLoading() : ''}\n\t\t`;\n }\n /**\n * Returns the style for focusing the button.\n *\n * @param options Options.\n * @returns Styles.\n */\n static getFocusStyle(options) {\n const { spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\tbutton:focus {\n\t\t\t\tbackground: ${this.getFocusColor(options)};\n\t\t\t}\n\n\t\t\tbutton:focus .divider {\n\t\t\t\twidth: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\tbutton:focus .container kompis-text {\n\t\t\t\tmax-width: ${options.expanding ? (spacing.space750 * 2) / 16 + 'rem' : 'initial'};\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns the text color when focusing.\n *\n * @param options Options.\n * @returns Styles.\n */\n static getFocusColor(options) {\n const { color } = options.theme;\n switch (options.buttonType) {\n case ButtonTypeEnum_1.default.primary:\n return options.invertedColors ? color.background.alt : color.component.primaryHover;\n case ButtonTypeEnum_1.default.emphasised:\n return options.invertedColors ? color.background.alt : color.accent.primaryAccent;\n case ButtonTypeEnum_1.default.secondary:\n return color.transparency.default;\n case ButtonTypeEnum_1.default.tertiary:\n return options.invertedColors\n ? ButtonStyle.getColor(options, ButtonOverlayColorEnum_1.default.BUTTON_COLOR_DARK)\n : color.background.alt;\n case ButtonTypeEnum_1.default.danger:\n return color.semantic.negative;\n case ButtonTypeEnum_1.default.imageOverlay:\n return ButtonStyle.getColor(options, ButtonOverlayColorEnum_1.default.IMAGE_OVERLAY_COLOR);\n default:\n return color.component.primaryHover;\n }\n }\n /**\n * Provide buttonType specific styles.\n *\n * @param options Options.\n * @returns Css.\n */\n static getLayoutStyle(options) {\n switch (options.buttonType) {\n case ButtonTypeEnum_1.default.primary:\n return this.getLayoutPrimary(options);\n case ButtonTypeEnum_1.default.emphasised:\n return this.getLayoutEmphasised(options);\n case ButtonTypeEnum_1.default.secondary:\n return this.getLayoutSecondary(options);\n case ButtonTypeEnum_1.default.tertiary:\n return this.getLayoutTertiary(options);\n case ButtonTypeEnum_1.default.danger:\n return this.getLayoutDanger(options);\n case ButtonTypeEnum_1.default.imageOverlay:\n return this.getLayoutImageOverlayButton(options);\n }\n return '';\n }\n /**\n * @returns Loading style.\n */\n static getLoading() {\n return (0, web_component_1.css) `\n\t\t\tbutton {\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\n\t\t\t.container {\n\t\t\t\tvisibility: hidden;\n\t\t\t}\n\t\t`;\n }\n /**\n * Style for button disabled.\n *\n * @param options Options.\n * @returns Style for button disabled.\n */\n static getDisabled(options) {\n return (0, web_component_1.css) `\n\t\t\tbutton {\n\t\t\t\tcolor: ${this.getDisabledColor(options)};\n\t\t\t\tbackground: ${this.getDisabledBackground(options)};\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns disabled text color.\n *\n * @param options Options.\n * @returns Style for button disabled.\n */\n static getDisabledColor(options) {\n const { color } = options.theme;\n switch (options.buttonType) {\n case ButtonTypeEnum_1.default.primary:\n case ButtonTypeEnum_1.default.emphasised:\n case ButtonTypeEnum_1.default.secondary:\n case ButtonTypeEnum_1.default.danger:\n case ButtonTypeEnum_1.default.imageOverlay:\n return color.neutral.grey500;\n case ButtonTypeEnum_1.default.tertiary:\n return color.disabled.default;\n }\n return '';\n }\n /**\n * Returns disabled background color.\n *\n * @param options Options.\n * @returns Style for button disabled.\n */\n static getDisabledBackground(options) {\n const { color } = options.theme;\n switch (options.buttonType) {\n case ButtonTypeEnum_1.default.primary:\n case ButtonTypeEnum_1.default.emphasised:\n case ButtonTypeEnum_1.default.secondary:\n return options.invertedColors\n ? ButtonStyle.getColor(options, ButtonOverlayColorEnum_1.default.BUTTON_COLOR_DARK)\n : color.disabled.default;\n case ButtonTypeEnum_1.default.danger:\n return color.disabled.default;\n case ButtonTypeEnum_1.default.imageOverlay:\n return ButtonStyle.getColor(options, ButtonOverlayColorEnum_1.default.IMAGE_OVERLAY_DARKEST);\n case ButtonTypeEnum_1.default.tertiary:\n return 'transparent';\n }\n return '';\n }\n /**\n * Returns background color for button types.\n *\n * @param options Options.\n */\n static getBackgroundColor(options) {\n const { color } = options.theme;\n switch (options.buttonType) {\n case ButtonTypeEnum_1.default.primary:\n return options.invertedColors ? color.background.default : color.neutral.grey900;\n case ButtonTypeEnum_1.default.emphasised:\n return options.invertedColors ? color.background.default : color.accent.primaryAccent;\n case ButtonTypeEnum_1.default.secondary:\n return color.neutral.white;\n case ButtonTypeEnum_1.default.tertiary:\n return color.transparency.default;\n case ButtonTypeEnum_1.default.danger:\n return color.semantic.negative;\n case ButtonTypeEnum_1.default.imageOverlay:\n return ButtonStyle.getColor(options, ButtonOverlayColorEnum_1.default.IMAGE_OVERLAY_COLOR);\n }\n return '';\n }\n /**\n * Returns hover color for button types.\n *\n * @param options Options.\n */\n static getHoverColor(options) {\n const { color } = options.theme;\n switch (options.buttonType) {\n case ButtonTypeEnum_1.default.primary:\n return options.invertedColors ? color.neutral.grey100 : color.component.primaryHover;\n case ButtonTypeEnum_1.default.emphasised:\n return options.invertedColors ? color.neutral.grey100 : color.accent.primaryAccentDark;\n case ButtonTypeEnum_1.default.secondary:\n return options.invertedColors\n ? ButtonStyle.getColor(options, ButtonOverlayColorEnum_1.default.BUTTON_COLOR_DARK)\n : color.border.dark;\n case ButtonTypeEnum_1.default.tertiary:\n return options.invertedColors\n ? ButtonStyle.getColor(options, ButtonOverlayColorEnum_1.default.BUTTON_COLOR_DARK)\n : color.background.alt;\n case ButtonTypeEnum_1.default.danger:\n return color.component.dangerHover;\n case ButtonTypeEnum_1.default.imageOverlay:\n return ButtonStyle.getColor(options, ButtonOverlayColorEnum_1.default.IMAGE_OVERLAY_DARK);\n }\n return '';\n }\n /**\n * Returns active color for button types.\n *\n * @param options Options.\n */\n static getActiveColor(options) {\n const { color } = options.theme;\n switch (options.buttonType) {\n case ButtonTypeEnum_1.default.primary:\n return options.invertedColors ? color.neutral.grey200 : color.component.primaryPress;\n case ButtonTypeEnum_1.default.emphasised:\n return options.invertedColors ? color.neutral.grey200 : color.accent.primaryAccentDarkest;\n case ButtonTypeEnum_1.default.secondary:\n return options.invertedColors ? color.border.inverse : color.border.dark;\n case ButtonTypeEnum_1.default.tertiary:\n return options.invertedColors\n ? ButtonStyle.getColor(options, ButtonOverlayColorEnum_1.default.BUTTON_COLOR_LIGHT_DARK)\n : color.neutral.grey200;\n case ButtonTypeEnum_1.default.danger:\n return color.component.dangerPress;\n case ButtonTypeEnum_1.default.imageOverlay:\n return ButtonStyle.getColor(options, ButtonOverlayColorEnum_1.default.IMAGE_OVERLAY_DARKEST);\n }\n return '';\n }\n /**\n * Returns text color for button types.\n *\n * @param options Options.\n */\n static getTextColor(options) {\n const { color } = options.theme;\n switch (options.buttonType) {\n case ButtonTypeEnum_1.default.primary:\n return options.invertedColors ? color.text.dark : color.neutral.white;\n case ButtonTypeEnum_1.default.emphasised:\n return options.invertedColors ? color.text.dark : color.neutral.white;\n case ButtonTypeEnum_1.default.secondary:\n return options.invertedColors ? color.text.inverse : color.text.dark;\n case ButtonTypeEnum_1.default.tertiary:\n return options.invertedColors ? color.text.inverse : color.text.dark;\n case ButtonTypeEnum_1.default.danger:\n return color.neutral.white;\n case ButtonTypeEnum_1.default.imageOverlay:\n return color.text.inverse;\n }\n return '';\n }\n /**\n * Style for primary buttonType.\n *\n * @param options Options.\n * @returns Style for primary buttonType.\n */\n static getLayoutPrimary(options) {\n return (0, web_component_1.css) `\n\t\t\tbutton {\n\t\t\t\tbackground: ${this.getBackgroundColor(options)};\n\t\t\t\tcolor: ${this.getTextColor(options)};\n\t\t\t}\n\n\t\t\t/* Prevents hover effect on touch. */\n\t\t\t@media (-moz-touch-enabled: 0), (pointer: fine) {\n\t\t\t\tbutton:hover {\n\t\t\t\t\tbackground: ${this.getHoverColor(options)};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbutton:active {\n\t\t\t\tbackground: ${this.getActiveColor(options)};\n\t\t\t}\n\t\t`;\n }\n /**\n * Style for text-only buttonType.\n *\n * @param options Options.\n * @returns Style for text-only buttonType.\n */\n static getLayoutEmphasised(options) {\n return (0, web_component_1.css) `\n\t\t\tbutton {\n\t\t\t\tbackground: ${this.getBackgroundColor(options)};\n\t\t\t\tcolor: ${this.getTextColor(options)};\n\t\t\t}\n\n\t\t\t/* Prevents hover effect on touch. */\n\t\t\t@media (-moz-touch-enabled: 0), (pointer: fine) {\n\t\t\t\tbutton:hover {\n\t\t\t\t\tbackground: ${this.getHoverColor(options)};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbutton:active {\n\t\t\t\tbackground: ${this.getActiveColor(options)};\n\t\t\t}\n\t\t`;\n }\n /**\n * Style for outlined buttonType.\n *\n * @param options Options.\n * @returns Style for outlined buttonType.\n */\n static getLayoutSecondary(options) {\n const { color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\tbutton {\n\t\t\t\tbackground: ${this.getBackgroundColor(options)};\n\t\t\t\tborder: ${1 / 16}rem solid\n\t\t\t\t\t${options.isDisabled\n ? 'none'\n : options.invertedColors\n ? color.border.inverse\n : color.border.dark};\n\t\t\t\tcolor: ${this.getTextColor(options)};\n\t\t\t}\n\n\t\t\t/* Prevents hover effect on touch. */\n\t\t\t@media (-moz-touch-enabled: 0), (pointer: fine) {\n\t\t\t\tbutton:hover {\n\t\t\t\t\tborder-color: ${this.getHoverColor(options)};\n\t\t\t\t\tbox-shadow: inset 0 0 0 ${1 / 16}rem\n\t\t\t\t\t\t${options.isDisabled\n ? 'none'\n : options.invertedColors\n ? color.border.inverse\n : color.border.dark};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbutton:focus {\n\t\t\t\tbox-shadow: inset 0 0 0 ${1 / 16}rem\n\t\t\t\t\t${options.isDisabled\n ? 'none'\n : options.invertedColors\n ? color.border.inverse\n : color.border.dark};\n\t\t\t}\n\n\t\t\tbutton:active {\n\t\t\t\tborder-color: ${this.getActiveColor(options)};\n\t\t\t\tbackground-color: ${options.invertedColors\n ? ButtonStyle.getColor(options, ButtonOverlayColorEnum_1.default.BUTTON_COLOR_SECONDARY_INVERSE)\n : ButtonStyle.getColor(options, ButtonOverlayColorEnum_1.default.BUTTON_COLOR_SECONDARY)};\n\t\t\t}\n\t\t`;\n }\n /**\n * @param options Options.\n * @returns Style for Tertiary buttonType.\n */\n static getLayoutTertiary(options) {\n return (0, web_component_1.css) `\n\t\t\tbutton {\n\t\t\t\tbackground: ${this.getBackgroundColor(options)};\n\t\t\t\tcolor: ${this.getTextColor(options)};\n\t\t\t}\n\n\t\t\t/* Prevents hover effect on touch. */\n\t\t\t@media (-moz-touch-enabled: 0), (pointer: fine) {\n\t\t\t\tbutton:hover {\n\t\t\t\t\tbackground: ${this.getHoverColor(options)};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbutton:active {\n\t\t\t\tbackground: ${this.getActiveColor(options)};\n\t\t\t}\n\t\t`;\n }\n /**\n * @param options Options.\n * @returns Style for danger buttonType.\n */\n static getLayoutDanger(options) {\n return (0, web_component_1.css) `\n\t\t\tbutton {\n\t\t\t\tbackground: ${this.getBackgroundColor(options)};\n\t\t\t\tcolor: ${this.getTextColor(options)};\n\t\t\t}\n\n\t\t\t/* Prevents hover effect on touch. */\n\t\t\t@media (-moz-touch-enabled: 0), (pointer: fine) {\n\t\t\t\tbutton:hover {\n\t\t\t\t\tbackground: ${this.getHoverColor(options)};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbutton:active {\n\t\t\t\tbackground: ${this.getActiveColor(options)};\n\t\t\t}\n\t\t`;\n }\n /**\n * Style for imageOverlay buttonType.\n *\n * @param options Options.\n * @returns Style for imageOverlay buttonType.\n */\n static getLayoutImageOverlayButton(options) {\n return (0, web_component_1.css) `\n\t\t\tbutton {\n\t\t\t\tbackground: ${this.getBackgroundColor(options)};\n\t\t\t\tcolor: ${this.getTextColor(options)};\n\t\t\t}\n\n\t\t\t/* Prevents hover effect on touch. */\n\t\t\t@media (-moz-touch-enabled: 0), (pointer: fine) {\n\t\t\t\tbutton:hover {\n\t\t\t\t\tbackground: ${this.getHoverColor(options)};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbutton:active {\n\t\t\t\tbackground: ${this.getActiveColor(options)};\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = ButtonStyle;\n//# sourceMappingURL=ButtonStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_focus_outline_1 = require(\"@inter-ikea-kompis/component-focus-outline\");\nconst component_loading_indicator_1 = require(\"@inter-ikea-kompis/component-loading-indicator\");\nrequire(\"@inter-ikea-kompis/component-icon\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@inter-ikea-kompis/component-loading-indicator\");\nrequire(\"@inter-ikea-kompis/component-focus-outline\");\nconst ButtonAlignEnum_1 = __importDefault(require(\"../../enums/ButtonAlignEnum\"));\nconst ButtonSizeEnum_1 = __importDefault(require(\"../../enums/ButtonSizeEnum\"));\nconst ButtonTypeEnum_1 = __importDefault(require(\"../../enums/ButtonTypeEnum\"));\nconst ButtonStyle_1 = __importDefault(require(\"./ButtonStyle\"));\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n * This component should be used for general buttons and it provides with general stylings according to NCL and fixes for common browsers and touch devices.\n *\n * @event click Triggered when button is clicked.\n */\nlet Button = class Button extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Text on button.\n this.label = null;\n // Explanatory accessibility text for button. Should only be used when label isn't clear enough.\n this.ariaLabel = null;\n // Appearance and function 'primary' or 'secondary'.\n this.type = ButtonTypeEnum_1.default.primary;\n // Align the icon 'right' or 'left'.\n this.alignIcon = ButtonAlignEnum_1.default.left;\n // InvertedColors mode\n this.invertedColors = false;\n // Flip the icon horizontally in RTL context\n this.flipIconRtl = false;\n // Icon: Icon on button.\n this.icon = null;\n // If set to true button is disabled.\n this.disabled = false;\n // Button size.\n this.size = ButtonSizeEnum_1.default.medium;\n // Expanding and shrinking.\n this.expanding = false;\n // Renders the loading style\n this.loading = false;\n // Tab index.\n this.tabIndex = 0;\n // Aria-describedby text.\n this.ariaDescribedby = null;\n // Sets the behaviour of the position watcher. The position watcher is useful when the component is inside an overflown element where it can become cropped. When enabled it will be set itself to be position fixed and update the position of itself live. However, updating the position live can be slow and result in lag on slower computers. Be wary of using 'auto' or 'enabled' if the component have any ancestors with transform styling.\n this.focusOutlinePositionWatcher = component_focus_outline_1.FocusOutlinePositionWatcherEnum.auto;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n var _a, _b;\n const direction = utilities_1.SafariWriteDirectionUtility.getWriteDirection(this);\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t\t\t event.preventDefault()}\"\n\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\taria-busy=\"${this.loading}\"\n\t\t\t\t\taria-label=\"${(_a = this.ariaLabel) !== null && _a !== void 0 ? _a : this.label}\"\n\t\t\t\t\taria-describedby=\"${(_b = this.ariaDescribedby) !== null && _b !== void 0 ? _b : ''}\"\n\t\t\t\t\ttabindex=\"${this.tabIndex}\"\n\t\t\t\t\t?disabled=\"${this.disabled || this.loading}\"\n\t\t\t\t>\n\t\t\t\t\t
    ${this.getIcon()} ${this.getDivider()} ${this.getLabel()}
    \n\t\t\t\t\t${this.getLoadingIcon()}\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n /**\n * Returns icon.\n *\n * @returns Template.\n */\n getIcon() {\n if (!this.icon) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n }\n /**\n * Return divider.\n *\n * @returns Template.\n */\n getDivider() {\n if (!this.icon || !this.label) {\n return null;\n }\n return (0, web_component_1.html) `
    `;\n }\n /**\n * Returns label.\n *\n * @returns Template.\n */\n getLabel() {\n if (!this.label) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${this.label}\n\t\t\t\n\t\t`;\n }\n /**\n * Returns loading icon.\n *\n * @returns Template.\n */\n getLoadingIcon() {\n if (!this.loading || this.disabled) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * Returns loading indicator color.\n */\n getLoadingIndicatorColor() {\n switch (this.type) {\n case ButtonTypeEnum_1.default.primary:\n case ButtonTypeEnum_1.default.emphasised:\n return this.invertedColors\n ? component_loading_indicator_1.LoadingIndicatorColorEnum.primary\n : component_loading_indicator_1.LoadingIndicatorColorEnum.secondary;\n case ButtonTypeEnum_1.default.secondary:\n case ButtonTypeEnum_1.default.tertiary:\n return this.invertedColors\n ? component_loading_indicator_1.LoadingIndicatorColorEnum.secondary\n : component_loading_indicator_1.LoadingIndicatorColorEnum.primary;\n default:\n return component_loading_indicator_1.LoadingIndicatorColorEnum.secondary;\n }\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Button.prototype, \"label\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Button.prototype, \"ariaLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Button.prototype, \"type\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Button.prototype, \"alignIcon\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Button.prototype, \"invertedColors\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Button.prototype, \"flipIconRtl\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Button.prototype, \"icon\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Button.prototype, \"disabled\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Button.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Button.prototype, \"size\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Button.prototype, \"expanding\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Button.prototype, \"loading\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], Button.prototype, \"tabIndex\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Button.prototype, \"ariaDescribedby\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Button.prototype, \"focusOutlinePositionWatcher\", void 0);\nButton = __decorate([\n (0, web_component_1.customElement)('kompis-button')\n], Button);\nexports.default = Button;\n//# sourceMappingURL=Button.js.map","import \"@inter-ikea-kompis/component-button/lib/components/button/Button\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisButton extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-button\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.alignIcon = props.alignIcon;\n element.ariaDescribedby = props.ariaDescribedby;\n element.ariaLabel = props.ariaLabel;\n element.disabled = props.disabled;\n element.expanding = props.expanding;\n element.flipIconRtl = props.flipIconRtl;\n element.focusOutlinePositionWatcher = props.focusOutlinePositionWatcher;\n element.icon = props.icon;\n element.invertedColors = props.invertedColors;\n element.label = props.label;\n element.loading = props.loading;\n element.size = props.size;\n element.tabIndex = props.tabIndex;\n element.theme = props.theme;\n element.type = props.type;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onClick, \"click\");\n }\n}\nKompisButton.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n alignIcon: PropTypes.string,\n ariaDescribedby: PropTypes.string,\n ariaLabel: PropTypes.string,\n disabled: PropTypes.bool,\n expanding: PropTypes.bool,\n flipIconRtl: PropTypes.bool,\n focusOutlinePositionWatcher: PropTypes.string,\n icon: PropTypes.string,\n invertedColors: PropTypes.bool,\n label: PropTypes.string,\n loading: PropTypes.bool,\n size: PropTypes.string,\n tabIndex: PropTypes.number,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n type: PropTypes.string,\n onClick: PropTypes.func\n};\nexport default KompisButton;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('chevron-left-small', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'm8.4004 12.0007 5.785 5.7857 1.4143-1.4141-4.3711-4.3716 4.3711-4.3717-1.4143-1.4142-5.785 5.7859z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('chevron-right-small', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'm15.5996 12.0007-5.785 5.7857-1.4143-1.4141 4.3711-4.3716L8.4003 7.629l1.4143-1.4142 5.785 5.7859z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar CarouselLayoutEnum;\n(function (CarouselLayoutEnum) {\n CarouselLayoutEnum[\"default\"] = \"default\";\n /** @deprecated */\n CarouselLayoutEnum[\"theatre\"] = \"theatre\";\n CarouselLayoutEnum[\"overflow\"] = \"overflow\";\n})(CarouselLayoutEnum || (CarouselLayoutEnum = {}));\nexports.default = CarouselLayoutEnum;\n//# sourceMappingURL=CarouselLayoutEnum.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-store/chevron-left-small\");\nrequire(\"@ingka/icon-store/chevron-right-small\");\nconst CarouselLayoutEnum_1 = __importDefault(require(\"../../enums/CarouselLayoutEnum\"));\n/**\n * Carousel Controls component.\n *\n * @event prev Emits when navigating to the previous item\n * @event next Emits when navigating to the next item\n */\nlet CarouselControls = class CarouselControls extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Appearance and function 'primary' or 'tertiary'.\n this.buttonType = 'primary';\n // Layout\n this.layout = CarouselLayoutEnum_1.default.default;\n // Show left arrow\n this.showLeftArrow = false;\n // Show right arrow\n this.showRightArrow = false;\n // Label for the carousel to set as an aria-label for accessibility reasons\n this.ariaLabelLeftArrow = null;\n // Label for the carousel to set as an aria-label for accessibility reasons\n this.ariaLabelRightArrow = null;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n const boxShadow = this.theme.elevation.size.default + ' ' + this.theme.elevation.color.default;\n const borderRadius = this.theme.border.radius.radius64 / 16 + 'rem';\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getPrevButton()}\n\t\t\t
    \n\t\t\t${this.getNextButton()}\n\t\t`;\n }\n /**\n * @returns Template.\n */\n getPrevButton() {\n if (!this.showLeftArrow) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t {\n this.dispatchEvent(new CustomEvent('prev', { bubbles: true }));\n }}\"\n\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\t${this.ariaLabelLeftArrow || ''}\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * @returns Template.\n */\n getNextButton() {\n if (!this.showRightArrow) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t {\n this.dispatchEvent(new CustomEvent('next', { bubbles: true }));\n }}\"\n\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\t${this.ariaLabelRightArrow || ''}\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], CarouselControls.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], CarouselControls.prototype, \"buttonType\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], CarouselControls.prototype, \"layout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], CarouselControls.prototype, \"showLeftArrow\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], CarouselControls.prototype, \"showRightArrow\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], CarouselControls.prototype, \"ariaLabelLeftArrow\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], CarouselControls.prototype, \"ariaLabelRightArrow\", void 0);\nCarouselControls = __decorate([\n (0, web_component_1.customElement)('kompis-carousel-controls')\n], CarouselControls);\nexports.default = CarouselControls;\n//# sourceMappingURL=CarouselControls.js.map","import \"@inter-ikea-kompis/component-carousel/lib/components/carousel-controls/CarouselControls\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisCarouselControls extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-carousel-controls\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.ariaLabelLeftArrow = props.ariaLabelLeftArrow;\n element.ariaLabelRightArrow = props.ariaLabelRightArrow;\n element.buttonType = props.buttonType;\n element.layout = props.layout;\n element.showLeftArrow = props.showLeftArrow;\n element.showRightArrow = props.showRightArrow;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onNext, \"next\");\n this.updateEventListener(element, props.onPrev, \"prev\");\n }\n}\nKompisCarouselControls.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n ariaLabelLeftArrow: PropTypes.string,\n ariaLabelRightArrow: PropTypes.string,\n buttonType: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n layout: PropTypes.string,\n showLeftArrow: PropTypes.bool,\n showRightArrow: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n onPrev: PropTypes.func,\n onNext: PropTypes.func\n};\nexport default KompisCarouselControls;\n","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\n/**\n * Carousel Item component.\n */\nlet CarouselItem = class CarouselItem extends web_component_1.KompisElement {\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t`;\n }\n};\nCarouselItem = __decorate([\n (0, web_component_1.customElement)('kompis-carousel-item')\n], CarouselItem);\nexports.default = CarouselItem;\n//# sourceMappingURL=CarouselItem.js.map","import \"@inter-ikea-kompis/component-carousel/lib/components/carousel-item/CarouselItem\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisCarouselItem extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-carousel-item\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) { }\n updateAllEventListeners(element, props) { }\n}\nKompisCarouselItem.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any\n};\nexport default KompisCarouselItem;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst CarouselLayoutEnum_1 = __importDefault(require(\"../../enums/CarouselLayoutEnum\"));\nclass CarouselStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.container Container.\n * @param options.container.clientWidth Client width.\n * @param options.container.scrollLeft Scroll left.\n * @param options.container.scrollWidth Scroll width.\n * @param options.itemCount = Item count.\n * @param options.fitItems \"true\" to fit items.\n * @param options.hasFocus \"true\" if focused.\n * @param options.theme Theme.\n * @param options.scrollBarHeight Scrollbar height.\n * @param options.isScrollbarHovered \"true\" if scrollbar is hovered.\n * @param options.showScrollbar \"true\" to show scrollbar.\n * @param options.paddingBottom \"true\" to apply padding under the carousel items.\n * @param options.direction Direction.\n * @returns Styles.\n */\n static getStyle(options) {\n const { color, border, motion, spacing } = options.theme;\n const scrollBarHeight = options.showScrollbar ? options.scrollBarHeight : 0;\n const scrollbarTrackBackground = options.showScrollbar\n ? `linear-gradient(\n\t\t\tto bottom,\n\t\t\ttransparent calc(50% - 1px),\n\t\t\t${color.border.light} calc(50% - 1px) calc(50% + 1px),\n\t\t\ttransparent calc(50% + 1px)\n\t\t)`\n : 'transparent';\n const scrollbarThumbBackground = options.showScrollbar\n ? `linear-gradient(\n\t\t\tto bottom,\n\t\t\ttransparent calc(50% - 1px),\n\t\t\t${color.neutral.grey900} calc(50% - 1px) calc(50% + 1px),\n\t\t\ttransparent calc(50% + 1px)\n\t\t)`\n : 'transparent';\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tposition: relative;\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\t.slideContainerWrapper {\n\t\t\t\toverflow: hidden;\n\t\t\t\theight: 100%;\n\t\t\t}\n\n\t\t\t.slideContainer {\n\t\t\t\tdisplay: ${options.fitItems ? 'grid' : 'flex'};\n\t\t\t\tgrid-template-columns: ${Array(options.itemCount)\n .fill(null)\n .map(() => '100%')\n .join(' ')};\n\t\t\t\toverflow-x: auto;\n\t\t\t\tgrid-column-gap: 0.08rem;\n\t\t\t\tflex-grow: 1;\n\t\t\t\theight: 100%;\n\t\t\t\tpadding-bottom: ${options.paddingBottom ? spacing.space200 / 16 : 0}rem;\n\n\t\t\t\t/*Firefox*/\n\t\t\t\tscrollbar-color: ${color.neutral.grey900} transparent;\n\t\t\t\tscrollbar-width: ${options.showScrollbar ? 'thin' : 'none'};\n\t\t\t}\n\n\t\t\t${this.getFirefoxScrollbar(options)}\n\n\t\t\t.slideContainer::-webkit-scrollbar {\n\t\t\t\t/* The browser adds some inner padding with the size of 2px for some reason */\n\t\t\t\theight: ${scrollBarHeight}px;\n\t\t\t}\n\t\t\t.slideContainer::-webkit-scrollbar-track {\n\t\t\t\tbackground: ${scrollbarTrackBackground};\n\t\t\t\tmargin-left: ${options.layout === CarouselLayoutEnum_1.default.theatre ? spacing.space50 / 16 : 0}rem;\n\t\t\t\tmargin-right: ${options.layout === CarouselLayoutEnum_1.default.theatre\n ? spacing.space50 / 16\n : 0}rem;\n\t\t\t}\n\t\t\t.slideContainer::-webkit-scrollbar-thumb {\n\t\t\t\tborder-radius: ${border.radius.radius64 / 16}rem;\n\t\t\t\tbackground: ${scrollbarThumbBackground};\n\t\t\t}\n\t\t\t.slideContainer::-webkit-scrollbar-thumb:active {\n\t\t\t\tbackground: ${color.neutral.grey900};\n\t\t\t}\n\t\t\t.slideContainer:focus {\n\t\t\t\toutline: none;\n\t\t\t}\n\t\t\t:host(:hover) kompis-carousel-controls {\n\t\t\t\tvisibility: visible;\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t\t.skipButton {\n\t\t\t\tposition: absolute;\n\t\t\t\tz-index: 1;\n\t\t\t\topacity: ${options.hasFocus ? 1 : 0};\n\t\t\t\ttop: ${spacing.space150 / 16}rem;\n\t\t\t\ttransition-property: opacity;\n\t\t\t\ttransition-duration: ${motion.duration.medium};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t\t${this.getRTLStyling(options)};\n\t\t\t}\n\t\t\tkompis-carousel-controls {\n\t\t\t\topacity: ${options.layout === CarouselLayoutEnum_1.default.overflow ? 1 : 0};\n\t\t\t\ttransition-property: opacity;\n\t\t\t\ttransition-duration: ${motion.duration.medium};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: ${(options.layout === CarouselLayoutEnum_1.default.overflow ||\n options.layout === CarouselLayoutEnum_1.default.theatre\n ? spacing.space75\n : spacing.space25) / 16}rem;\n\t\t\t\tright: ${(options.layout === CarouselLayoutEnum_1.default.overflow ||\n options.layout === CarouselLayoutEnum_1.default.theatre\n ? spacing.space75\n : spacing.space25) / 16}rem;\n\t\t\t\tpointer-events: none;\n\t\t\t\tbottom: ${options.showScrollbar ? options.scrollBarHeight : 0}px;\n\t\t\t\tpadding-bottom: ${options.paddingBottom ? spacing.space200 / 16 : 0}rem;\n\t\t\t\tz-index: 9;\n\t\t\t}\n\t\t\t${options.isScrollbarHovered ? this.getScrollbarHovered(options.theme) : ''}\n\t\t`;\n }\n /**\n * Returns hide scrollbar style.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @param options.showScrollbar Show scrollbar.\n * @returns Style.\n */\n static getFirefoxScrollbar(options) {\n if (options.showScrollbar) {\n return (0, web_component_1.css) `\n\t\t\t\t@-moz-document url-prefix() {\n\t\t\t\t\t.slideContainer {\n\t\t\t\t\t\tbackground: transparent;\n\t\t\t\t\t}\n\t\t\t\t\t/* Adds the illusion of a scrollbar track in Firefox */\n\t\t\t\t\t.slideContainer::after {\n\t\t\t\t\t\tcontent: '';\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\tbottom: 3.5px;\n\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\theight: 3px;\n\t\t\t\t\t\tbackground: ${options.theme.color.border.light};\n\t\t\t\t\t\tz-index: -1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t`;\n }\n return (0, web_component_1.css) `\n\t\t\t.slideContainer {\n\t\t\t\t/* Hides scrollbar in Firefox */\n\t\t\t\tbackground: transparent;\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns CSS for scrollbar hovered.\n *\n * @param theme Theme.\n * @returns Scrollbar hovered CSS.\n */\n static getScrollbarHovered(theme) {\n const { color, border } = theme;\n return (0, web_component_1.css) `\n\t\t\t.slideContainer {\n\t\t\t\tcursor: grab;\n\t\t\t}\n\t\t\t.slideContainer:active {\n\t\t\t\tcursor: grabbing;\n\t\t\t\tcursor: -moz-grabbing;\n\t\t\t}\n\t\t\t.slideContainer::-webkit-scrollbar-thumb {\n\t\t\t\tborder-radius: ${border.radius.radius64 / 16}rem;\n\t\t\t\tbackground: linear-gradient(\n\t\t\t\t\tto bottom,\n\t\t\t\t\ttransparent calc(50% - 2px),\n\t\t\t\t\t${color.neutral.grey900} calc(50% - 2px) calc(50% + 2px),\n\t\t\t\t\ttransparent calc(50% + 2px)\n\t\t\t\t);\n\t\t\t}\n\t\t\t.slideContainer::-webkit-scrollbar-track {\n\t\t\t\tbackground: linear-gradient(\n\t\t\t\t\tto bottom,\n\t\t\t\t\ttransparent calc(50% - 2px),\n\t\t\t\t\t${color.border.light} calc(50% - 2px) calc(50% + 2px),\n\t\t\t\t\ttransparent calc(50% + 2px)\n\t\t\t\t);\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns RTL styling for carousel.\n *\n * @param options\n * @returns Styles.\n */\n static getRTLStyling(options) {\n const { spacing } = options.theme;\n if (options.direction === 'rtl') {\n return (0, web_component_1.css) `\n\t\t\t\tleft: auto;\n\t\t\t\tright: ${options.hasFocus ? spacing.space150 / 16 + 'rem' : '-10000px'};\n\t\t\t`;\n }\n else {\n return (0, web_component_1.css) `\n\t\t\t\tleft: ${options.hasFocus ? spacing.space150 / 16 + 'rem' : '-10000px'};\n\t\t\t\tright: auto;\n\t\t\t`;\n }\n }\n}\nexports.default = CarouselStyle;\n//# sourceMappingURL=CarouselStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nrequire(\"@ingka/button-webc\");\nrequire(\"../carousel-controls/CarouselControls\");\nrequire(\"../carousel-item/CarouselItem\");\nconst CarouselLayoutEnum_1 = __importDefault(require(\"../../enums/CarouselLayoutEnum\"));\nconst CarouselStyle_1 = __importDefault(require(\"./CarouselStyle\"));\nconst SCROLLBAR_HEIGHT = 8;\nconst SWIPE_DISTANCE = 20;\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n *\n * Carousel component.\n *\n * @event change Emits when selectedIndex has changed. e.g. when user is clicking on next-button or do a swipe gesture\n */\nlet Carousel = class Carousel extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Visibility of navigation arrows\n this.showArrows = false;\n // Slides all visible items as one page\n this.slideVisibleItems = false;\n // Enables swiping with pointer\n this.pointerSwipe = false;\n // Show scrollbar representing pageIndex\n this.showScrollbar = false;\n // Enable to fit items.\n this.fitItems = false;\n // Applies padding in the bottom.\n this.paddingBottom = false;\n // Sets the button type for the navigation control buttons.\n this.buttonType = 'primary';\n // Sets the behaviour for the navigation control buttons.\n this.layout = CarouselLayoutEnum_1.default.default;\n // Set which slide index that should be active\n this.selectedIndex = 0;\n // Skip listing label\n this.skipListingLabel = null;\n // Label for the carousel to set as an aria-label for accessibility reasons\n this.ariaLabel = null;\n // Role description for the Carousel to set as an aria-roledescription for accessibility reasons\n this.ariaRoleDescription = null;\n // Label for the carousel control previous button to set as an aria-label for accessibility reasons\n this.ariaLabelCarouselControlsLeftArrow = null;\n // Label for the carousel control next button to set as an aria-label for accessibility reasons\n this.ariaLabelCarouselControlsRightArrow = null;\n // Set dragged state.\n this.isScrollbarHovered = false;\n this.hasFocus = false;\n this.resizeObserver = new ResizeObserver(() => {\n this.navigateToIndex(this.selectedIndex, 'auto');\n this.requestUpdate();\n });\n this.scrollTimeout = null;\n this.tabTimeout = null;\n this.arrowKeyTimeout = null;\n this.isUpdating = false;\n this.isDragging = false;\n this.isTabbing = false;\n this.isArrowKeyScrolling = false;\n this.isPointerDown = false;\n this.isSelectedIndexUpdated = false;\n this.startPosition = 0;\n this.startScrollLeft = 0;\n this.slideContainer = null;\n this.listeners = {\n pointerup: this.onPointerUp.bind(this),\n pointermove: this.onPointerMove.bind(this),\n pointerleave: this.onPointerUp.bind(this)\n };\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n var _a;\n const direction = window.getComputedStyle(this).direction;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t this.requestUpdate()}\"\n\t\t\t\t\t@scroll=\"${this.onScroll.bind(this)}\"\n\t\t\t\t\t@mousemove=\"${this.onMouseMove.bind(this)}\"\n\t\t\t\t\t@mouseleave=\"${this.onMouseLeave.bind(this)}\"\n\t\t\t\t\t@keydown=\"${(event) => this.onKeyDown(event)}\"\n\t\t\t\t\t@pointerdown=\"${this.onPointerDown.bind(this)}\"\n\t\t\t\t\t@focusin=\"${this.onFocusIn.bind(this)}\"\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\taria-roledescription=\"${this.ariaRoleDescription || ''}\"\n\t\t\t\t\taria-label=\"${this.ariaLabel || ''}\"\n\t\t\t\t>\n\t\t\t\t\t${this.getSkipButton()}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
    \n\t\t\t${this.getControls()}\n\t\t\t {\n const target = event.currentTarget;\n if (target) {\n target.tabIndex = -1;\n }\n }}\"\n\t\t\t>\n\t\t`;\n }\n /**\n * @override\n */\n connectedCallback() {\n super.connectedCallback();\n this.resizeObserver.observe(this);\n document.body.addEventListener('pointerleave', this.listeners.pointerleave);\n document.body.addEventListener('pointerup', this.listeners.pointerup);\n document.body.addEventListener('pointermove', this.listeners.pointermove);\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.resizeObserver.disconnect();\n this.scrollTimeout && clearTimeout(this.scrollTimeout);\n this.tabTimeout && clearTimeout(this.tabTimeout);\n this.scrollTimeout = null;\n this.isSelectedIndexUpdated = false;\n document.body.removeEventListener('pointerleave', this.listeners.pointerleave);\n document.body.removeEventListener('pointerup', this.listeners.pointerup);\n document.body.removeEventListener('pointermove', this.listeners.pointermove);\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (this.getContainerElement()) {\n if (changedProperties.has('selectedIndex')) {\n if (!this.isUpdating) {\n this.navigateToIndex(this.selectedIndex, !this.isSelectedIndexUpdated ? 'auto' : 'smooth');\n }\n }\n this.isUpdating = false;\n this.isSelectedIndexUpdated = true;\n }\n return true;\n }\n /**\n * @param child The child element.\n * @returns The percentage of the child that is visible in the viewport. Returns value between 0 and 100.\n */\n isChildVisible(child) {\n const scrollContainer = this.getContainerElement();\n if (!scrollContainer || !child) {\n return 0;\n }\n const x1 = scrollContainer.scrollLeft;\n const x2 = scrollContainer.scrollLeft + scrollContainer.offsetWidth;\n const y1 = child.offsetLeft;\n const y2 = child.offsetLeft + child.offsetWidth;\n const lt = Math.max(x1, y1); // The highest value of viewport left and child left\n const rt = Math.min(x2, y2); // The lowest value of viewport right and child right\n // Child is completely outside viewport\n if (rt - lt < 0) {\n return 0;\n }\n const percentageVisible = Math.round(100 * ((rt - lt) / child.offsetWidth));\n return percentageVisible;\n }\n /**\n * @returns If the left arrow should be visible.\n */\n showLeftArrow() {\n const firstChild = this.getChildren()[0];\n const thresholdPercentage = 85;\n return (this.showArrows && this.isChildVisible(firstChild) < thresholdPercentage && !this.isDragging);\n }\n /**\n * @returns If the right arrow should be visible.\n */\n showRightArrow() {\n const lastChild = this.getChildren()[this.getChildren().length - 1];\n const thresholdPercentage = 85;\n return (this.showArrows && this.isChildVisible(lastChild) < thresholdPercentage && !this.isDragging);\n }\n /**\n * @returns Get the arrows element.\n */\n getControls() {\n return (0, web_component_1.html) `\n\t\t\t this.navigatePrev()}\"\n\t\t\t\t@next=\"${() => this.navigateNext()}\"\n\t\t\t>\n\t\t`;\n }\n /**\n * Skip Button when entering a carousel through tabbing.\n *\n * @returns Template.\n */\n getSkipButton() {\n if (!this.skipListingLabel) {\n return null;\n }\n const primaryVariant = 'primary';\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${this.skipListingLabel}\n\t\t\t\n\t\t`;\n }\n /**\n * HTML event handler.\n */\n onSkipButtonBlur() {\n if (this.hasFocus) {\n this.hasFocus = false;\n this.requestUpdate();\n }\n }\n /**\n * HTML event handler.\n */\n onSkipButtonFocus() {\n if (!this.hasFocus) {\n this.hasFocus = true;\n this.requestUpdate();\n }\n }\n /**\n * HTML event handler.\n *\n * @param event Event.\n */\n onFocusIn(event) {\n if (!this.isTabbing) {\n return;\n }\n const path = event.composedPath();\n const children = this.getChildren();\n for (const node of path) {\n for (let i = 0; i < children.length; i++) {\n if (node === children[i] && i !== this.selectedIndex) {\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, detail: { selectedIndex: i } }));\n return;\n }\n }\n }\n }\n /**\n * Handles scroll event.\n */\n onScroll() {\n this.scrollTimeout && clearTimeout(this.scrollTimeout);\n this.scrollTimeout = setTimeout(() => {\n this.scrollTimeout && clearTimeout(this.scrollTimeout);\n this.scrollTimeout = null;\n this.requestUpdate();\n if (this.isPointerDown) {\n this.onScroll();\n }\n else {\n const currentIndex = this.getCurrentIndex();\n if (currentIndex === null) {\n return;\n }\n if (currentIndex !== this.selectedIndex) {\n if (!this.showRightArrow()) {\n this.isUpdating = true;\n }\n this.dispatchEvent(new CustomEvent('change', {\n bubbles: true,\n detail: { selectedIndex: currentIndex }\n }));\n }\n else {\n if (this.showRightArrow()) {\n this.navigateToIndex(this.selectedIndex);\n }\n }\n }\n }, 100);\n }\n /**\n * Event handler.\n */\n onSkipButtonClick() {\n var _a;\n const focusElement = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.skipListingFocusElement');\n focusElement.tabIndex = 0;\n focusElement.focus();\n }\n /**\n * Event handler.\n *\n * @param event Event.\n */\n onMouseMove(event) {\n if (!this.showScrollbar) {\n return;\n }\n const container = this.getContainerElement();\n if (event.offsetY >= container.offsetHeight - SCROLLBAR_HEIGHT) {\n if (!this.isScrollbarHovered) {\n this.isScrollbarHovered = true;\n this.requestUpdate();\n }\n }\n else if (this.isScrollbarHovered) {\n this.isScrollbarHovered = false;\n this.requestUpdate();\n }\n }\n /**\n * Event handler.\n */\n onMouseLeave() {\n if (!this.showScrollbar) {\n return;\n }\n if (this.isScrollbarHovered) {\n this.isScrollbarHovered = false;\n this.requestUpdate();\n }\n }\n /**\n * When key down.\n *\n * @param event Keyboard event.\n */\n onKeyDown(event) {\n switch (event.key) {\n case 'ArrowLeft':\n case 'ArrowRight':\n if (!this.isArrowKeyScrolling) {\n this.isArrowKeyScrolling = true;\n this.arrowKeyTimeout && clearTimeout(this.arrowKeyTimeout);\n this.arrowKeyTimeout = setTimeout(() => (this.isArrowKeyScrolling = false), 400);\n const direction = window.getComputedStyle(this).direction;\n event.preventDefault();\n if (event.key === 'ArrowLeft') {\n if (direction !== 'rtl') {\n this.navigatePrev();\n }\n else {\n this.navigateNext();\n }\n }\n else {\n if (direction !== 'rtl') {\n this.navigateNext();\n }\n else {\n this.navigatePrev();\n }\n }\n }\n break;\n case 'Tab':\n this.isTabbing = true;\n this.tabTimeout && clearTimeout(this.tabTimeout);\n this.tabTimeout = setTimeout(() => (this.isTabbing = false));\n break;\n }\n }\n /**\n * @returns Item width.\n */\n getItemWidth() {\n return this.getChildren()[0].offsetWidth;\n }\n /**\n * @returns Returns container element.\n */\n getContainerElement() {\n var _a;\n return (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.slideContainer');\n }\n /**\n * @returns Children.\n */\n getChildren() {\n if (this.children.length === 1 && this.children[0].tagName === 'SLOT') {\n return Array.from(this.getRootNode().host.children);\n }\n return Array.from(this.children);\n }\n /**\n * @returns Current index.\n */\n getCurrentIndex() {\n const scrollContainer = this.getContainerElement();\n const children = this.getChildren();\n if (!children.length) {\n return null;\n }\n const offsetLeft = children[0].offsetLeft;\n for (let index = 0; index < children.length; index++) {\n const child = children[index];\n if (Math.abs(child.offsetLeft - offsetLeft) + child.offsetWidth / 2 >\n Math.abs(scrollContainer.scrollLeft)) {\n return index;\n }\n }\n return this.getChildren().length - 1;\n }\n /**\n * Scrolls left.\n */\n navigatePrev() {\n const nextIndex = this.selectedIndex - this.getItemsPerPage();\n const selectedIndex = nextIndex > 0 ? nextIndex : 0;\n this.navigateToIndex(selectedIndex);\n }\n /**\n * Scrolls right.\n */\n navigateNext() {\n const nextIndex = this.selectedIndex + this.getItemsPerPage();\n const children = this.getChildren();\n const selectedIndex = nextIndex < children.length ? nextIndex : children.length - 1;\n this.navigateToIndex(selectedIndex);\n }\n /**\n * @param index Index.\n * @param behavior Behaviour.\n */\n navigateToIndex(index, behavior = 'smooth') {\n const scrollContainer = this.getContainerElement();\n if (!scrollContainer) {\n return;\n }\n const children = this.getChildren();\n const child = children[index];\n if (!child) {\n return;\n }\n const offsetLeft = children[0].offsetLeft;\n const scrollTo = child.offsetLeft - offsetLeft;\n if (scrollContainer.scrollLeft != scrollTo) {\n scrollContainer.scrollTo({\n left: scrollTo,\n behavior\n });\n }\n }\n /**\n * @returns Items per page.\n */\n getItemsPerPage() {\n if (this.slideVisibleItems) {\n return Math.floor(this.offsetWidth / this.getItemWidth());\n }\n return 1;\n }\n /**\n * Handles pointer down event.\n *\n * @param event MouseEvent.\n */\n onPointerDown(event) {\n this.isPointerDown = true;\n if (!this.pointerSwipe) {\n return;\n }\n event.preventDefault();\n this.slideContainer = event.currentTarget;\n this.startPosition = this.slideContainer.scrollLeft + event.clientX;\n this.startScrollLeft = this.slideContainer.scrollLeft;\n this.isDragging = true;\n this.update();\n }\n /**\n * Handles pointer move event and emits event if item was dragged.\n *\n * @param event MouseEvent.\n */\n onPointerMove(event) {\n if (!this.isDragging || !this.pointerSwipe) {\n return;\n }\n event.preventDefault();\n this.slideContainer.scrollLeft = this.startPosition - event.clientX;\n }\n /**\n * Handles pointer up event.\n *\n * @param e PointerEvent.\n */\n onPointerUp() {\n this.isPointerDown = false;\n if (!this.isDragging || !this.pointerSwipe) {\n return;\n }\n this.isDragging = false;\n const rtl = this.slideContainer.scrollLeft < 0 ? -1 : 1;\n const distance = this.slideContainer.scrollLeft - this.startScrollLeft * rtl;\n if (Math.abs(distance) > SWIPE_DISTANCE) {\n if (distance < 0) {\n this.navigatePrev();\n }\n else {\n this.navigateNext();\n }\n }\n this.startPosition = 0;\n this.startScrollLeft = 0;\n this.requestUpdate();\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Carousel.prototype, \"showArrows\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Carousel.prototype, \"slideVisibleItems\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Carousel.prototype, \"pointerSwipe\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Carousel.prototype, \"showScrollbar\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Carousel.prototype, \"fitItems\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Carousel.prototype, \"paddingBottom\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Carousel.prototype, \"buttonType\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Carousel.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Carousel.prototype, \"layout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number, synchronous: true })\n], Carousel.prototype, \"selectedIndex\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Carousel.prototype, \"skipListingLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Carousel.prototype, \"ariaLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Carousel.prototype, \"ariaRoleDescription\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Carousel.prototype, \"ariaLabelCarouselControlsLeftArrow\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Carousel.prototype, \"ariaLabelCarouselControlsRightArrow\", void 0);\nCarousel = __decorate([\n (0, web_component_1.customElement)('kompis-carousel')\n], Carousel);\nexports.default = Carousel;\n//# sourceMappingURL=Carousel.js.map","import \"@inter-ikea-kompis/component-carousel/lib/components/carousel/Carousel\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisCarousel extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-carousel\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.ariaLabel = props.ariaLabel;\n element.ariaLabelCarouselControlsLeftArrow = props.ariaLabelCarouselControlsLeftArrow;\n element.ariaLabelCarouselControlsRightArrow = props.ariaLabelCarouselControlsRightArrow;\n element.ariaRoleDescription = props.ariaRoleDescription;\n element.buttonType = props.buttonType;\n element.fitItems = props.fitItems;\n element.layout = props.layout;\n element.paddingBottom = props.paddingBottom;\n element.pointerSwipe = props.pointerSwipe;\n element.selectedIndex = props.selectedIndex;\n element.showArrows = props.showArrows;\n element.showScrollbar = props.showScrollbar;\n element.skipListingLabel = props.skipListingLabel;\n element.slideVisibleItems = props.slideVisibleItems;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onChange, \"change\");\n }\n}\nKompisCarousel.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n ariaLabel: PropTypes.string,\n ariaLabelCarouselControlsLeftArrow: PropTypes.string,\n ariaLabelCarouselControlsRightArrow: PropTypes.string,\n ariaRoleDescription: PropTypes.string,\n buttonType: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n fitItems: PropTypes.bool,\n layout: PropTypes.string,\n paddingBottom: PropTypes.bool,\n pointerSwipe: PropTypes.bool,\n selectedIndex: PropTypes.number,\n showArrows: PropTypes.bool,\n showScrollbar: PropTypes.bool,\n skipListingLabel: PropTypes.string,\n slideVisibleItems: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n onChange: PropTypes.func\n};\nexport default KompisCarousel;\n","import \"@inter-ikea-kompis/component-checkbox/lib/components/checkbox-group/CheckboxGroup\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisCheckboxGroup extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-checkbox-group\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.heading = props.heading;\n element.helpText = props.helpText;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisCheckboxGroup.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n heading: PropTypes.string,\n helpText: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisCheckboxGroup;\n","import \"@inter-ikea-kompis/component-checkbox/lib/components/checkbox/Checkbox\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisCheckbox extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-checkbox\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.alignButton = props.alignButton;\n element.checked = props.checked;\n element.disabled = props.disabled;\n element.errorMessage = props.errorMessage;\n element.hovered = props.hovered;\n element.invalid = props.invalid;\n element.label = props.label;\n element.layout = props.layout;\n element.required = props.required;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onChange, \"change\");\n }\n}\nKompisCheckbox.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n alignButton: PropTypes.string,\n checked: PropTypes.bool,\n disabled: PropTypes.bool,\n errorMessage: PropTypes.string,\n hovered: PropTypes.bool,\n invalid: PropTypes.bool,\n label: PropTypes.string,\n layout: PropTypes.string,\n required: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n onChange: PropTypes.func\n};\nexport default KompisCheckbox;\n","import \"@inter-ikea-kompis/component-collapsible/lib/components/collapsible/Collapsible\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisCollapsible extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-collapsible\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.expanded = props.expanded;\n element.horizontal = props.horizontal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onAnimationEnd, \"animationEnd\");\n }\n}\nKompisCollapsible.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n expanded: PropTypes.bool,\n horizontal: PropTypes.bool,\n onAnimationEnd: PropTypes.func\n};\nexport default KompisCollapsible;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar PopoverAlignmentEnum;\n(function (PopoverAlignmentEnum) {\n PopoverAlignmentEnum[\"start\"] = \"start\";\n PopoverAlignmentEnum[\"end\"] = \"end\";\n PopoverAlignmentEnum[\"center\"] = \"center\";\n})(PopoverAlignmentEnum || (PopoverAlignmentEnum = {}));\nexports.default = PopoverAlignmentEnum;\n//# sourceMappingURL=PopoverAlignmentEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar PopoverDirectionEnum;\n(function (PopoverDirectionEnum) {\n PopoverDirectionEnum[\"top\"] = \"top\";\n PopoverDirectionEnum[\"leading\"] = \"leading\";\n PopoverDirectionEnum[\"trailing\"] = \"trailing\";\n PopoverDirectionEnum[\"bottom\"] = \"bottom\";\n})(PopoverDirectionEnum || (PopoverDirectionEnum = {}));\nexports.default = PopoverDirectionEnum;\n//# sourceMappingURL=PopoverDirectionEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst PopoverAlignmentEnum_1 = __importDefault(require(\"../../enums/PopoverAlignmentEnum\"));\nconst PopoverDirectionEnum_1 = __importDefault(require(\"../../enums/PopoverDirectionEnum\"));\nclass PopoverPositionerStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @returns Css code.\n */\n static getStyle(options) {\n const { motion, spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t\tpointer-events: none;\n\t\t\t\tdirection: unset;\n\t\t\t\tz-index: ${options.zIndex};\n\t\t\t}\n\t\t\t* {\n\t\t\t\tz-index: inherit;\n\t\t\t}\n\t\t\t.boundingContainer {\n\t\t\t\tdirection: ltr;\n\t\t\t\tpointer-events: none;\n\t\t\t\tposition: fixed;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\tright: 0;\n\t\t\t}\n\t\t\t.alignmentContainer {\n\t\t\t\tmax-width: 100%;\n\t\t\t\tmax-height: 100%;\n\t\t\t\tpointer-events: none;\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: inherit;\n\t\t\t\tpadding: ${spacing.space75 / 16}rem;\n\t\t\t\tanimation-name: ${options.visible ? 'animationIn' : 'animationOut'};\n\t\t\t\tanimation-fill-mode: ${options.visible ? 'backwards' : 'forwards'};\n\t\t\t\tanimation-duration: ${motion.duration.small};\n\t\t\t}\n\t\t\t.balloon {\n\t\t\t\tmax-width: 100%;\n\t\t\t\tmax-height: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t\tpointer-events: ${options.visible ? 'auto' : 'none'};\n\t\t\t\tanimation-duration: ${motion.duration.small};\n\t\t\t}\n\t\t\t${this.getBoundingContainer(options)}\n\t\t\t${this.getAlignmentContainer(options)}\n\t\t\t${this.getWiggleAnimation(options)}\n\t\t\t${this.getAnimations(options)}\n\t\t`;\n }\n /**\n * Retrieves flex direction for bounding container.\n *\n * @param options Options.\n */\n static getAlignmentContainer(options) {\n switch (options.direction) {\n case PopoverDirectionEnum_1.default.bottom:\n case PopoverDirectionEnum_1.default.top:\n switch (options.alignment) {\n case PopoverAlignmentEnum_1.default.end:\n return (0, web_component_1.css) `\n\t\t\t\t\t\t\t.boundingContainer {\n\t\t\t\t\t\t\t\tjustify-content: flex-start;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t.alignmentContainer {\n\t\t\t\t\t\t\t\tpadding-right: 0;\n\t\t\t\t\t\t\t\tjustify-content: flex-end;\n\t\t\t\t\t\t\t\tmin-width: ${options.containerRect.right}px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t`;\n case PopoverAlignmentEnum_1.default.start:\n return (0, web_component_1.css) `\n\t\t\t\t\t\t\t.boundingContainer {\n\t\t\t\t\t\t\t\tjustify-content: flex-end;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t.alignmentContainer {\n\t\t\t\t\t\t\t\tpadding-left: 0;\n\t\t\t\t\t\t\t\tjustify-content: flex-start;\n\t\t\t\t\t\t\t\tmin-width: ${options.innerWidth - options.containerRect.left}px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t`;\n case PopoverAlignmentEnum_1.default.center: {\n const middleOfRect = options.containerRect.left + options.containerRect.width / 2;\n const middleOfViewport = options.innerWidth / 2;\n const diff = middleOfViewport - middleOfRect;\n if (diff > 0) {\n return (0, web_component_1.css) `\n\t\t\t\t\t\t\t\t.boundingContainer {\n\t\t\t\t\t\t\t\t\tjustify-content: flex-start;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.alignmentContainer {\n\t\t\t\t\t\t\t\t\tjustify-content: center;\n\t\t\t\t\t\t\t\t\tmin-width: ${options.innerWidth - diff * 2}px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t`;\n }\n return (0, web_component_1.css) `\n\t\t\t\t\t\t\t.boundingContainer {\n\t\t\t\t\t\t\t\tjustify-content: flex-end;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t.alignmentContainer {\n\t\t\t\t\t\t\t\tjustify-content: center;\n\t\t\t\t\t\t\t\tmin-width: ${options.innerWidth + diff * 2}px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t`;\n }\n default:\n break;\n }\n return (0, web_component_1.css) `\n\t\t\t\t\t.alignmentContainer {\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t}\n\t\t\t\t`;\n case PopoverDirectionEnum_1.default.leading:\n case PopoverDirectionEnum_1.default.trailing:\n switch (options.alignment) {\n case PopoverAlignmentEnum_1.default.end:\n return (0, web_component_1.css) `\n\t\t\t\t\t\t\t.boundingContainer {\n\t\t\t\t\t\t\t\tjustify-content: flex-start;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t.alignmentContainer {\n\t\t\t\t\t\t\t\tpadding-bottom: 0;\n\t\t\t\t\t\t\t\tjustify-content: flex-end;\n\t\t\t\t\t\t\t\theight: ${options.containerRect.bottom}px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t`;\n case PopoverAlignmentEnum_1.default.start:\n return (0, web_component_1.css) `\n\t\t\t\t\t\t\t.boundingContainer {\n\t\t\t\t\t\t\t\tjustify-content: flex-end;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t.alignmentContainer {\n\t\t\t\t\t\t\t\tpadding-top: 0;\n\t\t\t\t\t\t\t\tjustify-content: flex-start;\n\t\t\t\t\t\t\t\theight: ${options.innerHeight - options.containerRect.top}px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t`;\n case PopoverAlignmentEnum_1.default.center: {\n const middleOfRect = options.containerRect.top + options.containerRect.height / 2;\n const middleOfViewport = options.innerHeight / 2;\n const diff = middleOfViewport - middleOfRect;\n if (diff > 0) {\n return (0, web_component_1.css) `\n\t\t\t\t\t\t\t\t.boundingContainer {\n\t\t\t\t\t\t\t\t\tjustify-content: flex-start;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.alignmentContainer {\n\t\t\t\t\t\t\t\t\tjustify-content: center;\n\t\t\t\t\t\t\t\t\theight: ${options.innerHeight - diff * 2}px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t`;\n }\n return (0, web_component_1.css) `\n\t\t\t\t\t\t\t.boundingContainer {\n\t\t\t\t\t\t\t\tjustify-content: flex-end;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t.alignmentContainer {\n\t\t\t\t\t\t\t\tjustify-content: center;\n\t\t\t\t\t\t\t\theight: ${options.innerHeight + diff * 2}px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t`;\n }\n default:\n break;\n }\n return (0, web_component_1.css) `\n\t\t\t\t\t.alignmentContainer {\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t}\n\t\t\t\t`;\n }\n }\n /**\n * Sets alignment style for popover.\n *\n * @param options Options object.\n */\n static getBoundingContainer(options) {\n switch (options.direction) {\n case PopoverDirectionEnum_1.default.top:\n return (0, web_component_1.css) `\n\t\t\t\t\t.boundingContainer {\n\t\t\t\t\t\tflex-direction: row;\n\t\t\t\t\t\talign-items: flex-end;\n\t\t\t\t\t\tbottom: ${options.innerHeight - options.containerRect.top}px;\n\t\t\t\t\t}\n\t\t\t\t`;\n case PopoverDirectionEnum_1.default.bottom:\n return (0, web_component_1.css) `\n\t\t\t\t\t.boundingContainer {\n\t\t\t\t\t\tflex-direction: row;\n\t\t\t\t\t\talign-items: flex-start;\n\t\t\t\t\t\ttop: ${options.containerRect.bottom}px;\n\t\t\t\t\t}\n\t\t\t\t`;\n case PopoverDirectionEnum_1.default.leading:\n return (0, web_component_1.css) `\n\t\t\t\t\t.boundingContainer {\n\t\t\t\t\t\tflex-direction: column;\n\t\t\t\t\t\talign-items: flex-end;\n\t\t\t\t\t\tright: ${options.innerWidth - options.containerRect.left}px;\n\t\t\t\t\t}\n\t\t\t\t`;\n case PopoverDirectionEnum_1.default.trailing:\n return (0, web_component_1.css) `\n\t\t\t\t\t.boundingContainer {\n\t\t\t\t\t\tflex-direction: column;\n\t\t\t\t\t\talign-items: flex-start;\n\t\t\t\t\t\tleft: ${options.containerRect.right}px;\n\t\t\t\t\t}\n\t\t\t\t`;\n }\n }\n /**\n * Wiggle animation.\n *\n * @param options Options object.\n * @param position Current alignment.\n * @returns Animation css.\n */\n static getAnimations(options) {\n const map = {\n [PopoverDirectionEnum_1.default.top]: 'translateY(10px)',\n [PopoverDirectionEnum_1.default.bottom]: 'translateY(-10px)',\n [PopoverDirectionEnum_1.default.leading]: 'translateX(10px)',\n [PopoverDirectionEnum_1.default.trailing]: 'translateX(-10px)'\n };\n return (0, web_component_1.css) `\n\t\t\t@keyframes animationIn {\n\t\t\t\tfrom {\n\t\t\t\t\ttransform: ${map[options.direction]};\n\t\t\t\t\topacity: 0;\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\ttransform: translate(0);\n\t\t\t\t\topacity: 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes animationOut {\n\t\t\t\tfrom {\n\t\t\t\t\topacity: 1;\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\topacity: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n /**\n * Wiggle animation.\n *\n * @param options Options object.\n * @param position Current alignment.\n * @returns Animation css.\n */\n static getWiggleAnimation(options) {\n if (!options.wiggle) {\n return '';\n }\n return (0, web_component_1.css) `\n\t\t\t@keyframes wiggle {\n\t\t\t\t6% {\n\t\t\t\t\ttransform: rotate(3deg);\n\t\t\t\t}\n\t\t\t\t12% {\n\t\t\t\t\ttransform: rotate(-3deg);\n\t\t\t\t}\n\t\t\t\t18% {\n\t\t\t\t\ttransform: rotate(0deg);\n\t\t\t\t}\n\t\t\t}\n\t\t\t.balloon {\n\t\t\t\tanimation-name: wiggle;\n\t\t\t\tanimation-iteration-count: 10;\n\t\t\t\tanimation-delay: 0.5s;\n\t\t\t\tanimation-duration: 3s;\n\t\t\t\ttransform-origin: ${this.getWiggleTransformOrigin(options)};\n\t\t\t}\n\t\t`;\n }\n /**\n * @param options\n */\n static getWiggleTransformOrigin(options) {\n let alignment = '';\n switch (options.alignment) {\n case PopoverAlignmentEnum_1.default.start:\n alignment = '100%';\n break;\n case PopoverAlignmentEnum_1.default.center:\n alignment = 'center';\n break;\n case PopoverAlignmentEnum_1.default.end:\n alignment = '0%';\n break;\n }\n switch (options.direction) {\n case PopoverDirectionEnum_1.default.top:\n return `${alignment} bottom`;\n case PopoverDirectionEnum_1.default.bottom:\n return `${alignment} top`;\n case PopoverDirectionEnum_1.default.leading:\n return `right ${alignment}`;\n case PopoverDirectionEnum_1.default.trailing:\n return `left ${alignment}`;\n }\n }\n}\nexports.default = PopoverPositionerStyle;\n//# sourceMappingURL=PopoverPositionerStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst PopoverAlignmentEnum_1 = __importDefault(require(\"../../enums/PopoverAlignmentEnum\"));\nconst PopoverDirectionEnum_1 = __importDefault(require(\"../../enums/PopoverDirectionEnum\"));\nconst PopoverPositionerStyle_1 = __importDefault(require(\"./PopoverPositionerStyle\"));\nconst PADDING = 16;\nconst MIN_AREA_SIZE = 160;\n/**\n * Popover class.\n *\n * @event animationEnd When animation end.\n */\nlet PopoverPositioner = class PopoverPositioner extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Alignment of popover.\n this.alignment = PopoverAlignmentEnum_1.default.center;\n // Direction of popover. Null equals auto\n this.direction = null;\n // Z index.\n this.zIndex = 3000;\n // Visible.\n this.visible = false;\n // Enabled wiggle.\n this.wiggle = false;\n this.listeners = {\n resize: this.onResize.bind(this)\n };\n this.debounce = new utilities_1.DebounceManager();\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n const containerRect = this.getBoundingClientRect();\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t this.dispatchEvent(new CustomEvent('animationEnd', { bubbles: true }))}\"\n\t\t\t\t>\n\t\t\t\t\t
    \n\t\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\n\t\t`;\n }\n /**\n * Triggered when the component is inserted to DOM.\n */\n connectedCallback() {\n super.connectedCallback();\n window.addEventListener('resize', this.listeners.resize);\n }\n /**\n * Triggered when the component is removed from DOM.\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n window.removeEventListener('resize', this.listeners.resize);\n this.debounce.clearAll();\n }\n /**\n * Gets margins for balloon.\n *\n * @param containerRect\n */\n getMargins(containerRect) {\n const { innerHeight, innerWidth } = window;\n const { left, top, right, bottom } = containerRect;\n return {\n left: left,\n top: top,\n right: innerWidth - right,\n bottom: innerHeight - bottom\n };\n }\n /**\n * Get rtl direction.\n */\n getRtlDirection() {\n if (this.direction === PopoverDirectionEnum_1.default.leading &&\n window.getComputedStyle(this).direction === 'rtl') {\n return PopoverDirectionEnum_1.default.trailing;\n }\n if (this.direction === PopoverDirectionEnum_1.default.trailing &&\n window.getComputedStyle(this).direction === 'rtl') {\n return PopoverDirectionEnum_1.default.leading;\n }\n return this.direction;\n }\n /**\n * Calculate popover alignment area.\n *\n * @param containerRect Bound client rect.\n * @returns Alignment of popover.\n */\n getDirection(containerRect) {\n const margins = this.getMargins(containerRect);\n const direction = this.getRtlDirection();\n const temp = {\n [PopoverDirectionEnum_1.default.leading]: margins.left >= MIN_AREA_SIZE - PADDING,\n [PopoverDirectionEnum_1.default.trailing]: margins.right >= MIN_AREA_SIZE - PADDING,\n [PopoverDirectionEnum_1.default.top]: margins.top >= MIN_AREA_SIZE - PADDING,\n [PopoverDirectionEnum_1.default.bottom]: margins.bottom >= MIN_AREA_SIZE - PADDING\n };\n if (direction && temp[direction]) {\n return direction;\n }\n const accetableDirections = Object.keys(temp).filter((d) => temp[d]);\n if (accetableDirections.length === 0) {\n return PopoverDirectionEnum_1.default.top;\n }\n const area = {\n left: margins.left * innerHeight,\n top: margins.right * innerWidth,\n right: margins.right * innerHeight,\n bottom: margins.bottom * innerWidth\n };\n return accetableDirections.sort((a, b) => area[b] - area[a])[0];\n }\n /**\n * Listener for resize events.\n */\n onResize() {\n this.debounce.set('resize', () => this.requestUpdate(), 10);\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], PopoverPositioner.prototype, \"alignment\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], PopoverPositioner.prototype, \"direction\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], PopoverPositioner.prototype, \"zIndex\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PopoverPositioner.prototype, \"visible\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PopoverPositioner.prototype, \"wiggle\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], PopoverPositioner.prototype, \"theme\", void 0);\nPopoverPositioner = __decorate([\n (0, web_component_1.customElement)('kompis-popover-positioner')\n], PopoverPositioner);\nexports.default = PopoverPositioner;\n//# sourceMappingURL=PopoverPositioner.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nrequire(\"../popover-positioner/PopoverPositioner\");\nconst PopoverAlignmentEnum_1 = __importDefault(require(\"../../enums/PopoverAlignmentEnum\"));\n/**\n * Popover class.\n *\n * @event animationEnd When animation end.\n */\nlet Popover = class Popover extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Alignment of popover.\n this.alignment = PopoverAlignmentEnum_1.default.center;\n // Direction of popover.\n this.direction = null;\n // Z index.\n this.zIndex = 3000;\n // Visible.\n this.visible = false;\n // Enabled wiggle.\n this.wiggle = false;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n const { color, border } = this.theme;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getPopoverPositioner()}\n\t\t`;\n }\n /**\n * The intersection between iframe and visible area.\n *\n * @returns - Html.\n */\n getPopoverPositioner() {\n if (!this.visible) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('animationEnd', { bubbles: true }))}\"\n\t\t\t\t.visible=${this.visible}\n\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t.wiggle=\"${this.wiggle}\"\n\t\t\t\t.zIndex=${this.zIndex}\n\t\t\t\t.alignment=\"${this.alignment}\"\n\t\t\t\t.direction=\"${this.direction}\"\n\t\t\t>\n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Popover.prototype, \"alignment\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Popover.prototype, \"direction\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], Popover.prototype, \"zIndex\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Popover.prototype, \"visible\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Popover.prototype, \"wiggle\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Popover.prototype, \"theme\", void 0);\nPopover = __decorate([\n (0, web_component_1.customElement)('kompis-popover')\n], Popover);\nexports.default = Popover;\n//# sourceMappingURL=Popover.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\n/**\n * Popover class.\n */\nlet PopoverPadding = class PopoverPadding extends web_component_1.KompisElement {\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n const { spacing } = this.theme;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], PopoverPadding.prototype, \"theme\", void 0);\nPopoverPadding = __decorate([\n (0, web_component_1.customElement)('kompis-popover-padding')\n], PopoverPadding);\nexports.default = PopoverPadding;\n//# sourceMappingURL=PopoverPadding.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\n/**\n * Popover class.\n */\nlet PopoverPosition = class PopoverPosition extends web_component_1.KompisElement {\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t`;\n }\n};\nPopoverPosition = __decorate([\n (0, web_component_1.customElement)('kompis-popover-position')\n], PopoverPosition);\nexports.default = PopoverPosition;\n//# sourceMappingURL=PopoverPosition.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PopoverPositioner = exports.PopoverPosition = exports.PopoverPadding = exports.PopoverDirectionEnum = exports.PopoverAlignmentEnum = exports.Popover = void 0;\nconst Popover_1 = __importDefault(require(\"./components/popover/Popover\"));\nexports.Popover = Popover_1.default;\nconst PopoverPadding_1 = __importDefault(require(\"./components/popover-padding/PopoverPadding\"));\nexports.PopoverPadding = PopoverPadding_1.default;\nconst PopoverPosition_1 = __importDefault(require(\"./components/popover-position/PopoverPosition\"));\nexports.PopoverPosition = PopoverPosition_1.default;\nconst PopoverPositioner_1 = __importDefault(require(\"./components/popover-positioner/PopoverPositioner\"));\nexports.PopoverPositioner = PopoverPositioner_1.default;\nconst PopoverAlignmentEnum_1 = __importDefault(require(\"./enums/PopoverAlignmentEnum\"));\nexports.PopoverAlignmentEnum = PopoverAlignmentEnum_1.default;\nconst PopoverDirectionEnum_1 = __importDefault(require(\"./enums/PopoverDirectionEnum\"));\nexports.PopoverDirectionEnum = PopoverDirectionEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nrequire(\"@inter-ikea-kompis/component-popover\");\nrequire(\"@inter-ikea-kompis/component-text\");\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n *\n * Tooltip class.\n *\n * @event animationEnd When animation end.\n */\nlet Tooltip = class Tooltip extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Text to be displayed.\n this.text = null;\n // Z index.\n this.zIndex = null;\n // Max width in pixels.\n this.maxWidth = null;\n // Enable toggle mode.\n this.toggle = false;\n // Label for the tooltip to set as an aria-label for accessibility reasons.\n this.ariaLabel = null;\n // Unique ID text. Tooltip targets should have aria-describedby and tooltip content a corresponding ID for accessibility purposes.\n this.uniqueId = null;\n // Sets how long the tooltip should be visible for. Set to 0 to disable.\n this.timeout = 0;\n this.visible = false;\n this.renderPopover = false;\n this.timer = null;\n /**\n * Closes tooltip on escape.\n *\n * @param event Event.\n */\n this.onKeyDownListener = (event) => {\n if (event.code === 'Escape' && this.visible) {\n this.timer && clearTimeout(this.timer);\n this.visible = false;\n this.renderPopover = false;\n this.requestUpdate();\n }\n };\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n const { color, border, spacing } = this.theme;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t\t${this.getPopover()}\n\t\t`;\n }\n /**\n * @override\n */\n connectedCallback() {\n super.connectedCallback();\n window.addEventListener('keydown', this.onKeyDownListener);\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.visible = false;\n window.removeEventListener('keydown', this.onKeyDownListener);\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('toggle')) {\n if (changedProperties.get('toggle')) {\n this.visible = false;\n }\n }\n return true;\n }\n /**\n * Event handler enter.\n */\n onEnter() {\n if (this.toggle) {\n return;\n }\n this.timer && clearTimeout(this.timer);\n this.visible = true;\n this.renderPopover = true;\n this.requestUpdate();\n }\n /**\n * Event handler leave.\n */\n onLeave() {\n if (this.toggle) {\n return;\n }\n // Begin timer\n this.timer = setTimeout(() => {\n this.visible = false;\n this.requestUpdate();\n }, this.timeout);\n this.requestUpdate();\n }\n /**\n * Event handler focus in.\n */\n onFocusIn() {\n this.visible = true;\n this.renderPopover = true;\n this.requestUpdate();\n }\n /**\n * Event handler focus out.\n */\n onFocusOut() {\n this.visible = false;\n this.requestUpdate();\n }\n /**\n * Event handler click.\n *\n * @param event\n */\n onClick() {\n if (!this.toggle) {\n return;\n }\n if (!this.visible) {\n this.visible = true;\n this.renderPopover = true;\n }\n else {\n this.visible = false;\n this.renderPopover = true;\n }\n this.requestUpdate();\n }\n /**\n * Cleans up in the DOM.\n */\n onAnimationEnd() {\n if (this.visible === false) {\n this.renderPopover = false;\n this.dispatchEvent(new CustomEvent('animationEnd', { bubbles: true }));\n this.requestUpdate();\n }\n }\n /**\n * Gets the popover.\n *\n * @returns Template.\n */\n getPopover() {\n if (!this.renderPopover) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t${this.renderPopover ? this.text : null}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Tooltip.prototype, \"text\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], Tooltip.prototype, \"zIndex\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], Tooltip.prototype, \"maxWidth\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Tooltip.prototype, \"alignment\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Tooltip.prototype, \"direction\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Tooltip.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Tooltip.prototype, \"toggle\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Tooltip.prototype, \"ariaLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Tooltip.prototype, \"uniqueId\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], Tooltip.prototype, \"timeout\", void 0);\nTooltip = __decorate([\n (0, web_component_1.customElement)('kompis-tooltip')\n], Tooltip);\nexports.default = Tooltip;\n//# sourceMappingURL=Tooltip.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Tooltip = void 0;\nconst Tooltip_1 = __importDefault(require(\"./components/tooltip/Tooltip\"));\nexports.Tooltip = Tooltip_1.default;\n//# sourceMappingURL=index.js.map","import { getStore } from '@ingka/singleton-store';\nconst ICON_STORE_ID = 'skapa-icon-store';\n// The store will be initialized with a generic Map inside the getStore on first request.\nconst iconStore = getStore(ICON_STORE_ID);\nexport const registerIcon = (name, paths) => {\n if (!iconStore.has(name))\n iconStore.set(name, paths);\n};\nexport const getPaths = (name) => {\n if (!name)\n return;\n const result = iconStore.get(name);\n if (!result)\n console.error(`The icon: '${name}' has not been loaded yet!\\nDid you forget to import '@ingka/icon-store/${name}'?`);\n return result;\n};\n","import { registerIcon } from './index.js';\nregisterIcon('question-mark', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M11.4175 8.6142c.5274-.433 1.3054-.3594 1.7423.1648.459.551.3576 1.375-.2214 1.7981l-.8634.6309a2.6227 2.6227 0 0 0-1.0753 2.1176v.676h2v-.676c0-.5376.7495-.8639 1.1187-1.1338 1.5112-1.1043 1.776-3.2553.5778-4.6931-1.1403-1.3684-3.171-1.5606-4.5477-.4304L8.8232 8.1562l1.269 1.5458 1.3253-1.0878zm1.8322 8.145c0 .6903-.5596 1.25-1.25 1.25-.6903 0-1.25-.5597-1.25-1.25 0-.6904.5597-1.25 1.25-1.25.6904 0 1.25.5596 1.25 1.25z' } }]);\n","/**\n * This is a simple singleton service that is used as a helper to prevent\n * transitions of hoverable tooltips if another tooltip was hovered recently (1 sec)\n * TOOLTIP_GROUP_DELAY is the delay in ms triggered after mouse leave on a tooltip group,\n * allowing instantaneous display of tooltip while setTimeout within the service has not been triggered.\n */\nconst TOOLTIP_GROUP_DELAY = 1000;\nlet _preventTransition = false;\nlet timeoutRef;\nconst Service = {\n get preventTransition() {\n return _preventTransition;\n },\n setTooltipGroupTimer: function () {\n clearTimeout(timeoutRef);\n _preventTransition = true;\n timeoutRef = window.setTimeout(() => {\n _preventTransition = false;\n }, TOOLTIP_GROUP_DELAY);\n }\n};\nexport default Service;\nexport const HOVER_DELAY = 300;\nexport const SCREEN_EDGE_THRESHOLD = 20;\nexport const LEFT_POSITION_DEFAULT = '50%';\nexport const LEFT_POSITION_DEFAULT_RTL = '0%';\nexport const POSITIONS = {\n TOP: 'top',\n TRAILING: 'trailing',\n BOTTOM: 'bottom',\n LEADING: 'leading'\n};\n// Extended version of document.getElementById. This function traverses shadowDom chain to the document root.\nfunction findElementWithId(domRoot, elementId) {\n if (domRoot.getElementById) {\n const result = domRoot.getElementById(elementId);\n if (result)\n return result;\n else if (domRoot.nodeType === 11 && domRoot.host) { // shadowDom\n return findElementWithId(domRoot.host.getRootNode(), elementId);\n }\n }\n}\nexport function resolveOverflow(tooltipElement, tooltipBodyElement, boundaryElementID) {\n const boundaryElement = boundaryElementID ? findElementWithId(tooltipElement.getRootNode(), boundaryElementID) : undefined;\n if (!window || !tooltipElement || !tooltipBodyElement)\n return;\n const innerWidth = window.innerWidth * 0.01;\n const triggerWrapper = tooltipElement.getBoundingClientRect();\n tooltipBodyElement.style.setProperty('--skapa-trigger-left', `${(triggerWrapper.left / innerWidth).toFixed(0)}vw`);\n tooltipBodyElement.style.setProperty('--skapa-trigger-right', `${(triggerWrapper.right / innerWidth).toFixed(0)}vw`);\n if (boundaryElement) {\n const bounds = boundaryElement.getBoundingClientRect();\n tooltipBodyElement.style.setProperty('--skapa-tooltip-boundary-left', `${(bounds.left / innerWidth).toFixed(0)}vw`);\n tooltipBodyElement.style.setProperty('--skapa-tooltip-boundary-right', `${(bounds.right / innerWidth).toFixed(0)}vw`);\n }\n else {\n // perhaps not needed every time, only if the property has been updated.\n tooltipBodyElement.style.removeProperty('--skapa-tooltip-boundary-left');\n tooltipBodyElement.style.removeProperty('--skapa-tooltip-boundary-right');\n }\n}\n","const activeTooltips = new Set();\nfunction keyDownHandler(ev) {\n if (ev.key.toLowerCase() === 'escape') {\n // close request\n activeTooltips.forEach(tooltip => {\n tooltip.toggleTooltip(false);\n });\n }\n}\nexport const registerActiveTooltip = (tooltip) => {\n if (activeTooltips.has(tooltip))\n return;\n // First listener to be registered\n if (activeTooltips.size === 0)\n window.addEventListener('keydown', keyDownHandler);\n activeTooltips.add(tooltip);\n};\nexport const unregisterTooltip = (tooltip) => {\n if (!activeTooltips.has(tooltip))\n return;\n activeTooltips.delete(tooltip);\n // No more tooltips to report to, remove listener.\n if (!activeTooltips.size) {\n window.removeEventListener('keydown', keyDownHandler);\n }\n};\n","// @ts-ignore\nconst styles = ':host{display:inline-block;position:relative}#btn{pointer-events:all}#btn[variant=tertiary]{--background:rgb(var(--colour-interactive-secondary-bg-default,245,245,245));--background-hover:rgb(var(--colour-interactive-secondary-bg-hover,223,223,223));--background-press:rgb(var(--colour-interactive-secondary-bg-pressed,204,204,204))}slot[name=custom-trigger]{display:inline-block}button.aria-button{background:none;border:0;border-radius:50%;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:inherit;margin:0;outline:none;padding:0}button.aria-button.focus-visible{box-shadow:0 0 0 4px var(--skapa-focus-ring-internal,rgb(var(--colour-neutral-1,255,255,255)));outline:2px solid var(--skapa-focus-ring-external,rgb(var(--colour-neutral-7,17,17,17)));outline-offset:4px;transition:outline .2s ease-out,box-shadow .2s ease-out}.body{--skapa-tooltip-boundary-left:0vw;--skapa-tooltip-boundary-right:100vw;--skapa-tooltip-offset:0.75rem;--skapa-tooltip-screen-edge:1.25rem;--skapa-tooltip-max-width:min(60vw,calc(var(--skapa-tooltip-boundary-right) - var(--skapa-tooltip-boundary-left) - var(--skapa-tooltip-screen-edge)*2 - var(--skapa-tooltip-padding-horizontal)*2));--skapa-tooltip-transformY:-100%;--skapa-tooltip-padding-horizontal:0.75rem;--skapa-trigger-left:50vw;--skapa-trigger-right:50vw;--skapa-trigger-center:calc(var(--skapa-trigger-left)*0.5 + var(--skapa-trigger-right)*0.5);--skapa-tooltip-overflow-x-left:calc(50% + var(--skapa-tooltip-boundary-left) + var(--skapa-tooltip-screen-edge) - var(--skapa-trigger-center));--skapa-tooltip-overflow-x-right:calc(var(--skapa-trigger-center) + 50% - var(--skapa-tooltip-boundary-right) + var(--skapa-tooltip-screen-edge));--skapa-tooltip-transformX:min(max(-50%,calc(-50% + var(--skapa-tooltip-overflow-x-left))),calc(-50% - var(--skapa-tooltip-overflow-x-right)));box-sizing:initial;display:inline-block;font-size:.75rem;left:50%;line-height:1.5;max-width:var(--skapa-tooltip-max-width);opacity:0;padding:0;position:absolute;top:.5rem;transform:translateX(var(--skapa-tooltip-transformX)) translateY(var(--skapa-tooltip-transformY));transition:transform .1s cubic-bezier(.4,0,.4,1),opacity .1s linear,padding .1s linear;visibility:hidden;width:max-content;z-index:300}.body .body-bg{background:rgb(var(--colour-elevation-3,17,17,17));border:1px solid rgb(var(--colour-elevation-2-border,72,72,72));border-radius:4px;color:rgb(var(--colour-static-white,255,255,255));display:inline-block;padding:.5rem var(--skapa-tooltip-padding-horizontal)}.body.show{opacity:1;padding:.25rem;visibility:visible}.body.show:not(.instant){transition-delay:.3s}.body--hidden{display:none}:host(:not([position])) .body.show,:host([position=\"\"]) .body.show,:host([position=top]) .body.show{padding-bottom:calc(var(--skapa-tooltip-offset) + .5rem)}:host([position=bottom]) .body{--skapa-tooltip-transformY:0%;left:50%;top:calc(100% - .5rem)}:host([position=bottom]) .body.show{padding-top:calc(var(--skapa-tooltip-offset) + .5rem)}:host([position=leading][skapa-rtl]) .body,:host([position=trailing]:not([skapa-rtl])) .body{--skapa-tooltip-transformX:0%;--skapa-tooltip-transformY:-50%;left:calc(100% - .5rem);max-width:min(var(--skapa-tooltip-max-width),var(--skapa-tooltip-boundary-right) - var(--skapa-trigger-right) - var(--skapa-tooltip-offset) - 2 * var(--skapa-tooltip-padding-horizontal) - var(--skapa-tooltip-screen-edge));top:50%}:host([position=leading][skapa-rtl]) .body.show,:host([position=trailing]:not([skapa-rtl])) .body.show{padding-left:calc(var(--skapa-tooltip-offset) + .5rem)}:host([position=leading]:not([skapa-rtl])) .body,:host([position=trailing][skapa-rtl]) .body{--skapa-tooltip-transformX:-100%;--skapa-tooltip-transformY:-50%;left:.5rem;max-width:min(var(--skapa-tooltip-max-width),var(--skapa-trigger-left) - var(--skapa-tooltip-offset) - 2 * var(--skapa-tooltip-padding-horizontal) - var(--skapa-tooltip-screen-edge) - var(--skapa-tooltip-boundary-left));top:50%}:host([position=leading]:not([skapa-rtl])) .body.show,:host([position=trailing][skapa-rtl]) .body.show{padding-right:calc(var(--skapa-tooltip-offset) + .5rem)}@media (min-width:56.25em){:host{--skapa-tooltip-max-width:30vw}}';\nimport SkapaElement from '@ingka/skapa-webc-element';\nimport '@ingka/button-webc';\nimport '@ingka/icon-webc';\nimport '@ingka/icon-store/question-mark';\nimport TooltipService, { resolveOverflow } from '@ingka/tooltip-shared';\nimport { registerActiveTooltip, unregisterTooltip } from './tools/escapeListener.js';\nimport { RTLObserver, prefixReplacer, ResizeListener } from '@ingka/webc-tools';\nlet template;\nfunction getTemplate() {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = prefixReplacer(`\n \n \n \n \n \n \n \n `);\n }\n return template;\n}\nconst listenerTypes = ['mouseover', 'mouseout', 'focusin', 'focusout'];\n/** Sets or removes a list of listeners on the provided target element */\nfunction listeners(target, on) {\n const listenerType = on ? target.addEventListener.bind(target) : target.removeEventListener.bind(target);\n listenerTypes.map(eventType => listenerType(eventType, target.handleHover));\n listenerType('click', target.handleClick);\n}\nexport class Tooltip extends SkapaElement {\n constructor() {\n super();\n this.handleClick = (ev) => {\n // Click events are only handled in toggle mode\n if (!this.toggle)\n return;\n // Don't respond to click if it's not on the trigger container. (Tooltip body text should be selectable and clickable)\n if (!(ev.composedPath().includes(this.triggerContainer)))\n return;\n const button = this.ariaButton;\n const nextState = !(button.ariaPressed === 'true');\n this.toggleTooltip(nextState);\n };\n /** Controls the component's button styles, aria-pressed state and escape key listener based on the provided toggle state. */\n this.toggleTooltip = (on) => {\n this.ariaButton.ariaPressed = on.toString();\n this.iconButton.setAttribute('variant', on ? 'primary' : 'tertiary');\n if (on) {\n this.showTooltip();\n registerActiveTooltip(this);\n }\n else {\n this.hideTooltip();\n unregisterTooltip(this);\n }\n };\n /** Updates the overflow correction value in the component and in css as well. */\n this.resolveOverflow = () => {\n resolveOverflow(this.triggerContainer, this.tooltipBody, this.boundaryId);\n };\n /** Displays tooltip */\n this.showTooltip = () => {\n this.resolveOverflow();\n // Display the tooltip instantly if its in toggle mode or if a tooltip was already displayed recently.\n if (this.toggle || TooltipService.preventTransition)\n this.tooltipBody.classList.add('instant');\n // Displays the tooltip, but with delay if instant mode is not set.\n this.tooltipBody.classList.toggle('show', true);\n };\n /** Hides tooltip */\n this.hideTooltip = () => {\n // cleanup\n this.tooltipBody.classList.remove('instant');\n if (this.tooltipBody.classList.contains('show')) {\n // Notify tooltip service to start a timeout for instant activation.\n TooltipService.setTooltipGroupTimer();\n }\n // Hide the tooltip.\n this.tooltipBody.classList.toggle('show', false);\n };\n this.handleHover = (ev) => {\n if (this.toggle)\n return; // toggle mode only reacts to click events (triggered by tap, space and enter also)\n if (ev.currentTarget !== this)\n return;\n // focusin captures keyboard focus\n if (['mouseover', 'focusin'].includes(ev.type)) {\n this.showTooltip();\n }\n else {\n this.hideTooltip();\n }\n };\n this.gatherProperties(['position', 'toggle'], this);\n const shadow = this.attachShadow({ mode: 'open' });\n shadow.append(getTemplate().content.cloneNode(true));\n this.tooltipBody = shadow.querySelector('.body');\n this.iconButton = shadow.querySelector('#btn');\n this.ariaButton = shadow.querySelector('.aria-button');\n this.triggerContainer = shadow.querySelector('#trigger');\n }\n static get observedAttributes() {\n return ['toggle', 'boundaryId'];\n }\n /** On mount */\n connectedCallback() {\n super.connectedCallback();\n listeners(this, true);\n ResizeListener.addResizeListener(this.resolveOverflow);\n RTLObserver.addTarget(this);\n this.resolveOverflow();\n // Now that we have the css variables calculated and configured according to the current layout, we can show the tooltip body.\n this.tooltipBody.classList.remove('body--hidden');\n }\n /** On dismount */\n disconnectedCallback() {\n super.disconnectedCallback();\n listeners(this, false);\n RTLObserver.removeTarget(this);\n ResizeListener.removeResizeListener(this.resolveOverflow);\n // The next time the component is connected, the layout might be different.\n this.tooltipBody.classList.add('body--hidden');\n }\n attributeChangedCallback(attribute, oldVal, newVal) {\n // If the toggle attribute has been removed, remove toggled state\n if (attribute === 'toggle' && !newVal)\n this.toggleTooltip(false);\n if (attribute === 'boundaryId')\n this.resolveOverflow();\n }\n get position() {\n return this.getAttribute('position') || 'top';\n }\n set position(value) {\n if (!value)\n this.removeAttribute('position');\n else\n this.setAttribute('position', value);\n }\n get toggle() {\n return this.hasAttribute('toggle');\n }\n set toggle(val) {\n this.toggleAttribute('toggle', !!val);\n }\n get boundaryId() {\n return this.getAttribute('boundaryId');\n }\n set boundaryId(id) {\n if (id)\n this.setAttribute('boundaryId', id);\n else\n this.removeAttribute('boundaryId');\n }\n}\n","import define from '@ingka/webc-tools';\nimport { Tooltip } from './src/Tooltip.js';\nexport { Tooltip };\nexport const tooltipTagName = define('tooltip', Tooltip);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('copy', [{ tag: 'path', att: { d: 'M21 3H8v4h2V5h9v9h-2v2h4V3z' } }, { tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M16 8H3v13h13V8zM5 19v-9h9v9H5z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar CopyDesignCodeStateEnum;\n(function (CopyDesignCodeStateEnum) {\n CopyDesignCodeStateEnum[\"default\"] = \"default\";\n CopyDesignCodeStateEnum[\"success\"] = \"success\";\n})(CopyDesignCodeStateEnum || (CopyDesignCodeStateEnum = {}));\nexports.default = CopyDesignCodeStateEnum;\n//# sourceMappingURL=CopyDesignCodeStateEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass CopyDesignCodeStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing, color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t}\n\n\t\t\t.copyDesignCode {\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\n\t\t\t.designCode {\n\t\t\t\tmargin: 0 ${spacing.space50 / 16}rem 0 ${spacing.space25 / 16}rem;\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = CopyDesignCodeStyle;\n//# sourceMappingURL=CopyDesignCodeStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@inter-ikea-kompis/component-tooltip\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/tooltip-webc\");\nrequire(\"@ingka/icon-store/copy\");\nrequire(\"@ingka/icon-store/checkmark\");\nconst CopyDesignCodeStateEnum_1 = __importDefault(require(\"../../enums/CopyDesignCodeStateEnum\"));\nconst CopyDesignCodeStyle_1 = __importDefault(require(\"./CopyDesignCodeStyle\"));\n/**\n * CopyCode class.\n *\n * @event copy Click on copy button\n * @event reset Sent after 3 seconds after state success.\n */\nlet CopyDesignCode = class CopyDesignCode extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // State information\n this.state = CopyDesignCodeStateEnum_1.default.default;\n this.timeout = null;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n const { designCodeTitle } = this.getTranslations();\n const tertiaryVariant = 'tertiary';\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\t${designCodeTitle}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t${this.vpcCode}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t${this.getTooltipText()}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${this.getTooltipText()}\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n if (this.timeout) {\n clearTimeout(this.timeout);\n }\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n var _a;\n if (changedProperties.has('state')) {\n const tooltip = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('skapa-tooltip');\n if (this.state === CopyDesignCodeStateEnum_1.default.success) {\n tooltip === null || tooltip === void 0 ? void 0 : tooltip.setAttribute('toggle', 'true');\n if (this.timeout) {\n clearTimeout(this.timeout);\n }\n this.timeout = setTimeout(() => {\n this.dispatchEvent(new CustomEvent('reset', { bubbles: true }));\n }, 3000);\n }\n else if (this.state === CopyDesignCodeStateEnum_1.default.default) {\n tooltip === null || tooltip === void 0 ? void 0 : tooltip.removeAttribute('toggle');\n }\n }\n return true;\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n /**\n * Message to user.\n *\n * @returns Template.\n */\n getTooltipText() {\n if (this.state === CopyDesignCodeStateEnum_1.default.default) {\n return this.getTranslations().copyCodeTooltip;\n }\n return this.getTranslations().copyCodeSuccessMessage;\n }\n /**\n * Click event for button for copy.\n */\n onCopyClick() {\n return __awaiter(this, void 0, void 0, function* () {\n let thrownError = null;\n try {\n yield navigator.clipboard.writeText(this.vpcCode);\n }\n catch (error) {\n thrownError = error;\n }\n this.dispatchEvent(new CustomEvent('copy', {\n bubbles: true,\n detail: {\n state: !thrownError ? CopyDesignCodeStateEnum_1.default.success : CopyDesignCodeStateEnum_1.default.default,\n error: thrownError === null || thrownError === void 0 ? void 0 : thrownError.message\n }\n }));\n if (thrownError) {\n throw thrownError;\n }\n });\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], CopyDesignCode.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], CopyDesignCode.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], CopyDesignCode.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, required: true })\n], CopyDesignCode.prototype, \"vpcCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], CopyDesignCode.prototype, \"state\", void 0);\nCopyDesignCode = __decorate([\n (0, web_component_1.customElement)('kompis-copy-design-code')\n], CopyDesignCode);\nexports.default = CopyDesignCode;\n//# sourceMappingURL=CopyDesignCode.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass CopyDesignCodeToastMessage {\n /**\n * @param localizedInformationOrTranslations\n */\n static getCopyDesignCodeFailure(localizedInformationOrTranslations) {\n const label = 'translations' in localizedInformationOrTranslations\n ? localizedInformationOrTranslations.translations.ikeaGenericErrorTryAgain\n : localizedInformationOrTranslations.ikeaGenericErrorTryAgain;\n return {\n label\n };\n }\n}\nexports.default = CopyDesignCodeToastMessage;\n//# sourceMappingURL=CopyDesignCodeToastMessage.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CopyDesignCodeToastMessage = exports.CopyDesignCodeStateEnum = exports.CopyDesignCode = void 0;\nconst CopyDesignCode_1 = __importDefault(require(\"./components/copy-design-code/CopyDesignCode\"));\nexports.CopyDesignCode = CopyDesignCode_1.default;\nconst CopyDesignCodeStateEnum_1 = __importDefault(require(\"./enums/CopyDesignCodeStateEnum\"));\nexports.CopyDesignCodeStateEnum = CopyDesignCodeStateEnum_1.default;\nconst CopyDesignCodeToastMessage_1 = __importDefault(require(\"./utilities/CopyDesignCodeToastMessage\"));\nexports.CopyDesignCodeToastMessage = CopyDesignCodeToastMessage_1.default;\n//# sourceMappingURL=index.js.map","import { getStore } from '@ingka/singleton-store';\nconst ICON_STORE_ID = 'skapa-icon-store';\n// The store will be initialized with a generic Map inside the getStore on first request.\nconst iconStore = getStore(ICON_STORE_ID);\nexport const registerIcon = (name, paths) => {\n if (!iconStore.has(name))\n iconStore.set(name, paths);\n};\nexport const getPaths = (name) => {\n if (!name)\n return;\n const result = iconStore.get(name);\n if (!result)\n console.error(`The icon: '${name}' has not been loaded yet!\\nDid you forget to import '@ingka/icon-store/${name}'?`);\n return result;\n};\n","import { registerIcon } from './index.js';\nregisterIcon('arrow-right', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'm20.0008 12.0001-8-8.001-1.4143 1.414L16.1727 11H4v2h12.1723l-5.5868 5.5866 1.4141 1.4142 8.0012-8.0007z' } }]);\n","import SkapaElement from '@ingka/skapa-webc-element';\n// @ts-ignore\nconst styles = ':host{display:block;position:relative;width:inherit}slot{box-sizing:border-box;display:block;height:auto;padding-bottom:var(--skapa-aspect-ratio,75%);position:relative;width:100%}slot::slotted(*){color:#0000;height:100%;left:0;object-fit:cover;padding:0;position:absolute;top:0;width:100%}:host([ratio^=standard]){--skapa-aspect-ratio:75%}:host([ratio^=square]){--skapa-aspect-ratio:100%}:host([ratio^=wide]){--skapa-aspect-ratio:56.25%}:host([ratio^=portrait]){--skapa-aspect-ratio:133.3333333333%}:host([ratio^=semiportrait]){--skapa-aspect-ratio:116.6666666667%}@media (min-width:37.5em){:host([ratio*=to-standard-from-md]){--skapa-aspect-ratio:75%}:host([ratio*=to-square-from-md]){--skapa-aspect-ratio:100%}:host([ratio*=to-wide-from-md]){--skapa-aspect-ratio:56.25%}:host([ratio*=to-portrait-from-md]){--skapa-aspect-ratio:133.3333333333%}:host([ratio*=to-semiportrait-from-md]){--skapa-aspect-ratio:116.6666666667%}}@media (min-width:56.25em){:host([ratio*=to-standard-from-lg]){--skapa-aspect-ratio:75%}:host([ratio*=to-square-from-lg]){--skapa-aspect-ratio:100%}:host([ratio*=to-wide-from-lg]){--skapa-aspect-ratio:56.25%}:host([ratio*=to-portrait-from-lg]){--skapa-aspect-ratio:133.3333333333%}:host([ratio*=to-semiportrait-from-lg]){--skapa-aspect-ratio:116.6666666667%}}';\nconst template = document.createElement('template');\ntemplate.innerHTML = ``;\nexport class AspectRatioBox extends SkapaElement {\n set ratio(val) {\n this.setAttribute('ratio', val);\n }\n get ratio() {\n return this.getAttribute('ratio');\n }\n constructor() {\n super();\n this.gatherProperties(['ratio'], this); // Manages inherited pre-definition properties.\n this.attachShadow({ mode: 'open' }).append(template.content.cloneNode(true));\n }\n}\nexport default AspectRatioBox;\n","import define from '@ingka/webc-tools';\nimport AspectRatioBox from './src/AspectRatioBox.js';\nexport { AspectRatioBox };\nexport const aspectRatioBoxTagName = define('aspect-ratio', AspectRatioBox);\n","import { getStore } from '@ingka/singleton-store';\nconst ICON_STORE_ID = 'skapa-icon-store';\n// The store will be initialized with a generic Map inside the getStore on first request.\nconst iconStore = getStore(ICON_STORE_ID);\nexport const registerIcon = (name, paths) => {\n if (!iconStore.has(name))\n iconStore.set(name, paths);\n};\nexport const getPaths = (name) => {\n if (!name)\n return;\n const result = iconStore.get(name);\n if (!result)\n console.error(`The icon: '${name}' has not been loaded yet!\\nDid you forget to import '@ingka/icon-store/${name}'?`);\n return result;\n};\n","import { registerIcon } from './index.js';\nregisterIcon('image-strikethrough', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'm2.3979 2.414 19.1846 19.1907-1.3978 1.3965-3.0002-3.0011H3V5.8113L1 3.8106l1.3979-1.3965zM15.185 18.0002l-1.9994-2H6.5l2.6748-4.0122L5 7.8119V18h10.1851z' } }, { tag: 'path', att: { d: 'm6.8114 4.0001 1.9994 2H19v10.1924l2 2.0006V4.0001H6.8114z' } }, { tag: 'path', att: { d: 'M14 9.5001c0 .8284.6716 1.5 1.5 1.5s1.5-.6716 1.5-1.5-.6716-1.5-1.5-1.5-1.5.6716-1.5 1.5z' } }]);\n","import { registerIcon } from './index.js';\nregisterIcon('image', [{ tag: 'path', att: { d: 'M15.5 11c-.8284 0-1.5-.6716-1.5-1.5S14.6716 8 15.5 8s1.5.6716 1.5 1.5-.6716 1.5-1.5 1.5zM13 15.25l-3-4.5L6.5 16h11L15 12.25l-2 3z' } }, { tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M3 4v16h18V4H3zm2 14V6h14v12H5z' } }]);\n","import SkapaElement from '@ingka/skapa-webc-element';\nimport { iconTagName } from '@ingka/icon-webc';\nimport '@ingka/icon-store/image-strikethrough';\nimport '@ingka/icon-store/image';\n// @ts-ignore\nconst styles = ':host{display:block;height:auto;max-width:100%;position:relative}:host slot,:host slot::slotted(*){height:inherit;max-width:inherit;object-fit:inherit;width:inherit}';\n// @ts-ignore\nconst fallbackStyles = ':host{background:rgb(var(--colour-neutral-2,245,245,245));padding-bottom:100%}:host .icon{color:rgb(var(--colour-text-and-icon-4,146,146,146));left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}:host slot{clip:rect(1px,1px,1px,1px);display:block;height:1px;margin:-1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}';\nconst template = document.createElement('template');\ntemplate.innerHTML = ``;\nconst fallbackStyleElement = document.createElement('style');\nfallbackStyleElement.innerHTML = fallbackStyles;\nexport class Image extends SkapaElement {\n constructor() {\n super();\n this.state = {\n loadError: false,\n watching: false\n };\n this.__fallbackStylesNode = fallbackStyleElement.cloneNode(true);\n this.showPlaceholder = () => {\n if (!this.fallbackIcon) {\n // Init the icon\n this.fallbackIcon = document.createElement(iconTagName());\n this.fallbackIcon.className = 'icon';\n }\n this.fallbackIcon.icon = this.fallback ? 'image' : 'image-strikethrough';\n // Add the icon and fallback styles to the shadow dom.\n if (this.shadowRoot)\n this.shadowRoot.append(this.__fallbackStylesNode, this.fallbackIcon);\n };\n this.updatePlaceholder = () => {\n var _a;\n if (!this.fallback && !this.state.loadError) {\n // If not in fallback mode and there is no image loading error then remove Icon and Fallback styles from DOM\n (_a = this.fallbackIcon) === null || _a === void 0 ? void 0 : _a.remove();\n this.__fallbackStylesNode.remove();\n }\n else if (this.fallbackIcon) {\n // Adjust the displayed icon according to the state. Fallback mode in priority\n this.fallbackIcon.icon = this.fallback ? 'image' : 'image-strikethrough';\n }\n if (!this.fallback) {\n // Watch the failed image, it might load later. (src attribute may be updated by the user)\n this.watchAssignedImage();\n }\n };\n this.handleError = () => {\n // Slotted image failed to load\n this.state.loadError = true;\n this.showPlaceholder();\n };\n this.handleLoad = () => {\n // Slotted image loaded\n this.state.loadError = false;\n this.updatePlaceholder();\n };\n this.handleSlotChange = () => {\n // Reset state on new slotted image\n this.state.loadError = false;\n this.updatePlaceholder();\n };\n this.watchAssignedImage = () => {\n const assignedImage = this.querySelector('img');\n // If image has already loaded\n if (assignedImage && assignedImage.complete) {\n if (assignedImage.naturalHeight < 1) {\n // image load has failed before connecting to DOM\n if (!this.state.loadError)\n this.handleError();\n }\n else if (this.state.loadError) {\n // image load has succeded, clear error state\n this.handleLoad();\n }\n else {\n // The odd case when the image has successfully loaded the updated its src which failed instantly so the img object still holds remains of previous data (ie:naturalHeight).\n this.startWatching();\n }\n }\n else if (!this.state.watching) {\n // It's still loading and not already watching then listen for events\n this.startWatching();\n }\n };\n // Deduplicated listener launch method\n this.startWatching = () => {\n this.imageSlot.addEventListener('error', this.handleError, true);\n this.imageSlot.addEventListener('load', this.handleLoad, true);\n this.state.watching = true;\n };\n this.ignoreAssignedImage = () => {\n // Stop listening to image events\n if (!this.state.watching)\n return;\n this.imageSlot.removeEventListener('error', this.handleError, true);\n this.imageSlot.removeEventListener('load', this.handleLoad, true);\n this.state.watching = false;\n };\n this.gatherProperties(['fallback'], this); // Manages inherited pre-definition properties.\n const shadow = this.attachShadow({ mode: 'open' });\n shadow.append(template.content.cloneNode(true));\n this.imageSlot = shadow.querySelector('slot');\n }\n connectedCallback() {\n super.connectedCallback();\n this.imageSlot.addEventListener('slotchange', this.handleSlotChange);\n if (this.fallback)\n this.showPlaceholder();\n else\n this.watchAssignedImage();\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.imageSlot.removeEventListener('slotchange', this.handleSlotChange);\n this.ignoreAssignedImage();\n }\n get fallback() {\n return this.hasAttribute('fallback');\n }\n // Setting fallback mode via property. Effects are delegated to the attributeChangedCallback\n set fallback(val) {\n this.toggleAttribute('fallback', !!val);\n }\n attributeChangedCallback(name, oldValue, newValue) {\n // No need to check for attribute name, as only one triggers this callback\n if (oldValue === null)\n this.showPlaceholder(); // fallback mode: on\n else if (newValue === null)\n this.updatePlaceholder(); // fallback mode: off\n }\n}\nImage.observedAttributes = ['fallback'];\nexport default Image;\n","import define from '@ingka/webc-tools';\nimport Image from './src/Image.js';\nexport { Image };\nexport const imageTagName = define('image', Image);\n","import { prefixReplacer, PredefinitionPropertyHandler } from '@ingka/webc-tools';\nimport '@ingka/button-webc';\nimport '@ingka/icon-webc';\nimport '@ingka/icon-store/arrow-right';\nimport '@ingka/aspect-ratio-box-webc';\nimport '@ingka/image-webc';\n// @ts-ignore;\nconst styles = ':host{cursor:pointer;display:block}*{box-sizing:border-box}skapa-aspect-ratio{display:flex}.image>*{min-height:100%}a{display:flex;flex-direction:column;height:100%;text-decoration:none}a:not(.with-image){border-top:1px solid rgb(var(--colour-neutral-3,223,223,223))}a:not(.with-image) .image{display:none}.info{display:flex;flex-direction:column;padding:1.5rem;padding-inline-start:0}.focus-visible [name=title]::slotted(*),:host(:hover) [name=title]::slotted(*){text-decoration:underline}a:focus:not(.focus-visible){outline:none}a.focus-visible{box-shadow:0 0 0 4px var(--skapa-focus-ring-internal,rgb(var(--colour-neutral-1,255,255,255)));outline:2px solid var(--skapa-focus-ring-external,rgb(var(--colour-neutral-7,17,17,17)));outline-offset:4px;transition:outline .2s ease-out,box-shadow .2s ease-out}[name=image]::slotted(*){max-height:100%;max-width:100%;min-height:100%;object-fit:cover;width:100%}[name=title]{display:block;margin-top:.5rem}[name=title]::slotted(*){color:rgb(var(--colour-text-and-icon-1,17,17,17));font-size:1.125rem;letter-spacing:-.0042em;line-height:1.444}p{color:rgb(var(--colour-text-and-icon-2,72,72,72));margin:1rem 0 0;padding:0}[name=cta]{display:inline-block;margin-top:1.5rem}[name=label]::slotted(*){color:rgb(var(--colour-text-and-icon-2,72,72,72));font-size:.75rem;line-height:1.5}:host(:not([emphasised])) #btn{display:none}:host(:not([emphasised])) #btn+*{color:rgb(var(--colour-text-and-icon-1,17,17,17));margin-top:-.5rem}:host([emphasised]){background-color:rgb(var(--colour-neutral-2,245,245,245))}:host([emphasised]) a{border-top:0}:host([emphasised]) .info{flex-grow:1;padding-inline-start:1.5rem}:host([emphasised]) #btn{margin-top:1.5rem}:host([emphasised]) #btn+[icon]{display:none}:host([emphasised]) .text-wrapper{flex-grow:1}:host([large]){font-size:1rem;line-height:1.625}:host([large]) [name=title]::slotted(*){font-size:1.5rem;line-height:1.45}:host([compact]) .image{flex-shrink:0}:host([compact]) .info{flex-grow:1}:host([compact]) .text-wrapper{max-width:30rem}@media (min-width:37.5em){:host(:not([compact])) .info{padding-inline-end:10rem}:host(:not([compact])):host([emphasised]) .info{padding:2.5rem;padding-inline-end:7.5rem}:host(:not([compact])):host([emphasised]) [name=cta]{margin-top:1.5rem}:host(:not([compact])) [name=title]::slotted(*){font-size:1.5rem;line-height:1.45}:host(:not([compact])):host([large]) [name=title]::slotted(*){font-size:2.25rem;line-height:1.333}:host(:not([compact])):host([emphasised]) #btn{margin-top:2.5rem}}@media (min-width:75em){:host(:not([compact])) a{flex-direction:row}:host(:not([compact])) .image{flex-basis:60%;max-width:60%}:host(:not([compact])) .info{padding-bottom:0;padding-top:0}:host(:not([compact])) a.with-image .info{flex-basis:40%;max-width:40%;padding-inline-end:4rem;padding-inline-start:3rem}:host(:not([compact])) .text-wrapper{max-width:37.5rem}:host(:not([compact])):host([trailing-image]) .image{order:1}:host(:not([compact])):host([emphasised]) .info{padding:3rem;padding-inline-end:4rem}:host(:not([compact])):host([emphasised]) [name=cta]{margin-top:1.5rem}}:host([inverse]) [name=label]::slotted(*),:host([inverse]) [name=title]::slotted(*),:host([inverse]) p{color:inherit}:host([inverse]) .info{color:#fff}';\n// @ts-ignore;\nconst lightStyles = 'skapa-card[inverse]>*{color:inherit}';\nlet lightStyleTemplate;\nlet template;\nfunction getTemplate() {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = prefixReplacer(`\n \n \n
    \n \n \n \n \n \n
    \n
    \n
    \n \n \n

    \n
    \n \n \n \n \n
    \n
    \n \n `);\n lightStyleTemplate = document.createElement('style');\n lightStyleTemplate.slot = 'light-styles';\n lightStyleTemplate.innerHTML = prefixReplacer(lightStyles.toString());\n }\n return template;\n}\nexport class Card extends HTMLElement {\n constructor() {\n super();\n this.handleImageMode = () => {\n this.anchor.classList.toggle('with-image', Boolean(this.imageSlot.assignedNodes({ flatten: true }).length));\n };\n this.syncInverseLightStyle = () => {\n if (this.inverse)\n this.append(this.__lightStyleNode);\n else\n this.__lightStyleNode.remove();\n };\n PredefinitionPropertyHandler.gatherProperties(['url', 'emphasised', 'large', 'compact', 'target', 'inverse', 'trailingImage', 'imageRatio'], this);\n const shadow = this.shadow = this.attachShadow({ mode: 'open', delegatesFocus: true });\n shadow.append(getTemplate().content.cloneNode(true));\n this.imageSlot = shadow.querySelector('[name=image]');\n this.imageSlot.addEventListener('slotchange', this.handleImageMode);\n this.aspectRatio = shadow.getElementById('aspectratio');\n this.__lightStyleNode = lightStyleTemplate.cloneNode(true);\n }\n connectedCallback() {\n PredefinitionPropertyHandler.initGatheredProperties(this);\n this.syncInverseLightStyle();\n }\n get anchor() {\n return this.shadow.querySelector('a');\n }\n get emphasised() {\n return this.hasAttribute('emphasised');\n }\n set emphasised(toggle) {\n this.toggleAttribute('emphasised', !!toggle);\n }\n get large() {\n return this.hasAttribute('large');\n }\n set large(toggle) {\n this.toggleAttribute('large', !!toggle);\n }\n get compact() {\n return this.hasAttribute('compact');\n }\n set compact(toggle) {\n this.toggleAttribute('compact', !!toggle);\n }\n get trailingImage() {\n return this.hasAttribute('trailing-image');\n }\n set trailingImage(toggle) {\n this.toggleAttribute('trailing-image', !!toggle);\n }\n // Forwarded properties\n set url(value) {\n if (value)\n this.setAttribute('url', value);\n else\n this.removeAttribute('url');\n }\n get url() {\n return this.getAttribute('url');\n }\n set target(value) {\n if (value)\n this.setAttribute('target', value);\n else\n this.removeAttribute('target');\n }\n get target() {\n return this.anchor.getAttribute('target');\n }\n get inverse() {\n return this.hasAttribute('inverse');\n }\n set inverse(toggle) {\n this.toggleAttribute('inverse', !!toggle);\n }\n set imageRatio(value) {\n if (value)\n this.aspectRatio.ratio = value;\n else\n this.aspectRatio.ratio = 'wide';\n }\n get imageRatio() {\n const attribute = this.aspectRatio.getAttribute('ratio');\n return attribute || 'wide';\n }\n attributeChangedCallback(name, oldval, newVal) {\n if (name === 'url') {\n // set integrated anchor tag href to url\n if (newVal) {\n this.anchor.setAttribute('href', newVal);\n }\n else {\n this.anchor.removeAttribute('href');\n }\n }\n else if (name === 'target') {\n // reflect to integrated anchor tag\n if (newVal) {\n this.anchor.setAttribute('target', newVal);\n }\n else {\n this.anchor.removeAttribute('target');\n }\n }\n else if (name === 'image-ratio') {\n // reflect to integrated skapa-image-ratio tag\n if (newVal) {\n this.aspectRatio.ratio = newVal;\n }\n else {\n this.aspectRatio.ratio = 'wide';\n }\n }\n else if (name === 'inverse') {\n this.syncInverseLightStyle();\n }\n }\n}\nCard.observedAttributes = ['url', 'inverse', 'target', 'image-ratio'];\n","import define from '@ingka/webc-tools';\nimport { Card } from './src/Card.js';\nexport { Card };\nexport const cardTagName = define('card', Card);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('incorrect', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M20 12c0 4.4183-3.5817 8-8 8-1.8487 0-3.551-.6271-4.9056-1.6801L18.3199 7.0944C19.3729 8.449 20 10.1513 20 12zM5.6801 16.9056 16.9056 5.6801C15.551 4.6271 13.8487 4 12 4c-4.4183 0-8 3.5817-8 8 0 1.8487.627 3.551 1.6801 4.9056zM22 12c0 5.5228-4.4772 10-10 10-5.5229 0-10-4.4772-10-10C2 6.4771 6.4771 2 12 2c5.5228 0 10 4.4771 10 10z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('information-circle', [{ tag: 'path', att: { d: 'M12 9.5c.6904 0 1.25-.5596 1.25-1.25S12.6904 7 12 7s-1.25.5596-1.25 1.25S11.3096 9.5 12 9.5zM11 11v6h2v-6h-2z' } }, { tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M12 2C6.4771 2 2 6.4771 2 12c0 5.5228 4.4771 10 10 10 5.5228 0 10-4.4772 10-10 0-5.5229-4.4772-10-10-10zM4 12c0-4.4183 3.5817-8 8-8s8 3.5817 8 8-3.5817 8-8 8-8-3.5817-8-8z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('checkmark-circle', [{ tag: 'path', att: { d: 'M18 8.9608 16.5591 7.5l-5.9955 6.0784-3.1227-3.166L6 11.8732 10.5636 16.5 18 8.9608z' } }, { tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M12 22c5.5228 0 10-4.4772 10-10 0-5.5229-4.4772-10-10-10C6.4771 2 2 6.4771 2 12c0 5.5228 4.4771 10 10 10zm0-2c4.4183 0 8-3.5817 8-8s-3.5817-8-8-8-8 3.5817-8 8 3.5817 8 8 8z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum;\n(function (ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum) {\n ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum[\"default\"] = \"default\";\n ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum[\"loading\"] = \"loading\";\n ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum[\"failed\"] = \"failed\";\n})(ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum || (ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum = {}));\nexports.default = ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum;\n//# sourceMappingURL=ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ConfigurationSummaryConfirmationCardStateEnum;\n(function (ConfigurationSummaryConfirmationCardStateEnum) {\n ConfigurationSummaryConfirmationCardStateEnum[\"default\"] = \"default\";\n ConfigurationSummaryConfirmationCardStateEnum[\"ecoFeeCard\"] = \"ecoFeeCard\";\n})(ConfigurationSummaryConfirmationCardStateEnum || (ConfigurationSummaryConfirmationCardStateEnum = {}));\nexports.default = ConfigurationSummaryConfirmationCardStateEnum;\n//# sourceMappingURL=ConfigurationSummaryConfirmationCardStateEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ConfigurationSummaryConfirmationCardTypeEnum;\n(function (ConfigurationSummaryConfirmationCardTypeEnum) {\n ConfigurationSummaryConfirmationCardTypeEnum[\"addToCartSuccess\"] = \"addToCartSuccess\";\n ConfigurationSummaryConfirmationCardTypeEnum[\"addToListSuccess\"] = \"addToListSuccess\";\n ConfigurationSummaryConfirmationCardTypeEnum[\"saveVpcFail\"] = \"saveVpcFail\";\n ConfigurationSummaryConfirmationCardTypeEnum[\"addUnavailabeToCartAndListSuccess\"] = \"addUnavailabeToCartAndListSuccess\";\n ConfigurationSummaryConfirmationCardTypeEnum[\"addUnavailabeToCartFailAndListSuccess\"] = \"addUnavailabeToCartFailAndListSuccess\";\n ConfigurationSummaryConfirmationCardTypeEnum[\"addUnavailabeToCartSuccessAndListFail\"] = \"addUnavailabeToCartSuccessAndListFail\";\n})(ConfigurationSummaryConfirmationCardTypeEnum || (ConfigurationSummaryConfirmationCardTypeEnum = {}));\nexports.default = ConfigurationSummaryConfirmationCardTypeEnum;\n//# sourceMappingURL=ConfigurationSummaryConfirmationCardTypeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ConfirmationSummaryCopyDesignCodeStateEnum;\n(function (ConfirmationSummaryCopyDesignCodeStateEnum) {\n ConfirmationSummaryCopyDesignCodeStateEnum[\"default\"] = \"default\";\n ConfirmationSummaryCopyDesignCodeStateEnum[\"success\"] = \"success\";\n})(ConfirmationSummaryCopyDesignCodeStateEnum || (ConfirmationSummaryCopyDesignCodeStateEnum = {}));\nexports.default = ConfirmationSummaryCopyDesignCodeStateEnum;\n//# sourceMappingURL=ConfirmationSummaryCopyDesignCodeStateEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst analytics_1 = require(\"@inter-ikea-kompis/analytics\");\nconst insights_data_provider_1 = require(\"@insights/insights-data-provider\");\nconst moduleId = 'configuration_summary_confirmation_card';\n/**\n * Tracks events from Configuration Summary Confirmation Card and sends them to a reporter.\n *\n * @event link_card_click When the link card is clicked.\n */\nclass ConfigurationSummaryConfirmationCardTracker extends analytics_1.AbstractAnalyticsTracker {\n constructor(options) {\n super(Object.assign({ moduleId }, options));\n this.context = options.context;\n }\n /**\n * Call to report when link card has been clicked.\n *\n * @param meta Optional metadata for the payload in the analytics event.\n */\n sendLinkCardClick(meta) {\n this.getReporter().report({\n event: 'link_card_click',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe,\n payload: Object.assign(Object.assign({}, meta), { context: this.context })\n });\n }\n}\nexports.default = ConfigurationSummaryConfirmationCardTracker;\n//# sourceMappingURL=ConfigurationSummaryConfirmationCardTracker.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nconst ConfigurationSummaryConfirmationCardTypeEnum_1 = __importDefault(require(\"../../enums/ConfigurationSummaryConfirmationCardTypeEnum\"));\n/**\n * Styles.\n */\nclass ConfigurationSummaryConfirmationCardStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @param options.hasScreenshot\n * @param options.type\n * @returns CSS for ConfigurationSummary.\n */\n static getStyle(options) {\n const { color, spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\n\t\t\t.heading {\n\t\t\t\tmargin-top: 0;\n\t\t\t\tmargin-bottom: ${spacing.space150 / 16}rem;\n\t\t\t}\n\n\t\t\t.productInformation {\n\t\t\t\tdisplay: flex;\n\t\t\t\t${options.hasScreenshot ? 'gap:' + spacing.space100 / 16 + 'rem' : ''};\n\t\t\t}\n\n\t\t\t.productInformation kompis-image {\n\t\t\t\theight: ${96 / 16}rem;\n\t\t\t\twidth: auto;\n\t\t\t}\n\n\t\t\t.errorMessageProductInformation {\n\t\t\t\tcolor: ${color.text.default};\n\t\t\t}\n\n\t\t\t.addToBag {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: flex-start;\n\t\t\t}\n\n\t\t\t.message {\n\t\t\t\tmargin-bottom: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.vpcArea {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\tkompis-copy-design-code {\n\t\t\t\tmargin-bottom: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.goToLink {\n\t\t\t\tmargin-top: ${spacing.space150 / 16}rem;\n\t\t\t}\n\n\t\t\t.content {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\n\t\t\t.informationMessage {\n\t\t\t\tmargin-top: ${spacing.space150 / 16}rem;\n\t\t\t}\n\n\t\t\t.errorMessage {\n\t\t\t\tmargin-top: ${options.type !== ConfigurationSummaryConfirmationCardTypeEnum_1.default.saveVpcFail\n ? spacing.space150 / 16\n : '0'}rem;\n\t\t\t}\n\n\t\t\t.line {\n\t\t\t\theight: ${1 / 16}rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tbackground-color: ${color.neutral.grey200};\n\t\t\t\tmargin: ${spacing.space250 / 16}rem 0;\n\t\t\t}\n\n\t\t\t.divider {\n\t\t\t\theight: ${spacing.space150 / 16}rem;\n\t\t\t}\n\n\t\t\t/* Disable user agent styling for anchor tag */\n\t\t\ta {\n\t\t\t\tpadding: 0;\n\t\t\t\tborder: 0;\n\t\t\t}\n\n\t\t\t.saveDesignAreaAndLinkCardContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\tgap: ${spacing.space250 / 16}rem;\n\t\t\t}\n\n\t\t\t.saveDesignContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\tgap: ${spacing.space150 / 16}rem;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = ConfigurationSummaryConfirmationCardStyle;\n//# sourceMappingURL=ConfigurationSummaryConfirmationCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_price_module_1 = require(\"@inter-ikea-kompis/component-price-module\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@inter-ikea-kompis/component-copy-design-code\");\nrequire(\"@inter-ikea-kompis/component-price-module\");\nrequire(\"@inter-ikea-kompis/component-eco-fee\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/inline-message-webc\");\nrequire(\"@ingka/card-webc\");\nrequire(\"@ingka/icon-store/incorrect\");\nrequire(\"@ingka/icon-store/information-circle\");\nrequire(\"@ingka/icon-store/checkmark-circle\");\nconst ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum_1 = __importDefault(require(\"../../enums/ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum\"));\nconst ConfigurationSummaryConfirmationCardStateEnum_1 = __importDefault(require(\"../../enums/ConfigurationSummaryConfirmationCardStateEnum\"));\nconst ConfigurationSummaryConfirmationCardTypeEnum_1 = __importDefault(require(\"../../enums/ConfigurationSummaryConfirmationCardTypeEnum\"));\nconst ConfirmationSummaryCopyDesignCodeStateEnum_1 = __importDefault(require(\"../../enums/ConfirmationSummaryCopyDesignCodeStateEnum\"));\nconst ConfigurationSummaryConfirmationCardTracker_1 = __importDefault(require(\"../../trackers/ConfigurationSummaryConfirmationCardTracker\"));\nconst ConfigurationSummaryConfirmationCardStyle_1 = __importDefault(require(\"./ConfigurationSummaryConfirmationCardStyle\"));\n/**\n * ConfigurationSummaryConfirmationCard class.\n *\n * @event copyDesign When copy design is clicked.\n * @event confirmationCardStateChange When the state changes.\n * @event goToShoppingBag When goToShoppingBag is clicked\n * @event linkCardClick When the link card is clicked.\n * @event logInAndSaveDesign When save design is clicked.\n */\nlet ConfigurationSummaryConfirmationCard = class ConfigurationSummaryConfirmationCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // VPC code. If not provided the \"keep your design\"-section will not show.\n this.vpcCode = null;\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // Defines the state for add to bag button\n this.type = ConfigurationSummaryConfirmationCardTypeEnum_1.default.addToCartSuccess;\n // Show a warning about it includes unavailable products.\n this.addUnavailableProductsToList = false;\n // Defines the state for copy design code\n this.copyDesignState = ConfirmationSummaryCopyDesignCodeStateEnum_1.default.default;\n // The url for the screenshot.\n this.screenshotUrl = null;\n // The alt text for the screenshot. If not set, a default alt text will be used.\n this.screenshotAlt = null;\n // The name of the product.\n this.productName = null;\n // The current state of the component\n this.state = ConfigurationSummaryConfirmationCardStateEnum_1.default.default;\n // Displays link card when data and Översätta key showLinkCard are set. For image ratio guidelines, see Skapa Card. Hidden on kiosks when disableLinks is true.\n this.linkCard = null;\n // Used for automatic analytics. If null or not set, analytics is turned off.\n this.analytics = null;\n // Whether the user is logged in to IKEA or not.\n this.loggedIn = false;\n // Shows the save design button.\n this.showSaveDesign = false;\n // Defines the state for the log in and save button.\n this.logInAndSaveState = ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum_1.default.default;\n this.tracker = null;\n this.dexfSettings = null;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getContentBasedOnState()}\n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.disconnectTracker();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n if (changedProperties.has('analytics')) {\n this.disconnectTracker();\n this.connectTracker();\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getSettings() {\n return this.dexfSettings;\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n connectTracker() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n if (this.analytics) {\n // eslint-disable-next-line no-underscore-dangle\n const reporter = this.analytics.__INTERNAL__reporter;\n if ((reporter === null || reporter === void 0 ? void 0 : reporter.connected) === false) {\n // Should use an existing reporter, but wait for it to be connected\n return;\n }\n // Use existing connected reporter, or the tracker should create a new one.\n const reporterId = reporter ? reporter.id : undefined;\n this.tracker = new ConfigurationSummaryConfirmationCardTracker_1.default(Object.assign(Object.assign({}, this.analytics), { settings: this.getSettings(), reporterId }));\n yield ((_a = this.tracker) === null || _a === void 0 ? void 0 : _a.connect());\n }\n });\n }\n disconnectTracker() {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.disconnect();\n this.tracker = null;\n }\n getContentBasedOnState() {\n switch (this.state) {\n case ConfigurationSummaryConfirmationCardStateEnum_1.default.ecoFeeCard:\n return this.getEcoFeeCard();\n default:\n return (0, web_component_1.html) `\n\t\t\t\t\t
    \n\t\t\t\t\t\t${this.getProductInformation()}${this.getGoToLink()}${this.getContent()}\n\t\t\t\t\t
    \n\t\t\t\t`;\n }\n }\n getEcoFeeCard() {\n const totalPrice = utilities_1.TotalPriceCalculator.calculate(this.shoppingProducts, this.getSettings().localisation.dateFormat);\n return (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n }\n getProductInformation() {\n var _a;\n if (this.type ===\n ConfigurationSummaryConfirmationCardTypeEnum_1.default.addUnavailabeToCartFailAndListSuccess) {\n return (0, web_component_1.html) `\n\t\t\t\t

    \n\t\t\t\t\t${this.getTranslations().ikeaGenericErrorTryAgain}\n\t\t\t\t

    \n\t\t\t`;\n }\n if (this.type === ConfigurationSummaryConfirmationCardTypeEnum_1.default.saveVpcFail) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t this.dispatchEvent(new CustomEvent('confirmationCardStateChange', {\n bubbles: true,\n detail: { selectedState: event.detail.visibleModal }\n }))}\"\n\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n getGoToLink() {\n switch (this.type) {\n case ConfigurationSummaryConfirmationCardTypeEnum_1.default.saveVpcFail:\n return null;\n }\n const buttonVariant = this.type ===\n ConfigurationSummaryConfirmationCardTypeEnum_1.default.addUnavailabeToCartFailAndListSuccess\n ? 'primary'\n : 'emphasised';\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t this.dispatchEvent(new CustomEvent('goToShoppingBag', {\n bubbles: true\n }))}\"\n\t\t\t\t>\n\t\t\t\t\t${this.getButtonLabel()}\n\t\t\t\t\n\t\t\t
    \n\n\t\t\t${this.getInformationInlineMessage()} ${this.getErrorInlineMessage()}\n\t\t`;\n }\n getContent() {\n if (this.type === ConfigurationSummaryConfirmationCardTypeEnum_1.default.saveVpcFail) {\n return (0, web_component_1.html) `${this.getErrorInlineMessage()}`;\n }\n const saveDesignArea = this.getSaveDesignArea();\n const linkCard = this.getLinkCardArea();\n if (!saveDesignArea && !linkCard) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t${this.getLine()}\n\t\t\t
    ${saveDesignArea}${linkCard}
    \n\t\t`;\n }\n getSaveDesignArea() {\n const saveDesign = this.getSaveDesign();\n if (saveDesign) {\n return saveDesign;\n }\n return this.showSaveDesign ? null : this.getVpcArea();\n }\n getVpcArea() {\n if (!this.vpcCode) {\n return null;\n }\n if (this.type === ConfigurationSummaryConfirmationCardTypeEnum_1.default.saveVpcFail) {\n return null;\n }\n return (0, web_component_1.html) `
    \n\t\t\t

    \n\t\t\t\t${this.getTranslations().designCodeDescriptionTitle}\n\t\t\t

    \n\t\t\t${this.getVpcContent()}\n\t\t\t

    \n\t\t\t\t${this.getTranslations().designCodeDescription}\n\t\t\t

    \n\t\t
    `;\n }\n getSaveDesign() {\n if (!this.showSaveDesign) {\n return null;\n }\n if (this.loggedIn &&\n this.logInAndSaveState === ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum_1.default.default) {\n return null;\n }\n const informativeVariant = 'informative';\n const buttonVariant = 'secondary';\n return (0, web_component_1.html) `
    \n\t\t\t\n\t\t\t\t\n\t\t\t\t${this.getTranslations().confirmationCardSaveDesignHint}\n\t\t\t\n\t\t\t${this.getTranslations().save}\n\t\t
    `;\n }\n getLine() {\n return (0, web_component_1.html) `
    `;\n }\n onSaveClick() {\n this.dispatchEvent(new CustomEvent('logInAndSaveDesign', {\n bubbles: true\n }));\n }\n getLinkCardArea() {\n if (!this.getSettings().kompis.localization.showLinkCard ||\n this.disableLinks ||\n !this.linkCard) {\n return null;\n }\n const { imageUrl, imageAltText, titleText, bodyTextLines, buttonText, linkUrl, meta } = this.linkCard;\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t {\n var _a;\n this.dispatchEvent(new CustomEvent('linkCardClick', {\n bubbles: true,\n detail: meta\n }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendLinkCardClick(meta);\n }}\"\n\t\t\t\t>\n\t\t\t\t\t\"${imageAltText\n\t\t\t\t\t

    ${titleText}

    \n\t\t\t\t\t${buttonText}\n\t\t\t\t\t${bodyTextLines.map((line, index) => index < bodyTextLines.length - 1 ? (0, web_component_1.html) `${line}
    ` : (0, web_component_1.html) `${line}`)}\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n getErrorInlineMessage() {\n let errorMessage = '';\n const { codeFailureText, addToShoppingCartUnavailableCheckOutError } = this.getTranslations();\n switch (this.type) {\n case ConfigurationSummaryConfirmationCardTypeEnum_1.default.saveVpcFail: {\n errorMessage = codeFailureText;\n break;\n }\n case ConfigurationSummaryConfirmationCardTypeEnum_1.default.addUnavailabeToCartSuccessAndListFail: {\n errorMessage = addToShoppingCartUnavailableCheckOutError;\n break;\n }\n }\n const negativeVariant = 'negative';\n return errorMessage\n ? (0, web_component_1.html) `\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t${errorMessage}\n\t\t\t\t\t\n\t\t\t `\n : null;\n }\n /**\n *\n * @returns Template.\n */\n getVpcContent() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t`;\n }\n /**\n * On copy design code.\n *\n * @param event Event - should either be a browser copy event or a custom one.\n */\n onCopy(event) {\n if ('detail' in event &&\n event.detail.state !== ConfirmationSummaryCopyDesignCodeStateEnum_1.default.success) {\n this.dispatchEvent(new CustomEvent('copyDesign', {\n bubbles: true,\n detail: {\n copyDesignState: ConfirmationSummaryCopyDesignCodeStateEnum_1.default.default,\n error: true\n }\n }));\n }\n else {\n this.dispatchEvent(new CustomEvent('copyDesign', {\n bubbles: true,\n detail: {\n copyDesignState: ConfirmationSummaryCopyDesignCodeStateEnum_1.default.success,\n error: false\n }\n }));\n }\n }\n /**\n * On copy design code.\n *\n * @param event Event.\n */\n onReset() {\n this.dispatchEvent(new CustomEvent('copyDesign', {\n bubbles: true,\n detail: {\n copyDesignState: ConfirmationSummaryCopyDesignCodeStateEnum_1.default.default,\n error: false\n }\n }));\n }\n getInformationInlineMessage() {\n if (!this.addUnavailableProductsToList ||\n this.type ===\n ConfigurationSummaryConfirmationCardTypeEnum_1.default.addUnavailabeToCartSuccessAndListFail) {\n return null;\n }\n const informativeVariant = 'informative';\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t\n\t\t\t\t${this.getInformationMessageContent()}\n\t\t\t\n\t\t`;\n }\n getInformationMessageContent() {\n let list = [];\n const { addToShoppingCartUnavailableCheckOutConfirmation } = this.getTranslations();\n if (addToShoppingCartUnavailableCheckOutConfirmation.includes('[[')) {\n list = addToShoppingCartUnavailableCheckOutConfirmation.split('[[shopping_list]]');\n }\n else if (addToShoppingCartUnavailableCheckOutConfirmation.includes('{{')) {\n list = addToShoppingCartUnavailableCheckOutConfirmation.split('{{shopping_list}}');\n }\n if (list.length !== 2) {\n return addToShoppingCartUnavailableCheckOutConfirmation;\n }\n return (0, web_component_1.html) `\n\t\t\t${list[0]}\n\t\t\t${list[1]}\n\t\t`;\n }\n getButtonLink() {\n if (this.type === ConfigurationSummaryConfirmationCardTypeEnum_1.default.addToCartSuccess ||\n this.type ===\n ConfigurationSummaryConfirmationCardTypeEnum_1.default.addUnavailabeToCartAndListSuccess ||\n this.type ===\n ConfigurationSummaryConfirmationCardTypeEnum_1.default.addUnavailabeToCartSuccessAndListFail) {\n return this.getSettings().kompis.urls.shoppingCartLink;\n }\n return this.getSettings().kompis.urls.shoppingListLink;\n }\n getButtonLabel() {\n if (this.type === ConfigurationSummaryConfirmationCardTypeEnum_1.default.addToCartSuccess ||\n this.type ===\n ConfigurationSummaryConfirmationCardTypeEnum_1.default.addUnavailabeToCartAndListSuccess ||\n this.type ===\n ConfigurationSummaryConfirmationCardTypeEnum_1.default.addUnavailabeToCartSuccessAndListFail) {\n return this.getTranslations().shoppingBagLinkTo;\n }\n return this.getTranslations().shoppingListLinkTo;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummaryConfirmationCard.prototype, \"vpcCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ConfigurationSummaryConfirmationCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ConfigurationSummaryConfirmationCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ConfigurationSummaryConfirmationCard.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ConfigurationSummaryConfirmationCard.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ConfigurationSummaryConfirmationCard.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummaryConfirmationCard.prototype, \"type\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ConfigurationSummaryConfirmationCard.prototype, \"addUnavailableProductsToList\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummaryConfirmationCard.prototype, \"copyDesignState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummaryConfirmationCard.prototype, \"screenshotUrl\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummaryConfirmationCard.prototype, \"screenshotAlt\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummaryConfirmationCard.prototype, \"productName\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ConfigurationSummaryConfirmationCard.prototype, \"shoppingProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummaryConfirmationCard.prototype, \"state\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ConfigurationSummaryConfirmationCard.prototype, \"linkCard\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ConfigurationSummaryConfirmationCard.prototype, \"analytics\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ConfigurationSummaryConfirmationCard.prototype, \"loggedIn\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ConfigurationSummaryConfirmationCard.prototype, \"showSaveDesign\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummaryConfirmationCard.prototype, \"logInAndSaveState\", void 0);\nConfigurationSummaryConfirmationCard = __decorate([\n (0, web_component_1.customElement)('kompis-configuration-summary-confirmation-card')\n], ConfigurationSummaryConfirmationCard);\nexports.default = ConfigurationSummaryConfirmationCard;\n//# sourceMappingURL=ConfigurationSummaryConfirmationCard.js.map","import \"@inter-ikea-kompis/component-configuration-summary/lib/components/configuration-summary-confirmation-card/ConfigurationSummaryConfirmationCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisConfigurationSummaryConfirmationCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-configuration-summary-confirmation-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.addUnavailableProductsToList = props.addUnavailableProductsToList;\n element.analytics = props.analytics;\n element.copyDesignState = props.copyDesignState;\n element.disableLinks = props.disableLinks;\n element.linkCard = props.linkCard;\n element.localizedInformation = props.localizedInformation;\n element.logInAndSaveState = props.logInAndSaveState;\n element.loggedIn = props.loggedIn;\n element.productName = props.productName;\n element.screenshotAlt = props.screenshotAlt;\n element.screenshotUrl = props.screenshotUrl;\n element.settings = props.settings;\n element.shoppingProducts = props.shoppingProducts;\n element.showSaveDesign = props.showSaveDesign;\n element.state = props.state;\n element.theme = props.theme;\n element.translations = props.translations;\n element.type = props.type;\n element.vpcCode = props.vpcCode;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onConfirmationCardStateChange, \"confirmationCardStateChange\");\n this.updateEventListener(element, props.onCopyDesign, \"copyDesign\");\n this.updateEventListener(element, props.onGoToShoppingBag, \"goToShoppingBag\");\n this.updateEventListener(element, props.onLinkCardClick, \"linkCardClick\");\n this.updateEventListener(element, props.onLogInAndSaveDesign, \"logInAndSaveDesign\");\n }\n}\nKompisConfigurationSummaryConfirmationCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n addUnavailableProductsToList: PropTypes.bool,\n analytics: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n copyDesignState: PropTypes.string,\n disableLinks: PropTypes.bool,\n linkCard: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n logInAndSaveState: PropTypes.string,\n loggedIn: PropTypes.bool,\n productName: PropTypes.string,\n screenshotAlt: PropTypes.string,\n screenshotUrl: PropTypes.string,\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n shoppingProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n showSaveDesign: PropTypes.bool,\n state: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n type: PropTypes.string,\n vpcCode: PropTypes.string,\n onCopyDesign: PropTypes.func,\n onConfirmationCardStateChange: PropTypes.func,\n onGoToShoppingBag: PropTypes.func,\n onLinkCardClick: PropTypes.func,\n onLogInAndSaveDesign: PropTypes.func\n};\nexport default KompisConfigurationSummaryConfirmationCard;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar InputLayoutEnum;\n(function (InputLayoutEnum) {\n InputLayoutEnum[\"default\"] = \"default\";\n InputLayoutEnum[\"error\"] = \"error\";\n InputLayoutEnum[\"success\"] = \"success\";\n InputLayoutEnum[\"readOnly\"] = \"readOnly\";\n})(InputLayoutEnum || (InputLayoutEnum = {}));\nexports.default = InputLayoutEnum;\n//# sourceMappingURL=InputLayoutEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar InputTypeEnum;\n(function (InputTypeEnum) {\n InputTypeEnum[\"default\"] = \"default\";\n InputTypeEnum[\"subtle\"] = \"subtle\";\n})(InputTypeEnum || (InputTypeEnum = {}));\nexports.default = InputTypeEnum;\n//# sourceMappingURL=InputTypeEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst InputTypeEnum_1 = __importDefault(require(\"../../enums/InputTypeEnum\"));\nconst InputLayoutEnum_1 = __importDefault(require(\"./../../enums/InputLayoutEnum\"));\nconst LINE_HEIGHT = 26;\nclass InputStyle {\n /**\n * @param options The props.\n * @param options.diabled If it is disabled.\n * @param options.hasValue If it has value.\n * @param options.hasFocus If it has focus.\n * @param options.hasLabel If it has label.\n * @param options.hasLeadingIcon If it has a leading icon.\n * @param options.hasTrailingIcon If it has a trailing icon.\n * @param options.theme Theme.\n * @param options.disabled\n * @param options.type Type.\n * @returns Styles.\n */\n static getStyle(options) {\n const { color, spacing, motion } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t${themes_1.FontStyle.getStyle({\n type: enums_1.ThemeFontStyleTypeEnum.bodyLarge,\n theme: options.theme\n })}\n\t\t\tlabel,\n\t\t\tinput {\n\t\t\t\toutline: none;\n\t\t\t\twidth: auto;\n\t\t\t\tmargin: 0;\n\t\t\t\tpadding: 0;\n\t\t\t\tfont-size: inherit;\n\t\t\t\tfont-family: inherit;\n\t\t\t\t-webkit-appearance: none;\n\t\t\t}\n\t\t\t/* remove default arrows in input type=number */\n\t\t\tinput::-webkit-outer-spin-button,\n\t\t\tinput::-webkit-inner-spin-button {\n\t\t\t\t-webkit-appearance: none;\n\t\t\t\tmargin: 0; /* <-- Apparently some margin are still there even though it's hidden */\n\t\t\t}\n\t\t\tinput[type='number'] {\n\t\t\t\t/* remove default arrows in input type=number in Firefox*/\n\t\t\t\t-moz-appearance: textfield;\n\t\t\t}\n\t\t\tinput:disabled {\n\t\t\t\tbackground-color: transparent;\n\t\t\t}\n\t\t\t:host {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\twidth: auto;\n\t\t\t}\n\n\t\t\t${this.getRtl(options)}\n\n\t\t\t.prefix,\n\t\t\t.suffix {\n\t\t\t\t${this.getPadding(options)}\n\t\t\t\talign-self: center;\n\t\t\t\twhite-space: nowrap;\n\t\t\t\topacity: ${options.hasFocus || options.hasValue ? 1 : 0};\n\t\t\t\ttransition-property: opacity;\n\t\t\t\tcolor: ${options.disabled ? color.disabled.default : color.text.lightest};\n\t\t\t\ttransition-duration: ${motion.duration.small};\n\t\t\t\ttransition-delay: ${options.hasFocus ? motion.delay.medium : '0s'};\n\t\t\t}\n\n\t\t\tkompis-icon {\n\t\t\t\t${this.getPadding(options)}\n\t\t\t\talign-self: center;\n\t\t\t\tcolor: ${options.disabled ? color.disabled.default : color.icon.default};\n\t\t\t}\n\n\t\t\t.container {\n\t\t\t\tposition: relative;\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\t.input {\n\t\t\t\tpointer-events: ${options.layout === InputLayoutEnum_1.default.readOnly ? 'none' : 'auto'};\n\t\t\t\tposition: relative;\n\t\t\t\tdisplay: flex;\n\t\t\t\twidth: 100%;\n\t\t\t\t${options.type === InputTypeEnum_1.default.default\n ? `border-bottom: ${1 / 16}rem solid ${this.getBorderColor(options)};`\n : ''}\n\t\t\t\ttransition-property: border, box-shadow;\n\t\t\t\ttransition-duration: ${motion.duration.small};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t\tbox-shadow: ${this.getBoxShadow(options)};\n\t\t\t}\n\n\t\t\tinput {\n\t\t\t\t${this.getPadding(options)}\n\t\t\t\twidth: 100%;\n\t\t\t\tflex-grow: 1;\n\t\t\t\tmin-width: 0;\n\t\t\t\tline-height: ${LINE_HEIGHT / 16}rem;\n\t\t\t\tborder: none;\n\t\t\t\tcolor: ${options.disabled ? color.disabled.default : color.text.dark};\n\t\t\t}\n\n\t\t\tinput::-ms-clear,\n\t\t\tinput::-ms-reveal,\n\t\t\tinput::-webkit-search-decoration,\n\t\t\tinput::-webkit-search-cancel-button,\n\t\t\tinput::-webkit-search-results-button,\n\t\t\tinput::-webkit-search-results-decoration {\n\t\t\t\tdisplay: none;\n\t\t\t\twidth: 0;\n\t\t\t\theight: 0;\n\t\t\t}\n\n\t\t\t.helpContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\n\t\t\t.helpMessage {\n\t\t\t\tcolor: ${this.getHelpMessageColor(options)};\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-grow: 1;\n\t\t\t\tpadding-top: ${spacing.space25 / 16}rem;\n\t\t\t\talign-items: flex-start;\n\t\t\t}\n\n\t\t\t.characterCount {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tcolor: ${this.getCharacterCountColor(options)};\n\t\t\t}\n\n\t\t\t.labelContainer {\n\t\t\t\tposition: absolute;\n\t\t\t\tdisplay: flex;\n\t\t\t\twidth: 100%;\n\t\t\t\talign-items: flex-end;\n\t\t\t\ttop: 0;\n\t\t\t\tright: 0;\n\t\t\t\tleft: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\tlabel {\n\t\t\t\toverflow: hidden;\n\t\t\t\tpointer-events: none;\n\t\t\t\tline-height: ${LINE_HEIGHT / 16}rem;\n\t\t\t\t${options.hasFocus || options.hasValue ? '' : this.getPadding(options)}\n\t\t\t\ttransition-property: transform, color, font-size, line-height, padding;\n\t\t\t\ttransition-duration: ${motion.duration.small};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t\tcolor: ${options.disabled ? color.disabled.default : color.text.default};\n\t\t\t\ttransform: ${this.getLabelTransform(options)};\n\t\t\t}\n\n\t\t\t.divider {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\twidth: ${spacing.space25 / 16}rem;\n\t\t\t}\n\n\t\t\t${this.getRtlLabel(options)}\n\t\t\t${this.getLabelFontStyle(options)}\n\t\t\t${this.getHover(options)}\n\t\t`;\n }\n /**\n * @param options\n */\n static getHover(options) {\n if (options.type === InputTypeEnum_1.default.subtle) {\n return (0, web_component_1.css) `\n\t\t\t\t.input:hover {\n\t\t\t\t\tbox-shadow: 0 ${(options.hasFocus ? 2 : 1) / 16}rem 0 0 ${this.getBorderColor(options)};\n\t\t\t\t}\n\t\t\t`;\n }\n return '';\n }\n /**\n * Get rtl styling.\n *\n * @param options Options.\n */\n static getRtl(options) {\n if (options.direction === 'rtl') {\n return (0, web_component_1.css) `\n\t\t\t\t:host input[inputMode='tel'] {\n\t\t\t\t\tdirection: ltr;\n\t\t\t\t\tunicode-bidi: embed;\n\t\t\t\t\ttext-align: end;\n\t\t\t\t}\n\t\t\t\t:host-context input[inputMode='tel'] {\n\t\t\t\t\tdirection: ltr;\n\t\t\t\t\tunicode-bidi: embed;\n\t\t\t\t\ttext-align: end;\n\t\t\t\t}\n\t\t\t`;\n }\n return (0, web_component_1.css) `\n\t\t\t:host(:dir(rtl)) input[inputMode='tel'] {\n\t\t\t\tdirection: ltr;\n\t\t\t\tunicode-bidi: embed;\n\t\t\t\ttext-align: end;\n\t\t\t}\n\t\t\t:host-context([dir='rtl']) input[inputMode='tel'] {\n\t\t\t\tdirection: ltr;\n\t\t\t\tunicode-bidi: embed;\n\t\t\t\ttext-align: end;\n\t\t\t}\n\t\t`;\n }\n /**\n *\n * @param options\n */\n static getCharacterCountColor(options) {\n const { color } = options.theme;\n if (options.disabled) {\n return color.disabled.default;\n }\n else if (options.characterCountExceeded) {\n return color.semantic.negative;\n }\n return color.text.lightest;\n }\n /**\n * Padding for input.\n *\n * @param options Options.\n * @returns Padding style.\n */\n static getPadding(options) {\n const label = options.hasLabel;\n const { spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\tpadding-top: ${label ? spacing.space125 / 16 : 0}rem;\n\t\t\tpadding-bottom: ${spacing.space25 / 16}rem;\n\t\t`;\n }\n /**\n * @param options Options.\n * @param options.hasLabel If it has label.\n * @param options.hasLeadingIcon If it has a leading icon.\n * @param options.hasTrailingIcon If it has a trailing icon.\n * @param options.theme Theme.\n * @param options.hasValue\n * @param options.hasFocus\n * @returns Css rule.\n */\n static getLabelTransform(options) {\n const { spacing } = options.theme;\n if ((options.hasValue || options.hasFocus) && options.hasLabel) {\n return `translateY(-${56 / 16 / 2}rem)`;\n }\n else if (options.hasLeadingIcon && options.hasLabel) {\n return `translateX(${spacing.space150 / 16}rem)`;\n }\n return 'none';\n }\n /**\n *\n * @param options\n */\n static getRtlLabel(options) {\n const { spacing } = options.theme;\n if (options.direction === 'rtl') {\n if ((options.hasValue || options.hasFocus) && options.hasLabel) {\n return (0, web_component_1.css) `\n\t\t\t\t\tlabel {\n\t\t\t\t\t\ttransform: translateY(-${56 / 16 / 2}rem);\n\t\t\t\t\t}\n\t\t\t\t`;\n }\n else if (options.hasLeadingIcon && options.hasLabel) {\n return (0, web_component_1.css) `\n\t\t\t\t\tlabel {\n\t\t\t\t\t\ttransform: translateX(-${spacing.space150 / 16}rem);\n\t\t\t\t\t}\n\t\t\t\t`;\n }\n }\n if ((options.hasValue || options.hasFocus) && options.hasLabel) {\n return (0, web_component_1.css) `\n\t\t\t\t:host(:dir(rtl)) label {\n\t\t\t\t\ttransform: translateY(-${56 / 16 / 2}rem);\n\t\t\t\t}\n\t\t\t`;\n }\n else if (options.hasLeadingIcon && options.hasLabel) {\n return (0, web_component_1.css) `\n\t\t\t\t:host-context([dir='rtl']) label {\n\t\t\t\t\ttransform: translateX(-${spacing.space150 / 16}rem);\n\t\t\t\t}\n\t\t\t`;\n }\n return '';\n }\n /**\n * @param options Options holder.\n * @returns Font size.\n */\n static getLabelFontStyle(options) {\n if (options.hasValue || options.hasFocus) {\n return themes_1.FontStyle.getStyle({\n type: enums_1.ThemeFontStyleTypeEnum.bodySmall,\n theme: options.theme,\n querySelector: 'label'\n });\n }\n return themes_1.FontStyle.getStyle({\n type: enums_1.ThemeFontStyleTypeEnum.bodyLarge,\n theme: options.theme,\n querySelector: 'label'\n });\n }\n /**\n * Get help message color.\n *\n * @param options Options.\n * @returns Message color.\n */\n static getHelpMessageColor(options) {\n const { color } = options.theme;\n if (options.disabled) {\n return color.disabled.default;\n }\n switch (options.layout) {\n case InputLayoutEnum_1.default.success:\n return color.semantic.positive;\n case InputLayoutEnum_1.default.error:\n return color.semantic.negative;\n default:\n return color.text.lightest;\n }\n }\n /**\n * Get box shadow color.\n *\n * @param options Options.\n */\n static getBoxShadow(options) {\n if (options.type === InputTypeEnum_1.default.subtle && options.hasFocus) {\n return `0 ${2 / 16}rem 0 0 ${this.getBorderColor(options)}`;\n }\n else if ((!options.hasFocus && options.layout === InputLayoutEnum_1.default.default) ||\n options.disabled ||\n options.layout === InputLayoutEnum_1.default.readOnly) {\n return `0 0 0 0 transparent`;\n }\n return `0 ${1 / 16}rem 0 0 ${this.getBorderColor(options)}`;\n }\n /**\n * @param options Options holder.\n * @param options.theme Theme.\n * @param options.hasFocus If it has focus.\n * @returns Color.\n */\n static getBorderColor(options) {\n const { color } = options.theme;\n if (options.disabled) {\n return color.disabled.default;\n }\n if (!options.hasFocus && options.layout === InputLayoutEnum_1.default.default) {\n return color.border.default;\n }\n switch (options.layout) {\n case InputLayoutEnum_1.default.error: {\n return color.semantic.negative;\n }\n case InputLayoutEnum_1.default.success: {\n return color.semantic.positive;\n }\n case InputLayoutEnum_1.default.readOnly: {\n return color.disabled.default;\n }\n default: {\n return color.accent.primaryAccent;\n }\n }\n }\n}\nexports.default = InputStyle;\n//# sourceMappingURL=InputStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst keyboard_manager_1 = require(\"@inter-ikea-kompis/keyboard-manager\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@inter-ikea-kompis/component-icon\");\nrequire(\"@inter-ikea-kompis/component-text\");\nconst InputLayoutEnum_1 = __importDefault(require(\"../../enums/InputLayoutEnum\"));\nconst InputTypeEnum_1 = __importDefault(require(\"../../enums/InputTypeEnum\"));\nconst InputStyle_1 = __importDefault(require(\"./InputStyle\"));\nconst isSafari = navigator.userAgent.search('Safari') >= 0 && navigator.userAgent.search('Chrome') < 0;\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n *\n * @event input When inputing values\n * @event focusOut When input field is put out of focus\n */\nlet Input = class Input extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Input mode\n this.inputMode = keyboard_manager_1.InputModeEnum.text;\n // Layout\n this.layout = InputLayoutEnum_1.default.default;\n // Sets the autocomplete behaviour. Note that it should be set to \"off\" in Kiosks due to privacy policies, as it can otherwise store user data\n this.autocomplete = enums_1.AutoCompleteEnum.off;\n // Set the value of the field\n this.value = '';\n // Will be focused when created\n this.autofocus = false;\n // Like a native input element\n this.disabled = false;\n // Like a native input element\n this.spellcheck = false;\n // Label\n this.label = null;\n // Help message\n this.helpMessage = null;\n // Prefix.\n this.prefix = null;\n // Suffix.\n this.suffix = null;\n // Character count\n this.characterCount = null;\n // Put an icon in the ending of the input field\n this.trailingIcon = null;\n // Put an icon in the beginning of the input field\n this.leadingIcon = null;\n // SelectionStart of cursor\n this.selectionStart = null;\n // SelectionEnd of cursor\n this.selectionEnd = null;\n // Type of input\n this.type = InputTypeEnum_1.default.default;\n // Name of input\n this.inputName = '';\n this.hasFocus = false;\n this.cursor = {\n selectionStart: null,\n selectionEnd: null\n };\n this.listeners = {\n input: {\n handleEvent: this.onInput.bind(this),\n passive: false\n },\n pointerup: this.onSelectionChange.bind(this),\n keyup: this.onSelectionChange.bind(this),\n focusout: this.onFocusOut.bind(this),\n focusin: this.onFocusIn.bind(this)\n };\n this.keyboardManager = new keyboard_manager_1.KeyboardManager();\n this.hasBeenAutoFocused = false;\n this.labelId = new utilities_1.IdGenerator().generateId();\n this.errorId = new utilities_1.IdGenerator().generateId();\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n const direction = utilities_1.SafariWriteDirectionUtility.getWriteDirection(this);\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t
    ${this.getLabel()}
    \n\t\t\t\t\t${this.getLeadingIcon()} ${this.getPrefix()} ${this.getInputElement()} ${this.getSuffix()}\n\t\t\t\t\t${this.getTrailingIcon()}\n\t\t\t\t
    \n\t\t\t\t${this.getHelpContainer()}\n\t\t\t
    \n\t\t`;\n }\n /**\n * @override\n */\n update() {\n var _a;\n super.update();\n // FIXME\n // Temporary fix - Safari does not seem to let go of focus when running the code in the if-statement\n if (isSafari) {\n return;\n }\n const input = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('input');\n if (input) {\n if (this.autofocus && !this.hasBeenAutoFocused) {\n this.hasBeenAutoFocused = true;\n input.focus();\n if (this.value) {\n this.cursor.selectionStart = this.cursor.selectionStart\n ? this.cursor.selectionStart\n : this.value.length;\n this.cursor.selectionEnd = this.cursor.selectionEnd\n ? this.cursor.selectionEnd\n : this.value.length;\n }\n }\n // Forces update of selectionStart and selectionEnd after render\n // Sometimes it does not seem to want to update it during render\n input.selectionStart =\n this.selectionStart !== null ? this.selectionStart : this.cursor.selectionStart;\n input.selectionEnd =\n this.selectionEnd !== null ? this.selectionEnd : this.cursor.selectionEnd;\n }\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('autofocus') && !this.autofocus) {\n this.hasBeenAutoFocused = false;\n }\n return true;\n }\n /**\n * @returns Prefix.\n */\n getPrefix() {\n if (!this.prefix) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t${this.leadingIcon ? (0, web_component_1.html) `` : null}\n\t\t\t event.key === 'Enter' && this.onClick()}\"\n\t\t\t\t@click=\"${() => this.onClick()}\"\n\t\t\t\t>${this.prefix}\n\t\t\t\n\t\t`;\n }\n /**\n * @returns Suffix.\n */\n getSuffix() {\n if (!this.suffix) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t event.key === 'Enter' && this.click()}\"\n\t\t\t\t@click=\"${() => this.onClick()}\"\n\t\t\t\t>${this.suffix}\n\t\t\t${this.trailingIcon ? (0, web_component_1.html) `` : null}\n\t\t`;\n }\n /**\n * @returns Suffix.\n */\n getCharacterCount() {\n if (!this.characterCount) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t${this.value.length} / ${this.characterCount}\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n /**\n * @returns Template.\n */\n getHelpContainer() {\n if (!this.helpMessage && !this.characterCount) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${this.getHelpField()}\n\t\t\t\t
    \n\t\t\t\t${this.getCharacterCount()}\n\t\t\t
    \n\t\t`;\n }\n errorMessage() {\n return (0, web_component_1.html) `${this.helpMessage}`;\n }\n infoMessage() {\n return (0, web_component_1.html) `\n\t\t\t${this.helpMessage}\n\t\t`;\n }\n /**\n * @returns Template.\n */\n getHelpField() {\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\t${this.layout === InputLayoutEnum_1.default.error ? this.errorMessage() : null}\n\t\t\t\t${this.layout !== InputLayoutEnum_1.default.error ? this.infoMessage() : null}\n\t\t\t
    \n\t\t`;\n }\n /**\n * @returns Template.\n */\n getLeadingIcon() {\n if (!this.leadingIcon) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t`;\n }\n /**\n * @returns Template.\n */\n getTrailingIcon() {\n if (!this.trailingIcon) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t`;\n }\n /**\n * @returns Template.\n */\n getInputElement() {\n return (0, web_component_1.html) `\n\t\t\t event.preventDefault()}\n\t\t\t\t.value=\"${this.parseValue(this.value)}\"\n\t\t\t\t.selectionStart=\"${this.selectionStart !== null\n ? this.selectionStart\n : this.cursor.selectionStart}\"\n\t\t\t\tid=\"${this.labelId}\"\n\t\t\t\tname=\"${this.inputName}\"\n\t\t\t\tinputmode=${this.inputMode}\n\t\t\t\tautocomplete=\"${this.autocomplete}\"\n\t\t\t\t?autofocus=\"${this.autofocus}\"\n\t\t\t\tspellcheck=\"${this.spellcheck}\"\n\t\t\t\t?disabled=\"${this.disabled}\"\n\t\t\t\t?readonly=\"${this.layout === InputLayoutEnum_1.default.readOnly}\"\n\t\t\t\taria-invalid=\"${this.layout === InputLayoutEnum_1.default.error}\"\n\t\t\t\taria-errormessage=\"${this.layout === InputLayoutEnum_1.default.error ? this.errorId : ''}\"\n\t\t\t\taria-describedby=\"helpMessage\"\n\t\t\t/>\n\t\t`;\n }\n /**\n * @returns Template.\n */\n getLabel() {\n return (0, web_component_1.html) ` `;\n }\n /**\n * HTML event handler.\n */\n onFocusOut() {\n var _a, _b;\n this.keyboardManager.removeFocus();\n this.dispatchEvent(new CustomEvent('focusOut', {\n bubbles: true,\n detail: {\n value: this.value\n }\n }));\n // FIXME\n // Temporary fix - Safari gets really slow when running the code below, so we exclude it for now.\n if (isSafari === false) {\n this.cursor.selectionStart = null;\n this.cursor.selectionEnd = null;\n }\n this.hasFocus = false;\n this.update();\n (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('input')) === null || _b === void 0 ? void 0 : _b.blur();\n }\n /**\n * HTML event handler.\n *\n * @param event\n */\n onFocusIn(event) {\n var _a;\n const srcElement = event.currentTarget;\n this.cursor.selectionStart = srcElement.selectionStart;\n this.cursor.selectionEnd = srcElement.selectionEnd;\n if (this.layout === InputLayoutEnum_1.default.readOnly) {\n return;\n }\n const inputElement = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('input');\n if (inputElement) {\n this.keyboardManager.setFocus(inputElement);\n }\n this.hasFocus = true;\n this.update();\n }\n /**\n * HTML event handler.\n */\n onClick() {\n var _a, _b;\n (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('input')) === null || _b === void 0 ? void 0 : _b.focus();\n }\n /**\n * Runs when input event occurs.\n *\n * @param event HTMLEvent.\n */\n onInput(event) {\n event.stopPropagation();\n event.preventDefault();\n const srcElement = event.currentTarget;\n const newValue = this.parseValue(srcElement.value);\n const eventDetails = {\n data: event.data,\n value: newValue,\n valueAsNumber: this.stringToNumberValue(newValue),\n selectionStart: srcElement.selectionStart,\n selectionEnd: srcElement.selectionEnd\n };\n this.cursor.selectionStart = srcElement.selectionStart;\n this.cursor.selectionEnd = srcElement.selectionEnd;\n // Reset value to make this input stateless\n srcElement.value = this.value;\n this.dispatchEvent(new CustomEvent('input', { bubbles: true, detail: eventDetails }));\n }\n /**\n * Runs when selection changes.\n *\n * @param event HTMLEvent.\n */\n onSelectionChange(event) {\n this.cursor.selectionStart = event.target.selectionStart;\n this.cursor.selectionEnd = event.target.selectionEnd;\n }\n /**\n * Parses an input value based on the InputModeEnum prop.\n *\n * @param value Value from props.\n * @returns Parsed value.\n */\n parseValue(value) {\n if (!value) {\n return '';\n }\n switch (this.inputMode) {\n case keyboard_manager_1.InputModeEnum.tel: {\n return value.replace(/[^-+0-9]/g, '');\n }\n case keyboard_manager_1.InputModeEnum.numeric:\n return value.replace(/[^-0-9]/g, '');\n case keyboard_manager_1.InputModeEnum.decimal:\n return value.replace(/[^-0-9.,]/g, '');\n }\n return value;\n }\n /**\n * Converts string to number if InputModeEnum is number or decimal.\n *\n * @param value String value.\n * @returns Converted value.\n */\n stringToNumberValue(value) {\n switch (this.inputMode) {\n case keyboard_manager_1.InputModeEnum.numeric:\n case keyboard_manager_1.InputModeEnum.decimal:\n return parseFloat(value.replace(/,/g, '.'));\n }\n return null;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Input.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Input.prototype, \"inputMode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Input.prototype, \"layout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Input.prototype, \"autocomplete\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, synchronous: true })\n], Input.prototype, \"value\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Input.prototype, \"autofocus\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Input.prototype, \"disabled\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Input.prototype, \"spellcheck\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Input.prototype, \"label\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Input.prototype, \"helpMessage\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Input.prototype, \"prefix\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Input.prototype, \"suffix\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], Input.prototype, \"characterCount\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Input.prototype, \"trailingIcon\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Input.prototype, \"leadingIcon\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number, synchronous: true })\n], Input.prototype, \"selectionStart\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number, synchronous: true })\n], Input.prototype, \"selectionEnd\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Input.prototype, \"type\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Input.prototype, \"inputName\", void 0);\nInput = __decorate([\n (0, web_component_1.customElement)('kompis-input')\n], Input);\nexports.default = Input;\n//# sourceMappingURL=Input.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InputTypeEnum = exports.InputStyle = exports.InputLayoutEnum = exports.Input = void 0;\nconst Input_1 = __importDefault(require(\"./components/input/Input\"));\nexports.Input = Input_1.default;\nconst InputStyle_1 = __importDefault(require(\"./components/input/InputStyle\"));\nexports.InputStyle = InputStyle_1.default;\nconst InputLayoutEnum_1 = __importDefault(require(\"./enums/InputLayoutEnum\"));\nexports.InputLayoutEnum = InputLayoutEnum_1.default;\nconst InputTypeEnum_1 = __importDefault(require(\"./enums/InputTypeEnum\"));\nexports.InputTypeEnum = InputTypeEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SendByEmailStateEnum;\n(function (SendByEmailStateEnum) {\n SendByEmailStateEnum[\"default\"] = \"default\";\n SendByEmailStateEnum[\"loading\"] = \"loading\";\n SendByEmailStateEnum[\"success\"] = \"success\";\n SendByEmailStateEnum[\"failed\"] = \"failed\";\n})(SendByEmailStateEnum || (SendByEmailStateEnum = {}));\nexports.default = SendByEmailStateEnum;\n//# sourceMappingURL=SendByEmailStateEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\n/**\n * A class with style.\n */\nclass SendByEmailStyle {\n /**\n * Returns styles.\n *\n * @param options The props.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing, color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: flex-start;\n\t\t\t}\n\n\t\t\tkompis-input {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-self: stretch;\n\t\t\t\tmargin-bottom: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\tkompis-text {\n\t\t\t\tcolor: ${color.neutral.grey700};\n\t\t\t}\n\n\t\t\tskapa-inline-message {\n\t\t\t\tmargin-top: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.message {\n\t\t\t\tdisplay: block;\n\t\t\t\tmargin-top: ${spacing.space50 / 16}rem;\n\t\t\t\tfont-size: 0;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = SendByEmailStyle;\n//# sourceMappingURL=SendByEmailStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst enums_2 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_input_1 = require(\"@inter-ikea-kompis/component-input\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@inter-ikea-kompis/component-input\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@inter-ikea-kompis/component-input\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/inline-message-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/icon-store/warning-triangle\");\nrequire(\"@ingka/icon-store/checkmark-circle\");\nconst SendByEmailStateEnum_1 = __importDefault(require(\"../../enums/SendByEmailStateEnum\"));\nconst SendByEmailStyle_1 = __importDefault(require(\"./SendByEmailStyle\"));\n/* eslint-disable no-control-regex */\nconst EMAIL_REGEXP = /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])/;\n/* eslint-enable no-control-regex */\n/**\n * @event input Emitted when user write a character in the input field\n * @event validation Show error message or not depending on valid input\n * @event send Click on send button\n * @event reset Sent after 3 seconds after state success.\n */\nlet SendByEmail = class SendByEmail extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Valid states can be found in SendByEmailState\n this.state = SendByEmailStateEnum_1.default.default;\n // Valid input in input field\n this.invalidInput = false;\n // Enable to allow autocompletion in the browser. Note that it should be disabled in Kiosks due to privacy policies, as it can otherwise store user data.\n this.autocomplete = false;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // Email\n this.value = null;\n this.selectionStart = 0;\n this.selectionEnd = 0;\n this.timeout = null;\n this.dexfSettings = null;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n // We want translations and settings to be required, but since the props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    ${this.getInput()} ${this.getButton()}
    \n\t\t\t${this.getMessage()}\n\t\t`;\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n if (this.timeout) {\n clearTimeout(this.timeout);\n }\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n if (changedProperties.has('state')) {\n if (this.state === SendByEmailStateEnum_1.default.success) {\n if (this.timeout) {\n clearTimeout(this.timeout);\n }\n this.timeout = setTimeout(() => this.dispatchEvent(new CustomEvent('reset', { bubbles: true })), 3000);\n }\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n getSettings() {\n return this.dexfSettings;\n }\n /**\n * Get HTML for input.\n *\n * @returns Template.\n */\n getInput() {\n const translations = this.getTranslations();\n return (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n }\n /**\n * Message to the user.\n *\n * @returns Template.\n */\n getMessage() {\n return (0, web_component_1.html) `${this.getInlineMessage()} ${this.getDisclaimer()}`;\n }\n getInlineMessage() {\n return (0, web_component_1.html) `
    ${this.getSuccessMessage()}
    \n\t\t\t
    ${this.getFailedMessage()}
    `;\n }\n getSuccessMessage() {\n if (this.state !== SendByEmailStateEnum_1.default.success) {\n return null;\n }\n const positiveVariant = 'positive';\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getTranslations().emailSuccessMessage}\n\t\t`;\n }\n getFailedMessage() {\n if (this.state !== SendByEmailStateEnum_1.default.failed) {\n return null;\n }\n const cautionaryVariant = 'cautionary';\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getTranslations().ikeaGenericErrorTryAgain}\n\t\t`;\n }\n /**\n * Returns the disclaimer.\n *\n * @returns Template.\n */\n getDisclaimer() {\n const translations = this.getTranslations();\n const urls = this.getSettings().kompis.urls;\n if (!translations.privacyPolicy || !translations.privacyPolicyNoLinks) {\n return null;\n }\n if (this.disableLinks) {\n return (0, web_component_1.html) `\n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t\t\t${translations.privacyPolicyNoLinks}\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t${urls.privacyPolicyLink.replace('http://', '').replace('https://', '')}\n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t`;\n }\n const links = this.getSplitPrivacyPolicyString(translations.privacyPolicy);\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${links.map((text, index) => {\n if (index === links.length - 1) {\n return (0, web_component_1.html) `\n\t\t\t\t\t\t\t${text}\n\t\t\t\t\t\t`;\n }\n return (0, web_component_1.html) `\n\t\t\t\t\t\t${text}\n\t\t\t\t\t\t${this.getPrivacyPolicyLink()}\n\t\t\t\t\t`;\n })}\n\t\t\t
    \n\t\t`;\n }\n getSplitPrivacyPolicyString(text) {\n if (text.includes('{{')) {\n return text.split('{{privacy_policy_link}}');\n }\n else {\n return text.split('[[privacy_policy_link]]');\n }\n }\n /**\n * Returns the privacy policy link.\n *\n * @returns Template.\n */\n getPrivacyPolicyLink() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n /**\n * Get HTML for button.\n *\n * @returns Template.\n */\n getButton() {\n const primaryVariant = 'primary';\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${this.getTranslations().buttonSend}\n\t\t\t\n\t\t`;\n }\n /**\n * Event for focusOut.\n *\n * @param event Input event.\n */\n onFocusOut(event) {\n const { value } = event.detail;\n if (!this.validateInput(value)) {\n if (value.length < 1) {\n this.dispatchValidationEvent({ invalidInput: false });\n }\n else {\n this.dispatchValidationEvent({ invalidInput: true });\n }\n }\n }\n /**\n * On enter key pressed event.\n *\n * @param event Event.\n */\n onKeyPress(event) {\n if (event.key === 'Enter' && this.validateInput(this.value) && !this.invalidInput) {\n this.onSendClick();\n }\n else if (event.key === 'Enter' && !this.validateInput(this.value) && !this.invalidInput) {\n this.dispatchValidationEvent({ invalidInput: true });\n }\n }\n /**\n * Event for onInput.\n *\n * @param event Event.\n */\n onInput(event) {\n this.selectionStart = event.detail.selectionStart;\n this.selectionEnd = event.detail.selectionEnd;\n this.dispatchEvent(new CustomEvent('input', { bubbles: true, detail: { value: event.detail.value } }));\n if (this.invalidInput && this.validateInput(event.detail.value)) {\n this.dispatchValidationEvent({ invalidInput: false });\n }\n }\n /**\n * Click event for button and sends email.\n */\n onSendClick() {\n if (this.invalidInput || !this.validateInput(this.value)) {\n this.dispatchValidationEvent({ invalidInput: true, includeInputElement: true });\n }\n else {\n this.dispatchEvent(new CustomEvent('send', {\n bubbles: true,\n detail: {\n value: this.value\n }\n }));\n }\n }\n /**\n * @param object\n * @param object.invalidInput Whether the input is invalid or not.\n * @param object.includeInputElement Whether the input element should be included in the event detail.\n */\n dispatchValidationEvent({ invalidInput, includeInputElement = false }) {\n var _a, _b;\n const inputElement = includeInputElement\n ? (_b = (_a = this.shadowRoot.querySelector('kompis-input')) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('input')\n : undefined;\n this.dispatchEvent(new CustomEvent('validation', {\n bubbles: true,\n detail: {\n invalidInput,\n inputElement\n }\n }));\n }\n /**\n * Returns wether the value matches input mode pattern.\n *\n * @param value Input value.\n * @returns Is valid value.\n */\n validateInput(value) {\n if (!this.value) {\n return false;\n }\n return EMAIL_REGEXP.test(value || '');\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SendByEmail.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SendByEmail.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SendByEmail.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SendByEmail.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SendByEmail.prototype, \"state\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SendByEmail.prototype, \"invalidInput\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SendByEmail.prototype, \"autocomplete\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SendByEmail.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, synchronous: true })\n], SendByEmail.prototype, \"value\", void 0);\nSendByEmail = __decorate([\n (0, web_component_1.customElement)('kompis-send-by-email')\n], SendByEmail);\nexports.default = SendByEmail;\n//# sourceMappingURL=SendByEmail.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SendByEmailStateEnum = exports.SendByEmail = void 0;\nconst SendByEmail_1 = __importDefault(require(\"./components/send-by-email/SendByEmail\"));\nexports.SendByEmail = SendByEmail_1.default;\nconst SendByEmailStateEnum_1 = __importDefault(require(\"./enums/SendByEmailStateEnum\"));\nexports.SendByEmailStateEnum = SendByEmailStateEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.PLUS_CHARS = exports.VALID_PUNCTUATION = exports.WHITESPACE = exports.VALID_DIGITS = exports.MAX_LENGTH_COUNTRY_CODE = exports.MAX_LENGTH_FOR_NSN = exports.MIN_LENGTH_FOR_NSN = void 0;\n// The minimum length of the national significant number.\nvar MIN_LENGTH_FOR_NSN = 2; // The ITU says the maximum length should be 15,\n// but one can find longer numbers in Germany.\n\nexports.MIN_LENGTH_FOR_NSN = MIN_LENGTH_FOR_NSN;\nvar MAX_LENGTH_FOR_NSN = 17; // The maximum length of the country calling code.\n\nexports.MAX_LENGTH_FOR_NSN = MAX_LENGTH_FOR_NSN;\nvar MAX_LENGTH_COUNTRY_CODE = 3; // Digits accepted in phone numbers\n// (ascii, fullwidth, arabic-indic, and eastern arabic digits).\n\nexports.MAX_LENGTH_COUNTRY_CODE = MAX_LENGTH_COUNTRY_CODE;\nvar VALID_DIGITS = \"0-9\\uFF10-\\uFF19\\u0660-\\u0669\\u06F0-\\u06F9\"; // `DASHES` will be right after the opening square bracket of the \"character class\"\n\nexports.VALID_DIGITS = VALID_DIGITS;\nvar DASHES = \"-\\u2010-\\u2015\\u2212\\u30FC\\uFF0D\";\nvar SLASHES = \"\\uFF0F/\";\nvar DOTS = \"\\uFF0E.\";\nvar WHITESPACE = \" \\xA0\\xAD\\u200B\\u2060\\u3000\";\nexports.WHITESPACE = WHITESPACE;\nvar BRACKETS = \"()\\uFF08\\uFF09\\uFF3B\\uFF3D\\\\[\\\\]\"; // export const OPENING_BRACKETS = '(\\uFF08\\uFF3B\\\\\\['\n\nvar TILDES = \"~\\u2053\\u223C\\uFF5E\"; // Regular expression of acceptable punctuation found in phone numbers. This\n// excludes punctuation found as a leading character only. This consists of dash\n// characters, white space characters, full stops, slashes, square brackets,\n// parentheses and tildes. Full-width variants are also present.\n\nvar VALID_PUNCTUATION = \"\".concat(DASHES).concat(SLASHES).concat(DOTS).concat(WHITESPACE).concat(BRACKETS).concat(TILDES);\nexports.VALID_PUNCTUATION = VALID_PUNCTUATION;\nvar PLUS_CHARS = \"+\\uFF0B\"; // const LEADING_PLUS_CHARS_PATTERN = new RegExp('^[' + PLUS_CHARS + ']+')\n\nexports.PLUS_CHARS = PLUS_CHARS;\n//# sourceMappingURL=constants.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// https://stackoverflow.com/a/46971044/970769\nvar ParseError = function ParseError(code) {\n _classCallCheck(this, ParseError);\n\n this.name = this.constructor.name;\n this.message = code;\n this.stack = new Error(code).stack;\n};\n\nexports[\"default\"] = ParseError;\nParseError.prototype = Object.create(Error.prototype);\nParseError.prototype.constructor = ParseError;\n//# sourceMappingURL=ParseError.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = _default;\n\n// Copy-pasted from:\n// https://github.com/substack/semver-compare/blob/master/index.js\n//\n// Inlining this function because some users reported issues with\n// importing from `semver-compare` in a browser with ES6 \"native\" modules.\n//\n// Fixes `semver-compare` not being able to compare versions with alpha/beta/etc \"tags\".\n// https://github.com/catamphetamine/libphonenumber-js/issues/381\nfunction _default(a, b) {\n a = a.split('-');\n b = b.split('-');\n var pa = a[0].split('.');\n var pb = b[0].split('.');\n\n for (var i = 0; i < 3; i++) {\n var na = Number(pa[i]);\n var nb = Number(pb[i]);\n if (na > nb) return 1;\n if (nb > na) return -1;\n if (!isNaN(na) && isNaN(nb)) return 1;\n if (isNaN(na) && !isNaN(nb)) return -1;\n }\n\n if (a[1] && b[1]) {\n return a[1] > b[1] ? 1 : a[1] < b[1] ? -1 : 0;\n }\n\n return !a[1] && b[1] ? 1 : a[1] && !b[1] ? -1 : 0;\n}\n//# sourceMappingURL=semver-compare.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.validateMetadata = validateMetadata;\nexports.getExtPrefix = getExtPrefix;\nexports.getCountryCallingCode = getCountryCallingCode;\nexports.isSupportedCountry = isSupportedCountry;\nexports[\"default\"] = void 0;\n\nvar _semverCompare = _interopRequireDefault(require(\"./tools/semver-compare\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// Added \"possibleLengths\" and renamed\n// \"country_phone_code_to_countries\" to \"country_calling_codes\".\nvar V2 = '1.0.18'; // Added \"idd_prefix\" and \"default_idd_prefix\".\n\nvar V3 = '1.2.0'; // Moved `001` country code to \"nonGeographic\" section of metadata.\n\nvar V4 = '1.7.35';\nvar DEFAULT_EXT_PREFIX = ' ext. ';\nvar CALLING_CODE_REG_EXP = /^\\d+$/;\n/**\r\n * See: https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/METADATA.md\r\n */\n\nvar Metadata =\n/*#__PURE__*/\nfunction () {\n function Metadata(metadata) {\n _classCallCheck(this, Metadata);\n\n validateMetadata(metadata);\n this.metadata = metadata;\n setVersion.call(this, metadata);\n }\n\n _createClass(Metadata, [{\n key: \"getCountries\",\n value: function getCountries() {\n return Object.keys(this.metadata.countries).filter(function (_) {\n return _ !== '001';\n });\n }\n }, {\n key: \"getCountryMetadata\",\n value: function getCountryMetadata(countryCode) {\n return this.metadata.countries[countryCode];\n }\n }, {\n key: \"nonGeographic\",\n value: function nonGeographic() {\n if (this.v1 || this.v2 || this.v3) return; // `nonGeographical` was a typo.\n // It's present in metadata generated from `1.7.35` to `1.7.37`.\n\n return this.metadata.nonGeographic || this.metadata.nonGeographical;\n }\n }, {\n key: \"hasCountry\",\n value: function hasCountry(country) {\n return this.getCountryMetadata(country) !== undefined;\n }\n }, {\n key: \"hasCallingCode\",\n value: function hasCallingCode(callingCode) {\n if (this.getCountryCodesForCallingCode(callingCode)) {\n return true;\n }\n\n if (this.nonGeographic()) {\n if (this.nonGeographic()[callingCode]) {\n return true;\n }\n } else {\n // A hacky workaround for old custom metadata (generated before V4).\n var countryCodes = this.countryCallingCodes()[callingCode];\n\n if (countryCodes && countryCodes.length === 1 && countryCodes[0] === '001') {\n return true;\n }\n }\n }\n }, {\n key: \"isNonGeographicCallingCode\",\n value: function isNonGeographicCallingCode(callingCode) {\n if (this.nonGeographic()) {\n return this.nonGeographic()[callingCode] ? true : false;\n } else {\n return this.getCountryCodesForCallingCode(callingCode) ? false : true;\n }\n } // Deprecated.\n\n }, {\n key: \"country\",\n value: function country(countryCode) {\n return this.selectNumberingPlan(countryCode);\n }\n }, {\n key: \"selectNumberingPlan\",\n value: function selectNumberingPlan(countryCode, callingCode) {\n // Supports just passing `callingCode` as the first argument.\n if (countryCode && CALLING_CODE_REG_EXP.test(countryCode)) {\n callingCode = countryCode;\n countryCode = null;\n }\n\n if (countryCode && countryCode !== '001') {\n if (!this.hasCountry(countryCode)) {\n throw new Error(\"Unknown country: \".concat(countryCode));\n }\n\n this.numberingPlan = new NumberingPlan(this.getCountryMetadata(countryCode), this);\n } else if (callingCode) {\n if (!this.hasCallingCode(callingCode)) {\n throw new Error(\"Unknown calling code: \".concat(callingCode));\n }\n\n this.numberingPlan = new NumberingPlan(this.getNumberingPlanMetadata(callingCode), this);\n } else {\n this.numberingPlan = undefined;\n }\n\n return this;\n }\n }, {\n key: \"getCountryCodesForCallingCode\",\n value: function getCountryCodesForCallingCode(callingCode) {\n var countryCodes = this.countryCallingCodes()[callingCode];\n\n if (countryCodes) {\n // Metadata before V4 included \"non-geographic entity\" calling codes\n // inside `country_calling_codes` (for example, `\"881\":[\"001\"]`).\n // Now the semantics of `country_calling_codes` has changed:\n // it's specifically for \"countries\" now.\n // Older versions of custom metadata will simply skip parsing\n // \"non-geographic entity\" phone numbers with new versions\n // of this library: it's not considered a bug,\n // because such numbers are extremely rare,\n // and developers extremely rarely use custom metadata.\n if (countryCodes.length === 1 && countryCodes[0].length === 3) {\n return;\n }\n\n return countryCodes;\n }\n }\n }, {\n key: \"getCountryCodeForCallingCode\",\n value: function getCountryCodeForCallingCode(callingCode) {\n var countryCodes = this.getCountryCodesForCallingCode(callingCode);\n\n if (countryCodes) {\n return countryCodes[0];\n }\n }\n }, {\n key: \"getNumberingPlanMetadata\",\n value: function getNumberingPlanMetadata(callingCode) {\n var countryCode = this.getCountryCodeForCallingCode(callingCode);\n\n if (countryCode) {\n return this.getCountryMetadata(countryCode);\n }\n\n if (this.nonGeographic()) {\n var metadata = this.nonGeographic()[callingCode];\n\n if (metadata) {\n return metadata;\n }\n } else {\n // A hacky workaround for old custom metadata (generated before V4).\n var countryCodes = this.countryCallingCodes()[callingCode];\n\n if (countryCodes && countryCodes.length === 1 && countryCodes[0] === '001') {\n return this.metadata.countries['001'];\n }\n }\n } // Deprecated.\n\n }, {\n key: \"countryCallingCode\",\n value: function countryCallingCode() {\n return this.numberingPlan.callingCode();\n } // Deprecated.\n\n }, {\n key: \"IDDPrefix\",\n value: function IDDPrefix() {\n return this.numberingPlan.IDDPrefix();\n } // Deprecated.\n\n }, {\n key: \"defaultIDDPrefix\",\n value: function defaultIDDPrefix() {\n return this.numberingPlan.defaultIDDPrefix();\n } // Deprecated.\n\n }, {\n key: \"nationalNumberPattern\",\n value: function nationalNumberPattern() {\n return this.numberingPlan.nationalNumberPattern();\n } // Deprecated.\n\n }, {\n key: \"possibleLengths\",\n value: function possibleLengths() {\n return this.numberingPlan.possibleLengths();\n } // Deprecated.\n\n }, {\n key: \"formats\",\n value: function formats() {\n return this.numberingPlan.formats();\n } // Deprecated.\n\n }, {\n key: \"nationalPrefixForParsing\",\n value: function nationalPrefixForParsing() {\n return this.numberingPlan.nationalPrefixForParsing();\n } // Deprecated.\n\n }, {\n key: \"nationalPrefixTransformRule\",\n value: function nationalPrefixTransformRule() {\n return this.numberingPlan.nationalPrefixTransformRule();\n } // Deprecated.\n\n }, {\n key: \"leadingDigits\",\n value: function leadingDigits() {\n return this.numberingPlan.leadingDigits();\n } // Deprecated.\n\n }, {\n key: \"hasTypes\",\n value: function hasTypes() {\n return this.numberingPlan.hasTypes();\n } // Deprecated.\n\n }, {\n key: \"type\",\n value: function type(_type) {\n return this.numberingPlan.type(_type);\n } // Deprecated.\n\n }, {\n key: \"ext\",\n value: function ext() {\n return this.numberingPlan.ext();\n }\n }, {\n key: \"countryCallingCodes\",\n value: function countryCallingCodes() {\n if (this.v1) return this.metadata.country_phone_code_to_countries;\n return this.metadata.country_calling_codes;\n } // Deprecated.\n\n }, {\n key: \"chooseCountryByCountryCallingCode\",\n value: function chooseCountryByCountryCallingCode(callingCode) {\n return this.selectNumberingPlan(callingCode);\n }\n }, {\n key: \"hasSelectedNumberingPlan\",\n value: function hasSelectedNumberingPlan() {\n return this.numberingPlan !== undefined;\n }\n }]);\n\n return Metadata;\n}();\n\nexports[\"default\"] = Metadata;\n\nvar NumberingPlan =\n/*#__PURE__*/\nfunction () {\n function NumberingPlan(metadata, globalMetadataObject) {\n _classCallCheck(this, NumberingPlan);\n\n this.globalMetadataObject = globalMetadataObject;\n this.metadata = metadata;\n setVersion.call(this, globalMetadataObject.metadata);\n }\n\n _createClass(NumberingPlan, [{\n key: \"callingCode\",\n value: function callingCode() {\n return this.metadata[0];\n } // Formatting information for regions which share\n // a country calling code is contained by only one region\n // for performance reasons. For example, for NANPA region\n // (\"North American Numbering Plan Administration\",\n // which includes USA, Canada, Cayman Islands, Bahamas, etc)\n // it will be contained in the metadata for `US`.\n\n }, {\n key: \"getDefaultCountryMetadataForRegion\",\n value: function getDefaultCountryMetadataForRegion() {\n return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode());\n } // Is always present.\n\n }, {\n key: \"IDDPrefix\",\n value: function IDDPrefix() {\n if (this.v1 || this.v2) return;\n return this.metadata[1];\n } // Is only present when a country supports multiple IDD prefixes.\n\n }, {\n key: \"defaultIDDPrefix\",\n value: function defaultIDDPrefix() {\n if (this.v1 || this.v2) return;\n return this.metadata[12];\n }\n }, {\n key: \"nationalNumberPattern\",\n value: function nationalNumberPattern() {\n if (this.v1 || this.v2) return this.metadata[1];\n return this.metadata[2];\n } // Is always present.\n\n }, {\n key: \"possibleLengths\",\n value: function possibleLengths() {\n if (this.v1) return;\n return this.metadata[this.v2 ? 2 : 3];\n }\n }, {\n key: \"_getFormats\",\n value: function _getFormats(metadata) {\n return metadata[this.v1 ? 2 : this.v2 ? 3 : 4];\n } // For countries of the same region (e.g. NANPA)\n // formats are all stored in the \"main\" country for that region.\n // E.g. \"RU\" and \"KZ\", \"US\" and \"CA\".\n\n }, {\n key: \"formats\",\n value: function formats() {\n var _this = this;\n\n var formats = this._getFormats(this.metadata) || this._getFormats(this.getDefaultCountryMetadataForRegion()) || [];\n return formats.map(function (_) {\n return new Format(_, _this);\n });\n }\n }, {\n key: \"nationalPrefix\",\n value: function nationalPrefix() {\n return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5];\n }\n }, {\n key: \"_getNationalPrefixFormattingRule\",\n value: function _getNationalPrefixFormattingRule(metadata) {\n return metadata[this.v1 ? 4 : this.v2 ? 5 : 6];\n } // For countries of the same region (e.g. NANPA)\n // national prefix formatting rule is stored in the \"main\" country for that region.\n // E.g. \"RU\" and \"KZ\", \"US\" and \"CA\".\n\n }, {\n key: \"nationalPrefixFormattingRule\",\n value: function nationalPrefixFormattingRule() {\n return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion());\n }\n }, {\n key: \"_nationalPrefixForParsing\",\n value: function _nationalPrefixForParsing() {\n return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7];\n }\n }, {\n key: \"nationalPrefixForParsing\",\n value: function nationalPrefixForParsing() {\n // If `national_prefix_for_parsing` is not set explicitly,\n // then infer it from `national_prefix` (if any)\n return this._nationalPrefixForParsing() || this.nationalPrefix();\n }\n }, {\n key: \"nationalPrefixTransformRule\",\n value: function nationalPrefixTransformRule() {\n return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8];\n }\n }, {\n key: \"_getNationalPrefixIsOptionalWhenFormatting\",\n value: function _getNationalPrefixIsOptionalWhenFormatting() {\n return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9];\n } // For countries of the same region (e.g. NANPA)\n // \"national prefix is optional when formatting\" flag is\n // stored in the \"main\" country for that region.\n // E.g. \"RU\" and \"KZ\", \"US\" and \"CA\".\n\n }, {\n key: \"nationalPrefixIsOptionalWhenFormattingInNationalFormat\",\n value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {\n return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion());\n }\n }, {\n key: \"leadingDigits\",\n value: function leadingDigits() {\n return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10];\n }\n }, {\n key: \"types\",\n value: function types() {\n return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11];\n }\n }, {\n key: \"hasTypes\",\n value: function hasTypes() {\n // Versions 1.2.0 - 1.2.4: can be `[]`.\n\n /* istanbul ignore next */\n if (this.types() && this.types().length === 0) {\n return false;\n } // Versions <= 1.2.4: can be `undefined`.\n // Version >= 1.2.5: can be `0`.\n\n\n return !!this.types();\n }\n }, {\n key: \"type\",\n value: function type(_type2) {\n if (this.hasTypes() && getType(this.types(), _type2)) {\n return new Type(getType(this.types(), _type2), this);\n }\n }\n }, {\n key: \"ext\",\n value: function ext() {\n if (this.v1 || this.v2) return DEFAULT_EXT_PREFIX;\n return this.metadata[13] || DEFAULT_EXT_PREFIX;\n }\n }]);\n\n return NumberingPlan;\n}();\n\nvar Format =\n/*#__PURE__*/\nfunction () {\n function Format(format, metadata) {\n _classCallCheck(this, Format);\n\n this._format = format;\n this.metadata = metadata;\n }\n\n _createClass(Format, [{\n key: \"pattern\",\n value: function pattern() {\n return this._format[0];\n }\n }, {\n key: \"format\",\n value: function format() {\n return this._format[1];\n }\n }, {\n key: \"leadingDigitsPatterns\",\n value: function leadingDigitsPatterns() {\n return this._format[2] || [];\n }\n }, {\n key: \"nationalPrefixFormattingRule\",\n value: function nationalPrefixFormattingRule() {\n return this._format[3] || this.metadata.nationalPrefixFormattingRule();\n }\n }, {\n key: \"nationalPrefixIsOptionalWhenFormattingInNationalFormat\",\n value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {\n return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat();\n }\n }, {\n key: \"nationalPrefixIsMandatoryWhenFormattingInNationalFormat\",\n value: function nationalPrefixIsMandatoryWhenFormattingInNationalFormat() {\n // National prefix is omitted if there's no national prefix formatting rule\n // set for this country, or when the national prefix formatting rule\n // contains no national prefix itself, or when this rule is set but\n // national prefix is optional for this phone number format\n // (and it is not enforced explicitly)\n return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat();\n } // Checks whether national prefix formatting rule contains national prefix.\n\n }, {\n key: \"usesNationalPrefix\",\n value: function usesNationalPrefix() {\n return this.nationalPrefixFormattingRule() && // Check that national prefix formatting rule is not a \"dummy\" one.\n !FIRST_GROUP_ONLY_PREFIX_PATTERN.test(this.nationalPrefixFormattingRule()) // In compressed metadata, `this.nationalPrefixFormattingRule()` is `0`\n // when `national_prefix_formatting_rule` is not present.\n // So, `true` or `false` are returned explicitly here, so that\n // `0` number isn't returned.\n ? true : false;\n }\n }, {\n key: \"internationalFormat\",\n value: function internationalFormat() {\n return this._format[5] || this.format();\n }\n }]);\n\n return Format;\n}();\n/**\r\n * A pattern that is used to determine if the national prefix formatting rule\r\n * has the first group only, i.e., does not start with the national prefix.\r\n * Note that the pattern explicitly allows for unbalanced parentheses.\r\n */\n\n\nvar FIRST_GROUP_ONLY_PREFIX_PATTERN = /^\\(?\\$1\\)?$/;\n\nvar Type =\n/*#__PURE__*/\nfunction () {\n function Type(type, metadata) {\n _classCallCheck(this, Type);\n\n this.type = type;\n this.metadata = metadata;\n }\n\n _createClass(Type, [{\n key: \"pattern\",\n value: function pattern() {\n if (this.metadata.v1) return this.type;\n return this.type[0];\n }\n }, {\n key: \"possibleLengths\",\n value: function possibleLengths() {\n if (this.metadata.v1) return;\n return this.type[1] || this.metadata.possibleLengths();\n }\n }]);\n\n return Type;\n}();\n\nfunction getType(types, type) {\n switch (type) {\n case 'FIXED_LINE':\n return types[0];\n\n case 'MOBILE':\n return types[1];\n\n case 'TOLL_FREE':\n return types[2];\n\n case 'PREMIUM_RATE':\n return types[3];\n\n case 'PERSONAL_NUMBER':\n return types[4];\n\n case 'VOICEMAIL':\n return types[5];\n\n case 'UAN':\n return types[6];\n\n case 'PAGER':\n return types[7];\n\n case 'VOIP':\n return types[8];\n\n case 'SHARED_COST':\n return types[9];\n }\n}\n\nfunction validateMetadata(metadata) {\n if (!metadata) {\n throw new Error('[libphonenumber-js] `metadata` argument not passed. Check your arguments.');\n } // `country_phone_code_to_countries` was renamed to\n // `country_calling_codes` in `1.0.18`.\n\n\n if (!is_object(metadata) || !is_object(metadata.countries)) {\n throw new Error(\"[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got \".concat(is_object(metadata) ? 'an object of shape: { ' + Object.keys(metadata).join(', ') + ' }' : 'a ' + type_of(metadata) + ': ' + metadata, \".\"));\n }\n} // Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n\n/* istanbul ignore next */\n\n\nvar is_object = function is_object(_) {\n return _typeof(_) === 'object';\n}; // Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n\n/* istanbul ignore next */\n\n\nvar type_of = function type_of(_) {\n return _typeof(_);\n};\n/**\r\n * Returns extension prefix for a country.\r\n * @param {string} country\r\n * @param {object} metadata\r\n * @return {string?}\r\n * @example\r\n * // Returns \" ext. \"\r\n * getExtPrefix(\"US\")\r\n */\n\n\nfunction getExtPrefix(country, metadata) {\n metadata = new Metadata(metadata);\n\n if (metadata.hasCountry(country)) {\n return metadata.country(country).ext();\n }\n\n return DEFAULT_EXT_PREFIX;\n}\n/**\r\n * Returns \"country calling code\" for a country.\r\n * Throws an error if the country doesn't exist or isn't supported by this library.\r\n * @param {string} country\r\n * @param {object} metadata\r\n * @return {string}\r\n * @example\r\n * // Returns \"44\"\r\n * getCountryCallingCode(\"GB\")\r\n */\n\n\nfunction getCountryCallingCode(country, metadata) {\n metadata = new Metadata(metadata);\n\n if (metadata.hasCountry(country)) {\n return metadata.country(country).countryCallingCode();\n }\n\n throw new Error(\"Unknown country: \".concat(country));\n}\n\nfunction isSupportedCountry(country, metadata) {\n // metadata = new Metadata(metadata)\n // return metadata.hasCountry(country)\n return metadata.countries[country] !== undefined;\n}\n\nfunction setVersion(metadata) {\n var version = metadata.version;\n\n if (typeof version === 'number') {\n this.v1 = version === 1;\n this.v2 = version === 2;\n this.v3 = version === 3;\n this.v4 = version === 4;\n } else {\n if (!version) {\n this.v1 = true;\n } else if ((0, _semverCompare[\"default\"])(version, V3) === -1) {\n this.v2 = true;\n } else if ((0, _semverCompare[\"default\"])(version, V4) === -1) {\n this.v3 = true;\n } else {\n this.v4 = true;\n }\n }\n} // const ISO_COUNTRY_CODE = /^[A-Z]{2}$/\n// function isCountryCode(countryCode) {\n// \treturn ISO_COUNTRY_CODE.test(countryCodeOrCountryCallingCode)\n// }\n//# sourceMappingURL=metadata.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = createExtensionPattern;\n\nvar _constants = require(\"../../constants\");\n\n// The RFC 3966 format for extensions.\nvar RFC3966_EXTN_PREFIX = ';ext=';\n/**\r\n * Helper method for constructing regular expressions for parsing. Creates\r\n * an expression that captures up to max_length digits.\r\n * @return {string} RegEx pattern to capture extension digits.\r\n */\n\nvar getExtensionDigitsPattern = function getExtensionDigitsPattern(maxLength) {\n return \"([\".concat(_constants.VALID_DIGITS, \"]{1,\").concat(maxLength, \"})\");\n};\n/**\r\n * Helper initialiser method to create the regular-expression pattern to match\r\n * extensions.\r\n * Copy-pasted from Google's `libphonenumber`:\r\n * https://github.com/google/libphonenumber/blob/55b2646ec9393f4d3d6661b9c82ef9e258e8b829/javascript/i18n/phonenumbers/phonenumberutil.js#L759-L766\r\n * @return {string} RegEx pattern to capture extensions.\r\n */\n\n\nfunction createExtensionPattern(purpose) {\n // We cap the maximum length of an extension based on the ambiguity of the way\n // the extension is prefixed. As per ITU, the officially allowed length for\n // extensions is actually 40, but we don't support this since we haven't seen real\n // examples and this introduces many false interpretations as the extension labels\n // are not standardized.\n\n /** @type {string} */\n var extLimitAfterExplicitLabel = '20';\n /** @type {string} */\n\n var extLimitAfterLikelyLabel = '15';\n /** @type {string} */\n\n var extLimitAfterAmbiguousChar = '9';\n /** @type {string} */\n\n var extLimitWhenNotSure = '6';\n /** @type {string} */\n\n var possibleSeparatorsBetweenNumberAndExtLabel = \"[ \\xA0\\\\t,]*\"; // Optional full stop (.) or colon, followed by zero or more spaces/tabs/commas.\n\n /** @type {string} */\n\n var possibleCharsAfterExtLabel = \"[:\\\\.\\uFF0E]?[ \\xA0\\\\t,-]*\";\n /** @type {string} */\n\n var optionalExtnSuffix = \"#?\"; // Here the extension is called out in more explicit way, i.e mentioning it obvious\n // patterns like \"ext.\".\n\n /** @type {string} */\n\n var explicitExtLabels = \"(?:e?xt(?:ensi(?:o\\u0301?|\\xF3))?n?|\\uFF45?\\uFF58\\uFF54\\uFF4E?|\\u0434\\u043E\\u0431|anexo)\"; // One-character symbols that can be used to indicate an extension, and less\n // commonly used or more ambiguous extension labels.\n\n /** @type {string} */\n\n var ambiguousExtLabels = \"(?:[x\\uFF58#\\uFF03~\\uFF5E]|int|\\uFF49\\uFF4E\\uFF54)\"; // When extension is not separated clearly.\n\n /** @type {string} */\n\n var ambiguousSeparator = \"[- ]+\"; // This is the same as possibleSeparatorsBetweenNumberAndExtLabel, but not matching\n // comma as extension label may have it.\n\n /** @type {string} */\n\n var possibleSeparatorsNumberExtLabelNoComma = \"[ \\xA0\\\\t]*\"; // \",,\" is commonly used for auto dialling the extension when connected. First\n // comma is matched through possibleSeparatorsBetweenNumberAndExtLabel, so we do\n // not repeat it here. Semi-colon works in Iphone and Android also to pop up a\n // button with the extension number following.\n\n /** @type {string} */\n\n var autoDiallingAndExtLabelsFound = \"(?:,{2}|;)\";\n /** @type {string} */\n\n var rfcExtn = RFC3966_EXTN_PREFIX + getExtensionDigitsPattern(extLimitAfterExplicitLabel);\n /** @type {string} */\n\n var explicitExtn = possibleSeparatorsBetweenNumberAndExtLabel + explicitExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterExplicitLabel) + optionalExtnSuffix;\n /** @type {string} */\n\n var ambiguousExtn = possibleSeparatorsBetweenNumberAndExtLabel + ambiguousExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;\n /** @type {string} */\n\n var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + \"#\";\n /** @type {string} */\n\n var autoDiallingExtn = possibleSeparatorsNumberExtLabelNoComma + autoDiallingAndExtLabelsFound + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterLikelyLabel) + optionalExtnSuffix;\n /** @type {string} */\n\n var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + \"(?:,)+\" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix; // The first regular expression covers RFC 3966 format, where the extension is added\n // using \";ext=\". The second more generic where extension is mentioned with explicit\n // labels like \"ext:\". In both the above cases we allow more numbers in extension than\n // any other extension labels. The third one captures when single character extension\n // labels or less commonly used labels are used. In such cases we capture fewer\n // extension digits in order to reduce the chance of falsely interpreting two\n // numbers beside each other as a number + extension. The fourth one covers the\n // special case of American numbers where the extension is written with a hash\n // at the end, such as \"- 503#\". The fifth one is exclusively for extension\n // autodialling formats which are used when dialling and in this case we accept longer\n // extensions. The last one is more liberal on the number of commas that acts as\n // extension labels, so we have a strict cap on the number of digits in such extensions.\n\n return rfcExtn + \"|\" + explicitExtn + \"|\" + ambiguousExtn + \"|\" + americanStyleExtnWithSuffix + \"|\" + autoDiallingExtn + \"|\" + onlyCommasExtn;\n}\n//# sourceMappingURL=createExtensionPattern.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = isViablePhoneNumber;\nexports.isViablePhoneNumberStart = isViablePhoneNumberStart;\nexports.VALID_PHONE_NUMBER_WITH_EXTENSION = exports.VALID_PHONE_NUMBER = void 0;\n\nvar _constants = require(\"../constants\");\n\nvar _createExtensionPattern = _interopRequireDefault(require(\"./extension/createExtensionPattern\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n// Regular expression of viable phone numbers. This is location independent.\n// Checks we have at least three leading digits, and only valid punctuation,\n// alpha characters and digits in the phone number. Does not include extension\n// data. The symbol 'x' is allowed here as valid punctuation since it is often\n// used as a placeholder for carrier codes, for example in Brazilian phone\n// numbers. We also allow multiple '+' characters at the start.\n//\n// Corresponds to the following:\n// [digits]{minLengthNsn}|\n// plus_sign*\n// (([punctuation]|[star])*[digits]){3,}([punctuation]|[star]|[digits]|[alpha])*\n//\n// The first reg-ex is to allow short numbers (two digits long) to be parsed if\n// they are entered as \"15\" etc, but only if there is no punctuation in them.\n// The second expression restricts the number of digits to three or more, but\n// then allows them to be in international form, and to have alpha-characters\n// and punctuation. We split up the two reg-exes here and combine them when\n// creating the reg-ex VALID_PHONE_NUMBER_PATTERN itself so we can prefix it\n// with ^ and append $ to each branch.\n//\n// \"Note VALID_PUNCTUATION starts with a -,\n// so must be the first in the range\" (c) Google devs.\n// (wtf did they mean by saying that; probably nothing)\n//\nvar MIN_LENGTH_PHONE_NUMBER_PATTERN = '[' + _constants.VALID_DIGITS + ']{' + _constants.MIN_LENGTH_FOR_NSN + '}'; //\n// And this is the second reg-exp:\n// (see MIN_LENGTH_PHONE_NUMBER_PATTERN for a full description of this reg-exp)\n//\n\nvar VALID_PHONE_NUMBER = '[' + _constants.PLUS_CHARS + ']{0,1}' + '(?:' + '[' + _constants.VALID_PUNCTUATION + ']*' + '[' + _constants.VALID_DIGITS + ']' + '){3,}' + '[' + _constants.VALID_PUNCTUATION + _constants.VALID_DIGITS + ']*'; // This regular expression isn't present in Google's `libphonenumber`\n// and is only used to determine whether the phone number being input\n// is too short for it to even consider it a \"valid\" number.\n// This is just a way to differentiate between a really invalid phone\n// number like \"abcde\" and a valid phone number that a user has just\n// started inputting, like \"+1\" or \"1\": both these cases would be\n// considered `NOT_A_NUMBER` by Google's `libphonenumber`, but this\n// library can provide a more detailed error message — whether it's\n// really \"not a number\", or is it just a start of a valid phone number.\n\nexports.VALID_PHONE_NUMBER = VALID_PHONE_NUMBER;\nvar VALID_PHONE_NUMBER_START_REG_EXP = new RegExp('^' + '[' + _constants.PLUS_CHARS + ']{0,1}' + '(?:' + '[' + _constants.VALID_PUNCTUATION + ']*' + '[' + _constants.VALID_DIGITS + ']' + '){1,2}' + '$', 'i');\nvar VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER + // Phone number extensions\n'(?:' + (0, _createExtensionPattern[\"default\"])() + ')?'; // The combined regular expression for valid phone numbers:\n//\n\nexports.VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER_WITH_EXTENSION;\nvar VALID_PHONE_NUMBER_PATTERN = new RegExp( // Either a short two-digit-only phone number\n'^' + MIN_LENGTH_PHONE_NUMBER_PATTERN + '$' + '|' + // Or a longer fully parsed phone number (min 3 characters)\n'^' + VALID_PHONE_NUMBER_WITH_EXTENSION + '$', 'i'); // Checks to see if the string of characters could possibly be a phone number at\n// all. At the moment, checks to see that the string begins with at least 2\n// digits, ignoring any punctuation commonly found in phone numbers. This method\n// does not require the number to be normalized in advance - but does assume\n// that leading non-number symbols have been removed, such as by the method\n// `extract_possible_number`.\n//\n\nfunction isViablePhoneNumber(number) {\n return number.length >= _constants.MIN_LENGTH_FOR_NSN && VALID_PHONE_NUMBER_PATTERN.test(number);\n} // This is just a way to differentiate between a really invalid phone\n// number like \"abcde\" and a valid phone number that a user has just\n// started inputting, like \"+1\" or \"1\": both these cases would be\n// considered `NOT_A_NUMBER` by Google's `libphonenumber`, but this\n// library can provide a more detailed error message — whether it's\n// really \"not a number\", or is it just a start of a valid phone number.\n\n\nfunction isViablePhoneNumberStart(number) {\n return VALID_PHONE_NUMBER_START_REG_EXP.test(number);\n}\n//# sourceMappingURL=isViablePhoneNumber.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = extractExtension;\n\nvar _createExtensionPattern = _interopRequireDefault(require(\"./createExtensionPattern\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n// Regexp of all known extension prefixes used by different regions followed by\n// 1 or more valid digits, for use when parsing.\nvar EXTN_PATTERN = new RegExp('(?:' + (0, _createExtensionPattern[\"default\"])() + ')$', 'i'); // Strips any extension (as in, the part of the number dialled after the call is\n// connected, usually indicated with extn, ext, x or similar) from the end of\n// the number, and returns it.\n\nfunction extractExtension(number) {\n var start = number.search(EXTN_PATTERN);\n\n if (start < 0) {\n return {};\n } // If we find a potential extension, and the number preceding this is a viable\n // number, we assume it is an extension.\n\n\n var numberWithoutExtension = number.slice(0, start);\n var matches = number.match(EXTN_PATTERN);\n var i = 1;\n\n while (i < matches.length) {\n if (matches[i]) {\n return {\n number: numberWithoutExtension,\n ext: matches[i]\n };\n }\n\n i++;\n }\n}\n//# sourceMappingURL=extractExtension.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.parseDigit = parseDigit;\nexports[\"default\"] = parseDigits;\nexports.DIGITS = void 0;\n// These mappings map a character (key) to a specific digit that should\n// replace it for normalization purposes. Non-European digits that\n// may be used in phone numbers are mapped to a European equivalent.\n//\n// E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.\n//\nvar DIGITS = {\n '0': '0',\n '1': '1',\n '2': '2',\n '3': '3',\n '4': '4',\n '5': '5',\n '6': '6',\n '7': '7',\n '8': '8',\n '9': '9',\n \"\\uFF10\": '0',\n // Fullwidth digit 0\n \"\\uFF11\": '1',\n // Fullwidth digit 1\n \"\\uFF12\": '2',\n // Fullwidth digit 2\n \"\\uFF13\": '3',\n // Fullwidth digit 3\n \"\\uFF14\": '4',\n // Fullwidth digit 4\n \"\\uFF15\": '5',\n // Fullwidth digit 5\n \"\\uFF16\": '6',\n // Fullwidth digit 6\n \"\\uFF17\": '7',\n // Fullwidth digit 7\n \"\\uFF18\": '8',\n // Fullwidth digit 8\n \"\\uFF19\": '9',\n // Fullwidth digit 9\n \"\\u0660\": '0',\n // Arabic-indic digit 0\n \"\\u0661\": '1',\n // Arabic-indic digit 1\n \"\\u0662\": '2',\n // Arabic-indic digit 2\n \"\\u0663\": '3',\n // Arabic-indic digit 3\n \"\\u0664\": '4',\n // Arabic-indic digit 4\n \"\\u0665\": '5',\n // Arabic-indic digit 5\n \"\\u0666\": '6',\n // Arabic-indic digit 6\n \"\\u0667\": '7',\n // Arabic-indic digit 7\n \"\\u0668\": '8',\n // Arabic-indic digit 8\n \"\\u0669\": '9',\n // Arabic-indic digit 9\n \"\\u06F0\": '0',\n // Eastern-Arabic digit 0\n \"\\u06F1\": '1',\n // Eastern-Arabic digit 1\n \"\\u06F2\": '2',\n // Eastern-Arabic digit 2\n \"\\u06F3\": '3',\n // Eastern-Arabic digit 3\n \"\\u06F4\": '4',\n // Eastern-Arabic digit 4\n \"\\u06F5\": '5',\n // Eastern-Arabic digit 5\n \"\\u06F6\": '6',\n // Eastern-Arabic digit 6\n \"\\u06F7\": '7',\n // Eastern-Arabic digit 7\n \"\\u06F8\": '8',\n // Eastern-Arabic digit 8\n \"\\u06F9\": '9' // Eastern-Arabic digit 9\n\n};\nexports.DIGITS = DIGITS;\n\nfunction parseDigit(character) {\n return DIGITS[character];\n}\n/**\r\n * Parses phone number digits from a string.\r\n * Drops all punctuation leaving only digits.\r\n * Also converts wide-ascii and arabic-indic numerals to conventional numerals.\r\n * E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.\r\n * @param {string} string\r\n * @return {string}\r\n * @example\r\n * ```js\r\n * parseDigits('8 (800) 555')\r\n * // Outputs '8800555'.\r\n * ```\r\n */\n\n\nfunction parseDigits(string) {\n var result = ''; // Using `.split('')` here instead of normal `for ... of`\n // because the importing application doesn't neccessarily include an ES6 polyfill.\n // The `.split('')` approach discards \"exotic\" UTF-8 characters\n // (the ones consisting of four bytes) but digits\n // (including non-European ones) don't fall into that range\n // so such \"exotic\" characters would be discarded anyway.\n\n for (var _iterator = string.split(''), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var character = _ref;\n var digit = parseDigit(character);\n\n if (digit) {\n result += digit;\n }\n }\n\n return result;\n}\n//# sourceMappingURL=parseDigits.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = parseIncompletePhoneNumber;\nexports.parsePhoneNumberCharacter = parsePhoneNumberCharacter;\n\nvar _parseDigits = require(\"./helpers/parseDigits\");\n\n/**\r\n * Parses phone number characters from a string.\r\n * Drops all punctuation leaving only digits and the leading `+` sign (if any).\r\n * Also converts wide-ascii and arabic-indic numerals to conventional numerals.\r\n * E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.\r\n * @param {string} string\r\n * @return {string}\r\n * @example\r\n * ```js\r\n * // Outputs '8800555'.\r\n * parseIncompletePhoneNumber('8 (800) 555')\r\n * // Outputs '+7800555'.\r\n * parseIncompletePhoneNumber('+7 800 555')\r\n * ```\r\n */\nfunction parseIncompletePhoneNumber(string) {\n var result = ''; // Using `.split('')` here instead of normal `for ... of`\n // because the importing application doesn't neccessarily include an ES6 polyfill.\n // The `.split('')` approach discards \"exotic\" UTF-8 characters\n // (the ones consisting of four bytes) but digits\n // (including non-European ones) don't fall into that range\n // so such \"exotic\" characters would be discarded anyway.\n\n for (var _iterator = string.split(''), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var character = _ref;\n result += parsePhoneNumberCharacter(character, result) || '';\n }\n\n return result;\n}\n/**\r\n * Parses next character while parsing phone number digits (including a `+`)\r\n * from text: discards everything except `+` and digits, and `+` is only allowed\r\n * at the start of a phone number.\r\n * For example, is used in `react-phone-number-input` where it uses\r\n * [`input-format`](https://gitlab.com/catamphetamine/input-format).\r\n * @param {string} character - Yet another character from raw input string.\r\n * @param {string?} prevParsedCharacters - Previous parsed characters.\r\n * @param {object} meta - Optional custom use-case-specific metadata.\r\n * @return {string?} The parsed character.\r\n */\n\n\nfunction parsePhoneNumberCharacter(character, prevParsedCharacters) {\n // Only allow a leading `+`.\n if (character === '+') {\n // If this `+` is not the first parsed character\n // then discard it.\n if (prevParsedCharacters) {\n return;\n }\n\n return '+';\n } // Allow digits.\n\n\n return (0, _parseDigits.parseDigit)(character);\n}\n//# sourceMappingURL=parseIncompletePhoneNumber.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function get() {\n return _metadata.getCountryCallingCode;\n }\n});\n\nvar _metadata = require(\"./metadata\");\n//# sourceMappingURL=getCountryCallingCode.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = mergeArrays;\n\n/**\r\n * Merges two arrays.\r\n * @param {*} a\r\n * @param {*} b\r\n * @return {*}\r\n */\nfunction mergeArrays(a, b) {\n var merged = a.slice();\n\n for (var _iterator = b, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var element = _ref;\n\n if (a.indexOf(element) < 0) {\n merged.push(element);\n }\n }\n\n return merged.sort(function (a, b) {\n return a - b;\n }); // ES6 version, requires Set polyfill.\n // let merged = new Set(a)\n // for (const element of b) {\n // \tmerged.add(i)\n // }\n // return Array.from(merged).sort((a, b) => a - b)\n}\n//# sourceMappingURL=mergeArrays.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = checkNumberLength;\nexports.checkNumberLengthForType = checkNumberLengthForType;\n\nvar _mergeArrays = _interopRequireDefault(require(\"./mergeArrays\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction checkNumberLength(nationalNumber, metadata) {\n return checkNumberLengthForType(nationalNumber, undefined, metadata);\n} // Checks whether a number is possible for the country based on its length.\n// Should only be called for the \"new\" metadata which has \"possible lengths\".\n\n\nfunction checkNumberLengthForType(nationalNumber, type, metadata) {\n var type_info = metadata.type(type); // There should always be \"\" set for every type element.\n // This is declared in the XML schema.\n // For size efficiency, where a sub-description (e.g. fixed-line)\n // has the same \"\" as the \"general description\", this is missing,\n // so we fall back to the \"general description\". Where no numbers of the type\n // exist at all, there is one possible length (-1) which is guaranteed\n // not to match the length of any real phone number.\n\n var possible_lengths = type_info && type_info.possibleLengths() || metadata.possibleLengths(); // let local_lengths = type_info && type.possibleLengthsLocal() || metadata.possibleLengthsLocal()\n // Metadata before version `1.0.18` didn't contain `possible_lengths`.\n\n if (!possible_lengths) {\n return 'IS_POSSIBLE';\n }\n\n if (type === 'FIXED_LINE_OR_MOBILE') {\n // No such country in metadata.\n\n /* istanbul ignore next */\n if (!metadata.type('FIXED_LINE')) {\n // The rare case has been encountered where no fixedLine data is available\n // (true for some non-geographic entities), so we just check mobile.\n return checkNumberLengthForType(nationalNumber, 'MOBILE', metadata);\n }\n\n var mobile_type = metadata.type('MOBILE');\n\n if (mobile_type) {\n // Merge the mobile data in if there was any. \"Concat\" creates a new\n // array, it doesn't edit possible_lengths in place, so we don't need a copy.\n // Note that when adding the possible lengths from mobile, we have\n // to again check they aren't empty since if they are this indicates\n // they are the same as the general desc and should be obtained from there.\n possible_lengths = (0, _mergeArrays[\"default\"])(possible_lengths, mobile_type.possibleLengths()); // The current list is sorted; we need to merge in the new list and\n // re-sort (duplicates are okay). Sorting isn't so expensive because\n // the lists are very small.\n // if (local_lengths) {\n // \tlocal_lengths = mergeArrays(local_lengths, mobile_type.possibleLengthsLocal())\n // } else {\n // \tlocal_lengths = mobile_type.possibleLengthsLocal()\n // }\n }\n } // If the type doesn't exist then return 'INVALID_LENGTH'.\n else if (type && !type_info) {\n return 'INVALID_LENGTH';\n }\n\n var actual_length = nationalNumber.length; // In `libphonenumber-js` all \"local-only\" formats are dropped for simplicity.\n // // This is safe because there is never an overlap beween the possible lengths\n // // and the local-only lengths; this is checked at build time.\n // if (local_lengths && local_lengths.indexOf(nationalNumber.length) >= 0)\n // {\n // \treturn 'IS_POSSIBLE_LOCAL_ONLY'\n // }\n\n var minimum_length = possible_lengths[0];\n\n if (minimum_length === actual_length) {\n return 'IS_POSSIBLE';\n }\n\n if (minimum_length > actual_length) {\n return 'TOO_SHORT';\n }\n\n if (possible_lengths[possible_lengths.length - 1] < actual_length) {\n return 'TOO_LONG';\n } // We skip the first element since we've already checked it.\n\n\n return possible_lengths.indexOf(actual_length, 1) >= 0 ? 'IS_POSSIBLE' : 'INVALID_LENGTH';\n}\n//# sourceMappingURL=checkNumberLength.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = isPossiblePhoneNumber;\nexports.isPossibleNumber = isPossibleNumber;\n\nvar _metadata = _interopRequireDefault(require(\"./metadata\"));\n\nvar _checkNumberLength = _interopRequireDefault(require(\"./helpers/checkNumberLength\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction isPossiblePhoneNumber(input, options, metadata) {\n /* istanbul ignore if */\n if (options === undefined) {\n options = {};\n }\n\n metadata = new _metadata[\"default\"](metadata);\n\n if (options.v2) {\n if (!input.countryCallingCode) {\n throw new Error('Invalid phone number object passed');\n }\n\n metadata.selectNumberingPlan(input.countryCallingCode);\n } else {\n if (!input.phone) {\n return false;\n }\n\n if (input.country) {\n if (!metadata.hasCountry(input.country)) {\n throw new Error(\"Unknown country: \".concat(input.country));\n }\n\n metadata.country(input.country);\n } else {\n if (!input.countryCallingCode) {\n throw new Error('Invalid phone number object passed');\n }\n\n metadata.selectNumberingPlan(input.countryCallingCode);\n }\n }\n\n if (metadata.possibleLengths()) {\n return isPossibleNumber(input.phone || input.nationalNumber, metadata);\n } else {\n // There was a bug between `1.7.35` and `1.7.37` where \"possible_lengths\"\n // were missing for \"non-geographical\" numbering plans.\n // Just assume the number is possible in such cases:\n // it's unlikely that anyone generated their custom metadata\n // in that short period of time (one day).\n // This code can be removed in some future major version update.\n if (input.countryCallingCode && metadata.isNonGeographicCallingCode(input.countryCallingCode)) {\n // \"Non-geographic entities\" did't have `possibleLengths`\n // due to a bug in metadata generation process.\n return true;\n } else {\n throw new Error('Missing \"possibleLengths\" in metadata. Perhaps the metadata has been generated before v1.0.18.');\n }\n }\n}\n\nfunction isPossibleNumber(nationalNumber, metadata) {\n //, isInternational) {\n switch ((0, _checkNumberLength[\"default\"])(nationalNumber, metadata)) {\n case 'IS_POSSIBLE':\n return true;\n // This library ignores \"local-only\" phone numbers (for simplicity).\n // See the readme for more info on what are \"local-only\" phone numbers.\n // case 'IS_POSSIBLE_LOCAL_ONLY':\n // \treturn !isInternational\n\n default:\n return false;\n }\n}\n//# sourceMappingURL=isPossibleNumber_.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.parseRFC3966 = parseRFC3966;\nexports.formatRFC3966 = formatRFC3966;\n\nvar _isViablePhoneNumber = _interopRequireDefault(require(\"./isViablePhoneNumber\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n// https://www.ietf.org/rfc/rfc3966.txt\n\n/**\r\n * @param {string} text - Phone URI (RFC 3966).\r\n * @return {object} `{ ?number, ?ext }`.\r\n */\nfunction parseRFC3966(text) {\n var number;\n var ext; // Replace \"tel:\" with \"tel=\" for parsing convenience.\n\n text = text.replace(/^tel:/, 'tel=');\n\n for (var _iterator = text.split(';'), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var part = _ref;\n\n var _part$split = part.split('='),\n _part$split2 = _slicedToArray(_part$split, 2),\n name = _part$split2[0],\n value = _part$split2[1];\n\n switch (name) {\n case 'tel':\n number = value;\n break;\n\n case 'ext':\n ext = value;\n break;\n\n case 'phone-context':\n // Only \"country contexts\" are supported.\n // \"Domain contexts\" are ignored.\n if (value[0] === '+') {\n number = value + number;\n }\n\n break;\n }\n } // If the phone number is not viable, then abort.\n\n\n if (!(0, _isViablePhoneNumber[\"default\"])(number)) {\n return {};\n }\n\n var result = {\n number: number\n };\n\n if (ext) {\n result.ext = ext;\n }\n\n return result;\n}\n/**\r\n * @param {object} - `{ ?number, ?extension }`.\r\n * @return {string} Phone URI (RFC 3966).\r\n */\n\n\nfunction formatRFC3966(_ref2) {\n var number = _ref2.number,\n ext = _ref2.ext;\n\n if (!number) {\n return '';\n }\n\n if (number[0] !== '+') {\n throw new Error(\"\\\"formatRFC3966()\\\" expects \\\"number\\\" to be in E.164 format.\");\n }\n\n return \"tel:\".concat(number).concat(ext ? ';ext=' + ext : '');\n}\n//# sourceMappingURL=RFC3966.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = matchesEntirely;\n\n/**\r\n * Checks whether the entire input sequence can be matched\r\n * against the regular expression.\r\n * @return {boolean}\r\n */\nfunction matchesEntirely(text, regular_expression) {\n // If assigning the `''` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n text = text || '';\n return new RegExp('^(?:' + regular_expression + ')$').test(text);\n}\n//# sourceMappingURL=matchesEntirely.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = getNumberType;\nexports.isNumberTypeEqualTo = isNumberTypeEqualTo;\n\nvar _metadata = _interopRequireDefault(require(\"../metadata\"));\n\nvar _matchesEntirely = _interopRequireDefault(require(\"./matchesEntirely\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nvar NON_FIXED_LINE_PHONE_TYPES = ['MOBILE', 'PREMIUM_RATE', 'TOLL_FREE', 'SHARED_COST', 'VOIP', 'PERSONAL_NUMBER', 'PAGER', 'UAN', 'VOICEMAIL']; // Finds out national phone number type (fixed line, mobile, etc)\n\nfunction getNumberType(input, options, metadata) {\n // If assigning the `{}` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n options = options || {}; // When `parse()` returned `{}`\n // meaning that the phone number is not a valid one.\n\n if (!input.country) {\n return;\n }\n\n metadata = new _metadata[\"default\"](metadata);\n metadata.selectNumberingPlan(input.country, input.countryCallingCode);\n var nationalNumber = options.v2 ? input.nationalNumber : input.phone; // The following is copy-pasted from the original function:\n // https://github.com/googlei18n/libphonenumber/blob/3ea547d4fbaa2d0b67588904dfa5d3f2557c27ff/javascript/i18n/phonenumbers/phonenumberutil.js#L2835\n // Is this national number even valid for this country\n\n if (!(0, _matchesEntirely[\"default\"])(nationalNumber, metadata.nationalNumberPattern())) {\n return;\n } // Is it fixed line number\n\n\n if (isNumberTypeEqualTo(nationalNumber, 'FIXED_LINE', metadata)) {\n // Because duplicate regular expressions are removed\n // to reduce metadata size, if \"mobile\" pattern is \"\"\n // then it means it was removed due to being a duplicate of the fixed-line pattern.\n //\n if (metadata.type('MOBILE') && metadata.type('MOBILE').pattern() === '') {\n return 'FIXED_LINE_OR_MOBILE';\n } // v1 metadata.\n // Legacy.\n // Deprecated.\n\n\n if (!metadata.type('MOBILE')) {\n return 'FIXED_LINE_OR_MOBILE';\n } // Check if the number happens to qualify as both fixed line and mobile.\n // (no such country in the minimal metadata set)\n\n /* istanbul ignore if */\n\n\n if (isNumberTypeEqualTo(nationalNumber, 'MOBILE', metadata)) {\n return 'FIXED_LINE_OR_MOBILE';\n }\n\n return 'FIXED_LINE';\n }\n\n for (var _i = 0, _NON_FIXED_LINE_PHONE = NON_FIXED_LINE_PHONE_TYPES; _i < _NON_FIXED_LINE_PHONE.length; _i++) {\n var type = _NON_FIXED_LINE_PHONE[_i];\n\n if (isNumberTypeEqualTo(nationalNumber, type, metadata)) {\n return type;\n }\n }\n}\n\nfunction isNumberTypeEqualTo(nationalNumber, type, metadata) {\n type = metadata.type(type);\n\n if (!type || !type.pattern()) {\n return false;\n } // Check if any possible number lengths are present;\n // if so, we use them to avoid checking\n // the validation pattern if they don't match.\n // If they are absent, this means they match\n // the general description, which we have\n // already checked before a specific number type.\n\n\n if (type.possibleLengths() && type.possibleLengths().indexOf(nationalNumber.length) < 0) {\n return false;\n }\n\n return (0, _matchesEntirely[\"default\"])(nationalNumber, type.pattern());\n}\n//# sourceMappingURL=getNumberType.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = isValidNumber;\n\nvar _metadata = _interopRequireDefault(require(\"./metadata\"));\n\nvar _matchesEntirely = _interopRequireDefault(require(\"./helpers/matchesEntirely\"));\n\nvar _getNumberType = _interopRequireDefault(require(\"./helpers/getNumberType\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n/**\r\n * Checks if a given phone number is valid.\r\n *\r\n * If the `number` is a string, it will be parsed to an object,\r\n * but only if it contains only valid phone number characters (including punctuation).\r\n * If the `number` is an object, it is used as is.\r\n *\r\n * The optional `defaultCountry` argument is the default country.\r\n * I.e. it does not restrict to just that country,\r\n * e.g. in those cases where several countries share\r\n * the same phone numbering rules (NANPA, Britain, etc).\r\n * For example, even though the number `07624 369230`\r\n * belongs to the Isle of Man (\"IM\" country code)\r\n * calling `isValidNumber('07624369230', 'GB', metadata)`\r\n * still returns `true` because the country is not restricted to `GB`,\r\n * it's just that `GB` is the default one for the phone numbering rules.\r\n * For restricting the country see `isValidNumberForRegion()`\r\n * though restricting a country might not be a good idea.\r\n * https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#when-should-i-use-isvalidnumberforregion\r\n *\r\n * Examples:\r\n *\r\n * ```js\r\n * isValidNumber('+78005553535', metadata)\r\n * isValidNumber('8005553535', 'RU', metadata)\r\n * isValidNumber('88005553535', 'RU', metadata)\r\n * isValidNumber({ phone: '8005553535', country: 'RU' }, metadata)\r\n * ```\r\n */\nfunction isValidNumber(input, options, metadata) {\n // If assigning the `{}` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n options = options || {};\n metadata = new _metadata[\"default\"](metadata); // This is just to support `isValidNumber({})`\n // for cases when `parseNumber()` returns `{}`.\n\n if (!input.country) {\n return false;\n }\n\n metadata.selectNumberingPlan(input.country, input.countryCallingCode); // By default, countries only have type regexps when it's required for\n // distinguishing different countries having the same `countryCallingCode`.\n\n if (metadata.hasTypes()) {\n return (0, _getNumberType[\"default\"])(input, options, metadata.metadata) !== undefined;\n } // If there are no type regexps for this country in metadata then use\n // `nationalNumberPattern` as a \"better than nothing\" replacement.\n\n\n var national_number = options.v2 ? input.nationalNumber : input.phone;\n return (0, _matchesEntirely[\"default\"])(national_number, metadata.nationalNumberPattern());\n}\n//# sourceMappingURL=validate_.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = isValidNumberForRegion;\n\nvar _validate_ = _interopRequireDefault(require(\"./validate_\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n/**\r\n * Checks if a given phone number is valid within a given region.\r\n * Is just an alias for `phoneNumber.isValid() && phoneNumber.country === country`.\r\n * https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#when-should-i-use-isvalidnumberforregion\r\n */\nfunction isValidNumberForRegion(input, country, options, metadata) {\n // If assigning the `{}` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n options = options || {};\n return input.country === country && (0, _validate_[\"default\"])(input, options, metadata);\n}\n//# sourceMappingURL=isValidNumberForRegion_.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = applyInternationalSeparatorStyle;\n\nvar _constants = require(\"../constants\");\n\n// Removes brackets and replaces dashes with spaces.\n//\n// E.g. \"(999) 111-22-33\" -> \"999 111 22 33\"\n//\n// For some reason Google's metadata contains ``s with brackets and dashes.\n// Meanwhile, there's no single opinion about using punctuation in international phone numbers.\n//\n// For example, Google's `` for USA is `+1 213-373-4253`.\n// And here's a quote from WikiPedia's \"North American Numbering Plan\" page:\n// https://en.wikipedia.org/wiki/North_American_Numbering_Plan\n//\n// \"The country calling code for all countries participating in the NANP is 1.\n// In international format, an NANP number should be listed as +1 301 555 01 00,\n// where 301 is an area code (Maryland).\"\n//\n// I personally prefer the international format without any punctuation.\n// For example, brackets are remnants of the old age, meaning that the\n// phone number part in brackets (so called \"area code\") can be omitted\n// if dialing within the same \"area\".\n// And hyphens were clearly introduced for splitting local numbers into memorizable groups.\n// For example, remembering \"5553535\" is difficult but \"555-35-35\" is much simpler.\n// Imagine a man taking a bus from home to work and seeing an ad with a phone number.\n// He has a couple of seconds to memorize that number until it passes by.\n// If it were spaces instead of hyphens the man wouldn't necessarily get it,\n// but with hyphens instead of spaces the grouping is more explicit.\n// I personally think that hyphens introduce visual clutter,\n// so I prefer replacing them with spaces in international numbers.\n// In the modern age all output is done on displays where spaces are clearly distinguishable\n// so hyphens can be safely replaced with spaces without losing any legibility.\n//\nfunction applyInternationalSeparatorStyle(formattedNumber) {\n return formattedNumber.replace(new RegExp(\"[\".concat(_constants.VALID_PUNCTUATION, \"]+\"), 'g'), ' ').trim();\n}\n//# sourceMappingURL=applyInternationalSeparatorStyle.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = formatNationalNumberUsingFormat;\nexports.FIRST_GROUP_PATTERN = void 0;\n\nvar _applyInternationalSeparatorStyle = _interopRequireDefault(require(\"./applyInternationalSeparatorStyle\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n// This was originally set to $1 but there are some countries for which the\n// first group is not used in the national pattern (e.g. Argentina) so the $1\n// group does not match correctly. Therefore, we use `\\d`, so that the first\n// group actually used in the pattern will be matched.\nvar FIRST_GROUP_PATTERN = /(\\$\\d)/;\nexports.FIRST_GROUP_PATTERN = FIRST_GROUP_PATTERN;\n\nfunction formatNationalNumberUsingFormat(number, format, _ref) {\n var useInternationalFormat = _ref.useInternationalFormat,\n withNationalPrefix = _ref.withNationalPrefix,\n carrierCode = _ref.carrierCode,\n metadata = _ref.metadata;\n var formattedNumber = number.replace(new RegExp(format.pattern()), useInternationalFormat ? format.internationalFormat() : // This library doesn't use `domestic_carrier_code_formatting_rule`,\n // because that one is only used when formatting phone numbers\n // for dialing from a mobile phone, and this is not a dialing library.\n // carrierCode && format.domesticCarrierCodeFormattingRule()\n // \t// First, replace the $CC in the formatting rule with the desired carrier code.\n // \t// Then, replace the $FG in the formatting rule with the first group\n // \t// and the carrier code combined in the appropriate way.\n // \t? format.format().replace(FIRST_GROUP_PATTERN, format.domesticCarrierCodeFormattingRule().replace('$CC', carrierCode))\n // \t: (\n // \t\twithNationalPrefix && format.nationalPrefixFormattingRule()\n // \t\t\t? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule())\n // \t\t\t: format.format()\n // \t)\n withNationalPrefix && format.nationalPrefixFormattingRule() ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()) : format.format());\n\n if (useInternationalFormat) {\n return (0, _applyInternationalSeparatorStyle[\"default\"])(formattedNumber);\n }\n\n return formattedNumber;\n}\n//# sourceMappingURL=formatNationalNumberUsingFormat.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = getIddPrefix;\n\nvar _metadata = _interopRequireDefault(require(\"../metadata\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n/**\r\n * Pattern that makes it easy to distinguish whether a region has a single\r\n * international dialing prefix or not. If a region has a single international\r\n * prefix (e.g. 011 in USA), it will be represented as a string that contains\r\n * a sequence of ASCII digits, and possibly a tilde, which signals waiting for\r\n * the tone. If there are multiple available international prefixes in a\r\n * region, they will be represented as a regex string that always contains one\r\n * or more characters that are not ASCII digits or a tilde.\r\n */\nvar SINGLE_IDD_PREFIX_REG_EXP = /^[\\d]+(?:[~\\u2053\\u223C\\uFF5E][\\d]+)?$/; // For regions that have multiple IDD prefixes\n// a preferred IDD prefix is returned.\n\nfunction getIddPrefix(country, callingCode, metadata) {\n var countryMetadata = new _metadata[\"default\"](metadata);\n countryMetadata.selectNumberingPlan(country, callingCode);\n\n if (countryMetadata.defaultIDDPrefix()) {\n return countryMetadata.defaultIDDPrefix();\n }\n\n if (SINGLE_IDD_PREFIX_REG_EXP.test(countryMetadata.IDDPrefix())) {\n return countryMetadata.IDDPrefix();\n }\n}\n//# sourceMappingURL=getIddPrefix.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = formatNumber;\n\nvar _matchesEntirely = _interopRequireDefault(require(\"./helpers/matchesEntirely\"));\n\nvar _formatNationalNumberUsingFormat = _interopRequireDefault(require(\"./helpers/formatNationalNumberUsingFormat\"));\n\nvar _metadata = _interopRequireWildcard(require(\"./metadata\"));\n\nvar _getIddPrefix = _interopRequireDefault(require(\"./helpers/getIddPrefix\"));\n\nvar _RFC = require(\"./helpers/RFC3966\");\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj[\"default\"] = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar DEFAULT_OPTIONS = {\n formatExtension: function formatExtension(formattedNumber, extension, metadata) {\n return \"\".concat(formattedNumber).concat(metadata.ext()).concat(extension);\n } // Formats a phone number\n //\n // Example use cases:\n //\n // ```js\n // formatNumber('8005553535', 'RU', 'INTERNATIONAL')\n // formatNumber('8005553535', 'RU', 'INTERNATIONAL', metadata)\n // formatNumber({ phone: '8005553535', country: 'RU' }, 'INTERNATIONAL')\n // formatNumber({ phone: '8005553535', country: 'RU' }, 'INTERNATIONAL', metadata)\n // formatNumber('+78005553535', 'NATIONAL')\n // formatNumber('+78005553535', 'NATIONAL', metadata)\n // ```\n //\n\n};\n\nfunction formatNumber(input, format, options, metadata) {\n // Apply default options.\n if (options) {\n options = _objectSpread({}, DEFAULT_OPTIONS, options);\n } else {\n options = DEFAULT_OPTIONS;\n }\n\n metadata = new _metadata[\"default\"](metadata);\n\n if (input.country && input.country !== '001') {\n // Validate `input.country`.\n if (!metadata.hasCountry(input.country)) {\n throw new Error(\"Unknown country: \".concat(input.country));\n }\n\n metadata.country(input.country);\n } else if (input.countryCallingCode) {\n metadata.selectNumberingPlan(input.countryCallingCode);\n } else return input.phone || '';\n\n var countryCallingCode = metadata.countryCallingCode();\n var nationalNumber = options.v2 ? input.nationalNumber : input.phone; // This variable should have been declared inside `case`s\n // but Babel has a bug and it says \"duplicate variable declaration\".\n\n var number;\n\n switch (format) {\n case 'NATIONAL':\n // Legacy argument support.\n // (`{ country: ..., phone: '' }`)\n if (!nationalNumber) {\n return '';\n }\n\n number = formatNationalNumber(nationalNumber, input.carrierCode, 'NATIONAL', metadata, options);\n return addExtension(number, input.ext, metadata, options.formatExtension);\n\n case 'INTERNATIONAL':\n // Legacy argument support.\n // (`{ country: ..., phone: '' }`)\n if (!nationalNumber) {\n return \"+\".concat(countryCallingCode);\n }\n\n number = formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata, options);\n number = \"+\".concat(countryCallingCode, \" \").concat(number);\n return addExtension(number, input.ext, metadata, options.formatExtension);\n\n case 'E.164':\n // `E.164` doesn't define \"phone number extensions\".\n return \"+\".concat(countryCallingCode).concat(nationalNumber);\n\n case 'RFC3966':\n return (0, _RFC.formatRFC3966)({\n number: \"+\".concat(countryCallingCode).concat(nationalNumber),\n ext: input.ext\n });\n // For reference, here's Google's IDD formatter:\n // https://github.com/google/libphonenumber/blob/32719cf74e68796788d1ca45abc85dcdc63ba5b9/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L1546\n // Not saying that this IDD formatter replicates it 1:1, but it seems to work.\n // Who would even need to format phone numbers in IDD format anyway?\n\n case 'IDD':\n if (!options.fromCountry) {\n return; // throw new Error('`fromCountry` option not passed for IDD-prefixed formatting.')\n }\n\n var formattedNumber = formatIDD(nationalNumber, input.carrierCode, countryCallingCode, options.fromCountry, metadata);\n return addExtension(formattedNumber, input.ext, metadata, options.formatExtension);\n\n default:\n throw new Error(\"Unknown \\\"format\\\" argument passed to \\\"formatNumber()\\\": \\\"\".concat(format, \"\\\"\"));\n }\n}\n\nfunction formatNationalNumber(number, carrierCode, formatAs, metadata, options) {\n var format = chooseFormatForNumber(metadata.formats(), number);\n\n if (!format) {\n return number;\n }\n\n return (0, _formatNationalNumberUsingFormat[\"default\"])(number, format, {\n useInternationalFormat: formatAs === 'INTERNATIONAL',\n withNationalPrefix: format.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && options && options.nationalPrefix === false ? false : true,\n carrierCode: carrierCode,\n metadata: metadata\n });\n}\n\nfunction chooseFormatForNumber(availableFormats, nationalNnumber) {\n for (var _iterator = availableFormats, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var format = _ref;\n\n // Validate leading digits\n if (format.leadingDigitsPatterns().length > 0) {\n // The last leading_digits_pattern is used here, as it is the most detailed\n var lastLeadingDigitsPattern = format.leadingDigitsPatterns()[format.leadingDigitsPatterns().length - 1]; // If leading digits don't match then move on to the next phone number format\n\n if (nationalNnumber.search(lastLeadingDigitsPattern) !== 0) {\n continue;\n }\n } // Check that the national number matches the phone number format regular expression\n\n\n if ((0, _matchesEntirely[\"default\"])(nationalNnumber, format.pattern())) {\n return format;\n }\n }\n}\n\nfunction addExtension(formattedNumber, ext, metadata, formatExtension) {\n return ext ? formatExtension(formattedNumber, ext, metadata) : formattedNumber;\n}\n\nfunction formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry, metadata) {\n var fromCountryCallingCode = (0, _metadata.getCountryCallingCode)(fromCountry, metadata.metadata); // When calling within the same country calling code.\n\n if (fromCountryCallingCode === countryCallingCode) {\n var formattedNumber = formatNationalNumber(nationalNumber, carrierCode, 'NATIONAL', metadata); // For NANPA regions, return the national format for these regions\n // but prefix it with the country calling code.\n\n if (countryCallingCode === '1') {\n return countryCallingCode + ' ' + formattedNumber;\n } // If regions share a country calling code, the country calling code need\n // not be dialled. This also applies when dialling within a region, so this\n // if clause covers both these cases. Technically this is the case for\n // dialling from La Reunion to other overseas departments of France (French\n // Guiana, Martinique, Guadeloupe), but not vice versa - so we don't cover\n // this edge case for now and for those cases return the version including\n // country calling code. Details here:\n // http://www.petitfute.com/voyage/225-info-pratiques-reunion\n //\n\n\n return formattedNumber;\n }\n\n var iddPrefix = (0, _getIddPrefix[\"default\"])(fromCountry, undefined, metadata.metadata);\n\n if (iddPrefix) {\n return \"\".concat(iddPrefix, \" \").concat(countryCallingCode, \" \").concat(formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata));\n }\n}\n//# sourceMappingURL=format_.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _metadata2 = _interopRequireDefault(require(\"./metadata\"));\n\nvar _isPossibleNumber_ = _interopRequireDefault(require(\"./isPossibleNumber_\"));\n\nvar _validate_ = _interopRequireDefault(require(\"./validate_\"));\n\nvar _isValidNumberForRegion_ = _interopRequireDefault(require(\"./isValidNumberForRegion_\"));\n\nvar _getNumberType = _interopRequireDefault(require(\"./helpers/getNumberType\"));\n\nvar _format_ = _interopRequireDefault(require(\"./format_\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;\n\nvar PhoneNumber =\n/*#__PURE__*/\nfunction () {\n function PhoneNumber(countryCallingCode, nationalNumber, metadata) {\n _classCallCheck(this, PhoneNumber);\n\n if (!countryCallingCode) {\n throw new TypeError('`country` or `countryCallingCode` not passed');\n }\n\n if (!nationalNumber) {\n throw new TypeError('`nationalNumber` not passed');\n }\n\n if (!metadata) {\n throw new TypeError('`metadata` not passed');\n }\n\n var _metadata = new _metadata2[\"default\"](metadata); // If country code is passed then derive `countryCallingCode` from it.\n // Also store the country code as `.country`.\n\n\n if (isCountryCode(countryCallingCode)) {\n this.country = countryCallingCode;\n\n _metadata.country(countryCallingCode);\n\n countryCallingCode = _metadata.countryCallingCode();\n } else {\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (_metadata.isNonGeographicCallingCode(countryCallingCode)) {\n this.country = '001';\n }\n }\n }\n\n this.countryCallingCode = countryCallingCode;\n this.nationalNumber = nationalNumber;\n this.number = '+' + this.countryCallingCode + this.nationalNumber;\n this.metadata = metadata;\n }\n\n _createClass(PhoneNumber, [{\n key: \"setExt\",\n value: function setExt(ext) {\n this.ext = ext;\n }\n }, {\n key: \"isPossible\",\n value: function isPossible() {\n return (0, _isPossibleNumber_[\"default\"])(this, {\n v2: true\n }, this.metadata);\n }\n }, {\n key: \"isValid\",\n value: function isValid() {\n return (0, _validate_[\"default\"])(this, {\n v2: true\n }, this.metadata);\n }\n }, {\n key: \"isNonGeographic\",\n value: function isNonGeographic() {\n var metadata = new _metadata2[\"default\"](this.metadata);\n return metadata.isNonGeographicCallingCode(this.countryCallingCode);\n }\n }, {\n key: \"isEqual\",\n value: function isEqual(phoneNumber) {\n return this.number === phoneNumber.number && this.ext === phoneNumber.ext;\n } // // Is just an alias for `this.isValid() && this.country === country`.\n // // https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#when-should-i-use-isvalidnumberforregion\n // isValidForRegion(country) {\n // \treturn isValidNumberForRegion(this, country, { v2: true }, this.metadata)\n // }\n\n }, {\n key: \"getType\",\n value: function getType() {\n return (0, _getNumberType[\"default\"])(this, {\n v2: true\n }, this.metadata);\n }\n }, {\n key: \"format\",\n value: function format(_format, options) {\n return (0, _format_[\"default\"])(this, _format, options ? _objectSpread({}, options, {\n v2: true\n }) : {\n v2: true\n }, this.metadata);\n }\n }, {\n key: \"formatNational\",\n value: function formatNational(options) {\n return this.format('NATIONAL', options);\n }\n }, {\n key: \"formatInternational\",\n value: function formatInternational(options) {\n return this.format('INTERNATIONAL', options);\n }\n }, {\n key: \"getURI\",\n value: function getURI(options) {\n return this.format('RFC3966', options);\n }\n }]);\n\n return PhoneNumber;\n}();\n\nexports[\"default\"] = PhoneNumber;\n\nvar isCountryCode = function isCountryCode(value) {\n return /^[A-Z]{2}$/.test(value);\n};\n//# sourceMappingURL=PhoneNumber.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = stripIddPrefix;\n\nvar _metadata = _interopRequireDefault(require(\"../metadata\"));\n\nvar _constants = require(\"../constants\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nvar CAPTURING_DIGIT_PATTERN = new RegExp('([' + _constants.VALID_DIGITS + '])');\n\nfunction stripIddPrefix(number, country, callingCode, metadata) {\n if (!country) {\n return;\n } // Check if the number is IDD-prefixed.\n\n\n var countryMetadata = new _metadata[\"default\"](metadata);\n countryMetadata.selectNumberingPlan(country, callingCode);\n var IDDPrefixPattern = new RegExp(countryMetadata.IDDPrefix());\n\n if (number.search(IDDPrefixPattern) !== 0) {\n return;\n } // Strip IDD prefix.\n\n\n number = number.slice(number.match(IDDPrefixPattern)[0].length); // If there're any digits after an IDD prefix,\n // then those digits are a country calling code.\n // Since no country code starts with a `0`,\n // the code below validates that the next digit (if present) is not `0`.\n\n var matchedGroups = number.match(CAPTURING_DIGIT_PATTERN);\n\n if (matchedGroups && matchedGroups[1] != null && matchedGroups[1].length > 0) {\n if (matchedGroups[1] === '0') {\n return;\n }\n }\n\n return number;\n}\n//# sourceMappingURL=stripIddPrefix.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = extractNationalNumberFromPossiblyIncompleteNumber;\n\n/**\r\n * Strips any national prefix (such as 0, 1) present in a\r\n * (possibly incomplete) number provided.\r\n * \"Carrier codes\" are only used in Colombia and Brazil,\r\n * and only when dialing within those countries from a mobile phone to a fixed line number.\r\n * Sometimes it won't actually strip national prefix\r\n * and will instead prepend some digits to the `number`:\r\n * for example, when number `2345678` is passed with `VI` country selected,\r\n * it will return `{ number: \"3402345678\" }`, because `340` area code is prepended.\r\n * @param {string} number — National number digits.\r\n * @param {object} metadata — Metadata with country selected.\r\n * @return {object} `{ nationalNumber: string, nationalPrefix: string? carrierCode: string? }`. Even if a national prefix was extracted, it's not necessarily present in the returned object, so don't rely on its presence in the returned object in order to find out whether a national prefix has been extracted or not.\r\n */\nfunction extractNationalNumberFromPossiblyIncompleteNumber(number, metadata) {\n if (number && metadata.numberingPlan.nationalPrefixForParsing()) {\n // See METADATA.md for the description of\n // `national_prefix_for_parsing` and `national_prefix_transform_rule`.\n // Attempt to parse the first digits as a national prefix.\n var prefixPattern = new RegExp('^(?:' + metadata.numberingPlan.nationalPrefixForParsing() + ')');\n var prefixMatch = prefixPattern.exec(number);\n\n if (prefixMatch) {\n var nationalNumber;\n var carrierCode; // https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule\n // If a `national_prefix_for_parsing` has any \"capturing groups\"\n // then it means that the national (significant) number is equal to\n // those \"capturing groups\" transformed via `national_prefix_transform_rule`,\n // and nothing could be said about the actual national prefix:\n // what is it and was it even there.\n // If a `national_prefix_for_parsing` doesn't have any \"capturing groups\",\n // then everything it matches is a national prefix.\n // To determine whether `national_prefix_for_parsing` matched any\n // \"capturing groups\", the value of the result of calling `.exec()`\n // is looked at, and if it has non-undefined values where there're\n // \"capturing groups\" in the regular expression, then it means\n // that \"capturing groups\" have been matched.\n // It's not possible to tell whether there'll be any \"capturing gropus\"\n // before the matching process, because a `national_prefix_for_parsing`\n // could exhibit both behaviors.\n\n var capturedGroupsCount = prefixMatch.length - 1;\n var hasCapturedGroups = capturedGroupsCount > 0 && prefixMatch[capturedGroupsCount];\n\n if (metadata.nationalPrefixTransformRule() && hasCapturedGroups) {\n nationalNumber = number.replace(prefixPattern, metadata.nationalPrefixTransformRule()); // If there's more than one captured group,\n // then carrier code is the second one.\n\n if (capturedGroupsCount > 1) {\n carrierCode = prefixMatch[1];\n }\n } // If there're no \"capturing groups\",\n // or if there're \"capturing groups\" but no\n // `national_prefix_transform_rule`,\n // then just strip the national prefix from the number,\n // and possibly a carrier code.\n // Seems like there could be more.\n else {\n // `prefixBeforeNationalNumber` is the whole substring matched by\n // the `national_prefix_for_parsing` regular expression.\n // There seem to be no guarantees that it's just a national prefix.\n // For example, if there's a carrier code, it's gonna be a\n // part of `prefixBeforeNationalNumber` too.\n var prefixBeforeNationalNumber = prefixMatch[0];\n nationalNumber = number.slice(prefixBeforeNationalNumber.length); // If there's at least one captured group,\n // then carrier code is the first one.\n\n if (hasCapturedGroups) {\n carrierCode = prefixMatch[1];\n }\n } // Tries to guess whether a national prefix was present in the input.\n // This is not something copy-pasted from Google's library:\n // they don't seem to have an equivalent for that.\n // So this isn't an \"officially approved\" way of doing something like that.\n // But since there seems no other existing method, this library uses it.\n\n\n var nationalPrefix;\n\n if (hasCapturedGroups) {\n var possiblePositionOfTheFirstCapturedGroup = number.indexOf(prefixMatch[1]);\n var possibleNationalPrefix = number.slice(0, possiblePositionOfTheFirstCapturedGroup); // Example: an Argentinian (AR) phone number `0111523456789`.\n // `prefixMatch[0]` is `01115`, and `$1` is `11`,\n // and the rest of the phone number is `23456789`.\n // The national number is transformed via `9$1` to `91123456789`.\n // National prefix `0` is detected being present at the start.\n // if (possibleNationalPrefix.indexOf(metadata.numberingPlan.nationalPrefix()) === 0) {\n\n if (possibleNationalPrefix === metadata.numberingPlan.nationalPrefix()) {\n nationalPrefix = metadata.numberingPlan.nationalPrefix();\n }\n } else {\n nationalPrefix = prefixMatch[0];\n }\n\n return {\n nationalNumber: nationalNumber,\n nationalPrefix: nationalPrefix,\n carrierCode: carrierCode\n };\n }\n }\n\n return {\n nationalNumber: number\n };\n}\n//# sourceMappingURL=extractNationalNumberFromPossiblyIncompleteNumber.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = extractNationalNumber;\n\nvar _extractNationalNumberFromPossiblyIncompleteNumber = _interopRequireDefault(require(\"./extractNationalNumberFromPossiblyIncompleteNumber\"));\n\nvar _matchesEntirely = _interopRequireDefault(require(\"./matchesEntirely\"));\n\nvar _checkNumberLength = _interopRequireDefault(require(\"./checkNumberLength\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n/**\r\n * Strips national prefix and carrier code from a complete phone number.\r\n * The difference from the non-\"FromCompleteNumber\" function is that\r\n * it won't extract national prefix if the resultant number is too short\r\n * to be a complete number for the selected phone numbering plan.\r\n * @param {string} number — Complete phone number digits.\r\n * @param {Metadata} metadata — Metadata with a phone numbering plan selected.\r\n * @return {object} `{ nationalNumber: string, carrierCode: string? }`.\r\n */\nfunction extractNationalNumber(number, metadata) {\n // Parsing national prefixes and carrier codes\n // is only required for local phone numbers\n // but some people don't understand that\n // and sometimes write international phone numbers\n // with national prefixes (or maybe even carrier codes).\n // http://ucken.blogspot.ru/2016/03/trunk-prefixes-in-skype4b.html\n // Google's original library forgives such mistakes\n // and so does this library, because it has been requested:\n // https://github.com/catamphetamine/libphonenumber-js/issues/127\n var _extractNationalNumbe = (0, _extractNationalNumberFromPossiblyIncompleteNumber[\"default\"])(number, metadata),\n carrierCode = _extractNationalNumbe.carrierCode,\n nationalNumber = _extractNationalNumbe.nationalNumber;\n\n if (nationalNumber !== number) {\n if (!shouldHaveExtractedNationalPrefix(number, nationalNumber, metadata)) {\n // Don't strip the national prefix.\n return {\n nationalNumber: number\n };\n } // Check the national (significant) number length after extracting national prefix and carrier code.\n // Legacy generated metadata (before `1.0.18`) didn't support the \"possible lengths\" feature.\n\n\n if (metadata.possibleLengths()) {\n // The number remaining after stripping the national prefix and carrier code\n // should be long enough to have a possible length for the country.\n // Otherwise, don't strip the national prefix and carrier code,\n // since the original number could be a valid number.\n // This check has been copy-pasted \"as is\" from Google's original library:\n // https://github.com/google/libphonenumber/blob/876268eb1ad6cdc1b7b5bef17fc5e43052702d57/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L3236-L3250\n // It doesn't check for the \"possibility\" of the original `number`.\n // I guess it's fine not checking that one. It works as is anyway.\n if (!isPossibleIncompleteNationalNumber(nationalNumber, metadata)) {\n // Don't strip the national prefix.\n return {\n nationalNumber: number\n };\n }\n }\n }\n\n return {\n nationalNumber: nationalNumber,\n carrierCode: carrierCode\n };\n} // In some countries, the same digit could be a national prefix\n// or a leading digit of a valid phone number.\n// For example, in Russia, national prefix is `8`,\n// and also `800 555 35 35` is a valid number\n// in which `8` is not a national prefix, but the first digit\n// of a national (significant) number.\n// Same's with Belarus:\n// `82004910060` is a valid national (significant) number,\n// but `2004910060` is not.\n// To support such cases (to prevent the code from always stripping\n// national prefix), a condition is imposed: a national prefix\n// is not extracted when the original number is \"viable\" and the\n// resultant number is not, a \"viable\" national number being the one\n// that matches `national_number_pattern`.\n\n\nfunction shouldHaveExtractedNationalPrefix(nationalNumberBefore, nationalNumberAfter, metadata) {\n // The equivalent in Google's code is:\n // https://github.com/google/libphonenumber/blob/e326fa1fc4283bb05eb35cb3c15c18f98a31af33/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L2969-L3004\n if ((0, _matchesEntirely[\"default\"])(nationalNumberBefore, metadata.nationalNumberPattern()) && !(0, _matchesEntirely[\"default\"])(nationalNumberAfter, metadata.nationalNumberPattern())) {\n return false;\n } // This \"is possible\" national number (length) check has been commented out\n // because it's superceded by the (effectively) same check done in the\n // `extractNationalNumber()` function after it calls `shouldHaveExtractedNationalPrefix()`.\n // In other words, why run the same check twice if it could only be run once.\n // // Check the national (significant) number length after extracting national prefix and carrier code.\n // // Fixes a minor \"weird behavior\" bug: https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/57\n // // (Legacy generated metadata (before `1.0.18`) didn't support the \"possible lengths\" feature).\n // if (metadata.possibleLengths()) {\n // \tif (isPossibleIncompleteNationalNumber(nationalNumberBefore, metadata) &&\n // \t\t!isPossibleIncompleteNationalNumber(nationalNumberAfter, metadata)) {\n // \t\treturn false\n // \t}\n // }\n\n\n return true;\n}\n\nfunction isPossibleIncompleteNationalNumber(nationalNumber, metadata) {\n switch ((0, _checkNumberLength[\"default\"])(nationalNumber, metadata)) {\n case 'TOO_SHORT':\n case 'INVALID_LENGTH':\n // This library ignores \"local-only\" phone numbers (for simplicity).\n // See the readme for more info on what are \"local-only\" phone numbers.\n // case 'IS_POSSIBLE_LOCAL_ONLY':\n return false;\n\n default:\n return true;\n }\n}\n//# sourceMappingURL=extractNationalNumber.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign;\n\nvar _metadata = _interopRequireDefault(require(\"../metadata\"));\n\nvar _matchesEntirely = _interopRequireDefault(require(\"./matchesEntirely\"));\n\nvar _extractNationalNumber = _interopRequireDefault(require(\"./extractNationalNumber\"));\n\nvar _checkNumberLength = _interopRequireDefault(require(\"./checkNumberLength\"));\n\nvar _getCountryCallingCode = _interopRequireDefault(require(\"../getCountryCallingCode\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n/**\r\n * Sometimes some people incorrectly input international phone numbers\r\n * without the leading `+`. This function corrects such input.\r\n * @param {string} number — Phone number digits.\r\n * @param {string?} country\r\n * @param {string?} callingCode\r\n * @param {object} metadata\r\n * @return {object} `{ countryCallingCode: string?, number: string }`.\r\n */\nfunction extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, callingCode, metadata) {\n var countryCallingCode = country ? (0, _getCountryCallingCode[\"default\"])(country, metadata) : callingCode;\n\n if (number.indexOf(countryCallingCode) === 0) {\n metadata = new _metadata[\"default\"](metadata);\n metadata.selectNumberingPlan(country, callingCode);\n var possibleShorterNumber = number.slice(countryCallingCode.length);\n\n var _extractNationalNumbe = (0, _extractNationalNumber[\"default\"])(possibleShorterNumber, metadata),\n possibleShorterNationalNumber = _extractNationalNumbe.nationalNumber;\n\n var _extractNationalNumbe2 = (0, _extractNationalNumber[\"default\"])(number, metadata),\n nationalNumber = _extractNationalNumbe2.nationalNumber; // If the number was not valid before but is valid now,\n // or if it was too long before, we consider the number\n // with the country calling code stripped to be a better result\n // and keep that instead.\n // For example, in Germany (+49), `49` is a valid area code,\n // so if a number starts with `49`, it could be both a valid\n // national German number or an international number without\n // a leading `+`.\n\n\n if (!(0, _matchesEntirely[\"default\"])(nationalNumber, metadata.nationalNumberPattern()) && (0, _matchesEntirely[\"default\"])(possibleShorterNationalNumber, metadata.nationalNumberPattern()) || (0, _checkNumberLength[\"default\"])(nationalNumber, metadata) === 'TOO_LONG') {\n return {\n countryCallingCode: countryCallingCode,\n number: possibleShorterNumber\n };\n }\n }\n\n return {\n number: number\n };\n}\n//# sourceMappingURL=extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = extractCountryCallingCode;\n\nvar _stripIddPrefix = _interopRequireDefault(require(\"./stripIddPrefix\"));\n\nvar _extractCountryCallingCodeFromInternationalNumberWithoutPlusSign = _interopRequireDefault(require(\"./extractCountryCallingCodeFromInternationalNumberWithoutPlusSign\"));\n\nvar _metadata = _interopRequireDefault(require(\"../metadata\"));\n\nvar _constants = require(\"../constants\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n/**\r\n * Converts a phone number digits (possibly with a `+`)\r\n * into a calling code and the rest phone number digits.\r\n * The \"rest phone number digits\" could include\r\n * a national prefix, carrier code, and national\r\n * (significant) number.\r\n * @param {string} number — Phone number digits (possibly with a `+`).\r\n * @param {string} [country] — Default country.\r\n * @param {string} [callingCode] — Default calling code (some phone numbering plans are non-geographic).\r\n * @param {object} metadata\r\n * @return {object} `{ countryCallingCode: string?, number: string }`\r\n * @example\r\n * // Returns `{ countryCallingCode: \"1\", number: \"2133734253\" }`.\r\n * extractCountryCallingCode('2133734253', 'US', null, metadata)\r\n * extractCountryCallingCode('2133734253', null, '1', metadata)\r\n * extractCountryCallingCode('+12133734253', null, null, metadata)\r\n * extractCountryCallingCode('+12133734253', 'RU', null, metadata)\r\n */\nfunction extractCountryCallingCode(number, country, callingCode, metadata) {\n if (!number) {\n return {};\n } // If this is not an international phone number,\n // then either extract an \"IDD\" prefix, or extract a\n // country calling code from a number by autocorrecting it\n // by prepending a leading `+` in cases when it starts\n // with the country calling code.\n // https://wikitravel.org/en/International_dialling_prefix\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n\n\n if (number[0] !== '+') {\n // Convert an \"out-of-country\" dialing phone number\n // to a proper international phone number.\n var numberWithoutIDD = (0, _stripIddPrefix[\"default\"])(number, country, callingCode, metadata); // If an IDD prefix was stripped then\n // convert the number to international one\n // for subsequent parsing.\n\n if (numberWithoutIDD && numberWithoutIDD !== number) {\n number = '+' + numberWithoutIDD;\n } else {\n // Check to see if the number starts with the country calling code\n // for the default country. If so, we remove the country calling code,\n // and do some checks on the validity of the number before and after.\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n if (country || callingCode) {\n var _extractCountryCallin = (0, _extractCountryCallingCodeFromInternationalNumberWithoutPlusSign[\"default\"])(number, country, callingCode, metadata),\n countryCallingCode = _extractCountryCallin.countryCallingCode,\n shorterNumber = _extractCountryCallin.number;\n\n if (countryCallingCode) {\n return {\n countryCallingCode: countryCallingCode,\n number: shorterNumber\n };\n }\n }\n\n return {\n number: number\n };\n }\n } // Fast abortion: country codes do not begin with a '0'\n\n\n if (number[1] === '0') {\n return {};\n }\n\n metadata = new _metadata[\"default\"](metadata); // The thing with country phone codes\n // is that they are orthogonal to each other\n // i.e. there's no such country phone code A\n // for which country phone code B exists\n // where B starts with A.\n // Therefore, while scanning digits,\n // if a valid country code is found,\n // that means that it is the country code.\n //\n\n var i = 2;\n\n while (i - 1 <= _constants.MAX_LENGTH_COUNTRY_CODE && i <= number.length) {\n var _countryCallingCode = number.slice(1, i);\n\n if (metadata.hasCallingCode(_countryCallingCode)) {\n metadata.selectNumberingPlan(_countryCallingCode);\n return {\n countryCallingCode: _countryCallingCode,\n number: number.slice(i)\n };\n }\n\n i++;\n }\n\n return {};\n}\n//# sourceMappingURL=extractCountryCallingCode.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = getCountryByCallingCode;\n\nvar _metadata = _interopRequireDefault(require(\"../metadata\"));\n\nvar _getNumberType = _interopRequireDefault(require(\"./getNumberType\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;\n\nfunction getCountryByCallingCode(callingCode, nationalPhoneNumber, metadata) {\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (metadata.isNonGeographicCallingCode(callingCode)) {\n return '001';\n }\n } // Is always non-empty, because `callingCode` is always valid\n\n\n var possibleCountries = metadata.getCountryCodesForCallingCode(callingCode);\n\n if (!possibleCountries) {\n return;\n } // If there's just one country corresponding to the country code,\n // then just return it, without further phone number digits validation.\n\n\n if (possibleCountries.length === 1) {\n return possibleCountries[0];\n }\n\n return selectCountryFromList(possibleCountries, nationalPhoneNumber, metadata.metadata);\n}\n\nfunction selectCountryFromList(possibleCountries, nationalPhoneNumber, metadata) {\n // Re-create `metadata` because it will be selecting a `country`.\n metadata = new _metadata[\"default\"](metadata);\n\n for (var _iterator = possibleCountries, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var country = _ref;\n metadata.country(country); // Leading digits check would be the simplest and fastest one.\n // Leading digits patterns are only defined for about 20% of all countries.\n // https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/METADATA.md#leading_digits\n // Matching \"leading digits\" is a sufficient but not necessary condition.\n\n if (metadata.leadingDigits()) {\n if (nationalPhoneNumber && nationalPhoneNumber.search(metadata.leadingDigits()) === 0) {\n return country;\n }\n } // Else perform full validation with all of those\n // fixed-line/mobile/etc regular expressions.\n else if ((0, _getNumberType[\"default\"])({\n phone: nationalPhoneNumber,\n country: country\n }, undefined, metadata.metadata)) {\n return country;\n }\n }\n}\n//# sourceMappingURL=getCountryByCallingCode.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = parse;\n\nvar _constants = require(\"./constants\");\n\nvar _ParseError = _interopRequireDefault(require(\"./ParseError\"));\n\nvar _metadata = _interopRequireDefault(require(\"./metadata\"));\n\nvar _isViablePhoneNumber = _interopRequireWildcard(require(\"./helpers/isViablePhoneNumber\"));\n\nvar _extractExtension = _interopRequireDefault(require(\"./helpers/extension/extractExtension\"));\n\nvar _parseIncompletePhoneNumber = _interopRequireDefault(require(\"./parseIncompletePhoneNumber\"));\n\nvar _getCountryCallingCode = _interopRequireDefault(require(\"./getCountryCallingCode\"));\n\nvar _isPossibleNumber_ = require(\"./isPossibleNumber_\");\n\nvar _RFC = require(\"./helpers/RFC3966\");\n\nvar _PhoneNumber = _interopRequireDefault(require(\"./PhoneNumber\"));\n\nvar _matchesEntirely = _interopRequireDefault(require(\"./helpers/matchesEntirely\"));\n\nvar _extractCountryCallingCode = _interopRequireDefault(require(\"./helpers/extractCountryCallingCode\"));\n\nvar _extractCountryCallingCodeFromInternationalNumberWithoutPlusSign = _interopRequireDefault(require(\"./helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign\"));\n\nvar _extractNationalNumber = _interopRequireDefault(require(\"./helpers/extractNationalNumber\"));\n\nvar _stripIddPrefix = _interopRequireDefault(require(\"./helpers/stripIddPrefix\"));\n\nvar _getCountryByCallingCode = _interopRequireDefault(require(\"./helpers/getCountryByCallingCode\"));\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj[\"default\"] = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n// This is a port of Google Android `libphonenumber`'s\n// `phonenumberutil.js` of December 31th, 2018.\n//\n// https://github.com/googlei18n/libphonenumber/commits/master/javascript/i18n/phonenumbers/phonenumberutil.js\n// We don't allow input strings for parsing to be longer than 250 chars.\n// This prevents malicious input from consuming CPU.\nvar MAX_INPUT_STRING_LENGTH = 250; // This consists of the plus symbol, digits, and arabic-indic digits.\n\nvar PHONE_NUMBER_START_PATTERN = new RegExp('[' + _constants.PLUS_CHARS + _constants.VALID_DIGITS + ']'); // Regular expression of trailing characters that we want to remove.\n// A trailing `#` is sometimes used when writing phone numbers with extensions in US.\n// Example: \"+1 (645) 123 1234-910#\" number has extension \"910\".\n\nvar AFTER_PHONE_NUMBER_END_PATTERN = new RegExp('[^' + _constants.VALID_DIGITS + '#' + ']+$');\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false; // Examples:\n//\n// ```js\n// parse('8 (800) 555-35-35', 'RU')\n// parse('8 (800) 555-35-35', 'RU', metadata)\n// parse('8 (800) 555-35-35', { country: { default: 'RU' } })\n// parse('8 (800) 555-35-35', { country: { default: 'RU' } }, metadata)\n// parse('+7 800 555 35 35')\n// parse('+7 800 555 35 35', metadata)\n// ```\n//\n\nfunction parse(text, options, metadata) {\n // If assigning the `{}` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n options = options || {};\n metadata = new _metadata[\"default\"](metadata); // Validate `defaultCountry`.\n\n if (options.defaultCountry && !metadata.hasCountry(options.defaultCountry)) {\n if (options.v2) {\n throw new _ParseError[\"default\"]('INVALID_COUNTRY');\n }\n\n throw new Error(\"Unknown country: \".concat(options.defaultCountry));\n } // Parse the phone number.\n\n\n var _parseInput = parseInput(text, options.v2, options.extract),\n formattedPhoneNumber = _parseInput.number,\n ext = _parseInput.ext,\n error = _parseInput.error; // If the phone number is not viable then return nothing.\n\n\n if (!formattedPhoneNumber) {\n if (options.v2) {\n if (error === 'TOO_SHORT') {\n throw new _ParseError[\"default\"]('TOO_SHORT');\n }\n\n throw new _ParseError[\"default\"]('NOT_A_NUMBER');\n }\n\n return {};\n }\n\n var _parsePhoneNumber = parsePhoneNumber(formattedPhoneNumber, options.defaultCountry, options.defaultCallingCode, metadata),\n country = _parsePhoneNumber.country,\n nationalNumber = _parsePhoneNumber.nationalNumber,\n countryCallingCode = _parsePhoneNumber.countryCallingCode,\n carrierCode = _parsePhoneNumber.carrierCode;\n\n if (!metadata.hasSelectedNumberingPlan()) {\n if (options.v2) {\n throw new _ParseError[\"default\"]('INVALID_COUNTRY');\n }\n\n return {};\n } // Validate national (significant) number length.\n\n\n if (!nationalNumber || nationalNumber.length < _constants.MIN_LENGTH_FOR_NSN) {\n // Won't throw here because the regexp already demands length > 1.\n\n /* istanbul ignore if */\n if (options.v2) {\n throw new _ParseError[\"default\"]('TOO_SHORT');\n } // Google's demo just throws an error in this case.\n\n\n return {};\n } // Validate national (significant) number length.\n //\n // A sidenote:\n //\n // They say that sometimes national (significant) numbers\n // can be longer than `MAX_LENGTH_FOR_NSN` (e.g. in Germany).\n // https://github.com/googlei18n/libphonenumber/blob/7e1748645552da39c4e1ba731e47969d97bdb539/resources/phonenumber.proto#L36\n // Such numbers will just be discarded.\n //\n\n\n if (nationalNumber.length > _constants.MAX_LENGTH_FOR_NSN) {\n if (options.v2) {\n throw new _ParseError[\"default\"]('TOO_LONG');\n } // Google's demo just throws an error in this case.\n\n\n return {};\n }\n\n if (options.v2) {\n var phoneNumber = new _PhoneNumber[\"default\"](countryCallingCode, nationalNumber, metadata.metadata);\n\n if (country) {\n phoneNumber.country = country;\n }\n\n if (carrierCode) {\n phoneNumber.carrierCode = carrierCode;\n }\n\n if (ext) {\n phoneNumber.ext = ext;\n }\n\n return phoneNumber;\n } // Check if national phone number pattern matches the number.\n // National number pattern is different for each country,\n // even for those ones which are part of the \"NANPA\" group.\n\n\n var valid = (options.extended ? metadata.hasSelectedNumberingPlan() : country) ? (0, _matchesEntirely[\"default\"])(nationalNumber, metadata.nationalNumberPattern()) : false;\n\n if (!options.extended) {\n return valid ? result(country, nationalNumber, ext) : {};\n } // isInternational: countryCallingCode !== undefined\n\n\n return {\n country: country,\n countryCallingCode: countryCallingCode,\n carrierCode: carrierCode,\n valid: valid,\n possible: valid ? true : options.extended === true && metadata.possibleLengths() && (0, _isPossibleNumber_.isPossibleNumber)(nationalNumber, metadata) ? true : false,\n phone: nationalNumber,\n ext: ext\n };\n}\n/**\r\n * Extracts a formatted phone number from text.\r\n * Doesn't guarantee that the extracted phone number\r\n * is a valid phone number (for example, doesn't validate its length).\r\n * @param {string} text\r\n * @param {boolean} [extract] — If `false`, then will parse the entire `text` as a phone number.\r\n * @param {boolean} [throwOnError] — By default, it won't throw if the text is too long.\r\n * @return {string}\r\n * @example\r\n * // Returns \"(213) 373-4253\".\r\n * extractFormattedPhoneNumber(\"Call (213) 373-4253 for assistance.\")\r\n */\n\n\nfunction extractFormattedPhoneNumber(text, extract, throwOnError) {\n if (!text) {\n return;\n }\n\n if (text.length > MAX_INPUT_STRING_LENGTH) {\n if (throwOnError) {\n throw new _ParseError[\"default\"]('TOO_LONG');\n }\n\n return;\n }\n\n if (extract === false) {\n return text;\n } // Attempt to extract a possible number from the string passed in\n\n\n var startsAt = text.search(PHONE_NUMBER_START_PATTERN);\n\n if (startsAt < 0) {\n return;\n }\n\n return text // Trim everything to the left of the phone number\n .slice(startsAt) // Remove trailing non-numerical characters\n .replace(AFTER_PHONE_NUMBER_END_PATTERN, '');\n}\n/**\r\n * @param {string} text - Input.\r\n * @param {boolean} v2 - Legacy API functions don't pass `v2: true` flag.\r\n * @param {boolean} [extract] - Whether to extract a phone number from `text`, or attempt to parse the entire text as a phone number.\r\n * @return {object} `{ ?number, ?ext }`.\r\n */\n\n\nfunction parseInput(text, v2, extract) {\n // Parse RFC 3966 phone number URI.\n if (text && text.indexOf('tel:') === 0) {\n return (0, _RFC.parseRFC3966)(text);\n }\n\n var number = extractFormattedPhoneNumber(text, extract, v2); // If the phone number is not viable, then abort.\n\n if (!number) {\n return {};\n }\n\n if (!(0, _isViablePhoneNumber[\"default\"])(number)) {\n if ((0, _isViablePhoneNumber.isViablePhoneNumberStart)(number)) {\n return {\n error: 'TOO_SHORT'\n };\n }\n\n return {};\n } // Attempt to parse extension first, since it doesn't require region-specific\n // data and we want to have the non-normalised number here.\n\n\n var withExtensionStripped = (0, _extractExtension[\"default\"])(number);\n\n if (withExtensionStripped.ext) {\n return withExtensionStripped;\n }\n\n return {\n number: number\n };\n}\n/**\r\n * Creates `parse()` result object.\r\n */\n\n\nfunction result(country, nationalNumber, ext) {\n var result = {\n country: country,\n phone: nationalNumber\n };\n\n if (ext) {\n result.ext = ext;\n }\n\n return result;\n}\n/**\r\n * Parses a viable phone number.\r\n * @param {string} formattedPhoneNumber — Example: \"(213) 373-4253\".\r\n * @param {string} [defaultCountry]\r\n * @param {string} [defaultCallingCode]\r\n * @param {Metadata} metadata\r\n * @return {object} Returns `{ country: string?, countryCallingCode: string?, nationalNumber: string? }`.\r\n */\n\n\nfunction parsePhoneNumber(formattedPhoneNumber, defaultCountry, defaultCallingCode, metadata) {\n // Extract calling code from phone number.\n var _extractCountryCallin = (0, _extractCountryCallingCode[\"default\"])((0, _parseIncompletePhoneNumber[\"default\"])(formattedPhoneNumber), defaultCountry, defaultCallingCode, metadata.metadata),\n countryCallingCode = _extractCountryCallin.countryCallingCode,\n number = _extractCountryCallin.number; // Choose a country by `countryCallingCode`.\n\n\n var country;\n\n if (countryCallingCode) {\n metadata.selectNumberingPlan(countryCallingCode);\n } // If `formattedPhoneNumber` is in \"national\" format\n // then `number` is defined and `countryCallingCode` isn't.\n else if (number && (defaultCountry || defaultCallingCode)) {\n metadata.selectNumberingPlan(defaultCountry, defaultCallingCode);\n\n if (defaultCountry) {\n country = defaultCountry;\n } else {\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (metadata.isNonGeographicCallingCode(defaultCallingCode)) {\n country = '001';\n }\n }\n }\n\n countryCallingCode = defaultCallingCode || (0, _getCountryCallingCode[\"default\"])(defaultCountry, metadata.metadata);\n } else return {};\n\n if (!number) {\n return {\n countryCallingCode: countryCallingCode\n };\n }\n\n var _extractNationalNumbe = (0, _extractNationalNumber[\"default\"])((0, _parseIncompletePhoneNumber[\"default\"])(number), metadata),\n nationalNumber = _extractNationalNumbe.nationalNumber,\n carrierCode = _extractNationalNumbe.carrierCode; // Sometimes there are several countries\n // corresponding to the same country phone code\n // (e.g. NANPA countries all having `1` country phone code).\n // Therefore, to reliably determine the exact country,\n // national (significant) number should have been parsed first.\n //\n // When `metadata.json` is generated, all \"ambiguous\" country phone codes\n // get their countries populated with the full set of\n // \"phone number type\" regular expressions.\n //\n\n\n var exactCountry = (0, _getCountryByCallingCode[\"default\"])(countryCallingCode, nationalNumber, metadata);\n\n if (exactCountry) {\n country = exactCountry;\n /* istanbul ignore if */\n\n if (exactCountry === '001') {// Can't happen with `USE_NON_GEOGRAPHIC_COUNTRY_CODE` being `false`.\n // If `USE_NON_GEOGRAPHIC_COUNTRY_CODE` is set to `true` for some reason,\n // then remove the \"istanbul ignore if\".\n } else {\n metadata.country(country);\n }\n }\n\n return {\n country: country,\n countryCallingCode: countryCallingCode,\n nationalNumber: nationalNumber,\n carrierCode: carrierCode\n };\n}\n//# sourceMappingURL=parse_.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = parsePhoneNumber;\n\nvar _parse_ = _interopRequireDefault(require(\"./parse_\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction parsePhoneNumber(text, options, metadata) {\n return (0, _parse_[\"default\"])(text, _objectSpread({}, options, {\n v2: true\n }), metadata);\n}\n//# sourceMappingURL=parsePhoneNumber_.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = parsePhoneNumber;\nexports.normalizeArguments = normalizeArguments;\n\nvar _parsePhoneNumber_ = _interopRequireDefault(require(\"./parsePhoneNumber_\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction parsePhoneNumber() {\n var _normalizeArguments = normalizeArguments(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return (0, _parsePhoneNumber_[\"default\"])(text, options, metadata);\n}\n\nfunction normalizeArguments(args) {\n var _Array$prototype$slic = Array.prototype.slice.call(args),\n _Array$prototype$slic2 = _slicedToArray(_Array$prototype$slic, 4),\n arg_1 = _Array$prototype$slic2[0],\n arg_2 = _Array$prototype$slic2[1],\n arg_3 = _Array$prototype$slic2[2],\n arg_4 = _Array$prototype$slic2[3];\n\n var text;\n var options;\n var metadata; // If the phone number is passed as a string.\n // `parsePhoneNumber('88005553535', ...)`.\n\n if (typeof arg_1 === 'string') {\n text = arg_1;\n } else throw new TypeError('A text for parsing must be a string.'); // If \"default country\" argument is being passed then move it to `options`.\n // `parsePhoneNumber('88005553535', 'RU', [options], metadata)`.\n\n\n if (!arg_2 || typeof arg_2 === 'string') {\n if (arg_4) {\n options = arg_3;\n metadata = arg_4;\n } else {\n options = undefined;\n metadata = arg_3;\n }\n\n if (arg_2) {\n options = _objectSpread({\n defaultCountry: arg_2\n }, options);\n }\n } // `defaultCountry` is not passed.\n // Example: `parsePhoneNumber('+78005553535', [options], metadata)`.\n else if (isObject(arg_2)) {\n if (arg_3) {\n options = arg_2;\n metadata = arg_3;\n } else {\n metadata = arg_2;\n }\n } else throw new Error(\"Invalid second argument: \".concat(arg_2));\n\n return {\n text: text,\n options: options,\n metadata: metadata\n };\n} // Otherwise istanbul would show this as \"branch not covered\".\n\n/* istanbul ignore next */\n\n\nvar isObject = function isObject(_) {\n return _typeof(_) === 'object';\n};\n//# sourceMappingURL=parsePhoneNumber.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = parsePhoneNumberFromString;\n\nvar _parsePhoneNumber_ = _interopRequireDefault(require(\"./parsePhoneNumber_\"));\n\nvar _ParseError = _interopRequireDefault(require(\"./ParseError\"));\n\nvar _metadata = require(\"./metadata\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction parsePhoneNumberFromString(text, options, metadata) {\n // Validate `defaultCountry`.\n if (options && options.defaultCountry && !(0, _metadata.isSupportedCountry)(options.defaultCountry, metadata)) {\n options = _objectSpread({}, options, {\n defaultCountry: undefined\n });\n } // Parse phone number.\n\n\n try {\n return (0, _parsePhoneNumber_[\"default\"])(text, options, metadata);\n } catch (error) {\n /* istanbul ignore else */\n if (error instanceof _ParseError[\"default\"]) {//\n } else {\n throw error;\n }\n }\n}\n//# sourceMappingURL=parsePhoneNumberFromString_.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = parsePhoneNumberFromString;\n\nvar _parsePhoneNumber = require(\"./parsePhoneNumber\");\n\nvar _parsePhoneNumberFromString_ = _interopRequireDefault(require(\"./parsePhoneNumberFromString_\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction parsePhoneNumberFromString() {\n var _normalizeArguments = (0, _parsePhoneNumber.normalizeArguments)(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return (0, _parsePhoneNumberFromString_[\"default\"])(text, options, metadata);\n}\n//# sourceMappingURL=parsePhoneNumberFromString.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = isValidPhoneNumber;\n\nvar _parsePhoneNumber = require(\"./parsePhoneNumber\");\n\nvar _parsePhoneNumberFromString_ = _interopRequireDefault(require(\"./parsePhoneNumberFromString_\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction isValidPhoneNumber() {\n var _normalizeArguments = (0, _parsePhoneNumber.normalizeArguments)(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n options = _objectSpread({}, options, {\n extract: false\n });\n var phoneNumber = (0, _parsePhoneNumberFromString_[\"default\"])(text, options, metadata);\n return phoneNumber && phoneNumber.isValid() || false;\n}\n//# sourceMappingURL=isValidPhoneNumber.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = isPossiblePhoneNumber;\n\nvar _parsePhoneNumber = require(\"./parsePhoneNumber\");\n\nvar _parsePhoneNumberFromString_ = _interopRequireDefault(require(\"./parsePhoneNumberFromString_\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction isPossiblePhoneNumber() {\n var _normalizeArguments = (0, _parsePhoneNumber.normalizeArguments)(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n options = _objectSpread({}, options, {\n extract: false\n });\n var phoneNumber = (0, _parsePhoneNumberFromString_[\"default\"])(text, options, metadata);\n return phoneNumber && phoneNumber.isPossible() || false;\n}\n//# sourceMappingURL=isPossiblePhoneNumber.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = validatePhoneNumberLength;\n\nvar _parsePhoneNumber = require(\"./parsePhoneNumber\");\n\nvar _parsePhoneNumber_ = _interopRequireDefault(require(\"./parsePhoneNumber_\"));\n\nvar _ParseError = _interopRequireDefault(require(\"./ParseError\"));\n\nvar _metadata = _interopRequireDefault(require(\"./metadata\"));\n\nvar _checkNumberLength = _interopRequireDefault(require(\"./helpers/checkNumberLength\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction validatePhoneNumberLength() {\n var _normalizeArguments = (0, _parsePhoneNumber.normalizeArguments)(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n options = _objectSpread({}, options, {\n extract: false // Parse phone number.\n\n });\n\n try {\n var phoneNumber = (0, _parsePhoneNumber_[\"default\"])(text, options, metadata);\n metadata = new _metadata[\"default\"](metadata);\n metadata.selectNumberingPlan(phoneNumber.countryCallingCode);\n var result = (0, _checkNumberLength[\"default\"])(phoneNumber.nationalNumber, metadata);\n\n if (result !== 'IS_POSSIBLE') {\n return result;\n }\n } catch (error) {\n /* istanbul ignore else */\n if (error instanceof _ParseError[\"default\"]) {\n return error.message;\n } else {\n throw error;\n }\n }\n}\n//# sourceMappingURL=validatePhoneNumberLength.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// https://medium.com/dsinjs/implementing-lru-cache-in-javascript-94ba6755cda9\nvar Node = function Node(key, value) {\n var next = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n var prev = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n _classCallCheck(this, Node);\n\n this.key = key;\n this.value = value;\n this.next = next;\n this.prev = prev;\n};\n\nvar LRUCache =\n/*#__PURE__*/\nfunction () {\n //set default limit of 10 if limit is not passed.\n function LRUCache() {\n var limit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;\n\n _classCallCheck(this, LRUCache);\n\n this.size = 0;\n this.limit = limit;\n this.head = null;\n this.tail = null;\n this.cache = {};\n } // Write Node to head of LinkedList\n // update cache with Node key and Node reference\n\n\n _createClass(LRUCache, [{\n key: \"put\",\n value: function put(key, value) {\n this.ensureLimit();\n\n if (!this.head) {\n this.head = this.tail = new Node(key, value);\n } else {\n var node = new Node(key, value, this.head);\n this.head.prev = node;\n this.head = node;\n } //Update the cache map\n\n\n this.cache[key] = this.head;\n this.size++;\n } // Read from cache map and make that node as new Head of LinkedList\n\n }, {\n key: \"get\",\n value: function get(key) {\n if (this.cache[key]) {\n var value = this.cache[key].value; // node removed from it's position and cache\n\n this.remove(key); // write node again to the head of LinkedList to make it most recently used\n\n this.put(key, value);\n return value;\n }\n\n console.log(\"Item not available in cache for key \".concat(key));\n }\n }, {\n key: \"ensureLimit\",\n value: function ensureLimit() {\n if (this.size === this.limit) {\n this.remove(this.tail.key);\n }\n }\n }, {\n key: \"remove\",\n value: function remove(key) {\n var node = this.cache[key];\n\n if (node.prev !== null) {\n node.prev.next = node.next;\n } else {\n this.head = node.next;\n }\n\n if (node.next !== null) {\n node.next.prev = node.prev;\n } else {\n this.tail = node.prev;\n }\n\n delete this.cache[key];\n this.size--;\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this.head = null;\n this.tail = null;\n this.size = 0;\n this.cache = {};\n } // // Invokes the callback function with every node of the chain and the index of the node.\n // forEach(fn) {\n // let node = this.head;\n // let counter = 0;\n // while (node) {\n // fn(node, counter);\n // node = node.next;\n // counter++;\n // }\n // }\n // // To iterate over LRU with a 'for...of' loop\n // *[Symbol.iterator]() {\n // let node = this.head;\n // while (node) {\n // yield node;\n // node = node.next;\n // }\n // }\n\n }]);\n\n return LRUCache;\n}();\n\nexports[\"default\"] = LRUCache;\n//# sourceMappingURL=LRUCache.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _LRUCache = _interopRequireDefault(require(\"./LRUCache\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// A cache for frequently used country-specific regular expressions. Set to 32 to cover ~2-3\n// countries being used for the same doc with ~10 patterns for each country. Some pages will have\n// a lot more countries in use, but typically fewer numbers for each so expanding the cache for\n// that use-case won't have a lot of benefit.\nvar RegExpCache =\n/*#__PURE__*/\nfunction () {\n function RegExpCache(size) {\n _classCallCheck(this, RegExpCache);\n\n this.cache = new _LRUCache[\"default\"](size);\n }\n\n _createClass(RegExpCache, [{\n key: \"getPatternForRegExp\",\n value: function getPatternForRegExp(pattern) {\n var regExp = this.cache.get(pattern);\n\n if (!regExp) {\n regExp = new RegExp('^' + pattern);\n this.cache.put(pattern, regExp);\n }\n\n return regExp;\n }\n }]);\n\n return RegExpCache;\n}();\n\nexports[\"default\"] = RegExpCache;\n//# sourceMappingURL=RegExpCache.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.limit = limit;\nexports.trimAfterFirstMatch = trimAfterFirstMatch;\nexports.startsWith = startsWith;\nexports.endsWith = endsWith;\n\n/** Returns a regular expression quantifier with an upper and lower limit. */\nfunction limit(lower, upper) {\n if (lower < 0 || upper <= 0 || upper < lower) {\n throw new TypeError();\n }\n\n return \"{\".concat(lower, \",\").concat(upper, \"}\");\n}\n/**\r\n * Trims away any characters after the first match of {@code pattern} in {@code candidate},\r\n * returning the trimmed version.\r\n */\n\n\nfunction trimAfterFirstMatch(regexp, string) {\n var index = string.search(regexp);\n\n if (index >= 0) {\n return string.slice(0, index);\n }\n\n return string;\n}\n\nfunction startsWith(string, substring) {\n return string.indexOf(substring) === 0;\n}\n\nfunction endsWith(string, substring) {\n return string.indexOf(substring, string.length - substring.length) === string.length - substring.length;\n}\n//# sourceMappingURL=util.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isLatinLetter = isLatinLetter;\nexports.isInvalidPunctuationSymbol = isInvalidPunctuationSymbol;\nexports._pL = exports.pNd = exports._pN = exports.PZ = exports.pZ = void 0;\n// Javascript doesn't support UTF-8 regular expressions.\n// So mimicking them here.\n// Copy-pasted from `PhoneNumberMatcher.js`.\n\n/**\r\n * \"\\p{Z}\" is any kind of whitespace or invisible separator (\"Separator\").\r\n * http://www.regular-expressions.info/unicode.html\r\n * \"\\P{Z}\" is the reverse of \"\\p{Z}\".\r\n * \"\\p{N}\" is any kind of numeric character in any script (\"Number\").\r\n * \"\\p{Nd}\" is a digit zero through nine in any script except \"ideographic scripts\" (\"Decimal_Digit_Number\").\r\n * \"\\p{Sc}\" is a currency symbol (\"Currency_Symbol\").\r\n * \"\\p{L}\" is any kind of letter from any language (\"Letter\").\r\n * \"\\p{Mn}\" is \"non-spacing mark\".\r\n *\r\n * Javascript doesn't support Unicode Regular Expressions\r\n * so substituting it with this explicit set of characters.\r\n *\r\n * https://stackoverflow.com/questions/13210194/javascript-regex-equivalent-of-a-za-z-using-pl\r\n * https://github.com/danielberndt/babel-plugin-utf-8-regex/blob/master/src/transformer.js\r\n */\nvar _pZ = \" \\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000\";\nvar pZ = \"[\".concat(_pZ, \"]\");\nexports.pZ = pZ;\nvar PZ = \"[^\".concat(_pZ, \"]\");\nexports.PZ = PZ;\nvar _pN = \"0-9\\xB2\\xB3\\xB9\\xBC-\\xBE\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u09F4-\\u09F9\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0B72-\\u0B77\\u0BE6-\\u0BF2\\u0C66-\\u0C6F\\u0C78-\\u0C7E\\u0CE6-\\u0CEF\\u0D66-\\u0D75\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F33\\u1040-\\u1049\\u1090-\\u1099\\u1369-\\u137C\\u16EE-\\u16F0\\u17E0-\\u17E9\\u17F0-\\u17F9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19DA\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\u2070\\u2074-\\u2079\\u2080-\\u2089\\u2150-\\u2182\\u2185-\\u2189\\u2460-\\u249B\\u24EA-\\u24FF\\u2776-\\u2793\\u2CFD\\u3007\\u3021-\\u3029\\u3038-\\u303A\\u3192-\\u3195\\u3220-\\u3229\\u3248-\\u324F\\u3251-\\u325F\\u3280-\\u3289\\u32B1-\\u32BF\\uA620-\\uA629\\uA6E6-\\uA6EF\\uA830-\\uA835\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19\"; // const pN = `[${_pN}]`\n\nexports._pN = _pN;\nvar _pNd = \"0-9\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0BE6-\\u0BEF\\u0C66-\\u0C6F\\u0CE6-\\u0CEF\\u0D66-\\u0D6F\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F29\\u1040-\\u1049\\u1090-\\u1099\\u17E0-\\u17E9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19D9\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\uA620-\\uA629\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19\";\nvar pNd = \"[\".concat(_pNd, \"]\");\nexports.pNd = pNd;\nvar _pL = \"A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC\";\nexports._pL = _pL;\nvar pL = \"[\".concat(_pL, \"]\");\nvar pL_regexp = new RegExp(pL);\nvar _pSc = \"$\\xA2-\\xA5\\u058F\\u060B\\u09F2\\u09F3\\u09FB\\u0AF1\\u0BF9\\u0E3F\\u17DB\\u20A0-\\u20B9\\uA838\\uFDFC\\uFE69\\uFF04\\uFFE0\\uFFE1\\uFFE5\\uFFE6\";\nvar pSc = \"[\".concat(_pSc, \"]\");\nvar pSc_regexp = new RegExp(pSc);\nvar _pMn = \"\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08E4-\\u08FE\\u0900-\\u0902\\u093A\\u093C\\u0941-\\u0948\\u094D\\u0951-\\u0957\\u0962\\u0963\\u0981\\u09BC\\u09C1-\\u09C4\\u09CD\\u09E2\\u09E3\\u0A01\\u0A02\\u0A3C\\u0A41\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81\\u0A82\\u0ABC\\u0AC1-\\u0AC5\\u0AC7\\u0AC8\\u0ACD\\u0AE2\\u0AE3\\u0B01\\u0B3C\\u0B3F\\u0B41-\\u0B44\\u0B4D\\u0B56\\u0B62\\u0B63\\u0B82\\u0BC0\\u0BCD\\u0C3E-\\u0C40\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0CBC\\u0CBF\\u0CC6\\u0CCC\\u0CCD\\u0CE2\\u0CE3\\u0D41-\\u0D44\\u0D4D\\u0D62\\u0D63\\u0DCA\\u0DD2-\\u0DD4\\u0DD6\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F71-\\u0F7E\\u0F80-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1030\\u1032-\\u1037\\u1039\\u103A\\u103D\\u103E\\u1058\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108D\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4\\u17B5\\u17B7-\\u17BD\\u17C6\\u17C9-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193B\\u1A17\\u1A18\\u1A56\\u1A58-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A6C\\u1A73-\\u1A7C\\u1A7F\\u1B00-\\u1B03\\u1B34\\u1B36-\\u1B3A\\u1B3C\\u1B42\\u1B6B-\\u1B73\\u1B80\\u1B81\\u1BA2-\\u1BA5\\u1BA8\\u1BA9\\u1BAB\\u1BE6\\u1BE8\\u1BE9\\u1BED\\u1BEF-\\u1BF1\\u1C2C-\\u1C33\\u1C36\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE0\\u1CE2-\\u1CE8\\u1CED\\u1CF4\\u1DC0-\\u1DE6\\u1DFC-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302D\\u3099\\u309A\\uA66F\\uA674-\\uA67D\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA825\\uA826\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA951\\uA980-\\uA982\\uA9B3\\uA9B6-\\uA9B9\\uA9BC\\uAA29-\\uAA2E\\uAA31\\uAA32\\uAA35\\uAA36\\uAA43\\uAA4C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEC\\uAAED\\uAAF6\\uABE5\\uABE8\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26\";\nvar pMn = \"[\".concat(_pMn, \"]\");\nvar pMn_regexp = new RegExp(pMn);\nvar _InBasic_Latin = \"\\0-\\x7F\";\nvar _InLatin_1_Supplement = \"\\x80-\\xFF\";\nvar _InLatin_Extended_A = \"\\u0100-\\u017F\";\nvar _InLatin_Extended_Additional = \"\\u1E00-\\u1EFF\";\nvar _InLatin_Extended_B = \"\\u0180-\\u024F\";\nvar _InCombining_Diacritical_Marks = \"\\u0300-\\u036F\";\nvar latinLetterRegexp = new RegExp('[' + _InBasic_Latin + _InLatin_1_Supplement + _InLatin_Extended_A + _InLatin_Extended_Additional + _InLatin_Extended_B + _InCombining_Diacritical_Marks + ']');\n/**\r\n * Helper method to determine if a character is a Latin-script letter or not.\r\n * For our purposes, combining marks should also return true since we assume\r\n * they have been added to a preceding Latin character.\r\n */\n\nfunction isLatinLetter(letter) {\n // Combining marks are a subset of non-spacing-mark.\n if (!pL_regexp.test(letter) && !pMn_regexp.test(letter)) {\n return false;\n }\n\n return latinLetterRegexp.test(letter);\n}\n\nfunction isInvalidPunctuationSymbol(character) {\n return character === '%' || pSc_regexp.test(character);\n}\n//# sourceMappingURL=utf-8.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.containsMoreThanOneSlashInNationalNumber = containsMoreThanOneSlashInNationalNumber;\nexports[\"default\"] = void 0;\n\nvar _validate_ = _interopRequireDefault(require(\"../validate_\"));\n\nvar _parseDigits = _interopRequireDefault(require(\"../helpers/parseDigits\"));\n\nvar _util = require(\"./util\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n/**\r\n * Leniency when finding potential phone numbers in text segments\r\n * The levels here are ordered in increasing strictness.\r\n */\nvar _default = {\n /**\r\n * Phone numbers accepted are \"possible\", but not necessarily \"valid\".\r\n */\n POSSIBLE: function POSSIBLE(number, candidate, metadata) {\n return true;\n },\n\n /**\r\n * Phone numbers accepted are \"possible\" and \"valid\".\r\n * Numbers written in national format must have their national-prefix\r\n * present if it is usually written for a number of this type.\r\n */\n VALID: function VALID(number, candidate, metadata) {\n if (!(0, _validate_[\"default\"])(number, undefined, metadata) || !containsOnlyValidXChars(number, candidate.toString(), metadata)) {\n return false;\n } // Skipped for simplicity.\n // return isNationalPrefixPresentIfRequired(number, metadata)\n\n\n return true;\n },\n\n /**\r\n * Phone numbers accepted are \"valid\" and\r\n * are grouped in a possible way for this locale. For example, a US number written as\r\n * \"65 02 53 00 00\" and \"650253 0000\" are not accepted at this leniency level, whereas\r\n * \"650 253 0000\", \"650 2530000\" or \"6502530000\" are.\r\n * Numbers with more than one '/' symbol in the national significant number\r\n * are also dropped at this level.\r\n *\r\n * Warning: This level might result in lower coverage especially for regions outside of\r\n * country code \"+1\". If you are not sure about which level to use,\r\n * email the discussion group libphonenumber-discuss@googlegroups.com.\r\n */\n STRICT_GROUPING: function STRICT_GROUPING(number, candidate, metadata, regExpCache) {\n var candidateString = candidate.toString();\n\n if (!(0, _validate_[\"default\"])(number, undefined, metadata) || !containsOnlyValidXChars(number, candidateString, metadata) || containsMoreThanOneSlashInNationalNumber(number, candidateString) || !isNationalPrefixPresentIfRequired(number, metadata)) {\n return false;\n }\n\n return checkNumberGroupingIsValid(number, candidate, metadata, allNumberGroupsRemainGrouped, regExpCache);\n },\n\n /**\r\n * Phone numbers accepted are {@linkplain PhoneNumberUtil#isValidNumber(PhoneNumber) valid} and\r\n * are grouped in the same way that we would have formatted it, or as a single block. For\r\n * example, a US number written as \"650 2530000\" is not accepted at this leniency level, whereas\r\n * \"650 253 0000\" or \"6502530000\" are.\r\n * Numbers with more than one '/' symbol are also dropped at this level.\r\n *

    \r\n * Warning: This level might result in lower coverage especially for regions outside of country\r\n * code \"+1\". If you are not sure about which level to use, email the discussion group\r\n * libphonenumber-discuss@googlegroups.com.\r\n */\n EXACT_GROUPING: function EXACT_GROUPING(number, candidate, metadata, regExpCache) {\n var candidateString = candidate.toString();\n\n if (!(0, _validate_[\"default\"])(number, undefined, metadata) || !containsOnlyValidXChars(number, candidateString, metadata) || containsMoreThanOneSlashInNationalNumber(number, candidateString) || !isNationalPrefixPresentIfRequired(number, metadata)) {\n return false;\n }\n\n return checkNumberGroupingIsValid(number, candidate, metadata, allNumberGroupsAreExactlyPresent, regExpCache);\n }\n};\nexports[\"default\"] = _default;\n\nfunction containsOnlyValidXChars(number, candidate, metadata) {\n // The characters 'x' and 'X' can be (1) a carrier code, in which case they always precede the\n // national significant number or (2) an extension sign, in which case they always precede the\n // extension number. We assume a carrier code is more than 1 digit, so the first case has to\n // have more than 1 consecutive 'x' or 'X', whereas the second case can only have exactly 1 'x'\n // or 'X'. We ignore the character if it appears as the last character of the string.\n for (var index = 0; index < candidate.length - 1; index++) {\n var charAtIndex = candidate.charAt(index);\n\n if (charAtIndex === 'x' || charAtIndex === 'X') {\n var charAtNextIndex = candidate.charAt(index + 1);\n\n if (charAtNextIndex === 'x' || charAtNextIndex === 'X') {\n // This is the carrier code case, in which the 'X's always precede the national\n // significant number.\n index++;\n\n if (util.isNumberMatch(number, candidate.substring(index)) != MatchType.NSN_MATCH) {\n return false;\n } // This is the extension sign case, in which the 'x' or 'X' should always precede the\n // extension number.\n\n } else if ((0, _parseDigits[\"default\"])(candidate.substring(index)) !== number.ext) {\n return false;\n }\n }\n }\n\n return true;\n}\n\nfunction isNationalPrefixPresentIfRequired(number, _metadata) {\n // First, check how we deduced the country code. If it was written in international format, then\n // the national prefix is not required.\n if (number.getCountryCodeSource() != 'FROM_DEFAULT_COUNTRY') {\n return true;\n }\n\n var phoneNumberRegion = util.getRegionCodeForCountryCode(number.getCountryCode());\n var metadata = util.getMetadataForRegion(phoneNumberRegion);\n\n if (metadata == null) {\n return true;\n } // Check if a national prefix should be present when formatting this number.\n\n\n var nationalNumber = util.getNationalSignificantNumber(number);\n var formatRule = util.chooseFormattingPatternForNumber(metadata.numberFormats(), nationalNumber); // To do this, we check that a national prefix formatting rule was present\n // and that it wasn't just the first-group symbol ($1) with punctuation.\n\n if (formatRule && formatRule.getNationalPrefixFormattingRule().length > 0) {\n if (formatRule.getNationalPrefixOptionalWhenFormatting()) {\n // The national-prefix is optional in these cases, so we don't need to check if it was\n // present.\n return true;\n }\n\n if (PhoneNumberUtil.formattingRuleHasFirstGroupOnly(formatRule.getNationalPrefixFormattingRule())) {\n // National Prefix not needed for this number.\n return true;\n } // Normalize the remainder.\n\n\n var rawInputCopy = PhoneNumberUtil.normalizeDigitsOnly(number.getRawInput()); // Check if we found a national prefix and/or carrier code at the start of the raw input, and\n // return the result.\n\n return util.maybeStripNationalPrefixAndCarrierCode(rawInputCopy, metadata, null);\n }\n\n return true;\n}\n\nfunction containsMoreThanOneSlashInNationalNumber(number, candidate) {\n var firstSlashInBodyIndex = candidate.indexOf('/');\n\n if (firstSlashInBodyIndex < 0) {\n // No slashes, this is okay.\n return false;\n } // Now look for a second one.\n\n\n var secondSlashInBodyIndex = candidate.indexOf('/', firstSlashInBodyIndex + 1);\n\n if (secondSlashInBodyIndex < 0) {\n // Only one slash, this is okay.\n return false;\n } // If the first slash is after the country calling code, this is permitted.\n\n\n var candidateHasCountryCode = number.getCountryCodeSource() === CountryCodeSource.FROM_NUMBER_WITH_PLUS_SIGN || number.getCountryCodeSource() === CountryCodeSource.FROM_NUMBER_WITHOUT_PLUS_SIGN;\n\n if (candidateHasCountryCode && PhoneNumberUtil.normalizeDigitsOnly(candidate.substring(0, firstSlashInBodyIndex)) === String(number.getCountryCode())) {\n // Any more slashes and this is illegal.\n return candidate.slice(secondSlashInBodyIndex + 1).indexOf('/') >= 0;\n }\n\n return true;\n}\n\nfunction checkNumberGroupingIsValid(number, candidate, metadata, checkGroups, regExpCache) {\n var normalizedCandidate = normalizeDigits(candidate, true\n /* keep non-digits */\n );\n var formattedNumberGroups = getNationalNumberGroups(metadata, number, null);\n\n if (checkGroups(metadata, number, normalizedCandidate, formattedNumberGroups)) {\n return true;\n } // If this didn't pass, see if there are any alternate formats that match, and try them instead.\n\n\n var alternateFormats = MetadataManager.getAlternateFormatsForCountry(number.getCountryCode());\n var nationalSignificantNumber = util.getNationalSignificantNumber(number);\n\n if (alternateFormats) {\n for (var _iterator = alternateFormats.numberFormats(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var alternateFormat = _ref;\n\n if (alternateFormat.leadingDigitsPatterns().length > 0) {\n // There is only one leading digits pattern for alternate formats.\n var leadingDigitsRegExp = regExpCache.getPatternForRegExp('^' + alternateFormat.leadingDigitsPatterns()[0]);\n\n if (!leadingDigitsRegExp.test(nationalSignificantNumber)) {\n // Leading digits don't match; try another one.\n continue;\n }\n }\n\n formattedNumberGroups = getNationalNumberGroups(metadata, number, alternateFormat);\n\n if (checkGroups(metadata, number, normalizedCandidate, formattedNumberGroups)) {\n return true;\n }\n }\n }\n\n return false;\n}\n/**\r\n * Helper method to get the national-number part of a number, formatted without any national\r\n * prefix, and return it as a set of digit blocks that would be formatted together following\r\n * standard formatting rules.\r\n */\n\n\nfunction getNationalNumberGroups(metadata, number, formattingPattern) {\n if (formattingPattern) {\n // We format the NSN only, and split that according to the separator.\n var nationalSignificantNumber = util.getNationalSignificantNumber(number);\n return util.formatNsnUsingPattern(nationalSignificantNumber, formattingPattern, 'RFC3966', metadata).split('-');\n } // This will be in the format +CC-DG1-DG2-DGX;ext=EXT where DG1..DGX represents groups of digits.\n\n\n var rfc3966Format = formatNumber(number, 'RFC3966', metadata); // We remove the extension part from the formatted string before splitting it into different\n // groups.\n\n var endIndex = rfc3966Format.indexOf(';');\n\n if (endIndex < 0) {\n endIndex = rfc3966Format.length;\n } // The country-code will have a '-' following it.\n\n\n var startIndex = rfc3966Format.indexOf('-') + 1;\n return rfc3966Format.slice(startIndex, endIndex).split('-');\n}\n\nfunction allNumberGroupsAreExactlyPresent(metadata, number, normalizedCandidate, formattedNumberGroups) {\n var candidateGroups = normalizedCandidate.split(NON_DIGITS_PATTERN); // Set this to the last group, skipping it if the number has an extension.\n\n var candidateNumberGroupIndex = number.hasExtension() ? candidateGroups.length - 2 : candidateGroups.length - 1; // First we check if the national significant number is formatted as a block.\n // We use contains and not equals, since the national significant number may be present with\n // a prefix such as a national number prefix, or the country code itself.\n\n if (candidateGroups.length == 1 || candidateGroups[candidateNumberGroupIndex].contains(util.getNationalSignificantNumber(number))) {\n return true;\n } // Starting from the end, go through in reverse, excluding the first group, and check the\n // candidate and number groups are the same.\n\n\n var formattedNumberGroupIndex = formattedNumberGroups.length - 1;\n\n while (formattedNumberGroupIndex > 0 && candidateNumberGroupIndex >= 0) {\n if (candidateGroups[candidateNumberGroupIndex] !== formattedNumberGroups[formattedNumberGroupIndex]) {\n return false;\n }\n\n formattedNumberGroupIndex--;\n candidateNumberGroupIndex--;\n } // Now check the first group. There may be a national prefix at the start, so we only check\n // that the candidate group ends with the formatted number group.\n\n\n return candidateNumberGroupIndex >= 0 && (0, _util.endsWith)(candidateGroups[candidateNumberGroupIndex], formattedNumberGroups[0]);\n}\n\nfunction allNumberGroupsRemainGrouped(metadata, number, normalizedCandidate, formattedNumberGroups) {\n var fromIndex = 0;\n\n if (number.getCountryCodeSource() !== CountryCodeSource.FROM_DEFAULT_COUNTRY) {\n // First skip the country code if the normalized candidate contained it.\n var countryCode = String(number.getCountryCode());\n fromIndex = normalizedCandidate.indexOf(countryCode) + countryCode.length();\n } // Check each group of consecutive digits are not broken into separate groupings in the\n // {@code normalizedCandidate} string.\n\n\n for (var i = 0; i < formattedNumberGroups.length; i++) {\n // Fails if the substring of {@code normalizedCandidate} starting from {@code fromIndex}\n // doesn't contain the consecutive digits in formattedNumberGroups[i].\n fromIndex = normalizedCandidate.indexOf(formattedNumberGroups[i], fromIndex);\n\n if (fromIndex < 0) {\n return false;\n } // Moves {@code fromIndex} forward.\n\n\n fromIndex += formattedNumberGroups[i].length();\n\n if (i == 0 && fromIndex < normalizedCandidate.length()) {\n // We are at the position right after the NDC. We get the region used for formatting\n // information based on the country code in the phone number, rather than the number itself,\n // as we do not need to distinguish between different countries with the same country\n // calling code and this is faster.\n var region = util.getRegionCodeForCountryCode(number.getCountryCode());\n\n if (util.getNddPrefixForRegion(region, true) != null && Character.isDigit(normalizedCandidate.charAt(fromIndex))) {\n // This means there is no formatting symbol after the NDC. In this case, we only\n // accept the number if there is no formatting symbol at all in the number, except\n // for extensions. This is only important for countries with national prefixes.\n var nationalSignificantNumber = util.getNationalSignificantNumber(number);\n return (0, _util.startsWith)(normalizedCandidate.slice(fromIndex - formattedNumberGroups[i].length), nationalSignificantNumber);\n }\n }\n } // The check here makes sure that we haven't mistakenly already used the extension to\n // match the last group of the subscriber number. Note the extension cannot have\n // formatting in-between digits.\n\n\n return normalizedCandidate.slice(fromIndex).contains(number.getExtension());\n}\n//# sourceMappingURL=Leniency.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = parsePreCandidate;\n\nvar _util = require(\"./util\");\n\n// Regular expression of characters typically used to start a second phone number for the purposes\n// of parsing. This allows us to strip off parts of the number that are actually the start of\n// another number, such as for: (530) 583-6985 x302/x2303 -> the second extension here makes this\n// actually two phone numbers, (530) 583-6985 x302 and (530) 583-6985 x2303. We remove the second\n// extension so that the first number is parsed correctly.\n//\n// Matches a slash (\\ or /) followed by a space followed by an `x`.\n//\nvar SECOND_NUMBER_START_PATTERN = /[\\\\/] *x/;\n\nfunction parsePreCandidate(candidate) {\n // Check for extra numbers at the end.\n // TODO: This is the place to start when trying to support extraction of multiple phone number\n // from split notations (+41 79 123 45 67 / 68).\n return (0, _util.trimAfterFirstMatch)(SECOND_NUMBER_START_PATTERN, candidate);\n}\n//# sourceMappingURL=parsePreCandidate.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = isValidPreCandidate;\n// Matches strings that look like dates using \"/\" as a separator.\n// Examples: 3/10/2011, 31/10/96 or 08/31/95.\nvar SLASH_SEPARATED_DATES = /(?:(?:[0-3]?\\d\\/[01]?\\d)|(?:[01]?\\d\\/[0-3]?\\d))\\/(?:[12]\\d)?\\d{2}/; // Matches timestamps.\n// Examples: \"2012-01-02 08:00\".\n// Note that the reg-ex does not include the\n// trailing \":\\d\\d\" -- that is covered by TIME_STAMPS_SUFFIX.\n\nvar TIME_STAMPS = /[12]\\d{3}[-/]?[01]\\d[-/]?[0-3]\\d +[0-2]\\d$/;\nvar TIME_STAMPS_SUFFIX_LEADING = /^:[0-5]\\d/;\n\nfunction isValidPreCandidate(candidate, offset, text) {\n // Skip a match that is more likely to be a date.\n if (SLASH_SEPARATED_DATES.test(candidate)) {\n return false;\n } // Skip potential time-stamps.\n\n\n if (TIME_STAMPS.test(candidate)) {\n var followingText = text.slice(offset + candidate.length);\n\n if (TIME_STAMPS_SUFFIX_LEADING.test(followingText)) {\n return false;\n }\n }\n\n return true;\n}\n//# sourceMappingURL=isValidPreCandidate.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = isValidCandidate;\nexports.LEAD_CLASS = void 0;\n\nvar _constants = require(\"../constants\");\n\nvar _util = require(\"./util\");\n\nvar _utf = require(\"./utf-8\");\n\n// Copy-pasted from `PhoneNumberMatcher.js`.\nvar OPENING_PARENS = \"(\\\\[\\uFF08\\uFF3B\";\nvar CLOSING_PARENS = \")\\\\]\\uFF09\\uFF3D\";\nvar NON_PARENS = \"[^\".concat(OPENING_PARENS).concat(CLOSING_PARENS, \"]\");\nvar LEAD_CLASS = \"[\".concat(OPENING_PARENS).concat(_constants.PLUS_CHARS, \"]\"); // Punctuation that may be at the start of a phone number - brackets and plus signs.\n\nexports.LEAD_CLASS = LEAD_CLASS;\nvar LEAD_CLASS_LEADING = new RegExp('^' + LEAD_CLASS); // Limit on the number of pairs of brackets in a phone number.\n\nvar BRACKET_PAIR_LIMIT = (0, _util.limit)(0, 3);\n/**\r\n * Pattern to check that brackets match. Opening brackets should be closed within a phone number.\r\n * This also checks that there is something inside the brackets. Having no brackets at all is also\r\n * fine.\r\n *\r\n * An opening bracket at the beginning may not be closed, but subsequent ones should be. It's\r\n * also possible that the leading bracket was dropped, so we shouldn't be surprised if we see a\r\n * closing bracket first. We limit the sets of brackets in a phone number to four.\r\n */\n\nvar MATCHING_BRACKETS_ENTIRE = new RegExp('^' + \"(?:[\" + OPENING_PARENS + \"])?\" + \"(?:\" + NON_PARENS + \"+\" + \"[\" + CLOSING_PARENS + \"])?\" + NON_PARENS + \"+\" + \"(?:[\" + OPENING_PARENS + \"]\" + NON_PARENS + \"+[\" + CLOSING_PARENS + \"])\" + BRACKET_PAIR_LIMIT + NON_PARENS + \"*\" + '$');\n/**\r\n * Matches strings that look like publication pages. Example:\r\n *

    Computing Complete Answers to Queries in the Presence of Limited Access Patterns.\r\n * Chen Li. VLDB J. 12(3): 211-227 (2003).
    \r\n *\r\n * The string \"211-227 (2003)\" is not a telephone number.\r\n */\n\nvar PUB_PAGES = /\\d{1,5}-+\\d{1,5}\\s{0,4}\\(\\d{1,4}/;\n\nfunction isValidCandidate(candidate, offset, text, leniency) {\n // Check the candidate doesn't contain any formatting\n // which would indicate that it really isn't a phone number.\n if (!MATCHING_BRACKETS_ENTIRE.test(candidate) || PUB_PAGES.test(candidate)) {\n return;\n } // If leniency is set to VALID or stricter, we also want to skip numbers that are surrounded\n // by Latin alphabetic characters, to skip cases like abc8005001234 or 8005001234def.\n\n\n if (leniency !== 'POSSIBLE') {\n // If the candidate is not at the start of the text,\n // and does not start with phone-number punctuation,\n // check the previous character.\n if (offset > 0 && !LEAD_CLASS_LEADING.test(candidate)) {\n var previousChar = text[offset - 1]; // We return null if it is a latin letter or an invalid punctuation symbol.\n\n if ((0, _utf.isInvalidPunctuationSymbol)(previousChar) || (0, _utf.isLatinLetter)(previousChar)) {\n return false;\n }\n }\n\n var lastCharIndex = offset + candidate.length;\n\n if (lastCharIndex < text.length) {\n var nextChar = text[lastCharIndex];\n\n if ((0, _utf.isInvalidPunctuationSymbol)(nextChar) || (0, _utf.isLatinLetter)(nextChar)) {\n return false;\n }\n }\n }\n\n return true;\n}\n//# sourceMappingURL=isValidCandidate.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _PhoneNumber = _interopRequireDefault(require(\"./PhoneNumber\"));\n\nvar _constants = require(\"./constants\");\n\nvar _createExtensionPattern = _interopRequireDefault(require(\"./helpers/extension/createExtensionPattern\"));\n\nvar _RegExpCache = _interopRequireDefault(require(\"./findNumbers/RegExpCache\"));\n\nvar _util = require(\"./findNumbers/util\");\n\nvar _utf = require(\"./findNumbers/utf-8\");\n\nvar _Leniency = _interopRequireDefault(require(\"./findNumbers/Leniency\"));\n\nvar _parsePreCandidate = _interopRequireDefault(require(\"./findNumbers/parsePreCandidate\"));\n\nvar _isValidPreCandidate = _interopRequireDefault(require(\"./findNumbers/isValidPreCandidate\"));\n\nvar _isValidCandidate = _interopRequireWildcard(require(\"./findNumbers/isValidCandidate\"));\n\nvar _metadata = require(\"./metadata\");\n\nvar _parse_ = _interopRequireDefault(require(\"./parse_\"));\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj[\"default\"] = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar EXTN_PATTERNS_FOR_MATCHING = (0, _createExtensionPattern[\"default\"])('matching');\n/**\r\n * Patterns used to extract phone numbers from a larger phone-number-like pattern. These are\r\n * ordered according to specificity. For example, white-space is last since that is frequently\r\n * used in numbers, not just to separate two numbers. We have separate patterns since we don't\r\n * want to break up the phone-number-like text on more than one different kind of symbol at one\r\n * time, although symbols of the same type (e.g. space) can be safely grouped together.\r\n *\r\n * Note that if there is a match, we will always check any text found up to the first match as\r\n * well.\r\n */\n\nvar INNER_MATCHES = [// Breaks on the slash - e.g. \"651-234-2345/332-445-1234\"\n'\\\\/+(.*)/', // Note that the bracket here is inside the capturing group, since we consider it part of the\n// phone number. Will match a pattern like \"(650) 223 3345 (754) 223 3321\".\n'(\\\\([^(]*)', // Breaks on a hyphen - e.g. \"12345 - 332-445-1234 is my number.\"\n// We require a space on either side of the hyphen for it to be considered a separator.\n\"(?:\".concat(_utf.pZ, \"-|-\").concat(_utf.pZ, \")\").concat(_utf.pZ, \"*(.+)\"), // Various types of wide hyphens. Note we have decided not to enforce a space here, since it's\n// possible that it's supposed to be used to break two numbers without spaces, and we haven't\n// seen many instances of it used within a number.\n\"[\\u2012-\\u2015\\uFF0D]\".concat(_utf.pZ, \"*(.+)\"), // Breaks on a full stop - e.g. \"12345. 332-445-1234 is my number.\"\n\"\\\\.+\".concat(_utf.pZ, \"*([^.]+)\"), // Breaks on space - e.g. \"3324451234 8002341234\"\n\"\".concat(_utf.pZ, \"+(\").concat(_utf.PZ, \"+)\")]; // Limit on the number of leading (plus) characters.\n\nvar leadLimit = (0, _util.limit)(0, 2); // Limit on the number of consecutive punctuation characters.\n\nvar punctuationLimit = (0, _util.limit)(0, 4);\n/* The maximum number of digits allowed in a digit-separated block. As we allow all digits in a\r\n * single block, set high enough to accommodate the entire national number and the international\r\n * country code. */\n\nvar digitBlockLimit = _constants.MAX_LENGTH_FOR_NSN + _constants.MAX_LENGTH_COUNTRY_CODE; // Limit on the number of blocks separated by punctuation.\n// Uses digitBlockLimit since some formats use spaces to separate each digit.\n\nvar blockLimit = (0, _util.limit)(0, digitBlockLimit);\n/* A punctuation sequence allowing white space. */\n\nvar punctuation = \"[\".concat(_constants.VALID_PUNCTUATION, \"]\") + punctuationLimit; // A digits block without punctuation.\n\nvar digitSequence = _utf.pNd + (0, _util.limit)(1, digitBlockLimit);\n/**\r\n * Phone number pattern allowing optional punctuation.\r\n * The phone number pattern used by `find()`, similar to\r\n * VALID_PHONE_NUMBER, but with the following differences:\r\n *
      \r\n *
    • All captures are limited in order to place an upper bound to the text matched by the\r\n * pattern.\r\n *
        \r\n *
      • Leading punctuation / plus signs are limited.\r\n *
      • Consecutive occurrences of punctuation are limited.\r\n *
      • Number of digits is limited.\r\n *
      \r\n *
    • No whitespace is allowed at the start or end.\r\n *
    • No alpha digits (vanity numbers such as 1-800-SIX-FLAGS) are currently supported.\r\n *
    \r\n */\n\nvar PATTERN = '(?:' + _isValidCandidate.LEAD_CLASS + punctuation + ')' + leadLimit + digitSequence + '(?:' + punctuation + digitSequence + ')' + blockLimit + '(?:' + EXTN_PATTERNS_FOR_MATCHING + ')?'; // Regular expression of trailing characters that we want to remove.\n// We remove all characters that are not alpha or numerical characters.\n// The hash character is retained here, as it may signify\n// the previous block was an extension.\n//\n// // Don't know what does '&&' mean here.\n// const UNWANTED_END_CHAR_PATTERN = new RegExp(`[[\\\\P{N}&&\\\\P{L}]&&[^#]]+$`)\n//\n\nvar UNWANTED_END_CHAR_PATTERN = new RegExp(\"[^\".concat(_utf._pN).concat(_utf._pL, \"#]+$\"));\nvar NON_DIGITS_PATTERN = /(\\D+)/;\nvar MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1;\n/**\r\n * A stateful class that finds and extracts telephone numbers from {@linkplain CharSequence text}.\r\n * Instances can be created using the {@linkplain PhoneNumberUtil#findNumbers factory methods} in\r\n * {@link PhoneNumberUtil}.\r\n *\r\n *

    Vanity numbers (phone numbers using alphabetic digits such as 1-800-SIX-FLAGS are\r\n * not found.\r\n *\r\n *

    This class is not thread-safe.\r\n */\n\nvar PhoneNumberMatcher =\n/*#__PURE__*/\nfunction () {\n /** The iteration tristate. */\n\n /** The next index to start searching at. Undefined in {@link State#DONE}. */\n // A cache for frequently used country-specific regular expressions. Set to 32 to cover ~2-3\n // countries being used for the same doc with ~10 patterns for each country. Some pages will have\n // a lot more countries in use, but typically fewer numbers for each so expanding the cache for\n // that use-case won't have a lot of benefit.\n\n /**\r\n * Creates a new instance. See the factory methods in {@link PhoneNumberUtil} on how to obtain a\r\n * new instance.\r\n *\r\n * @param util the phone number util to use\r\n * @param text the character sequence that we will search, null for no text\r\n * @param country the country to assume for phone numbers not written in international format\r\n * (with a leading plus, or with the international dialing prefix of the specified region).\r\n * May be null or \"ZZ\" if only numbers with a leading plus should be\r\n * considered.\r\n * @param leniency the leniency to use when evaluating candidate phone numbers\r\n * @param maxTries the maximum number of invalid numbers to try before giving up on the text.\r\n * This is to cover degenerate cases where the text has a lot of false positives in it. Must\r\n * be {@code >= 0}.\r\n */\n function PhoneNumberMatcher() {\n var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var metadata = arguments.length > 2 ? arguments[2] : undefined;\n\n _classCallCheck(this, PhoneNumberMatcher);\n\n _defineProperty(this, \"state\", 'NOT_READY');\n\n _defineProperty(this, \"searchIndex\", 0);\n\n _defineProperty(this, \"regExpCache\", new _RegExpCache[\"default\"](32));\n\n options = _objectSpread({}, options, {\n defaultCallingCode: options.defaultCallingCode,\n defaultCountry: options.defaultCountry && (0, _metadata.isSupportedCountry)(options.defaultCountry, metadata) ? options.defaultCountry : undefined,\n leniency: options.leniency || options.extended ? 'POSSIBLE' : 'VALID',\n maxTries: options.maxTries || MAX_SAFE_INTEGER\n });\n\n if (!options.leniency) {\n throw new TypeError('`Leniency` not supplied');\n }\n\n if (options.maxTries < 0) {\n throw new TypeError('`maxTries` not supplied');\n }\n\n this.text = text;\n this.options = options;\n this.metadata = metadata;\n /** The degree of validation requested. */\n\n this.leniency = _Leniency[\"default\"][options.leniency];\n\n if (!this.leniency) {\n throw new TypeError(\"Unknown leniency: \".concat(options.leniency, \".\"));\n }\n /** The maximum number of retries after matching an invalid number. */\n\n\n this.maxTries = options.maxTries;\n this.PATTERN = new RegExp(PATTERN, 'ig');\n }\n /**\r\n * Attempts to find the next subsequence in the searched sequence on or after {@code searchIndex}\r\n * that represents a phone number. Returns the next match, null if none was found.\r\n *\r\n * @param index the search index to start searching at\r\n * @return the phone number match found, null if none can be found\r\n */\n\n\n _createClass(PhoneNumberMatcher, [{\n key: \"find\",\n value: function find() {\n // // Reset the regular expression.\n // this.PATTERN.lastIndex = index\n var matches;\n\n while (this.maxTries > 0 && (matches = this.PATTERN.exec(this.text)) !== null) {\n var candidate = matches[0];\n var offset = matches.index;\n candidate = (0, _parsePreCandidate[\"default\"])(candidate);\n\n if ((0, _isValidPreCandidate[\"default\"])(candidate, offset, this.text)) {\n var match = // Try to come up with a valid match given the entire candidate.\n this.parseAndVerify(candidate, offset, this.text) // If that failed, try to find an \"inner match\" -\n // there might be a phone number within this candidate.\n || this.extractInnerMatch(candidate, offset, this.text);\n\n if (match) {\n if (this.options.v2) {\n var phoneNumber = new _PhoneNumber[\"default\"](match.country || match.countryCallingCode, match.phone, this.metadata);\n\n if (match.ext) {\n phoneNumber.ext = match.ext;\n }\n\n return {\n startsAt: match.startsAt,\n endsAt: match.endsAt,\n number: phoneNumber\n };\n }\n\n return match;\n }\n }\n\n this.maxTries--;\n }\n }\n /**\r\n * Attempts to extract a match from `substring`\r\n * if the substring itself does not qualify as a match.\r\n */\n\n }, {\n key: \"extractInnerMatch\",\n value: function extractInnerMatch(substring, offset, text) {\n for (var _i = 0, _INNER_MATCHES = INNER_MATCHES; _i < _INNER_MATCHES.length; _i++) {\n var innerMatchPattern = _INNER_MATCHES[_i];\n var isFirstMatch = true;\n var candidateMatch = void 0;\n var innerMatchRegExp = new RegExp(innerMatchPattern, 'g');\n\n while (this.maxTries > 0 && (candidateMatch = innerMatchRegExp.exec(substring)) !== null) {\n if (isFirstMatch) {\n // We should handle any group before this one too.\n var _candidate = (0, _util.trimAfterFirstMatch)(UNWANTED_END_CHAR_PATTERN, substring.slice(0, candidateMatch.index));\n\n var _match = this.parseAndVerify(_candidate, offset, text);\n\n if (_match) {\n return _match;\n }\n\n this.maxTries--;\n isFirstMatch = false;\n }\n\n var candidate = (0, _util.trimAfterFirstMatch)(UNWANTED_END_CHAR_PATTERN, candidateMatch[1]); // Java code does `groupMatcher.start(1)` here,\n // but there's no way in javascript to get a `candidate` start index,\n // therefore resort to using this kind of an approximation.\n // (`groupMatcher` is called `candidateInSubstringMatch` in this javascript port)\n // https://stackoverflow.com/questions/15934353/get-index-of-each-capture-in-a-javascript-regex\n\n var candidateIndexGuess = substring.indexOf(candidate, candidateMatch.index);\n var match = this.parseAndVerify(candidate, offset + candidateIndexGuess, text);\n\n if (match) {\n return match;\n }\n\n this.maxTries--;\n }\n }\n }\n /**\r\n * Parses a phone number from the `candidate` using `parseNumber` and\r\n * verifies it matches the requested `leniency`. If parsing and verification succeed,\r\n * a corresponding `PhoneNumberMatch` is returned, otherwise this method returns `null`.\r\n *\r\n * @param candidate the candidate match\r\n * @param offset the offset of {@code candidate} within {@link #text}\r\n * @return the parsed and validated phone number match, or null\r\n */\n\n }, {\n key: \"parseAndVerify\",\n value: function parseAndVerify(candidate, offset, text) {\n if (!(0, _isValidCandidate[\"default\"])(candidate, offset, text, this.options.leniency)) {\n return;\n }\n\n var number = (0, _parse_[\"default\"])(candidate, {\n extended: true,\n defaultCountry: this.options.defaultCountry,\n defaultCallingCode: this.options.defaultCallingCode\n }, this.metadata);\n\n if (!number.possible) {\n return;\n }\n\n if (this.leniency(number, candidate, this.metadata, this.regExpCache)) {\n // // We used parseAndKeepRawInput to create this number,\n // // but for now we don't return the extra values parsed.\n // // TODO: stop clearing all values here and switch all users over\n // // to using rawInput() rather than the rawString() of PhoneNumberMatch.\n // number.clearCountryCodeSource()\n // number.clearRawInput()\n // number.clearPreferredDomesticCarrierCode()\n var result = {\n startsAt: offset,\n endsAt: offset + candidate.length,\n phone: number.phone\n };\n\n if (number.country && number.country !== '001') {\n result.country = number.country;\n } else {\n result.countryCallingCode = number.countryCallingCode;\n }\n\n if (number.ext) {\n result.ext = number.ext;\n }\n\n return result;\n }\n }\n }, {\n key: \"hasNext\",\n value: function hasNext() {\n if (this.state === 'NOT_READY') {\n this.lastMatch = this.find(); // (this.searchIndex)\n\n if (this.lastMatch) {\n // this.searchIndex = this.lastMatch.endsAt\n this.state = 'READY';\n } else {\n this.state = 'DONE';\n }\n }\n\n return this.state === 'READY';\n }\n }, {\n key: \"next\",\n value: function next() {\n // Check the state and find the next match as a side-effect if necessary.\n if (!this.hasNext()) {\n throw new Error('No next element');\n } // Don't retain that memory any longer than necessary.\n\n\n var result = this.lastMatch;\n this.lastMatch = null;\n this.state = 'NOT_READY';\n return result;\n }\n }]);\n\n return PhoneNumberMatcher;\n}();\n\nexports[\"default\"] = PhoneNumberMatcher;\n//# sourceMappingURL=PhoneNumberMatcher.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = findNumbers;\n\nvar _PhoneNumberMatcher = _interopRequireDefault(require(\"./PhoneNumberMatcher\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction findNumbers(text, options, metadata) {\n var matcher = new _PhoneNumberMatcher[\"default\"](text, options, metadata);\n var results = [];\n\n while (matcher.hasNext()) {\n results.push(matcher.next());\n }\n\n return results;\n}\n//# sourceMappingURL=findNumbers_.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = findNumbers;\n\nvar _findNumbers_ = _interopRequireDefault(require(\"./findNumbers_\"));\n\nvar _parsePhoneNumber = require(\"./parsePhoneNumber\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction findNumbers() {\n var _normalizeArguments = (0, _parsePhoneNumber.normalizeArguments)(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return (0, _findNumbers_[\"default\"])(text, options, metadata);\n}\n//# sourceMappingURL=findNumbers.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = searchNumbers;\n\nvar _parsePhoneNumber = require(\"./parsePhoneNumber\");\n\nvar _PhoneNumberMatcher = _interopRequireDefault(require(\"./PhoneNumberMatcher\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\r\n * @return ES6 `for ... of` iterator.\r\n */\nfunction searchNumbers() {\n var _normalizeArguments = (0, _parsePhoneNumber.normalizeArguments)(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n var matcher = new _PhoneNumberMatcher[\"default\"](text, options, metadata);\n return _defineProperty({}, Symbol.iterator, function () {\n return {\n next: function next() {\n if (matcher.hasNext()) {\n return {\n done: false,\n value: matcher.next()\n };\n }\n\n return {\n done: true\n };\n }\n };\n });\n}\n//# sourceMappingURL=searchNumbers.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = findPhoneNumbersInText;\nexports.getArguments = getArguments;\n\nvar _findNumbers = _interopRequireDefault(require(\"./findNumbers\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction findPhoneNumbersInText(text, defaultCountry, options, metadata) {\n var args = getArguments(defaultCountry, options, metadata);\n return (0, _findNumbers[\"default\"])(text, args.options, args.metadata);\n}\n\nfunction getArguments(defaultCountry, options, metadata) {\n if (metadata) {\n if (defaultCountry) {\n options = _objectSpread({}, options, {\n defaultCountry: defaultCountry\n });\n }\n } else {\n if (options) {\n metadata = options;\n\n if (defaultCountry) {\n if (is_object(defaultCountry)) {\n options = defaultCountry;\n } else {\n options = {\n defaultCountry: defaultCountry\n };\n }\n } else {\n options = undefined;\n }\n } else {\n metadata = defaultCountry;\n options = undefined;\n }\n }\n\n return {\n options: _objectSpread({}, options, {\n v2: true\n }),\n metadata: metadata\n };\n} // Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n\n/* istanbul ignore next */\n\n\nvar is_object = function is_object(_) {\n return _typeof(_) === 'object';\n};\n//# sourceMappingURL=findPhoneNumbersInText.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = searchPhoneNumbersInText;\n\nvar _searchNumbers = _interopRequireDefault(require(\"./searchNumbers\"));\n\nvar _findPhoneNumbersInText = require(\"./findPhoneNumbersInText\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction searchPhoneNumbersInText(text, defaultCountry, options, metadata) {\n var args = (0, _findPhoneNumbersInText.getArguments)(defaultCountry, options, metadata);\n return (0, _searchNumbers[\"default\"])(text, args.options, args.metadata);\n}\n//# sourceMappingURL=searchPhoneNumbersInText.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar AsYouTypeState =\n/*#__PURE__*/\nfunction () {\n function AsYouTypeState(_ref) {\n var _this = this;\n\n var onCountryChange = _ref.onCountryChange,\n onCallingCodeChange = _ref.onCallingCodeChange;\n\n _classCallCheck(this, AsYouTypeState);\n\n _defineProperty(this, \"update\", function (properties) {\n for (var _i = 0, _Object$keys = Object.keys(properties); _i < _Object$keys.length; _i++) {\n var key = _Object$keys[_i];\n _this[key] = properties[key];\n }\n });\n\n this.onCountryChange = onCountryChange;\n this.onCallingCodeChange = onCallingCodeChange;\n }\n\n _createClass(AsYouTypeState, [{\n key: \"reset\",\n value: function reset(defaultCountry, defaultCallingCode) {\n this.international = false;\n this.IDDPrefix = undefined;\n this.missingPlus = undefined;\n this.callingCode = undefined;\n this.digits = '';\n this.resetNationalSignificantNumber();\n this.initCountryAndCallingCode(defaultCountry, defaultCallingCode);\n }\n }, {\n key: \"resetNationalSignificantNumber\",\n value: function resetNationalSignificantNumber() {\n this.nationalSignificantNumber = this.getNationalDigits();\n this.nationalSignificantNumberMatchesInput = true;\n this.nationalPrefix = undefined;\n this.carrierCode = undefined;\n this.complexPrefixBeforeNationalSignificantNumber = undefined;\n }\n }, {\n key: \"initCountryAndCallingCode\",\n value: function initCountryAndCallingCode(country, callingCode) {\n this.setCountry(country);\n this.setCallingCode(callingCode);\n }\n }, {\n key: \"setCountry\",\n value: function setCountry(country) {\n this.country = country;\n this.onCountryChange(country);\n }\n }, {\n key: \"setCallingCode\",\n value: function setCallingCode(callingCode) {\n this.callingCode = callingCode;\n return this.onCallingCodeChange(this.country, callingCode);\n }\n }, {\n key: \"startInternationalNumber\",\n value: function startInternationalNumber() {\n // Prepend the `+` to parsed input.\n this.international = true; // If a default country was set then reset it\n // because an explicitly international phone\n // number is being entered.\n\n this.initCountryAndCallingCode();\n }\n }, {\n key: \"appendDigits\",\n value: function appendDigits(nextDigits) {\n this.digits += nextDigits;\n }\n }, {\n key: \"appendNationalSignificantNumberDigits\",\n value: function appendNationalSignificantNumberDigits(nextDigits) {\n this.nationalSignificantNumber += nextDigits;\n }\n /**\r\n * Returns the part of `this.digits` that corresponds to the national number.\r\n * Basically, all digits that have been input by the user, except for the\r\n * international prefix and the country calling code part\r\n * (if the number is an international one).\r\n * @return {string}\r\n */\n\n }, {\n key: \"getNationalDigits\",\n value: function getNationalDigits() {\n if (this.international) {\n return this.digits.slice((this.IDDPrefix ? this.IDDPrefix.length : 0) + (this.callingCode ? this.callingCode.length : 0));\n }\n\n return this.digits;\n }\n }, {\n key: \"getDigitsWithoutInternationalPrefix\",\n value: function getDigitsWithoutInternationalPrefix() {\n if (this.international) {\n if (this.IDDPrefix) {\n return this.digits.slice(this.IDDPrefix.length);\n }\n }\n\n return this.digits;\n }\n }]);\n\n return AsYouTypeState;\n}();\n\nexports[\"default\"] = AsYouTypeState;\n//# sourceMappingURL=AsYouTypeState.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.countOccurences = countOccurences;\nexports.repeat = repeat;\nexports.cutAndStripNonPairedParens = cutAndStripNonPairedParens;\nexports.closeNonPairedParens = closeNonPairedParens;\nexports.stripNonPairedParens = stripNonPairedParens;\nexports.populateTemplateWithDigits = populateTemplateWithDigits;\nexports.DIGIT_PLACEHOLDER = void 0;\n// Should be the same as `DIGIT_PLACEHOLDER` in `libphonenumber-metadata-generator`.\nvar DIGIT_PLACEHOLDER = 'x'; // '\\u2008' (punctuation space)\n\nexports.DIGIT_PLACEHOLDER = DIGIT_PLACEHOLDER;\nvar DIGIT_PLACEHOLDER_MATCHER = new RegExp(DIGIT_PLACEHOLDER); // Counts all occurences of a symbol in a string.\n// Unicode-unsafe (because using `.split()`).\n\nfunction countOccurences(symbol, string) {\n var count = 0; // Using `.split('')` to iterate through a string here\n // to avoid requiring `Symbol.iterator` polyfill.\n // `.split('')` is generally not safe for Unicode,\n // but in this particular case for counting brackets it is safe.\n // for (const character of string)\n\n for (var _iterator = string.split(''), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var character = _ref;\n\n if (character === symbol) {\n count++;\n }\n }\n\n return count;\n} // Repeats a string (or a symbol) N times.\n// http://stackoverflow.com/questions/202605/repeat-string-javascript\n\n\nfunction repeat(string, times) {\n if (times < 1) {\n return '';\n }\n\n var result = '';\n\n while (times > 1) {\n if (times & 1) {\n result += string;\n }\n\n times >>= 1;\n string += string;\n }\n\n return result + string;\n}\n\nfunction cutAndStripNonPairedParens(string, cutBeforeIndex) {\n if (string[cutBeforeIndex] === ')') {\n cutBeforeIndex++;\n }\n\n return stripNonPairedParens(string.slice(0, cutBeforeIndex));\n}\n\nfunction closeNonPairedParens(template, cut_before) {\n var retained_template = template.slice(0, cut_before);\n var opening_braces = countOccurences('(', retained_template);\n var closing_braces = countOccurences(')', retained_template);\n var dangling_braces = opening_braces - closing_braces;\n\n while (dangling_braces > 0 && cut_before < template.length) {\n if (template[cut_before] === ')') {\n dangling_braces--;\n }\n\n cut_before++;\n }\n\n return template.slice(0, cut_before);\n}\n\nfunction stripNonPairedParens(string) {\n var dangling_braces = [];\n var i = 0;\n\n while (i < string.length) {\n if (string[i] === '(') {\n dangling_braces.push(i);\n } else if (string[i] === ')') {\n dangling_braces.pop();\n }\n\n i++;\n }\n\n var start = 0;\n var cleared_string = '';\n dangling_braces.push(string.length);\n\n for (var _i2 = 0, _dangling_braces = dangling_braces; _i2 < _dangling_braces.length; _i2++) {\n var index = _dangling_braces[_i2];\n cleared_string += string.slice(start, index);\n start = index + 1;\n }\n\n return cleared_string;\n}\n\nfunction populateTemplateWithDigits(template, position, digits) {\n // Using `.split('')` to iterate through a string here\n // to avoid requiring `Symbol.iterator` polyfill.\n // `.split('')` is generally not safe for Unicode,\n // but in this particular case for `digits` it is safe.\n // for (const digit of digits)\n for (var _iterator2 = digits.split(''), _isArray2 = Array.isArray(_iterator2), _i3 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {\n var _ref2;\n\n if (_isArray2) {\n if (_i3 >= _iterator2.length) break;\n _ref2 = _iterator2[_i3++];\n } else {\n _i3 = _iterator2.next();\n if (_i3.done) break;\n _ref2 = _i3.value;\n }\n\n var digit = _ref2;\n\n // If there is room for more digits in current `template`,\n // then set the next digit in the `template`,\n // and return the formatted digits so far.\n // If more digits are entered than the current format could handle.\n if (template.slice(position + 1).search(DIGIT_PLACEHOLDER_MATCHER) < 0) {\n return;\n }\n\n position = template.search(DIGIT_PLACEHOLDER_MATCHER);\n template = template.replace(DIGIT_PLACEHOLDER_MATCHER, digit);\n }\n\n return [template, position];\n}\n//# sourceMappingURL=AsYouTypeFormatter.util.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = formatCompleteNumber;\nexports.canFormatCompleteNumber = canFormatCompleteNumber;\n\nvar _checkNumberLength = _interopRequireDefault(require(\"./helpers/checkNumberLength\"));\n\nvar _parseDigits = _interopRequireDefault(require(\"./helpers/parseDigits\"));\n\nvar _formatNationalNumberUsingFormat = _interopRequireDefault(require(\"./helpers/formatNationalNumberUsingFormat\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction formatCompleteNumber(state, format, _ref) {\n var metadata = _ref.metadata,\n shouldTryNationalPrefixFormattingRule = _ref.shouldTryNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix = _ref.getSeparatorAfterNationalPrefix;\n var matcher = new RegExp(\"^(?:\".concat(format.pattern(), \")$\"));\n\n if (matcher.test(state.nationalSignificantNumber)) {\n return formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format, {\n metadata: metadata,\n shouldTryNationalPrefixFormattingRule: shouldTryNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix\n });\n }\n}\n\nfunction canFormatCompleteNumber(nationalSignificantNumber, metadata) {\n return (0, _checkNumberLength[\"default\"])(nationalSignificantNumber, metadata) === 'IS_POSSIBLE';\n}\n\nfunction formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format, _ref2) {\n var metadata = _ref2.metadata,\n shouldTryNationalPrefixFormattingRule = _ref2.shouldTryNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix = _ref2.getSeparatorAfterNationalPrefix;\n // `format` has already been checked for `nationalPrefix` requirement.\n var nationalSignificantNumber = state.nationalSignificantNumber,\n international = state.international,\n nationalPrefix = state.nationalPrefix,\n carrierCode = state.carrierCode; // Format the number with using `national_prefix_formatting_rule`.\n // If the resulting formatted number is a valid formatted number, then return it.\n //\n // Google's AsYouType formatter is different in a way that it doesn't try\n // to format using the \"national prefix formatting rule\", and instead it\n // simply prepends a national prefix followed by a \" \" character.\n // This code does that too, but as a fallback.\n // The reason is that \"national prefix formatting rule\" may use parentheses,\n // which wouldn't be included has it used the simpler Google's way.\n //\n\n if (shouldTryNationalPrefixFormattingRule(format)) {\n var formattedNumber = formatNationalNumber(state, format, {\n useNationalPrefixFormattingRule: true,\n getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix,\n metadata: metadata\n });\n\n if (formattedNumber) {\n return formattedNumber;\n }\n } // Format the number without using `national_prefix_formatting_rule`.\n\n\n return formatNationalNumber(state, format, {\n useNationalPrefixFormattingRule: false,\n getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix,\n metadata: metadata\n });\n}\n\nfunction formatNationalNumber(state, format, _ref3) {\n var metadata = _ref3.metadata,\n useNationalPrefixFormattingRule = _ref3.useNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix = _ref3.getSeparatorAfterNationalPrefix;\n var formattedNationalNumber = (0, _formatNationalNumberUsingFormat[\"default\"])(state.nationalSignificantNumber, format, {\n carrierCode: state.carrierCode,\n useInternationalFormat: state.international,\n withNationalPrefix: useNationalPrefixFormattingRule,\n metadata: metadata\n });\n\n if (!useNationalPrefixFormattingRule) {\n if (state.nationalPrefix) {\n // If a national prefix was extracted, then just prepend it,\n // followed by a \" \" character.\n formattedNationalNumber = state.nationalPrefix + getSeparatorAfterNationalPrefix(format) + formattedNationalNumber;\n } else if (state.complexPrefixBeforeNationalSignificantNumber) {\n formattedNationalNumber = state.complexPrefixBeforeNationalSignificantNumber + ' ' + formattedNationalNumber;\n }\n }\n\n if (isValidFormattedNationalNumber(formattedNationalNumber, state)) {\n return formattedNationalNumber;\n }\n} // Check that the formatted phone number contains exactly\n// the same digits that have been input by the user.\n// For example, when \"0111523456789\" is input for `AR` country,\n// the extracted `this.nationalSignificantNumber` is \"91123456789\",\n// which means that the national part of `this.digits` isn't simply equal to\n// `this.nationalPrefix` + `this.nationalSignificantNumber`.\n//\n// Also, a `format` can add extra digits to the `this.nationalSignificantNumber`\n// being formatted via `metadata[country].national_prefix_transform_rule`.\n// For example, for `VI` country, it prepends `340` to the national number,\n// and if this check hasn't been implemented, then there would be a bug\n// when `340` \"area coude\" is \"duplicated\" during input for `VI` country:\n// https://github.com/catamphetamine/libphonenumber-js/issues/318\n//\n// So, all these \"gotchas\" are filtered out.\n//\n// In the original Google's code, the comments say:\n// \"Check that we didn't remove nor add any extra digits when we matched\n// this formatting pattern. This usually happens after we entered the last\n// digit during AYTF. Eg: In case of MX, we swallow mobile token (1) when\n// formatted but AYTF should retain all the number entered and not change\n// in order to match a format (of same leading digits and length) display\n// in that way.\"\n// \"If it's the same (i.e entered number and format is same), then it's\n// safe to return this in formatted number as nothing is lost / added.\"\n// Otherwise, don't use this format.\n// https://github.com/google/libphonenumber/commit/3e7c1f04f5e7200f87fb131e6f85c6e99d60f510#diff-9149457fa9f5d608a11bb975c6ef4bc5\n// https://github.com/google/libphonenumber/commit/3ac88c7106e7dcb553bcc794b15f19185928a1c6#diff-2dcb77e833422ee304da348b905cde0b\n//\n\n\nfunction isValidFormattedNationalNumber(formattedNationalNumber, state) {\n return (0, _parseDigits[\"default\"])(formattedNationalNumber) === state.getNationalDigits();\n}\n//# sourceMappingURL=AsYouTypeFormatter.complete.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar PatternMatcher =\n/*#__PURE__*/\nfunction () {\n function PatternMatcher(pattern) {\n _classCallCheck(this, PatternMatcher);\n\n this.matchTree = new PatternParser().parse(pattern);\n }\n\n _createClass(PatternMatcher, [{\n key: \"match\",\n value: function match(string) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n allowOverflow = _ref.allowOverflow;\n\n if (!string) {\n throw new Error('String is required');\n }\n\n var result = _match(string.split(''), this.matchTree, true);\n\n if (result && result.match) {\n delete result.matchedChars;\n }\n\n if (result && result.overflow) {\n if (!allowOverflow) {\n return;\n }\n }\n\n return result;\n }\n }]);\n\n return PatternMatcher;\n}();\n\nexports[\"default\"] = PatternMatcher;\n\nfunction _match(characters, tree, last) {\n if (typeof tree === 'string') {\n if (last) {\n // `tree` is always a single character.\n if (characters.length > tree.length) {\n return {\n overflow: true\n };\n }\n }\n\n var characterString = characters.join('');\n\n if (tree.indexOf(characterString) === 0) {\n // `tree` is always a single character.\n // If `tree.indexOf(characterString) === 0`\n // then `characters.length === tree.length`.\n\n /* istanbul ignore else */\n if (characters.length === tree.length) {\n return {\n match: true,\n matchedChars: characters\n };\n } // `tree` is always a single character.\n // If `tree.indexOf(characterString) === 0`\n // then `characters.length === tree.length`.\n\n /* istanbul ignore next */\n\n\n return {\n partialMatch: true // matchedChars: characters\n\n };\n }\n\n if (characterString.indexOf(tree) === 0) {\n return {\n match: true,\n matchedChars: characters.slice(0, tree.length)\n };\n }\n\n return;\n }\n\n if (Array.isArray(tree)) {\n var restCharacters = characters.slice();\n var i = 0;\n\n while (i < tree.length) {\n var subtree = tree[i];\n\n var result = _match(restCharacters, subtree, last && i === tree.length - 1);\n\n if (!result) {\n return;\n } else if (result.overflow) {\n return result;\n } else if (result.match) {\n // Continue with the next subtree with the rest of the characters.\n restCharacters = restCharacters.slice(result.matchedChars.length);\n\n if (restCharacters.length === 0) {\n if (i === tree.length - 1) {\n return {\n match: true,\n matchedChars: characters\n };\n } else {\n return {\n partialMatch: true // matchedChars: characters\n\n };\n }\n }\n } else {\n /* istanbul ignore else */\n if (result.partialMatch) {\n return {\n partialMatch: true // matchedChars: characters\n\n };\n } else {\n throw new Error(\"Unsupported match result:\\n\".concat(JSON.stringify(result, null, 2)));\n }\n }\n\n i++;\n } // If `last` then overflow has already been checked\n // by the last element of the `tree` array.\n\n /* istanbul ignore if */\n\n\n if (last) {\n return {\n overflow: true\n };\n }\n\n return {\n match: true,\n matchedChars: characters.slice(0, characters.length - restCharacters.length)\n };\n }\n\n switch (tree.op) {\n case '|':\n var partialMatch;\n\n for (var _iterator = tree.args, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref2;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref2 = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref2 = _i.value;\n }\n\n var branch = _ref2;\n\n var _result = _match(characters, branch, last);\n\n if (_result) {\n if (_result.overflow) {\n return _result;\n } else if (_result.match) {\n return {\n match: true,\n matchedChars: _result.matchedChars\n };\n } else {\n /* istanbul ignore else */\n if (_result.partialMatch) {\n partialMatch = true;\n } else {\n throw new Error(\"Unsupported match result:\\n\".concat(JSON.stringify(_result, null, 2)));\n }\n }\n }\n }\n\n if (partialMatch) {\n return {\n partialMatch: true // matchedChars: ...\n\n };\n } // Not even a partial match.\n\n\n return;\n\n case '[]':\n for (var _iterator2 = tree.args, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {\n var _ref3;\n\n if (_isArray2) {\n if (_i2 >= _iterator2.length) break;\n _ref3 = _iterator2[_i2++];\n } else {\n _i2 = _iterator2.next();\n if (_i2.done) break;\n _ref3 = _i2.value;\n }\n\n var _char = _ref3;\n\n if (characters[0] === _char) {\n if (characters.length === 1) {\n return {\n match: true,\n matchedChars: characters\n };\n }\n\n if (last) {\n return {\n overflow: true\n };\n }\n\n return {\n match: true,\n matchedChars: [_char]\n };\n }\n } // No character matches.\n\n\n return;\n\n /* istanbul ignore next */\n\n default:\n throw new Error(\"Unsupported instruction tree: \".concat(tree));\n }\n}\n\nvar OPERATOR = new RegExp( // any of:\n'(' + // or operator\n'\\\\|' + // or\n'|' + // or group start\n'\\\\(\\\\?\\\\:' + // or\n'|' + // or group end\n'\\\\)' + // or\n'|' + // one-of set start\n'\\\\[' + // or\n'|' + // one-of set end\n'\\\\]' + ')');\nvar ILLEGAL_CHARACTER_REGEXP = /[\\(\\)\\[\\]\\?\\:\\|]/;\n\nvar PatternParser =\n/*#__PURE__*/\nfunction () {\n function PatternParser() {\n _classCallCheck(this, PatternParser);\n }\n\n _createClass(PatternParser, [{\n key: \"parse\",\n value: function parse(pattern) {\n this.context = [{\n or: true,\n instructions: []\n }];\n this.parsePattern(pattern);\n\n if (this.context.length !== 1) {\n throw new Error('Non-finalized contexts left when pattern parse ended');\n }\n\n var _this$context$ = this.context[0],\n branches = _this$context$.branches,\n instructions = _this$context$.instructions;\n\n if (branches) {\n return [{\n op: '|',\n args: branches.concat([instructions])\n }];\n }\n /* istanbul ignore if */\n\n\n if (instructions.length === 0) {\n throw new Error('Pattern is required');\n }\n\n return instructions;\n }\n }, {\n key: \"startContext\",\n value: function startContext(context) {\n this.context.push(context);\n }\n }, {\n key: \"endContext\",\n value: function endContext() {\n this.context.pop();\n }\n }, {\n key: \"getContext\",\n value: function getContext() {\n return this.context[this.context.length - 1];\n }\n }, {\n key: \"parsePattern\",\n value: function parsePattern(pattern) {\n if (!pattern) {\n throw new Error('Pattern is required');\n }\n\n var match = pattern.match(OPERATOR);\n\n if (!match) {\n if (ILLEGAL_CHARACTER_REGEXP.test(pattern)) {\n throw new Error(\"Illegal characters found in a pattern: \".concat(pattern));\n }\n\n this.getContext().instructions = this.getContext().instructions.concat(pattern.split(''));\n return;\n }\n\n var operator = match[1];\n var before = pattern.slice(0, match.index);\n var rightPart = pattern.slice(match.index + operator.length);\n\n switch (operator) {\n case '(?:':\n if (before) {\n this.parsePattern(before);\n }\n\n this.startContext({\n or: true,\n instructions: [],\n branches: []\n });\n break;\n\n case ')':\n if (!this.getContext().or) {\n throw new Error('\")\" operator must be preceded by \"(?:\" operator');\n }\n\n if (before) {\n this.parsePattern(before);\n }\n\n if (this.getContext().instructions.length === 0) {\n throw new Error('No instructions found after \"|\" operator in an \"or\" group');\n }\n\n var _this$getContext = this.getContext(),\n branches = _this$getContext.branches;\n\n branches.push(this.getContext().instructions);\n this.endContext();\n this.getContext().instructions.push({\n op: '|',\n args: branches\n });\n break;\n\n case '|':\n if (!this.getContext().or) {\n throw new Error('\"|\" operator can only be used inside \"or\" groups');\n }\n\n if (before) {\n this.parsePattern(before);\n } // The top-level is an implicit \"or\" group, if required.\n\n\n if (!this.getContext().branches) {\n // `branches` are not defined only for the root implicit \"or\" operator.\n\n /* istanbul ignore else */\n if (this.context.length === 1) {\n this.getContext().branches = [];\n } else {\n throw new Error('\"branches\" not found in an \"or\" group context');\n }\n }\n\n this.getContext().branches.push(this.getContext().instructions);\n this.getContext().instructions = [];\n break;\n\n case '[':\n if (before) {\n this.parsePattern(before);\n }\n\n this.startContext({\n oneOfSet: true\n });\n break;\n\n case ']':\n if (!this.getContext().oneOfSet) {\n throw new Error('\"]\" operator must be preceded by \"[\" operator');\n }\n\n this.endContext();\n this.getContext().instructions.push({\n op: '[]',\n args: parseOneOfSet(before)\n });\n break;\n\n /* istanbul ignore next */\n\n default:\n throw new Error(\"Unknown operator: \".concat(operator));\n }\n\n if (rightPart) {\n this.parsePattern(rightPart);\n }\n }\n }]);\n\n return PatternParser;\n}();\n\nfunction parseOneOfSet(pattern) {\n var values = [];\n var i = 0;\n\n while (i < pattern.length) {\n if (pattern[i] === '-') {\n if (i === 0 || i === pattern.length - 1) {\n throw new Error(\"Couldn't parse a one-of set pattern: \".concat(pattern));\n }\n\n var prevValue = pattern[i - 1].charCodeAt(0) + 1;\n var nextValue = pattern[i + 1].charCodeAt(0) - 1;\n var value = prevValue;\n\n while (value <= nextValue) {\n values.push(String.fromCharCode(value));\n value++;\n }\n } else {\n values.push(pattern[i]);\n }\n\n i++;\n }\n\n return values;\n}\n//# sourceMappingURL=AsYouTypeFormatter.PatternMatcher.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"DIGIT_PLACEHOLDER\", {\n enumerable: true,\n get: function get() {\n return _AsYouTypeFormatter.DIGIT_PLACEHOLDER;\n }\n});\nexports[\"default\"] = void 0;\n\nvar _AsYouTypeFormatter = require(\"./AsYouTypeFormatter.util\");\n\nvar _AsYouTypeFormatter2 = _interopRequireWildcard(require(\"./AsYouTypeFormatter.complete\"));\n\nvar _AsYouTypeFormatter3 = _interopRequireDefault(require(\"./AsYouTypeFormatter.PatternMatcher\"));\n\nvar _parseDigits = _interopRequireDefault(require(\"./helpers/parseDigits\"));\n\nvar _formatNationalNumberUsingFormat = require(\"./helpers/formatNationalNumberUsingFormat\");\n\nvar _constants = require(\"./constants\");\n\nvar _applyInternationalSeparatorStyle = _interopRequireDefault(require(\"./helpers/applyInternationalSeparatorStyle\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj[\"default\"] = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n// Used in phone number format template creation.\n// Could be any digit, I guess.\nvar DUMMY_DIGIT = '9'; // I don't know why is it exactly `15`\n\nvar LONGEST_NATIONAL_PHONE_NUMBER_LENGTH = 15; // Create a phone number consisting only of the digit 9 that matches the\n// `number_pattern` by applying the pattern to the \"longest phone number\" string.\n\nvar LONGEST_DUMMY_PHONE_NUMBER = (0, _AsYouTypeFormatter.repeat)(DUMMY_DIGIT, LONGEST_NATIONAL_PHONE_NUMBER_LENGTH); // A set of characters that, if found in a national prefix formatting rules, are an indicator to\n// us that we should separate the national prefix from the number when formatting.\n\nvar NATIONAL_PREFIX_SEPARATORS_PATTERN = /[- ]/; // Deprecated: Google has removed some formatting pattern related code from their repo.\n// https://github.com/googlei18n/libphonenumber/commit/a395b4fef3caf57c4bc5f082e1152a4d2bd0ba4c\n// \"We no longer have numbers in formatting matching patterns, only \\d.\"\n// Because this library supports generating custom metadata\n// some users may still be using old metadata so the relevant\n// code seems to stay until some next major version update.\n\nvar SUPPORT_LEGACY_FORMATTING_PATTERNS = true; // A pattern that is used to match character classes in regular expressions.\n// An example of a character class is \"[1-4]\".\n\nvar CREATE_CHARACTER_CLASS_PATTERN = SUPPORT_LEGACY_FORMATTING_PATTERNS && function () {\n return /\\[([^\\[\\]])*\\]/g;\n}; // Any digit in a regular expression that actually denotes a digit. For\n// example, in the regular expression \"80[0-2]\\d{6,10}\", the first 2 digits\n// (8 and 0) are standalone digits, but the rest are not.\n// Two look-aheads are needed because the number following \\\\d could be a\n// two-digit number, since the phone number can be as long as 15 digits.\n\n\nvar CREATE_STANDALONE_DIGIT_PATTERN = SUPPORT_LEGACY_FORMATTING_PATTERNS && function () {\n return /\\d(?=[^,}][^,}])/g;\n}; // A regular expression that is used to determine if a `format` is\n// suitable to be used in the \"as you type formatter\".\n// A `format` is suitable when the resulting formatted number has\n// the same digits as the user has entered.\n//\n// In the simplest case, that would mean that the format\n// doesn't add any additional digits when formatting a number.\n// Google says that it also shouldn't add \"star\" (`*`) characters,\n// like it does in some Israeli formats.\n// Such basic format would only contain \"valid punctuation\"\n// and \"captured group\" identifiers ($1, $2, etc).\n//\n// An example of a format that adds additional digits:\n//\n// Country: `AR` (Argentina).\n// Format:\n// {\n// \"pattern\": \"(\\\\d)(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\n// \"leading_digits_patterns\": [\"91\"],\n// \"national_prefix_formatting_rule\": \"0$1\",\n// \"format\": \"$2 15-$3-$4\",\n// \"international_format\": \"$1 $2 $3-$4\"\n// }\n//\n// In the format above, the `format` adds `15` to the digits when formatting a number.\n// A sidenote: this format actually is suitable because `national_prefix_for_parsing`\n// has previously removed `15` from a national number, so re-adding `15` in `format`\n// doesn't actually result in any extra digits added to user's input.\n// But verifying that would be a complex procedure, so the code chooses a simpler path:\n// it simply filters out all `format`s that contain anything but \"captured group\" ids.\n//\n// This regular expression is called `ELIGIBLE_FORMAT_PATTERN` in Google's\n// `libphonenumber` code.\n//\n\n\nvar NON_ALTERING_FORMAT_REG_EXP = new RegExp('[' + _constants.VALID_PUNCTUATION + ']*' + // Google developers say:\n// \"We require that the first matching group is present in the\n// output pattern to ensure no data is lost while formatting.\"\n'\\\\$1' + '[' + _constants.VALID_PUNCTUATION + ']*' + '(\\\\$\\\\d[' + _constants.VALID_PUNCTUATION + ']*)*' + '$'); // This is the minimum length of the leading digits of a phone number\n// to guarantee the first \"leading digits pattern\" for a phone number format\n// to be preemptive.\n\nvar MIN_LEADING_DIGITS_LENGTH = 3;\n\nvar AsYouTypeFormatter =\n/*#__PURE__*/\nfunction () {\n function AsYouTypeFormatter(_ref) {\n var _this = this;\n\n var state = _ref.state,\n metadata = _ref.metadata;\n\n _classCallCheck(this, AsYouTypeFormatter);\n\n _defineProperty(this, \"getSeparatorAfterNationalPrefix\", function (format) {\n // `US` metadata doesn't have a `national_prefix_formatting_rule`,\n // so the `if` condition below doesn't apply to `US`,\n // but in reality there shoudl be a separator\n // between a national prefix and a national (significant) number.\n // So `US` national prefix separator is a \"special\" \"hardcoded\" case.\n if (_this.isNANP) {\n return ' ';\n } // If a `format` has a `national_prefix_formatting_rule`\n // and that rule has a separator after a national prefix,\n // then it means that there should be a separator\n // between a national prefix and a national (significant) number.\n\n\n if (format && format.nationalPrefixFormattingRule() && NATIONAL_PREFIX_SEPARATORS_PATTERN.test(format.nationalPrefixFormattingRule())) {\n return ' ';\n } // At this point, there seems to be no clear evidence that\n // there should be a separator between a national prefix\n // and a national (significant) number. So don't insert one.\n\n\n return '';\n });\n\n _defineProperty(this, \"shouldTryNationalPrefixFormattingRule\", function (format, _ref2) {\n var international = _ref2.international,\n nationalPrefix = _ref2.nationalPrefix;\n\n if (format.nationalPrefixFormattingRule()) {\n // In some countries, `national_prefix_formatting_rule` is `($1)`,\n // so it applies even if the user hasn't input a national prefix.\n // `format.usesNationalPrefix()` detects such cases.\n var usesNationalPrefix = format.usesNationalPrefix();\n\n if (usesNationalPrefix && nationalPrefix || !usesNationalPrefix && !international) {\n return true;\n }\n }\n });\n\n this.metadata = metadata;\n this.resetFormat();\n }\n\n _createClass(AsYouTypeFormatter, [{\n key: \"resetFormat\",\n value: function resetFormat() {\n this.chosenFormat = undefined;\n this.template = undefined;\n this.nationalNumberTemplate = undefined;\n this.populatedNationalNumberTemplate = undefined;\n this.populatedNationalNumberTemplatePosition = -1;\n }\n }, {\n key: \"reset\",\n value: function reset(numberingPlan, state) {\n this.resetFormat();\n\n if (numberingPlan) {\n this.isNANP = numberingPlan.callingCode() === '1';\n this.matchingFormats = numberingPlan.formats();\n\n if (state.nationalSignificantNumber) {\n this.narrowDownMatchingFormats(state);\n }\n } else {\n this.isNANP = undefined;\n this.matchingFormats = [];\n }\n }\n /**\r\n * Formats an updated phone number.\r\n * @param {string} nextDigits — Additional phone number digits.\r\n * @param {object} state — `AsYouType` state.\r\n * @return {[string]} Returns undefined if the updated phone number can't be formatted using any of the available formats.\r\n */\n\n }, {\n key: \"format\",\n value: function format(nextDigits, state) {\n var _this2 = this;\n\n // See if the phone number digits can be formatted as a complete phone number.\n // If not, use the results from `formatNationalNumberWithNextDigits()`,\n // which formats based on the chosen formatting pattern.\n //\n // Attempting to format complete phone number first is how it's done\n // in Google's `libphonenumber`, so this library just follows it.\n // Google's `libphonenumber` code doesn't explain in detail why does it\n // attempt to format digits as a complete phone number\n // instead of just going with a previoulsy (or newly) chosen `format`:\n //\n // \"Checks to see if there is an exact pattern match for these digits.\n // If so, we should use this instead of any other formatting template\n // whose leadingDigitsPattern also matches the input.\"\n //\n if ((0, _AsYouTypeFormatter2.canFormatCompleteNumber)(state.nationalSignificantNumber, this.metadata)) {\n for (var _iterator = this.matchingFormats, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref3;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref3 = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref3 = _i.value;\n }\n\n var format = _ref3;\n var formattedCompleteNumber = (0, _AsYouTypeFormatter2[\"default\"])(state, format, {\n metadata: this.metadata,\n shouldTryNationalPrefixFormattingRule: function shouldTryNationalPrefixFormattingRule(format) {\n return _this2.shouldTryNationalPrefixFormattingRule(format, {\n international: state.international,\n nationalPrefix: state.nationalPrefix\n });\n },\n getSeparatorAfterNationalPrefix: this.getSeparatorAfterNationalPrefix\n });\n\n if (formattedCompleteNumber) {\n this.resetFormat();\n this.chosenFormat = format;\n this.setNationalNumberTemplate(formattedCompleteNumber.replace(/\\d/g, _AsYouTypeFormatter.DIGIT_PLACEHOLDER), state);\n this.populatedNationalNumberTemplate = formattedCompleteNumber; // With a new formatting template, the matched position\n // using the old template needs to be reset.\n\n this.populatedNationalNumberTemplatePosition = this.template.lastIndexOf(_AsYouTypeFormatter.DIGIT_PLACEHOLDER);\n return formattedCompleteNumber;\n }\n }\n } // Format the digits as a partial (incomplete) phone number\n // using the previously chosen formatting pattern (or a newly chosen one).\n\n\n return this.formatNationalNumberWithNextDigits(nextDigits, state);\n } // Formats the next phone number digits.\n\n }, {\n key: \"formatNationalNumberWithNextDigits\",\n value: function formatNationalNumberWithNextDigits(nextDigits, state) {\n var previouslyChosenFormat = this.chosenFormat; // Choose a format from the list of matching ones.\n\n var newlyChosenFormat = this.chooseFormat(state);\n\n if (newlyChosenFormat) {\n if (newlyChosenFormat === previouslyChosenFormat) {\n // If it can format the next (current) digits\n // using the previously chosen phone number format\n // then return the updated formatted number.\n return this.formatNextNationalNumberDigits(nextDigits);\n } else {\n // If a more appropriate phone number format\n // has been chosen for these \"leading digits\",\n // then re-format the national phone number part\n // using the newly selected format.\n return this.formatNextNationalNumberDigits(state.getNationalDigits());\n }\n }\n }\n }, {\n key: \"narrowDownMatchingFormats\",\n value: function narrowDownMatchingFormats(_ref4) {\n var _this3 = this;\n\n var nationalSignificantNumber = _ref4.nationalSignificantNumber,\n nationalPrefix = _ref4.nationalPrefix,\n international = _ref4.international;\n var leadingDigits = nationalSignificantNumber; // \"leading digits\" pattern list starts with a\n // \"leading digits\" pattern fitting a maximum of 3 leading digits.\n // So, after a user inputs 3 digits of a national (significant) phone number\n // this national (significant) number can already be formatted.\n // The next \"leading digits\" pattern is for 4 leading digits max,\n // and the \"leading digits\" pattern after it is for 5 leading digits max, etc.\n // This implementation is different from Google's\n // in that it searches for a fitting format\n // even if the user has entered less than\n // `MIN_LEADING_DIGITS_LENGTH` digits of a national number.\n // Because some leading digit patterns already match for a single first digit.\n\n var leadingDigitsPatternIndex = leadingDigits.length - MIN_LEADING_DIGITS_LENGTH;\n\n if (leadingDigitsPatternIndex < 0) {\n leadingDigitsPatternIndex = 0;\n }\n\n this.matchingFormats = this.matchingFormats.filter(function (format) {\n return _this3.formatSuits(format, international, nationalPrefix) && _this3.formatMatches(format, leadingDigits, leadingDigitsPatternIndex);\n }); // If there was a phone number format chosen\n // and it no longer holds given the new leading digits then reset it.\n // The test for this `if` condition is marked as:\n // \"Reset a chosen format when it no longer holds given the new leading digits\".\n // To construct a valid test case for this one can find a country\n // in `PhoneNumberMetadata.xml` yielding one format for 3 ``\n // and yielding another format for 4 `` (Australia in this case).\n\n if (this.chosenFormat && this.matchingFormats.indexOf(this.chosenFormat) === -1) {\n this.resetFormat();\n }\n }\n }, {\n key: \"formatSuits\",\n value: function formatSuits(format, international, nationalPrefix) {\n // When a prefix before a national (significant) number is\n // simply a national prefix, then it's parsed as `this.nationalPrefix`.\n // In more complex cases, a prefix before national (significant) number\n // could include a national prefix as well as some \"capturing groups\",\n // and in that case there's no info whether a national prefix has been parsed.\n // If national prefix is not used when formatting a phone number\n // using this format, but a national prefix has been entered by the user,\n // and was extracted, then discard such phone number format.\n // In Google's \"AsYouType\" formatter code, the equivalent would be this part:\n // https://github.com/google/libphonenumber/blob/0a45cfd96e71cad8edb0e162a70fcc8bd9728933/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L175-L184\n if (nationalPrefix && !format.usesNationalPrefix() && // !format.domesticCarrierCodeFormattingRule() &&\n !format.nationalPrefixIsOptionalWhenFormattingInNationalFormat()) {\n return false;\n } // If national prefix is mandatory for this phone number format\n // and there're no guarantees that a national prefix is present in user input\n // then discard this phone number format as not suitable.\n // In Google's \"AsYouType\" formatter code, the equivalent would be this part:\n // https://github.com/google/libphonenumber/blob/0a45cfd96e71cad8edb0e162a70fcc8bd9728933/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L185-L193\n\n\n if (!international && !nationalPrefix && format.nationalPrefixIsMandatoryWhenFormattingInNationalFormat()) {\n return false;\n }\n\n return true;\n }\n }, {\n key: \"formatMatches\",\n value: function formatMatches(format, leadingDigits, leadingDigitsPatternIndex) {\n var leadingDigitsPatternsCount = format.leadingDigitsPatterns().length; // If this format is not restricted to a certain\n // leading digits pattern then it fits.\n\n if (leadingDigitsPatternsCount === 0) {\n return true;\n } // Start narrowing down the list of possible formats based on the leading digits.\n // (only previously matched formats take part in the narrowing down process)\n // `leading_digits_patterns` start with 3 digits min\n // and then go up from there one digit at a time.\n\n\n leadingDigitsPatternIndex = Math.min(leadingDigitsPatternIndex, leadingDigitsPatternsCount - 1);\n var leadingDigitsPattern = format.leadingDigitsPatterns()[leadingDigitsPatternIndex]; // Google imposes a requirement on the leading digits\n // to be minimum 3 digits long in order to be eligible\n // for checking those with a leading digits pattern.\n //\n // Since `leading_digits_patterns` start with 3 digits min,\n // Google's original `libphonenumber` library only starts\n // excluding any non-matching formats only when the\n // national number entered so far is at least 3 digits long,\n // otherwise format matching would give false negatives.\n //\n // For example, when the digits entered so far are `2`\n // and the leading digits pattern is `21` –\n // it's quite obvious in this case that the format could be the one\n // but due to the absence of further digits it would give false negative.\n //\n // Also, `leading_digits_patterns` doesn't always correspond to a single\n // digits count. For example, `60|8` pattern would already match `8`\n // but the `60` part would require having at least two leading digits,\n // so the whole pattern would require inputting two digits first in order to\n // decide on whether it matches the input, even when the input is \"80\".\n //\n // This library — `libphonenumber-js` — allows filtering by `leading_digits_patterns`\n // even when there's only 1 or 2 digits of the national (significant) number.\n // To do that, it uses a non-strict pattern matcher written specifically for that.\n //\n\n if (leadingDigits.length < MIN_LEADING_DIGITS_LENGTH) {\n // Before leading digits < 3 matching was implemented:\n // return true\n //\n // After leading digits < 3 matching was implemented:\n try {\n return new _AsYouTypeFormatter3[\"default\"](leadingDigitsPattern).match(leadingDigits, {\n allowOverflow: true\n }) !== undefined;\n } catch (error)\n /* istanbul ignore next */\n {\n // There's a slight possibility that there could be some undiscovered bug\n // in the pattern matcher code. Since the \"leading digits < 3 matching\"\n // feature is not \"essential\" for operation, it can fall back to the old way\n // in case of any issues rather than halting the application's execution.\n console.error(error);\n return true;\n }\n } // If at least `MIN_LEADING_DIGITS_LENGTH` digits of a national number are\n // available then use the usual regular expression matching.\n //\n // The whole pattern is wrapped in round brackets (`()`) because\n // the pattern can use \"or\" operator (`|`) at the top level of the pattern.\n //\n\n\n return new RegExp(\"^(\".concat(leadingDigitsPattern, \")\")).test(leadingDigits);\n }\n }, {\n key: \"getFormatFormat\",\n value: function getFormatFormat(format, international) {\n return international ? format.internationalFormat() : format.format();\n }\n }, {\n key: \"chooseFormat\",\n value: function chooseFormat(state) {\n var _this4 = this;\n\n var _loop2 = function _loop2() {\n if (_isArray2) {\n if (_i2 >= _iterator2.length) return \"break\";\n _ref5 = _iterator2[_i2++];\n } else {\n _i2 = _iterator2.next();\n if (_i2.done) return \"break\";\n _ref5 = _i2.value;\n }\n\n var format = _ref5;\n\n // If this format is currently being used\n // and is still suitable, then stick to it.\n if (_this4.chosenFormat === format) {\n return \"break\";\n } // Sometimes, a formatting rule inserts additional digits in a phone number,\n // and \"as you type\" formatter can't do that: it should only use the digits\n // that the user has input.\n //\n // For example, in Argentina, there's a format for mobile phone numbers:\n //\n // {\n // \"pattern\": \"(\\\\d)(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\n // \"leading_digits_patterns\": [\"91\"],\n // \"national_prefix_formatting_rule\": \"0$1\",\n // \"format\": \"$2 15-$3-$4\",\n // \"international_format\": \"$1 $2 $3-$4\"\n // }\n //\n // In that format, `international_format` is used instead of `format`\n // because `format` inserts `15` in the formatted number,\n // and `AsYouType` formatter should only use the digits\n // the user has actually input, without adding any extra digits.\n // In this case, it wouldn't make a difference, because the `15`\n // is first stripped when applying `national_prefix_for_parsing`\n // and then re-added when using `format`, so in reality it doesn't\n // add any new digits to the number, but to detect that, the code\n // would have to be more complex: it would have to try formatting\n // the digits using the format and then see if any digits have\n // actually been added or removed, and then, every time a new digit\n // is input, it should re-check whether the chosen format doesn't\n // alter the digits.\n //\n // Google's code doesn't go that far, and so does this library:\n // it simply requires that a `format` doesn't add any additonal\n // digits to user's input.\n //\n // Also, people in general should move from inputting phone numbers\n // in national format (possibly with national prefixes)\n // and use international phone number format instead:\n // it's a logical thing in the modern age of mobile phones,\n // globalization and the internet.\n //\n\n /* istanbul ignore if */\n\n\n if (!NON_ALTERING_FORMAT_REG_EXP.test(_this4.getFormatFormat(format, state.international))) {\n return \"continue\";\n }\n\n if (!_this4.createTemplateForFormat(format, state)) {\n // Remove the format if it can't generate a template.\n _this4.matchingFormats = _this4.matchingFormats.filter(function (_) {\n return _ !== format;\n });\n return \"continue\";\n }\n\n _this4.chosenFormat = format;\n return \"break\";\n };\n\n // When there are multiple available formats, the formatter uses the first\n // format where a formatting template could be created.\n _loop: for (var _iterator2 = this.matchingFormats.slice(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {\n var _ref5;\n\n var _ret = _loop2();\n\n switch (_ret) {\n case \"break\":\n break _loop;\n\n case \"continue\":\n continue;\n }\n }\n\n if (!this.chosenFormat) {\n // No format matches the national (significant) phone number.\n this.resetFormat();\n }\n\n return this.chosenFormat;\n }\n }, {\n key: \"createTemplateForFormat\",\n value: function createTemplateForFormat(format, state) {\n // The formatter doesn't format numbers when numberPattern contains '|', e.g.\n // (20|3)\\d{4}. In those cases we quickly return.\n // (Though there's no such format in current metadata)\n\n /* istanbul ignore if */\n if (SUPPORT_LEGACY_FORMATTING_PATTERNS && format.pattern().indexOf('|') >= 0) {\n return;\n } // Get formatting template for this phone number format\n\n\n var template = this.getTemplateForFormat(format, state); // If the national number entered is too long\n // for any phone number format, then abort.\n\n if (template) {\n this.setNationalNumberTemplate(template, state);\n return true;\n }\n }\n }, {\n key: \"getInternationalPrefixBeforeCountryCallingCode\",\n value: function getInternationalPrefixBeforeCountryCallingCode(_ref6, options) {\n var IDDPrefix = _ref6.IDDPrefix,\n missingPlus = _ref6.missingPlus;\n\n if (IDDPrefix) {\n return options && options.spacing === false ? IDDPrefix : IDDPrefix + ' ';\n }\n\n if (missingPlus) {\n return '';\n }\n\n return '+';\n }\n }, {\n key: \"getTemplate\",\n value: function getTemplate(state) {\n if (!this.template) {\n return;\n } // `this.template` holds the template for a \"complete\" phone number.\n // The currently entered phone number is most likely not \"complete\",\n // so trim all non-populated digits.\n\n\n var index = -1;\n var i = 0;\n var internationalPrefix = state.international ? this.getInternationalPrefixBeforeCountryCallingCode(state, {\n spacing: false\n }) : '';\n\n while (i < internationalPrefix.length + state.getDigitsWithoutInternationalPrefix().length) {\n index = this.template.indexOf(_AsYouTypeFormatter.DIGIT_PLACEHOLDER, index + 1);\n i++;\n }\n\n return (0, _AsYouTypeFormatter.cutAndStripNonPairedParens)(this.template, index + 1);\n }\n }, {\n key: \"setNationalNumberTemplate\",\n value: function setNationalNumberTemplate(template, state) {\n this.nationalNumberTemplate = template;\n this.populatedNationalNumberTemplate = template; // With a new formatting template, the matched position\n // using the old template needs to be reset.\n\n this.populatedNationalNumberTemplatePosition = -1; // For convenience, the public `.template` property\n // contains the whole international number\n // if the phone number being input is international:\n // 'x' for the '+' sign, 'x'es for the country phone code,\n // a spacebar and then the template for the formatted national number.\n\n if (state.international) {\n this.template = this.getInternationalPrefixBeforeCountryCallingCode(state).replace(/[\\d\\+]/g, _AsYouTypeFormatter.DIGIT_PLACEHOLDER) + (0, _AsYouTypeFormatter.repeat)(_AsYouTypeFormatter.DIGIT_PLACEHOLDER, state.callingCode.length) + ' ' + template;\n } else {\n this.template = template;\n }\n }\n /**\r\n * Generates formatting template for a national phone number,\r\n * optionally containing a national prefix, for a format.\r\n * @param {Format} format\r\n * @param {string} nationalPrefix\r\n * @return {string}\r\n */\n\n }, {\n key: \"getTemplateForFormat\",\n value: function getTemplateForFormat(format, _ref7) {\n var nationalSignificantNumber = _ref7.nationalSignificantNumber,\n international = _ref7.international,\n nationalPrefix = _ref7.nationalPrefix,\n complexPrefixBeforeNationalSignificantNumber = _ref7.complexPrefixBeforeNationalSignificantNumber;\n var pattern = format.pattern();\n /* istanbul ignore else */\n\n if (SUPPORT_LEGACY_FORMATTING_PATTERNS) {\n pattern = pattern // Replace anything in the form of [..] with \\d\n .replace(CREATE_CHARACTER_CLASS_PATTERN(), '\\\\d') // Replace any standalone digit (not the one in `{}`) with \\d\n .replace(CREATE_STANDALONE_DIGIT_PATTERN(), '\\\\d');\n } // Generate a dummy national number (consisting of `9`s)\n // that fits this format's `pattern`.\n //\n // This match will always succeed,\n // because the \"longest dummy phone number\"\n // has enough length to accomodate any possible\n // national phone number format pattern.\n //\n\n\n var digits = LONGEST_DUMMY_PHONE_NUMBER.match(pattern)[0]; // If the national number entered is too long\n // for any phone number format, then abort.\n\n if (nationalSignificantNumber.length > digits.length) {\n return;\n } // Get a formatting template which can be used to efficiently format\n // a partial number where digits are added one by one.\n // Below `strictPattern` is used for the\n // regular expression (with `^` and `$`).\n // This wasn't originally in Google's `libphonenumber`\n // and I guess they don't really need it\n // because they're not using \"templates\" to format phone numbers\n // but I added `strictPattern` after encountering\n // South Korean phone number formatting bug.\n //\n // Non-strict regular expression bug demonstration:\n //\n // this.nationalSignificantNumber : `111111111` (9 digits)\n //\n // pattern : (\\d{2})(\\d{3,4})(\\d{4})\n // format : `$1 $2 $3`\n // digits : `9999999999` (10 digits)\n //\n // '9999999999'.replace(new RegExp(/(\\d{2})(\\d{3,4})(\\d{4})/g), '$1 $2 $3') = \"99 9999 9999\"\n //\n // template : xx xxxx xxxx\n //\n // But the correct template in this case is `xx xxx xxxx`.\n // The template was generated incorrectly because of the\n // `{3,4}` variability in the `pattern`.\n //\n // The fix is, if `this.nationalSignificantNumber` has already sufficient length\n // to satisfy the `pattern` completely then `this.nationalSignificantNumber`\n // is used instead of `digits`.\n\n\n var strictPattern = new RegExp('^' + pattern + '$');\n var nationalNumberDummyDigits = nationalSignificantNumber.replace(/\\d/g, DUMMY_DIGIT); // If `this.nationalSignificantNumber` has already sufficient length\n // to satisfy the `pattern` completely then use it\n // instead of `digits`.\n\n if (strictPattern.test(nationalNumberDummyDigits)) {\n digits = nationalNumberDummyDigits;\n }\n\n var numberFormat = this.getFormatFormat(format, international);\n var nationalPrefixIncludedInTemplate; // If a user did input a national prefix (and that's guaranteed),\n // and if a `format` does have a national prefix formatting rule,\n // then see if that national prefix formatting rule\n // prepends exactly the same national prefix the user has input.\n // If that's the case, then use the `format` with the national prefix formatting rule.\n // Otherwise, use the `format` without the national prefix formatting rule,\n // and prepend a national prefix manually to it.\n\n if (this.shouldTryNationalPrefixFormattingRule(format, {\n international: international,\n nationalPrefix: nationalPrefix\n })) {\n var numberFormatWithNationalPrefix = numberFormat.replace(_formatNationalNumberUsingFormat.FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()); // If `national_prefix_formatting_rule` of a `format` simply prepends\n // national prefix at the start of a national (significant) number,\n // then such formatting can be used with `AsYouType` formatter.\n // There seems to be no `else` case: everywhere in metadata,\n // national prefix formatting rule is national prefix + $1,\n // or `($1)`, in which case such format isn't even considered\n // when the user has input a national prefix.\n\n /* istanbul ignore else */\n\n if ((0, _parseDigits[\"default\"])(format.nationalPrefixFormattingRule()) === (nationalPrefix || '') + (0, _parseDigits[\"default\"])('$1')) {\n numberFormat = numberFormatWithNationalPrefix;\n nationalPrefixIncludedInTemplate = true; // Replace all digits of the national prefix in the formatting template\n // with `DIGIT_PLACEHOLDER`s.\n\n if (nationalPrefix) {\n var i = nationalPrefix.length;\n\n while (i > 0) {\n numberFormat = numberFormat.replace(/\\d/, _AsYouTypeFormatter.DIGIT_PLACEHOLDER);\n i--;\n }\n }\n }\n } // Generate formatting template for this phone number format.\n\n\n var template = digits // Format the dummy phone number according to the format.\n .replace(new RegExp(pattern), numberFormat) // Replace each dummy digit with a DIGIT_PLACEHOLDER.\n .replace(new RegExp(DUMMY_DIGIT, 'g'), _AsYouTypeFormatter.DIGIT_PLACEHOLDER); // If a prefix of a national (significant) number is not as simple\n // as just a basic national prefix, then just prepend such prefix\n // before the national (significant) number, optionally spacing\n // the two with a whitespace.\n\n if (!nationalPrefixIncludedInTemplate) {\n if (complexPrefixBeforeNationalSignificantNumber) {\n // Prepend the prefix to the template manually.\n template = (0, _AsYouTypeFormatter.repeat)(_AsYouTypeFormatter.DIGIT_PLACEHOLDER, complexPrefixBeforeNationalSignificantNumber.length) + ' ' + template;\n } else if (nationalPrefix) {\n // Prepend national prefix to the template manually.\n template = (0, _AsYouTypeFormatter.repeat)(_AsYouTypeFormatter.DIGIT_PLACEHOLDER, nationalPrefix.length) + this.getSeparatorAfterNationalPrefix(format) + template;\n }\n }\n\n if (international) {\n template = (0, _applyInternationalSeparatorStyle[\"default\"])(template);\n }\n\n return template;\n }\n }, {\n key: \"formatNextNationalNumberDigits\",\n value: function formatNextNationalNumberDigits(digits) {\n var result = (0, _AsYouTypeFormatter.populateTemplateWithDigits)(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition, digits);\n\n if (!result) {\n // Reset the format.\n this.resetFormat();\n return;\n }\n\n this.populatedNationalNumberTemplate = result[0];\n this.populatedNationalNumberTemplatePosition = result[1]; // Return the formatted phone number so far.\n\n return (0, _AsYouTypeFormatter.cutAndStripNonPairedParens)(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1); // The old way which was good for `input-format` but is not so good\n // for `react-phone-number-input`'s default input (`InputBasic`).\n // return closeNonPairedParens(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1)\n // \t.replace(new RegExp(DIGIT_PLACEHOLDER, 'g'), ' ')\n }\n }]);\n\n return AsYouTypeFormatter;\n}();\n\nexports[\"default\"] = AsYouTypeFormatter;\n//# sourceMappingURL=AsYouTypeFormatter.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.extractFormattedDigitsAndPlus = extractFormattedDigitsAndPlus;\nexports[\"default\"] = void 0;\n\nvar _extractCountryCallingCode2 = _interopRequireDefault(require(\"./helpers/extractCountryCallingCode\"));\n\nvar _extractCountryCallingCodeFromInternationalNumberWithoutPlusSign = _interopRequireDefault(require(\"./helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign\"));\n\nvar _extractNationalNumberFromPossiblyIncompleteNumber = _interopRequireDefault(require(\"./helpers/extractNationalNumberFromPossiblyIncompleteNumber\"));\n\nvar _stripIddPrefix = _interopRequireDefault(require(\"./helpers/stripIddPrefix\"));\n\nvar _parseDigits = _interopRequireDefault(require(\"./helpers/parseDigits\"));\n\nvar _constants = require(\"./constants\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART = '[' + _constants.VALID_PUNCTUATION + _constants.VALID_DIGITS + ']+';\nvar VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN = new RegExp('^' + VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART + '$', 'i');\nvar VALID_FORMATTED_PHONE_NUMBER_PART = '(?:' + '[' + _constants.PLUS_CHARS + ']' + '[' + _constants.VALID_PUNCTUATION + _constants.VALID_DIGITS + ']*' + '|' + '[' + _constants.VALID_PUNCTUATION + _constants.VALID_DIGITS + ']+' + ')';\nvar AFTER_PHONE_NUMBER_DIGITS_END_PATTERN = new RegExp('[^' + _constants.VALID_PUNCTUATION + _constants.VALID_DIGITS + ']+' + '.*' + '$'); // Tests whether `national_prefix_for_parsing` could match\n// different national prefixes.\n// Matches anything that's not a digit or a square bracket.\n\nvar COMPLEX_NATIONAL_PREFIX = /[^\\d\\[\\]]/;\n\nvar AsYouTypeParser =\n/*#__PURE__*/\nfunction () {\n function AsYouTypeParser(_ref) {\n var defaultCountry = _ref.defaultCountry,\n defaultCallingCode = _ref.defaultCallingCode,\n metadata = _ref.metadata,\n onNationalSignificantNumberChange = _ref.onNationalSignificantNumberChange;\n\n _classCallCheck(this, AsYouTypeParser);\n\n this.defaultCountry = defaultCountry;\n this.defaultCallingCode = defaultCallingCode;\n this.metadata = metadata;\n this.onNationalSignificantNumberChange = onNationalSignificantNumberChange;\n }\n\n _createClass(AsYouTypeParser, [{\n key: \"input\",\n value: function input(text, state) {\n var _extractFormattedDigi = extractFormattedDigitsAndPlus(text),\n _extractFormattedDigi2 = _slicedToArray(_extractFormattedDigi, 2),\n formattedDigits = _extractFormattedDigi2[0],\n hasPlus = _extractFormattedDigi2[1];\n\n var digits = (0, _parseDigits[\"default\"])(formattedDigits); // Checks for a special case: just a leading `+` has been entered.\n\n var justLeadingPlus;\n\n if (hasPlus) {\n if (!state.digits) {\n state.startInternationalNumber();\n\n if (!digits) {\n justLeadingPlus = true;\n }\n }\n }\n\n if (digits) {\n this.inputDigits(digits, state);\n }\n\n return {\n digits: digits,\n justLeadingPlus: justLeadingPlus\n };\n }\n /**\r\n * Inputs \"next\" phone number digits.\r\n * @param {string} digits\r\n * @return {string} [formattedNumber] Formatted national phone number (if it can be formatted at this stage). Returning `undefined` means \"don't format the national phone number at this stage\".\r\n */\n\n }, {\n key: \"inputDigits\",\n value: function inputDigits(nextDigits, state) {\n var digits = state.digits;\n var hasReceivedThreeLeadingDigits = digits.length < 3 && digits.length + nextDigits.length >= 3; // Append phone number digits.\n\n state.appendDigits(nextDigits); // Attempt to extract IDD prefix:\n // Some users input their phone number in international format,\n // but in an \"out-of-country\" dialing format instead of using the leading `+`.\n // https://github.com/catamphetamine/libphonenumber-js/issues/185\n // Detect such numbers as soon as there're at least 3 digits.\n // Google's library attempts to extract IDD prefix at 3 digits,\n // so this library just copies that behavior.\n // I guess that's because the most commot IDD prefixes are\n // `00` (Europe) and `011` (US).\n // There exist really long IDD prefixes too:\n // for example, in Australia the default IDD prefix is `0011`,\n // and it could even be as long as `14880011`.\n // An IDD prefix is extracted here, and then every time when\n // there's a new digit and the number couldn't be formatted.\n\n if (hasReceivedThreeLeadingDigits) {\n this.extractIddPrefix(state);\n }\n\n if (this.isWaitingForCountryCallingCode(state)) {\n if (!this.extractCountryCallingCode(state)) {\n return;\n }\n } else {\n state.appendNationalSignificantNumberDigits(nextDigits);\n } // If a phone number is being input in international format,\n // then it's not valid for it to have a national prefix.\n // Still, some people incorrectly input such numbers with a national prefix.\n // In such cases, only attempt to strip a national prefix if the number becomes too long.\n // (but that is done later, not here)\n\n\n if (!state.international) {\n if (!this.hasExtractedNationalSignificantNumber) {\n this.extractNationalSignificantNumber(state.getNationalDigits(), state.update);\n }\n }\n }\n }, {\n key: \"isWaitingForCountryCallingCode\",\n value: function isWaitingForCountryCallingCode(_ref2) {\n var international = _ref2.international,\n callingCode = _ref2.callingCode;\n return international && !callingCode;\n } // Extracts a country calling code from a number\n // being entered in internatonal format.\n\n }, {\n key: \"extractCountryCallingCode\",\n value: function extractCountryCallingCode(state) {\n var _extractCountryCallin = (0, _extractCountryCallingCode2[\"default\"])('+' + state.getDigitsWithoutInternationalPrefix(), this.defaultCountry, this.defaultCallingCode, this.metadata.metadata),\n countryCallingCode = _extractCountryCallin.countryCallingCode,\n number = _extractCountryCallin.number;\n\n if (countryCallingCode) {\n state.setCallingCode(countryCallingCode);\n state.update({\n nationalSignificantNumber: number\n });\n return true;\n }\n }\n }, {\n key: \"reset\",\n value: function reset(numberingPlan) {\n if (numberingPlan) {\n this.hasSelectedNumberingPlan = true;\n\n var nationalPrefixForParsing = numberingPlan._nationalPrefixForParsing();\n\n this.couldPossiblyExtractAnotherNationalSignificantNumber = nationalPrefixForParsing && COMPLEX_NATIONAL_PREFIX.test(nationalPrefixForParsing);\n } else {\n this.hasSelectedNumberingPlan = undefined;\n this.couldPossiblyExtractAnotherNationalSignificantNumber = undefined;\n }\n }\n /**\r\n * Extracts a national (significant) number from user input.\r\n * Google's library is different in that it only applies `national_prefix_for_parsing`\r\n * and doesn't apply `national_prefix_transform_rule` after that.\r\n * https://github.com/google/libphonenumber/blob/a3d70b0487875475e6ad659af404943211d26456/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L539\r\n * @return {boolean} [extracted]\r\n */\n\n }, {\n key: \"extractNationalSignificantNumber\",\n value: function extractNationalSignificantNumber(nationalDigits, setState) {\n if (!this.hasSelectedNumberingPlan) {\n return;\n }\n\n var _extractNationalNumbe = (0, _extractNationalNumberFromPossiblyIncompleteNumber[\"default\"])(nationalDigits, this.metadata),\n nationalPrefix = _extractNationalNumbe.nationalPrefix,\n nationalNumber = _extractNationalNumbe.nationalNumber,\n carrierCode = _extractNationalNumbe.carrierCode;\n\n if (nationalNumber === nationalDigits) {\n return;\n }\n\n this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);\n return true;\n }\n /**\r\n * In Google's code this function is called \"attempt to extract longer NDD\".\r\n * \"Some national prefixes are a substring of others\", they say.\r\n * @return {boolean} [result] — Returns `true` if extracting a national prefix produced different results from what they were.\r\n */\n\n }, {\n key: \"extractAnotherNationalSignificantNumber\",\n value: function extractAnotherNationalSignificantNumber(nationalDigits, prevNationalSignificantNumber, setState) {\n if (!this.hasExtractedNationalSignificantNumber) {\n return this.extractNationalSignificantNumber(nationalDigits, setState);\n }\n\n if (!this.couldPossiblyExtractAnotherNationalSignificantNumber) {\n return;\n }\n\n var _extractNationalNumbe2 = (0, _extractNationalNumberFromPossiblyIncompleteNumber[\"default\"])(nationalDigits, this.metadata),\n nationalPrefix = _extractNationalNumbe2.nationalPrefix,\n nationalNumber = _extractNationalNumbe2.nationalNumber,\n carrierCode = _extractNationalNumbe2.carrierCode; // If a national prefix has been extracted previously,\n // then it's always extracted as additional digits are added.\n // That's assuming `extractNationalNumberFromPossiblyIncompleteNumber()`\n // doesn't do anything different from what it currently does.\n // So, just in case, here's this check, though it doesn't occur.\n\n /* istanbul ignore if */\n\n\n if (nationalNumber === prevNationalSignificantNumber) {\n return;\n }\n\n this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);\n return true;\n }\n }, {\n key: \"onExtractedNationalNumber\",\n value: function onExtractedNationalNumber(nationalPrefix, carrierCode, nationalSignificantNumber, nationalDigits, setState) {\n var complexPrefixBeforeNationalSignificantNumber;\n var nationalSignificantNumberMatchesInput; // This check also works with empty `this.nationalSignificantNumber`.\n\n var nationalSignificantNumberIndex = nationalDigits.lastIndexOf(nationalSignificantNumber); // If the extracted national (significant) number is the\n // last substring of the `digits`, then it means that it hasn't been altered:\n // no digits have been removed from the national (significant) number\n // while applying `national_prefix_transform_rule`.\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule\n\n if (nationalSignificantNumberIndex >= 0 && nationalSignificantNumberIndex === nationalDigits.length - nationalSignificantNumber.length) {\n nationalSignificantNumberMatchesInput = true; // If a prefix of a national (significant) number is not as simple\n // as just a basic national prefix, then such prefix is stored in\n // `this.complexPrefixBeforeNationalSignificantNumber` property and will be\n // prepended \"as is\" to the national (significant) number to produce\n // a formatted result.\n\n var prefixBeforeNationalNumber = nationalDigits.slice(0, nationalSignificantNumberIndex); // `prefixBeforeNationalNumber` is always non-empty,\n // because `onExtractedNationalNumber()` isn't called\n // when a national (significant) number hasn't been actually \"extracted\":\n // when a national (significant) number is equal to the national part of `digits`,\n // then `onExtractedNationalNumber()` doesn't get called.\n\n if (prefixBeforeNationalNumber !== nationalPrefix) {\n complexPrefixBeforeNationalSignificantNumber = prefixBeforeNationalNumber;\n }\n }\n\n setState({\n nationalPrefix: nationalPrefix,\n carrierCode: carrierCode,\n nationalSignificantNumber: nationalSignificantNumber,\n nationalSignificantNumberMatchesInput: nationalSignificantNumberMatchesInput,\n complexPrefixBeforeNationalSignificantNumber: complexPrefixBeforeNationalSignificantNumber\n }); // `onExtractedNationalNumber()` is only called when\n // the national (significant) number actually did change.\n\n this.hasExtractedNationalSignificantNumber = true;\n this.onNationalSignificantNumberChange();\n }\n }, {\n key: \"reExtractNationalSignificantNumber\",\n value: function reExtractNationalSignificantNumber(state) {\n // Attempt to extract a national prefix.\n //\n // Some people incorrectly input national prefix\n // in an international phone number.\n // For example, some people write British phone numbers as `+44(0)...`.\n //\n // Also, in some rare cases, it is valid for a national prefix\n // to be a part of an international phone number.\n // For example, mobile phone numbers in Mexico are supposed to be\n // dialled internationally using a `1` national prefix,\n // so the national prefix will be part of an international number.\n //\n // Quote from:\n // https://www.mexperience.com/dialing-cell-phones-in-mexico/\n //\n // \"Dialing a Mexican cell phone from abroad\n // When you are calling a cell phone number in Mexico from outside Mexico,\n // it’s necessary to dial an additional “1” after Mexico’s country code\n // (which is “52”) and before the area code.\n // You also ignore the 045, and simply dial the area code and the\n // cell phone’s number.\n //\n // If you don’t add the “1”, you’ll receive a recorded announcement\n // asking you to redial using it.\n //\n // For example, if you are calling from the USA to a cell phone\n // in Mexico City, you would dial +52 – 1 – 55 – 1234 5678.\n // (Note that this is different to calling a land line in Mexico City\n // from abroad, where the number dialed would be +52 – 55 – 1234 5678)\".\n //\n // Google's demo output:\n // https://libphonenumber.appspot.com/phonenumberparser?number=%2b5215512345678&country=MX\n //\n if (this.extractAnotherNationalSignificantNumber(state.getNationalDigits(), state.nationalSignificantNumber, state.update)) {\n return true;\n } // If no format matches the phone number, then it could be\n // \"a really long IDD\" (quote from a comment in Google's library).\n // An IDD prefix is first extracted when the user has entered at least 3 digits,\n // and then here — every time when there's a new digit and the number\n // couldn't be formatted.\n // For example, in Australia the default IDD prefix is `0011`,\n // and it could even be as long as `14880011`.\n //\n // Could also check `!hasReceivedThreeLeadingDigits` here\n // to filter out the case when this check duplicates the one\n // already performed when there're 3 leading digits,\n // but it's not a big deal, and in most cases there\n // will be a suitable `format` when there're 3 leading digits.\n //\n\n\n if (this.extractIddPrefix(state)) {\n this.extractCallingCodeAndNationalSignificantNumber(state);\n return true;\n } // Google's AsYouType formatter supports sort of an \"autocorrection\" feature\n // when it \"autocorrects\" numbers that have been input for a country\n // with that country's calling code.\n // Such \"autocorrection\" feature looks weird, but different people have been requesting it:\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n // https://github.com/catamphetamine/libphonenumber-js/issues/375\n // https://github.com/catamphetamine/libphonenumber-js/issues/316\n\n\n if (this.fixMissingPlus(state)) {\n this.extractCallingCodeAndNationalSignificantNumber(state);\n return true;\n }\n }\n }, {\n key: \"extractIddPrefix\",\n value: function extractIddPrefix(state) {\n // An IDD prefix can't be present in a number written with a `+`.\n // Also, don't re-extract an IDD prefix if has already been extracted.\n var international = state.international,\n IDDPrefix = state.IDDPrefix,\n digits = state.digits,\n nationalSignificantNumber = state.nationalSignificantNumber;\n\n if (international || IDDPrefix) {\n return;\n } // Some users input their phone number in \"out-of-country\"\n // dialing format instead of using the leading `+`.\n // https://github.com/catamphetamine/libphonenumber-js/issues/185\n // Detect such numbers.\n\n\n var numberWithoutIDD = (0, _stripIddPrefix[\"default\"])(digits, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata);\n\n if (numberWithoutIDD !== undefined && numberWithoutIDD !== digits) {\n // If an IDD prefix was stripped then convert the IDD-prefixed number\n // to international number for subsequent parsing.\n state.update({\n IDDPrefix: digits.slice(0, digits.length - numberWithoutIDD.length)\n });\n this.startInternationalNumber(state);\n return true;\n }\n }\n }, {\n key: \"fixMissingPlus\",\n value: function fixMissingPlus(state) {\n if (!state.international) {\n var _extractCountryCallin2 = (0, _extractCountryCallingCodeFromInternationalNumberWithoutPlusSign[\"default\"])(state.digits, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata),\n newCallingCode = _extractCountryCallin2.countryCallingCode,\n number = _extractCountryCallin2.number;\n\n if (newCallingCode) {\n state.update({\n missingPlus: true\n });\n this.startInternationalNumber(state);\n return true;\n }\n }\n }\n }, {\n key: \"startInternationalNumber\",\n value: function startInternationalNumber(state) {\n state.startInternationalNumber(); // If a national (significant) number has been extracted before, reset it.\n\n if (state.nationalSignificantNumber) {\n state.resetNationalSignificantNumber();\n this.onNationalSignificantNumberChange();\n this.hasExtractedNationalSignificantNumber = undefined;\n }\n }\n }, {\n key: \"extractCallingCodeAndNationalSignificantNumber\",\n value: function extractCallingCodeAndNationalSignificantNumber(state) {\n if (this.extractCountryCallingCode(state)) {\n // `this.extractCallingCode()` is currently called when the number\n // couldn't be formatted during the standard procedure.\n // Normally, the national prefix would be re-extracted\n // for an international number if such number couldn't be formatted,\n // but since it's already not able to be formatted,\n // there won't be yet another retry, so also extract national prefix here.\n this.extractNationalSignificantNumber(state.getNationalDigits(), state.update);\n }\n }\n }]);\n\n return AsYouTypeParser;\n}();\n/**\r\n * Extracts formatted phone number from text (if there's any).\r\n * @param {string} text\r\n * @return {string} [formattedPhoneNumber]\r\n */\n\n\nexports[\"default\"] = AsYouTypeParser;\n\nfunction extractFormattedPhoneNumber(text) {\n // Attempt to extract a possible number from the string passed in.\n var startsAt = text.search(VALID_FORMATTED_PHONE_NUMBER_PART);\n\n if (startsAt < 0) {\n return;\n } // Trim everything to the left of the phone number.\n\n\n text = text.slice(startsAt); // Trim the `+`.\n\n var hasPlus;\n\n if (text[0] === '+') {\n hasPlus = true;\n text = text.slice('+'.length);\n } // Trim everything to the right of the phone number.\n\n\n text = text.replace(AFTER_PHONE_NUMBER_DIGITS_END_PATTERN, ''); // Re-add the previously trimmed `+`.\n\n if (hasPlus) {\n text = '+' + text;\n }\n\n return text;\n}\n/**\r\n * Extracts formatted phone number digits (and a `+`) from text (if there're any).\r\n * @param {string} text\r\n * @return {any[]}\r\n */\n\n\nfunction _extractFormattedDigitsAndPlus(text) {\n // Extract a formatted phone number part from text.\n var extractedNumber = extractFormattedPhoneNumber(text) || ''; // Trim a `+`.\n\n if (extractedNumber[0] === '+') {\n return [extractedNumber.slice('+'.length), true];\n }\n\n return [extractedNumber];\n}\n/**\r\n * Extracts formatted phone number digits (and a `+`) from text (if there're any).\r\n * @param {string} text\r\n * @return {any[]}\r\n */\n\n\nfunction extractFormattedDigitsAndPlus(text) {\n var _extractFormattedDigi3 = _extractFormattedDigitsAndPlus(text),\n _extractFormattedDigi4 = _slicedToArray(_extractFormattedDigi3, 2),\n formattedDigits = _extractFormattedDigi4[0],\n hasPlus = _extractFormattedDigi4[1]; // If the extracted phone number part\n // can possibly be a part of some valid phone number\n // then parse phone number characters from a formatted phone number.\n\n\n if (!VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN.test(formattedDigits)) {\n formattedDigits = '';\n }\n\n return [formattedDigits, hasPlus];\n}\n//# sourceMappingURL=AsYouTypeParser.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _metadata = _interopRequireDefault(require(\"./metadata\"));\n\nvar _PhoneNumber = _interopRequireDefault(require(\"./PhoneNumber\"));\n\nvar _AsYouTypeState = _interopRequireDefault(require(\"./AsYouTypeState\"));\n\nvar _AsYouTypeFormatter = _interopRequireWildcard(require(\"./AsYouTypeFormatter\"));\n\nvar _AsYouTypeParser = _interopRequireWildcard(require(\"./AsYouTypeParser\"));\n\nvar _getCountryByCallingCode = _interopRequireDefault(require(\"./helpers/getCountryByCallingCode\"));\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj[\"default\"] = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;\n\nvar AsYouType =\n/*#__PURE__*/\nfunction () {\n /**\r\n * @param {(string|object)?} [optionsOrDefaultCountry] - The default country used for parsing non-international phone numbers. Can also be an `options` object.\r\n * @param {Object} metadata\r\n */\n function AsYouType(optionsOrDefaultCountry, metadata) {\n _classCallCheck(this, AsYouType);\n\n this.metadata = new _metadata[\"default\"](metadata);\n\n var _this$getCountryAndCa = this.getCountryAndCallingCode(optionsOrDefaultCountry),\n _this$getCountryAndCa2 = _slicedToArray(_this$getCountryAndCa, 2),\n defaultCountry = _this$getCountryAndCa2[0],\n defaultCallingCode = _this$getCountryAndCa2[1];\n\n this.defaultCountry = defaultCountry;\n this.defaultCallingCode = defaultCallingCode;\n this.reset();\n }\n\n _createClass(AsYouType, [{\n key: \"getCountryAndCallingCode\",\n value: function getCountryAndCallingCode(optionsOrDefaultCountry) {\n // Set `defaultCountry` and `defaultCallingCode` options.\n var defaultCountry;\n var defaultCallingCode; // Turns out `null` also has type \"object\". Weird.\n\n if (optionsOrDefaultCountry) {\n if (_typeof(optionsOrDefaultCountry) === 'object') {\n defaultCountry = optionsOrDefaultCountry.defaultCountry;\n defaultCallingCode = optionsOrDefaultCountry.defaultCallingCode;\n } else {\n defaultCountry = optionsOrDefaultCountry;\n }\n }\n\n if (defaultCountry && !this.metadata.hasCountry(defaultCountry)) {\n defaultCountry = undefined;\n }\n\n if (defaultCallingCode) {\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (this.metadata.isNonGeographicCallingCode(defaultCallingCode)) {\n defaultCountry = '001';\n }\n }\n }\n\n return [defaultCountry, defaultCallingCode];\n }\n /**\r\n * Inputs \"next\" phone number characters.\r\n * @param {string} text\r\n * @return {string} Formatted phone number characters that have been input so far.\r\n */\n\n }, {\n key: \"input\",\n value: function input(text) {\n var _this$parser$input = this.parser.input(text, this.state),\n digits = _this$parser$input.digits,\n justLeadingPlus = _this$parser$input.justLeadingPlus;\n\n if (justLeadingPlus) {\n this.formattedOutput = '+';\n } else if (digits) {\n this.determineTheCountryIfNeeded(); // Match the available formats by the currently available leading digits.\n\n if (this.state.nationalSignificantNumber) {\n this.formatter.narrowDownMatchingFormats(this.state);\n }\n\n var formattedNationalNumber;\n\n if (this.metadata.hasSelectedNumberingPlan()) {\n formattedNationalNumber = this.formatter.format(digits, this.state);\n }\n\n if (formattedNationalNumber === undefined) {\n // See if another national (significant) number could be re-extracted.\n if (this.parser.reExtractNationalSignificantNumber(this.state)) {\n this.determineTheCountryIfNeeded(); // If it could, then re-try formatting the new national (significant) number.\n\n var nationalDigits = this.state.getNationalDigits();\n\n if (nationalDigits) {\n formattedNationalNumber = this.formatter.format(nationalDigits, this.state);\n }\n }\n }\n\n this.formattedOutput = formattedNationalNumber ? this.getFullNumber(formattedNationalNumber) : this.getNonFormattedNumber();\n }\n\n return this.formattedOutput;\n }\n }, {\n key: \"reset\",\n value: function reset() {\n var _this = this;\n\n this.state = new _AsYouTypeState[\"default\"]({\n onCountryChange: function onCountryChange(country) {\n // Before version `1.6.0`, the official `AsYouType` formatter API\n // included the `.country` property of an `AsYouType` instance.\n // Since that property (along with the others) have been moved to\n // `this.state`, `this.country` property is emulated for compatibility\n // with the old versions.\n _this.country = country;\n },\n onCallingCodeChange: function onCallingCodeChange(country, callingCode) {\n _this.metadata.selectNumberingPlan(country, callingCode);\n\n _this.formatter.reset(_this.metadata.numberingPlan, _this.state);\n\n _this.parser.reset(_this.metadata.numberingPlan);\n }\n });\n this.formatter = new _AsYouTypeFormatter[\"default\"]({\n state: this.state,\n metadata: this.metadata\n });\n this.parser = new _AsYouTypeParser[\"default\"]({\n defaultCountry: this.defaultCountry,\n defaultCallingCode: this.defaultCallingCode,\n metadata: this.metadata,\n state: this.state,\n onNationalSignificantNumberChange: function onNationalSignificantNumberChange() {\n _this.determineTheCountryIfNeeded();\n\n _this.formatter.reset(_this.metadata.numberingPlan, _this.state);\n }\n });\n this.state.reset(this.defaultCountry, this.defaultCallingCode);\n this.formattedOutput = '';\n return this;\n }\n /**\r\n * Returns `true` if the phone number is being input in international format.\r\n * In other words, returns `true` if and only if the parsed phone number starts with a `\"+\"`.\r\n * @return {boolean}\r\n */\n\n }, {\n key: \"isInternational\",\n value: function isInternational() {\n return this.state.international;\n }\n /**\r\n * Returns the \"calling code\" part of the phone number when it's being input\r\n * in an international format.\r\n * If no valid calling code has been entered so far, returns `undefined`.\r\n * @return {string} [callingCode]\r\n */\n\n }, {\n key: \"getCallingCode\",\n value: function getCallingCode() {\n // If the number is being input in national format and some \"default calling code\"\n // has been passed to `AsYouType` constructor, then `this.state.callingCode`\n // is equal to that \"default calling code\".\n //\n // If the number is being input in national format and no \"default calling code\"\n // has been passed to `AsYouType` constructor, then returns `undefined`,\n // even if a \"default country\" has been passed to `AsYouType` constructor.\n //\n if (this.isInternational()) {\n return this.state.callingCode;\n }\n } // A legacy alias.\n\n }, {\n key: \"getCountryCallingCode\",\n value: function getCountryCallingCode() {\n return this.getCallingCode();\n }\n /**\r\n * Returns a two-letter country code of the phone number.\r\n * Returns `undefined` for \"non-geographic\" phone numbering plans.\r\n * Returns `undefined` if no phone number has been input yet.\r\n * @return {string} [country]\r\n */\n\n }, {\n key: \"getCountry\",\n value: function getCountry() {\n var digits = this.state.digits; // Return `undefined` if no digits have been input yet.\n\n if (digits) {\n return this._getCountry();\n }\n }\n /**\r\n * Returns a two-letter country code of the phone number.\r\n * Returns `undefined` for \"non-geographic\" phone numbering plans.\r\n * @return {string} [country]\r\n */\n\n }, {\n key: \"_getCountry\",\n value: function _getCountry() {\n var country = this.state.country;\n /* istanbul ignore if */\n\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n // `AsYouType.getCountry()` returns `undefined`\n // for \"non-geographic\" phone numbering plans.\n if (country === '001') {\n return;\n }\n }\n\n return country;\n }\n }, {\n key: \"determineTheCountryIfNeeded\",\n value: function determineTheCountryIfNeeded() {\n // Suppose a user enters a phone number in international format,\n // and there're several countries corresponding to that country calling code,\n // and a country has been derived from the number, and then\n // a user enters one more digit and the number is no longer\n // valid for the derived country, so the country should be re-derived\n // on every new digit in those cases.\n //\n // If the phone number is being input in national format,\n // then it could be a case when `defaultCountry` wasn't specified\n // when creating `AsYouType` instance, and just `defaultCallingCode` was specified,\n // and that \"calling code\" could correspond to a \"non-geographic entity\",\n // or there could be several countries corresponding to that country calling code.\n // In those cases, `this.country` is `undefined` and should be derived\n // from the number. Again, if country calling code is ambiguous, then\n // `this.country` should be re-derived with each new digit.\n //\n if (!this.state.country || this.isCountryCallingCodeAmbiguous()) {\n this.determineTheCountry();\n }\n } // Prepends `+CountryCode ` in case of an international phone number\n\n }, {\n key: \"getFullNumber\",\n value: function getFullNumber(formattedNationalNumber) {\n var _this2 = this;\n\n if (this.isInternational()) {\n var prefix = function prefix(text) {\n return _this2.formatter.getInternationalPrefixBeforeCountryCallingCode(_this2.state, {\n spacing: text ? true : false\n }) + text;\n };\n\n var callingCode = this.state.callingCode;\n\n if (!callingCode) {\n return prefix(\"\".concat(this.state.getDigitsWithoutInternationalPrefix()));\n }\n\n if (!formattedNationalNumber) {\n return prefix(callingCode);\n }\n\n return prefix(\"\".concat(callingCode, \" \").concat(formattedNationalNumber));\n }\n\n return formattedNationalNumber;\n }\n }, {\n key: \"getNonFormattedNationalNumberWithPrefix\",\n value: function getNonFormattedNationalNumberWithPrefix() {\n var _this$state = this.state,\n nationalSignificantNumber = _this$state.nationalSignificantNumber,\n complexPrefixBeforeNationalSignificantNumber = _this$state.complexPrefixBeforeNationalSignificantNumber,\n nationalPrefix = _this$state.nationalPrefix;\n var number = nationalSignificantNumber;\n var prefix = complexPrefixBeforeNationalSignificantNumber || nationalPrefix;\n\n if (prefix) {\n number = prefix + number;\n }\n\n return number;\n }\n }, {\n key: \"getNonFormattedNumber\",\n value: function getNonFormattedNumber() {\n var nationalSignificantNumberMatchesInput = this.state.nationalSignificantNumberMatchesInput;\n return this.getFullNumber(nationalSignificantNumberMatchesInput ? this.getNonFormattedNationalNumberWithPrefix() : this.state.getNationalDigits());\n }\n }, {\n key: \"getNonFormattedTemplate\",\n value: function getNonFormattedTemplate() {\n var number = this.getNonFormattedNumber();\n\n if (number) {\n return number.replace(/[\\+\\d]/g, _AsYouTypeFormatter.DIGIT_PLACEHOLDER);\n }\n }\n }, {\n key: \"isCountryCallingCodeAmbiguous\",\n value: function isCountryCallingCodeAmbiguous() {\n var callingCode = this.state.callingCode;\n var countryCodes = this.metadata.getCountryCodesForCallingCode(callingCode);\n return countryCodes && countryCodes.length > 1;\n } // Determines the country of the phone number\n // entered so far based on the country phone code\n // and the national phone number.\n\n }, {\n key: \"determineTheCountry\",\n value: function determineTheCountry() {\n this.state.setCountry((0, _getCountryByCallingCode[\"default\"])(this.isInternational() ? this.state.callingCode : this.defaultCallingCode, this.state.nationalSignificantNumber, this.metadata));\n }\n /**\r\n * Returns a E.164 phone number value for the user's input.\r\n *\r\n * For example, for country `\"US\"` and input `\"(222) 333-4444\"`\r\n * it will return `\"+12223334444\"`.\r\n *\r\n * For international phone number input, it will also auto-correct\r\n * some minor errors such as using a national prefix when writing\r\n * an international phone number. For example, if the user inputs\r\n * `\"+44 0 7400 000000\"` then it will return an auto-corrected\r\n * `\"+447400000000\"` phone number value.\r\n *\r\n * Will return `undefined` if no digits have been input,\r\n * or when inputting a phone number in national format and no\r\n * default country or default \"country calling code\" have been set.\r\n *\r\n * @return {string} [value]\r\n */\n\n }, {\n key: \"getNumberValue\",\n value: function getNumberValue() {\n var _this$state2 = this.state,\n digits = _this$state2.digits,\n callingCode = _this$state2.callingCode,\n country = _this$state2.country,\n nationalSignificantNumber = _this$state2.nationalSignificantNumber; // Will return `undefined` if no digits have been input.\n\n if (!digits) {\n return;\n }\n\n if (this.isInternational()) {\n if (callingCode) {\n return '+' + callingCode + nationalSignificantNumber;\n } else {\n return '+' + digits;\n }\n } else {\n if (country || callingCode) {\n var callingCode_ = country ? this.metadata.countryCallingCode() : callingCode;\n return '+' + callingCode_ + nationalSignificantNumber;\n }\n }\n }\n /**\r\n * Returns an instance of `PhoneNumber` class.\r\n * Will return `undefined` if no national (significant) number\r\n * digits have been entered so far, or if no `defaultCountry` has been\r\n * set and the user enters a phone number not in international format.\r\n */\n\n }, {\n key: \"getNumber\",\n value: function getNumber() {\n var _this$state3 = this.state,\n nationalSignificantNumber = _this$state3.nationalSignificantNumber,\n carrierCode = _this$state3.carrierCode,\n callingCode = _this$state3.callingCode; // `this._getCountry()` is basically same as `this.state.country`\n // with the only change that it return `undefined` in case of a\n // \"non-geographic\" numbering plan instead of `\"001\"` \"internal use\" value.\n\n var country = this._getCountry();\n\n if (!nationalSignificantNumber) {\n return;\n }\n\n if (!country && !callingCode) {\n return;\n }\n\n var phoneNumber = new _PhoneNumber[\"default\"](country || callingCode, nationalSignificantNumber, this.metadata.metadata);\n\n if (carrierCode) {\n phoneNumber.carrierCode = carrierCode;\n } // Phone number extensions are not supported by \"As You Type\" formatter.\n\n\n return phoneNumber;\n }\n /**\r\n * Returns `true` if the phone number is \"possible\".\r\n * Is just a shortcut for `PhoneNumber.isPossible()`.\r\n * @return {boolean}\r\n */\n\n }, {\n key: \"isPossible\",\n value: function isPossible() {\n var phoneNumber = this.getNumber();\n\n if (!phoneNumber) {\n return false;\n }\n\n return phoneNumber.isPossible();\n }\n /**\r\n * Returns `true` if the phone number is \"valid\".\r\n * Is just a shortcut for `PhoneNumber.isValid()`.\r\n * @return {boolean}\r\n */\n\n }, {\n key: \"isValid\",\n value: function isValid() {\n var phoneNumber = this.getNumber();\n\n if (!phoneNumber) {\n return false;\n }\n\n return phoneNumber.isValid();\n }\n /**\r\n * @deprecated\r\n * This method is used in `react-phone-number-input/source/input-control.js`\r\n * in versions before `3.0.16`.\r\n */\n\n }, {\n key: \"getNationalNumber\",\n value: function getNationalNumber() {\n return this.state.nationalSignificantNumber;\n }\n /**\r\n * Returns the phone number characters entered by the user.\r\n * @return {string}\r\n */\n\n }, {\n key: \"getChars\",\n value: function getChars() {\n return (this.state.international ? '+' : '') + this.state.digits;\n }\n /**\r\n * Returns the template for the formatted phone number.\r\n * @return {string}\r\n */\n\n }, {\n key: \"getTemplate\",\n value: function getTemplate() {\n return this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || '';\n }\n }]);\n\n return AsYouType;\n}();\n\nexports[\"default\"] = AsYouType;\n//# sourceMappingURL=AsYouType.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = getCountries;\n\nvar _metadata = _interopRequireDefault(require(\"./metadata\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction getCountries(metadata) {\n return new _metadata[\"default\"](metadata).getCountries();\n}\n//# sourceMappingURL=getCountries.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = getExampleNumber;\n\nvar _PhoneNumber = _interopRequireDefault(require(\"./PhoneNumber\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction getExampleNumber(country, examples, metadata) {\n if (examples[country]) {\n return new _PhoneNumber[\"default\"](country, examples[country], metadata);\n }\n}\n//# sourceMappingURL=getExampleNumber.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = formatIncompletePhoneNumber;\n\nvar _AsYouType = _interopRequireDefault(require(\"./AsYouType\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n/**\r\n * Formats a (possibly incomplete) phone number.\r\n * The phone number can be either in E.164 format\r\n * or in a form of national number digits.\r\n * @param {string} value - A possibly incomplete phone number. Either in E.164 format or in a form of national number digits.\r\n * @param {string?} country - Two-letter (\"ISO 3166-1 alpha-2\") country code.\r\n * @return {string} Formatted (possibly incomplete) phone number.\r\n */\nfunction formatIncompletePhoneNumber(value, country, metadata) {\n if (!metadata) {\n metadata = country;\n country = undefined;\n }\n\n return new _AsYouType[\"default\"](country, metadata).input(value);\n}\n//# sourceMappingURL=formatIncompletePhoneNumber.js.map","'use strict'\r\n\r\nvar parsePhoneNumberFromString = require('../build/parsePhoneNumberFromString').default\r\n\r\n// ES5 `require()` \"default\" \"interoperability\" hack.\r\n// https://github.com/babel/babel/issues/2212#issuecomment-131827986\r\n// An alternative approach:\r\n// https://www.npmjs.com/package/babel-plugin-add-module-exports\r\nexports = module.exports = parsePhoneNumberFromString\r\nexports['default'] = parsePhoneNumberFromString\r\n\r\nexports.ParseError = require('../build/ParseError').default\r\nvar parsePhoneNumberWithError = require('../build/parsePhoneNumber').default\r\n// `parsePhoneNumber()` named export has been renamed to `parsePhoneNumberWithError()`.\r\nexports.parsePhoneNumberWithError = parsePhoneNumberWithError\r\nexports.parsePhoneNumber = parsePhoneNumberWithError\r\n\r\n// `parsePhoneNumberFromString()` named export is now considered legacy:\r\n// it has been promoted to a default export due to being too verbose.\r\nexports.parsePhoneNumberFromString = parsePhoneNumberFromString\r\n\r\nexports.isValidPhoneNumber = require('../build/isValidPhoneNumber').default\r\nexports.isPossiblePhoneNumber = require('../build/isPossiblePhoneNumber').default\r\nexports.validatePhoneNumberLength = require('../build/validatePhoneNumberLength').default\r\n\r\nexports.findNumbers = require('../build/findNumbers').default\r\nexports.searchNumbers = require('../build/searchNumbers').default\r\nexports.findPhoneNumbersInText = require('../build/findPhoneNumbersInText').default\r\nexports.searchPhoneNumbersInText = require('../build/searchPhoneNumbersInText').default\r\nexports.PhoneNumberMatcher = require('../build/PhoneNumberMatcher').default\r\n\r\nexports.AsYouType = require('../build/AsYouType').default\r\n\r\nexports.Metadata = require('../build/metadata').default\r\nexports.isSupportedCountry = require('../build/metadata').isSupportedCountry\r\nexports.getCountries = require('../build/getCountries').default\r\nexports.getCountryCallingCode = require('../build/metadata').getCountryCallingCode\r\nexports.getExtPrefix = require('../build/metadata').getExtPrefix\r\n\r\nexports.getExampleNumber = require('../build/getExampleNumber').default\r\n\r\nexports.formatIncompletePhoneNumber = require('../build/formatIncompletePhoneNumber').default\r\n\r\nexports.parseIncompletePhoneNumber = require('../build/parseIncompletePhoneNumber').default\r\nexports.parsePhoneNumberCharacter = require('../build/parseIncompletePhoneNumber').parsePhoneNumberCharacter\r\nexports.parseDigits = require('../build/helpers/parseDigits').default\r\nexports.DIGIT_PLACEHOLDER = require('../build/AsYouTypeFormatter').DIGIT_PLACEHOLDER\r\n\r\nexports.parseRFC3966 = require('../build/helpers/RFC3966').parseRFC3966\r\nexports.formatRFC3966 = require('../build/helpers/RFC3966').formatRFC3966","'use strict'\r\n\r\nvar metadata = require('../metadata.min.json')\r\nvar core = require('../core/index.commonjs')\r\n\r\nfunction call(func, _arguments) {\r\n\tvar args = Array.prototype.slice.call(_arguments)\r\n\targs.push(metadata)\r\n\treturn func.apply(this, args)\r\n}\r\n\r\nfunction parsePhoneNumberFromString() {\r\n\treturn call(core.parsePhoneNumberFromString, arguments)\r\n}\r\n\r\n// ES5 `require()` \"default\" \"interoperability\" hack.\r\n// https://github.com/babel/babel/issues/2212#issuecomment-131827986\r\n// An alternative approach:\r\n// https://www.npmjs.com/package/babel-plugin-add-module-exports\r\nexports = module.exports = parsePhoneNumberFromString\r\nexports['default'] = parsePhoneNumberFromString\r\n\r\nexports.ParseError = core.ParseError\r\n\r\nfunction parsePhoneNumberWithError() {\r\n\treturn call(core.parsePhoneNumberWithError, arguments)\r\n}\r\n\r\n// `parsePhoneNumber()` named export has been renamed to `parsePhoneNumberWithError()`.\r\nexports.parsePhoneNumber = parsePhoneNumberWithError\r\nexports.parsePhoneNumberWithError = parsePhoneNumberWithError\r\n\r\n// `parsePhoneNumberFromString()` named export is now considered legacy:\r\n// it has been promoted to a default export due to being too verbose.\r\nexports.parsePhoneNumberFromString = parsePhoneNumberFromString\r\n\r\nexports.isValidPhoneNumber = function isValidPhoneNumber() {\r\n\treturn call(core.isValidPhoneNumber, arguments)\r\n}\r\n\r\nexports.isPossiblePhoneNumber = function isPossiblePhoneNumber() {\r\n\treturn call(core.isPossiblePhoneNumber, arguments)\r\n}\r\n\r\nexports.validatePhoneNumberLength = function validatePhoneNumberLength() {\r\n\treturn call(core.validatePhoneNumberLength, arguments)\r\n}\r\n\r\nexports.findNumbers = function findNumbers() {\r\n\treturn call(core.findNumbers, arguments)\r\n}\r\n\r\nexports.searchNumbers = function searchNumbers() {\r\n\treturn call(core.searchNumbers, arguments)\r\n}\r\n\r\nexports.findPhoneNumbersInText = function findPhoneNumbersInText() {\r\n\treturn call(core.findPhoneNumbersInText, arguments)\r\n}\r\n\r\nexports.searchPhoneNumbersInText = function searchPhoneNumbersInText() {\r\n\treturn call(core.searchPhoneNumbersInText, arguments)\r\n}\r\n\r\nexports.PhoneNumberMatcher = function PhoneNumberMatcher(text, options) {\r\n\treturn core.PhoneNumberMatcher.call(this, text, options, metadata)\r\n}\r\nexports.PhoneNumberMatcher.prototype = Object.create(core.PhoneNumberMatcher.prototype, {})\r\nexports.PhoneNumberMatcher.prototype.constructor = exports.PhoneNumberMatcher\r\n\r\nexports.AsYouType = function AsYouType(country) {\r\n\treturn core.AsYouType.call(this, country, metadata)\r\n}\r\nexports.AsYouType.prototype = Object.create(core.AsYouType.prototype, {})\r\nexports.AsYouType.prototype.constructor = exports.AsYouType\r\n\r\nexports.isSupportedCountry = function isSupportedCountry(country) {\r\n\treturn call(core.isSupportedCountry, arguments)\r\n}\r\n\r\nexports.getCountries = function getCountries() {\r\n\treturn call(core.getCountries, arguments)\r\n}\r\n\r\nexports.getCountryCallingCode = function getCountryCallingCode() {\r\n\treturn call(core.getCountryCallingCode, arguments)\r\n}\r\n\r\nexports.getExtPrefix = function getExtPrefix(country) {\r\n\treturn call(core.getExtPrefix, arguments)\r\n}\r\n\r\nexports.getExampleNumber = function getExampleNumber() {\r\n\treturn call(core.getExampleNumber, arguments)\r\n}\r\n\r\nexports.Metadata = function Metadata() {\r\n\treturn core.Metadata.call(this, metadata)\r\n}\r\nexports.Metadata.prototype = Object.create(core.Metadata.prototype, {})\r\nexports.Metadata.prototype.constructor = exports.Metadata\r\n\r\nexports.formatIncompletePhoneNumber = function formatIncompletePhoneNumber() {\r\n\treturn call(core.formatIncompletePhoneNumber, arguments)\r\n}\r\n\r\nexports.parseIncompletePhoneNumber = core.parseIncompletePhoneNumber\r\nexports.parsePhoneNumberCharacter = core.parsePhoneNumberCharacter\r\nexports.parseDigits = core.parseDigits\r\nexports.DIGIT_PLACEHOLDER = core.DIGIT_PLACEHOLDER\r\n\r\nexports.parseRFC3966 = core.parseRFC3966\r\nexports.formatRFC3966 = core.formatRFC3966","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = parseNumber;\n\nvar _parse_ = _interopRequireDefault(require(\"./parse_\"));\n\nvar _parsePhoneNumber = require(\"./parsePhoneNumber\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n// `options`:\n// {\n// country:\n// {\n// restrict - (a two-letter country code)\n// the phone number must be in this country\n//\n// default - (a two-letter country code)\n// default country to use for phone number parsing and validation\n// (if no country code could be derived from the phone number)\n// }\n// }\n//\n// Returns `{ country, number }`\n//\n// Example use cases:\n//\n// ```js\n// parse('8 (800) 555-35-35', 'RU')\n// parse('8 (800) 555-35-35', 'RU', metadata)\n// parse('8 (800) 555-35-35', { country: { default: 'RU' } })\n// parse('8 (800) 555-35-35', { country: { default: 'RU' } }, metadata)\n// parse('+7 800 555 35 35')\n// parse('+7 800 555 35 35', metadata)\n// ```\n//\nfunction parseNumber() {\n var _normalizeArguments = (0, _parsePhoneNumber.normalizeArguments)(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return (0, _parse_[\"default\"])(text, options, metadata);\n}\n//# sourceMappingURL=parse.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = formatNumber;\n\nvar _format_ = _interopRequireDefault(require(\"./format_\"));\n\nvar _parse_ = _interopRequireDefault(require(\"./parse_\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction formatNumber() {\n var _normalizeArguments = normalizeArguments(arguments),\n input = _normalizeArguments.input,\n format = _normalizeArguments.format,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return (0, _format_[\"default\"])(input, format, options, metadata);\n} // Sort out arguments\n\n\nfunction normalizeArguments(args) {\n var _Array$prototype$slic = Array.prototype.slice.call(args),\n _Array$prototype$slic2 = _slicedToArray(_Array$prototype$slic, 5),\n arg_1 = _Array$prototype$slic2[0],\n arg_2 = _Array$prototype$slic2[1],\n arg_3 = _Array$prototype$slic2[2],\n arg_4 = _Array$prototype$slic2[3],\n arg_5 = _Array$prototype$slic2[4];\n\n var input;\n var format;\n var options;\n var metadata; // Sort out arguments.\n // If the phone number is passed as a string.\n // `format('8005553535', ...)`.\n\n if (typeof arg_1 === 'string') {\n // If country code is supplied.\n // `format('8005553535', 'RU', 'NATIONAL', [options], metadata)`.\n if (typeof arg_3 === 'string') {\n format = arg_3;\n\n if (arg_5) {\n options = arg_4;\n metadata = arg_5;\n } else {\n metadata = arg_4;\n }\n\n input = (0, _parse_[\"default\"])(arg_1, {\n defaultCountry: arg_2,\n extended: true\n }, metadata);\n } // Just an international phone number is supplied\n // `format('+78005553535', 'NATIONAL', [options], metadata)`.\n else {\n if (typeof arg_2 !== 'string') {\n throw new Error('`format` argument not passed to `formatNumber(number, format)`');\n }\n\n format = arg_2;\n\n if (arg_4) {\n options = arg_3;\n metadata = arg_4;\n } else {\n metadata = arg_3;\n }\n\n input = (0, _parse_[\"default\"])(arg_1, {\n extended: true\n }, metadata);\n }\n } // If the phone number is passed as a parsed number object.\n // `format({ phone: '8005553535', country: 'RU' }, 'NATIONAL', [options], metadata)`.\n else if (is_object(arg_1)) {\n input = arg_1;\n format = arg_2;\n\n if (arg_4) {\n options = arg_3;\n metadata = arg_4;\n } else {\n metadata = arg_3;\n }\n } else throw new TypeError('A phone number must either be a string or an object of shape { phone, [country] }.'); // Legacy lowercase formats.\n\n\n if (format === 'International') {\n format = 'INTERNATIONAL';\n } else if (format === 'National') {\n format = 'NATIONAL';\n }\n\n return {\n input: input,\n format: format,\n options: options,\n metadata: metadata\n };\n} // Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n\n/* istanbul ignore next */\n\n\nvar is_object = function is_object(_) {\n return _typeof(_) === 'object';\n};\n//# sourceMappingURL=format.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = getNumberType;\nexports.normalizeArguments = normalizeArguments;\n\nvar _isViablePhoneNumber = _interopRequireDefault(require(\"./helpers/isViablePhoneNumber\"));\n\nvar _getNumberType2 = _interopRequireDefault(require(\"./helpers/getNumberType\"));\n\nvar _parse_ = _interopRequireDefault(require(\"./parse_\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n// Finds out national phone number type (fixed line, mobile, etc)\nfunction getNumberType() {\n var _normalizeArguments = normalizeArguments(arguments),\n input = _normalizeArguments.input,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return (0, _getNumberType2[\"default\"])(input, options, metadata);\n} // Sort out arguments\n\n\nfunction normalizeArguments(args) {\n var _Array$prototype$slic = Array.prototype.slice.call(args),\n _Array$prototype$slic2 = _slicedToArray(_Array$prototype$slic, 4),\n arg_1 = _Array$prototype$slic2[0],\n arg_2 = _Array$prototype$slic2[1],\n arg_3 = _Array$prototype$slic2[2],\n arg_4 = _Array$prototype$slic2[3];\n\n var input;\n var options = {};\n var metadata; // If the phone number is passed as a string.\n // `getNumberType('88005553535', ...)`.\n\n if (typeof arg_1 === 'string') {\n // If \"default country\" argument is being passed\n // then convert it to an `options` object.\n // `getNumberType('88005553535', 'RU', metadata)`.\n if (_typeof(arg_2) !== 'object') {\n if (arg_4) {\n options = arg_3;\n metadata = arg_4;\n } else {\n metadata = arg_3;\n } // `parse` extracts phone numbers from raw text,\n // therefore it will cut off all \"garbage\" characters,\n // while this `validate` function needs to verify\n // that the phone number contains no \"garbage\"\n // therefore the explicit `isViablePhoneNumber` check.\n\n\n if ((0, _isViablePhoneNumber[\"default\"])(arg_1)) {\n input = (0, _parse_[\"default\"])(arg_1, {\n defaultCountry: arg_2\n }, metadata);\n } else {\n input = {};\n }\n } // No \"resrict country\" argument is being passed.\n // International phone number is passed.\n // `getNumberType('+78005553535', metadata)`.\n else {\n if (arg_3) {\n options = arg_2;\n metadata = arg_3;\n } else {\n metadata = arg_2;\n } // `parse` extracts phone numbers from raw text,\n // therefore it will cut off all \"garbage\" characters,\n // while this `validate` function needs to verify\n // that the phone number contains no \"garbage\"\n // therefore the explicit `isViablePhoneNumber` check.\n\n\n if ((0, _isViablePhoneNumber[\"default\"])(arg_1)) {\n input = (0, _parse_[\"default\"])(arg_1, undefined, metadata);\n } else {\n input = {};\n }\n }\n } // If the phone number is passed as a parsed phone number.\n // `getNumberType({ phone: '88005553535', country: 'RU' }, ...)`.\n else if (is_object(arg_1)) {\n input = arg_1;\n\n if (arg_3) {\n options = arg_2;\n metadata = arg_3;\n } else {\n metadata = arg_2;\n }\n } else throw new TypeError('A phone number must either be a string or an object of shape { phone, [country] }.');\n\n return {\n input: input,\n options: options,\n metadata: metadata\n };\n} // Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n\n/* istanbul ignore next */\n\n\nvar is_object = function is_object(_) {\n return _typeof(_) === 'object';\n};\n//# sourceMappingURL=getNumberType.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = isPossibleNumber;\n\nvar _getNumberType = require(\"./getNumberType\");\n\nvar _isPossibleNumber_ = _interopRequireDefault(require(\"./isPossibleNumber_\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n/**\r\n * Checks if a given phone number is possible.\r\n * Which means it only checks phone number length\r\n * and doesn't test any regular expressions.\r\n *\r\n * Examples:\r\n *\r\n * ```js\r\n * isPossibleNumber('+78005553535', metadata)\r\n * isPossibleNumber('8005553535', 'RU', metadata)\r\n * isPossibleNumber('88005553535', 'RU', metadata)\r\n * isPossibleNumber({ phone: '8005553535', country: 'RU' }, metadata)\r\n * ```\r\n */\nfunction isPossibleNumber() {\n var _normalizeArguments = (0, _getNumberType.normalizeArguments)(arguments),\n input = _normalizeArguments.input,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return (0, _isPossibleNumber_[\"default\"])(input, options, metadata);\n}\n//# sourceMappingURL=isPossibleNumber.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = isValidNumber;\n\nvar _validate_ = _interopRequireDefault(require(\"./validate_\"));\n\nvar _getNumberType = require(\"./getNumberType\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n// Finds out national phone number type (fixed line, mobile, etc)\nfunction isValidNumber() {\n var _normalizeArguments = (0, _getNumberType.normalizeArguments)(arguments),\n input = _normalizeArguments.input,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return (0, _validate_[\"default\"])(input, options, metadata);\n}\n//# sourceMappingURL=validate.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = isValidNumberForRegion;\n\nvar _isViablePhoneNumber = _interopRequireDefault(require(\"./helpers/isViablePhoneNumber\"));\n\nvar _parse_ = _interopRequireDefault(require(\"./parse_\"));\n\nvar _isValidNumberForRegion_ = _interopRequireDefault(require(\"./isValidNumberForRegion_\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction isValidNumberForRegion(number, country, metadata) {\n if (typeof number !== 'string') {\n throw new TypeError('number must be a string');\n }\n\n if (typeof country !== 'string') {\n throw new TypeError('country must be a string');\n } // `parse` extracts phone numbers from raw text,\n // therefore it will cut off all \"garbage\" characters,\n // while this `validate` function needs to verify\n // that the phone number contains no \"garbage\"\n // therefore the explicit `isViablePhoneNumber` check.\n\n\n var input;\n\n if ((0, _isViablePhoneNumber[\"default\"])(number)) {\n input = (0, _parse_[\"default\"])(number, {\n defaultCountry: country\n }, metadata);\n } else {\n input = {};\n }\n\n return (0, _isValidNumberForRegion_[\"default\"])(input, country, undefined, metadata);\n}\n//# sourceMappingURL=isValidNumberForRegion.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = findPhoneNumbers;\nexports.searchPhoneNumbers = searchPhoneNumbers;\nexports.PhoneNumberSearch = exports.EXTN_PATTERNS_FOR_PARSING = void 0;\n\nvar _constants = require(\"./constants\");\n\nvar _parse_ = _interopRequireDefault(require(\"./parse_\"));\n\nvar _isViablePhoneNumber = require(\"./helpers/isViablePhoneNumber\");\n\nvar _createExtensionPattern = _interopRequireDefault(require(\"./helpers/extension/createExtensionPattern\"));\n\nvar _parsePreCandidate = _interopRequireDefault(require(\"./findNumbers/parsePreCandidate\"));\n\nvar _isValidPreCandidate = _interopRequireDefault(require(\"./findNumbers/isValidPreCandidate\"));\n\nvar _isValidCandidate = _interopRequireDefault(require(\"./findNumbers/isValidCandidate\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\r\n * Regexp of all possible ways to write extensions, for use when parsing. This\r\n * will be run as a case-insensitive regexp match. Wide character versions are\r\n * also provided after each ASCII version. There are three regular expressions\r\n * here. The first covers RFC 3966 format, where the extension is added using\r\n * ';ext='. The second more generic one starts with optional white space and\r\n * ends with an optional full stop (.), followed by zero or more spaces/tabs\r\n * /commas and then the numbers themselves. The other one covers the special\r\n * case of American numbers where the extension is written with a hash at the\r\n * end, such as '- 503#'. Note that the only capturing groups should be around\r\n * the digits that you want to capture as part of the extension, or else parsing\r\n * will fail! We allow two options for representing the accented o - the\r\n * character itself, and one in the unicode decomposed form with the combining\r\n * acute accent.\r\n */\nvar EXTN_PATTERNS_FOR_PARSING = (0, _createExtensionPattern[\"default\"])('parsing');\nexports.EXTN_PATTERNS_FOR_PARSING = EXTN_PATTERNS_FOR_PARSING;\nvar WHITESPACE_IN_THE_BEGINNING_PATTERN = new RegExp('^[' + _constants.WHITESPACE + ']+');\nvar PUNCTUATION_IN_THE_END_PATTERN = new RegExp('[' + _constants.VALID_PUNCTUATION + ']+$'); // // Regular expression for getting opening brackets for a valid number\n// // found using `PHONE_NUMBER_START_PATTERN` for prepending those brackets to the number.\n// const BEFORE_NUMBER_DIGITS_PUNCTUATION = new RegExp('[' + OPENING_BRACKETS + ']+' + '[' + WHITESPACE + ']*' + '$')\n\nvar VALID_PRECEDING_CHARACTER_PATTERN = /[^a-zA-Z0-9]/;\n\nfunction findPhoneNumbers(text, options, metadata) {\n /* istanbul ignore if */\n if (options === undefined) {\n options = {};\n }\n\n var search = new PhoneNumberSearch(text, options, metadata);\n var phones = [];\n\n while (search.hasNext()) {\n phones.push(search.next());\n }\n\n return phones;\n}\n/**\r\n * @return ES6 `for ... of` iterator.\r\n */\n\n\nfunction searchPhoneNumbers(text, options, metadata) {\n /* istanbul ignore if */\n if (options === undefined) {\n options = {};\n }\n\n var search = new PhoneNumberSearch(text, options, metadata);\n return _defineProperty({}, Symbol.iterator, function () {\n return {\n next: function next() {\n if (search.hasNext()) {\n return {\n done: false,\n value: search.next()\n };\n }\n\n return {\n done: true\n };\n }\n };\n });\n}\n/**\r\n * Extracts a parseable phone number including any opening brackets, etc.\r\n * @param {string} text - Input.\r\n * @return {object} `{ ?number, ?startsAt, ?endsAt }`.\r\n */\n\n\nvar PhoneNumberSearch =\n/*#__PURE__*/\nfunction () {\n // Iteration tristate.\n function PhoneNumberSearch(text, options, metadata) {\n _classCallCheck(this, PhoneNumberSearch);\n\n _defineProperty(this, \"state\", 'NOT_READY');\n\n this.text = text; // If assigning the `{}` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n\n this.options = options || {};\n this.metadata = metadata;\n this.regexp = new RegExp(_isViablePhoneNumber.VALID_PHONE_NUMBER_WITH_EXTENSION, 'ig');\n }\n\n _createClass(PhoneNumberSearch, [{\n key: \"find\",\n value: function find() {\n var matches = this.regexp.exec(this.text);\n\n if (!matches) {\n return;\n }\n\n var number = matches[0];\n var startsAt = matches.index;\n number = number.replace(WHITESPACE_IN_THE_BEGINNING_PATTERN, '');\n startsAt += matches[0].length - number.length; // Fixes not parsing numbers with whitespace in the end.\n // Also fixes not parsing numbers with opening parentheses in the end.\n // https://github.com/catamphetamine/libphonenumber-js/issues/252\n\n number = number.replace(PUNCTUATION_IN_THE_END_PATTERN, '');\n number = (0, _parsePreCandidate[\"default\"])(number);\n var result = this.parseCandidate(number, startsAt);\n\n if (result) {\n return result;\n } // Tail recursion.\n // Try the next one if this one is not a valid phone number.\n\n\n return this.find();\n }\n }, {\n key: \"parseCandidate\",\n value: function parseCandidate(number, startsAt) {\n if (!(0, _isValidPreCandidate[\"default\"])(number, startsAt, this.text)) {\n return;\n } // Don't parse phone numbers which are non-phone numbers\n // due to being part of something else (e.g. a UUID).\n // https://github.com/catamphetamine/libphonenumber-js/issues/213\n // Copy-pasted from Google's `PhoneNumberMatcher.js` (`.parseAndValidate()`).\n\n\n if (!(0, _isValidCandidate[\"default\"])(number, startsAt, this.text, this.options.extended ? 'POSSIBLE' : 'VALID')) {\n return;\n } // // Prepend any opening brackets left behind by the\n // // `PHONE_NUMBER_START_PATTERN` regexp.\n // const text_before_number = text.slice(this.searching_from, startsAt)\n // const full_number_starts_at = text_before_number.search(BEFORE_NUMBER_DIGITS_PUNCTUATION)\n // if (full_number_starts_at >= 0)\n // {\n // \tnumber = text_before_number.slice(full_number_starts_at) + number\n // \tstartsAt = full_number_starts_at\n // }\n //\n // this.searching_from = matches.lastIndex\n\n\n var result = (0, _parse_[\"default\"])(number, this.options, this.metadata);\n\n if (!result.phone) {\n return;\n }\n\n result.startsAt = startsAt;\n result.endsAt = startsAt + number.length;\n return result;\n }\n }, {\n key: \"hasNext\",\n value: function hasNext() {\n if (this.state === 'NOT_READY') {\n this.last_match = this.find();\n\n if (this.last_match) {\n this.state = 'READY';\n } else {\n this.state = 'DONE';\n }\n }\n\n return this.state === 'READY';\n }\n }, {\n key: \"next\",\n value: function next() {\n // Check the state and find the next match as a side-effect if necessary.\n if (!this.hasNext()) {\n throw new Error('No next element');\n } // Don't retain that memory any longer than necessary.\n\n\n var result = this.last_match;\n this.last_match = null;\n this.state = 'NOT_READY';\n return result;\n }\n }]);\n\n return PhoneNumberSearch;\n}();\n\nexports.PhoneNumberSearch = PhoneNumberSearch;\n//# sourceMappingURL=findPhoneNumbers_.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = findPhoneNumbers;\nexports.searchPhoneNumbers = searchPhoneNumbers;\n\nvar _findPhoneNumbers_ = _interopRequireWildcard(require(\"./findPhoneNumbers_\"));\n\nvar _parsePhoneNumber = require(\"./parsePhoneNumber\");\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj[\"default\"] = obj; return newObj; } }\n\n// This is a legacy function.\n// Use `findNumbers()` instead.\nfunction findPhoneNumbers() {\n var _normalizeArguments = (0, _parsePhoneNumber.normalizeArguments)(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return (0, _findPhoneNumbers_[\"default\"])(text, options, metadata);\n}\n/**\r\n * @return ES6 `for ... of` iterator.\r\n */\n\n\nfunction searchPhoneNumbers() {\n var _normalizeArguments2 = (0, _parsePhoneNumber.normalizeArguments)(arguments),\n text = _normalizeArguments2.text,\n options = _normalizeArguments2.options,\n metadata = _normalizeArguments2.metadata;\n\n return (0, _findPhoneNumbers_.searchPhoneNumbers)(text, options, metadata);\n}\n//# sourceMappingURL=findPhoneNumbers.js.map","'use strict'\r\n\r\nvar min = require('./min/index.commonjs')\r\nvar metadata = require('./metadata.min.json')\r\n\r\nfunction withMetadata(func, _arguments) {\r\n\tvar args = Array.prototype.slice.call(_arguments)\r\n\targs.push(metadata)\r\n\treturn func.apply(this, args)\r\n}\r\n\r\n// ES5 `require()` \"default\" \"interoperability\" hack.\r\n// https://github.com/babel/babel/issues/2212#issuecomment-131827986\r\n// An alternative approach:\r\n// https://www.npmjs.com/package/babel-plugin-add-module-exports\r\nexports = module.exports = min.parsePhoneNumberFromString\r\nexports['default'] = min.parsePhoneNumberFromString\r\n\r\n// `parsePhoneNumberFromString()` named export is now considered legacy:\r\n// it has been promoted to a default export due to being too verbose.\r\nexports.parsePhoneNumberFromString = min.parsePhoneNumberFromString\r\n\r\nexports.ParseError = min.ParseError\r\n\r\n// `parsePhoneNumber()` named export has been renamed to `parsePhoneNumberWithError()`.\r\nexports.parsePhoneNumber = min.parsePhoneNumberWithError\r\nexports.parsePhoneNumberWithError = min.parsePhoneNumberWithError\r\n\r\nexports.isValidPhoneNumber = min.isValidPhoneNumber\r\nexports.isPossiblePhoneNumber = min.isPossiblePhoneNumber\r\nexports.validatePhoneNumberLength = min.validatePhoneNumberLength\r\n\r\n// `parse()` and `parseNumber()` functions are deprecated.\r\nvar parse_ = require('./build/parse').default\r\nexports.parse = function parse() {\r\n\treturn withMetadata(parse_, arguments)\r\n}\r\nexports.parseNumber = exports.parse\r\n\r\n// `format()` and `formatNumber()` functions are deprecated.\r\nvar format_ = require('./build/format').default\r\nexports.format = function format() {\r\n\treturn withMetadata(format_, arguments)\r\n}\r\nexports.formatNumber = exports.format\r\n\r\n// Deprecated.\r\nvar getNumberType_ = require('./build/getNumberType').default\r\nexports.getNumberType = function getNumberType() {\r\n\treturn withMetadata(getNumberType_, arguments)\r\n}\r\n\r\n// Deprecated.\r\nvar isPossibleNumber_ = require('./build/isPossibleNumber').default\r\nexports.isPossibleNumber = function isPossibleNumber() {\r\n\treturn withMetadata(isPossibleNumber_, arguments)\r\n}\r\n\r\n// Deprecated.\r\nvar isValidNumber_ = require('./build/validate').default\r\nexports.isValidNumber = function isValidNumber() {\r\n\treturn withMetadata(isValidNumber_, arguments)\r\n}\r\n\r\n// Deprecated.\r\nvar isValidNumberForRegion_ = require('./build/isValidNumberForRegion').default\r\nexports.isValidNumberForRegion = function isValidNumberForRegion() {\r\n\treturn withMetadata(isValidNumberForRegion_, arguments)\r\n}\r\n\r\nexports.getExampleNumber = min.getExampleNumber\r\nexports.Metadata = min.Metadata\r\n\r\n// Deprecated.\r\nvar findPhoneNumbers_ = require('./build/findPhoneNumbers').default\r\nexports.findPhoneNumbers = function findPhoneNumbers() {\r\n\treturn withMetadata(findPhoneNumbers_, arguments)\r\n}\r\n\r\n// Deprecated.\r\nvar searchPhoneNumbers_ = require('./build/findPhoneNumbers').searchPhoneNumbers\r\nexports.searchPhoneNumbers = function searchPhoneNumbers() {\r\n\treturn withMetadata(searchPhoneNumbers_, arguments)\r\n}\r\n\r\n// Deprecated.\r\nvar PhoneNumberSearch_ = require('./build/findPhoneNumbers_').PhoneNumberSearch\r\nexports.PhoneNumberSearch = function PhoneNumberSearch(text, options) {\r\n\treturn PhoneNumberSearch_.call(this, text, options, metadata)\r\n}\r\nexports.PhoneNumberSearch.prototype = Object.create(PhoneNumberSearch_.prototype, {})\r\nexports.PhoneNumberSearch.prototype.constructor = exports.PhoneNumberSearch\r\n\r\n// Deprecated.\r\nexports.findNumbers = min.findNumbers\r\n// Deprecated.\r\nexports.searchNumbers = min.searchNumbers\r\n\r\nexports.findPhoneNumbersInText = min.findPhoneNumbersInText\r\nexports.searchPhoneNumbersInText = min.searchPhoneNumbersInText\r\nexports.PhoneNumberMatcher = min.PhoneNumberMatcher\r\n\r\nexports.AsYouType = min.AsYouType\r\n\r\nexports.getCountries = min.getCountries\r\nexports.getCountryCallingCode = min.getCountryCallingCode\r\nexports.isSupportedCountry = min.isSupportedCountry\r\nexports.getExtPrefix = min.getExtPrefix\r\n\r\nexports.parseRFC3966 = min.parseRFC3966\r\nexports.formatRFC3966 = min.formatRFC3966\r\n\r\n// Deprecated: `DIGITS` were used by `react-phone-number-input`.\r\n// Replaced by `parseDigits()`.\r\nexports.DIGITS = require('./build/helpers/parseDigits').DIGITS\r\nexports.DIGIT_PLACEHOLDER = min.DIGIT_PLACEHOLDER\r\n\r\n// `getPhoneCode` name is deprecated\r\nexports.getPhoneCode = min.getCountryCallingCode\r\n\r\nexports.formatIncompletePhoneNumber = min.formatIncompletePhoneNumber\r\nexports.parseIncompletePhoneNumber = min.parseIncompletePhoneNumber\r\nexports.parsePhoneNumberCharacter = min.parsePhoneNumberCharacter\r\nexports.parseDigits = min.parseDigits","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SendBySmsStateEnum;\n(function (SendBySmsStateEnum) {\n SendBySmsStateEnum[\"default\"] = \"default\";\n SendBySmsStateEnum[\"loading\"] = \"loading\";\n SendBySmsStateEnum[\"success\"] = \"success\";\n SendBySmsStateEnum[\"failed\"] = \"failed\";\n})(SendBySmsStateEnum || (SendBySmsStateEnum = {}));\nexports.default = SendBySmsStateEnum;\n//# sourceMappingURL=SendBySmsStateEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass SendBySmsStyle {\n static getStyle(options) {\n const { spacing, color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: flex-start;\n\t\t\t}\n\n\t\t\tkompis-input {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-self: stretch;\n\t\t\t\tmargin-bottom: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\tkompis-text {\n\t\t\t\tcolor: ${color.neutral.grey700};\n\t\t\t}\n\n\t\t\tskapa-inline-message {\n\t\t\t\tmargin-top: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.message {\n\t\t\t\tdisplay: block;\n\t\t\t\tmargin-top: ${spacing.space50 / 16}rem;\n\t\t\t\tfont-size: 0;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = SendBySmsStyle;\n//# sourceMappingURL=SendBySmsStyle.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_input_1 = require(\"@inter-ikea-kompis/component-input\");\nconst LibPhoneNumber = __importStar(require(\"libphonenumber-js/index.common.js\"));\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@inter-ikea-kompis/component-input\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/inline-message-webc\");\nrequire(\"@ingka/icon-store/warning-triangle\");\nrequire(\"@ingka/icon-store/checkmark-circle\");\nconst SendBySmsStateEnum_1 = __importDefault(require(\"../../enums/SendBySmsStateEnum\"));\nconst SendBySmsStyle_1 = __importDefault(require(\"./SendBySmsStyle\"));\n/**\n * @event input Emitted when user write a character in the input field\n * @event state The state of the component\n * @event validation Show error message or not depending on valid input\n * @event send Click on send button\n * @event reset Sent after 3 seconds after state success.\n */\nlet SendBySms = class SendBySms extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Valid states can be found in SendBySmsState\n this.state = SendBySmsStateEnum_1.default.default;\n // Valid input in input field\n this.invalidInput = false;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // Phone number\n this.value = null;\n // Enable to allow autocompletion in the browser. Note that it should be disabled in Kiosks due to privacy policies, as it can otherwise store user data.\n this.autocomplete = false;\n this.selectionStart = 0;\n this.selectionEnd = 0;\n this.timeout = null;\n this.dexfSettings = null;\n }\n render() {\n // We want translations and settings to be required, but since the props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t

    ${this.getInput()} ${this.getSendButton()}
    \n\t\t\t${this.getMessage()}\n\t\t`;\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n if (this.timeout) {\n clearTimeout(this.timeout);\n }\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n if (changedProperties.has('state')) {\n if (this.state === SendBySmsStateEnum_1.default.success) {\n if (this.timeout) {\n clearTimeout(this.timeout);\n }\n this.timeout = setTimeout(() => {\n this.dispatchEvent(new CustomEvent('reset', { bubbles: true }));\n }, 3000);\n }\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n getSettings() {\n return this.dexfSettings;\n }\n getInput() {\n const { phoneNumber, phoneNumberInvalid } = this.getTranslations();\n return (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n }\n getMessage() {\n return (0, web_component_1.html) `${this.getInlineMessage()} ${this.getDisclaimer()}`;\n }\n getInlineMessage() {\n return (0, web_component_1.html) `
    ${this.getSuccessMessage()}
    \n\t\t\t
    ${this.getFailedMessage()}
    `;\n }\n getSuccessMessage() {\n if (this.state !== SendBySmsStateEnum_1.default.success) {\n return null;\n }\n const positiveVariant = 'positive';\n const smsSuccessMessage = this.getTranslations().smsSuccessMessage;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${smsSuccessMessage}\n\t\t`;\n }\n getFailedMessage() {\n if (this.state !== SendBySmsStateEnum_1.default.failed) {\n return null;\n }\n const cautionaryVariant = 'cautionary';\n const ikeaGenericErrorTryAgain = this.getTranslations().ikeaGenericErrorTryAgain;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${ikeaGenericErrorTryAgain}\n\t\t`;\n }\n getDisclaimer() {\n const { privacyPolicyNoLinks, privacyPolicy } = this.getTranslations();\n const privacyPolicyLink = this.getSettings().kompis.urls.privacyPolicyLink;\n if (!privacyPolicy || !privacyPolicyNoLinks) {\n return null;\n }\n if (this.disableLinks) {\n return (0, web_component_1.html) `\n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t\t\t${privacyPolicyNoLinks}\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t${privacyPolicyLink.replace('http://', '').replace('https://', '')}\n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t`;\n }\n const links = this.getSplitPrivacyPolicyString(privacyPolicy);\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${links.map((text, index) => {\n if (index === links.length - 1) {\n return (0, web_component_1.html) `\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t${text}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t`;\n }\n return (0, web_component_1.html) `\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t${text}\n\t\t\t\t\t\t\n\t\t\t\t\t\t${this.getPrivacyPolicyLink()}\n\t\t\t\t\t`;\n })}\n\t\t\t
    \n\t\t`;\n }\n getSplitPrivacyPolicyString(text) {\n if (text.includes('{{')) {\n return text.split('{{privacy_policy_link}}');\n }\n else {\n return text.split('[[privacy_policy_link]]');\n }\n }\n getPrivacyPolicyLink() {\n const privacyPolicyLink = this.getSettings().kompis.urls.privacyPolicyLink;\n const privacyPolicyLinkText = this.getTranslations().privacyPolicyLinkText;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n getSendButton() {\n const primaryVariant = 'primary';\n const { buttonSend, loading } = this.getTranslations();\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${buttonSend}\n\t\t\t\n\t\t`;\n }\n onFocusOut(event) {\n const { value } = event.detail;\n if (!this.validateInput(value)) {\n const { country } = utilities_1.LocaleUtility.getCountryAndLanguage(this.locale);\n if (country === null) {\n throw new exceptions_1.ComponentElementException(this, `Could not extract country from locale: \"${this.locale}\"`);\n }\n const countryCode = '+' +\n LibPhoneNumber.getCountryCallingCode(country.toUpperCase());\n if (value.replace(countryCode, '').length < 1 || value === '+') {\n this.dispatchValidationEvent({ invalidInput: false });\n }\n else {\n this.dispatchValidationEvent({ invalidInput: true });\n }\n }\n }\n onInput(event) {\n this.selectionStart = event.detail.selectionStart;\n this.selectionEnd = event.detail.selectionEnd;\n if (event.detail.value === '') {\n this.dispatchEvent(new CustomEvent('input', { bubbles: true, detail: { value: '+' } }));\n }\n else {\n this.dispatchEvent(new CustomEvent('input', { bubbles: true, detail: { value: event.detail.value } }));\n }\n if (this.invalidInput && this.validateInput(event.detail.value)) {\n this.dispatchValidationEvent({ invalidInput: false });\n }\n }\n onKeyPressed(event) {\n if (event.code === 'Enter' && this.validateInput(this.value) && !this.invalidInput) {\n this.onSendClick();\n }\n else if (event.code === 'Enter' && !this.validateInput(this.value) && !this.invalidInput) {\n this.dispatchValidationEvent({ invalidInput: true });\n }\n }\n onSendClick() {\n var _a;\n if (this.invalidInput || !this.validateInput(this.value)) {\n this.dispatchValidationEvent({ invalidInput: true, includeInputElement: true });\n }\n else {\n this.dispatchEvent(new CustomEvent('send', {\n bubbles: true,\n detail: {\n value: (_a = this.value) === null || _a === void 0 ? void 0 : _a.replace(/-/g, '')\n }\n }));\n }\n }\n /**\n * @param object\n * @param object.invalidInput Whether the input is invalid or not.\n * @param object.includeInputElement Whether the input element should be included in the event detail.\n */\n dispatchValidationEvent({ invalidInput, includeInputElement = false }) {\n var _a, _b;\n const inputElement = includeInputElement\n ? (_b = (_a = this.shadowRoot.querySelector('kompis-input')) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('input')\n : undefined;\n this.dispatchEvent(new CustomEvent('validation', {\n bubbles: true,\n detail: {\n invalidInput,\n inputElement\n }\n }));\n }\n getValue() {\n // Fix for Spanish islands\n const countrySubdivisions = { ce: 'es', sp: 'es' };\n if (this.value === null || this.value === '') {\n const { country } = utilities_1.LocaleUtility.getCountryAndLanguage(this.locale);\n if (country === null) {\n throw new exceptions_1.ComponentElementException(this, `Could not extract country from locale: \"${this.locale}\"`);\n }\n if (country in countrySubdivisions) {\n return ('+' +\n LibPhoneNumber.getCountryCallingCode(countrySubdivisions[country].toUpperCase()));\n }\n return ('+' +\n LibPhoneNumber.getCountryCallingCode(country.toUpperCase()));\n }\n return this.value;\n }\n validateInput(value) {\n if (!this.value) {\n return false;\n }\n const parsedNumber = LibPhoneNumber.parsePhoneNumberFromString(value);\n return parsedNumber === undefined ? false : parsedNumber.isValid();\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SendBySms.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SendBySms.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SendBySms.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SendBySms.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SendBySms.prototype, \"state\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SendBySms.prototype, \"invalidInput\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SendBySms.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, synchronous: true })\n], SendBySms.prototype, \"value\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SendBySms.prototype, \"autocomplete\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, required: true })\n], SendBySms.prototype, \"locale\", void 0);\nSendBySms = __decorate([\n (0, web_component_1.customElement)('kompis-send-by-sms')\n], SendBySms);\nexports.default = SendBySms;\n//# sourceMappingURL=SendBySms.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SendBySmsStateEnum = exports.SendBySms = void 0;\nconst SendBySms_1 = __importDefault(require(\"./components/send-by-sms/SendBySms\"));\nexports.SendBySms = SendBySms_1.default;\nconst SendBySmsStateEnum_1 = __importDefault(require(\"./enums/SendBySmsStateEnum\"));\nexports.SendBySmsStateEnum = SendBySmsStateEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ActionListItem = exports.ActionListControlEnum = exports.ActionListBorderEnum = exports.ActionList = void 0;\nconst ActionList_1 = __importDefault(require(\"./components/action-list/ActionList\"));\nexports.ActionList = ActionList_1.default;\nconst ActionListItem_1 = __importDefault(require(\"./components/action-list-item/ActionListItem\"));\nexports.ActionListItem = ActionListItem_1.default;\nconst ActionListBorderEnum_1 = __importDefault(require(\"./enums/ActionListBorderEnum\"));\nexports.ActionListBorderEnum = ActionListBorderEnum_1.default;\nconst ActionListControlEnum_1 = __importDefault(require(\"./enums/ActionListControlEnum\"));\nexports.ActionListControlEnum = ActionListControlEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar DividerTypeEnum;\n(function (DividerTypeEnum) {\n DividerTypeEnum[\"thin\"] = \"thin\";\n DividerTypeEnum[\"dashed\"] = \"dashed\";\n})(DividerTypeEnum || (DividerTypeEnum = {}));\nexports.default = DividerTypeEnum;\n//# sourceMappingURL=DividerTypeEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst DividerTypeEnum_1 = __importDefault(require(\"../../enums/DividerTypeEnum\"));\n/**\n * Style for Link.\n */\nclass DividerStyle {\n /**\n * Get the styles.\n *\n * @param options Options.\n * @param options.type Divider type.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { color } = options.theme;\n const borderType = options.type === DividerTypeEnum_1.default.dashed ? 'dashed' : 'solid';\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: block;\n\t\t\t\tborder-bottom: ${1 / 16}rem ${borderType} ${color.neutral.grey200};\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = DividerStyle;\n//# sourceMappingURL=DividerStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@inter-ikea-kompis/component-icon\");\nconst DividerTypeEnum_1 = __importDefault(require(\"../../enums/DividerTypeEnum\"));\nconst DividerStyle_1 = __importDefault(require(\"./DividerStyle\"));\n/**\n * Divider class.\n */\nlet Divider = class Divider extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Type of divider.\n this.type = DividerTypeEnum_1.default.thin;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Divider.prototype, \"type\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Divider.prototype, \"theme\", void 0);\nDivider = __decorate([\n (0, web_component_1.customElement)('kompis-divider')\n], Divider);\nexports.default = Divider;\n//# sourceMappingURL=Divider.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DividerTypeEnum = exports.Divider = void 0;\nconst Divider_1 = __importDefault(require(\"./components/divider/Divider\"));\nexports.Divider = Divider_1.default;\nconst DividerTypeEnum_1 = __importDefault(require(\"./enums/DividerTypeEnum\"));\nexports.DividerTypeEnum = DividerTypeEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('link', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'm15.5353 9.879-5.6568 5.6568-1.4142-1.4142 5.6568-5.6568 1.4142 1.4142z' } }, { tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M16.9496 7.0506c-1.1716-1.1716-3.0711-1.1716-4.2427 0l-1.4142 1.4142-1.4142-1.4143 1.4142-1.4142c1.9526-1.9526 5.1185-1.9526 7.0711 0 1.9526 1.9527 1.9526 5.1185 0 7.0711l-1.4142 1.4142-1.4143-1.4142 1.4143-1.4142c1.1715-1.1716 1.1715-3.071 0-4.2427zM7.05 16.95c1.1716 1.1716 3.0711 1.1716 4.2427 0l1.4142-1.4142 1.4142 1.4142-1.4142 1.4143c-1.9526 1.9526-5.1184 1.9526-7.071 0-1.9527-1.9527-1.9527-5.1185 0-7.0711L7.05 9.879l1.4142 1.4142L7.05 12.7074c-1.1716 1.1716-1.1716 3.0711 0 4.2426z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ShareDesignCardCopyStateEnum;\n(function (ShareDesignCardCopyStateEnum) {\n ShareDesignCardCopyStateEnum[\"default\"] = \"default\";\n ShareDesignCardCopyStateEnum[\"success\"] = \"success\";\n ShareDesignCardCopyStateEnum[\"failed\"] = \"failed\";\n})(ShareDesignCardCopyStateEnum || (ShareDesignCardCopyStateEnum = {}));\nexports.default = ShareDesignCardCopyStateEnum;\n//# sourceMappingURL=ShareDesignCardCopyStateEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ShareDesignCardStateEnum;\n(function (ShareDesignCardStateEnum) {\n ShareDesignCardStateEnum[\"default\"] = \"default\";\n ShareDesignCardStateEnum[\"sendByEmail\"] = \"sendByEmail\";\n ShareDesignCardStateEnum[\"sendBySms\"] = \"sendBySms\";\n ShareDesignCardStateEnum[\"getDesignCode\"] = \"getDesignCode\";\n ShareDesignCardStateEnum[\"getLink\"] = \"getLink\";\n})(ShareDesignCardStateEnum || (ShareDesignCardStateEnum = {}));\nexports.default = ShareDesignCardStateEnum;\n//# sourceMappingURL=ShareDesignCardStateEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst analytics_1 = require(\"@inter-ikea-kompis/analytics\");\nconst insights_data_provider_1 = require(\"@insights/insights-data-provider\");\nconst ShareDesignCardStateEnum_1 = __importDefault(require(\"../enums/ShareDesignCardStateEnum\"));\nconst moduleId = 'share_design_card';\n// Converts selected state in browser event 'select' to the corresponding name it should have in the analytics event 'share_design_select_option'\nconst BrowserEventSelectedStateToAnalyticsEventSelectedOption = {\n [ShareDesignCardStateEnum_1.default.sendByEmail]: 'email',\n [ShareDesignCardStateEnum_1.default.sendBySms]: 'sms',\n [ShareDesignCardStateEnum_1.default.getDesignCode]: 'code',\n [ShareDesignCardStateEnum_1.default.getLink]: 'link'\n};\n/**\n * Tracks events from Share Design Card and sends them to a reporter.\n *\n * @event share_design_select_option When a share option (item in action list) is clicked.\n * @event share_design_send_by_email When send button for sending email is clicked.\n * @event share_design_send_by_sms When send button for sending sms is clicked.\n * @event share_design_copy_code When copy code button is clicked.\n * @event share_design_copy_link When copy link button is clicked.\n * @event share_design_initial_configuration When the component is rendered the first time.\n */\nclass ShareDesignCardTracker extends analytics_1.AbstractAnalyticsTracker {\n /**\n * @param options\n * @param options.dev\n * @param options.ab\n * @param options.settings\n * @param options.locale\n * @param options.reporterId\n * @param options.context The context where the {@link SaveDesignCard} component is rendered, e.g. 'main_page', or 'summary_page'. This is used to distinguish the analytics data if the component is used in several places in a planner.\n */\n constructor(options) {\n super(Object.assign({ moduleId }, options));\n this.context = options.context;\n }\n /**\n * Call to report the initial config of ShareDesignCard.\n *\n * @param payload\n * @param payload.showEmailOption\n * @param payload.showSmsOption\n * @param payload.showCopyLinkOption\n * @param payload.showCopyCodeButton\n */\n sendInitialConfiguration(payload) {\n this.getReporter().report({\n event: 'share_design_initial_configuration',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.nonInteraction,\n payload: Object.assign(Object.assign({}, payload), { context: this.context })\n });\n }\n /**\n * Call to report when a share option (item in action list) is clicked.\n *\n * @param selectedState The selected state in Share Design Card.\n */\n sendSelectOption(selectedState) {\n this.getReporter().report({\n event: 'share_design_select_option',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.giveMe,\n payload: {\n option: BrowserEventSelectedStateToAnalyticsEventSelectedOption[selectedState],\n context: this.context\n }\n });\n }\n /**\n * Call to report when send button for sending email is clicked.\n *\n * @param designId The design id (VPC code).\n */\n sendSendByEmail(designId) {\n this.getReporter().report({\n event: 'share_design_send_by_email',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.giveMe,\n payload: { designId, context: this.context }\n });\n }\n /**\n * Call to report when send button for sending sms is clicked.\n *\n * @param designId The design id (VPC code).\n */\n sendSendBySms(designId) {\n this.getReporter().report({\n event: 'share_design_send_by_sms',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.giveMe,\n payload: { designId, context: this.context }\n });\n }\n /**\n * Call to report when copy code button is clicked.\n *\n * @param designId The design id (VPC code).\n */\n sendCopyCode(designId) {\n this.getReporter().report({\n event: 'share_design_copy_code',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.giveMe,\n payload: { designId, context: this.context }\n });\n }\n /**\n * Call to report when copy link button is clicked.\n *\n * @param designId The design id (VPC code).\n */\n sendCopyLink(designId) {\n this.getReporter().report({\n event: 'share_design_copy_link',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.giveMe,\n payload: { designId, context: this.context }\n });\n }\n}\nexports.default = ShareDesignCardTracker;\n//# sourceMappingURL=ShareDesignCardTracker.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nclass ShareDesignCardStyle {\n /**\n * Returns styles.\n *\n * @param options The props.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { color, spacing, breakpoint } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\n\t\t\t.title {\n\t\t\t\tdisplay: block;\n\t\t\t\tmargin-bottom: ${spacing.space300 / 16}rem;\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\n\t\t\t.default-description {\n\t\t\t\tdisplay: block;\n\t\t\t\tmargin-bottom: ${spacing.space300 / 16}rem;\n\t\t\t}\n\t\t\t.default-description h3 {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t.description {\n\t\t\t\tdisplay: block;\n\t\t\t\tmargin-bottom: ${spacing.space250 / 16}rem;\n\t\t\t}\n\n\t\t\t.designCodeText p {\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t\tmargin-bottom: ${spacing.space250 / 16}rem;\n\t\t\t}\n\n\t\t\tskapa-button {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\t.spacer {\n\t\t\t\tmargin-bottom: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.qr-code {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\tskapa-inline-message {\n\t\t\t\tmargin-top: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\tskapa-aspect-ratio {\n\t\t\t\tdisplay: block;\n\t\t\t\tmargin-bottom: ${spacing.space125 / 16}rem;\n\t\t\t}\n\n\t\t\tskapa-image {\n\t\t\t\tmax-width: ${200 / 16}rem;\n\t\t\t}\n\n\t\t\t.qr-code-text {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t@media screen and (min-width: ${breakpoint.large.width / 16}rem) {\n\t\t\t\t.qr-code {\n\t\t\t\t\tmargin: ${spacing.space400 / 16}rem 0;\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-direction: column;\n\t\t\t\t\tpadding: ${spacing.space125 / 16}rem;\n\t\t\t\t\tbackground-color: ${color.neutral.grey100};\n\t\t\t\t}\n\n\t\t\t\tkompis-qr-code {\n\t\t\t\t\twidth: ${132 / 16}rem;\n\t\t\t\t\tmargin: 0 auto;\n\t\t\t\t\tbackground-color: ${color.neutral.white};\n\t\t\t\t}\n\n\t\t\t\t.qr-code-text {\n\t\t\t\t\tmargin-top: ${spacing.space125 / 16}rem;\n\t\t\t\t\ttext-align: center;\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = ShareDesignCardStyle;\n//# sourceMappingURL=ShareDesignCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\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};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst icons_1 = require(\"@inter-ikea-kompis/icons\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_send_by_email_1 = require(\"@inter-ikea-kompis/component-send-by-email\");\nconst component_send_by_sms_1 = require(\"@inter-ikea-kompis/component-send-by-sms\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nconst insights_data_provider_1 = require(\"@insights/insights-data-provider\");\nrequire(\"@inter-ikea-kompis/component-action-list\");\nrequire(\"@inter-ikea-kompis/component-qr-code\");\nrequire(\"@inter-ikea-kompis/component-divider\");\nrequire(\"@inter-ikea-kompis/component-send-by-email\");\nrequire(\"@inter-ikea-kompis/component-send-by-sms\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/image-webc\");\nrequire(\"@ingka/inline-message-webc\");\nrequire(\"@ingka/icon-store/checkmark\");\nrequire(\"@ingka/icon-store/copy\");\nrequire(\"@ingka/icon-store/link\");\nrequire(\"@ingka/icon-store/warning-triangle\");\nconst ShareDesignCardCopyStateEnum_1 = __importDefault(require(\"../../enums/ShareDesignCardCopyStateEnum\"));\nconst ShareDesignCardStateEnum_1 = __importDefault(require(\"../../enums/ShareDesignCardStateEnum\"));\nconst ShareDesignCardTracker_1 = __importDefault(require(\"../../trackers/ShareDesignCardTracker\"));\nconst ShareDesignCardStyle_1 = __importDefault(require(\"./ShareDesignCardStyle\"));\n/**\n * Displays different options on how to share the solution.\n *\n * @event copyDesignCodeClick Triggered when the user clicks the copy design code button.\n * @event copyDesignCodeReset Triggered 3 seconds after copyDesignCodeState is set to success.\n * @event copyDesignLinkClick Triggered when the user clicks the copy design link button.\n * @event copyDesignLinkReset Triggered 3 seconds after copyDesignLinkState is set to success.\n * @event select Triggered when an item in the action list is clicked.\n * @event sendByEmailInput Triggered when the user writes in the sendByEmail view\n * @event sendByEmailReset Triggered 3 seconds after SendByEmailState is set to success.\n * @event sendByEmailSend Triggered when the user clicks send\n * @event sendByEmailValidation Triggered when the user tries to send with an invalid email\n * @event sendBySmsInput Triggered when the user writes in the sendBySms view\n * @event sendBySmsReset Triggered 3 seconds after SendBySmsState is set to success.\n * @event sendBySmsSend Triggered when the user clicks send\n * @event sendBySmsValidation Triggered when the user tries to send with an invalid number\n */\nlet ShareDesignCard = class ShareDesignCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // The url to the solution saved. If not set, \"Get link to design\" is not shown. When copied, query parameter with vpc source is added. Required for rendering optional QR code.\n this.designLink = null;\n // Set to true to show GetLink option in the default view. Requires the designLink to be set. Should be disabled in Kiosks.\n this.showGetLink = false;\n // If a QR code should be shown. Requires the designLink to be set. Won't show on tablet in portrait view or on mobile.\n this.showQrCode = false;\n // The current state of the component, e.g Share via SMS\n this.state = ShareDesignCardStateEnum_1.default.default;\n // Enable to allow autocompletion in the browser. Note that it should be disabled in Kiosks due to privacy policies, as it can otherwise store user data.\n this.autocomplete = false;\n // Disables outgoing links. Should be true in kiosks.\n this.disableLinks = false;\n // Set to true to show SendByEmail option in the default view\n this.showSendByEmail = false;\n // The current state of the SendByEmail view\n this.sendByEmailState = component_send_by_email_1.SendByEmailStateEnum.default;\n // The current value of the input in the SendByEmail view\n this.sendByEmailValue = '';\n // If the current value of the sendByEmail input field is valid or not\n this.sendByEmailInvalidInput = false;\n // Set to true to show SendBySms option in the default view\n this.showSendBySms = false;\n // The current state of the SendBySms view\n this.sendBySmsState = component_send_by_sms_1.SendBySmsStateEnum.default;\n // The current value of the input in the SendBySms view\n this.sendBySmsValue = '';\n // If the current value of the sendBySms input field is valid or not\n this.sendBySmsInvalidInput = false;\n // Shows the button in the copyDesignCode view. Should be false in kiosks.\n this.showCopyDesignCodeButton = false;\n // The current state for the copy design code button\n this.copyDesignCodeState = ShareDesignCardCopyStateEnum_1.default.default;\n // The current state for the copy design link button\n this.copyDesignLinkState = ShareDesignCardCopyStateEnum_1.default.default;\n // The current design screenshot image.\n this.screenshotUrl = null;\n // The current design screenshot image alt text.\n this.screenshotAlt = null;\n // The current design screenshot image product name.\n this.productName = '';\n // The current design screenshot image product description.\n this.productDescription = '';\n // Used for automatic analytics. If null or not set, analytics is turned off.\n this.analytics = null;\n this.copyDesignCodeTimeout = null;\n this.copyDesignLinkTimeout = null;\n this.tracker = null;\n this.dexfSettings = null;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getViewForState()}\n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n if (this.copyDesignCodeTimeout) {\n clearTimeout(this.copyDesignCodeTimeout);\n }\n if (this.copyDesignLinkTimeout) {\n clearTimeout(this.copyDesignLinkTimeout);\n }\n this.disconnectTracker();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('copyDesignCodeState')) {\n if (this.copyDesignCodeState === ShareDesignCardCopyStateEnum_1.default.success) {\n if (this.copyDesignCodeTimeout) {\n clearTimeout(this.copyDesignCodeTimeout);\n }\n this.copyDesignCodeTimeout = setTimeout(() => this.dispatchEvent(new CustomEvent('copyDesignCodeReset', { bubbles: true })), 3000);\n }\n }\n if (changedProperties.has('copyDesignLinkState')) {\n if (this.copyDesignLinkState === ShareDesignCardCopyStateEnum_1.default.success) {\n if (this.copyDesignLinkTimeout) {\n clearTimeout(this.copyDesignLinkTimeout);\n }\n this.copyDesignLinkTimeout = setTimeout(() => this.dispatchEvent(new CustomEvent('copyDesignLinkReset', { bubbles: true })), 3000);\n }\n }\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n if (changedProperties.has('analytics')) {\n this.disconnectTracker();\n this.connectTracker().then(() => {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendInitialConfiguration({\n showEmailOption: this.showSendByEmailOption(),\n showSmsOption: this.showSendBySmsOption(),\n showCopyLinkOption: this.showGetLinkOption(),\n showCopyCodeButton: this.showCopyDesignCodeButton\n });\n });\n }\n return true;\n }\n getSettings() {\n return this.dexfSettings;\n }\n hasTranslationsAndSettings() {\n return !!this.localizedInformation || !!(this.translations && this.settings);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n connectTracker() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n if (this.analytics) {\n // eslint-disable-next-line no-underscore-dangle\n const reporter = this.analytics.__INTERNAL__reporter;\n if ((reporter === null || reporter === void 0 ? void 0 : reporter.connected) === false) {\n // Should use an existing reporter, but wait for it to be connected\n return;\n }\n // Use existing connected reporter, or the tracker should create a new one.\n const reporterId = reporter ? reporter.id : undefined;\n this.tracker = new ShareDesignCardTracker_1.default(Object.assign(Object.assign({}, this.analytics), { settings: this.getSettings(), locale: this.locale, reporterId }));\n yield ((_a = this.tracker) === null || _a === void 0 ? void 0 : _a.connect());\n }\n });\n }\n disconnectTracker() {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.disconnect();\n this.tracker = null;\n }\n /**\n * Returns the view for the component depending on state.\n */\n getViewForState() {\n switch (this.state) {\n case ShareDesignCardStateEnum_1.default.sendByEmail:\n return this.getSendByEmail();\n case ShareDesignCardStateEnum_1.default.sendBySms:\n return this.getSendBySms();\n case ShareDesignCardStateEnum_1.default.getDesignCode:\n return this.getDesignCode();\n case ShareDesignCardStateEnum_1.default.getLink:\n return this.getLinkToDesign();\n default:\n return this.getDefault();\n }\n }\n /**\n * @returns True if notifications are enabled in localizedInformation.\n */\n notificationsAreEnabled() {\n const { notificationDataSource } = this.getSettings().kompis.serviceSettings;\n return notificationDataSource !== enums_1.NotificationDataSourceEnum.disabled;\n }\n /**\n * @returns True if showSendByEmail is true and notifications are enabled in localizedInformation.\n */\n showSendByEmailOption() {\n return this.showSendByEmail && this.notificationsAreEnabled();\n }\n /**\n * @returns True if showSendBySms is true and notifications are enabled in localizedInformation.\n */\n showSendBySmsOption() {\n return this.showSendBySms && this.notificationsAreEnabled();\n }\n /**\n * @returns True if designLink is provided, showGetLink is true and disableLinks is false.\n */\n showGetLinkOption() {\n return !!this.designLink && this.showGetLink && !this.disableLinks;\n }\n onlyDesignCodeViewIsActivated() {\n return (!this.showSendByEmailOption() && !this.showSendBySmsOption() && !this.showGetLinkOption());\n }\n /**\n * Get default view.\n */\n getDefault() {\n if (this.onlyDesignCodeViewIsActivated()) {\n return (0, web_component_1.html) `${this.getTitle(ShareDesignCardStateEnum_1.default.default)} ${this.getProductDescription()}\n\t\t\t${this.getDesignCodeBody()} ${this.getQrCode()}`;\n }\n return (0, web_component_1.html) `
    \n\t\t\t${this.getTitle(ShareDesignCardStateEnum_1.default.default)} ${this.getProductDescription()}\n\t\t\t${this.getActionList()} ${this.getQrCode()}\n\t\t
    `;\n }\n /**\n * Get title for view.\n *\n * @param view\n */\n getTitle(view) {\n const { shareDesignCardDefaultTitle, shareDesignCardSendByEmailTitle, shareDesignCardSendBySmsTitle, shareDesignCardGetDesignCodeTitle, shareDesignCardGetLinkTitle } = this.getTranslations();\n const titles = {\n [ShareDesignCardStateEnum_1.default.default]: shareDesignCardDefaultTitle,\n [ShareDesignCardStateEnum_1.default.sendByEmail]: shareDesignCardSendByEmailTitle,\n [ShareDesignCardStateEnum_1.default.sendBySms]: shareDesignCardSendBySmsTitle,\n [ShareDesignCardStateEnum_1.default.getDesignCode]: shareDesignCardGetDesignCodeTitle,\n [ShareDesignCardStateEnum_1.default.getLink]: shareDesignCardGetLinkTitle\n };\n return (0, web_component_1.html) `

    \n\t\t\t${titles[view]}\n\t\t

    `;\n }\n /**\n * Get Action List.\n */\n getActionList() {\n const sendByEmail = this.showSendByEmailOption()\n ? this.getActionListItem(ShareDesignCardStateEnum_1.default.sendByEmail)\n : '';\n const sendBySms = this.showSendBySmsOption()\n ? this.getActionListItem(ShareDesignCardStateEnum_1.default.sendBySms)\n : '';\n const getDesignCode = this.getActionListItem(ShareDesignCardStateEnum_1.default.getDesignCode);\n const getDesignLink = this.showGetLinkOption()\n ? this.getActionListItem(ShareDesignCardStateEnum_1.default.getLink)\n : '';\n return (0, web_component_1.html) ` \n\n\t\t\t\n\t\t\t\t${sendByEmail} ${sendBySms} ${getDesignCode} ${getDesignLink}\n\t\t\t`;\n }\n /**\n * Get Action List Item.\n *\n * @param state\n */\n getActionListItem(state) {\n const { shareDesignCardSendByEmailLabel, shareDesignCardSendBySmsLabel, shareDesignCardGetDesignCodeLabel, shareDesignCardGetLinkLabel } = this.getTranslations();\n const labels = {\n [ShareDesignCardStateEnum_1.default.sendByEmail]: shareDesignCardSendByEmailLabel,\n [ShareDesignCardStateEnum_1.default.sendBySms]: shareDesignCardSendBySmsLabel,\n [ShareDesignCardStateEnum_1.default.getDesignCode]: shareDesignCardGetDesignCodeLabel,\n [ShareDesignCardStateEnum_1.default.getLink]: shareDesignCardGetLinkLabel\n };\n const icons = {\n [ShareDesignCardStateEnum_1.default.sendByEmail]: icons_1.MailIcon,\n [ShareDesignCardStateEnum_1.default.sendBySms]: icons_1.MobileHandoverIcon,\n [ShareDesignCardStateEnum_1.default.getDesignCode]: icons_1.ScanQRCodeIcon,\n [ShareDesignCardStateEnum_1.default.getLink]: icons_1.LinkIcon\n };\n return (0, web_component_1.html) `\n\t\t\t {\n var _a;\n this.dispatchEvent(new CustomEvent('select', {\n bubbles: true,\n detail: { selectedState: state }\n }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendSelectOption(state);\n }}\"\n\t\t\t>\n\t\t`;\n }\n /**\n * Get description for view.\n *\n * @param view\n */\n getDescription(view) {\n const { shareDesignCardSendByEmailDescription, shareDesignCardSendBySmsDescription, shareDesignCardGetDesignCodeDescription, shareDesignCardGetLinkDescription } = this.getTranslations();\n const descriptions = {\n [ShareDesignCardStateEnum_1.default.sendByEmail]: shareDesignCardSendByEmailDescription,\n [ShareDesignCardStateEnum_1.default.sendBySms]: shareDesignCardSendBySmsDescription,\n [ShareDesignCardStateEnum_1.default.getDesignCode]: shareDesignCardGetDesignCodeDescription,\n [ShareDesignCardStateEnum_1.default.getLink]: shareDesignCardGetLinkDescription\n };\n return (0, web_component_1.html) `

    \n\t\t\t${(0, web_component_1.unsafeHTML)(descriptions[view].replace(/[\\n\\r]+/gm, '

    '))}\n\t\t

    `;\n }\n /**\n * Get default description.\n */\n getProductDescription() {\n return (0, web_component_1.html) ` ${this.getScreenshot()}\n\t\t\t
    \n\t\t\t\t

    \n\t\t\t\t\t${this.productName.toUpperCase()}\n\t\t\t\t

    \n\t\t\t\t${this.productDescription}\n\t\t\t
    `;\n }\n /**\n * Get screenshot if available.\n */\n getScreenshot() {\n var _a;\n if (!this.screenshotUrl) {\n return null;\n }\n return (0, web_component_1.html) ` \n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n /**\n * Get Send By Email.\n */\n getSendByEmail() {\n return (0, web_component_1.html) `${this.getTitle(ShareDesignCardStateEnum_1.default.sendByEmail)}\n\t\t\t${this.getDescription(ShareDesignCardStateEnum_1.default.sendByEmail)}\n\t\t\t this.dispatchEvent(new CustomEvent('sendByEmailInput', { bubbles: true, detail }))}\"\n\t\t\t\t@validation=\"${({ detail }) => {\n const { inputElement } = detail, restOfDetail = __rest(detail, [\"inputElement\"]);\n this.dispatchEvent(new CustomEvent('sendByEmailValidation', { bubbles: true, detail: restOfDetail }));\n inputElement === null || inputElement === void 0 ? void 0 : inputElement.focus();\n }}\"\n\t\t\t\t@send=\"${({ detail }) => {\n var _a;\n this.dispatchEvent(new CustomEvent('sendByEmailSend', { bubbles: true, detail }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendSendByEmail(this.vpcCode);\n }}\"\n\t\t\t\t@reset=\"${({ detail }) => this.dispatchEvent(new CustomEvent('sendByEmailReset', { bubbles: true, detail }))}\"\n\t\t\t>\n\t\t\t`;\n }\n /**\n * Get Send By SMS.\n */\n getSendBySms() {\n return (0, web_component_1.html) `${this.getTitle(ShareDesignCardStateEnum_1.default.sendBySms)}\n\t\t\t${this.getDescription(ShareDesignCardStateEnum_1.default.sendBySms)}\n\t\t\t this.dispatchEvent(new CustomEvent('sendBySmsInput', { bubbles: true, detail }))}\"\n\t\t\t\t@validation=\"${({ detail }) => {\n const { inputElement } = detail, restOfDetail = __rest(detail, [\"inputElement\"]);\n this.dispatchEvent(new CustomEvent('sendBySmsValidation', { bubbles: true, detail: restOfDetail }));\n inputElement === null || inputElement === void 0 ? void 0 : inputElement.focus();\n }}\"\n\t\t\t\t@send=\"${({ detail }) => {\n var _a;\n this.dispatchEvent(new CustomEvent('sendBySmsSend', { bubbles: true, detail }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendSendBySms(this.vpcCode);\n }}\"\n\t\t\t\t@reset=\"${({ detail }) => this.dispatchEvent(new CustomEvent('sendBySmsReset', { bubbles: true, detail }))}\"\n\t\t\t>\n\t\t\t`;\n }\n /**\n * Click event for button for copy.\n */\n onCopyClick() {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n let thrownError = null;\n const linkToCopy = `${utilities_1.UrlUtility.addQueryParameter(this.designLink, 'vpcSource', insights_data_provider_1.DesignSourceEnum.clipboard)}`;\n const onVpcCodeView = this.state === ShareDesignCardStateEnum_1.default.getDesignCode || this.onlyDesignCodeViewIsActivated();\n const stringToCopy = onVpcCodeView ? this.vpcCode : linkToCopy;\n const eventName = onVpcCodeView ? 'copyDesignCodeClick' : 'copyDesignLinkClick';\n try {\n yield navigator.clipboard.writeText(stringToCopy);\n }\n catch (error) {\n thrownError = error;\n }\n this.dispatchEvent(new CustomEvent(eventName, {\n bubbles: true,\n detail: {\n state: !thrownError\n ? ShareDesignCardCopyStateEnum_1.default.success\n : ShareDesignCardCopyStateEnum_1.default.failed,\n error: thrownError === null || thrownError === void 0 ? void 0 : thrownError.message\n }\n }));\n if (onVpcCodeView) {\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendCopyCode(this.vpcCode);\n }\n else {\n (_b = this.tracker) === null || _b === void 0 ? void 0 : _b.sendCopyLink(this.vpcCode);\n }\n if (thrownError) {\n throw thrownError;\n }\n });\n }\n /**\n * Get body of design code view.\n */\n getDesignCodeBody() {\n const primaryVariant = 'primary';\n const { shareDesignCardGetDesignCodeButtonSuccess, shareDesignCardGetDesignCodeButtonDefault, shareDesignCardGetDesignCodeDesignCode } = this.getTranslations();\n let buttonLabel;\n let buttonIcon;\n switch (this.copyDesignCodeState) {\n case ShareDesignCardCopyStateEnum_1.default.success:\n buttonLabel = shareDesignCardGetDesignCodeButtonSuccess;\n buttonIcon = 'checkmark';\n break;\n default:\n buttonLabel = shareDesignCardGetDesignCodeButtonDefault;\n buttonIcon = 'copy';\n break;\n }\n return (0, web_component_1.html) `\n\t\t\t${this.getDescription(ShareDesignCardStateEnum_1.default.getDesignCode)}\n\t\t\t
    \n\t\t\t\t

    \n\t\t\t\t\t${shareDesignCardGetDesignCodeDesignCode + ': '} ${this.vpcCode}\n\t\t\t\t

    \n\t\t\t
    \n\t\t\t${this.showCopyDesignCodeButton\n ? (0, web_component_1.html) `\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t${buttonLabel}\n\t\t\t\t\t\t\n\t\t\t\t\t\t${this.getCopyCodeFailedError()}`\n : null}\n\t\t`;\n }\n /**\n * Get Design Code view.\n */\n getDesignCode() {\n return (0, web_component_1.html) `${this.getTitle(ShareDesignCardStateEnum_1.default.getDesignCode)} ${this.getDesignCodeBody()}`;\n }\n getCopyFailedError() {\n const cautionaryVariant = 'cautionary';\n const { ikeaGenericErrorTryAgain } = this.getTranslations();\n return (0, web_component_1.html) `
    \n\t\t\t\n\t\t\t\t\n\t\t\t\t${ikeaGenericErrorTryAgain}\n\t\t\t\n\t\t
    `;\n }\n getCopyCodeFailedError() {\n if (this.copyDesignCodeState !== ShareDesignCardCopyStateEnum_1.default.failed) {\n return null;\n }\n return this.getCopyFailedError();\n }\n getCopyLinkFailedError() {\n if (this.copyDesignLinkState !== ShareDesignCardCopyStateEnum_1.default.failed) {\n return null;\n }\n return this.getCopyFailedError();\n }\n /**\n * Get Link To Design view.\n */\n getLinkToDesign() {\n const primaryVariant = 'primary';\n const { shareDesignCardGetLinkButtonSuccess, shareDesignCardGetLinkButtonDefault } = this.getTranslations();\n let buttonLabel;\n let buttonIcon;\n let buttonRole;\n switch (this.copyDesignLinkState) {\n case ShareDesignCardCopyStateEnum_1.default.success:\n buttonLabel = shareDesignCardGetLinkButtonSuccess;\n buttonIcon = 'checkmark';\n buttonRole = 'status';\n break;\n default:\n buttonLabel = shareDesignCardGetLinkButtonDefault;\n buttonIcon = 'link';\n buttonRole = 'none';\n break;\n }\n return (0, web_component_1.html) `${this.getTitle(ShareDesignCardStateEnum_1.default.getLink)}\n\t\t\t${this.getDescription(ShareDesignCardStateEnum_1.default.getLink)}\n\t\t\t\n\t\t\t\t\n\t\t\t\t${buttonLabel}\n\t\t\t\n\t\t\t${this.getCopyLinkFailedError()}`;\n }\n /**\n * Get QR Code.\n *\n * @returns The QR code.\n */\n getQrCode() {\n const { summaryPageQrCodeTitle, summaryPageQrCodeText } = this.getTranslations();\n if (!this.showQrCode || !this.designLink) {\n return null;\n }\n return (0, web_component_1.html) `
    \n\t\t\t\n\t\t\t

    ${summaryPageQrCodeText}

    \n\t\t
    `;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ShareDesignCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ShareDesignCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ShareDesignCard.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ShareDesignCard.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, required: true })\n], ShareDesignCard.prototype, \"locale\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, required: true })\n], ShareDesignCard.prototype, \"vpcCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ShareDesignCard.prototype, \"designLink\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ShareDesignCard.prototype, \"showGetLink\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ShareDesignCard.prototype, \"showQrCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ShareDesignCard.prototype, \"state\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ShareDesignCard.prototype, \"autocomplete\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ShareDesignCard.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ShareDesignCard.prototype, \"showSendByEmail\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ShareDesignCard.prototype, \"sendByEmailState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ShareDesignCard.prototype, \"sendByEmailValue\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ShareDesignCard.prototype, \"sendByEmailInvalidInput\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ShareDesignCard.prototype, \"showSendBySms\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ShareDesignCard.prototype, \"sendBySmsState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ShareDesignCard.prototype, \"sendBySmsValue\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ShareDesignCard.prototype, \"sendBySmsInvalidInput\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ShareDesignCard.prototype, \"showCopyDesignCodeButton\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ShareDesignCard.prototype, \"copyDesignCodeState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ShareDesignCard.prototype, \"copyDesignLinkState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ShareDesignCard.prototype, \"screenshotUrl\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ShareDesignCard.prototype, \"screenshotAlt\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ShareDesignCard.prototype, \"productName\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ShareDesignCard.prototype, \"productDescription\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ShareDesignCard.prototype, \"analytics\", void 0);\nShareDesignCard = __decorate([\n (0, web_component_1.customElement)('kompis-share-design-card')\n], ShareDesignCard);\nexports.default = ShareDesignCard;\n//# sourceMappingURL=ShareDesignCard.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShareDesignCardStateEnum = exports.ShareDesignCardCopyStateEnum = exports.ShareDesignCard = void 0;\nconst ShareDesignCard_1 = __importDefault(require(\"./components/share-design-card/ShareDesignCard\"));\nexports.ShareDesignCard = ShareDesignCard_1.default;\nconst ShareDesignCardCopyStateEnum_1 = __importDefault(require(\"./enums/ShareDesignCardCopyStateEnum\"));\nexports.ShareDesignCardCopyStateEnum = ShareDesignCardCopyStateEnum_1.default;\nconst ShareDesignCardStateEnum_1 = __importDefault(require(\"./enums/ShareDesignCardStateEnum\"));\nexports.ShareDesignCardStateEnum = ShareDesignCardStateEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ComponentUniqueEnum;\n(function (ComponentUniqueEnum) {\n ComponentUniqueEnum[\"confirmationCard\"] = \"confirmationCard\";\n})(ComponentUniqueEnum || (ComponentUniqueEnum = {}));\nvar ShareDesignCardEnum;\n(function (ShareDesignCardEnum) {\n ShareDesignCardEnum[\"shareDesignCard\"] = \"shareDesignCard\";\n})(ShareDesignCardEnum || (ShareDesignCardEnum = {}));\nvar ConfigurationSummaryModalEnum;\n(function (ConfigurationSummaryModalEnum) {\n ConfigurationSummaryModalEnum[\"confirmationCard\"] = \"confirmationCard\";\n ConfigurationSummaryModalEnum[\"ecoFeeCard\"] = \"ecoFeeCard\";\n ConfigurationSummaryModalEnum[\"energyFicheCard\"] = \"energyFicheCard\";\n ConfigurationSummaryModalEnum[\"energyLabelCard\"] = \"energyLabelCard\";\n ConfigurationSummaryModalEnum[\"unavailableProductCard\"] = \"unavailableProductCard\";\n ConfigurationSummaryModalEnum[\"financialServicesCard\"] = \"financialServicesCard\";\n ConfigurationSummaryModalEnum[\"saveDesignToProfileCard\"] = \"saveDesignToProfileCard\";\n ConfigurationSummaryModalEnum[\"shareDesignCard\"] = \"shareDesignCard\";\n})(ConfigurationSummaryModalEnum || (ConfigurationSummaryModalEnum = {}));\nexports.default = ConfigurationSummaryModalEnum;\n//# sourceMappingURL=ConfigurationSummaryModalEnum.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst component_share_design_card_1 = require(\"@inter-ikea-kompis/component-share-design-card\");\nrequire(\"@inter-ikea-kompis/component-share-design-card\");\nrequire(\"@ingka/modal-webc\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nconst ConfigurationSummaryModalEnum_1 = __importDefault(require(\"../../enums/ConfigurationSummaryModalEnum\"));\n/**\n * A sheet containing ShareDesignCard.\n *\n * @event modalClose Triggered when the user clicks on the sheet close button.\n * @event shareDesignCardStateChange Triggered when the state for ShareDesignCard changes.\n * @event sendByEmailInput Triggered when the user writes in the sendByEmail view.\n * @event sendByEmailValidation Triggered when the user tries to send with an invalid email.\n * @event sendByEmailSend Triggered when the user clicks send in the sendByEmail view.\n * @event sendByEmailReset Triggered 3 seconds after SendByEmailState is set to success.\n * @event sendBySmsInput Triggered when the user writes in the sendBySms view.\n * @event sendBySmsValidation Triggered when the user tries to send with an invalid number.\n * @event sendBySmsSend Triggered when the user clicks send in the sendBySms view.\n * @event sendBySmsReset Triggered 3 seconds after SendBySmsState is set to success.\n * @event copyDesignCodeClick Triggered when the user clicks the copy design code button.\n * @event copyDesignCodeReset Triggered 3 seconds after copyDesignCodeState is set to success.\n * @event copyDesignLinkClick Triggered when the user clicks the copy design link button.\n * @event copyDesignLinkReset Triggered 3 seconds after copyDesignLinkState is set to success.\n */\nlet ConfigurationSummaryShareDesignSheet = class ConfigurationSummaryShareDesignSheet extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // VPC code for the solution.\n this.vpcCode = null;\n // Disables outgoing links.\n this.disableLinks = false;\n // Visible modal\n this.visibleModal = null;\n // A collection of props used for the ShareDesignCard component rendered in the sheet.\n this.shareDesignCard = null;\n // The url for the screenshot.\n this.screenshotUrl = null;\n // The alt text for the screenshot.\n this.screenshotAlt = null;\n // The name of the product, e.g. PLATSA.\n this.productName = null;\n // Description of the product, e.g. \"Wardrobe, 200x300x55 cm\".\n this.productDescription = null;\n // Used for automatic analytics. If null or not set, analytics is turned off.\n this.analytics = null;\n this.shareDesignCardSheet = null;\n this.backButton = null;\n }\n render() {\n return null;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.closeSheet();\n }\n /**\n * Since this component uses pure javascript to render, it also means it must update props by itself.\n * Listening to changes using the shouldUpdate method and then updating props makes it so that this\n * component is updated when props are updated.\n *\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('visibleModal')) {\n if (this.visibleModal === ConfigurationSummaryModalEnum_1.default.shareDesignCard) {\n this.openSheet();\n }\n else {\n this.closeSheet();\n }\n }\n if (changedProperties.has('shareDesignCard') ||\n changedProperties.has('screenshotAlt') ||\n changedProperties.has('screenshotUrl') ||\n changedProperties.has('productName') ||\n changedProperties.has('productDescription') ||\n changedProperties.has('analytics')) {\n this.updateSheetElements();\n }\n return true;\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n if (!translations) {\n throw new Error('Translations must be defined either through the \"translations\" or \"localizedInformation\" prop.');\n }\n return translations;\n }\n closeSheet() {\n if (this.shareDesignCardSheet) {\n this.shareDesignCardSheet.open = false;\n this.shareDesignCardSheet = null;\n this.backButton = null;\n }\n }\n openSheet() {\n // Sheet is already shown\n if (this.shareDesignCardSheet) {\n return;\n }\n // Sheet should not be shown\n if (!this.vpcCode || !this.shareDesignCard) {\n return;\n }\n const shareDesignCardSheet = this.createShareDesignSheet();\n this.shareDesignCardSheet = shareDesignCardSheet;\n const parent = document.querySelector('kompis-keyboard-injector') || document.body;\n parent.appendChild(shareDesignCardSheet);\n shareDesignCardSheet.open = true;\n }\n updateSheetElements() {\n var _a, _b;\n this.shareDesignCardSheet && this.setPropsOnSheet(this.shareDesignCardSheet);\n const sheetHeader = (_a = this.shareDesignCardSheet) === null || _a === void 0 ? void 0 : _a.querySelector('skapa-modal-header');\n sheetHeader && this.toggleSheetHeaderBackButton(sheetHeader);\n const card = (_b = this.shareDesignCardSheet) === null || _b === void 0 ? void 0 : _b.querySelector('kompis-share-design-card');\n card && this.setPropsOnShareDesignCard(card);\n }\n setPropsOnSheet(sheetElement) {\n var _a, _b;\n const { shareDesignCardDefaultTitle, shareDesignCardSendByEmailTitle, shareDesignCardSendBySmsTitle, shareDesignCardGetDesignCodeTitle, shareDesignCardGetLinkTitle } = this.getTranslations();\n const ariaLabels = {\n [component_share_design_card_1.ShareDesignCardStateEnum.default]: shareDesignCardDefaultTitle,\n [component_share_design_card_1.ShareDesignCardStateEnum.sendByEmail]: shareDesignCardSendByEmailTitle,\n [component_share_design_card_1.ShareDesignCardStateEnum.sendBySms]: shareDesignCardSendBySmsTitle,\n [component_share_design_card_1.ShareDesignCardStateEnum.getDesignCode]: shareDesignCardGetDesignCodeTitle,\n [component_share_design_card_1.ShareDesignCardStateEnum.getLink]: shareDesignCardGetLinkTitle\n };\n if ((_a = this.shareDesignCard) === null || _a === void 0 ? void 0 : _a.state) {\n sheetElement.setAttribute('aria-label', ariaLabels[(_b = this.shareDesignCard) === null || _b === void 0 ? void 0 : _b.state]);\n }\n sheetElement.size = 'small';\n sheetElement.fullHeight = true;\n sheetElement.style.fontFamily = themes_1.FontStyle.getFontFamily(this.theme);\n sheetElement.style.zIndex = '500';\n }\n setPropsOnShareDesignCard(cardElement) {\n var _a;\n if (!this.vpcCode || !this.shareDesignCard) {\n return;\n }\n const designLink = (_a = this.shareDesignCard.designLink) !== null && _a !== void 0 ? _a : null;\n cardElement.theme = this.theme;\n cardElement.localizedInformation = this.localizedInformation;\n cardElement.translations = this.translations;\n cardElement.settings = this.settings;\n cardElement.vpcCode = this.vpcCode;\n cardElement.locale = this.locale;\n cardElement.designLink = this.shareDesignCard.showCopyLink ? designLink : null;\n cardElement.state = this.shareDesignCard.state;\n cardElement.disableLinks = this.disableLinks;\n cardElement.screenshotUrl = this.screenshotUrl;\n cardElement.screenshotAlt = this.screenshotAlt;\n if (this.productName) {\n cardElement.productName = this.productName;\n }\n if (this.productDescription) {\n cardElement.productDescription = this.productDescription;\n }\n if (this.shareDesignCard.autocomplete) {\n cardElement.autocomplete = this.shareDesignCard.autocomplete;\n }\n if (this.shareDesignCard.showGetLink) {\n cardElement.showGetLink = this.shareDesignCard.showGetLink;\n }\n if (this.shareDesignCard.showSendByEmail) {\n cardElement.showSendByEmail = this.shareDesignCard.showSendByEmail;\n }\n if (this.shareDesignCard.sendByEmailState) {\n cardElement.sendByEmailState = this.shareDesignCard.sendByEmailState;\n }\n if (this.shareDesignCard.showSendBySms) {\n cardElement.showSendBySms = this.shareDesignCard.showSendBySms;\n }\n if (this.shareDesignCard.sendBySmsState) {\n cardElement.sendBySmsState = this.shareDesignCard.sendBySmsState;\n }\n if (this.shareDesignCard.showCopyDesignCodeButton) {\n cardElement.showCopyDesignCodeButton = this.shareDesignCard.showCopyDesignCodeButton;\n }\n cardElement.analytics = this.analytics;\n }\n createShareDesignSheet() {\n const sheetElement = this.createSheet();\n const sheetHeaderElement = this.createSheetHeader();\n const shareDesignCardElement = this.createShareDesignCard();\n sheetElement.appendChild(sheetHeaderElement);\n sheetElement.appendChild(shareDesignCardElement);\n return sheetElement;\n }\n createSheet() {\n const sheetElement = document.createElement('skapa-sheet');\n this.setPropsOnSheet(sheetElement);\n sheetElement.addEventListener('closerequest', () => {\n if (this.shareDesignCardSheet) {\n this.dispatchEvent(new CustomEvent('modalClose', {\n bubbles: true,\n detail: {\n visibleModal: null\n }\n }));\n }\n });\n sheetElement.addEventListener('closed', () => {\n var _a;\n (_a = sheetElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(sheetElement);\n });\n return sheetElement;\n }\n createSheetHeader() {\n const sheetHeaderElement = document.createElement('skapa-modal-header');\n sheetHeaderElement.slot = 'header';\n const closeButtonLabelSlot = document.createElement('span');\n closeButtonLabelSlot.slot = 'closebutton-label';\n closeButtonLabelSlot.innerText = this.getTranslations().modalAriaLabelButtonClose;\n sheetHeaderElement.appendChild(closeButtonLabelSlot);\n this.toggleSheetHeaderBackButton(sheetHeaderElement);\n sheetHeaderElement.addEventListener('backrequest', () => this.dispatchEvent(new CustomEvent('shareDesignCardStateChange', {\n bubbles: true,\n detail: { selectedState: component_share_design_card_1.ShareDesignCardStateEnum.default }\n })));\n return sheetHeaderElement;\n }\n toggleSheetHeaderBackButton(sheetHeaderElement) {\n var _a;\n if (((_a = this.shareDesignCard) === null || _a === void 0 ? void 0 : _a.state) !== component_share_design_card_1.ShareDesignCardStateEnum.default) {\n if (!sheetHeaderElement.contains(this.backButton)) {\n const backButton = this.createBackButton();\n this.backButton = backButton;\n sheetHeaderElement.appendChild(backButton);\n }\n }\n else {\n this.backButton &&\n sheetHeaderElement.contains(this.backButton) &&\n sheetHeaderElement.removeChild(this.backButton);\n this.backButton = null;\n }\n }\n createBackButton() {\n const backButton = document.createElement('skapa-icon-button');\n backButton.a11yLabel = this.getTranslations().modalAriaLabelButtonBack || '';\n backButton.variant = 'primary';\n backButton.inverse = true;\n backButton.small = true;\n backButton.slot = 'back-button';\n const icon = document.createElement('skapa-icon');\n icon.icon = 'arrow-left';\n icon.flipRTL = true;\n icon.slot = 'icon';\n backButton.append(icon);\n return backButton;\n }\n createShareDesignCard() {\n const cardElement = document.createElement('kompis-share-design-card');\n this.setPropsOnShareDesignCard(cardElement);\n // Casting to EventListener to be able to access detail, which only exists in CustomEvent\n cardElement.addEventListener('select', ((event) => {\n cardElement.copyDesignLinkState = component_share_design_card_1.ShareDesignCardCopyStateEnum.default;\n cardElement.copyDesignCodeState = component_share_design_card_1.ShareDesignCardCopyStateEnum.default;\n this.dispatchEvent(new CustomEvent('shareDesignCardStateChange', { bubbles: true, detail: event.detail }));\n }));\n cardElement.addEventListener('copyDesignCodeClick', ((event) => {\n cardElement.copyDesignCodeState = event.detail.state;\n this.dispatchEvent(new CustomEvent('copyDesignCodeClick', { bubbles: true, detail: event.detail }));\n }));\n cardElement.addEventListener('copyDesignCodeReset', () => {\n cardElement.copyDesignCodeState = component_share_design_card_1.ShareDesignCardCopyStateEnum.default;\n this.dispatchEvent(new CustomEvent('copyDesignCodeReset', { bubbles: true }));\n });\n cardElement.addEventListener('copyDesignLinkClick', ((event) => {\n cardElement.copyDesignLinkState = event.detail.state;\n this.dispatchEvent(new CustomEvent('copyDesignLinkClick', { bubbles: true, detail: event.detail }));\n }));\n cardElement.addEventListener('copyDesignLinkReset', () => {\n cardElement.copyDesignLinkState = component_share_design_card_1.ShareDesignCardCopyStateEnum.default;\n this.dispatchEvent(new CustomEvent('copyDesignLinkReset', { bubbles: true }));\n });\n cardElement.addEventListener('sendByEmailInput', ((event) => {\n cardElement.sendByEmailValue = event.detail.value;\n this.dispatchEvent(new CustomEvent('sendByEmailInput', { bubbles: true, detail: event.detail }));\n }));\n cardElement.addEventListener('sendByEmailValidation', ((event) => {\n cardElement.sendByEmailInvalidInput = event.detail.invalidInput;\n this.dispatchEvent(new CustomEvent('sendByEmailValidation', { bubbles: true, detail: event.detail }));\n }));\n cardElement.addEventListener('sendByEmailSend', ((event) => {\n this.dispatchEvent(new CustomEvent('sendByEmailSend', { bubbles: true, detail: event.detail }));\n }));\n cardElement.addEventListener('sendByEmailReset', ((event) => {\n cardElement.sendByEmailValue = '';\n this.dispatchEvent(new CustomEvent('sendByEmailReset', { bubbles: true, detail: event.detail }));\n }));\n cardElement.addEventListener('sendBySmsInput', ((event) => {\n cardElement.sendBySmsValue = event.detail.value;\n this.dispatchEvent(new CustomEvent('sendBySmsInput', { bubbles: true, detail: event.detail }));\n }));\n cardElement.addEventListener('sendBySmsValidation', ((event) => {\n cardElement.sendBySmsInvalidInput = event.detail.invalidInput;\n this.dispatchEvent(new CustomEvent('sendBySmsValidation', { bubbles: true, detail: event.detail }));\n }));\n cardElement.addEventListener('sendBySmsSend', ((event) => {\n this.dispatchEvent(new CustomEvent('sendBySmsSend', { bubbles: true, detail: event.detail }));\n }));\n cardElement.addEventListener('sendBySmsReset', ((event) => {\n cardElement.sendBySmsValue = '';\n this.dispatchEvent(new CustomEvent('sendBySmsReset', { bubbles: true, detail: event.detail }));\n }));\n return cardElement;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ConfigurationSummaryShareDesignSheet.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ConfigurationSummaryShareDesignSheet.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ConfigurationSummaryShareDesignSheet.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ConfigurationSummaryShareDesignSheet.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, required: true })\n], ConfigurationSummaryShareDesignSheet.prototype, \"locale\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummaryShareDesignSheet.prototype, \"vpcCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ConfigurationSummaryShareDesignSheet.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ConfigurationSummaryShareDesignSheet.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ConfigurationSummaryShareDesignSheet.prototype, \"shareDesignCard\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummaryShareDesignSheet.prototype, \"screenshotUrl\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummaryShareDesignSheet.prototype, \"screenshotAlt\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummaryShareDesignSheet.prototype, \"productName\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummaryShareDesignSheet.prototype, \"productDescription\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ConfigurationSummaryShareDesignSheet.prototype, \"analytics\", void 0);\nConfigurationSummaryShareDesignSheet = __decorate([\n (0, web_component_1.customElement)('kompis-configuration-summary-share-design-sheet')\n], ConfigurationSummaryShareDesignSheet);\nexports.default = ConfigurationSummaryShareDesignSheet;\n//# sourceMappingURL=ConfigurationSummaryShareDesignSheet.js.map","import \"@inter-ikea-kompis/component-configuration-summary/lib/components/configuration-summary-share-design-sheet/ConfigurationSummaryShareDesignSheet\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisConfigurationSummaryShareDesignSheet extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-configuration-summary-share-design-sheet\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.analytics = props.analytics;\n element.disableLinks = props.disableLinks;\n element.locale = props.locale;\n element.localizedInformation = props.localizedInformation;\n element.productDescription = props.productDescription;\n element.productName = props.productName;\n element.screenshotAlt = props.screenshotAlt;\n element.screenshotUrl = props.screenshotUrl;\n element.settings = props.settings;\n element.shareDesignCard = props.shareDesignCard;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n element.vpcCode = props.vpcCode;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onCopyDesignCodeClick, \"copyDesignCodeClick\");\n this.updateEventListener(element, props.onCopyDesignCodeReset, \"copyDesignCodeReset\");\n this.updateEventListener(element, props.onCopyDesignLinkClick, \"copyDesignLinkClick\");\n this.updateEventListener(element, props.onCopyDesignLinkReset, \"copyDesignLinkReset\");\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onSendByEmailInput, \"sendByEmailInput\");\n this.updateEventListener(element, props.onSendByEmailReset, \"sendByEmailReset\");\n this.updateEventListener(element, props.onSendByEmailSend, \"sendByEmailSend\");\n this.updateEventListener(element, props.onSendByEmailValidation, \"sendByEmailValidation\");\n this.updateEventListener(element, props.onSendBySmsInput, \"sendBySmsInput\");\n this.updateEventListener(element, props.onSendBySmsReset, \"sendBySmsReset\");\n this.updateEventListener(element, props.onSendBySmsSend, \"sendBySmsSend\");\n this.updateEventListener(element, props.onSendBySmsValidation, \"sendBySmsValidation\");\n this.updateEventListener(element, props.onShareDesignCardStateChange, \"shareDesignCardStateChange\");\n }\n}\nKompisConfigurationSummaryShareDesignSheet.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n analytics: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n disableLinks: PropTypes.bool,\n locale: PropTypes.string.isRequired,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n productDescription: PropTypes.string,\n productName: PropTypes.string,\n screenshotAlt: PropTypes.string,\n screenshotUrl: PropTypes.string,\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n shareDesignCard: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n vpcCode: PropTypes.string,\n onModalClose: PropTypes.func,\n onShareDesignCardStateChange: PropTypes.func,\n onSendByEmailInput: PropTypes.func,\n onSendByEmailValidation: PropTypes.func,\n onSendByEmailSend: PropTypes.func,\n onSendByEmailReset: PropTypes.func,\n onSendBySmsInput: PropTypes.func,\n onSendBySmsValidation: PropTypes.func,\n onSendBySmsSend: PropTypes.func,\n onSendBySmsReset: PropTypes.func,\n onCopyDesignCodeClick: PropTypes.func,\n onCopyDesignCodeReset: PropTypes.func,\n onCopyDesignLinkClick: PropTypes.func,\n onCopyDesignLinkReset: PropTypes.func\n};\nexport default KompisConfigurationSummaryShareDesignSheet;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass AddToBagToastMessage {\n static getAddToCartSuccess(localizedInformationOrTranslations, urls) {\n const { addToShoppingCartSuccessHeadline, addToShoppingCartName } = this.getToastTranslations(localizedInformationOrTranslations);\n if ('urls' in localizedInformationOrTranslations) {\n return {\n label: addToShoppingCartSuccessHeadline,\n actionHref: localizedInformationOrTranslations.urls.shoppingCartLink,\n actionLabel: addToShoppingCartName\n };\n }\n else if (urls) {\n return {\n label: addToShoppingCartSuccessHeadline,\n actionHref: urls.shoppingCartLink,\n actionLabel: addToShoppingCartName\n };\n }\n throw new Error(\"URLs must either be provided through the 'urls' parameter or by using the ILocalizedInformation type for the 'localizedInformationOrTranslations' parameter.\");\n }\n static getAddToCartFailure(localizedInformationOrTranslations, urls) {\n const { addToShoppingCartFailureHeadline, addToShoppingCartFailureLink } = this.getToastTranslations(localizedInformationOrTranslations);\n if ('urls' in localizedInformationOrTranslations) {\n return {\n label: addToShoppingCartFailureHeadline,\n actionHref: localizedInformationOrTranslations.urls.shoppingCartLink,\n actionLabel: addToShoppingCartFailureLink\n };\n }\n else if (urls) {\n return {\n label: addToShoppingCartFailureHeadline,\n actionHref: urls.shoppingCartLink,\n actionLabel: addToShoppingCartFailureLink\n };\n }\n throw new Error(\"URLs must either be provided through the 'urls' parameter or by using the ILocalizedInformation type for the 'localizedInformationOrTranslations' parameter.\");\n }\n static getAddToCartFail(localizedInformationOrTranslations, urls) {\n const { addToShoppingBagAndListErrorMessage, addToShoppingListName } = this.getToastTranslations(localizedInformationOrTranslations);\n if ('urls' in localizedInformationOrTranslations) {\n return {\n label: addToShoppingBagAndListErrorMessage,\n actionHref: localizedInformationOrTranslations.urls.shoppingListLink,\n actionLabel: addToShoppingListName\n };\n }\n else if (urls) {\n return {\n label: addToShoppingBagAndListErrorMessage,\n actionHref: urls.shoppingListLink,\n actionLabel: addToShoppingListName\n };\n }\n throw new Error(\"URLs must either be provided through the 'urls' parameter or by using the ILocalizedInformation type for the 'localizedInformationOrTranslations' parameter.\");\n }\n static getToastTranslations(localizedInformationOrTranslations) {\n if ('translations' in localizedInformationOrTranslations) {\n return localizedInformationOrTranslations.translations;\n }\n return localizedInformationOrTranslations;\n }\n}\nexports.default = AddToBagToastMessage;\n//# sourceMappingURL=AddToBagToastMessage.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UnavailableProductsCard = exports.UnavailableOnlineBehaviourEnum = exports.AddToBagToastMessage = exports.AddToBagStateEnum = exports.AddToBagModalEnum = exports.AddToBagLayoutEnum = exports.AddToBag = void 0;\nconst AddToBag_1 = __importDefault(require(\"./components/add-to-bag/AddToBag\"));\nexports.AddToBag = AddToBag_1.default;\nconst UnavailableProductsCard_1 = __importDefault(require(\"./components/unavailable-products-card/UnavailableProductsCard\"));\nexports.UnavailableProductsCard = UnavailableProductsCard_1.default;\nconst AddToBagLayoutEnum_1 = __importDefault(require(\"./enums/AddToBagLayoutEnum\"));\nexports.AddToBagLayoutEnum = AddToBagLayoutEnum_1.default;\nconst AddToBagModalEnum_1 = __importDefault(require(\"./enums/AddToBagModalEnum\"));\nexports.AddToBagModalEnum = AddToBagModalEnum_1.default;\nconst AddToBagStateEnum_1 = __importDefault(require(\"./enums/AddToBagStateEnum\"));\nexports.AddToBagStateEnum = AddToBagStateEnum_1.default;\nconst UnavailableOnlineBehaviourEnum_1 = __importDefault(require(\"./enums/UnavailableOnlineBehaviourEnum\"));\nexports.UnavailableOnlineBehaviourEnum = UnavailableOnlineBehaviourEnum_1.default;\nconst AddToBagToastMessage_1 = __importDefault(require(\"./utilities/AddToBagToastMessage\"));\nexports.AddToBagToastMessage = AddToBagToastMessage_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nclass SaveDesignToProfileCardStyle {\n static getStyle(options) {\n const { spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\n\t\t\th2 {\n\t\t\t\tmargin: 0;\n\t\t\t\tmargin-bottom: ${spacing.space400 / 16}rem;\n\t\t\t}\n\n\t\t\timg {\n\t\t\t\tmax-width: ${200 / 16}rem;\n\t\t\t}\n\n\t\t\t.productName {\n\t\t\t\tmargin-top: ${spacing.space125 / 16}rem;\n\t\t\t\tmargin-bottom: 0;\n\t\t\t}\n\n\t\t\t.productDescription {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t/* CSS rules for visual reordering to maintain design while enhancing accessibility, compensating for HTML structure. */\n\t\t\t.designWrapper {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\t.designWrapper img {\n\t\t\t\torder: -1;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = SaveDesignToProfileCardStyle;\n//# sourceMappingURL=SaveDesignToProfileCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@ingka/inline-message-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/icon-store/information-circle\");\nconst SaveDesignToProfileCardStyle_1 = __importDefault(require(\"./SaveDesignToProfileCardStyle\"));\nlet SaveDesignToProfileCard = class SaveDesignToProfileCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // Whether the user is logged in to IKEA or not.\n this.loggedIn = false;\n // The url for the screenshot.\n this.screenshotUrl = null;\n // The alt text for the screenshot. If not set, a default alt text will be used.\n this.screenshotAlt = null;\n // The name of the product, e.g. PLATSA.\n this.productName = null;\n // Description of the product, e.g. \"Wardrobe, 200x300x55 cm\".\n this.productDescription = null;\n }\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t

    \n\t\t\t\t${this.getTranslations().saveDesignToProfileSaveDesignHeader}\n\t\t\t

    \n\n\t\t\t${this.loggedIn ? this.getDesignToSave() : this.getLogInInlineMessage()}\n\t\t`;\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n getDesignToSave() {\n var _a;\n const altText = (_a = this.screenshotAlt) !== null && _a !== void 0 ? _a : this.getTranslations().summaryPageScreenshotAltText;\n const image = this.screenshotUrl\n ? (0, web_component_1.html) `\"${altText}\"`\n : null;\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t

    \n\t\t\t\t\t${this.productName}\n\t\t\t\t

    \n\t\t\t\t${image}\n\t\t\t\t

    \n\t\t\t\t\t${this.productDescription}\n\t\t\t\t

    \n\t\t\t
    \n\t\t`;\n }\n getLogInInlineMessage() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getTranslations().saveDesignToProfileLogInMessage}\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SaveDesignToProfileCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SaveDesignToProfileCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SaveDesignToProfileCard.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SaveDesignToProfileCard.prototype, \"loggedIn\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SaveDesignToProfileCard.prototype, \"screenshotUrl\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SaveDesignToProfileCard.prototype, \"screenshotAlt\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SaveDesignToProfileCard.prototype, \"productName\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SaveDesignToProfileCard.prototype, \"productDescription\", void 0);\nSaveDesignToProfileCard = __decorate([\n (0, web_component_1.customElement)('kompis-save-design-to-profile-card')\n], SaveDesignToProfileCard);\nexports.default = SaveDesignToProfileCard;\n//# sourceMappingURL=SaveDesignToProfileCard.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SaveDesignToProfileModalEnum;\n(function (SaveDesignToProfileModalEnum) {\n SaveDesignToProfileModalEnum[\"saveDesignToProfileCard\"] = \"saveDesignToProfileCard\";\n})(SaveDesignToProfileModalEnum || (SaveDesignToProfileModalEnum = {}));\nexports.default = SaveDesignToProfileModalEnum;\n//# sourceMappingURL=SaveDesignToProfileModalEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SaveDesignToProfileStateEnum;\n(function (SaveDesignToProfileStateEnum) {\n SaveDesignToProfileStateEnum[\"default\"] = \"default\";\n SaveDesignToProfileStateEnum[\"loading\"] = \"loading\";\n})(SaveDesignToProfileStateEnum || (SaveDesignToProfileStateEnum = {}));\nexports.default = SaveDesignToProfileStateEnum;\n//# sourceMappingURL=SaveDesignToProfileStateEnum.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nrequire(\"@ingka/modal-webc\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"../save-design-to-profile-card/SaveDesignToProfileCard\");\nconst SaveDesignToProfileModalEnum_1 = __importDefault(require(\"../../enums/SaveDesignToProfileModalEnum\"));\nconst SaveDesignToProfileStateEnum_1 = __importDefault(require(\"../../enums/SaveDesignToProfileStateEnum\"));\n/**\n * @event modalClose Modal close.\n * @event logIn Triggered when the log in button is clicked.\n * @event saveDesign Triggered when the save button is clicked.\n * @event backButtonClick Triggered when the back button is clicked.\n */\nlet SaveDesignToProfile = class SaveDesignToProfile extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // Visible modal.\n this.visibleModal = null;\n // Whether the user is logged in to IKEA or not.\n this.loggedIn = false;\n // The url for the screenshot.\n this.screenshotUrl = null;\n // The alt text for the screenshot. If not set, a default alt text will be used.\n this.screenshotAlt = null;\n // The name of the product, e.g. PLATSA.\n this.productName = null;\n // Description of the product, e.g. \"Wardrobe, 200x300x55 cm\".\n this.productDescription = null;\n // The state of the saving the design.\n this.saveDesignState = SaveDesignToProfileStateEnum_1.default.default;\n // Where the sheet will open. The values are flipped in RTL, meaning \"right\" will open to the left and vice versa.\n this.sheetAlignment = enums_1.SheetAlignmentEnum.right;\n // Whether or not to show a back button.\n this.showBackButton = false;\n this.sheetElement = null;\n this.cardElement = null;\n this.sheetHeaderElement = null;\n this.sheetFooterElement = null;\n }\n render() {\n return null;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.closeSheet();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n var _a, _b;\n if (changedProperties.has('visibleModal')) {\n if (this.visibleModal === SaveDesignToProfileModalEnum_1.default.saveDesignToProfileCard) {\n this.openSheet();\n }\n else {\n this.closeSheet();\n }\n }\n if (this.cardElement) {\n this.cardElement.theme = this.theme;\n this.cardElement.localizedInformation = this.localizedInformation;\n this.cardElement.loggedIn = this.loggedIn;\n this.cardElement.screenshotUrl = this.screenshotUrl;\n this.cardElement.screenshotAlt = this.screenshotAlt;\n this.cardElement.productName = this.productName;\n this.cardElement.productDescription = this.productDescription;\n }\n if (changedProperties.has('showBackButton')) {\n this.recreateSheetHeader();\n }\n if (changedProperties.has('loggedIn')) {\n this.recreateSheetFooter();\n }\n if (changedProperties.has('saveDesignState')) {\n const button = (_b = (_a = this.sheetFooterElement) === null || _a === void 0 ? void 0 : _a.querySelector('skapa-button')) !== null && _b !== void 0 ? _b : null;\n if (button) {\n button.loading = this.saveDesignState === SaveDesignToProfileStateEnum_1.default.loading;\n }\n }\n return true;\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n if (!translations) {\n throw new Error('Translations must be defined either through the \"translations\" or \"localizedInformation\" prop.');\n }\n return translations;\n }\n closeSheet() {\n if (this.sheetElement) {\n this.sheetElement.open = false;\n this.sheetElement = null;\n this.cardElement = null;\n this.sheetHeaderElement = null;\n this.sheetFooterElement = null;\n }\n }\n openSheet() {\n if (this.sheetElement) {\n return;\n }\n const sheetElement = this.createSheetElement();\n sheetElement.addEventListener('closed', () => {\n var _a;\n (_a = sheetElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(sheetElement);\n });\n this.sheetElement = sheetElement;\n this.cardElement = sheetElement.querySelector('kompis-save-design-to-profile-card');\n this.sheetHeaderElement = sheetElement.querySelector('skapa-modal-header');\n this.sheetFooterElement = sheetElement.querySelector('skapa-modal-footer');\n const parent = document.querySelector('kompis-keyboard-injector') || document.body;\n parent.appendChild(sheetElement);\n sheetElement.open = true;\n }\n createSheetElement() {\n const sheetElement = this.createSheet();\n const sheetHeaderElement = this.createSheetHeader();\n const saveDesignToProfileCard = this.createCard();\n const sheetFooterElement = this.createSheetFooter();\n sheetElement.appendChild(sheetHeaderElement);\n sheetElement.appendChild(saveDesignToProfileCard);\n sheetElement.appendChild(sheetFooterElement);\n return sheetElement;\n }\n createSheet() {\n const sheetElement = document.createElement('skapa-sheet');\n sheetElement.setAttribute('aria-label', this.getTranslations().saveDesignToProfileSaveDesignHeader);\n sheetElement.size = 'small';\n sheetElement.style.zIndex = '500';\n sheetElement.fullHeight = true;\n sheetElement.alignToStart = this.sheetAlignment === enums_1.SheetAlignmentEnum.left;\n sheetElement.style.fontFamily = themes_1.FontStyle.getFontFamily(this.theme);\n sheetElement.addEventListener('closerequest', () => {\n if (this.sheetElement) {\n this.dispatchEvent(new CustomEvent('modalClose', {\n bubbles: true,\n detail: {\n visibleModal: null\n }\n }));\n }\n });\n return sheetElement;\n }\n recreateSheetHeader() {\n if (this.sheetElement) {\n if (this.sheetHeaderElement) {\n this.sheetElement.removeChild(this.sheetHeaderElement);\n this.sheetHeaderElement = null;\n }\n const header = this.createSheetHeader();\n this.sheetElement.prepend(header);\n this.sheetHeaderElement = header;\n }\n }\n createSheetHeader() {\n const sheetHeaderElement = document.createElement('skapa-modal-header');\n sheetHeaderElement.slot = 'header';\n const closeSpan = document.createElement('span');\n closeSpan.slot = 'closebutton-label';\n closeSpan.innerText = this.getTranslations().modalAriaLabelButtonClose;\n sheetHeaderElement.appendChild(closeSpan);\n if (this.showBackButton) {\n const backButton = this.createBackButton();\n sheetHeaderElement.appendChild(backButton);\n sheetHeaderElement.addEventListener('backrequest', () => {\n this.dispatchEvent(new CustomEvent('backButtonClick', {\n bubbles: true,\n detail: {\n visibleModal: null\n }\n }));\n });\n }\n return sheetHeaderElement;\n }\n createBackButton() {\n const backButton = document.createElement('skapa-icon-button');\n backButton.slot = 'back-button';\n backButton.variant = 'primary';\n backButton.inverse = true;\n backButton.small = true;\n backButton.innerText = this.getTranslations().modalAriaLabelButtonBack;\n const icon = document.createElement('skapa-icon');\n icon.slot = 'icon';\n icon.icon = 'arrow-left';\n icon.flipRTL = true;\n backButton.append(icon);\n return backButton;\n }\n createCard() {\n const saveDesignToProfileCard = document.createElement('kompis-save-design-to-profile-card');\n saveDesignToProfileCard.theme = this.theme;\n saveDesignToProfileCard.localizedInformation = this.localizedInformation;\n saveDesignToProfileCard.translations = this.translations;\n saveDesignToProfileCard.loggedIn = this.loggedIn;\n saveDesignToProfileCard.screenshotUrl = this.screenshotUrl;\n saveDesignToProfileCard.screenshotAlt = this.screenshotAlt;\n saveDesignToProfileCard.productName = this.productName;\n saveDesignToProfileCard.productDescription = this.productDescription;\n return saveDesignToProfileCard;\n }\n recreateSheetFooter() {\n if (this.sheetElement) {\n if (this.sheetFooterElement) {\n this.sheetElement.removeChild(this.sheetFooterElement);\n this.sheetFooterElement = null;\n }\n const footer = this.createSheetFooter();\n this.sheetElement.appendChild(footer);\n this.sheetFooterElement = footer;\n }\n }\n createSheetFooter() {\n const sheetFooterElement = document.createElement('skapa-modal-footer');\n sheetFooterElement.slot = 'footer';\n const button = document.createElement('skapa-button');\n if (this.loggedIn) {\n button.slot = 'primary-button';\n button.variant = 'primary';\n button.a11yLabel = this.getTranslations().save;\n button.textContent = this.getTranslations().save;\n button.loading = this.saveDesignState === SaveDesignToProfileStateEnum_1.default.loading;\n button.addEventListener('click', () => {\n this.dispatchEvent(new CustomEvent('saveDesign', { bubbles: true }));\n });\n }\n else {\n button.slot = 'primary-button';\n button.variant = 'emphasised';\n button.a11yLabel = this.getTranslations().saveDesignToProfileLogInOrRegisterButtonLabel;\n button.textContent = this.getTranslations().saveDesignToProfileLogInOrRegisterButtonLabel;\n button.addEventListener('click', () => {\n this.dispatchEvent(new CustomEvent('logIn', { bubbles: true }));\n });\n }\n sheetFooterElement.appendChild(button);\n return sheetFooterElement;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SaveDesignToProfile.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SaveDesignToProfile.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SaveDesignToProfile.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SaveDesignToProfile.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SaveDesignToProfile.prototype, \"loggedIn\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SaveDesignToProfile.prototype, \"screenshotUrl\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SaveDesignToProfile.prototype, \"screenshotAlt\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SaveDesignToProfile.prototype, \"productName\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SaveDesignToProfile.prototype, \"productDescription\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SaveDesignToProfile.prototype, \"saveDesignState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SaveDesignToProfile.prototype, \"sheetAlignment\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SaveDesignToProfile.prototype, \"showBackButton\", void 0);\nSaveDesignToProfile = __decorate([\n (0, web_component_1.customElement)('kompis-save-design-to-profile')\n], SaveDesignToProfile);\nexports.default = SaveDesignToProfile;\n//# sourceMappingURL=SaveDesignToProfile.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass SaveDesignToProfileToastMessage {\n /**\n * @param localizedInformationOrTranslations\n */\n static getSaveDesignSuccess(localizedInformationOrTranslations) {\n const label = 'translations' in localizedInformationOrTranslations\n ? localizedInformationOrTranslations.translations.saveDesignToProfileSaveDesignSuccess\n : localizedInformationOrTranslations.saveDesignToProfileSaveDesignSuccess;\n return {\n label\n };\n }\n /**\n * @param localizedInformationOrTranslations\n */\n static getSaveDesignFailure(localizedInformationOrTranslations) {\n const label = 'translations' in localizedInformationOrTranslations\n ? localizedInformationOrTranslations.translations.saveDesignToProfileSaveDesignFailure\n : localizedInformationOrTranslations.saveDesignToProfileSaveDesignFailure;\n return {\n label\n };\n }\n}\nexports.default = SaveDesignToProfileToastMessage;\n//# sourceMappingURL=SaveDesignToProfileToastMessage.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SaveDesignToProfileToastMessage = exports.SaveDesignToProfileStateEnum = exports.SaveDesignToProfileModalEnum = exports.SaveDesignToProfile = void 0;\nconst SaveDesignToProfile_1 = __importDefault(require(\"./components/save-design-to-profile/SaveDesignToProfile\"));\nexports.SaveDesignToProfile = SaveDesignToProfile_1.default;\nconst SaveDesignToProfileModalEnum_1 = __importDefault(require(\"./enums/SaveDesignToProfileModalEnum\"));\nexports.SaveDesignToProfileModalEnum = SaveDesignToProfileModalEnum_1.default;\nconst SaveDesignToProfileStateEnum_1 = __importDefault(require(\"./enums/SaveDesignToProfileStateEnum\"));\nexports.SaveDesignToProfileStateEnum = SaveDesignToProfileStateEnum_1.default;\nconst SaveDesignToProfileToastMessage_1 = __importDefault(require(\"./utilities/SaveDesignToProfileToastMessage\"));\nexports.SaveDesignToProfileToastMessage = SaveDesignToProfileToastMessage_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SheetAnimationNameEnum;\n(function (SheetAnimationNameEnum) {\n SheetAnimationNameEnum[\"opening\"] = \"opening\";\n SheetAnimationNameEnum[\"closing\"] = \"closing\";\n SheetAnimationNameEnum[\"openingRtl\"] = \"openingRtl\";\n SheetAnimationNameEnum[\"closingRtl\"] = \"closingRtl\";\n})(SheetAnimationNameEnum || (SheetAnimationNameEnum = {}));\nexports.default = SheetAnimationNameEnum;\n//# sourceMappingURL=SheetAnimationNameEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SheetStateEnum;\n(function (SheetStateEnum) {\n SheetStateEnum[\"open\"] = \"open\";\n SheetStateEnum[\"closed\"] = \"closed\";\n SheetStateEnum[\"opening\"] = \"opening\";\n SheetStateEnum[\"closing\"] = \"closing\";\n})(SheetStateEnum || (SheetStateEnum = {}));\nexports.default = SheetStateEnum;\n//# sourceMappingURL=SheetStateEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst SheetAnimationNameEnum_1 = __importDefault(require(\"../../enums/SheetAnimationNameEnum\"));\nconst SheetStateEnum_1 = __importDefault(require(\"../../enums/SheetStateEnum\"));\nconst TRANSITION_TIME = '0.2s';\nclass SheetBackdropStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.backdropColor Backdrop color.\n * @param options.state Sheet state.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\t\t\t:host,\n\t\t\t.container {\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\tright: 0;\n\t\t\t\tz-index: inherit;\n\t\t\t}\n\t\t\t.container {\n\t\t\t\tcursor: inherit;\n\t\t\t}\n\n\t\t\t${this.getStateStyle(options.state)}\n\t\t\t${this.getBackdropColor()}\n\t\t`;\n }\n /**\n * Returns styles.\n *\n * @returns Styles.\n */\n static getBackdropColor() {\n return (0, web_component_1.css) `\n\t\t\t.container {\n\t\t\t\tbackground: rgba(0, 0, 0, 0.15);\n\t\t\t\tcursor: inherit;\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns state dependent styling.\n *\n * @param state Props. Open|closed.\n * @returns Styles.\n */\n static getStateStyle(state) {\n switch (state) {\n case SheetStateEnum_1.default.open:\n return this.getOpenStyle();\n case SheetStateEnum_1.default.closed:\n return this.getClosedStyle();\n case SheetStateEnum_1.default.closing:\n return this.getClosingtyle();\n case SheetStateEnum_1.default.opening:\n return this.getOpeningStyle();\n }\n return '';\n }\n /**\n * Returns styles.\n *\n * @returns Styles.\n */\n static getClosingtyle() {\n return (0, web_component_1.css) `\n\t\t\t@keyframes ${SheetAnimationNameEnum_1.default.closing} {\n\t\t\t\tfrom {\n\t\t\t\t\topacity: 1;\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\topacity: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t:host {\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\t.container {\n\t\t\t\tanimation-name: ${SheetAnimationNameEnum_1.default.closing};\n\t\t\t\tanimation-duration: ${TRANSITION_TIME};\n\t\t\t\tanimation-fill-mode: both;\n\t\t\t\tanimation-timing-function: ease-in-out;\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns styles.\n *\n * @returns Styles.\n */\n static getClosedStyle() {\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tpointer-events: none;\n\t\t\t\tvisibility: hidden;\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns styles.\n *\n * @returns Styles.\n */\n static getOpeningStyle() {\n return (0, web_component_1.css) `\n\t\t\t@keyframes ${SheetAnimationNameEnum_1.default.opening} {\n\t\t\t\tfrom {\n\t\t\t\t\topacity: 0;\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\topacity: 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t:host {\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\t.container {\n\t\t\t\tanimation-name: ${SheetAnimationNameEnum_1.default.opening};\n\t\t\t\tanimation-duration: ${TRANSITION_TIME};\n\t\t\t\tanimation-fill-mode: both;\n\t\t\t\tanimation-timing-function: ease-in-out;\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns styles.\n *\n * @returns Styles.\n */\n static getOpenStyle() {\n return (0, web_component_1.css) ``;\n }\n}\nexports.default = SheetBackdropStyle;\n//# sourceMappingURL=SheetBackdropStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst SheetAnimationNameEnum_1 = __importDefault(require(\"../../enums/SheetAnimationNameEnum\"));\nconst SheetStateEnum_1 = __importDefault(require(\"../../enums/SheetStateEnum\"));\nconst SheetBackdropStyle_1 = __importDefault(require(\"./SheetBackdropStyle\"));\n/**\n * SheetBackdrop component class.\n */\nlet SheetBackdrop = class SheetBackdrop extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // If it should be visible. Opens and closes with transitions\n this.visible = false;\n this.state = SheetStateEnum_1.default.closed;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('visible')) {\n if (this.visible) {\n this.state = SheetStateEnum_1.default.opening;\n }\n else {\n this.state = SheetStateEnum_1.default.closing;\n }\n }\n return true;\n }\n /**\n * Listener for animationend.\n *\n * @param event Html event.\n */\n onAnimationEnd(event) {\n event.stopPropagation();\n if (event.animationName.startsWith(SheetAnimationNameEnum_1.default.closing)) {\n this.state = SheetStateEnum_1.default.closed;\n }\n else if (event.animationName.startsWith(SheetAnimationNameEnum_1.default.opening)) {\n this.state = SheetStateEnum_1.default.open;\n }\n this.update();\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SheetBackdrop.prototype, \"visible\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SheetBackdrop.prototype, \"theme\", void 0);\nSheetBackdrop = __decorate([\n (0, web_component_1.customElement)('kompis-sheet-backdrop')\n], SheetBackdrop);\nexports.default = SheetBackdrop;\n//# sourceMappingURL=SheetBackdrop.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SheetAlignmentEnum;\n(function (SheetAlignmentEnum) {\n SheetAlignmentEnum[\"left\"] = \"left\";\n SheetAlignmentEnum[\"right\"] = \"right\";\n})(SheetAlignmentEnum || (SheetAlignmentEnum = {}));\nexports.default = SheetAlignmentEnum;\n//# sourceMappingURL=SheetAlignmentEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SheetSizeEnum;\n(function (SheetSizeEnum) {\n SheetSizeEnum[\"small\"] = \"small\";\n SheetSizeEnum[\"medium\"] = \"medium\";\n SheetSizeEnum[\"large\"] = \"large\";\n})(SheetSizeEnum || (SheetSizeEnum = {}));\nexports.default = SheetSizeEnum;\n//# sourceMappingURL=SheetSizeEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst SheetAlignmentEnum_1 = __importDefault(require(\"../../enums/SheetAlignmentEnum\"));\nconst SheetAnimationNameEnum_1 = __importDefault(require(\"../../enums/SheetAnimationNameEnum\"));\nconst SheetSizeEnum_1 = __importDefault(require(\"../../enums/SheetSizeEnum\"));\nconst MIN_WIDTH = 260;\nconst SHEET_WIDTH_SIZE_LARGE = 1080;\nconst SHEET_WIDTH_SIZE_MEDIUM = 720;\nconst SHEET_WIDTH_SIZE_SMALL = 480;\nconst SHEET_MOBILE_MAX_WIDTH = 480;\nconst SHEET_DESKTOP_MIN_WIDTH = 481;\nclass SheetStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.top Offset from top.\n * @param options.bottom Offset from bottom.\n * @param options.theme Theme.\n * @param options.zIndex Z-index.\n * @param options.preserveAlignment\n * @param options.sheetSize\n * @param options.sheetAlignment\n * @param options.visible Visible sheet.\n * @param options.direction Safari write direction.\n * @returns Styles.\n */\n static getStyle(options) {\n const { color, motion } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tpointer-events: none;\n\t\t\t\tposition: fixed;\n\t\t\t\tleft: 0;\n\t\t\t\tright: 0;\n\t\t\t\ttop: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\tz-index: ${options.zIndex};\n\t\t\t}\n\t\t\t* {\n\t\t\t\tz-index: inherit;\n\t\t\t}\n\t\t\tkompis-sheet-backdrop {\n\t\t\t\tpointer-events: auto;\n\t\t\t}\n\t\t\t.container {\n\t\t\t\tposition: absolute;\n\t\t\t\tleft: 0;\n\t\t\t\tright: 0;\n\t\t\t\ttop: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\tdisplay: flex;\n\t\t\t\tpointer-events: none;\n\t\t\t\ttransition: top ${motion.duration.medium} ${motion.ease.easy},\n\t\t\t\t\tbottom ${motion.duration.medium} ${motion.ease.easy};\n\t\t\t}\n\t\t\t.sheet {\n\t\t\t\tpointer-events: ${options.isAnimating ? 'none' : 'auto'};\n\t\t\t\toverflow: hidden;\n\t\t\t\tposition: relative;\n\t\t\t\tbackground-color: ${color.neutral.white};\n\t\t\t\tdisplay: flex;\n\t\t\t\ttransition-property: right, bottom;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tflex-direction: column;\n\t\t\t\t${this.getAnimationName(options)};\n\t\t\t\tanimation-duration: ${options.visible ? motion.duration.medium : motion.duration.small};\n\t\t\t\tanimation-fill-mode: both;\n\t\t\t\tanimation-timing-function: ${options.visible ? motion.ease.enter : motion.ease.exit};\n\t\t\t\toutline: none;\n\t\t\t}\n\t\t\t.content {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-grow: 1;\n\t\t\t\tflex-direction: column;\n\t\t\t\toverflow: hidden;\n\t\t\t\tmin-width: ${MIN_WIDTH / 16}rem;\n\t\t\t}\n\t\t\t${this.getResponsiveRules(options)}\n\t\t`;\n }\n /**\n * @param options\n */\n static getAnimationName(options) {\n if (!options.isAnimating) {\n return '';\n }\n if (options.visible) {\n return (0, web_component_1.css) `\n\t\t\t\tanimation-name: ${SheetAnimationNameEnum_1.default.opening};\n\t\t\t`;\n }\n return (0, web_component_1.css) `\n\t\t\tanimation-name: ${SheetAnimationNameEnum_1.default.closing};\n\t\t`;\n }\n /**\n * Gets the responsive rules for borders, opening, closing for sheet.\n *\n * @param options Options.\n */\n static getResponsiveRules(options) {\n if (options.preserveAlignment) {\n return this.getDesktopRules(options);\n }\n return (0, web_component_1.css) `\n\t\t\t@media screen and (max-width: ${SHEET_MOBILE_MAX_WIDTH / 16}rem) {\n\t\t\t\t${this.getMobileRules(options)};\n\t\t\t}\n\t\t\t@media screen and (min-width: ${SHEET_DESKTOP_MIN_WIDTH / 16}rem) {\n\t\t\t\t${this.getDesktopRules(options)};\n\t\t\t}\n\t\t`;\n }\n /**\n * Gets the mobile rules for borders, opening, closing for sheet.\n *\n * @param options Options.\n */\n static getMobileRules(options) {\n const { border, spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t.container {\n\t\t\t\tmargin-top: ${spacing.space150 / 16}rem;\n\t\t\t}\n\t\t\t.sheet {\n\t\t\t\tflex-grow: 1;\n\t\t\t\tborder-top-left-radius: ${border.radius.radius8 / 16}rem;\n\t\t\t\tborder-top-right-radius: ${border.radius.radius8 / 16}rem;\n\t\t\t}\n\t\t\t@keyframes ${SheetAnimationNameEnum_1.default.opening} {\n\t\t\t\tfrom {\n\t\t\t\t\tbottom: -100%;\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\tbottom: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes ${SheetAnimationNameEnum_1.default.closing} {\n\t\t\t\tfrom {\n\t\t\t\t\tbottom: 0;\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\tbottom: -100%;\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n /**\n * Gets the desktop rules for borders, opening, closing for sheet.\n *\n * @param options Options.\n */\n static getDesktopRules(options) {\n const { border, spacing } = options.theme;\n const { radius } = border;\n const inverseAlignment = (options.direction === 'rtl') !== (options.sheetAlignment === SheetAlignmentEnum_1.default.right);\n const position = inverseAlignment ? '-100%' : '100%';\n return (0, web_component_1.css) `\n\t\t\t.sheet {\n\t\t\t\twidth: ${this.getMaxWidth(options)};\n\t\t\t\tborder-top-left-radius: ${inverseAlignment ? radius.radius8 / 16 + 'rem' : 0};\n\t\t\t\tborder-bottom-left-radius: ${inverseAlignment ? radius.radius8 / 16 + 'rem' : 0};\n\t\t\t\tborder-top-right-radius: ${!inverseAlignment ? radius.radius8 / 16 + 'rem' : 0};\n\t\t\t\tborder-bottom-right-radius: ${!inverseAlignment ? radius.radius8 / 16 + 'rem' : 0};\n\t\t\t}\n\t\t\t.space {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tpointer-events: none;\n\t\t\t\twidth: ${spacing.space300 / 16}rem;\n\t\t\t}\n\t\t\t.container {\n\t\t\t\tflex-direction: ${options.sheetAlignment === SheetAlignmentEnum_1.default.right\n ? 'row-reverse'\n : 'row'};\n\t\t\t}\n\n\t\t\t@keyframes ${SheetAnimationNameEnum_1.default.opening} {\n\t\t\t\tfrom {\n\t\t\t\t\tright: ${position};\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\tright: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes ${SheetAnimationNameEnum_1.default.closing} {\n\t\t\t\tfrom {\n\t\t\t\t\tright: 0;\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\tright: ${position};\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns max width.\n *\n * @param options Options.\n */\n static getMaxWidth(options) {\n switch (options.sheetSize) {\n case SheetSizeEnum_1.default.small:\n return `${SHEET_WIDTH_SIZE_SMALL / 16}rem`;\n case SheetSizeEnum_1.default.medium:\n return `${SHEET_WIDTH_SIZE_MEDIUM / 16}rem`;\n case SheetSizeEnum_1.default.large:\n return `${SHEET_WIDTH_SIZE_LARGE / 16}rem`;\n default:\n return '100%';\n }\n }\n}\nexports.default = SheetStyle;\n//# sourceMappingURL=SheetStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"../sheet-backdrop/SheetBackdrop\");\nconst SheetAlignmentEnum_1 = __importDefault(require(\"../../enums/SheetAlignmentEnum\"));\nconst SheetAnimationNameEnum_1 = __importDefault(require(\"../../enums/SheetAnimationNameEnum\"));\nconst SheetSizeEnum_1 = __importDefault(require(\"../../enums/SheetSizeEnum\"));\nconst SheetStyle_1 = __importDefault(require(\"./SheetStyle\"));\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n * Sheet component.\n *\n * @event overlayClick When the overlay or escape is clicked.\n * @event animationEnd When the animation ends.\n */\nlet Sheet = class Sheet extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Hide or show sheet with transitions.\n this.visible = false;\n // Override z-index of the Sheet.\n this.zIndex = 500;\n // Preserve alignment in mobile only. Ignores mobile layout and uses side sheet.\n this.preserveAlignment = false;\n // Sheet alignment.\n this.sheetAlignment = SheetAlignmentEnum_1.default.right;\n // Sheet size.\n this.sheetSize = SheetSizeEnum_1.default.small;\n // Label for the sheet to be used when a heading is not provided in sheetHeader.\n this.ariaLabel = null;\n this.isAnimating = false;\n this.debounce = new utilities_1.DebounceManager();\n /**\n * Closes sheet on escape.\n *\n * @param event Event.\n */\n this.onKeyDownListener = (event) => {\n if (event.code === 'Escape' && this.visible) {\n this.dispatchEvent(new CustomEvent('overlayClick', {\n bubbles: true,\n detail: {\n type: 'overlay'\n }\n }));\n }\n };\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n if (!this.visible && !this.isAnimating) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getBackdrop()}${this.getContainer()}\n\t\t`;\n }\n /**\n * @override\n */\n connectedCallback() {\n super.connectedCallback();\n window.addEventListener('keydown', this.onKeyDownListener);\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.isAnimating = false;\n window.removeEventListener('keydown', this.onKeyDownListener);\n this.debounce.clear('visibleSheet');\n }\n focus() {\n var _a, _b;\n (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.sheet')) === null || _b === void 0 ? void 0 : _b.focus();\n }\n /**\n * @param changedProperties Changed properties.\n * @returns \"true\" if it should update.\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('visible')) {\n this.isAnimating = true;\n }\n return true;\n }\n /**\n * @returns Template.\n */\n getBackdrop() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n }\n /**\n * @returns - Html.\n */\n getContainer() {\n const header = this.querySelector('kompis-sheet-header');\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t {\n this.focus();\n }}\"\n\t\t\t\t>
    \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t {\n this.focus();\n }}\"\n\t\t\t\t>\n\t\t\t\n\t\t`;\n }\n /**\n * Listener for animationend.\n *\n * @param event Html event.\n */\n onAnimationEnd(event) {\n this.isAnimating = false;\n if (event.animationName.startsWith(SheetAnimationNameEnum_1.default.closing)) {\n this.dispatchEvent(new CustomEvent('animationEnd', {\n bubbles: true,\n detail: {\n type: 'close'\n }\n }));\n }\n else if (event.animationName.startsWith(SheetAnimationNameEnum_1.default.opening)) {\n this.dispatchEvent(new CustomEvent('animationEnd', {\n bubbles: true,\n detail: {\n type: 'open'\n }\n }));\n if (this.visible) {\n this.debounce.set('visibleSheet', () => {\n this.focus();\n }, 1);\n }\n }\n this.update();\n }\n /**\n * Dispatch close event.\n */\n handleOverlayClick() {\n if (this.isAnimating) {\n return;\n }\n this.dispatchEvent(new CustomEvent('overlayClick', {\n bubbles: true,\n detail: {\n type: 'overlay'\n }\n }));\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Sheet.prototype, \"visible\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Sheet.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], Sheet.prototype, \"zIndex\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Sheet.prototype, \"preserveAlignment\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Sheet.prototype, \"sheetAlignment\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Sheet.prototype, \"sheetSize\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Sheet.prototype, \"ariaLabel\", void 0);\nSheet = __decorate([\n (0, web_component_1.customElement)('kompis-sheet')\n], Sheet);\nexports.default = Sheet;\n//# sourceMappingURL=Sheet.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nrequire(\"@inter-ikea-kompis/component-image\");\n/**\n * SheetBody component.\n */\nlet SheetBody = class SheetBody extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Adds a vertical scroll-bar that will always be visible.\n this.verticalScroll = false;\n // Separates the header and body with a thin line that acts like a divider.\n this.scrollDivider = false;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SheetBody.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SheetBody.prototype, \"verticalScroll\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SheetBody.prototype, \"scrollDivider\", void 0);\nSheetBody = __decorate([\n (0, web_component_1.customElement)('kompis-sheet-body')\n], SheetBody);\nexports.default = SheetBody;\n//# sourceMappingURL=SheetBody.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nrequire(\"@inter-ikea-kompis/component-text\");\n/**\n * SheetBodyPadding component.\n */\nlet SheetBodyPadding = class SheetBodyPadding extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n this.bottomPadding = false;\n this.topPadding = false;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n const { spacing, breakpoint } = this.theme;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SheetBodyPadding.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SheetBodyPadding.prototype, \"bottomPadding\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SheetBodyPadding.prototype, \"topPadding\", void 0);\nSheetBodyPadding = __decorate([\n (0, web_component_1.customElement)('kompis-sheet-body-padding')\n], SheetBodyPadding);\nexports.default = SheetBodyPadding;\n//# sourceMappingURL=SheetBodyPadding.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass SheetFooterStyle {\n /**\n * Returns styles.\n *\n * @param options Options Object.\n * @param options.theme Theme.\n * @param options.floatingHeader Floating header.\n * @param options.hasSecondaryButton\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing, color, breakpoint } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tpadding: ${spacing.space150 / 16}rem ${spacing.space150 / 16}rem;\n\t\t\t\tborder-top: ${1 / 16}rem solid ${color.border.light};\n\t\t\t}\n\t\t\t.container {\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\t\t\t@media screen and (min-width: ${breakpoint.large.width / 16}rem) {\n\t\t\t\t:host {\n\t\t\t\t\tpadding: ${spacing.space150 / 16}rem ${spacing.space300 / 16}rem;\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = SheetFooterStyle;\n//# sourceMappingURL=SheetFooterStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst SheetFooterStyle_1 = __importDefault(require(\"./SheetFooterStyle\"));\n/**\n * SheetFooter component.\n */\nlet SheetFooter = class SheetFooter extends web_component_1.KompisElement {\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SheetFooter.prototype, \"theme\", void 0);\nSheetFooter = __decorate([\n (0, web_component_1.customElement)('kompis-sheet-footer')\n], SheetFooter);\nexports.default = SheetFooter;\n//# sourceMappingURL=SheetFooter.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ButtonTypeEnum = exports.ButtonSizeEnum = exports.ButtonOverlayColorEnum = exports.ButtonAlignEnum = exports.Button = void 0;\nconst Button_1 = __importDefault(require(\"./components/button/Button\"));\nexports.Button = Button_1.default;\nconst ButtonAlignEnum_1 = __importDefault(require(\"./enums/ButtonAlignEnum\"));\nexports.ButtonAlignEnum = ButtonAlignEnum_1.default;\nconst ButtonOverlayColorEnum_1 = __importDefault(require(\"./enums/ButtonOverlayColorEnum\"));\nexports.ButtonOverlayColorEnum = ButtonOverlayColorEnum_1.default;\nconst ButtonSizeEnum_1 = __importDefault(require(\"./enums/ButtonSizeEnum\"));\nexports.ButtonSizeEnum = ButtonSizeEnum_1.default;\nconst ButtonTypeEnum_1 = __importDefault(require(\"./enums/ButtonTypeEnum\"));\nexports.ButtonTypeEnum = ButtonTypeEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst BUTTON_MAX_WIDTH = 360;\nconst SHEET_WIDTH_SIZE_MEDIUM = 560;\nclass SheetFooterButtonsStyle {\n /**\n * Returns styles.\n *\n * @param options Options Object.\n * @param options.theme Theme.\n * @param options.hasSecondaryButton Secondary button.\n * @param options.compact\n * @param options.container.clientWidth Client width.\n * @param options.container.offsetWidth Offset width.\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing } = options.theme;\n const primaryButtonMargin = `${options.hasSecondaryButton && !options.compact ? spacing.space100 / 16 : 0}rem;`;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: flex;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-grow: 1;\n\t\t\t\tflex-direction: ${options.compact ? 'row-reverse' : 'column'};\n\t\t\t}\n\t\t\tskapa-button {\n\t\t\t\tmax-width: ${options.compact || options.containerRect.width >= SHEET_WIDTH_SIZE_MEDIUM\n ? BUTTON_MAX_WIDTH / 16 + 'rem'\n : '100%'};\n\t\t\t}\n\t\t\t.divider {\n\t\t\t\twidth: ${(options.compact ? spacing.space75 : spacing.space100) / 16}rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t}\n\t\t\t@media screen and (max-width: ${(SHEET_WIDTH_SIZE_MEDIUM - 1) / 16}rem) {\n\t\t\t\t.primaryButton {\n\t\t\t\t\tmargin-bottom: ${primaryButtonMargin};\n\t\t\t\t}\n\t\t\t}\n\t\t\t@media screen and (min-width: ${SHEET_WIDTH_SIZE_MEDIUM / 16}rem) {\n\t\t\t\t.container {\n\t\t\t\t\tflex-direction: ${options.containerRect.width <= SHEET_WIDTH_SIZE_MEDIUM &&\n !options.compact\n ? 'column'\n : 'row-reverse'};\n\t\t\t\t\tjustify-content: start;\n\t\t\t\t}\n\t\t\t\t.primaryButton {\n\t\t\t\t\tmargin-bottom: ${primaryButtonMargin};\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = SheetFooterButtonsStyle;\n//# sourceMappingURL=SheetFooterButtonsStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst component_button_1 = require(\"@inter-ikea-kompis/component-button\");\nrequire(\"@ingka/button-webc\");\nconst SheetFooterButtonsStyle_1 = __importDefault(require(\"./SheetFooterButtonsStyle\"));\n/**\n * SheetFooter component.\n *\n * @event buttonClick Click on buttons.\n */\nlet SheetFooterButtons = class SheetFooterButtons extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Primary button label.\n this.primaryLabel = null;\n // Secondary button label.\n this.secondaryLabel = null;\n // Compact placing buttons next to each other (in small sheet)\n this.compact = false;\n this.breakpointObserver = new themes_1.ThemeBreakpointObserver(() => this.requestUpdate());\n this.resizeObserver = new ResizeObserver(() => this.requestUpdate());\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n const containerRect = this.getBoundingClientRect();\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t${this.getPrimaryButton()} ${this.getDivider()} ${this.getSecondaryButton()}\n\t\t\t
    \n\t\t`;\n }\n connectedCallback() {\n super.connectedCallback();\n this.resizeObserver.observe(this);\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.resizeObserver.unobserve(this);\n this.breakpointObserver.disconnect();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('theme')) {\n this.breakpointObserver.observe(this.theme);\n }\n return true;\n }\n /**\n * @returns True if landscape layout.\n */\n getButtonSize() {\n const breakpointIndex = this.breakpointObserver.getBreakpointIndex();\n const breakpointIndexIsSmallOrNull = breakpointIndex === null || breakpointIndex <= enums_1.ThemeBreakpointIndexEnum.small;\n if (breakpointIndexIsSmallOrNull && this.compact) {\n return component_button_1.ButtonSizeEnum.small;\n }\n return component_button_1.ButtonSizeEnum.medium;\n }\n getDivider() {\n if (!this.secondaryLabel || !this.primaryLabel) {\n return null;\n }\n return (0, web_component_1.html) `
    `;\n }\n /**\n * @returns Primary button HTMl.\n */\n getPrimaryButton() {\n if (!this.primaryLabel) {\n return null;\n }\n const primaryVariant = 'primary';\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('buttonClick', { bubbles: true, detail: { type: 'primaryButton' } }))}\"\n\t\t\t>\n\t\t\t\t${this.primaryLabel}\n\t\t\t\n\t\t`;\n }\n /**\n * @returns Secondary button HTMl.\n */\n getSecondaryButton() {\n if (!this.secondaryLabel) {\n return null;\n }\n const secondaryVariant = 'secondary';\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('buttonClick', { bubbles: true, detail: { type: 'secondaryButton' } }))}\"\n\t\t\t>\n\t\t\t\t${this.secondaryLabel}\n\t\t\t\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SheetFooterButtons.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SheetFooterButtons.prototype, \"primaryLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SheetFooterButtons.prototype, \"secondaryLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SheetFooterButtons.prototype, \"compact\", void 0);\nSheetFooterButtons = __decorate([\n (0, web_component_1.customElement)('kompis-sheet-footer-buttons')\n], SheetFooterButtons);\nexports.default = SheetFooterButtons;\n//# sourceMappingURL=SheetFooterButtons.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('arrow-left', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'm3.999 11.9997 8 8.0011 1.4143-1.4141-5.5859-5.5866H20v-2H7.8273l5.5871-5.5868-1.4142-1.4143-8.0012 8.0007z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('cross', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'm12 13.4142 4.9498 4.9497 1.4142-1.4142L13.4142 12l4.9498-4.9498-1.4142-1.4142L12 10.5857 7.0503 5.636 5.636 7.0502 10.5859 12l-4.9497 4.9497 1.4142 1.4142L12 13.4142z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst HEADER_HEIGHT_SMALL = 60;\nconst FILLER_WIDTH = 40;\nclass SheetHeaderStyle {\n /**\n * Returns styles.\n *\n * @param options Options Object.\n * @param options.theme Theme.\n * @param options.floatingHeader Floating header.\n * @param options.zIndex\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing, color, breakpoint } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tz-index: ${options.zIndex};\n\t\t\t\tposition: ${options.floatingHeader ? 'absolute' : 'relative'};\n\t\t\t\twidth: 100%;\n\t\t\t\tbackground-color: ${options.floatingHeader ? 'transparent' : `${color.neutral.white}`};\n\t\t\t}\n\t\t\t.headingContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tposition: relative;\n\t\t\t\twidth: 100%;\n\t\t\t\tpadding: 0 ${spacing.space75 / 16}rem;\n\t\t\t\tmin-height: ${spacing.space550 / 16}rem;\n\t\t\t}\n\t\t\t.header {\n\t\t\t\tflex-grow: 1;\n\t\t\t\ttext-align: center;\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\t\t\t.filler {\n\t\t\t\twidth: ${FILLER_WIDTH / 16}rem;\n\t\t\t}\n\t\t\t@media screen and (max-width: ${breakpoint.medium.width / 16}rem) {\n\t\t\t\t.headingContainer {\n\t\t\t\t\tmin-height: ${HEADER_HEIGHT_SMALL / 16}rem;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@media screen and (min-width: ${breakpoint.large.width / 16}rem) {\n\t\t\t\t.headingContainer {\n\t\t\t\t\tpadding: 0 ${spacing.space200 / 16}rem;\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = SheetHeaderStyle;\n//# sourceMappingURL=SheetHeaderStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/icon-store/arrow-left\");\nrequire(\"@ingka/icon-store/cross\");\nconst SheetHeaderStyle_1 = __importDefault(require(\"./SheetHeaderStyle\"));\n/**\n * SheetHeader component.\n *\n * @event closeButtonClick Triggered when the user clicks on the back button icon.\n * @event backButtonClick When next button is clicked.\n */\nlet SheetHeader = class SheetHeader extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Heading\n this.heading = null;\n // Z-index.\n this.zIndex = 501;\n // Floating header.\n this.floatingHeader = false;\n // Back icon as default.\n this.backIcon = false;\n // Label for the close icon button to set as an aria-label for accessibility reasons. There is a common translation modalAriaLabelButtonClose you can use.\n this.ariaLabelCloseButton = null;\n // Label for the back icon button to set as an aria-label for accessibility reasons. There is a common translation modalAriaLabelButtonBack you can use.\n this.ariaLabelBackButton = null;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t${this.getBackButton()}\n\t\t\t\t

    \n\t\t\t\t\t${this.heading}\n\t\t\t\t

    \n\t\t\t\t${this.getCloseButton()}\n\t\t\t
    \n\t\t`;\n }\n /**\n * @returns Close button.\n */\n getCloseButton() {\n const buttonVariant = this.floatingHeader ? 'primary' : 'tertiary';\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t\n\t\t\t\t${this.ariaLabelCloseButton || ''}\n\t\t\t\n\t\t`;\n }\n /**\n * On close click event.\n */\n onCloseClick() {\n this.dispatchEvent(new CustomEvent('closeButtonClick', { bubbles: true, detail: { type: 'button' } }));\n }\n /**\n * @returns Back button.\n */\n getBackButton() {\n if (!this.backIcon) {\n return (0, web_component_1.html) `
    `;\n }\n const buttonVariant = this.floatingHeader ? 'primary' : 'tertiary';\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t\n\t\t\t\t${this.ariaLabelBackButton || ''}\n\t\t\t\n\t\t`;\n }\n /**\n * On back click event.\n */\n onBackClick() {\n this.dispatchEvent(new CustomEvent('backButtonClick', { bubbles: true, detail: { type: 'button' } }));\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SheetHeader.prototype, \"heading\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SheetHeader.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], SheetHeader.prototype, \"zIndex\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SheetHeader.prototype, \"floatingHeader\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SheetHeader.prototype, \"backIcon\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SheetHeader.prototype, \"ariaLabelCloseButton\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SheetHeader.prototype, \"ariaLabelBackButton\", void 0);\nSheetHeader = __decorate([\n (0, web_component_1.customElement)('kompis-sheet-header')\n], SheetHeader);\nexports.default = SheetHeader;\n//# sourceMappingURL=SheetHeader.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SheetStateEnum = exports.SheetSizeEnum = exports.SheetHeader = exports.SheetFooterButtons = exports.SheetFooter = exports.SheetBodyPadding = exports.SheetBody = exports.SheetBackdrop = exports.SheetAlignmentEnum = exports.Sheet = void 0;\nconst Sheet_1 = __importDefault(require(\"./components/sheet/Sheet\"));\nexports.Sheet = Sheet_1.default;\nconst SheetBackdrop_1 = __importDefault(require(\"./components/sheet-backdrop/SheetBackdrop\"));\nexports.SheetBackdrop = SheetBackdrop_1.default;\nconst SheetBody_1 = __importDefault(require(\"./components/sheet-body/SheetBody\"));\nexports.SheetBody = SheetBody_1.default;\nconst SheetBodyPadding_1 = __importDefault(require(\"./components/sheet-body-padding/SheetBodyPadding\"));\nexports.SheetBodyPadding = SheetBodyPadding_1.default;\nconst SheetFooter_1 = __importDefault(require(\"./components/sheet-footer/SheetFooter\"));\nexports.SheetFooter = SheetFooter_1.default;\nconst SheetFooterButtons_1 = __importDefault(require(\"./components/sheet-footer-buttons/SheetFooterButtons\"));\nexports.SheetFooterButtons = SheetFooterButtons_1.default;\nconst SheetHeader_1 = __importDefault(require(\"./components/sheet-header/SheetHeader\"));\nexports.SheetHeader = SheetHeader_1.default;\nconst SheetAlignmentEnum_1 = __importDefault(require(\"./enums/SheetAlignmentEnum\"));\nexports.SheetAlignmentEnum = SheetAlignmentEnum_1.default;\nconst SheetSizeEnum_1 = __importDefault(require(\"./enums/SheetSizeEnum\"));\nexports.SheetSizeEnum = SheetSizeEnum_1.default;\nconst SheetStateEnum_1 = __importDefault(require(\"./enums/SheetStateEnum\"));\nexports.SheetStateEnum = SheetStateEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass FinancialServicesCardStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n return (0, web_component_1.css) `\n\t\t\t/* Override font-family since the provided font-family 'Noto IKEA' from the API is not available. */\n\t\t\t.monthlypay_fragment,\n\t\t\tdiv {\n\t\t\t\tfont-family: ${this.getFontFamily(options.theme)} !important;\n\t\t\t}\n\n\t\t\t/* Remove header margin and padding to look similar to Ingka's version. */\n\t\t\th1,\n\t\t\th2,\n\t\t\th3,\n\t\t\th4,\n\t\t\th5,\n\t\t\th6 {\n\t\t\t\tmargin: 0;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t`;\n }\n /**\n * Get the font-family from the theme.\n *\n * @param theme The theme.\n * @returns The font family.\n */\n static getFontFamily(theme) {\n return [theme.fontFace.family, ...theme.fontFace.fallbacks]\n .map((font) => `'${font}'`)\n .join(',');\n }\n}\nexports.default = FinancialServicesCardStyle;\n//# sourceMappingURL=FinancialServicesCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst FinancialServicesCardStyle_1 = __importDefault(require(\"./FinancialServicesCardStyle\"));\nlet FinancialServicesCard = class FinancialServicesCard extends web_component_1.KompisElement {\n render() {\n return (0, web_component_1.html) `\n\t\t\t
    ${(0, web_component_1.unsafeHTML)(this.financingOption.content)}
    `;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], FinancialServicesCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], FinancialServicesCard.prototype, \"financingOption\", void 0);\nFinancialServicesCard = __decorate([\n (0, web_component_1.customElement)('kompis-financial-services-card')\n], FinancialServicesCard);\nexports.default = FinancialServicesCard;\n//# sourceMappingURL=FinancialServicesCard.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst component_hyperlink_1 = require(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@inter-ikea-kompis/component-hyperlink\");\n/**\n * Financial services link.\n *\n * @event linkClick Triggered when the user clicks on the financial services button link.\n */\nlet FinancialServicesLink = class FinancialServicesLink extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n }\n render() {\n return (0, web_component_1.html) `\n\t\t\t${this.getHyperLink()}\n\t\t
    `;\n }\n getHyperLink() {\n const { anchor, anchorLink } = this.financingOption;\n if (anchorLink && !this.disableLinks) {\n return (0, web_component_1.html) `\n\t\t\t`;\n }\n return (0, web_component_1.html) ` this.dispatchEvent(new CustomEvent('linkClick', {\n bubbles: true,\n detail: { triggerElement: this.getTriggerElement() }\n }))}}\"\n\t\t>\n\t\t`;\n }\n getTriggerElement() {\n var _a, _b, _c;\n return ((_c = (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('kompis-hyperlink')) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('kompis-focus-outline > a'));\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], FinancialServicesLink.prototype, \"financingOption\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], FinancialServicesLink.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], FinancialServicesLink.prototype, \"theme\", void 0);\nFinancialServicesLink = __decorate([\n (0, web_component_1.customElement)('kompis-financial-services-link')\n], FinancialServicesLink);\nexports.default = FinancialServicesLink;\n//# sourceMappingURL=FinancialServicesLink.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass FinancialServicesButtonsStyle {\n /**\n * Returns styles.\n *\n * @param options Options Object.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing, color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: flex;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\n\t\t\t.buttonContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-grow: 1;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\t.info-button {\n\t\t\t\tmargin-bottom: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.qr-code {\n\t\t\t\tmargin: ${spacing.space100 / 16}rem 0 ${spacing.space150 / 16}rem 0;\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\tkompis-qr-code {\n\t\t\t\twidth: 6.7rem;\n\t\t\t\tmargin: 0 auto;\n\t\t\t\tbackground-color: ${color.neutral.white};\n\t\t\t}\n\n\t\t\t.qr-code-text {\n\t\t\t\tmargin-top: ${spacing.space50 / 16}rem;\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t\ttext-align: center;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = FinancialServicesButtonsStyle;\n//# sourceMappingURL=FinancialServicesButtonsStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@inter-ikea-kompis/component-qr-code\");\nrequire(\"@ingka/button-webc\");\nconst FinancialServicesButtonsStyle_1 = __importDefault(require(\"./FinancialServicesButtonsStyle\"));\n/**\n * Financial services buttons.\n *\n * @event continueButtonClick When continue planning button is clicked.\n * @event moreInfoClick When read more is clicked.\n * */\nlet FinancialServicesButtons = class FinancialServicesButtons extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // Disables links. Shows QR code. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n }\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t${this.getStandardConfiguration()} ${this.getKioskConfiguration()}\n\t\t\t
    \n\t\t`;\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n getStandardConfiguration() {\n if (this.disableLinks) {\n return null;\n }\n return (0, web_component_1.html) `${this.getMoreInfoLink()} ${this.getContinueButton()}`;\n }\n getKioskConfiguration() {\n if (!this.disableLinks) {\n return null;\n }\n return (0, web_component_1.html) `${this.getQrCode()} ${this.getContinueButton()}`;\n }\n getContinueButton() {\n const primaryVariant = 'primary';\n return (0, web_component_1.html) ` {\n this.dispatchEvent(new CustomEvent('continueButtonClick'));\n }}\"\n\t\t\tfluid\n\t\t>\n\t\t\t${this.getTranslations().financialServicesContinueButton}\n\t\t`;\n }\n getMoreInfoLink() {\n const secondaryVariant = 'secondary';\n return (0, web_component_1.html) `\n\t\t\t {\n this.dispatchEvent(new CustomEvent('moreInfoClick'));\n }}\"\n\t\t\t\tfluid\n\t\t\t>\n\t\t\t\t${this.financingOption.moreInfoAnchor}\n\t\t\t\n\t\t`;\n }\n getQrCode() {\n return (0, web_component_1.html) `
    \n\t\t\t\n\t\t\t\n\t\t\t\t${this.financingOption.moreInfoAnchor}\n\t\t\t\n\t\t
    `;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], FinancialServicesButtons.prototype, \"financingOption\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], FinancialServicesButtons.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], FinancialServicesButtons.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], FinancialServicesButtons.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], FinancialServicesButtons.prototype, \"disableLinks\", void 0);\nFinancialServicesButtons = __decorate([\n (0, web_component_1.customElement)('kompis-financial-services-buttons')\n], FinancialServicesButtons);\nexports.default = FinancialServicesButtons;\n//# sourceMappingURL=FinancialServicesButtons.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar FinancialServicesModalEnum;\n(function (FinancialServicesModalEnum) {\n FinancialServicesModalEnum[\"financialServicesCard\"] = \"financialServicesCard\";\n})(FinancialServicesModalEnum || (FinancialServicesModalEnum = {}));\nexports.default = FinancialServicesModalEnum;\n//# sourceMappingURL=FinancialServicesModalEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst analytics_1 = require(\"@inter-ikea-kompis/analytics\");\nconst insights_data_provider_1 = require(\"@insights/insights-data-provider\");\nconst moduleId = 'financial_services';\n/**\n * Tracks events from Financial Services and sends them to a reporter.\n *\n * @event financial_services_open_sheet When financial services link is clicked.\n * @event financial_services_more_info When financial services read more link is clicked.\n */\nclass FinancialServicesTracker extends analytics_1.AbstractAnalyticsTracker {\n /**\n * @param options\n * @param options.dev\n * @param options.ab\n * @param options.settings\n * @param options.locale\n * @param options.reporterId\n * @param options.context The context where the {@link FinancialServices} component is rendered, e.g. 'main_page', or 'summary_page'. This is used to distinguish the analytics data if the component is used in several places in a planner.\n */\n constructor(options) {\n super(Object.assign({ moduleId }, options));\n this.context = options.context;\n }\n /**\n * Call to report the financial services link is clicked.\n */\n sendOpenSheet() {\n this.getReporter().report({\n event: 'financial_services_open_sheet',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe,\n payload: { context: this.context }\n });\n }\n /**\n * Call to report the financial services read more link is clicked.\n */\n sendMoreInfoClick() {\n this.getReporter().report({\n event: 'financial_services_more_info',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe,\n payload: { context: this.context }\n });\n }\n}\nexports.default = FinancialServicesTracker;\n//# sourceMappingURL=FinancialServicesTracker.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass FinancialServicesStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: flex;\n\t\t\t\tcolor: ${options.theme.color.neutral.grey900};\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = FinancialServicesStyle;\n//# sourceMappingURL=FinancialServicesStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@inter-ikea-kompis/component-sheet\");\nrequire(\"../financial-services-card/FinancialServicesCard\");\nrequire(\"../financial-services-link/FinancialServicesLink\");\nrequire(\"../financial-services-buttons/FinancialServicesButtons\");\nconst FinancialServicesModalEnum_1 = __importDefault(require(\"../../enums/FinancialServicesModalEnum\"));\nconst FinancialServicesTracker_1 = __importDefault(require(\"../../trackers/FinancialServicesTracker\"));\nconst FinancialServicesStyle_1 = __importDefault(require(\"./FinancialServicesStyle\"));\n/**\n * Financial services.\n *\n * @event modalClose Modal close.\n * @event modalOpen Modal open.\n * @event continueButtonClick When continue planning button is clicked in sheet.\n * @event moreInfoClick When read more is clicked in sheet.\n */\nlet FinancialServices = class FinancialServices extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Visible modal.\n this.visibleModal = null;\n // Disables links. Shows QR code. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // Used for automatic analytics. If null or not set, analytics is turned off.\n this.analytics = null;\n this.sheetElement = null;\n this.cardElement = null;\n this.buttonsElement = null;\n this.tracker = null;\n this.dexfSettings = null;\n }\n render() {\n // We want translations and settings to be required, but since the props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.disconnectTracker();\n this.closeSheet();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n if (changedProperties.has('visibleModal') && this.hasTranslationsAndSettings()) {\n if (this.visibleModal === FinancialServicesModalEnum_1.default.financialServicesCard) {\n this.openSheet();\n }\n else {\n this.closeSheet();\n }\n }\n if (this.cardElement) {\n this.cardElement.theme = this.theme;\n this.cardElement.financingOption = this.financingOption;\n }\n if (this.buttonsElement) {\n this.buttonsElement.financingOption = this.financingOption;\n this.buttonsElement.theme = this.theme;\n this.buttonsElement.localizedInformation = this.localizedInformation;\n this.buttonsElement.translations = this.translations;\n this.buttonsElement.disableLinks = this.disableLinks;\n }\n if (changedProperties.has('analytics') && this.hasTranslationsAndSettings()) {\n this.disconnectTracker();\n this.connectTracker();\n }\n return true;\n }\n hasTranslationsAndSettings() {\n var _a;\n return (!!this.translations && !!this.settings) || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n getSettings() {\n return this.dexfSettings;\n }\n connectTracker() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n if (this.analytics) {\n // eslint-disable-next-line no-underscore-dangle\n const reporter = this.analytics.__INTERNAL__reporter;\n if ((reporter === null || reporter === void 0 ? void 0 : reporter.connected) === false) {\n // Should use an existing reporter, but wait for it to be connected\n return;\n }\n // Use existing connected reporter, or the tracker should create a new one.\n const reporterId = reporter ? reporter.id : undefined;\n this.tracker = new FinancialServicesTracker_1.default(Object.assign(Object.assign({}, this.analytics), { settings: this.getSettings(), reporterId }));\n yield ((_a = this.tracker) === null || _a === void 0 ? void 0 : _a.connect());\n }\n });\n }\n disconnectTracker() {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.disconnect();\n this.tracker = null;\n }\n onLinkClick(event) {\n var _a;\n this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: {\n visibleModal: FinancialServicesModalEnum_1.default.financialServicesCard,\n triggerElement: event.detail.triggerElement\n }\n }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendOpenSheet();\n }\n closeSheet() {\n if (this.sheetElement) {\n this.sheetElement.visible = false;\n this.sheetElement = null;\n this.cardElement = null;\n this.buttonsElement = null;\n }\n }\n openSheet() {\n var _a, _b;\n if (this.sheetElement) {\n return;\n }\n const sheetElement = this.createSheetElement();\n const onClose = () => {\n if (this.sheetElement) {\n this.dispatchEvent(new CustomEvent('modalClose', {\n bubbles: true,\n detail: {\n visibleModal: null,\n triggerElement: this.getTriggerElement()\n }\n }));\n }\n };\n // When user closes the Sheet\n sheetElement.addEventListener('overlayClick', onClose);\n const sheetHeaderElement = sheetElement.querySelector('kompis-sheet-header');\n sheetHeaderElement === null || sheetHeaderElement === void 0 ? void 0 : sheetHeaderElement.addEventListener('closeButtonClick', onClose);\n // Cleanup sheet when the animation is over\n sheetElement.addEventListener('animationEnd', () => {\n var _a;\n if (!sheetElement.visible) {\n (_a = sheetElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(sheetElement);\n }\n });\n this.sheetElement = sheetElement;\n this.cardElement = sheetElement.querySelector('kompis-financial-services-card');\n this.buttonsElement = sheetElement.querySelector('kompis-financial-services-buttons');\n (_a = this.buttonsElement) === null || _a === void 0 ? void 0 : _a.addEventListener('continueButtonClick', (event) => {\n this.dispatchEvent(new CustomEvent('continueButtonClick', {\n detail: Object.assign(Object.assign({}, event.detail), { triggerElement: this.getTriggerElement() }),\n bubbles: true\n }));\n });\n (_b = this.buttonsElement) === null || _b === void 0 ? void 0 : _b.addEventListener('moreInfoClick', (event) => {\n var _a;\n this.dispatchEvent(new CustomEvent('moreInfoClick', {\n detail: Object.assign({}, event.detail),\n bubbles: true\n }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendMoreInfoClick();\n });\n sheetElement.visible = true;\n const parent = document.querySelector('kompis-keyboard-injector') || document.body;\n parent.appendChild(sheetElement);\n }\n createSheetElement() {\n const sheetElement = document.createElement('kompis-sheet');\n const sheetHeaderElement = (document.createElement('kompis-sheet-header'));\n const sheetBodyElement = document.createElement('kompis-sheet-body');\n const sheetPaddingElement = document.createElement('kompis-sheet-body-padding');\n const cardElement = document.createElement('kompis-financial-services-card');\n const sheetFooterElement = document.createElement('kompis-sheet-footer');\n const buttonsElement = document.createElement('kompis-financial-services-buttons');\n sheetElement.theme = this.theme;\n sheetBodyElement.theme = this.theme;\n sheetPaddingElement.theme = this.theme;\n sheetPaddingElement.style.paddingBottom = this.theme.spacing.space150 / 16 + 'rem';\n sheetHeaderElement.theme = this.theme;\n sheetHeaderElement.ariaLabelCloseButton = this.getTranslations().modalAriaLabelButtonClose;\n cardElement.financingOption = this.financingOption;\n cardElement.theme = this.theme;\n sheetFooterElement.theme = this.theme;\n buttonsElement.financingOption = this.financingOption;\n buttonsElement.theme = this.theme;\n buttonsElement.localizedInformation = this.localizedInformation;\n buttonsElement.translations = this.translations;\n buttonsElement.disableLinks = this.disableLinks;\n sheetElement.appendChild(sheetHeaderElement);\n sheetElement.appendChild(sheetBodyElement);\n sheetBodyElement.appendChild(sheetPaddingElement);\n sheetPaddingElement.appendChild(cardElement);\n sheetElement.appendChild(sheetFooterElement);\n sheetFooterElement.appendChild(buttonsElement);\n return sheetElement;\n }\n getTriggerElement() {\n var _a, _b, _c, _d, _e;\n return ((_e = (_d = (_c = (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('kompis-financial-services-link')) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('kompis-hyperlink')) === null || _d === void 0 ? void 0 : _d.shadowRoot) === null || _e === void 0 ? void 0 : _e.querySelector('kompis-focus-outline > a'));\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], FinancialServices.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], FinancialServices.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], FinancialServices.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], FinancialServices.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], FinancialServices.prototype, \"financingOption\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], FinancialServices.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], FinancialServices.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], FinancialServices.prototype, \"analytics\", void 0);\nFinancialServices = __decorate([\n (0, web_component_1.customElement)('kompis-financial-services')\n], FinancialServices);\nexports.default = FinancialServices;\n//# sourceMappingURL=FinancialServices.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FinancialServicesModalEnum = exports.FinancialServicesLink = exports.FinancialServicesCard = exports.FinancialServicesButtons = exports.FinancialServices = void 0;\nconst FinancialServices_1 = __importDefault(require(\"./components/financial-services/FinancialServices\"));\nexports.FinancialServices = FinancialServices_1.default;\nconst FinancialServicesButtons_1 = __importDefault(require(\"./components/financial-services-buttons/FinancialServicesButtons\"));\nexports.FinancialServicesButtons = FinancialServicesButtons_1.default;\nconst FinancialServicesCard_1 = __importDefault(require(\"./components/financial-services-card/FinancialServicesCard\"));\nexports.FinancialServicesCard = FinancialServicesCard_1.default;\nconst FinancialServicesLink_1 = __importDefault(require(\"./components/financial-services-link/FinancialServicesLink\"));\nexports.FinancialServicesLink = FinancialServicesLink_1.default;\nconst FinancialServicesModalEnum_1 = __importDefault(require(\"./enums/FinancialServicesModalEnum\"));\nexports.FinancialServicesModalEnum = FinancialServicesModalEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('arrow-up-from-base', [{ tag: 'path', att: { d: 'm11 7.8294-3.242 3.242-1.4143-1.4142L12 4l5.6575 5.6572-1.4143 1.4142L13 7.8284V16h-2V7.8294z' } }, { tag: 'path', att: { d: 'M2 21.0029h20v-9h-2v7H4v-7H2v9z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ConfirmationSummaryShareDesignStateEnum;\n(function (ConfirmationSummaryShareDesignStateEnum) {\n ConfirmationSummaryShareDesignStateEnum[\"default\"] = \"default\";\n ConfirmationSummaryShareDesignStateEnum[\"loading\"] = \"loading\";\n})(ConfirmationSummaryShareDesignStateEnum || (ConfirmationSummaryShareDesignStateEnum = {}));\nexports.default = ConfirmationSummaryShareDesignStateEnum;\n//# sourceMappingURL=ConfirmationSummaryShareDesignStateEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst analytics_1 = require(\"@inter-ikea-kompis/analytics\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst moduleId = 'configuration_summary';\n/**\n * Tracks events from Configuration Summary and sends them to a reporter.\n *\n * @event save_planner When save design button is clicked.\n * {@nestedTracker component-add-to-bag/src/trackers/AddToBagTracker.ts}.\n * {@nestedTracker component-financial-services/src/trackers/FinancialServicesTracker.ts}.\n * {@nestedTracker component-configuration-summary/src/trackers/ConfigurationSummaryConfirmationCardTracker.ts}.\n */\nclass ConfigurationSummaryTracker extends analytics_1.AbstractAnalyticsTracker {\n constructor(options) {\n super(Object.assign({ moduleId }, options));\n this.context = options.context;\n }\n /**\n * Call to report when save design has been clicked.\n *\n * @param options\n * @param options.type The way the design was saved. Sharing through VPC, or saving to profile.\n * @param options.vpcCode The VPC code when using options.type 'Share'.\n */\n sendSaveDesign(options) {\n this.getReporter().saveDesign(options, this.context);\n }\n /**\n * Call to report when products have been added to the shopping cart.\n *\n * @param shoppingItems\n * @param shoppingProducts\n * @param settings\n * @param designId\n * @param unavailableItems\n */\n sendAddToCart(shoppingItems, shoppingProducts, settings, unavailableItems, designId) {\n const eventData = this.getEventData(shoppingItems, shoppingProducts, settings, designId, unavailableItems);\n this.getReporter().addToCart(eventData);\n }\n /**\n * Call to report when products have been added to the shopping list.\n *\n * @param shoppingItems\n * @param shoppingProducts\n * @param settings\n * @param designId\n */\n sendAddToList(shoppingItems, shoppingProducts, settings, designId) {\n const eventData = this.getEventData(shoppingItems, shoppingProducts, settings, designId);\n this.getReporter().addToWishList(eventData);\n }\n /**\n * @param shoppingItems\n * @param shoppingProducts\n * @param settings\n * @param designId\n * @param unavailable\n */\n getEventData(shoppingItems, shoppingProducts, settings, designId, unavailable) {\n const eventData = {\n currency: settings.localisation.currencyCode,\n items: this.getArticleData(shoppingItems, shoppingProducts, settings)\n };\n if (unavailable) {\n eventData.unavailableItems = this.getArticleData(unavailable, shoppingProducts, settings);\n }\n if (designId) {\n eventData.designId = designId;\n }\n if (this.context) {\n eventData.payload = { context: this.context };\n }\n return eventData;\n }\n /**\n * Maps shopping items to article data, with price calculation.\n *\n * @param shoppingItems Items to be converted to articles.\n * @param shoppingProducts Products data for price calculation.\n * @param settings Used for price calculation formatting.\n * @returns Array of article data with ID, price, and quantity.\n */\n getArticleData(shoppingItems, shoppingProducts, settings) {\n return shoppingItems.map((shoppingItem) => {\n const shoppingProduct = shoppingProducts.find((sp) => { var _a, _b; return ((_b = (_a = sp.product) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.ruItemNo) === shoppingItem.id; });\n if (!shoppingProduct) {\n throw new Error(`Could not find shopping product matching id '${shoppingItem.id}'!`);\n }\n const priceSummary = utilities_1.TotalPriceCalculator.calculate(\n // Setting quantity to one so we get the price for just one product.\n [Object.assign(Object.assign({}, shoppingProduct), { quantity: 1 })], settings.localisation.dateFormat);\n const price = utilities_1.PriceUtility.getPrice(priceSummary);\n return { id: shoppingItem.id, price, qty: shoppingItem.quantity };\n });\n }\n}\nexports.default = ConfigurationSummaryTracker;\n//# sourceMappingURL=ConfigurationSummaryTracker.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\n/**\n * Handles weight utilities.\n */\nclass ConfigurationSummaryWeightUtility {\n /**\n * @returns Total package weight in kilos.\n * @param shoppingProducts\n * @param includedProductsWithinSprs\n */\n static getTotalWeightInKg(shoppingProducts, includedProductsWithinSprs) {\n const includedShoppingProducts = this.getIncludedShoppingProducts(shoppingProducts, includedProductsWithinSprs);\n return [...shoppingProducts, ...includedShoppingProducts]\n .map((sp) => { var _a, _b; return (((_b = (_a = sp.product.content) === null || _a === void 0 ? void 0 : _a.packageMeasure) === null || _b === void 0 ? void 0 : _b.totalWeightGross) || 0) * sp.quantity; })\n .reduce((prev, curr) => prev + curr, 0);\n }\n /**\n * @param kilos The value in kilos.\n * @param locale Locale in format xx-XX, e.g. En-GB.\n * @param translations Phrase translations.\n * @param useMetricMeasures LocalizedInformation or dexf settings key.\n * @returns A formatted and localized weight with the correct unit (kg or lb and oz).\n */\n static getLocalizedWeight(kilos, locale, translations, useMetricMeasures) {\n if (useMetricMeasures) {\n // Multiplying and dividing to round the fractions.\n const roundedKilos = Math.round(kilos * 100) / 100;\n const formattedKilos = roundedKilos.toLocaleString(locale, {\n minimumFractionDigits: 2\n });\n const { weightUnitKg } = translations;\n return { kgValue: formattedKilos, kgUnit: weightUnitKg };\n }\n const { weightValuePound, weightValueOunce } = translations;\n const { lb, oz } = utilities_1.WeightUtility.metricToImperial(kilos);\n return Object.assign(Object.assign({}, (lb ? { lbValue: `${lb}`, lbUnit: weightValuePound } : null)), { ozValue: `${oz}`, ozUnit: weightValueOunce });\n }\n /**\n * @param localizedWeight Localized weight object returned from ConfigurationSummaryWeightUtility.getLocalizedWeight.\n * @returns Formatted string with HTML entities such as  .\n */\n static getLocalizedWeightHtmlString(localizedWeight) {\n const nbsp = '\\u00A0';\n if ('kgValue' in localizedWeight) {\n const { kgValue, kgUnit } = localizedWeight;\n return `${kgValue}${nbsp}${kgUnit}`;\n }\n else if ('lbValue' in localizedWeight) {\n const { lbValue, lbUnit, ozValue, ozUnit } = localizedWeight;\n return `${lbValue}${nbsp}${lbUnit} ${ozValue}${nbsp}${ozUnit}`;\n }\n else {\n const { ozValue, ozUnit } = localizedWeight;\n return `${ozValue}${nbsp}${ozUnit}`;\n }\n }\n /**\n * @returns Included shopping items based on SPR products and includedProductsWithinSprs.\n * @param shoppingProducts\n * @param includedProductsWithinSprs\n */\n static getIncludedShoppingProducts(shoppingProducts, includedProductsWithinSprs) {\n var _a, _b;\n const sprChildren = [];\n for (const shoppingProduct of shoppingProducts) {\n const sprQuantity = shoppingProduct.quantity;\n const children = ((_b = (_a = shoppingProduct.product.content) === null || _a === void 0 ? void 0 : _a.child) === null || _b === void 0 ? void 0 : _b.map(({ itemId, quantity, sortNo }) => ({\n itemId,\n quantity: quantity * sprQuantity,\n sortNo\n }))) || [];\n sprChildren.push(...children);\n }\n return sprChildren.map((sprChild) => {\n const matchingIncludedProduct = (includedProductsWithinSprs === null || includedProductsWithinSprs === void 0 ? void 0 : includedProductsWithinSprs.find(({ itemId }) => itemId === sprChild.itemId)) || null;\n if (!matchingIncludedProduct) {\n throw Error(`Could not find matching included product within SPR for itemId \"${sprChild.itemId}\".`);\n }\n return {\n quantity: sprChild.quantity,\n product: matchingIncludedProduct\n };\n });\n }\n}\nexports.default = ConfigurationSummaryWeightUtility;\n//# sourceMappingURL=ConfigurationSummaryWeightUtility.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\n/**\n * Styles.\n */\nclass ConfigurationSummaryStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @returns CSS for ConfigurationSummary.\n */\n static getStyle(options) {\n const { breakpoint, spacing, color } = options.theme;\n const gutterXlarge = spacing.space75;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\n\t\t\t:host {\n\t\t\t\tmax-width: ${400 / 16}rem;\n\t\t\t\tdisplay: grid;\n\t\t\t\tgrid-template-columns: repeat(4, 1fr);\n\t\t\t}\n\n\t\t\t.priceHeader {\n\t\t\t\tgrid-column: 1 / span 4;\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\n\t\t\t.priceHeaderPrice {\n\t\t\t\tflex: 1;\n\t\t\t}\n\n\t\t\t.priceHeaderButtons {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: flex-start;\n\t\t\t\tgap: ${spacing.space25 / 16}rem;\n\t\t\t\tpadding-left: ${spacing.space25 / 16}rem;\n\t\t\t}\n\n\t\t\t.buttons {\n\t\t\t\tgrid-column: 1 / span 4;\n\t\t\t\tmargin-top: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.buttons:empty {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\n\t\t\t.buttons > *:not(:first-child) {\n\t\t\t\tmargin-top: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.shareDesign,\n\t\t\t.saveDesign {\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: flex-end;\n\t\t\t}\n\n\t\t\t.shareDesign .divider,\n\t\t\t.saveDesign .divider {\n\t\t\t\twidth: ${spacing.space50 / 16}rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tmargin-inline-end: ${3.5}rem;\n\t\t\t}\n\n\t\t\tkompis-financial-services {\n\t\t\t\tmargin: ${spacing.space100 / 16}rem 0;\n\t\t\t}\n\n\t\t\t.priceExchangeRateContainer {\n\t\t\t\tcolor: ${color.neutral.grey700};\n\t\t\t}\n\n\t\t\t.totalPackageWeight {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\tkompis-save-design-to-profile {\n\t\t\t\tgrid-column: 1 / span 4;\n\t\t\t}\n\n\t\t\t@media print {\n\t\t\t\t.buttons,\n\t\t\t\t.priceHeaderButtons {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@media (min-width: ${breakpoint.xlarge.width / 16}rem) {\n\t\t\t\t:host {\n\t\t\t\t\tcolumn-gap: ${gutterXlarge / 16}rem;\n\t\t\t\t}\n\n\t\t\t\t.buttons {\n\t\t\t\t\tgrid-column: 1 / span 3;\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = ConfigurationSummaryStyle;\n//# sourceMappingURL=ConfigurationSummaryStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_add_to_bag_1 = require(\"@inter-ikea-kompis/component-add-to-bag\");\nconst AddToListLayoutEnum_1 = __importDefault(require(\"@inter-ikea-kompis/component-add-to-bag/lib/enums/AddToListLayoutEnum\"));\nconst component_hyperlink_1 = require(\"@inter-ikea-kompis/component-hyperlink\");\nconst component_price_module_1 = require(\"@inter-ikea-kompis/component-price-module\");\nconst component_save_design_to_profile_1 = require(\"@inter-ikea-kompis/component-save-design-to-profile\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@inter-ikea-kompis/component-add-to-bag\");\nrequire(\"@inter-ikea-kompis/component-financial-services\");\nrequire(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@inter-ikea-kompis/component-image\");\nrequire(\"@inter-ikea-kompis/component-save-design-to-profile\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/modal-webc\");\nrequire(\"@ingka/icon-store/arrow-up-from-base\");\nrequire(\"../configuration-summary-confirmation-card/ConfigurationSummaryConfirmationCard\");\nrequire(\"../configuration-summary-share-design-sheet/ConfigurationSummaryShareDesignSheet\");\nconst ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum_1 = __importDefault(require(\"../../enums/ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum\"));\nconst ConfigurationSummaryConfirmationCardStateEnum_1 = __importDefault(require(\"../../enums/ConfigurationSummaryConfirmationCardStateEnum\"));\nconst ConfigurationSummaryConfirmationCardTypeEnum_1 = __importDefault(require(\"../../enums/ConfigurationSummaryConfirmationCardTypeEnum\"));\nconst ConfigurationSummaryModalEnum_1 = __importDefault(require(\"../../enums/ConfigurationSummaryModalEnum\"));\nconst ConfirmationSummaryShareDesignStateEnum_1 = __importDefault(require(\"../../enums/ConfirmationSummaryShareDesignStateEnum\"));\nconst ConfigurationSummaryTracker_1 = __importDefault(require(\"../../trackers/ConfigurationSummaryTracker\"));\nconst ConfigurationSummaryWeightUtility_1 = __importDefault(require(\"../../utilities/ConfigurationSummaryWeightUtility\"));\nconst ConfigurationSummaryStyle_1 = __importDefault(require(\"./ConfigurationSummaryStyle\"));\n/**\n * ConfigurationSummary class.\n *\n * @event addToCart Start adding products to shopping cart.\n * @event addToList Start adding products to shopping list.\n * @event addToCartClick User clicks on add to cart button.\n * @event shareDesign When share design is clicked.\n * @event saveDesign When save design is clicked.\n * @event logInAndSaveDesign When save design is clicked inside the confirmation card.\n * @event saveDesignToProfile When save in save design to profile sheet is clicked.\n * @event saveDesignToProfileLogIn When login in save design to profile sheet is clicked.\n * @event modalClose Triggered when the modal has been closed\n * @event modalOpen Triggered when a modal has been opened. event.detail.type tells you the type\n * @event addUnavailableProductsToListChange Changes the option \"addUnavailableProductsToList\". Tiggered by user clicking the checkbox\n * @event addUnavailableToCartAndList Start adding unavailable products to shopping cart and shopping list\n * @event copyDesign When copy design is clicked.\n * @event confirmationCardStateChange Triggered when the state for ConfirmationCard changes.\n * @event financialServicesContinueButtonClick Triggered when continue planning button is clicked in financial services sheet.\n * @event financialServicesMoreInfoClick Triggered when read more is clicked in financial services sheet.\n * @event unavailableProductsModalContinue Click on continue in the unavailable products modal.\n * @event goToShoppingBag When goToShoppingBag is clicked.\n * @event resetAddToCartState Sent after 3 seconds after addToCartState confirmation to be able to reset the state of the button.\n * @event resetAddToListState Sent after 3 seconds after addToListState confirmation to be able to reset the state of the button.\n * @event kioskMainCtaButtonClick Triggered when main call to action button on kiosk is clicked.\n * @event linkCardClick When the link card is clicked.\n * @event shareDesignCardStateChange Triggered when the state for ShareDesignCard changes.\n * @event sendByEmailInput Triggered when the user writes in the sendByEmail view.\n * @event sendByEmailValidation Triggered when the user tries to send with an invalid email.\n * @event sendByEmailSend Triggered when the user clicks send in the sendByEmail view.\n * @event sendByEmailReset Triggered 3 seconds after SendByEmailState is set to success.\n * @event sendBySmsInput Triggered when the user writes in the sendBySms view.\n * @event sendBySmsValidation Triggered when the user tries to send with an invalid number.\n * @event sendBySmsSend Triggered when the user clicks send in the sendBySms view.\n * @event sendBySmsReset Triggered 3 seconds after SendBySmsState is set to success.\n * @event copyDesignCodeClick Triggered when the user clicks the copy design code button.\n * @event copyDesignCodeReset Triggered 3 seconds after copyDesignCodeState is set to success.\n * @event copyDesignLinkClick Triggered when the user clicks the copy design link button.\n * @event copyDesignLinkReset Triggered 3 seconds after copyDesignLinkState is set to success.\n */\nlet ConfigurationSummary = class ConfigurationSummary extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Application name for the tip over risk translation key when fixed to ceiling. E.g. \"tipOverWarningAlgotPostMountedStorage\" where \"Algot\" is the application name. The key \"tipOverWarningPostMountedStorage\" will be used if application name is not applied\n this.tipOverRiskApplicationName = null;\n // Name of the product\n this.productName = null;\n // Set to \"true\" if there is a tip over risk and a warning should be displayed. It will still only be displayed if localization.hasTipOverWarning is set to \"true\" in the translation tool\n this.tipOverRisk = false;\n // Set to \"true\" if furniture is fixed to ceiling. This will be used by \"tip over warning\" disclaimer\n this.furnitureFixedToCeiling = false;\n // True if the price should animate.\n this.animatedPrice = false;\n // VPC code.\n this.vpcCode = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk\n this.disableLinks = false;\n // Shows the share design button.\n this.showShareDesign = false;\n // Shows the save design button.\n this.showSaveDesign = false;\n // True if the add to bag buttons should be disabled\n this.disableAddToBag = false;\n // Shows the add to bag and add to list components. Add to list is also affected for backward compatibility. This attribute should be set to \"false\" when in a Kiosk. Setting this to \"false\" also moves the share button down to the text buttons.\n this.showAddToBag = false;\n // Defines the state for add to bag button\n this.addToCartState = component_add_to_bag_1.AddToBagStateEnum.default;\n // Defines the state for add to list button\n this.addToListState = component_add_to_bag_1.AddToBagStateEnum.default;\n // Defines the state for the share design button.\n this.shareDesignState = ConfirmationSummaryShareDesignStateEnum_1.default.default;\n // Defines the state for the confirmation card\n this.confirmationCardState = ConfigurationSummaryConfirmationCardStateEnum_1.default.default;\n // Show a modal\n this.visibleModal = null;\n // What type of information to show in the confirmation card modal\n this.confirmationCardType = null;\n // Defines the state for copy design code\n this.copyDesignState = null;\n // Defines the state for add to bag button\n this.unavailableOnlineBehaviour = component_add_to_bag_1.UnavailableOnlineBehaviourEnum.blockPurchase;\n // Selects the checkbox for the UnavailableProductsCard that adds unavailable items when user clicks \"continue\"\n this.addUnavailableProductsToList = false;\n // List of failed shopping products returned when trying to add to cart.\n this.failedShoppingItems = null;\n // The url for the screenshot.\n this.screenshotUrl = null;\n // The alt text for the screenshot. If not set, a default alt text will be used.\n this.screenshotAlt = null;\n // Shows financial services. The financing option is retrieved by service.\n this.financingOption = null;\n // Shows total package weight of the shopping products. If using SPR products, includedProductsWithinSprs must also be set.\n this.showTotalPackageWeight = false;\n // A list of included products within SPR products. Must be set (if applicable) for total package weight.\n this.includedProductsWithinSprs = null;\n // Current locale (e.g. \"en-GB\"). Must be set to show total package weight and/or to enable analytics.\n this.locale = null;\n // Shows call to action button to give user the possibilitiy to complete their purchase on kiosk. Won't be shown if showAddToBag is true.\n this.showKioskMainCTAButton = false;\n // Used for automatic analytics. If null or not set, analytics is turned off.\n this.analytics = null;\n // Displays link card when data and Översätta key showLinkCard are set. For image ratio guidelines, see Skapa Card. Hidden on kiosks when disableLinks is true.\n this.linkCard = null;\n // A collection of props used for the sheet shown after clicking save design. For more info about the props check the SaveDesignToProfile component.\n this.saveDesignToProfile = null;\n // Defines the state for the log in and save button.\n this.logInAndSaveState = ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum_1.default.default;\n // A collection of props used for the sheet shown after clicking share design. For more info about the props check the ShareDesignCard component.\n this.shareDesignCard = null;\n // Description of the product, e.g. \"Wardrobe, 200x300x55 cm\". Used in SaveDesignToProfile and ShareDesignCard.\n this.productDescription = null;\n this.sheetElement = null;\n this.sheetHeader = null;\n this.backButton = null;\n this.ecoFeeModalHeading = null;\n this.triggerElement = null;\n this.tracker = null;\n this.dexfSettings = null;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t${this.getPriceDisplay()} ${this.getDualCurrencyExchangeRate()}\n\t\t\t\t\t${this.getFinancialServices()}\n\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t${this.getShareDesignIconButton()} ${this.getAddToList()}\n\t\t\t\t
    \n\t\t\t
    \n\t\t\t${this.getTipOverWarning()} ${this.getTitle20()}\n\t\t\t
    \n\t\t\t\t${this.getKioskMainCTAButton()} ${this.getAddToBag()} ${this.getSaveDesignButton()}\n\t\t\t\t${this.getShareDesignButton()}\n\t\t\t
    \n\t\t\t${this.getSaveDesignToProfile()} ${this.getConfigurationSummaryShareDesignSheet()}\n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.closeConfirmationCardSheet();\n this.disconnectTracker();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n var _a, _b;\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n if (changedProperties.has('visibleModal')) {\n if (this.visibleModal === ConfigurationSummaryModalEnum_1.default.confirmationCard) {\n this.openConfirmationCardSheet();\n }\n else {\n this.closeConfirmationCardSheet();\n }\n }\n else if (this.sheetElement) {\n this.setPropsToCard(this.sheetElement);\n }\n if (changedProperties.has('analytics')) {\n this.disconnectTracker();\n this.connectTracker();\n }\n if (changedProperties.has('confirmationCardType')) {\n this.sendTrackingData();\n }\n if (changedProperties.has('visibleModal') &&\n this.visibleModal === ConfigurationSummaryModalEnum_1.default.shareDesignCard) {\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendSaveDesign({ type: 'Share', vpcCode: (_b = this.vpcCode) !== null && _b !== void 0 ? _b : undefined });\n }\n if (changedProperties.has('confirmationCardState')) {\n if (this.confirmationCardState !== ConfigurationSummaryConfirmationCardStateEnum_1.default.default) {\n this.showBackButton();\n }\n else {\n this.hideBackButton();\n }\n if (this.confirmationCardState === ConfigurationSummaryConfirmationCardStateEnum_1.default.ecoFeeCard) {\n this.showEcoFeeModalHeading();\n }\n else {\n this.hideEcoFeeModalHeading();\n }\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getSettings() {\n return this.dexfSettings;\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n getSaveDesignButton() {\n if (!this.showSaveDesign || !this.saveDesignToProfile) {\n return null;\n }\n const secondaryVariant = 'secondary';\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\t${this.getTranslations().save}\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n onSaveDesign() {\n var _a;\n this.dispatchEvent(new CustomEvent('saveDesign', {\n bubbles: true\n }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendSaveDesign({ type: 'Save' });\n }\n querySaveDesignButton() {\n var _a, _b, _c;\n return ((_c = (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.saveDesign skapa-button')) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('button'));\n }\n getSaveDesignToProfile() {\n if (!this.showSaveDesign || !this.saveDesignToProfile) {\n return null;\n }\n return (0, web_component_1.html) ` this.dispatchEvent(new CustomEvent('modalClose', {\n bubbles: true,\n detail: { visibleModal: null, triggerElement: this.querySaveDesignButton() }\n }))}\"\n\t\t\t@saveDesign=\"${() => this.dispatchEvent(new CustomEvent('saveDesignToProfile', { bubbles: true, detail: { visibleModal: null } }))}\"\n\t\t\t@logIn=\"${() => this.dispatchEvent(new CustomEvent('saveDesignToProfileLogIn', {\n bubbles: true\n }))}\"\n\t\t>\n\t\t`;\n }\n getShareDesignButton() {\n if (!this.showShareDesign || (this.showAddToBag && this.showSaveDesign)) {\n return null;\n }\n const secondaryVariant = 'secondary';\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\t${this.getTranslations().share}\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n getShareDesignIconButton() {\n if (!this.showShareDesign || !this.showAddToBag || !this.showSaveDesign) {\n return null;\n }\n const tertiaryVariant = 'tertiary';\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t\n\t\t\t\t${this.getTranslations().share}\n\t\t\t\n\t\t`;\n }\n getPriceDisplay() {\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('modalOpen', { bubbles: true, detail: event.detail }))}\"\n\t\t\t\t@modalClose=\"${() => this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }))}\"\n\t\t\t>\n\t\t\t\t\n\t\t\t\t${this.getTotalPackageWeight()}\n\t\t\t\n\t\t`;\n }\n /**\n * @returns Total package weight if enabled.\n */\n getTotalPackageWeight() {\n if (!this.showTotalPackageWeight || !this.locale) {\n return null;\n }\n const totalPackageWeightKgs = ConfigurationSummaryWeightUtility_1.default.getTotalWeightInKg(this.shoppingProducts, this.includedProductsWithinSprs);\n const localizedWeight = ConfigurationSummaryWeightUtility_1.default.getLocalizedWeight(totalPackageWeightKgs, this.locale, this.getTranslations(), this.getSettings().localisation.useMetricMeasures);\n const localizedWeightText = ConfigurationSummaryWeightUtility_1.default.getLocalizedWeightHtmlString(localizedWeight);\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${this.getTranslations().configurationSummaryTotalPackageWeight}: ${localizedWeightText}\n\t\t\t
    \n\t\t`;\n }\n /**\n * Returns HTML for exchange rate if more than one currency is provided.\n *\n * @returns Template.\n */\n getDualCurrencyExchangeRate() {\n var _a, _b, _c, _d;\n const hasDualCurrencies = new Set((_d = (_c = (_b = (_a = this.shoppingProducts[0]) === null || _a === void 0 ? void 0 : _a.product) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.priceInformation) === null || _d === void 0 ? void 0 : _d.salesPrice.map((price) => price.currencyCode)).size > 1;\n const { priceSettings } = this.getSettings().kompis;\n if (!(priceSettings.dualCurrencyExchangeRate && hasDualCurrencies)) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${priceSettings.dualCurrencyExchangeRate}\n\t\t\t\n\t\t`;\n }\n getFinancialServices() {\n if (!this.financingOption) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t {\n this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }));\n detail.triggerElement.focus();\n }}\"\n\t\t\t\t@modalOpen=\"${() => this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: { visibleModal: ConfigurationSummaryModalEnum_1.default.financialServicesCard }\n }))}\"\n\t\t\t\t@continueButtonClick=\"${({ detail }) => {\n this.dispatchEvent(new CustomEvent('financialServicesContinueButtonClick', { bubbles: true, detail }));\n detail.triggerElement.focus();\n }}\"\n\t\t\t\t@moreInfoClick=\"${({ detail }) => this.dispatchEvent(new CustomEvent('financialServicesMoreInfoClick', { bubbles: true, detail }))}\"\n\t\t\t>\n\t\t`;\n }\n getAddToBag() {\n if (!this.showAddToBag) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('modalOpen', { bubbles: true, detail }))}\"\n\t\t\t\t@modalClose=\"${({ detail }) => {\n var _a;\n this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }));\n (_a = detail.triggerElement) === null || _a === void 0 ? void 0 : _a.focus();\n }}\"\n\t\t\t\t@addUnavailableToCartAndList=\"${this.onAddUnavailableToCartAndList.bind(this)}\"\n\t\t\t\t@addToCart=\"${this.onAddToCart.bind(this)}\"\n\t\t\t\t@addToCartClick=\"${({ detail }) => {\n this.dispatchEvent(new CustomEvent('addToCartClick', {\n bubbles: true\n }));\n this.triggerElement = detail.triggerElement;\n }}\"\n\t\t\t\t@addUnavailableProductsToListChange=\"${(event) => this.dispatchEvent(new CustomEvent('addUnavailableProductsToListChange', {\n bubbles: true,\n detail: event.detail\n }))}\"\n\t\t\t\t@unavailableProductsModalContinue=\"${() => this.dispatchEvent(new CustomEvent('unavailableProductsModalContinue', {\n bubbles: true\n }))}}\"\n\t\t\t\t@resetAddToCartState=\"${() => this.dispatchEvent(new CustomEvent('resetAddToCartState', {\n bubbles: true\n }))}}\"\n\t\t\t\t@resetAddToListState=\"${() => this.dispatchEvent(new CustomEvent('resetAddToListState', {\n bubbles: true\n }))}}\"\n\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t.disabled=${this.disableAddToBag}\n\t\t\t\t.addToCartState=\"${this.addToCartState}\"\n\t\t\t\t.shoppingProducts=${this.shoppingProducts}\n\t\t\t\t.disableLinks=\"${this.disableLinks}\"\n\t\t\t\t.visibleModal=\"${this.visibleModal && this.visibleModal in component_add_to_bag_1.AddToBagModalEnum\n ? this.visibleModal\n : null}\"\n\t\t\t\t.showShareDesign=\"${this.showShareDesign}\"\n\t\t\t\t.localizedInformation=\"${this.localizedInformation}\"\n\t\t\t\t.settings=\"${this.settings}\"\n\t\t\t\t.translations=\"${this.translations}\"\n\t\t\t\t.unavailableOnlineBehaviour=\"${this.unavailableOnlineBehaviour}\"\n\t\t\t\t.addUnavailableProductsToList=\"${this.addUnavailableProductsToList}\"\n\t\t\t\t.failedShoppingItems=\"${this.failedShoppingItems}\"\n\t\t\t\t.analytics=\"${this.getSubComponentAnalytics()}\"\n\t\t\t\thideListButton\n\t\t\t>\n\t\t\t\n\t\t`;\n }\n getAddToList() {\n if (!this.showAddToBag) {\n return null;\n }\n const layout = AddToListLayoutEnum_1.default.iconSmall;\n const iconVariant = 'tertiary';\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('resetAddToListState', {\n bubbles: true\n }))}}\"\n\t\t\t\t.translations=\"${this.translations}\"\n\t\t\t\t.localizedInformation=\"${this.localizedInformation}\"\n\t\t\t\t.settings=\"${this.settings}\"\n\t\t\t\t.disabled=${this.disableAddToBag}\n\t\t\t\t.state=\"${this.addToListState}\"\n\t\t\t\t.shoppingProducts=${this.shoppingProducts}\n\t\t\t\t.analytics=\"${this.getSubComponentAnalytics()}\"\n\t\t\t\t.layout=${layout}\n\t\t\t\t.iconVariant=${iconVariant}\n\t\t\t>\n\t\t\t\n\t\t`;\n }\n kioskMainCTAButtonShouldShow() {\n return this.showKioskMainCTAButton && !this.showAddToBag;\n }\n getKioskMainCTAButton() {\n if (!this.kioskMainCTAButtonShouldShow()) {\n return null;\n }\n const emphasisedVariant = 'emphasised';\n return (0, web_component_1.html) `\n\t\t\t${this.getTranslations().kioskMainCtaButton}\n\t\t`;\n }\n onKioskMainCTAButtonClick() {\n this.triggerElement = this.queryKioskMainCTAButton();\n this.dispatchEvent(new CustomEvent('kioskMainCtaButtonClick', {\n bubbles: true,\n detail: {\n triggerElement: this.triggerElement\n }\n }));\n }\n queryKioskMainCTAButton() {\n var _a, _b, _c;\n return ((_c = (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#kiosk-main-cta')) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('button'));\n }\n /**\n * Get analytics object to pass on to sub components.\n */\n getSubComponentAnalytics() {\n var _a;\n const reporterId = (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.getConnectedReporterId();\n return this.analytics\n ? Object.assign(Object.assign({}, this.analytics), { locale: this.getLocaleForAnalyticsOrThrow(), \n // eslint-disable-next-line camelcase\n __INTERNAL__reporter: reporterId\n ? { connected: true, id: reporterId }\n : { connected: false } }) : null;\n }\n getLocaleForAnalyticsOrThrow() {\n if (!this.locale) {\n throw Error(\"The property 'locale' must be set when analytics is enabled.\");\n }\n return this.locale;\n }\n getTipOverWarning() {\n if (!this.getSettings().kompis.localization.hasTipOverWarning || !this.tipOverRisk) {\n return null;\n }\n const tipOverText = this.getTipOverText();\n if (!tipOverText) {\n return null;\n }\n let link = null;\n if (tipOverText.includes('[[')) {\n link = tipOverText.split('[[tip_over_warning_link]]');\n }\n else {\n link = tipOverText.split('{{tip_over_warning_link}}');\n }\n const list = link.map((text) => (0, web_component_1.html) `\n\t\t\t\t${text}\n\t\t\t`);\n if (this.disableLinks || !this.getSettings().kompis.urls.tipOverWarningUrl || list.length < 2) {\n return list;\n }\n return [\n list[0],\n (0, web_component_1.html) `\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t`,\n list[1]\n ];\n }\n getTipOverText() {\n if (this.furnitureFixedToCeiling) {\n return this.getTranslations()[`tipOverWarning${this.tipOverRiskApplicationName || ''}PostMountedStorage`];\n }\n return this.getTranslations().tipOverWarning;\n }\n getTitle20() {\n return this.getSettings().kompis.priceSettings.showTitle20 &&\n this.getTranslations().priceInfoTitle20\n ? (0, web_component_1.html) `\n\t\t\t\t\t${this.getTranslations().priceInfoTitle20}\n\t\t\t `\n : null;\n }\n onShareDesign() {\n this.triggerElement = this.queryShareDesignButton();\n this.dispatchEvent(new CustomEvent('shareDesign', {\n bubbles: true,\n detail: {\n shoppingItems: this.getShoppingItems(),\n triggerElement: this.triggerElement\n }\n }));\n }\n queryShareDesignButton() {\n var _a, _b;\n const button = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(\n // The button could either be in the main content or the price header\n '.shareDesign skapa-button, .priceHeaderButtons skapa-icon-button');\n return (_b = button === null || button === void 0 ? void 0 : button.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('button');\n }\n /**\n * Event handler.\n *\n * @param event Event.\n */\n onAddToCart(event) {\n this.dispatchEvent(new CustomEvent('addToCart', {\n bubbles: true,\n detail: Object.assign({}, event.detail)\n }));\n }\n /**\n * Event handler.\n *\n * @param event Event.\n */\n onAddToList(event) {\n this.dispatchEvent(new CustomEvent('addToList', {\n bubbles: true,\n detail: Object.assign({}, event.detail)\n }));\n this.triggerElement = event.detail.triggerElement;\n }\n /**\n * Event handler.\n *\n * @param event Event.\n */\n onAddUnavailableToCartAndList(event) {\n this.dispatchEvent(new CustomEvent('addUnavailableToCartAndList', {\n bubbles: true,\n detail: Object.assign({}, event.detail)\n }));\n }\n getShoppingItems() {\n return utilities_1.ProductUtility.getShoppingItems(this.shoppingProducts);\n }\n closeConfirmationCardSheet() {\n if (this.sheetElement) {\n this.sheetElement.open = false;\n this.sheetElement = null;\n }\n }\n openConfirmationCardSheet() {\n if (this.sheetElement) {\n return;\n }\n const sheetElement = this.createSheetElement();\n const onClose = () => {\n if (this.sheetElement) {\n this.dispatchEvent(new CustomEvent('modalClose', {\n bubbles: true,\n detail: {\n visibleModal: null,\n triggerElement: this.triggerElement\n }\n }));\n this.dispatchEvent(new CustomEvent('confirmationCardStateChange', {\n bubbles: true,\n detail: { selectedState: ConfigurationSummaryConfirmationCardStateEnum_1.default.default }\n }));\n }\n };\n // When user clicks 'close'\n sheetElement.addEventListener('closerequest', onClose);\n // Remove sheet when it has closed.\n sheetElement.addEventListener('closed', () => {\n var _a;\n (_a = sheetElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(sheetElement);\n });\n this.sheetElement = sheetElement;\n this.sheetHeader = sheetElement.querySelector('skapa-modal-header');\n sheetElement.open = true;\n const parent = document.querySelector('kompis-keyboard-injector') || document.body;\n parent.appendChild(sheetElement);\n }\n createSheetElement() {\n const sheetElement = this.createSheet();\n const sheetHeader = this.createSheetHeader();\n const configurationSummaryConfirmationCard = document.createElement('kompis-configuration-summary-confirmation-card');\n sheetElement.appendChild(sheetHeader);\n sheetElement.appendChild(configurationSummaryConfirmationCard);\n this.setPropsToCard(sheetElement);\n configurationSummaryConfirmationCard.addEventListener('copyDesign', (event) => {\n this.dispatchEvent(new CustomEvent('copyDesign', { bubbles: true, detail: Object.assign({}, event['detail']) }));\n });\n configurationSummaryConfirmationCard.addEventListener('confirmationCardStateChange', (event) => {\n this.dispatchEvent(new CustomEvent('confirmationCardStateChange', {\n bubbles: true,\n detail: Object.assign({}, event['detail'])\n }));\n });\n configurationSummaryConfirmationCard.addEventListener('goToShoppingBag', () => {\n this.dispatchEvent(new CustomEvent('goToShoppingBag', { bubbles: true }));\n });\n configurationSummaryConfirmationCard.addEventListener('linkCardClick', () => {\n this.dispatchEvent(new CustomEvent('linkCardClick', { bubbles: true }));\n });\n configurationSummaryConfirmationCard.addEventListener('logInAndSaveDesign', () => {\n var _a;\n this.dispatchEvent(new CustomEvent('logInAndSaveDesign', { bubbles: true }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendSaveDesign({ type: 'Save' });\n });\n return sheetElement;\n }\n createSheet() {\n const sheetElement = document.createElement('skapa-sheet');\n sheetElement.size = 'small';\n sheetElement.fullHeight = true;\n sheetElement.style.fontFamily = themes_1.FontStyle.getFontFamily(this.theme);\n sheetElement.style.zIndex = '500';\n return sheetElement;\n }\n createSheetHeader() {\n const sheetHeader = document.createElement('skapa-modal-header');\n sheetHeader.slot = 'header';\n if (this.confirmationCardState !== ConfigurationSummaryConfirmationCardStateEnum_1.default.default) {\n this.showBackButton();\n }\n this.ecoFeeModalHeading = this.createEcoFeeModalHeading();\n if (this.confirmationCardState === ConfigurationSummaryConfirmationCardStateEnum_1.default.ecoFeeCard) {\n this.showEcoFeeModalHeading();\n }\n const closeButton = this.createCloseButton();\n sheetHeader.appendChild(closeButton);\n sheetHeader.addEventListener('backrequest', () => {\n this.dispatchEvent(new CustomEvent('confirmationCardStateChange', {\n bubbles: true,\n detail: { selectedState: ConfigurationSummaryConfirmationCardStateEnum_1.default.default }\n }));\n });\n return sheetHeader;\n }\n createBackButton() {\n const backButton = document.createElement('skapa-icon-button');\n backButton.a11yLabel = this.getTranslations().modalAriaLabelButtonBack || '';\n backButton.variant = 'primary';\n backButton.inverse = true;\n backButton.small = true;\n const icon = document.createElement('skapa-icon');\n icon.icon = 'arrow-left';\n icon.flipRTL = true;\n icon.slot = 'icon';\n backButton.append(icon);\n backButton.slot = 'back-button';\n return backButton;\n }\n showBackButton() {\n this.backButton = this.createBackButton();\n this.sheetHeader && this.sheetHeader.appendChild(this.backButton);\n }\n hideBackButton() {\n this.sheetHeader &&\n this.backButton &&\n this.sheetHeader.contains(this.backButton) &&\n this.sheetHeader.removeChild(this.backButton);\n this.backButton = null;\n }\n createEcoFeeModalHeading() {\n const heading = document.createElement('h2');\n heading.innerText = this.getTranslations().ecoHeadline;\n heading.className = common_styles_webc_1.Text.classnames({ heading: { s: true } });\n heading.style.margin = '0';\n const style = document.createElement('style');\n style.textContent = common_styles_webc_1.Text.CSS;\n heading.appendChild(style);\n return heading;\n }\n showEcoFeeModalHeading() {\n if (this.ecoFeeModalHeading) {\n this.sheetHeader && this.sheetHeader.appendChild(this.ecoFeeModalHeading);\n }\n }\n hideEcoFeeModalHeading() {\n if (this.sheetHeader &&\n this.ecoFeeModalHeading &&\n this.sheetHeader.contains(this.ecoFeeModalHeading)) {\n this.sheetHeader.removeChild(this.ecoFeeModalHeading);\n }\n }\n createCloseButton() {\n const closeSpan = document.createElement('span');\n closeSpan.slot = 'closebutton-label';\n closeSpan.innerText = this.getTranslations().modalAriaLabelButtonClose;\n return closeSpan;\n }\n createSheetBodyHeading() {\n const sheetBodyHeading = document.createElement('div');\n sheetBodyHeading.classList.add('sheetBodyHeading');\n const bodyHeading = document.createElement('h2');\n bodyHeading.innerHTML = this.getSheetBodyTitleText();\n bodyHeading.className = common_styles_webc_1.Text.classnames({ heading: { m: true } });\n const style = document.createElement('style');\n style.textContent = common_styles_webc_1.Text.CSS;\n bodyHeading.appendChild(style);\n sheetBodyHeading.appendChild(bodyHeading);\n return sheetBodyHeading;\n }\n /**\n * @param sheetElement\n */\n updateSheetBodyHeading(sheetElement) {\n const cardElement = sheetElement.querySelector('kompis-configuration-summary-confirmation-card');\n const bodyHeading = sheetElement.querySelector('.sheetBodyHeading');\n if (this.confirmationCardState === ConfigurationSummaryConfirmationCardStateEnum_1.default.ecoFeeCard) {\n if (bodyHeading) {\n sheetElement.removeChild(bodyHeading);\n }\n }\n else if (!bodyHeading) {\n const sheetBodyHeading = this.createSheetBodyHeading();\n sheetElement.insertBefore(sheetBodyHeading, cardElement);\n }\n }\n getSheetBodyTitleText() {\n const { confirmationCardAddToShoppingCartSuccess, confirmationCardAddToShoppingListSuccess, addToShoppingCartFailureHeadline } = this.getTranslations();\n switch (this.confirmationCardType) {\n case ConfigurationSummaryConfirmationCardTypeEnum_1.default.addToCartSuccess:\n case ConfigurationSummaryConfirmationCardTypeEnum_1.default.addUnavailabeToCartAndListSuccess:\n case ConfigurationSummaryConfirmationCardTypeEnum_1.default.addUnavailabeToCartSuccessAndListFail:\n return confirmationCardAddToShoppingCartSuccess;\n case ConfigurationSummaryConfirmationCardTypeEnum_1.default.addToListSuccess:\n return confirmationCardAddToShoppingListSuccess;\n case ConfigurationSummaryConfirmationCardTypeEnum_1.default.addUnavailabeToCartFailAndListSuccess:\n return addToShoppingCartFailureHeadline;\n default:\n return '';\n }\n }\n setPropsToCard(sheetElement) {\n var _a, _b, _c;\n const cardElement = sheetElement.querySelector('kompis-configuration-summary-confirmation-card');\n if (!cardElement) {\n return;\n }\n cardElement.theme = this.theme;\n cardElement.localizedInformation = this.localizedInformation;\n cardElement.translations = this.translations;\n cardElement.settings = this.settings;\n cardElement.vpcCode = this.vpcCode;\n cardElement.addUnavailableProductsToList = this.addUnavailableProductsToList;\n cardElement.screenshotUrl = this.screenshotUrl;\n cardElement.screenshotAlt = this.screenshotAlt;\n cardElement.shoppingProducts = this.shoppingProducts;\n cardElement.productName = this.productName;\n cardElement.state = this.confirmationCardState;\n cardElement.disableLinks = this.disableLinks;\n cardElement.showSaveDesign = this.showSaveDesign;\n cardElement.loggedIn = (_b = (_a = this.saveDesignToProfile) === null || _a === void 0 ? void 0 : _a.loggedIn) !== null && _b !== void 0 ? _b : false;\n cardElement.logInAndSaveState = this.logInAndSaveState;\n if (this.confirmationCardType) {\n cardElement.type = this.confirmationCardType;\n }\n if (this.copyDesignState) {\n cardElement.copyDesignState = this.copyDesignState;\n }\n if (this.linkCard) {\n cardElement.linkCard = this.linkCard;\n }\n cardElement.analytics = this.getSubComponentAnalytics();\n cardElement.innerHTML = (_c = this.innerHTML) === null || _c === void 0 ? void 0 : _c.trim();\n this.setSheetAriaLabel(sheetElement);\n this.updateSheetBodyHeading(sheetElement);\n }\n setSheetAriaLabel(sheetElement) {\n if (this.confirmationCardState !== ConfigurationSummaryConfirmationCardStateEnum_1.default.ecoFeeCard) {\n sheetElement.setAttribute('aria-label', this.getSheetBodyTitleText());\n }\n else {\n sheetElement.setAttribute('aria-label', this.getTranslations().ecoHeadline);\n }\n }\n /**\n * @param shoppingProduct\n */\n isShoppingProductOnlineSaleable(shoppingProduct) {\n var _a, _b, _c, _d, _e;\n return Boolean(((_b = (_a = shoppingProduct.product.content) === null || _a === void 0 ? void 0 : _a.priceInformation) === null || _b === void 0 ? void 0 : _b.availableForHomeDelivery) ||\n ((_d = (_c = shoppingProduct.product.content) === null || _c === void 0 ? void 0 : _c.priceInformation) === null || _d === void 0 ? void 0 : _d.availableForClickCollect) ||\n ((_e = this.localizedInformation) === null || _e === void 0 ? void 0 : _e.localization.disableOnlineSaleableVerification));\n }\n /**\n * Returns a list of ShoppingProducts that is not saleable online.\n *\n * @returns Template.\n */\n getUnavailableShoppingProducts() {\n const shoppingProducts = this.shoppingProducts\n .filter((shoppingProduct) => shoppingProduct.quantity > 0)\n .filter((shoppingProduct) => !this.isShoppingProductOnlineSaleable(shoppingProduct));\n return shoppingProducts.map((shoppingProduct) => {\n var _a, _b, _c, _d;\n return ({\n id: (_b = (_a = shoppingProduct.product.content) === null || _a === void 0 ? void 0 : _a.ruItemNo) !== null && _b !== void 0 ? _b : '',\n type: (_d = (_c = shoppingProduct.product.content) === null || _c === void 0 ? void 0 : _c.ruItemType) !== null && _d !== void 0 ? _d : '',\n quantity: shoppingProduct.quantity\n });\n });\n }\n sendTrackingData() {\n var _a, _b, _c;\n const designId = (_a = this.vpcCode) !== null && _a !== void 0 ? _a : undefined;\n if (this.confirmationCardType === ConfigurationSummaryConfirmationCardTypeEnum_1.default.addToCartSuccess ||\n this.confirmationCardType ===\n ConfigurationSummaryConfirmationCardTypeEnum_1.default.addUnavailabeToCartAndListSuccess ||\n this.confirmationCardType ===\n ConfigurationSummaryConfirmationCardTypeEnum_1.default.addUnavailabeToCartSuccessAndListFail) {\n const unavailableProducts = this.confirmationCardType === ConfigurationSummaryConfirmationCardTypeEnum_1.default.addToCartSuccess\n ? undefined\n : this.getUnavailableShoppingProducts();\n (_b = this.tracker) === null || _b === void 0 ? void 0 : _b.sendAddToCart(this.getShoppingItems(), this.shoppingProducts, this.getSettings(), unavailableProducts, designId);\n }\n if (this.confirmationCardType === ConfigurationSummaryConfirmationCardTypeEnum_1.default.addToListSuccess ||\n this.confirmationCardType ===\n ConfigurationSummaryConfirmationCardTypeEnum_1.default.addUnavailabeToCartAndListSuccess ||\n this.confirmationCardType ===\n ConfigurationSummaryConfirmationCardTypeEnum_1.default.addUnavailabeToCartFailAndListSuccess) {\n (_c = this.tracker) === null || _c === void 0 ? void 0 : _c.sendAddToList(this.getShoppingItems(), this.shoppingProducts, this.getSettings(), designId);\n }\n }\n getConfigurationSummaryShareDesignSheet() {\n if (!this.vpcCode || !this.shareDesignCard) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t {\n this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail }));\n }}\"\n\t\t\t\t@shareDesignCardStateChange=\"${({ detail }) => this.dispatchEvent(new CustomEvent('shareDesignCardStateChange', { bubbles: true, detail }))}\"\n\t\t\t\t@sendByEmailInput=\"${({ detail }) => this.dispatchEvent(new CustomEvent('sendByEmailInput', { bubbles: true, detail }))}\"\n\t\t\t\t@sendByEmailValidation=\"${({ detail }) => this.dispatchEvent(new CustomEvent('sendByEmailValidation', { bubbles: true, detail }))}\"\n\t\t\t\t@sendByEmailSend=\"${({ detail }) => this.dispatchEvent(new CustomEvent('sendByEmailSend', { bubbles: true, detail }))}\"\n\t\t\t\t@sendByEmailReset=\"${({ detail }) => this.dispatchEvent(new CustomEvent('sendByEmailReset', { bubbles: true, detail }))}\"\n\t\t\t\t@sendBySmsInput=\"${({ detail }) => this.dispatchEvent(new CustomEvent('sendBySmsInput', { bubbles: true, detail }))}\"\n\t\t\t\t@sendBySmsValidation=\"${({ detail }) => this.dispatchEvent(new CustomEvent('sendBySmsValidation', { bubbles: true, detail }))}\"\n\t\t\t\t@sendBySmsSend=\"${({ detail }) => this.dispatchEvent(new CustomEvent('sendBySmsSend', { bubbles: true, detail }))}\"\n\t\t\t\t@sendBySmsReset=\"${({ detail }) => this.dispatchEvent(new CustomEvent('sendBySmsReset', { bubbles: true, detail }))}\"\n\t\t\t\t@copyDesignCodeClick=\"${({ detail }) => this.dispatchEvent(new CustomEvent('copyDesignCodeClick', { bubbles: true, detail }))}\"\n\t\t\t\t@copyDesignCodeReset=\"${() => this.dispatchEvent(new CustomEvent('copyDesignCodeReset', { bubbles: true }))}\"\n\t\t\t\t@copyDesignLinkClick=\"${({ detail }) => this.dispatchEvent(new CustomEvent('copyDesignLinkClick', { bubbles: true, detail }))}\"\n\t\t\t\t@copyDesignLinkReset=\"${() => this.dispatchEvent(new CustomEvent('copyDesignLinkReset', { bubbles: true }))}\"\n\t\t\t>\n\t\t\t\n\t\t`;\n }\n connectTracker() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n if (this.analytics) {\n const locale = this.getLocaleForAnalyticsOrThrow();\n // eslint-disable-next-line no-underscore-dangle\n const reporter = this.analytics.__INTERNAL__reporter;\n if ((reporter === null || reporter === void 0 ? void 0 : reporter.connected) === false) {\n // Should use an existing reporter, but wait for it to be connected\n return;\n }\n // Use existing connected reporter, or the tracker should create a new one.\n const reporterId = reporter ? reporter.id : undefined;\n this.tracker = new ConfigurationSummaryTracker_1.default(Object.assign(Object.assign({}, this.analytics), { locale, settings: this.getSettings(), reporterId }));\n yield ((_a = this.tracker) === null || _a === void 0 ? void 0 : _a.connect());\n // Make sure child components with analytics connect their trackers when the id is available.\n this.requestUpdate();\n }\n });\n }\n disconnectTracker() {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.disconnect();\n this.tracker = null;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ConfigurationSummary.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummary.prototype, \"tipOverRiskApplicationName\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummary.prototype, \"productName\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ConfigurationSummary.prototype, \"shoppingProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ConfigurationSummary.prototype, \"tipOverRisk\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ConfigurationSummary.prototype, \"furnitureFixedToCeiling\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ConfigurationSummary.prototype, \"animatedPrice\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummary.prototype, \"vpcCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ConfigurationSummary.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ConfigurationSummary.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ConfigurationSummary.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ConfigurationSummary.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ConfigurationSummary.prototype, \"showShareDesign\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ConfigurationSummary.prototype, \"showSaveDesign\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ConfigurationSummary.prototype, \"disableAddToBag\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ConfigurationSummary.prototype, \"showAddToBag\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummary.prototype, \"addToCartState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummary.prototype, \"addToListState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummary.prototype, \"shareDesignState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummary.prototype, \"confirmationCardState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummary.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummary.prototype, \"confirmationCardType\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummary.prototype, \"copyDesignState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummary.prototype, \"unavailableOnlineBehaviour\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ConfigurationSummary.prototype, \"addUnavailableProductsToList\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ConfigurationSummary.prototype, \"failedShoppingItems\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummary.prototype, \"screenshotUrl\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummary.prototype, \"screenshotAlt\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ConfigurationSummary.prototype, \"financingOption\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ConfigurationSummary.prototype, \"showTotalPackageWeight\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ConfigurationSummary.prototype, \"includedProductsWithinSprs\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummary.prototype, \"locale\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ConfigurationSummary.prototype, \"showKioskMainCTAButton\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ConfigurationSummary.prototype, \"analytics\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ConfigurationSummary.prototype, \"linkCard\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ConfigurationSummary.prototype, \"saveDesignToProfile\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummary.prototype, \"logInAndSaveState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ConfigurationSummary.prototype, \"shareDesignCard\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ConfigurationSummary.prototype, \"productDescription\", void 0);\nConfigurationSummary = __decorate([\n (0, web_component_1.customElement)('kompis-configuration-summary')\n], ConfigurationSummary);\nexports.default = ConfigurationSummary;\n//# sourceMappingURL=ConfigurationSummary.js.map","import \"@inter-ikea-kompis/component-configuration-summary/lib/components/configuration-summary/ConfigurationSummary\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisConfigurationSummary extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-configuration-summary\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.addToCartState = props.addToCartState;\n element.addToListState = props.addToListState;\n element.addUnavailableProductsToList = props.addUnavailableProductsToList;\n element.analytics = props.analytics;\n element.animatedPrice = props.animatedPrice;\n element.confirmationCardState = props.confirmationCardState;\n element.confirmationCardType = props.confirmationCardType;\n element.copyDesignState = props.copyDesignState;\n element.disableAddToBag = props.disableAddToBag;\n element.disableLinks = props.disableLinks;\n element.failedShoppingItems = props.failedShoppingItems;\n element.financingOption = props.financingOption;\n element.furnitureFixedToCeiling = props.furnitureFixedToCeiling;\n element.includedProductsWithinSprs = props.includedProductsWithinSprs;\n element.linkCard = props.linkCard;\n element.locale = props.locale;\n element.localizedInformation = props.localizedInformation;\n element.logInAndSaveState = props.logInAndSaveState;\n element.productDescription = props.productDescription;\n element.productName = props.productName;\n element.saveDesignToProfile = props.saveDesignToProfile;\n element.screenshotAlt = props.screenshotAlt;\n element.screenshotUrl = props.screenshotUrl;\n element.settings = props.settings;\n element.shareDesignCard = props.shareDesignCard;\n element.shareDesignState = props.shareDesignState;\n element.shoppingProducts = props.shoppingProducts;\n element.showAddToBag = props.showAddToBag;\n element.showKioskMainCTAButton = props.showKioskMainCTAButton;\n element.showSaveDesign = props.showSaveDesign;\n element.showShareDesign = props.showShareDesign;\n element.showTotalPackageWeight = props.showTotalPackageWeight;\n element.theme = props.theme;\n element.tipOverRisk = props.tipOverRisk;\n element.tipOverRiskApplicationName = props.tipOverRiskApplicationName;\n element.translations = props.translations;\n element.unavailableOnlineBehaviour = props.unavailableOnlineBehaviour;\n element.visibleModal = props.visibleModal;\n element.vpcCode = props.vpcCode;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onAddToCart, \"addToCart\");\n this.updateEventListener(element, props.onAddToCartClick, \"addToCartClick\");\n this.updateEventListener(element, props.onAddToList, \"addToList\");\n this.updateEventListener(element, props.onAddUnavailableProductsToListChange, \"addUnavailableProductsToListChange\");\n this.updateEventListener(element, props.onAddUnavailableToCartAndList, \"addUnavailableToCartAndList\");\n this.updateEventListener(element, props.onConfirmationCardStateChange, \"confirmationCardStateChange\");\n this.updateEventListener(element, props.onCopyDesign, \"copyDesign\");\n this.updateEventListener(element, props.onCopyDesignCodeClick, \"copyDesignCodeClick\");\n this.updateEventListener(element, props.onCopyDesignCodeReset, \"copyDesignCodeReset\");\n this.updateEventListener(element, props.onCopyDesignLinkClick, \"copyDesignLinkClick\");\n this.updateEventListener(element, props.onCopyDesignLinkReset, \"copyDesignLinkReset\");\n this.updateEventListener(element, props.onFinancialServicesContinueButtonClick, \"financialServicesContinueButtonClick\");\n this.updateEventListener(element, props.onFinancialServicesMoreInfoClick, \"financialServicesMoreInfoClick\");\n this.updateEventListener(element, props.onGoToShoppingBag, \"goToShoppingBag\");\n this.updateEventListener(element, props.onKioskMainCtaButtonClick, \"kioskMainCtaButtonClick\");\n this.updateEventListener(element, props.onLinkCardClick, \"linkCardClick\");\n this.updateEventListener(element, props.onLogInAndSaveDesign, \"logInAndSaveDesign\");\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n this.updateEventListener(element, props.onResetAddToCartState, \"resetAddToCartState\");\n this.updateEventListener(element, props.onResetAddToListState, \"resetAddToListState\");\n this.updateEventListener(element, props.onSaveDesign, \"saveDesign\");\n this.updateEventListener(element, props.onSaveDesignToProfile, \"saveDesignToProfile\");\n this.updateEventListener(element, props.onSaveDesignToProfileLogIn, \"saveDesignToProfileLogIn\");\n this.updateEventListener(element, props.onSendByEmailInput, \"sendByEmailInput\");\n this.updateEventListener(element, props.onSendByEmailReset, \"sendByEmailReset\");\n this.updateEventListener(element, props.onSendByEmailSend, \"sendByEmailSend\");\n this.updateEventListener(element, props.onSendByEmailValidation, \"sendByEmailValidation\");\n this.updateEventListener(element, props.onSendBySmsInput, \"sendBySmsInput\");\n this.updateEventListener(element, props.onSendBySmsReset, \"sendBySmsReset\");\n this.updateEventListener(element, props.onSendBySmsSend, \"sendBySmsSend\");\n this.updateEventListener(element, props.onSendBySmsValidation, \"sendBySmsValidation\");\n this.updateEventListener(element, props.onShareDesign, \"shareDesign\");\n this.updateEventListener(element, props.onShareDesignCardStateChange, \"shareDesignCardStateChange\");\n this.updateEventListener(element, props.onUnavailableProductsModalContinue, \"unavailableProductsModalContinue\");\n }\n}\nKompisConfigurationSummary.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n addToCartState: PropTypes.string,\n addToListState: PropTypes.string,\n addUnavailableProductsToList: PropTypes.bool,\n analytics: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n animatedPrice: PropTypes.bool,\n confirmationCardState: PropTypes.string,\n confirmationCardType: PropTypes.string,\n copyDesignState: PropTypes.string,\n disableAddToBag: PropTypes.bool,\n disableLinks: PropTypes.bool,\n failedShoppingItems: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n financingOption: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n furnitureFixedToCeiling: PropTypes.bool,\n includedProductsWithinSprs: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n linkCard: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n locale: PropTypes.string,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n logInAndSaveState: PropTypes.string,\n productDescription: PropTypes.string,\n productName: PropTypes.string,\n saveDesignToProfile: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n screenshotAlt: PropTypes.string,\n screenshotUrl: PropTypes.string,\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n shareDesignCard: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n shareDesignState: PropTypes.string,\n shoppingProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n showAddToBag: PropTypes.bool,\n showKioskMainCTAButton: PropTypes.bool,\n showSaveDesign: PropTypes.bool,\n showShareDesign: PropTypes.bool,\n showTotalPackageWeight: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n tipOverRisk: PropTypes.bool,\n tipOverRiskApplicationName: PropTypes.string,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n unavailableOnlineBehaviour: PropTypes.string,\n visibleModal: PropTypes.string,\n vpcCode: PropTypes.string,\n onAddToCart: PropTypes.func,\n onAddToList: PropTypes.func,\n onAddToCartClick: PropTypes.func,\n onShareDesign: PropTypes.func,\n onSaveDesign: PropTypes.func,\n onLogInAndSaveDesign: PropTypes.func,\n onSaveDesignToProfile: PropTypes.func,\n onSaveDesignToProfileLogIn: PropTypes.func,\n onModalClose: PropTypes.func,\n onModalOpen: PropTypes.func,\n onAddUnavailableProductsToListChange: PropTypes.func,\n onAddUnavailableToCartAndList: PropTypes.func,\n onCopyDesign: PropTypes.func,\n onConfirmationCardStateChange: PropTypes.func,\n onFinancialServicesContinueButtonClick: PropTypes.func,\n onFinancialServicesMoreInfoClick: PropTypes.func,\n onUnavailableProductsModalContinue: PropTypes.func,\n onGoToShoppingBag: PropTypes.func,\n onResetAddToCartState: PropTypes.func,\n onResetAddToListState: PropTypes.func,\n onKioskMainCtaButtonClick: PropTypes.func,\n onLinkCardClick: PropTypes.func,\n onShareDesignCardStateChange: PropTypes.func,\n onSendByEmailInput: PropTypes.func,\n onSendByEmailValidation: PropTypes.func,\n onSendByEmailSend: PropTypes.func,\n onSendByEmailReset: PropTypes.func,\n onSendBySmsInput: PropTypes.func,\n onSendBySmsValidation: PropTypes.func,\n onSendBySmsSend: PropTypes.func,\n onSendBySmsReset: PropTypes.func,\n onCopyDesignCodeClick: PropTypes.func,\n onCopyDesignCodeReset: PropTypes.func,\n onCopyDesignLinkClick: PropTypes.func,\n onCopyDesignLinkReset: PropTypes.func\n};\nexport default KompisConfigurationSummary;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\n/**\n * A utility to add styling for components used for navigation.\n *\n * Only to be used internally within Kompis: in main header, main footer, summary page and the content margins component.\n */\nclass StyleUtility {\n static getSpaceForHeader({ cssSelector, theme }) {\n const { breakpoint, spacing } = theme;\n return (0, web_component_1.css) `\n\t\t\t${cssSelector} {\n\t\t\t\tmargin-top: calc(${80 / 16}rem + ${spacing.space125 / 16}rem);\n\n\t\t\t\t@media (min-width: ${breakpoint.large.width / 16}rem) {\n\t\t\t\t\tmargin-top: calc(${90 / 16}rem + ${spacing.space125 / 16}rem);\n\t\t\t\t}\n\n\t\t\t\t@media (min-width: ${breakpoint.xlarge.width / 16}rem) {\n\t\t\t\t\tmargin-top: calc(${90 / 16}rem + ${spacing.space250 / 16}rem);\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n static getLayoutParentStyling({ cssSelector, theme }) {\n const { breakpoint, spacing } = theme;\n return (0, web_component_1.css) `\n\t\t\t@media (min-width: ${breakpoint.xlarge.width / 16}rem) {\n\t\t\t\t${cssSelector} {\n\t\t\t\t\tdisplay: grid;\n\t\t\t\t\tgrid-template-columns: repeat(13, minmax(0, 1fr));\n\t\t\t\t\tcolumn-gap: ${spacing.space125 / 16}rem;\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n static getLayoutChildStyling({ cssSelector, theme }) {\n const { breakpoint } = theme;\n return (0, web_component_1.css) `\n\t\t\t${cssSelector} {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\t@media (min-width: ${breakpoint.xlarge.width / 16}rem) {\n\t\t\t\t${cssSelector} {\n\t\t\t\t\tgrid-column-start: 2;\n\t\t\t\t\tgrid-column-end: -1;\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n static getHorizontalSpacing({ cssSelector, theme, direction }) {\n const { breakpoint, spacing } = theme;\n const margins = {\n small: spacing.space150,\n medium: spacing.space200,\n large: spacing.space250,\n xlarge: spacing.space300\n };\n /* XXL in Kompis SkapaTheme is 1920, while Skapas is 1600, so we hardcode it here */\n const xxLargeBreakPoint = 1600;\n return (0, web_component_1.css) `\n\t\t\t${cssSelector} {\n\t\t\t\tpadding-left: ${margins.small / 16}rem;\n\t\t\t\tpadding-right: ${margins.small / 16}rem;\n\t\t\t}\n\n\t\t\t@media (min-width: ${breakpoint.medium.width / 16}rem) {\n\t\t\t\t${cssSelector} {\n\t\t\t\t\tpadding-left: ${margins.medium / 16}rem;\n\t\t\t\t\tpadding-right: ${margins.medium / 16}rem;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@media (min-width: ${breakpoint.large.width / 16}rem) {\n\t\t\t\t${cssSelector} {\n\t\t\t\t\tpadding-left: ${margins.large / 16}rem;\n\t\t\t\t\tpadding-right: ${margins.large / 16}rem;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@media (min-width: ${breakpoint.xlarge.width / 16}rem) {\n\t\t\t\t${cssSelector} {\n\t\t\t\t\tpadding-left: ${direction === 'rtl' ? margins.xlarge / 16 : spacing.space125 / 16}rem;\n\t\t\t\t\tpadding-right: ${direction === 'rtl' ? spacing.space125 / 16 : margins.xlarge / 16}rem;\n\t\t\t\t}\n\n\t\t\t\t/** Chrome & Firefox */\n\t\t\t\t:host-context([dir='rtl']) ${cssSelector} {\n\t\t\t\t\tpadding-left: ${margins.xlarge / 16}rem;\n\t\t\t\t\tpadding-right: ${spacing.space125 / 16}rem;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/** Centralize the component with auto margins. */\n\t\t\t@media (min-width: ${xxLargeBreakPoint / 16}rem) {\n\t\t\t\t${cssSelector} {\n\t\t\t\t\tmargin-left: auto;\n\t\t\t\t\tmargin-right: auto;\n\t\t\t\t\tmax-width: ${1792 / 16}rem; /* 122rem, matches the max width of Ikea main page layout*/\n\t\t\t\t\tpadding-left: ${direction === 'rtl' ? margins.xlarge / 16 : spacing.space125 / 16}rem;\n\t\t\t\t\tpadding-right: ${direction === 'rtl' ? spacing.space125 / 16 : margins.xlarge / 16}rem;\n\t\t\t\t}\n\n\t\t\t\t/** Chrome & Firefox */\n\t\t\t\t:host-context([dir='rtl']) ${cssSelector} {\n\t\t\t\t\tpadding-left: ${margins.xlarge / 16}rem;\n\t\t\t\t\tpadding-right: ${spacing.space125 / 16}rem;\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = StyleUtility;\n//# sourceMappingURL=StyleUtility.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst StyleUtility_1 = __importDefault(require(\"../../utilities/StyleUtility\"));\nclass ContentMarginsStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { theme, direction } = options;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\t${StyleUtility_1.default.getSpaceForHeader({ cssSelector: '.wrapper', theme })}\n\t\t\t${StyleUtility_1.default.getLayoutParentStyling({ cssSelector: '.wrapper', theme })}\n\t\t\t${StyleUtility_1.default.getHorizontalSpacing({ cssSelector: '.wrapper', theme, direction })};\n\t\t\t${StyleUtility_1.default.getLayoutChildStyling({ cssSelector: '.content', theme })}\n\t\t`;\n }\n}\nexports.default = ContentMarginsStyle;\n//# sourceMappingURL=ContentMarginsStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst ContentMarginsStyle_1 = __importDefault(require(\"./ContentMarginsStyle\"));\nlet ContentMargins = class ContentMargins extends web_component_1.KompisElement {\n render() {\n const direction = utilities_1.SafariWriteDirectionUtility.getWriteDirection(this);\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t
    \n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ContentMargins.prototype, \"theme\", void 0);\nContentMargins = __decorate([\n (0, web_component_1.customElement)('kompis-content-margins')\n], ContentMargins);\nexports.default = ContentMargins;\n//# sourceMappingURL=ContentMargins.js.map","import \"@inter-ikea-kompis/component-content-margins/lib/components/content-margins/ContentMargins\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisContentMargins extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-content-margins\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisContentMargins.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisContentMargins;\n","import \"@inter-ikea-kompis/component-copy-design-code/lib/components/copy-design-code/CopyDesignCode\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisCopyDesignCode extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-copy-design-code\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.localizedInformation = props.localizedInformation;\n element.state = props.state;\n element.theme = props.theme;\n element.translations = props.translations;\n element.vpcCode = props.vpcCode;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onCopy, \"copy\");\n this.updateEventListener(element, props.onReset, \"reset\");\n }\n}\nKompisCopyDesignCode.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n state: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n vpcCode: PropTypes.string.isRequired,\n onCopy: PropTypes.func,\n onReset: PropTypes.func\n};\nexport default KompisCopyDesignCode;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nclass CountdownStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @returns Styles.\n */\n static getStyle(options) {\n const { color, border } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t${themes_1.FontStyle.getStyle({\n type: enums_1.ThemeFontStyleTypeEnum.headingSmall,\n theme: options.theme\n })}\n\n\t\t\t:host {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\n\t\t\tsvg {\n\t\t\t\tstroke: ${color.component.primaryPress};\n\t\t\t\tstroke-width: ${border.radius.radius4 / 16}rem;\n\t\t\t\tfill: transparent;\n\t\t\t\theight: ${57 / 16}rem;\n\t\t\t\twidth: ${57 / 16}rem;\n\t\t\t\toverflow: visible;\n\t\t\t}\n\n\t\t\tcircle {\n\t\t\t\ttransition: ${options.circleAnimation ? 'all 1s linear' : '0'};\n\t\t\t}\n\n\t\t\t.circle--bg {\n\t\t\t\tstroke: ${color.neutral.grey200};\n\t\t\t}\n\n\t\t\ttext {\n\t\t\t\tfill: ${color.neutral.grey900};\n\t\t\t\tstroke-width: 0;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = CountdownStyle;\n//# sourceMappingURL=CountdownStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nrequire(\"@inter-ikea-kompis/component-text\");\nconst CountdownStyle_1 = __importDefault(require(\"./CountdownStyle\"));\nconst COUNTDOWN_HEIGHT = 56;\n/**\n * This component should be used for general Countdown and it provides with general stylings according to NCL and fixes for common browsers and touch devices.\n *\n * @event timeEnd When the animation for circle tick ends.\n * @event timeChange When time changes.\n */\nlet Countdown = class Countdown extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Start value for countdown\n this.startTime = 0;\n // Current value for countdown.\n this.time = 0;\n // Radius and size of SVG circle.\n this.radius = 0;\n this.circumference = 0;\n // Timeout\n this.timeout = null;\n this.circleAnimation = false;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n const scale = this.getScale();\n // We need to calculate the size and radius for the SVG.\n this.radius = (COUNTDOWN_HEIGHT * scale) / 2;\n this.circumference = 2 * Math.PI * this.radius;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t\t\t${this.time}\n\t\t\t\t\n\t\t\t\t
    \n\t\t\t\n\t\t`;\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n if (this.timeout) {\n clearTimeout(this.timeout);\n }\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('time')) {\n if (this.timeout) {\n clearTimeout(this.timeout);\n }\n if (this.time < this.startTime) {\n this.circleAnimation = true;\n }\n if (this.time === 0) {\n this.circleAnimation = false;\n this.dispatchEvent(new CustomEvent('timeEnd', {\n bubbles: true,\n detail: {\n visible: false\n }\n }));\n }\n else {\n this.timeout = setTimeout(() => {\n this.dispatchEvent(new CustomEvent('timeChange', {\n bubbles: true,\n detail: {\n time: this.time - 1\n }\n }));\n }, 1000);\n }\n }\n return true;\n }\n /**\n * Returns the scale calculated from the rem-scaling.\n */\n getScale() {\n const rootFontSize = window\n .getComputedStyle(document.documentElement)\n .getPropertyValue('font-size');\n let scale = 0;\n if (rootFontSize) {\n if (rootFontSize.includes('%')) {\n scale = Number(rootFontSize.replace('%', '')) / 100;\n }\n else {\n scale = Number(rootFontSize.replace('px', '')) / 16;\n }\n }\n return scale;\n }\n /**\n * First, 1/4 of circumfence of 90 degrees. To start from top of the view,\n * we must rotate it by 90 degrees.\n * By default circle will start on the right.\n * Stroke offset effectively rotates the circle.\n */\n getStrokeOffset() {\n return (1 / 4) * this.circumference;\n }\n /**\n * Second, calculate dash array. We need dash array containing only two parts -\n * visible dash, and invisible dash.\n * Visible dash should have length of the chosen angle (time). Full circle is 360 degrees (startTime),\n * and this 360 degrees does also equal the entire circumference. We want just a part of\n * this entire circle to be visible - (time / startTime) returns a percentage value\n * (between 0.0 and 100.0) of how much circumference should be visible.\n * Hence, we then multiply (time / startTime) times the entire circumference.\n */\n getStrokeDasharray() {\n return (this.time / this.startTime) * this.circumference;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], Countdown.prototype, \"startTime\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], Countdown.prototype, \"time\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Countdown.prototype, \"theme\", void 0);\nCountdown = __decorate([\n (0, web_component_1.customElement)('kompis-countdown')\n], Countdown);\nexports.default = Countdown;\n//# sourceMappingURL=Countdown.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar CountdownBannerAnimationNameEnum;\n(function (CountdownBannerAnimationNameEnum) {\n CountdownBannerAnimationNameEnum[\"opening\"] = \"opening\";\n CountdownBannerAnimationNameEnum[\"closing\"] = \"closing\";\n CountdownBannerAnimationNameEnum[\"openingRtl\"] = \"openingRtl\";\n CountdownBannerAnimationNameEnum[\"closingRtl\"] = \"closingRtl\";\n})(CountdownBannerAnimationNameEnum || (CountdownBannerAnimationNameEnum = {}));\nexports.default = CountdownBannerAnimationNameEnum;\n//# sourceMappingURL=CountdownBannerAnimationNameEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst CountdownBannerAnimationNameEnum_1 = __importDefault(require(\"../../enums/CountdownBannerAnimationNameEnum\"));\nclass CountdownBannerStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.isVisible \"true\" if visible.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing, color, motion } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tposition: fixed;\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\tleft: 0;\n\t\t\t\tright: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\ttop: 0;\n\t\t\t\ttransition-duration: ${options.theme.motion.duration.medium};\n\t\t\t\ttransition-property: bottom, top;\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\n\t\t\t.container {\n\t\t\t\tmin-height: ${spacing.space750 / 16}rem;\n\t\t\t\tpointer-events: ${options.isAnimating ? 'none' : 'auto'};\n\t\t\t\toverflow: hidden;\n\t\t\t\tbackground-color: ${color.neutral.white};\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\tanimation-name: ${options.isVisible\n ? CountdownBannerAnimationNameEnum_1.default.opening\n : CountdownBannerAnimationNameEnum_1.default.closing};\n\t\t\t\tanimation-duration: ${options.isVisible ? motion.duration.medium : motion.duration.small};\n\t\t\t\tanimation-fill-mode: both;\n\t\t\t\tanimation-timing-function: ${options.isVisible ? motion.ease.enter : motion.ease.exit};\n\t\t\t}\n\n\t\t\t.countdownBannerHeader {\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\n\t\t\tkompis-sheet-backdrop {\n\t\t\t\tpointer-events: auto;\n\t\t\t}\n\n\t\t\tkompis-countdown {\n\t\t\t\tmargin-inline-end: ${spacing.space150 / 16}rem;\n\t\t\t}\n\n\t\t\t.countdownBannerGalleryButton {\n\t\t\t\tmargin-inline-end: ${spacing.space75 / 16}rem;\n\t\t\t}\n\n\t\t\t.rightContent {\n\t\t\t\tdisplay: flex;\n\t\t\t\tmargin-inline-start: auto;\n\t\t\t\talign-items: center;\n\t\t\t}\n\n\t\t\t.bannerContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tflex-grow: 1;\n\t\t\t\tpointer-events: ${options.isVisible ? 'auto' : 'none'};\n\t\t\t\tpadding-right: ${spacing.space400 / 16}rem;\n\t\t\t\tpadding-left: ${spacing.space400 / 16}rem;\n\t\t\t}\n\n\t\t\toverlayContainer {\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 80%;\n\t\t\t\topacity: 0.5;\n\t\t\t}\n\n\t\t\t@keyframes closing {\n\t\t\t\tfrom {\n\t\t\t\t\ttransform: translateY(0);\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\ttransform: translateY(-100%);\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes opening {\n\t\t\t\tfrom {\n\t\t\t\t\ttransform: translateY(-100%);\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\ttransform: translateY(0);\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = CountdownBannerStyle;\n//# sourceMappingURL=CountdownBannerStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@inter-ikea-kompis/component-sheet\");\nrequire(\"@ingka/button-webc\");\nrequire(\"../countdown/Countdown\");\nconst CountdownBannerAnimationNameEnum_1 = __importDefault(require(\"../../enums/CountdownBannerAnimationNameEnum\"));\nconst CountdownBannerStyle_1 = __importDefault(require(\"./CountdownBannerStyle\"));\n/**\n * Banner if user leave the screen idle for some time.\n *\n * @event close Triggered by user.\n * @event sessionClick When user clicks start new session.\n * @event timeEnd When the animation for circle tick ends.\n * @event timeChange When duration change.\n * @event animationEnd When the animation ends.\n */\nlet CountdownBanner = class CountdownBanner extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // Start value for countdown.\n this.startTime = 0;\n // Current value for countdown.\n this.time = 0;\n // Show or hide banner.\n this.visible = false;\n // Show or hide secondary button.\n this.showSecondaryButton = false;\n // Checks for animation open/close.\n this.isAnimating = false;\n }\n /**\n * @override\n */\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n return null;\n }\n if (!this.visible && !this.isAnimating) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t
    ${this.getBackdrop()} ${this.getContainer()}
    \n\t\t`;\n }\n /**\n * @param changedProperties Changed properties.\n */\n shouldUpdate(changedProperties) {\n if (typeof changedProperties.get('visible') === 'boolean' &&\n typeof this.visible === 'boolean') {\n this.isAnimating = true;\n }\n return true;\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n /**\n * @returns Template.\n */\n getBackdrop() {\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('close', { bubbles: true }))}\"\n\t\t\t\t.visible=\"${this.visible}\"\n\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t>\n\t\t`;\n }\n /**\n * @returns - Html.\n */\n getContainer() {\n const { countdownBannerHeader, buttonContinue } = this.getTranslations();\n const primaryVariant = 'primary';\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t\n\t\t\t\t\t\t\t${countdownBannerHeader}\n\t\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t this.dispatchEvent(new CustomEvent('timeEnd', { bubbles: true }))}\"\n\t\t\t\t\t\t\t@timeChange=\"${(event) => this.dispatchEvent(new CustomEvent('timeChange', { bubbles: true, detail: event.detail }))}\"\n\t\t\t\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t\t\t\t.startTime=\"${this.startTime}\"\n\t\t\t\t\t\t\t.time=\"${this.time}\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\n\t\t\t\t\t\t${this.getSessionButton()}\n\t\t\t\t\t\t this.dispatchEvent(new CustomEvent('close', { bubbles: true }))}\"\n\t\t\t\t\t\t\tclass=\"buttonContinue\"\n\t\t\t\t\t\t\tvariant=\"${primaryVariant}\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t${buttonContinue}\n\t\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t
    \n\t\t`;\n }\n /**\n * Returns session button if not mobile.\n */\n getSessionButton() {\n if (!this.showSecondaryButton) {\n return null;\n }\n const countdownBannerGalleryButton = this.getTranslations().countdownBannerGalleryButton;\n const secondaryVariant = 'secondary';\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('sessionClick', { bubbles: true }))}\"\n\t\t\t\tclass=\"countdownBannerGalleryButton\"\n\t\t\t\tvariant=\"${secondaryVariant}\"\n\t\t\t>\n\t\t\t\t${countdownBannerGalleryButton}\n\t\t\t\n\t\t`;\n }\n /**\n * Listener for animationend.\n *\n * @param event Html event.\n */\n onAnimationEnd(event) {\n this.isAnimating = false;\n if (event.animationName.startsWith(CountdownBannerAnimationNameEnum_1.default.closing)) {\n this.dispatchEvent(new CustomEvent('animationEnd', {\n bubbles: true,\n detail: {\n type: 'close'\n }\n }));\n }\n else if (event.animationName.startsWith(CountdownBannerAnimationNameEnum_1.default.opening)) {\n this.dispatchEvent(new CustomEvent('animationEnd', {\n bubbles: true,\n detail: {\n type: 'open'\n }\n }));\n }\n this.update();\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], CountdownBanner.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], CountdownBanner.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], CountdownBanner.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], CountdownBanner.prototype, \"startTime\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], CountdownBanner.prototype, \"time\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], CountdownBanner.prototype, \"visible\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], CountdownBanner.prototype, \"showSecondaryButton\", void 0);\nCountdownBanner = __decorate([\n (0, web_component_1.customElement)('kompis-countdown-banner')\n], CountdownBanner);\nexports.default = CountdownBanner;\n//# sourceMappingURL=CountdownBanner.js.map","import \"@inter-ikea-kompis/component-countdown-banner/lib/components/countdown-banner/CountdownBanner\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisCountdownBanner extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-countdown-banner\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.localizedInformation = props.localizedInformation;\n element.showSecondaryButton = props.showSecondaryButton;\n element.startTime = props.startTime;\n element.theme = props.theme;\n element.time = props.time;\n element.translations = props.translations;\n element.visible = props.visible;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onAnimationEnd, \"animationEnd\");\n this.updateEventListener(element, props.onClose, \"close\");\n this.updateEventListener(element, props.onSessionClick, \"sessionClick\");\n this.updateEventListener(element, props.onTimeChange, \"timeChange\");\n this.updateEventListener(element, props.onTimeEnd, \"timeEnd\");\n }\n}\nKompisCountdownBanner.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n showSecondaryButton: PropTypes.bool,\n startTime: PropTypes.number,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n time: PropTypes.number,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visible: PropTypes.bool,\n onClose: PropTypes.func,\n onSessionClick: PropTypes.func,\n onTimeEnd: PropTypes.func,\n onTimeChange: PropTypes.func,\n onAnimationEnd: PropTypes.func\n};\nexport default KompisCountdownBanner;\n","import \"@inter-ikea-kompis/component-countdown-banner/lib/components/countdown/Countdown\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisCountdown extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-countdown\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.startTime = props.startTime;\n element.theme = props.theme;\n element.time = props.time;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onTimeChange, \"timeChange\");\n this.updateEventListener(element, props.onTimeEnd, \"timeEnd\");\n }\n}\nKompisCountdown.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n startTime: PropTypes.number,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n time: PropTypes.number,\n onTimeEnd: PropTypes.func,\n onTimeChange: PropTypes.func\n};\nexport default KompisCountdown;\n","import \"@inter-ikea-kompis/component-divider/lib/components/divider/Divider\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisDivider extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-divider\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.theme = props.theme;\n element.type = props.type;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisDivider.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n type: PropTypes.string\n};\nexport default KompisDivider;\n","import \"@inter-ikea-kompis/component-do-not-diy/lib/components/do-not-diy/DoNotDiy\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisDoNotDiy extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-do-not-diy\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.product = props.product;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisDoNotDiy.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisDoNotDiy;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar DragAndDropAreaEventEnum;\n(function (DragAndDropAreaEventEnum) {\n DragAndDropAreaEventEnum[\"pointerMove\"] = \"pointerMove\";\n DragAndDropAreaEventEnum[\"pointerDown\"] = \"pointerDown\";\n DragAndDropAreaEventEnum[\"pointerUp\"] = \"pointerUp\";\n DragAndDropAreaEventEnum[\"enterDropArea\"] = \"enterDropArea\";\n DragAndDropAreaEventEnum[\"leaveDropArea\"] = \"leaveDropArea\";\n})(DragAndDropAreaEventEnum || (DragAndDropAreaEventEnum = {}));\nexports.default = DragAndDropAreaEventEnum;\n//# sourceMappingURL=DragAndDropAreaEventEnum.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst DragAndDropAreaEventEnum_1 = __importDefault(require(\"../../enums/DragAndDropAreaEventEnum\"));\n/**\n * Drag and Drop Area component.\n *\n * @event pointerMove Triggered when pointer is moving over the drop area.\n * @event pointerDown Triggered when pointer is down over the drop area.\n * @event pointerUp Triggered when pointer is up over the drop area.\n * @event enterDropArea Triggered when pointer has moved over the drop area.\n * @event leaveDropArea Triggered when pointer has left the drop area.\n */\nlet DragAndDropArea = class DragAndDropArea extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Set dragged state.\n this.disableInput = false;\n // Id\n this.areaId = null;\n this.resizeObserver = new ResizeObserver(this.onResize.bind(this));\n this.isOverDropAreaState = false;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * Triggered when the element is connected.\n */\n connectedCallback() {\n super.connectedCallback();\n this.getDropArea();\n // Observers\n this.resizeObserver.observe(this);\n // Move events\n this.addEventListener('mousemove', this.pointerMove.bind(this));\n this.addEventListener('touchmove', this.onTouchMove.bind(this));\n // Pointer down events\n this.addEventListener('mousedown', this.pointerDown.bind(this));\n this.addEventListener('touchstart', this.onTouchDown.bind(this));\n // Pointer up events\n this.addEventListener('mouseup', this.pointerUp.bind(this));\n this.addEventListener('touchend', this.onTouchUp.bind(this));\n }\n /**\n * Triggered when the component is removed from DOM.\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n // Observers\n this.resizeObserver.unobserve(this);\n // Move events\n this.removeEventListener('mousemove', this.pointerMove.bind(this));\n this.removeEventListener('touchmove', this.onTouchMove.bind(this));\n // Pointer down events\n this.removeEventListener('mousedown', this.pointerDown.bind(this));\n this.removeEventListener('touchstart', this.onTouchDown.bind(this));\n // Pointer up events\n this.removeEventListener('mouseup', this.pointerUp.bind(this));\n this.removeEventListener('touchend', this.onTouchUp.bind(this));\n }\n /**\n * Handle mousemove events.\n *\n * @param event PointerEvent.\n */\n pointerMove(event) {\n const position = { x: null, y: null };\n position.x = event.clientX;\n position.y = event.clientY;\n const isOverDropArea = this.isOverDropArea(position);\n if (!this.disableInput) {\n this.dispatchEvent(new CustomEvent(DragAndDropAreaEventEnum_1.default.pointerMove, {\n bubbles: true,\n detail: { position, isOverDropArea }\n }));\n }\n }\n /**\n * Handle touchmove events.\n *\n * @param event TouchEvent.\n */\n onTouchMove(event) {\n const position = { x: null, y: null };\n position.x = event.touches.length && event.touches[0].clientX;\n position.y = event.touches.length && event.touches[0].clientY;\n const isOverDropArea = this.isOverDropArea(position);\n if (!this.disableInput) {\n this.dispatchEvent(new CustomEvent(DragAndDropAreaEventEnum_1.default.pointerMove, {\n bubbles: true,\n detail: { position, isOverDropArea }\n }));\n }\n }\n /**\n * Handle mousedown events.\n *\n * @param e PointerEvent.\n * @param event\n */\n pointerDown(event) {\n const position = { x: null, y: null };\n position.x = event.clientX;\n position.y = event.clientY;\n if (!this.disableInput) {\n this.dispatchEvent(new CustomEvent(DragAndDropAreaEventEnum_1.default.pointerDown, {\n bubbles: true,\n detail: {\n position,\n isOverDropArea: this.isOverDropArea(position)\n }\n }));\n }\n }\n /**\n * Handle touchend events.\n *\n * @param event TouchEvent.\n */\n onTouchDown(event) {\n const position = { x: null, y: null };\n position.x = event.touches.length && event.touches[0].clientX;\n position.y = event.touches.length && event.touches[0].clientY;\n if (!this.disableInput) {\n this.dispatchEvent(new CustomEvent(DragAndDropAreaEventEnum_1.default.pointerDown, {\n bubbles: true,\n detail: {\n position,\n isOverDropArea: this.isOverDropArea(position)\n }\n }));\n }\n }\n /**\n * Handle mouseup events.\n *\n * @param event PointerEvent.\n */\n pointerUp(event) {\n const position = { x: null, y: null };\n position.x = event.clientX;\n position.y = event.clientY;\n if (!this.disableInput) {\n this.dispatchEvent(new CustomEvent(DragAndDropAreaEventEnum_1.default.pointerUp, {\n bubbles: true,\n detail: {\n position,\n isOverDropArea: this.isOverDropArea(position)\n }\n }));\n }\n }\n /**\n * Handle touchend events.\n *\n * @param event TouchEvent.\n */\n onTouchUp(event) {\n const position = { x: null, y: null };\n position.x = event.changedTouches.length && event.changedTouches[0].clientX;\n position.y = event.changedTouches.length && event.changedTouches[0].clientY;\n if (!this.disableInput) {\n this.dispatchEvent(new CustomEvent(DragAndDropAreaEventEnum_1.default.pointerUp, {\n bubbles: true,\n detail: {\n position,\n isOverDropArea: this.isOverDropArea(position)\n }\n }));\n }\n }\n /**\n * Recalculate area size and position on resize.\n */\n onResize() {\n var _a, _b;\n this.dropAreaRect = (_b = (_a = this.dropArea) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) !== null && _b !== void 0 ? _b : null;\n }\n /**\n * Get drop area.\n */\n getDropArea() {\n this.dropArea = this.querySelector('#' + this.areaId);\n }\n /**\n * @param position\n */\n checkIsOverDropArea(position) {\n if (!(position === null || position === void 0 ? void 0 : position.y) || !(position === null || position === void 0 ? void 0 : position.x) || !this.dropAreaRect) {\n return false;\n }\n return (position.y >= this.dropAreaRect.top - (window.scrollY || window.pageYOffset) &&\n position.y <= this.dropAreaRect.bottom - (window.scrollY || window.pageYOffset) &&\n position.x >= this.dropAreaRect.left &&\n position.x <= this.dropAreaRect.right);\n }\n /**\n * Checks if pointer is over drop area and emits events.\n *\n * @param position IPointerPosition.\n *\n * @returns Boolean.\n */\n isOverDropArea(position) {\n if (!this.dropAreaRect) {\n this.onResize();\n this.reconnectObserver();\n }\n if (this.checkIsOverDropArea(position)) {\n if (!this.isOverDropAreaState) {\n this.isOverDropAreaState = true;\n this.dispatchEvent(new CustomEvent(DragAndDropAreaEventEnum_1.default.enterDropArea, {\n bubbles: true,\n detail: { position }\n }));\n }\n return true;\n }\n else {\n if (this.isOverDropAreaState) {\n this.isOverDropAreaState = false;\n this.dispatchEvent(new CustomEvent(DragAndDropAreaEventEnum_1.default.leaveDropArea, {\n bubbles: true,\n detail: { position }\n }));\n }\n return false;\n }\n }\n /**\n * Reconnects resize observer.\n */\n reconnectObserver() {\n this.resizeObserver.unobserve(this);\n this.resizeObserver.observe(this);\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], DragAndDropArea.prototype, \"disableInput\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], DragAndDropArea.prototype, \"areaId\", void 0);\nDragAndDropArea = __decorate([\n (0, web_component_1.customElement)('kompis-drag-and-drop-area')\n], DragAndDropArea);\nexports.default = DragAndDropArea;\n//# sourceMappingURL=DragAndDropArea.js.map","import \"@inter-ikea-kompis/component-drag-and-drop/lib/components/drag-and-drop-area/DragAndDropArea\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisDragAndDropArea extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-drag-and-drop-area\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.areaId = props.areaId;\n element.disableInput = props.disableInput;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onEnterDropArea, \"enterDropArea\");\n this.updateEventListener(element, props.onLeaveDropArea, \"leaveDropArea\");\n this.updateEventListener(element, props.onPointerDown, \"pointerDown\");\n this.updateEventListener(element, props.onPointerMove, \"pointerMove\");\n this.updateEventListener(element, props.onPointerUp, \"pointerUp\");\n }\n}\nKompisDragAndDropArea.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n areaId: PropTypes.string,\n disableInput: PropTypes.bool,\n onPointerMove: PropTypes.func,\n onPointerDown: PropTypes.func,\n onPointerUp: PropTypes.func,\n onEnterDropArea: PropTypes.func,\n onLeaveDropArea: PropTypes.func\n};\nexport default KompisDragAndDropArea;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar DragAndDropItemEventEnum;\n(function (DragAndDropItemEventEnum) {\n DragAndDropItemEventEnum[\"dragItem\"] = \"dragItem\";\n DragAndDropItemEventEnum[\"invalidDrag\"] = \"invalidDrag\";\n DragAndDropItemEventEnum[\"ghostPositionUpdate\"] = \"ghostPositionUpdate\";\n})(DragAndDropItemEventEnum || (DragAndDropItemEventEnum = {}));\nexports.default = DragAndDropItemEventEnum;\n//# sourceMappingURL=DragAndDropItemEventEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar DragDirectionEnum;\n(function (DragDirectionEnum) {\n DragDirectionEnum[\"horizontal\"] = \"horizontal\";\n DragDirectionEnum[\"vertical\"] = \"vertical\";\n})(DragDirectionEnum || (DragDirectionEnum = {}));\nexports.default = DragDirectionEnum;\n//# sourceMappingURL=DragDirectionEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\n/**\n * A class with style.\n */\nclass DragAndDropItemStyle {\n /**\n * Returns styles.\n *\n * @returns Styles.\n */\n static getStyle() {\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t\t.ghost-container {\n\t\t\t\tposition: fixed;\n\t\t\t\ttransform: translate(-50%, -50%);\n\t\t\t}\n\t\t\t.item-container {\n\t\t\t\tposition: relative;\n\t\t\t\theight: 100%;\n\t\t\t}\n\t\t\t.drag-container {\n\t\t\t\tposition: relative;\n\t\t\t\ttop: -100vh;\n\t\t\t\tleft: -100vw;\n\t\t\t\theight: 200vh;\n\t\t\t\twidth: 200vw;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = DragAndDropItemStyle;\n//# sourceMappingURL=DragAndDropItemStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst DragAndDropItemEventEnum_1 = __importDefault(require(\"../../enums/DragAndDropItemEventEnum\"));\nconst DragDirectionEnum_1 = __importDefault(require(\"../../enums/DragDirectionEnum\"));\nconst DragAndDropItemStyle_1 = __importDefault(require(\"./DragAndDropItemStyle\"));\n/**\n * Drag and Drop Item component.\n *\n * @event dragItem Emits when dragging an item\n * @event invalidDrag Emits when an item couldn't be dragged to a position\n * @event ghostPositionUpdate Emits the updated position of the dragged item\n */\nlet DragAndDropItem = class DragAndDropItem extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // An object data to be transfered.\n this.data = null;\n // Set dragged state.\n this.isDragged = false;\n // Start drag on direction.\n this.dragDirection = DragDirectionEnum_1.default.horizontal;\n // Start drag on angle.\n this.dragAngleLimit = 50;\n // Start drag on offset.\n this.dragOffset = 40;\n /* eslint-enable @typescript-eslint/no-explicit-any */\n this.startPosition = null;\n this.listeners = {\n pointerUp: this.pointerUp.bind(this),\n pointerMove: this.pointerMove.bind(this),\n onTouchMove: this.onTouchMove.bind(this)\n };\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t this.onTouchDown(event)\n }}\"\n\t\t\t\t@mousedown=\"${{\n passive: false,\n handleEvent: (event) => this.pointerDown(event)\n }}\"\n\t\t\t>\n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t\n\t\t`;\n }\n /**\n * Triggered when the element is connected.\n */\n connectedCallback() {\n super.connectedCallback();\n // Pointer up events\n document.body.addEventListener('mouseup', this.listeners.pointerUp);\n document.body.addEventListener('touchend', this.listeners.pointerUp);\n // Move events\n document.body.addEventListener('mousemove', this.listeners.pointerMove);\n document.body.addEventListener('touchmove', this.listeners.onTouchMove);\n }\n /**\n * Triggered when the component is removed from DOM.\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n // Pointer up events\n document.body.removeEventListener('mouseup', this.listeners.pointerUp);\n document.body.removeEventListener('touchend', this.listeners.pointerUp);\n // Move events\n document.body.removeEventListener('mousemove', this.listeners.pointerMove);\n document.body.removeEventListener('touchmove', this.listeners.onTouchMove);\n }\n /**\n * Handles pointer down event.\n *\n * @param event MouseEvent.\n */\n pointerDown(event) {\n event.preventDefault();\n const position = { x: null, y: null };\n position.x = event.clientX;\n position.y = event.clientY;\n this.startPosition = position;\n this.update();\n }\n /**\n * Handles touch down event.\n *\n * @param event TouchEvent.\n */\n onTouchDown(event) {\n event.preventDefault();\n const position = { x: null, y: null };\n position.x = event.touches[0].clientX;\n position.y = event.touches[0].clientY;\n this.startPosition = position;\n this.update();\n }\n /**\n * Handles pointer move event and emits event if item was dragged.\n *\n * @param event MouseEvent.\n */\n pointerMove(event) {\n const position = { x: null, y: null };\n position.x = event.clientX;\n position.y = event.clientY;\n this.drag(position);\n if (this.isDragged) {\n this.update();\n return;\n }\n }\n /**\n * Handles touch move event and enits event if item was dragged.\n *\n * @param event TouchEvent.\n */\n onTouchMove(event) {\n const position = { x: null, y: null };\n position.x = event.touches[0].clientX;\n position.y = event.touches[0].clientY;\n this.drag(position);\n if (this.isDragged) {\n this.update();\n return;\n }\n }\n /**\n * Checks if the item can be dragged and emits an event.\n *\n * @param position PointerPosition.\n */\n drag(position) {\n var _a, _b;\n if (this.isDragged) {\n this.dispatchEvent(new CustomEvent(DragAndDropItemEventEnum_1.default.ghostPositionUpdate, {\n bubbles: true,\n detail: { position: position }\n }));\n }\n if (position.x && position.y && ((_a = this.startPosition) === null || _a === void 0 ? void 0 : _a.x) && ((_b = this.startPosition) === null || _b === void 0 ? void 0 : _b.y)) {\n const moveOffset = Math.hypot(Math.abs(position.x - this.startPosition.x), Math.abs(position.y - this.startPosition.y));\n if (moveOffset >= this.dragOffset) {\n const angle = this.getAngle(this.startPosition, position);\n if (this.isDragAngle(angle)) {\n this.dispatchEvent(new CustomEvent(DragAndDropItemEventEnum_1.default.dragItem, {\n bubbles: true,\n detail: {\n data: this.data,\n position: position\n }\n }));\n }\n else {\n this.dispatchEvent(new Event(DragAndDropItemEventEnum_1.default.invalidDrag, { bubbles: true }));\n this.update();\n }\n this.startPosition = null;\n }\n }\n }\n /**\n * Handles pointer up event.\n */\n pointerUp() {\n this.startPosition = null;\n }\n /**\n * Calculates angle between 2 points.\n *\n * @param p1 PointerPosition.\n * @param p2 PointerPosition.\n * @returns Number.\n *\n */\n getAngle(p1, p2) {\n if (p1.x !== null && p1.y !== null && p2.x !== null && p2.y !== null) {\n return (Math.atan2(Math.abs(p2.y - p1.y), Math.abs(p2.x - p1.x)) * 180) / Math.PI;\n }\n throw new Error(\"Can't create angle without PointerPosition\");\n }\n /**\n * Returns true if angle is within drag angle limit.\n *\n * @param angle Number.\n * @returns Boolean.\n *\n */\n isDragAngle(angle) {\n if (this.dragDirection == DragDirectionEnum_1.default.horizontal) {\n return angle >= this.dragAngleLimit;\n }\n else {\n return angle <= this.dragAngleLimit;\n }\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], DragAndDropItem.prototype, \"data\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], DragAndDropItem.prototype, \"isDragged\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], DragAndDropItem.prototype, \"dragDirection\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], DragAndDropItem.prototype, \"dragAngleLimit\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], DragAndDropItem.prototype, \"dragOffset\", void 0);\nDragAndDropItem = __decorate([\n (0, web_component_1.customElement)('kompis-drag-and-drop-item')\n], DragAndDropItem);\nexports.default = DragAndDropItem;\n//# sourceMappingURL=DragAndDropItem.js.map","import \"@inter-ikea-kompis/component-drag-and-drop/lib/components/drag-and-drop-item/DragAndDropItem\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisDragAndDropItem extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-drag-and-drop-item\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.data = props.data;\n element.dragAngleLimit = props.dragAngleLimit;\n element.dragDirection = props.dragDirection;\n element.dragOffset = props.dragOffset;\n element.isDragged = props.isDragged;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onDragItem, \"dragItem\");\n this.updateEventListener(element, props.onGhostPositionUpdate, \"ghostPositionUpdate\");\n this.updateEventListener(element, props.onInvalidDrag, \"invalidDrag\");\n }\n}\nKompisDragAndDropItem.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n data: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n dragAngleLimit: PropTypes.number,\n dragDirection: PropTypes.string,\n dragOffset: PropTypes.number,\n isDragged: PropTypes.bool,\n onDragItem: PropTypes.func,\n onInvalidDrag: PropTypes.func,\n onGhostPositionUpdate: PropTypes.func\n};\nexport default KompisDragAndDropItem;\n","import \"@inter-ikea-kompis/component-eco-fee/lib/components/eco-fee-card/EcoFeeCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisEcoFeeCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-eco-fee-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.disableLinks = props.disableLinks;\n element.localizedInformation = props.localizedInformation;\n element.settings = props.settings;\n element.theme = props.theme;\n element.totalPrice = props.totalPrice;\n element.translations = props.translations;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisEcoFeeCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n disableLinks: PropTypes.bool,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n totalPrice: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object])\n};\nexport default KompisEcoFeeCard;\n","import \"@inter-ikea-kompis/component-eco-fee/lib/components/eco-fee/EcoFee\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisEcoFee extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-eco-fee\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.disableLinks = props.disableLinks;\n element.localizedInformation = props.localizedInformation;\n element.settings = props.settings;\n element.theme = props.theme;\n element.totalPrice = props.totalPrice;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n }\n}\nKompisEcoFee.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n disableLinks: PropTypes.bool,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n totalPrice: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n onModalOpen: PropTypes.func,\n onModalClose: PropTypes.func\n};\nexport default KompisEcoFee;\n","import \"@inter-ikea-kompis/component-energy-efficiency-class/lib/components/energy-efficiency-class/EnergyEfficiencyClass\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisEnergyEfficiencyClass extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-energy-efficiency-class\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.disableLinks = props.disableLinks;\n element.localizedInformation = props.localizedInformation;\n element.product = props.product;\n element.settings = props.settings;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n }\n}\nKompisEnergyEfficiencyClass.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n disableLinks: PropTypes.bool,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n onModalOpen: PropTypes.func,\n onModalClose: PropTypes.func\n};\nexport default KompisEnergyEfficiencyClass;\n","import \"@inter-ikea-kompis/component-energy-efficiency-class/lib/components/energy-efficiency-non-rescaled/EnergyEfficiencyNonRescaled\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisEnergyEfficiencyNonRescaled extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-energy-efficiency-non-rescaled\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.product = props.product;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisEnergyEfficiencyNonRescaled.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisEnergyEfficiencyNonRescaled;\n","import \"@inter-ikea-kompis/component-energy-efficiency-class/lib/components/energy-fiche-card/EnergyFicheCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisEnergyFicheCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-energy-fiche-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.disableLinks = props.disableLinks;\n element.product = props.product;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisEnergyFicheCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n disableLinks: PropTypes.bool,\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisEnergyFicheCard;\n","import \"@inter-ikea-kompis/component-energy-efficiency-class/lib/components/energy-label-card/EnergyLabelCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisEnergyLabelCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-energy-label-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.disableLinks = props.disableLinks;\n element.labelFilter = props.labelFilter;\n element.localizedInformation = props.localizedInformation;\n element.product = props.product;\n element.theme = props.theme;\n element.translations = props.translations;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisEnergyLabelCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n disableLinks: PropTypes.bool,\n labelFilter: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object])\n};\nexport default KompisEnergyLabelCard;\n","import \"@inter-ikea-kompis/component-energy-efficiency-class/lib/components/eprel-link/EprelLink\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisEprelLink extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-eprel-link\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.disableLinks = props.disableLinks;\n element.localizedInformation = props.localizedInformation;\n element.product = props.product;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n }\n}\nKompisEprelLink.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n disableLinks: PropTypes.bool,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n onModalOpen: PropTypes.func,\n onModalClose: PropTypes.func\n};\nexport default KompisEprelLink;\n","import \"@inter-ikea-kompis/component-energy-efficiency-class/lib/components/eprel-qr-toggle/EprelQrToggle\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisEprelQrToggle extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-eprel-qr-toggle\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.expanded = props.expanded;\n element.localizedInformation = props.localizedInformation;\n element.product = props.product;\n element.theme = props.theme;\n element.translations = props.translations;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onAnimationEnd, \"animationEnd\");\n this.updateEventListener(element, props.onExpand, \"expand\");\n }\n}\nKompisEprelQrToggle.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n expanded: PropTypes.bool,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n onExpand: PropTypes.func,\n onAnimationEnd: PropTypes.func\n};\nexport default KompisEprelQrToggle;\n","import \"@inter-ikea-kompis/component-energy-efficiency-class/lib/components/eprel-qr/EprelQr\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisEprelQr extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-eprel-qr\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.localizedInformation = props.localizedInformation;\n element.product = props.product;\n element.theme = props.theme;\n element.translations = props.translations;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisEprelQr.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object])\n};\nexport default KompisEprelQr;\n","import \"@inter-ikea-kompis/component-energy-efficiency-class/lib/components/sec-link/SecLink\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSecLink extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-sec-link\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.disableLinks = props.disableLinks;\n element.localizedInformation = props.localizedInformation;\n element.product = props.product;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n }\n}\nKompisSecLink.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n disableLinks: PropTypes.bool,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n onModalOpen: PropTypes.func,\n onModalClose: PropTypes.func\n};\nexport default KompisSecLink;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\n/**\n * A class with style.\n */\nclass FakeDataStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t.container {\n\t\t\t\tmax-width: ${450 / 16}rem;\n\t\t\t}\n\t\t\t.searchWrapper {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t}\n\t\t\t.getProductButton {\n\t\t\t\tmargin-left: ${spacing.space50 / 16}rem;\n\t\t\t}\n\t\t\t.checkboxes,\n\t\t\t.invalidateButton,\n\t\t\t.applyButton,\n\t\t\t.changedProducts,\n\t\t\t.dateInputs,\n\t\t\t.priceInputs {\n\t\t\t\tmargin-top: ${spacing.space75 / 16}rem;\n\t\t\t}\n\t\t\t.loadButton {\n\t\t\t\tmargin-top: ${spacing.space200 / 16}rem;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = FakeDataStyle;\n//# sourceMappingURL=FakeDataStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@inter-ikea-kompis/component-input\");\nrequire(\"@inter-ikea-kompis/component-checkbox\");\nrequire(\"@ingka/button-webc\");\nconst FakeDataStyle_1 = __importDefault(require(\"./FakeDataStyle\"));\n/**\n * Fake Data component.\n *\n * @event applyChanges Emitted when applying the product data changes\n */\nlet FakeData = class FakeData extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // List of products.\n this.products = null;\n this.showError = false;\n this.useFamilyPrice = false;\n this.useTROPrice = false;\n this.isOnlineSellable = true;\n this.productIdsInput = null;\n this.fromDateInput = null;\n this.toDateInput = null;\n this.specialPriceInput = null;\n this.regularPriceInput = null;\n this.changedProducts = [];\n this.selectedProduct = null;\n this.changedProductsText = '';\n this.dateInputRegex = /^[0-9)(-]+$/;\n this.priceInputRegex = /^[0-9)(.]+$/;\n }\n /**\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t${this.getSearch()} ${this.getInvalidateButton()} ${this.getCheckboxes()}\n\t\t\t\t${this.getDateInputs()} ${this.getPriceInputs()} ${this.getApplyButton()}\n\t\t\t\t${this.getChangedProductsText()} ${this.getLoadButton()}\n\t\t\t
    \n\t\t`;\n }\n /**\n * Get HTML for search input and button.\n *\n * @returns Template.\n */\n getSearch() {\n const emphasisedVariant = 'emphasised';\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tGet product\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * Get HTML for invalidate button.\n *\n * @returns Template.\n */\n getInvalidateButton() {\n const emphasisedVariant = 'emphasised';\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\tInvalidate product\n\t\t\t\n\t\t`;\n }\n /**\n * Get HTML for checkboxes.\n *\n * @returns Template.\n */\n getCheckboxes() {\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * Get HTML for date inputs.\n *\n * @returns Template.\n */\n getDateInputs() {\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * Get HTML for price inputs.\n *\n * @returns Template.\n */\n getPriceInputs() {\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * Get HTML for apply changes button.\n *\n * @returns Template.\n */\n getApplyButton() {\n const emphasisedVariant = 'emphasised';\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\tApply changes for product\n\t\t\t\n\t\t`;\n }\n /**\n * Get HTML for changed products text.\n *\n * @returns Template.\n */\n getChangedProductsText() {\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\tChanged items:\n\t\t\t\t${this.changedProductsText}\n\t\t\t
    \n\t\t`;\n }\n /**\n * Get HTML load fake data button.\n *\n * @returns Template.\n */\n getLoadButton() {\n const emphasisedVariant = 'emphasised';\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\tLoad fake data\n\t\t\t\n\t\t`;\n }\n /**\n * Handle input event from the Input component.\n *\n * @param event Event.\n */\n onInput(event) {\n this.productIdsInput = event.detail.value.substring(0, 8);\n this.requestUpdate();\n }\n /**\n * Handle input focus event from the Input component.\n *\n */\n onInputFocus() {\n this.showError = false;\n this.requestUpdate();\n }\n /**\n * Handle date from input event.\n *\n * @param event Event.\n */\n onDateFromInput(event) {\n if (this.dateInputRegex.test(event.detail.value) || event.detail.value === '') {\n this.fromDateInput = event.detail.value.substring(0, 10);\n this.requestUpdate();\n }\n }\n /**\n * Handle date to input event.\n *\n * @param event Event.\n */\n onDateToInput(event) {\n if (this.dateInputRegex.test(event.detail.value) || event.detail.value === '') {\n this.toDateInput = event.detail.value.substring(0, 10);\n this.requestUpdate();\n }\n }\n /**\n * Handle special price input event.\n *\n * @param event Event.\n */\n onSpecialPriceInput(event) {\n if (this.priceInputRegex.test(event.detail.value) || event.detail.value === '') {\n this.specialPriceInput = event.detail.value;\n this.requestUpdate();\n }\n }\n /**\n * Handle regular price input event.\n *\n * @param event Event.\n */\n onRegularPriceInput(event) {\n if (this.priceInputRegex.test(event.detail.value) || event.detail.value === '') {\n this.regularPriceInput = event.detail.value;\n this.requestUpdate();\n }\n }\n /**\n * Handle change family price checkbox value.\n *\n */\n onChangeFamilyPrice() {\n this.useFamilyPrice = !this.useFamilyPrice;\n this.requestUpdate();\n }\n /**\n * Handle change family price checkbox value.\n *\n */\n onChangeTROPrice() {\n this.useTROPrice = !this.useTROPrice;\n this.requestUpdate();\n }\n /**\n * Handle change online sellable checkbox value.\n *\n */\n onChangeIsOnlineSellable() {\n this.isOnlineSellable = !this.isOnlineSellable;\n this.requestUpdate();\n }\n /**\n * Handle get product button click.\n */\n onGetProductButtonClick() {\n const productItem = this.products.find((product) => {\n return (product.content &&\n (product.content.itemNoGlobal === this.productIdsInput ||\n product.content.itemNoLocal === this.productIdsInput));\n });\n if (productItem) {\n this.selectedProduct = productItem;\n }\n else {\n this.showError = true;\n }\n this.requestUpdate();\n }\n /**\n * Handle invalidate product button click.\n */\n onInvalidateProductButtonClick() {\n const changedProduct = this.selectedProduct;\n changedProduct.valid = false;\n changedProduct.reason = [\n {\n code: enums_1.InvalidProductReasonEnum.retailItemNotAvailable,\n message: 'This item is not available'\n }\n ];\n this.changedProducts.push(changedProduct);\n this.setChangedProductsText();\n this.resetValues();\n this.requestUpdate();\n }\n /**\n * Handle apply changes button click.\n */\n onApplyChangesButtonClick() {\n let changedProduct = this.selectedProduct;\n if (changedProduct === null || changedProduct === void 0 ? void 0 : changedProduct.content) {\n changedProduct.content.priceInformation.availableForClickCollect = this.isOnlineSellable;\n changedProduct.content.priceInformation.availableForHomeDelivery = this.isOnlineSellable;\n if (this.useFamilyPrice && this.specialPriceInput !== '') {\n changedProduct = this.addFamilyPrice(changedProduct);\n }\n else if (this.useTROPrice &&\n this.fromDateInput &&\n this.toDateInput &&\n this.specialPriceInput !== '') {\n changedProduct = this.addTROPrice(changedProduct);\n }\n this.changedProducts.push(changedProduct);\n this.setChangedProductsText();\n this.resetValues();\n this.requestUpdate();\n }\n }\n /**\n * Adds family price to product.\n *\n */\n setChangedProductsText() {\n this.changedProductsText = '';\n this.changedProducts.forEach((changedProduct, index) => {\n if (changedProduct.content) {\n const productItemNo = changedProduct.content.itemNoGlobal || changedProduct.content.itemNoLocal;\n this.changedProductsText += productItemNo;\n if (index !== this.changedProducts.length - 1) {\n this.changedProductsText += ', ';\n }\n }\n });\n }\n /**\n * Adds family price to product.\n *\n * @param changedProduct Product to add family price for.\n * @returns The changed product with family price.\n */\n addFamilyPrice(changedProduct) {\n let changedPriceWithFamilyPrice = changedProduct;\n if (!changedProduct.content.priceInformation['familyPrice']) {\n const shouldUseTRO = this.useTROPrice && this.fromDateInput && this.toDateInput ? true : false;\n const familyPrice = {\n currencyCode: changedProduct.content.priceInformation['price']\n ? changedProduct.content.priceInformation['price'].currencyCode\n : changedProduct.content.priceInformation.salesPrice[0].currencyCode,\n priceExclTax: Number(this.specialPriceInput) - 2,\n priceInclTax: Number(this.specialPriceInput),\n indicativeTotalTax: Number(this.specialPriceInput) + 2,\n previousSalesPrice: {\n priceInclTax: Number(this.specialPriceInput),\n priceExclTax: Number(this.specialPriceInput) - 2,\n indicativeTotalTax: Number(this.specialPriceInput) + 2\n },\n typeCode: 'IKEAFamilySalesUnitPrice',\n validFromText: this.fromDateInput || null,\n validToText: this.toDateInput || null,\n changeReason: shouldUseTRO ? 'Temporary' : 'family',\n validToDateTime: null,\n validFromDateTime: null\n };\n changedPriceWithFamilyPrice.content.priceInformation['familyPrice'] = familyPrice;\n changedPriceWithFamilyPrice.content.priceInformation.salesPrice.push(familyPrice);\n if (shouldUseTRO) {\n changedPriceWithFamilyPrice.content.priceInformation['temporaryFamilyPrice'] = true;\n }\n }\n else {\n changedPriceWithFamilyPrice.content.priceInformation['familyPrice']['priceInclTax'] = Number(this.specialPriceInput);\n const familySalesPriceIndex = changedProduct.content.priceInformation.salesPrice.indexOf(changedProduct.content.priceInformation.salesPrice.find((priceObject) => {\n return priceObject.typeCode === 'IKEAFamilySalesUnitPrice';\n }));\n changedPriceWithFamilyPrice.content.priceInformation.salesPrice[familySalesPriceIndex]['priceInclTax'] = Number(this.specialPriceInput);\n }\n changedPriceWithFamilyPrice = this.addRegularPrice(changedProduct);\n return changedPriceWithFamilyPrice;\n }\n /**\n * Adds TRO (Time Restricted Offer) price to product.\n *\n * @param changedProduct Product to add TRO price for.\n * @returns The changed product with TRO price.\n */\n addTROPrice(changedProduct) {\n let changedPriceWithTROPrice = changedProduct;\n changedPriceWithTROPrice.content.priceInformation['timeRestrictedOffer'] = true;\n const temporarySalesPriceIndex = changedProduct.content.priceInformation.salesPrice.indexOf(changedProduct.content.priceInformation.salesPrice.find((priceObject) => {\n return priceObject.typeCode === 'TimeRestrictedOffer';\n }));\n const temporaryPrice = {\n currencyCode: changedProduct.content.priceInformation['price']\n ? changedProduct.content.priceInformation['price'].currencyCode\n : changedProduct.content.priceInformation.salesPrice[0].currencyCode,\n priceExclTax: Number(this.specialPriceInput) - 2,\n priceInclTax: Number(this.specialPriceInput),\n indicativeTotalTax: Number(this.specialPriceInput) + 2,\n previousSalesPrice: {\n priceInclTax: Number(this.regularPriceInput),\n priceExclTax: Number(this.regularPriceInput) - 2,\n indicativeTotalTax: Number(this.regularPriceInput) + 2\n },\n typeCode: 'TimeRestrictedOffer',\n validFromText: this.fromDateInput,\n validToText: this.toDateInput,\n changeReason: 'TimeRestrictedOffer',\n validToDateTime: null,\n validFromDateTime: null\n };\n changedPriceWithTROPrice.content.priceInformation['price'] = temporaryPrice;\n if (temporarySalesPriceIndex > -1) {\n changedPriceWithTROPrice.content.priceInformation.salesPrice[temporarySalesPriceIndex] =\n temporaryPrice;\n }\n else {\n changedPriceWithTROPrice.content.priceInformation.salesPrice.push(temporaryPrice);\n }\n changedPriceWithTROPrice = this.addRegularPrice(changedProduct);\n return changedPriceWithTROPrice;\n }\n /**\n * Adds regular price to product.\n *\n * @param changedProduct Product to add regular price for.\n * @returns The changed product with regular price.\n */\n addRegularPrice(changedProduct) {\n const changedPriceWithRegularPrice = changedProduct;\n if (this.regularPriceInput !== '') {\n const regularPrice = {\n typeCode: 'RegularSalesUnitPrice',\n priceExclTax: Number(this.regularPriceInput) - 2,\n priceInclTax: Number(this.regularPriceInput),\n indicativeTotalTax: Number(this.specialPriceInput) + 2,\n previousSalesPrice: {\n priceInclTax: Number(this.specialPriceInput),\n priceExclTax: Number(this.specialPriceInput) - 2,\n indicativeTotalTax: Number(this.specialPriceInput) + 2\n },\n changeReason: 'regular',\n validToDateTime: null,\n validFromDateTime: null,\n validFromText: null,\n validToText: null,\n currencyCode: changedProduct.content.priceInformation['price']\n ? changedProduct.content.priceInformation['price'].currencyCode\n : changedProduct.content.priceInformation.salesPrice[0].currencyCode\n };\n const regularSalesPriceIndex = changedProduct.content.priceInformation.salesPrice.indexOf(changedProduct.content.priceInformation.salesPrice.find((priceObject) => {\n return priceObject.typeCode === 'RegularSalesUnitPrice';\n }));\n changedPriceWithRegularPrice.content.priceInformation['regularPrice'] = regularPrice;\n changedPriceWithRegularPrice.content.priceInformation.salesPrice[regularSalesPriceIndex] =\n regularPrice;\n if (changedProduct.content.priceInformation['price'] &&\n changedProduct.content.priceInformation['price'].typeCode === 'RegularSalesUnitPrice') {\n changedPriceWithRegularPrice.content.priceInformation['price'] = regularPrice;\n }\n }\n return changedPriceWithRegularPrice;\n }\n /**\n * Handle load fake data button click.\n */\n onLoadButtonClick() {\n const updatedProducts = this.products.map((product) => {\n if (this.changedProducts.includes(product)) {\n const index = this.changedProducts.indexOf(product);\n return this.changedProducts[index];\n }\n return product;\n });\n this.dispatchEvent(new CustomEvent('applyChanges', {\n bubbles: true,\n detail: {\n updatedProducts: updatedProducts\n }\n }));\n }\n /**\n * Resets all values set for a product.\n */\n resetValues() {\n this.selectedProduct = null;\n this.isOnlineSellable = true;\n this.useFamilyPrice = false;\n this.useTROPrice = false;\n this.productIdsInput = '';\n this.specialPriceInput = '';\n this.regularPriceInput = '';\n this.fromDateInput = '';\n this.toDateInput = '';\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], FakeData.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], FakeData.prototype, \"products\", void 0);\nFakeData = __decorate([\n (0, web_component_1.customElement)('kompis-fake-data')\n], FakeData);\nexports.default = FakeData;\n//# sourceMappingURL=FakeData.js.map","import \"@inter-ikea-kompis/component-fake-data/lib/components/fake-data/FakeData\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisFakeData extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-fake-data\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.products = props.products;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onApplyChanges, \"applyChanges\");\n }\n}\nKompisFakeData.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n products: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n onApplyChanges: PropTypes.func\n};\nexport default KompisFakeData;\n","import \"@inter-ikea-kompis/component-financial-services/lib/components/financial-services-buttons/FinancialServicesButtons\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisFinancialServicesButtons extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-financial-services-buttons\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.disableLinks = props.disableLinks;\n element.financingOption = props.financingOption;\n element.localizedInformation = props.localizedInformation;\n element.theme = props.theme;\n element.translations = props.translations;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onContinueButtonClick, \"continueButtonClick\");\n this.updateEventListener(element, props.onMoreInfoClick, \"moreInfoClick\");\n }\n}\nKompisFinancialServicesButtons.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n disableLinks: PropTypes.bool,\n financingOption: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n onContinueButtonClick: PropTypes.func,\n onMoreInfoClick: PropTypes.func\n};\nexport default KompisFinancialServicesButtons;\n","import \"@inter-ikea-kompis/component-financial-services/lib/components/financial-services-card/FinancialServicesCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisFinancialServicesCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-financial-services-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.financingOption = props.financingOption;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisFinancialServicesCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n financingOption: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisFinancialServicesCard;\n","import \"@inter-ikea-kompis/component-financial-services/lib/components/financial-services-link/FinancialServicesLink\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisFinancialServicesLink extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-financial-services-link\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.disableLinks = props.disableLinks;\n element.financingOption = props.financingOption;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onLinkClick, \"linkClick\");\n }\n}\nKompisFinancialServicesLink.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n disableLinks: PropTypes.bool,\n financingOption: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n onLinkClick: PropTypes.func\n};\nexport default KompisFinancialServicesLink;\n","import \"@inter-ikea-kompis/component-financial-services/lib/components/financial-services/FinancialServices\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisFinancialServices extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-financial-services\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.analytics = props.analytics;\n element.disableLinks = props.disableLinks;\n element.financingOption = props.financingOption;\n element.localizedInformation = props.localizedInformation;\n element.settings = props.settings;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onContinueButtonClick, \"continueButtonClick\");\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n this.updateEventListener(element, props.onMoreInfoClick, \"moreInfoClick\");\n }\n}\nKompisFinancialServices.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n analytics: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n disableLinks: PropTypes.bool,\n financingOption: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n onModalClose: PropTypes.func,\n onModalOpen: PropTypes.func,\n onContinueButtonClick: PropTypes.func,\n onMoreInfoClick: PropTypes.func\n};\nexport default KompisFinancialServices;\n","import \"@inter-ikea-kompis/component-focus-outline/lib/components/focus-outline/FocusOutline\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisFocusOutline extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-focus-outline\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.focused = props.focused;\n element.invertedColors = props.invertedColors;\n element.positionWatcher = props.positionWatcher;\n element.theme = props.theme;\n element.type = props.type;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisFocusOutline.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n focused: PropTypes.bool,\n invertedColors: PropTypes.bool,\n positionWatcher: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n type: PropTypes.string\n};\nexport default KompisFocusOutline;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar FunctionIconEnum;\n(function (FunctionIconEnum) {\n FunctionIconEnum[\"small\"] = \"small\";\n FunctionIconEnum[\"medium\"] = \"medium\";\n})(FunctionIconEnum || (FunctionIconEnum = {}));\nexports.default = FunctionIconEnum;\n//# sourceMappingURL=FunctionIconEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst component_icon_1 = require(\"@inter-ikea-kompis/component-icon\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nconst FunctionIconEnum_1 = __importDefault(require(\"../../enums/FunctionIconEnum\"));\nconst OUTLINE_SIZE = {\n small: 40,\n medium: 48\n};\nconst ICON_SIZE = {\n small: 24,\n medium: 32\n};\n/**\n * IconButton Style.\n */\nclass FunctionIconStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @returns Styles.\n */\n static getStyle(options) {\n const { color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\t\t\t:host {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tposition: relative;\n\t\t\t}\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\t\t\t\talign-items: center;\n\t\t\t\tbackground: ${color.neutral.grey200};\n\t\t\t\tborder-radius: 50%;\n\t\t\t\twidth: ${this.getOutlineSize(options.size)};\n\t\t\t\theight: ${this.getOutlineSize(options.size)};\n\t\t\t}\n\t\t\t${this.getIconStyle(options)}\n\t\t`;\n }\n /**\n * Returns icon container size.\n *\n * @param size\n */\n static getOutlineSize(size) {\n if (size === FunctionIconEnum_1.default.small) {\n return `${OUTLINE_SIZE.small / 16}rem`;\n }\n return `${OUTLINE_SIZE.medium / 16}rem`;\n }\n /**\n * Returns icon style.\n *\n * @param options\n */\n static getIconStyle(options) {\n const { size, icon } = options;\n if (!icon) {\n return '';\n }\n const { width, height } = size === FunctionIconEnum_1.default.small\n ? component_icon_1.IconSizeCalculator.getMeasuredSize(icon, ICON_SIZE.small)\n : component_icon_1.IconSizeCalculator.getMeasuredSize(icon, ICON_SIZE.medium);\n return (0, web_component_1.css) `\n\t\t\tsvg {\n\t\t\t\twidth: ${component_icon_1.IconSizeCalculator.round(width / 16)}rem;\n\t\t\t\theight: ${component_icon_1.IconSizeCalculator.round(height / 16)}rem;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = FunctionIconStyle;\n//# sourceMappingURL=FunctionIconStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nrequire(\"@ingka/tooltip-webc\");\nconst FunctionIconEnum_1 = __importDefault(require(\"../../enums/FunctionIconEnum\"));\nconst FunctionIconStyle_1 = __importDefault(require(\"./FunctionIconStyle\"));\n/**\n * Function Icon component.\n */\nlet FunctionIcon = class FunctionIcon extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Icon\n this.icon = null;\n // Label\n this.label = null;\n // If you use 24x24 use small, if using 32x32 use medium.\n this.size = FunctionIconEnum_1.default.small;\n }\n /**\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getTemplate()}\n\t\t`;\n }\n /**\n * Returns icon.\n *\n * @returns Template.\n */\n getTemplate() {\n if (!this.label) {\n return (0, web_component_1.html) `
    ${this.getIcon()}
    `;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t
    ${this.getIcon()}
    \n\t\t\t\t${this.label}\n\t\t\t
    \n\t\t`;\n }\n /**\n * Returns icon.\n *\n * @returns Template.\n */\n getIcon() {\n if (!this.icon) {\n return null;\n }\n const svg = document.createElement('svg-icon');\n const endOfSvgTag = this.icon.indexOf('>');\n if (this.label) {\n const roleAttribute = `role=\"img\"`;\n const titleElement = `${this.label}`;\n svg.innerHTML =\n this.icon.slice(0, endOfSvgTag) +\n roleAttribute +\n this.icon.slice(endOfSvgTag, endOfSvgTag + 1) +\n titleElement +\n this.icon.slice(endOfSvgTag + 1);\n }\n else {\n svg.innerHTML =\n this.icon.slice(0, endOfSvgTag) + `aria-hidden=true` + this.icon.slice(endOfSvgTag);\n }\n return svg.firstChild;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], FunctionIcon.prototype, \"icon\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], FunctionIcon.prototype, \"label\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], FunctionIcon.prototype, \"size\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], FunctionIcon.prototype, \"theme\", void 0);\nFunctionIcon = __decorate([\n (0, web_component_1.customElement)('kompis-function-icon')\n], FunctionIcon);\nexports.default = FunctionIcon;\n//# sourceMappingURL=FunctionIcon.js.map","import \"@inter-ikea-kompis/component-function-icon/lib/components/function-icon/FunctionIcon\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisFunctionIcon extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-function-icon\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.icon = props.icon;\n element.label = props.label;\n element.size = props.size;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisFunctionIcon.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n icon: PropTypes.string,\n label: PropTypes.string,\n size: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisFunctionIcon;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar HomeDeliveryAvailabilityEnum;\n(function (HomeDeliveryAvailabilityEnum) {\n HomeDeliveryAvailabilityEnum[\"available\"] = \"available\";\n HomeDeliveryAvailabilityEnum[\"unavailable\"] = \"unavailable\";\n HomeDeliveryAvailabilityEnum[\"notInRange\"] = \"notInRange\";\n HomeDeliveryAvailabilityEnum[\"notSoldTemp\"] = \"notSoldTemp\";\n HomeDeliveryAvailabilityEnum[\"mixed\"] = \"mixed\";\n})(HomeDeliveryAvailabilityEnum || (HomeDeliveryAvailabilityEnum = {}));\nexports.default = HomeDeliveryAvailabilityEnum;\n//# sourceMappingURL=HomeDeliveryAvailabilityEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar HomeDeliveryStateEnum;\n(function (HomeDeliveryStateEnum) {\n HomeDeliveryStateEnum[\"default\"] = \"default\";\n HomeDeliveryStateEnum[\"loading\"] = \"loading\";\n HomeDeliveryStateEnum[\"invalidInput\"] = \"invalidInput\";\n HomeDeliveryStateEnum[\"noDeliveryInfo\"] = \"noDeliveryInfo\";\n HomeDeliveryStateEnum[\"submitted\"] = \"submitted\";\n})(HomeDeliveryStateEnum || (HomeDeliveryStateEnum = {}));\nexports.default = HomeDeliveryStateEnum;\n//# sourceMappingURL=HomeDeliveryStateEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst HomeDeliveryAvailabilityEnum_1 = __importDefault(require(\"../enums/HomeDeliveryAvailabilityEnum\"));\n/**\n * Home delivery utility.\n */\nclass HomeDeliveryUtility {\n /**\n * Returns delivery availability status for all products.\n *\n * @param options Options.\n * @param options.zipAvailabilities Zip availabilities.\n * @param options.products Products for market availability.\n * @returns HomeDeliveryAvailabilityEnum.\n */\n static getAvailabilityStatus(options) {\n const { zipAvailabilities, products } = options;\n if (products && products.length > 0) {\n if (products.every((product) => { var _a, _b; return ((_b = (_a = product === null || product === void 0 ? void 0 : product.content) === null || _a === void 0 ? void 0 : _a.priceInformation) === null || _b === void 0 ? void 0 : _b.availableForHomeDelivery) === false; })) {\n return this.getUnavailableStatusProducts(products);\n }\n }\n if (!zipAvailabilities || !zipAvailabilities.length) {\n return null;\n }\n const isAllAvailable = zipAvailabilities.every((zipAvailability) => { var _a; return (_a = zipAvailability === null || zipAvailability === void 0 ? void 0 : zipAvailability.content) === null || _a === void 0 ? void 0 : _a.availableForHomeDelivery; });\n if (isAllAvailable) {\n return HomeDeliveryAvailabilityEnum_1.default.available;\n }\n const isSomeAvailable = zipAvailabilities.some((zipAvailability) => { var _a; return (_a = zipAvailability === null || zipAvailability === void 0 ? void 0 : zipAvailability.content) === null || _a === void 0 ? void 0 : _a.availableForHomeDelivery; });\n if (isSomeAvailable) {\n return HomeDeliveryAvailabilityEnum_1.default.mixed;\n }\n const hasAvailability = (messageType) => zipAvailabilities.every((zipAvailability) => {\n var _a, _b;\n return !((_a = zipAvailability === null || zipAvailability === void 0 ? void 0 : zipAvailability.content) === null || _a === void 0 ? void 0 : _a.availableForHomeDelivery) &&\n ((_b = zipAvailability.content.homeDelivery) === null || _b === void 0 ? void 0 : _b.messageType) === messageType;\n });\n const { outOfStock, notSoldTemp, notInRange } = enums_1.ZipAvailabilityProbabilityEnum;\n if (hasAvailability(outOfStock)) {\n return HomeDeliveryAvailabilityEnum_1.default.unavailable;\n }\n if (hasAvailability(notSoldTemp)) {\n return HomeDeliveryAvailabilityEnum_1.default.notSoldTemp;\n }\n if (hasAvailability(notInRange)) {\n return HomeDeliveryAvailabilityEnum_1.default.notInRange;\n }\n return null;\n }\n /**\n * Returns HomeDeliveryStatus of HomeDeliveryAvailabilityEnum type.\n *\n * @param products\n *\n */\n static getUnavailableStatusProducts(products) {\n if (!products) {\n return null;\n }\n const { notSoldTemp, notInRange } = enums_1.ZipAvailabilityProbabilityEnum;\n const isEveryMessageType = (messageType) => products.every((product) => { var _a, _b, _c; return ((_c = (_b = (_a = product === null || product === void 0 ? void 0 : product.content) === null || _a === void 0 ? void 0 : _a.priceInformation) === null || _b === void 0 ? void 0 : _b.homeDelivery) === null || _c === void 0 ? void 0 : _c.messageType) === messageType; });\n if (isEveryMessageType(notSoldTemp)) {\n return HomeDeliveryAvailabilityEnum_1.default.notSoldTemp;\n }\n if (isEveryMessageType(notInRange)) {\n return HomeDeliveryAvailabilityEnum_1.default.notInRange;\n }\n return HomeDeliveryAvailabilityEnum_1.default.unavailable;\n }\n}\nexports.default = HomeDeliveryUtility;\n//# sourceMappingURL=HomeDeliveryUtility.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass HomeDeliveryCardStyle {\n static getStyle(options) {\n const { spacing, color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\t.heading {\n\t\t\t\tdisplay: flex;\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t\tmargin-top: 0;\n\t\t\t\tmargin-bottom: 0;\n\t\t\t}\n\n\t\t\t.body {\n\t\t\t\tdisplay: block;\n\t\t\t\tcolor: ${color.text.default};\n\t\t\t\tpadding-top: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.footer {\n\t\t\t\tdisplay: block;\n\t\t\t\tcolor: ${color.text.default};\n\t\t\t\tpadding-top: ${spacing.space150 / 16}rem;\n\t\t\t}\n\n\t\t\t.zipCode {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\talign-items: center;\n\t\t\t}\n\n\t\t\tkompis-input {\n\t\t\t\tdisplay: block;\n\t\t\t\tpadding-top: ${spacing.space75 / 16}rem;\n\t\t\t}\n\n\t\t\tskapa-button {\n\t\t\t\tdisplay: block;\n\t\t\t\tpadding-top: ${spacing.space250 / 16}rem;\n\t\t\t}\n\n\t\t\t.forgetPostcodeButton {\n\t\t\t\tpadding-top: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.inline-message-wrapper {\n\t\t\t\tpadding-top: ${spacing.space200 / 16}rem;\n\t\t\t}\n\n\t\t\t.label {\n\t\t\t\tdisplay: inline;\n\t\t\t\tmargin-inline-end: ${spacing.space75 / 16}rem;\n\t\t\t}\n\n\t\t\tskapa-status {\n\t\t\t\t--skapa-status-inner-margin: 0;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = HomeDeliveryCardStyle;\n//# sourceMappingURL=HomeDeliveryCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst component_hyperlink_1 = require(\"@inter-ikea-kompis/component-hyperlink\");\nconst component_input_1 = require(\"@inter-ikea-kompis/component-input\");\nrequire(\"@inter-ikea-kompis/component-input\");\nrequire(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/status-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/inline-message-webc\");\nrequire(\"@ingka/icon-store/warning-triangle\");\nconst HomeDeliveryAvailabilityEnum_1 = __importDefault(require(\"../../enums/HomeDeliveryAvailabilityEnum\"));\nconst HomeDeliveryStateEnum_1 = __importDefault(require(\"../../enums/HomeDeliveryStateEnum\"));\nconst HomeDeliveryUtility_1 = __importDefault(require(\"../../utilities/HomeDeliveryUtility\"));\nconst HomeDeliveryCardStyle_1 = __importDefault(require(\"./HomeDeliveryCardStyle\"));\n/**\n * @event input Input of zip code.\n * @event startOverClick User clicks on the start over link.\n * @event forgetClick User clicks on the forget link.\n * @event submitButtonClick User clicks the check availability button.\n */\nlet HomeDeliveryCard = class HomeDeliveryCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // ZIP availability object. This field should be populated together with \"zipCode\".\n this.zipAvailabilities = null;\n // Submitted and validated ZIP code. This field should be populated together with \"zipAvailability\".\n this.zipCode = null;\n // ZIP code input by the user.\n this.inputValue = null;\n // Card state.\n this.state = HomeDeliveryStateEnum_1.default.default;\n this.resizeObserver = new ResizeObserver(() => this.requestUpdate());\n }\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getContainer()}\n\t\t`;\n }\n connectedCallback() {\n super.connectedCallback();\n this.resizeObserver.observe(this);\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.resizeObserver.unobserve(this);\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n getContainer() {\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${this.getHeading()} ${this.getBody()} ${this.getInput()} ${this.getButton()}\n\t\t\t\t${!this.zipAvailabilities ? this.getForgetButton() : null} ${this.getInlineMessage()}\n\t\t\t\t${this.getFooter()}\n\t\t\t
    \n\t\t`;\n }\n getSplitZipCodeString(text) {\n if (text.includes('{{')) {\n return text.split('{{zip_code}}');\n }\n else if (text.includes('[[')) {\n return text.split('[[zip_code]]');\n }\n else {\n return null;\n }\n }\n getHeading() {\n const { homeDeliveryCardHeadlineUnavailable, homeDeliveryCardHeadlineAvailable, homeDeliveryCardHeadlineSomeAvailable, homeDeliveryCardHeadlineInactive } = this.getTranslations();\n if (this.zipAvailabilities && this.zipCode && this.state === HomeDeliveryStateEnum_1.default.submitted) {\n let zipCodeTranslations = this.getSplitZipCodeString(homeDeliveryCardHeadlineUnavailable);\n const availabilityStatus = HomeDeliveryUtility_1.default.getAvailabilityStatus({\n zipAvailabilities: this.zipAvailabilities\n });\n if (availabilityStatus === HomeDeliveryAvailabilityEnum_1.default.available) {\n zipCodeTranslations = this.getSplitZipCodeString(homeDeliveryCardHeadlineAvailable);\n }\n if (availabilityStatus === HomeDeliveryAvailabilityEnum_1.default.mixed) {\n zipCodeTranslations = this.getSplitZipCodeString(homeDeliveryCardHeadlineSomeAvailable);\n }\n if (!zipCodeTranslations || (zipCodeTranslations === null || zipCodeTranslations === void 0 ? void 0 : zipCodeTranslations.length) === 0) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\t

    \n\t\t\t\t\t\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\t${zipCodeTranslations[0]}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t${this.zipCode}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t${zipCodeTranslations.length > 0\n ? (0, web_component_1.html) `${zipCodeTranslations[1]}`\n : null}\n\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t${this.getStatusIndicator()}\n\t\t\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t

    \n\t\t\t`;\n }\n return (0, web_component_1.html) `\n\t\t\t

    \n\t\t\t\t\n\t\t\t\t\t${homeDeliveryCardHeadlineInactive}\n\t\t\t\t\n\t\t\t

    \n\t\t`;\n }\n getBody() {\n let translation = this.getTranslations().homeDeliveryCardBodyInactive;\n if (this.zipAvailabilities && this.zipCode && this.state === HomeDeliveryStateEnum_1.default.submitted) {\n const availabiltyStatus = HomeDeliveryUtility_1.default.getAvailabilityStatus({\n zipAvailabilities: this.zipAvailabilities\n });\n if (availabiltyStatus === HomeDeliveryAvailabilityEnum_1.default.available) {\n translation = this.getTranslations().homeDeliveryCardBodyAvailable;\n }\n else {\n translation = this.getTranslations().homeDeliveryCardBodyUnavailable;\n }\n }\n return (0, web_component_1.html) `\n\t\t\t${(0, web_component_1.unsafeHTML)(translation.replace(/[\\n\\r]+/gm, '

    '))}\n\t\t`;\n }\n getInput() {\n var _a;\n if (this.zipAvailabilities && this.zipCode && this.state === HomeDeliveryStateEnum_1.default.submitted) {\n return null;\n }\n const translations = this.getTranslations();\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('input', {\n detail: { inputValue: event.detail.value, state: HomeDeliveryStateEnum_1.default.default },\n bubbles: true\n }))}\"\n\t\t\t\t@keydown=\"${(event) => {\n if (event.key === 'Enter') {\n this.dispatchEvent(new CustomEvent('submitButtonClick', { bubbles: true }));\n }\n }}\"\n\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t.label=\"${this.getTranslations().homeDeliveryCardInputLabel}\"\n\t\t\t\t.helpMessage=\"${this.state === HomeDeliveryStateEnum_1.default.invalidInput\n ? translations.homeDeliveryCardInputError\n : translations.homeDeliveryCardInputHelpText}\"\n\t\t\t\t.layout=\"${this.state === HomeDeliveryStateEnum_1.default.invalidInput\n ? component_input_1.InputLayoutEnum.error\n : component_input_1.InputLayoutEnum.default}\"\n\t\t\t\t.value=\"${(_a = this.inputValue) !== null && _a !== void 0 ? _a : ''}\"\n\t\t\t>\n\t\t`;\n }\n getButton() {\n if (this.zipAvailabilities && this.zipCode && this.state === HomeDeliveryStateEnum_1.default.submitted) {\n return null;\n }\n const primaryVariant = 'primary';\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('submitButtonClick', { bubbles: true }))}\"\n\t\t\t\tvariant=\"${primaryVariant}\"\n\t\t\t\t?loading=\"${this.state === HomeDeliveryStateEnum_1.default.loading}\"\n\t\t\t\tloadingSrText=\"${this.getTranslations().loading}\"\n\t\t\t\t?disabled=\"${!this.inputValue || this.state === HomeDeliveryStateEnum_1.default.invalidInput}\"\n\t\t\t>\n\t\t\t\t${this.getTranslations().homeDeliveryCardCheckAvailabilityButton}\n\t\t\t\n\t\t`;\n }\n getForgetButton() {\n if (!this.zipCode && this.state !== HomeDeliveryStateEnum_1.default.submitted) {\n return null;\n }\n const forgetLinkTranslation = this.getTranslations().homeDeliveryCardFooterForgetLink;\n // Set the first character of the translation key to uppercase.\n const forgetLinkTranslationUppercase = forgetLinkTranslation[0].toUpperCase() +\n forgetLinkTranslation.substring(1, forgetLinkTranslation.length);\n const secondaryVariant = 'secondary';\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('forgetClick', { bubbles: true }))}\"\n\t\t\t\tvariant=\"${secondaryVariant}\"\n\t\t\t\t?disabled=\"${!this.inputValue || this.state === HomeDeliveryStateEnum_1.default.invalidInput}\"\n\t\t\t>\n\t\t\t\t${forgetLinkTranslationUppercase}\n\t\t\t\n\t\t`;\n }\n getInlineMessage() {\n return (0, web_component_1.html) `
    ${this.getHomeDeliveryErrorMessage()}
    `;\n }\n getHomeDeliveryErrorMessage() {\n if (this.state !== HomeDeliveryStateEnum_1.default.noDeliveryInfo) {\n return null;\n }\n const cautionaryVariant = 'cautionary';\n const { homeDeliveryCardStatusErrorTitle, homeDeliveryCardStatusErrorBody } = this.getTranslations();\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${homeDeliveryCardStatusErrorTitle}\n\t\t\t\t\t${homeDeliveryCardStatusErrorBody}\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n getFooter() {\n if (!this.zipAvailabilities ||\n !this.zipCode ||\n this.state !== HomeDeliveryStateEnum_1.default.submitted) {\n return null;\n }\n const { homeDeliveryCardFooterLinks, homeDeliveryCardFooterStartOverLink, homeDeliveryCardFooterForgetLink } = this.getTranslations();\n // Matches {{}} and [[]]\n const regexp = /\\{\\{([^}]+)\\}\\}|\\[\\[([^\\]]+)\\]\\]/g;\n const labels = [];\n let lastIndex = 0;\n // \"homeDeliveryCardFooterLinks\" is a translation string containing two links at any position (e.g. \"before [[start_over_link]] middle [[forget_link]] after\")\n // We use Regexp here to find the links in the string and push the kompis-hyperlink components between the texts.\n for (let match = regexp.exec(homeDeliveryCardFooterLinks); match !== null; match = regexp.exec(homeDeliveryCardFooterLinks)) {\n if (lastIndex < match.index) {\n labels.push(homeDeliveryCardFooterLinks.slice(lastIndex, match.index));\n }\n // match[1] = {{}}, match[2] = [[]]\n const regexMatch = match[1] ? match[1] : match[2];\n switch (regexMatch) {\n case 'start_over_link':\n labels.push(this.getHyperlink(homeDeliveryCardFooterStartOverLink, this.onStartOverLinkClick.bind(this)));\n break;\n case 'forget_link':\n labels.push(this.getHyperlink(homeDeliveryCardFooterForgetLink, this.onForgetLinkClick.bind(this)));\n break;\n }\n lastIndex = match.index + match[0].length;\n }\n if (lastIndex < homeDeliveryCardFooterLinks.length) {\n labels.push(homeDeliveryCardFooterLinks.slice(lastIndex));\n }\n return (0, web_component_1.html) `${labels}`;\n }\n /**\n * Returns hyperlink.\n *\n * @param translation Translation.\n * @param listener Event listener.\n * @returns Template.\n */\n getHyperlink(translation, listener) {\n return (0, web_component_1.html) ` listener()}\"\n\t\t\t.theme=\"${this.theme}\"\n\t\t\t.text=\"${translation}\"\n\t\t\t.color=\"${component_hyperlink_1.HyperlinkColorEnum.grey}\"\n\t\t\t.underline=\"${true}\"\n\t\t>`;\n }\n getStatusIndicator() {\n if (!this.zipAvailabilities ||\n !this.zipCode ||\n this.state !== HomeDeliveryStateEnum_1.default.submitted) {\n return null;\n }\n let statusColor = 'red';\n const availabilityStatus = HomeDeliveryUtility_1.default.getAvailabilityStatus({\n zipAvailabilities: this.zipAvailabilities\n });\n if (availabilityStatus === HomeDeliveryAvailabilityEnum_1.default.available) {\n statusColor = 'green';\n }\n if (availabilityStatus === HomeDeliveryAvailabilityEnum_1.default.mixed) {\n statusColor = 'orange';\n }\n const position = 'inline';\n return (0, web_component_1.html) ``;\n }\n onStartOverLinkClick() {\n this.dispatchEvent(new CustomEvent('startOverClick', {\n bubbles: true,\n detail: {\n inputValue: null\n }\n }));\n }\n onForgetLinkClick() {\n this.dispatchEvent(new CustomEvent('forgetClick', {\n bubbles: true,\n detail: {\n inputValue: null,\n zipCode: null,\n zipAvailabilities: null,\n state: HomeDeliveryStateEnum_1.default.default,\n visibleModal: null\n }\n }));\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], HomeDeliveryCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], HomeDeliveryCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], HomeDeliveryCard.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], HomeDeliveryCard.prototype, \"zipAvailabilities\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], HomeDeliveryCard.prototype, \"zipCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, synchronous: true })\n], HomeDeliveryCard.prototype, \"inputValue\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], HomeDeliveryCard.prototype, \"state\", void 0);\nHomeDeliveryCard = __decorate([\n (0, web_component_1.customElement)('kompis-home-delivery-card')\n], HomeDeliveryCard);\nexports.default = HomeDeliveryCard;\n//# sourceMappingURL=HomeDeliveryCard.js.map","import \"@inter-ikea-kompis/component-home-delivery/lib/components/home-delivery-card/HomeDeliveryCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisHomeDeliveryCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-home-delivery-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.inputValue = props.inputValue;\n element.localizedInformation = props.localizedInformation;\n element.state = props.state;\n element.theme = props.theme;\n element.translations = props.translations;\n element.zipAvailabilities = props.zipAvailabilities;\n element.zipCode = props.zipCode;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onForgetClick, \"forgetClick\");\n this.updateEventListener(element, props.onInput, \"input\");\n this.updateEventListener(element, props.onStartOverClick, \"startOverClick\");\n this.updateEventListener(element, props.onSubmitButtonClick, \"submitButtonClick\");\n }\n}\nKompisHomeDeliveryCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n inputValue: PropTypes.string,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n state: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n zipAvailabilities: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n zipCode: PropTypes.string,\n onInput: PropTypes.func,\n onStartOverClick: PropTypes.func,\n onForgetClick: PropTypes.func,\n onSubmitButtonClick: PropTypes.func\n};\nexport default KompisHomeDeliveryCard;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('delivery-truck', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M1 4h15v3h3.0246l3.9793 5.6848V18h-2.6567c-.4218 1.3056-1.6473 2.25-3.0933 2.25-1.446 0-2.6715-.9444-3.0932-2.25h-3.9044c-.4217 1.3056-1.6472 2.25-3.0932 2.25S4.4916 19.3056 4.0698 18H1V4zm3.0698 12c.4218-1.3056 1.6473-2.25 3.0933-2.25 1.446 0 2.6715.9444 3.0932 2.25H14V6H3v10h1.0698zM16 14.0007a3.24 3.24 0 0 1 1.2539-.2507c1.446 0 2.6715.9444 3.0933 2.25h.6567v-2.6848L17.9833 9H16v5.0007zM7.163 15.75c-.6903 0-1.25.5596-1.25 1.25s.5597 1.25 1.25 1.25c.6904 0 1.25-.5596 1.25-1.25s-.5596-1.25-1.25-1.25zm10.0909 0c-.6904 0-1.25.5596-1.25 1.25s.5596 1.25 1.25 1.25 1.25-.5596 1.25-1.25-.5596-1.25-1.25-1.25z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar HomeDeliveryLevelEnum;\n(function (HomeDeliveryLevelEnum) {\n HomeDeliveryLevelEnum[\"market\"] = \"market\";\n HomeDeliveryLevelEnum[\"zip\"] = \"zip\";\n HomeDeliveryLevelEnum[\"unsupported\"] = \"unsupported\";\n})(HomeDeliveryLevelEnum || (HomeDeliveryLevelEnum = {}));\nexports.default = HomeDeliveryLevelEnum;\n//# sourceMappingURL=HomeDeliveryLevelEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar HomeDeliveryLinkStateEnum;\n(function (HomeDeliveryLinkStateEnum) {\n HomeDeliveryLinkStateEnum[\"default\"] = \"default\";\n HomeDeliveryLinkStateEnum[\"loading\"] = \"loading\";\n HomeDeliveryLinkStateEnum[\"noDeliveryInfo\"] = \"noDeliveryInfo\";\n HomeDeliveryLinkStateEnum[\"submitted\"] = \"submitted\";\n})(HomeDeliveryLinkStateEnum || (HomeDeliveryLinkStateEnum = {}));\nexports.default = HomeDeliveryLinkStateEnum;\n//# sourceMappingURL=HomeDeliveryLinkStateEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar HomeDeliveryModalEnum;\n(function (HomeDeliveryModalEnum) {\n HomeDeliveryModalEnum[\"zipAvailabilityCard\"] = \"zipAvailabilityCard\";\n})(HomeDeliveryModalEnum || (HomeDeliveryModalEnum = {}));\nexports.default = HomeDeliveryModalEnum;\n//# sourceMappingURL=HomeDeliveryModalEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nclass HomeDeliveryLinkStyle {\n static getStyle(options) {\n const { spacing, color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\t.linkContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: flex-start;\n\t\t\t\tcolor: ${color.text.default};\n\t\t\t}\n\n\t\t\t.availabilityContainer {\n\t\t\t\tdisplay: flex-column;\n\t\t\t\tjustify-content: center;\n\t\t\t\tflex-wrap: wrap;\n\t\t\t\tmargin-inline-start: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.info-row {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tmin-height: ${spacing.space150 / 16}rem;\n\t\t\t}\n\n\t\t\tskapa-icon {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\twidth: ${spacing.space150 / 16}rem;\n\t\t\t\theight: ${spacing.space150 / 16}rem;\n\t\t\t\tcolor: ${color.icon.default};\n\t\t\t}\n\n\t\t\tkompis-hyperlink {\n\t\t\t\twhite-space: normal;\n\t\t\t}\n\n\t\t\tskapa-status {\n\t\t\t\twhite-space: pre-wrap;\n\t\t\t}\n\n\t\t\tskapa-status.status-hidden {\n\t\t\t\t--size: 0;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = HomeDeliveryLinkStyle;\n//# sourceMappingURL=HomeDeliveryLinkStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_hyperlink_1 = require(\"@inter-ikea-kompis/component-hyperlink\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@inter-ikea-kompis/component-icon\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@ingka/status-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/icon-store/delivery-truck\");\nrequire(\"../home-delivery-card/HomeDeliveryCard\");\nconst HomeDeliveryAvailabilityEnum_1 = __importDefault(require(\"../../enums/HomeDeliveryAvailabilityEnum\"));\nconst HomeDeliveryLevelEnum_1 = __importDefault(require(\"../../enums/HomeDeliveryLevelEnum\"));\nconst HomeDeliveryLinkStateEnum_1 = __importDefault(require(\"../../enums/HomeDeliveryLinkStateEnum\"));\nconst HomeDeliveryModalEnum_1 = __importDefault(require(\"../../enums/HomeDeliveryModalEnum\"));\nconst HomeDeliveryUtility_1 = __importDefault(require(\"../../utilities/HomeDeliveryUtility\"));\nconst HomeDeliveryLinkStyle_1 = __importDefault(require(\"./HomeDeliveryLinkStyle\"));\n/**\n * @event linkClick User clicks on the link.\n */\nlet HomeDeliveryLink = class HomeDeliveryLink extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // An array of products of type IProduct.\n this.products = null;\n // ZIP availability object. This field should be populated together with \"zipCode\".\n this.zipAvailabilities = null;\n // Submitted and validated ZIP code. This field should be populated together with \"zipAvailability\".\n this.zipCode = null;\n // Card state.\n this.state = HomeDeliveryLinkStateEnum_1.default.default;\n this.availabilityTranslationMessage = null;\n this.dexfSettings = null;\n this.deliveryLevel = null;\n }\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n this.deliveryLevel = this.getDeliveryLevel();\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t
    ${this.getStatusText()}
    \n\t\t`;\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n return true;\n }\n hasTranslationsAndSettings() {\n var _a;\n return (!!this.translations && !!this.settings) || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getSettings() {\n return this.dexfSettings;\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n getStatusText() {\n const deliveryTruckIcon = this.getDeliveryTruckIcon();\n const label = this.getLabel();\n const indicator = this.getIndicator(label);\n const errorHelpText = this.getErrorHelpText();\n return (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n }\n getDeliveryTruckIcon() {\n return (0, web_component_1.html) ``;\n }\n getErrorHelpText() {\n if (this.isNoDeliveryInfoOrEmptyZipAvailabilities()) {\n return (0, web_component_1.html) `
    \n\t\t\t\t${this.getTranslations().homeDeliveryStatusErrorHelpText}\n\t\t\t
    `;\n }\n return null;\n }\n getIndicator(label) {\n var _a, _b;\n const availabilityStatusOptions = {\n zipAvailabilities: (_a = this.zipAvailabilities) !== null && _a !== void 0 ? _a : undefined,\n products: (_b = this.products) !== null && _b !== void 0 ? _b : undefined\n };\n const availabilityStatus = HomeDeliveryUtility_1.default.getAvailabilityStatus(availabilityStatusOptions);\n const color = this.getStatusIndicatorColor(availabilityStatus);\n // Status needs to be the same element between states for focus to be put back when setting or forgetting a zip code.\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${label}\n\t\t\t
    \n\t\t`;\n }\n getLabel() {\n const text = this.getLabelText();\n const link = this.getLabelLink(); // TODO\n const content = this.formatLabelContent(text, link);\n return (0, web_component_1.html) `${content}`;\n }\n formatLabelContent(text, link) {\n const pattern = '[[zip_code]]';\n const phrasePattern = '{{zip_code}}';\n let start = text || '';\n let end = '';\n if (text === null || text === void 0 ? void 0 : text.includes(pattern)) {\n [start, end] = text.split(pattern);\n }\n else if (text === null || text === void 0 ? void 0 : text.includes(phrasePattern)) {\n [start, end] = text.split(phrasePattern);\n }\n return (0, web_component_1.html) `${start}${link}${end}`;\n }\n getLabelText() {\n if (this.zipCode && (this.isDeliveryLevelZip() || this.isDeliveryLevelUnsupported())) {\n const translation = this.getZipLevelAvailabilityTranslation();\n if (translation) {\n return translation;\n }\n }\n if (this.isDeliveryLevelMarket()) {\n return this.getMarketLevelAvailabilityTranslation();\n }\n if (this.isDeliveryLevelUnsupported()) {\n return this.getTranslations().homeDeliveryStatusUnsupported;\n }\n return null;\n }\n getLabelLink() {\n if (this.zipCode && (this.isDeliveryLevelZip() || this.isDeliveryLevelUnsupported())) {\n return this.getHyperlink(this.zipCode);\n }\n if (this.isDeliveryLevelMarket() || this.isDeliveryLevelUnsupported()) {\n return null;\n }\n return this.getHyperlink(this.getTranslations().homeDeliveryStatusInactive);\n }\n getHyperlink(label) {\n if (label) {\n return (0, web_component_1.html) ` this.onLinkClick()}\"\n\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t.text=\"${label}\"\n\t\t\t\t.color=\"${component_hyperlink_1.HyperlinkColorEnum.grey}\"\n\t\t\t\t.underline=\"${true}\"\n\t\t\t>`;\n }\n return null;\n }\n onLinkClick() {\n this.dispatchEvent(new CustomEvent('linkClick', {\n bubbles: true,\n detail: {\n visibleModal: HomeDeliveryModalEnum_1.default.zipAvailabilityCard,\n state: this.zipAvailabilities &&\n this.zipCode &&\n this.state !== HomeDeliveryLinkStateEnum_1.default.noDeliveryInfo &&\n this.state !== HomeDeliveryLinkStateEnum_1.default.loading\n ? HomeDeliveryLinkStateEnum_1.default.submitted\n : this.state,\n triggerElement: this.getTriggerElement()\n }\n }));\n }\n getTriggerElement() {\n var _a, _b, _c;\n return ((_c = (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('kompis-hyperlink')) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('kompis-focus-outline > a'));\n }\n getMarketLevelAvailabilityTranslation() {\n const { homeDeliveryStatusNotSoldTemp, zipAvailabilityUnavailable, homeDeliveryStatusNotInRange } = this.getTranslations();\n const availabilityMessageType = HomeDeliveryUtility_1.default.getUnavailableStatusProducts(this.products);\n switch (availabilityMessageType) {\n case HomeDeliveryAvailabilityEnum_1.default.notInRange:\n this.availabilityTranslationMessage = homeDeliveryStatusNotInRange;\n break;\n case HomeDeliveryAvailabilityEnum_1.default.notSoldTemp:\n this.availabilityTranslationMessage = homeDeliveryStatusNotSoldTemp;\n break;\n case HomeDeliveryAvailabilityEnum_1.default.unavailable:\n this.availabilityTranslationMessage = zipAvailabilityUnavailable;\n break;\n }\n return this.availabilityTranslationMessage;\n }\n getZipLevelAvailabilityTranslation() {\n const { homeDeliveryStatusErrorMessage, homeDeliveryStatusAvailable, homeDeliveryStatusSomeAvailable, homeDeliveryStatusUnavailable, homeDeliveryStatusActive } = this.getTranslations();\n if (this.isStateLoading()) {\n // Use same message as previous render to prevent it from getting rest on loading state\n this.availabilityTranslationMessage;\n }\n else if (this.isNoDeliveryInfoOrEmptyZipAvailabilities()) {\n this.availabilityTranslationMessage = homeDeliveryStatusErrorMessage;\n }\n else if (this.zipAvailabilities) {\n const availabilityStatus = HomeDeliveryUtility_1.default.getAvailabilityStatus({\n zipAvailabilities: this.zipAvailabilities\n });\n switch (availabilityStatus) {\n case HomeDeliveryAvailabilityEnum_1.default.available:\n this.availabilityTranslationMessage = homeDeliveryStatusAvailable;\n break;\n case HomeDeliveryAvailabilityEnum_1.default.mixed:\n this.availabilityTranslationMessage = homeDeliveryStatusSomeAvailable;\n break;\n default:\n this.availabilityTranslationMessage = homeDeliveryStatusUnavailable;\n break;\n }\n }\n else if (this.state !== HomeDeliveryLinkStateEnum_1.default.default) {\n this.availabilityTranslationMessage = homeDeliveryStatusActive;\n }\n return this.availabilityTranslationMessage;\n }\n getStatusIndicatorColor(availabilityStatus) {\n if (this.isDeliveryLevelUnsupported()) {\n return 'grey';\n }\n switch (availabilityStatus) {\n case HomeDeliveryAvailabilityEnum_1.default.available:\n return 'green';\n case HomeDeliveryAvailabilityEnum_1.default.mixed:\n return 'orange';\n case HomeDeliveryAvailabilityEnum_1.default.unavailable:\n return 'red';\n case HomeDeliveryAvailabilityEnum_1.default.notInRange:\n return 'grey';\n case HomeDeliveryAvailabilityEnum_1.default.notSoldTemp:\n return 'red';\n default:\n return null;\n }\n }\n getDeliveryLevel() {\n if (!this.isHomeDeliverySupported()) {\n return HomeDeliveryLevelEnum_1.default.unsupported;\n }\n if (!!this.products &&\n this.products.length > 0 &&\n !this.isEveryProductAvailableForHomeDelivery(this.products)) {\n return HomeDeliveryLevelEnum_1.default.market;\n }\n return HomeDeliveryLevelEnum_1.default.zip;\n }\n isHomeDeliverySupported() {\n const zipAvailabilityDataSourceEnabled = this.getSettings().kompis.serviceSettings.zipAvailabilityDataSource !==\n enums_1.ZipAvailabilityDataSourceEnum.disabled;\n return !this.isNoDeliveryInfoOrEmptyZipAvailabilities() && zipAvailabilityDataSourceEnabled;\n }\n /**\n * @param nonZeroProducts Products with a length of at least 1.\n */\n isEveryProductAvailableForHomeDelivery(nonZeroProducts) {\n return nonZeroProducts.every((product) => { var _a, _b; return ((_b = (_a = product === null || product === void 0 ? void 0 : product.content) === null || _a === void 0 ? void 0 : _a.priceInformation) === null || _b === void 0 ? void 0 : _b.availableForHomeDelivery) === true; });\n }\n isStateLoading() {\n return this.state === HomeDeliveryLinkStateEnum_1.default.loading;\n }\n isNoDeliveryInfoOrEmptyZipAvailabilities() {\n return (this.state === HomeDeliveryLinkStateEnum_1.default.noDeliveryInfo ||\n (!!this.zipAvailabilities && !this.zipAvailabilities.length));\n }\n isDeliveryLevelMarket() {\n return this.deliveryLevel === HomeDeliveryLevelEnum_1.default.market;\n }\n isDeliveryLevelZip() {\n return this.deliveryLevel === HomeDeliveryLevelEnum_1.default.zip;\n }\n isDeliveryLevelUnsupported() {\n return this.deliveryLevel === HomeDeliveryLevelEnum_1.default.unsupported;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], HomeDeliveryLink.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], HomeDeliveryLink.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], HomeDeliveryLink.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], HomeDeliveryLink.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], HomeDeliveryLink.prototype, \"products\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], HomeDeliveryLink.prototype, \"zipAvailabilities\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], HomeDeliveryLink.prototype, \"zipCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], HomeDeliveryLink.prototype, \"state\", void 0);\nHomeDeliveryLink = __decorate([\n (0, web_component_1.customElement)('kompis-home-delivery-link')\n], HomeDeliveryLink);\nexports.default = HomeDeliveryLink;\n//# sourceMappingURL=HomeDeliveryLink.js.map","import \"@inter-ikea-kompis/component-home-delivery/lib/components/home-delivery-link/HomeDeliveryLink\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisHomeDeliveryLink extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-home-delivery-link\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.localizedInformation = props.localizedInformation;\n element.products = props.products;\n element.settings = props.settings;\n element.state = props.state;\n element.theme = props.theme;\n element.translations = props.translations;\n element.zipAvailabilities = props.zipAvailabilities;\n element.zipCode = props.zipCode;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onLinkClick, \"linkClick\");\n }\n}\nKompisHomeDeliveryLink.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n products: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n state: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n zipAvailabilities: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n zipCode: PropTypes.string,\n onLinkClick: PropTypes.func\n};\nexport default KompisHomeDeliveryLink;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar HomeDeliveryStartOverEventEnum;\n(function (HomeDeliveryStartOverEventEnum) {\n HomeDeliveryStartOverEventEnum[\"backButton\"] = \"backButton\";\n HomeDeliveryStartOverEventEnum[\"startOverLink\"] = \"startOverLink\";\n})(HomeDeliveryStartOverEventEnum || (HomeDeliveryStartOverEventEnum = {}));\nexports.default = HomeDeliveryStartOverEventEnum;\n//# sourceMappingURL=HomeDeliveryStartOverEventEnum.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@ingka/modal-webc\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/icon-store/arrow-left\");\nrequire(\"../home-delivery-card/HomeDeliveryCard\");\nrequire(\"../home-delivery-link/HomeDeliveryLink\");\nconst HomeDeliveryModalEnum_1 = __importDefault(require(\"../../enums/HomeDeliveryModalEnum\"));\nconst HomeDeliveryStartOverEventEnum_1 = __importDefault(require(\"../../enums/HomeDeliveryStartOverEventEnum\"));\nconst HomeDeliveryStateEnum_1 = __importDefault(require(\"../../enums/HomeDeliveryStateEnum\"));\n/**\n * @event modalClose Modal close.\n * @event modalOpen Modal open.\n * @event startOverClick User clicks on the start over link or the back button.\n * @event forgetClick User clicks on the forget link.\n * @event input Input of zip code.\n * @event submitButtonClick User clicks the check availability button.\n */\nlet HomeDelivery = class HomeDelivery extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // An array of products of type IProduct.\n this.products = null;\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // ZIP availability object. This field should be populated together with \"zipCode\".\n this.zipAvailabilities = null;\n // Submitted and validated ZIP code. This field should be populated together with \"zipAvailability\".\n this.zipCode = null;\n // ZIP code input by the user.\n this.inputValue = null;\n // Card state.\n this.state = HomeDeliveryStateEnum_1.default.default;\n // Visible modal.\n this.visibleModal = null;\n this.sheetElement = null;\n this.cardElement = null;\n this.triggerElement = null;\n this.sheetHeader = null;\n this.backButton = null;\n this.dexfSettings = null;\n }\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.closeSheet();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n if (changedProperties.has('visibleModal')) {\n if (this.visibleModal === HomeDeliveryModalEnum_1.default.zipAvailabilityCard) {\n this.openSheet();\n }\n else {\n this.closeSheet();\n }\n }\n if (this.cardElement) {\n this.cardElement.zipAvailabilities = this.zipAvailabilities;\n this.cardElement.theme = this.theme;\n this.cardElement.localizedInformation = this.localizedInformation;\n this.cardElement.translations = this.translations;\n this.cardElement.zipCode = this.zipCode;\n this.cardElement.state = this.state;\n // \"inputValue\" is synchrounous, so we should set it last as it might trigger multiple renderings otherwise\n this.cardElement.inputValue = this.inputValue;\n }\n if (changedProperties.has('state')) {\n if (this.state === HomeDeliveryStateEnum_1.default.submitted) {\n this.addBackButton();\n }\n else {\n this.removeBackButton();\n }\n }\n return true;\n }\n hasTranslationsAndSettings() {\n var _a;\n return (!!this.translations && !!this.settings) || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n onLinkClick(event) {\n if (!this.products) {\n this.triggerElement = this.queryHyperlinkElement();\n this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: Object.assign(Object.assign({}, event.detail), { triggerElement: this.triggerElement })\n }));\n }\n }\n closeSheet() {\n if (this.sheetElement) {\n this.sheetElement.open = false;\n this.sheetElement = null;\n this.cardElement = null;\n this.backButton = null;\n }\n }\n openSheet() {\n if (this.sheetElement) {\n return;\n }\n const sheetElement = this.createSheetElement();\n this.sheetElement = sheetElement;\n // When user closes the Sheet\n sheetElement.addEventListener('closerequest', () => {\n if (this.sheetElement) {\n this.dispatchEvent(new CustomEvent('modalClose', {\n bubbles: true,\n detail: {\n visibleModal: null,\n triggerElement: this.queryHyperlinkElement()\n }\n }));\n this.dispatchEvent(new CustomEvent('input', {\n detail: {\n inputValue: this.zipCode\n },\n bubbles: true\n }));\n }\n });\n // Remove sheet when it has closed.\n sheetElement.addEventListener('closed', () => {\n var _a;\n (_a = sheetElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(sheetElement);\n });\n // When the user clicks the back button\n this.sheetHeader &&\n this.sheetHeader.addEventListener('backrequest', () => this.dispatchEvent(new CustomEvent('startOverClick', {\n detail: {\n inputValue: null,\n state: HomeDeliveryStateEnum_1.default.default,\n type: HomeDeliveryStartOverEventEnum_1.default.backButton\n },\n bubbles: true\n })));\n // Input event\n sheetElement.addEventListener('input', (event) => {\n this.dispatchEvent(new CustomEvent('input', {\n detail: Object.assign({}, event.detail),\n bubbles: true\n }));\n });\n // Button click\n sheetElement.addEventListener('submitButtonClick', (event) => {\n this.dispatchEvent(new CustomEvent('submitButtonClick', {\n detail: Object.assign(Object.assign({}, event.detail), { triggerElement: this.queryHyperlinkElement() }),\n bubbles: true\n }));\n });\n // When the user clicks the startover link\n sheetElement.addEventListener('startOverClick', () => this.dispatchEvent(new CustomEvent('startOverClick', {\n detail: {\n inputValue: null,\n state: HomeDeliveryStateEnum_1.default.default,\n type: HomeDeliveryStartOverEventEnum_1.default.startOverLink\n },\n bubbles: true\n })));\n // When the user clicks the forget link\n sheetElement.addEventListener('forgetClick', () => this.dispatchEvent(new CustomEvent('forgetClick', {\n detail: {\n state: HomeDeliveryStateEnum_1.default.default,\n visibleModal: null,\n zipAvailabilities: null,\n zipCode: null,\n inputValue: null,\n triggerElement: this.queryHyperlinkElement()\n },\n bubbles: true\n })));\n this.cardElement = sheetElement.querySelector('kompis-home-delivery-card');\n const parent = document.querySelector('kompis-keyboard-injector') || document.body;\n parent.appendChild(sheetElement);\n sheetElement.open = true;\n }\n /**\n * Function for querying inline hyperlink element from within the kompis-home-delivery-link component.\n */\n queryHyperlinkElement() {\n var _a, _b, _c, _d, _e, _f;\n return ((_f = (_e = (_d = (_c = (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('kompis-home-delivery-link')) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('kompis-hyperlink')) === null || _d === void 0 ? void 0 : _d.shadowRoot) === null || _e === void 0 ? void 0 : _e.querySelector('kompis-focus-outline > a')) !== null && _f !== void 0 ? _f : null);\n }\n createSheetElement() {\n const sheetElement = this.createSheet();\n const sheetHeaderElement = this.createSheetHeader();\n const homeDeliveryCardElement = this.createCard();\n sheetElement.appendChild(sheetHeaderElement);\n sheetElement.appendChild(homeDeliveryCardElement);\n return sheetElement;\n }\n createSheet() {\n const sheetElement = document.createElement('skapa-sheet');\n sheetElement.size = 'small';\n sheetElement.fullHeight = true;\n sheetElement.style.fontFamily = themes_1.FontStyle.getFontFamily(this.theme);\n sheetElement.style.zIndex = '500';\n return sheetElement;\n }\n createSheetHeader() {\n const sheetHeaderElement = document.createElement('skapa-modal-header');\n this.sheetHeader = sheetHeaderElement;\n const closeButtonSlot = document.createElement('span');\n closeButtonSlot.slot = 'closebutton-label';\n closeButtonSlot.innerText = this.getTranslations().modalAriaLabelButtonClose;\n sheetHeaderElement.appendChild(closeButtonSlot);\n if (this.state === HomeDeliveryStateEnum_1.default.submitted) {\n this.addBackButton();\n }\n sheetHeaderElement.slot = 'header';\n return sheetHeaderElement;\n }\n addBackButton() {\n if (this.sheetHeader && !this.sheetHeader.contains(this.backButton)) {\n const backButton = this.createBackButton();\n this.backButton = backButton;\n this.sheetHeader.appendChild(this.backButton);\n }\n }\n createBackButton() {\n const backButton = document.createElement('skapa-icon-button');\n backButton.a11yLabel = this.getTranslations().modalAriaLabelButtonBack || '';\n backButton.variant = 'primary';\n backButton.inverse = true;\n backButton.small = true;\n backButton.slot = 'back-button';\n const icon = document.createElement('skapa-icon');\n icon.icon = 'arrow-left';\n icon.flipRTL = true;\n icon.slot = 'icon';\n backButton.append(icon);\n return backButton;\n }\n removeBackButton() {\n this.sheetHeader &&\n this.backButton &&\n this.sheetHeader.contains(this.backButton) &&\n this.sheetHeader.removeChild(this.backButton);\n this.backButton = null;\n }\n createCard() {\n const cardElement = (document.createElement('kompis-home-delivery-card'));\n cardElement.theme = this.theme;\n cardElement.localizedInformation = this.localizedInformation;\n cardElement.translations = this.translations;\n cardElement.zipAvailabilities = this.zipAvailabilities;\n cardElement.zipCode = this.zipCode;\n cardElement.state = this.state;\n cardElement.inputValue = this.inputValue;\n return cardElement;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], HomeDelivery.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], HomeDelivery.prototype, \"products\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], HomeDelivery.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], HomeDelivery.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], HomeDelivery.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], HomeDelivery.prototype, \"zipAvailabilities\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], HomeDelivery.prototype, \"zipCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, synchronous: true })\n], HomeDelivery.prototype, \"inputValue\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], HomeDelivery.prototype, \"state\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], HomeDelivery.prototype, \"visibleModal\", void 0);\nHomeDelivery = __decorate([\n (0, web_component_1.customElement)('kompis-home-delivery')\n], HomeDelivery);\nexports.default = HomeDelivery;\n//# sourceMappingURL=HomeDelivery.js.map","import \"@inter-ikea-kompis/component-home-delivery/lib/components/home-delivery/HomeDelivery\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisHomeDelivery extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-home-delivery\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.inputValue = props.inputValue;\n element.localizedInformation = props.localizedInformation;\n element.products = props.products;\n element.settings = props.settings;\n element.state = props.state;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n element.zipAvailabilities = props.zipAvailabilities;\n element.zipCode = props.zipCode;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onForgetClick, \"forgetClick\");\n this.updateEventListener(element, props.onInput, \"input\");\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n this.updateEventListener(element, props.onStartOverClick, \"startOverClick\");\n this.updateEventListener(element, props.onSubmitButtonClick, \"submitButtonClick\");\n }\n}\nKompisHomeDelivery.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n inputValue: PropTypes.string,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n products: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n state: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n zipAvailabilities: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n zipCode: PropTypes.string,\n onModalClose: PropTypes.func,\n onModalOpen: PropTypes.func,\n onStartOverClick: PropTypes.func,\n onForgetClick: PropTypes.func,\n onInput: PropTypes.func,\n onSubmitButtonClick: PropTypes.func\n};\nexport default KompisHomeDelivery;\n","import \"@inter-ikea-kompis/component-hyperlink/lib/components/hyperlink/Hyperlink\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisHyperlink extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-hyperlink\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.ariaLabel = props.ariaLabel;\n element.color = props.color;\n element.href = props.href;\n element.icon = props.icon;\n element.target = props.target;\n element.text = props.text;\n element.theme = props.theme;\n element.underline = props.underline;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onLinkClick, \"linkClick\");\n }\n}\nKompisHyperlink.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n ariaLabel: PropTypes.string,\n color: PropTypes.string,\n href: PropTypes.string,\n icon: PropTypes.string,\n target: PropTypes.string,\n text: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n underline: PropTypes.bool,\n onLinkClick: PropTypes.func\n};\nexport default KompisHyperlink;\n","import \"@inter-ikea-kompis/component-icon/lib/components/icon/Icon\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisIcon extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-icon\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.flipIconRtl = props.flipIconRtl;\n element.icon = props.icon;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisIcon.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n flipIconRtl: PropTypes.bool,\n icon: PropTypes.string.isRequired,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisIcon;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar IconButtonSizeEnum;\n(function (IconButtonSizeEnum) {\n IconButtonSizeEnum[\"xsmall\"] = \"xsmall\";\n IconButtonSizeEnum[\"small\"] = \"small\";\n IconButtonSizeEnum[\"medium\"] = \"medium\";\n})(IconButtonSizeEnum || (IconButtonSizeEnum = {}));\nexports.default = IconButtonSizeEnum;\n//# sourceMappingURL=IconButtonSizeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar IconButtonOverlayColorEnum;\n(function (IconButtonOverlayColorEnum) {\n IconButtonOverlayColorEnum[\"IMAGE_OVERLAY_DARKEST\"] = \"IMAGE_OVERLAY_DARKEST\";\n IconButtonOverlayColorEnum[\"IMAGE_OVERLAY_COLOR\"] = \"IMAGE_OVERLAY_COLOR\";\n IconButtonOverlayColorEnum[\"IMAGE_OVERLAY_DARK\"] = \"IMAGE_OVERLAY_DARK\";\n IconButtonOverlayColorEnum[\"BUTTON_COLOR_DARK\"] = \"BUTTON_COLOR_DARK\";\n IconButtonOverlayColorEnum[\"BUTTON_COLOR_LIGHT\"] = \"BUTTON_COLOR_LIGHT\";\n IconButtonOverlayColorEnum[\"BUTTON_COLOR_LIGHT_DARK\"] = \"BUTTON_COLOR_LIGHT_DARK\";\n IconButtonOverlayColorEnum[\"BUTTON_COLOR_SECONDARY_INVERSE\"] = \"BUTTON_COLOR_SECONDARY_INVERSE\";\n IconButtonOverlayColorEnum[\"BUTTON_COLOR_SECONDARY\"] = \"BUTTON_COLOR_SECONDARY\";\n})(IconButtonOverlayColorEnum || (IconButtonOverlayColorEnum = {}));\nexports.default = IconButtonOverlayColorEnum;\n//# sourceMappingURL=IconButtonOverlayColorEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst IconButtonOverlayColorEnum_1 = __importDefault(require(\"../../enums/IconButtonOverlayColorEnum\"));\nconst IconButtonSizeEnum_1 = __importDefault(require(\"../../enums/IconButtonSizeEnum\"));\nconst BUTTON_HEIGHT = {\n xsmall: 24,\n small: 40,\n medium: 56\n};\nconst CLICKABLE_AREA = {\n xsmallButton: 10,\n smallButton: 2\n};\n/**\n * IconButton Style.\n */\nclass IconButtonStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @returns Styles.\n */\n static getStyle(options) {\n return (0, web_component_1.css) `\n\t\t\t${this.getCommonStyle(options)}\n\t\t\t${this.getLayoutStyle(options)}\n\t\t\t${options.isDisabled ? this.getDisabled(options) : ''}\n\t\t`;\n }\n /**\n * Returns overlay color styles.\n *\n * @param options Options.\n * @param color\n * @returns Styles.\n */\n static getColor(options, color) {\n const { neutral } = options.theme.color;\n switch (color) {\n case IconButtonOverlayColorEnum_1.default.IMAGE_OVERLAY_DARKEST:\n return utilities_1.ColorConverter.multiplyOpacity(neutral.grey900, 0.7);\n case IconButtonOverlayColorEnum_1.default.IMAGE_OVERLAY_COLOR:\n return utilities_1.ColorConverter.multiplyOpacity(neutral.grey900, 0.6);\n case IconButtonOverlayColorEnum_1.default.IMAGE_OVERLAY_DARK:\n return utilities_1.ColorConverter.multiplyOpacity(neutral.grey900, 0.65);\n case IconButtonOverlayColorEnum_1.default.BUTTON_COLOR_DARK:\n return utilities_1.ColorConverter.multiplyOpacity(neutral.white, 0.15);\n case IconButtonOverlayColorEnum_1.default.BUTTON_COLOR_LIGHT:\n return utilities_1.ColorConverter.multiplyOpacity(neutral.white, 0.5);\n case IconButtonOverlayColorEnum_1.default.BUTTON_COLOR_LIGHT_DARK:\n return utilities_1.ColorConverter.multiplyOpacity(neutral.white, 0.3);\n case IconButtonOverlayColorEnum_1.default.BUTTON_COLOR_SECONDARY_INVERSE:\n return utilities_1.ColorConverter.multiplyOpacity(neutral.white, 0.1);\n case IconButtonOverlayColorEnum_1.default.BUTTON_COLOR_SECONDARY:\n return utilities_1.ColorConverter.multiplyOpacity(neutral.grey900, 0.1);\n }\n }\n /**\n * Returns styles.\n *\n * @param options Options.\n * @returns Styles.\n */\n static getCommonStyle(options) {\n const { motion, border } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\t${options.isDisabled ? 'pointer-events: none;' : 'pointer-events: auto;'}\n\t\t\t}\n\n\t\t\t.visuallyHidden {\n\t\t\t\tborder: 0 !important;\n\t\t\t\tclip: rect(${1 / 16}rem, ${1 / 16}rem, ${1 / 16}rem, ${1 / 16}rem) !important;\n\t\t\t\t-webkit-clip-path: inset(50%) !important;\n\t\t\t\tclip-path: inset(50%) !important;\n\t\t\t\theight: ${1 / 16}rem !important;\n\t\t\t\tmargin: -${1 / 16}rem !important;\n\t\t\t\toverflow: hidden !important;\n\t\t\t\tpadding: 0 !important;\n\t\t\t\tposition: absolute !important;\n\t\t\t\twidth: ${1 / 16}rem !important;\n\t\t\t\twhite-space: nowrap !important;\n\t\t\t\ttop: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\tleft: 0;\n\t\t\t\tright: 0;\n\t\t\t}\n\n\t\t\tbutton {\n\t\t\t\tposition: relative;\n\t\t\t\tborder-radius: 50%;\n\t\t\t\tpointer-events: initial;\n\t\t\t\ttransition-property: background, transform;\n\t\t\t\ttransition-duration: ${motion.duration.small};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t\theight: ${this.getButtonSize(options)};\n\t\t\t\twidth: ${this.getButtonSize(options)};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tcursor: pointer;\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\t\t\t\toverflow: visible;\n\t\t\t\talign-items: center;\n\t\t\t\t/* Override user agent styling */\n\t\t\t\tpadding: 0;\n\t\t\t\tborder: 0;\n\t\t\t\toutline: none;\n\t\t\t\tfont-weight: bold;\n\t\t\t}\n\n\t\t\tbutton:active {\n\t\t\t\ttransform: scale(0.98);\n\t\t\t}\n\n\t\t\tbutton::-moz-focus-inner {\n\t\t\t\tborder: 0;\n\t\t\t}\n\n\t\t\t.icon {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tjustify-content: center;\n\t\t\t\ttransition-duration: ${options.isLoading ? motion.duration.xsmall : motion.duration.large};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t\topacity: ${options.isLoading ? 0 : 1};\n\t\t\t}\n\n\t\t\t${this.getTransform(options)}\n\n\t\t\t.loading-indicator-container {\n\t\t\t\ttransition-duration: ${motion.duration.large};\n\t\t\t\ttransition-property: opacity;\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t\topacity: ${options.isLoading ? 1 : 0};\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\t\t\t\talign-items: center;\n\t\t\t}\n\n\t\t\t.icon kompis-icon {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tflex-grow: 0;\n\t\t\t}\n\n\t\t\tkompis-focus-outline {\n\t\t\t\tdisplay: flex;\n\t\t\t\tborder-radius: ${border.radius.radius64 / 16}rem;\n\t\t\t}\n\n\t\t\t${this.getFocusStyle(options)}\n\n\t\t\t${!options.isDisabled && options.isLoading ? this.getLoading() : ''}\n\n\t\t\t${this.getClickableArea(options)}\n\t\t`;\n }\n /**\n * Returns button size.\n *\n * @param options\n */\n static getButtonSize(options) {\n switch (options.size) {\n case IconButtonSizeEnum_1.default.xsmall:\n return `${BUTTON_HEIGHT.xsmall / 16}rem`;\n case IconButtonSizeEnum_1.default.small:\n return `${BUTTON_HEIGHT.small / 16}rem`;\n case IconButtonSizeEnum_1.default.medium:\n return `${BUTTON_HEIGHT.medium / 16}rem`;\n default:\n return `${BUTTON_HEIGHT.medium / 16}rem`;\n }\n }\n /**\n * Returns the style for focusing the button.\n *\n * @param options Options.\n * @returns Styles.\n */\n static getFocusStyle(options) {\n return (0, web_component_1.css) `\n\t\t\tbutton:focus {\n\t\t\t\tbackground: ${this.getFocusColor(options)};\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns the text color when focusing.\n *\n * @param options Options.\n * @returns Styles.\n */\n static getFocusColor(options) {\n const { color } = options.theme;\n switch (options.buttonType) {\n case 'primary':\n return options.invertedColors ? color.background.alt : color.component.primaryHover;\n case 'emphasised':\n return options.invertedColors ? color.background.alt : color.accent.primaryAccent;\n case 'secondary':\n return color.transparency.default;\n case 'tertiary':\n return options.invertedColors\n ? IconButtonStyle.getColor(options, IconButtonOverlayColorEnum_1.default.BUTTON_COLOR_DARK)\n : color.background.alt;\n case 'danger':\n return color.semantic.negative;\n case 'imageOverlay':\n case 'image-overlay':\n return IconButtonStyle.getColor(options, IconButtonOverlayColorEnum_1.default.IMAGE_OVERLAY_COLOR);\n default:\n return color.component.primaryHover;\n }\n }\n /**\n * Provide buttonType specific styles.\n *\n * @param options Options.\n * @returns Css.\n */\n static getLayoutStyle(options) {\n switch (options.buttonType) {\n case 'primary':\n return this.getLayoutPrimary(options);\n case 'emphasised':\n return this.getLayoutEmphasised(options);\n case 'secondary':\n return this.getLayoutSecondary(options);\n case 'tertiary':\n return this.getLayoutTertiary(options);\n case 'danger':\n return this.getLayoutDanger(options);\n case 'imageOverlay':\n case 'image-overlay':\n return this.getLayoutImageOverlayButton(options);\n }\n return '';\n }\n /**\n * @returns Loading style.\n */\n static getLoading() {\n return (0, web_component_1.css) `\n\t\t\tbutton {\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\n\t\t\t.container {\n\t\t\t\tvisibility: hidden;\n\t\t\t}\n\t\t`;\n }\n /**\n * Style for button disabled.\n *\n * @param options Options.\n * @returns Style for button disabled.\n */\n static getDisabled(options) {\n return (0, web_component_1.css) `\n\t\t\tbutton {\n\t\t\t\tcolor: ${this.getDisabledColor(options)};\n\t\t\t\tbackground: ${this.getDisabledBackground(options)};\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns disabled text color.\n *\n * @param options Options.\n * @returns Style for button disabled.\n */\n static getDisabledColor(options) {\n const { color } = options.theme;\n switch (options.buttonType) {\n case 'primary':\n case 'emphasised':\n case 'secondary':\n case 'danger':\n case 'imageOverlay':\n case 'image-overlay':\n return color.neutral.grey500;\n case 'tertiary':\n return color.disabled.default;\n }\n return '';\n }\n /**\n * Returns disabled background color.\n *\n * @param options Options.\n * @returns Style for button disabled.\n */\n static getDisabledBackground(options) {\n const { color } = options.theme;\n switch (options.buttonType) {\n case 'primary':\n case 'emphasised':\n case 'secondary':\n return options.invertedColors\n ? IconButtonStyle.getColor(options, IconButtonOverlayColorEnum_1.default.BUTTON_COLOR_DARK)\n : color.disabled.default;\n case 'danger':\n return color.disabled.default;\n case 'imageOverlay':\n case 'image-overlay':\n return IconButtonStyle.getColor(options, IconButtonOverlayColorEnum_1.default.IMAGE_OVERLAY_DARKEST);\n case 'tertiary':\n return 'transparent';\n }\n return '';\n }\n /**\n * Returns background color for button types.\n *\n * @param options Options.\n */\n static getBackgroundColor(options) {\n const { color } = options.theme;\n switch (options.buttonType) {\n case 'primary':\n return options.invertedColors ? color.background.default : color.neutral.grey900;\n case 'emphasised':\n return options.invertedColors ? color.background.default : color.accent.primaryAccent;\n case 'secondary':\n return color.transparency.default;\n case 'tertiary':\n return 'transparent';\n case 'danger':\n return color.semantic.negative;\n case 'imageOverlay':\n case 'image-overlay':\n return IconButtonStyle.getColor(options, IconButtonOverlayColorEnum_1.default.IMAGE_OVERLAY_COLOR);\n }\n return '';\n }\n /**\n * Returns hover color for button types.\n *\n * @param options Options.\n */\n static getHoverColor(options) {\n const { color } = options.theme;\n switch (options.buttonType) {\n case 'primary':\n return options.invertedColors ? color.neutral.grey100 : color.component.primaryHover;\n case 'emphasised':\n return options.invertedColors ? color.neutral.grey100 : color.accent.primaryAccentDark;\n case 'secondary':\n return options.invertedColors\n ? IconButtonStyle.getColor(options, IconButtonOverlayColorEnum_1.default.BUTTON_COLOR_DARK)\n : color.border.dark;\n case 'tertiary':\n return options.invertedColors\n ? IconButtonStyle.getColor(options, IconButtonOverlayColorEnum_1.default.BUTTON_COLOR_DARK)\n : color.background.alt;\n case 'danger':\n return color.component.dangerHover;\n case 'imageOverlay':\n case 'image-overlay':\n return IconButtonStyle.getColor(options, IconButtonOverlayColorEnum_1.default.IMAGE_OVERLAY_DARK);\n }\n return '';\n }\n /**\n * Returns active color for button types.\n *\n * @param options Options.\n */\n static getActiveColor(options) {\n const { color } = options.theme;\n switch (options.buttonType) {\n case 'primary':\n return options.invertedColors ? color.neutral.grey200 : color.component.primaryPress;\n case 'emphasised':\n return options.invertedColors ? color.neutral.grey200 : color.accent.primaryAccentDarkest;\n case 'secondary':\n return options.invertedColors ? color.border.inverse : color.border.dark;\n case 'tertiary':\n return options.invertedColors\n ? IconButtonStyle.getColor(options, IconButtonOverlayColorEnum_1.default.BUTTON_COLOR_LIGHT_DARK)\n : color.neutral.grey200;\n case 'danger':\n return color.component.dangerPress;\n case 'imageOverlay':\n case 'image-overlay':\n return IconButtonStyle.getColor(options, IconButtonOverlayColorEnum_1.default.IMAGE_OVERLAY_DARKEST);\n }\n return '';\n }\n /**\n * Returns text color for button types.\n *\n * @param options Options.\n */\n static getTextColor(options) {\n const { color } = options.theme;\n switch (options.buttonType) {\n case 'primary':\n return options.invertedColors ? color.text.dark : color.neutral.white;\n case 'emphasised':\n return options.invertedColors ? color.text.dark : color.neutral.white;\n case 'secondary':\n return options.invertedColors ? color.text.inverse : color.text.dark;\n case 'tertiary':\n return options.invertedColors ? color.text.inverse : color.text.dark;\n case 'danger':\n return color.neutral.white;\n case 'imageOverlay':\n case 'image-overlay':\n return color.text.inverse;\n }\n return '';\n }\n /**\n * Style for primary buttonType.\n *\n * @param options Options.\n * @returns Style for primary buttonType.\n */\n static getLayoutPrimary(options) {\n return (0, web_component_1.css) `\n\t\t\tbutton {\n\t\t\t\tbackground: ${this.getBackgroundColor(options)};\n\t\t\t\tcolor: ${this.getTextColor(options)};\n\t\t\t}\n\n\t\t\t/* Prevents hover effect on touch. */\n\t\t\t@media (-moz-touch-enabled: 0), (pointer: fine) {\n\t\t\t\tbutton:hover {\n\t\t\t\t\tbackground: ${this.getHoverColor(options)};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbutton:active {\n\t\t\t\tbackground: ${this.getActiveColor(options)};\n\t\t\t}\n\t\t`;\n }\n /**\n * Style for text-only buttonType.\n *\n * @param options Options.\n * @returns Style for text-only buttonType.\n */\n static getLayoutEmphasised(options) {\n return (0, web_component_1.css) `\n\t\t\tbutton {\n\t\t\t\tbackground: ${this.getBackgroundColor(options)};\n\t\t\t\tcolor: ${this.getTextColor(options)};\n\t\t\t}\n\n\t\t\t/* Prevents hover effect on touch. */\n\t\t\t@media (-moz-touch-enabled: 0), (pointer: fine) {\n\t\t\t\tbutton:hover {\n\t\t\t\t\tbackground: ${this.getHoverColor(options)};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbutton:active {\n\t\t\t\tbackground: ${this.getActiveColor(options)};\n\t\t\t}\n\t\t`;\n }\n /**\n * Style for outlined buttonType.\n *\n * @param options Options.\n * @returns Style for outlined buttonType.\n */\n static getLayoutSecondary(options) {\n const { color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\tbutton {\n\t\t\t\tbackground: ${this.getBackgroundColor(options)};\n\t\t\t\tborder: ${1 / 16}rem solid\n\t\t\t\t\t${options.isDisabled\n ? 'none'\n : options.invertedColors\n ? color.border.inverse\n : color.border.dark};\n\t\t\t\tcolor: ${this.getTextColor(options)};\n\t\t\t}\n\n\t\t\t/* Prevents hover effect on touch. */\n\t\t\t@media (-moz-touch-enabled: 0), (pointer: fine) {\n\t\t\t\tbutton:hover {\n\t\t\t\t\tborder-color: ${this.getHoverColor(options)};\n\t\t\t\t\tbox-shadow: inset 0 0 0 ${1 / 16}rem\n\t\t\t\t\t\t${options.isDisabled\n ? 'none'\n : options.invertedColors\n ? color.border.inverse\n : color.border.dark};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbutton:focus {\n\t\t\t\tbox-shadow: inset 0 0 0 ${1 / 16}rem\n\t\t\t\t\t${options.isDisabled\n ? 'none'\n : options.invertedColors\n ? color.border.inverse\n : color.border.dark};\n\t\t\t}\n\n\t\t\tbutton:active {\n\t\t\t\tborder-color: ${this.getActiveColor(options)};\n\t\t\t\tbackground-color: ${options.invertedColors\n ? IconButtonStyle.getColor(options, IconButtonOverlayColorEnum_1.default.BUTTON_COLOR_SECONDARY_INVERSE)\n : IconButtonStyle.getColor(options, IconButtonOverlayColorEnum_1.default.BUTTON_COLOR_SECONDARY)};\n\t\t\t}\n\t\t`;\n }\n /**\n * @param options Options.\n * @returns Style for Tertiary buttonType.\n */\n static getLayoutTertiary(options) {\n return (0, web_component_1.css) `\n\t\t\tbutton {\n\t\t\t\tbackground: ${this.getBackgroundColor(options)};\n\t\t\t\tcolor: ${this.getTextColor(options)};\n\t\t\t}\n\n\t\t\t/* Prevents hover effect on touch. */\n\t\t\t@media (-moz-touch-enabled: 0), (pointer: fine) {\n\t\t\t\tbutton:hover {\n\t\t\t\t\tbackground: ${this.getHoverColor(options)};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbutton:active {\n\t\t\t\tbackground: ${this.getActiveColor(options)};\n\t\t\t}\n\t\t`;\n }\n /**\n * @param options Options.\n * @returns Style for danger buttonType.\n */\n static getLayoutDanger(options) {\n return (0, web_component_1.css) `\n\t\t\tbutton {\n\t\t\t\tbackground: ${this.getBackgroundColor(options)};\n\t\t\t\tcolor: ${this.getTextColor(options)};\n\t\t\t}\n\n\t\t\t/* Prevents hover effect on touch. */\n\t\t\t@media (-moz-touch-enabled: 0), (pointer: fine) {\n\t\t\t\tbutton:hover {\n\t\t\t\t\tbackground: ${this.getHoverColor(options)};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbutton:active {\n\t\t\t\tbackground: ${this.getActiveColor(options)};\n\t\t\t}\n\t\t`;\n }\n /**\n * Style for imageOverlay buttonType.\n *\n * @param options Options.\n * @returns Style for imageOverlay buttonType.\n */\n static getLayoutImageOverlayButton(options) {\n return (0, web_component_1.css) `\n\t\t\tbutton {\n\t\t\t\tbackground: ${this.getBackgroundColor(options)};\n\t\t\t\tcolor: ${this.getTextColor(options)};\n\t\t\t}\n\n\t\t\t/* Prevents hover effect on touch. */\n\t\t\t@media (-moz-touch-enabled: 0), (pointer: fine) {\n\t\t\t\tbutton:hover {\n\t\t\t\t\tbackground: ${this.getHoverColor(options)};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbutton:active {\n\t\t\t\tbackground: ${this.getActiveColor(options)};\n\t\t\t}\n\t\t`;\n }\n /**\n * Transform for Icon button.\n *\n * @param options Options.\n * */\n static getTransform(options) {\n if (options.isLoading) {\n return (0, web_component_1.css) `\n\t\t\t\t.icon {\n\t\t\t\t\ttransform: translateY(30%);\n\t\t\t\t}\n\t\t\t`;\n }\n return '';\n }\n /**\n * Get the clickable area of button.\n *\n * @param options\n * @returns Style for the clicable area of button.\n */\n static getClickableArea(options) {\n const isButtonTypeSecondary = options.buttonType === 'secondary';\n switch (options.size) {\n case IconButtonSizeEnum_1.default.xsmall:\n return (0, web_component_1.css) `\n\t\t\t\t\tbutton:after {\n\t\t\t\t\t\tcontent: '';\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\tinset: -${isButtonTypeSecondary ? (CLICKABLE_AREA.xsmallButton + 1) / 16 : CLICKABLE_AREA.xsmallButton / 16}rem;\n\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t}\n\t\t\t\t`;\n case IconButtonSizeEnum_1.default.small:\n return (0, web_component_1.css) `\n\t\t\t\t\tbutton:after {\n\t\t\t\t\t\tcontent: '';\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\tinset: -${isButtonTypeSecondary ? (CLICKABLE_AREA.smallButton + 1) / 16 : CLICKABLE_AREA.smallButton / 16}rem;\n\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t}\n\t\t\t\t`;\n default:\n return (0, web_component_1.css) `\n\t\t\t\t\tbutton:after {\n\t\t\t\t\t\tcontent: none;\n\t\t\t\t\t}\n\t\t\t\t`;\n }\n }\n}\nexports.default = IconButtonStyle;\n//# sourceMappingURL=IconButtonStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_focus_outline_1 = require(\"@inter-ikea-kompis/component-focus-outline\");\nconst component_loading_indicator_1 = require(\"@inter-ikea-kompis/component-loading-indicator\");\nrequire(\"@inter-ikea-kompis/component-icon\");\nrequire(\"@inter-ikea-kompis/component-loading-indicator\");\nrequire(\"@inter-ikea-kompis/component-focus-outline\");\nconst IconButtonSizeEnum_1 = __importDefault(require(\"../../enums/IconButtonSizeEnum\"));\nconst IconButtonStyle_1 = __importDefault(require(\"./IconButtonStyle\"));\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n * IconButton class.\n *\n * @event click Triggered when button is clicked.\n */\nlet IconButton = class IconButton extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Svg icon\n this.icon = null;\n // Renders the loading style\n this.loading = false;\n // True if the button is disabled\n this.disabled = false;\n // Inverted Colors mode\n this.invertedColors = false;\n // Flip the icon horizontally in RTL context\n this.flipIconRtl = false;\n // Type of icon button style\n this.type = 'primary';\n // Size of the icon button\n this.size = IconButtonSizeEnum_1.default.medium;\n // Accessibility description that will be set as an \"aria-label\" attribute on the icon button.\n this.ariaLabel = null;\n // Sets the behaviour of the position watcher. The position watcher is useful when the component is inside an overflown element where it can become cropped. When enabled it will be set itself to be position fixed and update the position of itself live. However, updating the position live can be slow and result in lag on slower computers. Be wary of using 'auto' or 'enabled' if the component have any ancestors with transform styling.\n this.focusOutlinePositionWatcher = component_focus_outline_1.FocusOutlinePositionWatcherEnum.auto;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n const direction = utilities_1.SafariWriteDirectionUtility.getWriteDirection(this);\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t\t\t event.preventDefault()}\"\n\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\taria-busy=\"${this.loading}\"\n\t\t\t\t\t?disabled=\"${this.disabled || this.loading}\"\n\t\t\t\t>\n\t\t\t\t\t
    \n\t\t\t\t\t${this.ariaLabel ? this.ariaLabel : null}\n\t\t\t\t\t${this.getIcon()} ${this.getLoadingIcon()}\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n /**\n * Returns icon.\n *\n * @returns Template.\n */\n getIcon() {\n if (!this.icon) {\n return null;\n }\n return (0, web_component_1.html) ` `;\n }\n /**\n * Returns loading icon.\n *\n * @returns Template.\n */\n getLoadingIcon() {\n if (!this.loading || this.disabled) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * Returns loading indicator color.\n */\n getLoadingIndicatorColor() {\n switch (this.type) {\n case 'primary':\n case 'emphasised':\n return this.invertedColors\n ? component_loading_indicator_1.LoadingIndicatorColorEnum.primary\n : component_loading_indicator_1.LoadingIndicatorColorEnum.secondary;\n case 'secondary':\n case 'tertiary':\n return this.invertedColors\n ? component_loading_indicator_1.LoadingIndicatorColorEnum.secondary\n : component_loading_indicator_1.LoadingIndicatorColorEnum.primary;\n default:\n return component_loading_indicator_1.LoadingIndicatorColorEnum.secondary;\n }\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], IconButton.prototype, \"icon\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], IconButton.prototype, \"loading\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], IconButton.prototype, \"disabled\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], IconButton.prototype, \"invertedColors\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], IconButton.prototype, \"flipIconRtl\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], IconButton.prototype, \"type\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], IconButton.prototype, \"size\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], IconButton.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], IconButton.prototype, \"ariaLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], IconButton.prototype, \"focusOutlinePositionWatcher\", void 0);\nIconButton = __decorate([\n (0, web_component_1.customElement)('kompis-icon-button')\n], IconButton);\nexports.default = IconButton;\n//# sourceMappingURL=IconButton.js.map","import \"@inter-ikea-kompis/component-icon-button/lib/components/icon-button/IconButton\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisIconButton extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-icon-button\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.ariaLabel = props.ariaLabel;\n element.disabled = props.disabled;\n element.flipIconRtl = props.flipIconRtl;\n element.focusOutlinePositionWatcher = props.focusOutlinePositionWatcher;\n element.icon = props.icon;\n element.invertedColors = props.invertedColors;\n element.loading = props.loading;\n element.size = props.size;\n element.theme = props.theme;\n element.type = props.type;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onClick, \"click\");\n }\n}\nKompisIconButton.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n ariaLabel: PropTypes.string,\n disabled: PropTypes.bool,\n flipIconRtl: PropTypes.bool,\n focusOutlinePositionWatcher: PropTypes.string,\n icon: PropTypes.string,\n invertedColors: PropTypes.bool,\n loading: PropTypes.bool,\n size: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n type: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n onClick: PropTypes.func\n};\nexport default KompisIconButton;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/* eslint-disable no-console */\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass IconPillGroupStyle {\n /**\n * @param options\n * @param options.theme\n * @param options\n * @param options.theme\n */\n static getStyle(options) {\n const { spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t.container {\n\t\t\t\tflex-wrap: wrap;\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n\t\t\t::slotted(kompis-icon-pill) {\n\t\t\t\tmargin: ${spacing.space25 / 16}rem;\n\t\t\t}\n\t\t\tkompis-icon-pill {\n\t\t\t\tmargin: ${spacing.space25 / 16}rem;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = IconPillGroupStyle;\n//# sourceMappingURL=IconPillGroupStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst IconPillGroupStyle_1 = __importDefault(require(\"./IconPillGroupStyle\"));\n/**\n * Icon Pill class.\n */\nlet IconPillGroup = class IconPillGroup extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Label for the icon pill group to set as an aria-label for accessibility reasons.\n this.ariaLabel = null;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t this.onKeyDown(event)}\">\n\t\t\t
    \n\t\t`;\n }\n /**\n * When key down.\n *\n * @param event Keyboard event.\n */\n onKeyDown(event) {\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n event.preventDefault();\n this.changeButtonFocus(+1);\n break;\n case 'ArrowLeft':\n case 'ArrowUp':\n event.preventDefault();\n this.changeButtonFocus(-1);\n break;\n }\n }\n /**\n * @param increment\n */\n changeButtonFocus(increment) {\n var _a, _b;\n const iconPills = Array.from(this.querySelectorAll('kompis-icon-pill')).filter((node) => !node.disabled);\n const currentlyFocusedIconPill = iconPills.find((element) => element.matches(':focus-within'));\n if (!currentlyFocusedIconPill) {\n return;\n }\n const index = iconPills.indexOf(currentlyFocusedIconPill);\n const iconPill = iconPills[(iconPills.length + index + increment) % iconPills.length];\n (_b = (_a = iconPill.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('div')) === null || _b === void 0 ? void 0 : _b.focus();\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], IconPillGroup.prototype, \"ariaLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], IconPillGroup.prototype, \"theme\", void 0);\nIconPillGroup = __decorate([\n (0, web_component_1.customElement)('kompis-icon-pill-group')\n], IconPillGroup);\nexports.default = IconPillGroup;\n//# sourceMappingURL=IconPillGroup.js.map","import \"@inter-ikea-kompis/component-icon-pill/lib/components/icon-pill-group/IconPillGroup\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisIconPillGroup extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-icon-pill-group\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.ariaLabel = props.ariaLabel;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisIconPillGroup.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n ariaLabel: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisIconPillGroup;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar IconPillSizeOptionsEnum;\n(function (IconPillSizeOptionsEnum) {\n IconPillSizeOptionsEnum[\"small\"] = \"small\";\n IconPillSizeOptionsEnum[\"medium\"] = \"medium\";\n})(IconPillSizeOptionsEnum || (IconPillSizeOptionsEnum = {}));\nexports.default = IconPillSizeOptionsEnum;\n//# sourceMappingURL=IconPillSizeOptionsEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/* eslint-disable no-console */\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst BUTTON_HEIGHT = {\n small: 40,\n medium: 56\n};\nclass IconPillStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.theme Theme.\n * @param options.isDisabled True if disabled.\n * @param options.icon Value of the icon prop.\n * @param options.iconPillSize Icon pill size.\n * @returns Styles.\n */\n /**\n * @param options\n */\n static getStyle(options) {\n const { color, border, motion } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tpointer-events: ${options.isDisabled ? 'none' : 'initial'};\n\t\t\t}\n\n\t\t\t.iconPillButton {\n\t\t\t\tposition: relative;\n\t\t\t\tmin-height: ${40 / 16}rem;\n\t\t\t\tpadding: 0;\n\t\t\t\toutline: none;\n\t\t\t\tborder-radius: ${border.radius.radius64 / 16}rem;\n\t\t\t\tborder: ${border.thickness.thin / 16}rem solid transparent;\n\n\t\t\t\t/* Disabled text selection */\n\t\t\t\t-webkit-touch-callout: none;\n\t\t\t\t-webkit-user-select: none;\n\t\t\t\t-khtml-user-select: none;\n\t\t\t\t-moz-user-select: none;\n\t\t\t\t-ms-user-select: none;\n\t\t\t\tuser-select: none;\n\n\t\t\t\tdisplay: inline-flex;\n\n\t\t\t\tcursor: ${options.isDisabled ? 'default' : 'pointer'};\n\t\t\t\t-webkit-tap-highlight-color: transparent;\n\n\t\t\t\tvertical-align: middle;\n\t\t\t\tjustify-content: center;\n\t\t\t\talign-items: center;\n\n\t\t\t\ttransition-property: background, transform;\n\t\t\t\ttransition-duration: ${motion.duration.xsmall};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\n\t\t\t\tbackground: ${options.isDisabled ? color.disabled.default : color.neutral.grey100};\n\t\t\t\tcolor: ${options.isDisabled ? color.neutral.grey500 : color.neutral.grey900};\n\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\theight: ${(options.iconPillSize === 'small' ? BUTTON_HEIGHT.small : BUTTON_HEIGHT.medium) /\n 16}rem;\n\t\t\t\twidth: ${(options.iconPillSize === 'small' ? BUTTON_HEIGHT.small : BUTTON_HEIGHT.medium) /\n 16}rem;\n\t\t\t}\n\n\t\t\t${this.getSelectedStyle(options)}\n\t\t\t${this.getHover(options)}\n\t\t\t${this.getFocusStyle(options)}\n\t\t`;\n }\n /**\n * Returns the style when selected.\n *\n * @param options Options.\n * @returns Styles.\n */\n static getSelectedStyle(options) {\n if (!options.selected) {\n return '';\n }\n const { motion, color, border } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t.iconPillButton {\n\t\t\t\ttransition-property: border, transform;\n\t\t\t\ttransition-duration: ${motion.duration.xsmall};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t\tborder: ${border.thickness.thin / 16}rem solid\n\t\t\t\t\t${options.isDisabled ? color.neutral.grey100 : color.neutral.grey900};\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns the style for focusing the button.\n *\n * @param options Options.\n * @returns Styles.\n */\n static getFocusStyle(options) {\n if (!options.hasFocus) {\n return '';\n }\n const { focusOutline, motion, border } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t.outline {\n\t\t\t\tposition: absolute;\n\t\t\t\tleft: -${focusOutline.offset / 16}rem;\n\t\t\t\ttop: -${focusOutline.offset / 16}rem;\n\t\t\t\tright: -${focusOutline.offset / 16}rem;\n\t\t\t\tbottom: -${focusOutline.offset / 16}rem;\n\t\t\t\tz-index: inherit;\n\t\t\t\tborder-radius: ${border.radius.radius64 / 16}rem;\n\t\t\t\tpointer-events: none;\n\t\t\t\ttransition-property: top, left, right, bottom, opacity;\n\t\t\t\ttransition-duration: ${motion.duration.large};\n\t\t\t\tbox-shadow: 0 0 0 0.1rem ${focusOutline.color};\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns hover effect.\n *\n * @param options Options object.\n * @param options.theme Theme.\n * @param options.disabled\n * @returns Css code.\n */\n static getHover(options) {\n const { color } = options.theme;\n const inner = (0, web_component_1.css) `\n\t\t\t.iconPillButton:hover {\n\t\t\t\tbackground: ${options.isDisabled ? color.neutral.grey100 : color.neutral.grey200};\n\t\t\t}\n\t\t\t.iconPillButtonSelected:hover {\n\t\t\t\tbackground: ${options.isDisabled ? color.neutral.grey100 : color.neutral.grey200};\n\t\t\t}\n\t\t\t.iconPillButton:active {\n\t\t\t\tbackground: ${options.isDisabled ? color.neutral.grey100 : color.neutral.grey300};\n\t\t\t}\n\t\t\t.iconPillButtonSelected:active {\n\t\t\t\tbackground: ${options.isDisabled ? color.neutral.grey100 : color.neutral.grey300};\n\t\t\t}\n\t\t`;\n return (0, web_component_1.css) `\n\t\t\t/* Prevent hover effect on touch. */\n\t\t\t@media (-moz-touch-enabled: 0), (pointer: fine) {\n\t\t\t\t${inner}\n\t\t\t}\n\t\t\t/* Needed for IE11 to get an hover effect. */\n\t\t\t@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n\t\t\t\t${inner}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = IconPillStyle;\n//# sourceMappingURL=IconPillStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst IconPillSizeOptionsEnum_1 = __importDefault(require(\"../../enums/IconPillSizeOptionsEnum\"));\nconst IconPillStyle_1 = __importDefault(require(\"./IconPillStyle\"));\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n *\n * Icon Pill class.\n *\n * @event select Icon pill triggers props select event.\n */\nlet IconPill = class IconPill extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Select\n this.selected = false;\n // Icon in the pill\n this.icon = null;\n // Disabled mode\n this.disabled = false;\n // Icon pill size option\n this.iconPillSize = IconPillSizeOptionsEnum_1.default.medium;\n // Label for the icon pill to set as an aria-label for accessibility reasons\n this.ariaLabel = null;\n this.hasFocus = false;\n this.pointerIsDown = false;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t\t\t
    \n\t\t\t\t${this.getIcon()}\n\t\t\t\n\t\t`;\n }\n /**\n * Get the icon.\n *\n * @returns Template.\n */\n getIcon() {\n if (!this.icon) {\n return null;\n }\n return (0, web_component_1.html) ` `;\n }\n /**\n * Event handler.\n *\n * @param event HTMLEvent.\n */\n onChange(event) {\n event.stopPropagation();\n event.preventDefault();\n if (this.disabled) {\n return;\n }\n this.dispatchEvent(new CustomEvent('select', {\n bubbles: true,\n detail: {\n selected: !this.selected\n }\n }));\n this.pointerIsDown = false;\n }\n /**\n * Event handler.\n *\n * @param event HTMLEvent.\n */\n onKeyDown(event) {\n if (this.disabled) {\n return;\n }\n if (event.key === 'Enter' || event.key === ' ') {\n this.onChange(event);\n }\n }\n /**\n * HTML event handler.\n */\n onFocusOut() {\n if (this.hasFocus) {\n this.hasFocus = false;\n this.pointerIsDown = false;\n this.update();\n }\n }\n /**\n * HTML event handler.\n */\n onFocus() {\n if (this.pointerIsDown) {\n return;\n }\n this.hasFocus = true;\n this.update();\n }\n /**\n * HTML event handler.\n *\n * @param event HTMLEvent.\n */\n onPointerDown() {\n this.pointerIsDown = true;\n if (this.hasFocus) {\n this.hasFocus = false;\n this.update();\n }\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], IconPill.prototype, \"selected\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], IconPill.prototype, \"icon\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], IconPill.prototype, \"disabled\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], IconPill.prototype, \"iconPillSize\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], IconPill.prototype, \"ariaLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], IconPill.prototype, \"theme\", void 0);\nIconPill = __decorate([\n (0, web_component_1.customElement)('kompis-icon-pill')\n], IconPill);\nexports.default = IconPill;\n//# sourceMappingURL=IconPill.js.map","import \"@inter-ikea-kompis/component-icon-pill/lib/components/icon-pill/IconPill\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisIconPill extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-icon-pill\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.ariaLabel = props.ariaLabel;\n element.disabled = props.disabled;\n element.icon = props.icon;\n element.iconPillSize = props.iconPillSize;\n element.selected = props.selected;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onSelect, \"select\");\n }\n}\nKompisIconPill.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n ariaLabel: PropTypes.string,\n disabled: PropTypes.bool,\n icon: PropTypes.string,\n iconPillSize: PropTypes.string,\n selected: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n onSelect: PropTypes.func\n};\nexport default KompisIconPill;\n","import \"@inter-ikea-kompis/component-image/lib/components/image/Image\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisImage extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-image\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.alt = props.alt;\n element.aspectRatio = props.aspectRatio;\n element.enableSkeletonLoading = props.enableSkeletonLoading;\n element.productImage = props.productImage;\n element.quality = props.quality;\n element.src = props.src;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisImage.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n alt: PropTypes.string,\n aspectRatio: PropTypes.string,\n enableSkeletonLoading: PropTypes.bool,\n productImage: PropTypes.bool,\n quality: PropTypes.string,\n src: PropTypes.string\n};\nexport default KompisImage;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * @deprecated This Enum has been deprecated. Please use Skapa instead.\n */\nvar InlineMessageLayoutEnum;\n(function (InlineMessageLayoutEnum) {\n InlineMessageLayoutEnum[\"positive\"] = \"positive\";\n InlineMessageLayoutEnum[\"informative\"] = \"informative\";\n InlineMessageLayoutEnum[\"negative\"] = \"negative\";\n InlineMessageLayoutEnum[\"caution\"] = \"caution\";\n InlineMessageLayoutEnum[\"cautionary\"] = \"cautionary\";\n})(InlineMessageLayoutEnum || (InlineMessageLayoutEnum = {}));\nexports.default = InlineMessageLayoutEnum;\n//# sourceMappingURL=InlineMessageLayoutEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar InlineMessageTypeEnum;\n(function (InlineMessageTypeEnum) {\n InlineMessageTypeEnum[\"subtle\"] = \"subtle\";\n InlineMessageTypeEnum[\"regular\"] = \"regular\";\n})(InlineMessageTypeEnum || (InlineMessageTypeEnum = {}));\nexports.default = InlineMessageTypeEnum;\n//# sourceMappingURL=InlineMessageTypeEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst InlineMessageLayoutEnum_1 = __importDefault(require(\"../../enums/InlineMessageLayoutEnum\"));\nconst InlineMessageTypeEnum_1 = __importDefault(require(\"../../enums/InlineMessageTypeEnum\"));\nconst BOX_SHADOW = 'rgba(0, 0, 0, 0.1)';\n/**\n * A class with style.\n */\nclass InlineMessageStyle {\n /**\n * Returns styles.\n *\n * @param options The props.\n * @param options.type Layout type.\n * @param options.layout Message layout.\n * @param options.theme Theme.\n * @param options.closed Closed.\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing, motion, color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: flex;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\twidth: 100%;\n\t\t\t\talign-items: flex-start;\n\t\t\t\topacity: ${options.closed ? 0 : 1};\n\t\t\t\theight: ${options.type === InlineMessageTypeEnum_1.default.subtle || !options.closed ? '100%' : 0};\n\t\t\t\tbox-shadow: ${this.getBoxShadow(options)};\n\t\t\t\ttransition-property: opacity\n\t\t\t\t\t${options.type === InlineMessageTypeEnum_1.default.regular ? ', height' : ''};\n\t\t\t\ttransition-duration: ${motion.duration.medium};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t\tborder-radius: ${spacing.space25 / 16}rem;\n\t\t\t\toverflow: ${options.closed || options.type === InlineMessageTypeEnum_1.default.regular\n ? 'hidden'\n : 'visible'};\n\t\t\t\tbackground-color: ${color.neutral.white};\n\t\t\t}\n\n\t\t\t.crossIcon {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tflex-grow: 1;\n\t\t\t\ttransition-property: height, opacity;\n\t\t\t\ttransition-duration: ${motion.duration.medium};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t\tmargin: ${options.type === InlineMessageTypeEnum_1.default.regular\n ? spacing.space50 / 16 + 'rem'\n : '0'};\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: flex-end;\n\t\t\t}\n\n\t\t\t.stripe {\n\t\t\t\twidth: ${spacing.space25 / 16}rem;\n\t\t\t\tbackground-color: ${this.getTypeColor(options)};\n\t\t\t\tflex-shrink: 0;\n\t\t\t\talign-self: stretch;\n\t\t\t}\n\n\t\t\t.textContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\tjustify-content: ${options.type === InlineMessageTypeEnum_1.default.regular\n ? 'flex-start'\n : 'center'};\n\t\t\t}\n\n\t\t\tkompis-text {\n\t\t\t\tcolor: ${color.text.default};\n\t\t\t\tword-break: break-word;\n\t\t\t}\n\n\t\t\t.title {\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\n\t\t\t.cross {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tmargin-top: -0.25rem;\n\t\t\t}\n\n\t\t\t.infoIcon kompis-icon {\n\t\t\t\tcolor: ${this.getTypeColor(options)};\n\t\t\t}\n\n\t\t\t.infoIcon {\n\t\t\t\tmargin: ${1 / 16 + 'rem 0'}; /* Added to align icon with text and title */\n\t\t\t}\n\n\t\t\t.infoIcon,\n\t\t\t.textContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: flex-start;\n\t\t\t\tpadding: ${options.type === InlineMessageTypeEnum_1.default.regular\n ? spacing.space100 / 16 + 'rem 0'\n : '0'};\n\t\t\t}\n\n\t\t\t.divider {\n\t\t\t\twidth: ${spacing.space75 / 16}rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t}\n\t\t`;\n }\n /**\n * Get type color.\n *\n * @param options Options.\n */\n static getTypeColor(options) {\n switch (options.layout) {\n case InlineMessageLayoutEnum_1.default.positive:\n return options.theme.color.semantic.positive;\n case InlineMessageLayoutEnum_1.default.informative:\n return options.theme.color.semantic.informative;\n case InlineMessageLayoutEnum_1.default.negative:\n return options.theme.color.semantic.negative;\n case InlineMessageLayoutEnum_1.default.caution:\n return options.theme.color.semantic.caution;\n default:\n return 'inherit';\n }\n }\n /**\n * @param options Options.\n * @param options.type Types of message.\n * @param options.theme Theme.\n * @returns Box shadow.\n */\n static getBoxShadow(options) {\n const { spacing } = options.theme;\n if (options.type === InlineMessageTypeEnum_1.default.subtle) {\n return 'none';\n }\n return (0, web_component_1.css) `\n\t\t\t${'0 ' + spacing.space25 / 16 + 'rem ' + '1rem ' + BOX_SHADOW}\n\t\t`;\n }\n}\nexports.default = InlineMessageStyle;\n//# sourceMappingURL=InlineMessageStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst icons_1 = require(\"@inter-ikea-kompis/icons\");\nrequire(\"@inter-ikea-kompis/component-icon\");\nrequire(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/icon-store/cross-small\");\nconst InlineMessageLayoutEnum_1 = __importDefault(require(\"../../enums/InlineMessageLayoutEnum\"));\nconst InlineMessageTypeEnum_1 = __importDefault(require(\"../../enums/InlineMessageTypeEnum\"));\nconst InlineMessageStyle_1 = __importDefault(require(\"./InlineMessageStyle\"));\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n *\n * @event close When dismissing inline message.\n */\nlet InlineMessage = class InlineMessage extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Sets how the message is presented visually\n this.type = InlineMessageTypeEnum_1.default.regular;\n // Sets layout which should be based on what the message is trying to convey\n this.layout = InlineMessageLayoutEnum_1.default.positive;\n // Custom icon that only can be set for informative layout\n this.icon = null;\n // Gives the possibility to close the message\n this.closable = false;\n // Closed\n this.closed = false;\n // Title\n this.title = '';\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t${this.getStripe()}\n\t\t\t\t${this.type === InlineMessageTypeEnum_1.default.regular ? (0, web_component_1.html) `
    ` : null}\n\t\t\t\t
    ${this.getIcon()}
    \n\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t${this.getTitle()}\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t
    ${this.getClosableIcon()}
    \n\t\t\t
    \n\t\t`;\n }\n /**\n * Retrieves correct icon.\n *\n * @returns Html.\n */\n getIcon() {\n return (0, web_component_1.html) ` `;\n }\n /**\n * Retrieves stripe.\n *\n * @returns Html.\n */\n getStripe() {\n if (this.type === InlineMessageTypeEnum_1.default.subtle) {\n return null;\n }\n return (0, web_component_1.html) `
    `;\n }\n /**\n * Get title.\n */\n getTitle() {\n if (this.type === InlineMessageTypeEnum_1.default.subtle) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t${this.title}\n\t\t`;\n }\n /**\n * Returns icon button if closable.\n */\n getClosableIcon() {\n if (!this.closable) {\n return null;\n }\n const tertiaryVariant = 'tertiary';\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('close', { bubbles: true }))}\n\t\t\t>\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n /**\n * Retrives correct icon depending on message type.\n *\n * @returns Icon.\n */\n getIconType() {\n switch (this.layout) {\n case InlineMessageLayoutEnum_1.default.positive:\n return icons_1.CheckmarkCircleIcon;\n case InlineMessageLayoutEnum_1.default.informative:\n return this.icon || icons_1.InformationCircleIcon;\n case InlineMessageLayoutEnum_1.default.negative:\n return icons_1.IncorrectIcon;\n case InlineMessageLayoutEnum_1.default.caution:\n return icons_1.WarningTriangleIcon;\n default:\n return null;\n }\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], InlineMessage.prototype, \"type\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], InlineMessage.prototype, \"layout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], InlineMessage.prototype, \"icon\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], InlineMessage.prototype, \"closable\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], InlineMessage.prototype, \"closed\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], InlineMessage.prototype, \"title\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], InlineMessage.prototype, \"theme\", void 0);\nInlineMessage = __decorate([\n (0, web_component_1.customElement)('kompis-inline-message')\n], InlineMessage);\nexports.default = InlineMessage;\n//# sourceMappingURL=InlineMessage.js.map","import \"@inter-ikea-kompis/component-inline-message/lib/components/inline-message/InlineMessage\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisInlineMessage extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-inline-message\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.closable = props.closable;\n element.closed = props.closed;\n element.icon = props.icon;\n element.layout = props.layout;\n element.theme = props.theme;\n element.title = props.title;\n element.type = props.type;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onClose, \"close\");\n }\n}\nKompisInlineMessage.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n closable: PropTypes.bool,\n closed: PropTypes.bool,\n icon: PropTypes.string,\n layout: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n title: PropTypes.string,\n type: PropTypes.string,\n onClose: PropTypes.func\n};\nexport default KompisInlineMessage;\n","import \"@inter-ikea-kompis/component-input/lib/components/input/Input\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisInput extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-input\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.autocomplete = props.autocomplete;\n element.autofocus = props.autofocus;\n element.characterCount = props.characterCount;\n element.disabled = props.disabled;\n element.helpMessage = props.helpMessage;\n element.inputMode = props.inputMode;\n element.inputName = props.inputName;\n element.label = props.label;\n element.layout = props.layout;\n element.leadingIcon = props.leadingIcon;\n element.prefix = props.prefix;\n element.selectionEnd = props.selectionEnd;\n element.selectionStart = props.selectionStart;\n element.spellcheck = props.spellcheck;\n element.suffix = props.suffix;\n element.theme = props.theme;\n element.trailingIcon = props.trailingIcon;\n element.type = props.type;\n element.value = props.value;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onFocusOut, \"focusOut\");\n this.updateEventListener(element, props.onInput, \"input\");\n }\n}\nKompisInput.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n autocomplete: PropTypes.string,\n autofocus: PropTypes.bool,\n characterCount: PropTypes.number,\n disabled: PropTypes.bool,\n helpMessage: PropTypes.string,\n inputMode: PropTypes.string,\n inputName: PropTypes.string,\n label: PropTypes.string,\n layout: PropTypes.string,\n leadingIcon: PropTypes.string,\n prefix: PropTypes.string,\n selectionEnd: PropTypes.number,\n selectionStart: PropTypes.number,\n spellcheck: PropTypes.bool,\n suffix: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n trailingIcon: PropTypes.string,\n type: PropTypes.string,\n value: PropTypes.string,\n onInput: PropTypes.func,\n onFocusOut: PropTypes.func\n};\nexport default KompisInput;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar KeyboardKeyCodeEnum;\n(function (KeyboardKeyCodeEnum) {\n KeyboardKeyCodeEnum[\"number0\"] = \"0\";\n KeyboardKeyCodeEnum[\"number1\"] = \"1\";\n KeyboardKeyCodeEnum[\"number2\"] = \"2\";\n KeyboardKeyCodeEnum[\"number3\"] = \"3\";\n KeyboardKeyCodeEnum[\"number4\"] = \"4\";\n KeyboardKeyCodeEnum[\"number5\"] = \"5\";\n KeyboardKeyCodeEnum[\"number6\"] = \"6\";\n KeyboardKeyCodeEnum[\"number7\"] = \"7\";\n KeyboardKeyCodeEnum[\"number8\"] = \"8\";\n KeyboardKeyCodeEnum[\"number9\"] = \"9\";\n KeyboardKeyCodeEnum[\"backspace\"] = \"backspace\";\n KeyboardKeyCodeEnum[\"decimal\"] = \"decimal\";\n KeyboardKeyCodeEnum[\"space\"] = \" \";\n KeyboardKeyCodeEnum[\"Q\"] = \"Q\";\n KeyboardKeyCodeEnum[\"W\"] = \"W\";\n KeyboardKeyCodeEnum[\"E\"] = \"E\";\n KeyboardKeyCodeEnum[\"R\"] = \"R\";\n KeyboardKeyCodeEnum[\"T\"] = \"T\";\n KeyboardKeyCodeEnum[\"Y\"] = \"Y\";\n KeyboardKeyCodeEnum[\"U\"] = \"U\";\n KeyboardKeyCodeEnum[\"I\"] = \"I\";\n KeyboardKeyCodeEnum[\"O\"] = \"O\";\n KeyboardKeyCodeEnum[\"P\"] = \"P\";\n KeyboardKeyCodeEnum[\"A\"] = \"A\";\n KeyboardKeyCodeEnum[\"S\"] = \"S\";\n KeyboardKeyCodeEnum[\"D\"] = \"D\";\n KeyboardKeyCodeEnum[\"F\"] = \"F\";\n KeyboardKeyCodeEnum[\"G\"] = \"G\";\n KeyboardKeyCodeEnum[\"H\"] = \"H\";\n KeyboardKeyCodeEnum[\"J\"] = \"J\";\n KeyboardKeyCodeEnum[\"K\"] = \"K\";\n KeyboardKeyCodeEnum[\"L\"] = \"L\";\n KeyboardKeyCodeEnum[\"Z\"] = \"Z\";\n KeyboardKeyCodeEnum[\"X\"] = \"X\";\n KeyboardKeyCodeEnum[\"C\"] = \"C\";\n KeyboardKeyCodeEnum[\"V\"] = \"V\";\n KeyboardKeyCodeEnum[\"B\"] = \"B\";\n KeyboardKeyCodeEnum[\"N\"] = \"N\";\n KeyboardKeyCodeEnum[\"M\"] = \"M\";\n KeyboardKeyCodeEnum[\"q\"] = \"q\";\n KeyboardKeyCodeEnum[\"w\"] = \"w\";\n KeyboardKeyCodeEnum[\"e\"] = \"e\";\n KeyboardKeyCodeEnum[\"r\"] = \"r\";\n KeyboardKeyCodeEnum[\"t\"] = \"t\";\n KeyboardKeyCodeEnum[\"y\"] = \"y\";\n KeyboardKeyCodeEnum[\"u\"] = \"u\";\n KeyboardKeyCodeEnum[\"i\"] = \"i\";\n KeyboardKeyCodeEnum[\"o\"] = \"o\";\n KeyboardKeyCodeEnum[\"p\"] = \"p\";\n KeyboardKeyCodeEnum[\"a\"] = \"a\";\n KeyboardKeyCodeEnum[\"s\"] = \"s\";\n KeyboardKeyCodeEnum[\"d\"] = \"d\";\n KeyboardKeyCodeEnum[\"f\"] = \"f\";\n KeyboardKeyCodeEnum[\"g\"] = \"g\";\n KeyboardKeyCodeEnum[\"h\"] = \"h\";\n KeyboardKeyCodeEnum[\"j\"] = \"j\";\n KeyboardKeyCodeEnum[\"k\"] = \"k\";\n KeyboardKeyCodeEnum[\"l\"] = \"l\";\n KeyboardKeyCodeEnum[\"z\"] = \"z\";\n KeyboardKeyCodeEnum[\"x\"] = \"x\";\n KeyboardKeyCodeEnum[\"c\"] = \"c\";\n KeyboardKeyCodeEnum[\"v\"] = \"v\";\n KeyboardKeyCodeEnum[\"b\"] = \"b\";\n KeyboardKeyCodeEnum[\"n\"] = \"n\";\n KeyboardKeyCodeEnum[\"m\"] = \"m\";\n KeyboardKeyCodeEnum[\"@\"] = \"@\";\n KeyboardKeyCodeEnum[\".\"] = \".\";\n KeyboardKeyCodeEnum[\"_\"] = \"_\";\n KeyboardKeyCodeEnum[\"-\"] = \"-\";\n KeyboardKeyCodeEnum[\"plus\"] = \"+\";\n})(KeyboardKeyCodeEnum || (KeyboardKeyCodeEnum = {}));\nexports.default = KeyboardKeyCodeEnum;\n//# sourceMappingURL=KeyboardKeyCodeEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst keyboard_manager_1 = require(\"@inter-ikea-kompis/keyboard-manager\");\nconst KeyboardKeyCodeEnum_1 = __importDefault(require(\"../../enums/KeyboardKeyCodeEnum\"));\nclass KeyboardButtonStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @param options.keyCode KeyboardKeyCodeEnum, the allowed buttons that exists on the keyboard.\n * @param options.type KeyboardTypeEnum, for instance text or measurement keyboards.\n * @param options.isActive \"true\" if mousedown is active for the button.\n * @returns CSS.\n */\n static getStyle(options) {\n const { color, spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\n\t\t\tbutton {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tjustify-content: center;\n\t\t\t\talign-items: center;\n\t\t\t\twidth: ${this.getWidth(options)};\n\t\t\t\theight: ${(90 / 1920) * 100}vw;\n\t\t\t\tpadding: 0;\n\t\t\t\tborder: ${1 / 16}rem solid ${color.neutral.grey900};\n\t\t\t\tborder-radius: ${4 / 16}rem;\n\t\t\t\tmargin-right: ${(spacing.space100 / 1920) * 100}vw;\n\t\t\t\tbackground: ${this.getBackgroundColor(options)};\n\t\t\t\toutline: none;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tfont-family: ${this.getFontFamily(options.theme)};\n\t\t\t\tfont-size: ${(50 / 1920) * 100}vw;\n\t\t\t}\n\t\t`;\n }\n static getBackgroundColor(options) {\n const { color } = options.theme;\n if (options.isActive) {\n return `${color.neutral.grey300};`;\n }\n if (options.keyCode === KeyboardKeyCodeEnum_1.default.backspace ||\n options.keyCode === KeyboardKeyCodeEnum_1.default.space) {\n return `${color.neutral.grey100};`;\n }\n return `${color.neutral.white}`;\n }\n // Returns keyboard button size.\n static getWidth(options) {\n if (this.isLargeKey(options)) {\n return `${(196 / 1920) * 100}vw`;\n }\n return `${(90 / 1920) * 100}vw`;\n }\n // Returns true if key is supposed to be larger than the default size for the current keyboard type.\n static isLargeKey(options) {\n switch (options.type) {\n case keyboard_manager_1.KeyboardTypeEnum.number:\n return options.keyCode === KeyboardKeyCodeEnum_1.default.number0;\n case keyboard_manager_1.KeyboardTypeEnum.text:\n case keyboard_manager_1.KeyboardTypeEnum.email:\n case keyboard_manager_1.KeyboardTypeEnum.measurement:\n return (options.keyCode === KeyboardKeyCodeEnum_1.default.backspace ||\n options.keyCode === KeyboardKeyCodeEnum_1.default.space);\n }\n return false;\n }\n static getFontFamily(theme) {\n return [theme.fontFace.family, ...theme.fontFace.fallbacks]\n .map((font) => `'${font}'`)\n .join(',');\n }\n}\nexports.default = KeyboardButtonStyle;\n//# sourceMappingURL=KeyboardButtonStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst keyboard_manager_1 = require(\"@inter-ikea-kompis/keyboard-manager\");\nconst KeyboardKeyCodeEnum_1 = __importDefault(require(\"../../enums/KeyboardKeyCodeEnum\"));\nconst KeyboardButtonStyle_1 = __importDefault(require(\"./KeyboardButtonStyle\"));\nlet KeyboardButton = class KeyboardButton extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Key code\n this.keyCode = null;\n // Type of keyboard.\n this.type = keyboard_manager_1.KeyboardTypeEnum.text;\n // Locale is used to determine the type of decimal symbol (comma or point) on the \"decimal\" keyboard layout.\n this.locale = null;\n this.listeners = {\n mouseUp: this.onMouseUp.bind(this),\n mouseDown: this.onMouseDown.bind(this),\n mouseLeave: this.onMouseLeave.bind(this)\n };\n this.active = false;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t\t\t
    ${this.getKeyText()}
    \n\t\t\t\n\t\t`;\n }\n /**\n * Return key text.\n *\n * @returns Key text.\n */\n getKeyText() {\n switch (this.keyCode) {\n case KeyboardKeyCodeEnum_1.default.backspace:\n return '⟵';\n case KeyboardKeyCodeEnum_1.default.space:\n return '␣';\n case KeyboardKeyCodeEnum_1.default.decimal:\n return this.getDecimalSymbol();\n }\n return this.keyCode;\n }\n /**\n * Returns the decimal key text.\n *\n * @returns Key text.\n */\n getDecimalSymbol() {\n if (!this.locale) {\n throw new exceptions_1.ComponentException('Failed get decimal symbol. The prop \"locale\" has not been defined.');\n }\n return (1.1).toLocaleString(this.locale).includes(',') ? ',' : '.';\n }\n /**\n * Handles mouse down event.\n *\n * @param event HTMLEvent.\n */\n onMouseDown(event) {\n if (event['sourceCapabilities'] &&\n event['sourceCapabilities'].firesTouchEvents &&\n event.type === 'mousedown') {\n return;\n }\n this.active = true;\n this.update();\n }\n /**\n * Handles mouse up event.\n *\n * @param event HTMLEvent.\n */\n onMouseUp(event) {\n if (event['sourceCapabilities'] &&\n event['sourceCapabilities'].firesTouchEvents &&\n event.type === 'mouseup') {\n return;\n }\n this.active = false;\n this.update();\n }\n /**\n * Handles mouse leave.\n */\n onMouseLeave() {\n if (this.active) {\n this.active = false;\n this.update();\n }\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], KeyboardButton.prototype, \"keyCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], KeyboardButton.prototype, \"type\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], KeyboardButton.prototype, \"locale\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], KeyboardButton.prototype, \"theme\", void 0);\nKeyboardButton = __decorate([\n (0, web_component_1.customElement)('kompis-keyboard-button')\n], KeyboardButton);\nexports.default = KeyboardButton;\n//# sourceMappingURL=KeyboardButton.js.map","import \"@inter-ikea-kompis/component-keyboard/lib/components/keyboard-button/KeyboardButton\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisKeyboardButton extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-keyboard-button\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.keyCode = props.keyCode;\n element.locale = props.locale;\n element.theme = props.theme;\n element.type = props.type;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisKeyboardButton.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n keyCode: PropTypes.string,\n locale: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n type: PropTypes.string\n};\nexport default KompisKeyboardButton;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// Keyboard layouts.\nexports.default = Object.freeze({\n // QWERTY layout.\n qwerty: {\n name: 'qwerty',\n text: [\n ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'backspace'],\n ['Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P'],\n ['A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L'],\n ['Z', 'X', 'C', 'V', 'B', 'N', 'M']\n ],\n email: [\n ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'backspace'],\n ['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p'],\n ['a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l'],\n ['z', 'x', 'c', 'v', 'b', 'n', 'm', '@', '.', '_', '-']\n ],\n number: [\n ['7', '8', '9'],\n ['4', '5', '6'],\n ['1', '2', '3'],\n ['0', 'backspace']\n ],\n decimal: [\n ['7', '8', '9'],\n ['4', '5', '6'],\n ['1', '2', '3'],\n ['0', 'decimal', 'backspace']\n ],\n tel: [\n ['1', '2', '3'],\n ['4', '5', '6'],\n ['7', '8', '9'],\n ['+', '0', 'backspace']\n ],\n measurement: [\n ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'backspace'],\n ['Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '/', '′'],\n ['A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', '″'],\n ['Z', 'X', 'C', 'V', 'B', 'N', 'M', 'decimal', ' ']\n ]\n },\n // QWERTZ layout.\n qwertz: {\n name: 'qwertz',\n text: [\n ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'backspace'],\n ['Q', 'W', 'E', 'R', 'T', 'Z', 'U', 'I', 'O', 'P'],\n ['A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L'],\n ['Y', 'X', 'C', 'V', 'B', 'N', 'M']\n ],\n email: [\n ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'backspace'],\n ['q', 'w', 'e', 'r', 't', 'z', 'u', 'i', 'o', 'p'],\n ['a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l'],\n ['y', 'x', 'c', 'v', 'b', 'n', 'm', '@', '.', '_', '-']\n ],\n number: [\n ['7', '8', '9'],\n ['4', '5', '6'],\n ['1', '2', '3'],\n ['0', 'backspace']\n ],\n decimal: [\n ['7', '8', '9'],\n ['4', '5', '6'],\n ['1', '2', '3'],\n ['0', 'decimal', 'backspace']\n ],\n tel: [\n ['1', '2', '3'],\n ['4', '5', '6'],\n ['7', '8', '9'],\n ['+', '0', 'backspace']\n ],\n measurement: [\n ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'backspace'],\n ['Q', 'W', 'E', 'R', 'T', 'Z', 'U', 'I', 'O', 'P', '/', '′'],\n ['A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', '″'],\n ['Y', 'X', 'C', 'V', 'B', 'N', 'M', 'decimal', ' ']\n ]\n },\n // AZERTY layput.\n azerty: {\n name: 'azerty',\n text: [\n ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'backspace'],\n ['A', 'Z', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P'],\n ['Q', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M'],\n ['W', 'X', 'C', 'V', 'B', 'N']\n ],\n email: [\n ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'backspace'],\n ['a', 'z', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p'],\n ['q', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm'],\n ['w', 'x', 'c', 'v', 'b', 'n', '@', '.', '_', '-']\n ],\n number: [\n ['7', '8', '9'],\n ['4', '5', '6'],\n ['1', '2', '3'],\n ['0', 'backspace']\n ],\n decimal: [\n ['7', '8', '9'],\n ['4', '5', '6'],\n ['1', '2', '3'],\n ['0', 'decimal', 'backspace']\n ],\n tel: [\n ['1', '2', '3'],\n ['4', '5', '6'],\n ['7', '8', '9'],\n ['+', '0', 'backspace']\n ],\n measurement: [\n ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'backspace'],\n ['A', 'Z', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '/', '′'],\n ['Q', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', '″'],\n ['W', 'X', 'C', 'V', 'B', 'N', 'decimal', ' ']\n ]\n }\n});\n//# sourceMappingURL=KeyboardLayout.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// Constant for keyboard transition.\nexports.default = Object.freeze({ duration: 500, timingFunction: 'ease-in-out' });\n//# sourceMappingURL=KeyboardTransition.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst KeyboardTransition_1 = __importDefault(require(\"../../enums/KeyboardTransition\"));\n/**\n * Keyboard style.\n */\nclass KeyboardStyle {\n /**\n * Returns style.\n *\n * @param options Style options.\n * @param options.isVisible True if the keyboard is visible.\n * @param options.theme Theme.\n * @param options.zIndex ZIndex.\n * @returns Keyboard CSS.\n */\n static getStyle(options) {\n const { color, spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tz-index: ${options.zIndex};\n\t\t\t\tposition: absolute;\n\t\t\t}\n\t\t\t.keyboard {\n\t\t\t\tposition: fixed;\n\t\t\t\tbottom: 0;\n\t\t\t\tleft: 0;\n\t\t\t\tright: 0;\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\twidth: 100%;\n\t\t\t\tpadding: ${(spacing.space200 / 1920) * 100}vw;\n\t\t\t\tbackground: ${color.neutral.grey100};\n\t\t\t\tborder: solid ${color.neutral.grey200};\n\t\t\t\tborder-width: ${1 / 16}rem 0 0 0;\n\t\t\t\tbox-shadow: ${7 / 16}rem ${3 / 16}rem -${5 / 16}rem rgba(0, 0, 0, 0.1);\n\t\t\t\tuser-select: none;\n\t\t\t\ttransition: transform ${KeyboardTransition_1.default.timingFunction} ${KeyboardTransition_1.default.duration}ms;\n\t\t\t\ttransform: translateY(${options.isVisible ? '0' : '100%'});\n\t\t\t}\n\n\t\t\t.row {\n\t\t\t\tdirection: ltr;\n\t\t\t\tmargin-bottom: ${(spacing.space100 / 1920) * 100}vw;\n\t\t\t\tdisplay: flex;\n\t\t\t\tposition: relative;\n\t\t\t}\n\n\t\t\t.row:last-child {\n\t\t\t\tmargin-bottom: 0;\n\t\t\t\talign-items: center;\n\t\t\t}\n\n\t\t\tkompis-text {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\tskapa-button {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tposition: absolute;\n\t\t\t\tleft: calc(100%);\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = KeyboardStyle;\n//# sourceMappingURL=KeyboardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst keyboard_manager_1 = require(\"@inter-ikea-kompis/keyboard-manager\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@ingka/button-webc\");\nrequire(\"../keyboard-button/KeyboardButton\");\nconst KeyboardKeyCodeEnum_1 = __importDefault(require(\"../../enums/KeyboardKeyCodeEnum\"));\nconst KeyboardLayout_1 = __importDefault(require(\"../../enums/KeyboardLayout\"));\nconst KeyboardStyle_1 = __importDefault(require(\"./KeyboardStyle\"));\n/**\n * A virtual keyboard view.\n *\n * @event keyPressed Dispatched when a key is pressed. Backspace is dispatched with keyCode = 'backspace'.\n * @event done When the Done button is clicked.\n */\nlet Keyboard = class Keyboard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // The keyboard layout.\n this.layout = KeyboardLayout_1.default.qwerty.name;\n // Type of keyboard.\n this.type = keyboard_manager_1.KeyboardTypeEnum.text;\n // Locale is used to determine the type of decimal symbol (comma or point) on the \"decimal\" keyboard layout.\n this.locale = null;\n // True if the keyboard is visible.\n this.visible = false;\n // Done button label.\n this.doneButtonLabel = null;\n // Override z-index of the Keyboard.\n this.zIndex = 501;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t\t
    \n\t\t\t\t${this.getKeyRows()}\n\t\t\t
    \n\t\t`;\n }\n /**\n * @param event Event.\n * Handles mouse down.\n */\n onMouseDown(event) {\n event.preventDefault();\n }\n /**\n * Returns HTML for the keys in a row.\n *\n * @returns HTML for the keys in a row.\n */\n getKeyRows() {\n const rows = KeyboardLayout_1.default[this.layout][this.type];\n return rows.map((row, index) => (0, web_component_1.html) `\n\t\t\t\t
    \n\t\t\t\t\t${row.map((keyCode) => this.getKeyboardButton(keyCode))}\n\t\t\t\t\t${index === rows.length - 1 ? this.getDoneButton() : null}\n\t\t\t\t
    \n\t\t\t`);\n }\n /**\n * Returns HTML for a key.\n *\n * @param keyCode Key code.\n * @returns HTML for a key.\n */\n getKeyboardButton(keyCode) {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n }\n /**\n * Returns a function that emits keyPressed event.\n *\n * @param keyCode Key code.\n */\n onKeyPressed(keyCode) {\n this.dispatchEvent(new CustomEvent('keyPressed', {\n bubbles: true,\n detail: {\n keyCode: keyCode === KeyboardKeyCodeEnum_1.default.decimal ? this.getDecimalSymbol() : keyCode\n }\n }));\n }\n /**\n * @returns Close button.\n */\n getDoneButton() {\n const primaryVariant = 'primary';\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${this.doneButtonLabel}\n\t\t\t\n\t\t`;\n }\n /**\n * On close click event.\n */\n onDoneClick() {\n this.dispatchEvent(new CustomEvent('done', {\n bubbles: true\n }));\n }\n /**\n * Returns the decimal key text.\n *\n * @returns Key text.\n */\n getDecimalSymbol() {\n if (!this.locale) {\n throw new exceptions_1.ComponentException('Failed get decimal symbol. The prop \"locale\" has not been defined.');\n }\n return '0' + (1.1).toLocaleString(this.locale).includes(',') ? ',' : '.';\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Keyboard.prototype, \"layout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Keyboard.prototype, \"type\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Keyboard.prototype, \"locale\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Keyboard.prototype, \"visible\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Keyboard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Keyboard.prototype, \"doneButtonLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], Keyboard.prototype, \"zIndex\", void 0);\nKeyboard = __decorate([\n (0, web_component_1.customElement)('kompis-keyboard')\n], Keyboard);\nexports.default = Keyboard;\n//# sourceMappingURL=Keyboard.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst KeyboardTransition_1 = __importDefault(require(\"../../enums/KeyboardTransition\"));\n/**\n * Keyboard style.\n */\nclass KeyboardInjectorStyle {\n /**\n * Returns style.\n *\n * @param options Options.\n * @param options.offsetY OffsetY y.\n * @returns Keyboard CSS.\n */\n static getStyle(options) {\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tposition: fixed;\n\t\t\t\ttop: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\tleft: 0;\n\t\t\t\tright: 0;\n\t\t\t}\n\n\t\t\t.app {\n\t\t\t\toverflow-y: auto;\n\t\t\t\toverflow-x: hidden;\n\t\t\t\tscroll-behavior: smooth;\n\t\t\t\tmax-height: 100%;\n\t\t\t\tmax-width: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\ttop: -${options.offsetY}px;\n\t\t\t\ttransition: ${KeyboardTransition_1.default.timingFunction} ${KeyboardTransition_1.default.duration}ms;\n\t\t\t\ttransition-property: top;\n\t\t\t\tposition: relative;\n\t\t\t}\n\n\t\t\t@media print {\n\t\t\t\tkompis-keyboard {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\t\t\t\t:host {\n\t\t\t\t\tposition: relative;\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = KeyboardInjectorStyle;\n//# sourceMappingURL=KeyboardInjectorStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst exceptions_1 = require(\"@inter-ikea-kompis/exceptions\");\nconst keyboard_manager_1 = require(\"@inter-ikea-kompis/keyboard-manager\");\nrequire(\"../keyboard/Keyboard\");\nconst KeyboardLayout_1 = __importDefault(require(\"../../enums/KeyboardLayout\"));\nconst KeyboardInjectorStyle_1 = __importDefault(require(\"./KeyboardInjectorStyle\"));\nconst PADDING = 64;\n/**\n * A virtual keyboard. This component is used with this.__keyboardManager.\n */\nlet KeyboardInjector = class KeyboardInjector extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // The keyboard layout.\n this.layout = KeyboardLayout_1.default.qwerty.name;\n // Locale is used to determine the type of decimal symbol (comma or point) on the \"decimal\" keyboard layout.\n this.locale = null;\n // Override z-index of the Keyboard.\n this.zIndex = 501;\n this.listeners = {\n keyPressed: this.onKeyPressed.bind(this),\n done: this.onDoneClick.bind(this)\n };\n this.type = keyboard_manager_1.KeyboardTypeEnum.text;\n this.input = null;\n this.offsetY = 0;\n this.keyboardManager = new keyboard_manager_1.KeyboardManager();\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t\n\t\t\t
    \n\t\t\t\n\t\t`;\n }\n /**\n * Call this function when the input is focused.\n *\n * @param inputElement Input Element.\n */\n setFocus(inputElement) {\n const inputMode = inputElement.getAttribute('inputmode');\n if (!inputMode) {\n throw new exceptions_1.ComponentElementException(this, 'The attribute \"inputmode\" is required on input elements.');\n }\n if (inputElement.type !== 'text') {\n throw new exceptions_1.ComponentElementException(this, 'The Keyboard only supports type \"text\" on input elements.');\n }\n this.type = this.getKeyboardType(inputMode);\n if (this.type === null) {\n throw new exceptions_1.ComponentElementException(this, `The InputModeEnum \"${inputMode}\" set as an attribute on the input element is not supported by the Keyboard.`);\n }\n this.input = inputElement;\n this.offsetY = this.getOffsetY();\n this.requestUpdate();\n }\n /**\n * Called when the input lost focus.\n *\n */\n removeFocus() {\n this.input = null;\n this.offsetY = 0;\n this.requestUpdate();\n }\n /**\n * @override\n */\n connectedCallback() {\n super.connectedCallback();\n this.keyboardManager.addKeyboard(this);\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.keyboardManager.removeKeyboard(this);\n }\n /**\n * Handles key pressed.\n *\n * @param event Event.\n */\n onKeyPressed(event) {\n var _a;\n if (event.detail.keyCode === 'backspace') {\n this.removeText();\n }\n else {\n this.insertCharacter(event.detail.keyCode);\n }\n (_a = this.input) === null || _a === void 0 ? void 0 : _a.dispatchEvent(new CustomEvent('input', { bubbles: true, cancelable: true }));\n }\n /**\n * On done click.\n */\n onDoneClick() {\n if (this.input) {\n this.input.blur();\n this.removeFocus();\n }\n }\n /**\n * Inserts a character in the input field.\n *\n * @param keyCode Key code.\n */\n insertCharacter(keyCode) {\n if (!this.input) {\n return;\n }\n const selectionStart = this.input.selectionStart;\n const selectionEnd = this.input.selectionEnd;\n const length = this.input.value.length;\n if (selectionStart === length) {\n // If the cursor is at the end of the string\n this.input.value += keyCode;\n }\n else if (selectionStart !== null && selectionEnd !== null) {\n const firstHalf = this.input.value.slice(0, selectionStart);\n const secondHalf = this.input.value.slice(selectionEnd);\n this.input.value = firstHalf + keyCode + secondHalf;\n const newSelectionStart = selectionStart + 1;\n this.input.setSelectionRange(newSelectionStart, newSelectionStart);\n }\n }\n /**\n * Removes text.\n */\n removeText() {\n if (!this.input) {\n return;\n }\n const selectionStart = this.input.selectionStart;\n const selectionEnd = this.input.selectionEnd;\n const length = this.input.value.length;\n if (selectionStart === length) {\n // If the cursor is at the end of the string\n this.input.value = this.input.value.slice(0, length - 1); // Remove the last character.\n }\n else if (selectionStart !== null && selectionStart === selectionEnd && selectionStart !== 0) {\n // If the cursor is not at the end of a string and no text is selected\n const firstHalf = this.input.value.slice(0, selectionStart - 1);\n const secondHalf = this.input.value.slice(selectionEnd);\n this.input.value = firstHalf + secondHalf;\n this.input.setSelectionRange(selectionStart - 1, selectionStart - 1);\n }\n else if (selectionStart !== null && selectionEnd !== null) {\n // If text is selected\n const firstHalf = this.input.value.slice(0, selectionStart);\n const secondHalf = this.input.value.slice(selectionEnd);\n this.input.value = firstHalf + secondHalf;\n this.input.setSelectionRange(selectionStart, selectionStart);\n }\n }\n /**\n * Returns keyboard type.\n *\n * @param inputMode Input mode.\n * @returns The keyboard type.\n */\n getKeyboardType(inputMode) {\n switch (inputMode) {\n case keyboard_manager_1.InputModeEnum.decimal:\n return keyboard_manager_1.KeyboardTypeEnum.decimal;\n case keyboard_manager_1.InputModeEnum.numeric:\n return keyboard_manager_1.KeyboardTypeEnum.number;\n case keyboard_manager_1.InputModeEnum.tel:\n return keyboard_manager_1.KeyboardTypeEnum.tel;\n case keyboard_manager_1.InputModeEnum.email:\n return keyboard_manager_1.KeyboardTypeEnum.email;\n case keyboard_manager_1.InputModeEnum.text:\n case keyboard_manager_1.InputModeEnum.search:\n case keyboard_manager_1.InputModeEnum.url:\n return keyboard_manager_1.KeyboardTypeEnum.text;\n case keyboard_manager_1.InputModeEnum.measurement:\n return keyboard_manager_1.KeyboardTypeEnum.measurement;\n default:\n return null;\n }\n }\n /**\n * @returns GetOffset Y.\n */\n getOffsetY() {\n var _a;\n let inputBottom = this.getInputBottom();\n let appTop = this.getAppTop();\n if (inputBottom === null || appTop === null) {\n return 0;\n }\n const distanceOutsideViewport = Math.max(inputBottom - appTop - window.innerHeight, 0);\n if (distanceOutsideViewport > 0) {\n (_a = this.input) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ block: 'nearest', behavior: 'smooth' });\n }\n inputBottom = this.getInputBottom();\n appTop = this.getAppTop();\n if (inputBottom === null || appTop === null) {\n return 0;\n }\n const diff = inputBottom +\n this.theme.spacing.space200 -\n this.getVisibleKeyboardTop() -\n distanceOutsideViewport -\n appTop;\n return Math.max(0, diff + PADDING);\n }\n /**\n * Returns the bottom position of the input in px.\n *\n * @returns Bottom position of the input in px.\n */\n getInputBottom() {\n var _a, _b;\n const inputRect = (_a = this.input) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();\n return (_b = inputRect === null || inputRect === void 0 ? void 0 : inputRect.bottom) !== null && _b !== void 0 ? _b : null;\n }\n /**\n * Returns the top position of the app container in px.\n *\n * @returns App top position in px.\n */\n getAppTop() {\n var _a, _b, _c;\n return (_c = (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.app')) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect().top) !== null && _c !== void 0 ? _c : null;\n }\n /**\n * Returns the top position of the keyboard when it's visible after the translate transition in px.\n *\n * @returns The top position of the keyboard when it's visible after the translate transition.\n */\n getVisibleKeyboardTop() {\n return window.innerHeight - this.getKeyboardHeight();\n }\n /**\n * Returns the keyboard view height in px.\n *\n * @returns Keyboard height in px.\n */\n getKeyboardHeight() {\n var _a, _b;\n const keyboard = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('kompis-keyboard');\n return ((_b = keyboard === null || keyboard === void 0 ? void 0 : keyboard.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('.keyboard')).offsetHeight;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], KeyboardInjector.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, required: true })\n], KeyboardInjector.prototype, \"doneButtonLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], KeyboardInjector.prototype, \"layout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], KeyboardInjector.prototype, \"locale\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], KeyboardInjector.prototype, \"zIndex\", void 0);\nKeyboardInjector = __decorate([\n (0, web_component_1.customElement)('kompis-keyboard-injector')\n], KeyboardInjector);\nexports.default = KeyboardInjector;\n//# sourceMappingURL=KeyboardInjector.js.map","import \"@inter-ikea-kompis/component-keyboard/lib/components/keyboard-injector/KeyboardInjector\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisKeyboardInjector extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-keyboard-injector\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.doneButtonLabel = props.doneButtonLabel;\n element.layout = props.layout;\n element.locale = props.locale;\n element.theme = props.theme;\n element.zIndex = props.zIndex;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisKeyboardInjector.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n doneButtonLabel: PropTypes.string.isRequired,\n layout: PropTypes.string,\n locale: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n zIndex: PropTypes.number\n};\nexport default KompisKeyboardInjector;\n","import \"@inter-ikea-kompis/component-keyboard/lib/components/keyboard/Keyboard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisKeyboard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-keyboard\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.doneButtonLabel = props.doneButtonLabel;\n element.layout = props.layout;\n element.locale = props.locale;\n element.theme = props.theme;\n element.type = props.type;\n element.visible = props.visible;\n element.zIndex = props.zIndex;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onDone, \"done\");\n this.updateEventListener(element, props.onKeyPressed, \"keyPressed\");\n }\n}\nKompisKeyboard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n doneButtonLabel: PropTypes.string,\n layout: PropTypes.string,\n locale: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n type: PropTypes.string,\n visible: PropTypes.bool,\n zIndex: PropTypes.number,\n onKeyPressed: PropTypes.func,\n onDone: PropTypes.func\n};\nexport default KompisKeyboard;\n","import { CachedValue } from '@ingka/webc-tools';\nimport SkapaElement from '@ingka/skapa-webc-element';\n// @ts-ignore\nconst styles = ':host{--skapa-choice-min-height:5.5rem;--skapa-choice-padding-block:1.25rem;background:#0000;display:block;list-style:none;margin:0;padding:0;width:100%}:host([size=small]){--skapa-choice-min-height:3rem;--skapa-choice-padding-block:.5rem;--skapa-choice-item-spacing:0.5rem}:host([size=medium]){--skapa-choice-min-height:4.5rem;--skapa-choice-padding-block:.75rem;--skapa-choice-item-spacing:0.75rem}::slotted(*){margin-bottom:var(--skapa-choice-item-spacing,1rem)}:host([leading-alignment=top]){--skapa-choice-leading-alignment:flex-start}:host([trailing-alignment=top]){--skapa-choice-trailing-alignment:flex-start}:host([subtle]){--skapa-choice-item-border-colour-selected:rgb(var(--colour-neutral-7,17,17,17));--skapa-choice-item-border-colour-selected-hover:rgb(var(--colour-neutral-7,17,17,17))}';\nconst defaultSize = 'large';\nlet template;\nfunction getTemplate() {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = `\n \n \n `;\n }\n return template;\n}\nexport class Choice extends SkapaElement {\n constructor() {\n super();\n // Returns the assigned elements in the leading and trailing slots.\n this.getSlottedElements = () => {\n return this.shadowSlot.assignedElements({ flatten: true });\n };\n // Cached array of the assigned elements in the leading and trailing slots.\n this.slottedElements = new CachedValue(this.getSlottedElements);\n this.handleSlotChange = () => {\n // Mark cache as outdated.\n this.slottedElements.updateCache = true;\n // If the wrapper component is disabled, then all new options should also be disabled as well.\n if (this.disabled)\n this.syncDisabledState();\n // Propagate the size related information.\n this.syncChoiceItems();\n };\n // Propagate local properties to assigned choice items.\n this.syncChoiceItems = () => {\n const size = this.size;\n this.slottedElements.value.forEach((element) => {\n element.size = size;\n });\n };\n // Propagate local disabled state to assigned choice items.\n this.syncDisabledState = () => {\n const disabled = this.disabled;\n this.slottedElements.value.forEach((element) => {\n element.disabled = disabled;\n });\n };\n this.gatherProperties(['subtle', 'deselectable', 'disabled'], this);\n const shadow = this.attachShadow({ mode: 'open' });\n shadow.append(getTemplate().content.cloneNode(true));\n this.shadowSlot = shadow.querySelector('slot');\n }\n connectedCallback() {\n super.connectedCallback();\n this.syncChoiceItems();\n this.setAttribute('role', 'list');\n this.addEventListener('choice-item-select', this.handleSelection);\n this.shadowRoot.addEventListener('slotchange', this.handleSlotChange);\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('choice-item-select', this.handleSelection);\n this.shadowRoot.removeEventListener('slotchange', this.handleSlotChange);\n }\n attributeChangedCallback(name, oldVal, newVal) {\n if (name === 'disabled') {\n // Only propagate disabled state if explicitly set.\n this.syncDisabledState();\n }\n else {\n this.syncChoiceItems();\n }\n }\n get deselectable() {\n return this.hasAttribute('deselectable');\n }\n set deselectable(val) {\n this.toggleAttribute('deselectable', !!val);\n }\n get subtle() {\n return this.hasAttribute('subtle');\n }\n set subtle(val) {\n this.toggleAttribute('subtle', !!val);\n }\n get disabled() {\n return this.hasAttribute('disabled');\n }\n set disabled(val) {\n this.toggleAttribute('disabled', !!val);\n }\n get size() {\n return this.getAttribute('size') || defaultSize;\n }\n set size(size) {\n if (size === defaultSize) {\n this.removeAttribute('size');\n }\n else {\n this.setAttribute('size', size);\n }\n }\n get leadingAlignment() {\n return this.getAttribute('leading-alignment') || 'center';\n }\n set leadingAlignment(align) {\n if (align === 'top')\n this.setAttribute('leading-alignment', align);\n else\n this.removeAttribute('leading-alignment');\n }\n get trailingAlignment() {\n return this.getAttribute('trailing-alignment') || 'center';\n }\n set trailingAlignment(align) {\n if (align === 'top')\n this.setAttribute('trailing-alignment', align);\n else\n this.removeAttribute('trailing-alignment');\n }\n handleSelection(ev) {\n const target = ev.target;\n this.slottedElements.value.forEach(element => element.selected = element === target // Mark it selected if it is the child clicked\n && !(this.deselectable // and it is not deselectable\n && target.selected) // or if it is deselectable, then deselect if already selected\n );\n }\n}\nChoice.observedAttributes = ['disabled', 'size'];\nexport default Choice;\n","import SkapaElement from '@ingka/skapa-webc-element';\n// @ts-ignore\nconst styles = ':host{box-sizing:border-box;display:block;height:0;overflow:hidden;transition:all var(--skapa-reduced-motion-override,.25s) cubic-bezier(.4,0,.4,1)}:host([hidden]){display:none}@media (prefers-reduced-motion){:host{--skapa-reduced-motion-override:16ms}}';\nlet template;\nfunction getTemplate() {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = `\n \n \n `;\n }\n return template;\n}\nexport class Collapsible extends SkapaElement {\n constructor() {\n super();\n this.updateState = () => {\n cancelAnimationFrame(this.animationFrameID);\n if (this.expanded) {\n if (this.scrollHeight === 0 || this.scrollHeight === this.offsetHeight) {\n // Nowhere to animate to.\n this.style.height = 'auto';\n }\n else {\n this.style.height = `${this.scrollHeight}px`;\n }\n }\n else {\n this.style.height = `${this.clientHeight}px`;\n this.animationFrameID = requestAnimationFrame(this.closeUp);\n }\n };\n /** This function is called on transitionend events.\n * If the component has finished opening, its height becomes auto\n * If the component has finished closing, it is removed from the layout to prevent focusing of nested items.\n */\n this.enableAuto = (ev) => {\n if (ev.target === this && ev.propertyName === 'height') {\n if (this.expanded)\n this.style.height = 'auto';\n else\n this.setAttribute('hidden', '');\n }\n };\n this.closeUp = () => {\n this.style.removeProperty('height');\n };\n this.gatherProperties(['expanded'], this);\n const shadow = this.shadow = this.attachShadow({ mode: 'open' });\n shadow.append(getTemplate().content.cloneNode(true));\n this.animationFrameID = 0;\n }\n static get observedAttributes() {\n return ['expanded'];\n }\n connectedCallback() {\n super.connectedCallback();\n const { expanded } = this;\n if (expanded)\n this.style.height = 'auto';\n this.toggleAttribute('hidden', !expanded);\n this.shadow.addEventListener('slotchange', this.updateState);\n this.addEventListener('transitionend', this.enableAuto);\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n cancelAnimationFrame(this.animationFrameID);\n this.removeEventListener('transitionend', this.enableAuto);\n this.shadow.removeEventListener('slotchange', this.updateState);\n }\n attributeChangedCallback() {\n if (this.expanded) {\n // If the component is opening from a closed state then first remove the layout-ignore state.\n this.removeAttribute('hidden');\n }\n if (this.isConnected) {\n // If it is connected, first wait for the content to be created by the layout engine.\n this.animationFrameID = requestAnimationFrame(this.updateState);\n }\n else {\n // No need to animate, the component is not connected.\n this.updateState();\n }\n }\n get expanded() {\n return this.hasAttribute('expanded');\n }\n set expanded(value) {\n this.toggleAttribute('expanded', !!value);\n }\n}\nexport default Collapsible;\n","import define from '@ingka/webc-tools';\nimport { Collapsible } from './src/Collapsible.js';\nexport { Collapsible };\nexport const collapsibleTagName = define('collapsible', Collapsible);\n","import { CachedValue, prefixReplacer, SlotTools } from '@ingka/webc-tools';\nimport SkapaElement from '@ingka/skapa-webc-element';\nimport '@ingka/collapsible-webc';\n// @ts-ignore\nconst styles = 'button{color:inherit;outline:none}:host{background:none;color:rgb(var(--colour-text-and-icon-2,72,72,72));display:flex;flex-direction:column;min-height:var(--skapa-choice-min-height,4.5rem);outline:0;position:relative;width:100%}.action{-webkit-tap-highlight-color:transparent;align-items:center;background:none;border:0;cursor:pointer;display:flex;flex:1;font-family:inherit;height:var(--skapa-choice-min-height,4.5rem);min-height:var(--skapa-choice-min-height,4.5rem);padding:var(--skapa-choice-padding-block,.75rem) 1.5rem;scroll-margin-top:var(--skapa-scroll-margin-top,inherit);text-decoration:none}.action:disabled{cursor:default}.action:disabled ::slotted(*){color:rgb(var(--colour-interactive-disabled-1,204,204,204))!important}@media (hover:hover){.action:disabled:hover:not(:disabled){text-decoration:none}}.action .content{align-items:center;display:flex;flex-direction:row;flex-grow:1;min-width:50%}.action .text-content{align-self:center;flex-grow:1;text-align:start}.action slot[name=title]::slotted(*){color:rgb(var(--colour-text-and-icon-1,17,17,17));font-size:.875rem!important;font-weight:700;line-height:1.571!important}.action slot[name=caption]::slotted(*){color:rgb(var(--colour-text-and-icon-2,72,72,72));display:block;font-size:.875rem;line-height:1.571}slot[name=trailing]{--skapa-price-font-size:0.875rem;align-self:var(--skapa-choice-trailing-alignment,center);color:rgb(var(--colour-text-and-icon-1,17,17,17));display:flex;flex-direction:column;flex-shrink:0;font-size:.875rem;font-weight:700;max-width:50%}slot[name=trailing]::slotted(*){display:block;line-height:1.571;margin-inline-start:1rem;text-align:end}slot[name=leading]::slotted(*){align-self:var(--skapa-choice-leading-alignment,center)}button:hover{--skapa-choice-item-border-colour:var(--skapa-choice-item-border-colour-hover,rgb(var(--colour-neutral-5,146,146,146)))}:host([selected]){--skapa-choice-item-border-colour:var(--skapa-choice-item-border-colour-selected,rgb(var(--colour-interactive-emphasised-border-selected,0,88,163)));--skapa-choice-item-border-colour-hover:var(--skapa-choice-item-border-colour-selected-hover,rgb(var(--colour-interactive-emphasised-border-selected,0,88,163)));--skapa-choice-item-border-width:2px}:host(:not([selected])) button:active{--skapa-choice-item-border-colour:rgb(var(--colour-neutral-7,17,17,17));--skapa-choice-item-border-colour-hover:rgb(var(--colour-neutral-7,17,17,17))}:host([disabled]){--skapa-choice-item-disabled-border-colour:rgb(var(--colour-interactive-disabled-1,204,204,204))}button:after{border:var(--skapa-choice-item-border-width,1px) solid var(--skapa-choice-item-disabled-border-colour,var(--skapa-choice-item-border-colour,rgb(var(--colour-neutral-3,223,223,223))));border-radius:4px;bottom:0;content:\"\";left:0;pointer-events:none;position:absolute;right:0;top:0}.focus-visible:after{box-shadow:0 0 0 4px var(--skapa-focus-ring-internal,rgb(var(--colour-neutral-1,255,255,255)));outline:2px solid var(--skapa-focus-ring-external,rgb(var(--colour-neutral-7,17,17,17)));outline-offset:4px;transition:outline .2s ease-out,box-shadow .2s ease-out}slot[name=leading]::slotted(*),slot[name=trailing]::slotted(*){flex-shrink:0}slot[name=leading]::slotted(skapa-image),slot[name=trailing]::slotted(skapa-image){color:#0000;height:3rem;max-width:3rem;object-fit:cover;padding:0;width:3rem}:host([disabled]) slot[name=leading]::slotted(skapa-image),:host([disabled]) slot[name=leading]::slotted(skapa-payment-logo),:host([disabled]) slot[name=trailing]::slotted(skapa-image),:host([disabled]) slot[name=trailing]::slotted(skapa-payment-logo){opacity:.4}slot[name=leading]::slotted(skapa-icon),slot[name=trailing]::slotted(skapa-icon){color:rgb(var(--colour-text-and-icon-1,17,17,17))}slot[name=leading]::slotted(*){margin-inline-end:1rem}slot[name=nested]:not(.skapa-empty){display:block;padding:0 1.5rem 1.5rem}@media (forced-colors:active){.action:disabled ::slotted(*){color:GrayText}}';\nlet template;\nfunction getTemplate() {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = prefixReplacer(`\n \n \n \n \n \n `);\n }\n return template;\n}\nexport class ChoiceItem extends SkapaElement {\n constructor() {\n super();\n // Returns the assigned elements in the leading and trailing slots.\n this.getSlottedElements = () => {\n return this.leading.assignedElements({ flatten: true })\n .concat(this.trailing.assignedElements({ flatten: true }));\n };\n // Cached array of the assigned elements in the leading and trailing slots.\n this.slottedElements = new CachedValue(this.getSlottedElements);\n this.handleActionClick = () => {\n this.dispatchEvent(new CustomEvent('choice-item-select', { bubbles: true }));\n };\n this.handleSlotChange = (ev) => {\n // Mark cache as outdated.\n this.slottedElements.updateCache = true;\n // Update `skapa-empty` class state, which is used to hide the `nested` slot when empty.\n SlotTools.slotChange(ev);\n this.syncAssignedElements();\n };\n // Set assigned Price component and PaymentLogo size.\n this.syncAssignedElements = () => {\n // Configure assigned elements\n this.slottedElements.value.forEach((element) => {\n switch (element.tagName.toLowerCase()) {\n // Configure Skapa Price\n case prefixReplacer('skapa-price'):\n element.setAttribute('size', 'small');\n break;\n // Configure Skapa Payment logo size\n case prefixReplacer('skapa-payment-logo'):\n element.toggleAttribute('small', this.__size === 'small');\n break;\n default:\n }\n });\n };\n /* Internal reference used only to propagate size sensitive configurations to potentially assigned elements, such as payment-logo.\n This setter is only meant to be called by the parent Choice component.\n */\n this.__size = 'large';\n this.gatherProperties(['disabled', 'selected'], this);\n const shadow = this.shadow = this.attachShadow({ mode: 'open' });\n shadow.append(getTemplate().content.cloneNode(true));\n this.actionButton = shadow.querySelector('#action-btn');\n this.collapser = shadow.querySelector('#collapsible');\n this.leading = shadow.querySelector('slot[name=leading]');\n this.trailing = shadow.querySelector('slot[name=trailing]');\n }\n static get observedAttributes() {\n return ['disabled', 'selected'];\n }\n connectedCallback() {\n super.connectedCallback();\n // Set Aria role\n this.setAttribute('role', 'listitem');\n // Setup toggle button behaviour.\n this.actionButton.addEventListener('click', this.handleActionClick);\n this.actionButton.setAttribute('aria-pressed', this.selected.toString());\n // Configure slots and assigned elements.\n this.syncAssignedElements();\n this.shadow.addEventListener('slotchange', this.handleSlotChange);\n Array.from(this.shadow.querySelectorAll('slot')).map(SlotTools.checkSlot);\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.actionButton.removeEventListener('click', this.handleActionClick);\n this.shadow.removeEventListener('slotchange', this.handleSlotChange);\n }\n attributeChangedCallback(attributeName) {\n if (attributeName === 'disabled' && this.actionButton) {\n this.actionButton.disabled = this.disabled;\n this.collapser.expanded = this.disabled ? false : this.selected;\n }\n else if (attributeName === 'selected')\n this.collapser.expanded = this.selected;\n }\n get disabled() {\n return this.hasAttribute('disabled');\n }\n set disabled(val) {\n this.toggleAttribute('disabled', !!val);\n }\n get selected() {\n return this.hasAttribute('selected');\n }\n set selected(val) {\n this.toggleAttribute('selected', !!val);\n this.actionButton.setAttribute('aria-pressed', val.toString());\n }\n set size(size) {\n this.__size = size;\n this.syncAssignedElements();\n }\n}\nexport default ChoiceItem;\n","import define from '@ingka/webc-tools';\nimport { Choice } from './src/Choice.js';\nimport { ChoiceItem } from './src/ChoiceItem.js';\nexport { Choice, ChoiceItem };\nexport const choiceTagName = define('choice', Choice);\nexport const choiceItemTagName = define('choice-item', ChoiceItem);\n","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@ingka/choice-webc\");\n/**\n * LanguageSelectorCard class.\n *\n * @event change Triggered when a new language is selected\n */\nlet LanguageSelectorCard = class LanguageSelectorCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"settings\" instead.\n this.localizedInformation = null;\n // The settings retrieved from settings service.\n this.settings = null;\n this.dexfSettings = null;\n }\n /**\n * @override\n */\n render() {\n // We want settings to be required, but since both props to provide settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t ${this.getChoiceItems()} \n\t\t`;\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n return true;\n }\n hasSettings() {\n return !!this.dexfSettings || !!this.localizedInformation;\n }\n getSettings() {\n return this.dexfSettings;\n }\n /**\n * Gets choice items.\n *\n * @returns Template.\n */\n getChoiceItems() {\n return utilities_1.LocalizedInformationAlternateLanguage.getAlternateLanguages(this.getSettings(), this.locale).map((language) => (0, web_component_1.html) `\n\t\t\t\t\t {\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, detail: { locale: language.locale } }));\n }}\"\n\t\t\t\t\t\t.selected=\"${this.locale === language.locale}\"\n\t\t\t\t\t>\n\t\t\t\t\t\t${language.label}\n\t\t\t\t\t\n\t\t\t\t`);\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], LanguageSelectorCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], LanguageSelectorCard.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], LanguageSelectorCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, required: true })\n], LanguageSelectorCard.prototype, \"locale\", void 0);\nLanguageSelectorCard = __decorate([\n (0, web_component_1.customElement)('kompis-language-selector-card')\n], LanguageSelectorCard);\nexports.default = LanguageSelectorCard;\n//# sourceMappingURL=LanguageSelectorCard.js.map","import \"@inter-ikea-kompis/component-language-selector/lib/components/language-selector-card/LanguageSelectorCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisLanguageSelectorCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-language-selector-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.locale = props.locale;\n element.localizedInformation = props.localizedInformation;\n element.settings = props.settings;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onChange, \"change\");\n }\n}\nKompisLanguageSelectorCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n locale: PropTypes.string.isRequired,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n onChange: PropTypes.func\n};\nexport default KompisLanguageSelectorCard;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('globe', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M13.7467 18.1766C12.9482 19.7737 12.2151 20 12 20c-.2151 0-.9482-.2263-1.7467-1.8234-.3065-.6131-.5745-1.3473-.7831-2.1766h5.0596c-.2086.8293-.4766 1.5635-.7831 2.1766zM14.8885 14h-5.777A17.7354 17.7354 0 0 1 9 12c0-.6949.0392-1.3641.1115-2h5.777c.0723.6359.1115 1.3051.1115 2 0 .6949-.0392 1.3641-.1115 2zm1.6955 2c-.2658 1.2166-.6492 2.307-1.1213 3.2138A8.0347 8.0347 0 0 0 18.9297 16H16.584zm3.164-2H16.9c.0656-.6462.1-1.3151.1-2 0-.6849-.0344-1.3538-.1-2h2.848A8.0156 8.0156 0 0 1 20 12a8.0156 8.0156 0 0 1-.252 2zm-.8183-6a8.035 8.035 0 0 0-3.467-3.2138c.4721.9068.8555 1.9972 1.1213 3.2138h2.3457zm-4.3999 0c-.2086-.8293-.4766-1.5635-.7831-2.1766C12.9482 4.2264 12.2151 4 12 4c-.2151 0-.9482.2263-1.7467 1.8234-.3065.613-.5745 1.3473-.7831 2.1766h5.0596zM7.416 8c.2658-1.2166.6491-2.307 1.1213-3.2138A8.035 8.035 0 0 0 5.0703 8H7.416zm-3.164 2A8.0147 8.0147 0 0 0 4 12c0 .6906.0875 1.3608.252 2H7.1a19.829 19.829 0 0 1-.1-2c0-.6849.0344-1.3538.1-2H4.252zm3.164 6H5.0704a8.0347 8.0347 0 0 0 3.467 3.2138C8.0651 18.307 7.6818 17.2166 7.4161 16zM22 12c0-5.5229-4.4772-10-10-10C6.4771 2 2 6.4771 2 12c0 5.5228 4.4771 10 10 10 5.5228 0 10-4.4772 10-10z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass LanguageSelectorLinkGroupStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @param options.selected\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing, color, border } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tposition: relative;\n\t\t\t}\n\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\n\t\t\t.divider {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\twidth: ${border.thickness.thin / 16}rem;\n\t\t\t\tbackground-color: ${color.border.default};\n\t\t\t\tmargin-left: ${spacing.space50 / 16}rem;\n\t\t\t\tmargin-right: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.container skapa-icon {\n\t\t\t\tmargin-inline-end: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.divider:last-child {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\tkompis-text {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t}\n\n\t\t\t.link {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tpadding: 0;\n\t\t\t\toutline: none;\n\n\t\t\t\t/* Disabled text selection */\n\t\t\t\t-webkit-touch-callout: none;\n\t\t\t\t-webkit-user-select: none;\n\t\t\t\t-khtml-user-select: none;\n\t\t\t\t-moz-user-select: none;\n\t\t\t\t-ms-user-select: none;\n\t\t\t\tuser-select: none;\n\t\t\t}\n\n\t\t\t.link::before {\n\t\t\t\tcontent: attr(data-text);\n\t\t\t\theight: 0;\n\t\t\t\tvisibility: hidden;\n\t\t\t\toverflow: hidden;\n\t\t\t\tuser-select: none;\n\t\t\t\tpointer-events: none;\n\t\t\t\tfont-weight: bold;\n\t\t\t}\n\n\t\t\t.link[aria-checked='true'] {\n\t\t\t\tfont-weight: bold;\n\t\t\t}\n\n\t\t\t${this.getActiveStyle(options)}\n\t\t`;\n }\n /**\n * Returns hover effect.\n *\n * @param options Options object.\n * @param options.theme Theme.\n * @param options.selected\n * @returns Css code.\n */\n static getActiveStyle(options) {\n const { color } = options.theme;\n const inner = (0, web_component_1.css) `\n\t\t\t.link:hover {\n\t\t\t\tcolor: ${options.selected ? color.neutral.grey100 : color.neutral.grey200};\n\t\t\t}\n\t\t\t.linkSelected:hover {\n\t\t\t\tcolor: ${options.selected ? color.neutral.grey100 : color.neutral.grey200};\n\t\t\t}\n\t\t\t.link:active {\n\t\t\t\tcolor: ${options.selected ? color.neutral.grey100 : color.neutral.grey300};\n\t\t\t}\n\t\t\t.linkSelected:active {\n\t\t\t\tcolor: ${options.selected ? color.neutral.grey100 : color.neutral.grey300};\n\t\t\t}\n\t\t`;\n return (0, web_component_1.css) `\n\t\t\t/* Prevent hover effect on touch. */\n\t\t\t@media (-moz-touch-enabled: 0), (pointer: fine) {\n\t\t\t\t${inner}\n\t\t\t}\n\t\t\t/* Needed for IE11 to get an hover effect. */\n\t\t\t@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n\t\t\t\t${inner}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = LanguageSelectorLinkGroupStyle;\n//# sourceMappingURL=LanguageSelectorLinkGroupStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_hyperlink_1 = require(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/icon-store/globe\");\nconst LanguageSelectorLinkGroupStyle_1 = __importDefault(require(\"./LanguageSelectorLinkGroupStyle\"));\n/**\n * LanguageSelectorLinkGroup class.\n *\n * @event change A change event is triggered when a new language is selected.\n */\nlet LanguageSelectorLinkGroup = class LanguageSelectorLinkGroup extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"settings\" instead.\n this.localizedInformation = null;\n // The settings retrieved from settings service.\n this.settings = null;\n this.selected = false;\n this.dexfSettings = null;\n }\n /**\n * @override\n */\n render() {\n // We want settings to be required, but since both props to provide settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    ${this.getIcon()} ${this.getLinks()}
    \n\t\t`;\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n return true;\n }\n hasSettings() {\n return !!this.dexfSettings || !!this.localizedInformation;\n }\n getSettings() {\n return this.dexfSettings;\n }\n /**\n * Returns icon.\n *\n * @returns Template.\n */\n getIcon() {\n return (0, web_component_1.html) ` `;\n }\n /**\n * Gets links.\n *\n * @returns Template.\n */\n getLinks() {\n return utilities_1.LocalizedInformationAlternateLanguage.getAlternateLanguages(this.getSettings(), this.locale).map((language) => (0, web_component_1.html) ` \n\t\t\t\t\t\t this.dispatchEvent(new CustomEvent('change', { bubbles: true, detail: { locale: language.locale } }))}\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\t
    `);\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], LanguageSelectorLinkGroup.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], LanguageSelectorLinkGroup.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], LanguageSelectorLinkGroup.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, required: true })\n], LanguageSelectorLinkGroup.prototype, \"locale\", void 0);\nLanguageSelectorLinkGroup = __decorate([\n (0, web_component_1.customElement)('kompis-language-selector-link-group')\n], LanguageSelectorLinkGroup);\nexports.default = LanguageSelectorLinkGroup;\n//# sourceMappingURL=LanguageSelectorLinkGroup.js.map","import \"@inter-ikea-kompis/component-language-selector/lib/components/language-selector-link-group/LanguageSelectorLinkGroup\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisLanguageSelectorLinkGroup extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-language-selector-link-group\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.locale = props.locale;\n element.localizedInformation = props.localizedInformation;\n element.settings = props.settings;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onChange, \"change\");\n }\n}\nKompisLanguageSelectorLinkGroup.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n locale: PropTypes.string.isRequired,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n onChange: PropTypes.func\n};\nexport default KompisLanguageSelectorLinkGroup;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar LanguageSelectorLayoutEnum;\n(function (LanguageSelectorLayoutEnum) {\n LanguageSelectorLayoutEnum[\"popover\"] = \"popover\";\n LanguageSelectorLayoutEnum[\"sheet\"] = \"sheet\";\n LanguageSelectorLayoutEnum[\"link\"] = \"link\";\n})(LanguageSelectorLayoutEnum || (LanguageSelectorLayoutEnum = {}));\nexports.default = LanguageSelectorLayoutEnum;\n//# sourceMappingURL=LanguageSelectorLayoutEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar LanguageSelectorModalEnum;\n(function (LanguageSelectorModalEnum) {\n LanguageSelectorModalEnum[\"languageSelectorPopover\"] = \"languageSelectorPopover\";\n LanguageSelectorModalEnum[\"languageSelectorSheet\"] = \"languageSelectorSheet\";\n})(LanguageSelectorModalEnum || (LanguageSelectorModalEnum = {}));\nexports.default = LanguageSelectorModalEnum;\n//# sourceMappingURL=LanguageSelectorModalEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar LanguageSelectorSizeEnum;\n(function (LanguageSelectorSizeEnum) {\n LanguageSelectorSizeEnum[\"small\"] = \"small\";\n LanguageSelectorSizeEnum[\"medium\"] = \"medium\";\n})(LanguageSelectorSizeEnum || (LanguageSelectorSizeEnum = {}));\nexports.default = LanguageSelectorSizeEnum;\n//# sourceMappingURL=LanguageSelectorSizeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass LanguageSelectorStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tposition: relative;\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\n\t\t\tkompis-popover {\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\tright: 0;\n\t\t\t}\n\n\t\t\tkompis-popover-padding {\n\t\t\t\tmax-width: ${284 / 16}rem;\n\t\t\t\twidth: calc(100vw - ${spacing.space150 / 16}rem);\n\t\t\t\tpadding: ${spacing.space150 / 16}rem;\n\t\t\t}\n\n\t\t\t.spacer {\n\t\t\t\theight: ${spacing.space100 / 16}rem;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = LanguageSelectorStyle;\n//# sourceMappingURL=LanguageSelectorStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_popover_1 = require(\"@inter-ikea-kompis/component-popover\");\nrequire(\"@inter-ikea-kompis/component-popover\");\nrequire(\"@inter-ikea-kompis/component-sheet\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/icon-store/globe\");\nrequire(\"../language-selector-card/LanguageSelectorCard\");\nrequire(\"../language-selector-link-group/LanguageSelectorLinkGroup\");\nconst LanguageSelectorLayoutEnum_1 = __importDefault(require(\"../../enums/LanguageSelectorLayoutEnum\"));\nconst LanguageSelectorModalEnum_1 = __importDefault(require(\"../../enums/LanguageSelectorModalEnum\"));\nconst LanguageSelectorSizeEnum_1 = __importDefault(require(\"../../enums/LanguageSelectorSizeEnum\"));\nconst LanguageSelectorStyle_1 = __importDefault(require(\"./LanguageSelectorStyle\"));\n/**\n * LanguageSelector class.\n *\n * @event change Triggered when a new language is selected.\n * @event modalOpen Triggered when a modal should be opened.\n * @event modalClose Triggered when a modal should be closed.\n */\nlet LanguageSelector = class LanguageSelector extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Layout.\n this.layout = LanguageSelectorLayoutEnum_1.default.popover;\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Modal visible\n this.visibleModal = null;\n // Sets the button size of the Language Selector button. Note that this doesn't change the size when layout is set to \"link\".\n this.buttonSize = LanguageSelectorSizeEnum_1.default.small;\n this.listeners = {\n hideKompisPopover: () => this.hideKompisPopover()\n };\n this.sheetElement = null;\n this.dexfSettings = null;\n }\n /**\n * @override\n */\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getLayout()}\n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.closeSheet();\n this.hideKompisPopover();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n if (changedProperties.has('visibleModal')) {\n if (this.visibleModal === LanguageSelectorModalEnum_1.default.languageSelectorSheet) {\n this.openSheet();\n }\n else {\n this.closeSheet();\n }\n }\n this.forwardPropsToCard();\n return true;\n }\n hasTranslationsAndSettings() {\n var _a;\n return (!!this.translations && !!this.settings) || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n getSettings() {\n return this.dexfSettings;\n }\n /**\n * Gets layout.\n *\n * @param options\n * @returns Template.\n */\n getLayout() {\n if (this.layout === LanguageSelectorLayoutEnum_1.default.sheet ||\n this.layout === LanguageSelectorLayoutEnum_1.default.popover) {\n return this.getButtonLayout();\n }\n else {\n return this.getLinkLayout();\n }\n }\n /**\n * Gets button layout.\n *\n * @param options\n */\n getButtonLayout() {\n return (0, web_component_1.html) `${this.getButton()} ${this.getKompisPopover()} `;\n }\n /**\n * Gets button for buttonLayout.\n *\n * @param options\n */\n getButton() {\n var _a;\n const options = utilities_1.LocalizedInformationAlternateLanguage.getAlternateLanguages(this.getSettings(), this.locale);\n if (options.length <= 1) {\n return null;\n }\n const secondaryVariant = 'secondary';\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: {\n visibleModal: this.layout === LanguageSelectorLayoutEnum_1.default.popover\n ? LanguageSelectorModalEnum_1.default.languageSelectorPopover\n : LanguageSelectorModalEnum_1.default.languageSelectorSheet\n }\n }))}\n\t\t\t\t?small=${this.buttonSize === LanguageSelectorSizeEnum_1.default.small}\n\t\t\t\tvariant=${secondaryVariant}\n\t\t\t>\n\t\t\t\t\n\t\t\t\t${(_a = options.find((option) => option.locale === this.locale)) === null || _a === void 0 ? void 0 : _a.label}\n\t\t\t\n\t\t`;\n }\n /**\n * Gets link layout.\n *\n * @param options\n * @returns Template.\n */\n getLinkLayout() {\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('change', { bubbles: true, detail: event.detail }))}\"\n\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t.settings=\"${this.settings}\"\n\t\t\t\t.localizedInformation=\"${this.localizedInformation}\"\n\t\t\t\t.locale=\"${this.locale}\"\n\t\t\t>\n\t\t\t\n\t\t`;\n }\n /**\n * Closes the sheet.\n */\n closeSheet() {\n if (this.sheetElement) {\n this.sheetElement.visible = false;\n this.sheetElement = null;\n }\n }\n /**\n * Opens the sheet.\n */\n openSheet() {\n if (this.sheetElement) {\n return;\n }\n const sheetElement = this.createSheetElement();\n const onClose = () => {\n if (this.sheetElement) {\n this.dispatchEvent(new CustomEvent('modalClose', {\n bubbles: true,\n detail: {\n visibleModal: null\n }\n }));\n }\n };\n // When user clicks 'close'\n sheetElement.addEventListener('overlayClick', onClose);\n sheetElement.addEventListener('closeButtonClick', onClose);\n // Cleanup sheet when the animation is over\n sheetElement.addEventListener('animationEnd', () => {\n var _a;\n if (!sheetElement.visible) {\n (_a = sheetElement === null || sheetElement === void 0 ? void 0 : sheetElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(sheetElement);\n }\n });\n this.sheetElement = sheetElement;\n sheetElement.visible = true;\n const parent = document.querySelector('kompis-keyboard-injector') || document.body;\n parent.appendChild(sheetElement);\n }\n /**\n * Create a sheet element.\n */\n createSheetElement() {\n const sheetElement = document.createElement('kompis-sheet');\n const sheetHeaderElement = (document.createElement('kompis-sheet-header'));\n const sheetBodyElement = document.createElement('kompis-sheet-body');\n const sheetPaddingElement = (document.createElement('kompis-sheet-body-padding'));\n sheetElement.theme = this.theme;\n sheetBodyElement.theme = this.theme;\n sheetPaddingElement.theme = this.theme;\n sheetPaddingElement.style.padding = this.theme.spacing.space150 / 16 + 'rem';\n sheetHeaderElement.theme = this.theme;\n sheetHeaderElement.heading = this.getTranslations().languagePickerLabel;\n sheetHeaderElement.ariaLabelCloseButton = this.getTranslations().modalAriaLabelButtonClose;\n this.cardElement = document.createElement('kompis-language-selector-card');\n this.forwardPropsToCard();\n this.cardElement.addEventListener('change', (event) => {\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, detail: event['detail'] }));\n });\n sheetElement.appendChild(sheetHeaderElement);\n sheetElement.appendChild(sheetBodyElement);\n sheetBodyElement.appendChild(sheetPaddingElement);\n sheetPaddingElement.appendChild(this.cardElement);\n return sheetElement;\n }\n forwardPropsToCard() {\n if (this.cardElement) {\n this.cardElement.theme = this.theme;\n this.cardElement.settings = this.settings;\n this.cardElement.localizedInformation = this.localizedInformation;\n this.cardElement.locale = this.locale;\n }\n }\n /**\n * Gets popover.\n *\n * @param options\n * @returns Template.\n */\n getKompisPopover() {\n if (this.visibleModal !== LanguageSelectorModalEnum_1.default.languageSelectorPopover) {\n return null;\n }\n // Event handler click.\n document.body.addEventListener('click', this.listeners.hideKompisPopover);\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t${this.getTranslations().languagePickerLabel}\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t
    \n\t\t\t\t\t\t this.dispatchEvent(new CustomEvent('change', { bubbles: true, detail: event.detail }))}\"\n\t\t\t\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t\t\t\t.settings=\"${this.settings}\"\n\t\t\t\t\t\t\t.localizedInformation=\"${this.localizedInformation}\"\n\t\t\t\t\t\t\t.locale=\"${this.locale}\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n /**\n * Event handler click.\n */\n hideKompisPopover() {\n this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }));\n document.body.removeEventListener('click', this.listeners.hideKompisPopover);\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], LanguageSelector.prototype, \"layout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, required: true })\n], LanguageSelector.prototype, \"locale\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], LanguageSelector.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], LanguageSelector.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], LanguageSelector.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], LanguageSelector.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], LanguageSelector.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], LanguageSelector.prototype, \"buttonSize\", void 0);\nLanguageSelector = __decorate([\n (0, web_component_1.customElement)('kompis-language-selector')\n], LanguageSelector);\nexports.default = LanguageSelector;\n//# sourceMappingURL=LanguageSelector.js.map","import \"@inter-ikea-kompis/component-language-selector/lib/components/language-selector/LanguageSelector\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisLanguageSelector extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-language-selector\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.buttonSize = props.buttonSize;\n element.layout = props.layout;\n element.locale = props.locale;\n element.localizedInformation = props.localizedInformation;\n element.settings = props.settings;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onChange, \"change\");\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n }\n}\nKompisLanguageSelector.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n buttonSize: PropTypes.string,\n layout: PropTypes.string,\n locale: PropTypes.string.isRequired,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n onChange: PropTypes.func,\n onModalOpen: PropTypes.func,\n onModalClose: PropTypes.func\n};\nexport default KompisLanguageSelector;\n","import \"@inter-ikea-kompis/component-loading-indicator/lib/components/loading-indicator/LoadingIndicator\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisLoadingIndicator extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-loading-indicator\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.color = props.color;\n element.size = props.size;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisLoadingIndicator.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n color: PropTypes.string,\n size: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisLoadingIndicator;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass LoadingSkeletonStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.theme Theme.\n * @param options.direction Write direction for safari.\n * @returns Styles.\n */\n static getStyle(options) {\n const { color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n\t\t\t.animation {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\twidth: 100%;\n\t\t\t\tcursor: progress;\n\t\t\t\tbackground-color: ${color.background.alt};\n\t\t\t\tbackground-image: linear-gradient(\n\t\t\t\t\t90deg,\n\t\t\t\t\thsla(0, 0%, 100%, 0) 40%,\n\t\t\t\t\thsla(0, 0%, 100%, 0.5) 50%,\n\t\t\t\t\thsla(0, 0%, 100%, 0) 60%\n\t\t\t\t);\n\t\t\t\tbackground-repeat: no-repeat;\n\t\t\t\tbackground-size: 250% 100%;\n\t\t\t\tbackground-position: ${options.direction === 'rtl' ? '0 100%' : '100% 0'};\n\t\t\t\tanimation: ${options.direction === 'rtl' ? 'skeleton-animation-rtl' : 'skeleton-animation'}\n\t\t\t\t\t2s infinite;\n\t\t\t}\n\n\t\t\t:host(:dir(rtl)) .animation {\n\t\t\t\tbackground-position: 0 100%;\n\t\t\t\tanimation: skeleton-animation-rtl 2s infinite;\n\t\t\t}\n\t\t\t:host-context([dir='rtl']) .animation {\n\t\t\t\tbackground-position: 0 100%;\n\t\t\t\tanimation: skeleton-animation-rtl 2s infinite;\n\t\t\t}\n\n\t\t\t@keyframes skeleton-animation {\n\t\t\t\tto {\n\t\t\t\t\tbackground-position: 0 100%;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes skeleton-animation-rtl {\n\t\t\t\tto {\n\t\t\t\t\tbackground-position: 100% 0;\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = LoadingSkeletonStyle;\n//# sourceMappingURL=LoadingSkeletonStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst LoadingSkeletonStyle_1 = __importDefault(require(\"./LoadingSkeletonStyle\"));\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n * Skeleton Loading Indicator component.\n */\nlet LoadingSkeleton = class LoadingSkeleton extends web_component_1.KompisElement {\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n const direction = utilities_1.SafariWriteDirectionUtility.getWriteDirection(this);\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], LoadingSkeleton.prototype, \"theme\", void 0);\nLoadingSkeleton = __decorate([\n (0, web_component_1.customElement)('kompis-loading-skeleton')\n], LoadingSkeleton);\nexports.default = LoadingSkeleton;\n//# sourceMappingURL=LoadingSkeleton.js.map","import \"@inter-ikea-kompis/component-loading-skeleton/lib/components/loading-skeleton/LoadingSkeleton\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisLoadingSkeleton extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-loading-skeleton\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisLoadingSkeleton.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisLoadingSkeleton;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StyleUtility = exports.ContentMargins = void 0;\nconst ContentMargins_1 = __importDefault(require(\"./components/content-margins/ContentMargins\"));\nexports.ContentMargins = ContentMargins_1.default;\nconst StyleUtility_1 = __importDefault(require(\"./utilities/StyleUtility\"));\nexports.StyleUtility = StyleUtility_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst component_content_margins_1 = require(\"@inter-ikea-kompis/component-content-margins\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nclass MainFooterStyle {\n static getStyle(options) {\n const { theme, direction } = options;\n const { background, text } = theme.color;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\n\t\t\tfooter {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: left;\n\t\t\t\tbackground-color: ${background.default};\n\t\t\t\theight: ${90 / 16}rem;\n\t\t\t}\n\n\t\t\t#footerText {\n\t\t\t\tcolor: ${text.dark};\n\t\t\t}\n\n\t\t\t/* Align left/right in Firefox & Safari */\n\t\t\t:host(:dir(rtl)) footer {\n\t\t\t\tjustify-content: right;\n\t\t\t}\n\n\t\t\t/* Align left/right in Chrome & Edge */\n\t\t\t:host-context([dir='rtl']) footer {\n\t\t\t\tjustify-content: right;\n\t\t\t}\n\n\t\t\t${component_content_margins_1.StyleUtility.getLayoutParentStyling({ cssSelector: '.wrapper', theme })}\n\t\t\t${component_content_margins_1.StyleUtility.getHorizontalSpacing({ cssSelector: '.wrapper', theme, direction })};\n\t\t\t${component_content_margins_1.StyleUtility.getLayoutChildStyling({ cssSelector: '.content', theme })}\n\t\t`;\n }\n}\nexports.default = MainFooterStyle;\n//# sourceMappingURL=MainFooterStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nconst MainFooterStyle_1 = __importDefault(require(\"./MainFooterStyle\"));\nlet MainFooter = class MainFooter extends web_component_1.KompisElement {\n /**\n * Renders the component.\n * Setting dir=ltr on so that the '©' will stay on the left side in when in rtl.\n *\n * @returns TemplateResult.\n */\n render() {\n const direction = utilities_1.SafariWriteDirectionUtility.getWriteDirection(this);\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t\n\t\t\t\t\t\t\t© Inter IKEA Systems B.V. 1999-${new Date().getFullYear()}\n\t\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], MainFooter.prototype, \"theme\", void 0);\nMainFooter = __decorate([\n (0, web_component_1.customElement)('kompis-main-footer')\n], MainFooter);\nexports.default = MainFooter;\n//# sourceMappingURL=MainFooter.js.map","import \"@inter-ikea-kompis/component-main-footer/lib/components/main-footer/MainFooter\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisMainFooter extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-main-footer\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisMainFooter.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisMainFooter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('shopping-bag', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M10.9994 4h-.5621l-.2922.4802-3.357 5.517h-5.069l.3107 1.2425 1.6212 6.4851c.334 1.3355 1.5339 2.2724 2.9105 2.2724h10.8769c1.3766 0 2.5765-.9369 2.9104-2.2724l1.6213-6.4851.3106-1.2425h-5.0695l-3.3574-5.517L13.5618 4h-2.5624zm3.8707 5.9972L12.4376 6h-.8761L9.1292 9.9972h5.7409zm-9.2787 7.2425-1.3106-5.2425h15.4384l-1.3106 5.2425a1 1 0 0 1-.9701.7575H6.5615a1 1 0 0 1-.97-.7575z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('shopping-bag-active', [{ tag: 'path', att: { d: 'M21 17.5c0 1.3807-1.1193 2.5-2.5 2.5S16 18.8807 16 17.5s1.1193-2.5 2.5-2.5 2.5 1.1193 2.5 2.5z', fill: 'rgb(var(--colour-semantic-informative, 0, 88, 163))' } }, { tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M10.4372 4h3.1244l.2922.4801 3.3574 5.517h5.0694l-.3104 1.2425L21.2804 14h-2.0615l.5005-2.0029H4.2808l1.3106 5.2426a1 1 0 0 0 .9702.7574H15v2H6.5616c-1.3766 0-2.5766-.9369-2.9105-2.2724L2.03 11.2397l-.3107-1.2426H6.788l3.357-5.517L10.4372 4zm2.0003 2L14.87 9.9971H9.1291L11.5614 6h.8761z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst analytics_1 = require(\"@inter-ikea-kompis/analytics\");\nconst insights_data_provider_1 = require(\"@insights/insights-data-provider\");\nconst moduleId = 'main_header';\n/**\n * @event navigation When any of the navigation icons is clicked.\n */\nclass MainHeaderTracker extends analytics_1.AbstractAnalyticsTracker {\n constructor(options) {\n super(Object.assign({ moduleId }, options));\n }\n /**\n * Send navigation event, i.e. When the user clicks on a link that opens a new page.\n *\n * @param step Which page the MainHeader is located.\n * @param to The destination of the link.\n */\n sendNavigation(step, to) {\n const payload = {\n common: { component: moduleId },\n data: {\n step,\n to\n }\n };\n this.getReporter().report({\n event: 'navigation',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe,\n payload\n });\n }\n}\nexports.default = MainHeaderTracker;\n//# sourceMappingURL=MainHeaderTracker.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst IkeaLogo = `\n\n\n\n\n`;\nexports.default = IkeaLogo;\n//# sourceMappingURL=IkeaLogo.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst component_content_margins_1 = require(\"@inter-ikea-kompis/component-content-margins\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nclass MainHeaderStyle {\n static getStyle(options) {\n const { theme, direction } = options;\n const { breakpoint } = theme;\n /* XXL in Kompis SkapaTheme is 1920, while Skapas is 1600, so we hardcode it here */\n const xxLargeBreakPoint = 1600;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\t\t\t${common_styles_webc_1.FocusRing.CSS}\n\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\theader {\n\t\t\t\tposition: fixed;\n\t\t\t\ttop: 0;\n\t\t\t\tz-index: 2;\n\t\t\t\tbackground: white;\n\t\t\t\tdisplay: flex;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: ${80 / 16}rem;\n\t\t\t}\n\n\t\t\t.left-menu {\n\t\t\t\tdisplay: none;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t}\n\n\t\t\t.right-menu,\n\t\t\t.right-menu-buttons,\n\t\t\t.logo-link {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t}\n\n\t\t\t.right-menu {\n\t\t\t\tjustify-content: space-between;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\n\t\t\t.right-menu-buttons {\n\t\t\t\tgap: ${theme.spacing.space50 / 16}rem;\n\t\t\t\tmargin-right: -${10 / 16}rem;\n\t\t\t}\n\n\t\t\t.ikea-logo {\n\t\t\t\twidth: ${90 / 16}rem;\n\t\t\t\theight: ${36 / 16}rem;\n\t\t\t}\n\n\t\t\t${component_content_margins_1.StyleUtility.getLayoutParentStyling({ cssSelector: 'header', theme })}\n\t\t\t${component_content_margins_1.StyleUtility.getHorizontalSpacing({ cssSelector: 'header', theme, direction })}\n\n\t\t\t@media (min-width: ${breakpoint.large.width / 16}rem) {\n\t\t\t\theader {\n\t\t\t\t\theight: ${90 / 16}rem;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@media (min-width: ${breakpoint.xlarge.width / 16}rem) {\n\t\t\t\t.left-menu {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t}\n\n\t\t\t\t.right-menu {\n\t\t\t\t\tgrid-column: 2 / span 12;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@media (min-width: ${xxLargeBreakPoint / 16}rem) {\n\t\t\t\t:host {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tjustify-content: center;\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = MainHeaderStyle;\n//# sourceMappingURL=MainHeaderStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst analytics_1 = require(\"@inter-ikea-kompis/analytics\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@inter-ikea-kompis/component-image\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/icon-store/heart\");\nrequire(\"@ingka/icon-store/shopping-bag\");\nrequire(\"@ingka/icon-store/shopping-bag-active\");\nconst MainHeaderTracker_1 = __importDefault(require(\"../../trackers/MainHeaderTracker\"));\nconst IkeaLogo_1 = __importDefault(require(\"./IkeaLogo\"));\nconst MainHeaderStyle_1 = __importDefault(require(\"./MainHeaderStyle\"));\nlet MainHeader = class MainHeader extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // Changes the icon for the shopping bag icon if cart has shoppingItems.\n this.activeShoppingBag = false;\n // Used for automatic analytics. If null or not set, analytics is turned off.\n this.analytics = null;\n this.breakpointObserver = new themes_1.ThemeBreakpointObserver(() => this.requestUpdate());\n this.dexfSettings = null;\n this.tracker = null;\n }\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n const direction = utilities_1.SafariWriteDirectionUtility.getWriteDirection(this);\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t
    ${this.largeScreenNavigation()} ${this.getHeaderNavigation()}
    \n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.breakpointObserver.disconnect();\n this.disconnectTracker();\n }\n /**\n * Required for the breakpointObserver to work.\n *\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n if (changedProperties.has('theme')) {\n this.breakpointObserver.observe(this.theme);\n }\n if (changedProperties.has('analytics')) {\n this.disconnectTracker();\n this.connectTracker();\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getSettings() {\n return this.dexfSettings;\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n connectTracker() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n if (this.analytics) {\n this.tracker = new MainHeaderTracker_1.default(Object.assign(Object.assign({}, this.analytics), { settings: this.getSettings() }));\n yield ((_a = this.tracker) === null || _a === void 0 ? void 0 : _a.connect());\n }\n });\n }\n disconnectTracker() {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.disconnect();\n this.tracker = null;\n }\n /**\n * This is hidden on the DOM, but is rendered when screens are larger than 1200px.\n * Renders a slot for the menu on the left side when media-query above is matched.\n *\n * @returns TemplateResult.\n */\n largeScreenNavigation() {\n return (0, web_component_1.html) `
    \n\t\t\t${!this.isDeviceSmallToLarge() ? (0, web_component_1.html) `` : null}\n\t\t
    `;\n }\n /**\n * Renders ikea logo on the left side, shopping list and shopping bag on the right side\n * Renders a slot for the menu on devices < 1200px.\n *\n * @returns TemplateResult.\n */\n getHeaderNavigation() {\n return (0, web_component_1.html) `
    \n\t\t\t${this.getIkeaLogo()}\n\n\t\t\t
    \n\t\t\t\t${this.getShoppingListIcon()} ${this.getShoppingBagIcon()}\n\t\t\t\t${this.isDeviceSmallToLarge() ? (0, web_component_1.html) `` : null}\n\t\t\t
    \n\t\t
    `;\n }\n /**\n * Heart icon with a link to the users /favourites.\n *\n * @returns TemplateResult.\n */\n getShoppingListIcon() {\n if (!utilities_1.ShoppingSupport.hasListSupport(this.getSettings()) || this.disableLinks) {\n return null;\n }\n const summaryPageHeaderShoppingListAriaLabel = this.getTranslations().summaryPageHeaderShoppingListAriaLabel;\n const shoppingListLink = this.getSettings().kompis.urls.shoppingListLink;\n return (0, web_component_1.html) `\n\t\t\t this.sendNavigationEvent(analytics_1.NavigationToEnum.ikeaFavorites)}\"\n\t\t\t>\n\t\t\t\t${summaryPageHeaderShoppingListAriaLabel}\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n /**\n * Shopping bag icon with a link to the users /shoppingcart.\n *\n * @returns TemplateResult.\n */\n getShoppingBagIcon() {\n if (!utilities_1.ShoppingSupport.hasCartSupport(this.getSettings()) || this.disableLinks) {\n return null;\n }\n const shoppingCartLink = this.getSettings().kompis.urls.shoppingCartLink;\n const shoppingIcon = this.activeShoppingBag ? 'shopping-bag-active' : 'shopping-bag';\n const summaryPageHeaderShoppingCartAriaLabel = this.getTranslations().summaryPageHeaderShoppingCartAriaLabel;\n return (0, web_component_1.html) `\n\t\t\t this.sendNavigationEvent(analytics_1.NavigationToEnum.ikeaCart)}\"\n\t\t\t>\n\t\t\t\t${summaryPageHeaderShoppingCartAriaLabel}\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n /**\n *\tReturns image or image-link depending on disableLinks.\n *\n * @returns TemplateResult.\n */\n getIkeaLogo() {\n const encodedLogo = encodeURIComponent(IkeaLogo_1.default);\n const svgSource = `data:image/svg+xml,${encodedLogo}`;\n const summaryPageHeaderIkeaLogoAltText = this.getTranslations().summaryPageHeaderIkeaLogoAltText;\n const image = (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n if (this.disableLinks) {\n return image;\n }\n const homePageLink = this.getSettings().kompis.urls.homePageLink;\n return (0, web_component_1.html) `\n\t\t\t this.sendNavigationEvent(analytics_1.NavigationToEnum.ikeaMainPage)}\"\n\t\t\t>\n\t\t\t\t${image}\n\t\t\t\n\t\t`;\n }\n isDeviceSmallToLarge() {\n var _a;\n const breakpointIndex = (_a = this.breakpointObserver.getBreakpointIndex()) !== null && _a !== void 0 ? _a : enums_1.ThemeBreakpointIndexEnum.small;\n return breakpointIndex <= enums_1.ThemeBreakpointIndexEnum.large;\n }\n sendNavigationEvent(to) {\n var _a;\n this.analytics && ((_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendNavigation(this.analytics.step, to));\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], MainHeader.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MainHeader.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MainHeader.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MainHeader.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], MainHeader.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], MainHeader.prototype, \"activeShoppingBag\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MainHeader.prototype, \"analytics\", void 0);\nMainHeader = __decorate([\n (0, web_component_1.customElement)('kompis-main-header')\n], MainHeader);\nexports.default = MainHeader;\n//# sourceMappingURL=MainHeader.js.map","import \"@inter-ikea-kompis/component-main-header/lib/components/main-header/MainHeader\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisMainHeader extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-main-header\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.activeShoppingBag = props.activeShoppingBag;\n element.analytics = props.analytics;\n element.disableLinks = props.disableLinks;\n element.localizedInformation = props.localizedInformation;\n element.settings = props.settings;\n element.theme = props.theme;\n element.translations = props.translations;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisMainHeader.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n activeShoppingBag: PropTypes.bool,\n analytics: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n disableLinks: PropTypes.bool,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object])\n};\nexport default KompisMainHeader;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/** @deprecated Use button types from Skapa instead. */\nvar CarouselButtonTypeEnum;\n(function (CarouselButtonTypeEnum) {\n CarouselButtonTypeEnum[\"primary\"] = \"primary\";\n CarouselButtonTypeEnum[\"tertiary\"] = \"tertiary\";\n})(CarouselButtonTypeEnum || (CarouselButtonTypeEnum = {}));\nexports.default = CarouselButtonTypeEnum;\n//# sourceMappingURL=CarouselButtonTypeEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CarouselLayoutEnum = exports.CarouselItem = exports.CarouselControls = exports.CarouselButtonTypeEnum = exports.Carousel = void 0;\nconst Carousel_1 = __importDefault(require(\"./components/carousel/Carousel\"));\nexports.Carousel = Carousel_1.default;\nconst CarouselControls_1 = __importDefault(require(\"./components/carousel-controls/CarouselControls\"));\nexports.CarouselControls = CarouselControls_1.default;\nconst CarouselItem_1 = __importDefault(require(\"./components/carousel-item/CarouselItem\"));\nexports.CarouselItem = CarouselItem_1.default;\nconst CarouselButtonTypeEnum_1 = __importDefault(require(\"./enums/CarouselButtonTypeEnum\"));\nexports.CarouselButtonTypeEnum = CarouselButtonTypeEnum_1.default;\nconst CarouselLayoutEnum_1 = __importDefault(require(\"./enums/CarouselLayoutEnum\"));\nexports.CarouselLayoutEnum = CarouselLayoutEnum_1.default;\n//# sourceMappingURL=index.js.map","export class Speedtracker {\n constructor() {\n this.lastTime = Date.now();\n this.lastValue = 0;\n this.__speed = 0;\n }\n set value(val) {\n this.__speed = (val - this.lastValue) / (Date.now() - this.lastTime);\n this.lastValue = val;\n this.lastTime = Date.now();\n }\n get speed() {\n return this.__speed;\n }\n}\n","import { getStore } from '@ingka/singleton-store';\nconst ICON_STORE_ID = 'skapa-icon-store';\n// The store will be initialized with a generic Map inside the getStore on first request.\nconst iconStore = getStore(ICON_STORE_ID);\nexport const registerIcon = (name, paths) => {\n if (!iconStore.has(name))\n iconStore.set(name, paths);\n};\nexport const getPaths = (name) => {\n if (!name)\n return;\n const result = iconStore.get(name);\n if (!result)\n console.error(`The icon: '${name}' has not been loaded yet!\\nDid you forget to import '@ingka/icon-store/${name}'?`);\n return result;\n};\n","import { registerIcon } from './index.js';\nregisterIcon('chevron-right', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'm16.415 12.0011-8.0012 8.0007-1.4141-1.4143 6.587-6.5866-6.586-6.5868L8.415 4l8 8.0011z' } }]);\n","import { registerIcon } from './index.js';\nregisterIcon('chevron-left', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'm7 12.0009 8.0012-8.0007 1.4142 1.4142-6.587 6.5866 6.5859 6.5868L15 20.002l-8-8.0011z' } }]);\n","import { registerIcon } from './index.js';\nregisterIcon('chevron-right-small', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'm15.5996 12.0007-5.785 5.7857-1.4143-1.4141 4.3711-4.3716L8.4003 7.629l1.4143-1.4142 5.785 5.7859z' } }]);\n","import { registerIcon } from './index.js';\nregisterIcon('chevron-left-small', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'm8.4004 12.0007 5.785 5.7857 1.4143-1.4141-4.3711-4.3716 4.3711-4.3717-1.4143-1.4142-5.785 5.7859z' } }]);\n","import { prefixReplacer, RTLObserver } from '@ingka/webc-tools';\nimport SkapaElement from '@ingka/skapa-webc-element';\nimport '@ingka/button-webc';\nimport '@ingka/icon-webc';\nimport '@ingka/icon-store/chevron-right';\nimport '@ingka/icon-store/chevron-left';\nimport '@ingka/icon-store/chevron-right-small';\nimport '@ingka/icon-store/chevron-left-small';\n// @ts-ignore\nconst styles = ':host{--skapa-carousel-control-offset:-1.25rem;display:none;height:2.5rem;pointer-events:none;position:relative;width:100%}:host([hidden]){visibility:hidden}.next,.prev{pointer-events:all;position:absolute;transition:opacity .2s cubic-bezier(.4,0,.4,1)}.next.hidden,.prev.hidden{opacity:0;pointer-events:none}.prev{left:var(--skapa-carousel-control-offset)}.next{right:var(--skapa-carousel-control-offset)}:host([overflow]){--skapa-carousel-control-offset:0.5rem;display:block}@media (min-width:37.5em){:host{display:block}}';\nconst getTemplate = () => prefixReplacer(`\n\n\n \n\n\n \n\n`);\nexport const NavigationEventDirection = {\n PREV: 'CAROUSEL_CONTROL_PREV',\n NEXT: 'CAROUSEL_CONTROL_NEXT'\n};\nexport const NavigationEventType = 'SKAPA_CAROUSEL_NAVIGATION';\nexport class NavigationEvent extends Event {\n constructor(navigationType) {\n super(NavigationEventType, { composed: true, bubbles: true });\n this.navigationType = navigationType;\n }\n}\nconst UDPATE_FREQUENCY = 1 / 10;\nexport class CarouselControls extends SkapaElement {\n constructor() {\n super();\n this.state = {\n visibility: {\n prevButton: false,\n nextButton: false\n }\n };\n this.handlePointerUp = (ev) => {\n const { PREV, NEXT } = NavigationEventDirection;\n this.dispatchEvent(new NavigationEvent(ev.currentTarget === this.prevButton ? PREV : NEXT));\n };\n this.syncState = () => {\n const { prevButton, nextButton, state: { visibility } } = this;\n prevButton.classList.toggle('hidden', !visibility.prevButton);\n prevButton.disabled = !visibility.prevButton;\n nextButton.classList.toggle('hidden', !visibility.nextButton);\n nextButton.disabled = !visibility.nextButton;\n };\n this.overflowInconsistentControlsForTouchUsers = (ev) => {\n // If the first touch interaction was not with the overflow controls then we assume we'll never ever need them again. (according to spec)\n if (!ev.composedPath().includes(this))\n this.hidden = true;\n };\n const shadow = this.attachShadow({ mode: 'open' });\n shadow.innerHTML = getTemplate();\n this.leftButton = shadow.querySelector('.prev');\n this.rightButton = shadow.querySelector('.next');\n this.iconPrev = this.leftButton.querySelector('[icon]');\n this.iconNext = this.rightButton.querySelector('[icon]');\n }\n static get observedAttributes() {\n return ['overflow', 'skapa-rtl'];\n }\n connectedCallback() {\n RTLObserver.addTarget(this);\n this.leftButton.addEventListener('click', this.handlePointerUp);\n this.rightButton.addEventListener('click', this.handlePointerUp);\n const parent = this.parentNode && this.parentNode.host;\n if (parent)\n parent.addEventListener('touchstart', this.overflowInconsistentControlsForTouchUsers, { once: true, passive: true });\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n RTLObserver.removeTarget(this);\n this.leftButton.removeEventListener('click', this.handlePointerUp);\n this.rightButton.removeEventListener('click', this.handlePointerUp);\n const parent = this.parentNode && this.parentNode.host;\n if (parent)\n parent.removeEventListener('touchstart', this.overflowInconsistentControlsForTouchUsers);\n }\n get isRTL() {\n return this.hasAttribute('skapa-rtl');\n }\n get nextButton() {\n return this.isRTL ? this.leftButton : this.rightButton;\n }\n get prevButton() {\n return this.isRTL ? this.rightButton : this.leftButton;\n }\n set prev(value) {\n this.state.visibility.prevButton = value;\n this.micro(this.syncState, 'synchronising control buttons visibility state', UDPATE_FREQUENCY);\n }\n set next(value) {\n this.state.visibility.nextButton = value;\n this.micro(this.syncState, 'synchronising control buttons visibility state', UDPATE_FREQUENCY);\n }\n // This should be refactored into slot provisions instead.\n get overflow() {\n return this.hasAttribute('overflow');\n }\n set overflow(value) {\n this.toggleAttribute('overflow', !!value);\n }\n // Returns an offset value to ensure the paging buttons do not cover the content.\n get controllerWidth() {\n return this.overflow ? 40 : 0;\n }\n attributeChangedCallback() {\n if (this.overflow) {\n this.leftButton.xsmall = this.rightButton.xsmall = true;\n this.leftButton.inverse = this.rightButton.inverse = true;\n this.iconPrev.icon = 'chevron-left-small';\n this.iconNext.icon = 'chevron-right-small';\n }\n else {\n this.leftButton.xsmall = this.rightButton.xsmall = false;\n this.leftButton.inverse = this.rightButton.inverse = false;\n this.iconPrev.icon = 'chevron-left';\n this.iconNext.icon = 'chevron-right';\n }\n this.micro(this.syncState, 'synchronising control buttons visibility state', UDPATE_FREQUENCY);\n }\n}\n","import { prefixReplacer, RTLObserver } from '@ingka/webc-tools';\nimport { Speedtracker } from '../features/utils/speed-tracker.js';\nimport { NavigationEvent, NavigationEventDirection } from './CarouselControls.js';\n// @ts-ignore\nconst styles = ':host{--height:.125rem;align-items:center;cursor:pointer;display:flex;height:1.875rem;position:relative;touch-action:none;transition:opacity .1s cubic-bezier(.4,0,.4,1)}:host(.hide){opacity:0}:host(:focus){outline:none}:host(.focus-visible),:host(:hover){--height:.25rem}.track{align-items:center;background-color:rgb(var(--colour-neutral-3,223,223,223));border-radius:var(--height);display:flex;height:var(--height);transition:height .1s cubic-bezier(.4,0,.4,1);width:100%}:host(.focus-visible) .handle{--height:.5rem}.handle{background-color:rgb(var(--colour-neutral-7,17,17,17));border-radius:var(--height);height:var(--height);margin-inline-start:var(--skapaScrollHandleLeft,0);position:relative;transition:inherit;transition-property:inherit;width:var(--skapaScrollHandleWidth,10%)}.handle.drag,.handle.drag:hover{--height:.5rem}.handle:after{content:\" \";cursor:grab;height:2.75rem;left:50%;min-width:2.75rem;position:absolute;transform:translate(-50%,-50%);width:100%;z-index:3}:host(.focus-visible) .handle{box-shadow:0 0 0 4px rgb(var(--colour-neutral-1,255,255,255)),0 0 0 6px rgb(var(--colour-neutral-7,17,17,17));transition-duration:.2s;transition-property:box-shadow;transition-timing-function:ease-out}';\nconst styles_template = document.createElement('template');\nstyles_template.innerHTML = prefixReplacer(`\n\n
    \n
    \n
    `);\nfunction cancelEvent(ev) {\n ev.preventDefault();\n}\nexport class Scrollbar extends HTMLElement {\n constructor() {\n super();\n this.dragOffsetX = 0;\n this.animationID = -1;\n this.speedTracker = new Speedtracker();\n this.handleDragStart = (ev) => {\n if (typeof window !== 'undefined') {\n // SSR safety\n window.addEventListener('pointerleave', this.handleDragEnd);\n window.addEventListener('pointermove', this.updatePosition);\n window.addEventListener('pointerup', this.handleDragEnd);\n }\n this.handle.classList.toggle('drag', true);\n this.speedTracker.value = this.currentOffset;\n const biDirectionalOffset = this.isRTL\n ? (this.handle.offsetLeft + this.handle.clientWidth) - this.clientWidth\n : this.handle.offsetLeft;\n // dragOffset holds the handle position and startup and the pointer position on the handle.\n this.dragOffsetX = ev.pageX - biDirectionalOffset;\n this.dispatchEvent(new CustomEvent('skapa-scrollbar-scroll-start'));\n };\n this.handleDragEnd = () => {\n cancelAnimationFrame(this.animationID);\n if (typeof window !== 'undefined') {\n // SSR safety\n window.removeEventListener('pointerleave', this.handleDragEnd);\n window.removeEventListener('pointerup', this.handleDragEnd);\n window.removeEventListener('pointermove', this.updatePosition);\n }\n this.handle.classList.toggle('drag', false);\n this.handle.style.setProperty('--skapaScrollHandleLeft', null);\n this.dispatchEvent(new CustomEvent('skapa-scrollbar-scroll-end', { detail: this.speedTracker.speed * 100 }));\n };\n this.updatePosition = (ev) => {\n const rawDragOffset = (ev.pageX - this.dragOffsetX) * (this.isRTL ? -1 : 1);\n const dragPos = (Math.min(Math.max((rawDragOffset), 0), this.clientWidth - this.handle.clientWidth) / this.clientWidth);\n cancelAnimationFrame(this.animationID);\n this.animationID = requestAnimationFrame(() => {\n // measure speed for intertia scrolling effect\n this.speedTracker.value = this.currentOffset;\n this.handle.style.setProperty('--skapaScrollHandleLeft', `${(100 * dragPos).toFixed(2)}%`);\n this.dispatchEvent(new CustomEvent('skapa-scrollbar-scroll', { detail: { dragPos } }));\n });\n };\n this.navigateTrack = (ev) => {\n // ignore if the click targeted the handle\n if (ev.composedPath()[0] === this.handle)\n return;\n const scrollBarPosition = this.getBoundingClientRect();\n const clickTarget = (ev.pageX - scrollBarPosition.x) / scrollBarPosition.width;\n const scrollBarCenter = this.handle.clientWidth * 0.5 / scrollBarPosition.width;\n const targetOffsetPercent = Math.max(Math.min((this.isRTL ? 1 - clickTarget : clickTarget) - scrollBarCenter, 1), 0);\n this.dispatchEvent(new CustomEvent('skapa-scrollbar-scroll', { detail: { dragPos: targetOffsetPercent.toFixed(2) } }));\n };\n this.handleKey = (ev) => {\n if (ev.shiftKey || ev.ctrlKey || ev.metaKey || ev.altKey)\n return;\n const forwardKey = this.isRTL ? 'ArrowLeft' : 'ArrowRight';\n const backwardKey = this.isRTL ? 'ArrowRight' : 'ArrowLeft';\n const { PREV, NEXT } = NavigationEventDirection;\n if (ev.key === backwardKey) {\n ev.preventDefault();\n this.dispatchEvent(new NavigationEvent(PREV));\n }\n if (ev.key === forwardKey) {\n ev.preventDefault();\n this.dispatchEvent(new NavigationEvent(NEXT));\n }\n };\n const shadow = this.attachShadow({ mode: 'open' });\n shadow.append(styles_template.content.cloneNode(true));\n this.handle = shadow.querySelector('.handle');\n this.ariaOrientation = 'horizontal';\n }\n get isRTL() {\n return this.hasAttribute('skapa-rtl');\n }\n /** Returns the current scroll offset value in decimal percentage; 0 < value < 1 */\n get currentOffset() {\n return this.handle.offsetLeft / (this.clientWidth - this.handle.clientWidth);\n }\n connectedCallback() {\n RTLObserver.addTarget(this);\n this.ariaValueMin = '0';\n this.ariaValueMax = '100';\n this.ariaValueNow = '0';\n this.setAttribute('role', 'scrollbar');\n this.setAttribute('aria-orientation', 'horizontal');\n this.setAttribute('tabindex', '0');\n this.handle.addEventListener('pointerdown', this.handleDragStart);\n this.addEventListener('click', this.navigateTrack);\n this.addEventListener('dragstart', cancelEvent); // prevent weird drag effects on windows.\n this.addEventListener('keydown', this.handleKey);\n }\n disconnectedCallback() {\n RTLObserver.removeTarget(this);\n this.handle.removeEventListener('pointerdown', this.handleDragStart);\n this.handleDragEnd(); // for safety\n this.removeEventListener('click', this.navigateTrack);\n this.removeEventListener('dragstart', cancelEvent); // prevent weird drag effects on windows.\n this.removeEventListener('keydown', this.handleKey);\n }\n}\nScrollbar.observedAttributes = ['skapa-rtl'];\n","/**\n * This file contains an implementation of smooth scrolling experience. It was chosen over the built-in smooth scroll features for better controls over the scrolling behaviour.\n * The fallback uses the built in easing functions of the browser to calculate the\n * animation offset values.\n */\nfunction generateEasingFunction(inertia = 0) {\n return `cubic-bezier(0.42, ${inertia.toFixed(2)}, 0.58, 1.0)`;\n}\nexport class SkapaSmoothScroller extends EventTarget {\n constructor(target) {\n super();\n this.animationID = -1;\n this.isAnimating = false;\n this.targetScroll = 0;\n this.instant = false;\n this.isRTL = false;\n this.initHelpers = () => {\n const helper = document.createElement('skapa-carousel-animation-helper');\n helper.style.position = 'absolute';\n helper.style.transition = 'left ease-in-out 0ms';\n helper.style.transitionTimingFunction = generateEasingFunction();\n helper.style.visibility = 'hidden';\n helper.ariaHidden = 'true';\n this.target.parentNode.appendChild(helper); // Review this.\n this.helper = helper;\n };\n this.debounceID = -1;\n /**\n * The function is used to keep the manual and external scrolling updates in sync.\n * The debounce feature is required to prevent the update from interfering with the scrolling.\n * @param val {number} sets the new scroll left value of the container\n */\n this.debouncedUpdate = (val) => {\n clearTimeout(this.debounceID);\n if (this.helper)\n this.debounceID = window.setTimeout(() => this.helper && (this.helper.style.left = `${val}px`), 50);\n };\n /**\n * When using smooth scroll fallback mode, this function sets up and starts the animation of a proxy element\n * which is used to to calculate offset values on any given frame.\n * @returns nothing\n */\n this.startAnimation = () => {\n if (!this.helper)\n return;\n const helper = this.helper;\n helper.style.transitionDuration = '400ms'; // This value feels closest to native smooth scroll. No universal value though: https://drafts.csswg.org/css-overflow/#valdef-scroll-behavior-smooth\n helper.style.left = `${this.targetScroll}px`;\n this.isAnimating = true;\n this.iterate();\n };\n // Applies the animation of the proxy helper element to the scroll container's scrollLeft property.\n this.iterate = () => {\n cancelAnimationFrame(this.animationID); // avoid mulitple parallel controls\n if (!this.helper)\n return;\n const { isRTL } = this;\n // Clamp the scroll target values between the (current container size and accumulated content width) minim and maximum scroll offset values.\n const minimumScrollValue = isRTL ? -(this.target.scrollWidth - this.target.clientWidth) : 0;\n const maximumScrollValue = isRTL ? 0 : (this.target.scrollWidth - this.target.clientWidth);\n if (this.targetScroll < minimumScrollValue)\n this.targetScroll = minimumScrollValue;\n else if (this.targetScroll > maximumScrollValue)\n this.targetScroll = maximumScrollValue;\n // Here the CSS transitioned left value is mirrored to the scroll container simulating the effect of smooth transitioned scrolling.\n this.target.scrollLeft = this.helper.offsetLeft;\n // If the targetScrollOffset is met, then stop the updates. The rounding is required as on some mobile devices the scroll may never be equal.\n if (Math.abs(this.targetScroll - this.target.scrollLeft) <= 1) {\n this.target.scrollLeft = this.targetScroll; // double value update that could be prevented?\n this.onAnimationEnd();\n }\n else {\n // Still distance left to scroll\n this.helper.style.left = `${this.targetScroll}px`; // possibly redundant target value update, yet it feels more robust.\n this.animationID = requestAnimationFrame(this.iterate); // Loop\n }\n };\n // Stop animation\n this.onAnimationEnd = () => {\n const helper = this.helper;\n if (helper) {\n helper.style.transitionDuration = '0ms';\n }\n cancelAnimationFrame(this.animationID);\n this.isAnimating = false;\n };\n // Cleanup\n this.stopAnimations = () => {\n if (this.helper) {\n this.onAnimationEnd();\n }\n };\n this.target = target;\n this.initHelpers();\n }\n get scrollLeft() {\n return this.target.scrollLeft;\n }\n set scrollLeft(value) {\n // Using helper for smooth scrolling effect.\n this.targetScroll = value;\n if (this.instant && this.helper) {\n if (this.isAnimating)\n this.onAnimationEnd();\n this.helper.style.left = `${value}px`;\n this.target.scrollLeft = value;\n }\n else {\n this.startAnimation();\n }\n }\n // The scrollLeft value of the container once the animation has settled. If there are no animations then the current value is returned.\n get scrollTarget() {\n return this.targetScroll;\n }\n set inertia(value) {\n if (this.helper && !isNaN(value))\n this.helper.style.transitionTimingFunction = generateEasingFunction(Math.max(Math.min(value, 1), 0));\n }\n}\n","export class CarouselFeature extends EventTarget {\n constructor(host) {\n super();\n this.host = host;\n this.micro = this.host.micro;\n }\n // Do not delete these.\n connectedCallback() { }\n disconnectedCallback() { }\n attributeChangedCallback(name, oldValue, newValue) { }\n}\nCarouselFeature.observedAttributes = [];\n","import { CarouselFeature } from './feature-base.js';\n/** Writing direction change related event types. */\nexport const Events = {\n CHANGE: 'SKAPA_CAROUSEL_WRITING_DIRECTION_CHANGE'\n};\n/** Writing direction change related features. */\nexport class RTLHandlerFeature extends CarouselFeature {\n constructor() {\n super(...arguments);\n this.isRTL = false;\n }\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'skapa-rtl') {\n // When RTL mode has changed.\n this.isRTL = newValue !== null;\n this.dispatchEvent(new WritingDirectionChangeEvent(this.isRTL));\n }\n }\n}\nRTLHandlerFeature.observedAttributes = ['skapa-rtl'];\nexport class WritingDirectionChangeEvent extends Event {\n constructor(rtl) {\n super(Events.CHANGE, { bubbles: false });\n this.rtl = rtl;\n }\n}\n","import { SkapaSmoothScroller } from './utils/smooth-scroll.js';\nimport { CarouselFeature } from './feature-base.js';\nimport { Events as WritingDirectionEvents } from './rtl-handler.js';\nexport const Events = {\n UPDATE: 'SKAPA_CAROUSEL_SCROLL_UPDATE'\n};\nexport class ScrollHandlerFeature extends CarouselFeature {\n constructor(host) {\n super(host);\n /**\n * Scroll snap polyfill for environments that don't support smooth scrolling.\n * However it may needs to be turned off for scrolling by touch elements in pixels.\n * @param offset The offset position the function should find the nearest snap point to.\n * @returns a scroll offset value that will snap to the nearest element's edge.\n */\n this.getNearestSnapTarget = (offset) => {\n const elements = this.host.assignedChildren;\n if (!elements.length)\n return offset;\n let requiredSnapOffset = elements[0].offsetLeft - offset; // initialise with the distance to the left edge of the first element\n const leftSnapOffsets = [];\n elements.forEach(element => {\n const distanceStart = element.offsetLeft - offset;\n const distanceEnd = distanceStart + element.offsetWidth - this.host.scrollContainer.clientWidth;\n const closerDistance = Math.abs(distanceStart) > Math.abs(distanceEnd) ? distanceEnd : distanceStart;\n // this is a weird sort thing:\n leftSnapOffsets.splice(leftSnapOffsets.findIndex(v => !v || v < requiredSnapOffset), 0, requiredSnapOffset);\n if (Math.abs(closerDistance) < Math.abs(requiredSnapOffset))\n requiredSnapOffset = closerDistance;\n });\n // Maybe the result should be clamped based on the available scroll range.\n return offset + requiredSnapOffset;\n };\n this.animationFrameID = -1;\n this.updateScrollState = () => {\n cancelAnimationFrame(this.animationFrameID);\n this.animationFrameID = requestAnimationFrame(this.onScrollStateUpdate);\n };\n this.onScrollStateUpdate = () => {\n this.onScrollSmoothScrollerCallback(this.host);\n this.dispatchEvent(new ScrollUpdateEvent(this.host));\n };\n // This function is called to synchronise the smooth scroller's position with the actual container's scroll position.\n this.onScrollSmoothScrollerCallback = ({ scrollLeft }) => {\n // update scroller fallback\n if (!globalIsResizingFlag)\n this.scroller.debouncedUpdate(scrollLeft); // UNDO\n };\n this.onWritingDirectionChangeScrollUpdate = ({ rtl }) => {\n this.scroller.isRTL = rtl;\n this.scroller.scrollLeft = this.scrollLeft;\n };\n this.scroller = new SkapaSmoothScroller(host.scrollContainer);\n }\n get scrollLeft() {\n return this.host.scrollContainer.scrollLeft;\n }\n set scrollLeft(value) {\n this.scroller.scrollLeft = value;\n }\n get scrollTarget() {\n return this.scroller.scrollTarget;\n }\n connectedCallback() {\n this.host.features.resizeHandler.addEventListener('SKAPA_CAROUSEL_RESIZE_EVENT', updateIsResizingState);\n // Update scroll state on writing direction change.\n this.host.features.writingDirection.addEventListener(WritingDirectionEvents.CHANGE, this.onWritingDirectionChangeScrollUpdate);\n // Update scroll state on scroll events. (Potentially should also be triggered )\n this.host.scrollContainer.addEventListener('scroll', this.updateScrollState);\n // Align on connect.\n this.updateScrollState();\n }\n disconnectedCallback() {\n this.host.features.resizeHandler.removeEventListener('SKAPA_CAROUSEL_RESIZE_EVENT', updateIsResizingState);\n this.host.scrollContainer.removeEventListener('scroll', this.updateScrollState);\n // stopAnimations makes sure to remove any intervals.\n this.scroller.stopAnimations();\n }\n}\nlet globalIsResizingFlag = false; // No need to store it per instance;\nfunction updateIsResizingState({ finished }) {\n globalIsResizingFlag = !finished;\n}\nexport class ScrollUpdateEvent extends Event {\n constructor(host) {\n super(Events.UPDATE, { bubbles: false });\n this.clientWidth = host.scrollContainer.clientWidth;\n this.scrollLeft = host.scrollLeft;\n this.scrollWidth = host.scrollWidth;\n }\n}\n","import { Events as ScrollEvents } from './scroll-handler.js';\nimport { CarouselFeature } from './feature-base.js';\n// Time since the last scrollevent before announcing the update.\nconst SlideVisibilityAnnouncementThrottle = 50; // ms.\nexport class SlideVisibilityFeature extends CarouselFeature {\n constructor() {\n super(...arguments);\n this.controlledUpdate = true; // Report true on mount.\n this.slideVisibilityUpdateCallback = ({ scrollLeft }) => this.micro(() => this.updateVisibleSlides(scrollLeft), 'update visible slides index', SlideVisibilityAnnouncementThrottle);\n // Sets the amount of surface percentage required of a slide to be visible to be considered as displayed.\n this.visibilityPercentThreshold = 0.95; // If 95% of a slide is visible it will considered displayed.\n // Evaluates each slide's visibility and dispatches an event if a change can be detected in the result.\n this.updateVisibleSlides = (scrollLeft = this.host.scrollLeft) => {\n const clientWidth = this.host.clientWidth;\n this.slidesVisibilityRatio.length = 0;\n const visibleSlides = [];\n // Potentially the scroller's target scroll value should be used as while animating it can yield invalid results.\n const containerLeftEdge = scrollLeft;\n const containerRightEdge = containerLeftEdge + clientWidth;\n const scrollWidth = this.host.scrollContainer.scrollWidth;\n this.host.assignedChildren.forEach((el, i) => {\n const toleranceMargin = el.clientWidth * (1 - this.visibilityPercentThreshold);\n if ((el.offsetLeft + toleranceMargin >= scrollLeft) && (el.offsetLeft + el.clientWidth - toleranceMargin <= scrollLeft + clientWidth)) {\n visibleSlides.push(i);\n }\n if (el.clientWidth) {\n // Let's figure out how much of the element is actually visible\n // To do that let's see if the left and right edges are within the view area.\n // If they are not then divide the visible area with the full width of the element\n // Which should give a value between 0 and 1.\n const leftEdge = el.offsetLeft;\n const rightEdge = leftEdge + el.clientWidth;\n const isAtScrollStart = leftEdge <= 1; // 1 px tolerance.\n const isAtScrollEnd = rightEdge >= scrollWidth - 1; // 1 px tolerance.\n // The first element should not consider the controller width on its left edge\n const adjustedContainerLeftEdge = containerLeftEdge + (isAtScrollStart ? 0 : this.host.controls.controllerWidth);\n // The last element should not consdier the controller width on its right edge\n const adjustedContainerRightEdge = containerRightEdge - (isAtScrollEnd ? 0 : this.host.controls.controllerWidth);\n const offScreenLeft = -Math.min(leftEdge - adjustedContainerLeftEdge, 0); // The amount offscreen to the left\n const offScreenRight = Math.max(rightEdge - adjustedContainerRightEdge, 0); // The amount offscreen to the right\n const visibleAmount = Math.max(el.clientWidth - (offScreenLeft + offScreenRight), 0) / el.clientWidth;\n this.slidesVisibilityRatio.push(visibleAmount);\n }\n else {\n // The assigned child has zero width which will be assumed as not visible: 0 visibility?\n this.slidesVisibilityRatio.push(0);\n }\n });\n // Cheap(?) array comparison.\n if (this.__visibleSlides.toString() !== visibleSlides.toString()) {\n // Update in visibility\n if (this.controlledUpdate // if its marked as controlled update\n && this.host.slideIndex !== null // and slideIndex is defined\n && !visibleSlides.includes(clamp(this.host.slideIndex, 0, this.host.assignedChildren.length - 1)) // and the (range clamped) target slide is not visible\n ) {\n // Then we assume the user has overridden the automatic slide update\n this.controlledUpdate = false; // so mark the update as user triggered.\n }\n const slideVisibilityEvent = new SlideVisibilityEvent(visibleSlides, this.controlledUpdate);\n this.host.dispatchEvent(slideVisibilityEvent);\n this.controlledUpdate = false;\n // Update the local cache while keeping the reference.\n this.__visibleSlides.length = 0;\n this.visibleSlides.push(...visibleSlides);\n }\n };\n this.__visibleSlides = [];\n this.__slidesVisibilityRatio = [];\n }\n connectedCallback() {\n this.host.features.scroller.addEventListener(ScrollEvents.UPDATE, this.slideVisibilityUpdateCallback);\n }\n disconnectedCallback() {\n this.host.features.scroller.removeEventListener(ScrollEvents.UPDATE, this.slideVisibilityUpdateCallback);\n // Remove visible slide announcement by overriding the callback function labelled 'update visible slides index'.\n this.micro(() => void 0, 'update visible slides index', 50);\n }\n get visibleSlides() {\n return this.__visibleSlides;\n }\n get slidesVisibilityRatio() {\n return this.__slidesVisibilityRatio;\n }\n}\nexport class SlideVisibilityEvent extends Event {\n constructor(detail, controlled) {\n super('skapa-carousel-visible-slides', { bubbles: false });\n this.detail = detail;\n this.controlled = controlled;\n }\n}\n/**\n * This mixin class adds visible slides tracking feature. It evaluates which slides are visible during and after a scroll event.\n *\n */\nfunction clamp(x, min, max) {\n // eslint-disable-next-line no-nested-ternary\n return (x > max) ? max : (x < min) ? min : x;\n}\n","import { CarouselFeature } from './feature-base.js';\nexport class SlideIndexFeature extends CarouselFeature {\n constructor(host) {\n super(host);\n this.syncViewToSlideIndex = () => {\n if (this.host.slideIndex === null)\n return;\n // Scroll to slide index.\n // Move this to a microtask as it is dependent on RTL which attribute may not have been processed yet.\n this.micro(() => {\n const targetIndex = Math.round(Math.min(Number(this.host.slideIndex), this.host.assignedChildren.length - 1));\n if (targetIndex > -1) {\n const targetElement = this.host.assignedChildren[Number(targetIndex)];\n this.host.features.slideVisibility.controlledUpdate = true;\n this.host.scrollToSlide(targetElement, 0.5); // 0.5 means centering into view.\n }\n }, 'update slide index');\n };\n // @ts-expect-error The method is protected but this feature should be considered `internal`.\n host.gatherProperties(['slideIndex'], host);\n Object.defineProperty(host, 'slideIndex', {\n get() {\n return host.hasAttribute('slide-index') ? Number(host.getAttribute('slide-index')) : null;\n },\n set(val) {\n if (val !== null)\n host.setAttribute('slide-index', String(val));\n else\n host.removeAttribute('slide-index');\n }\n });\n }\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'slide-index' && Number(newValue) > -1) {\n this.syncViewToSlideIndex();\n }\n }\n}\n// Add the new attribute.\nSlideIndexFeature.observedAttributes = ['slide-index'];\n","import { NavigationEventType, NavigationEventDirection } from '../elements/CarouselControls.js';\nimport { Events as ScrollEvents } from './scroll-handler.js';\nimport { CarouselFeature } from './feature-base.js';\nexport class PagingControlsFeature extends CarouselFeature {\n constructor() {\n super(...arguments);\n this.onScrollPagingCallback = ({ scrollLeft, clientWidth, scrollWidth }) => {\n this.micro(() => {\n const isAtStart = Math.abs(scrollLeft) <= 0;\n const isAtEnd = Math.round(Math.abs(scrollLeft) + clientWidth) >= (scrollWidth - 1); // The scrollWidth value is calculated from rounded parts, so the value may be 1px larger than actually is.\n this.host.controls.prev = !isAtStart;\n this.host.controls.next = !isAtEnd;\n }, 'update control buttons visibility');\n };\n this.handlePageRequest = (ev) => {\n const { controls, scrollToSlide, assignedChildren, features: { slideVisibility, scroller, writingDirection } } = this.host;\n scroller.scroller.inertia = 0; // sets transition to ease-in-out\n slideVisibility.updateVisibleSlides(this.host.scrollLeft);\n if (ev.navigationType === NavigationEventDirection.NEXT) {\n // go next\n // The first slide which has less visibility than the previous one.\n const nextNotFullyVisibleSlideIndex = slideVisibility.slidesVisibilityRatio.findIndex((e, i, arr) => arr[i - 1] > e);\n if (nextNotFullyVisibleSlideIndex > -1) {\n const nextSlide = assignedChildren[nextNotFullyVisibleSlideIndex];\n const isLastSlide = nextNotFullyVisibleSlideIndex === (assignedChildren.length - 1); // The next controller is not visible on the last slide\n scrollToSlide(nextSlide, writingDirection.isRTL ? 1 : 0, isLastSlide ? 0 : controls.controllerWidth);\n }\n }\n else {\n // go prev\n const maxVisibility = Math.max(...slideVisibility.slidesVisibilityRatio);\n // The slide before the first occurence of maximum visibility. (maximum visibility can be lower than 1 if scroll area is narrower than the slide's width.)\n const nextNotFullyVisibleSlideIndex = slideVisibility.slidesVisibilityRatio.findIndex((e, i, arr) => arr[i + 1] === maxVisibility);\n if (nextNotFullyVisibleSlideIndex > -1) {\n const nextSlide = assignedChildren[nextNotFullyVisibleSlideIndex];\n scrollToSlide(nextSlide, writingDirection.isRTL ? 0 : 1, controls.controllerWidth);\n }\n }\n };\n }\n connectedCallback() {\n this.host.features.scroller.addEventListener(ScrollEvents.UPDATE, this.onScrollPagingCallback);\n // Paging requests coming from the control buttons\n this.host.addEventListener(NavigationEventType, this.handlePageRequest);\n }\n disconnectedCallback() {\n this.host.features.scroller.removeEventListener(ScrollEvents.UPDATE, this.onScrollPagingCallback);\n // Control button events\n this.host.removeEventListener(NavigationEventType, this.handlePageRequest);\n }\n}\n/**\n * This mixin class handles paging requests. Paging is typically done by pressing one of the horizontal control buttons.\n *\n */\n","import { CarouselFeature } from './feature-base.js';\nexport class ChildFocusFeature extends CarouselFeature {\n constructor() {\n super(...arguments);\n this.pointerInteraction = false;\n this.registerPointerEvent = () => {\n this.pointerInteraction = true;\n this.micro(() => {\n this.pointerInteraction = false;\n }, 'registering user pointer events');\n };\n // Safari does not focus a clicked button by design. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#clicking_and_focus\n this.safariClickFocusPoly = (ev) => {\n const { assignedChildren } = this.host;\n const dispatcher = ev.composedPath().find(elem => assignedChildren.includes(elem));\n if (dispatcher && !dispatcher.matches(':focus, :focus-within')) {\n this.pointerInteraction = true; // Act like it wasn't for Safari.\n dispatcher.focus();\n }\n };\n this.childFocusHandler = (ev) => {\n const { scrollContainer, assignedChildren, controls, features: { slideVisibility, scroller, writingDirection } } = this.host;\n // Find the dispatcher ancestor which is an assigned child of the carousel.\n // Potentially investigate resetting the the scrollLeft value in a microtask?\n const scrollLeftBeforeFocus = scrollContainer.scrollLeft;\n const dispatcher = ev.composedPath().find(elem => assignedChildren.includes(elem));\n if (dispatcher) {\n // Need the latest values of slide visibility. Using scrollTarget to determine the visibility based on the target scroll state.\n // slideVisibility.updateVisibleSlides(scroller.scrollTarget);\n slideVisibility.updateVisibleSlides(scrollContainer.scrollLeft);\n let focusDirection = 0; // left to right?\n // Simple solution to determine the expected focus horizontal direction.\n // This is necessary in order to scroll enough to show the next focusable items as well in the relevant direction.\n if (ev.relatedTarget) {\n if (ev.relatedTarget.getBoundingClientRect().x > dispatcher.getBoundingClientRect().x)\n focusDirection = -1;\n }\n const wasPointerInteraction = this.pointerInteraction; // We need to cache the state as it will be reset by the time the microtask is called.\n this.pointerInteraction = false;\n this.micro(() => {\n scrollContainer.scrollLeft = scrollLeftBeforeFocus;\n // calculate if the focused element is out of view.\n if (slideVisibility.slidesVisibilityRatio[assignedChildren.indexOf(dispatcher)] === 1) {\n if (wasPointerInteraction)\n return; // If the focus event is a result of user interaction and the clicked element is fully visible then don't start auto scrolling.\n // Otherwise, (Keyboard or programmatical focus event) let's check if the next focusable element is out of view. If so we should scroll the container to show the next elements.\n const rtlSign = writingDirection.isRTL ? -1 : 1;\n const nextFocusItemIndex = assignedChildren.indexOf(dispatcher) + (focusDirection || 1) * rtlSign;\n const nextFocusItem = assignedChildren[nextFocusItemIndex];\n if (!(nextFocusItem && slideVisibility.slidesVisibilityRatio[nextFocusItemIndex] !== 1))\n return; // Slide is FULLY visible: do nothing,\n }\n scroller.scroller.inertia = 0; // sets transition to ease-in-out\n this.host.scrollToSlide(dispatcher, !focusDirection ? 0 : 1, controls.controllerWidth);\n }, 'carousel child focus handler');\n }\n };\n }\n connectedCallback() {\n this.host.addEventListener('focus', this.childFocusHandler, { capture: true, passive: true });\n this.host.slides.addEventListener('click', this.safariClickFocusPoly, { capture: true, passive: true });\n this.host.slides.addEventListener('mousedown', this.registerPointerEvent);\n }\n disconnectedCallback() {\n this.host.removeEventListener('focus', this.childFocusHandler, { capture: true });\n this.host.slides.removeEventListener('click', this.safariClickFocusPoly, { capture: true });\n this.host.slides.removeEventListener('mousedown', this.registerPointerEvent);\n }\n}\n/**\n * This mixin class handles focus events triggered within the Carousel.\n * It's main purpose is to align the scroll container's view accordingly.\n */\n","import { CarouselFeature } from './feature-base.js';\nlet touchMode = false;\nexport class TouchModeDetectionFeature extends CarouselFeature {\n constructor() {\n super(...arguments);\n /** Hide control buttons in touch mode */\n this.enableTouchMode = () => {\n touchMode = true;\n if (!this.host.controls.overflow)\n this.host.controls.remove(); // Because overflow controls may be kept if the user has interacted with them before using touch scroll ?!\n this.host.addEventListener('pointerdown', this.disableTouchMode, { passive: true });\n };\n // Touch screen displays may accidentally trigger touch mode behaviour. Reenable in this case.\n this.disableTouchMode = (ev) => {\n if (ev.pointerType === 'touch')\n return; // A pointerdown is still triggered on touch\n this.host.shadow.append(this.host.controls); // Add the control buttons back.\n this.host.removeEventListener('pointerdown', this.disableTouchMode);\n touchMode = false;\n };\n }\n connectedCallback() {\n // Touch mode has been detected by another carousel.\n if (touchMode === true)\n return this.enableTouchMode();\n // Add touch visibility related self configuration listener. ( has to be on window )\n if (typeof window !== 'undefined')\n window.addEventListener('touchstart', this.enableTouchMode, { once: true, passive: true });\n }\n disconnectedCallback() {\n // Remove touch visibility related self configuration listeners\n if (typeof window !== 'undefined')\n window.removeEventListener('touchstart', this.enableTouchMode);\n this.host.removeEventListener('pointerdown', this.disableTouchMode);\n }\n}\n/**\n * This mixin class detects touch type user interaction and hides the control buttons as per specification.\n *\n */\n","import { ResizeListener } from '@ingka/webc-tools';\nimport { CarouselFeature } from './feature-base.js';\n/** Resize related event types. */\nexport const Events = {\n UPDATE: 'SKAPA_CAROUSEL_RESIZE_EVENT'\n};\nexport class CarouselResizeEvent extends Event {\n constructor(finished) {\n super(Events.UPDATE);\n this.finished = finished;\n }\n}\n// THIS WHOLE FEATURE FILE COULD POTENTIALLY BE REDISTRIBUTED INTO OTHER FEATURES AND THEN REMOVED.\nexport class ResizeHandlerFeature extends CarouselFeature {\n constructor() {\n super(...arguments);\n this.onScrollResizeCallback = ({ scrollLeft, scrollWidth }) => {\n if (!this.isResizing && (scrollWidth !== 0))\n this.originalScrollPosition = scrollLeft / scrollWidth;\n };\n this.isResizing = false;\n this.originalScrollPosition = 0;\n this.handleResize = (finished) => {\n this.dispatchEvent(new CarouselResizeEvent(finished));\n if (!finished && !this.isResizing) {\n // Start of resize process\n // This should go to scroll stuff\n // This will realign the scrolloffset to match the pre-resize one.\n const keepPosition = () => {\n this.host.scrollContainer.scrollLeft = this.originalScrollPosition * this.host.scrollContainer.scrollWidth;\n if (this.isResizing)\n requestAnimationFrame(keepPosition);\n };\n requestAnimationFrame(keepPosition);\n }\n else if (finished) {\n // End of resize process\n this.host.features.scroller.updateScrollState(); // Refactor?\n }\n // Let's try to keep the center centered.\n this.isResizing = !finished;\n };\n }\n connectedCallback() {\n this.host.features.scroller.addEventListener('SKAPA_CAROUSEL_SCROLL_UPDATE', this.onScrollResizeCallback);\n // Register the component for window resize notifications\n ResizeListener.addResizeListener(this.handleResize);\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.host.features.scroller.removeEventListener('SKAPA_CAROUSEL_SCROLL_UPDATE', this.onScrollResizeCallback);\n ResizeListener.removeResizeListener(this.handleResize);\n }\n}\n/**\n * This mixin class handles resize events on the page.\n * The reason why its needed is to ensure that the currently visible section of the screen is kept during and after the resize.\n */\n","import { CarouselFeature } from './feature-base.js';\nconst attributeName = 'auto-slide-size';\nconst propertyName = 'autoSlideSize';\nexport class AutoSlideSizeFeature extends CarouselFeature {\n constructor(host) {\n super(host);\n // @ts-expect-error The method is protected but this feature should be considered `internal`.\n host.gatherProperties([propertyName], host);\n Object.defineProperty(host, propertyName, {\n get() {\n return host.hasAttribute(attributeName);\n },\n set(val) {\n host.toggleAttribute(attributeName, !!val);\n }\n });\n }\n}\n","import define, { CachedValue, RTLObserver } from '@ingka/webc-tools';\nimport SkapaElement from '@ingka/skapa-webc-element';\nimport { CarouselControls } from './elements/CarouselControls.js';\ndefine('carousel-controls', CarouselControls);\n// Feature imports\nimport { SlideVisibilityFeature } from './features/slide-visibility.js';\nimport { SlideIndexFeature } from './features/slide-index.js';\nimport { PagingControlsFeature } from './features/paging-controls.js';\nimport { ChildFocusFeature } from './features/child-focus-handler.js';\nimport { TouchModeDetectionFeature } from './features/touch-mode-detection.js';\nimport { ResizeHandlerFeature } from './features/resize-handler.js';\nimport { ScrollHandlerFeature } from './features/scroll-handler.js';\nimport { RTLHandlerFeature } from './features/rtl-handler.js';\nimport { AutoSlideSizeFeature } from './features/auto-slide-size.js';\nconst baseFeatures = {\n scroller: ScrollHandlerFeature,\n slideVisibility: SlideVisibilityFeature,\n slideIndex: SlideIndexFeature,\n resizeHandler: ResizeHandlerFeature,\n pagingControls: PagingControlsFeature,\n childFocusHandler: ChildFocusFeature,\n touchModeDetection: TouchModeDetectionFeature,\n writingDirection: RTLHandlerFeature,\n autoSlideSize: AutoSlideSizeFeature\n};\nexport class CarouselBase extends SkapaElement {\n constructor(template) {\n super();\n // Cache until slotchange event.\n this.__assignedChildren = new CachedValue(() => {\n // nodeType 1 is technically Element not HTMLElement, but at the moment I can't predict any issues caused by the forced casting.\n return this.slides.assignedElements({ flatten: true }).filter(node => node.nodeType === 1);\n });\n // Slot assigned children have been updated\n this.handleSlotChange = () => {\n this.__assignedChildren.updateCache = true;\n this.features.scroller.updateScrollState();\n };\n /**\n *\n * @param slide Reference to the element to be displayed.\n * @param offsetPercent Number between 0 and 1: 0 will align the left edge of the slide and the container, 1 will align it to the right.\n * @param padding Number interpreted in pixels. Will offset the alignment with the value, creating a padding in respect of the container.\n */\n this.scrollToSlide = (slide, offsetPercent = 0, padding = 0) => {\n const target = slide.offsetLeft - (this.clientWidth - slide.clientWidth) * offsetPercent - (1 - 2 * offsetPercent) * padding;\n this.features.scroller.scrollLeft = target;\n };\n const shadow = this.shadow = this.attachShadow({ mode: 'open' });\n shadow.append(template.content.cloneNode(true));\n this.slides = shadow.querySelector('#slides');\n this.scrollContainer = shadow.querySelector('.wrapper');\n this.controls = shadow.querySelector('.controls');\n // Initialise instance features.\n this.features = Object.fromEntries(Object.entries(baseFeatures)\n .map(({ 0: featureName, 1: featureClass }) => [featureName, new featureClass(this)])); // Could refine to avoid casting?\n this.featuresList = Object.values(this.features);\n }\n // Observed attributes are defined within the features.\n static get observedAttributes() {\n const featureAttributes = Object.values(baseFeatures).map(feature => feature.observedAttributes).flat();\n return featureAttributes;\n }\n // Get slot assigned HTMLElements\n get assignedChildren() {\n return this.__assignedChildren.value;\n }\n attributeChangedCallback(name, oldValue, newValue) {\n this.featuresList.forEach(feature => feature.attributeChangedCallback(name, oldValue, newValue));\n }\n // Override: Forward the scrollLeft controls to the embedded scrollContainer\n set scrollLeft(value) {\n // This if statement check should not be necessary, yet it will cause a break in some test enviornments (jsdom)\n if (this.scrollContainer)\n this.scrollContainer.scrollLeft = value;\n }\n // Override: Forward the scrollLeft controls to the embedded scrollContainer\n get scrollLeft() {\n // This if statement check should not be necessary, yet it will cause a break in some test enviornments (jsdom)\n return this.scrollContainer ? this.scrollContainer.scrollLeft : 0;\n }\n // Override: Forward the scrollWidth controls to the embedded scrollContainer\n get scrollWidth() {\n return this.scrollContainer ? this.scrollContainer.scrollWidth : this.clientWidth; // scrollWidth;\n }\n connectedCallback() {\n super.connectedCallback();\n // Register for RTL writing direction updates.\n RTLObserver.addTarget(this);\n this.featuresList.forEach(feature => feature.connectedCallback());\n // In case the assigned elements change, then recalculate scrollbar.\n this.slides.addEventListener('slotchange', this.handleSlotChange);\n // Prevent browser dragging context behaviour.\n this.scrollContainer.addEventListener('dragstart', cancelEvent);\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n RTLObserver.removeTarget(this);\n this.slides.removeEventListener('slotchange', this.handleSlotChange);\n this.featuresList.forEach(feature => feature.disconnectedCallback());\n // Remove drag context listener.\n this.scrollContainer.removeEventListener('dragstart', cancelEvent);\n }\n}\nfunction cancelEvent(ev) {\n ev.preventDefault();\n}\n","import { CarouselFeature } from './feature-base.js';\nexport class SlideShowFeature extends CarouselFeature {\n constructor(host) {\n super(host);\n this.enabled = false;\n this.enableSlideShow = () => {\n if (this.enabled)\n this.disableSlideShow();\n const host = this.host;\n // set up listeners\n host.addEventListener('touchstart', this.handleTouchMove);\n host.addEventListener('click', this.handleTouchMove);\n host.addEventListener('wheel', this.handleTouchMove);\n this.enabled = true;\n };\n /** Disables Slide Show navigation support on the provided Carousel instance. */\n this.disableSlideShow = () => {\n const host = this.host;\n // clean listeners\n host.removeEventListener('touchstart', this.handleTouchMove);\n host.removeEventListener('click', this.handleTouchMove);\n host.removeEventListener('wheel', this.handleTouchMove);\n this.enabled = false;\n };\n this.handleTouchMove = (ev) => {\n const host = this.host;\n if (ev.composedPath().includes(host.scrollContainer)) {\n this.setManualMode(true);\n host.features.scroller.scroller.stopAnimations();\n }\n else {\n this.setManualMode();\n }\n };\n this.setManualMode = (toggle = false) => {\n this.host.scrollContainer.classList.toggle('manual-scroll', toggle);\n };\n this.host = host; // This will override the type from CarouselBase to Carousel.\n // @ts-expect-error The method is protected but this feature should be considered `internal`.\n host.gatherProperties(['slideShow'], host);\n Object.defineProperty(host, 'slideShow', {\n get() {\n return host.hasAttribute('slide-show');\n },\n set(value) {\n host.toggleAttribute('slide-show', value);\n }\n });\n }\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'slide-show') {\n if (newValue !== null) {\n this.enableSlideShow();\n }\n else {\n this.disableSlideShow();\n }\n }\n }\n connectedCallback() {\n if (this.host.slideShow)\n this.enableSlideShow();\n }\n disconnectedCallback() {\n // disable slide show related features\n this.disableSlideShow();\n }\n}\nSlideShowFeature.observedAttributes = ['slide-show'];\n","import { CarouselFeature } from './feature-base.js';\n/**\n * Skip listing handler section.\n * Anchor link targets can not be withing a shadowDom, so the WAI recommended solution is a no-op.\n *\n * This workaround enables a temporary focus target which is disabled again after the focus has been shifted by the user.\n*/\nexport class SkipListingFeature extends CarouselFeature {\n constructor(host) {\n super(host);\n this.handleSkipListing = () => {\n this.skipListingTarget.tabIndex = 0; // -1 will allow the item to be focused, yet it will not add it into the tab navigation order.\n this.skipListingTarget.addEventListener('focus', this.targetFocused, { once: true, passive: true });\n this.skipListingTarget.focus();\n };\n this.targetFocused = () => {\n this.skipListingTarget.addEventListener('blur', this.resetTarget, { once: true, passive: true });\n };\n this.resetTarget = () => {\n this.skipListingTarget.tabIndex = -1; // the focusability of the item has to be removed.\n };\n this.destroy = () => {\n // Skip listing\n this.skipListingTarget.removeEventListener('focus', this.targetFocused);\n this.skipListingTarget.removeEventListener('blur', this.resetTarget);\n };\n this.skipListingButton = host.shadow.querySelector('#btn-skip');\n this.skipListingTarget = host.shadow.querySelector('#skiplisting');\n }\n connectedCallback() {\n this.skipListingButton.addEventListener('click', this.handleSkipListing);\n }\n disconnectedCallback() {\n this.skipListingButton.removeEventListener('click', this.handleSkipListing);\n this.destroy();\n }\n}\n","import { CarouselFeature } from './feature-base.js';\n/**\n * Skip listing handler section.\n * Anchor link targets can not be withing a shadowDom, so the WAI recommended solution is a no-op.\n *\n * This workaround enables a temporary focus target which is disabled again after the focus has been shifted by the user.\n*/\nexport class ScrollbarHandlerFeature extends CarouselFeature {\n constructor(host, scrollbar) {\n super(host);\n this.scrollBarUpdateCallback = ({ scrollWidth, scrollLeft, clientWidth }) => {\n const { scrollbar } = this;\n // update scrollbar\n if (scrollWidth) {\n scrollbar.style.setProperty('--skapaScrollHandleLeft', `${(100 * Math.abs(scrollLeft) / scrollWidth).toFixed(2)}%`);\n scrollbar.style.setProperty('--skapaScrollHandleWidth', `${(100 * clientWidth / scrollWidth).toFixed(2)}%`);\n }\n if (scrollWidth !== clientWidth)\n scrollbar.ariaValueNow = (100 * Math.abs(scrollLeft) / (scrollWidth - clientWidth)).toFixed(0);\n // maybe this could use some further throttling, and a potential refactor to inside the scrollbar.\n scrollbar.classList.toggle('hide', clientWidth >= scrollWidth);\n scrollbar.ariaHidden = (clientWidth >= scrollWidth).toString();\n };\n this.handleScrollbarEvents = (ev) => {\n const { features, scrollContainer } = this.host;\n const { scroller } = features.scroller;\n if (ev.type === 'skapa-scrollbar-scroll') {\n const rawScrollTarget = (this.host.features.writingDirection.isRTL ? -1 : 1) * ev.detail.dragPos * (scrollContainer.scrollWidth);\n scroller.scrollLeft = scroller.instant ? rawScrollTarget : this.host.features.scroller.getNearestSnapTarget(rawScrollTarget);\n }\n else if (ev.type === 'skapa-scrollbar-scroll-start') {\n // Start manual scrolling\n // The following will turn smooth scrolling off to ensure that the slide container responds instantly to user interaction with the scrollbar.\n scroller.instant = true;\n scroller.inertia = 0;\n }\n else {\n // End manual scrolling\n scroller.instant = false;\n const speed = ev.detail;\n // calculate landing offset based on scrolling speed\n const inertiaScrollingOffset = 0.3 * speed * this.host.scrollContainer.scrollWidth; // 0.3 was chosen based on manual testing. It factors the calculated speed into a result that feels natural.\n // update smooth-scroller poly with the current inertia so it can provide a more idea timing function.\n scroller.inertia = Math.abs(speed * 5);\n // This feature adds weight to the scrollbar causing it to naturally ease into a stopping position based on the velocity of the user's drag.\n // Snap to the nearest target in the direction of the scroll.\n this.micro(() => {\n scroller.scrollLeft = this.host.features.scroller.getNearestSnapTarget(scroller.scrollLeft + inertiaScrollingOffset);\n }, 'set scroll inertia target');\n }\n };\n this.scrollbar = scrollbar;\n // @ts-expect-error The method is protected but this feature should be considered `internal`.\n host.gatherProperties(['hiddenScrollbar'], host);\n Object.defineProperty(host, 'hiddenScrollbar', {\n get() {\n return host.hasAttribute('hidden-scrollbar');\n },\n set(val) {\n host.toggleAttribute('hidden-scrollbar', !!val);\n }\n });\n }\n connectedCallback() {\n // Scrollbar events\n this.scrollbar.addEventListener('skapa-scrollbar-scroll', this.handleScrollbarEvents);\n this.scrollbar.addEventListener('skapa-scrollbar-scroll-start', this.handleScrollbarEvents);\n this.scrollbar.addEventListener('skapa-scrollbar-scroll-end', this.handleScrollbarEvents);\n // Add scrollbar state updater callback to scroll event.\n this.host.features.scroller.addEventListener('SKAPA_CAROUSEL_SCROLL_UPDATE', this.scrollBarUpdateCallback);\n }\n disconnectedCallback() {\n // Scrollbar events\n this.scrollbar.removeEventListener('skapa-scrollbar-scroll', this.handleScrollbarEvents);\n this.scrollbar.removeEventListener('skapa-scrollbar-scroll-start', this.handleScrollbarEvents);\n this.scrollbar.removeEventListener('skapa-scrollbar-scroll-end', this.handleScrollbarEvents);\n // Remove scrollbar state updater callback to scroll event.\n this.host.features.scroller.removeEventListener('SKAPA_CAROUSEL_SCROLL_UPDATE', this.scrollBarUpdateCallback);\n }\n}\n","import define, { prefixReplacer } from '@ingka/webc-tools';\nimport '@ingka/button-webc';\nimport { Scrollbar } from './elements/Scrollbar.js';\nimport { CarouselBase } from './CarouselBase.js';\nimport { SlideShowFeature } from './features/slide-show.js';\nimport { SkipListingFeature } from './features/skip-listing.js';\nimport { ScrollbarHandlerFeature } from './features/scrollbar-handler.js';\nconst scrollbarTagName = define('carousel-scrollbar', Scrollbar);\n// @ts-ignore\nconst styles = ':host{--carousel-container-vertical-padding:0.5rem;display:block;max-width:100%;position:relative}@supports (scroll-margin-inline-start:0.5rem){:host(:not([slide-show])) ::slotted(*){scroll-margin-inline-start:.5rem}}.wrapper{box-sizing:border-box;display:flex;flex-wrap:nowrap;margin-bottom:calc(var(--carousel-container-vertical-padding)*-1);margin-top:calc(var(--carousel-container-vertical-padding)*-1);margin-inline-end:calc(var(--skapa-carousel-overflow-end, 0)*-1);margin-inline-start:calc(var(--skapa-carousel-overflow-start, 0)*-1);overflow-x:scroll;overscroll-behavior-inline:none;padding-bottom:var(--carousel-container-vertical-padding);padding-top:var(--carousel-container-vertical-padding);scrollbar-width:none;width:calc(100% + var(--skapa-carousel-overflow-start, 0rem) + var(--skapa-carousel-overflow-end, 0rem))}.wrapper::-webkit-scrollbar{display:none}.wrapper:after,.wrapper:before{content:\"\";display:block;flex:0 0 var(--skapa-carousel-overflow-start,0)}.wrapper:after{flex:0 0 var(--skapa-carousel-overflow-end,0)}#slides::slotted(:not(:first-of-type)){margin-inline-start:var(--skapa-carousel-item-gap,1.25rem)!important}#slides::slotted(*){flex-shrink:0}#slides::slotted(img){object-fit:contain;pointer-events:none;user-select:none}:host([auto-slide-size]) #slides::slotted(*),:host([slide-show]) #slides::slotted(*){flex:0 0 calc((100% - var(--skapa-carousel-overflow-end, 0rem) - var(--skapa-carousel-overflow-start, 0rem) - (var(--visible-item-count, 1) - 1)*var(--skapa-carousel-item-gap, 1.25rem))/var(--visible-item-count, 1));width:calc((100% - var(--skapa-carousel-overflow-end, 0rem) - var(--skapa-carousel-overflow-start, 0rem) - (var(--visible-item-count, 1) - 1)*var(--skapa-carousel-item-gap, 1.25rem))/var(--visible-item-count, 1))}.controls{position:absolute;transition:opacity .2s cubic-bezier(.4,0,.4,1);z-index:2}.controls::part(control-button){box-shadow:0 4px 16px #0000001a}slot[name=skip-button]{display:inline-block;margin-inline-start:1.5rem;opacity:0;pointer-events:none;position:absolute;top:1.5rem;z-index:2}slot[name=skip-button]:focus-within{opacity:1;pointer-events:all}.scrollbar{margin-top:.5rem}.controls{top:calc(50% - 1.25rem)}:host(:not(:hover)) .controls{opacity:0}:host([slide-show]) .controls{--skapa-carousel-control-offset:2rem;display:block}:host([slide-show]) .wrapper.manual-scroll{scroll-snap-type:x mandatory}:host([slide-show]) .wrapper #slides::slotted(*){scroll-snap-align:center}:host([hidden-scrollbar]) .scrollbar{display:none}';\nlet template;\nconst getTemplate = () => {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = prefixReplacer(`\n \n Skip listing\n \n
    \n \n
    \n \n \n
    \n `);\n }\n // Make sure to keep the empty space within the skiplisting target, otherwise it will be ignored by some browsers.\n return template;\n};\nexport class Carousel extends CarouselBase {\n constructor() {\n super(getTemplate());\n this.features.scrollbarHandler = new ScrollbarHandlerFeature(this, this.shadow.querySelector(scrollbarTagName()));\n this.featuresList.push(this.features.scrollbarHandler);\n this.features.slideShow = new SlideShowFeature(this);\n this.featuresList.push(this.features.slideShow);\n this.features.skipListing = new SkipListingFeature(this);\n this.featuresList.push(this.features.skipListing);\n // Cache the base function\n this.rawScrollToSlide = this.scrollToSlide;\n this.scrollToSlide = (slide, offsetPercent = 0, padding = 0) => {\n // Since this is used in programmatic scrolling, we should make sure that the component knows its not a user interaction\n this.features.slideShow.setManualMode();\n // When in slideshow mode, make sure to center the image view\n this.rawScrollToSlide(slide, this.slideShow ? 0.5 : offsetPercent, padding);\n };\n }\n}\n","import { CarouselBase } from './CarouselBase.js';\nimport { prefixReplacer } from '@ingka/webc-tools';\n// @ts-ignore\nconst styles = ':host{--carousel-container-vertical-padding:0.5rem;display:block;max-width:100%;position:relative}@supports (scroll-margin-inline-start:0.5rem){:host(:not([slide-show])) ::slotted(*){scroll-margin-inline-start:.5rem}}.wrapper{box-sizing:border-box;display:flex;flex-wrap:nowrap;margin-bottom:calc(var(--carousel-container-vertical-padding)*-1);margin-top:calc(var(--carousel-container-vertical-padding)*-1);margin-inline-end:calc(var(--skapa-carousel-overflow-end, 0)*-1);margin-inline-start:calc(var(--skapa-carousel-overflow-start, 0)*-1);overflow-x:scroll;overscroll-behavior-inline:none;padding-bottom:var(--carousel-container-vertical-padding);padding-top:var(--carousel-container-vertical-padding);scrollbar-width:none;width:calc(100% + var(--skapa-carousel-overflow-start, 0rem) + var(--skapa-carousel-overflow-end, 0rem))}.wrapper::-webkit-scrollbar{display:none}.wrapper:after,.wrapper:before{content:\"\";display:block;flex:0 0 var(--skapa-carousel-overflow-start,0)}.wrapper:after{flex:0 0 var(--skapa-carousel-overflow-end,0)}#slides::slotted(:not(:first-of-type)){margin-inline-start:var(--skapa-carousel-item-gap,1.25rem)!important}#slides::slotted(*){flex-shrink:0}#slides::slotted(img){object-fit:contain;pointer-events:none;user-select:none}:host([auto-slide-size]) #slides::slotted(*),:host([slide-show]) #slides::slotted(*){flex:0 0 calc((100% - var(--skapa-carousel-overflow-end, 0rem) - var(--skapa-carousel-overflow-start, 0rem) - (var(--visible-item-count, 1) - 1)*var(--skapa-carousel-item-gap, 1.25rem))/var(--visible-item-count, 1));width:calc((100% - var(--skapa-carousel-overflow-end, 0rem) - var(--skapa-carousel-overflow-start, 0rem) - (var(--visible-item-count, 1) - 1)*var(--skapa-carousel-item-gap, 1.25rem))/var(--visible-item-count, 1))}.controls{position:absolute;transition:opacity .2s cubic-bezier(.4,0,.4,1);z-index:2}.controls::part(control-button){box-shadow:0 4px 16px #0000001a}:host{--skapa-carousel-overflow-start:.5rem;--skapa-carousel-overflow-end:.5rem}.wrapper{--skapa-carousel-item-gap:0.5rem}.controls{top:calc(50% - 1rem)}';\nlet template;\nconst getTemplate = () => {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = prefixReplacer(`\n \n
    \n \n
    \n `);\n }\n return template;\n};\nexport class OverflowCarousel extends CarouselBase {\n constructor() {\n super(getTemplate());\n }\n}\n","import define from '@ingka/webc-tools';\nimport { Carousel } from './src/Carousel.js';\nimport { OverflowCarousel } from './src/OverflowCarousel.js';\nexport { Carousel, OverflowCarousel };\nexport const carouselTagName = define('carousel', Carousel);\nexport const overflowCarouselTagName = define('overflow-carousel', OverflowCarousel);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\n/**\n * Style for MediaCarousel.\n */\nclass MediaCarouselStyle {\n /**\n * @param options Options.\n * @param options.theme Theme.\n * @param options.layout\n * @param options.isLandscapeLayout \"true\" if landscape layout.\n * @param options.showScrollbar \"true\" if scrollbar should be visible.\n * @returns Style.\n */\n static getStyle(options) {\n const { color, spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t\tposition: relative;\n\t\t\t\theight: unset;\n\t\t\t}\n\n\t\t\t.mediaSwiper {\n\t\t\t\theight: 100%;\n\t\t\t}\n\n\t\t\t.mediaPicker {\n\t\t\t\tpadding-top: 2rem;\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-wrap: wrap;\n\t\t\t\tjustify-content: flex-start;\n\t\t\t\talign-items: center;\n\t\t\t\tmargin-left: ${2 / 16}rem;\n\t\t\t}\n\n\t\t\t.mediaPicker .thumbnail {\n\t\t\t\tdisplay: flex;\n\t\t\t\theight: ${60 / 16}rem;\n\t\t\t\twidth: ${60 / 16}rem;\n\t\t\t\tborder-radius: ${2 / 16}rem;\n\t\t\t\tjustify-content: center;\n\t\t\t\talign-items: center;\n\t\t\t\tbox-shadow: 0 0 0 ${1 / 16}rem ${color.neutral.grey200};\n\t\t\t\tcursor: pointer;\n\t\t\t\toutline: none;\n\t\t\t\tmargin-bottom: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.mediaPicker .thumbnail kompis-image {\n\t\t\t\theight: ${(60 - spacing.space25 / 2) / 16}rem;\n\t\t\t\twidth: auto;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\n\t\t\t.mediaPicker .thumbnail.selectedThumbnail,\n\t\t\t.mediaPicker .thumbnail:focus {\n\t\t\t\tbox-shadow: 0 0 0 ${2 / 16}rem ${color.neutral.grey900};\n\t\t\t}\n\n\t\t\t.mediaPicker .divider {\n\t\t\t\twidth: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.showAllBtn {\n\t\t\t\tmargin: 0 ${spacing.space50 / 16}rem ${spacing.space50 / 16}rem ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\tvideo {\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = MediaCarouselStyle;\n//# sourceMappingURL=MediaCarouselStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst component_carousel_1 = require(\"@inter-ikea-kompis/component-carousel\");\nconst ImageAspectRatioEnum_1 = __importDefault(require(\"@inter-ikea-kompis/component-image/lib/enums/ImageAspectRatioEnum\"));\nrequire(\"@inter-ikea-kompis/component-carousel\");\nrequire(\"@inter-ikea-kompis/component-image\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/carousel-webc\");\nconst MediaCarouselStyle_1 = __importDefault(require(\"./MediaCarouselStyle\"));\nconst PRODUCT_IMAGE_SCALE = 1.04;\n/**\n * MediaCarousel class.\n *\n * @event change Media changed\n * @event showAllThumbnails Show all thumbnails event.\n */\nlet MediaCarousel = class MediaCarousel extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // Array of MediaItem objects\n this.mediaItems = null;\n // Index of the main image.\n this.selectedIndex = 0;\n // Visibility of scrollbar\n this.showScrollbar = false;\n // Visibility of arrow controls\n this.showArrows = false;\n // Expanding thumbnails\n this.showAll = false;\n // Max limit of thumbnails to be displayed.\n this.thumbnailLimit = null;\n // Layout\n this.layout = component_carousel_1.CarouselLayoutEnum.default;\n // Skip listing label\n this.skipListingLabel = null;\n // Show less label\n this.showLessLabel = null;\n // The aspect ratio that the image should adopt.\n this.aspectRatio = ImageAspectRatioEnum_1.default.ORIGINAL;\n }\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t${this.getGallery()} ${this.mediaPicker()}\n\t\t\t {\n const target = event.currentTarget;\n if (target) {\n target.tabIndex = -1;\n }\n }}\"\n\t\t\t>\n\t\t`;\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n onThumbnailClick(selectedIndex) {\n this.selectedIndex = selectedIndex;\n }\n updateVisibleSlide(event) {\n var _a;\n // Defaults to selectedIndex since index might be undefined if the user clicks arrows too fast.\n const index = (_a = event.detail[0]) !== null && _a !== void 0 ? _a : this.selectedIndex;\n this.onThumbnailClick(index);\n this.dispatchEvent(new CustomEvent('change', {\n bubbles: true,\n detail: { selectedIndex: index, type: 'thumbnail' }\n }));\n }\n getSkipListing() {\n if (!this.skipListingLabel) {\n return null;\n }\n // Find and set the element to be tabbable, and when the element is focused out, the tabIndex is removed from the element.\n const handleSkipListing = () => {\n var _a;\n const focusElement = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('carouselCustomSkipTarget');\n focusElement.tabIndex = 0;\n focusElement.focus();\n };\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${this.skipListingLabel}\n\t\t\t\n\t\t`;\n }\n getGallery() {\n return this.layout === component_carousel_1.CarouselLayoutEnum.overflow\n ? (0, web_component_1.html) `\n\t\t\t\t\t this.updateVisibleSlide(event)}\n\t\t\t\t\t>\n\t\t\t\t\t\t${this.getSkipListing()} ${this.getCarouselItems()}\n\t\t\t\t\t\n\t\t\t `\n : (0, web_component_1.html) `\n\t\t\t\t\t this.updateVisibleSlide(event)}\n\t\t\t\t\t>\n\t\t\t\t\t\t${this.getSkipListing()} ${this.getCarouselItems()}\n\t\t\t\t\t\n\t\t\t `;\n }\n getCarouselItems() {\n if (!this.mediaItems) {\n return null;\n }\n return this.mediaItems.map((mediaItem, index) => {\n const isAriaHidden = index !== this.selectedIndex;\n if (mediaItem.videoSrc) {\n return (0, web_component_1.html) `\n\t\t\t\t\t\n\t\t\t\t`;\n }\n else {\n return (0, web_component_1.html) `\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t`;\n }\n });\n }\n mediaPicker() {\n if ((this.mediaItems && this.mediaItems.length < 2) || this.showScrollbar) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${this.getThumbnails()}${this.getExpandingThumbnailsButton()}\n\t\t\t\n\t\t`;\n }\n getThumbnails() {\n var _a, _b, _c, _d;\n const thumbnails = [];\n const limit = this.showAll || !this.thumbnailLimit\n ? (_b = (_a = this.mediaItems) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0\n : Math.min(this.thumbnailLimit, (_d = (_c = this.mediaItems) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0);\n for (let i = 0; i < limit; i++) {\n const mediaItem = this.mediaItems[i];\n const isAriaPressed = i === this.selectedIndex;\n thumbnails.push((0, web_component_1.html) `\n\t\t\t\t this.onThumbnailClick(i)}\n\t\t\t\t\t@keydown=${(event) => {\n if (event.key === 'Enter') {\n this.onThumbnailClick(i);\n }\n }}\n\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\tclass=${(0, web_component_1.classMap)({\n thumbnail: true,\n selectedThumbnail: this.selectedIndex === i\n })}\n\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t`);\n if (i < limit) {\n thumbnails.push((0, web_component_1.html) `
    `);\n }\n }\n return thumbnails;\n }\n getExpandingThumbnailsButton() {\n var _a, _b, _c, _d;\n if (!this.thumbnailLimit || ((_b = (_a = this.mediaItems) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) <= this.thumbnailLimit) {\n return;\n }\n const secondaryVariant = 'secondary';\n const label = !this.showAll\n ? '+ ' + (((_d = (_c = this.mediaItems) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) - this.thumbnailLimit)\n : this.showLessLabel;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${label}\n\t\t\t\n\t\t`;\n }\n onButtonClick() {\n this.dispatchEvent(new CustomEvent('showAllThumbnails', { bubbles: true, detail: { showAll: !this.showAll } }));\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], MediaCarousel.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MediaCarousel.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MediaCarousel.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MediaCarousel.prototype, \"mediaItems\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], MediaCarousel.prototype, \"selectedIndex\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], MediaCarousel.prototype, \"showScrollbar\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], MediaCarousel.prototype, \"showArrows\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], MediaCarousel.prototype, \"showAll\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], MediaCarousel.prototype, \"thumbnailLimit\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], MediaCarousel.prototype, \"layout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], MediaCarousel.prototype, \"skipListingLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], MediaCarousel.prototype, \"showLessLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], MediaCarousel.prototype, \"aspectRatio\", void 0);\nMediaCarousel = __decorate([\n (0, web_component_1.customElement)('kompis-media-carousel')\n], MediaCarousel);\nexports.default = MediaCarousel;\n//# sourceMappingURL=MediaCarousel.js.map","import \"@inter-ikea-kompis/component-media-carousel/lib/components/media-carousel/MediaCarousel\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisMediaCarousel extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-media-carousel\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.aspectRatio = props.aspectRatio;\n element.layout = props.layout;\n element.localizedInformation = props.localizedInformation;\n element.mediaItems = props.mediaItems;\n element.selectedIndex = props.selectedIndex;\n element.showAll = props.showAll;\n element.showArrows = props.showArrows;\n element.showLessLabel = props.showLessLabel;\n element.showScrollbar = props.showScrollbar;\n element.skipListingLabel = props.skipListingLabel;\n element.theme = props.theme;\n element.thumbnailLimit = props.thumbnailLimit;\n element.translations = props.translations;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onChange, \"change\");\n this.updateEventListener(element, props.onShowAllThumbnails, \"showAllThumbnails\");\n }\n}\nKompisMediaCarousel.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n aspectRatio: PropTypes.string,\n layout: PropTypes.string,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n mediaItems: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n selectedIndex: PropTypes.number,\n showAll: PropTypes.bool,\n showArrows: PropTypes.bool,\n showLessLabel: PropTypes.string,\n showScrollbar: PropTypes.bool,\n skipListingLabel: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n thumbnailLimit: PropTypes.number,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n onChange: PropTypes.func,\n onShowAllThumbnails: PropTypes.func\n};\nexport default KompisMediaCarousel;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LanguageSelectorSizeEnum = exports.LanguageSelectorModalEnum = exports.LanguageSelectorLayoutEnum = exports.LanguageSelectorCard = exports.LanguageSelector = void 0;\nconst LanguageSelector_1 = __importDefault(require(\"./components/language-selector/LanguageSelector\"));\nexports.LanguageSelector = LanguageSelector_1.default;\nconst LanguageSelectorCard_1 = __importDefault(require(\"./components/language-selector-card/LanguageSelectorCard\"));\nexports.LanguageSelectorCard = LanguageSelectorCard_1.default;\nconst LanguageSelectorLayoutEnum_1 = __importDefault(require(\"./enums/LanguageSelectorLayoutEnum\"));\nexports.LanguageSelectorLayoutEnum = LanguageSelectorLayoutEnum_1.default;\nconst LanguageSelectorModalEnum_1 = __importDefault(require(\"./enums/LanguageSelectorModalEnum\"));\nexports.LanguageSelectorModalEnum = LanguageSelectorModalEnum_1.default;\nconst LanguageSelectorSizeEnum_1 = __importDefault(require(\"./enums/LanguageSelectorSizeEnum\"));\nexports.LanguageSelectorSizeEnum = LanguageSelectorSizeEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('arrow-left-to-base', [{ tag: 'path', att: { d: 'M12 4V2H3v20h9v-2H5V4h7z' } }, { tag: 'path', att: { d: 'M13.6569 14.8285 11.8284 13H20v-2h-8.1715l3.241-3.2423-1.4142-1.4142-5.6569 5.6569 5.6569 5.6568 1.4142-1.4142-1.4136-1.4136.001-.0009z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('folder', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'm9.4142 4 4 4H22v12H2V4h7.4142zM4 8h6.5858l-2-2H4v2zm0 10v-8h16v8H4z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('create-new', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M17.9997 4V1h2v3h3v2h-3v3h-2V6h-3V4h3zM4.001 20V4h8.9961v2H6.001v12h12v-7h2v9h-16z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('bookmark', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M6 3h12v18h-2.4346L12 17.1799 8.4345 21H6V3zm2 2v13.5344l4-4.2857 4 4.2857V5H8z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('printer', [{ tag: 'path', att: { d: 'M9 18h6v-2H9v2z' } }, { tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M5 3v5H2v10h3v3h14v-3h3V8h-3V3H5zm0 13H4v-6h16v6h-1v-3H5v3zm12-1v4H7v-4h10zm0-7V5H7v3h10z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('question-mark-circle', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M12 4c-4.4183 0-8 3.5817-8 8s3.5817 8 8 8 8-3.5817 8-8-3.5817-8-8-8zM2 12C2 6.4771 6.4771 2 12 2c5.5228 0 10 4.4771 10 10 0 5.5228-4.4772 10-10 10-5.5229 0-10-4.4772-10-10z' } }, { tag: 'path', att: { d: 'M11.4177 8.228c.5275-.433 1.3055-.3593 1.7423.1649.4591.5509.3576 1.375-.2213 1.798l-.8634.631A2.6225 2.6225 0 0 0 11 12.9394v.676h2v-.676c0-.5375.7494-.8639 1.1187-1.1337 1.5112-1.1043 1.776-3.2553.5778-4.6932-1.1403-1.3683-3.171-1.5605-4.5477-.4303L8.8235 7.77l1.269 1.5459 1.3252-1.0879zm1.8323 8.0298c0 .6904-.5596 1.25-1.25 1.25s-1.25-.5596-1.25-1.25c0-.6903.5596-1.25 1.25-1.25s1.25.5597 1.25 1.25z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('warehouse', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M2 4h20v16H2V4zm18 14h-3v-8H7v8H4V6h16v12zm-5 0H9v-2h6v2zm0-4v-2H9v2h6z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar MenuCardBackButtonEnum;\n(function (MenuCardBackButtonEnum) {\n MenuCardBackButtonEnum[\"exitPlanner\"] = \"exitPlanner\";\n MenuCardBackButtonEnum[\"backToStartPage\"] = \"backToStartPage\";\n MenuCardBackButtonEnum[\"editDesign\"] = \"editDesign\";\n MenuCardBackButtonEnum[\"none\"] = \"none\";\n})(MenuCardBackButtonEnum || (MenuCardBackButtonEnum = {}));\nexports.default = MenuCardBackButtonEnum;\n//# sourceMappingURL=MenuCardBackButtonEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar MenuCardStepEnum;\n(function (MenuCardStepEnum) {\n MenuCardStepEnum[\"gallery\"] = \"gallery\";\n MenuCardStepEnum[\"planning\"] = \"planning\";\n MenuCardStepEnum[\"summary\"] = \"summary\";\n})(MenuCardStepEnum || (MenuCardStepEnum = {}));\nexports.default = MenuCardStepEnum;\n//# sourceMappingURL=MenuCardStepEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar MenuItemEnum;\n(function (MenuItemEnum) {\n MenuItemEnum[\"menu\"] = \"menu\";\n MenuItemEnum[\"open\"] = \"open\";\n MenuItemEnum[\"startFromScratch\"] = \"startFromScratch\";\n MenuItemEnum[\"save\"] = \"save\";\n MenuItemEnum[\"share\"] = \"share\";\n MenuItemEnum[\"print\"] = \"print\";\n MenuItemEnum[\"help\"] = \"help\";\n MenuItemEnum[\"selectLanguage\"] = \"selectLanguage\";\n MenuItemEnum[\"selectZipCode\"] = \"selectZipCode\";\n MenuItemEnum[\"selectStore\"] = \"selectStore\";\n})(MenuItemEnum || (MenuItemEnum = {}));\nexports.default = MenuItemEnum;\n//# sourceMappingURL=MenuItemEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst IkeaLogo = `\n\n\n\n\n`;\nexports.default = IkeaLogo;\n//# sourceMappingURL=IkeaLogo.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst analytics_1 = require(\"@inter-ikea-kompis/analytics\");\nconst insights_data_provider_1 = require(\"@insights/insights-data-provider\");\nconst moduleId = 'menu_card';\n/**\n * @event click When any of the options in the card is clicked.\n * @event navigation When IKEA logo is clicked.\n */\nclass MenuCardTracker extends analytics_1.AbstractAnalyticsTracker {\n constructor(options) {\n super(Object.assign({ moduleId }, options));\n }\n /**\n * Send navigation event for when the user navigates to the IKEA web main page.\n *\n * @param step Which page the Menu is located.\n */\n sendNavigationMainPage(step) {\n const payload = {\n common: { component: moduleId },\n data: {\n step,\n to: analytics_1.NavigationToEnum.ikeaMainPage\n }\n };\n this.getReporter().report({\n event: 'navigation',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe,\n payload\n });\n }\n /**\n * Send click event for when a menu item is clicked.\n *\n * @param step Which page the Menu is located.\n * @param item The menu item that is clicked.\n */\n sendMenuItemClick(step, item) {\n this.sendClickItem(step, item, insights_data_provider_1.IpexMomentEnum.showMe);\n }\n /**\n * Send click event for when the back button is clicked.\n *\n * @param step Which page the Menu is located.\n * @param backButton The type of the back button that is clicked.\n */\n sendBackButtonClick(step, backButton) {\n this.sendClickItem(step, backButton, insights_data_provider_1.IpexMomentEnum.whatIsMe);\n }\n sendClickItem(step, item, ipexMoment) {\n const payload = {\n common: { component: moduleId },\n data: {\n item,\n step\n }\n };\n this.getReporter().report({\n event: 'click',\n ipexMoment,\n payload\n });\n }\n}\nexports.default = MenuCardTracker;\n//# sourceMappingURL=MenuCardTracker.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nclass MenuCardStyle {\n static getStyle(options) {\n var _a;\n const { theme } = options;\n const { spacing, color } = theme;\n // Using small as breakpoint since fontStyle is the same for all of theme\n const { headingXSmall } = options.theme.breakpoint.small.fontStyle;\n /*\n What follows is the explanation of a quite hacky solution, but likely needed unfortunately:\n In order to use the full 100% of the space in the sheet (so that the footer is always at the bottom),\n we need to set position: absolute on the .outer class\n\n However, doing that stops the sheet-body-padding component from effecting the MenuCard.\n So we need to copy the padding from the sheet package, and apply it to the .container class.\n */\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.FocusRing.CSS}\n\n\t\t\t.outer {\n\t\t\t\tposition: absolute;\n\t\t\t\tleft: 0;\n\t\t\t\tright: 0;\n\t\t\t\ttop: 0;\n\t\t\t\tbottom: 0;\n\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\twidth: 100%;\n\t\t\t\t/* stolen from sheet-body-padding */\n\t\t\t\tpadding: 0 ${spacing.space150 / 16}rem;\n\t\t\t\t/* stolen from sheet-header */\n\t\t\t\tpadding-top: ${spacing.space550 / 16}rem;\n\t\t\t}\n\n\t\t\t.body {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\tgap: ${spacing.space200 / 16}rem;\n\n\t\t\t\tflex-grow: 1;\n\t\t\t\toverflow-y: auto;\n\t\t\t\toverflow-x: hidden;\n\t\t\t}\n\n\t\t\t/* To align the icon in the back button, we push all other icons to the right */\n\t\t\t.body > :not(.back-button),\n\t\t\t.footer {\n\t\t\t\tmargin-left: 0.5rem;\n\t\t\t\tmargin-right: 0.5rem; /* RTL */\n\t\t\t}\n\n\t\t\t.back-button,\n\t\t\t.menu-options {\n\t\t\t\tfont-weight: ${(_a = headingXSmall.weight) !== null && _a !== void 0 ? _a : ''};\n\t\t\t\tfont-size: ${headingXSmall.size / 16}rem;\n\t\t\t\tline-height: ${headingXSmall.lineHeight / 16}rem;\n\t\t\t\tcolor: ${color.neutral.grey900};\n\t\t\t}\n\n\t\t\t.back-button {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tcursor: pointer;\n\t\t\t\tgap: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.menu-options {\n\t\t\t\twidth: 100%;\n\n\t\t\t\t/* To remove browser list-item styling */\n\t\t\t\tlist-style: none;\n\t\t\t\tpadding: 0;\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t.menu-option {\n\t\t\t\tmin-height: 3rem;\n\t\t\t\tdisplay: flex;\n\t\t\t\tgap: 1rem;\n\t\t\t\talign-items: center;\n\t\t\t\twidth: 100%;\n\n\t\t\t\t/* To remove browser button styling */\n\t\t\t\tbackground: none;\n\t\t\t\tborder: none;\n\t\t\t\tpadding: 0;\n\t\t\t\tfont: inherit;\n\t\t\t\tcursor: pointer;\n\t\t\t\tcolor: ${color.neutral.grey900};\n\t\t\t}\n\n\t\t\t.footer {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tmargin-top: ${spacing.space150 / 16}rem;\n\t\t\t\tmargin-bottom: ${spacing.space250 / 16}rem;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tbackground-color: ${color.background.default};\n\t\t\t}\n\n\t\t\t.ikea-logo {\n\t\t\t\twidth: ${90 / 16}rem;\n\t\t\t\theight: ${36 / 16}rem;\n\t\t\t}\n\n\t\t\ta {\n\t\t\t\t/* To remove the extra pixels around the logo otherwise added by the anchor tag */\n\t\t\t\tline-height: 0;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = MenuCardStyle;\n//# sourceMappingURL=MenuCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@inter-ikea-kompis/component-language-selector\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/icon-store/arrow-left\");\nrequire(\"@ingka/icon-store/arrow-left-to-base\");\nrequire(\"@ingka/icon-store/folder\");\nrequire(\"@ingka/icon-store/create-new\");\nrequire(\"@ingka/icon-store/bookmark\");\nrequire(\"@ingka/icon-store/arrow-up-from-base\");\nrequire(\"@ingka/icon-store/printer\");\nrequire(\"@ingka/icon-store/question-mark-circle\");\nrequire(\"@ingka/icon-store/delivery-truck\");\nrequire(\"@ingka/icon-store/warehouse\");\nconst MenuCardBackButtonEnum_1 = __importDefault(require(\"../../enums/MenuCardBackButtonEnum\"));\nconst MenuCardStepEnum_1 = __importDefault(require(\"../../enums/MenuCardStepEnum\"));\nconst MenuItemEnum_1 = __importDefault(require(\"../../enums/MenuItemEnum\"));\nconst IkeaLogo_1 = __importDefault(require(\"../../IkeaLogo\"));\nconst MenuCardTracker_1 = __importDefault(require(\"../../trackers/MenuCardTracker\"));\nconst MenuCardStyle_1 = __importDefault(require(\"./MenuCardStyle\"));\n/**\n * @event backButtonClick Triggered when the back button is clicked.\n * @event openButtonClick Triggered when the open button is clicked.\n * @event startFromScratchButtonClick Triggered when the start from scratch button is clicked.\n * @event saveButtonClick Triggered when the save button is clicked.\n * @event shareButtonClick Triggered when the share button is clicked.\n * @event printButtonClick Triggered when the print button is clicked.\n * @event helpButtonClick Triggered when the help button is clicked.\n * @event zipCodeButtonClick Triggered when the zip code button is clicked.\n * @event storeButtonClick Triggered when the store button is clicked.\n * @event languageSelectorClick Triggered when the language selector button is clicked.\n */\nlet MenuCard = class MenuCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Shows the Save design button. Only available when optionsConfiguration is set to \"planning\" or \"summary\".\n this.showSaveButton = false;\n // Shows the Share design button. Only available when optionsConfiguration is set to \"planning\" or \"summary\".\n this.showShareButton = false;\n // Shows the Print button. Only available when optionsConfiguration is set to \"summary\".\n this.showPrintButton = false;\n // Shows the Help button.\n this.showHelpButton = false;\n // Submitted and validated ZIP code.\n this.zipCode = null;\n // Selected store id.\n this.storeId = null;\n // A list of stores. Used to display the name of the selected store.\n this.stores = null;\n // Shows the language selector. Set to true in kiosks.\n this.showLanguageSelector = false;\n // Currently selected language. Only needed when language selector is shown. For example: \"en-GB\".\n this.locale = null;\n // Disables outgoing links. Should be true for kiosks.\n this.disableLinks = false;\n // Currently selected language. Must be set to show language selector and/or to enable analytics. For example: \"en-GB\".\n this.analytics = null;\n this.tracker = null;\n this.dexfSettings = null;\n }\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t${this.getBackButton()} ${this.getTopMenuOptions()} ${this.getBottomMenuOptions()}\n\t\t\t\t\t\t${this.getLanguageSelector()}\n\t\t\t\t\t
    \n\t\t\t\t\t${this.getFooter()}\n\t\t\t\t
    \n\t\t\t
    \n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.disconnectTracker();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n if (changedProperties.has('analytics') && this.hasTranslationsAndSettings()) {\n this.disconnectTracker();\n this.connectTracker();\n }\n return true;\n }\n getSettings() {\n return this.dexfSettings;\n }\n hasTranslationsAndSettings() {\n return !!this.localizedInformation || !!(this.translations && this.settings);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n connectTracker() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n if (this.analytics) {\n const locale = this.getLocaleForAnalyticsOrThrow();\n // eslint-disable-next-line no-underscore-dangle\n const reporter = this.analytics.__INTERNAL__reporter;\n if ((reporter === null || reporter === void 0 ? void 0 : reporter.connected) === false) {\n // Should use an existing reporter, but wait for it to be connected\n return;\n }\n // Use existing connected reporter, or the tracker should create a new one.\n const reporterId = reporter ? reporter.id : undefined;\n this.tracker = new MenuCardTracker_1.default(Object.assign(Object.assign({}, this.analytics), { locale, settings: this.getSettings(), reporterId }));\n yield ((_a = this.tracker) === null || _a === void 0 ? void 0 : _a.connect());\n }\n });\n }\n getLocaleForAnalyticsOrThrow() {\n if (!this.locale) {\n throw Error(\"The property 'locale' must be set when analytics is enabled.\");\n }\n return this.locale;\n }\n disconnectTracker() {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.disconnect();\n this.tracker = null;\n }\n getBackButton() {\n if (this.backButton === MenuCardBackButtonEnum_1.default.none) {\n return null;\n }\n const { navMenuNavigationButtonEntry, navMenuNavigationButtonPlanning, navMenuNavigationButtonSummary } = this.getTranslations();\n const translations = {\n [MenuCardBackButtonEnum_1.default.exitPlanner]: navMenuNavigationButtonEntry,\n [MenuCardBackButtonEnum_1.default.backToStartPage]: navMenuNavigationButtonPlanning,\n [MenuCardBackButtonEnum_1.default.editDesign]: navMenuNavigationButtonSummary\n };\n const icons = {\n [MenuCardBackButtonEnum_1.default.exitPlanner]: 'arrow-left-to-base',\n [MenuCardBackButtonEnum_1.default.backToStartPage]: 'arrow-left',\n [MenuCardBackButtonEnum_1.default.editDesign]: 'arrow-left'\n };\n /* eslint-disable lit-a11y/click-events-have-key-events */\n return (0, web_component_1.html) `\n\t\t\t {\n var _a;\n const button = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('skapa-icon-button');\n // We do this to avoid triggering double events if the button is clicked which is inside the div.\n if (event.target !== button) {\n button.click();\n }\n }}\n\t\t\t>\n\t\t\t\t\n\t\t\t\t\t${translations[this.backButton]}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t${translations[this.backButton]}\n\t\t\t\n\t\t`;\n /* eslint-enable lit-a11y/click-events-have-key-events */\n }\n onBackButtonClick() {\n var _a;\n this.dispatchEvent(new CustomEvent('backButtonClick', { bubbles: true }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendBackButtonClick(this.optionsConfiguration, this.backButton);\n }\n getTopMenuOptions() {\n const { open, startFromScratch, save, share, print, help } = this.getTranslations();\n const menuOptions = [\n {\n icon: 'folder',\n text: open,\n show: true,\n eventName: 'openButtonClick',\n menuItem: MenuItemEnum_1.default.open\n },\n {\n icon: 'create-new',\n text: startFromScratch,\n show: true,\n eventName: 'startFromScratchButtonClick',\n menuItem: MenuItemEnum_1.default.startFromScratch\n },\n {\n icon: 'bookmark',\n text: save,\n show: this.showSaveButton && this.optionsConfiguration !== MenuCardStepEnum_1.default.gallery,\n eventName: 'saveButtonClick',\n menuItem: MenuItemEnum_1.default.save\n },\n {\n icon: 'arrow-up-from-base',\n text: share,\n show: this.showShareButton && this.optionsConfiguration !== MenuCardStepEnum_1.default.gallery,\n eventName: 'shareButtonClick',\n menuItem: MenuItemEnum_1.default.share\n },\n {\n icon: 'printer',\n text: print,\n show: this.showPrintButton && this.optionsConfiguration === MenuCardStepEnum_1.default.summary,\n eventName: 'printButtonClick',\n menuItem: MenuItemEnum_1.default.print\n },\n {\n icon: 'question-mark-circle',\n text: help,\n show: this.showHelpButton,\n eventName: 'helpButtonClick',\n menuItem: MenuItemEnum_1.default.help\n }\n ];\n return (0, web_component_1.html) `\n\t\t\t
      \n\t\t\t\t${menuOptions.map((menuOption) => this.getMenuOption(menuOption))}\n\t\t\t
    \n\t\t`;\n }\n showStore() {\n var _a;\n if (!this.stores ||\n ((_a = this.stores) === null || _a === void 0 ? void 0 : _a.length) === 0 ||\n // No reason to show the store selector if there are no store availabilties.\n this.getSettings().kompis.serviceSettings.storeAvailabilityDataSource ===\n enums_1.StoreAvailabilityDataSourceEnum.disabled) {\n return false;\n }\n return true;\n }\n getBottomMenuOptions() {\n var _a;\n const { zipValidationDataSource, zipAvailabilityDataSource } = this.getSettings().kompis.serviceSettings;\n const zipCodeText = (_a = this.zipCode) !== null && _a !== void 0 ? _a : this.getTranslations().enterZip;\n const showZipCode = zipValidationDataSource !== enums_1.ZipValidationDataSourceEnum.disabled &&\n zipAvailabilityDataSource !== enums_1.ZipAvailabilityDataSourceEnum.disabled;\n const storeText = this.getStoreText();\n const showStore = this.showStore();\n const menuOptions = [\n {\n icon: 'delivery-truck',\n text: zipCodeText,\n show: showZipCode,\n eventName: 'zipCodeButtonClick',\n menuItem: MenuItemEnum_1.default.selectZipCode\n },\n {\n icon: 'warehouse',\n text: storeText,\n show: showStore,\n eventName: 'storeButtonClick',\n menuItem: MenuItemEnum_1.default.selectStore\n }\n ];\n if (menuOptions.filter(({ show }) => show).length === 0) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
      \n\t\t\t\t${menuOptions.map((menuOption) => this.getMenuOption(menuOption))}\n\t\t\t
    \n\t\t`;\n }\n getMenuOption(menuOption) {\n // This code and related styling copies the Skapa ListViewItem\n // When ListViewItem is available as a web component, we should\n // use that web component instead.\n const { icon, text, show, eventName, menuItem } = menuOption;\n if (!show) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
  • \n\t\t\t\t {\n this.dispatchEvent(new CustomEvent(eventName, {\n bubbles: true,\n detail: {\n triggerElement: this.shadowRoot.querySelector('#' + eventName)\n }\n }));\n this.sendClickItemEvent(menuItem);\n }}\"\n\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\t${text}\n\t\t\t\t\n\t\t\t
  • \n\t\t`;\n }\n getStoreText() {\n var _a, _b;\n const text = this.getTranslations().storeSelectorTitle;\n if (!this.storeId) {\n return text;\n }\n const store = ((_a = this.stores) === null || _a === void 0 ? void 0 : _a.find((store) => store.id === this.storeId)) || null;\n return (_b = store === null || store === void 0 ? void 0 : store.name) !== null && _b !== void 0 ? _b : text;\n }\n getLanguageSelector() {\n if (!this.locale || !this.showLanguageSelector) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t {\n this.dispatchEvent(new CustomEvent('languageSelectorClick', { bubbles: true }));\n this.sendClickItemEvent(MenuItemEnum_1.default.selectLanguage);\n }}\"\n\t\t\t>\n\t\t`;\n }\n getFooter() {\n const encodedLogo = encodeURIComponent(IkeaLogo_1.default);\n const svgSource = `data:image/svg+xml,${encodedLogo}`;\n const image = (0, web_component_1.html) ``;\n const logo = this.disableLinks\n ? image\n : (0, web_component_1.html) `${image}`;\n return (0, web_component_1.html) `
    ${logo}
    `;\n }\n sendClickItemEvent(item) {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendMenuItemClick(this.optionsConfiguration, item);\n }\n sendNavigationEvent() {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendNavigationMainPage(this.optionsConfiguration);\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], MenuCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MenuCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MenuCard.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MenuCard.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, required: true })\n], MenuCard.prototype, \"backButton\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, required: true })\n], MenuCard.prototype, \"optionsConfiguration\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], MenuCard.prototype, \"showSaveButton\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], MenuCard.prototype, \"showShareButton\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], MenuCard.prototype, \"showPrintButton\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], MenuCard.prototype, \"showHelpButton\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], MenuCard.prototype, \"zipCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], MenuCard.prototype, \"storeId\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MenuCard.prototype, \"stores\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], MenuCard.prototype, \"showLanguageSelector\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], MenuCard.prototype, \"locale\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], MenuCard.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MenuCard.prototype, \"analytics\", void 0);\nMenuCard = __decorate([\n (0, web_component_1.customElement)('kompis-menu-card')\n], MenuCard);\nexports.default = MenuCard;\n//# sourceMappingURL=MenuCard.js.map","import \"@inter-ikea-kompis/component-menu/lib/components/menu-card/MenuCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisMenuCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-menu-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.analytics = props.analytics;\n element.backButton = props.backButton;\n element.disableLinks = props.disableLinks;\n element.locale = props.locale;\n element.localizedInformation = props.localizedInformation;\n element.optionsConfiguration = props.optionsConfiguration;\n element.settings = props.settings;\n element.showHelpButton = props.showHelpButton;\n element.showLanguageSelector = props.showLanguageSelector;\n element.showPrintButton = props.showPrintButton;\n element.showSaveButton = props.showSaveButton;\n element.showShareButton = props.showShareButton;\n element.storeId = props.storeId;\n element.stores = props.stores;\n element.theme = props.theme;\n element.translations = props.translations;\n element.zipCode = props.zipCode;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onBackButtonClick, \"backButtonClick\");\n this.updateEventListener(element, props.onHelpButtonClick, \"helpButtonClick\");\n this.updateEventListener(element, props.onLanguageSelectorClick, \"languageSelectorClick\");\n this.updateEventListener(element, props.onOpenButtonClick, \"openButtonClick\");\n this.updateEventListener(element, props.onPrintButtonClick, \"printButtonClick\");\n this.updateEventListener(element, props.onSaveButtonClick, \"saveButtonClick\");\n this.updateEventListener(element, props.onShareButtonClick, \"shareButtonClick\");\n this.updateEventListener(element, props.onStartFromScratchButtonClick, \"startFromScratchButtonClick\");\n this.updateEventListener(element, props.onStoreButtonClick, \"storeButtonClick\");\n this.updateEventListener(element, props.onZipCodeButtonClick, \"zipCodeButtonClick\");\n }\n}\nKompisMenuCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n analytics: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n backButton: PropTypes.string.isRequired,\n disableLinks: PropTypes.bool,\n locale: PropTypes.string,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n optionsConfiguration: PropTypes.string.isRequired,\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n showHelpButton: PropTypes.bool,\n showLanguageSelector: PropTypes.bool,\n showPrintButton: PropTypes.bool,\n showSaveButton: PropTypes.bool,\n showShareButton: PropTypes.bool,\n storeId: PropTypes.string,\n stores: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n zipCode: PropTypes.string,\n onBackButtonClick: PropTypes.func,\n onOpenButtonClick: PropTypes.func,\n onStartFromScratchButtonClick: PropTypes.func,\n onSaveButtonClick: PropTypes.func,\n onShareButtonClick: PropTypes.func,\n onPrintButtonClick: PropTypes.func,\n onHelpButtonClick: PropTypes.func,\n onZipCodeButtonClick: PropTypes.func,\n onStoreButtonClick: PropTypes.func,\n onLanguageSelectorClick: PropTypes.func\n};\nexport default KompisMenuCard;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('menu', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M20 8H4V6h16v2zm0 5H4v-2h16v2zm0 5H4v-2h16v2z' } }]);\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst analytics_1 = require(\"@inter-ikea-kompis/analytics\");\nconst insights_data_provider_1 = require(\"@insights/insights-data-provider\");\nconst MenuItemEnum_1 = __importDefault(require(\"../enums/MenuItemEnum\"));\nconst moduleId = 'menu';\n/**\n * @event click When menu button is clicked.\n * {@nestedTracker component-menu/src/trackers/MenuCardTracker.ts}.\n */\nclass MenuTracker extends analytics_1.AbstractAnalyticsTracker {\n constructor(options) {\n super(Object.assign({ moduleId }, options));\n }\n sendClickMenu(step) {\n const payload = {\n common: { component: moduleId },\n data: {\n item: MenuItemEnum_1.default.menu,\n step\n }\n };\n this.getReporter().report({\n event: 'click',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe,\n payload\n });\n }\n}\nexports.default = MenuTracker;\n//# sourceMappingURL=MenuTracker.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar MenuModalEnum;\n(function (MenuModalEnum) {\n MenuModalEnum[\"menuCard\"] = \"menuCard\";\n})(MenuModalEnum || (MenuModalEnum = {}));\nexports.default = MenuModalEnum;\n//# sourceMappingURL=MenuModalEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nclass MenuStyle {\n static getStyle(options) {\n const { theme } = options;\n const { breakpoint, color } = theme;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\n\t\t\t:host {\n\t\t\t\tpointer-events: auto;\n\t\t\t}\n\n\t\t\t.button {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t}\n\n\t\t\t#visible-label {\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\t@media screen and (min-width: ${breakpoint.xlarge.width / 16}rem) {\n\t\t\t\t#visible-label {\n\t\t\t\t\tdisplay: inline;\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = MenuStyle;\n//# sourceMappingURL=MenuStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_sheet_1 = require(\"@inter-ikea-kompis/component-sheet\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@inter-ikea-kompis/component-sheet\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/icon-store/menu\");\nrequire(\"../menu-card/MenuCard\");\nconst MenuCardStepEnum_1 = __importDefault(require(\"../../enums/MenuCardStepEnum\"));\nconst MenuTracker_1 = __importDefault(require(\"../../trackers/MenuTracker\"));\nconst MenuModalEnum_1 = __importDefault(require(\"../../types/MenuModalEnum\"));\nconst MenuStyle_1 = __importDefault(require(\"./MenuStyle\"));\n/**\n * @event menuButtonClick Triggered when the menu button is clicked.\n * @event modalClose Triggered when modal should be hidden.\n * @event backButtonClick Triggered when the back button is clicked.\n * @event openButtonClick Triggered when the open button is clicked.\n * @event startFromScratchButtonClick Triggered when the start from scratch button is clicked.\n * @event saveButtonClick Triggered when the save button is clicked.\n * @event shareButtonClick Triggered when the share button is clicked.\n * @event printButtonClick Triggered when the print button is clicked.\n * @event helpButtonClick Triggered when the help button is clicked.\n * @event zipCodeButtonClick Triggered when the zip code button is clicked.\n * @event storeButtonClick Triggered when the store button is clicked.\n * @event languageSelectorClick Triggered when the language selector button is clicked.\n */\nlet Menu = class Menu extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Show a modal.\n this.visibleModal = null;\n // Submitted and validated ZIP code.\n this.zipCode = null;\n // Selected store id.\n this.storeId = null;\n // A list of stores. Used to display the name of the selected store.\n this.stores = null;\n // Currently selected language. Must be set to show language selector and/or to enable analytics. For example: \"en-GB\".\n this.locale = null;\n // Disables outgoing links. Should be true for kiosks.\n this.disableLinks = false;\n // Used for automatic analytics. If null or not set, analytics is turned off.\n this.analytics = null;\n // Menu Card settings. For more info about the props check the Menu Card component.\n this.menuCard = {\n showSaveButton: false,\n showShareButton: false,\n showPrintButton: false,\n showHelpButton: false,\n showLanguageSelector: false\n };\n this.breakpointObserver = new themes_1.ThemeBreakpointObserver(() => this.requestUpdate());\n this.tracker = null;\n this.dexfSettings = null;\n }\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n const breakpointIndex = this.breakpointObserver.getBreakpointIndex();\n const primaryVariant = 'primary';\n const screenWidthIsLargerThanSmall = breakpointIndex !== null && breakpointIndex !== enums_1.ThemeBreakpointIndexEnum.small;\n const showLargeButton = screenWidthIsLargerThanSmall && this.optionsConfiguration === MenuCardStepEnum_1.default.planning;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t {\n var _a;\n this.dispatchEvent(new CustomEvent('menuButtonClick', {\n bubbles: true,\n detail: {\n visibleModal: MenuModalEnum_1.default.menuCard\n }\n }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendClickMenu(this.optionsConfiguration);\n }}\n\t\t\t\t>\n\t\t\t\t\t${this.getTranslations().menu}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t${this.getVisibleLabel()}\n\t\t\t
    \n\t\t\t${this.getSheet()}\n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.breakpointObserver.disconnect();\n this.disconnectTracker();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n if (changedProperties.has('theme')) {\n this.breakpointObserver.observe(this.theme);\n }\n if (changedProperties.has('analytics') && this.hasTranslationsAndSettings()) {\n this.disconnectTracker();\n this.connectTracker();\n }\n return true;\n }\n getSettings() {\n return this.dexfSettings;\n }\n hasTranslationsAndSettings() {\n return !!this.localizedInformation || !!(this.translations && this.settings);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n connectTracker() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n if (this.analytics) {\n this.tracker = new MenuTracker_1.default(Object.assign(Object.assign({}, this.analytics), { locale: this.getLocaleForAnalyticsOrThrow(), settings: this.getSettings() }));\n yield ((_a = this.tracker) === null || _a === void 0 ? void 0 : _a.connect());\n }\n });\n }\n getLocaleForAnalyticsOrThrow() {\n if (!this.locale) {\n throw Error(\"The property 'locale' must be set when analytics is enabled.\");\n }\n return this.locale;\n }\n disconnectTracker() {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.disconnect();\n this.tracker = null;\n }\n getVisibleLabel() {\n if (this.optionsConfiguration === MenuCardStepEnum_1.default.planning) {\n return null;\n }\n return (0, web_component_1.html) ` \n\t\t\t${this.getTranslations().menu}\n\t\t
    `;\n }\n getSheet() {\n const { menu, modalAriaLabelButtonClose } = this.getTranslations();\n return (0, web_component_1.html) ` {\n this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }));\n this.refocusMenuButton();\n }}\"\n\t\t>\n\t\t\t {\n this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }));\n this.refocusMenuButton();\n }}\"\n\t\t\t>\n\t\t\t${this.getMenuCard()}`;\n }\n refocusMenuButton() {\n var _a;\n const button = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('skapa-icon-button');\n button.focus();\n }\n getMenuCard() {\n const { showSaveButton, showShareButton, showPrintButton, showHelpButton, showLanguageSelector } = this.menuCard;\n return (0, web_component_1.html) ` this.dispatchEvent(new CustomEvent('backButtonClick', { bubbles: true }))}\"\n\t\t\t@openButtonClick=\"${(event) => {\n var _a;\n return this.dispatchEvent(new CustomEvent('openButtonClick', {\n bubbles: true,\n detail: {\n triggerElement: (_a = event.detail) === null || _a === void 0 ? void 0 : _a.triggerElement\n }\n }));\n }}\"\n\t\t\t@startFromScratchButtonClick=\"${(event) => {\n var _a;\n this.dispatchEvent(new CustomEvent('startFromScratchButtonClick', {\n bubbles: true,\n detail: {\n triggerElement: (_a = event.detail) === null || _a === void 0 ? void 0 : _a.triggerElement\n }\n }));\n }}\"\n\t\t\t@saveButtonClick=\"${(event) => {\n var _a;\n return this.dispatchEvent(new CustomEvent('saveButtonClick', {\n bubbles: true,\n detail: {\n triggerElement: (_a = event.detail) === null || _a === void 0 ? void 0 : _a.triggerElement\n }\n }));\n }}\"\n\t\t\t@printButtonClick=\"${(event) => {\n var _a;\n return this.dispatchEvent(new CustomEvent('printButtonClick', {\n bubbles: true,\n detail: {\n triggerElement: (_a = event.detail) === null || _a === void 0 ? void 0 : _a.triggerElement\n }\n }));\n }}\"\n\t\t\t@helpButtonClick=\"${(event) => {\n var _a;\n return this.dispatchEvent(new CustomEvent('helpButtonClick', {\n bubbles: true,\n detail: {\n triggerElement: (_a = event.detail) === null || _a === void 0 ? void 0 : _a.triggerElement\n }\n }));\n }}\"\n\t\t\t@zipCodeButtonClick=\"${(event) => {\n var _a;\n this.dispatchEvent(new CustomEvent('zipCodeButtonClick', {\n bubbles: true,\n detail: {\n triggerElement: (_a = event.detail) === null || _a === void 0 ? void 0 : _a.triggerElement\n }\n }));\n }}\"\n\t\t\t@storeButtonClick=\"${(event) => {\n var _a;\n return this.dispatchEvent(new CustomEvent('storeButtonClick', {\n bubbles: true,\n detail: {\n triggerElement: (_a = event.detail) === null || _a === void 0 ? void 0 : _a.triggerElement\n }\n }));\n }}\"\n\t\t\t@languageSelectorClick=\"${(event) => {\n var _a;\n return this.dispatchEvent(new CustomEvent('languageSelectorClick', {\n bubbles: true,\n detail: {\n triggerElement: (_a = event.detail) === null || _a === void 0 ? void 0 : _a.triggerElement\n }\n }));\n }}\"\n\t\t\t@shareButtonClick=\"${(event) => {\n var _a;\n this.dispatchEvent(new CustomEvent('shareButtonClick', {\n bubbles: true,\n detail: {\n triggerElement: (_a = event.detail) === null || _a === void 0 ? void 0 : _a.triggerElement\n }\n }));\n }}\"\n\t\t>`;\n }\n getAnalyticsForCard() {\n var _a;\n const reporterId = (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.getConnectedReporterId();\n return this.analytics\n ? Object.assign(Object.assign({}, this.analytics), { \n // eslint-disable-next-line camelcase\n __INTERNAL__reporter: reporterId\n ? { connected: true, id: reporterId }\n : { connected: false } }) : null;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Menu.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], Menu.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], Menu.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], Menu.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Menu.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, required: true })\n], Menu.prototype, \"backButton\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, required: true })\n], Menu.prototype, \"optionsConfiguration\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Menu.prototype, \"zipCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Menu.prototype, \"storeId\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], Menu.prototype, \"stores\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Menu.prototype, \"locale\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Menu.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], Menu.prototype, \"analytics\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], Menu.prototype, \"menuCard\", void 0);\nMenu = __decorate([\n (0, web_component_1.customElement)('kompis-menu')\n], Menu);\nexports.default = Menu;\n//# sourceMappingURL=Menu.js.map","import \"@inter-ikea-kompis/component-menu/lib/components/menu/Menu\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisMenu extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-menu\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.analytics = props.analytics;\n element.backButton = props.backButton;\n element.disableLinks = props.disableLinks;\n element.locale = props.locale;\n element.localizedInformation = props.localizedInformation;\n element.menuCard = props.menuCard;\n element.optionsConfiguration = props.optionsConfiguration;\n element.settings = props.settings;\n element.storeId = props.storeId;\n element.stores = props.stores;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n element.zipCode = props.zipCode;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onBackButtonClick, \"backButtonClick\");\n this.updateEventListener(element, props.onHelpButtonClick, \"helpButtonClick\");\n this.updateEventListener(element, props.onLanguageSelectorClick, \"languageSelectorClick\");\n this.updateEventListener(element, props.onMenuButtonClick, \"menuButtonClick\");\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onOpenButtonClick, \"openButtonClick\");\n this.updateEventListener(element, props.onPrintButtonClick, \"printButtonClick\");\n this.updateEventListener(element, props.onSaveButtonClick, \"saveButtonClick\");\n this.updateEventListener(element, props.onShareButtonClick, \"shareButtonClick\");\n this.updateEventListener(element, props.onStartFromScratchButtonClick, \"startFromScratchButtonClick\");\n this.updateEventListener(element, props.onStoreButtonClick, \"storeButtonClick\");\n this.updateEventListener(element, props.onZipCodeButtonClick, \"zipCodeButtonClick\");\n }\n}\nKompisMenu.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n analytics: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n backButton: PropTypes.string.isRequired,\n disableLinks: PropTypes.bool,\n locale: PropTypes.string,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n menuCard: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n optionsConfiguration: PropTypes.string.isRequired,\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n storeId: PropTypes.string,\n stores: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n zipCode: PropTypes.string,\n onMenuButtonClick: PropTypes.func,\n onModalClose: PropTypes.func,\n onBackButtonClick: PropTypes.func,\n onOpenButtonClick: PropTypes.func,\n onStartFromScratchButtonClick: PropTypes.func,\n onSaveButtonClick: PropTypes.func,\n onShareButtonClick: PropTypes.func,\n onPrintButtonClick: PropTypes.func,\n onHelpButtonClick: PropTypes.func,\n onZipCodeButtonClick: PropTypes.func,\n onStoreButtonClick: PropTypes.func,\n onLanguageSelectorClick: PropTypes.func\n};\nexport default KompisMenu;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar MiniPriceAlignmentEnum;\n(function (MiniPriceAlignmentEnum) {\n MiniPriceAlignmentEnum[\"right\"] = \"right\";\n MiniPriceAlignmentEnum[\"left\"] = \"left\";\n})(MiniPriceAlignmentEnum || (MiniPriceAlignmentEnum = {}));\nexports.default = MiniPriceAlignmentEnum;\n//# sourceMappingURL=MiniPriceAlignmentEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar MiniPriceModalEnum;\n(function (MiniPriceModalEnum) {\n MiniPriceModalEnum[\"ecoFeeCard\"] = \"ecoFeeCard\";\n})(MiniPriceModalEnum || (MiniPriceModalEnum = {}));\nexports.default = MiniPriceModalEnum;\n//# sourceMappingURL=MiniPriceModalEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst MiniPriceAlignmentEnum_1 = __importDefault(require(\"../../enums/MiniPriceAlignmentEnum\"));\nclass MiniPriceStyle {\n /**\n * Returns style.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @param options.align Alignment.\n * @param options.hasDualCurrencies\n * @param options.isTRO Time Restricted Offer.\n * @returns Css.\n */\n static getStyle(options) {\n const { color, spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: ${options.align === MiniPriceAlignmentEnum_1.default.right ? 'flex-end' : 'flex-start'};\n\t\t\t\ttext-align: ${options.align === MiniPriceAlignmentEnum_1.default.right ? 'end' : 'start'};\n\t\t\t}\n\n\t\t\t.priceContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\n\t\t\t.innerPriceContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: ${options.align === MiniPriceAlignmentEnum_1.default.right ? 'flex-end' : 'flex-start'};\n\t\t\t}\n\n\t\t\t.text {\n\t\t\t\tcolor: ${color.neutral.grey700};\n\t\t\t}\n\n\t\t\t.divider {\n\t\t\t\tdisplay: flex;\n\t\t\t\twidth: ${spacing.space50 / 16}rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t}\n\n\t\t\t.regularPriceTextDivider {\n\t\t\t\tdisplay: flex;\n\t\t\t\twidth: ${spacing.space25 / 16}rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t}\n\n\t\t\tskapa-commercial-message {\n\t\t\t\tfont-size: ${14 / 16}rem;\n\t\t\t}\n\n\t\t\t.regularPrice {\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: ${options.align === MiniPriceAlignmentEnum_1.default.right\n ? 'flex-end'\n : 'flex-start'};\n\t\t\t}\n\n\t\t\t.price {\n\t\t\t\tdisplay: flex;\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t\talign-items: center;\n\t\t\t}\n\n\t\t\t.price:nth-child(odd) {\n\t\t\t\tmargin-bottom: ${options.hasDualCurrencies ? 6 / 16 : 0}rem;\n\t\t\t}\n\n\t\t\t.price:nth-child(even):not(:last-child) {\n\t\t\t\tmargin-bottom: ${options.isTRO ? 6 / 16 : 0}rem;\n\t\t\t}\n\n\t\t\tslot,\n\t\t\tkompis-eco-fee {\n\t\t\t\tpointer-events: auto;\n\t\t\t\tuser-select: auto;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = MiniPriceStyle;\n//# sourceMappingURL=MiniPriceStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@inter-ikea-kompis/component-price-formatter\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@inter-ikea-kompis/component-eco-fee\");\nrequire(\"@ingka/commercial-message-webc\");\nconst MiniPriceAlignmentEnum_1 = __importDefault(require(\"../../enums/MiniPriceAlignmentEnum\"));\nconst MiniPriceModalEnum_1 = __importDefault(require(\"../../enums/MiniPriceModalEnum\"));\nconst MiniPriceStyle_1 = __importDefault(require(\"./MiniPriceStyle\"));\n/**\n * Mini Price.\n *\n * @event modalClose Triggered when the modal has been closed\n * @event modalOpen Triggered when a modal has been opened. event.detail.modalType tells you the type\n */\nlet MiniPrice = class MiniPrice extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Set price to be animated\n this.animatedPrice = false;\n // Align slot\n this.align = null;\n // Show eco fee\n this.showEcoFee = false;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // Show a modal.\n this.visibleModal = null;\n this.dexfSettings = null;\n }\n /**\n * Renders view.\n *\n * @returns Template.\n */\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n if (!this.shoppingProducts) {\n return null;\n }\n const totalPrice = utilities_1.TotalPriceCalculator.calculateMultiple(this.shoppingProducts, this.getSettings().localisation.dateFormat);\n const primaryCurrency = totalPrice[0];\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t${this.getCommercialMessage(primaryCurrency)}\n\n\t\t\t
    \n\t\t\t\t${this.align === MiniPriceAlignmentEnum_1.default.right\n ? (0, web_component_1.html) `\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
    \n\t\t\t\t\t `\n : ''}\n\n\t\t\t\t
    \n\t\t\t\t\t${totalPrice.map((price, index) => {\n const isPrimaryCurrency = index < 1;\n return (0, web_component_1.html) `\n\t\t\t\t\t\t\t${this.getRegularPrice(price)} ${this.getPrice(price, isPrimaryCurrency)}\n\t\t\t\t\t\t`;\n })}\n\t\t\t\t
    \n\n\t\t\t\t${this.align !== MiniPriceAlignmentEnum_1.default.right\n ? (0, web_component_1.html) `\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
    \n\t\t\t\t\t `\n : ''}\n\t\t\t
    \n\n\t\t\t${this.getText(primaryCurrency)} ${this.getEcoFee(primaryCurrency)}\n\t\t`;\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n getSettings() {\n return this.dexfSettings;\n }\n /**\n * Returns eco fee.\n *\n * @param totalPrice Price model.\n * @returns Template.\n */\n getEcoFee(totalPrice) {\n if (!this.showEcoFee || (!totalPrice.ecoPrice && !totalPrice.weeePrice)) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t {\n var _a, _b;\n this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }));\n (_b = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.triggerElement) === null || _b === void 0 ? void 0 : _b.focus();\n }}\"\n\t\t\t\t@modalOpen=\"${() => this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: { visibleModal: MiniPriceModalEnum_1.default.ecoFeeCard }\n }))}\"\n\t\t\t>\n\t\t`;\n }\n /**\n * Get the commercial message.\n *\n * @param totalPrice Price model.\n * @returns Commercial message.\n */\n getCommercialMessage(totalPrice) {\n if (!utilities_1.PriceUtility.isFamily(totalPrice)) {\n return null;\n }\n const variant = 'family';\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${this.getTranslations().priceInfoIkeaFamilyPrice}\n\t\t\t\n\t\t`;\n }\n /**\n * Get the regular price.\n *\n * @param totalPrice Price model.\n * @returns Regular price.\n */\n getRegularPrice(totalPrice) {\n if (!utilities_1.PriceUtility.isTro(totalPrice)) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n /**\n * Get the current price.\n *\n * @param totalPrice Price model.\n * @param isPrimaryCurrency\n * @returns Current price.\n */\n getPrice(totalPrice, isPrimaryCurrency) {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n /**\n * Get the text.\n *\n * @param totalPrice Price model.\n * @returns The text.\n */\n getText(totalPrice) {\n if (!utilities_1.PriceUtility.isTroOrFamily(totalPrice)) {\n return null;\n }\n return (0, web_component_1.html) `${this.getRegularPriceText(totalPrice)} ${this.getValidTimePeriod(totalPrice)}`;\n }\n /**\n * Get correct translation for time period.\n *\n * @param totalPrice Price model.\n * @returns Translated price period.\n */\n getValidTimePeriod(totalPrice) {\n const settings = this.getSettings();\n const updatedSettings = Object.assign(Object.assign({}, settings), { kompis: Object.assign(Object.assign({}, settings.kompis), { priceSettings: Object.assign(Object.assign({}, settings.kompis.priceSettings), { temporaryPricePeriod: settings.kompis.priceSettings.temporaryPricePeriodMiniSummary }) }) });\n const validInterval = utilities_1.PriceUtility.getValidInterval(totalPrice, undefined, this.getTranslations(), updatedSettings);\n return validInterval\n ? (0, web_component_1.html) `\n\t\t\t\t\t\n\t\t\t\t\t\t${validInterval}\n\t\t\t\t\t\n\t\t\t `\n : null;\n }\n /**\n * Get regular price text.\n * If loyaltyProgramEqualFontSize is true, it will render the same amount, but with enlarged font size.\n *\n * @param totalPrice Price model.\n * @returns Regular price text.\n */\n getRegularPriceText(totalPrice) {\n if (!utilities_1.PriceUtility.isFamily(totalPrice)) {\n return null;\n }\n const loyaltyProgramEqualFontSize = this.getSettings().kompis.priceSettings.loyaltyProgramEqualFontSize;\n const priceInfoRegularPrice = this.getTranslations().priceInfoRegularPrice;\n if (loyaltyProgramEqualFontSize) {\n return (0, web_component_1.html) `\n\t\t\t\t\n\t\t\t\t\t${priceInfoRegularPrice}\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t`;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t
    \n\t\t\t\t\t${priceInfoRegularPrice}:\n\t\t\t\t\t
    \n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t
    \n\t\t`;\n }\n /**\n * Price font style type.\n *\n * @param totalPrice Price model.\n * @param isPrimaryCurrency\n * @returns Font style type.\n */\n getPriceFontStyleType(totalPrice, isPrimaryCurrency) {\n if (utilities_1.PriceUtility.isFamily(totalPrice)) {\n return isPrimaryCurrency\n ? enums_1.ThemeFontStyleTypeEnum.priceMedium\n : enums_1.ThemeFontStyleTypeEnum.priceXSmall;\n }\n if (utilities_1.PriceUtility.isTro(totalPrice)) {\n return enums_1.ThemeFontStyleTypeEnum.priceMedium;\n }\n return isPrimaryCurrency\n ? enums_1.ThemeFontStyleTypeEnum.priceXLarge\n : enums_1.ThemeFontStyleTypeEnum.priceMedium;\n }\n /**\n * Returns if price is mixed size.\n *\n * @param totalPrice\n * @param isPrimaryCurrency\n * @returns Mixed size.\n */\n getPriceMixedSize(totalPrice, isPrimaryCurrency) {\n if (utilities_1.PriceUtility.isFamily(totalPrice) && !isPrimaryCurrency) {\n return false;\n }\n return true;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MiniPrice.prototype, \"shoppingProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MiniPrice.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MiniPrice.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MiniPrice.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], MiniPrice.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], MiniPrice.prototype, \"animatedPrice\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], MiniPrice.prototype, \"align\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], MiniPrice.prototype, \"showEcoFee\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], MiniPrice.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], MiniPrice.prototype, \"visibleModal\", void 0);\nMiniPrice = __decorate([\n (0, web_component_1.customElement)('kompis-mini-price')\n], MiniPrice);\nexports.default = MiniPrice;\n//# sourceMappingURL=MiniPrice.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MiniPriceModalEnum = exports.MiniPriceAlignmentEnum = exports.MiniPrice = void 0;\nconst MiniPrice_1 = __importDefault(require(\"./components/mini-price/MiniPrice\"));\nexports.MiniPrice = MiniPrice_1.default;\nconst MiniPriceAlignmentEnum_1 = __importDefault(require(\"./enums/MiniPriceAlignmentEnum\"));\nexports.MiniPriceAlignmentEnum = MiniPriceAlignmentEnum_1.default;\nconst MiniPriceModalEnum_1 = __importDefault(require(\"./enums/MiniPriceModalEnum\"));\nexports.MiniPriceModalEnum = MiniPriceModalEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('arrow-right', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'm20.0008 12.0001-8-8.001-1.4143 1.414L16.1727 11H4v2h12.1723l-5.5868 5.5866 1.4141 1.4142 8.0012-8.0007z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar MiniConfigurationSummaryIconTypeEnum;\n(function (MiniConfigurationSummaryIconTypeEnum) {\n MiniConfigurationSummaryIconTypeEnum[\"primaryInverted\"] = \"primaryInverted\";\n MiniConfigurationSummaryIconTypeEnum[\"tertiary\"] = \"tertiary\";\n})(MiniConfigurationSummaryIconTypeEnum || (MiniConfigurationSummaryIconTypeEnum = {}));\nexports.default = MiniConfigurationSummaryIconTypeEnum;\n//# sourceMappingURL=MiniConfigurationSummaryIconTypeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass MiniConfigurationSummaryStyle {\n /**\n * Returns style.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @returns Css.\n */\n static getStyle(options) {\n const { spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: flex-end;\n\t\t\t\tpointer-events: none;\n\t\t\t\tuser-select: none;\n\t\t\t}\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: stretch;\n\t\t\t}\n\t\t\t#whatsIncluded {\n\t\t\t\talign-self: center;\n\t\t\t}\n\t\t\tkompis-mini-price {\n\t\t\t\tjustify-content: space-evenly;\n\t\t\t}\n\t\t\t.divider {\n\t\t\t\tdisplay: flex;\n\t\t\t\twidth: ${spacing.space100 / 16}rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t}\n\t\t\tskapa-button,\n\t\t\tskapa-icon-button {\n\t\t\t\talign-self: flex-start;\n\t\t\t\tpointer-events: auto;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = MiniConfigurationSummaryStyle;\n//# sourceMappingURL=MiniConfigurationSummaryStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_button_1 = require(\"@inter-ikea-kompis/component-button\");\nconst component_mini_price_1 = require(\"@inter-ikea-kompis/component-mini-price\");\nrequire(\"@inter-ikea-kompis/component-mini-price\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/icon-store/arrow-right\");\nrequire(\"@ingka/icon-store/information-circle\");\nconst MiniConfigurationSummaryIconTypeEnum_1 = __importDefault(require(\"./../../enums/MiniConfigurationSummaryIconTypeEnum\"));\nconst MiniConfigurationSummaryStyle_1 = __importDefault(require(\"./MiniConfigurationSummaryStyle\"));\n/**\n * Mini Configuration Summary View.\n *\n * @event modalOpen Triggered when the user clicks on the eco fee link\n * @event modalClose Triggered when the user clicks on the sheet close button.\n * @event openWhatsIncluded Triggered when the user clicks on the whatsIncluded link or whatsIncluded icon.\n * @event next When next button is clicked.\n */\nlet MiniConfigurationSummary = class MiniConfigurationSummary extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Set price to be animated\n this.animatedPrice = false;\n // Disables button\n this.disabled = false;\n // Icon type\n this.iconType = MiniConfigurationSummaryIconTypeEnum_1.default.primaryInverted;\n // Hide whatsIncluded icon\n this.hideWhatsIncludedIcon = false;\n // Button size.\n this.buttonSize = component_button_1.ButtonSizeEnum.medium;\n // Button label\n this.buttonLabel = null;\n // Hide button icon\n this.hideButtonIcon = false;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // Renders the loading style\n this.loading = false;\n // Show a modal.\n this.visibleModal = null;\n this.breakpointObserver = new themes_1.ThemeBreakpointObserver(() => this.requestUpdate());\n }\n /**\n * Renders view.\n *\n * @returns Template.\n */\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.shoppingProducts || !this.hasTranslationsAndSettings()) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t${this.getPrice()}\n\t\t\t\t
    \n\t\t\t\t${this.getNextButton()}\n\t\t\t
    \n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.breakpointObserver.disconnect();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('theme')) {\n this.breakpointObserver.observe(this.theme);\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n /**\n * Returns mini price.\n *\n * @returns Html.\n */\n getPrice() {\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('modalOpen', { bubbles: true, detail: event.detail }))}\"\n\t\t\t\t@modalClose=\"${(event) => this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: event.detail }))}\"\n\t\t\t>\n\t\t\t\t${this.getWhatsIncludedIcon()}\n\t\t\t\n\t\t`;\n }\n /**\n * Returns the label for the checkout button.\n *\n * @returns Label to checkout button.\n */\n getNextButtonLabel() {\n return this.buttonLabel || this.getTranslations().buttonNextStep || '';\n }\n /**\n * Returns the checkout button.\n *\n * @returns Button to checkout.\n */\n getNextButton() {\n const breakpointIndex = this.breakpointObserver.getBreakpointIndex();\n const emphasisedVariant = 'emphasised';\n if (breakpointIndex !== null && breakpointIndex <= enums_1.ThemeBreakpointIndexEnum.small) {\n return (0, web_component_1.html) `\n\t\t\t\t this.dispatchEvent(new CustomEvent('next', { bubbles: true, detail: 'nextButtonClicked' }))}\n\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\t${this.getNextButtonLabel()}\n\t\t\t\t\n\t\t\t`;\n }\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('next', { bubbles: true, detail: 'nextButtonClicked' }))}\n\t\t\t>\n\t\t\t\t${this.hideButtonIcon\n ? null\n : (0, web_component_1.html) ``}\n\t\t\t\t${this.getNextButtonLabel()}\n\t\t\t\n\t\t`;\n }\n /**\n * @param shoppingProducts ShoppingProducts.\n * @returns ShoppingItems.\n */\n getShoppingItems(shoppingProducts) {\n const validShoppingProducts = shoppingProducts.filter((shoppingProduct) => !!shoppingProduct.product.content);\n return utilities_1.ProductUtility.getShoppingItems(validShoppingProducts);\n }\n /**\n * Callback for onOpenWhatsIncluded event.\n */\n onOpenWhatsIncluded() {\n if (!this.disabled) {\n this.dispatchEvent(new CustomEvent('openWhatsIncluded', {\n bubbles: true,\n detail: {\n shoppingItems: this.getShoppingItems(this.shoppingProducts),\n triggerElement: this.queryWhatsIncludedButton()\n }\n }));\n }\n }\n queryWhatsIncludedButton() {\n var _a, _b, _c, _d;\n return ((_d = (_c = (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#whatsIncluded')) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('button')) !== null && _d !== void 0 ? _d : null);\n }\n /**\n * @returns WhatsIncludedIcon.\n */\n getWhatsIncludedIcon() {\n if (this.hideWhatsIncludedIcon) {\n return null;\n }\n const buttonVariant = this.iconType === MiniConfigurationSummaryIconTypeEnum_1.default.primaryInverted\n ? 'primary'\n : 'tertiary';\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t\n\t\t\t\t${this.getTranslations().miniConfigurationSummaryAriaLabelWhatsIncluded}\n\t\t\t\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MiniConfigurationSummary.prototype, \"shoppingProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MiniConfigurationSummary.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MiniConfigurationSummary.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MiniConfigurationSummary.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], MiniConfigurationSummary.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], MiniConfigurationSummary.prototype, \"animatedPrice\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], MiniConfigurationSummary.prototype, \"disabled\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], MiniConfigurationSummary.prototype, \"iconType\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], MiniConfigurationSummary.prototype, \"hideWhatsIncludedIcon\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], MiniConfigurationSummary.prototype, \"buttonSize\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], MiniConfigurationSummary.prototype, \"buttonLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], MiniConfigurationSummary.prototype, \"hideButtonIcon\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], MiniConfigurationSummary.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], MiniConfigurationSummary.prototype, \"loading\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], MiniConfigurationSummary.prototype, \"visibleModal\", void 0);\nMiniConfigurationSummary = __decorate([\n (0, web_component_1.customElement)('kompis-mini-configuration-summary')\n], MiniConfigurationSummary);\nexports.default = MiniConfigurationSummary;\n//# sourceMappingURL=MiniConfigurationSummary.js.map","import \"@inter-ikea-kompis/component-mini-configuration-summary/lib/components/mini-configuration-summary/MiniConfigurationSummary\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisMiniConfigurationSummary extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-mini-configuration-summary\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.animatedPrice = props.animatedPrice;\n element.buttonLabel = props.buttonLabel;\n element.buttonSize = props.buttonSize;\n element.disableLinks = props.disableLinks;\n element.disabled = props.disabled;\n element.hideButtonIcon = props.hideButtonIcon;\n element.hideWhatsIncludedIcon = props.hideWhatsIncludedIcon;\n element.iconType = props.iconType;\n element.loading = props.loading;\n element.localizedInformation = props.localizedInformation;\n element.settings = props.settings;\n element.shoppingProducts = props.shoppingProducts;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n this.updateEventListener(element, props.onNext, \"next\");\n this.updateEventListener(element, props.onOpenWhatsIncluded, \"openWhatsIncluded\");\n }\n}\nKompisMiniConfigurationSummary.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n animatedPrice: PropTypes.bool,\n buttonLabel: PropTypes.string,\n buttonSize: PropTypes.string,\n disableLinks: PropTypes.bool,\n disabled: PropTypes.bool,\n hideButtonIcon: PropTypes.bool,\n hideWhatsIncludedIcon: PropTypes.bool,\n iconType: PropTypes.string,\n loading: PropTypes.bool,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n shoppingProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n onModalOpen: PropTypes.func,\n onModalClose: PropTypes.func,\n onOpenWhatsIncluded: PropTypes.func,\n onNext: PropTypes.func\n};\nexport default KompisMiniConfigurationSummary;\n","import \"@inter-ikea-kompis/component-mini-price/lib/components/mini-price/MiniPrice\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisMiniPrice extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-mini-price\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.align = props.align;\n element.animatedPrice = props.animatedPrice;\n element.disableLinks = props.disableLinks;\n element.localizedInformation = props.localizedInformation;\n element.settings = props.settings;\n element.shoppingProducts = props.shoppingProducts;\n element.showEcoFee = props.showEcoFee;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n }\n}\nKompisMiniPrice.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n align: PropTypes.string,\n animatedPrice: PropTypes.bool,\n disableLinks: PropTypes.bool,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n shoppingProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n showEcoFee: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n onModalClose: PropTypes.func,\n onModalOpen: PropTypes.func\n};\nexport default KompisMiniPrice;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IconPillSizeOptionsEnum = exports.IconPillGroup = exports.IconPill = void 0;\nconst IconPill_1 = __importDefault(require(\"./components/icon-pill/IconPill\"));\nexports.IconPill = IconPill_1.default;\nconst IconPillGroup_1 = __importDefault(require(\"./components/icon-pill-group/IconPillGroup\"));\nexports.IconPillGroup = IconPillGroup_1.default;\nconst IconPillSizeOptionsEnum_1 = __importDefault(require(\"./enums/IconPillSizeOptionsEnum\"));\nexports.IconPillSizeOptionsEnum = IconPillSizeOptionsEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar MiniSurveyAnswerEnum;\n(function (MiniSurveyAnswerEnum) {\n MiniSurveyAnswerEnum[\"yes\"] = \"yes\";\n MiniSurveyAnswerEnum[\"no\"] = \"no\";\n})(MiniSurveyAnswerEnum || (MiniSurveyAnswerEnum = {}));\nexports.default = MiniSurveyAnswerEnum;\n//# sourceMappingURL=MiniSurveyAnswerEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar MiniSurveyLayoutEnum;\n(function (MiniSurveyLayoutEnum) {\n MiniSurveyLayoutEnum[\"grade\"] = \"grade\";\n MiniSurveyLayoutEnum[\"binary\"] = \"binary\";\n})(MiniSurveyLayoutEnum || (MiniSurveyLayoutEnum = {}));\nexports.default = MiniSurveyLayoutEnum;\n//# sourceMappingURL=MiniSurveyLayoutEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar MiniSurveyStateEnum;\n(function (MiniSurveyStateEnum) {\n MiniSurveyStateEnum[\"default\"] = \"default\";\n MiniSurveyStateEnum[\"success\"] = \"success\";\n})(MiniSurveyStateEnum || (MiniSurveyStateEnum = {}));\nexports.default = MiniSurveyStateEnum;\n//# sourceMappingURL=MiniSurveyStateEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass MiniSurveyCardStyle {\n /**\n * Returns styles.\n *\n * @param options\n * @param options.theme\n * @param options.smallDevice\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\tjustify-content: space-between;\n\t\t\t}\n\n\t\t\t.headerContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: row;\n\t\t\t\tflex: 1;\n\t\t\t\tjustify-content: space-between;\n\t\t\t\toutline: none;\n\t\t\t}\n\n\t\t\t.headerContainer skapa-icon-button {\n\t\t\t\tpointer-events: inherit;\n\t\t\t\talign-self: flex-start;\n\t\t\t\tmargin-top: -${8 / 16}rem;\n\t\t\t\tmargin-right: -${8 / 16}rem;\n\t\t\t}\n\n\t\t\t.headerContainer kompis-text {\n\t\t\t\tpadding-top: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.question {\n\t\t\t\tdisplay: flex;\n\t\t\t\tpadding-top: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.binaryChoiceContainer {\n\t\t\t\tdisplay: grid;\n\t\t\t\tgrid-template-columns: 1fr 1fr;\n\t\t\t\tgrid-gap: 1rem;\n\t\t\t}\n\n\t\t\tkompis-icon-pill-group {\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: space-between;\n\t\t\t}\n\n\t\t\t.binaryChoiceContainer,\n\t\t\tkompis-icon-pill-group {\n\t\t\t\tpadding-top: ${spacing.space100 / 16}rem;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = MiniSurveyCardStyle;\n//# sourceMappingURL=MiniSurveyCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst icons_1 = require(\"@inter-ikea-kompis/icons\");\nconst component_icon_pill_1 = require(\"@inter-ikea-kompis/component-icon-pill\");\nrequire(\"@inter-ikea-kompis/component-icon-pill\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/icon-store/cross-small\");\nconst MiniSurveyAnswerEnum_1 = __importDefault(require(\"../../enums/MiniSurveyAnswerEnum\"));\nconst MiniSurveyLayoutEnum_1 = __importDefault(require(\"../../enums/MiniSurveyLayoutEnum\"));\nconst MiniSurveyStateEnum_1 = __importDefault(require(\"../../enums/MiniSurveyStateEnum\"));\nconst MiniSurveyCardStyle_1 = __importDefault(require(\"../mini-survey-card/MiniSurveyCardStyle\"));\n/**\n * Mini Survey component.\n *\n * @event close Click on close button\n * @event select Emitted when user selects a smiley or binary choice\n * @event reset Emitted when component should reset\n */\nlet MiniSurveyCard = class MiniSurveyCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // The layout of the Mini Survey, can be set to grade or binary\n this.layout = MiniSurveyLayoutEnum_1.default.grade;\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // Valid states can be found in MiniSurveyStateEnum\n this.state = MiniSurveyStateEnum_1.default.default;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n // We want translations to be required, but since the props to provide translations is optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t${this.getHeaderContainer()} ${this.getQuestionContainer()}\n\t\t\t\t${this.layout === MiniSurveyLayoutEnum_1.default.grade\n ? this.getSmileyContainer()\n : this.getBinaryChoiceContainer()}\n\t\t\t
    \n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n clearTimeout(this.timeout);\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n var _a;\n if (changedProperties.has('state')) {\n if (this.state === MiniSurveyStateEnum_1.default.success) {\n const miniSurveyCard = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.headerContainer');\n if (miniSurveyCard) {\n miniSurveyCard.focus();\n }\n clearTimeout(this.timeout);\n this.timeout = setTimeout(() => this.dispatchEvent(new CustomEvent('reset', {\n bubbles: true,\n detail: {\n state: MiniSurveyStateEnum_1.default.default\n }\n })), 30000);\n }\n }\n return true;\n }\n hasTranslations() {\n return !!this.translations || !!this.localizedInformation;\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n /**\n * @returns - Html.\n */\n getHeaderContainer() {\n const { miniSurveyHeader, miniSurveySuccessHeader, modalAriaLabelButtonClose } = this.getTranslations();\n const headerText = this.state !== MiniSurveyStateEnum_1.default.success ? miniSurveyHeader : miniSurveySuccessHeader;\n const tertiaryVariant = 'tertiary';\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${headerText}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${modalAriaLabelButtonClose}\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * @returns - Html.\n */\n getQuestionContainer() {\n const questionText = this.state !== MiniSurveyStateEnum_1.default.success\n ? this.questionText\n : this.getTranslations().miniSurveySuccessBody;\n return (0, web_component_1.html) `\n\t\t\t${questionText}\n\t\t`;\n }\n /**\n * @returns - Html.\n */\n getSmileyContainer() {\n if (this.state === MiniSurveyStateEnum_1.default.success) {\n return null;\n }\n const iconArray = [\n icons_1.FeedbackSadIcon,\n icons_1.FeedbackDissatisfiedIcon,\n icons_1.FeedbackNeutralIcon,\n icons_1.FeedbackSatisfiedIcon,\n icons_1.FeedbackHappyIcon\n ];\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\t${iconArray.map((icon, index) => {\n return (0, web_component_1.html) `\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t`;\n })}\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * @returns - Html.\n */\n getBinaryChoiceContainer() {\n if (this.state === MiniSurveyStateEnum_1.default.success) {\n return null;\n }\n const primaryVariant = 'primary';\n const secondaryVariant = 'secondary';\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\t${this.getTranslations().no}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t${this.getTranslations().yes}\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * Handler for close button.\n */\n onCloseClick() {\n this.dispatchEvent(new CustomEvent('close', {\n bubbles: true,\n detail: {\n type: 'icon-button',\n visible: false\n }\n }));\n }\n /**\n * Handler for select icon pill.\n *\n * @param event\n */\n onSelectClick(event) {\n this.dispatchEvent(new CustomEvent('select', {\n bubbles: true,\n detail: {\n type: 'icon-pill',\n grade: Number(event.target.id) + 1,\n state: MiniSurveyStateEnum_1.default.success\n }\n }));\n }\n /**\n * Handler for \"yes\" button.\n */\n onYesClicked() {\n this.dispatchEvent(new CustomEvent('select', {\n bubbles: true,\n detail: {\n type: 'click',\n answer: MiniSurveyAnswerEnum_1.default.yes,\n state: MiniSurveyStateEnum_1.default.success\n }\n }));\n }\n /**\n * Handler for \"no\" button.\n */\n onNoClicked() {\n this.dispatchEvent(new CustomEvent('select', {\n bubbles: true,\n detail: {\n type: 'click',\n answer: MiniSurveyAnswerEnum_1.default.no,\n state: MiniSurveyStateEnum_1.default.success\n }\n }));\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], MiniSurveyCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], MiniSurveyCard.prototype, \"layout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MiniSurveyCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MiniSurveyCard.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], MiniSurveyCard.prototype, \"questionText\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], MiniSurveyCard.prototype, \"state\", void 0);\nMiniSurveyCard = __decorate([\n (0, web_component_1.customElement)('kompis-mini-survey-card')\n], MiniSurveyCard);\nexports.default = MiniSurveyCard;\n//# sourceMappingURL=MiniSurveyCard.js.map","import \"@inter-ikea-kompis/component-mini-survey/lib/components/mini-survey-card/MiniSurveyCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisMiniSurveyCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-mini-survey-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.layout = props.layout;\n element.localizedInformation = props.localizedInformation;\n element.questionText = props.questionText;\n element.state = props.state;\n element.theme = props.theme;\n element.translations = props.translations;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onClose, \"close\");\n this.updateEventListener(element, props.onReset, \"reset\");\n this.updateEventListener(element, props.onSelect, \"select\");\n }\n}\nKompisMiniSurveyCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n layout: PropTypes.string,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n questionText: PropTypes.string,\n state: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n onClose: PropTypes.func,\n onSelect: PropTypes.func,\n onReset: PropTypes.func\n};\nexport default KompisMiniSurveyCard;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar MiniSurveyAnimationNameEnum;\n(function (MiniSurveyAnimationNameEnum) {\n MiniSurveyAnimationNameEnum[\"opening\"] = \"opening\";\n MiniSurveyAnimationNameEnum[\"closing\"] = \"closing\";\n})(MiniSurveyAnimationNameEnum || (MiniSurveyAnimationNameEnum = {}));\nexports.default = MiniSurveyAnimationNameEnum;\n//# sourceMappingURL=MiniSurveyAnimationNameEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst MiniSurveyAnimationNameEnum_1 = __importDefault(require(\"../../enums/MiniSurveyAnimationNameEnum\"));\nclass MiniSurveyStyle {\n /**\n * Returns styles.\n *\n * @param options\n * @param options.theme\n * @param options.visible\n * @param options.zIndex\n * @param options.state\n * @param options.isSmallDevice\n * @param options.top\n * @param options.left\n * @param options.right\n * @returns Styles.\n */\n static getStyle(options) {\n const { color, motion, spacing, border, elevation } = options.theme;\n const top = options.top !== null ? `${options.top / 16}rem` : 'auto';\n const left = options.left !== null ? `${options.left / 16}rem` : 'auto';\n const right = options.right !== null ? `${options.right / 16}rem` : 'auto';\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: ${!options.isSmallDevice ? top : 0};\n\t\t\t\tleft: ${!options.isSmallDevice ? left : 0};\n\t\t\t\tright: ${!options.isSmallDevice ? right : 0};\n\t\t\t\tmax-width: ${400 / 16}rem;\n\t\t\t\twidth: 100%;\n\t\t\t\tz-index: ${options.zIndex};\n\t\t\t\tdisplay: ${options.visible ? 'block' : 'none'};\n\t\t\t}\n\n\t\t\t.container {\n\t\t\t\tpadding: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\tkompis-mini-survey-card {\n\t\t\t\toverflow: hidden;\n\t\t\t\tborder-radius: ${border.radius.radius4 / 16}rem;\n\t\t\t\tcolor: ${color.neutral.grey900};\n\t\t\t\tbackground-color: ${color.neutral.white};\n\t\t\t\tborder-width: 0;\n\t\t\t\tbox-shadow: 0 ${spacing.space25 / 16}rem ${spacing.space100 / 16}rem\n\t\t\t\t\t${elevation.color.default};\n\t\t\t\tpadding: ${spacing.space150 / 16}rem;\n\n\t\t\t\tanimation-name: ${options.visible\n ? MiniSurveyAnimationNameEnum_1.default.opening\n : MiniSurveyAnimationNameEnum_1.default.closing};\n\t\t\t\tanimation-duration: ${options.visible ? motion.duration.medium : motion.duration.small};\n\t\t\t\tanimation-fill-mode: both;\n\t\t\t\tanimation-timing-function: ${options.visible ? motion.ease.enter : motion.ease.exit};\n\t\t\t}\n\n\t\t\t@keyframes ${MiniSurveyAnimationNameEnum_1.default.opening} {\n\t\t\t\tfrom {\n\t\t\t\t\ttransform: translateX(0);\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\ttransform: translateX(10);\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes ${MiniSurveyAnimationNameEnum_1.default.closing} {\n\t\t\t\tfrom {\n\t\t\t\t\ttransform: translateX(10);\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\ttransform: translateX(0);\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = MiniSurveyStyle;\n//# sourceMappingURL=MiniSurveyStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nrequire(\"@inter-ikea-kompis/component-icon-pill\");\nrequire(\"../mini-survey-card/MiniSurveyCard\");\nconst MiniSurveyLayoutEnum_1 = __importDefault(require(\"../../enums/MiniSurveyLayoutEnum\"));\nconst MiniSurveyStateEnum_1 = __importDefault(require(\"../../enums/MiniSurveyStateEnum\"));\nconst MiniSurveyStyle_1 = __importDefault(require(\"./MiniSurveyStyle\"));\n/**\n * Mini Survey component.\n *\n * @event close Click on close button\n * @event select Emitted when user selects a smiley\n * @event reset Emitted when component should reset\n */\nlet MiniSurvey = class MiniSurvey extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // The layout of the Mini Survey, can be set to grade or binary\n this.layout = MiniSurveyLayoutEnum_1.default.grade;\n // Hide or show mini survey with transitions.\n this.visible = false;\n // Valid states can be found in MiniSurveyStateEnum\n this.state = MiniSurveyStateEnum_1.default.default;\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // Z-index of the container.\n this.zIndex = 500;\n // Position from top in pixels\n this.top = null;\n // Position from left in pixels\n this.left = null;\n // Position from right in pixels\n this.right = null;\n this.breakpointObserver = new themes_1.ThemeBreakpointObserver(() => this.requestUpdate());\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n // We want translations to be required, but since the props to provide translations is optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n const breakpointIndex = this.breakpointObserver.getBreakpointIndex();\n const isSmallDevice = !!breakpointIndex && breakpointIndex <= enums_1.ThemeBreakpointIndexEnum.small;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    ${this.getContainer()}
    \n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.breakpointObserver.disconnect();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('theme')) {\n this.breakpointObserver.observe(this.theme);\n }\n return true;\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n /**\n * Gets the select element.\n *\n * @returns Template.\n */\n getContainer() {\n if (!this.visible) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('reset', {\n bubbles: true,\n detail: {\n visible: false,\n state: MiniSurveyStateEnum_1.default.default\n }\n }))}\"\n\t\t\t>\n\t\t\t\n\t\t`;\n }\n /**\n * Handler for close button.\n */\n onCloseClick() {\n this.dispatchEvent(new CustomEvent('close', {\n bubbles: true,\n detail: {\n type: 'icon-button',\n visible: false\n }\n }));\n }\n /**\n * Handler for select icon pill.\n *\n * @param event Event.\n */\n onSelectClick(event) {\n if (this.layout === MiniSurveyLayoutEnum_1.default.grade) {\n this.dispatchEvent(new CustomEvent('select', {\n bubbles: true,\n detail: {\n type: 'icon-pill',\n grade: event.detail.grade,\n state: MiniSurveyStateEnum_1.default.success\n }\n }));\n }\n else {\n this.dispatchEvent(new CustomEvent('select', {\n bubbles: true,\n detail: {\n type: 'click',\n answer: event.detail.answer,\n state: MiniSurveyStateEnum_1.default.success\n }\n }));\n }\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], MiniSurvey.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], MiniSurvey.prototype, \"layout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], MiniSurvey.prototype, \"visible\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], MiniSurvey.prototype, \"questionText\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], MiniSurvey.prototype, \"state\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MiniSurvey.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MiniSurvey.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], MiniSurvey.prototype, \"zIndex\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], MiniSurvey.prototype, \"top\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], MiniSurvey.prototype, \"left\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], MiniSurvey.prototype, \"right\", void 0);\nMiniSurvey = __decorate([\n (0, web_component_1.customElement)('kompis-mini-survey')\n], MiniSurvey);\nexports.default = MiniSurvey;\n//# sourceMappingURL=MiniSurvey.js.map","import \"@inter-ikea-kompis/component-mini-survey/lib/components/mini-survey/MiniSurvey\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisMiniSurvey extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-mini-survey\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.layout = props.layout;\n element.left = props.left;\n element.localizedInformation = props.localizedInformation;\n element.questionText = props.questionText;\n element.right = props.right;\n element.state = props.state;\n element.theme = props.theme;\n element.top = props.top;\n element.translations = props.translations;\n element.visible = props.visible;\n element.zIndex = props.zIndex;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onClose, \"close\");\n this.updateEventListener(element, props.onReset, \"reset\");\n this.updateEventListener(element, props.onSelect, \"select\");\n }\n}\nKompisMiniSurvey.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n layout: PropTypes.string,\n left: PropTypes.number,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n questionText: PropTypes.string,\n right: PropTypes.number,\n state: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n top: PropTypes.number,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visible: PropTypes.bool,\n zIndex: PropTypes.number,\n onClose: PropTypes.func,\n onSelect: PropTypes.func,\n onReset: PropTypes.func\n};\nexport default KompisMiniSurvey;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar OpenDesignCodeLengthEnum;\n(function (OpenDesignCodeLengthEnum) {\n OpenDesignCodeLengthEnum[OpenDesignCodeLengthEnum[\"min\"] = 5] = \"min\";\n OpenDesignCodeLengthEnum[OpenDesignCodeLengthEnum[\"max\"] = 6] = \"max\";\n})(OpenDesignCodeLengthEnum || (OpenDesignCodeLengthEnum = {}));\nexports.default = OpenDesignCodeLengthEnum;\n//# sourceMappingURL=OpenDesignCodeLengthEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar OpenDesignCodeStateEnum;\n(function (OpenDesignCodeStateEnum) {\n OpenDesignCodeStateEnum[\"default\"] = \"default\";\n OpenDesignCodeStateEnum[\"loading\"] = \"loading\";\n OpenDesignCodeStateEnum[\"failed\"] = \"failed\";\n})(OpenDesignCodeStateEnum || (OpenDesignCodeStateEnum = {}));\nexports.default = OpenDesignCodeStateEnum;\n//# sourceMappingURL=OpenDesignCodeStateEnum.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst component_input_1 = require(\"@inter-ikea-kompis/component-input\");\nrequire(\"@inter-ikea-kompis/component-input\");\nconst OpenDesignCodeLengthEnum_1 = __importDefault(require(\"../../enums/OpenDesignCodeLengthEnum\"));\nconst OpenDesignCodeStateEnum_1 = __importDefault(require(\"../../enums/OpenDesignCodeStateEnum\"));\nconst OPEN_DESIGN_CODE_REGEX = /[^a-zA-Z0-9]/g;\n/**\n * @event open When keypress = Enter emit open event.\n * @event input Emitted when user write a character in the input field.\n */\nlet OpenDesignCodeInput = class OpenDesignCodeInput extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The state. Valid state are in OpenDesignCodeInputState\n this.state = OpenDesignCodeStateEnum_1.default.default;\n // VPC code\n this.vpcCode = null;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t`;\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n /**\n * Get input layout.\n */\n getInputLayout() {\n switch (this.state) {\n case OpenDesignCodeStateEnum_1.default.default:\n return component_input_1.InputLayoutEnum.default;\n case OpenDesignCodeStateEnum_1.default.loading:\n return component_input_1.InputLayoutEnum.readOnly;\n default:\n return component_input_1.InputLayoutEnum.default;\n }\n }\n /**\n * Check if input is valid.\n *\n * @returns Boolean.\n */\n validateInput() {\n return (this.state !== OpenDesignCodeStateEnum_1.default.loading &&\n !!this.vpcCode &&\n this.vpcCode.length <= OpenDesignCodeLengthEnum_1.default.max &&\n this.vpcCode.length >= OpenDesignCodeLengthEnum_1.default.min);\n }\n /**\n * @param event Event.\n */\n onKeyPressed(event) {\n if (event.key === 'Enter' && this.validateInput()) {\n this.onOpen();\n }\n }\n /**\n * Emit open event.\n */\n onOpen() {\n this.dispatchEvent(new CustomEvent('open', {\n bubbles: true,\n detail: {\n vpcCode: this.vpcCode\n }\n }));\n }\n /**\n * Handle input event from the Input component.\n *\n * @param event Event.\n */\n onInput(event) {\n this.dispatchEvent(new CustomEvent('input', {\n bubbles: true,\n detail: {\n vpcCode: event.detail.value\n .toUpperCase()\n .replace(OPEN_DESIGN_CODE_REGEX, '')\n .substring(0, OpenDesignCodeLengthEnum_1.default.max)\n }\n }));\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], OpenDesignCodeInput.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], OpenDesignCodeInput.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], OpenDesignCodeInput.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], OpenDesignCodeInput.prototype, \"state\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, synchronous: true })\n], OpenDesignCodeInput.prototype, \"vpcCode\", void 0);\nOpenDesignCodeInput = __decorate([\n (0, web_component_1.customElement)('kompis-open-design-code-input')\n], OpenDesignCodeInput);\nexports.default = OpenDesignCodeInput;\n//# sourceMappingURL=OpenDesignCodeInput.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\n/**\n * A class with style.\n */\nclass OpenDesignCodeStyle {\n /**\n * Returns styles.\n *\n * @param options\n * @param options.theme\n * @returns Styles.\n */\n static getStyle(options) {\n const theme = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: flex-start;\n\t\t\t}\n\n\t\t\tskapa-button {\n\t\t\t\tmargin-top: ${theme.spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\tskapa-inline-message {\n\t\t\t\tmargin-top: ${theme.spacing.space50 / 16}rem;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = OpenDesignCodeStyle;\n//# sourceMappingURL=OpenDesignCodeStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/inline-message-webc\");\nrequire(\"@ingka/icon-store/warning-triangle\");\nrequire(\"../open-design-code-input/OpenDesignCodeInput\");\nconst OpenDesignCodeLengthEnum_1 = __importDefault(require(\"../../enums/OpenDesignCodeLengthEnum\"));\nconst OpenDesignCodeStateEnum_1 = __importDefault(require(\"../../enums/OpenDesignCodeStateEnum\"));\nconst OpenDesignCodeStyle_1 = __importDefault(require(\"./OpenDesignCodeStyle\"));\n/**\n *\n * @event open When button \"open\" is clicked.\n * @event input Emitted when user write a character in the input field.\n */\nlet OpenDesignCode = class OpenDesignCode extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The state. Valid state are in OpenDesignCodeState\n this.state = OpenDesignCodeStateEnum_1.default.default;\n // VPC code\n this.vpcCode = null;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n const primaryVariant = 'primary';\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t
    \n\t\t\t\t\n\n\t\t\t\t
    \n\n\t\t\t\t\n\t\t\t\t\t${this.getTranslations().sprGalleryOpen}\n\t\t\t\t\n\t\t\t
    \n\n\t\t\t${this.getInlineMessage()}\n\t\t`;\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n getInlineMessage() {\n return (0, web_component_1.html) `
    ${this.getUnavailableDesignErrorMessage()}
    `;\n }\n getUnavailableDesignErrorMessage() {\n if (this.state !== OpenDesignCodeStateEnum_1.default.failed) {\n return null;\n }\n const error = this.getTranslations().invalidConfigurationMessage;\n const cautionaryVariant = 'cautionary';\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t\n\t\t\t\t${error}\n\t\t\t\n\t\t`;\n }\n /**\n * Check if button is disabled.\n *\n * @returns Boolean.\n */\n isButtonDisabled() {\n if (this.state === OpenDesignCodeStateEnum_1.default.loading) {\n return false;\n }\n return (!this.vpcCode ||\n this.vpcCode.length > OpenDesignCodeLengthEnum_1.default.max ||\n this.vpcCode.length < OpenDesignCodeLengthEnum_1.default.min);\n }\n /**\n * Check if key is pressed.\n *\n * @param event Event.\n */\n onKeyPressed(event) {\n if (event.key === 'Enter' && !this.isButtonDisabled()) {\n this.onButtonClick();\n }\n }\n /**\n * Emit open event.\n */\n onButtonClick() {\n this.dispatchEvent(new CustomEvent('open', {\n bubbles: true,\n detail: {\n vpcCode: this.vpcCode\n }\n }));\n }\n /**\n * Handle input event from the Input component.\n *\n * @param event Event.\n */\n onInput(event) {\n this.dispatchEvent(new CustomEvent('input', { bubbles: true, detail: Object.assign({}, event.detail) }));\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], OpenDesignCode.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], OpenDesignCode.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], OpenDesignCode.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], OpenDesignCode.prototype, \"state\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, synchronous: true })\n], OpenDesignCode.prototype, \"vpcCode\", void 0);\nOpenDesignCode = __decorate([\n (0, web_component_1.customElement)('kompis-open-design-code')\n], OpenDesignCode);\nexports.default = OpenDesignCode;\n//# sourceMappingURL=OpenDesignCode.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OpenDesignCodeStateEnum = exports.OpenDesignCodeLengthEnum = exports.OpenDesignCodeInput = exports.OpenDesignCode = void 0;\nconst OpenDesignCode_1 = __importDefault(require(\"./components/open-design-code/OpenDesignCode\"));\nexports.OpenDesignCode = OpenDesignCode_1.default;\nconst OpenDesignCodeInput_1 = __importDefault(require(\"./components/open-design-code-input/OpenDesignCodeInput\"));\nexports.OpenDesignCodeInput = OpenDesignCodeInput_1.default;\nconst OpenDesignCodeLengthEnum_1 = __importDefault(require(\"./enums/OpenDesignCodeLengthEnum\"));\nexports.OpenDesignCodeLengthEnum = OpenDesignCodeLengthEnum_1.default;\nconst OpenDesignCodeStateEnum_1 = __importDefault(require(\"./enums/OpenDesignCodeStateEnum\"));\nexports.OpenDesignCodeStateEnum = OpenDesignCodeStateEnum_1.default;\n//# sourceMappingURL=index.js.map","export function updateSelectionStyles(host, targetTab) {\n if (!targetTab)\n targetTab = host.tabs.find(tab => tab.getAttribute('aria-selected') === 'true'); // Let's find the active tab manually.\n if (!targetTab)\n return; // couldn't find currently selected tab.\n const offset = host.hasAttribute('skapa-rtl') ? host.offsetWidth - targetTab.offsetLeft : targetTab.offsetLeft;\n // Safari for some reason ignores the host as an offsetParent even if it has `position: relative;` set.\n host.selectionHighlight.style.setProperty('--tab-selection-offset', `${offset}px`);\n host.selectionHighlight.style.setProperty('--tab-selection-width', `${targetTab.offsetWidth}px`);\n}\nexport function instantUpdateSelectionStyles(host, targetTab) {\n host.selectionHighlight.classList.toggle('instant', true);\n host.micro(() => {\n updateSelectionStyles(host, targetTab);\n host.selectionHighlight.classList.toggle('instant', false);\n }, 'realign the selection underline on wd change');\n}\n","export function isAccessible(tab) {\n return !(tab.hasAttribute('disabled') || tab.ariaDisabled === 'true');\n}\n","import { isAccessible } from '../utils/accessible-tab.js';\nvar Direction;\n(function (Direction) {\n Direction[Direction[\"Forward\"] = 0] = \"Forward\";\n Direction[Direction[\"Backward\"] = 1] = \"Backward\";\n})(Direction || (Direction = {}));\nexport function keyboardControl(tabs, e, isRTL) {\n const key = e.key.toLowerCase();\n let direction = Direction.Forward;\n let startIndex = tabs.findIndex(tab => tab.getAttribute('aria-selected') === 'true');\n switch (key) {\n case 'arrowleft':\n direction = isRTL ? Direction.Forward : Direction.Backward;\n break;\n case 'arrowright':\n direction = isRTL ? Direction.Backward : Direction.Forward;\n break;\n case 'home':\n startIndex = -1; // Look from the beginning.\n break;\n case 'end':\n startIndex = tabs.length; // Start searching from the end.\n direction = Direction.Backward;\n break;\n default:\n // nothing to do, ignore the rest.\n return;\n }\n e.preventDefault(); // to prevent native scrolling\n return findNextClosestAccessibleTab(tabs, startIndex, direction);\n}\nfunction findNextClosestAccessibleTab(tabs, startIndex, direction = Direction.Forward) {\n let tab;\n const length = tabs.length;\n const step = direction === Direction.Forward ? 1 : -1;\n for (let offsetIndex = 0 + step; Math.abs(offsetIndex) < length; offsetIndex += step) {\n tab = tabs[(startIndex + offsetIndex + length) % length];\n if (isAccessible(tab))\n return tab;\n }\n}\n","export function decorateTab(tab, panel) {\n tab.setAttribute('role', 'tab');\n if (panel) {\n panel.setAttribute('role', 'tabpanel');\n panel.tabIndex = 0;\n }\n}\nexport function connectTabWithPanel(tab, panel, baseId, index) {\n tab.setAttribute('id', `${baseId}-tab-${index}`);\n tab.setAttribute('aria-controls', `${baseId}-tabpanel-${index}`);\n panel.setAttribute('aria-labelledby', `${baseId}-tab-${index}`);\n panel.setAttribute('id', `${baseId}-tabpanel-${index}`);\n}\nexport function updateSelectedState(tab, panel, selected = false) {\n tab.tabIndex = selected ? 0 : -1;\n tab.setAttribute('aria-selected', selected.toString());\n if (panel) {\n panel.hidden = !selected;\n panel.classList.toggle('skapa-active-panel', selected);\n }\n}\n","export function cancelledSelection(host, targetIndex) {\n const notificationEvent = new CustomEvent('skapa-tab-select', { detail: targetIndex, cancelable: true });\n host.dispatchEvent(notificationEvent);\n return notificationEvent.defaultPrevented;\n}\n","// @ts-ignore\nconst styles = ':host{display:block;position:relative}slot[name=panels]{display:block;position:relative}slot[name=panels]::slotted(*){position:absolute;top:0;visibility:hidden}slot[name=panels]::slotted(.skapa-active-panel){position:relative;visibility:visible}hr{border:none;border-bottom:1px solid rgb(var(--colour-neutral-3,223,223,223));margin:0 calc(var(--skapa-tabs-overflow-margin, .25rem)*-1);margin-top:.25rem;width:calc(100% + var(--skapa-tabs-overflow-margin, .25rem)*2)}:host([sticky]) div.wrapper{background-color:rgb(var(--colour-elevation-1,255,255,255));position:sticky;top:0;z-index:1}:host([sticky]) slot[name=panels]{--skapa-scroll-margin-top:3.25rem}skapa-overflow-carousel{--skapa-carousel-overflow-start:var(--skapa-tabs-overflow-margin,0.25rem);--skapa-carousel-overflow-end:var(--skapa-tabs-overflow-margin,0.25rem)}skapa-selection-highlight{align-self:flex-end;display:block;height:.1875rem;order:-1;pointer-events:none;width:0}skapa-selection-highlight:after{background-color:rgb(var(--colour-interactive-emphasised-border-selected,0,88,163));border-radius:.09375rem;content:\"\";display:block;height:.1875rem;left:calc(var(--tab-selection-offset, 0rem) + var(--skapa-tabs-overflow-margin, .25rem));min-width:var(--tab-selection-width,0);position:relative;top:.25rem;transition:left var(--skapa-reduced-motion,.2s) cubic-bezier(.4,0,.4,1);transition-property:left,min-width}skapa-overflow-carousel::part(container){--skapa-carousel-item-gap:1.5rem;--carousel-container-vertical-padding:0.25rem}skapa-selection-highlight.instant:after{display:none;transition:none}:host([skapa-rtl]) skapa-selection-highlight:after{left:unset;right:calc(var(--tab-selection-offset, 0) - var(--tab-selection-width, 0) + var(--skapa-tabs-overflow-margin, .25rem));transition-property:right,min-width}@media (prefers-reduced-motion){skapa-selection-highlight{--skapa-reduced-motion:0}}';\n// @ts-ignore\nconst lightStyles = 'skapa-tabs>[role=tabpanel]{padding:2.5rem 0}skapa-tabs>.focus-visible{box-shadow:0 0 0 4px var(--skapa-focus-ring-internal,rgb(var(--colour-neutral-1,255,255,255)));outline:2px solid var(--skapa-focus-ring-external,rgb(var(--colour-neutral-7,17,17,17)));outline-offset:4px;transition:outline .2s ease-out,box-shadow .2s ease-out}skapa-tabs>[role=tab],skapa-tabs>button{align-items:center;background:none;border:0;border-radius:.125rem;box-sizing:border-box;color:rgb(var(--colour-text-and-icon-3,118,118,118));cursor:pointer;display:inline-flex;flex-shrink:0;font-family:inherit;font-size:.875rem;font-weight:700;height:2.75rem;line-height:1.4285714286;margin:0;min-height:2.75rem;padding:.25rem;text-align:start}skapa-tabs>[role=tab]:hover,skapa-tabs>button:hover{color:rgb(var(--colour-text-and-icon-2,72,72,72))}skapa-tabs>[role=tab][aria-selected=true],skapa-tabs>button[aria-selected=true]{color:rgb(var(--colour-text-and-icon-1,17,17,17));cursor:default}skapa-tabs>[role=tab]:disabled,skapa-tabs>button:disabled{color:rgb(var(--colour-interactive-disabled-1,204,204,204));cursor:default}skapa-tabs>[role=tab]>skapa-icon,skapa-tabs>button>skapa-icon{color:inherit;margin:-.5rem 0;margin-inline-end:.5rem;pointer-events:none}skapa-tabs>[role=tab].focus-visible,skapa-tabs>button.focus-visible{box-shadow:none;outline-offset:.125rem}';\nimport '@ingka/carousel-webc';\nimport SkapaElement from '@ingka/skapa-webc-element';\nimport { prefixReplacer, RTLObserver, CachedValue } from '@ingka/webc-tools';\nimport { updateSelectionStyles, instantUpdateSelectionStyles } from './features/selection-highlight.js';\nimport { keyboardControl } from './features/key-handler.js';\nimport { isAccessible } from './utils/accessible-tab.js';\nimport { decorateTab, connectTabWithPanel, updateSelectedState } from './features/tab-decorator.js';\nimport { cancelledSelection } from './features/selection-event.js';\nlet template;\nlet lightStyleTemplate;\nfunction getTemplate() {\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = prefixReplacer(`\n \n
    \n \n \n \n \n
    \n
    \n \n \n `);\n lightStyleTemplate = document.createElement('template');\n lightStyleTemplate.innerHTML = prefixReplacer(``);\n }\n return template;\n}\nexport class Tabs extends SkapaElement {\n constructor() {\n super();\n this.initialiseTabs = () => {\n var _a;\n // Make sure the list of assigned elements are up to date.\n this.__tabs.updateCache = true;\n this.__panels.updateCache = true;\n const autoId = this.autoId;\n // set roles\n this.tabs.forEach((tab, i) => {\n const panel = this.panels[i] || undefined; // The matching panel if provided.\n // Set roles and tabindex on tab and panel.\n decorateTab(tab, panel);\n // set ids if requested.\n if (autoId && panel)\n connectTabWithPanel(tab, panel, autoId, i);\n });\n const activeTabId = this.activeTab; // Cache locally;\n if (activeTabId)\n this.activateTab(activeTabId, true); // If active-tab attribute was set try to activate that one.\n else\n this.activateTab((_a = this.tabs.find(isAccessible)) === null || _a === void 0 ? void 0 : _a.id, true); // Otherwise find the first non disabled tab.\n };\n // Cached list of tabs. The parameter function is used for refreshing its stored value.\n this.__tabs = new CachedValue(() => Array.from(this.tabSlot.assignedElements({ flatten: true })));\n // Cached list of panels. The parameter function is used for refreshing its value.\n this.__panels = new CachedValue(() => Array.from(this.panelSlot.assignedElements({ flatten: true })));\n this.handleKeydown = (e) => {\n const nextTab = keyboardControl(this.tabs, e, this.hasAttribute('skapa-rtl'));\n if (nextTab) {\n if (this.activateTab(nextTab.id)) {\n instantUpdateSelectionStyles(this);\n nextTab.focus();\n }\n }\n };\n this.handleClick = (e) => {\n const btn = e.target;\n this.activateTab(btn.id);\n };\n this.activateTab = (tabId, silent = false) => {\n if (!tabId)\n return false;\n const targetIndex = this.tabs.findIndex(tab => tab.id === tabId); // Get the tab's index\n if (targetIndex < 0)\n return false; // Do nothing if tab is not found.\n const targetTab = this.tabs[targetIndex]; // Get the tab element\n if (!isAccessible(targetTab))\n return false; // Do nothing if its disabled\n // Silent is used for initialisation and controlled updates (non user-induced changes).\n if (!silent) {\n // Dispatches a cancellable event.\n if (cancelledSelection(this, targetIndex))\n return false; // Do nothing if it is cancelled.\n }\n // Update the DOM attributes of the tabs and panels based on their selected state.\n this.tabs.forEach((tab, index) => updateSelectedState(tab, this.panels[index], tab === targetTab));\n // Update the blue selection underline's position.\n updateSelectionStyles(this, targetTab);\n // Report successful update.\n return true;\n };\n this.synchTablistAria = () => {\n if (this.tablistLabel)\n this.tablist.setAttribute('aria-label', this.tablistLabel);\n else\n this.tablist.removeAttribute('aria-label');\n if (this.tablistLabelledBy)\n this.tablist.setAttribute('aria-labelledby', this.tablistLabelledBy);\n else\n this.tablist.removeAttribute('aria-labelledby');\n };\n this.gatherProperties(['activeTab', 'autoId', 'sticky', 'tablistLabel', 'tablistLabelledBy'], this);\n const shadow = this.attachShadow({ mode: 'open' });\n shadow.append(getTemplate().content.cloneNode(true));\n this.tabSlot = shadow.querySelector('slot.tabs');\n this.panelSlot = shadow.querySelector('slot[name=panels]');\n this.lightStyleNode = lightStyleTemplate.content.cloneNode(true);\n this.selectionHighlight = shadow.querySelector(prefixReplacer('skapa-selection-highlight'));\n this.tablist = shadow.querySelector('[role=tablist]');\n }\n static get observedAttributes() {\n return ['active-tab', 'auto-id', 'sticky', 'skapa-rtl', 'tabllist-label', 'tablist-labelledby'];\n }\n connectedCallback() {\n super.connectedCallback();\n this.shadowRoot.addEventListener('slotchange', this.initialiseTabs);\n this.tabSlot.addEventListener('click', this.handleClick);\n this.tabSlot.addEventListener('keydown', this.handleKeydown);\n this.append(this.lightStyleNode);\n RTLObserver.addTarget(this);\n this.synchTablistAria();\n this.micro(this.initialiseTabs, 'initialise tabs');\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.shadowRoot.removeEventListener('slotchange', this.initialiseTabs);\n this.tabSlot.removeEventListener('click', this.handleClick);\n this.tabSlot.removeEventListener('keydown', this.handleKeydown);\n RTLObserver.removeTarget(this);\n }\n get tabs() {\n return this.__tabs.value;\n }\n get panels() {\n return this.__panels.value;\n }\n attributeChangedCallback(attributeName) {\n if (attributeName === 'active-tab') {\n // Active the requested tab without emitting a select event.\n this.activateTab(this.activeTab, true);\n }\n else if (attributeName === 'skapa-rtl') {\n // Adjust the selection underline on writing direction change.\n const currentTab = this.tabs.find(tab => tab.ariaSelected === 'true');\n if (currentTab) {\n // Update position without animation on writing direction change.\n instantUpdateSelectionStyles(this, currentTab);\n }\n }\n else if (attributeName === 'auto-id') {\n this.initialiseTabs();\n }\n else if (attributeName.includes('tablist')) {\n // Tablist aria updates.\n this.synchTablistAria();\n }\n }\n get activeTab() {\n return this.getAttribute('active-tab');\n }\n set activeTab(value) {\n if (value)\n this.setAttribute('active-tab', value);\n else\n this.removeAttribute('active-tab');\n }\n get sticky() {\n return this.hasAttribute('sticky');\n }\n set sticky(toggle) {\n this.toggleAttribute('sticky', !!toggle);\n }\n get autoId() {\n return this.getAttribute('auto-id');\n }\n set autoId(value) {\n if (value)\n this.setAttribute('auto-id', value);\n else\n this.removeAttribute('auto-id');\n }\n get tablistLabel() {\n return this.getAttribute('tablist-label');\n }\n set tablistLabel(label) {\n if (label)\n this.setAttribute('tablist-label', label);\n else\n this.removeAttribute('tablist-label');\n }\n get tablistLabelledBy() {\n return this.getAttribute('tablist-labelledby');\n }\n set tablistLabelledBy(labelId) {\n if (labelId)\n this.setAttribute('tablist-labelledby', labelId);\n else\n this.removeAttribute('tablist-labelledby');\n }\n}\n","import define from '@ingka/webc-tools';\nimport { Tabs } from './src/Tabs.js';\nexport { Tabs };\nexport const tabTagName = define('tabs', Tabs);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar OpenDesignTabEnum;\n(function (OpenDesignTabEnum) {\n OpenDesignTabEnum[\"ikeaProfile\"] = \"ikeaProfile\";\n OpenDesignTabEnum[\"designCode\"] = \"designCode\";\n})(OpenDesignTabEnum || (OpenDesignTabEnum = {}));\nexports.default = OpenDesignTabEnum;\n//# sourceMappingURL=OpenDesignTabEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nclass OpenDesignCardStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\n\t\t\th2 {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\tskapa-tabs {\n\t\t\t\tmargin-top: ${spacing.space150 / 16}rem;\n\t\t\t}\n\n\t\t\t#kioskOpenDesignCode {\n\t\t\t\tmargin-top: ${spacing.space200 / 16}rem;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = OpenDesignCardStyle;\n//# sourceMappingURL=OpenDesignCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_open_design_code_1 = require(\"@inter-ikea-kompis/component-open-design-code\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@inter-ikea-kompis/component-open-design-code\");\nrequire(\"@ingka/inline-message-webc\");\nrequire(\"@ingka/choice-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/image-webc\");\nrequire(\"@ingka/tabs-webc\");\nrequire(\"@ingka/icon-store/information-circle\");\nconst OpenDesignTabEnum_1 = __importDefault(require(\"../../enums/OpenDesignTabEnum\"));\nconst OpenDesignCardStyle_1 = __importDefault(require(\"./OpenDesignCardStyle\"));\n/**\n * @event tabSelect Triggered when a tab is selected.\n * @event openDesignCode Triggered when the open button is clicked when a design code is entered.\n * @event designCodeInput Triggered when the user writes in the design code input.\n * @event designSelect Triggered when a saved design is selected.\n * @event resetOpenDesignCodeState Conditionally triggered when a tab is selected.\n */\nlet OpenDesignCard = class OpenDesignCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Whether the user is logged in to IKEA or not. Always set to false when in Kiosk.\n this.loggedIn = false;\n // Whether to show saved designs or not. Always set to false when in Kiosk.\n this.showSavedDesigns = false;\n // The design code entered by the user.\n this.designCode = null;\n // The state of open design code.\n this.openDesignCodeState = component_open_design_code_1.OpenDesignCodeStateEnum.default;\n // List of saved designs retrieved from save service.\n this.savedDesigns = null;\n this.selectedTab = OpenDesignTabEnum_1.default.ikeaProfile;\n this.dexfSettings = null;\n }\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t

    \n\t\t\t\t${this.getTranslations().openDesignHeader}\n\t\t\t

    \n\n\t\t\t${this.showSavedDesigns\n ? this.getTabVersion()\n : this.getOpenDesignCode('kioskOpenDesignCode')}\n\t\t`;\n }\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n return true;\n }\n hasTranslationsAndSettings() {\n var _a;\n return (!!this.translations && !!this.settings) || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n getSettings() {\n return this.dexfSettings;\n }\n getTabVersion() {\n const { openDesignHeader, openDesignMyProfileTitle, openDesignDesignCodeTitle } = this.getTranslations();\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t${this.loggedIn ? this.getSavedDesignChoiceItems() : this.getLogInInlineMessage()}\n\t\t\t
    \n\n\t\t\t\n\t\t\t
    \n\t\t\t\t${this.getOpenDesignCode()}\n\t\t\t
    \n\t\t`;\n }\n onTabSelect(event) {\n const selectedTab = event.detail === 1 ? OpenDesignTabEnum_1.default.designCode : OpenDesignTabEnum_1.default.ikeaProfile;\n this.dispatchEvent(new CustomEvent('tabSelect', {\n bubbles: true,\n detail: { selectedTab }\n }));\n this.selectedTab = selectedTab;\n this.requestUpdate();\n if (selectedTab !== OpenDesignTabEnum_1.default.designCode &&\n this.openDesignCodeState === component_open_design_code_1.OpenDesignCodeStateEnum.failed) {\n this.dispatchEvent(new CustomEvent('resetOpenDesignCodeState', {\n bubbles: true,\n detail: { openDesignCodeState: component_open_design_code_1.OpenDesignCodeStateEnum.default }\n }));\n }\n }\n getLogInInlineMessage() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getTranslations().openDesignLogInMessage}\n\t\t`;\n }\n getSavedDesignChoiceItems() {\n var _a, _b;\n if (!((_a = this.savedDesigns) === null || _a === void 0 ? void 0 : _a.length)) {\n return this.getNoSavedDesignsInlineMessage();\n }\n const sortedSavedDesigns = [...((_b = this.savedDesigns) !== null && _b !== void 0 ? _b : [])].sort((a, b) => {\n return Date.parse(b.savedDate) - Date.parse(a.savedDate);\n });\n const choiceItems = sortedSavedDesigns.map((savedDesign) => {\n var _a;\n const imageUrl = ((_a = savedDesign.imageUrl) === null || _a === void 0 ? void 0 : _a.length) ? savedDesign.imageUrl[0].url : null;\n const image = imageUrl\n ? (0, web_component_1.html) `\"\"`\n : // Placeholder image.\n (0, web_component_1.html) `\"\"`;\n return (0, web_component_1.html) ` {\n this.dispatchEvent(new CustomEvent('designSelect', {\n bubbles: true,\n detail: { designId: savedDesign.designId }\n }));\n }}\"\n\t\t\t>\n\t\t\t\t${image}\n\t\t\t\t${this.getFormattedDate(savedDesign)}\n\t\t\t\t${savedDesign.description}\n\t\t\t`;\n });\n const ariaLabel = this.getTranslations().openDesignAriaLabelSavedDesigns;\n return (0, web_component_1.html) `
    \n\t\t\t${choiceItems}\n\t\t
    `;\n }\n getNoSavedDesignsInlineMessage() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getTranslations().openDesignNoSavedDesignsMessage}\n\t\t`;\n }\n getFormattedDate(savedDesign) {\n const format = `${this.getSettings().localisation.dateFormat} HH:mm`;\n return utilities_1.DateFormatter.dateToString(savedDesign.savedDate, format);\n }\n getOpenDesignCode(id) {\n return (0, web_component_1.html) ` this.dispatchEvent(new CustomEvent('designCodeInput', {\n bubbles: true,\n detail: {\n designCode: event.detail.vpcCode\n }\n }))}\"\n\t\t\t@open=\"${(event) => this.dispatchEvent(new CustomEvent('openDesignCode', {\n bubbles: true,\n detail: {\n designCode: event.detail.vpcCode\n }\n }))}\"\n\t\t>`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], OpenDesignCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], OpenDesignCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], OpenDesignCard.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], OpenDesignCard.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], OpenDesignCard.prototype, \"loggedIn\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], OpenDesignCard.prototype, \"showSavedDesigns\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, synchronous: true })\n], OpenDesignCard.prototype, \"designCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], OpenDesignCard.prototype, \"openDesignCodeState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], OpenDesignCard.prototype, \"savedDesigns\", void 0);\nOpenDesignCard = __decorate([\n (0, web_component_1.customElement)('kompis-open-design-card')\n], OpenDesignCard);\nexports.default = OpenDesignCard;\n//# sourceMappingURL=OpenDesignCard.js.map","import \"@inter-ikea-kompis/component-open-design/lib/components/open-design-card/OpenDesignCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisOpenDesignCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-open-design-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.designCode = props.designCode;\n element.localizedInformation = props.localizedInformation;\n element.loggedIn = props.loggedIn;\n element.openDesignCodeState = props.openDesignCodeState;\n element.savedDesigns = props.savedDesigns;\n element.settings = props.settings;\n element.showSavedDesigns = props.showSavedDesigns;\n element.theme = props.theme;\n element.translations = props.translations;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onDesignCodeInput, \"designCodeInput\");\n this.updateEventListener(element, props.onDesignSelect, \"designSelect\");\n this.updateEventListener(element, props.onOpenDesignCode, \"openDesignCode\");\n this.updateEventListener(element, props.onResetOpenDesignCodeState, \"resetOpenDesignCodeState\");\n this.updateEventListener(element, props.onTabSelect, \"tabSelect\");\n }\n}\nKompisOpenDesignCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n designCode: PropTypes.string,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n loggedIn: PropTypes.bool,\n openDesignCodeState: PropTypes.string,\n savedDesigns: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n showSavedDesigns: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n onTabSelect: PropTypes.func,\n onOpenDesignCode: PropTypes.func,\n onDesignCodeInput: PropTypes.func,\n onDesignSelect: PropTypes.func,\n onResetOpenDesignCodeState: PropTypes.func\n};\nexport default KompisOpenDesignCard;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar OpenDesignModalEnum;\n(function (OpenDesignModalEnum) {\n OpenDesignModalEnum[\"openDesignCard\"] = \"openDesignCard\";\n})(OpenDesignModalEnum || (OpenDesignModalEnum = {}));\nexports.default = OpenDesignModalEnum;\n//# sourceMappingURL=OpenDesignModalEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar OpenDesignStateEnum;\n(function (OpenDesignStateEnum) {\n OpenDesignStateEnum[\"default\"] = \"default\";\n OpenDesignStateEnum[\"loading\"] = \"loading\";\n})(OpenDesignStateEnum || (OpenDesignStateEnum = {}));\nexports.default = OpenDesignStateEnum;\n//# sourceMappingURL=OpenDesignStateEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass OpenDesignStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\th2 {\n\t\t\t\tmargin-top: 0;\n\t\t\t\tmargin-bottom: ${spacing.space200 / 16}rem;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = OpenDesignStyle;\n//# sourceMappingURL=OpenDesignStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_open_design_code_1 = require(\"@inter-ikea-kompis/component-open-design-code\");\nrequire(\"@ingka/modal-webc\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"../open-design-card/OpenDesignCard\");\nconst OpenDesignModalEnum_1 = __importDefault(require(\"../../enums/OpenDesignModalEnum\"));\nconst OpenDesignStateEnum_1 = __importDefault(require(\"../../enums/OpenDesignStateEnum\"));\nconst OpenDesignTabEnum_1 = __importDefault(require(\"../../enums/OpenDesignTabEnum\"));\nconst OpenDesignStyle_1 = __importDefault(require(\"./OpenDesignStyle\"));\n/**\n * @event modalClose Modal close.\n * @event logIn Triggered when the log in button is clicked.\n * @event openSavedDesign Triggered when the open button is clicked when a saved design is selected.\n * @event openDesignCode Triggered when the open button is clicked when a design code is entered.\n * @event designCodeInput Triggered when the user writes in the design code input.\n * @event resetOpenDesignCodeState Conditionally triggered when a tab is selected.\n * @event backButtonClick Triggered when the back button is clicked.\n */\nlet OpenDesign = class OpenDesign extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Visible modal.\n this.visibleModal = null;\n // Whether the user is logged in to IKEA or not. Always set to false when in Kiosk.\n this.loggedIn = false;\n // Whether to show saved designs or not. Always set to false when in Kiosk.\n this.showSavedDesigns = false;\n // The design code entered by the user.\n this.designCode = null;\n // The state of open design code.\n this.openDesignCodeState = component_open_design_code_1.OpenDesignCodeStateEnum.default;\n // List of saved designs retrieved from save service.\n this.savedDesigns = null;\n // The state of open saved design.\n this.openSavedDesignState = OpenDesignStateEnum_1.default.default;\n // Where the sheet will open. The values are flipped in RTL, meaning \"right\" will open to the left and vice versa.\n this.sheetAlignment = enums_1.SheetAlignmentEnum.right;\n // Whether or not to show a back button.\n this.showBackButton = false;\n this.sheetElement = null;\n this.cardElement = null;\n this.sheetHeaderElement = null;\n this.sheetFooterElement = null;\n this.selectedSavedDesignId = null;\n this.selectedTab = OpenDesignTabEnum_1.default.ikeaProfile;\n this.dexfSettings = null;\n }\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.closeSheet();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n if (changedProperties.has('visibleModal')) {\n if (this.visibleModal === OpenDesignModalEnum_1.default.openDesignCard) {\n this.openSheet();\n }\n else {\n this.closeSheet();\n }\n }\n if (this.cardElement) {\n this.cardElement.theme = this.theme;\n this.cardElement.localizedInformation = this.localizedInformation;\n this.cardElement.translations = this.translations;\n this.cardElement.settings = this.settings;\n this.cardElement.loggedIn = this.loggedIn;\n this.cardElement.showSavedDesigns = this.showSavedDesigns;\n this.cardElement.designCode = this.designCode;\n this.cardElement.openDesignCodeState = this.openDesignCodeState;\n this.cardElement.savedDesigns = this.savedDesigns;\n }\n if (changedProperties.has('showBackButton')) {\n this.recreateSheetHeader();\n }\n if (changedProperties.has('showSavedDesigns') ||\n changedProperties.has('loggedIn') ||\n changedProperties.has('savedDesigns')) {\n this.recreateSheetFooter();\n }\n if (changedProperties.has('openSavedDesignState')) {\n const button = this.getFooterButton();\n if (button) {\n button.loading = this.openSavedDesignState === OpenDesignStateEnum_1.default.loading;\n }\n }\n return true;\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n if (!translations) {\n throw new Error('Translations must be defined either through the \"translations\" or \"localizedInformation\" prop.');\n }\n return translations;\n }\n getSettings() {\n if (!this.dexfSettings) {\n throw new Error('Settings must be defined either through the \"settings\" or \"localizedInformation\" prop.');\n }\n return this.dexfSettings;\n }\n closeSheet() {\n if (this.sheetElement) {\n this.sheetElement.open = false;\n this.sheetElement = null;\n this.cardElement = null;\n this.sheetHeaderElement = null;\n this.sheetFooterElement = null;\n this.selectedTab = OpenDesignTabEnum_1.default.ikeaProfile;\n this.selectedSavedDesignId = null;\n }\n }\n openSheet() {\n if (this.sheetElement) {\n return;\n }\n const sheetElement = this.createSheetElement();\n sheetElement.addEventListener('closed', () => {\n var _a;\n (_a = sheetElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(sheetElement);\n });\n this.sheetElement = sheetElement;\n this.cardElement = sheetElement.querySelector('kompis-open-design-card');\n this.sheetHeaderElement = sheetElement.querySelector('skapa-modal-header');\n this.sheetFooterElement = sheetElement.querySelector('skapa-modal-footer');\n const parent = document.querySelector('kompis-keyboard-injector') || document.body;\n parent.appendChild(sheetElement);\n sheetElement.open = true;\n }\n recreateSheetHeader() {\n if (this.sheetElement) {\n if (this.sheetHeaderElement) {\n this.sheetElement.removeChild(this.sheetHeaderElement);\n this.sheetHeaderElement = null;\n }\n const header = this.createSheetHeader();\n this.sheetElement.prepend(header);\n this.sheetHeaderElement = header;\n }\n }\n createSheetElement() {\n const sheetElement = this.createSheet();\n const sheetHeaderElement = this.createSheetHeader();\n const openDesignCard = this.createCard();\n const sheetFooterElement = this.createSheetFooter();\n sheetElement.appendChild(sheetHeaderElement);\n sheetElement.appendChild(openDesignCard);\n if (sheetFooterElement) {\n sheetElement.appendChild(sheetFooterElement);\n }\n return sheetElement;\n }\n createSheet() {\n const sheetElement = document.createElement('skapa-sheet');\n sheetElement.setAttribute('aria-label', this.getTranslations().openDesignHeader);\n sheetElement.size = 'small';\n sheetElement.style.zIndex = '500';\n sheetElement.fullHeight = true;\n sheetElement.alignToStart = this.sheetAlignment === enums_1.SheetAlignmentEnum.left;\n sheetElement.style.fontFamily = themes_1.FontStyle.getFontFamily(this.theme);\n sheetElement.addEventListener('closerequest', () => {\n if (this.sheetElement) {\n this.dispatchEvent(new CustomEvent('modalClose', {\n bubbles: true,\n detail: {\n visibleModal: null\n }\n }));\n }\n });\n return sheetElement;\n }\n createSheetHeader() {\n const sheetHeaderElement = document.createElement('skapa-modal-header');\n sheetHeaderElement.slot = 'header';\n const headerSpan = document.createElement('span');\n headerSpan.slot = 'closebutton-label';\n headerSpan.innerText = this.getTranslations().modalAriaLabelButtonClose;\n sheetHeaderElement.appendChild(headerSpan);\n if (this.showBackButton) {\n const backButton = this.createBackButton();\n sheetHeaderElement.appendChild(backButton);\n sheetHeaderElement.addEventListener('backrequest', () => {\n this.dispatchEvent(new CustomEvent('backButtonClick', {\n bubbles: true,\n detail: {\n visibleModal: null\n }\n }));\n });\n }\n return sheetHeaderElement;\n }\n createBackButton() {\n const backButton = document.createElement('skapa-icon-button');\n backButton.slot = 'back-button';\n backButton.variant = 'primary';\n backButton.inverse = true;\n backButton.small = true;\n backButton.innerText = this.getTranslations().modalAriaLabelButtonBack;\n const icon = document.createElement('skapa-icon');\n icon.slot = 'icon';\n icon.icon = 'arrow-left';\n icon.flipRTL = true;\n backButton.append(icon);\n return backButton;\n }\n createCard() {\n const openDesignCard = document.createElement('kompis-open-design-card');\n openDesignCard.theme = this.theme;\n openDesignCard.localizedInformation = this.localizedInformation;\n openDesignCard.translations = this.translations;\n openDesignCard.settings = this.getSettings();\n openDesignCard.loggedIn = this.loggedIn;\n openDesignCard.showSavedDesigns = this.showSavedDesigns;\n openDesignCard.designCode = this.designCode;\n openDesignCard.openDesignCodeState = this.openDesignCodeState;\n openDesignCard.savedDesigns = this.savedDesigns;\n openDesignCard.addEventListener('tabSelect', (event) => {\n const selectedTab = event.detail.selectedTab;\n if (this.selectedTab !== selectedTab) {\n this.selectedTab = selectedTab;\n this.recreateSheetFooter();\n }\n });\n openDesignCard.addEventListener('designCodeInput', (event) => {\n this.dispatchEvent(new CustomEvent('designCodeInput', { bubbles: true, detail: event.detail }));\n });\n openDesignCard.addEventListener('openDesignCode', (event) => this.dispatchEvent(new CustomEvent('openDesignCode', { bubbles: true, detail: event.detail })));\n openDesignCard.addEventListener('designSelect', (event) => {\n this.selectedSavedDesignId = event.detail.designId;\n const button = this.getFooterButton();\n if (button) {\n button.disabled = false;\n }\n });\n openDesignCard.addEventListener('resetOpenDesignCodeState', (event) => this.dispatchEvent(new CustomEvent('resetOpenDesignCodeState', {\n bubbles: true,\n detail: event.detail\n })));\n return openDesignCard;\n }\n /**\n * Recreates the sheet footer. This should be done when props (or events) that affect the footer are updated.\n * For example, different buttons should be shown depending on the props. It's easier to recreate the entire footer then to replace the individual button.\n */\n recreateSheetFooter() {\n if (this.sheetElement) {\n if (this.sheetFooterElement) {\n this.sheetElement.removeChild(this.sheetFooterElement);\n this.sheetFooterElement = null;\n }\n const footer = this.createSheetFooter();\n if (footer) {\n this.sheetElement.appendChild(footer);\n this.sheetFooterElement = footer;\n }\n }\n }\n createSheetFooter() {\n var _a;\n if (this.selectedTab === OpenDesignTabEnum_1.default.designCode || !this.showSavedDesigns) {\n return null;\n }\n const sheetFooterElement = document.createElement('skapa-modal-footer');\n sheetFooterElement.slot = 'footer';\n const button = document.createElement('skapa-button');\n if (this.loggedIn) {\n if (!((_a = this.savedDesigns) === null || _a === void 0 ? void 0 : _a.length)) {\n return null;\n }\n button.slot = 'primary-button';\n button.variant = 'primary';\n button.a11yLabel = this.getTranslations().open;\n button.textContent = this.getTranslations().open;\n button.disabled = !this.selectedSavedDesignId;\n button.loading = this.openSavedDesignState === OpenDesignStateEnum_1.default.loading;\n button.addEventListener('click', () => {\n this.dispatchEvent(new CustomEvent('openSavedDesign', {\n bubbles: true,\n detail: { designId: this.selectedSavedDesignId }\n }));\n });\n }\n else {\n button.slot = 'primary-button';\n button.variant = 'emphasised';\n button.a11yLabel = this.getTranslations().loginButton;\n button.textContent = this.getTranslations().loginButton;\n button.addEventListener('click', () => {\n this.dispatchEvent(new CustomEvent('logIn', { bubbles: true }));\n });\n }\n sheetFooterElement.appendChild(button);\n return sheetFooterElement;\n }\n getFooterButton() {\n var _a, _b;\n return (_b = (_a = this.sheetFooterElement) === null || _a === void 0 ? void 0 : _a.querySelector('skapa-button')) !== null && _b !== void 0 ? _b : null;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], OpenDesign.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], OpenDesign.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], OpenDesign.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], OpenDesign.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], OpenDesign.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], OpenDesign.prototype, \"loggedIn\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], OpenDesign.prototype, \"showSavedDesigns\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, synchronous: true })\n], OpenDesign.prototype, \"designCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], OpenDesign.prototype, \"openDesignCodeState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], OpenDesign.prototype, \"savedDesigns\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], OpenDesign.prototype, \"openSavedDesignState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], OpenDesign.prototype, \"sheetAlignment\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], OpenDesign.prototype, \"showBackButton\", void 0);\nOpenDesign = __decorate([\n (0, web_component_1.customElement)('kompis-open-design')\n], OpenDesign);\nexports.default = OpenDesign;\n//# sourceMappingURL=OpenDesign.js.map","import \"@inter-ikea-kompis/component-open-design/lib/components/open-design/OpenDesign\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisOpenDesign extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-open-design\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.designCode = props.designCode;\n element.localizedInformation = props.localizedInformation;\n element.loggedIn = props.loggedIn;\n element.openDesignCodeState = props.openDesignCodeState;\n element.openSavedDesignState = props.openSavedDesignState;\n element.savedDesigns = props.savedDesigns;\n element.settings = props.settings;\n element.sheetAlignment = props.sheetAlignment;\n element.showBackButton = props.showBackButton;\n element.showSavedDesigns = props.showSavedDesigns;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onBackButtonClick, \"backButtonClick\");\n this.updateEventListener(element, props.onDesignCodeInput, \"designCodeInput\");\n this.updateEventListener(element, props.onLogIn, \"logIn\");\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onOpenDesignCode, \"openDesignCode\");\n this.updateEventListener(element, props.onOpenSavedDesign, \"openSavedDesign\");\n this.updateEventListener(element, props.onResetOpenDesignCodeState, \"resetOpenDesignCodeState\");\n }\n}\nKompisOpenDesign.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n designCode: PropTypes.string,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n loggedIn: PropTypes.bool,\n openDesignCodeState: PropTypes.string,\n openSavedDesignState: PropTypes.string,\n savedDesigns: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n sheetAlignment: PropTypes.string,\n showBackButton: PropTypes.bool,\n showSavedDesigns: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n onModalClose: PropTypes.func,\n onLogIn: PropTypes.func,\n onOpenSavedDesign: PropTypes.func,\n onOpenDesignCode: PropTypes.func,\n onDesignCodeInput: PropTypes.func,\n onResetOpenDesignCodeState: PropTypes.func,\n onBackButtonClick: PropTypes.func\n};\nexport default KompisOpenDesign;\n","import \"@inter-ikea-kompis/component-open-design-code/lib/components/open-design-code-input/OpenDesignCodeInput\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisOpenDesignCodeInput extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-open-design-code-input\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.localizedInformation = props.localizedInformation;\n element.state = props.state;\n element.theme = props.theme;\n element.translations = props.translations;\n element.vpcCode = props.vpcCode;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onInput, \"input\");\n this.updateEventListener(element, props.onOpen, \"open\");\n }\n}\nKompisOpenDesignCodeInput.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n state: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n vpcCode: PropTypes.string,\n onOpen: PropTypes.func,\n onInput: PropTypes.func\n};\nexport default KompisOpenDesignCodeInput;\n","import \"@inter-ikea-kompis/component-open-design-code/lib/components/open-design-code/OpenDesignCode\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisOpenDesignCode extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-open-design-code\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.localizedInformation = props.localizedInformation;\n element.state = props.state;\n element.theme = props.theme;\n element.translations = props.translations;\n element.vpcCode = props.vpcCode;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onInput, \"input\");\n this.updateEventListener(element, props.onOpen, \"open\");\n }\n}\nKompisOpenDesignCode.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n state: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n vpcCode: PropTypes.string,\n onOpen: PropTypes.func,\n onInput: PropTypes.func\n};\nexport default KompisOpenDesignCode;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar PillAlignEnum;\n(function (PillAlignEnum) {\n PillAlignEnum[\"left\"] = \"left\";\n PillAlignEnum[\"right\"] = \"right\";\n})(PillAlignEnum || (PillAlignEnum = {}));\nexports.default = PillAlignEnum;\n//# sourceMappingURL=PillAlignEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar PillSizeOptionsEnum;\n(function (PillSizeOptionsEnum) {\n PillSizeOptionsEnum[\"small\"] = \"small\";\n PillSizeOptionsEnum[\"medium\"] = \"medium\";\n})(PillSizeOptionsEnum || (PillSizeOptionsEnum = {}));\nexports.default = PillSizeOptionsEnum;\n//# sourceMappingURL=PillSizeOptionsEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/* eslint-disable no-console */\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst PillSizeOptionsEnum_1 = __importDefault(require(\"../../enums/PillSizeOptionsEnum\"));\nconst BUTTON_HEIGHT = {\n small: 40,\n medium: 56\n};\nclass PillStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.theme Theme.\n * @param options.isDisabled True if disabled.\n * @param options.icon Value of the icon prop.\n * @param options.pillSize Pill size.\n * @param options.theme Theme.\n * @param options.alignIcon\n * @returns Styles.\n */\n /**\n * @param options\n */\n static getStyle(options) {\n const { color, spacing, border, breakpoint, motion } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tpointer-events: ${options.isDisabled ? 'none' : 'initial'};\n\t\t\t}\n\n\t\t\t.pill {\n\t\t\t\tdisplay: flex;\n\t\t\t\tposition: relative;\n\t\t\t\tmin-height: ${40 / 16}rem;\n\t\t\t\tpadding: 0;\n\t\t\t\toutline: none;\n\t\t\t\tborder-radius: ${border.radius.radius64 / 16}rem;\n\n\t\t\t\t/* Disabled text selection */\n\t\t\t\t-webkit-touch-callout: none;\n\t\t\t\t-webkit-user-select: none;\n\t\t\t\t-khtml-user-select: none;\n\t\t\t\t-moz-user-select: none;\n\t\t\t\t-ms-user-select: none;\n\t\t\t\tuser-select: none;\n\t\t\t}\n\n\t\t\t.pillButton {\n\t\t\t\tborder: ${1 / 16}rem solid transparent;\n\t\t\t\tcursor: ${options.isDisabled ? 'default' : 'pointer'};\n\t\t\t\tvertical-align: middle;\n\t\t\t\ttext-align: center;\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tposition: relative;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\ttransition-property: background, transform;\n\t\t\t\ttransition-duration: ${motion.duration.medium};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t\tbackground: ${options.isDisabled ? color.neutral.grey200 : color.neutral.grey100};\n\t\t\t\tcolor: ${options.isDisabled ? color.neutral.grey500 : color.neutral.grey900};\n\t\t\t\theight: ${(options.pillSize === 'small' ? BUTTON_HEIGHT.small : BUTTON_HEIGHT.medium) /\n 16}rem;\n\t\t\t\tborder-radius: ${border.radius.radius64 / 16}rem;\n\t\t\t\tpadding: 0 ${this.getPadding(options) / 16}rem;\n\t\t\t\tuser-select: none;\n\t\t\t\t-webkit-tap-highlight-color: transparent;\n\t\t\t\tjustify-content: center;\n\t\t\t\talign-items: center;\n\t\t\t\toutline: none;\n\t\t\t}\n\n\t\t\t@media screen and (min-width: ${breakpoint.xlarge.width / 16}rem) {\n\t\t\t\ttransition-duration: ${motion.duration.small};\n\t\t\t}\n\n\t\t\t.pillIcon {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\n\t\t\t.pillSpacer {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-shrink: 1;\n\t\t\t\twidth: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.pillText {\n\t\t\t\tdisplay: flex;\n\t\t\t\tfont-weight: bold;\n\t\t\t}\n\n\t\t\t.pillButtonSelected {\n\t\t\t\ttransition-property: border, transform;\n\t\t\t\ttransition-duration: ${motion.duration.medium};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t\tborder: ${1 / 16}rem solid\n\t\t\t\t\t${options.isDisabled ? color.neutral.grey100 : color.neutral.grey900};\n\t\t\t}\n\n\t\t\t.divider {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\twidth: ${spacing.space200 / 16}rem;\n\t\t\t\ttransition-property: width;\n\t\t\t\ttransition-duration: ${motion.duration.large};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t}\n\n\t\t\t${this.getHover(options)}\n\t\t\t${options.isDisabled ? this.getDisabled(options) : ''}\n\t\t\t${this.getThumbnail(options)}\n\t\t`;\n }\n /**\n * Returns the padding.\n *\n * @param options Options.\n * @returns Styles.\n */\n static getPadding(options) {\n const { spacing } = options.theme;\n switch (options.pillSize) {\n case PillSizeOptionsEnum_1.default.small:\n return spacing.space150;\n }\n return spacing.space200;\n }\n /**\n * Returns Thumbnail.\n *\n * @param options Options object.\n * @param options.theme Theme.\n * @param options.small\n * @returns Css code.\n */\n static getThumbnail(options) {\n const { spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t.thumbnail {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\t\t\tkompis-image {\n\t\t\t\tdisplay: flex;\n\t\t\t\twidth: ${(options.pillSize === 'small' ? spacing.space150 : spacing.space200) / 16}rem;\n\t\t\t\theight: ${(options.pillSize === 'small' ? spacing.space150 : spacing.space200) / 16}rem;\n\t\t\t\tborder-radius: ${spacing.space400 / 16}rem;\n\t\t\t\toverflow: hidden;\n\t\t\t\tmargin: 0 -${this.getPadding(options) / 16 / 2}rem;\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns hover effect.\n *\n * @param options Options object.\n * @param options.theme Theme.\n * @param options.disabled\n * @returns Css code.\n */\n static getHover(options) {\n const { color } = options.theme;\n const inner = (0, web_component_1.css) `\n\t\t\t.pillButton:hover {\n\t\t\t\tbackground: ${options.isDisabled ? color.neutral.grey100 : color.neutral.grey200};\n\t\t\t}\n\t\t\t.pillButtonSelected:hover {\n\t\t\t\tbackground: ${options.isDisabled ? color.neutral.grey100 : color.neutral.grey200};\n\t\t\t}\n\t\t\t.pillButton:active {\n\t\t\t\tbackground: ${options.isDisabled ? color.neutral.grey100 : color.neutral.grey300};\n\t\t\t}\n\t\t\t.pillButtonSelected:active {\n\t\t\t\tbackground: ${options.isDisabled ? color.neutral.grey100 : color.neutral.grey300};\n\t\t\t}\n\t\t`;\n return (0, web_component_1.css) `\n\t\t\t/* Prevent hover effect on touch. */\n\t\t\t@media (-moz-touch-enabled: 0), (pointer: fine) {\n\t\t\t\t${inner}\n\t\t\t}\n\t\t\t/* Needed for IE11 to get an hover effect. */\n\t\t\t@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n\t\t\t\t${inner}\n\t\t\t}\n\t\t`;\n }\n /**\n * Style for button disabled.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @param options.light Version.\n * @param options.disabled\n * @param options.buttonType Layout.\n * @returns Style for button disabled.\n */\n static getDisabled(options) {\n const { color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\tbutton {\n\t\t\t\tcolor: ${color.disabled.default} !important;\n\t\t\t\tbackground: ${color.disabled.default} !important;\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\t.thumbnail {\n\t\t\t\topacity: ${options.isDisabled ? '0.5' : '1'};\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = PillStyle;\n//# sourceMappingURL=PillStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst component_focus_outline_1 = require(\"@inter-ikea-kompis/component-focus-outline\");\nrequire(\"@inter-ikea-kompis/component-image\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@inter-ikea-kompis/component-focus-outline\");\nconst PillAlignEnum_1 = __importDefault(require(\"../../enums/PillAlignEnum\"));\nconst PillSizeOptionsEnum_1 = __importDefault(require(\"../../enums/PillSizeOptionsEnum\"));\nconst PillStyle_1 = __importDefault(require(\"./PillStyle\"));\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n *\n * Pill class.\n *\n * @event select Pill triggers props select event.\n */\nlet Pill = class Pill extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Label associated with pill.\n this.label = null;\n // Align the icon 'right' or 'left'.\n this.alignIcon = PillAlignEnum_1.default.left;\n // Select\n this.selected = false;\n // Thumbnail\n this.thumbnail = null;\n // Icon: Icon on pill.\n this.icon = null;\n // Disabled mode\n this.disabled = false;\n // Pill size option\n this.pillSize = PillSizeOptionsEnum_1.default.medium;\n // Sets the behaviour of the position watcher. The position watcher is useful when the component is inside an overflown element where it can become cropped. When enabled it will be set itself to be position fixed and update the position of itself live. However, updating the position live can be slow and result in lag on slower computers. Be wary of using 'auto' or 'enabled' if the component have any ancestors with transform styling.\n this.focusOutlinePositionWatcher = component_focus_outline_1.FocusOutlinePositionWatcherEnum.auto;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n const isLeftIcon = this.alignIcon === 'left';\n const labelClass = `pillButton${this.selected ? ' pillButtonSelected' : ''}`;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t this.onKeyDown(event)}\"\n\t\t\t\t@click=\"${this.onClick.bind(this)}\"\n\t\t\t\ttabindex=\"${this.disabled ? -1 : ''}\"\n\t\t\t>\n\t\t\t\t\n\t\t\t\t\t${!this.thumbnail ? this.getIcon(isLeftIcon ? this.icon : null, isLeftIcon) : ''}\n\t\t\t\t\t${this.getThumbnail(this.thumbnail)} ${this.getText(this.label)}\n\t\t\t\t\t${!this.thumbnail ? this.getIcon(!isLeftIcon ? this.icon : null, isLeftIcon) : ''}\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n /**\n * Get text.\n *\n * @param text The text to display.\n * @returns Template.\n */\n getText(text) {\n if (!text) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${text}\n\t\t\t
    \n\t\t`;\n }\n /**\n * Get the icon.\n *\n * @param icon The icon.\n * @param isLeftIcon Where to place the spacer.\n * @returns Template.\n */\n getIcon(icon, isLeftIcon) {\n if (!icon) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${this.getSpacer(!isLeftIcon)}\n\t\t\t\t\n\t\t\t\t${this.getSpacer(isLeftIcon)}\n\t\t\t
    \n\t\t`;\n }\n /**\n * Get thumbnail.\n *\n * @param url\n * @param thumbnail The thumbnail.\n * @returns Template.\n */\n getThumbnail(thumbnail) {\n if (!thumbnail) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t
    \n\t\t\t
    \n\t\t`;\n }\n /**\n * @param show If space should be shown.\n * @returns Template.\n */\n getSpacer(show) {\n if (!show) {\n return null;\n }\n return (0, web_component_1.html) `
    `;\n }\n /**\n * Event handler.\n *\n * @param event HTMLEvent.\n */\n onClick(event) {\n event.stopPropagation();\n event.preventDefault();\n if (this.disabled) {\n return;\n }\n this.dispatchEvent(new CustomEvent('select', {\n bubbles: true,\n detail: {\n selected: !this.selected\n }\n }));\n }\n /**\n * Event handler.\n *\n * @param event Event.\n */\n onKeyDown(event) {\n if (event.key === 'Enter' || event.key === ' ') {\n if (this.disabled) {\n return;\n }\n this.dispatchEvent(new CustomEvent('select', {\n bubbles: true,\n detail: {\n selected: !this.selected\n }\n }));\n }\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Pill.prototype, \"label\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Pill.prototype, \"alignIcon\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Pill.prototype, \"selected\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Pill.prototype, \"thumbnail\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Pill.prototype, \"icon\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Pill.prototype, \"disabled\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Pill.prototype, \"pillSize\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Pill.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Pill.prototype, \"focusOutlinePositionWatcher\", void 0);\nPill = __decorate([\n (0, web_component_1.customElement)('kompis-pill')\n], Pill);\nexports.default = Pill;\n//# sourceMappingURL=Pill.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass PillGroupCarouselStyle {\n /**\n * Returns styles.\n *\n * @param options Options holder.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\tkompis-carousel {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-wrap: nowrap;\n\t\t\t}\n\t\t\tkompis-carousel-item {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tpadding: ${spacing.space75 / 16 / 2}rem 0;\n\t\t\t}\n\t\t\tkompis-pill {\n\t\t\t\tmargin-right: ${spacing.space200 / 16 / 2}rem;\n\t\t\t}\n\t\t\t::-webkit-scrollbar {\n\t\t\t\twidth: 0;\n\t\t\t\tbackground: transparent;\n\t\t\t\theight: 0;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = PillGroupCarouselStyle;\n//# sourceMappingURL=PillGroupCarouselStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst component_carousel_1 = require(\"@inter-ikea-kompis/component-carousel\");\nconst component_focus_outline_1 = require(\"@inter-ikea-kompis/component-focus-outline\");\nrequire(\"@inter-ikea-kompis/component-carousel\");\nrequire(\"../pill/Pill\");\nconst PillAlignEnum_1 = __importDefault(require(\"../../enums/PillAlignEnum\"));\nconst PillSizeOptionsEnum_1 = __importDefault(require(\"../../enums/PillSizeOptionsEnum\"));\nconst PillGroupCarouselStyle_1 = __importDefault(require(\"./PillGroupCarouselStyle\"));\n/**\n * Product Gallery View component.\n *\n * @event change Event forwarded from kompis-carousel\n * @event select A select event is triggered when pill is selected\n */\nlet PillGroupCarousel = class PillGroupCarousel extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Visibility of navigation arrows\n this.showArrows = false;\n // Array of MediaItem objects\n this.pillItems = null;\n // Align the icon 'right' or 'left'.\n this.alignIcon = PillAlignEnum_1.default.left;\n // Thumbnail\n this.thumbnail = null;\n // Pill size option\n this.pillSize = PillSizeOptionsEnum_1.default.medium;\n // Set which slide index that should be active\n this.selectedIndex = 0;\n // Label for the Carousel to set as an aria-label for accessibility reasons\n this.ariaLabelCarousel = null;\n // Role description for the Carousel to set as an aria-roledescription for accessibility reasons\n this.ariaRoleDescriptionCarousel = null;\n // Label for the CarouselControl LeftArrow to set as an aria-label for accessibility reasons\n this.ariaLabelCarouselLeftArrow = null;\n // Label for the CarouselControl RightArrow to set as an aria-label for accessibility reasons\n this.ariaLabelCarouselRightArrow = null;\n this.breakpointObserver = new themes_1.ThemeBreakpointObserver(() => this.requestUpdate());\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t this.dispatchEvent(new CustomEvent('change', {\n bubbles: true,\n detail: { selectedIndex: event.detail.selectedIndex }\n }))}\n\t\t\t>\n\t\t\t\t${this.getPills()}\n\t\t\t\n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.breakpointObserver.disconnect();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('theme')) {\n this.breakpointObserver.observe(this.theme);\n }\n return true;\n }\n /**\n * Returns carousel items.\n *\n * @returns Carousel items.\n */\n getPills() {\n var _a;\n if (!this.pillItems) {\n return null;\n }\n return (_a = this.pillItems) === null || _a === void 0 ? void 0 : _a.map((pillItem, index) => (0, web_component_1.html) `\n\t\t\t\t\n\t\t\t\t\t this.dispatchEvent(new CustomEvent('select', { bubbles: true, detail: { selectedIndex: index } }))}\"\n\t\t\t\t\t\t.focusOutlinePositionWatcher=\"${component_focus_outline_1.FocusOutlinePositionWatcherEnum.enabled}\"\n\t\t\t\t\t\t.pillSize=\"${this.pillSize}\"\n\t\t\t\t\t\t.alignIcon=\"${this.alignIcon}\"\n\t\t\t\t\t\t.thumbnail=\"${this.thumbnail}\"\n\t\t\t\t\t\t.icon=\"${pillItem.icon || null}\"\n\t\t\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t\t\t.label=\"${pillItem.name}\"\n\t\t\t\t\t>\n\t\t\t\t\n\t\t\t`);\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PillGroupCarousel.prototype, \"showArrows\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], PillGroupCarousel.prototype, \"pillItems\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], PillGroupCarousel.prototype, \"alignIcon\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], PillGroupCarousel.prototype, \"thumbnail\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], PillGroupCarousel.prototype, \"pillSize\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], PillGroupCarousel.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number, synchronous: true })\n], PillGroupCarousel.prototype, \"selectedIndex\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], PillGroupCarousel.prototype, \"ariaLabelCarousel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], PillGroupCarousel.prototype, \"ariaRoleDescriptionCarousel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], PillGroupCarousel.prototype, \"ariaLabelCarouselLeftArrow\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], PillGroupCarousel.prototype, \"ariaLabelCarouselRightArrow\", void 0);\nPillGroupCarousel = __decorate([\n (0, web_component_1.customElement)('kompis-pill-group-carousel')\n], PillGroupCarousel);\nexports.default = PillGroupCarousel;\n//# sourceMappingURL=PillGroupCarousel.js.map","import \"@inter-ikea-kompis/component-pill/lib/components/pill-group-carousel/PillGroupCarousel\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisPillGroupCarousel extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-pill-group-carousel\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.alignIcon = props.alignIcon;\n element.ariaLabelCarousel = props.ariaLabelCarousel;\n element.ariaLabelCarouselLeftArrow = props.ariaLabelCarouselLeftArrow;\n element.ariaLabelCarouselRightArrow = props.ariaLabelCarouselRightArrow;\n element.ariaRoleDescriptionCarousel = props.ariaRoleDescriptionCarousel;\n element.pillItems = props.pillItems;\n element.pillSize = props.pillSize;\n element.selectedIndex = props.selectedIndex;\n element.showArrows = props.showArrows;\n element.theme = props.theme;\n element.thumbnail = props.thumbnail;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onChange, \"change\");\n this.updateEventListener(element, props.onSelect, \"select\");\n }\n}\nKompisPillGroupCarousel.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n alignIcon: PropTypes.string,\n ariaLabelCarousel: PropTypes.string,\n ariaLabelCarouselLeftArrow: PropTypes.string,\n ariaLabelCarouselRightArrow: PropTypes.string,\n ariaRoleDescriptionCarousel: PropTypes.string,\n pillItems: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n pillSize: PropTypes.string,\n selectedIndex: PropTypes.number,\n showArrows: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n thumbnail: PropTypes.string,\n onChange: PropTypes.func,\n onSelect: PropTypes.func\n};\nexport default KompisPillGroupCarousel;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass PillGroupStyle {\n /**\n * @param options\n * @param options.theme\n * @param options\n * @param options.theme\n */\n static getStyle(options) {\n const { spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tflex-wrap: wrap;\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n\t\t\t::slotted(kompis-pill) {\n\t\t\t\tmargin: ${spacing.space25 / 16}rem;\n\t\t\t}\n\t\t\tkompis-pill {\n\t\t\t\tmargin: ${spacing.space25 / 16}rem;\n\t\t\t}\n\t\t\t${this.hidePills(options)}\n\t\t`;\n }\n /**\n * @param options\n */\n static hidePills(options) {\n if (options.showAll || options.pillLimit === null) {\n return '';\n }\n return (0, web_component_1.css) `\n\t\t\t::slotted(kompis-pill:nth-child(n + ${options.pillLimit + 1})) {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = PillGroupStyle;\n//# sourceMappingURL=PillGroupStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst component_focus_outline_1 = require(\"@inter-ikea-kompis/component-focus-outline\");\nrequire(\"@inter-ikea-kompis/component-icon\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"./../pill/Pill\");\nconst PillGroupStyle_1 = __importDefault(require(\"./PillGroupStyle\"));\n/**\n * Pill class.\n *\n * @event showAllPills Show all pills event.\n */\nlet PillGroup = class PillGroup extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Show more button text.\n this.showMoreLabel = '';\n // Max limit of pills to be displayed.\n this.pillLimit = null;\n // Show all pills.\n this.showAll = false;\n // Sets the behaviour of the position watcher. The position watcher is useful when the component is inside an overflown element where it can become cropped. When enabled it will be set itself to be position fixed and update the position of itself live. However, updating the position live can be slow and result in lag on slower computers. Be wary of using 'auto' or 'enabled' if the component have any ancestors with transform styling.\n this.focusOutlinePositionWatcher = component_focus_outline_1.FocusOutlinePositionWatcherEnum.auto;\n // Label for the pill group to set as an aria-label for accessibility reasons\n this.ariaLabel = null;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t${this.getShowAllButton()}\n\t\t\t
    \n\t\t`;\n }\n /**\n * Handler for onClick button.\n */\n getShowAllButton() {\n var _a;\n if (this.showAll || this.pillLimit === null || this.children.length < this.pillLimit) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n }\n /**\n * Handler for onClick button.\n */\n onButtonClick() {\n this.dispatchEvent(new CustomEvent('showAllPills', { bubbles: true }));\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], PillGroup.prototype, \"showMoreLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], PillGroup.prototype, \"pillLimit\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], PillGroup.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PillGroup.prototype, \"showAll\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], PillGroup.prototype, \"focusOutlinePositionWatcher\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], PillGroup.prototype, \"ariaLabel\", void 0);\nPillGroup = __decorate([\n (0, web_component_1.customElement)('kompis-pill-group')\n], PillGroup);\nexports.default = PillGroup;\n//# sourceMappingURL=PillGroup.js.map","import \"@inter-ikea-kompis/component-pill/lib/components/pill-group/PillGroup\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisPillGroup extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-pill-group\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.ariaLabel = props.ariaLabel;\n element.focusOutlinePositionWatcher = props.focusOutlinePositionWatcher;\n element.pillLimit = props.pillLimit;\n element.showAll = props.showAll;\n element.showMoreLabel = props.showMoreLabel;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onShowAllPills, \"showAllPills\");\n }\n}\nKompisPillGroup.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n ariaLabel: PropTypes.string,\n focusOutlinePositionWatcher: PropTypes.string,\n pillLimit: PropTypes.number,\n showAll: PropTypes.bool,\n showMoreLabel: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n onShowAllPills: PropTypes.func\n};\nexport default KompisPillGroup;\n","import \"@inter-ikea-kompis/component-pill/lib/components/pill/Pill\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisPill extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-pill\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.alignIcon = props.alignIcon;\n element.disabled = props.disabled;\n element.focusOutlinePositionWatcher = props.focusOutlinePositionWatcher;\n element.icon = props.icon;\n element.label = props.label;\n element.pillSize = props.pillSize;\n element.selected = props.selected;\n element.theme = props.theme;\n element.thumbnail = props.thumbnail;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onSelect, \"select\");\n }\n}\nKompisPill.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n alignIcon: PropTypes.string,\n disabled: PropTypes.bool,\n focusOutlinePositionWatcher: PropTypes.string,\n icon: PropTypes.string,\n label: PropTypes.string,\n pillSize: PropTypes.string,\n selected: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n thumbnail: PropTypes.string,\n onSelect: PropTypes.func\n};\nexport default KompisPill;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = Object.freeze({\n PeriodStartAndEnd: 'PeriodStartAndEnd',\n PeriodEnd: 'PeriodEnd',\n PeriodNone: 'PeriodNone'\n});\n//# sourceMappingURL=MiniConfigurationSummaryTemporaryPeriod.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MiniConfigurationSummaryTemporaryPeriod = exports.MiniConfigurationSummary = void 0;\nconst MiniConfigurationSummary_1 = __importDefault(require(\"./components/mini-configuration-summary/MiniConfigurationSummary\"));\nexports.MiniConfigurationSummary = MiniConfigurationSummary_1.default;\nconst MiniConfigurationSummaryTemporaryPeriod_1 = __importDefault(require(\"./enums/MiniConfigurationSummaryTemporaryPeriod\"));\nexports.MiniConfigurationSummaryTemporaryPeriod = MiniConfigurationSummaryTemporaryPeriod_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ClickItemEnum;\n(function (ClickItemEnum) {\n ClickItemEnum[\"whatsIncluded\"] = \"whatsIncluded\";\n ClickItemEnum[\"next\"] = \"next\";\n ClickItemEnum[\"ecoFee\"] = \"ecoFee\";\n})(ClickItemEnum || (ClickItemEnum = {}));\nexports.default = ClickItemEnum;\n//# sourceMappingURL=ClickItemEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst analytics_1 = require(\"@inter-ikea-kompis/analytics\");\nconst insights_data_provider_1 = require(\"@insights/insights-data-provider\");\nconst moduleId = 'planning_header';\n/**\n * @event click When any of the buttons are clicked.\n */\nclass PlanningHeaderTracker extends analytics_1.AbstractAnalyticsTracker {\n constructor(options) {\n super(Object.assign({ moduleId }, options));\n }\n /**\n * Send click event, e.g. When the user clicks on the next button.\n *\n * @param item The item that has been clicked.\n */\n sendClick(item) {\n const payload = {\n common: { component: moduleId },\n data: {\n item\n }\n };\n this.getReporter().report({\n event: 'click',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe,\n payload\n });\n }\n}\nexports.default = PlanningHeaderTracker;\n//# sourceMappingURL=PlanningHeaderTracker.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass PlanningHeaderStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { theme: { spacing, breakpoint } } = options;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\n\t\t\theader {\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: space-between;\n\t\t\t\talign-items: flex-start;\n\t\t\t\tbackground-color: transparent;\n\n\t\t\t\tpadding-left: ${spacing.space100 / 16}rem;\n\t\t\t\tpadding-right: ${spacing.space100 / 16}rem;\n\t\t\t\tpadding-top: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t::slotted(*) {\n\t\t\t\tmargin-right: ${spacing.space100 / 64}rem;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t}\n\n\t\t\t@media (min-width: ${breakpoint.medium.width / 16}rem) {\n\t\t\t\theader {\n\t\t\t\t\tpadding-left: ${spacing.space150 / 16}rem;\n\t\t\t\t\tpadding-right: ${spacing.space150 / 16}rem;\n\t\t\t\t\tpadding-top: ${spacing.space150 / 16}rem;\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = PlanningHeaderStyle;\n//# sourceMappingURL=PlanningHeaderStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_button_1 = require(\"@inter-ikea-kompis/component-button\");\nconst component_eco_fee_1 = require(\"@inter-ikea-kompis/component-eco-fee\");\nrequire(\"@inter-ikea-kompis/component-mini-configuration-summary\");\nconst ClickItemEnum_1 = __importDefault(require(\"../../enums/ClickItemEnum\"));\nconst PlanningHeaderTracker_1 = __importDefault(require(\"../../trackers/PlanningHeaderTracker\"));\nconst PlanningHeaderStyle_1 = __importDefault(require(\"./PlanningHeaderStyle\"));\n/**\n * @event modalOpen Triggered when the user clicks on the eco fee link\n * @event modalClose Triggered when the user clicks on the sheet close button.\n * @event openWhatsIncluded Triggered when the user clicks on the whatsIncluded link or whatsIncluded icon.\n * @event next When next button is clicked.\n */\nlet PlanningHeader = class PlanningHeader extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Disables button\n this.disabled = false;\n // Hide whatsIncluded icon\n this.hideWhatsIncludedIcon = false;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // Renders the loading style\n this.loading = false;\n // Show a modal.\n this.visibleModal = null;\n // Used for automatic analytics. If null or not set, analytics is turned off.\n this.analytics = null;\n this.tracker = null;\n this.dexfSettings = null;\n this.breakpointObserver = new themes_1.ThemeBreakpointObserver(() => this.requestUpdate());\n }\n /**\n * Intended usage of slot is to render a menu button which will open a sheet.\n *\n * @returns Template.\n */\n render() {\n // We want translations and settings to be required, but since the props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t${this.getMiniConfigurationSummary()}\n\t\t\t
    \n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.breakpointObserver.disconnect();\n this.disconnectTracker();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n if (changedProperties.has('theme')) {\n this.breakpointObserver.observe(this.theme);\n }\n if (changedProperties.has('analytics') && this.hasTranslationsAndSettings()) {\n this.disconnectTracker();\n this.connectTracker();\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n getSettings() {\n return this.dexfSettings;\n }\n connectTracker() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n if (this.analytics) {\n this.tracker = new PlanningHeaderTracker_1.default(Object.assign(Object.assign({}, this.analytics), { settings: this.getSettings() }));\n yield ((_a = this.tracker) === null || _a === void 0 ? void 0 : _a.connect());\n }\n });\n }\n disconnectTracker() {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.disconnect();\n this.tracker = null;\n }\n sendClickEvent(item) {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendClick(item);\n }\n getMiniConfigurationSummary() {\n const buttonLabel = this.getTranslations().miniConfigurationSummaryButton;\n return (0, web_component_1.html) ` {\n var _a;\n this.dispatchEvent(new CustomEvent('modalOpen', { bubbles: true, detail: event.detail }));\n if (((_a = event.detail) === null || _a === void 0 ? void 0 : _a.visibleModal) === component_eco_fee_1.EcoFeeModalEnum.ecoFeeCard) {\n this.sendClickEvent(ClickItemEnum_1.default.ecoFee);\n }\n }}))}\"\n\t\t\t@modalClose=\"${() => this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }))}\"\n\t\t\t@openWhatsIncluded=\"${(event) => {\n this.dispatchEvent(new CustomEvent('openWhatsIncluded', { bubbles: true, detail: event.detail }));\n this.sendClickEvent(ClickItemEnum_1.default.whatsIncluded);\n }}\"\n\t\t\t@next=\"${() => {\n this.dispatchEvent(new CustomEvent('next', { bubbles: true }));\n this.sendClickEvent(ClickItemEnum_1.default.next);\n }}\"\n\t\t>\n\t\t`;\n }\n isMobile() {\n var _a;\n return (((_a = this.breakpointObserver.getBreakpointIndex()) !== null && _a !== void 0 ? _a : enums_1.ThemeBreakpointIndexEnum.small) <=\n enums_1.ThemeBreakpointIndexEnum.small);\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], PlanningHeader.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], PlanningHeader.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], PlanningHeader.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], PlanningHeader.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], PlanningHeader.prototype, \"shoppingProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PlanningHeader.prototype, \"disabled\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PlanningHeader.prototype, \"hideWhatsIncludedIcon\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PlanningHeader.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], PlanningHeader.prototype, \"loading\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], PlanningHeader.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], PlanningHeader.prototype, \"analytics\", void 0);\nPlanningHeader = __decorate([\n (0, web_component_1.customElement)('kompis-planning-header')\n], PlanningHeader);\nexports.default = PlanningHeader;\n//# sourceMappingURL=PlanningHeader.js.map","import \"@inter-ikea-kompis/component-planning-header/lib/components/planning-header/PlanningHeader\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisPlanningHeader extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-planning-header\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.analytics = props.analytics;\n element.disableLinks = props.disableLinks;\n element.disabled = props.disabled;\n element.hideWhatsIncludedIcon = props.hideWhatsIncludedIcon;\n element.loading = props.loading;\n element.localizedInformation = props.localizedInformation;\n element.settings = props.settings;\n element.shoppingProducts = props.shoppingProducts;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n this.updateEventListener(element, props.onNext, \"next\");\n this.updateEventListener(element, props.onOpenWhatsIncluded, \"openWhatsIncluded\");\n }\n}\nKompisPlanningHeader.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n analytics: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n disableLinks: PropTypes.bool,\n disabled: PropTypes.bool,\n hideWhatsIncludedIcon: PropTypes.bool,\n loading: PropTypes.bool,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n shoppingProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n onModalOpen: PropTypes.func,\n onModalClose: PropTypes.func,\n onOpenWhatsIncluded: PropTypes.func,\n onNext: PropTypes.func\n};\nexport default KompisPlanningHeader;\n","import \"@inter-ikea-kompis/component-popover/lib/components/popover-padding/PopoverPadding\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisPopoverPadding extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-popover-padding\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisPopoverPadding.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisPopoverPadding;\n","import \"@inter-ikea-kompis/component-popover/lib/components/popover-position/PopoverPosition\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisPopoverPosition extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-popover-position\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) { }\n updateAllEventListeners(element, props) { }\n}\nKompisPopoverPosition.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any\n};\nexport default KompisPopoverPosition;\n","import \"@inter-ikea-kompis/component-popover/lib/components/popover-positioner/PopoverPositioner\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisPopoverPositioner extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-popover-positioner\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.alignment = props.alignment;\n element.direction = props.direction;\n element.theme = props.theme;\n element.visible = props.visible;\n element.wiggle = props.wiggle;\n element.zIndex = props.zIndex;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onAnimationEnd, \"animationEnd\");\n }\n}\nKompisPopoverPositioner.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n alignment: PropTypes.string,\n direction: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n visible: PropTypes.bool,\n wiggle: PropTypes.bool,\n zIndex: PropTypes.number,\n onAnimationEnd: PropTypes.func\n};\nexport default KompisPopoverPositioner;\n","import \"@inter-ikea-kompis/component-popover/lib/components/popover/Popover\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisPopover extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-popover\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.alignment = props.alignment;\n element.direction = props.direction;\n element.theme = props.theme;\n element.visible = props.visible;\n element.wiggle = props.wiggle;\n element.zIndex = props.zIndex;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onAnimationEnd, \"animationEnd\");\n }\n}\nKompisPopover.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n alignment: PropTypes.string,\n direction: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n visible: PropTypes.bool,\n wiggle: PropTypes.bool,\n zIndex: PropTypes.number,\n onAnimationEnd: PropTypes.func\n};\nexport default KompisPopover;\n","import \"@inter-ikea-kompis/component-price-formatter/lib/components/price-formatter/PriceFormatter\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisPriceFormatter extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-price-formatter\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.amount = props.amount;\n element.animated = props.animated;\n element.ariaLabelPrice = props.ariaLabelPrice;\n element.currencySymbol = props.currencySymbol;\n element.localizedInformation = props.localizedInformation;\n element.mixedSize = props.mixedSize;\n element.settings = props.settings;\n element.strikeThrough = props.strikeThrough;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisPriceFormatter.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n amount: PropTypes.number.isRequired,\n animated: PropTypes.bool,\n ariaLabelPrice: PropTypes.string,\n currencySymbol: PropTypes.string,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n mixedSize: PropTypes.bool,\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n strikeThrough: PropTypes.bool\n};\nexport default KompisPriceFormatter;\n","import \"@inter-ikea-kompis/component-price-module/lib/components/price-module/PriceModule\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisPriceModule extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-price-module\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.animated = props.animated;\n element.disableFocusStyle = props.disableFocusStyle;\n element.disableLinks = props.disableLinks;\n element.isCombinedProduct = props.isCombinedProduct;\n element.isFromPrice = props.isFromPrice;\n element.layout = props.layout;\n element.localizedInformation = props.localizedInformation;\n element.productLink = props.productLink;\n element.productName = props.productName;\n element.settings = props.settings;\n element.shoppingProducts = props.shoppingProducts;\n element.showEcoFee = props.showEcoFee;\n element.showEnergyLabel = props.showEnergyLabel;\n element.showLowestPreviousSalesPrice = props.showLowestPreviousSalesPrice;\n element.showPriceExclTax = props.showPriceExclTax;\n element.showPriceUnit = props.showPriceUnit;\n element.showRepairabilityIndex = props.showRepairabilityIndex;\n element.theme = props.theme;\n element.translations = props.translations;\n element.underline = props.underline;\n element.visibleModal = props.visibleModal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n this.updateEventListener(element, props.onProductNameClick, \"productNameClick\");\n }\n}\nKompisPriceModule.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n animated: PropTypes.bool,\n disableFocusStyle: PropTypes.bool,\n disableLinks: PropTypes.bool,\n isCombinedProduct: PropTypes.bool,\n isFromPrice: PropTypes.bool,\n layout: PropTypes.string,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n productLink: PropTypes.string,\n productName: PropTypes.string,\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n shoppingProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n showEcoFee: PropTypes.bool,\n showEnergyLabel: PropTypes.bool,\n showLowestPreviousSalesPrice: PropTypes.bool,\n showPriceExclTax: PropTypes.bool,\n showPriceUnit: PropTypes.bool,\n showRepairabilityIndex: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n underline: PropTypes.bool,\n visibleModal: PropTypes.string,\n onProductNameClick: PropTypes.func,\n onModalClose: PropTypes.func,\n onModalOpen: PropTypes.func\n};\nexport default KompisPriceModule;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FunctionIconEnum = exports.FunctionIcon = void 0;\nconst FunctionIcon_1 = __importDefault(require(\"./components/function-icon/FunctionIcon\"));\nexports.FunctionIcon = FunctionIcon_1.default;\nconst FunctionIconEnum_1 = __importDefault(require(\"./enums/FunctionIconEnum\"));\nexports.FunctionIconEnum = FunctionIconEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HomeDeliveryUtility = exports.HomeDeliveryToastMessage = exports.HomeDeliveryStateEnum = exports.HomeDeliveryStartOverEventEnum = exports.HomeDeliveryModalEnum = exports.HomeDeliveryLinkStateEnum = exports.HomeDeliveryLink = exports.HomeDeliveryCard = exports.HomeDeliveryAvailabilityEnum = exports.HomeDelivery = void 0;\nconst component_zip_in_1 = require(\"@inter-ikea-kompis/component-zip-in\");\nObject.defineProperty(exports, \"HomeDeliveryToastMessage\", { enumerable: true, get: function () { return component_zip_in_1.ZipInToastMessage; } });\nconst HomeDelivery_1 = __importDefault(require(\"./components/home-delivery/HomeDelivery\"));\nexports.HomeDelivery = HomeDelivery_1.default;\nconst HomeDeliveryCard_1 = __importDefault(require(\"./components/home-delivery-card/HomeDeliveryCard\"));\nexports.HomeDeliveryCard = HomeDeliveryCard_1.default;\nconst HomeDeliveryLink_1 = __importDefault(require(\"./components/home-delivery-link/HomeDeliveryLink\"));\nexports.HomeDeliveryLink = HomeDeliveryLink_1.default;\nconst HomeDeliveryAvailabilityEnum_1 = __importDefault(require(\"./enums/HomeDeliveryAvailabilityEnum\"));\nexports.HomeDeliveryAvailabilityEnum = HomeDeliveryAvailabilityEnum_1.default;\nconst HomeDeliveryLinkStateEnum_1 = __importDefault(require(\"./enums/HomeDeliveryLinkStateEnum\"));\nexports.HomeDeliveryLinkStateEnum = HomeDeliveryLinkStateEnum_1.default;\nconst HomeDeliveryModalEnum_1 = __importDefault(require(\"./enums/HomeDeliveryModalEnum\"));\nexports.HomeDeliveryModalEnum = HomeDeliveryModalEnum_1.default;\nconst HomeDeliveryStartOverEventEnum_1 = __importDefault(require(\"./enums/HomeDeliveryStartOverEventEnum\"));\nexports.HomeDeliveryStartOverEventEnum = HomeDeliveryStartOverEventEnum_1.default;\nconst HomeDeliveryStateEnum_1 = __importDefault(require(\"./enums/HomeDeliveryStateEnum\"));\nexports.HomeDeliveryStateEnum = HomeDeliveryStateEnum_1.default;\nconst HomeDeliveryUtility_1 = __importDefault(require(\"./utilities/HomeDeliveryUtility\"));\nexports.HomeDeliveryUtility = HomeDeliveryUtility_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('store', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M22 20V4H2v16h20zM20 6H4v12h3v-8h10v8h3V6zm-9 6H9v6h2v-6zm2 6h2v-6h-2v6z' } }]);\n","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@ingka/choice-webc\");\n/**\n * The view for the StoreSelector.\n *\n * @event change Triggered when selected store is changed.\n */\nlet StoreSelectorCard = class StoreSelectorCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // Stores.\n this.stores = null;\n // Selected store id.\n this.storeId = null;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n if (!this.stores || !this.stores.length) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t${this.getHeading()}${this.getChoice()}\n\t\t`;\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n getHeading() {\n return (0, web_component_1.html) `

    \n\t\t\t${this.getTranslations().storeSelectorTitle}\n\t\t

    `;\n }\n getChoice() {\n var _a;\n const noneSelectedFakeStore = {\n name: this.getTranslations().storeSelectorNoneSelected,\n id: null\n };\n const stores = [noneSelectedFakeStore, ...((_a = this.stores) !== null && _a !== void 0 ? _a : [])];\n return (0, web_component_1.html) `${stores.map((store) => this.getChoiceItem(store))} `;\n }\n getChoiceItem(store) {\n return (0, web_component_1.html) `\n\t\t\t {\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, detail: { storeId: store.id } }));\n }}\"\n\t\t\t\t.selected=\"${this.storeId === store.id}\"\n\t\t\t>\n\t\t\t\t${store.name}\n\t\t\t\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], StoreSelectorCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], StoreSelectorCard.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], StoreSelectorCard.prototype, \"stores\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], StoreSelectorCard.prototype, \"storeId\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], StoreSelectorCard.prototype, \"theme\", void 0);\nStoreSelectorCard = __decorate([\n (0, web_component_1.customElement)('kompis-store-selector-card')\n], StoreSelectorCard);\nexports.default = StoreSelectorCard;\n//# sourceMappingURL=StoreSelectorCard.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar StoreSelectorLayoutEnum;\n(function (StoreSelectorLayoutEnum) {\n StoreSelectorLayoutEnum[\"button\"] = \"button\";\n StoreSelectorLayoutEnum[\"link\"] = \"link\";\n})(StoreSelectorLayoutEnum || (StoreSelectorLayoutEnum = {}));\nexports.default = StoreSelectorLayoutEnum;\n//# sourceMappingURL=StoreSelectorLayoutEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar StoreSelectorModalEnum;\n(function (StoreSelectorModalEnum) {\n StoreSelectorModalEnum[\"storeSelectorCard\"] = \"storeSelectorCard\";\n})(StoreSelectorModalEnum || (StoreSelectorModalEnum = {}));\nexports.default = StoreSelectorModalEnum;\n//# sourceMappingURL=StoreSelectorModalEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar StoreSelectorTagNameEnum;\n(function (StoreSelectorTagNameEnum) {\n StoreSelectorTagNameEnum[\"button\"] = \"SKAPA-BUTTON\";\n StoreSelectorTagNameEnum[\"hyperlink\"] = \"KOMPIS-HYPERLINK\";\n})(StoreSelectorTagNameEnum || (StoreSelectorTagNameEnum = {}));\nexports.default = StoreSelectorTagNameEnum;\n//# sourceMappingURL=StoreSelectorTagNameEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nclass StoreSelectorStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { color, spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\t.container {\n\t\t\t\tposition: relative;\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\t.linkContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: flex-start;\n\t\t\t\tcolor: ${color.text.default};\n\t\t\t}\n\n\t\t\t.storeAvailabilityContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-wrap: wrap;\n\t\t\t\tmargin-inline-start: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.availabilityLabel {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tflex-wrap: wrap;\n\t\t\t\tmin-height: ${spacing.space150 / 16}rem;\n\t\t\t}\n\n\t\t\t.restock,\n\t\t\t.captionText {\n\t\t\t\twidth: 100%;\n\t\t\t\tcolor: ${color.text.lightest};\n\t\t\t\tmin-height: ${spacing.space150 / 16}rem;\n\t\t\t}\n\n\t\t\tskapa-icon {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\twidth: ${spacing.space150 / 16}rem;\n\t\t\t\theight: ${spacing.space150 / 16}rem;\n\t\t\t\tcolor: ${color.icon.default};\n\t\t\t}\n\n\t\t\tkompis-hyperlink {\n\t\t\t\twhite-space: normal;\n\t\t\t}\n\n\t\t\tskapa-status {\n\t\t\t\twhite-space: pre-wrap;\n\t\t\t}\n\n\t\t\tskapa-status.status-hidden {\n\t\t\t\t--size: 0;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = StoreSelectorStyle;\n//# sourceMappingURL=StoreSelectorStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst utilities_2 = require(\"@inter-ikea-kompis/utilities\");\nconst component_hyperlink_1 = require(\"@inter-ikea-kompis/component-hyperlink\");\nconst component_sheet_1 = require(\"@inter-ikea-kompis/component-sheet\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@ingka/status-webc\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/modal-webc\");\nrequire(\"@ingka/icon-store/store\");\nrequire(\"../store-selector-card/StoreSelectorCard\");\nconst StoreSelectorLayoutEnum_1 = __importDefault(require(\"../../enums/StoreSelectorLayoutEnum\"));\nconst StoreSelectorModalEnum_1 = __importDefault(require(\"../../enums/StoreSelectorModalEnum\"));\nconst StoreSelectorTagNameEnum_1 = __importDefault(require(\"../../enums/StoreSelectorTagNameEnum\"));\nconst StoreSelectorStyle_1 = __importDefault(require(\"./StoreSelectorStyle\"));\n/**\n * @event change Triggered when selected store is changed.\n * @event modalOpen Triggered when a modal should be opened.\n * @event modalClose Triggered when a modal should be closed.\n */\nlet StoreSelector = class StoreSelector extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Stores.\n this.stores = null;\n // Selected store id.\n this.storeId = null;\n // Layout.\n this.layout = StoreSelectorLayoutEnum_1.default.button;\n // Visible modal.\n this.visibleModal = null;\n // Store availability object.\n this.storeAvailabilities = null;\n // Sheet alignment\n this.sheetAlignment = component_sheet_1.SheetAlignmentEnum.right; // Replace with SheetAlignmentEnum in enums package when removing kompis-sheet.\n // Accessibility description that will be set as an \"aria-label\" attribute on the store selector sheet.\n this.ariaLabel = null;\n this.sheetElement = null;\n this.triggerElement = null;\n this.dexfSettings = null;\n }\n /**\n * Renders the component.\n *\n * @returns TemplateResult.\n */\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n if (!this.stores || (this.stores && this.stores.length === 0)) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    ${this.getLayoutElement()}
    \n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.closeSheet();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n if (changedProperties.has('visibleModal')) {\n if (this.visibleModal === StoreSelectorModalEnum_1.default.storeSelectorCard) {\n this.openSheet();\n }\n else {\n this.closeSheet();\n }\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n getSettings() {\n return this.dexfSettings;\n }\n /**\n * Returns a link or button element based on the layout property value.\n *\n * @returns TemplateResult.\n */\n getLayoutElement() {\n const isLinkLayout = this.layout === StoreSelectorLayoutEnum_1.default.link;\n if (isLinkLayout) {\n return this.getLink();\n }\n return this.getButton();\n }\n /**\n * Returns the button layout element.\n *\n * @returns TemplateResult.\n */\n getButton() {\n const store = this.getStore();\n const secondaryVariant = 'secondary';\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t\n\t\t\t\t${store ? store.name : this.getTranslations().storeSelectorTitle}\n\t\t\t\n\t\t`;\n }\n getStoreAriaLabel(store) {\n if (!(store === null || store === void 0 ? void 0 : store.name)) {\n return ''; // use label instead of aria label\n }\n return this.getTranslations()\n .storeSelectorAriaLabelSelectedStore.replace('[[store]]', store.name)\n .replace('{{store}}', store.name);\n }\n /**\n * Returns the link layout element.\n *\n * @returns TemplateResult.\n */\n getLink() {\n const storeAvailabilityTranslation = this.getStoreAvailabilityTranslation();\n const labels = [\n this.getAvailabilityLabel(storeAvailabilityTranslation),\n this.getOrderItemCaptionText()\n ];\n if (storeAvailabilityTranslation) {\n labels.push(this.getRestockMessage()); // TODO\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n }\n /**\n * Will show captionText for StoreSelector when a storeAvailabilties is one item.\n *\n * @returns TemplateResult | null.\n */\n getOrderItemCaptionText() {\n const isOrderItem = this.getStoreAvailabilityStatus() === enums_1.StoreAvailabilityProbabilityEnum.orderItemSingle;\n if (!isOrderItem) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t${this.getTranslations().storeAvailabilityOrderItemsCaption}\n\t\t`;\n }\n getAvailabilityLabel(storeAvailabilityTranslation) {\n const store = this.getStore();\n const ariaLabel = storeAvailabilityTranslation && (store === null || store === void 0 ? void 0 : store.name)\n ? storeAvailabilityTranslation\n .replace('[[store]]', store.name)\n .replace('{{store}}', store.name)\n : this.getStoreAriaLabel(store);\n const hyperlink = this.getHyperlink(store ? store.name : this.getTranslations().storeSelectorCheckAvailabilityInStore, ariaLabel);\n const storeAvailabilityTranslations = (storeAvailabilityTranslation === null || storeAvailabilityTranslation === void 0 ? void 0 : storeAvailabilityTranslation.includes('{{store}}'))\n ? storeAvailabilityTranslation.split('{{store}}')\n : storeAvailabilityTranslation === null || storeAvailabilityTranslation === void 0 ? void 0 : storeAvailabilityTranslation.split('[[store]]');\n // Since the translations are included in the aria label of the hyperlink, we should aria hide the visual text.\n const prefix = this.wrapInAriaHiddenIfPresent(storeAvailabilityTranslations === null || storeAvailabilityTranslations === void 0 ? void 0 : storeAvailabilityTranslations[0]);\n const suffix = this.wrapInAriaHiddenIfPresent(storeAvailabilityTranslations === null || storeAvailabilityTranslations === void 0 ? void 0 : storeAvailabilityTranslations[1]);\n const label = (0, web_component_1.html) `${prefix}${hyperlink}${suffix}`;\n const statusIndicator = this.getStatusIndicator(label);\n return (0, web_component_1.html) `
    ${statusIndicator}
    `;\n }\n getStatusIndicator(label) {\n const color = this.getStatusIndicatorColor();\n const showStatus = this.getStore() && color;\n return (0, web_component_1.html) `\n\t\t\t${label}\n\t\t`;\n }\n wrapInAriaHiddenIfPresent(text, className) {\n return text\n ? (0, web_component_1.html) `${text}`\n : null;\n }\n getHyperlink(label, ariaLabel) {\n return (0, web_component_1.html) ``;\n }\n getRestockMessage() {\n var _a, _b, _c;\n // Restock message is only intended for single articles.\n if (((_a = this.storeAvailabilities) === null || _a === void 0 ? void 0 : _a.length) !== 1) {\n return null;\n }\n const storeAvailability = this.storeAvailabilities[0];\n const restock = (_c = (_b = storeAvailability === null || storeAvailability === void 0 ? void 0 : storeAvailability.content) === null || _b === void 0 ? void 0 : _b.cashCarry) === null || _c === void 0 ? void 0 : _c.restock;\n const availabilityStatus = this.storeAvailabilities &&\n utilities_2.AvailabilityUtility.getStoreAvailabilityStatus(this.storeAvailabilities);\n if (availabilityStatus === enums_1.StoreAvailabilityProbabilityEnum.outOfStock && restock) {\n const restockEarliestDate = utilities_1.DateFormatter.isoStringToDate(restock.earliestDateText);\n const restockLatestDate = utilities_1.DateFormatter.isoStringToDate(restock.latestDateText);\n const formattedRestockEarliestDate = utilities_1.DateFormatter.dateToString(restockEarliestDate, this.getSettings().localisation.dateFormat);\n const formattedRestockLatestDate = utilities_1.DateFormatter.dateToString(restockLatestDate, this.getSettings().localisation.dateFormat);\n const restockMessage = this.getTranslations()\n .storeAvailabilityBackInStockDates.replace('[[dateFrom]]', formattedRestockEarliestDate)\n .replace('{{dateFrom}}', formattedRestockEarliestDate)\n .replace('[[dateTo]]', formattedRestockLatestDate)\n .replace('{{dateTo}}', formattedRestockLatestDate);\n return (0, web_component_1.html) `
    ${restockMessage}
    `;\n }\n return null;\n }\n getStatusIndicatorColor() {\n const availabilityStatus = this.storeAvailabilities &&\n utilities_2.AvailabilityUtility.getStoreAvailabilityStatus(this.storeAvailabilities);\n return availabilityStatus && utilities_2.AvailabilityUtility.getStoreAvailabilityColor(availabilityStatus);\n }\n closeSheet() {\n if (this.sheetElement) {\n this.sheetElement.open = false;\n this.sheetElement = null;\n }\n }\n openSheet() {\n if (this.sheetElement) {\n return;\n }\n const sheetElement = this.createSheetElement();\n this.sheetElement = sheetElement;\n const parent = document.querySelector('kompis-keyboard-injector') || document.body;\n parent.appendChild(sheetElement);\n sheetElement.open = true;\n }\n createSheetElement() {\n const sheetElement = this.createSheet();\n const sheetHeaderElement = this.createSheetHeader();\n const storeSelectorCardElement = this.createCard();\n sheetElement.appendChild(sheetHeaderElement);\n sheetElement.appendChild(storeSelectorCardElement);\n return sheetElement;\n }\n createSheet() {\n const sheetElement = document.createElement('skapa-sheet');\n const ariaLabel = this.ariaLabel ? this.ariaLabel : this.getTranslations().storeSelectorTitle;\n sheetElement.setAttribute('aria-label', ariaLabel);\n sheetElement.size = 'small';\n sheetElement.fullHeight = true;\n sheetElement.alignToStart = this.sheetAlignment === component_sheet_1.SheetAlignmentEnum.left;\n sheetElement.style.fontFamily = themes_1.FontStyle.getFontFamily(this.theme);\n sheetElement.style.zIndex = '500';\n sheetElement.addEventListener('closerequest', () => {\n if (this.sheetElement) {\n this.dispatchEvent(new CustomEvent('modalClose', {\n bubbles: true,\n detail: {\n visibleModal: null,\n triggerElement: this.triggerElement\n }\n }));\n }\n });\n sheetElement.addEventListener('closed', () => {\n var _a;\n (_a = sheetElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(sheetElement);\n });\n return sheetElement;\n }\n createSheetHeader() {\n const sheetHeaderElement = document.createElement('skapa-modal-header');\n sheetHeaderElement.slot = 'header';\n const headerSpan = document.createElement('span');\n headerSpan.slot = 'closebutton-label';\n headerSpan.innerText = this.getTranslations().modalAriaLabelButtonClose;\n sheetHeaderElement.appendChild(headerSpan);\n return sheetHeaderElement;\n }\n createCard() {\n const cardElement = document.createElement('kompis-store-selector-card');\n cardElement.theme = this.theme;\n cardElement.localizedInformation = this.localizedInformation;\n cardElement.translations = this.translations;\n cardElement.stores = this.stores;\n cardElement.storeId = this.storeId;\n cardElement.addEventListener('change', (event) => {\n this.dispatchEvent(new CustomEvent('change', {\n bubbles: true,\n detail: {\n storeId: event.detail.storeId,\n visibleModal: null,\n triggerElement: this.triggerElement\n }\n }));\n });\n return cardElement;\n }\n /**\n * Returns a store from the stores property through the storeId property.\n *\n * @returns IStore or null.\n */\n getStore() {\n var _a;\n return ((_a = this.stores) === null || _a === void 0 ? void 0 : _a.find((store) => store.id === this.storeId)) || null;\n }\n getStoreAvailabilityStatus() {\n return (this.storeAvailabilities &&\n utilities_2.AvailabilityUtility.getStoreAvailabilityStatus(this.storeAvailabilities));\n }\n /**\n * Returns the store availability translation.\n *\n * @returns Store availability translation string.\n */\n getStoreAvailabilityTranslation() {\n if (!this.getStore()) {\n return null;\n }\n const status = this.getStoreAvailabilityStatus();\n return utilities_2.AvailabilityUtility.getStoreAvailabilityTranslation(status, this.getTranslations());\n }\n /**\n * Dispatches a modalOpen event.\n *\n * @param event\n */\n dispatchModalOpenEvent(event) {\n const triggerElement = this.setTriggerElement(event.target);\n this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: {\n visibleModal: StoreSelectorModalEnum_1.default.storeSelectorCard,\n triggerElement\n }\n }));\n }\n /**\n * @param target\n */\n setTriggerElement(target) {\n if (target instanceof Element) {\n this.triggerElement = this.getTriggerElement(target);\n }\n return this.triggerElement;\n }\n /**\n * @param element\n */\n getTriggerElement(element) {\n if (element.tagName === StoreSelectorTagNameEnum_1.default.button) {\n return this.queryButtonElement(element);\n }\n if (element.tagName === StoreSelectorTagNameEnum_1.default.hyperlink) {\n return this.queryHyperlinkElement(element);\n }\n return null;\n }\n /**\n * Function for querying the button-element within a kompis-button element.\n *\n * @param element\n */\n queryButtonElement(element) {\n const button = element.shadowRoot.querySelector('button');\n return button;\n }\n /**\n * Function for querying the hyperlink element within the composed text layout.\n *\n * @param element\n */\n queryHyperlinkElement(element) {\n var _a, _b;\n return (_b = (_a = element.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('kompis-focus-outline > a')) !== null && _b !== void 0 ? _b : null;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], StoreSelector.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], StoreSelector.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], StoreSelector.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], StoreSelector.prototype, \"stores\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], StoreSelector.prototype, \"storeId\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], StoreSelector.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], StoreSelector.prototype, \"layout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], StoreSelector.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], StoreSelector.prototype, \"storeAvailabilities\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], StoreSelector.prototype, \"sheetAlignment\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], StoreSelector.prototype, \"ariaLabel\", void 0);\nStoreSelector = __decorate([\n (0, web_component_1.customElement)('kompis-store-selector')\n], StoreSelector);\nexports.default = StoreSelector;\n//# sourceMappingURL=StoreSelector.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreSelectorModalEnum = exports.StoreSelectorLayoutEnum = exports.StoreSelectorCard = exports.StoreSelector = void 0;\nconst StoreSelector_1 = __importDefault(require(\"./components/store-selector/StoreSelector\"));\nexports.StoreSelector = StoreSelector_1.default;\nconst StoreSelectorCard_1 = __importDefault(require(\"./components/store-selector-card/StoreSelectorCard\"));\nexports.StoreSelectorCard = StoreSelectorCard_1.default;\nconst StoreSelectorLayoutEnum_1 = __importDefault(require(\"./enums/StoreSelectorLayoutEnum\"));\nexports.StoreSelectorLayoutEnum = StoreSelectorLayoutEnum_1.default;\nconst StoreSelectorModalEnum_1 = __importDefault(require(\"./enums/StoreSelectorModalEnum\"));\nexports.StoreSelectorModalEnum = StoreSelectorModalEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nclass MeasurementsCardStyle {\n static getStyle(options) {\n const { spacing, color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\n\t\t\t.measurements {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\tmargin-bottom: ${spacing.space150 / 16}rem;\n\t\t\t}\n\n\t\t\t.typeName {\n\t\t\t\tcolor: ${color.neutral.grey700};\n\t\t\t}\n\n\t\t\t.images > *:not(:last-child) {\n\t\t\t\tmargin-bottom: ${spacing.space250 / 16}rem;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = MeasurementsCardStyle;\n//# sourceMappingURL=MeasurementsCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst utilities_2 = require(\"@inter-ikea-kompis/utilities\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@ingka/image-webc\");\nconst MeasurementsCardStyle_1 = __importDefault(require(\"./MeasurementsCardStyle\"));\n/**\n * This is the MeasurementsCard sub component to Product Information Section.\n *\n * Used to display all different measurements along with a illustration of the measurements.\n */\nlet MeasurementsCard = class MeasurementsCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n this.dexfSettings = null;\n }\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n const headingTextClass = common_styles_webc_1.Text.classnames({ heading: { m: true } });\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t
    \n\t\t\t\t

    \n\t\t\t\t\t${this.getTranslations().productCardMeasurementTitle}\n\t\t\t\t

    \n\n\t\t\t\t
    ${this.getProductMeasurements()}
    \n\t\t\t\t${this.getProductMeasurementIllustration()}\n\t\t\t
    \n\t\t`;\n }\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n getSettings() {\n return this.dexfSettings;\n }\n getProductMeasurements() {\n const productMeasurements = utilities_1.ProductDescriptionUtility.getProductMeasures({\n settings: this.getSettings(),\n product: this.product,\n productMeasures: utilities_1.ProductDescriptionProductMeasureEnum.array\n });\n if (!productMeasurements) {\n return null;\n }\n const headingTextClass = common_styles_webc_1.Text.classnames({ heading: { xs: true } });\n const bodyTextClass = common_styles_webc_1.Text.classnames({ body: { m: true } });\n return productMeasurements.map(({ typeName, measure }) => {\n return (0, web_component_1.html) `\n\t\t\t\t\n\t\t\t\t\t${typeName}:\n\t\t\t\t\t${measure}\n\t\t\t\t\n\t\t\t`;\n });\n }\n constructAltTextFromProduct() {\n var _a, _b, _c;\n if (!((_a = this.product) === null || _a === void 0 ? void 0 : _a.content)) {\n return '';\n }\n const { name, typeName, validDesignText, measureReference } = this.product.content;\n const useMetricMeasures = this.getSettings().localisation.useMetricMeasures;\n return `\n\t\t\t${name} ${typeName} ${validDesignText}, ${useMetricMeasures\n ? `${(_b = measureReference === null || measureReference === void 0 ? void 0 : measureReference.textMetric) !== null && _b !== void 0 ? _b : ''}`\n : `${(_c = measureReference === null || measureReference === void 0 ? void 0 : measureReference.textImperial) !== null && _c !== void 0 ? _c : ''}`}\n\t\t`.trim();\n }\n getProductMeasurementIllustration() {\n const productImages = utilities_2.ProductUtility.getProductImages(this.product, enums_1.ImageTypeNameEnum.measurementIllustration).filter((productImage) => productImage.size === enums_1.ImageSizeTypeEnum.S5);\n if (!productImages || productImages.length === 0) {\n return null;\n }\n if (productImages.length === 1) {\n return (0, web_component_1.html) `\n\t\t\t\t\n\t\t\t\t\n\t\t\t`;\n }\n else {\n return (0, web_component_1.html) `\n\t\t\t\t
    \n\t\t\t\t\t${productImages.map((image) => {\n return (0, web_component_1.html) `\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t`;\n })}\n\t\t\t\t
    \n\t\t\t`;\n }\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], MeasurementsCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MeasurementsCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MeasurementsCard.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], MeasurementsCard.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], MeasurementsCard.prototype, \"product\", void 0);\nMeasurementsCard = __decorate([\n (0, web_component_1.customElement)('kompis-measurements-card')\n], MeasurementsCard);\nexports.default = MeasurementsCard;\n//# sourceMappingURL=MeasurementsCard.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass WoodDeclarationCardStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { color, spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\t\t\tkompis-text {\n\t\t\t\tcolor: ${color.text.default};\n\t\t\t}\n\t\t\t.row {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\tmargin-bottom: ${spacing.space100 / 16}rem;\n\t\t\t}\n\t\t\t.row:last-child {\n\t\t\t\tmargin-bottom: 0;\n\t\t\t}\n\t\t\t.woodDeclarationHeader {\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t\tpadding-bottom: ${spacing.space150 / 16}rem;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = WoodDeclarationCardStyle;\n//# sourceMappingURL=WoodDeclarationCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst lib_1 = require(\"@inter-ikea-kompis/enums/lib\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@inter-ikea-kompis/component-text\");\nconst WoodDeclarationCardStyle_1 = __importDefault(require(\"./WoodDeclarationCardStyle\"));\nconst WOOD_DECLARATION_CODE = '00692';\n/**\n * Wood declaration card sub component.\n */\nlet WoodDeclarationCard = class WoodDeclarationCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Show type of wood header.\n this.showHeader = false;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n var _a, _b, _c;\n if (!((_c = (_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.complianceInformation) === null || _c === void 0 ? void 0 : _c.find((compliance) => compliance.datasetCode === WOOD_DECLARATION_CODE))) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    ${this.getWoodDeclarationHeader()}${this.getWoodDeclaration()}
    \n\t\t`;\n }\n /**\n * Returns the wood type and country of harvest from the product data.\n */\n getWoodDeclaration() {\n var _a, _b, _c;\n const woodDeclarationInformation = (_c = (_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.complianceInformation) === null || _c === void 0 ? void 0 : _c.filter((info) => info.datasetCode === WOOD_DECLARATION_CODE).map((info) => info.text);\n if (!woodDeclarationInformation) {\n return null;\n }\n // Match 0 = Everything.\n // Match 1 = Tree name.\n // Match 2 = Scientific tree name.\n // Match 3 = Country header.\n // Match 4 = Countries.\n const regexp = /[^;]*;([^(]+)\\(([^)]+)[^;]*;([^:]+):[ ]*(.+)/;\n return woodDeclarationInformation.map((info) => {\n const match = info.match(regexp) || '';\n return (0, web_component_1.html) `
    \n\t\t\t\t${this.getComplianceHeader({\n name: match[1],\n scientificName: match[2]\n })}${this.getComplianceData({\n header: match[3],\n countries: match[4]\n })}\n\t\t\t
    `;\n });\n }\n /**\n * Returns the wood declaration.\n *\n * @param header Tree type Header.\n * @param options Options.\n * @param options.name Tree name.\n * @param options.scientificName Scientific tree name.\n */\n getComplianceHeader(options) {\n return (0, web_component_1.html) `${`${options.name} (${options.scientificName})`}`;\n }\n /**\n * Returns the country of harvest data.\n *\n * @param options Options.\n * @param options.header Country of harvest header.\n * @param options.countries Countries.\n */\n getComplianceData(options) {\n const lowerCaseCountries = options.countries\n .split(',')\n .map((country) => utilities_1.StringUtility.capitalizeFirstLetter(country.trim().toLocaleLowerCase()))\n .join(', ');\n return (0, web_component_1.html) `${`${options.header.trim()}: ${lowerCaseCountries}`}`;\n }\n /**\n * Returns header for accordion from data.\n */\n getWoodDeclarationHeader() {\n var _a, _b, _c;\n if (!this.showHeader) {\n return '';\n }\n const header = ((_c = (_b = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.complianceInformation) === null || _b === void 0 ? void 0 : _b.find((compliance) => compliance.headingText)) === null || _c === void 0 ? void 0 : _c.headingText) || null;\n if (!header) {\n return '';\n }\n return (0, web_component_1.html) `${header}`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], WoodDeclarationCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], WoodDeclarationCard.prototype, \"product\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], WoodDeclarationCard.prototype, \"showHeader\", void 0);\nWoodDeclarationCard = __decorate([\n (0, web_component_1.customElement)('kompis-wood-declaration-card')\n], WoodDeclarationCard);\nexports.default = WoodDeclarationCard;\n//# sourceMappingURL=WoodDeclarationCard.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass WoodDeclarationStyle {\n /**\n * Returns styles.\n *\n * @returns Styles.\n */\n static getStyle() {\n return (0, web_component_1.css) `\n\t\t\tkompis-accordion-item-padding {\n\t\t\t\tpadding-top: 0;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = WoodDeclarationStyle;\n//# sourceMappingURL=WoodDeclarationStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nrequire(\"@inter-ikea-kompis/component-accordion\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"../wood-declaration-card/WoodDeclarationCard\");\nconst WoodDeclarationStyle_1 = __importDefault(require(\"./WoodDeclarationStyle\"));\nconst WOOD_DECLARATION_CODE = '00692';\n/**\n * Wood declaration component.\n *\n * @event woodDeclarationExpand Triggered when accordion is clicked.\n */\nlet WoodDeclaration = class WoodDeclaration extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Expands the accordion.\n this.woodDeclarationExpanded = false;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n var _a, _b, _c;\n if (!((_c = (_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.complianceInformation) === null || _c === void 0 ? void 0 : _c.find((compliance) => compliance.datasetCode === WOOD_DECLARATION_CODE))) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * Dispatched event for when the accordion expands.\n */\n onAccordionExpand() {\n this.dispatchEvent(new CustomEvent('woodDeclarationExpand', {\n detail: { expand: !this.woodDeclarationExpanded },\n bubbles: true\n }));\n }\n /**\n * Returns header for accordion from data.\n */\n getHeader() {\n var _a, _b, _c;\n const header = (_c = (_b = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.complianceInformation) === null || _b === void 0 ? void 0 : _b.find((compliance) => compliance.datasetCode === WOOD_DECLARATION_CODE)) === null || _c === void 0 ? void 0 : _c.headingText;\n return header || '';\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], WoodDeclaration.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], WoodDeclaration.prototype, \"woodDeclarationExpanded\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], WoodDeclaration.prototype, \"product\", void 0);\nWoodDeclaration = __decorate([\n (0, web_component_1.customElement)('kompis-wood-declaration')\n], WoodDeclaration);\nexports.default = WoodDeclaration;\n//# sourceMappingURL=WoodDeclaration.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WoodDeclarationCard = exports.WoodDeclaration = void 0;\nconst WoodDeclaration_1 = __importDefault(require(\"./components/wood-declaration/WoodDeclaration\"));\nexports.WoodDeclaration = WoodDeclaration_1.default;\nconst WoodDeclarationCard_1 = __importDefault(require(\"./components/wood-declaration-card/WoodDeclarationCard\"));\nexports.WoodDeclarationCard = WoodDeclarationCard_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ProductInformationExpandedAccordionEnum;\n(function (ProductInformationExpandedAccordionEnum) {\n ProductInformationExpandedAccordionEnum[\"goodToKnow\"] = \"goodToKnow\";\n ProductInformationExpandedAccordionEnum[\"materialsAndCare\"] = \"materialsAndCare\";\n ProductInformationExpandedAccordionEnum[\"safetyAndCompliance\"] = \"safetyAndCompliance\";\n ProductInformationExpandedAccordionEnum[\"sustainabilityAndEnvironment\"] = \"sustainabilityAndEnvironment\";\n})(ProductInformationExpandedAccordionEnum || (ProductInformationExpandedAccordionEnum = {}));\nexports.default = ProductInformationExpandedAccordionEnum;\n//# sourceMappingURL=ProductInformationExpandedAccordionEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ProductInformationSectionSecurityAndComplianceEnum;\n(function (ProductInformationSectionSecurityAndComplianceEnum) {\n ProductInformationSectionSecurityAndComplianceEnum[\"warning\"] = \"Warning\";\n ProductInformationSectionSecurityAndComplianceEnum[\"safetyInformation\"] = \"Safety Information\";\n ProductInformationSectionSecurityAndComplianceEnum[\"ageRecommendation\"] = \"Age recommendations\";\n ProductInformationSectionSecurityAndComplianceEnum[\"testResultsAndCompliance\"] = \"Test results and compliance\";\n})(ProductInformationSectionSecurityAndComplianceEnum || (ProductInformationSectionSecurityAndComplianceEnum = {}));\nexports.default = ProductInformationSectionSecurityAndComplianceEnum;\n//# sourceMappingURL=ProductInformationSectionSecurityAndComplianceEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nclass ProductDetailsCardStyle {\n /**\n * @param options Options object.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing, color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\n\t\t\tskapa-product-identifier {\n\t\t\t\tmargin-bottom: ${spacing.space300 / 16}rem;\n\t\t\t}\n\n\t\t\tkompis-accordion-item-padding {\n\t\t\t\tpadding-top: 0;\n\t\t\t\tpadding-bottom: 0;\n\t\t\t}\n\n\t\t\t.header {\n\t\t\t\tdisplay: flex;\n\t\t\t\tmargin-bottom: ${spacing.space100 / 16}rem !important;\n\t\t\t}\n\n\t\t\t.distanceSelling {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\tmargin-bottom: ${spacing.space200 / 16}rem !important;\n\t\t\t}\n\n\t\t\t.textTypeSubHeading {\n\t\t\t\tmargin-block-start: 0;\n\t\t\t\tmargin-block-end: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.goodToKnow > span:not(:last-child),\n\t\t\t.customerMaterial > span:not(:last-child),\n\t\t\t.safetyAndCompliance > span:not(:last-child),\n\t\t\t.careInstruction > span:not(:last-child),\n\t\t\t.sustainabilityAndEnvironment > span:not(:last-child),\n\t\t\t.customerBenefits > span:not(:last-child) {\n\t\t\t\tdisplay: flex;\n\t\t\t\tmargin-bottom: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.goodToKnow,\n\t\t\t.safetyAndCompliance,\n\t\t\t.sustainabilityAndEnvironment,\n\t\t\t.customerBenefits,\n\t\t\t.customerMaterial span:last-child,\n\t\t\t.careInstruction span:last-child,\n\t\t\tkompis-wood-declaration-card,\n\t\t\tkompis-divider {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\tmargin-bottom: ${spacing.space150 / 16}rem;\n\t\t\t}\n\n\t\t\t.customerMaterial span.textPart {\n\t\t\t\tcolor: ${color.text.default};\n\t\t\t\tmargin-bottom: 0rem;\n\t\t\t}\n\n\t\t\t.materialAndCareHeader {\n\t\t\t\tdisplay: flex;\n\t\t\t\tmargin-bottom: ${spacing.space100 / 16}rem !important;\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\n\t\t\t.customerMaterial {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\t.materialsAndCare {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\t.distanceSellingHeader {\n\t\t\t\tcolor: ${color.text.default};\n\t\t\t}\n\n\t\t\t/* Overrides user agent styling. */\n\t\t\t.header,\n\t\t\t.distanceSellingHeader,\n\t\t\t.materialAndCareHeader,\n\t\t\t.textPart {\n\t\t\t\tmargin-block-end: 0;\n\t\t\t\tmargin-block-start: 0;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = ProductDetailsCardStyle;\n//# sourceMappingURL=ProductDetailsCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\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};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@inter-ikea-kompis/component-accordion\");\nrequire(\"@inter-ikea-kompis/component-divider\");\nrequire(\"@inter-ikea-kompis/component-wood-declaration\");\nrequire(\"@ingka/product-identifier-webc\");\nconst ProductInformationExpandedAccordionEnum_1 = __importDefault(require(\"../../enums/ProductInformationExpandedAccordionEnum\"));\nconst ProductInformationSectionSecurityAndComplianceEnum_1 = __importDefault(require(\"../../enums/ProductInformationSectionSecurityAndComplianceEnum\"));\nconst ProductDetailsCardStyle_1 = __importDefault(require(\"./ProductDetailsCardStyle\"));\n// Manufacturer, Importer & Country of Origin\nconst COUNTRY_OF_ORIGIN_CODES = ['00719', '00759'];\nconst WOOD_DECLARATION_CODE = '00692';\n/**\n * This is the Product details card sub component to Product information section.\n */\nlet ProductDetailsCard = class ProductDetailsCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n this.expandedAccordionIndex = null;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n const headingTextClass = common_styles_webc_1.Text.classnames({ heading: { m: true } });\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t
    \n\t\t\t\t

    \n\t\t\t\t\t${this.getTranslations().productCardProductDetailsTitle}\n\t\t\t\t

    \n\n\t\t\t\t${this.getCustomerBenefits()}${this.getDistanceSellingInformationRequirements()}${this.getArticleNumber()}\n\n\t\t\t\t\n\t\t\t\t\t${this.getGoodToKnowAccordionItem()} ${this.getMaterialAndCareAccordionItem()}\n\t\t\t\t\t${this.getSafetyAndComplianceAccordionItem()}\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n getGoodToKnowAccordionItem() {\n var _a;\n const goodToKnow = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.goodToKnow;\n if (!goodToKnow) {\n return null;\n }\n const filteredGoodToKnow = goodToKnow.filter((item) => !Object.values(ProductInformationSectionSecurityAndComplianceEnum_1.default).includes(item.typeName));\n if (!filteredGoodToKnow || filteredGoodToKnow.length === 0) {\n return null;\n }\n const { productDetailsGoodToKnowHeader } = this.getTranslations();\n return (0, web_component_1.html) `\n\t\t\t {\n this.expandedAccordionIndex = event.detail.expanded\n ? ProductInformationExpandedAccordionEnum_1.default.goodToKnow\n : null;\n this.requestUpdate();\n }}\"\n\t\t\t\t.expanded=${this.expandedAccordionIndex ===\n ProductInformationExpandedAccordionEnum_1.default.goodToKnow}\n\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t.label=\"${productDetailsGoodToKnowHeader}\"\n\t\t\t>\n\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t\t\t${filteredGoodToKnow.map(({ text }) => this.renderBodyText(text))}\n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\n\t\t`;\n }\n /**\n *\tThe \"textType\" property occurs several times, this removes the duplicates to form a rendered group.\n *\n * @param customerMaterial IProductCustomerMaterial[].\n * @returns CustomerMaterial[].\n */\n removeDuplicateTextTypes(customerMaterial) {\n return customerMaterial.reduce((acc, curr) => {\n const textTypeExists = acc.some((product) => product.textType === curr.textType);\n if (textTypeExists) {\n const { textType } = curr, materialItem = __rest(curr, [\"textType\"]);\n acc.push(materialItem);\n }\n else {\n acc.push(curr);\n }\n return acc;\n }, []);\n }\n getTextType(textType) {\n if (!textType) {\n return null;\n }\n const headingTextClass = common_styles_webc_1.Text.classnames({ heading: { xs: true } });\n return (0, web_component_1.html) `

    ${textType}

    `;\n }\n productMaterialHasTextType(product) {\n var _a;\n if (!((_a = product.content) === null || _a === void 0 ? void 0 : _a.customerMaterial)) {\n return false;\n }\n return product.content.customerMaterial.some((material) => material.textType);\n }\n getMaterialAndCareAccordionItem() {\n var _a, _b, _c, _d, _e;\n const customerMaterial = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.customerMaterial;\n const careInstruction = (_b = this.product.content) === null || _b === void 0 ? void 0 : _b.careInstruction;\n const woodDeclaration = (_e = (_d = (_c = this.product) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.complianceInformation) === null || _e === void 0 ? void 0 : _e.find((compliance) => compliance.datasetCode === WOOD_DECLARATION_CODE);\n if (!careInstruction && !customerMaterial && !woodDeclaration) {\n return null;\n }\n const { productDetailsMaterialAndCareCareSubheader, productDetailsMaterialAndCareMaterialSubheader, productDetailsMaterialAndCareInstructionsHeader } = this.getTranslations();\n let customerMaterialHTML = null;\n let careInstructionHTML = null;\n let woodDeclarationHTML = null;\n const headingTextClass = common_styles_webc_1.Text.classnames({ heading: { xs: true } });\n if (customerMaterial) {\n const withTextTypeHeader = this.productMaterialHasTextType(this.product)\n ? this.removeDuplicateTextTypes(customerMaterial)\n : customerMaterial;\n customerMaterialHTML = (0, web_component_1.html) `\n\t\t\t\t
    \n\t\t\t\t\t

    \n\t\t\t\t\t\t${productDetailsMaterialAndCareMaterialSubheader}\n\t\t\t\t\t

    \n\t\t\t\t\t${withTextTypeHeader.map(({ text, textPart, textType = null }) => {\n return (0, web_component_1.html) `${this.getTextType(textType)} ${this.renderBodyText(text, textPart)}`;\n })}\n\t\t\t\t
    \n\t\t\t`;\n }\n if (woodDeclaration) {\n woodDeclarationHTML = (0, web_component_1.html) `\n\t\t\t\t${customerMaterial && (0, web_component_1.html) ``}\n\t\t\t\t\n\t\t\t\t\n\t\t\t`;\n }\n if (careInstruction) {\n careInstructionHTML = (0, web_component_1.html) `\n\t\t\t\t${(woodDeclarationHTML || customerMaterialHTML) &&\n (0, web_component_1.html) ``}\n\t\t\t\t
    \n\t\t\t\t\t

    ${productDetailsMaterialAndCareCareSubheader}

    \n\t\t\t\t\t${careInstruction.map(({ text }) => this.renderBodyText(text))}\n\t\t\t\t
    \n\t\t\t`;\n }\n return (0, web_component_1.html) `\n\t\t\t {\n this.expandedAccordionIndex = event.detail.expanded\n ? ProductInformationExpandedAccordionEnum_1.default.materialsAndCare\n : null;\n this.requestUpdate();\n }}\"\n\t\t\t\t.expanded=${this.expandedAccordionIndex ===\n ProductInformationExpandedAccordionEnum_1.default.materialsAndCare}\n\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t.label=\"${productDetailsMaterialAndCareInstructionsHeader}\"\n\t\t\t>\n\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t\t\t${customerMaterialHTML} ${woodDeclarationHTML} ${careInstructionHTML}\n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\n\t\t`;\n }\n /**\n * The safety and compliance is filtered out from the good to know section with the help of\n * the ProductInformationSectionSecurityAndComplianceEnum.\n */\n getSafetyAndComplianceAccordionItem() {\n var _a, _b;\n const safetyAndCompliance = (_b = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.goodToKnow) === null || _b === void 0 ? void 0 : _b.filter((item) => Object.values(ProductInformationSectionSecurityAndComplianceEnum_1.default).includes(item.typeName));\n if (!safetyAndCompliance || safetyAndCompliance.length === 0) {\n return null;\n }\n const sortOrder = Object.values(ProductInformationSectionSecurityAndComplianceEnum_1.default);\n const sortedSafteyAndCompliance = safetyAndCompliance.sort((a, b) => sortOrder.indexOf(a.typeName) -\n sortOrder.indexOf(b.typeName));\n const { productDetailsSafetyAndComplianceHeader } = this.getTranslations();\n return (0, web_component_1.html) `\n\t\t\t {\n this.expandedAccordionIndex = event.detail.expanded\n ? ProductInformationExpandedAccordionEnum_1.default.safetyAndCompliance\n : null;\n this.requestUpdate();\n }}\"\n\t\t\t\t.expanded=${this.expandedAccordionIndex ===\n ProductInformationExpandedAccordionEnum_1.default.safetyAndCompliance}\n\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t.label=\"${productDetailsSafetyAndComplianceHeader}\"\n\t\t\t>\n\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t\t\t${sortedSafteyAndCompliance.map(({ text }) => this.renderBodyText(text))}\n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\n\t\t`;\n }\n renderBodyText(text, textPart) {\n const bodyTextClass = common_styles_webc_1.Text.classnames({ body: { m: true } });\n const headingTextClass = common_styles_webc_1.Text.classnames({ heading: { xs: true } });\n return (0, web_component_1.html) `\n\t\t\t${textPart ? (0, web_component_1.html) `${textPart}` : null}\n\t\t\t${text}\n\t\t`;\n }\n getCustomerBenefits() {\n var _a, _b;\n const customerBenefit = (_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.customerBenefit;\n if (!customerBenefit) {\n return null;\n }\n const sortedCustomerBenefits = [...customerBenefit].sort((a, b) => {\n return a.sortNo - b.sortNo;\n });\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${sortedCustomerBenefits.map(({ text }) => this.renderBodyText(text))}\n\t\t\t
    \n\t\t`;\n }\n getArticleNumber() {\n var _a, _b, _c, _d;\n if (!((_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.ruItemNo)) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${utilities_1.ProductUtility.formatItemNo((_d = (_c = this.product) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.ruItemNo)}\n\t\t\t\n\t\t`;\n }\n getDistanceSellingInformationRequirements() {\n var _a;\n if (!((_a = this.product.content) === null || _a === void 0 ? void 0 : _a.complianceInformation)) {\n return null;\n }\n return this.product.content.complianceInformation.map((complianceInformation) => {\n if (COUNTRY_OF_ORIGIN_CODES.includes(complianceInformation.datasetCode)) {\n const { headingText, text } = complianceInformation;\n const headingTextClass = common_styles_webc_1.Text.classnames({ heading: { xs: true } });\n // TODO - this modifies all compliance texts. I.e. IKEA becomes Ikea\n // Capitalize compliance text.\n const capitalizedComplianceText = text\n .toLowerCase()\n .replace(/\\b[a-z]/g, (firstLetter) => firstLetter.toUpperCase())\n .replace(/,/g, ', ');\n return (0, web_component_1.html) `\n\t\t\t\t\t
    \n\t\t\t\t\t\t

    ${headingText}

    \n\n\t\t\t\t\t\t${this.renderBodyText(capitalizedComplianceText)}\n\t\t\t\t\t
    \n\t\t\t\t`;\n }\n else {\n return null;\n }\n });\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ProductDetailsCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductDetailsCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductDetailsCard.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ProductDetailsCard.prototype, \"product\", void 0);\nProductDetailsCard = __decorate([\n (0, web_component_1.customElement)('kompis-product-details-card')\n], ProductDetailsCard);\nexports.default = ProductDetailsCard;\n//# sourceMappingURL=ProductDetailsCard.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nclass TechnicalInformationCardStyle {\n /**\n * @param options Options object.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const space100 = options.theme.spacing.space100;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\t\t\t${common_styles_webc_1.Table.CSS}\n\n\t\t\t.header {\n\t\t\t\tdisplay: flex;\n\t\t\t\tmargin-bottom: ${space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.productDescription {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\t/* TODO vertical-align is overriding user agent stylesheet, Skapa doesn't expose this yet. */\n\t\t\ttd {\n\t\t\t\tvertical-align: top;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = TechnicalInformationCardStyle;\n//# sourceMappingURL=TechnicalInformationCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nconst TechnicalInformationCardStyle_1 = __importDefault(require(\"./TechnicalInformationCardStyle\"));\nconst TECHNICAL_INFORMATION_SORT_ORDER = [\n 'BRAND',\n 'MODEL',\n 'PRODUCT_TYPE',\n 'PRODUCT_DESCRIPTION',\n 'ENERGY_STAR',\n 'ENERGY_EFFICIENCY_CLASS',\n 'ENERGY_CONSUMPTION',\n 'CONSUMPTION'\n];\nconst TECHNICAL_INFORMATION_EXCLUDED_HEADINGS = [\n 'PRODUCT_INFO_SHEET',\n 'PRODUCT_FICHE',\n 'HYPERLINK'\n];\n/**\n * This is the technical information card sub component to Product information section.\n */\nlet TechnicalInformationCard = class TechnicalInformationCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n const headingTextClass = common_styles_webc_1.Text.classnames({ heading: { m: true } });\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t
    \n\t\t\t\t

    \n\t\t\t\t\t${this.getTranslations().productCardTechnicalInformationTitle}\n\t\t\t\t

    \n\n\t\t\t\t${this.getProductDescription()}\n\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t${this.getDataRows()}\n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t
    \n\t\t`;\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n /**\n * Retrieves product description if exists.\n */\n getProductDescription() {\n var _a, _b, _c, _d;\n if (!((_a = this.product.content) === null || _a === void 0 ? void 0 : _a.typeName) || !((_c = (_b = this.product) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.name)) {\n return null;\n }\n const headingTextClass = common_styles_webc_1.Text.classnames({ heading: { xs: true } });\n const bodyTextClass = common_styles_webc_1.Text.classnames({ body: { m: true } });\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t

    ${this.product.content.name}

    \n\n\t\t\t\t\n\t\t\t\t\t${utilities_1.StringUtility.capitalizeFirstLetter((_d = this.product.content) === null || _d === void 0 ? void 0 : _d.typeName)}\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * Retrieves data from complianceTechnical or technicalInformation.\n */\n getDataRows() {\n var _a, _b;\n const complianceTechnicalItems = this.getComplianceTechnical();\n const bodyTextClass = common_styles_webc_1.Text.classnames({ body: { m: true } });\n if (complianceTechnicalItems) {\n return (0, web_component_1.html) `\n\t\t\t\t${complianceTechnicalItems.map(({ headingText, text }) => (0, web_component_1.html) `\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t${headingText}\n\t\t\t\t\t\t\t\t${text}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t`)}\n\t\t\t`;\n }\n else {\n return (0, web_component_1.html) `${(_b = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.technicalInformation) === null || _b === void 0 ? void 0 : _b.map(({ typeName, valueMetric, unitMetric = '' }) => (0, web_component_1.html) `\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t${typeName}\n\t\t\t\t\t\t\t${valueMetric} ${unitMetric}\n\t\t\t\t\t\t\n\t\t\t\t\t`)}`;\n }\n }\n /**\n * Retrieves all objects in complianceTechnical.\n */\n getComplianceTechnical() {\n var _a, _b;\n const compliances = (_b = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.complianceTechnical) === null || _b === void 0 ? void 0 : _b.filter((complianceItem) => complianceItem.headingType !== enums_1.ProductComplianceTechnicalHeadingTypeEnum.nonRescaled);\n if (compliances) {\n return this.getSortedComplianceTechnical(compliances);\n }\n return null;\n }\n /**\n * Get sorted and filtered complianceTechnical. It will remove excluded headers from the EXCLUDED_HEADINGS array.\n * Sorting: It will sort the complianceTechnical data by the SORT_ORDER array, which is the same sorting done\n * on the PIP page on IKEA.com. There are some things that are sorted and some are left unsorder, which means\n * that they will always be displayed last. This is done because IKEA.com wants to highlight some of the data\n * and some should just be displayed, regardless of order.\n *\n * @param items\n */\n getSortedComplianceTechnical(items) {\n const sortOrder = TECHNICAL_INFORMATION_SORT_ORDER;\n const excludedHeaders = TECHNICAL_INFORMATION_EXCLUDED_HEADINGS;\n const compliancesToShowInCard = items.filter((item) => !excludedHeaders.includes(item.headingType));\n const sortedComplianceTechnical = compliancesToShowInCard\n .filter((compliance) => sortOrder.includes(compliance.headingType))\n .sort((a, b) => sortOrder.indexOf(a.headingType) - sortOrder.indexOf(b.headingType));\n const unsortedComplianceTechnical = compliancesToShowInCard.filter((compliance) => !sortOrder.includes(compliance.headingType));\n return [...sortedComplianceTechnical, ...unsortedComplianceTechnical];\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], TechnicalInformationCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], TechnicalInformationCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], TechnicalInformationCard.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], TechnicalInformationCard.prototype, \"product\", void 0);\nTechnicalInformationCard = __decorate([\n (0, web_component_1.customElement)('kompis-technical-information-card')\n], TechnicalInformationCard);\nexports.default = TechnicalInformationCard;\n//# sourceMappingURL=TechnicalInformationCard.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ProductInformationSectionModalEnum;\n(function (ProductInformationSectionModalEnum) {\n ProductInformationSectionModalEnum[\"productDetailsCard\"] = \"productDetailsCard\";\n ProductInformationSectionModalEnum[\"technicalInformationCard\"] = \"technicalInformationCard\";\n ProductInformationSectionModalEnum[\"measurementsCard\"] = \"measurementsCard\";\n})(ProductInformationSectionModalEnum || (ProductInformationSectionModalEnum = {}));\nexports.default = ProductInformationSectionModalEnum;\n//# sourceMappingURL=ProductInformationSectionModalEnum.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_action_list_1 = require(\"@inter-ikea-kompis/component-action-list\");\nrequire(\"@inter-ikea-kompis/component-action-list\");\nrequire(\"@ingka/modal-webc\");\nrequire(\"../technical-information-card/TechnicalInformationCard\");\nrequire(\"../measurements-card/MeasurementsCard\");\nrequire(\"../product-details-card/ProductDetailsCard\");\nconst ProductInformationSectionModalEnum_1 = __importDefault(require(\"../../enums/ProductInformationSectionModalEnum\"));\n/**\n * Product information section.\n *\n * @event modalOpen When product information section action list item has been pressed.\n * @event modalClose When the sheet with content has been closed.\n */\nlet ProductInformationSection = class ProductInformationSection extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Visible modal\n this.visibleModal = null;\n this.triggerElement = null;\n this.cardElement = null;\n }\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${this.getProductDetailsActionItem()} ${this.getTechnicalInformationActionItem()}\n\t\t\t\t${this.getProductMeasurementActionItem()}\n\t\t\t\n\t\t`;\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('visibleModal')) {\n if (this.visibleModal === ProductInformationSectionModalEnum_1.default.productDetailsCard ||\n this.visibleModal === ProductInformationSectionModalEnum_1.default.technicalInformationCard ||\n this.visibleModal === ProductInformationSectionModalEnum_1.default.measurementsCard) {\n this.openSheet();\n }\n else {\n this.closeSheet();\n }\n }\n if (this.cardElement) {\n this.cardElement.theme = this.theme;\n this.cardElement.localizedInformation = this.localizedInformation;\n this.cardElement.translations = this.translations;\n this.cardElement.product = this.product;\n if ('settings' in this.cardElement) {\n this.cardElement.settings = this.settings;\n }\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n /**\n * Returns the product details action list item if content is present.\n */\n getProductDetailsActionItem() {\n if (!this.product.content) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t this.dispatchModalOpenEvent(event, ProductInformationSectionModalEnum_1.default.productDetailsCard)}\"\n\t\t\t>\n\t\t\t\n\t\t`;\n }\n /**\n * Returns the technical information action list item if content is present.\n */\n getTechnicalInformationActionItem() {\n var _a, _b;\n if (!((_a = this.product.content) === null || _a === void 0 ? void 0 : _a.complianceTechnical) && !((_b = this.product.content) === null || _b === void 0 ? void 0 : _b.technicalInformation)) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t this.dispatchModalOpenEvent(event, ProductInformationSectionModalEnum_1.default.technicalInformationCard)}\"\n\t\t\t>\n\t\t\t\n\t\t`;\n }\n /**\n * Returns the product measurement action list item if content is present.\n */\n getProductMeasurementActionItem() {\n var _a;\n const hasMeasurementImages = utilities_1.ProductUtility.getProductImages(this.product, enums_1.ImageTypeNameEnum.measurementIllustration);\n if (!((_a = this.product.content) === null || _a === void 0 ? void 0 : _a.measure) && hasMeasurementImages.length === 0) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t this.dispatchModalOpenEvent(event, ProductInformationSectionModalEnum_1.default.measurementsCard)}\"\n\t\t\t>\n\t\t\t\n\t\t`;\n }\n closeSheet() {\n if (this.sheetElement) {\n this.sheetElement.open = false;\n this.sheetElement = null;\n this.cardElement = null;\n }\n }\n /**\n * Dispatches a modalOpen event.\n *\n * @param event\n * @param visibleModal\n */\n dispatchModalOpenEvent(event, visibleModal) {\n if (event.target) {\n this.setTriggerElement(event.target);\n }\n this.dispatchEvent(new CustomEvent('modalOpen', {\n detail: {\n visibleModal,\n triggerElement: this.triggerElement\n }\n }));\n }\n /**\n * Opens the sheet.\n */\n openSheet() {\n if (this.sheetElement) {\n return;\n }\n const sheetElement = this.createSheetElement();\n const cardElement = this.getCardElementType().card;\n const onClose = () => {\n var _a;\n if (this.sheetElement) {\n this.dispatchEvent(new CustomEvent('modalClose', {\n bubbles: true,\n detail: {\n visibleModal: null,\n triggerElement: (_a = this.triggerElement) !== null && _a !== void 0 ? _a : this.getTriggerElement()\n }\n }));\n }\n };\n sheetElement.addEventListener('closerequest', onClose);\n sheetElement.addEventListener('closed', () => {\n var _a;\n (_a = sheetElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(sheetElement);\n });\n this.sheetElement = sheetElement;\n this.cardElement = cardElement;\n const parent = document.querySelector('kompis-keyboard-injector') || document.body;\n parent.appendChild(sheetElement);\n sheetElement.open = true;\n }\n /**\n * Get trigger element on close.\n */\n getTriggerElement() {\n const actionListItem = this.shadowRoot.querySelector(`#${this.visibleModal}`);\n return actionListItem;\n }\n /**\n * Sets trigger element.\n *\n * @param target Target.\n */\n setTriggerElement(target) {\n if (target && target instanceof Element) {\n if (target.shadowRoot) {\n this.triggerElement = target.shadowRoot.querySelector('button');\n }\n }\n return this.triggerElement;\n }\n createSheetElement() {\n const { card, ariaLabel } = this.getCardElementType();\n const sheetHeaderElement = this.createSheetHeader();\n const sheetElement = this.createSheet(ariaLabel);\n sheetElement.appendChild(sheetHeaderElement);\n sheetElement.appendChild(card);\n return sheetElement;\n }\n createSheet(ariaLabel) {\n const sheetElement = document.createElement('skapa-sheet');\n sheetElement.setAttribute('aria-label', ariaLabel);\n sheetElement.size = 'small';\n sheetElement.fullHeight = true;\n sheetElement.style.fontFamily = themes_1.FontStyle.getFontFamily(this.theme);\n sheetElement.style.zIndex = '500';\n return sheetElement;\n }\n createSheetHeader() {\n const sheetHeaderElement = document.createElement('skapa-modal-header');\n sheetHeaderElement.slot = 'header';\n const headerSpan = document.createElement('span');\n headerSpan.slot = 'closebutton-label';\n headerSpan.innerText = this.getTranslations().modalAriaLabelButtonClose;\n sheetHeaderElement.append(headerSpan);\n return sheetHeaderElement;\n }\n createCard(element) {\n const card = document.createElement(element);\n card.theme = this.theme;\n card.localizedInformation = this.localizedInformation;\n card.translations = this.translations;\n card.product = this.product;\n if ('settings' in card) {\n card.settings = this.settings;\n }\n return card;\n }\n /**\n * @returns Returns card element and ariaLabel depending on the open modal type.\n */\n getCardElementType() {\n const { productCardTechnicalInformationTitle, productCardProductDetailsTitle, productCardMeasurementTitle } = this.getTranslations();\n switch (this.visibleModal) {\n case ProductInformationSectionModalEnum_1.default.technicalInformationCard:\n return {\n card: this.createCard('kompis-technical-information-card'),\n ariaLabel: productCardTechnicalInformationTitle\n };\n case ProductInformationSectionModalEnum_1.default.measurementsCard:\n return {\n card: this.createCard('kompis-measurements-card'),\n ariaLabel: productCardMeasurementTitle\n };\n case ProductInformationSectionModalEnum_1.default.productDetailsCard:\n default:\n return {\n card: this.createCard('kompis-product-details-card'),\n ariaLabel: productCardProductDetailsTitle\n };\n }\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ProductInformationSection.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductInformationSection.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductInformationSection.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductInformationSection.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductInformationSection.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ProductInformationSection.prototype, \"product\", void 0);\nProductInformationSection = __decorate([\n (0, web_component_1.customElement)('kompis-product-information-section')\n], ProductInformationSection);\nexports.default = ProductInformationSection;\n//# sourceMappingURL=ProductInformationSection.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TechnicalInformationCard = exports.ProductInformationSectionModalEnum = exports.ProductInformationSection = exports.ProductDetailsCard = exports.MeasurementsCard = void 0;\nconst MeasurementsCard_1 = __importDefault(require(\"./components/measurements-card/MeasurementsCard\"));\nexports.MeasurementsCard = MeasurementsCard_1.default;\nconst ProductDetailsCard_1 = __importDefault(require(\"./components/product-details-card/ProductDetailsCard\"));\nexports.ProductDetailsCard = ProductDetailsCard_1.default;\nconst ProductInformationSection_1 = __importDefault(require(\"./components/product-information-section/ProductInformationSection\"));\nexports.ProductInformationSection = ProductInformationSection_1.default;\nconst TechnicalInformationCard_1 = __importDefault(require(\"./components/technical-information-card/TechnicalInformationCard\"));\nexports.TechnicalInformationCard = TechnicalInformationCard_1.default;\nconst ProductInformationSectionModalEnum_1 = __importDefault(require(\"./enums/ProductInformationSectionModalEnum\"));\nexports.ProductInformationSectionModalEnum = ProductInformationSectionModalEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MediaCarousel = void 0;\nconst MediaCarousel_1 = __importDefault(require(\"./components/media-carousel/MediaCarousel\"));\nexports.MediaCarousel = MediaCarousel_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ProductCardMediaEnum;\n(function (ProductCardMediaEnum) {\n ProductCardMediaEnum[\"singleImage\"] = \"singleImage\";\n ProductCardMediaEnum[\"switchImageOnHover\"] = \"switchImageOnHover\";\n ProductCardMediaEnum[\"carousel\"] = \"carousel\";\n})(ProductCardMediaEnum || (ProductCardMediaEnum = {}));\nexports.default = ProductCardMediaEnum;\n//# sourceMappingURL=ProductCardMediaEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst IMAGE_SCALE_FACTOR = 1.02;\n/**\n * A class with style.\n */\nclass ProductCardMediaStyle {\n /**\n * Returns styles.\n *\n * @param options Options object..\n * @param options.hasHoverImage Has hover image.\n * @param options.theme Theme.\n * @param options.isHovered \"true\" if hovered.\n * @returns Styles.\n */\n static getStyle(options) {\n const { motion } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\t.imageLinkWrapper {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\tflex-grow: 1;\n\t\t\t\tcolor: inherit;\n\t\t\t\ttext-decoration: inherit;\n\t\t\t\tcursor: pointer;\n\t\t\t}\n\n\t\t\t.imageContainer {\n\t\t\t\tdisplay: block;\n\t\t\t\tposition: relative;\n\t\t\t}\n\n\t\t\t.singleImage {\n\t\t\t\tdisplay: block;\n\t\t\t\topacity: ${options.hasHoverImage && options.isHovered ? '0' : '1'};\n\t\t\t\ttransform: ${!options.hasHoverImage && options.isHovered\n ? 'scale(' + IMAGE_SCALE_FACTOR + ')'\n : 'none'};\n\t\t\t\ttransition-property: transform;\n\t\t\t\ttransition-duration: ${motion.duration.medium};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t}\n\n\t\t\t.hoverImage {\n\t\t\t\tdisplay: block;\n\t\t\t\tposition: absolute;\n\t\t\t\tleft: 50%;\n\t\t\t\ttop: 50%;\n\t\t\t\ttransform: ${options.hasHoverImage && options.isHovered\n ? 'translate(-50%, -50%) scale(1)'\n : 'translate(-50%, -50%) scale(0.98)'};\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tobject-fit: cover;\n\t\t\t\tobject-position: center center;\n\t\t\t\ttransition-property: opacity, transform;\n\t\t\t\ttransition-duration: ${motion.duration.medium};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t\topacity: ${options.hasHoverImage && options.isHovered ? '1' : '0'};\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = ProductCardMediaStyle;\n//# sourceMappingURL=ProductCardMediaStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst ImageAspectRatioEnum_1 = __importDefault(require(\"@inter-ikea-kompis/component-image/lib/enums/ImageAspectRatioEnum\"));\nrequire(\"@inter-ikea-kompis/component-image\");\nrequire(\"@inter-ikea-kompis/component-media-carousel\");\nconst ProductCardMediaEnum_1 = __importDefault(require(\"../../enums/ProductCardMediaEnum\"));\nconst ProductCardMediaStyle_1 = __importDefault(require(\"./ProductCardMediaStyle\"));\n/**\n * Product Card component.\n *\n * @event carouselChange Triggered when a carousel slide should be changed.\n * @event carouselShowAllThumbnails Triggered when the show all thumbnails button is clicked in the carousel.\n */\nlet ProductCardMedia = class ProductCardMedia extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Sets how media should be displayed.\n this.media = ProductCardMediaEnum_1.default.singleImage;\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // Selected index of the carousel slides.\n this.carouselSelectedIndex = 0;\n // Max limit of thumbnails to be displayed in the carousel.\n this.carouselThumbnailLimit = null;\n // Shows all thumbnails in the carousel when a limit has been set.\n this.carouselShowAll = false;\n // Show scrollbar representing pageIndex\n this.carouselShowScrollbar = false;\n // Show arrows in carousel.\n this.carouselShowArrows = false;\n // \"true\" if hovered.\n this.hovered = false;\n // The aspect ratio that the images should adopt.\n this.imageAspectRatio = ImageAspectRatioEnum_1.default.ORIGINAL;\n // Defines the image sort order. When only one image is being displayed, the first image in the list is used.\n this.imageSortOrder = null;\n // Defines the image sort order for the image displayed on hover when \"media\" is set to \"switchImageOnHover\".\n this.hoverImageSortOrder = [\n enums_1.ImageTypeNameEnum.functionalProductPicture,\n enums_1.ImageTypeNameEnum.contextProductPicture\n ];\n }\n /**\n * Render.\n *\n * @returns Template.\n */\n render() {\n var _a;\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n if (!((_a = this.product) === null || _a === void 0 ? void 0 : _a.content)) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getContainer()}\n\t\t`;\n }\n hasTranslations() {\n return !!this.translations || !!this.localizedInformation;\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n /**\n * Returns container.\n *\n * @returns Template.\n */\n getContainer() {\n return (0, web_component_1.html) `
    ${this.getMedia()}
    `;\n }\n /**\n * Returns media.\n *\n * @returns Template.\n */\n getMedia() {\n switch (this.media) {\n case ProductCardMediaEnum_1.default.singleImage:\n case ProductCardMediaEnum_1.default.switchImageOnHover:\n return this.getImage();\n case ProductCardMediaEnum_1.default.carousel:\n return this.getCarousel();\n default:\n return null;\n }\n }\n /**\n * Returns single image.\n *\n * @returns Template.\n */\n getImage() {\n var _a, _b, _c, _d;\n if (!((_c = (_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.image) === null || _c === void 0 ? void 0 : _c.length)) {\n return null;\n }\n const productImage = this.getFirstImageMatchingType(this.product.content.image, (_d = this.imageSortOrder) !== null && _d !== void 0 ? _d : null) ||\n this.product.content.image.find((image) => image.size === enums_1.ImageSizeTypeEnum.S5) ||\n null;\n if (!productImage) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t\t${this.getHoverImage()}\n\t\t\t
    \n\t\t`;\n }\n /**\n * Returns hover image.\n *\n * @returns Template.\n */\n getHoverImage() {\n var _a, _b, _c;\n if (this.media !== ProductCardMediaEnum_1.default.switchImageOnHover) {\n return null;\n }\n const hoverImage = this.getFirstImageMatchingType((_b = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.image) !== null && _b !== void 0 ? _b : null, (_c = this.hoverImageSortOrder) !== null && _c !== void 0 ? _c : null);\n if (!hoverImage) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * Returns carousel.\n *\n * @returns Template.\n */\n getCarousel() {\n var _a, _b, _c;\n if (!((_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.image)) {\n return null;\n }\n const images = this.getImagesSortedByType(this.product.content.image, (_c = this.imageSortOrder) !== null && _c !== void 0 ? _c : null);\n const mediaItems = images.map((image) => {\n var _a, _b;\n return ({\n src: image.url,\n alt: (_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.name,\n productImage: true\n });\n });\n if (mediaItems.length === 0) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t this.dispatchEvent(new CustomEvent('carouselChange', {\n bubbles: true,\n detail: {\n carouselSelectedIndex: event.detail.selectedIndex,\n type: event.detail.type\n }\n }))}\"\n\t\t\t\t\t@showAllThumbnails=\"${(event) => this.dispatchEvent(new CustomEvent('carouselShowAllThumbnails', {\n bubbles: true,\n detail: { carouselShowAll: event.detail.showAll }\n }))}\"\n\t\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t\t.localizedInformation=\"${this.localizedInformation}\"\n\t\t\t\t\t.translations=\"${this.translations}\"\n\t\t\t\t\t.skipListingLabel=\"${this.getTranslations().carouselSkipListing}\"\n\t\t\t\t\t.showLessLabel=\"${this.getTranslations().carouselShowLess}\"\n\t\t\t\t\t.mediaItems=\"${mediaItems}\"\n\t\t\t\t\t.selectedIndex=\"${this.carouselSelectedIndex}\"\n\t\t\t\t\t.thumbnailLimit=\"${this.carouselThumbnailLimit}\"\n\t\t\t\t\t.showAll=\"${this.carouselShowAll}\"\n\t\t\t\t\t.showScrollbar=\"${this.carouselShowScrollbar}\"\n\t\t\t\t\t.showArrows=\"${this.carouselShowArrows}\"\n\t\t\t\t\t.aspectRatio=\"${this.imageAspectRatio}\"\n\t\t\t\t>\n\t\t\t
    \n\t\t`;\n }\n /**\n * Returns images sorted by type.\n *\n * @param images Images.\n * @param types List of types to sort by in priority order.\n * @returns Sorted images.\n */\n getImagesSortedByType(images, types) {\n if (!types) {\n return images.filter((image) => image.size === enums_1.ImageSizeTypeEnum.S5);\n }\n const result = [];\n // Add images to start of result based on types order.\n for (const type of types) {\n for (const image of images) {\n if (image.size === enums_1.ImageSizeTypeEnum.S5 && image.typeName == type) {\n result.push(image);\n }\n }\n }\n // Add the rest of the images.\n for (const image of images) {\n if (image.size === enums_1.ImageSizeTypeEnum.S5 && !types.includes(image.typeName)) {\n result.push(image);\n }\n }\n return result;\n }\n /**\n * Returns first image matching the type.\n *\n * @param images Images.\n * @param types List of types to sort by in priority order.\n * @returns First image matching the type.\n */\n getFirstImageMatchingType(images, types) {\n if (!types || !images || !images.length) {\n return null;\n }\n for (const type of types) {\n for (const image of images) {\n if (image.size === enums_1.ImageSizeTypeEnum.S5 && image.typeName == type) {\n return image;\n }\n }\n }\n return null;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ProductCardMedia.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ProductCardMedia.prototype, \"product\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductCardMedia.prototype, \"media\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductCardMedia.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductCardMedia.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], ProductCardMedia.prototype, \"carouselSelectedIndex\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], ProductCardMedia.prototype, \"carouselThumbnailLimit\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductCardMedia.prototype, \"carouselShowAll\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductCardMedia.prototype, \"carouselShowScrollbar\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductCardMedia.prototype, \"carouselShowArrows\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductCardMedia.prototype, \"hovered\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductCardMedia.prototype, \"imageAspectRatio\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductCardMedia.prototype, \"imageSortOrder\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductCardMedia.prototype, \"hoverImageSortOrder\", void 0);\nProductCardMedia = __decorate([\n (0, web_component_1.customElement)('kompis-product-card-media')\n], ProductCardMedia);\nexports.default = ProductCardMedia;\n//# sourceMappingURL=ProductCardMedia.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nrequire(\"@inter-ikea-kompis/component-image\");\n/**\n * Product Card Water Sense Image Component.\n */\nlet ProductCardWaterSenseImage = class ProductCardWaterSenseImage extends web_component_1.KompisElement {\n /**\n * Renders a water-senses compliance image.\n */\n render() {\n const imageElement = this.getImageElement();\n return imageElement;\n }\n /**\n * Returns a kompis-image element or null.\n */\n getImageElement() {\n const complianceTechnicalWaterSense = this.findProductComplianceTechnicalWaterSense();\n const src = this.getImageSrc(complianceTechnicalWaterSense);\n const alt = this.getImageAlt(complianceTechnicalWaterSense);\n if (src) {\n return (0, web_component_1.html) `\n\t\t\t\t\n\t\t\t\t\n\t\t\t`;\n }\n return null;\n }\n /**\n * Returns a image alt text.\n *\n * @param complianceTechnicalWaterSense\n * @returns Alt.\n */\n getImageAlt(complianceTechnicalWaterSense) {\n if (complianceTechnicalWaterSense) {\n const { headingText, text } = complianceTechnicalWaterSense;\n return `${headingText} ${text}`;\n }\n return null;\n }\n /**\n * Returns a image src url.\n *\n * @param complianceTechnicalWaterSense\n * @returns Src.\n */\n getImageSrc(complianceTechnicalWaterSense) {\n var _a;\n const mediaItem = this.getMediaItem(complianceTechnicalWaterSense);\n return (_a = mediaItem === null || mediaItem === void 0 ? void 0 : mediaItem.url) !== null && _a !== void 0 ? _a : null;\n }\n /**\n * Returns a single media item from the complianceTechnical media array.\n *\n * @param complianceTechnicalWaterSense\n * @returns IProductComplianceTechnicalMedia.\n */\n getMediaItem(complianceTechnicalWaterSense) {\n const svgMedia = this.findMediaItem(complianceTechnicalWaterSense, '00017');\n const jpegMedia = this.findMediaItem(complianceTechnicalWaterSense, '00001');\n return svgMedia !== null && svgMedia !== void 0 ? svgMedia : jpegMedia;\n }\n /**\n * Function for finding a media that has a svg fileTypeCode.\n *\n * @param complianceTechnicalWaterSense\n * @param fileTypeCode\n * @returns IProductComplianceTechnicalMedia.\n */\n findMediaItem(complianceTechnicalWaterSense, fileTypeCode) {\n var _a;\n if (complianceTechnicalWaterSense) {\n const { media } = complianceTechnicalWaterSense;\n return (_a = media === null || media === void 0 ? void 0 : media.find((item) => item.fileTypeCode === fileTypeCode)) !== null && _a !== void 0 ? _a : null;\n }\n return null;\n }\n /**\n * Returns a compliance technical information that is of type Water Sense.\n *\n * @returns IProductComplianceTechnicalMedia.\n */\n findProductComplianceTechnicalWaterSense() {\n var _a, _b, _c;\n const complianceTechnical = (_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.complianceTechnical;\n return (_c = complianceTechnical === null || complianceTechnical === void 0 ? void 0 : complianceTechnical.find(this.isWaterSenseItem)) !== null && _c !== void 0 ? _c : null;\n }\n /**\n * Check if item in complianceTechnical has a headingType WATER_SENSE and media key with value.\n *\n * @param complianceTechnical\n * @returns Boolean.\n */\n isWaterSenseItem(complianceTechnical) {\n const hasHeadingType = complianceTechnical.headingType === 'WATER_SENSE';\n const hasMedia = 'media' in complianceTechnical;\n return hasHeadingType && hasMedia;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ProductCardWaterSenseImage.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ProductCardWaterSenseImage.prototype, \"product\", void 0);\nProductCardWaterSenseImage = __decorate([\n (0, web_component_1.customElement)('kompis-product-card-water-sense-image')\n], ProductCardWaterSenseImage);\nexports.default = ProductCardWaterSenseImage;\n//# sourceMappingURL=ProductCardWaterSenseImage.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ProductCardPriceLayoutTypeEnum;\n(function (ProductCardPriceLayoutTypeEnum) {\n ProductCardPriceLayoutTypeEnum[\"default\"] = \"default\";\n ProductCardPriceLayoutTypeEnum[\"subtle\"] = \"subtle\";\n ProductCardPriceLayoutTypeEnum[\"emphasized\"] = \"emphasized\";\n})(ProductCardPriceLayoutTypeEnum || (ProductCardPriceLayoutTypeEnum = {}));\nexports.default = ProductCardPriceLayoutTypeEnum;\n//# sourceMappingURL=ProductCardPriceLayoutTypeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// We want the customer to nagivate to, and see the name, description and price of the product in the card first. Then the focus should go back to reading order.\nvar ProductCardOrderEnum;\n(function (ProductCardOrderEnum) {\n // All elements that visually should be before the main focus element.\n ProductCardOrderEnum[ProductCardOrderEnum[\"beforeFirstFocusElement\"] = 1] = \"beforeFirstFocusElement\";\n // All elements that is important for the customer to be focused first.\n ProductCardOrderEnum[ProductCardOrderEnum[\"firstFocusElement\"] = 2] = \"firstFocusElement\";\n // All elements that visually should be after the main focus element.\n ProductCardOrderEnum[ProductCardOrderEnum[\"afterFirstFocusElement\"] = 3] = \"afterFirstFocusElement\";\n})(ProductCardOrderEnum || (ProductCardOrderEnum = {}));\nexports.default = ProductCardOrderEnum;\n//# sourceMappingURL=ProductCardOrderEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nconst ProductCardOrderEnum_1 = __importDefault(require(\"../../enums/ProductCardOrderEnum\"));\nconst FUNCTION_ICON_SIZE = 40;\nconst CONTAINER_MAX_WIDTH = 600;\n/**\n * A class with style.\n */\nclass InformationCardStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.theme Theme.\n * @param options.hasHomeDelivery Has Home delivery.\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing, color, border } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\t.container {\n\t\t\t\tposition: relative;\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\tpadding: ${spacing.space100 / 16}rem;\n\t\t\t\toutline: none;\n\t\t\t\tmax-width: ${CONTAINER_MAX_WIDTH / 16}rem;\n\t\t\t}\n\n\t\t\tkompis-product-card-media {\n\t\t\t\torder: ${ProductCardOrderEnum_1.default.beforeFirstFocusElement};\n\t\t\t}\n\n\t\t\t.priceModuleWrapper {\n\t\t\t\tmargin-top: ${spacing.space150 / 16}rem;\n\t\t\t\tdisplay: flex;\n\t\t\t\torder: ${ProductCardOrderEnum_1.default.firstFocusElement};\n\t\t\t}\n\n\t\t\tkompis-product-card-water-sense-image {\n\t\t\t\torder: ${ProductCardOrderEnum_1.default.afterFirstFocusElement};\n\t\t\t}\n\n\t\t\t.functionIcons {\n\t\t\t\tdisplay: flex;\n\t\t\t\tposition: absolute;\n\t\t\t\torder: ${ProductCardOrderEnum_1.default.afterFirstFocusElement};\n\t\t\t\ttop: ${spacing.space100 / 16}rem;\n\t\t\t\tleft: ${spacing.space100 / 16}rem;\n\t\t\t\tright: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\tslot,\n\t\t\t::slotted(*) {\n\t\t\t\torder: ${ProductCardOrderEnum_1.default.afterFirstFocusElement};\n\t\t\t}\n\n\t\t\t.slotDivider {\n\t\t\t\torder: ${ProductCardOrderEnum_1.default.afterFirstFocusElement};\n\t\t\t}\n\n\t\t\tkompis-home-delivery {\n\t\t\t\tdisplay: flex;\n\t\t\t\torder: ${ProductCardOrderEnum_1.default.afterFirstFocusElement};\n\t\t\t\tmargin-top: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.storeAvailability {\n\t\t\t\torder: ${ProductCardOrderEnum_1.default.afterFirstFocusElement};\n\t\t\t\tmargin-top: ${options.hasHomeDelivery ? spacing.space50 / 16 : spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.homeDeliveryDivider {\n\t\t\t\torder: ${ProductCardOrderEnum_1.default.afterFirstFocusElement};\n\t\t\t}\n\n\t\t\t.productDescription {\n\t\t\t\torder: ${ProductCardOrderEnum_1.default.afterFirstFocusElement};\n\t\t\t\tcolor: ${color.text.default};\n\t\t\t\tmargin-top: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.productIdentifier {\n\t\t\t\torder: ${ProductCardOrderEnum_1.default.afterFirstFocusElement};\n\t\t\t\tmargin-top: ${spacing.space75 / 16}rem;\n\t\t\t}\n\n\t\t\tkompis-product-information-section {\n\t\t\t\torder: ${ProductCardOrderEnum_1.default.afterFirstFocusElement};\n\t\t\t\tdisplay: block;\n\t\t\t\tborder-top: ${1 / 16}rem solid ${color.border.light};\n\t\t\t\tmargin-top: ${spacing.space200 / 16}rem;\n\t\t\t}\n\n\t\t\t.priceModuleWrapper kompis-price-module {\n\t\t\t\tflex-shrink: 1;\n\t\t\t\tflex-grow: 1;\n\t\t\t}\n\n\t\t\tkompis-function-icon {\n\t\t\t\tdisplay: block;\n\t\t\t\twidth: ${FUNCTION_ICON_SIZE / 16}rem;\n\t\t\t\tmargin: ${spacing.space25 / 16}rem;\n\t\t\t}\n\n\t\t\t.divider {\n\t\t\t\tmargin-top: ${spacing.space100 / 16}rem;\n\t\t\t\tborder-top: ${border.thickness.thin / 16}rem solid ${color.border.light};\n\t\t\t}\n\n\t\t\tkompis-do-not-diy {\n\t\t\t\torder: ${ProductCardOrderEnum_1.default.afterFirstFocusElement};\n\t\t\t\tmargin-top: ${spacing.space100 / 16}rem;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = InformationCardStyle;\n//# sourceMappingURL=InformationCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_function_icon_1 = require(\"@inter-ikea-kompis/component-function-icon\");\nconst component_home_delivery_1 = require(\"@inter-ikea-kompis/component-home-delivery\");\nconst ImageAspectRatioEnum_1 = __importDefault(require(\"@inter-ikea-kompis/component-image/lib/enums/ImageAspectRatioEnum\"));\nconst component_price_module_1 = require(\"@inter-ikea-kompis/component-price-module\");\nconst component_store_selector_1 = require(\"@inter-ikea-kompis/component-store-selector\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@inter-ikea-kompis/component-store-selector\");\nrequire(\"@inter-ikea-kompis/component-action-list\");\nrequire(\"@inter-ikea-kompis/component-price-module\");\nrequire(\"@inter-ikea-kompis/component-function-icon\");\nrequire(\"@inter-ikea-kompis/component-home-delivery\");\nrequire(\"@inter-ikea-kompis/component-product-information-section\");\nrequire(\"@inter-ikea-kompis/component-image\");\nrequire(\"@inter-ikea-kompis/component-function-icon\");\nrequire(\"@inter-ikea-kompis/component-do-not-diy\");\nrequire(\"@ingka/status-webc\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/product-identifier-webc\");\nrequire(\"../product-card-media/ProductCardMedia\");\nrequire(\"../product-card-water-sense-image/ProductCardWaterSenseImage\");\nconst ProductCardMediaEnum_1 = __importDefault(require(\"../../enums/ProductCardMediaEnum\"));\nconst ProductCardPriceLayoutTypeEnum_1 = __importDefault(require(\"../../enums/ProductCardPriceLayoutTypeEnum\"));\nconst InformationCardStyle_1 = __importDefault(require(\"./InformationCardStyle\"));\n/**\n * Product card information card component.\n *\n * @event modalClose Triggered when the modal should be closed.\n * @event modalOpen Triggered when a modal should be opened. \"event.detail.visibleModal\" tells you what modal that should be opened.\n * @event carouselChange Triggered when a carousel slide should be changed.\n * @event carouselShowAllThumbnails Triggered when the show all thumbnails button is clicked in the carousel.\n * @event storeSelectorChange Triggered when the user selects a store in the store selector.\n * @event homeDeliveryStartOverClick User clicks on the start over link or the back button.\n * @event homeDeliveryForgetClick User clicks on the forget link from Home Delivery.\n * @event homeDeliveryInput Input of zip code.\n * @event homeDeliverySubmitButtonClick User clicks the Check availability button.\n */\nlet InformationCard = class InformationCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Sets how media should be displayed.\n this.media = ProductCardMediaEnum_1.default.singleImage;\n // The aspect ratio that the images should adopt.\n this.imageAspectRatio = ImageAspectRatioEnum_1.default.ORIGINAL;\n // Defines the image sort order. When only one image is being displayed, the first image matching the type is used.\n this.imageSortOrder = null;\n // Selected index of the carousel slides.\n this.carouselSelectedIndex = 0;\n // Max limit of thumbnails to be displayed in the carousel.\n this.carouselThumbnailLimit = null;\n // Shows all thumbnails in the carousel when a limit has been set.\n this.carouselShowAll = false;\n // Show scrollbar in carousel.\n this.carouselShowScrollbar = false;\n // Show arrows in carousel.\n this.carouselShowArrows = false;\n this.hoverImageSortOrder = [\n enums_1.ImageTypeNameEnum.functionalProductPicture,\n enums_1.ImageTypeNameEnum.contextProductPicture\n ];\n // Optional array of function icons.\n this.functionIcons = null;\n // Price module layout type.\n this.priceModuleLayout = ProductCardPriceLayoutTypeEnum_1.default.default;\n // Show a modal of type ProductCardModalEnum.\n this.visibleModal = null;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // Show price excl tax.\n this.showPriceExclTax = false;\n // Product measures.\n this.productMeasures = utilities_1.ProductDescriptionProductMeasureEnum.none;\n // Show text describing the color and/or material of the product.\n this.showDesignText = false;\n // Show product package weight info.\n this.showWeight = false;\n // Show product package measures.\n this.showPackageMeasures = false;\n // Optional array of type IProduct used for products included in the main product, i.e. child products. Needed for price to be calculated and displayed for an assembly product (ASP). Products included in all variations is needed when card should represent multiple variations of an assembly product.\n this.includedProducts = null;\n // Shows the Home delivery component.\n this.showHomeDelivery = false;\n // Zip availability for the product(s). Object or array. Array is used when card should represent multiple variations of a product (array with availability for all variations), an assembly product (ASP) (array of availabilty for all child items) or multiple variations of assembly products (array of availabilty for all child items of all variations).\n this.zipAvailability = null;\n // Card state for Home Delivery\n this.homeDeliveryState = component_home_delivery_1.HomeDeliveryStateEnum.default;\n // Input value for Home Delivery\n this.homeDeliveryInputValue = null;\n // Submitted and validated ZIP code for Home Delivery.\n this.homeDeliveryZipCode = null;\n // Store availability for the product(s). Object or array. Array is used when card should represent multiple variations of a product (array with availability for all variations), an assembly product (ASP) (array of availabilty for all child items) or multiple variations of assembly products (array of availabilty for all child items of all variations).\n this.storeAvailability = null;\n // Stores.\n this.stores = null;\n // Shows a product identifier if the layout is set to \"information\".\n this.showProductIdentifier = false;\n // Text for product description.\n this.productDescription = null;\n // Selected store id.\n this.storeId = null;\n this.isHovered = false;\n this.dexfSettings = null;\n }\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `${this.getCard()}`;\n }\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return !!this.localizedInformation || !!(this.translations && this.settings);\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n getSettings() {\n return this.dexfSettings;\n }\n getCard() {\n var _a, _b;\n const homeDelivery = this.getHomeDelivery();\n const storeAvailability = this.getStoreAvailability();\n const hasSlotContent = !!((_a = this.querySelector('slot')) === null || _a === void 0 ? void 0 : _a.assignedElements().length);\n const slotDivider = !hasSlotContent && (homeDelivery || storeAvailability)\n ? this.getDivider('slotDivider')\n : null;\n const homeDeliveryDivider = (this.showHomeDelivery || ((_b = this.stores) === null || _b === void 0 ? void 0 : _b.length)) &&\n (this.getProductDescription() || this.getProductIdentifierItemNo())\n ? this.getDivider('homeDeliveryDivider')\n : null;\n const content = [\n this.getPriceModule(),\n this.getDoNotDiy(),\n this.getMedia(),\n this.getEnergyComplianceWaterSenseImage(),\n this.getFunctionIcons(),\n this.getActionListSlot(),\n slotDivider,\n homeDelivery,\n storeAvailability,\n homeDeliveryDivider,\n this.getProductDescription(),\n this.getProductIdentifier(),\n this.getProductInformationSection()\n ];\n // eslint-disable-next-line lit-a11y/mouse-events-have-key-events\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t
    \n\t\t\t\t${content}\n\t\t\t`;\n }\n getMedia() {\n return (0, web_component_1.html) `\n\t\t\t {\n this.dispatchEvent(new CustomEvent('carouselChange', { bubbles: true, detail: event.detail }));\n }}\"\n\t\t\t\t@carouselShowAllThumbnails=\"${(event) => {\n this.dispatchEvent(new CustomEvent('carouselShowAllThumbnails', { bubbles: true, detail: event.detail }));\n }}\"\n\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t.product=\"${this.product}\"\n\t\t\t\t.localizedInformation=\"${this.localizedInformation}\"\n\t\t\t\t.translations=\"${this.translations}\"\n\t\t\t\t.media=\"${this.media}\"\n\t\t\t\t.hovered=\"${this.isHovered}\"\n\t\t\t\t.carouselSelectedIndex=\"${this.carouselSelectedIndex}\"\n\t\t\t\t.carouselThumbnailLimit=\"${this.carouselThumbnailLimit}\"\n\t\t\t\t.carouselShowAll=\"${this.carouselShowAll}\"\n\t\t\t\t.carouselShowScrollbar=\"${this.carouselShowScrollbar}\"\n\t\t\t\t.carouselShowArrows=\"${this.carouselShowArrows}\"\n\t\t\t\t.imageAspectRatio=\"${this.imageAspectRatio}\"\n\t\t\t\t.imageSortOrder=\"${this.imageSortOrder}\"\n\t\t\t\t.hoverImageSortOrder=\"${this.hoverImageSortOrder}\"\n\t\t\t>\n\t\t`;\n }\n getPriceModule() {\n var _a;\n const calculatePriceFromChildProducts = utilities_1.ProductUtility.shouldCalculatePriceFromChildProducts(this.product);\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: {\n visibleModal: event.detail.visibleModal\n }\n }))}\"\n\t\t\t\t\t@modalClose=\"${() => this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }))}\"\n\t\t\t\t\t.shoppingProducts=\"${this.getPriceModuleShoppingProducts()}\"\n\t\t\t\t\t.localizedInformation=\"${this.localizedInformation}\"\n\t\t\t\t\t.translations=\"${this.translations}\"\n\t\t\t\t\t.settings=\"${this.settings}\"\n\t\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t\t.layout=\"${this.priceModuleLayout}\"\n\t\t\t\t\t.productName=\"${(_a = this.product.content) === null || _a === void 0 ? void 0 : _a.name}\"\n\t\t\t\t\t.productLink=\"${this.getProductLinkState()}\"\n\t\t\t\t\t.visibleModal=\"${this.visibleModal}\"\n\t\t\t\t\t.disableLinks=\"${this.disableLinks}\"\n\t\t\t\t\t.showPriceUnit=\"${!calculatePriceFromChildProducts}\"\n\t\t\t\t\t.showEcoFee=\"${true}\"\n\t\t\t\t\t.showPriceExclTax=\"${this.showPriceExclTax}\"\n\t\t\t\t\t.showEnergyLabel=\"${!calculatePriceFromChildProducts}\"\n\t\t\t\t\t.showRepairabilityIndex=\"${!calculatePriceFromChildProducts}\"\n\t\t\t\t\t.showLowestPreviousSalesPrice=\"${!calculatePriceFromChildProducts}\"\n\t\t\t\t\t.isCombinedProduct=\"${calculatePriceFromChildProducts}\"\n\t\t\t\t>\n\t\t\t\t\t${this.getDescription()}\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n getDoNotDiy() {\n return (0, web_component_1.html) ``;\n }\n getFunctionIcons() {\n if (!this.functionIcons) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${this.functionIcons.map((icon) => (0, web_component_1.html) `\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t`)}\n\t\t\t
    \n\t\t`;\n }\n getActionListSlot() {\n return (0, web_component_1.html) ` this.requestUpdate()}\"> `;\n }\n getEnergyComplianceWaterSenseImage() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n }\n getProductDescription() {\n if (!this.productDescription) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${this.productDescription}\n\t\t\t
    \n\t\t`;\n }\n getDescription() {\n return utilities_1.ProductDescriptionUtility.getDescription({\n settings: this.getSettings(),\n translations: this.getTranslations(),\n product: this.product,\n include: {\n productMeasures: this.productMeasures,\n designText: this.showDesignText,\n packageMeasures: this.showPackageMeasures,\n weight: this.showWeight\n }\n });\n }\n getDivider(classname) {\n return (0, web_component_1.html) `
    `;\n }\n getHomeDelivery() {\n if (!this.showHomeDelivery) {\n return null;\n }\n return (0, web_component_1.html) ` {\n this.dispatchEvent(new CustomEvent('modalOpen', { bubbles: true, detail: Object.assign({}, event.detail) }));\n }}\"\n\t\t\t@modalClose=\"${() => this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }))}\"\n\t\t\t@submitButtonClick=${() => this.dispatchEvent(new CustomEvent('homeDeliverySubmitButtonClick', { bubbles: true }))}\n\t\t\t@forgetClick=\"${(event) => {\n this.dispatchEvent(new CustomEvent('homeDeliveryForgetClick', {\n bubbles: true,\n detail: Object.assign({}, event.detail)\n }));\n }}\"\n\t\t\t@startOverClick=\"${(event) => {\n this.dispatchEvent(new CustomEvent('homeDeliveryStartOverClick', {\n bubbles: true,\n detail: Object.assign({}, event.detail)\n }));\n }}\"\n\t\t\t@input=\"${(event) => {\n this.dispatchEvent(new CustomEvent('homeDeliveryInput', { bubbles: true, detail: Object.assign({}, event.detail) }));\n }}\"\n\t\t>`;\n }\n getStoreAvailability() {\n var _a;\n if (!((_a = this.stores) === null || _a === void 0 ? void 0 : _a.length)) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t event.stopPropagation()}\"\n\t\t\t\t\t@modalOpen=\"${(event) => this.dispatchEvent(new CustomEvent('modalOpen', { bubbles: true, detail: event.detail }))}\"\n\t\t\t\t\t@modalClose=\"${(event) => this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: event.detail }))}\"\n\t\t\t\t\t@change=\"${(event) => {\n this.dispatchEvent(new CustomEvent('storeSelectorChange', {\n bubbles: true,\n detail: Object.assign(Object.assign({}, event.detail), { product: this.product })\n }));\n }}\"\n\t\t\t\t\t.localizedInformation=\"${this.localizedInformation}\"\n\t\t\t\t\t.translations=\"${this.translations}\"\n\t\t\t\t\t.settings=\"${this.settings}\"\n\t\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t\t.stores=\"${this.stores}\"\n\t\t\t\t\t.storeId=\"${this.storeId}\"\n\t\t\t\t\t.storeAvailabilities=\"${this.storeAvailability\n ? Array.isArray(this.storeAvailability)\n ? this.storeAvailability\n : [this.storeAvailability]\n : null}\"\n\t\t\t\t\t.visibleModal=\"${this.visibleModal}\"\n\t\t\t\t\t.layout=\"${component_store_selector_1.StoreSelectorLayoutEnum.link}\"\n\t\t\t\t>\n\t\t\t
    \n\t\t`;\n }\n getProductIdentifierItemNo() {\n var _a;\n const itemNo = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.ruItemNo;\n if (!this.showProductIdentifier || !itemNo) {\n return null;\n }\n return itemNo;\n }\n /**\n * Some products (DEXF custom items) are missing \"ruItemNo\".\n *\n * @returns TemplateResult | null.\n */\n getProductIdentifier() {\n const itemNo = this.getProductIdentifierItemNo();\n if (itemNo) {\n return (0, web_component_1.html) `\n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t\t\t${utilities_1.ProductUtility.formatItemNo(itemNo)}\n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t`;\n }\n return null;\n }\n getPriceModuleShoppingProducts() {\n var _a, _b, _c;\n if (utilities_1.ProductUtility.shouldCalculatePriceFromChildProducts(this.product)) {\n const includedShoppingProducts = utilities_1.ProductUtility.getIncludedShoppingProducts({\n product: this.product,\n includedProducts: (_a = this.includedProducts) !== null && _a !== void 0 ? _a : [],\n ignoreInvalidProducts: true\n });\n if (includedShoppingProducts.length > 0 &&\n includedShoppingProducts.length === ((_c = (_b = this.product.content) === null || _b === void 0 ? void 0 : _b.child) === null || _c === void 0 ? void 0 : _c.length)) {\n return includedShoppingProducts;\n }\n }\n return [{ quantity: 1, product: this.product }];\n }\n getProductLinkState() {\n var _a;\n const itemTypesWithLink = [enums_1.ItemTypeEnum.art, enums_1.ItemTypeEnum.spr];\n const productItemType = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.itemType;\n if ((productItemType && !itemTypesWithLink.includes(productItemType)) || this.disableLinks) {\n return component_price_module_1.PriceModuleProductLinkEnum.disabled;\n }\n return component_price_module_1.PriceModuleProductLinkEnum.productInformationPage;\n }\n getProductInformationSection() {\n var _a, _b, _c;\n if (!((_a = this.product.content) === null || _a === void 0 ? void 0 : _a.complianceTechnical) &&\n !((_b = this.product.content) === null || _b === void 0 ? void 0 : _b.goodToKnow) &&\n !((_c = this.product.content) === null || _c === void 0 ? void 0 : _c.customerBenefit)) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: {\n visibleModal: event.detail.visibleModal\n }\n }))}\"\n\t\t\t\t@modalClose=\"${(event) => {\n var _a, _b;\n this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }));\n (_b = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.triggerElement) === null || _b === void 0 ? void 0 : _b.focus();\n }}\"\n\t\t\t>\n\t\t\t\n\t\t`;\n }\n onMouseOver() {\n if (this.isHovered || this.disableLinks) {\n return;\n }\n this.isHovered = true;\n this.requestUpdate();\n }\n onMouseLeave() {\n if (!this.isHovered || this.disableLinks) {\n return;\n }\n this.isHovered = false;\n this.requestUpdate();\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], InformationCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], InformationCard.prototype, \"product\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], InformationCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], InformationCard.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], InformationCard.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], InformationCard.prototype, \"media\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], InformationCard.prototype, \"imageAspectRatio\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], InformationCard.prototype, \"imageSortOrder\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], InformationCard.prototype, \"carouselSelectedIndex\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], InformationCard.prototype, \"carouselThumbnailLimit\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], InformationCard.prototype, \"carouselShowAll\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], InformationCard.prototype, \"carouselShowScrollbar\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], InformationCard.prototype, \"carouselShowArrows\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], InformationCard.prototype, \"hoverImageSortOrder\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], InformationCard.prototype, \"functionIcons\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], InformationCard.prototype, \"priceModuleLayout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], InformationCard.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], InformationCard.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], InformationCard.prototype, \"showPriceExclTax\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], InformationCard.prototype, \"productMeasures\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], InformationCard.prototype, \"showDesignText\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], InformationCard.prototype, \"showWeight\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], InformationCard.prototype, \"showPackageMeasures\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], InformationCard.prototype, \"includedProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], InformationCard.prototype, \"showHomeDelivery\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], InformationCard.prototype, \"zipAvailability\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], InformationCard.prototype, \"homeDeliveryState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, synchronous: true })\n], InformationCard.prototype, \"homeDeliveryInputValue\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], InformationCard.prototype, \"homeDeliveryZipCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], InformationCard.prototype, \"storeAvailability\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], InformationCard.prototype, \"stores\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], InformationCard.prototype, \"showProductIdentifier\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], InformationCard.prototype, \"productDescription\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], InformationCard.prototype, \"storeId\", void 0);\nInformationCard = __decorate([\n (0, web_component_1.customElement)('kompis-information-card')\n], InformationCard);\nexports.default = InformationCard;\n//# sourceMappingURL=InformationCard.js.map","import \"@inter-ikea-kompis/component-product-card/lib/components/information-card/InformationCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisInformationCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-information-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.carouselSelectedIndex = props.carouselSelectedIndex;\n element.carouselShowAll = props.carouselShowAll;\n element.carouselShowArrows = props.carouselShowArrows;\n element.carouselShowScrollbar = props.carouselShowScrollbar;\n element.carouselThumbnailLimit = props.carouselThumbnailLimit;\n element.disableLinks = props.disableLinks;\n element.functionIcons = props.functionIcons;\n element.homeDeliveryInputValue = props.homeDeliveryInputValue;\n element.homeDeliveryState = props.homeDeliveryState;\n element.homeDeliveryZipCode = props.homeDeliveryZipCode;\n element.hoverImageSortOrder = props.hoverImageSortOrder;\n element.imageAspectRatio = props.imageAspectRatio;\n element.imageSortOrder = props.imageSortOrder;\n element.includedProducts = props.includedProducts;\n element.localizedInformation = props.localizedInformation;\n element.media = props.media;\n element.priceModuleLayout = props.priceModuleLayout;\n element.product = props.product;\n element.productDescription = props.productDescription;\n element.productMeasures = props.productMeasures;\n element.settings = props.settings;\n element.showDesignText = props.showDesignText;\n element.showHomeDelivery = props.showHomeDelivery;\n element.showPackageMeasures = props.showPackageMeasures;\n element.showPriceExclTax = props.showPriceExclTax;\n element.showProductIdentifier = props.showProductIdentifier;\n element.showWeight = props.showWeight;\n element.storeAvailability = props.storeAvailability;\n element.storeId = props.storeId;\n element.stores = props.stores;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n element.zipAvailability = props.zipAvailability;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onCarouselChange, \"carouselChange\");\n this.updateEventListener(element, props.onCarouselShowAllThumbnails, \"carouselShowAllThumbnails\");\n this.updateEventListener(element, props.onHomeDeliveryForgetClick, \"homeDeliveryForgetClick\");\n this.updateEventListener(element, props.onHomeDeliveryInput, \"homeDeliveryInput\");\n this.updateEventListener(element, props.onHomeDeliveryStartOverClick, \"homeDeliveryStartOverClick\");\n this.updateEventListener(element, props.onHomeDeliverySubmitButtonClick, \"homeDeliverySubmitButtonClick\");\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n this.updateEventListener(element, props.onStoreSelectorChange, \"storeSelectorChange\");\n }\n}\nKompisInformationCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n carouselSelectedIndex: PropTypes.number,\n carouselShowAll: PropTypes.bool,\n carouselShowArrows: PropTypes.bool,\n carouselShowScrollbar: PropTypes.bool,\n carouselThumbnailLimit: PropTypes.number,\n disableLinks: PropTypes.bool,\n functionIcons: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n homeDeliveryInputValue: PropTypes.string,\n homeDeliveryState: PropTypes.string,\n homeDeliveryZipCode: PropTypes.string,\n hoverImageSortOrder: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n imageAspectRatio: PropTypes.string,\n imageSortOrder: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n includedProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n media: PropTypes.string,\n priceModuleLayout: PropTypes.string,\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n productDescription: PropTypes.string,\n productMeasures: PropTypes.string,\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n showDesignText: PropTypes.bool,\n showHomeDelivery: PropTypes.bool,\n showPackageMeasures: PropTypes.bool,\n showPriceExclTax: PropTypes.bool,\n showProductIdentifier: PropTypes.bool,\n showWeight: PropTypes.bool,\n storeAvailability: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n storeId: PropTypes.string,\n stores: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n zipAvailability: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n onModalClose: PropTypes.func,\n onModalOpen: PropTypes.func,\n onCarouselChange: PropTypes.func,\n onCarouselShowAllThumbnails: PropTypes.func,\n onStoreSelectorChange: PropTypes.func,\n onHomeDeliveryStartOverClick: PropTypes.func,\n onHomeDeliveryForgetClick: PropTypes.func,\n onHomeDeliveryInput: PropTypes.func,\n onHomeDeliverySubmitButtonClick: PropTypes.func\n};\nexport default KompisInformationCard;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst IMAGE_SIZE = 40;\nconst MORE_LABEL_SIZE = 40;\n/**\n * A class with style.\n */\nclass ProductCardVariantsStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing, color, border } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-flow: wrap;\n\t\t\t\talign-items: center;\n\t\t\t\tpadding: 0;\n\t\t\t\tmargin: 0;\n\t\t\t\tjustify-content: flex-start;\n\t\t\t}\n\n\t\t\tli {\n\t\t\t\tlist-style-type: none;\n\t\t\t}\n\n\t\t\tbutton {\n\t\t\t\tbackground: none;\n\t\t\t\tcolor: inherit;\n\t\t\t\tborder: none;\n\t\t\t\tmargin: 0;\n\t\t\t\tfont: inherit;\n\t\t\t\tcursor: pointer;\n\t\t\t\toutline: inherit;\n\t\t\t}\n\n\t\t\t.variant {\n\t\t\t\twidth: ${IMAGE_SIZE / 16}rem;\n\t\t\t\theight: ${IMAGE_SIZE / 16}rem;\n\t\t\t\tcursor: pointer;\n\t\t\t\tlist-style-type: none;\n\t\t\t\toutline: none;\n\t\t\t\tmargin-top: ${spacing.space25 / 16}rem;\n\t\t\t\tbox-shadow: 0 0 0 ${1 / 16}rem transparent;\n\t\t\t\tborder-radius: ${border.radius.radius4 / 16 / 2}rem;\n\t\t\t\tpadding: ${spacing.space25 / 2 / 16}rem;\n\t\t\t}\n\n\t\t\t.variant:focus {\n\t\t\t\tbox-shadow: 0 0 0 ${1 / 16}rem ${color.border.default};\n\t\t\t}\n\n\t\t\t.variant:hover {\n\t\t\t\tbox-shadow: 0 0 0 ${1 / 16}rem ${color.border.default};\n\t\t\t}\n\n\t\t\t.divider {\n\t\t\t\twidth: ${spacing.space25 / 16}rem;\n\t\t\t}\n\n\t\t\t.showMoreButton {\n\t\t\t\tbackground-color: ${color.background.default};\n\t\t\t\tcursor: pointer;\n\t\t\t\tborder: ${border.thickness.thin / 16}rem solid ${color.border.light};\n\t\t\t\tmargin: ${spacing.space25 / 2 / 16}rem;\n\t\t\t\tmargin-top: ${spacing.space25 / 16}rem;\n\t\t\t\twidth: ${MORE_LABEL_SIZE / 16}rem;\n\t\t\t\theight: ${MORE_LABEL_SIZE / 16}rem;\n\t\t\t\tborder-radius: 50%;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t}\n\n\t\t\t.showMoreButton:hover {\n\t\t\t\tborder-color: ${color.border.default};\n\t\t\t}\n\n\t\t\t.visuallyHidden:not(:focus):not(:active) {\n\t\t\t\tclip: rect(0 0 0 0);\n\t\t\t\tclip-path: inset(50%);\n\t\t\t\theight: ${1 / 16}rem;\n\t\t\t\toverflow: hidden;\n\t\t\t\tposition: absolute;\n\t\t\t\twhite-space: nowrap;\n\t\t\t\twidth: ${1 / 16}rem;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = ProductCardVariantsStyle;\n//# sourceMappingURL=ProductCardVariantsStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@inter-ikea-kompis/component-image\");\nconst ProductCardVariantsStyle_1 = __importDefault(require(\"./ProductCardVariantsStyle\"));\n/**\n * Product Card component.\n *\n * @event variantClick Fired when a product variant thumbnail is clicked.\n * @event showMoreClick Fired when the show more button is clicked\n */\nlet ProductCardVariants = class ProductCardVariants extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Array of product variants.\n this.products = null;\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Limits the number of variants displayed.\n this.limit = null;\n this.lastVariant = null;\n this.dexfSettings = null;\n }\n /**\n * Render.\n *\n * @returns Template.\n */\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n if (!this.products || !this.products.length) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getContainer()}\n\t\t`;\n }\n shouldUpdate(changedProperties) {\n var _a;\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n if (changedProperties.has('limit')) {\n (_a = this.lastVariant) === null || _a === void 0 ? void 0 : _a.focus();\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return !!this.localizedInformation || !!(this.translations && this.settings);\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n getSettings() {\n return this.dexfSettings;\n }\n /**\n * Returns container.\n *\n * @returns Template.\n */\n getContainer() {\n /* eslint-disable lit-a11y/no-redundant-role */\n return (0, web_component_1.html) `\n\t\t\t
      \n\t\t\t\t${this.getVariants()}${this.getShowMoreButton()}\n\t\t\t
    \n\t\t`;\n /* eslint-enable lit-a11y/no-redundant-role */\n }\n /**\n * Returns product variants.\n *\n * @returns Template.\n */\n getVariants() {\n var _a;\n const variants = [];\n if (!((_a = this.products) === null || _a === void 0 ? void 0 : _a.length)) {\n return variants;\n }\n const limit = !this.limit ? this.products.length : Math.min(this.limit, this.products.length);\n for (let i = 0; i < limit; i++) {\n const product = this.products[i];\n const description = utilities_1.ProductDescriptionUtility.getDescription({\n product,\n settings: this.getSettings(),\n translations: this.getTranslations(),\n include: {\n designText: true\n }\n });\n const productImage = utilities_1.ProductUtility.getMainImages(product).find((productImage) => productImage.size === enums_1.ImageSizeTypeEnum.S5);\n if (productImage) {\n variants.push((0, web_component_1.html) `\n\t\t\t\t\t
  • \n\t\t\t\t\t\t {\n event.preventDefault();\n event.stopPropagation();\n this.dispatchEvent(new CustomEvent('variantClick', { bubbles: true, detail: { product } }));\n }}\n\t\t\t\t\t\t\t@keydown=${(event) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n event.stopPropagation();\n this.dispatchEvent(new CustomEvent('variantClick', { bubbles: true, detail: { product } }));\n }\n }}\n\t\t\t\t\t\t\taria-label=${description}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
  • \n\t\t\t\t`);\n variants.push((0, web_component_1.html) `
    `);\n }\n }\n return variants;\n }\n /**\n * Returns more label.\n *\n * @returns Template.\n */\n getShowMoreButton() {\n var _a;\n if (!this.limit || !((_a = this.products) === null || _a === void 0 ? void 0 : _a.length) || this.products.length <= this.limit) {\n return null;\n }\n const label = `+${this.products.length - this.limit}`;\n return (0, web_component_1.html) `\n\t\t\t
  • \n\t\t\t\t this.onShowMoreClick(event)}\"\n\t\t\t\t\t@keydown=${(event) => {\n event.key === 'Enter' && this.onShowMoreClick(event);\n }}\n\t\t\t\t\taria-expanded=\"false\"\n\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t>\n\t\t\t\t\t${this.products.length - this.limit}\n\t\t\t\t\t\t${this.getTranslations().productCardMoreOptionsAvailable}\n\t\t\t\t\t\n\t\t\t\t\t\t${label}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
  • \n\t\t`;\n }\n onShowMoreClick(event) {\n const productVariantsList = this.shadowRoot.querySelectorAll('.variant');\n this.lastVariant = Array.from(productVariantsList).slice(-1)[0];\n event.preventDefault();\n event.stopPropagation();\n this.dispatchEvent(new CustomEvent('showMoreClick', {\n bubbles: true\n }));\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ProductCardVariants.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductCardVariants.prototype, \"products\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductCardVariants.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductCardVariants.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductCardVariants.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], ProductCardVariants.prototype, \"limit\", void 0);\nProductCardVariants = __decorate([\n (0, web_component_1.customElement)('kompis-product-card-variants')\n], ProductCardVariants);\nexports.default = ProductCardVariants;\n//# sourceMappingURL=ProductCardVariants.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ListGalleryCardMediaEnum;\n(function (ListGalleryCardMediaEnum) {\n ListGalleryCardMediaEnum[\"singleImage\"] = \"singleImage\";\n ListGalleryCardMediaEnum[\"switchImageOnHover\"] = \"switchImageOnHover\";\n})(ListGalleryCardMediaEnum || (ListGalleryCardMediaEnum = {}));\nexports.default = ListGalleryCardMediaEnum;\n//# sourceMappingURL=ListGalleryCardMediaEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ProductCardInfoIconButtonLinkTargetEnum;\n(function (ProductCardInfoIconButtonLinkTargetEnum) {\n ProductCardInfoIconButtonLinkTargetEnum[\"self\"] = \"_self\";\n ProductCardInfoIconButtonLinkTargetEnum[\"blank\"] = \"_blank\";\n ProductCardInfoIconButtonLinkTargetEnum[\"parent\"] = \"_parent\";\n ProductCardInfoIconButtonLinkTargetEnum[\"top\"] = \"_top\";\n})(ProductCardInfoIconButtonLinkTargetEnum || (ProductCardInfoIconButtonLinkTargetEnum = {}));\nexports.default = ProductCardInfoIconButtonLinkTargetEnum;\n//# sourceMappingURL=ProductCardInfoIconButtonLinkTargetEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ProductCardLayoutEnum;\n(function (ProductCardLayoutEnum) {\n ProductCardLayoutEnum[\"list\"] = \"list\";\n ProductCardLayoutEnum[\"gallery\"] = \"gallery\";\n ProductCardLayoutEnum[\"information\"] = \"information\";\n})(ProductCardLayoutEnum || (ProductCardLayoutEnum = {}));\nexports.default = ProductCardLayoutEnum;\n//# sourceMappingURL=ProductCardLayoutEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ProductCardSelectBehaviourEnum;\n(function (ProductCardSelectBehaviourEnum) {\n ProductCardSelectBehaviourEnum[\"disabled\"] = \"disabled\";\n ProductCardSelectBehaviourEnum[\"productInformationPageLink\"] = \"productInformationPageLink\";\n ProductCardSelectBehaviourEnum[\"selectable\"] = \"selectable\";\n})(ProductCardSelectBehaviourEnum || (ProductCardSelectBehaviourEnum = {}));\nexports.default = ProductCardSelectBehaviourEnum;\n//# sourceMappingURL=ProductCardSelectBehaviourEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ProductCardSelectedStateEnum;\n(function (ProductCardSelectedStateEnum) {\n ProductCardSelectedStateEnum[\"unselected\"] = \"unselected\";\n ProductCardSelectedStateEnum[\"checkbox\"] = \"checkbox\";\n ProductCardSelectedStateEnum[\"outline\"] = \"outline\";\n})(ProductCardSelectedStateEnum || (ProductCardSelectedStateEnum = {}));\nexports.default = ProductCardSelectedStateEnum;\n//# sourceMappingURL=ProductCardSelectedStateEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nconst ProductCardLayoutEnum_1 = __importDefault(require(\"../../enums/ProductCardLayoutEnum\"));\nconst ProductCardOrderEnum_1 = __importDefault(require(\"../../enums/ProductCardOrderEnum\"));\nconst ProductCardSelectBehaviourEnum_1 = __importDefault(require(\"../../enums/ProductCardSelectBehaviourEnum\"));\nconst ProductCardSelectedStateEnum_1 = __importDefault(require(\"../../enums/ProductCardSelectedStateEnum\"));\nconst FUNCTION_ICON_SIZE = 40;\nconst CHECKBOX_ICON_SIZE = 32;\nconst CONTAINER_MAX_WIDTH = 600;\n/**\n * A class with style.\n */\nclass ListGalleryCardStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.theme Theme.\n * @param options.layout\n * @param options.selectedState\n * @param options.hasFocus\n * @param options.hasZipAvailabilities\n * @param options.selectBehaviour\n * @param options.hasProductActionElement\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing, color, elevation } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\t.container {\n\t\t\t\tposition: relative;\n\t\t\t\toutline: none;\n\t\t\t\tpadding: ${spacing.space100 / 16}rem;\n\t\t\t\tmax-width: ${CONTAINER_MAX_WIDTH / 16}rem;\n\t\t\t}\n\n\t\t\t.innerContainer {\n\t\t\t\ttext-decoration: none;\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t\tcursor: ${options.hasProductActionElement ? 'pointer' : 'auto'};\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\toutline: none;\n\t\t\t}\n\n\t\t\t.checkboxIconContainer .checkboxIcon {\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\t\t\t\talign-items: center;\n\t\t\t\twidth: ${CHECKBOX_ICON_SIZE / 16}rem;\n\t\t\t\theight: ${CHECKBOX_ICON_SIZE / 16}rem;\n\t\t\t\tbackground-color: ${color.background.inverse};\n\t\t\t\tcolor: ${color.text.inverse};\n\t\t\t\tmargin: ${spacing.space25 / 16}rem;\n\t\t\t\tborder-radius: 50%;\n\t\t\t\tbox-shadow: ${elevation.size.default} ${elevation.color.default};\n\t\t\t}\n\n\t\t\tkompis-product-card-media {\n\t\t\t\torder: ${ProductCardOrderEnum_1.default.beforeFirstFocusElement};\n\t\t\t}\n\n\t\t\t.priceModuleWrapper {\n\t\t\t\tmargin-top: ${spacing.space50 / 16}rem;\n\t\t\t\torder: ${ProductCardOrderEnum_1.default.firstFocusElement};\n\t\t\t\tz-index: 1;\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\n\t\t\t.functionIcons,\n\t\t\t.checkboxIconContainer {\n\t\t\t\torder: ${ProductCardOrderEnum_1.default.afterFirstFocusElement};\n\t\t\t\tdisplay: flex;\n\t\t\t\tz-index: 1;\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: ${spacing.space100 / 16}rem;\n\t\t\t\tleft: ${spacing.space100 / 16}rem;\n\t\t\t\tright: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.checkboxIconContainer {\n\t\t\t\tjustify-content: flex-end;\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\n\t\t\t.availabilityContent {\n\t\t\t\torder: ${ProductCardOrderEnum_1.default.afterFirstFocusElement};\n\t\t\t}\n\n\t\t\t.zipAvailabilityStatusIndicator {\n\t\t\t\tmargin-top: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.storeAvailabilityStatusIndicator {\n\t\t\t\tmargin-top: ${(options.hasZipAvailabilities ? 0 : spacing.space50) / 16}rem;\n\t\t\t}\n\n\t\t\t.productVariants {\n\t\t\t\torder: ${ProductCardOrderEnum_1.default.afterFirstFocusElement};\n\t\t\t\tmargin-top: ${spacing.space75 / 16}rem;\n\t\t\t}\n\n\t\t\t.priceModuleWrapper kompis-price-module {\n\t\t\t\tflex-shrink: 1;\n\t\t\t\tflex-grow: 1;\n\t\t\t}\n\n\t\t\t.priceModuleWrapper .separator {\n\t\t\t\twidth: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.priceModuleWrapper .infoIconButton {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tflex-grow: 0;\n\t\t\t}\n\n\t\t\t.infoIconButton skapa-icon-button {\n\t\t\t\tposition: relative;\n\t\t\t}\n\n\t\t\t.productVariants h4 {\n\t\t\t\tmargin: 0;\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t\tfont-weight: normal;\n\t\t\t}\n\n\t\t\tkompis-function-icon {\n\t\t\t\tdisplay: block;\n\t\t\t\twidth: ${FUNCTION_ICON_SIZE / 16}rem;\n\t\t\t\tmargin: ${spacing.space25 / 16}rem;\n\t\t\t}\n\n\t\t\tskapa-status {\n\t\t\t\tmin-height: ${22 / 16}rem;\n\t\t\t}\n\n\t\t\t.visuallyHidden:not(:focus):not(:active) {\n\t\t\t\tclip: rect(0 0 0 0);\n\t\t\t\tclip-path: inset(50%);\n\t\t\t\theight: ${1 / 16}rem;\n\t\t\t\toverflow: hidden;\n\t\t\t\tposition: absolute;\n\t\t\t\twhite-space: nowrap;\n\t\t\t\twidth: ${1 / 16}rem;\n\t\t\t}\n\n\t\t\t${this.getOutlineStyle(options)}\n\t\t`;\n }\n /**\n * Returns the outline style when focusing.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @param options.hasFocus Has focus.\n * @param options.selectedState Selected state.\n * @param options.layout Layout.\n * @param options.selectBehaviour Select behaviour.\n * @returns Styles.\n */\n static getOutlineStyle(options) {\n const { focusOutline, motion, border } = options.theme;\n const isVisible = options.hasFocus ||\n (options.selectedState === ProductCardSelectedStateEnum_1.default.outline &&\n options.selectBehaviour === ProductCardSelectBehaviourEnum_1.default.selectable &&\n options.layout === ProductCardLayoutEnum_1.default.list);\n return (0, web_component_1.css) `\n\t\t\t.outline {\n\t\t\t\tz-index: inherit;\n\t\t\t\tpointer-events: none;\n\t\t\t\ttransition-property: top, left, right, bottom, opacity;\n\t\t\t\ttransition-duration: ${motion.duration.large};\n\t\t\t\tborder-radius: ${border.radius.radius4 / 16}rem;\n\t\t\t\tposition: absolute;\n\t\t\t\tbox-shadow: 0 0 0 ${focusOutline.width / 16}rem ${focusOutline.color};\n\t\t\t\tleft: -${focusOutline.offset / 16}rem;\n\t\t\t\ttop: -${focusOutline.offset / 16}rem;\n\t\t\t\tright: -${focusOutline.offset / 16}rem;\n\t\t\t\tbottom: -${focusOutline.offset / 16}rem;\n\t\t\t\topacity: ${isVisible ? 1 : 0};\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = ListGalleryCardStyle;\n//# sourceMappingURL=ListGalleryCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/* eslint-disable lit-a11y/click-events-have-key-events */\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_function_icon_1 = require(\"@inter-ikea-kompis/component-function-icon\");\nconst ImageAspectRatioEnum_1 = __importDefault(require(\"@inter-ikea-kompis/component-image/lib/enums/ImageAspectRatioEnum\"));\nconst component_price_module_1 = require(\"@inter-ikea-kompis/component-price-module\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@inter-ikea-kompis/component-price-module\");\nrequire(\"@inter-ikea-kompis/component-function-icon\");\nrequire(\"@inter-ikea-kompis/component-image\");\nrequire(\"@ingka/status-webc\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/tooltip-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/icon-store/checkmark\");\nrequire(\"@ingka/icon-store/information-circle\");\nrequire(\"../product-card-media/ProductCardMedia\");\nrequire(\"../product-card-variants/ProductCardVariants\");\nconst ListGalleryCardMediaEnum_1 = __importDefault(require(\"../../enums/ListGalleryCardMediaEnum\"));\nconst ProductCardInfoIconButtonLinkTargetEnum_1 = __importDefault(require(\"../../enums/ProductCardInfoIconButtonLinkTargetEnum\"));\nconst ProductCardLayoutEnum_1 = __importDefault(require(\"../../enums/ProductCardLayoutEnum\"));\nconst ProductCardPriceLayoutTypeEnum_1 = __importDefault(require(\"../../enums/ProductCardPriceLayoutTypeEnum\"));\nconst ProductCardSelectBehaviourEnum_1 = __importDefault(require(\"../../enums/ProductCardSelectBehaviourEnum\"));\nconst ProductCardSelectedStateEnum_1 = __importDefault(require(\"../../enums/ProductCardSelectedStateEnum\"));\nconst ListGalleryCardStyle_1 = __importDefault(require(\"./ListGalleryCardStyle\"));\n/**\n * Product card list and gallery card component.\n *\n * @event modalClose Triggered when the modal should be closed.\n * @event modalOpen Triggered when a modal should be opened. \"event.detail.visibleModal\" tells you what modal that should be opened.\n * @event infoIconButtonClick Triggered when the info icon button is clicked. Only available when layout is set to \"list\".\n * @event productVariantClick Triggered when a product variant thumbnail is clicked.\n * @event productVariantShowMoreClick Triggered when the show more variants button is clicked.\n * @event select Triggered when the user clicks the card and selects it, or by pressing the Enter or the Space key after selecting it with tab.\n */\nlet ListGalleryCard = class ListGalleryCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Defines the overall layout of the card.\n this.layout = ProductCardLayoutEnum_1.default.list;\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Optional array of function icons.\n this.functionIcons = null;\n // The aspect ratio that the images should adopt.\n this.imageAspectRatio = ImageAspectRatioEnum_1.default.ORIGINAL;\n // Defines the image sort order. When only one image is being displayed, the first image matching the type is used.\n this.imageSortOrder = null;\n // Defines the image sort order for the image displayed on hover when \"media\" is set to \"switchImageOnHover\".\n this.hoverImageSortOrder = [\n enums_1.ImageTypeNameEnum.functionalProductPicture,\n enums_1.ImageTypeNameEnum.contextProductPicture\n ];\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // Info icon button link URL. Only available when layout is set to \"list\".\n this.infoIconButtonLinkUrl = null;\n // Shows an info icon button. Only available when layout is set to \"list\".\n this.showInfoIconButton = false;\n // Info icon button link target. Only available when layout is set to \"list\".\n this.infoIconButtonLinkTarget = ProductCardInfoIconButtonLinkTargetEnum_1.default.self;\n // Optional array of type IProduct used for variations of a product when card should represent multiple variations, i.e for auto adapt products. Price of cheapest variation will be shown as \"from price\". Only available when layout is set to \"list\".\n this.productVariations = null;\n // Price module layout type.\n this.priceModuleLayout = ProductCardPriceLayoutTypeEnum_1.default.default;\n // When enabled it is possible select the product card using keyboard or mouse. Set selected state with the \"selectedState\" attribute when using the \"list\" layout.\n this.selectBehaviour = ProductCardSelectBehaviourEnum_1.default.disabled;\n // Show a modal of type ProductCardModalEnum.\n this.visibleModal = null;\n // Product measures.\n this.productMeasures = utilities_1.ProductDescriptionProductMeasureEnum.none;\n // Show text describing the color and/or material of the product.\n this.showDesignText = false;\n // Show product package weight info.\n this.showWeight = false;\n // Sets how media should be displayed.\n this.media = ListGalleryCardMediaEnum_1.default.singleImage;\n // Show price excl tax.\n this.showPriceExclTax = false;\n // Show product package measures.\n this.showPackageMeasures = false;\n // Selected state. Only available when layout is set to \"list\".\n this.selectedState = ProductCardSelectedStateEnum_1.default.unselected;\n // Optional array of type IProduct used for products included in the main product, i.e. child products. Needed for price to be calculated and displayed for an assembly product (ASP). Products included in all variations is needed when card should represent multiple variations of an assembly product.\n this.includedProducts = null;\n // Zip availability for the product(s). Object or array. Array is used when card should represent multiple variations of a product (array with availability for all variations), an assembly product (ASP) (array of availabilty for all child items) or multiple variations of assembly products (array of availabilty for all child items of all variations).\n this.zipAvailability = null;\n // Store availability for the product(s). Object or array. Array is used when card should represent multiple variations of a product (array with availability for all variations), an assembly product (ASP) (array of availabilty for all child items) or multiple variations of assembly products (array of availabilty for all child items of all variations).\n this.storeAvailability = null;\n // Stores. Used for availability status indicator.\n this.stores = null;\n // Selected store id. Used for availability status indicator.\n this.storeId = null;\n // Aria label that will be read up together with the product name and description. Only rendered when selectedState = checkbox. Tells the user that, when navigating to the product card, it has the \"checkbox icon\". What that means depends on how you have implemented it in your planner.\n this.selectedStateAriaLabel = null;\n // Shows a label that tells the customer that there are more options available.\n this.showProductVariants = false;\n // Optional array of type IProduct which will be displayed as \"More options available\".\n this.productVariants = null;\n // Number of product variant thumbnails to initially show. All product variant thumbnails can be expanded.\n this.productVariantsLimit = null;\n this.isHovered = false;\n this.isPointerDown = false;\n this.hasFocus = false;\n this.dexfSettings = null;\n this.debounce = new utilities_1.DebounceManager();\n }\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n this.priceModuleShoppingProducts = this.getPriceModuleShoppingProducts();\n if (!this.priceModuleShoppingProducts) {\n // If we fail to provide price module with shopping products (i.e. failing to show price when expected), we should not show the card at all.\n return null;\n }\n return (0, web_component_1.html) `${this.getCard()}`;\n }\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return !!this.localizedInformation || !!(this.translations && this.settings);\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n getSettings() {\n return this.dexfSettings;\n }\n getCard() {\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t${this.getContainer()}\n\t\t\t
    `;\n }\n getContainer() {\n const content = [\n this.getPriceModuleWrapper(),\n this.getMedia(),\n this.getFunctionIcons(),\n this.getCheckboxWrapper(),\n this.getAvailabilityContent(),\n this.getProductVariants()\n ];\n // eslint-disable-next-line lit-a11y/mouse-events-have-key-events\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${content}\n\t\t\t\n\t\t`;\n }\n getAvailabilityContent() {\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${this.getZipAvailabilityStatusIndicator()}${this.getStoreAvailabilityStatusIndicator()}\n\t\t\t
    \n\t\t`;\n }\n getMedia() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n }\n getPriceModuleWrapper() {\n const infoIconButton = this.getInfoIconButton();\n const priceModule = this.getPriceModule();\n if (!priceModule && !infoIconButton) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${priceModule}\n\t\t\t\t
    \n\t\t\t\t${infoIconButton}\n\t\t\t
    \n\t\t`;\n }\n getPriceModule() {\n var _a;\n if (!this.priceModuleShoppingProducts) {\n return null;\n }\n const priceForMultipleProducts = utilities_1.ProductUtility.shouldCalculatePriceFromChildProducts(this.product) ||\n this.priceModuleShoppingProducts.length > 1 ||\n this.priceModuleShoppingProducts[0].quantity > 1;\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: {\n visibleModal: event.detail.visibleModal\n }\n }))}\"\n\t\t\t\t@modalClose=\"${() => this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }))}\"\n\t\t\t\t@productNameClick=\"${() => {\n const selectedState = this.getNewSelectState();\n this.debounce.set('productNameClick', () => {\n this.dispatchEvent(new CustomEvent('select', {\n bubbles: true,\n detail: { selectedState }\n }));\n }, 1);\n }}\"\n\t\t\t\t@blur=\"${this.onBlur.bind(this)}\"\n\t\t\t\t@focus=\"${this.onFocus.bind(this)}\"\n\t\t\t\t.disableFocusStyle=\"${true}\"\n\t\t\t\t.shoppingProducts=\"${this.priceModuleShoppingProducts}\"\n\t\t\t\t.localizedInformation=\"${this.localizedInformation}\"\n\t\t\t\t.translations=\"${this.translations}\"\n\t\t\t\t.settings=\"${this.settings}\"\n\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t.layout=\"${this.priceModuleLayout}\"\n\t\t\t\t.productName=\"${(_a = this.product.content) === null || _a === void 0 ? void 0 : _a.name}\"\n\t\t\t\t.isFromPrice=\"${this.isAutoAdapt()}\"\n\t\t\t\t.productLink=\"${this.getProductLinkState()}\"\n\t\t\t\t.visibleModal=\"${this.visibleModal}\"\n\t\t\t\t.disableLinks=\"${this.disableLinks}\"\n\t\t\t\t.showPriceUnit=\"${!priceForMultipleProducts}\"\n\t\t\t\t.showEcoFee=\"${true}\"\n\t\t\t\t.showPriceExclTax=\"${this.showPriceExclTax}\"\n\t\t\t\t.showEnergyLabel=\"${!priceForMultipleProducts}\"\n\t\t\t\t.showRepairabilityIndex=\"${!priceForMultipleProducts}\"\n\t\t\t\t.underline=\"${this.isHovered}\"\n\t\t\t\t.showLowestPreviousSalesPrice=\"${!priceForMultipleProducts}\"\n\t\t\t\t.isCombinedProduct=\"${priceForMultipleProducts}\"\n\t\t\t>\n\t\t\t\t${this.getDescription()} ${this.getSelectedStateAriaLabel()}\n\t\t\t\n\t\t`;\n }\n getPriceModuleShoppingProducts() {\n var _a, _b, _c;\n if (this.isAutoAdapt()) {\n // Return variation with lowest price or child products for variation with lowest price\n // If not possible to calculate price for any variation, null is returned\n const variationsShoppingProductGroups = this.getShoppingProductGroupsForVariations();\n return utilities_1.PriceUtility.getShoppingProductsWithLowestTotalRegularPrice(variationsShoppingProductGroups);\n }\n if (utilities_1.ProductUtility.shouldCalculatePriceFromChildProducts(this.product)) {\n // Return child products if it is possible to calculate price from them (i.e. we have price data for all),\n // otherwise null is returned\n const includedShoppingProducts = utilities_1.ProductUtility.getIncludedShoppingProducts({\n product: this.product,\n includedProducts: (_a = this.includedProducts) !== null && _a !== void 0 ? _a : [],\n ignoreInvalidProducts: true\n });\n return includedShoppingProducts.length > 0 &&\n includedShoppingProducts.length === ((_c = (_b = this.product.content) === null || _b === void 0 ? void 0 : _b.child) === null || _c === void 0 ? void 0 : _c.length)\n ? includedShoppingProducts\n : null;\n }\n // Return main product\n return [{ quantity: 1, product: this.product }];\n }\n /**\n * Creates an array of arrays of shopping products, one array with shopping products for each variation.\n *\n * If variation is a product where price should be calculated from child products,\n * variation array will contain shopping products for those child products. Unless price can not be\n * calculated for the variation (e.g. One child product missing price), then array for variation is omitted.\n *\n * If variation is a product with price, variation array will contain a shopping product for the variation itself.\n *\n * @returns Array of arrays of shopping products, one array with shopping products for each variation.\n */\n getShoppingProductGroupsForVariations() {\n if (!this.productVariations) {\n return [];\n }\n return this.productVariations\n .map((variation) => {\n var _a, _b, _c;\n if (utilities_1.ProductUtility.shouldCalculatePriceFromChildProducts(variation)) {\n // Get shopping products for all child products of the variation\n const variationIncludedShoppingProducts = utilities_1.ProductUtility.getIncludedShoppingProducts({\n product: variation,\n includedProducts: (_a = this.includedProducts) !== null && _a !== void 0 ? _a : []\n });\n return variationIncludedShoppingProducts.length > 0 &&\n variationIncludedShoppingProducts.length === ((_c = (_b = variation.content) === null || _b === void 0 ? void 0 : _b.child) === null || _c === void 0 ? void 0 : _c.length)\n ? variationIncludedShoppingProducts\n : null;\n }\n else {\n return [{ quantity: 1, product: variation }];\n }\n })\n .filter((shoppingProducts) => !!shoppingProducts);\n }\n getSelectedStateAriaLabel() {\n if (this.selectedStateAriaLabel &&\n this.selectedState === ProductCardSelectedStateEnum_1.default.checkbox &&\n this.selectBehaviour === ProductCardSelectBehaviourEnum_1.default.selectable) {\n return (0, web_component_1.html) `${this.selectedStateAriaLabel}`;\n }\n return null;\n }\n getProductLinkState() {\n var _a;\n const itemTypesWithLink = [enums_1.ItemTypeEnum.art, enums_1.ItemTypeEnum.spr];\n const productItemType = (_a = this.product.content) === null || _a === void 0 ? void 0 : _a.itemType;\n if (productItemType &&\n !itemTypesWithLink.includes(productItemType) &&\n this.selectBehaviour === ProductCardSelectBehaviourEnum_1.default.productInformationPageLink) {\n return component_price_module_1.PriceModuleProductLinkEnum.disabled;\n }\n if (this.selectBehaviour === ProductCardSelectBehaviourEnum_1.default.productInformationPageLink &&\n !this.disableLinks) {\n return component_price_module_1.PriceModuleProductLinkEnum.productInformationPage;\n }\n else if (this.selectBehaviour === ProductCardSelectBehaviourEnum_1.default.selectable) {\n return component_price_module_1.PriceModuleProductLinkEnum.eventOnly;\n }\n return component_price_module_1.PriceModuleProductLinkEnum.disabled;\n }\n getDescription() {\n return utilities_1.ProductDescriptionUtility.getDescription({\n settings: this.getSettings(),\n translations: this.getTranslations(),\n product: this.product,\n include: {\n productMeasures: this.productMeasures,\n designText: this.showDesignText,\n packageMeasures: this.showPackageMeasures,\n weight: this.showWeight\n }\n });\n }\n getInfoIconButton() {\n if (this.layout !== ProductCardLayoutEnum_1.default.list || !this.showInfoIconButton) {\n return null;\n }\n const tertiaryVariant = 'tertiary';\n const { informationViewMoreInformation } = this.getTranslations();\n if (this.disableLinks || !this.infoIconButtonLinkUrl) {\n return (0, web_component_1.html) `\n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t\t\t {\n event.preventDefault();\n event.stopPropagation();\n this.dispatchEvent(new CustomEvent('infoIconButtonClick', {\n bubbles: true,\n detail: { product: this.product }\n }));\n }}\"\n\t\t\t\t\t\t\tvariant=\"${tertiaryVariant}\"\n\t\t\t\t\t\t\txsmall\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t${informationViewMoreInformation}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t${informationViewMoreInformation}\n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t`;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t {\n event.stopPropagation();\n this.dispatchEvent(new CustomEvent('infoIconButtonClick', {\n bubbles: true,\n detail: { product: this.product }\n }));\n }}\"\n\t\t\t\t\tclass=\"infoIconButton\"\n\t\t\t\t\thref=\"${this.infoIconButtonLinkUrl}\"\n\t\t\t\t\t?new-window=\"${this.infoIconButtonLinkTarget ===\n ProductCardInfoIconButtonLinkTargetEnum_1.default.blank}\"\n\t\t\t\t\txsmall\n\t\t\t\t\tvariant=\"${tertiaryVariant}\"\n\t\t\t\t>\n\t\t\t\t\t${informationViewMoreInformation}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t${informationViewMoreInformation}\n\t\t\t\n\t\t`;\n }\n getFunctionIcons() {\n if (!this.functionIcons) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${this.functionIcons.map((icon) => (0, web_component_1.html) `\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t`)}\n\t\t\t
    \n\t\t`;\n }\n getCheckboxWrapper() {\n return (0, web_component_1.html) `
    ${this.getCheckboxIcon()}
    `;\n }\n getCheckboxIcon() {\n if (this.selectBehaviour !== ProductCardSelectBehaviourEnum_1.default.selectable ||\n this.selectedState !== ProductCardSelectedStateEnum_1.default.checkbox ||\n this.layout !== ProductCardLayoutEnum_1.default.list) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n getZipAvailabilityStatusIndicator() {\n if (!this.zipAvailability) {\n return null;\n }\n return this.getStatusIndicator(utilities_1.ZipAvailabilityUtility.getLabel({\n translations: this.getTranslations(),\n zipAvailability: this.zipAvailability\n }), utilities_1.ZipAvailabilityUtility.getColor({\n zipAvailability: this.zipAvailability\n }));\n }\n getStatusIndicator(statusLabel, statusColor) {\n if (!statusColor) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${statusLabel}\n\t\t\t
    \n\t\t`;\n }\n getStoreAvailabilityStatusIndicator() {\n var _a, _b;\n const store = ((_a = this.stores) === null || _a === void 0 ? void 0 : _a.find((store) => store.id === this.storeId)) || null;\n if (!this.storeAvailability || !this.stores || !(store === null || store === void 0 ? void 0 : store.name)) {\n return null;\n }\n const statusLabel = (_b = utilities_1.AvailabilityUtility.getStoreAvailabilityLabel({\n translations: this.getTranslations(),\n storeAvailability: this.storeAvailability\n })) === null || _b === void 0 ? void 0 : _b.replace('[[store]]', store.name).replace('{{store}}', store.name);\n const statusColor = utilities_1.AvailabilityUtility.getStoreAvailabilityStatusColor(this.storeAvailability);\n if (!statusLabel || !statusColor) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${statusLabel}\n\t\t\t
    \n\t\t`;\n }\n getProductVariants() {\n const isAutoAdapt = this.isAutoAdapt();\n if (!this.showProductVariants || isAutoAdapt) {\n return null;\n }\n const productVariantsHeader = () => {\n if (this.layout === ProductCardLayoutEnum_1.default.gallery && !this.productVariants) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\t

    \n\t\t\t\t\t${this.getTranslations().productCardMoreOptionsAvailable}\n\t\t\t\t

    \n\t\t\t`;\n };\n const showProductVariants = () => {\n if (!this.productVariants || !this.productVariants.length) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\t {\n this.dispatchEvent(new CustomEvent('productVariantClick', { bubbles: true, detail: event.detail }));\n }}\"\n\t\t\t\t\t@showMoreClick=\"${() => {\n this.dispatchEvent(new CustomEvent('productVariantShowMoreClick', {\n bubbles: true,\n detail: { product: this.product }\n }));\n }}\"\n\t\t\t\t\t.localizedInformation=\"${this.localizedInformation}\"\n\t\t\t\t\t.translations=\"${this.translations}\"\n\t\t\t\t\t.settings=\"${this.settings}\"\n\t\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t\t.limit=\"${this.productVariantsLimit}\"\n\t\t\t\t\t.products=\"${this.productVariants}\"\n\t\t\t\t>\n\t\t\t`;\n };\n return (0, web_component_1.html) `\n\t\t\t
    ${productVariantsHeader()} ${showProductVariants()}
    \n\t\t`;\n }\n isAutoAdapt() {\n return (this.layout === ProductCardLayoutEnum_1.default.list &&\n !!this.productVariations &&\n this.productVariations.length > 0);\n }\n getNewSelectState() {\n if (this.layout !== ProductCardLayoutEnum_1.default.list) {\n return null;\n }\n return this.selectedState === ProductCardSelectedStateEnum_1.default.unselected\n ? ProductCardSelectedStateEnum_1.default.checkbox\n : ProductCardSelectedStateEnum_1.default.unselected;\n }\n hasProductActionElement() {\n return component_price_module_1.PriceModuleUtility.showInteractiveProductName(this.getProductLinkState(), this.disableLinks);\n }\n onClick(event) {\n var _a, _b;\n const productActionElement = (_b = (_a = this.shadowRoot\n .querySelector('kompis-price-module')) === null || _a === void 0 ? void 0 : _a.shadowRoot.querySelector('.actionElement')) !== null && _b !== void 0 ? _b : null;\n if (productActionElement !== event.target) {\n productActionElement === null || productActionElement === void 0 ? void 0 : productActionElement.click();\n }\n }\n onMouseOver() {\n if (this.isHovered || !this.hasProductActionElement()) {\n return;\n }\n this.isHovered = true;\n this.requestUpdate();\n }\n onMouseLeave() {\n if (!this.isHovered || !this.hasProductActionElement()) {\n return;\n }\n this.isHovered = false;\n this.requestUpdate();\n }\n onPointerDown() {\n if (!this.hasProductActionElement()) {\n return;\n }\n this.isPointerDown = true;\n if (this.hasFocus) {\n this.hasFocus = false;\n this.requestUpdate();\n }\n }\n onFocus() {\n if (this.isPointerDown) {\n return;\n }\n this.hasFocus = true;\n this.requestUpdate();\n }\n onBlur() {\n this.hasFocus = false;\n this.isPointerDown = false;\n this.requestUpdate();\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ListGalleryCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ListGalleryCard.prototype, \"product\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ListGalleryCard.prototype, \"layout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ListGalleryCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ListGalleryCard.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ListGalleryCard.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ListGalleryCard.prototype, \"functionIcons\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ListGalleryCard.prototype, \"imageAspectRatio\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ListGalleryCard.prototype, \"imageSortOrder\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ListGalleryCard.prototype, \"hoverImageSortOrder\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ListGalleryCard.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ListGalleryCard.prototype, \"infoIconButtonLinkUrl\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ListGalleryCard.prototype, \"showInfoIconButton\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ListGalleryCard.prototype, \"infoIconButtonLinkTarget\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ListGalleryCard.prototype, \"productVariations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ListGalleryCard.prototype, \"priceModuleLayout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ListGalleryCard.prototype, \"selectBehaviour\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ListGalleryCard.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ListGalleryCard.prototype, \"productMeasures\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ListGalleryCard.prototype, \"showDesignText\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ListGalleryCard.prototype, \"showWeight\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ListGalleryCard.prototype, \"media\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ListGalleryCard.prototype, \"showPriceExclTax\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ListGalleryCard.prototype, \"showPackageMeasures\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ListGalleryCard.prototype, \"selectedState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ListGalleryCard.prototype, \"includedProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ListGalleryCard.prototype, \"zipAvailability\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ListGalleryCard.prototype, \"storeAvailability\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ListGalleryCard.prototype, \"stores\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ListGalleryCard.prototype, \"storeId\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ListGalleryCard.prototype, \"selectedStateAriaLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ListGalleryCard.prototype, \"showProductVariants\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ListGalleryCard.prototype, \"productVariants\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], ListGalleryCard.prototype, \"productVariantsLimit\", void 0);\nListGalleryCard = __decorate([\n (0, web_component_1.customElement)('kompis-list-gallery-card')\n], ListGalleryCard);\nexports.default = ListGalleryCard;\n//# sourceMappingURL=ListGalleryCard.js.map","import \"@inter-ikea-kompis/component-product-card/lib/components/list-gallery-card/ListGalleryCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisListGalleryCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-list-gallery-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.disableLinks = props.disableLinks;\n element.functionIcons = props.functionIcons;\n element.hoverImageSortOrder = props.hoverImageSortOrder;\n element.imageAspectRatio = props.imageAspectRatio;\n element.imageSortOrder = props.imageSortOrder;\n element.includedProducts = props.includedProducts;\n element.infoIconButtonLinkTarget = props.infoIconButtonLinkTarget;\n element.infoIconButtonLinkUrl = props.infoIconButtonLinkUrl;\n element.layout = props.layout;\n element.localizedInformation = props.localizedInformation;\n element.media = props.media;\n element.priceModuleLayout = props.priceModuleLayout;\n element.product = props.product;\n element.productMeasures = props.productMeasures;\n element.productVariants = props.productVariants;\n element.productVariantsLimit = props.productVariantsLimit;\n element.productVariations = props.productVariations;\n element.selectBehaviour = props.selectBehaviour;\n element.selectedState = props.selectedState;\n element.selectedStateAriaLabel = props.selectedStateAriaLabel;\n element.settings = props.settings;\n element.showDesignText = props.showDesignText;\n element.showInfoIconButton = props.showInfoIconButton;\n element.showPackageMeasures = props.showPackageMeasures;\n element.showPriceExclTax = props.showPriceExclTax;\n element.showProductVariants = props.showProductVariants;\n element.showWeight = props.showWeight;\n element.storeAvailability = props.storeAvailability;\n element.storeId = props.storeId;\n element.stores = props.stores;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n element.zipAvailability = props.zipAvailability;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onInfoIconButtonClick, \"infoIconButtonClick\");\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n this.updateEventListener(element, props.onProductVariantClick, \"productVariantClick\");\n this.updateEventListener(element, props.onProductVariantShowMoreClick, \"productVariantShowMoreClick\");\n this.updateEventListener(element, props.onSelect, \"select\");\n }\n}\nKompisListGalleryCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n disableLinks: PropTypes.bool,\n functionIcons: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n hoverImageSortOrder: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n imageAspectRatio: PropTypes.string,\n imageSortOrder: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n includedProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n infoIconButtonLinkTarget: PropTypes.string,\n infoIconButtonLinkUrl: PropTypes.string,\n layout: PropTypes.string,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n media: PropTypes.string,\n priceModuleLayout: PropTypes.string,\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n productMeasures: PropTypes.string,\n productVariants: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n productVariantsLimit: PropTypes.number,\n productVariations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n selectBehaviour: PropTypes.string,\n selectedState: PropTypes.string,\n selectedStateAriaLabel: PropTypes.string,\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n showDesignText: PropTypes.bool,\n showInfoIconButton: PropTypes.bool,\n showPackageMeasures: PropTypes.bool,\n showPriceExclTax: PropTypes.bool,\n showProductVariants: PropTypes.bool,\n showWeight: PropTypes.bool,\n storeAvailability: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n storeId: PropTypes.string,\n stores: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n zipAvailability: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n onModalClose: PropTypes.func,\n onModalOpen: PropTypes.func,\n onInfoIconButtonClick: PropTypes.func,\n onProductVariantClick: PropTypes.func,\n onProductVariantShowMoreClick: PropTypes.func,\n onSelect: PropTypes.func\n};\nexport default KompisListGalleryCard;\n","import \"@inter-ikea-kompis/component-product-card/lib/components/product-card-media/ProductCardMedia\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisProductCardMedia extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-product-card-media\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.carouselSelectedIndex = props.carouselSelectedIndex;\n element.carouselShowAll = props.carouselShowAll;\n element.carouselShowArrows = props.carouselShowArrows;\n element.carouselShowScrollbar = props.carouselShowScrollbar;\n element.carouselThumbnailLimit = props.carouselThumbnailLimit;\n element.hoverImageSortOrder = props.hoverImageSortOrder;\n element.hovered = props.hovered;\n element.imageAspectRatio = props.imageAspectRatio;\n element.imageSortOrder = props.imageSortOrder;\n element.localizedInformation = props.localizedInformation;\n element.media = props.media;\n element.product = props.product;\n element.theme = props.theme;\n element.translations = props.translations;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onCarouselChange, \"carouselChange\");\n this.updateEventListener(element, props.onCarouselShowAllThumbnails, \"carouselShowAllThumbnails\");\n }\n}\nKompisProductCardMedia.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n carouselSelectedIndex: PropTypes.number,\n carouselShowAll: PropTypes.bool,\n carouselShowArrows: PropTypes.bool,\n carouselShowScrollbar: PropTypes.bool,\n carouselThumbnailLimit: PropTypes.number,\n hoverImageSortOrder: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n hovered: PropTypes.bool,\n imageAspectRatio: PropTypes.string,\n imageSortOrder: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n media: PropTypes.string,\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n onCarouselChange: PropTypes.func,\n onCarouselShowAllThumbnails: PropTypes.func\n};\nexport default KompisProductCardMedia;\n","import \"@inter-ikea-kompis/component-product-card/lib/components/product-card-variants/ProductCardVariants\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisProductCardVariants extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-product-card-variants\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.limit = props.limit;\n element.localizedInformation = props.localizedInformation;\n element.products = props.products;\n element.settings = props.settings;\n element.theme = props.theme;\n element.translations = props.translations;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onShowMoreClick, \"showMoreClick\");\n this.updateEventListener(element, props.onVariantClick, \"variantClick\");\n }\n}\nKompisProductCardVariants.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n limit: PropTypes.number,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n products: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n onVariantClick: PropTypes.func,\n onShowMoreClick: PropTypes.func\n};\nexport default KompisProductCardVariants;\n","import \"@inter-ikea-kompis/component-product-card/lib/components/product-card-water-sense-image/ProductCardWaterSenseImage\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisProductCardWaterSenseImage extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-product-card-water-sense-image\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.product = props.product;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisProductCardWaterSenseImage.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisProductCardWaterSenseImage;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst analytics_1 = require(\"@inter-ikea-kompis/analytics\");\nconst insights_data_provider_1 = require(\"@insights/insights-data-provider\");\nconst moduleId = 'product_card';\n/**\n * Tracks events from Product Card and sends them to a reporter.\n *\n * @event product_card_carousel_change Triggered when a carousel slide should be changed. Only available when layout is set to \"information\".\n * @event product_card_carousel_show_all_thumbnails Triggered when the show all thumbnails button is clicked in the carousel. Only available when layout is set to \"information\".\n * @event product_card_product_variant_click Triggered when a product variant thumbnail is clicked. Only available when layout is set to \"gallery\".\n * @event product_card_variant_show_more_click Triggered when the show more variants button is clicked. Only available when layout is set to \"gallery\".\n * @event product_card_info_icon_button_click Triggered when the info icon button is clicked. Only available when layout is set to \"list\".\n * @event product_card_selected_product Triggered when the user tabs to the card and selects it by pressing the Enter key. Only available when layout is set to \"list\".\n * @event product_card_store_selector_change Triggered when the user selects a store in the store selector. Only available when layout is set to \"information\".\n * @event product_card_wood_declaration_expand Triggered when the user clicks on the wood declaration accordion. Only available when layout is set to \"information\".\n */\nclass ProductCardTracker extends analytics_1.AbstractAnalyticsTracker {\n constructor(options) {\n super(Object.assign({ moduleId }, options));\n }\n /**\n * Call to report when the image is changed the carousel through either clicking on the thumbnail or arrows in the carousel in Product Card Information.\n *\n * @param carouselChangeDetails\n * @param carouselChangeDetails.carouselSelectedIndex The selected index of the carousel.\n * @param carouselChangeDetails.type How the change was made, either from thumbnail or navigation arrows in the carousel.\n */\n sendCarouselChange(carouselChangeDetails) {\n this.getReporter().report({\n event: 'product_card_carousel_change',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.whatIsMe,\n payload: carouselChangeDetails\n });\n }\n /**\n * Call to report when the button for showing all/show less thumbnails is clicked in Product Card Information.\n *\n * @param carouselShowAll Indicating whether or not to show all thumbnails.\n */\n sendCarouselShowAllThumbnails(carouselShowAll) {\n this.getReporter().report({\n event: 'product_card_carousel_show_all_thumbnails',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.whatIsMe,\n payload: { carouselShowAll }\n });\n }\n /**\n * Call to report when clicking on a product variant in Product Card Gallery.\n *\n * @param selectedProduct RuItemNo of the product.\n */\n sendProductVariantClick(selectedProduct) {\n this.getReporter().report({\n event: 'product_card_product_variant_click',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.whatIsMe,\n payload: { selectedProduct }\n });\n }\n /**\n * Call to report when the button for showing more product variants is clicked in Product Card Gallery.\n *\n * @param product RuItemNo of the product.\n */\n sendProductVariantShowMoreClick(product) {\n this.getReporter().report({\n event: 'product_card_variant_show_more_click',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.whatIsMe,\n payload: { product }\n });\n }\n /**\n * Call to report when the info icon button is clicked in the Product Card List.\n *\n * @param product RuItemNo of the product.\n */\n sendInfoIconButtonClick(product) {\n this.getReporter().report({\n event: 'product_card_info_icon_button_click',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.whatIsMe,\n payload: { product }\n });\n }\n /**\n * Call to report when selecting a product in Product Card List.\n *\n * @param selectedState The selected state of the product card, either 'checkbox' or 'unselected'.\n */\n sendSelectedProduct(selectedState) {\n this.getReporter().report({\n event: 'product_card_selected_product',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.makeItMe,\n payload: { selectedState }\n });\n }\n /**\n * Call to report when the store selector is changed in Product Card Information.\n *\n * @param storeSelectorChangeDetails\n * @param storeSelectorChangeDetails.storeId The storeId of the chosen store.\n * @param storeSelectorChangeDetails.product RuItemNo of the product.\n */\n sendStoreSelectorChange(storeSelectorChangeDetails) {\n this.getReporter().report({\n event: 'product_card_store_selector_change',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe,\n payload: storeSelectorChangeDetails\n });\n }\n /**\n * Call to report when the wood declaration accordion has been pressed in Product Card Information.\n *\n * @param expand Indicating whether or not the wood declaration accordion was pressed.\n */\n sendWoodDeclarationExpand(expand) {\n this.getReporter().report({\n event: 'product_card_wood_declaration_expand',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.whatIsMe,\n payload: { expand }\n });\n }\n}\nexports.default = ProductCardTracker;\n//# sourceMappingURL=ProductCardTracker.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_home_delivery_1 = require(\"@inter-ikea-kompis/component-home-delivery\");\nconst ImageAspectRatioEnum_1 = __importDefault(require(\"@inter-ikea-kompis/component-image/lib/enums/ImageAspectRatioEnum\"));\nrequire(\"../information-card/InformationCard\");\nrequire(\"../list-gallery-card/ListGalleryCard\");\nconst ListGalleryCardMediaEnum_1 = __importDefault(require(\"../../enums/ListGalleryCardMediaEnum\"));\nconst ProductCardInfoIconButtonLinkTargetEnum_1 = __importDefault(require(\"../../enums/ProductCardInfoIconButtonLinkTargetEnum\"));\nconst ProductCardLayoutEnum_1 = __importDefault(require(\"../../enums/ProductCardLayoutEnum\"));\nconst ProductCardMediaEnum_1 = __importDefault(require(\"../../enums/ProductCardMediaEnum\"));\nconst ProductCardPriceLayoutTypeEnum_1 = __importDefault(require(\"../../enums/ProductCardPriceLayoutTypeEnum\"));\nconst ProductCardSelectBehaviourEnum_1 = __importDefault(require(\"../../enums/ProductCardSelectBehaviourEnum\"));\nconst ProductCardSelectedStateEnum_1 = __importDefault(require(\"../../enums/ProductCardSelectedStateEnum\"));\nconst ProductCardTracker_1 = __importDefault(require(\"../../trackers/ProductCardTracker\"));\n/**\n * Product card component.\n *\n * @event modalClose Triggered when the modal should be closed.\n * @event modalOpen Triggered when a modal should be opened. \"event.detail.visibleModal\" tells you what modal that should be opened.\n * @event carouselChange Triggered when a carousel slide should be changed. Only available when layout is set to \"information\".\n * @event carouselShowAllThumbnails Triggered when the show all thumbnails button is clicked in the carousel. Only available when layout is set to \"information\".\n * @event productVariantClick Triggered when a product variant thumbnail is clicked. Only available when layout is set to \"gallery\".\n * @event productVariantShowMoreClick Triggered when the show more variants button is clicked. Only available when layout is set to \"gallery\".\n * @event infoIconButtonClick Triggered when the info icon button is clicked. Only available when layout is set to \"list\".\n * @event select Triggered when the user tabs to the card and selects it by pressing the Enter or the Space key. Only available when layout is set to \"list\" or \"gallery\".\n * @event storeSelectorChange Triggered when the user selects a store in the store selector. Only available when layout is set to \"information\".\n * @event homeDeliveryStartOverClick User clicks on the start over link or the back button.\n * @event homeDeliveryForgetClick User clicks on the forget link from Home Delivery.\n * @event homeDeliveryInput Input of zip code.\n * @event homeDeliverySubmitButtonClick User clicks the Check availability button.\n */\nlet ProductCard = class ProductCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Defines the overall layout of the card.\n this.layout = ProductCardLayoutEnum_1.default.list;\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Optional array of function icons.\n this.functionIcons = null;\n // Optional array of type IProduct which will be displayed as \"More options available\". Only available when layout is set to \"gallery\" or \"list\".\n this.productVariants = null;\n // Optional array of type IProduct used for variations of a product when card should represent multiple variations, i.e for auto adapt products. Price of cheapest variation will be shown as \"from price\". Only available when layout is set to \"list\".\n this.productVariations = null;\n // Product variants limit. Only available when layout is set to \"gallery\" or \"list\".\n this.productVariantsLimit = null;\n // Optional array of type IProduct used for products included in the main product, i.e. child products. Needed for price to be calculated and displayed for an assembly product (ASP). Products included in all variations is needed when card should represent multiple variations of an assembly product.\n this.includedProducts = null;\n // Store availability for the product(s). Object or array. Array is used when card should represent multiple variations of a product (array with availability for all variations), an assembly product (ASP) (array of availabilty for all child items) or multiple variations of assembly products (array of availabilty for all child items of all variations).\n this.storeAvailability = null;\n // Zip availability for the product(s). Object or array. Array is used when card should represent multiple variations of a product (array with availability for all variations), an assembly product (ASP) (array of availabilty for all child items) or multiple variations of assembly products (array of availabilty for all child items of all variations).\n this.zipAvailability = null;\n // Show a modal of type ProductCardModalEnum.\n this.visibleModal = null;\n // Sets how media should be displayed. The carousel option is only available when layout is set to \"information\".\n this.media = ProductCardMediaEnum_1.default.singleImage;\n // Selected index of the carousel slides. Only available when layout is set to \"information\".\n this.carouselSelectedIndex = 0;\n // Max limit of thumbnails to be displayed in the carousel. Only available when layout is set to \"information\".\n this.carouselThumbnailLimit = null;\n // Shows all thumbnails in the carousel when a limit has been set. Only available when layout is set to \"information\".\n this.carouselShowAll = false;\n // Show scrollbar in carousel. Only available when layout is set to \"information\".\n this.carouselShowScrollbar = false;\n // Show arrows in carousel. Only available when layout is set to \"information\".\n this.carouselShowArrows = false;\n // Info icon button link URL. Only available when layout is set to \"list\".\n this.infoIconButtonLinkUrl = null;\n // Info icon button link target. Only available when layout is set to \"list\".\n this.infoIconButtonLinkTarget = ProductCardInfoIconButtonLinkTargetEnum_1.default.self;\n // Selected state. Only available when layout is set to \"list\".\n this.selectedState = ProductCardSelectedStateEnum_1.default.unselected;\n // When enabled it is possible select the product card using keyboard or mouse. Set selected state with the \"selectedState\" attribute when using the \"list\" layout. Only available when layout is set to \"list\" or \"gallery\"\n this.selectBehaviour = ProductCardSelectBehaviourEnum_1.default.disabled;\n // Product measures. Only affects measurements in the product description. Measurement action item will be rendered based on article data.\n this.productMeasures = utilities_1.ProductDescriptionProductMeasureEnum.none;\n // Price module layout type.\n this.priceModuleLayout = ProductCardPriceLayoutTypeEnum_1.default.default;\n // Show product package measures.\n this.showPackageMeasures = false;\n // Show text describing the color and/or material of the product.\n this.showDesignText = false;\n // Show product package weight info.\n this.showWeight = false;\n // Shows a label that tells the customer that there are more options available. Only available when layout is set to \"list\" or \"gallery\".\n this.showProductVariants = false;\n // Shows a product identifier if the layout is set to \"information\". Only available when layout is set to \"information\".\n this.showProductIdentifier = false;\n // Shows an info icon button. Only available when layout is set to \"list\".\n this.showInfoIconButton = false;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // Show price excl tax.\n this.showPriceExclTax = false;\n // Stores. Only available when layout is set to \"information\".\n this.stores = null;\n // Selected store id. Only available when layout is set to \"information\".\n this.storeId = null;\n // Text for product description. Only available when layout is set to \"information\".\n this.productDescription = null;\n // The aspect ratio that the images should adopt.\n this.imageAspectRatio = ImageAspectRatioEnum_1.default.ORIGINAL;\n // Shows the Home delivery component.\n this.showHomeDelivery = false;\n // Card state for Home Delivery\n this.homeDeliveryState = component_home_delivery_1.HomeDeliveryStateEnum.default;\n // Input value for Home Delivery\n this.homeDeliveryInputValue = null;\n // Submitted and validated ZIP code for Home Delivery.\n this.homeDeliveryZipCode = null;\n // Defines the image sort order. When only one image is being displayed, the first image matching the type is used.\n this.imageSortOrder = null;\n // Defines the image sort order for the image displayed on hover when \"media\" is set to \"switchImageOnHover\".\n this.hoverImageSortOrder = [\n enums_1.ImageTypeNameEnum.functionalProductPicture,\n enums_1.ImageTypeNameEnum.contextProductPicture\n ];\n // Aria label that will be read up together with the product name and description. Only rendered when selectedState = checkbox. Tells the user that, when navigating to the product card, it has the \"checkbox icon\". What that means depends on how you have implemented it in your planner.\n this.selectedStateAriaLabel = null;\n // Used for automatic analytics. If null or not set, analytics is turned off.\n this.analytics = null;\n this.tracker = null;\n this.dexfSettings = null;\n }\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n if (!this.product.content) {\n return null;\n }\n switch (this.layout) {\n case ProductCardLayoutEnum_1.default.information:\n return (0, web_component_1.html) `${this.getInformationCard()}`;\n case ProductCardLayoutEnum_1.default.gallery:\n case ProductCardLayoutEnum_1.default.list:\n default:\n return (0, web_component_1.html) `${this.getListGalleryCard()}`;\n }\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.disconnectTracker();\n }\n /**\n * @param changedProperties\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n if (changedProperties.has('analytics') && this.hasTranslationsAndSettings()) {\n this.disconnectTracker();\n this.connectTracker();\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return !!this.localizedInformation || !!(this.translations && this.settings);\n }\n getSettings() {\n return this.dexfSettings;\n }\n connectTracker() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n if (this.analytics) {\n this.tracker = new ProductCardTracker_1.default(Object.assign(Object.assign({}, this.analytics), { settings: this.getSettings() }));\n yield ((_a = this.tracker) === null || _a === void 0 ? void 0 : _a.connect());\n }\n });\n }\n disconnectTracker() {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.disconnect();\n this.tracker = null;\n }\n getInformationCard() {\n return (0, web_component_1.html) ` {\n var _a;\n this.dispatchEvent(new CustomEvent('carouselChange', { bubbles: true, detail: event.detail }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendCarouselChange(event.detail);\n }}\"\n\t\t\t@carouselShowAllThumbnails=\"${(event) => {\n var _a;\n this.dispatchEvent(new CustomEvent('carouselShowAllThumbnails', { bubbles: true, detail: event.detail }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendCarouselShowAllThumbnails(event.detail.carouselShowAll);\n }}\"\n\t\t\t@storeSelectorChange=\"${(event) => {\n var _a, _b;\n this.dispatchEvent(new CustomEvent('storeSelectorChange', {\n bubbles: true,\n detail: event.detail\n }));\n ((_a = this.product.content) === null || _a === void 0 ? void 0 : _a.ruItemNo) &&\n ((_b = this.tracker) === null || _b === void 0 ? void 0 : _b.sendStoreSelectorChange({\n storeId: event.detail.storeId,\n product: this.product.content.ruItemNo\n }));\n }}\"\n\t\t\t@modalClose=\"${(event) => this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: event.detail }))}\"\n\t\t\t@modalOpen=\"${(event) => this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: event.detail\n }))}\"\n\t\t\t@homeDeliverySubmitButtonClick=${() => this.dispatchEvent(new CustomEvent('homeDeliverySubmitButtonClick', { bubbles: true }))}\n\t\t\t@homeDeliveryForgetClick=\"${(event) => {\n this.dispatchEvent(new CustomEvent('homeDeliveryForgetClick', {\n bubbles: true,\n detail: Object.assign({}, event.detail)\n }));\n }}\"\n\t\t\t@homeDeliveryStartOverClick=\"${(event) => {\n this.dispatchEvent(new CustomEvent('homeDeliveryStartOverClick', {\n bubbles: true,\n detail: Object.assign({}, event.detail)\n }));\n }}\"\n\t\t\t@homeDeliveryInput=\"${(event) => {\n this.dispatchEvent(new CustomEvent('homeDeliveryInput', { bubbles: true, detail: Object.assign({}, event.detail) }));\n }}\"\n\t\t\t.theme=\"${this.theme}\"\n\t\t\t.product=\"${this.product}\"\n\t\t\t.includedProducts=\"${this.includedProducts}\"\n\t\t\t.localizedInformation=\"${this.localizedInformation}\"\n\t\t\t.translations=\"${this.translations}\"\n\t\t\t.settings=\"${this.settings}\"\n\t\t\t.media=\"${this.media}\"\n\t\t\t.imageAspectRatio=\"${this.imageAspectRatio}\"\n\t\t\t.imageSortOrder=\"${this.imageSortOrder}\"\n\t\t\t.hoverImageSortOrder=\"${this.hoverImageSortOrder}\"\n\t\t\t.carouselSelectedIndex=\"${this.carouselSelectedIndex}\"\n\t\t\t.carouselThumbnailLimit=\"${this.carouselThumbnailLimit}\"\n\t\t\t.carouselShowAll=\"${this.carouselShowAll}\"\n\t\t\t.carouselShowScrollbar=\"${this.carouselShowScrollbar}\"\n\t\t\t.carouselShowArrows=\"${this.carouselShowArrows}\"\n\t\t\t.functionIcons=\"${this.functionIcons}\"\n\t\t\t.priceModuleLayout=\"${this.priceModuleLayout}\"\n\t\t\t.visibleModal=\"${this.visibleModal}\"\n\t\t\t.disableLinks=\"${this.disableLinks}\"\n\t\t\t.showPriceExclTax=\"${this.showPriceExclTax}\"\n\t\t\t.productMeasures=\"${this.productMeasures}\"\n\t\t\t.showDesignText=\"${this.showDesignText}\"\n\t\t\t.showWeight=\"${this.showWeight}\"\n\t\t\t.showPackageMeasures=\"${this.showPackageMeasures}\"\n\t\t\t.showHomeDelivery=\"${this.showHomeDelivery}\"\n\t\t\t.zipAvailability=\"${this.zipAvailability}\"\n\t\t\t.homeDeliveryState=\"${this.homeDeliveryState}\"\n\t\t\t.homeDeliveryInputValue=\"${this.homeDeliveryInputValue}\"\n\t\t\t.homeDeliveryZipCode=\"${this.homeDeliveryZipCode}\"\n\t\t\t.storeAvailability=\"${this.storeAvailability}\"\n\t\t\t.stores=\"${this.stores}\"\n\t\t\t.showProductIdentifier=\"${this.showProductIdentifier}\"\n\t\t\t.productDescription=\"${this.productDescription}\"\n\t\t\t.storeId=\"${this.storeId}\"\n\t\t\t>\n\t\t`;\n }\n getListGalleryCard() {\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: event.detail\n }))}\"\n\t\t\t\t@modalClose=\"${(event) => this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: event.detail }))}\"\n\t\t\t\t@infoIconButtonClick=\"${(event) => {\n var _a, _b;\n this.dispatchEvent(new CustomEvent('infoIconButtonClick', {\n bubbles: true,\n detail: event.detail\n }));\n if (((_a = this.product.content) === null || _a === void 0 ? void 0 : _a.ruItemNo) &&\n (this.disableLinks || !this.infoIconButtonLinkUrl)) {\n (_b = this.tracker) === null || _b === void 0 ? void 0 : _b.sendInfoIconButtonClick(this.product.content.ruItemNo);\n }\n }}\"\n\t\t\t\t@productVariantClick=\"${(event) => {\n var _a;\n this.dispatchEvent(new CustomEvent('productVariantClick', { bubbles: true, detail: event.detail }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendProductVariantClick(event.detail.product.content.ruItemNo);\n }}\"\n\t\t\t\t@productVariantShowMoreClick=\"${(event) => {\n var _a, _b;\n this.dispatchEvent(new CustomEvent('productVariantShowMoreClick', {\n bubbles: true,\n detail: event.detail\n }));\n ((_a = this.product.content) === null || _a === void 0 ? void 0 : _a.ruItemNo) &&\n ((_b = this.tracker) === null || _b === void 0 ? void 0 : _b.sendProductVariantShowMoreClick(this.product.content.ruItemNo));\n }}\"\n\t\t\t\t@select=\"${(event) => {\n var _a, _b;\n this.dispatchEvent(new CustomEvent('select', {\n bubbles: true,\n detail: event.detail\n }));\n ((_a = event.detail) === null || _a === void 0 ? void 0 : _a.selectedState) &&\n ((_b = this.tracker) === null || _b === void 0 ? void 0 : _b.sendSelectedProduct(event.detail.selectedState));\n }}\"\n\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t.media=\"${this.media === ProductCardMediaEnum_1.default.carousel\n ? ListGalleryCardMediaEnum_1.default.singleImage\n : this.media}\"\n\t\t\t\t.product=\"${this.product}\"\n\t\t\t\t.includedProducts=\"${this.includedProducts}\"\n\t\t\t\t.layout=\"${this.layout}\"\n\t\t\t\t.localizedInformation=\"${this.localizedInformation}\"\n\t\t\t\t.translations=\"${this.translations}\"\n\t\t\t\t.settings=\"${this.settings}\"\n\t\t\t\t.functionIcons=\"${this.functionIcons}\"\n\t\t\t\t.imageAspectRatio=\"${this.imageAspectRatio}\"\n\t\t\t\t.imageSortOrder=\"${this.imageSortOrder}\"\n\t\t\t\t.hoverImageSortOrder=\"${this.hoverImageSortOrder}\"\n\t\t\t\t.disableLinks=\"${this.disableLinks}\"\n\t\t\t\t.infoIconButtonLinkUrl=\"${this.infoIconButtonLinkUrl}\"\n\t\t\t\t.showInfoIconButton=\"${this.showInfoIconButton}\"\n\t\t\t\t.infoIconButtonLinkTarget=\"${this.infoIconButtonLinkTarget}\"\n\t\t\t\t.productVariations=\"${this.productVariations}\"\n\t\t\t\t.priceModuleLayout=\"${this.priceModuleLayout}\"\n\t\t\t\t.selectBehaviour=\"${this.selectBehaviour}\"\n\t\t\t\t.visibleModal=\"${this.visibleModal}\"\n\t\t\t\t.productMeasures=\"${this.productMeasures}\"\n\t\t\t\t.showDesignText=\"${this.showDesignText}\"\n\t\t\t\t.showWeight=\"${this.showWeight}\"\n\t\t\t\t.selectedStateAriaLabel=\"${this.selectedStateAriaLabel}\"\n\t\t\t\t.showPriceExclTax=\"${this.showPriceExclTax}\"\n\t\t\t\t.showPackageMeasures=\"${this.showPackageMeasures}\"\n\t\t\t\t.selectedState=\"${this.selectedState}\"\n\t\t\t\t.zipAvailability=\"${this.zipAvailability}\"\n\t\t\t\t.storeAvailability=\"${this.storeAvailability}\"\n\t\t\t\t.stores=\"${this.stores}\"\n\t\t\t\t.storeId=\"${this.storeId}\"\n\t\t\t\t.showProductVariants=\"${this.showProductVariants}\"\n\t\t\t\t.productVariants=\"${this.productVariants}\"\n\t\t\t\t.productVariantsLimit=\"${this.productVariantsLimit}\"\n\t\t\t>\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductCard.prototype, \"layout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ProductCard.prototype, \"product\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductCard.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductCard.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductCard.prototype, \"functionIcons\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductCard.prototype, \"productVariants\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductCard.prototype, \"productVariations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], ProductCard.prototype, \"productVariantsLimit\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductCard.prototype, \"includedProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductCard.prototype, \"storeAvailability\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductCard.prototype, \"zipAvailability\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ProductCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductCard.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductCard.prototype, \"media\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], ProductCard.prototype, \"carouselSelectedIndex\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], ProductCard.prototype, \"carouselThumbnailLimit\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductCard.prototype, \"carouselShowAll\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductCard.prototype, \"carouselShowScrollbar\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductCard.prototype, \"carouselShowArrows\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductCard.prototype, \"infoIconButtonLinkUrl\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductCard.prototype, \"infoIconButtonLinkTarget\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductCard.prototype, \"selectedState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductCard.prototype, \"selectBehaviour\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductCard.prototype, \"productMeasures\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductCard.prototype, \"priceModuleLayout\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductCard.prototype, \"showPackageMeasures\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductCard.prototype, \"showDesignText\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductCard.prototype, \"showWeight\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductCard.prototype, \"showProductVariants\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductCard.prototype, \"showProductIdentifier\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductCard.prototype, \"showInfoIconButton\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductCard.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductCard.prototype, \"showPriceExclTax\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductCard.prototype, \"stores\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductCard.prototype, \"storeId\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductCard.prototype, \"productDescription\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductCard.prototype, \"imageAspectRatio\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductCard.prototype, \"showHomeDelivery\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductCard.prototype, \"homeDeliveryState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, synchronous: true })\n], ProductCard.prototype, \"homeDeliveryInputValue\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductCard.prototype, \"homeDeliveryZipCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductCard.prototype, \"imageSortOrder\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductCard.prototype, \"hoverImageSortOrder\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductCard.prototype, \"selectedStateAriaLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductCard.prototype, \"analytics\", void 0);\nProductCard = __decorate([\n (0, web_component_1.customElement)('kompis-product-card')\n], ProductCard);\nexports.default = ProductCard;\n//# sourceMappingURL=ProductCard.js.map","import \"@inter-ikea-kompis/component-product-card/lib/components/product-card/ProductCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisProductCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-product-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.analytics = props.analytics;\n element.carouselSelectedIndex = props.carouselSelectedIndex;\n element.carouselShowAll = props.carouselShowAll;\n element.carouselShowArrows = props.carouselShowArrows;\n element.carouselShowScrollbar = props.carouselShowScrollbar;\n element.carouselThumbnailLimit = props.carouselThumbnailLimit;\n element.disableLinks = props.disableLinks;\n element.functionIcons = props.functionIcons;\n element.homeDeliveryInputValue = props.homeDeliveryInputValue;\n element.homeDeliveryState = props.homeDeliveryState;\n element.homeDeliveryZipCode = props.homeDeliveryZipCode;\n element.hoverImageSortOrder = props.hoverImageSortOrder;\n element.imageAspectRatio = props.imageAspectRatio;\n element.imageSortOrder = props.imageSortOrder;\n element.includedProducts = props.includedProducts;\n element.infoIconButtonLinkTarget = props.infoIconButtonLinkTarget;\n element.infoIconButtonLinkUrl = props.infoIconButtonLinkUrl;\n element.layout = props.layout;\n element.localizedInformation = props.localizedInformation;\n element.media = props.media;\n element.priceModuleLayout = props.priceModuleLayout;\n element.product = props.product;\n element.productDescription = props.productDescription;\n element.productMeasures = props.productMeasures;\n element.productVariants = props.productVariants;\n element.productVariantsLimit = props.productVariantsLimit;\n element.productVariations = props.productVariations;\n element.selectBehaviour = props.selectBehaviour;\n element.selectedState = props.selectedState;\n element.selectedStateAriaLabel = props.selectedStateAriaLabel;\n element.settings = props.settings;\n element.showDesignText = props.showDesignText;\n element.showHomeDelivery = props.showHomeDelivery;\n element.showInfoIconButton = props.showInfoIconButton;\n element.showPackageMeasures = props.showPackageMeasures;\n element.showPriceExclTax = props.showPriceExclTax;\n element.showProductIdentifier = props.showProductIdentifier;\n element.showProductVariants = props.showProductVariants;\n element.showWeight = props.showWeight;\n element.storeAvailability = props.storeAvailability;\n element.storeId = props.storeId;\n element.stores = props.stores;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n element.zipAvailability = props.zipAvailability;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onCarouselChange, \"carouselChange\");\n this.updateEventListener(element, props.onCarouselShowAllThumbnails, \"carouselShowAllThumbnails\");\n this.updateEventListener(element, props.onHomeDeliveryForgetClick, \"homeDeliveryForgetClick\");\n this.updateEventListener(element, props.onHomeDeliveryInput, \"homeDeliveryInput\");\n this.updateEventListener(element, props.onHomeDeliveryStartOverClick, \"homeDeliveryStartOverClick\");\n this.updateEventListener(element, props.onHomeDeliverySubmitButtonClick, \"homeDeliverySubmitButtonClick\");\n this.updateEventListener(element, props.onInfoIconButtonClick, \"infoIconButtonClick\");\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n this.updateEventListener(element, props.onProductVariantClick, \"productVariantClick\");\n this.updateEventListener(element, props.onProductVariantShowMoreClick, \"productVariantShowMoreClick\");\n this.updateEventListener(element, props.onSelect, \"select\");\n this.updateEventListener(element, props.onStoreSelectorChange, \"storeSelectorChange\");\n }\n}\nKompisProductCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n analytics: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n carouselSelectedIndex: PropTypes.number,\n carouselShowAll: PropTypes.bool,\n carouselShowArrows: PropTypes.bool,\n carouselShowScrollbar: PropTypes.bool,\n carouselThumbnailLimit: PropTypes.number,\n disableLinks: PropTypes.bool,\n functionIcons: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n homeDeliveryInputValue: PropTypes.string,\n homeDeliveryState: PropTypes.string,\n homeDeliveryZipCode: PropTypes.string,\n hoverImageSortOrder: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n imageAspectRatio: PropTypes.string,\n imageSortOrder: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n includedProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n infoIconButtonLinkTarget: PropTypes.string,\n infoIconButtonLinkUrl: PropTypes.string,\n layout: PropTypes.string,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n media: PropTypes.string,\n priceModuleLayout: PropTypes.string,\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n productDescription: PropTypes.string,\n productMeasures: PropTypes.string,\n productVariants: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n productVariantsLimit: PropTypes.number,\n productVariations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n selectBehaviour: PropTypes.string,\n selectedState: PropTypes.string,\n selectedStateAriaLabel: PropTypes.string,\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n showDesignText: PropTypes.bool,\n showHomeDelivery: PropTypes.bool,\n showInfoIconButton: PropTypes.bool,\n showPackageMeasures: PropTypes.bool,\n showPriceExclTax: PropTypes.bool,\n showProductIdentifier: PropTypes.bool,\n showProductVariants: PropTypes.bool,\n showWeight: PropTypes.bool,\n storeAvailability: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n storeId: PropTypes.string,\n stores: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n zipAvailability: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n onModalClose: PropTypes.func,\n onModalOpen: PropTypes.func,\n onCarouselChange: PropTypes.func,\n onCarouselShowAllThumbnails: PropTypes.func,\n onProductVariantClick: PropTypes.func,\n onProductVariantShowMoreClick: PropTypes.func,\n onInfoIconButtonClick: PropTypes.func,\n onSelect: PropTypes.func,\n onStoreSelectorChange: PropTypes.func,\n onHomeDeliveryStartOverClick: PropTypes.func,\n onHomeDeliveryForgetClick: PropTypes.func,\n onHomeDeliveryInput: PropTypes.func,\n onHomeDeliverySubmitButtonClick: PropTypes.func\n};\nexport default KompisProductCard;\n","import \"@inter-ikea-kompis/component-product-information-section/lib/components/measurements-card/MeasurementsCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisMeasurementsCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-measurements-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.localizedInformation = props.localizedInformation;\n element.product = props.product;\n element.settings = props.settings;\n element.theme = props.theme;\n element.translations = props.translations;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisMeasurementsCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object])\n};\nexport default KompisMeasurementsCard;\n","import \"@inter-ikea-kompis/component-product-information-section/lib/components/product-details-card/ProductDetailsCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisProductDetailsCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-product-details-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.localizedInformation = props.localizedInformation;\n element.product = props.product;\n element.theme = props.theme;\n element.translations = props.translations;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisProductDetailsCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object])\n};\nexport default KompisProductDetailsCard;\n","import \"@inter-ikea-kompis/component-product-information-section/lib/components/product-information-section/ProductInformationSection\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisProductInformationSection extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-product-information-section\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.localizedInformation = props.localizedInformation;\n element.product = props.product;\n element.settings = props.settings;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n }\n}\nKompisProductInformationSection.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n onModalOpen: PropTypes.func,\n onModalClose: PropTypes.func\n};\nexport default KompisProductInformationSection;\n","import \"@inter-ikea-kompis/component-product-information-section/lib/components/technical-information-card/TechnicalInformationCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisTechnicalInformationCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-technical-information-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.localizedInformation = props.localizedInformation;\n element.product = props.product;\n element.theme = props.theme;\n element.translations = props.translations;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisTechnicalInformationCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object])\n};\nexport default KompisTechnicalInformationCard;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass ProductListSectionStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\t.label,\n\t\t\t.numberOfItems {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\n\t\t\t.divider {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-shrink: 0;\n\t\t\t\twidth: ${spacing.space25 / 16}rem;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = ProductListSectionStyle;\n//# sourceMappingURL=ProductListSectionStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst enums_2 = require(\"@inter-ikea-kompis/enums\");\nrequire(\"@inter-ikea-kompis/component-text\");\nconst ProductListSectionStyle_1 = __importDefault(require(\"./ProductListSectionStyle\"));\nlet ProductListSection = class ProductListSection extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The section label.\n this.label = null;\n // The number of items in section.\n this.numberOfItems = null;\n // Semantic heading level for the heading with the highest level in the product list section.\n this.maxHeadingLevel = enums_2.HeadingsEnum.h2;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n // We want translations to be required, but since all props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\t${this.label}\n\t\t\t\t\n\t\t\t
    \n\n\t\t\t${this.getNumberOfItems()}\n\n\t\t\t\n\t\t`;\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n /**\n * Renders number of items.\n *\n * @returns Template.\n */\n getNumberOfItems() {\n if (this.numberOfItems === null) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\t${this.numberOfItems}\n\t\t\t\t\n\t\t\t\t
    \n\t\t\t\t\n\t\t\t\t\t${this.getTranslations().productListItems}\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ProductListSection.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductListSection.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductListSection.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductListSection.prototype, \"label\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], ProductListSection.prototype, \"numberOfItems\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductListSection.prototype, \"maxHeadingLevel\", void 0);\nProductListSection = __decorate([\n (0, web_component_1.customElement)('kompis-product-list-section')\n], ProductListSection);\nexports.default = ProductListSection;\n//# sourceMappingURL=ProductListSection.js.map","import \"@inter-ikea-kompis/component-product-list/lib/components/product-list-section/ProductListSection\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisProductListSection extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-product-list-section\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.label = props.label;\n element.localizedInformation = props.localizedInformation;\n element.maxHeadingLevel = props.maxHeadingLevel;\n element.numberOfItems = props.numberOfItems;\n element.theme = props.theme;\n element.translations = props.translations;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisProductListSection.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n label: PropTypes.string,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n maxHeadingLevel: PropTypes.string,\n numberOfItems: PropTypes.number,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object])\n};\nexport default KompisProductListSection;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ProductListModalEnum;\n(function (ProductListModalEnum) {\n ProductListModalEnum[\"ecoFeeCard\"] = \"ecoFeeCard\";\n})(ProductListModalEnum || (ProductListModalEnum = {}));\nexports.default = ProductListModalEnum;\n//# sourceMappingURL=ProductListModalEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nclass ProductListTotalPriceStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.theme Theme.\n * @param options.isTroOrFamilyPrice If it is family price or TRO (Time Restricted Offer).\n * @param options.collectable Whether to show the collect checkbox or not.\n * @param options.isMobile\n * @param options.isTablet\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing, color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\t.container {\n\t\t\t\tdisplay: grid;\n\t\t\t\tgrid-gap: ${spacing.space100 / 16}rem;\n\t\t\t\tgrid-template-columns: ${64 / 16}rem 4fr 3fr 2fr 3fr ${options.collectable ? '2fr' : ''};\n\t\t\t\tpadding-top: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.total {\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: flex-end;\n\t\t\t}\n\n\t\t\t.total p,\n\t\t\t.numberOfItems p {\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t.bold {\n\t\t\t\tfont-weight: bold;\n\t\t\t}\n\n\t\t\t.numberOfItems {\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\t\t\t}\n\t\t\t.numberOfItems p {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t.divider {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-shrink: 0;\n\t\t\t\twidth: ${spacing.space25 / 16}rem;\n\t\t\t}\n\n\t\t\t.total .numberOfItems {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\t.total,\n\t\t\t.numberOfItems {\n\t\t\t\tpadding-top: ${options.isTroOrFamilyPrice ? spacing.space150 / 16 : 0}rem;\n\t\t\t}\n\n\t\t\tkompis-price-module {\n\t\t\t\talign-items: flex-end;\n\t\t\t\ttext-align: end;\n\t\t\t}\n\n\t\t\t${this.getDeviceStyle(options)}\n\t\t`;\n }\n static getCompactLayoutStyle(options) {\n const { spacing, color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\t\t\t.compactPriceWrapper {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: end;\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t\tmargin-top: ${spacing.space50 / 16}rem;\n\t\t\t}\n\n\t\t\t.compactPriceWrapper p {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t.compactPrice:not(:last-child) {\n\t\t\t\tmargin-bottom: ${spacing.space25 / 16}rem;\n\t\t\t}\n\n\t\t\t.compactPrice {\n\t\t\t\tcolor: inherit;\n\t\t\t}\n\n\t\t\t.compactCommercialMessage {\n\t\t\t\tmargin-bottom: ${spacing.space25 / 16}rem;\n\t\t\t\tcolor: inherit;\n\t\t\t}\n\n\t\t\t.bold {\n\t\t\t\tfont-weight: bold;\n\t\t\t}\n\t\t`;\n }\n /**\n * @param options\n * @param options.theme\n * @param options.isMobile\n * @param options.isTablet\n * @returns Mobile style for product list total price.\n */\n static getDeviceStyle(options) {\n if (!options.isMobile || !options.isTablet) {\n return '';\n }\n else if (options.isMobile) {\n return (0, web_component_1.css) `\n\t\t\t\t.container {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-direction: row;\n\t\t\t\t}\n\t\t\t\t.container .numberOfItems {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\t\t\t\t.total .numberOfItems {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tpadding: 0;\n\t\t\t\t\tjustify-content: flex-start;\n\t\t\t\t}\n\t\t\t\t.spacer {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\t\t\t\t.total {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-grow: 1;\n\t\t\t\t\tjustify-content: flex-start;\n\t\t\t\t\tflex-direction: column;\n\t\t\t\t}\n\t\t\t\t.spacerDesktop {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\t\t\t`;\n }\n else if (options.isTablet) {\n return (0, web_component_1.css) `\n\t\t\t\t.container {\n\t\t\t\t\tgrid-template-columns: ${64 / 16}rem 4fr 3fr 3fr;\n\t\t\t\t}\n\t\t\t\t.spacerDesktop {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\t\t\t`;\n }\n return '';\n }\n}\nexports.default = ProductListTotalPriceStyle;\n//# sourceMappingURL=ProductListTotalPriceStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_price_module_1 = require(\"@inter-ikea-kompis/component-price-module\");\nconst component_product_row_1 = require(\"@inter-ikea-kompis/component-product-row\");\nrequire(\"@inter-ikea-kompis/component-price-module\");\nrequire(\"@inter-ikea-kompis/component-price-formatter\");\nconst ProductListModalEnum_1 = __importDefault(require(\"../../enums/ProductListModalEnum\"));\nconst ProductListTotalPriceStyle_1 = __importDefault(require(\"./ProductListTotalPriceStyle\"));\n/**\n *\n *\n * @event modalClose Triggered when the modal has been closed\n * @event modalOpen Triggered when a modal has been opened. event.detail.modalType tells you the type\n */\nlet ProductListTotalPrice = class ProductListTotalPrice extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Whether to show the collect checkbox or not.\n this.collectable = false;\n // Show a modal.\n this.visibleModal = null;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // Layout for product row. NOTE: ProductRowLayoutEnum.compactPrint should only be used during print.\n this.layout = null;\n this.breakpointObserver = new themes_1.ThemeBreakpointObserver(() => this.requestUpdate(), this);\n this.dexfSettings = null;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `${this.getLayout()}`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.breakpointObserver.disconnect();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('theme')) {\n this.breakpointObserver.observe(this.theme);\n }\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n return true;\n }\n getLayout() {\n if (this.layout === component_product_row_1.ProductRowLayoutEnum.compactPrint) {\n return this.getCompactPrintLayout();\n }\n else {\n return this.getDefaultLayout();\n }\n }\n getDefaultLayout() {\n var _a;\n const validShoppingProducts = this.shoppingProducts.filter((shoppingProduct) => shoppingProduct.product.valid);\n const totalPrice = utilities_1.TotalPriceCalculator.calculate(validShoppingProducts, this.getSettings().localisation.dateFormat);\n const breakpointIndex = (_a = this.breakpointObserver.getBreakpointIndex()) !== null && _a !== void 0 ? _a : enums_1.ThemeBreakpointIndexEnum.small;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t

    ${this.getTranslations().productListTotalPrice}

    \n\t\t\t\t\t${this.getNumberOfItems(validShoppingProducts)}\n\t\t\t\t
    \n\t\t\t\t${this.getNumberOfItems(validShoppingProducts)}\n\t\t\t\t
    \n\t\t\t\t\t this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }))}\"\n\t\t\t\t\t\t@modalOpen=\"${() => this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: {\n visibleModal: ProductListModalEnum_1.default.ecoFeeCard\n }\n }))}\"\n\t\t\t\t\t>\n\t\t\t\t
    \n\t\t\t
    \n\t\t`;\n }\n getCompactPrintLayout() {\n const totalPrice = utilities_1.TotalPriceCalculator.calculate(this.shoppingProducts, this.getSettings().localisation.dateFormat);\n const listTotalPrice = utilities_1.PriceUtility.getPrice(totalPrice);\n return (0, web_component_1.html) `\n\t\t\t${this.getCompactPriceWrapper({ totalPrice, listTotalPrice })}`;\n }\n getCompactPriceWrapper(options) {\n const { priceInfoIkeaFamilyPrice, priceInfoRegularPrice, productListTotalPriceSummary } = this.getTranslations();\n const { totalPrice, listTotalPrice } = options;\n return totalPrice.family\n ? (0, web_component_1.html) `\n\t\t\t\t\t
    \n\t\t\t\t\t\t

    ${priceInfoIkeaFamilyPrice}

    \n\t\t\t\t\t\t

    \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t

    \n\t\t\t\t\t\t

    ${priceInfoRegularPrice}

    \n\t\t\t\t\t\t

    \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t

    \n\t\t\t\t\t
    \n\t\t\t `\n : (0, web_component_1.html) `\n\t\t\t\t\t
    \n\t\t\t\t\t\t

    \n\t\t\t\t\t\t\t${productListTotalPriceSummary}\n\t\t\t\t\t\t

    \n\t\t\t\t\t\t

    \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t

    \n\t\t\t\t\t
    \n\t\t\t `;\n }\n getSettings() {\n return this.dexfSettings;\n }\n hasTranslationsAndSettings() {\n return !!this.localizedInformation || !!(this.translations && this.settings);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n /**\n * Get number of items.\n *\n * @param validShoppingProducts Valid shopping Products.\n * @returns Template.\n */\n getNumberOfItems(validShoppingProducts) {\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t

    \n\t\t\t\t\t${validShoppingProducts.reduce((sum, product) => sum + product.quantity, 0)}\n\t\t\t\t

    \n\t\t\t\t
    \n\t\t\t\t

    ${this.getTranslations().productListItems}

    \n\t\t\t
    \n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ProductListTotalPrice.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductListTotalPrice.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductListTotalPrice.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductListTotalPrice.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ProductListTotalPrice.prototype, \"shoppingProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductListTotalPrice.prototype, \"collectable\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductListTotalPrice.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductListTotalPrice.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductListTotalPrice.prototype, \"layout\", void 0);\nProductListTotalPrice = __decorate([\n (0, web_component_1.customElement)('kompis-product-list-total-price')\n], ProductListTotalPrice);\nexports.default = ProductListTotalPrice;\n//# sourceMappingURL=ProductListTotalPrice.js.map","import \"@inter-ikea-kompis/component-product-list/lib/components/product-list-total-price/ProductListTotalPrice\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisProductListTotalPrice extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-product-list-total-price\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.collectable = props.collectable;\n element.disableLinks = props.disableLinks;\n element.layout = props.layout;\n element.localizedInformation = props.localizedInformation;\n element.settings = props.settings;\n element.shoppingProducts = props.shoppingProducts;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n }\n}\nKompisProductListTotalPrice.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n collectable: PropTypes.bool,\n disableLinks: PropTypes.bool,\n layout: PropTypes.string,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n shoppingProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n onModalClose: PropTypes.func,\n onModalOpen: PropTypes.func\n};\nexport default KompisProductListTotalPrice;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('arrow-up-arrow-down', [{ tag: 'path', att: { d: 'M6.2924 9.8284 4.436 11.6569 3 10.2427 7.3077 6l4.3078 4.2427-1.4359 1.4142-1.8565-1.8284V18H6.2924V9.8284zm9.3846 4.3432-1.8566-1.8285-1.4359 1.4142L16.6923 18 21 13.7573l-1.4359-1.4142-1.8565 1.8284V6H15.677v8.1716z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('sort-descending', [{ tag: 'path', att: { d: 'M22 6H12v2h10V6zm-10 5h7v2h-7v-2zm0 5h4v2h-4v-2zm-6.9995-1.8284L3.172 12.3431l-1.4142 1.4143L6.0004 18l4.2427-4.2426-1.4142-1.4143-1.8284 1.8284V6h-2v8.1716z' } }]);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SortListOptionsEnum;\n(function (SortListOptionsEnum) {\n SortListOptionsEnum[\"default\"] = \"default\";\n SortListOptionsEnum[\"aisleLocation\"] = \"aisleLocation\";\n SortListOptionsEnum[\"packageSize\"] = \"packageSize\";\n SortListOptionsEnum[\"packageWeight\"] = \"packageWeight\";\n})(SortListOptionsEnum || (SortListOptionsEnum = {}));\nexports.default = SortListOptionsEnum;\n//# sourceMappingURL=SortListOptionsEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst SortListOptionsEnum_1 = __importDefault(require(\"../enums/SortListOptionsEnum\"));\nclass LabelUtility {\n /**\n * Get label for button or sort list option.\n *\n * @param option The option.\n * @param localizedInformationOrTranslations The localized information or translations object.\n * @returns Current label for button.\n */\n static getLabel(option, localizedInformationOrTranslations) {\n const translations = 'translations' in localizedInformationOrTranslations\n ? localizedInformationOrTranslations.translations\n : localizedInformationOrTranslations;\n switch (option) {\n case SortListOptionsEnum_1.default.aisleLocation:\n return translations.pickingListSortAisleLocation;\n case SortListOptionsEnum_1.default.packageSize:\n return translations.pickingListSortPackageSize;\n case SortListOptionsEnum_1.default.packageWeight:\n return translations.pickingListSortPackageWeight;\n case SortListOptionsEnum_1.default.default:\n return translations.pickingListSortDefault;\n default:\n return translations.pickingListSortTitle;\n }\n }\n}\nexports.default = LabelUtility;\n//# sourceMappingURL=LabelUtility.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@ingka/choice-webc\");\nconst SortListOptionsEnum_1 = __importDefault(require(\"../../enums/SortListOptionsEnum\"));\nconst LabelUtility_1 = __importDefault(require(\"../../utilities/LabelUtility\"));\n/**\n * @event change When sort option is changed.\n */\nlet SortListCard = class SortListCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // Selected option\n this.selected = null;\n }\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t${this.getHeading()}${this.getChoice()}`;\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n getHeading() {\n return (0, web_component_1.html) `

    \n\t\t\t${this.getTranslations().pickingListSortTitle}\n\t\t

    `;\n }\n getChoice() {\n return (0, web_component_1.html) `${Object.values(SortListOptionsEnum_1.default).map((option) => this.getChoiceItem(option))} `;\n }\n getChoiceItem(option) {\n const selectedOption = this.selected || SortListOptionsEnum_1.default.default;\n return (0, web_component_1.html) `\n\t\t\t {\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, detail: { selected: option } }));\n }}\"\n\t\t\t\t.selected=\"${selectedOption === option}\"\n\t\t\t>\n\t\t\t\t${LabelUtility_1.default.getLabel(option, this.getTranslations())}\n\t\t\t\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SortListCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SortListCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SortListCard.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SortListCard.prototype, \"selected\", void 0);\nSortListCard = __decorate([\n (0, web_component_1.customElement)('kompis-sort-list-card')\n], SortListCard);\nexports.default = SortListCard;\n//# sourceMappingURL=SortListCard.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SortListModalEnum;\n(function (SortListModalEnum) {\n SortListModalEnum[\"sortListCard\"] = \"sortListCard\";\n})(SortListModalEnum || (SortListModalEnum = {}));\nexports.default = SortListModalEnum;\n//# sourceMappingURL=SortListModalEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass SortListStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle() {\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tline-height: 0;\n\t\t\t}\n\t\t\t.container {\n\t\t\t\tposition: relative;\n\t\t\t\tdisplay: block;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = SortListStyle;\n//# sourceMappingURL=SortListStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst component_sheet_1 = require(\"@inter-ikea-kompis/component-sheet\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/modal-webc\");\nrequire(\"@ingka/icon-store/arrow-up-arrow-down\");\nrequire(\"@ingka/icon-store/sort-descending\");\nrequire(\"../sort-list-card/SortListCard\");\nconst SortListModalEnum_1 = __importDefault(require(\"../../enums/SortListModalEnum\"));\nconst SortListOptionsEnum_1 = __importDefault(require(\"../../enums/SortListOptionsEnum\"));\nconst LabelUtility_1 = __importDefault(require(\"../../utilities/LabelUtility\"));\nconst SortListStyle_1 = __importDefault(require(\"./SortListStyle\"));\n/**\n * @event change Triggered when the change button is clicked.\n * @event modalOpen Triggered when a modal should be opened.\n * @event modalClose Triggered when a modal should be closed.\n */\nlet SortList = class SortList extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // Selected option\n this.selected = null;\n // Sheet alignment\n this.sheetAlignment = component_sheet_1.SheetAlignmentEnum.right; // Replace with SheetAlignmentEnum in enums package when removing kompis-sheet.\n // Visible modal.\n this.visibleModal = null;\n this.sheetElement = null;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    ${this.getButton()}
    \n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.closeSheet();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('visibleModal')) {\n if (this.visibleModal === SortListModalEnum_1.default.sortListCard) {\n this.openSheet();\n }\n else {\n this.closeSheet();\n }\n }\n return true;\n }\n hasTranslations() {\n var _a;\n return !!this.translations || !!((_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n getButton() {\n const secondaryVariant = 'secondary';\n return (0, web_component_1.html) `\n\t\t\t {\n this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: {\n visibleModal: SortListModalEnum_1.default.sortListCard,\n triggerElement: this.queryTriggerElement()\n }\n }));\n }}\"\n\t\t\t\ta11y-label=${this.getAriaLabel()}\n\t\t\t>\n\t\t\t\t\n\t\t\t\t${LabelUtility_1.default.getLabel(this.selected === SortListOptionsEnum_1.default.default ? null : this.selected, this.getTranslations())}\n\t\t\t\n\t\t`;\n }\n getAriaLabel() {\n if (this.selected === null || this.selected === SortListOptionsEnum_1.default.default) {\n return ''; // use label instead of aria label\n }\n const sortOptionLabel = LabelUtility_1.default.getLabel(this.selected, this.getTranslations());\n return this.getTranslations()\n .pickingListSortAriaLabel.replace('[[sort_option]]', sortOptionLabel)\n .replace('{{sort_option}}', sortOptionLabel);\n }\n /**\n * Get icon for button.\n *\n * @param option The option.\n * @returns Current icon for button.\n */\n getIcon(option) {\n return option === SortListOptionsEnum_1.default.default || option === null\n ? 'arrow-up-arrow-down'\n : 'sort-descending';\n }\n closeSheet() {\n if (this.sheetElement) {\n this.sheetElement.open = false;\n this.sheetElement = null;\n }\n }\n openSheet() {\n if (this.sheetElement) {\n return;\n }\n const sheetElement = this.createSheetElement();\n this.sheetElement = sheetElement;\n const parent = document.querySelector('kompis-keyboard-injector') || document.body;\n parent.appendChild(sheetElement);\n sheetElement.open = true;\n }\n createSheetElement() {\n const sheetElement = this.createSheet();\n const sheetHeaderElement = this.createSheetHeader();\n const sortListCardElement = this.createCard();\n sheetElement.appendChild(sheetHeaderElement);\n sheetElement.appendChild(sortListCardElement);\n return sheetElement;\n }\n createSheet() {\n const sheetElement = document.createElement('skapa-sheet');\n sheetElement.setAttribute('aria-label', this.getTranslations().pickingListSortTitle);\n sheetElement.size = 'small';\n sheetElement.fullHeight = true;\n sheetElement.alignToStart = this.sheetAlignment === component_sheet_1.SheetAlignmentEnum.left;\n sheetElement.style.fontFamily = themes_1.FontStyle.getFontFamily(this.theme);\n sheetElement.style.zIndex = '500';\n sheetElement.addEventListener('closerequest', () => {\n if (this.sheetElement) {\n this.dispatchEvent(new CustomEvent('modalClose', {\n bubbles: true,\n detail: {\n visibleModal: null,\n triggerElement: this.queryTriggerElement()\n }\n }));\n }\n });\n sheetElement.addEventListener('closed', () => {\n var _a;\n (_a = sheetElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(sheetElement);\n });\n return sheetElement;\n }\n createSheetHeader() {\n const sheetHeaderElement = document.createElement('skapa-modal-header');\n sheetHeaderElement.slot = 'header';\n const headerSpan = document.createElement('span');\n headerSpan.slot = 'closebutton-label';\n headerSpan.innerText = this.getTranslations().modalAriaLabelButtonClose;\n sheetHeaderElement.appendChild(headerSpan);\n return sheetHeaderElement;\n }\n createCard() {\n const cardElement = document.createElement('kompis-sort-list-card');\n cardElement.theme = this.theme;\n cardElement.localizedInformation = this.localizedInformation;\n cardElement.translations = this.translations;\n cardElement.selected = this.selected;\n cardElement.addEventListener('change', (event) => {\n this.dispatchEvent(new CustomEvent('change', {\n bubbles: true,\n detail: {\n selected: event.detail.selected,\n visibleModal: null,\n triggerElement: this.queryTriggerElement()\n }\n }));\n });\n return cardElement;\n }\n /**\n * Find the sheet trigger element.\n */\n queryTriggerElement() {\n var _a, _b, _c, _d;\n return ((_d = (_c = (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('skapa-button')) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('button')) !== null && _d !== void 0 ? _d : null);\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SortList.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SortList.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SortList.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SortList.prototype, \"selected\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SortList.prototype, \"sheetAlignment\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SortList.prototype, \"visibleModal\", void 0);\nSortList = __decorate([\n (0, web_component_1.customElement)('kompis-sort-list')\n], SortList);\nexports.default = SortList;\n//# sourceMappingURL=SortList.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SortListOptionsEnum = exports.SortListModalEnum = exports.SortList = void 0;\nconst SortList_1 = __importDefault(require(\"./components/sort-list/SortList\"));\nexports.SortList = SortList_1.default;\nconst SortListModalEnum_1 = __importDefault(require(\"./enums/SortListModalEnum\"));\nexports.SortListModalEnum = SortListModalEnum_1.default;\nconst SortListOptionsEnum_1 = __importDefault(require(\"./enums/SortListOptionsEnum\"));\nexports.SortListOptionsEnum = SortListOptionsEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Contains utility methods for SPRs used for sorting in ProductList.\n */\nclass ProductListSprUtility {\n /**\n * Finds all SPRs in a list and returns their children, along with any non-SPR products.\n *\n * @param shoppingProducts A list of shopping products, both SPRs and articles.\n * @param includedProducts A list of products containing full product info for child products.\n * @returns A flattened list of all products and child products.\n */\n static flattenSprs(shoppingProducts, includedProducts) {\n if (!includedProducts) {\n return shoppingProducts;\n }\n const children = shoppingProducts\n .flatMap((sp) => Array(sp.quantity).fill(sp))\n .flatMap((sp) => { var _a; return (_a = sp.product.content) === null || _a === void 0 ? void 0 : _a.child; })\n .filter((child) => !!child);\n const childrenWithoutDuplicates = this.mergeDuplicateChildren(children);\n const childProducts = childrenWithoutDuplicates\n .map((child) => {\n const itemNo = child.itemId.split('-')[1];\n const product = includedProducts.find((p) => { var _a; return itemNo === ((_a = p === null || p === void 0 ? void 0 : p.content) === null || _a === void 0 ? void 0 : _a.ruItemNo); });\n return { product, quantity: child.quantity };\n })\n .filter(({ product }) => product);\n return shoppingProducts.filter((sp) => { var _a; return !((_a = sp.product.content) === null || _a === void 0 ? void 0 : _a.child); }).concat(childProducts);\n }\n /**\n * Merges duplicated children and sums their quantities.\n *\n * @param children Children, with potentially duplicated products.\n */\n static mergeDuplicateChildren(children) {\n const childMap = children.reduce((all, curr) => {\n const child = all[curr.itemId];\n if (child) {\n const quantity = child.quantity + curr.quantity;\n return Object.assign(Object.assign({}, all), { [curr.itemId]: Object.assign(Object.assign({}, child), { quantity }) });\n }\n return Object.assign(Object.assign({}, all), { [curr.itemId]: curr });\n }, {});\n return Object.values(childMap);\n }\n}\nexports.default = ProductListSprUtility;\n//# sourceMappingURL=ProductListSprUtility.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst component_sort_list_1 = require(\"@inter-ikea-kompis/component-sort-list\");\nconst ProductListSprUtility_1 = __importDefault(require(\"./ProductListSprUtility\"));\nconst IN_STOCK_PROBABILITY_SCORE = {\n [enums_1.StoreAvailabilityProbabilityEnum.outOfStock]: 5,\n [enums_1.StoreAvailabilityProbabilityEnum.lowInStock]: 0,\n [enums_1.StoreAvailabilityProbabilityEnum.mediumInStock]: 0,\n [enums_1.StoreAvailabilityProbabilityEnum.highInStock]: 0\n};\nconst SALES_TYPE_SCORE = {\n [enums_1.SalesTypeCodeEnum.contactStaff]: 2,\n [enums_1.SalesTypeCodeEnum.department]: 1,\n [enums_1.SalesTypeCodeEnum.aisleAndBin]: 0\n};\n/**\n * Everything sorting related for the ProductList.\n */\nclass ProductListSorting {\n /**\n * Sorts the product array in-place.\n *\n * @param shoppingProducts A list of shopping products.\n * @param sortBy The sorting order.\n * @param locale Locale string.\n * @param storeAvailabilities A list of availabilities for products in a certain store.\n * @param includedProducts A list of full product data for included products in SPRs.\n * @returns A sorted array of shopping products.\n */\n static sort(shoppingProducts, sortBy, locale, storeAvailabilities, includedProducts) {\n switch (sortBy) {\n case component_sort_list_1.SortListOptionsEnum.packageWeight:\n return this.sortByPackageProperty(ProductListSprUtility_1.default.flattenSprs(shoppingProducts, includedProducts), ({ totalWeightGross }) => totalWeightGross);\n case component_sort_list_1.SortListOptionsEnum.packageSize:\n return this.sortByPackageProperty(ProductListSprUtility_1.default.flattenSprs(shoppingProducts, includedProducts), this.getMaxDimension);\n case component_sort_list_1.SortListOptionsEnum.aisleLocation:\n return this.sortByAisleLocation(ProductListSprUtility_1.default.flattenSprs(shoppingProducts, includedProducts), locale, storeAvailabilities);\n default:\n return shoppingProducts;\n }\n }\n /**\n * Sorts by physical property (weight or height)\n * Puts biggest/heaviest products first.\n *\n * @param shoppingProducts\n * @param getPackageProperty A function which returns the physical property (e.g. Weight or size).\n */\n static sortByPackageProperty(shoppingProducts, getPackageProperty) {\n return shoppingProducts.sort((productA, productB) => {\n var _a, _b;\n const packageMeasureA = (_a = productA.product.content) === null || _a === void 0 ? void 0 : _a.packageMeasure;\n const packageMeasureB = (_b = productB.product.content) === null || _b === void 0 ? void 0 : _b.packageMeasure;\n if (!packageMeasureA && !packageMeasureB) {\n return 0;\n }\n if (!packageMeasureA) {\n return -1;\n }\n if (!packageMeasureB) {\n return 1;\n }\n return getPackageProperty(packageMeasureB) - getPackageProperty(packageMeasureA);\n });\n }\n /**\n * Finds the maximum dimension from all included packages.\n *\n * @param packageMeasure Package measurements.\n * @returns The value of the maximum dimension.\n */\n static getMaxDimension(packageMeasure) {\n return packageMeasure.package.reduce((maxValue, productPackage) => {\n const { height, width, length } = productPackage;\n return Math.max(maxValue, Math.max(height, width, length));\n }, -1);\n }\n /**\n * Sorts by aisle and location, the order you would\n * find products when walking through an IKEA warehouse.\n * Products without storeAvailability are put last in the list.\n *\n * @param shoppingProducts\n * @param locale\n * @param storeAvailabilities\n */\n static sortByAisleLocation(shoppingProducts, locale, storeAvailabilities) {\n if (!storeAvailabilities) {\n return shoppingProducts;\n }\n const storeAvailabilityShoppingProducts = shoppingProducts.map((shoppingProduct) => ({\n shoppingProduct,\n availability: this.getStoreAvailabilityForProduct(shoppingProduct, storeAvailabilities)\n }));\n return storeAvailabilityShoppingProducts\n .sort((storeAvailabilityProductA, storeAvailabilityProductB) => {\n var _a, _b, _c, _d, _e, _f;\n const availabilityA = (_b = (_a = storeAvailabilityProductA.availability) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.cashCarry;\n const availabilityASalesLocation = (_c = availabilityA === null || availabilityA === void 0 ? void 0 : availabilityA.salesLocations) === null || _c === void 0 ? void 0 : _c[0];\n const availabilityB = (_e = (_d = storeAvailabilityProductB.availability) === null || _d === void 0 ? void 0 : _d.content) === null || _e === void 0 ? void 0 : _e.cashCarry;\n const availabilityBSalesLocation = (_f = availabilityB === null || availabilityB === void 0 ? void 0 : availabilityB.salesLocations) === null || _f === void 0 ? void 0 : _f[0];\n if (!(availabilityASalesLocation === null || availabilityASalesLocation === void 0 ? void 0 : availabilityASalesLocation.type) && !(availabilityBSalesLocation === null || availabilityBSalesLocation === void 0 ? void 0 : availabilityBSalesLocation.type)) {\n return 0;\n }\n if (!(availabilityASalesLocation === null || availabilityASalesLocation === void 0 ? void 0 : availabilityASalesLocation.type)) {\n return -1;\n }\n if (!(availabilityBSalesLocation === null || availabilityBSalesLocation === void 0 ? void 0 : availabilityBSalesLocation.type)) {\n return 1;\n }\n const scoreA = SALES_TYPE_SCORE[availabilityASalesLocation.type];\n const scoreB = SALES_TYPE_SCORE[availabilityBSalesLocation.type];\n if (scoreA === scoreB) {\n let locationScore;\n if (scoreA === 0) {\n // Sales type \"aisle and bin\"\n locationScore = this.compareByAisleAndBin(availabilityASalesLocation, availabilityBSalesLocation);\n }\n else if (scoreA === 1) {\n // Sales type \"department\"\n locationScore = this.compareByDepartment(availabilityASalesLocation, availabilityBSalesLocation, locale);\n }\n if (locationScore === 0) {\n const availabilityAScore = (availabilityA === null || availabilityA === void 0 ? void 0 : availabilityA.messageType)\n ? IN_STOCK_PROBABILITY_SCORE[availabilityA === null || availabilityA === void 0 ? void 0 : availabilityA.messageType]\n : 0;\n const availabilityBScore = (availabilityB === null || availabilityB === void 0 ? void 0 : availabilityB.messageType)\n ? IN_STOCK_PROBABILITY_SCORE[availabilityB === null || availabilityB === void 0 ? void 0 : availabilityB.messageType]\n : 0;\n return availabilityBScore - availabilityAScore;\n }\n return locationScore;\n }\n // Put products with higher score before products with lower score\n return scoreB - scoreA;\n })\n .map(({ shoppingProduct }) => shoppingProduct);\n }\n /**\n * @param shoppingProduct\n * @param storeAvailabilities\n */\n static getStoreAvailabilityForProduct(shoppingProduct, storeAvailabilities) {\n var _a;\n const id = (_a = shoppingProduct.product.content) === null || _a === void 0 ? void 0 : _a.ruItemNo;\n return storeAvailabilities.find((sa) => sa.content.itemNo === id);\n }\n /**\n * Custom sorting algorithm based on aisle & bin.\n * Assumes both products have SalesTypeCode AISLE_AND_BIN.\n *\n * @param availabilityALocation\n * @param availabilityBLocation\n */\n static compareByAisleAndBin(availabilityALocation, availabilityBLocation) {\n const aisleComparison = parseInt(availabilityALocation.aisle) - parseInt(availabilityBLocation.aisle);\n if (aisleComparison === 0) {\n return (parseInt(availabilityALocation.bin) - parseInt(availabilityBLocation.bin));\n }\n return aisleComparison;\n }\n /**\n * Compares two availabilities alphabetically by department name.\n * Assumes both products have SalesTypeCode DEPARTMENT.\n *\n * @param availabilityALocation\n * @param availabilityBLocation\n * @param locale\n */\n static compareByDepartment(availabilityALocation, availabilityBLocation, locale) {\n const departmentA = availabilityALocation.departmentName || '';\n const departmentB = availabilityBLocation.departmentName || '';\n // String.localeCompare can't handle null, so if locale isn't set we send in undefined instead.\n return departmentA.localeCompare(departmentB, locale || undefined);\n }\n}\nexports.default = ProductListSorting;\n//# sourceMappingURL=ProductListSorting.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nclass ProductListStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.theme Theme.\n * @param options.isCompactLayout Stuff.\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing, color, border } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\tkompis-product-row {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tmargin: ${options.isCompactLayout ? spacing.space50 / 16 : spacing.space150 / 16}rem 0;\n\t\t\t}\n\n\t\t\t.row-wrapper {\n\t\t\t\tborder-bottom: ${1 / 16}rem solid ${color.neutral.grey200};\n\t\t\t}\n\n\t\t\t.container {\n\t\t\t\tposition: relative;\n\t\t\t}\n\n\t\t\t.skipButton:not(:focus) {\n\t\t\t\tclip: rect(0.06rem, 0.06rem, 0.06rem, 0.06rem);\n\t\t\t\toverflow: hidden;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\n\t\t\t.skipButton {\n\t\t\t\tposition: absolute;\n\t\t\t\tz-index: 1;\n\t\t\t\ttop: ${spacing.space150 / 16}rem;\n\t\t\t\tleft: ${spacing.space150 / 16}rem;\n\t\t\t}\n\n\t\t\tkompis-product-list-section {\n\t\t\t\tdisplay: block;\n\t\t\t\tpage-break-inside: avoid;\n\t\t\t\tbreak-inside: avoid;\n\t\t\t}\n\n\t\t\tul,\n\t\t\tli {\n\t\t\t\tlist-style: none;\n\t\t\t\tmargin: 0;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\n\t\t\tkompis-product-list-section:not(:first-of-type) {\n\t\t\t\tpadding-top: ${spacing.space200 / 16}rem;\n\t\t\t}\n\n\t\t\t.compactListHeaders {\n\t\t\t\tdisplay: grid;\n\t\t\t\t/* This style is the same as in compact product row, to make the grid match the product row columns. */\n\t\t\t\tgrid-template-columns: ${30 / 16}rem 1fr ${83 / 16}rem ${86 / 16}rem ${60 / 16}rem ${80 /\n 16}rem ${80 / 16}rem;\n\t\t\t\tgap: 0 ${spacing.space75 / 16}rem;\n\t\t\t\tcolor: ${color.text.default};\n\t\t\t\tborder-bottom: ${border.thickness.thin / 16}rem solid ${color.border.light};\n\t\t\t\tpadding-bottom: ${spacing.space50 / 16}rem;\n\t\t\t\talign-items: flex-start;\n\t\t\t}\n\n\t\t\t.compactListHeaders h4 {\n\t\t\t\tfont-weight: normal;\n\t\t\t\toverflow-wrap: break-word;\n\t\t\t\thyphens: auto;\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t.compactListHeaders h4,\n\t\t\t.compactListHeaders span {\n\t\t\t\tfont-size: ${10 / 16}rem !important;\n\t\t\t}\n\n\t\t\t.location {\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: space-between;\n\t\t\t}\n\n\t\t\t.location span {\n\t\t\t\tword-break: break-all;\n\t\t\t}\n\t\t\t.divider {\n\t\t\t\twidth: ${spacing.space25 / 16}rem;\n\t\t\t}\n\n\t\t\t.compactListHeaders h4:last-child {\n\t\t\t\ttext-align: end;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = ProductListStyle;\n//# sourceMappingURL=ProductListStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst component_product_row_1 = require(\"@inter-ikea-kompis/component-product-row\");\nconst component_product_row_2 = require(\"@inter-ikea-kompis/component-product-row\");\nconst component_sort_list_1 = require(\"@inter-ikea-kompis/component-sort-list\");\nrequire(\"@inter-ikea-kompis/component-product-row\");\nrequire(\"../product-list-section/ProductListSection\");\nrequire(\"../product-list-total-price/ProductListTotalPrice\");\nconst ProductListSorting_1 = __importDefault(require(\"../../utilities/ProductListSorting\"));\nconst ProductListStyle_1 = __importDefault(require(\"./ProductListStyle\"));\n/**\n * Used by components like WhatsIncluded to display a product list.\n *\n * @event add Triggered when the an add button is clicked.\n * @event remove Triggered when the a remove button is clicked.\n * @event quantity Triggered when the quantity is changed.\n * @event expand Triggered when included shopping products gets expanded.\n * @event collect Triggered when a product is collected.\n * @event productImageClick Triggered when the user clicks on a product image.\n * @event productNameClick Triggered when the user clicks on a product name.\n * @event modalClose Triggered when the modal has been closed\n * @event modalOpen Triggered when a modal has been opened. event.detail.type tells you the type\n */\nlet ProductList = class ProductList extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // A list of included products in SPR products. The ProductRow component will find the correct Product for each child of the SPR product.\n this.includedProducts = null;\n // A list of product item numbers that can be added.\n this.addable = null;\n // A list of product item numbers that can be removed.\n this.removable = null;\n // A list of sections.\n this.sections = null;\n // A list of store availability objects. The ProductRow component will find the correct Store Availability for each child of the SPR product.\n this.storeAvailabilities = null;\n // A list of zip availability objects. The ProductRow component will find the correct Zip Availability for each child of the SPR product.\n this.zipAvailabilities = null;\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Product measures.\n this.productMeasures = component_product_row_2.ProductRowProductMeasureEnum.none;\n // Sets the product link behaviour. This attribute should be set to \"disabled\" when in a Kiosk.\n this.productLink = component_product_row_2.ProductRowProductLinkEnum.productInformationPage;\n // Show product id.\n this.showItemNo = false;\n // Show product package weight info.\n this.showWeight = false;\n // Enable to be able to edit the quantity.\n this.editableQuantity = false;\n // Show text describing the color and/or material of the product.\n this.showDesignText = false;\n // Show product package measures.\n this.showPackageMeasures = false;\n // Show status indicator on print.\n this.showStockStatusOnPrint = false;\n // A list of expanded shopping products.\n this.expanded = null;\n // Whether to show the collect checkbox or not.\n this.collectable = false;\n // A list of product ids that are collected.\n this.collected = null;\n // Sets the minimum quantity value.\n this.quantityMinValue = 0;\n // Stores.\n this.stores = null;\n // Selected store id.\n this.storeId = null;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // How the products should be sorted, can be used with SortList component\n this.sortBy = component_sort_list_1.SortListOptionsEnum.default;\n // Locale is used to determine how to sort products on departments properly\n this.locale = null;\n // Disables online saleable verification. Deprecated - No longer in use.\n this.disableOnlineSaleableVerification = false;\n // Visible modal\n this.visibleModal = null;\n // Skip listing label\n this.skipListingLabel = null;\n // Semantic heading level for the heading with the highest level in the product list.\n this.maxHeadingLevel = null;\n // Layout for product list. NOTE: ProductRowLayoutEnum.compactPrint should only be used during print. Make sure SPR's has their child articles in includedProducts, since SPR's are not visible in compactPrint.\n this.layout = null;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t${this.getSkipButton()} ${this.getSectionHeaders()}${this.getList()}${this.getTotalPrice()}\n\t\t\t
    \n\t\t\t {\n const target = event.currentTarget;\n if (target) {\n target.tabIndex = -1;\n }\n }}\"\n\t\t\t>\n\t\t`;\n }\n hasTranslationsAndSettings() {\n return !!this.localizedInformation || !!(this.translations && this.settings);\n }\n getTranslations() {\n var _a;\n const translations = this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n return translations;\n }\n /**\n * Skip Button when entering a carousel through tabbing.\n *\n * @returns Template.\n */\n getSkipButton() {\n if (!this.skipListingLabel) {\n return null;\n }\n const primaryVariant = 'primary';\n return (0, web_component_1.html) `\n\t\t\t${this.skipListingLabel}\n\t\t`;\n }\n /**\n * Event handler.\n */\n onSkipButtonClick() {\n var _a;\n const focusElement = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.skipListingFocusElement');\n focusElement.tabIndex = 0;\n focusElement.focus();\n }\n getSectionHeaders() {\n if (this.layout !== component_product_row_1.ProductRowLayoutEnum.compactPrint) {\n return null;\n }\n const { quantityShort, productArticleNo, productSalesAisle, productSalesLocation, productListTotalPriceSummary, weight, price, article } = this.getTranslations();\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t

    ${quantityShort}

    \n\t\t\t\t

    ${article}

    \n\t\t\t\t

    \n\t\t\t\t\t${productSalesAisle}${productSalesLocation}\n\t\t\t\t

    \n\t\t\t\t

    ${productArticleNo}

    \n\t\t\t\t

    ${weight}

    \n\t\t\t\t

    ${price}

    \n\t\t\t\t

    ${productListTotalPriceSummary}

    \n\t\t\t
    \n\t\t`;\n }\n /**\n * Returns HTML for a list of ShoppingProduct rows or sections if defined.\n *\n * @returns Template.\n */\n getList() {\n if (this.sections && this.layout !== component_product_row_1.ProductRowLayoutEnum.compactPrint) {\n const sections = this.getSections();\n return (0, web_component_1.html) ` ${sections.map((section) => this.getSection(section))} `;\n }\n return (0, web_component_1.html) `\n\t\t\t${this.getA11yList(this.sortProducts(this.layout === component_product_row_1.ProductRowLayoutEnum.compactPrint\n ? this.getOnlyArticleShoppingProducts()\n : this.shoppingProducts).map((shoppingProduct) => this.getRow(shoppingProduct)))}\n\t\t`;\n }\n getOnlyArticleShoppingProducts() {\n return this.shoppingProducts\n .flatMap((shoppingProduct) => {\n const { itemType } = shoppingProduct.product.content || {};\n if (itemType === enums_1.ItemTypeEnum.spr) {\n return this.getArticlesFromSpr(shoppingProduct);\n }\n else {\n return [shoppingProduct];\n }\n })\n .reduce((acc, shoppingProduct) => {\n var _a, _b;\n const itemNo = ((_a = shoppingProduct.product.content) === null || _a === void 0 ? void 0 : _a.itemNoLocal) ||\n ((_b = shoppingProduct.product.content) === null || _b === void 0 ? void 0 : _b.itemNoGlobal);\n const existingProduct = itemNo ? this.getExistingProduct(acc, itemNo) : null;\n if (existingProduct) {\n existingProduct.quantity += shoppingProduct.quantity;\n }\n else {\n acc.push(shoppingProduct);\n }\n return acc;\n }, []);\n }\n getArticlesFromSpr(shoppingProduct) {\n var _a, _b;\n const sprChildren = (_a = shoppingProduct.product.content) === null || _a === void 0 ? void 0 : _a.child;\n if (!sprChildren) {\n return [];\n }\n const includedProducts = [];\n for (const child of sprChildren) {\n const itemNo = child.itemId.split('-').reverse()[0];\n const includedProduct = (_b = this.includedProducts) === null || _b === void 0 ? void 0 : _b.find((includedProduct) => {\n var _a, _b;\n return itemNo === ((_a = includedProduct.content) === null || _a === void 0 ? void 0 : _a.itemNoLocal) ||\n itemNo === ((_b = includedProduct.content) === null || _b === void 0 ? void 0 : _b.itemNoGlobal);\n });\n if (includedProduct) {\n const totalQuantity = child.quantity * shoppingProduct.quantity;\n includedProducts.push({ product: includedProduct, quantity: totalQuantity });\n }\n }\n return includedProducts;\n }\n getExistingProduct(shoppingProducts, itemNo) {\n return shoppingProducts.find((includedProduct) => {\n var _a, _b;\n return itemNo === ((_a = includedProduct.product.content) === null || _a === void 0 ? void 0 : _a.itemNoLocal) ||\n itemNo === ((_b = includedProduct.product.content) === null || _b === void 0 ? void 0 : _b.itemNoGlobal);\n });\n }\n /**\n * Returns HTML for a section.\n *\n * @param section A product section.\n * @param section.label The label of the section.\n * @param section.shoppingProducts The shopping products that should be shown in the section.\n * @returns Template.\n */\n getSection(section) {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${this.getA11yList(this.sortProducts(section.shoppingProducts).map((shoppingProduct) => this.getRow(shoppingProduct)))}\n\t\t\t\n\t\t`;\n }\n /**\n * @param listItems Content within a list.\n */\n getA11yList(listItems) {\n /* eslint-disable lit-a11y/no-redundant-role */\n return (0, web_component_1.html) `\n\t\t\t
      \n\t\t\t\t${listItems}\n\t\t\t
    \n\t\t`;\n /* eslint-enable lit-a11y/no-redundant-role */\n }\n /**\n * Get sections.\n */\n getSections() {\n var _a, _b, _c, _d;\n const sections = [];\n for (const section of (_a = this.sections) !== null && _a !== void 0 ? _a : []) {\n if ((_b = section.products) === null || _b === void 0 ? void 0 : _b.length) {\n const shoppingProducts = [];\n for (const shoppingProduct of this.shoppingProducts) {\n const ruItemNo = (_d = (_c = shoppingProduct.product) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.ruItemNo;\n if (ruItemNo && section.products.includes(ruItemNo)) {\n shoppingProducts.push(shoppingProduct);\n }\n }\n sections.push({ label: section.label, shoppingProducts });\n }\n }\n return sections;\n }\n /**\n * Sorts products based on chosen sorting option.\n *\n * @param shoppingProducts The shopping products which should be sorted.\n */\n sortProducts(shoppingProducts) {\n var _a, _b, _c;\n return ProductListSorting_1.default.sort(shoppingProducts, this.sortBy, (_a = this.locale) !== null && _a !== void 0 ? _a : undefined, (_b = this.storeAvailabilities) !== null && _b !== void 0 ? _b : undefined, (_c = this.includedProducts) !== null && _c !== void 0 ? _c : undefined);\n }\n /**\n * Returns HTML for a ShoppingProduct row.\n *\n * @param shoppingProduct Retail item.\n * @returns Template.\n */\n getRow(shoppingProduct) {\n var _a, _b, _c;\n const product = shoppingProduct.product;\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t this.dispatchEvent(new CustomEvent('productImageClick', { bubbles: true, detail: Object.assign({}, event.detail) }))}\"\n\t\t\t\t\t@productNameClick=\"${(event) => this.dispatchEvent(new CustomEvent('productNameClick', { bubbles: true, detail: Object.assign({}, event.detail) }))}\"\n\t\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t\t.localizedInformation=\"${this.localizedInformation}\"\n\t\t\t\t\t.layout=\"${this.layout}\"\n\t\t\t\t\t.translations=\"${this.translations}\"\n\t\t\t\t\t.settings=\"${this.settings}\"\n\t\t\t\t\t.shoppingProduct=\"${shoppingProduct}\"\n\t\t\t\t\t.includedProducts=\"${this.includedProducts}\"\n\t\t\t\t\t.storeAvailabilities=\"${this.storeAvailabilities}\"\n\t\t\t\t\t.zipAvailabilities=\"${this.zipAvailabilities}\"\n\t\t\t\t\t.stores=\"${this.stores}\"\n\t\t\t\t\t.storeId=\"${this.storeId}\"\n\t\t\t\t\t.productMeasures=\"${this.productMeasures}\"\n\t\t\t\t\t.showItemNo=\"${this.showItemNo}\"\n\t\t\t\t\t.showStockStatusOnPrint=\"${this.showStockStatusOnPrint}\"\n\t\t\t\t\t.editableQuantity=\"${this.editableQuantity}\"\n\t\t\t\t\t.showDesignText=\"${this.showDesignText}\"\n\t\t\t\t\t.showPackageMeasures=\"${this.showPackageMeasures}\"\n\t\t\t\t\t.showWeight=\"${this.showWeight}\"\n\t\t\t\t\t.showTotalPrice=\"${true}\"\n\t\t\t\t\t.productLink=\"${this.productLink}\"\n\t\t\t\t\t.expanded=\"${this.isExpanded(product)}\"\n\t\t\t\t\t.collectable=\"${this.collectable}\"\n\t\t\t\t\t.collected=\"${this.getCollectedIds(product)}\"\n\t\t\t\t\t.quantityMinValue=\"${this.quantityMinValue}\"\n\t\t\t\t\t.disableLinks=\"${this.disableLinks}\"\n\t\t\t\t\t.visibleModal=\"${((_a = product.content) === null || _a === void 0 ? void 0 : _a.ruItemNo) === ((_b = this.visibleModal) === null || _b === void 0 ? void 0 : _b.itemNo)\n ? (_c = this.visibleModal) === null || _c === void 0 ? void 0 : _c.modal\n : null}\"\n\t\t\t\t\t.optionalState=\"${this.getProductRowOptionalState(product)}\"\n\t\t\t\t\t.disableOnlineSaleableVerification=\"${this.disableOnlineSaleableVerification}\"\n\t\t\t\t\t@modalOpen=\"${(event) => {\n var _a;\n return this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: {\n visibleModal: {\n modal: event.detail.visibleModal,\n itemNo: (_a = product.content) === null || _a === void 0 ? void 0 : _a.ruItemNo\n }\n }\n }));\n }}\"\n\t\t\t\t\t@modalClose=\"${() => this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }))}\"\n\t\t\t\t>\n\t\t\t
    \n\t\t`;\n }\n getTotalPrice() {\n if (this.layout !== component_product_row_1.ProductRowLayoutEnum.compactPrint) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t`;\n }\n /**\n * @param product Product.\n */\n onAdd(product) {\n var _a;\n if (product.content) {\n const removable = (this.removable || []).slice();\n const addable = (this.addable || []).slice();\n const ruItemNo = (_a = product.content) === null || _a === void 0 ? void 0 : _a.ruItemNo;\n const index = ruItemNo ? addable.indexOf(ruItemNo) : -1;\n if (index !== -1) {\n addable.splice(index, 1);\n }\n ruItemNo && removable.push(ruItemNo);\n this.dispatchEvent(new CustomEvent('add', {\n bubbles: true,\n detail: { removable, addable, itemNo: product.content.ruItemNo }\n }));\n }\n }\n /**\n * @param product Product.\n */\n onRemove(product) {\n var _a;\n if (product.content) {\n const removable = (this.removable || []).slice();\n const addable = (this.addable || []).slice();\n const ruItemNo = (_a = product.content) === null || _a === void 0 ? void 0 : _a.ruItemNo;\n const index = ruItemNo ? removable.indexOf(ruItemNo) : -1;\n if (index !== -1) {\n removable.splice(index, 1);\n }\n ruItemNo && addable.push(ruItemNo);\n this.dispatchEvent(new CustomEvent('remove', {\n bubbles: true,\n detail: { removable, addable, itemNo: product.content.ruItemNo }\n }));\n }\n }\n /**\n * @param product Product.\n */\n onExpand(product) {\n var _a;\n if (product.content) {\n const expanded = (this.expanded || []).slice();\n const ruItemNo = (_a = product === null || product === void 0 ? void 0 : product.content) === null || _a === void 0 ? void 0 : _a.ruItemNo;\n const index = ruItemNo ? expanded.indexOf(ruItemNo) : -1;\n if (index !== -1) {\n expanded.splice(index, 1);\n }\n else {\n ruItemNo && expanded.push(ruItemNo);\n }\n this.dispatchEvent(new CustomEvent('expand', {\n bubbles: true,\n detail: { expanded, itemNo: product.content.ruItemNo }\n }));\n }\n }\n /**\n * @param event Event.\n */\n onCollect(event) {\n var _a, _b;\n let collected = [];\n for (const productRow of Array.from((_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('kompis-product-row')) !== null && _b !== void 0 ? _b : [])) {\n if (productRow === event.currentTarget) {\n collected = collected.concat(event.detail.collected);\n }\n else if (productRow['collected']) {\n collected = collected.concat(productRow['collected']);\n }\n }\n this.dispatchEvent(new CustomEvent('collect', {\n bubbles: true,\n detail: { collected, collectId: event.detail.collectId }\n }));\n }\n /**\n * @param event Event.\n */\n onQuantity(event) {\n const changedShoppingProduct = event.detail.shoppingProduct;\n if (changedShoppingProduct.product.content) {\n const changedItemNo = changedShoppingProduct.product.content.itemNoLocal ||\n changedShoppingProduct.product.content.itemNoGlobal;\n this.dispatchEvent(new CustomEvent('quantity', {\n bubbles: true,\n detail: {\n shoppingProducts: this.shoppingProducts.map((shoppingProduct) => {\n var _a, _b;\n if (((_a = shoppingProduct.product.content) === null || _a === void 0 ? void 0 : _a.itemNoLocal) === changedItemNo ||\n ((_b = shoppingProduct.product.content) === null || _b === void 0 ? void 0 : _b.itemNoGlobal) === changedItemNo) {\n return changedShoppingProduct;\n }\n return shoppingProduct;\n }),\n shoppingProduct: changedShoppingProduct\n }\n }));\n }\n }\n /**\n * @param product Product.\n * @returns \"true\" if expanded.\n */\n isExpanded(product) {\n if (!product.content) {\n return false;\n }\n const expanded = this.expanded || [];\n return ((!!product.content.itemNoLocal && expanded.includes(product.content.itemNoLocal)) ||\n (!!product.content.itemNoGlobal && expanded.includes(product.content.itemNoGlobal)));\n }\n /**\n * @param product Product.\n * @returns Collected.\n */\n getCollectedIds(product) {\n if (!product.content) {\n return [];\n }\n return (this.collected || []).filter((collectId) => {\n var _a, _b;\n return (((_a = product.content) === null || _a === void 0 ? void 0 : _a.itemNoLocal) && collectId.startsWith(product.content.itemNoLocal)) ||\n (((_b = product.content) === null || _b === void 0 ? void 0 : _b.itemNoGlobal) && collectId.startsWith(product.content.itemNoGlobal));\n });\n }\n /**\n * @param product Product.\n * @returns Optional state.\n */\n getProductRowOptionalState(product) {\n var _a;\n const ruItemNo = (_a = product.content) === null || _a === void 0 ? void 0 : _a.ruItemNo;\n if (ruItemNo && (this.removable || []).includes(ruItemNo)) {\n return component_product_row_2.ProductRowOptionalStateEnum.removableFromList;\n }\n if (ruItemNo && (this.addable || []).includes(ruItemNo)) {\n return component_product_row_2.ProductRowOptionalStateEnum.addable;\n }\n return component_product_row_2.ProductRowOptionalStateEnum.mandatory;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ProductList.prototype, \"shoppingProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductList.prototype, \"includedProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductList.prototype, \"addable\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductList.prototype, \"removable\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductList.prototype, \"sections\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductList.prototype, \"storeAvailabilities\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductList.prototype, \"zipAvailabilities\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductList.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductList.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductList.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ProductList.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductList.prototype, \"productMeasures\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductList.prototype, \"productLink\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductList.prototype, \"showItemNo\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductList.prototype, \"showWeight\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductList.prototype, \"editableQuantity\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductList.prototype, \"showDesignText\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductList.prototype, \"showPackageMeasures\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductList.prototype, \"showStockStatusOnPrint\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductList.prototype, \"expanded\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductList.prototype, \"collectable\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductList.prototype, \"collected\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], ProductList.prototype, \"quantityMinValue\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductList.prototype, \"stores\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductList.prototype, \"storeId\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductList.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductList.prototype, \"sortBy\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductList.prototype, \"locale\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductList.prototype, \"disableOnlineSaleableVerification\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductList.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductList.prototype, \"skipListingLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductList.prototype, \"maxHeadingLevel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductList.prototype, \"layout\", void 0);\nProductList = __decorate([\n (0, web_component_1.customElement)('kompis-product-list')\n], ProductList);\nexports.default = ProductList;\n//# sourceMappingURL=ProductList.js.map","import \"@inter-ikea-kompis/component-product-list/lib/components/product-list/ProductList\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisProductList extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-product-list\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.addable = props.addable;\n element.collectable = props.collectable;\n element.collected = props.collected;\n element.disableLinks = props.disableLinks;\n element.disableOnlineSaleableVerification = props.disableOnlineSaleableVerification;\n element.editableQuantity = props.editableQuantity;\n element.expanded = props.expanded;\n element.includedProducts = props.includedProducts;\n element.layout = props.layout;\n element.locale = props.locale;\n element.localizedInformation = props.localizedInformation;\n element.maxHeadingLevel = props.maxHeadingLevel;\n element.productLink = props.productLink;\n element.productMeasures = props.productMeasures;\n element.quantityMinValue = props.quantityMinValue;\n element.removable = props.removable;\n element.sections = props.sections;\n element.settings = props.settings;\n element.shoppingProducts = props.shoppingProducts;\n element.showDesignText = props.showDesignText;\n element.showItemNo = props.showItemNo;\n element.showPackageMeasures = props.showPackageMeasures;\n element.showStockStatusOnPrint = props.showStockStatusOnPrint;\n element.showWeight = props.showWeight;\n element.skipListingLabel = props.skipListingLabel;\n element.sortBy = props.sortBy;\n element.storeAvailabilities = props.storeAvailabilities;\n element.storeId = props.storeId;\n element.stores = props.stores;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n element.zipAvailabilities = props.zipAvailabilities;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onAdd, \"add\");\n this.updateEventListener(element, props.onCollect, \"collect\");\n this.updateEventListener(element, props.onExpand, \"expand\");\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n this.updateEventListener(element, props.onProductImageClick, \"productImageClick\");\n this.updateEventListener(element, props.onProductNameClick, \"productNameClick\");\n this.updateEventListener(element, props.onQuantity, \"quantity\");\n this.updateEventListener(element, props.onRemove, \"remove\");\n }\n}\nKompisProductList.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n addable: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n collectable: PropTypes.bool,\n collected: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n disableLinks: PropTypes.bool,\n disableOnlineSaleableVerification: PropTypes.bool,\n editableQuantity: PropTypes.bool,\n expanded: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n includedProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n layout: PropTypes.string,\n locale: PropTypes.string,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n maxHeadingLevel: PropTypes.string,\n productLink: PropTypes.string,\n productMeasures: PropTypes.string,\n quantityMinValue: PropTypes.number,\n removable: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n sections: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n shoppingProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n showDesignText: PropTypes.bool,\n showItemNo: PropTypes.bool,\n showPackageMeasures: PropTypes.bool,\n showStockStatusOnPrint: PropTypes.bool,\n showWeight: PropTypes.bool,\n skipListingLabel: PropTypes.string,\n sortBy: PropTypes.string,\n storeAvailabilities: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n storeId: PropTypes.string,\n stores: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n zipAvailabilities: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n onAdd: PropTypes.func,\n onRemove: PropTypes.func,\n onQuantity: PropTypes.func,\n onExpand: PropTypes.func,\n onCollect: PropTypes.func,\n onProductImageClick: PropTypes.func,\n onProductNameClick: PropTypes.func,\n onModalClose: PropTypes.func,\n onModalOpen: PropTypes.func\n};\nexport default KompisProductList;\n","import \"@inter-ikea-kompis/component-product-row/lib/components/compact-product-row/CompactProductRow\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisCompactProductRow extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-compact-product-row\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.localizedInformation = props.localizedInformation;\n element.settings = props.settings;\n element.shoppingProduct = props.shoppingProduct;\n element.storeAvailabilities = props.storeAvailabilities;\n element.theme = props.theme;\n element.translations = props.translations;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisCompactProductRow.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n shoppingProduct: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n storeAvailabilities: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object])\n};\nexport default KompisCompactProductRow;\n","import \"@inter-ikea-kompis/component-product-row/lib/components/product-row/ProductRow\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisProductRow extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-product-row\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.collectable = props.collectable;\n element.collected = props.collected;\n element.disableLinks = props.disableLinks;\n element.disableOnlineSaleableVerification = props.disableOnlineSaleableVerification;\n element.editableQuantity = props.editableQuantity;\n element.expanded = props.expanded;\n element.includedProducts = props.includedProducts;\n element.layout = props.layout;\n element.localizedInformation = props.localizedInformation;\n element.optionalState = props.optionalState;\n element.productLink = props.productLink;\n element.productMeasures = props.productMeasures;\n element.quantityMinValue = props.quantityMinValue;\n element.settings = props.settings;\n element.shoppingProduct = props.shoppingProduct;\n element.showDesignText = props.showDesignText;\n element.showItemNo = props.showItemNo;\n element.showPackageMeasures = props.showPackageMeasures;\n element.showStockStatusOnPrint = props.showStockStatusOnPrint;\n element.showTotalPrice = props.showTotalPrice;\n element.showWeight = props.showWeight;\n element.storeAvailabilities = props.storeAvailabilities;\n element.storeId = props.storeId;\n element.stores = props.stores;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n element.zipAvailabilities = props.zipAvailabilities;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onAdd, \"add\");\n this.updateEventListener(element, props.onCollect, \"collect\");\n this.updateEventListener(element, props.onExpand, \"expand\");\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n this.updateEventListener(element, props.onProductImageClick, \"productImageClick\");\n this.updateEventListener(element, props.onProductNameClick, \"productNameClick\");\n this.updateEventListener(element, props.onQuantity, \"quantity\");\n this.updateEventListener(element, props.onRemove, \"remove\");\n }\n}\nKompisProductRow.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n collectable: PropTypes.bool,\n collected: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n disableLinks: PropTypes.bool,\n disableOnlineSaleableVerification: PropTypes.bool,\n editableQuantity: PropTypes.bool,\n expanded: PropTypes.bool,\n includedProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n layout: PropTypes.string,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n optionalState: PropTypes.string,\n productLink: PropTypes.string,\n productMeasures: PropTypes.string,\n quantityMinValue: PropTypes.number,\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n shoppingProduct: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n showDesignText: PropTypes.bool,\n showItemNo: PropTypes.bool,\n showPackageMeasures: PropTypes.bool,\n showStockStatusOnPrint: PropTypes.bool,\n showTotalPrice: PropTypes.bool,\n showWeight: PropTypes.bool,\n storeAvailabilities: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n storeId: PropTypes.string,\n stores: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n zipAvailabilities: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n onQuantity: PropTypes.func,\n onExpand: PropTypes.func,\n onCollect: PropTypes.func,\n onAdd: PropTypes.func,\n onRemove: PropTypes.func,\n onProductImageClick: PropTypes.func,\n onProductNameClick: PropTypes.func,\n onModalClose: PropTypes.func,\n onModalOpen: PropTypes.func\n};\nexport default KompisProductRow;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ProductCardModalEnum;\n(function (ProductCardModalEnum) {\n ProductCardModalEnum[\"energyLabelCard\"] = \"energyLabelCard\";\n ProductCardModalEnum[\"ecoFeeCard\"] = \"ecoFeeCard\";\n ProductCardModalEnum[\"energyFicheCard\"] = \"energyFicheCard\";\n ProductCardModalEnum[\"storeSelectorCard\"] = \"storeSelectorCard\";\n ProductCardModalEnum[\"zipAvailabilityCard\"] = \"zipAvailabilityCard\";\n ProductCardModalEnum[\"unifiedWaterLabelCard\"] = \"waterLabelCard\";\n ProductCardModalEnum[\"productDetailsCard\"] = \"productDetailsCard\";\n ProductCardModalEnum[\"technicalInformationCard\"] = \"technicalInformationCard\";\n ProductCardModalEnum[\"measurementsCard\"] = \"measurementsCard\";\n})(ProductCardModalEnum || (ProductCardModalEnum = {}));\nexports.default = ProductCardModalEnum;\n//# sourceMappingURL=ProductCardModalEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProductCardVariants = exports.ProductCardSelectedStateEnum = exports.ProductCardSelectBehaviourEnum = exports.ProductCardPriceLayoutTypeEnum = exports.ProductCardModalEnum = exports.ProductCardMediaEnum = exports.ProductCardMedia = exports.ProductCardLayoutEnum = exports.ProductCard = void 0;\nconst ProductCard_1 = __importDefault(require(\"./components/product-card/ProductCard\"));\nexports.ProductCard = ProductCard_1.default;\nconst ProductCardMedia_1 = __importDefault(require(\"./components/product-card-media/ProductCardMedia\"));\nexports.ProductCardMedia = ProductCardMedia_1.default;\nconst ProductCardVariants_1 = __importDefault(require(\"./components/product-card-variants/ProductCardVariants\"));\nexports.ProductCardVariants = ProductCardVariants_1.default;\nconst ProductCardLayoutEnum_1 = __importDefault(require(\"./enums/ProductCardLayoutEnum\"));\nexports.ProductCardLayoutEnum = ProductCardLayoutEnum_1.default;\nconst ProductCardMediaEnum_1 = __importDefault(require(\"./enums/ProductCardMediaEnum\"));\nexports.ProductCardMediaEnum = ProductCardMediaEnum_1.default;\nconst ProductCardModalEnum_1 = __importDefault(require(\"./enums/ProductCardModalEnum\"));\nexports.ProductCardModalEnum = ProductCardModalEnum_1.default;\nconst ProductCardPriceLayoutTypeEnum_1 = __importDefault(require(\"./enums/ProductCardPriceLayoutTypeEnum\"));\nexports.ProductCardPriceLayoutTypeEnum = ProductCardPriceLayoutTypeEnum_1.default;\nconst ProductCardSelectBehaviourEnum_1 = __importDefault(require(\"./enums/ProductCardSelectBehaviourEnum\"));\nexports.ProductCardSelectBehaviourEnum = ProductCardSelectBehaviourEnum_1.default;\nconst ProductCardSelectedStateEnum_1 = __importDefault(require(\"./enums/ProductCardSelectedStateEnum\"));\nexports.ProductCardSelectedStateEnum = ProductCardSelectedStateEnum_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ProductShelfProductCardMediaEnum;\n(function (ProductShelfProductCardMediaEnum) {\n ProductShelfProductCardMediaEnum[\"singleImage\"] = \"singleImage\";\n ProductShelfProductCardMediaEnum[\"switchImageOnHover\"] = \"switchImageOnHover\";\n})(ProductShelfProductCardMediaEnum || (ProductShelfProductCardMediaEnum = {}));\nexports.default = ProductShelfProductCardMediaEnum;\n//# sourceMappingURL=ProductShelfProductCardMediaEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ProductShelfProductLinkEnum;\n(function (ProductShelfProductLinkEnum) {\n ProductShelfProductLinkEnum[\"disabled\"] = \"disabled\";\n ProductShelfProductLinkEnum[\"productInformationPage\"] = \"productInformationPage\";\n ProductShelfProductLinkEnum[\"eventOnly\"] = \"eventOnly\";\n})(ProductShelfProductLinkEnum || (ProductShelfProductLinkEnum = {}));\nexports.default = ProductShelfProductLinkEnum;\n//# sourceMappingURL=ProductShelfProductLinkEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass ProductShelfStyle {\n static getStyle(options) {\n const { space50, space100 } = options.theme.spacing;\n return (0, web_component_1.css) `\n\t\t\tkompis-carousel-item {\n\t\t\t\tjustify-content: flex-start;\n\t\t\t\tflex-direction: column;\n\t\t\t\tmin-width: ${249 / 16}rem;\n\t\t\t\tmax-width: ${249 / 16}rem;\n\t\t\t\tpadding: ${space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\tkompis-add-to-bag {\n\t\t\t\talign-self: flex-end;\n\t\t\t\tmargin-top: ${space50 / 16}rem;\n\t\t\t}\n\n\t\t\tkompis-product-card {\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = ProductShelfStyle;\n//# sourceMappingURL=ProductShelfStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_add_to_bag_1 = require(\"@inter-ikea-kompis/component-add-to-bag\");\nconst component_carousel_1 = require(\"@inter-ikea-kompis/component-carousel\");\nconst component_product_card_1 = require(\"@inter-ikea-kompis/component-product-card\");\nrequire(\"@inter-ikea-kompis/component-carousel\");\nrequire(\"@inter-ikea-kompis/component-add-to-bag\");\nrequire(\"@inter-ikea-kompis/component-product-card\");\nconst ProductShelfProductCardMediaEnum_1 = __importDefault(require(\"../../enums/ProductShelfProductCardMediaEnum\"));\nconst ProductShelfProductLinkEnum_1 = __importDefault(require(\"../../enums/ProductShelfProductLinkEnum\"));\nconst ProductShelfStyle_1 = __importDefault(require(\"./ProductShelfStyle\"));\nconst ADD_TO_BAG_LAYOUT = component_add_to_bag_1.AddToBagLayoutEnum.icon;\n/**\n * ProductShelf View component.\n *\n * @event addToCart Emitted when user clicks on the add to cart button.\n * @event addToList Emitted when user clicks on the add to shopping list button.\n * @event change Emits when selectedIndex has changed. e.g. when user is clicking on next-button\n * @event linkClick Emitted when user clicks on PIP link.\n * @event modalClose Triggered when the modal has been closed\n * @event modalOpen Triggered when a modal has been opened. event.detail.type tells you the type\n */\nlet ProductShelf = class ProductShelf extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Set which slide index that should be active\n this.selectedIndex = 0;\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // A list of IDs\n this.itemsAddedToCart = null;\n // A list of IDs\n this.itemsAddedToList = null;\n // A list of IDs\n this.loadingItemsAddedToCart = null;\n // A list of IDs\n this.loadingItemsAddedToList = null;\n // Sets how media should be displayed.\n this.productCardMedia = ProductShelfProductCardMediaEnum_1.default.singleImage;\n // Visible modal.\n this.visibleModal = null;\n // Hides the add to bag component. This attribute should be set to \"true\" when in a Kiosk\n this.hideAddToBag = false;\n // Sets the link behaviour. This attribute should be set to \"disabled\" when in a Kiosk.\n this.productLink = ProductShelfProductLinkEnum_1.default.productInformationPage;\n // Show price excl tax.\n this.showPriceExclTax = false;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // Skip listing label\n this.skipListingLabel = null;\n // Show design text for Product Cards in Shelf.\n this.showDesignText = false;\n // Show product measures for Product Cards in Shelf.\n this.productMeasures = utilities_1.ProductDescriptionProductMeasureEnum.none;\n this.breakpointObserver = new themes_1.ThemeBreakpointObserver(() => this.requestUpdate());\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\t${this.getCarouselSlides()}\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.breakpointObserver.disconnect();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('theme')) {\n this.breakpointObserver.observe(this.theme);\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return !!this.localizedInformation || !!(this.translations && this.settings);\n }\n onChange(event) {\n this.dispatchEvent(new CustomEvent('change', {\n bubbles: true,\n detail: { selectedIndex: event.detail.selectedIndex, type: 'carousel' }\n }));\n }\n /**\n * Get swiper slides with ProductShelf Items.\n *\n * @returns Template.\n */\n getCarouselSlides() {\n return this.products.map(this.getCarouselItem.bind(this));\n }\n getCarouselItem(product) {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${this.getProductCard(product)} ${this.getAddToBag(product)}\n\t\t\t\n\t\t`;\n }\n getProductCard(product) {\n var _a, _b, _c;\n const productCardMedia = this.productCardMedia === ProductShelfProductCardMediaEnum_1.default.switchImageOnHover\n ? ProductShelfProductCardMediaEnum_1.default.switchImageOnHover\n : ProductShelfProductCardMediaEnum_1.default.singleImage;\n const isModalVisible = ((_a = product.content) === null || _a === void 0 ? void 0 : _a.ruItemNo) === ((_b = this.visibleModal) === null || _b === void 0 ? void 0 : _b.itemNo) ? (_c = this.visibleModal) === null || _c === void 0 ? void 0 : _c.modal : null;\n return (0, web_component_1.html) ` this.dispatchEvent(new CustomEvent('linkClick', { bubbles: true, detail: product }))}\n\t\t\t@modalClose=\"${() => this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }))}\"\n\t\t\t@modalOpen=\"${(event) => {\n var _a;\n return this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: {\n visibleModal: {\n modal: event.detail.visibleModal,\n itemNo: (_a = product.content) === null || _a === void 0 ? void 0 : _a.ruItemNo\n }\n }\n }));\n }}\"\n\t\t>\n\t\t`;\n }\n getAddToBag(product) {\n if (this.hideAddToBag) {\n return null;\n }\n return (0, web_component_1.html) ` this.dispatchEvent(new CustomEvent('addToCart', {\n bubbles: true,\n detail: { shoppingItems: event.detail.shoppingItems }\n }))}\n\t\t\t@addToList=${(event) => this.dispatchEvent(new CustomEvent('addToList', {\n bubbles: true,\n detail: { shoppingItems: event.detail.shoppingItems }\n }))}\n\t\t>\n\t\t`;\n }\n getAddToBagState(product, loadingItems, itemsAdded) {\n var _a;\n if (!((_a = product.content) === null || _a === void 0 ? void 0 : _a.ruItemNo)) {\n return component_add_to_bag_1.AddToBagStateEnum.default;\n }\n if (loadingItems && loadingItems.includes(product.content.ruItemNo)) {\n return component_add_to_bag_1.AddToBagStateEnum.loading;\n }\n if (itemsAdded && itemsAdded.includes(product.content.ruItemNo)) {\n return component_add_to_bag_1.AddToBagStateEnum.confirmation;\n }\n return component_add_to_bag_1.AddToBagStateEnum.default;\n }\n getShoppingProduct(product) {\n return {\n product: product,\n quantity: 1\n };\n }\n getProductCardSelectBehaviour() {\n switch (this.productLink) {\n case ProductShelfProductLinkEnum_1.default.disabled:\n return component_product_card_1.ProductCardSelectBehaviourEnum.disabled;\n case ProductShelfProductLinkEnum_1.default.eventOnly:\n return component_product_card_1.ProductCardSelectBehaviourEnum.selectable;\n case ProductShelfProductLinkEnum_1.default.productInformationPage:\n return component_product_card_1.ProductCardSelectBehaviourEnum.productInformationPageLink;\n }\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ProductShelf.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductShelf.prototype, \"products\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number, synchronous: true })\n], ProductShelf.prototype, \"selectedIndex\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductShelf.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductShelf.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductShelf.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductShelf.prototype, \"itemsAddedToCart\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductShelf.prototype, \"itemsAddedToList\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductShelf.prototype, \"loadingItemsAddedToCart\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductShelf.prototype, \"loadingItemsAddedToList\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductShelf.prototype, \"productCardMedia\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], ProductShelf.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductShelf.prototype, \"hideAddToBag\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductShelf.prototype, \"productLink\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductShelf.prototype, \"showPriceExclTax\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductShelf.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductShelf.prototype, \"skipListingLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ProductShelf.prototype, \"showDesignText\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ProductShelf.prototype, \"productMeasures\", void 0);\nProductShelf = __decorate([\n (0, web_component_1.customElement)('kompis-product-shelf')\n], ProductShelf);\nexports.default = ProductShelf;\n//# sourceMappingURL=ProductShelf.js.map","import \"@inter-ikea-kompis/component-product-shelf/lib/components/product-shelf/ProductShelf\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisProductShelf extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-product-shelf\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.disableLinks = props.disableLinks;\n element.hideAddToBag = props.hideAddToBag;\n element.itemsAddedToCart = props.itemsAddedToCart;\n element.itemsAddedToList = props.itemsAddedToList;\n element.loadingItemsAddedToCart = props.loadingItemsAddedToCart;\n element.loadingItemsAddedToList = props.loadingItemsAddedToList;\n element.localizedInformation = props.localizedInformation;\n element.productCardMedia = props.productCardMedia;\n element.productLink = props.productLink;\n element.productMeasures = props.productMeasures;\n element.products = props.products;\n element.selectedIndex = props.selectedIndex;\n element.settings = props.settings;\n element.showDesignText = props.showDesignText;\n element.showPriceExclTax = props.showPriceExclTax;\n element.skipListingLabel = props.skipListingLabel;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onAddToCart, \"addToCart\");\n this.updateEventListener(element, props.onAddToList, \"addToList\");\n this.updateEventListener(element, props.onChange, \"change\");\n this.updateEventListener(element, props.onLinkClick, \"linkClick\");\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n }\n}\nKompisProductShelf.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n disableLinks: PropTypes.bool,\n hideAddToBag: PropTypes.bool,\n itemsAddedToCart: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n itemsAddedToList: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n loadingItemsAddedToCart: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n loadingItemsAddedToList: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n productCardMedia: PropTypes.string,\n productLink: PropTypes.string,\n productMeasures: PropTypes.string,\n products: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n selectedIndex: PropTypes.number,\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n showDesignText: PropTypes.bool,\n showPriceExclTax: PropTypes.bool,\n skipListingLabel: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n onAddToCart: PropTypes.func,\n onAddToList: PropTypes.func,\n onChange: PropTypes.func,\n onLinkClick: PropTypes.func,\n onModalClose: PropTypes.func,\n onModalOpen: PropTypes.func\n};\nexport default KompisProductShelf;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar PromptButtonTypeEnum;\n(function (PromptButtonTypeEnum) {\n PromptButtonTypeEnum[\"primaryButton\"] = \"primaryButton\";\n PromptButtonTypeEnum[\"secondaryButton\"] = \"secondaryButton\";\n})(PromptButtonTypeEnum || (PromptButtonTypeEnum = {}));\nexports.default = PromptButtonTypeEnum;\n//# sourceMappingURL=PromptButtonTypeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar PromptAnimationNameEnum;\n(function (PromptAnimationNameEnum) {\n PromptAnimationNameEnum[\"opening\"] = \"opening\";\n PromptAnimationNameEnum[\"closing\"] = \"closing\";\n})(PromptAnimationNameEnum || (PromptAnimationNameEnum = {}));\nexports.default = PromptAnimationNameEnum;\n//# sourceMappingURL=PromptAnimationNameEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst PromptAnimationNameEnum_1 = __importDefault(require(\"../../enums/PromptAnimationNameEnum\"));\nconst MAX_WIDTH = 504;\nclass PromptStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.isFullscreen \"true\" if fullscreen.\n * @param options.zIndex Z-index.\n * @param options.state Lightbox state.\n * @param options.top Offset from top.\n * @param options.bottom Offset from bottom.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n var _a;\n const { spacing, color, motion, breakpoint } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tpointer-events: none;\n\t\t\t\tposition: fixed;\n\t\t\t\tleft: 0;\n\t\t\t\tright: 0;\n\t\t\t\ttop: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\tz-index: ${options.zIndex};\n\t\t\t}\n\t\t\t* {\n\t\t\t\tz-index: inherit;\n\t\t\t}\n\t\t\t.backdrop {\n\t\t\t\tdisplay: block;\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\tright: 0;\n\t\t\t\topacity: ${options.visible ? 1 : 0};\n\t\t\t\ttransition-property: opacity;\n\t\t\t\ttransition-duration: ${motion.duration.medium};\n\t\t\t\tbackground-color: ${color.transparency.light};\n\t\t\t\tpointer-events: auto;\n\t\t\t}\n\t\t\t.intersection {\n\t\t\t\tposition: absolute;\n\t\t\t\tleft: 0;\n\t\t\t\tright: 0;\n\t\t\t\ttop: ${options.top}px;\n\t\t\t\tbottom: ${options.bottom}px;\n\t\t\t\tdisplay: flex;\n\t\t\t\ttransition: top ${motion.duration.medium} ${motion.ease.easy},\n\t\t\t\t\tbottom ${motion.duration.medium} ${motion.ease.easy};\n\t\t\t}\n\t\t\t.body {\n\t\t\t\tflex-grow: 1;\n\t\t\t}\n\t\t\t.footer {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\t\t\t.scrollContainer {\n\t\t\t\toverflow-y: auto;\n\t\t\t\tflex-grow: 1;\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\t\t\t.buttonDivider {\n\t\t\t\twidth: ${spacing.space75 / 16}rem;\n\t\t\t\theight: ${spacing.space100 / 16}rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t}\n\t\t\t.lightbox {\n\t\t\t\tpointer-events: ${options.isAnimating ? 'none' : 'auto'};\n\t\t\t\toverflow: hidden;\n\t\t\t\tposition: relative;\n\t\t\t\tbackground-color: ${color.neutral.white};\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\t${(_a = this.getAnimationName(options)) !== null && _a !== void 0 ? _a : ''};\n\t\t\t\tanimation-duration: ${options.theme.motion.duration.medium};\n\t\t\t\tanimation-fill-mode: both;\n\t\t\t\tanimation-timing-function: ${options.visible ? 'ease-out' : 'easy-in'};\n\t\t\t}\n\t\t\t@media screen and (max-width: ${breakpoint.medium.width / 16}rem) {\n\t\t\t\t${this.getMobileRules(options)}\n\t\t\t}\n\t\t\t@media screen and (min-width: ${(breakpoint.medium.width + 1) / 16}rem) {\n\t\t\t\t${this.getDesktopRules(options)}\n\t\t\t}\n\t\t`;\n }\n /**\n * @param options\n */\n static getAnimationName(options) {\n if (!options.isAnimating) {\n return null;\n }\n if (options.visible) {\n return (0, web_component_1.css) `\n\t\t\t\tanimation-name: ${PromptAnimationNameEnum_1.default.opening};\n\t\t\t`;\n }\n return (0, web_component_1.css) `\n\t\t\tanimation-name: ${PromptAnimationNameEnum_1.default.closing};\n\t\t`;\n }\n /**\n * Gets the mobile rules for borders, opening, closing for sheet.\n *\n * @param options Options.\n */\n static getMobileRules(options) {\n const { spacing, border, color } = options.theme;\n const borderRadius = options.isFullscreen ? 0 : border.radius.radius8 / 16;\n const lightboxPaddingTop = options.isFullscreen ? 0 : spacing.space150 / 16;\n const headerMarginTop = options.isFullscreen ? spacing.space550 / 16 : spacing.space150 / 16;\n return (0, web_component_1.css) `\n\t\t\t.header {\n\t\t\t\tmargin-top: ${headerMarginTop}rem;\n\t\t\t\tpadding: 0 ${spacing.space150 / 16}rem;\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\t\t\t.body {\n\t\t\t\tmargin-top: ${spacing.space100 / 16}rem;\n\t\t\t\tpadding: 0 ${spacing.space150 / 16}rem;\n\t\t\t\toverflow-x: hidden;\n\t\t\t}\n\t\t\t.footer {\n\t\t\t\tmargin: ${spacing.space150 / 16}rem 0;\n\t\t\t\tpadding: 0 ${spacing.space150 / 16}rem;\n\t\t\t\tflex-direction: ${options.compact ? 'row-reverse' : 'column'};\n\t\t\t}\n\t\t\t.lightbox {\n\t\t\t\tflex-grow: ${options.isFullscreen ? 1 : 0};\n\t\t\t\tborder-top-left-radius: ${borderRadius}rem;\n\t\t\t\tborder-top-right-radius: ${borderRadius}rem;\n\t\t\t}\n\t\t\t.intersection {\n\t\t\t\tpadding-top: ${lightboxPaddingTop}rem;\n\t\t\t\tflex-direction: column-reverse;\n\t\t\t}\n\t\t\t@keyframes ${PromptAnimationNameEnum_1.default.opening} {\n\t\t\t\tfrom {\n\t\t\t\t\ttransform: translateY(100%);\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\ttransform: none;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes ${PromptAnimationNameEnum_1.default.closing} {\n\t\t\t\tfrom {\n\t\t\t\t\ttransform: none;\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\ttransform: translateY(100%);\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n /**\n * Gets the desktop rules for borders, opening, closing for sheet.\n *\n * @param options Options.\n */\n static getDesktopRules(options) {\n const { spacing, border } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t.header {\n\t\t\t\tmargin-top: ${spacing.space250 / 16}rem;\n\t\t\t\tpadding: 0 ${spacing.space150 / 16}rem;\n\t\t\t}\n\t\t\t.body {\n\t\t\t\tmargin-top: ${spacing.space100 / 16}rem;\n\t\t\t\tpadding: 0 ${spacing.space150 / 16}rem;\n\t\t\t}\n\t\t\t.footer {\n\t\t\t\tmargin: ${spacing.space250 / 16}rem 0;\n\t\t\t\tpadding: 0 ${spacing.space150 / 16}rem;\n\t\t\t\tflex-direction: ${options.compact ? 'row-reverse' : 'column'};\n\t\t\t}\n\t\t\t.lightbox {\n\t\t\t\tmax-height: 75vh;\n\t\t\t\twidth: ${MAX_WIDTH / 16}rem;\n\t\t\t\tmax-width: ${MAX_WIDTH / 16}rem;\n\t\t\t\tborder-radius: ${border.radius.radius8 / 16}rem;\n\t\t\t}\n\t\t\t.intersection {\n\t\t\t\tflex-direction: column;\n\t\t\t\tjustify-content: center;\n\t\t\t\talign-items: center;\n\t\t\t}\n\t\t\t@keyframes ${PromptAnimationNameEnum_1.default.closing} {\n\t\t\t\tfrom {\n\t\t\t\t\topacity: 1;\n\t\t\t\t\ttransform: scale(1);\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\topacity: 0;\n\t\t\t\t\ttransform: scale(0.9);\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes ${PromptAnimationNameEnum_1.default.opening} {\n\t\t\t\tfrom {\n\t\t\t\t\topacity: 0;\n\t\t\t\t\ttransform: scale(0.9);\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\topacity: 1;\n\t\t\t\t\ttransform: scale(1);\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = PromptStyle;\n//# sourceMappingURL=PromptStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst enums_2 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_button_1 = require(\"@inter-ikea-kompis/component-button\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@ingka/button-webc\");\nconst PromptButtonTypeEnum_1 = __importDefault(require(\"../../enums/PromptButtonTypeEnum\"));\nconst PromptStyle_1 = __importDefault(require(\"./PromptStyle\"));\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n *\n * Prompt component.\n *\n * @event buttonClick When a button is clicked.\n * @event animationEnd When the animation ends.\n */\nlet Prompt = class Prompt extends web_component_1.KompisElement {\n constructor() {\n // Can be open, closed, opening and closing\n super(...arguments);\n // Sets the prompt to fullscreen. Only affects mobile\n this.fullscreen = false;\n // Heading for the prompt\n this.heading = null;\n // Label for the primary button\n this.primaryButtonLabel = null;\n // Label for the secondary button\n this.secondaryButtonLabel = null;\n // True if sticky should be disabled.\n this.disableIframeSticky = false;\n // Override z-index of the prompt.\n this.zIndex = 500;\n // Hide or show prompt with transitions.\n this.visible = false;\n // Compact placing of buttons.\n this.compact = false;\n this.isAnimating = false;\n this.isRendered = false;\n this.top = 0;\n this.bottom = 0;\n this.breakpointObserver = new themes_1.ThemeBreakpointObserver(() => this.requestUpdate());\n this.iframeVisibleAreaObserver = utilities_1.IframeUtility.isInsideIframe() && utilities_1.IframeUtility.isParentWindowAccessible()\n ? new utilities_1.IframeVisibleAreaObserver({\n debounceTime: 100,\n overflow: true,\n callback: (area) => {\n this.top = area.top;\n this.bottom = area.bottom;\n this.requestUpdate();\n }\n })\n : null;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n if (!this.visible && !this.isAnimating) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t${this.getIntersection()}\n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.isRendered = false;\n this.isAnimating = false;\n if (this.iframeVisibleAreaObserver) {\n this.iframeVisibleAreaObserver.disconnect();\n }\n this.breakpointObserver.disconnect();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('visible') && this.isRendered) {\n this.isAnimating = true;\n }\n if (changedProperties.has('disableIframeSticky')) {\n if (this.disableIframeSticky) {\n this.top = 0;\n this.bottom = 0;\n }\n }\n if (this.iframeVisibleAreaObserver) {\n if (this.disableIframeSticky ||\n !utilities_1.IframeUtility.isInsideIframe() ||\n !utilities_1.IframeUtility.isParentWindowAccessible()) {\n this.iframeVisibleAreaObserver.disconnect();\n }\n else {\n this.iframeVisibleAreaObserver.observe();\n const area = this.iframeVisibleAreaObserver.getArea();\n this.top = area.top;\n this.bottom = area.bottom;\n }\n }\n if (changedProperties.has('theme')) {\n this.breakpointObserver.observe(this.theme);\n }\n this.isRendered = true;\n return true;\n }\n /**\n * The intersection between iframe and visible area.\n *\n * @returns - Html.\n */\n getIntersection() {\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t${this.heading}\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t${this.getPrimaryButton()}${this.getButtonDivider()}${this.getSecondaryButton()}\n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t
    \n\t\t`;\n }\n /**\n * Listener for animationend.\n *\n * @param event Html event.\n */\n onAnimationEnd() {\n this.isAnimating = false;\n if (this.visible) {\n this.dispatchEvent(new CustomEvent('animationEnd', { bubbles: true, detail: { type: 'open' } }));\n }\n else {\n this.dispatchEvent(new CustomEvent('animationEnd', { bubbles: true, detail: { type: 'close' } }));\n }\n this.requestUpdate();\n }\n /**\n * @returns Primary button HTMl.\n */\n getPrimaryButton() {\n if (!this.primaryButtonLabel) {\n return null;\n }\n const primaryVariant = 'primary';\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('buttonClick', {\n bubbles: true,\n detail: { type: PromptButtonTypeEnum_1.default.primaryButton }\n }))}\"\n\t\t\t>\n\t\t\t\t${this.primaryButtonLabel}\n\t\t\t\n\t\t`;\n }\n /**\n * @returns Secondary button HTMl.\n */\n getSecondaryButton() {\n if (!this.secondaryButtonLabel) {\n return null;\n }\n const secondaryVariant = 'secondary';\n return (0, web_component_1.html) `\n\t\t\t this.dispatchEvent(new CustomEvent('buttonClick', {\n bubbles: true,\n detail: { type: PromptButtonTypeEnum_1.default.secondaryButton }\n }))}\"\n\t\t\t>\n\t\t\t\t${this.secondaryButtonLabel}\n\t\t\t\n\t\t`;\n }\n getButtonDivider() {\n if (!this.secondaryButtonLabel) {\n return null;\n }\n return (0, web_component_1.html) `
    `;\n }\n /**\n * @returns True if landscape layout.\n */\n getButtonSize() {\n if (!this.compact || this.secondaryButtonLabel === null) {\n return component_button_1.ButtonSizeEnum.medium;\n }\n const currentBreakpointIndex = this.breakpointObserver.getBreakpointIndex();\n // If breakpointIndex is null, then return small button size\n if (!currentBreakpointIndex || currentBreakpointIndex <= enums_2.ThemeBreakpointIndexEnum.small) {\n return component_button_1.ButtonSizeEnum.small;\n }\n return component_button_1.ButtonSizeEnum.medium;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Prompt.prototype, \"fullscreen\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Prompt.prototype, \"heading\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Prompt.prototype, \"primaryButtonLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Prompt.prototype, \"secondaryButtonLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Prompt.prototype, \"disableIframeSticky\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], Prompt.prototype, \"zIndex\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Prompt.prototype, \"visible\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Prompt.prototype, \"compact\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Prompt.prototype, \"theme\", void 0);\nPrompt = __decorate([\n (0, web_component_1.customElement)('kompis-prompt')\n], Prompt);\nexports.default = Prompt;\n//# sourceMappingURL=Prompt.js.map","import \"@inter-ikea-kompis/component-prompt/lib/components/prompt/Prompt\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisPrompt extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-prompt\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.compact = props.compact;\n element.disableIframeSticky = props.disableIframeSticky;\n element.fullscreen = props.fullscreen;\n element.heading = props.heading;\n element.primaryButtonLabel = props.primaryButtonLabel;\n element.secondaryButtonLabel = props.secondaryButtonLabel;\n element.theme = props.theme;\n element.visible = props.visible;\n element.zIndex = props.zIndex;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onAnimationEnd, \"animationEnd\");\n this.updateEventListener(element, props.onButtonClick, \"buttonClick\");\n }\n}\nKompisPrompt.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n compact: PropTypes.bool,\n disableIframeSticky: PropTypes.bool,\n fullscreen: PropTypes.bool,\n heading: PropTypes.string,\n primaryButtonLabel: PropTypes.string,\n secondaryButtonLabel: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n visible: PropTypes.bool,\n zIndex: PropTypes.number,\n onButtonClick: PropTypes.func,\n onAnimationEnd: PropTypes.func\n};\nexport default KompisPrompt;\n","import \"@inter-ikea-kompis/component-qr-code/lib/components/qr-code/QrCode\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisQrCode extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-qr-code\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.qrCodeTitle = props.qrCodeTitle;\n element.url = props.url;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisQrCode.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n qrCodeTitle: PropTypes.string,\n url: PropTypes.string.isRequired\n};\nexport default KompisQrCode;\n","import \"@inter-ikea-kompis/component-quantity/lib/components/quantity/Quantity\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisQuantity extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-quantity\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.disabled = props.disabled;\n element.max = props.max;\n element.min = props.min;\n element.theme = props.theme;\n element.value = props.value;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onChange, \"change\");\n }\n}\nKompisQuantity.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n disabled: PropTypes.bool,\n max: PropTypes.number,\n min: PropTypes.number,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n value: PropTypes.number,\n onChange: PropTypes.func\n};\nexport default KompisQuantity;\n","import \"@inter-ikea-kompis/component-radio-button/lib/components/radio-button/RadioButton\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisRadioButton extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-radio-button\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.alignButton = props.alignButton;\n element.checked = props.checked;\n element.disabled = props.disabled;\n element.hovered = props.hovered;\n element.label = props.label;\n element.layout = props.layout;\n element.name = props.name;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onSelect, \"select\");\n }\n}\nKompisRadioButton.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n alignButton: PropTypes.string,\n checked: PropTypes.bool,\n disabled: PropTypes.bool,\n hovered: PropTypes.bool,\n label: PropTypes.string,\n layout: PropTypes.string,\n name: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n onSelect: PropTypes.func\n};\nexport default KompisRadioButton;\n","import \"@inter-ikea-kompis/component-radio-button/lib/components/radio-group/RadioGroup\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisRadioGroup extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-radio-group\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.heading = props.heading;\n element.helpText = props.helpText;\n element.invalid = props.invalid;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisRadioGroup.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n heading: PropTypes.string,\n helpText: PropTypes.string,\n invalid: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisRadioGroup;\n","import \"@inter-ikea-kompis/component-repairability-index/lib/components/repairability-index-card/RepairabilityIndexCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisRepairabilityIndexCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-repairability-index-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.product = props.product;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisRepairabilityIndexCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisRepairabilityIndexCard;\n","import \"@inter-ikea-kompis/component-repairability-index/lib/components/repairability-index/RepairabilityIndex\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisRepairabilityIndex extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-repairability-index\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.disableLinks = props.disableLinks;\n element.localizedInformation = props.localizedInformation;\n element.product = props.product;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n }\n}\nKompisRepairabilityIndex.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n disableLinks: PropTypes.bool,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n onModalOpen: PropTypes.func,\n onModalClose: PropTypes.func\n};\nexport default KompisRepairabilityIndex;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SaveDesignCardCopyStateEnum;\n(function (SaveDesignCardCopyStateEnum) {\n SaveDesignCardCopyStateEnum[\"default\"] = \"default\";\n SaveDesignCardCopyStateEnum[\"success\"] = \"success\";\n SaveDesignCardCopyStateEnum[\"failed\"] = \"failed\";\n})(SaveDesignCardCopyStateEnum || (SaveDesignCardCopyStateEnum = {}));\nexports.default = SaveDesignCardCopyStateEnum;\n//# sourceMappingURL=SaveDesignCardCopyStateEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SaveDesignCardStateEnum;\n(function (SaveDesignCardStateEnum) {\n SaveDesignCardStateEnum[\"default\"] = \"default\";\n SaveDesignCardStateEnum[\"sendByEmail\"] = \"sendByEmail\";\n SaveDesignCardStateEnum[\"sendBySms\"] = \"sendBySms\";\n SaveDesignCardStateEnum[\"getDesignCode\"] = \"getDesignCode\";\n SaveDesignCardStateEnum[\"getLink\"] = \"getLink\";\n})(SaveDesignCardStateEnum || (SaveDesignCardStateEnum = {}));\nexports.default = SaveDesignCardStateEnum;\n//# sourceMappingURL=SaveDesignCardStateEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst analytics_1 = require(\"@inter-ikea-kompis/analytics\");\nconst insights_data_provider_1 = require(\"@insights/insights-data-provider\");\nconst SaveDesignCardStateEnum_1 = __importDefault(require(\"../enums/SaveDesignCardStateEnum\"));\nconst moduleId = 'save_design_card';\n// Converts selected state in browser event 'select' to the corresponding name it should have in the analytics event 'save_design_select_option'\nconst BrowserEventSelectedStateToAnalyticsEventSelectedOption = {\n [SaveDesignCardStateEnum_1.default.sendByEmail]: 'email',\n [SaveDesignCardStateEnum_1.default.sendBySms]: 'sms',\n [SaveDesignCardStateEnum_1.default.getDesignCode]: 'code',\n [SaveDesignCardStateEnum_1.default.getLink]: 'link'\n};\n/**\n * Tracks events from Save Design Card and sends them to a reporter.\n *\n * @event save_design_select_option When a save option (item in action list) is clicked.\n * @event save_design_send_by_email When send button for sending email is clicked.\n * @event save_design_send_by_sms When send button for sending sms is clicked.\n * @event save_design_copy_code When copy code button is clicked.\n * @event save_design_copy_link When copy link button is clicked.\n * @event save_design_initial_configuration When the component is rendered the first time.\n */\nclass SaveDesignCardTracker extends analytics_1.AbstractAnalyticsTracker {\n /**\n * @param options\n * @param options.dev\n * @param options.settings\n * @param options.ab\n * @param options.locale\n * @param options.reporterId\n * @param options.context The context where the {@link SaveDesignCard} component is rendered, e.g. 'main_page', or 'summary_page'. This is used to distinguish the analytics data if the component is used in several places in a planner.\n */\n constructor(options) {\n super(Object.assign({ moduleId }, options));\n this.context = options.context;\n }\n /**\n * Call to report the initial config of SaveDesignCard.\n *\n * @param payload\n * @param payload.showEmailOption\n * @param payload.showSmsOption\n * @param payload.showCopyLinkOption\n * @param payload.showCopyCodeButton\n */\n sendInitialConfiguration(payload) {\n this.getReporter().report({\n event: 'save_design_initial_configuration',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.nonInteraction,\n payload\n });\n }\n /**\n * Call to report when a save option (item in action list) is clicked.\n *\n * @param selectedState The selected state in Save Design Card.\n */\n sendSelectOption(selectedState) {\n this.getReporter().report({\n event: 'save_design_select_option',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.giveMe,\n payload: {\n option: BrowserEventSelectedStateToAnalyticsEventSelectedOption[selectedState],\n context: this.context\n }\n });\n }\n /**\n * Call to report when send button for sending email is clicked.\n *\n * @param designId The design id (VPC code).\n */\n sendSendByEmail(designId) {\n this.getReporter().report({\n event: 'save_design_send_by_email',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.giveMe,\n payload: { designId, context: this.context }\n });\n }\n /**\n * Call to report when send button for sending sms is clicked.\n *\n * @param designId The design id (VPC code).\n */\n sendSendBySms(designId) {\n this.getReporter().report({\n event: 'save_design_send_by_sms',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.giveMe,\n payload: { designId, context: this.context }\n });\n }\n /**\n * Call to report when copy code button is clicked.\n *\n * @param designId The design id (VPC code).\n */\n sendCopyCode(designId) {\n this.getReporter().report({\n event: 'save_design_copy_code',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.giveMe,\n payload: { designId, context: this.context }\n });\n }\n /**\n * Call to report when copy link button is clicked.\n *\n * @param designId The design id (VPC code).\n */\n sendCopyLink(designId) {\n this.getReporter().report({\n event: 'save_design_copy_link',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.giveMe,\n payload: { designId, context: this.context }\n });\n }\n}\nexports.default = SaveDesignCardTracker;\n//# sourceMappingURL=SaveDesignCardTracker.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\n/**\n * A class with style.\n */\nclass SaveDesignCardStyle {\n /**\n * Returns styles.\n *\n * @param options The props.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { color, spacing, breakpoint } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t.title {\n\t\t\t\tdisplay: block;\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t\tmargin-bottom: ${spacing.space200 / 16}rem;\n\t\t\t}\n\n\t\t\t.default-description {\n\t\t\t\tdisplay: block;\n\t\t\t\tcolor: ${color.text.default};\n\t\t\t\tmargin-bottom: ${spacing.space200 / 16}rem;\n\t\t\t}\n\n\t\t\t.description {\n\t\t\t\tdisplay: block;\n\t\t\t\tcolor: ${color.text.default};\n\t\t\t\tmargin-bottom: ${spacing.space250 / 16}rem;\n\t\t\t}\n\n\t\t\t.designCodeText {\n\t\t\t\tmargin-bottom: ${spacing.space250 / 16}rem;\n\t\t\t}\n\n\t\t\t.designCodeText kompis-text {\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\n\t\t\tskapa-button {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\t.qr-code {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\tskapa-inline-message {\n\t\t\t\tmargin-top: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t@media screen and (min-width: ${breakpoint.large.width / 16}rem) {\n\t\t\t\t.qr-code {\n\t\t\t\t\tmargin: ${spacing.space400 / 16}rem 0;\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-direction: column;\n\t\t\t\t\tpadding: ${spacing.space125 / 16}rem;\n\t\t\t\t\tbackground-color: ${color.neutral.grey100};\n\t\t\t\t}\n\n\t\t\t\tkompis-qr-code {\n\t\t\t\t\twidth: ${132 / 16}rem;\n\t\t\t\t\tmargin: 0 auto;\n\t\t\t\t\tbackground-color: ${color.neutral.white};\n\t\t\t\t}\n\n\t\t\t\t.qr-code-text {\n\t\t\t\t\tmargin-top: ${spacing.space125 / 16}rem;\n\t\t\t\t\ttext-align: center;\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = SaveDesignCardStyle;\n//# sourceMappingURL=SaveDesignCardStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\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};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_action_list_1 = require(\"@inter-ikea-kompis/component-action-list\");\nconst component_send_by_email_1 = require(\"@inter-ikea-kompis/component-send-by-email\");\nconst component_send_by_sms_1 = require(\"@inter-ikea-kompis/component-send-by-sms\");\nconst insights_data_provider_1 = require(\"@insights/insights-data-provider\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@inter-ikea-kompis/component-action-list\");\nrequire(\"@inter-ikea-kompis/component-send-by-email\");\nrequire(\"@inter-ikea-kompis/component-send-by-sms\");\nrequire(\"@inter-ikea-kompis/component-qr-code\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/inline-message-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/icon-store/checkmark\");\nrequire(\"@ingka/icon-store/link\");\nrequire(\"@ingka/icon-store/copy\");\nrequire(\"@ingka/icon-store/warning-triangle\");\nconst SaveDesignCardCopyStateEnum_1 = __importDefault(require(\"../../enums/SaveDesignCardCopyStateEnum\"));\nconst SaveDesignCardStateEnum_1 = __importDefault(require(\"../../enums/SaveDesignCardStateEnum\"));\nconst SaveDesignCardTracker_1 = __importDefault(require(\"../../trackers/SaveDesignCardTracker\"));\nconst SaveDesignCardStyle_1 = __importDefault(require(\"./SaveDesignCardStyle\"));\n/**\n * Displays different options on how to save the solution.\n *\n * @event select Triggered when an item in the action list is clicked.\n * @event sendByEmailInput Triggered when the user writes in the sendByEmail view\n * @event sendByEmailValidation Triggered when the user tries to send with an invalid email\n * @event sendByEmailSend Triggered when the user clicks send\n * @event sendByEmailReset Triggered 3 seconds after SendByEmailState is set to success.\n * @event sendBySmsInput Triggered when the user writes in the sendBySms view\n * @event sendBySmsValidation Triggered when the user tries to send with an invalid number\n * @event sendBySmsSend Triggered when the user clicks send\n * @event sendBySmsReset Triggered 3 seconds after SendBySmsState is set to success.\n * @event copyDesignCodeClick Triggered when the user clicks the copy design code button.\n * @event copyDesignCodeReset Triggered 3 seconds after copyDesignCodeState is set to success.\n * @event copyDesignLinkClick Triggered when the user clicks the copy design link button.\n * @event copyDesignLinkReset Triggered 3 seconds after copyDesignLinkState is set to success.\n */\nlet SaveDesignCard = class SaveDesignCard extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // The url to the solution saved. If not set, \"Get link to design\" is not shown. When copied, query parameter with vpc source is added. Required for rendering optional QR code.\n this.designLink = null;\n // Set to true to show GetLink option in the default view. Requires the designLink to be set. Should be disabled in Kiosks.\n this.showGetLink = false;\n // If a QR code should be shown. Requires the designLink to be set. Won't show on tablet in portrait view or on mobile.\n this.showQrCode = false;\n // The current state of the component, e.g Save via SMS\n this.state = SaveDesignCardStateEnum_1.default.default;\n // Enable to allow autocompletion in the browser. Note that it should be disabled in Kiosks due to privacy policies, as it can otherwise store user data.\n this.autocomplete = false;\n // Disables outgoing links. Should be true in kiosks.\n this.disableLinks = false;\n // Set to true to show SendByEmail option in the default view\n this.showSendByEmail = false;\n // The current state of the SendByEmail view\n this.sendByEmailState = component_send_by_email_1.SendByEmailStateEnum.default;\n // The current value of the input in the SendByEmail view\n this.sendByEmailValue = '';\n // If the current value of the sendByEmail input field is valid or not\n this.sendByEmailInvalidInput = false;\n // Set to true to show SendBySms option in the default view\n this.showSendBySms = false;\n // The current state of the SendBySms view\n this.sendBySmsState = component_send_by_sms_1.SendBySmsStateEnum.default;\n // The current value of the input in the SendBySms view\n this.sendBySmsValue = '';\n // If the current value of the sendBySms input field is valid or not\n this.sendBySmsInvalidInput = false;\n // Shows the button in the copyDesignCode view. Should be false in kiosks.\n this.showCopyDesignCodeButton = false;\n // The current state for the copy design code button\n this.copyDesignCodeState = SaveDesignCardCopyStateEnum_1.default.default;\n // The current state for the copy design link button\n this.copyDesignLinkState = SaveDesignCardCopyStateEnum_1.default.default;\n // Used for automatic analytics. If null or not set, analytics is turned off.\n this.analytics = null;\n this.copyDesignCodeTimeout = null;\n this.copyDesignLinkTimeout = null;\n this.tracker = null;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getViewForState()}\n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n if (this.copyDesignCodeTimeout) {\n clearTimeout(this.copyDesignCodeTimeout);\n }\n if (this.copyDesignLinkTimeout) {\n clearTimeout(this.copyDesignLinkTimeout);\n }\n this.disconnectTracker();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('copyDesignCodeState')) {\n if (this.copyDesignCodeState === SaveDesignCardCopyStateEnum_1.default.success) {\n if (this.copyDesignCodeTimeout) {\n clearTimeout(this.copyDesignCodeTimeout);\n }\n this.copyDesignCodeTimeout = setTimeout(() => this.dispatchEvent(new CustomEvent('copyDesignCodeReset', { bubbles: true })), 3000);\n }\n }\n if (changedProperties.has('copyDesignLinkState')) {\n if (this.copyDesignLinkState === SaveDesignCardCopyStateEnum_1.default.success) {\n if (this.copyDesignLinkTimeout) {\n clearTimeout(this.copyDesignLinkTimeout);\n }\n this.copyDesignLinkTimeout = setTimeout(() => this.dispatchEvent(new CustomEvent('copyDesignLinkReset', { bubbles: true })), 3000);\n }\n }\n if (changedProperties.has('analytics')) {\n this.disconnectTracker();\n this.connectTracker().then(() => {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendInitialConfiguration({\n showEmailOption: this.showSendByEmailOption(),\n showSmsOption: this.showSendBySmsOption(),\n showCopyLinkOption: this.showGetLinkOption(),\n showCopyCodeButton: this.showCopyDesignCodeButton\n });\n });\n }\n return true;\n }\n connectTracker() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n if (this.analytics) {\n // eslint-disable-next-line no-underscore-dangle\n const reporter = this.analytics.__INTERNAL__reporter;\n if ((reporter === null || reporter === void 0 ? void 0 : reporter.connected) === false) {\n // Should use an existing reporter, but wait for it to be connected\n return;\n }\n // Use existing connected reporter, or the tracker should create a new one.\n const reporterId = reporter ? reporter.id : undefined;\n this.tracker = new SaveDesignCardTracker_1.default(Object.assign(Object.assign({}, this.analytics), { settings: utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation), locale: this.locale, reporterId }));\n yield ((_a = this.tracker) === null || _a === void 0 ? void 0 : _a.connect());\n }\n });\n }\n disconnectTracker() {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.disconnect();\n this.tracker = null;\n }\n /**\n * Returns the view for the component depending on state.\n */\n getViewForState() {\n switch (this.state) {\n case SaveDesignCardStateEnum_1.default.sendByEmail:\n return this.getSendByEmail();\n case SaveDesignCardStateEnum_1.default.sendBySms:\n return this.getSendBySms();\n case SaveDesignCardStateEnum_1.default.getDesignCode:\n return this.getDesignCode();\n case SaveDesignCardStateEnum_1.default.getLink:\n return this.getLinkToDesign();\n default:\n return this.getDefault();\n }\n }\n /**\n * @returns True if notifications are enabled in localizedInformation.\n */\n notificationsAreEnabled() {\n return (this.localizedInformation.localization.notificationDataSource !==\n enums_1.NotificationDataSourceEnum.disabled);\n }\n /**\n * @returns True if showSendByEmail is true and notifications are enabled in localizedInformation.\n */\n showSendByEmailOption() {\n return this.showSendByEmail && this.notificationsAreEnabled();\n }\n /**\n * @returns True if showSendBySms is true and notifications are enabled in localizedInformation.\n */\n showSendBySmsOption() {\n return this.showSendBySms && this.notificationsAreEnabled();\n }\n /**\n * @returns True if designLink is provided, showGetLink is true and disableLinks is false.\n */\n showGetLinkOption() {\n return !!this.designLink && this.showGetLink && !this.disableLinks;\n }\n onlyDesignCodeViewIsActivated() {\n return (!this.showSendByEmailOption() && !this.showSendBySmsOption() && !this.showGetLinkOption());\n }\n /**\n * Get default view.\n */\n getDefault() {\n if (this.onlyDesignCodeViewIsActivated()) {\n return (0, web_component_1.html) ` ${this.getTitle(SaveDesignCardStateEnum_1.default.default)} ${this.getDesignCodeBody()}\n\t\t\t${this.getQrCode()}`;\n }\n return (0, web_component_1.html) `
    \n\t\t\t${this.getTitle(SaveDesignCardStateEnum_1.default.default)} ${this.getDefaultDescription()}\n\t\t\t${this.getActionList()} ${this.getQrCode()}\n\t\t
    `;\n }\n /**\n * Get title for view.\n *\n * @param view\n */\n getTitle(view) {\n const titles = {\n [SaveDesignCardStateEnum_1.default.default]: this.localizedInformation.translations.saveDesignCardDefaultTitle,\n [SaveDesignCardStateEnum_1.default.sendByEmail]: this.localizedInformation.translations.saveDesignCardSendByEmailTitle,\n [SaveDesignCardStateEnum_1.default.sendBySms]: this.localizedInformation.translations.saveDesignCardSendBySmsTitle,\n [SaveDesignCardStateEnum_1.default.getDesignCode]: this.localizedInformation.translations.saveDesignCardGetDesignCodeTitle,\n [SaveDesignCardStateEnum_1.default.getLink]: this.localizedInformation.translations.saveDesignCardGetLinkTitle\n };\n return (0, web_component_1.html) ` ${titles[view]}\n\t\t
    `;\n }\n /**\n * Get Action List.\n */\n getActionList() {\n const sendByEmail = this.showSendByEmailOption()\n ? this.getActionListItem(SaveDesignCardStateEnum_1.default.sendByEmail)\n : '';\n const sendBySms = this.showSendBySmsOption()\n ? this.getActionListItem(SaveDesignCardStateEnum_1.default.sendBySms)\n : '';\n const getDesignCode = this.getActionListItem(SaveDesignCardStateEnum_1.default.getDesignCode);\n const getDesignLink = this.showGetLinkOption()\n ? this.getActionListItem(SaveDesignCardStateEnum_1.default.getLink)\n : '';\n return (0, web_component_1.html) ` \n\t\t\t${sendByEmail} ${sendBySms} ${getDesignCode} ${getDesignLink}\n\t\t`;\n }\n /**\n * Get Action List Item.\n *\n * @param state\n */\n getActionListItem(state) {\n const labels = {\n [SaveDesignCardStateEnum_1.default.sendByEmail]: this.localizedInformation.translations.saveDesignCardSendByEmailLabel,\n [SaveDesignCardStateEnum_1.default.sendBySms]: this.localizedInformation.translations.saveDesignCardSendBySmsLabel,\n [SaveDesignCardStateEnum_1.default.getDesignCode]: this.localizedInformation.translations.saveDesignCardGetDesignCodeLabel,\n [SaveDesignCardStateEnum_1.default.getLink]: this.localizedInformation.translations.saveDesignCardGetLinkLabel\n };\n return (0, web_component_1.html) `\n\t\t\t {\n var _a;\n this.dispatchEvent(new CustomEvent('select', { bubbles: true, detail: { selectedState: state } }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendSelectOption(state);\n }}\"\n\t\t\t>\n\t\t`;\n }\n /**\n * Get description for view.\n *\n * @param view\n */\n getDescription(view) {\n const descriptions = {\n [SaveDesignCardStateEnum_1.default.sendByEmail]: this.localizedInformation.translations.saveDesignCardSendByEmailDescription,\n [SaveDesignCardStateEnum_1.default.sendBySms]: this.localizedInformation.translations.saveDesignCardSendBySmsDescription,\n [SaveDesignCardStateEnum_1.default.getDesignCode]: this.localizedInformation.translations.saveDesignCardGetDesignCodeDescription,\n [SaveDesignCardStateEnum_1.default.getLink]: this.localizedInformation.translations.saveDesignCardGetLinkDescription\n };\n return (0, web_component_1.html) ` \n\t\t\t${(0, web_component_1.unsafeHTML)(descriptions[view].replace(/[\\n\\r]+/gm, '

    '))}\n\t\t`;\n }\n /**\n * Get default description.\n */\n getDefaultDescription() {\n const description = this.localizedInformation.translations.saveDesignCardDefaultDescription;\n return (0, web_component_1.html) ` \n\t\t\t${(0, web_component_1.unsafeHTML)(description.replace(/[\\n\\r]+/gm, '
    '))}\n\t\t`;\n }\n /**\n * Get Send By Email.\n */\n getSendByEmail() {\n return (0, web_component_1.html) `\n\t\t\t${this.getTitle(SaveDesignCardStateEnum_1.default.sendByEmail)}\n\t\t\t${this.getDescription(SaveDesignCardStateEnum_1.default.sendByEmail)}\n\t\t\t this.dispatchEvent(new CustomEvent('sendByEmailInput', { bubbles: true, detail }))}\"\n\t\t\t\t@validation=\"${({ detail }) => {\n const { inputElement } = detail, restOfDetail = __rest(detail, [\"inputElement\"]);\n this.dispatchEvent(new CustomEvent('sendByEmailValidation', { bubbles: true, detail: restOfDetail }));\n inputElement === null || inputElement === void 0 ? void 0 : inputElement.focus();\n }}\"\n\t\t\t\t@send=\"${({ detail }) => {\n var _a;\n this.dispatchEvent(new CustomEvent('sendByEmailSend', { bubbles: true, detail }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendSendByEmail(this.vpcCode);\n }}\"\n\t\t\t\t@reset=\"${({ detail }) => this.dispatchEvent(new CustomEvent('sendByEmailReset', { bubbles: true, detail }))}\"\n\t\t\t>\n\t\t\t\n\t\t`;\n }\n /**\n * Get Send By SMS.\n */\n getSendBySms() {\n return (0, web_component_1.html) `\n\t\t\t${this.getTitle(SaveDesignCardStateEnum_1.default.sendBySms)}\n\t\t\t${this.getDescription(SaveDesignCardStateEnum_1.default.sendBySms)}\n\t\t\t this.dispatchEvent(new CustomEvent('sendBySmsInput', { bubbles: true, detail }))}\"\n\t\t\t\t@validation=\"${({ detail }) => {\n const { inputElement } = detail, restOfDetail = __rest(detail, [\"inputElement\"]);\n this.dispatchEvent(new CustomEvent('sendBySmsValidation', { bubbles: true, detail: restOfDetail }));\n inputElement === null || inputElement === void 0 ? void 0 : inputElement.focus();\n }}\"\n\t\t\t\t@send=\"${({ detail }) => {\n var _a;\n this.dispatchEvent(new CustomEvent('sendBySmsSend', { bubbles: true, detail }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendSendBySms(this.vpcCode);\n }}\"\n\t\t\t\t@reset=\"${({ detail }) => this.dispatchEvent(new CustomEvent('sendBySmsReset', { bubbles: true, detail }))}\"\n\t\t\t>\n\t\t\t\n\t\t`;\n }\n /**\n * Click event for button for copy.\n */\n onCopyClick() {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n let thrownError = null;\n const linkToCopy = `${utilities_1.UrlUtility.addQueryParameter(this.designLink, 'vpcSource', insights_data_provider_1.DesignSourceEnum.clipboard)}`;\n const onVpcCodeView = this.state === SaveDesignCardStateEnum_1.default.getDesignCode || this.onlyDesignCodeViewIsActivated();\n const stringToCopy = onVpcCodeView ? this.vpcCode : linkToCopy;\n const eventName = onVpcCodeView ? 'copyDesignCodeClick' : 'copyDesignLinkClick';\n try {\n yield navigator.clipboard.writeText(stringToCopy);\n }\n catch (error) {\n thrownError = error;\n }\n this.dispatchEvent(new CustomEvent(eventName, {\n bubbles: true,\n detail: {\n state: !thrownError\n ? SaveDesignCardCopyStateEnum_1.default.success\n : SaveDesignCardCopyStateEnum_1.default.failed,\n error: thrownError === null || thrownError === void 0 ? void 0 : thrownError.message\n }\n }));\n if (onVpcCodeView) {\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendCopyCode(this.vpcCode);\n }\n else {\n (_b = this.tracker) === null || _b === void 0 ? void 0 : _b.sendCopyLink(this.vpcCode);\n }\n if (thrownError) {\n throw thrownError;\n }\n });\n }\n /**\n * Get body of design code view.\n */\n getDesignCodeBody() {\n const primaryVariant = 'primary';\n const { saveDesignCardGetDesignCodeButtonSuccess, saveDesignCardGetDesignCodeButtonDefault, saveDesignCardGetDesignCodeDesignCode } = this.localizedInformation.translations;\n let buttonLabel;\n let buttonIcon;\n switch (this.copyDesignCodeState) {\n case SaveDesignCardCopyStateEnum_1.default.success:\n buttonLabel = saveDesignCardGetDesignCodeButtonSuccess;\n buttonIcon = 'checkmark';\n break;\n default:\n buttonLabel = saveDesignCardGetDesignCodeButtonDefault;\n buttonIcon = 'copy';\n break;\n }\n return (0, web_component_1.html) `\n\t\t\t${this.getDescription(SaveDesignCardStateEnum_1.default.getDesignCode)}\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\t${saveDesignCardGetDesignCodeDesignCode + ': '}\n\t\t\t\t\n\t\t\t\t${this.vpcCode}\n\t\t\t\t\n\t\t\t
    \n\t\t\t${this.showCopyDesignCodeButton\n ? (0, web_component_1.html) ` \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t${buttonLabel}\n\t\t\t\t\t\t\n\t\t\t\t\t\t${this.getCopyCodeFailedError()}`\n : null}\n\t\t`;\n }\n /**\n * Get Design Code view.\n */\n getDesignCode() {\n return (0, web_component_1.html) `\n\t\t\t${this.getTitle(SaveDesignCardStateEnum_1.default.getDesignCode)} ${this.getDesignCodeBody()}\n\t\t`;\n }\n getCopyFailedError() {\n const cautionaryVariant = 'cautionary';\n return (0, web_component_1.html) `
    \n\t\t\t\n\t\t\t\t\n\t\t\t\t${this.localizedInformation.translations.ikeaGenericErrorTryAgain}\n\t\t\t\n\t\t
    `;\n }\n getCopyCodeFailedError() {\n if (this.copyDesignCodeState !== SaveDesignCardCopyStateEnum_1.default.failed) {\n return null;\n }\n return this.getCopyFailedError();\n }\n getCopyLinkFailedError() {\n if (this.copyDesignLinkState !== SaveDesignCardCopyStateEnum_1.default.failed) {\n return null;\n }\n return this.getCopyFailedError();\n }\n /**\n * Get Link To Design view.\n */\n getLinkToDesign() {\n const primaryVariant = 'primary';\n const { saveDesignCardGetLinkButtonSuccess, saveDesignCardGetLinkButtonDefault } = this.localizedInformation.translations;\n let buttonLabel;\n let buttonIcon;\n switch (this.copyDesignLinkState) {\n case SaveDesignCardCopyStateEnum_1.default.success:\n buttonLabel = saveDesignCardGetLinkButtonSuccess;\n buttonIcon = 'checkmark';\n break;\n default:\n buttonLabel = saveDesignCardGetLinkButtonDefault;\n buttonIcon = 'link';\n break;\n }\n return (0, web_component_1.html) `${this.getTitle(SaveDesignCardStateEnum_1.default.getLink)}\n\t\t\t${this.getDescription(SaveDesignCardStateEnum_1.default.getLink)}\n\t\t\t\n\t\t\t\t\n\t\t\t\t${buttonLabel}\n\t\t\t\n\t\t\t${this.getCopyLinkFailedError()}`;\n }\n /**\n * Get QR Code.\n *\n * @returns The QR code.\n */\n getQrCode() {\n if (!this.showQrCode || !this.designLink) {\n return null;\n }\n return (0, web_component_1.html) `
    \n\t\t\t\n\t\t\t\n\t\t\t\t${this.localizedInformation.translations.summaryPageQrCodeText}\n\t\t\t\n\t\t
    `;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SaveDesignCard.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SaveDesignCard.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, required: true })\n], SaveDesignCard.prototype, \"locale\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, required: true })\n], SaveDesignCard.prototype, \"vpcCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SaveDesignCard.prototype, \"designLink\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SaveDesignCard.prototype, \"showGetLink\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SaveDesignCard.prototype, \"showQrCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SaveDesignCard.prototype, \"state\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SaveDesignCard.prototype, \"autocomplete\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SaveDesignCard.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SaveDesignCard.prototype, \"showSendByEmail\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SaveDesignCard.prototype, \"sendByEmailState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SaveDesignCard.prototype, \"sendByEmailValue\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SaveDesignCard.prototype, \"sendByEmailInvalidInput\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SaveDesignCard.prototype, \"showSendBySms\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SaveDesignCard.prototype, \"sendBySmsState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SaveDesignCard.prototype, \"sendBySmsValue\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SaveDesignCard.prototype, \"sendBySmsInvalidInput\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SaveDesignCard.prototype, \"showCopyDesignCodeButton\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SaveDesignCard.prototype, \"copyDesignCodeState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SaveDesignCard.prototype, \"copyDesignLinkState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SaveDesignCard.prototype, \"analytics\", void 0);\nSaveDesignCard = __decorate([\n (0, web_component_1.customElement)('kompis-save-design-card')\n], SaveDesignCard);\nexports.default = SaveDesignCard;\n//# sourceMappingURL=SaveDesignCard.js.map","import \"@inter-ikea-kompis/component-save-design-card/lib/components/save-design-card/SaveDesignCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSaveDesignCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-save-design-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.analytics = props.analytics;\n element.autocomplete = props.autocomplete;\n element.copyDesignCodeState = props.copyDesignCodeState;\n element.copyDesignLinkState = props.copyDesignLinkState;\n element.designLink = props.designLink;\n element.disableLinks = props.disableLinks;\n element.locale = props.locale;\n element.localizedInformation = props.localizedInformation;\n element.sendByEmailInvalidInput = props.sendByEmailInvalidInput;\n element.sendByEmailState = props.sendByEmailState;\n element.sendByEmailValue = props.sendByEmailValue;\n element.sendBySmsInvalidInput = props.sendBySmsInvalidInput;\n element.sendBySmsState = props.sendBySmsState;\n element.sendBySmsValue = props.sendBySmsValue;\n element.showCopyDesignCodeButton = props.showCopyDesignCodeButton;\n element.showGetLink = props.showGetLink;\n element.showQrCode = props.showQrCode;\n element.showSendByEmail = props.showSendByEmail;\n element.showSendBySms = props.showSendBySms;\n element.state = props.state;\n element.theme = props.theme;\n element.vpcCode = props.vpcCode;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onCopyDesignCodeClick, \"copyDesignCodeClick\");\n this.updateEventListener(element, props.onCopyDesignCodeReset, \"copyDesignCodeReset\");\n this.updateEventListener(element, props.onCopyDesignLinkClick, \"copyDesignLinkClick\");\n this.updateEventListener(element, props.onCopyDesignLinkReset, \"copyDesignLinkReset\");\n this.updateEventListener(element, props.onSelect, \"select\");\n this.updateEventListener(element, props.onSendByEmailInput, \"sendByEmailInput\");\n this.updateEventListener(element, props.onSendByEmailReset, \"sendByEmailReset\");\n this.updateEventListener(element, props.onSendByEmailSend, \"sendByEmailSend\");\n this.updateEventListener(element, props.onSendByEmailValidation, \"sendByEmailValidation\");\n this.updateEventListener(element, props.onSendBySmsInput, \"sendBySmsInput\");\n this.updateEventListener(element, props.onSendBySmsReset, \"sendBySmsReset\");\n this.updateEventListener(element, props.onSendBySmsSend, \"sendBySmsSend\");\n this.updateEventListener(element, props.onSendBySmsValidation, \"sendBySmsValidation\");\n }\n}\nKompisSaveDesignCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n analytics: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n autocomplete: PropTypes.bool,\n copyDesignCodeState: PropTypes.string,\n copyDesignLinkState: PropTypes.string,\n designLink: PropTypes.string,\n disableLinks: PropTypes.bool,\n locale: PropTypes.string.isRequired,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n sendByEmailInvalidInput: PropTypes.bool,\n sendByEmailState: PropTypes.string,\n sendByEmailValue: PropTypes.string,\n sendBySmsInvalidInput: PropTypes.bool,\n sendBySmsState: PropTypes.string,\n sendBySmsValue: PropTypes.string,\n showCopyDesignCodeButton: PropTypes.bool,\n showGetLink: PropTypes.bool,\n showQrCode: PropTypes.bool,\n showSendByEmail: PropTypes.bool,\n showSendBySms: PropTypes.bool,\n state: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n vpcCode: PropTypes.string.isRequired,\n onSelect: PropTypes.func,\n onSendByEmailInput: PropTypes.func,\n onSendByEmailValidation: PropTypes.func,\n onSendByEmailSend: PropTypes.func,\n onSendByEmailReset: PropTypes.func,\n onSendBySmsInput: PropTypes.func,\n onSendBySmsValidation: PropTypes.func,\n onSendBySmsSend: PropTypes.func,\n onSendBySmsReset: PropTypes.func,\n onCopyDesignCodeClick: PropTypes.func,\n onCopyDesignCodeReset: PropTypes.func,\n onCopyDesignLinkClick: PropTypes.func,\n onCopyDesignLinkReset: PropTypes.func\n};\nexport default KompisSaveDesignCard;\n","import \"@inter-ikea-kompis/component-save-design-to-profile/lib/components/save-design-to-profile-card/SaveDesignToProfileCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSaveDesignToProfileCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-save-design-to-profile-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.localizedInformation = props.localizedInformation;\n element.loggedIn = props.loggedIn;\n element.productDescription = props.productDescription;\n element.productName = props.productName;\n element.screenshotAlt = props.screenshotAlt;\n element.screenshotUrl = props.screenshotUrl;\n element.theme = props.theme;\n element.translations = props.translations;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisSaveDesignToProfileCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n loggedIn: PropTypes.bool,\n productDescription: PropTypes.string,\n productName: PropTypes.string,\n screenshotAlt: PropTypes.string,\n screenshotUrl: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object])\n};\nexport default KompisSaveDesignToProfileCard;\n","import \"@inter-ikea-kompis/component-save-design-to-profile/lib/components/save-design-to-profile/SaveDesignToProfile\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSaveDesignToProfile extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-save-design-to-profile\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.localizedInformation = props.localizedInformation;\n element.loggedIn = props.loggedIn;\n element.productDescription = props.productDescription;\n element.productName = props.productName;\n element.saveDesignState = props.saveDesignState;\n element.screenshotAlt = props.screenshotAlt;\n element.screenshotUrl = props.screenshotUrl;\n element.sheetAlignment = props.sheetAlignment;\n element.showBackButton = props.showBackButton;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onBackButtonClick, \"backButtonClick\");\n this.updateEventListener(element, props.onLogIn, \"logIn\");\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onSaveDesign, \"saveDesign\");\n }\n}\nKompisSaveDesignToProfile.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n loggedIn: PropTypes.bool,\n productDescription: PropTypes.string,\n productName: PropTypes.string,\n saveDesignState: PropTypes.string,\n screenshotAlt: PropTypes.string,\n screenshotUrl: PropTypes.string,\n sheetAlignment: PropTypes.string,\n showBackButton: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n onModalClose: PropTypes.func,\n onLogIn: PropTypes.func,\n onSaveDesign: PropTypes.func,\n onBackButtonClick: PropTypes.func\n};\nexport default KompisSaveDesignToProfile;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ScreensaverFrameVideoObjectFitEnum;\n(function (ScreensaverFrameVideoObjectFitEnum) {\n ScreensaverFrameVideoObjectFitEnum[\"fill\"] = \"fill\";\n ScreensaverFrameVideoObjectFitEnum[\"contain\"] = \"contain\";\n ScreensaverFrameVideoObjectFitEnum[\"cover\"] = \"cover\";\n ScreensaverFrameVideoObjectFitEnum[\"none\"] = \"none\";\n ScreensaverFrameVideoObjectFitEnum[\"scaleDown\"] = \"scale-down\";\n})(ScreensaverFrameVideoObjectFitEnum || (ScreensaverFrameVideoObjectFitEnum = {}));\nexports.default = ScreensaverFrameVideoObjectFitEnum;\n//# sourceMappingURL=ScreensaverFrameVideoObjectFitEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass ScreensaverFrameStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @returns Styles.\n */\n static getStyle(options) {\n const { color, spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tposition: fixed;\n\t\t\t\tleft: 0;\n\t\t\t\tright: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\ttop: 0;\n\t\t\t\tz-index: ${options.zIndex};\n\t\t\t}\n\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t\theight: 100%;\n\t\t\t\tbackground-color: ${color.neutral.white};\n\t\t\t}\n\n\t\t\t.title {\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\n\t\t\t.leftContent {\n\t\t\t\tflex: 50%;\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\tjustify-content: space-between;\n\t\t\t\talign-items: flex-start;\n\t\t\t\tpadding: ${spacing.space550 / 16}rem;\n\t\t\t}\n\n\t\t\t.rightContent {\n\t\t\t\tflex: 50%;\n\t\t\t}\n\n\t\t\tvideo {\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tobject-fit: ${options.videoObjectFit};\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = ScreensaverFrameStyle;\n//# sourceMappingURL=ScreensaverFrameStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@ingka/button-webc\");\nconst ScreensaverFrameVideoObjectFitEnum_1 = __importDefault(require(\"../../enums/ScreensaverFrameVideoObjectFitEnum\"));\nconst ScreensaverFrameStyle_1 = __importDefault(require(\"./ScreensaverFrameStyle\"));\n/**\n * Screensaver if user leave the screen idle for some time.\n *\n * @event close Triggered by user.\n */\nlet ScreensaverFrame = class ScreensaverFrame extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Show or hide screensaver.\n this.visible = false;\n // Title\n this.title = '';\n // Source for the custom video.\n this.videoSrc = null;\n // Override z-index of the screensaver.\n this.zIndex = 500;\n // Start button label.\n this.startButtonLabel = null;\n // Value for object-fit CSS property on video element. Sets how the content should be resized to fit its container.\n this.videoObjectFit = ScreensaverFrameVideoObjectFitEnum_1.default.contain;\n }\n /**\n * @override\n */\n render() {\n if (!this.visible) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getContainer()}\n\t\t`;\n }\n /**\n * Get title.\n *\n * @returns The title.\n */\n getTitle() {\n return (0, web_component_1.html) `${this.title}`;\n }\n /**\n * Get button.\n *\n * @returns The start button.\n */\n getButton() {\n const primaryVariant = 'primary';\n return (0, web_component_1.html) ` \n\t\t\t${this.startButtonLabel}\n\t\t`;\n }\n /**\n * Get video if provided.\n *\n * @returns The custom video.\n */\n getVideo() {\n if (!this.videoSrc) {\n return null;\n }\n return (0, web_component_1.html) ` `;\n }\n /**\n * HTML event handler.\n */\n onClick() {\n this.dispatchEvent(new CustomEvent('close', { bubbles: true }));\n }\n /**\n * @returns - Html.\n */\n getContainer() {\n return (0, web_component_1.html) `\n\t\t\t
    this.onClick()}\" @keydown=\"${() => this.onClick()}\" class=\"container\">\n\t\t\t\t
    ${this.getTitle()} ${this.getButton()}
    \n\t\t\t\t
    ${this.getVideo()}
    \n\t\t\t
    \n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], ScreensaverFrame.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], ScreensaverFrame.prototype, \"visible\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ScreensaverFrame.prototype, \"title\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ScreensaverFrame.prototype, \"videoSrc\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], ScreensaverFrame.prototype, \"zIndex\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ScreensaverFrame.prototype, \"startButtonLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], ScreensaverFrame.prototype, \"videoObjectFit\", void 0);\nScreensaverFrame = __decorate([\n (0, web_component_1.customElement)('kompis-screensaver-frame')\n], ScreensaverFrame);\nexports.default = ScreensaverFrame;\n//# sourceMappingURL=ScreensaverFrame.js.map","import \"@inter-ikea-kompis/component-screensaver-frame/lib/components/screensaver-frame/ScreensaverFrame\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisScreensaverFrame extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-screensaver-frame\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.startButtonLabel = props.startButtonLabel;\n element.theme = props.theme;\n element.title = props.title;\n element.videoObjectFit = props.videoObjectFit;\n element.videoSrc = props.videoSrc;\n element.visible = props.visible;\n element.zIndex = props.zIndex;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onClose, \"close\");\n }\n}\nKompisScreensaverFrame.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n startButtonLabel: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n title: PropTypes.string,\n videoObjectFit: PropTypes.string,\n videoSrc: PropTypes.string,\n visible: PropTypes.bool,\n zIndex: PropTypes.number,\n onClose: PropTypes.func\n};\nexport default KompisScreensaverFrame;\n","import \"@inter-ikea-kompis/component-send-by-email/lib/components/send-by-email/SendByEmail\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSendByEmail extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-send-by-email\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.autocomplete = props.autocomplete;\n element.disableLinks = props.disableLinks;\n element.invalidInput = props.invalidInput;\n element.localizedInformation = props.localizedInformation;\n element.settings = props.settings;\n element.state = props.state;\n element.theme = props.theme;\n element.translations = props.translations;\n element.value = props.value;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onInput, \"input\");\n this.updateEventListener(element, props.onReset, \"reset\");\n this.updateEventListener(element, props.onSend, \"send\");\n this.updateEventListener(element, props.onValidation, \"validation\");\n }\n}\nKompisSendByEmail.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n autocomplete: PropTypes.bool,\n disableLinks: PropTypes.bool,\n invalidInput: PropTypes.bool,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n state: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n value: PropTypes.string,\n onInput: PropTypes.func,\n onValidation: PropTypes.func,\n onSend: PropTypes.func,\n onReset: PropTypes.func\n};\nexport default KompisSendByEmail;\n","import \"@inter-ikea-kompis/component-send-by-sms/lib/components/send-by-sms/SendBySms\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSendBySms extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-send-by-sms\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.autocomplete = props.autocomplete;\n element.disableLinks = props.disableLinks;\n element.invalidInput = props.invalidInput;\n element.locale = props.locale;\n element.localizedInformation = props.localizedInformation;\n element.settings = props.settings;\n element.state = props.state;\n element.theme = props.theme;\n element.translations = props.translations;\n element.value = props.value;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onInput, \"input\");\n this.updateEventListener(element, props.onReset, \"reset\");\n this.updateEventListener(element, props.onSend, \"send\");\n this.updateEventListener(element, props.onState, \"state\");\n this.updateEventListener(element, props.onValidation, \"validation\");\n }\n}\nKompisSendBySms.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n autocomplete: PropTypes.bool,\n disableLinks: PropTypes.bool,\n invalidInput: PropTypes.bool,\n locale: PropTypes.string.isRequired,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n state: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n value: PropTypes.string,\n onInput: PropTypes.func,\n onState: PropTypes.func,\n onValidation: PropTypes.func,\n onSend: PropTypes.func,\n onReset: PropTypes.func\n};\nexport default KompisSendBySms;\n","import \"@inter-ikea-kompis/component-share-design-card/lib/components/share-design-card/ShareDesignCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisShareDesignCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-share-design-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.analytics = props.analytics;\n element.autocomplete = props.autocomplete;\n element.copyDesignCodeState = props.copyDesignCodeState;\n element.copyDesignLinkState = props.copyDesignLinkState;\n element.designLink = props.designLink;\n element.disableLinks = props.disableLinks;\n element.locale = props.locale;\n element.localizedInformation = props.localizedInformation;\n element.productDescription = props.productDescription;\n element.productName = props.productName;\n element.screenshotAlt = props.screenshotAlt;\n element.screenshotUrl = props.screenshotUrl;\n element.sendByEmailInvalidInput = props.sendByEmailInvalidInput;\n element.sendByEmailState = props.sendByEmailState;\n element.sendByEmailValue = props.sendByEmailValue;\n element.sendBySmsInvalidInput = props.sendBySmsInvalidInput;\n element.sendBySmsState = props.sendBySmsState;\n element.sendBySmsValue = props.sendBySmsValue;\n element.settings = props.settings;\n element.showCopyDesignCodeButton = props.showCopyDesignCodeButton;\n element.showGetLink = props.showGetLink;\n element.showQrCode = props.showQrCode;\n element.showSendByEmail = props.showSendByEmail;\n element.showSendBySms = props.showSendBySms;\n element.state = props.state;\n element.theme = props.theme;\n element.translations = props.translations;\n element.vpcCode = props.vpcCode;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onCopyDesignCodeClick, \"copyDesignCodeClick\");\n this.updateEventListener(element, props.onCopyDesignCodeReset, \"copyDesignCodeReset\");\n this.updateEventListener(element, props.onCopyDesignLinkClick, \"copyDesignLinkClick\");\n this.updateEventListener(element, props.onCopyDesignLinkReset, \"copyDesignLinkReset\");\n this.updateEventListener(element, props.onSelect, \"select\");\n this.updateEventListener(element, props.onSendByEmailInput, \"sendByEmailInput\");\n this.updateEventListener(element, props.onSendByEmailReset, \"sendByEmailReset\");\n this.updateEventListener(element, props.onSendByEmailSend, \"sendByEmailSend\");\n this.updateEventListener(element, props.onSendByEmailValidation, \"sendByEmailValidation\");\n this.updateEventListener(element, props.onSendBySmsInput, \"sendBySmsInput\");\n this.updateEventListener(element, props.onSendBySmsReset, \"sendBySmsReset\");\n this.updateEventListener(element, props.onSendBySmsSend, \"sendBySmsSend\");\n this.updateEventListener(element, props.onSendBySmsValidation, \"sendBySmsValidation\");\n }\n}\nKompisShareDesignCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n analytics: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n autocomplete: PropTypes.bool,\n copyDesignCodeState: PropTypes.string,\n copyDesignLinkState: PropTypes.string,\n designLink: PropTypes.string,\n disableLinks: PropTypes.bool,\n locale: PropTypes.string.isRequired,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n productDescription: PropTypes.string,\n productName: PropTypes.string,\n screenshotAlt: PropTypes.string,\n screenshotUrl: PropTypes.string,\n sendByEmailInvalidInput: PropTypes.bool,\n sendByEmailState: PropTypes.string,\n sendByEmailValue: PropTypes.string,\n sendBySmsInvalidInput: PropTypes.bool,\n sendBySmsState: PropTypes.string,\n sendBySmsValue: PropTypes.string,\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n showCopyDesignCodeButton: PropTypes.bool,\n showGetLink: PropTypes.bool,\n showQrCode: PropTypes.bool,\n showSendByEmail: PropTypes.bool,\n showSendBySms: PropTypes.bool,\n state: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n vpcCode: PropTypes.string.isRequired,\n onCopyDesignCodeClick: PropTypes.func,\n onCopyDesignCodeReset: PropTypes.func,\n onCopyDesignLinkClick: PropTypes.func,\n onCopyDesignLinkReset: PropTypes.func,\n onSelect: PropTypes.func,\n onSendByEmailInput: PropTypes.func,\n onSendByEmailReset: PropTypes.func,\n onSendByEmailSend: PropTypes.func,\n onSendByEmailValidation: PropTypes.func,\n onSendBySmsInput: PropTypes.func,\n onSendBySmsReset: PropTypes.func,\n onSendBySmsSend: PropTypes.func,\n onSendBySmsValidation: PropTypes.func\n};\nexport default KompisShareDesignCard;\n","import \"@inter-ikea-kompis/component-sheet/lib/components/sheet-backdrop/SheetBackdrop\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSheetBackdrop extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-sheet-backdrop\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.theme = props.theme;\n element.visible = props.visible;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisSheetBackdrop.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n visible: PropTypes.bool\n};\nexport default KompisSheetBackdrop;\n","import \"@inter-ikea-kompis/component-sheet/lib/components/sheet-body-padding/SheetBodyPadding\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSheetBodyPadding extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-sheet-body-padding\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.bottomPadding = props.bottomPadding;\n element.theme = props.theme;\n element.topPadding = props.topPadding;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisSheetBodyPadding.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n bottomPadding: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n topPadding: PropTypes.bool\n};\nexport default KompisSheetBodyPadding;\n","import \"@inter-ikea-kompis/component-sheet/lib/components/sheet-body/SheetBody\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSheetBody extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-sheet-body\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.scrollDivider = props.scrollDivider;\n element.theme = props.theme;\n element.verticalScroll = props.verticalScroll;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisSheetBody.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n scrollDivider: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n verticalScroll: PropTypes.bool\n};\nexport default KompisSheetBody;\n","import \"@inter-ikea-kompis/component-sheet/lib/components/sheet-footer-buttons/SheetFooterButtons\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSheetFooterButtons extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-sheet-footer-buttons\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.compact = props.compact;\n element.primaryLabel = props.primaryLabel;\n element.secondaryLabel = props.secondaryLabel;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onButtonClick, \"buttonClick\");\n }\n}\nKompisSheetFooterButtons.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n compact: PropTypes.bool,\n primaryLabel: PropTypes.string,\n secondaryLabel: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n onButtonClick: PropTypes.func\n};\nexport default KompisSheetFooterButtons;\n","import \"@inter-ikea-kompis/component-sheet/lib/components/sheet-footer/SheetFooter\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSheetFooter extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-sheet-footer\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisSheetFooter.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisSheetFooter;\n","import \"@inter-ikea-kompis/component-sheet/lib/components/sheet-header/SheetHeader\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSheetHeader extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-sheet-header\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.ariaLabelBackButton = props.ariaLabelBackButton;\n element.ariaLabelCloseButton = props.ariaLabelCloseButton;\n element.backIcon = props.backIcon;\n element.floatingHeader = props.floatingHeader;\n element.heading = props.heading;\n element.theme = props.theme;\n element.zIndex = props.zIndex;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onBackButtonClick, \"backButtonClick\");\n this.updateEventListener(element, props.onCloseButtonClick, \"closeButtonClick\");\n }\n}\nKompisSheetHeader.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n ariaLabelBackButton: PropTypes.string,\n ariaLabelCloseButton: PropTypes.string,\n backIcon: PropTypes.bool,\n floatingHeader: PropTypes.bool,\n heading: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n zIndex: PropTypes.number,\n onCloseButtonClick: PropTypes.func,\n onBackButtonClick: PropTypes.func\n};\nexport default KompisSheetHeader;\n","import \"@inter-ikea-kompis/component-sheet/lib/components/sheet/Sheet\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSheet extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-sheet\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.ariaLabel = props.ariaLabel;\n element.preserveAlignment = props.preserveAlignment;\n element.sheetAlignment = props.sheetAlignment;\n element.sheetSize = props.sheetSize;\n element.theme = props.theme;\n element.visible = props.visible;\n element.zIndex = props.zIndex;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onAnimationEnd, \"animationEnd\");\n this.updateEventListener(element, props.onOverlayClick, \"overlayClick\");\n }\n}\nKompisSheet.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n ariaLabel: PropTypes.string,\n preserveAlignment: PropTypes.bool,\n sheetAlignment: PropTypes.string,\n sheetSize: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n visible: PropTypes.bool,\n zIndex: PropTypes.number,\n onOverlayClick: PropTypes.func,\n onAnimationEnd: PropTypes.func\n};\nexport default KompisSheet;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst SLIDER_HEIGHT = 48;\n/**\n * A class with style.\n */\nclass SliderStyle {\n /**\n * Returns style.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @param options.thumbSize Thumb size in px.\n * @param options.hasValue If slider has value label.\n * @param options.isActive If the thumb is focused.\n * @param options.disabled Disabled state.\n * @param options.showValue Should show value above the slider.\n */\n static getStyle(options) {\n const { color, spacing, border } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\t.container {\n\t\t\t\tcolor: ${color.disabled.default};\n\t\t\t\tposition: relative;\n\t\t\t}\n\t\t\t.value {\n\t\t\t\tvisibility: ${!options.showValue ? 'hidden' : options.disabled ? 'hidden' : 'visible'};\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: 0;\n\t\t\t\tpadding: ${spacing.space25 / 16}rem ${spacing.space50 / 16}rem;\n\t\t\t\tbackground-color: ${color.background.inverse};\n\t\t\t\tcolor: ${color.text.inverse};\n\t\t\t\tborder-radius: ${border.radius.radius4 / 16}rem;\n\t\t\t\twhite-space: nowrap;\n\t\t\t}\n\t\t\t.sliderContainer {\n\t\t\t\tposition: relative;\n\t\t\t\theight: ${SLIDER_HEIGHT / 16}rem;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t}\n\t\t\t.limitContainer {\n\t\t\t\tdisplay: flex;\n\t\t\t\tcolor: ${color.text.lightest};\n\t\t\t\tmargin-top: ${!options.showValue ? -spacing.space50 / 16 : spacing.space100 / 16}rem;\n\t\t\t\tjustify-content: space-between;\n\t\t\t}\n\t\t\t.sliderBackground {\n\t\t\t\t${this.getSliderMargin(options)}\n\t\t\t\tposition: absolute;\n\t\t\t\theight: ${4 / 16}rem;\n\t\t\t\tleft: 0;\n\t\t\t\tright: 0;\n\t\t\t\tborder-radius: ${border.radius.radius8 / 16}rem;\n\t\t\t}\n\t\t\t.slider {\n\t\t\t\tmargin: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\tz-index: 1;\n\t\t\t\tpadding: ${SLIDER_HEIGHT / 2 / 16}rem 0;\n\t\t\t\tbackground: transparent;\n\t\t\t\tcursor: ${options.disabled ? 'default' : 'pointer'};\n\t\t\t\t-moz-appearance: none;\n\t\t\t\t-webkit-appearance: none;\n\t\t\t\tappearance: none;\n\t\t\t\theight: ${spacing.space25 / 16}rem;\n\t\t\t\t${this.getSliderMargin(options)};\n\t\t\t\toutline: none;\n\t\t\t}\n\n\t\t\t.slider:focus-visible::-webkit-slider-thumb {\n\t\t\t\tbox-shadow: 0 0 0 ${4 / 16}rem ${color.neutral.white},\n\t\t\t\t\t0 0 0 ${6 / 16}rem ${color.neutral.grey900};\n\t\t\t}\n\n\t\t\t.slider:focus-visible::-moz-range-thumb {\n\t\t\t\tbox-shadow: 0 0 0 ${4 / 16}rem ${color.neutral.white},\n\t\t\t\t\t0 0 0 ${6 / 16}rem ${color.neutral.grey900};\n\t\t\t}\n\n\t\t\t.slider::-webkit-slider-thumb {\n\t\t\t\t-webkit-appearance: none;\n\t\t\t\t${this.getThumbFocusStyle(options)}\n\t\t\t\t${this.getThumbStyle(options)}\n\t\t\t}\n\n\t\t\t.slider::-moz-range-thumb {\n\t\t\t\t-moz-appearance: none;\n\t\t\t\t${this.getThumbFocusStyle(options)}\n\t\t\t\t${this.getThumbStyle(options)}\n\t\t\t}\n\t\t\t${this.getActiveStyle(options)}\n\t\t`;\n }\n /**\n * Returns the outline focus style.\n *\n * @param options Options.\n */\n static getThumbFocusStyle(options) {\n const { motion } = options.theme;\n return (0, web_component_1.css) `\n\t\t\tbox-shadow: none;\n\t\t\ttransition-property: box-shadow;\n\t\t\ttransition-duration: ${motion.duration.small};\n\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t`;\n }\n /**\n * Returns the slider margin top.\n *\n * @param options Options.\n */\n static getSliderMargin(options) {\n const { spacing } = options.theme;\n if (!options.hasValue) {\n return (0, web_component_1.css) `\n\t\t\t\tmargin-top: 0;\n\t\t\t`;\n }\n return (0, web_component_1.css) `\n\t\t\tmargin-top: ${spacing.space300 / 16}rem;\n\t\t`;\n }\n /**\n * @param options\n */\n static getThumbStyle(options) {\n const { color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\tappearance: none;\n\t\t\tborder: none;\n\t\t\twidth: ${options.thumbSize / 16}rem;\n\t\t\theight: ${options.thumbSize / 16}rem;\n\t\t\tborder-radius: 50%;\n\t\t\tbackground: ${options.disabled ? color.neutral.grey500 : color.background.inverse};\n\t\t\t${this.getCursorGrabStyle(options)}\n\t\t`;\n }\n /**\n * Get the cursor grab style.\n *\n * @param options Options.\n */\n static getCursorGrabStyle(options) {\n return (0, web_component_1.css) `\n\t\t\tcursor: ${options.disabled ? 'default' : '-moz-grab'};\n\t\t\tcursor: ${options.disabled ? 'default' : '-webkit-grab'};\n\t\t\tcursor: ${options.disabled ? 'default' : 'grab'};\n\t\t`;\n }\n /**\n * Get the cursor grabbing style.\n *\n * @param options Options.\n */\n static getCursorGrabbingStyle(options) {\n return (0, web_component_1.css) `\n\t\t\tcursor: ${options.disabled ? 'default' : '-moz-grabbing'};\n\t\t\tcursor: ${options.disabled ? 'default' : '-webkit-grabbing'};\n\t\t\tcursor: ${options.disabled ? 'default' : 'grabbing'};\n\t\t`;\n }\n /**\n * @param options Options.\n */\n static getActiveStyle(options) {\n if (!options.isActive || options.disabled) {\n return '';\n }\n const { color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t.slider::-moz-range-thumb {\n\t\t\t\t${this.getCursorGrabbingStyle(options)}\n\t\t\t\tbox-shadow: 0 0 0 ${3 / 16}rem\n\t\t\t\t\t${utilities_1.ColorConverter.multiplyOpacity(color.border.dark, 0.1)};\n\t\t\t}\n\t\t\t.slider::-webkit-slider-thumb {\n\t\t\t\t${this.getCursorGrabbingStyle(options)}\n\t\t\t\tbox-shadow: 0 0 0 ${3 / 16}rem\n\t\t\t\t\t${utilities_1.ColorConverter.multiplyOpacity(color.border.dark, 0.1)};\n\t\t\t}\n\t\t\t.slider,\n\t\t\t.limitContainer,\n\t\t\t.sliderContainer,\n\t\t\t.sliderBackground,\n\t\t\t.value {\n\t\t\t\t${this.getCursorGrabbingStyle(options)}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = SliderStyle;\n//# sourceMappingURL=SliderStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nrequire(\"@inter-ikea-kompis/component-text\");\nconst SliderStyle_1 = __importDefault(require(\"./SliderStyle\"));\nconst THUMB_SIZE = 24;\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n *\n * @event change When setting the value.\n * @event focusOut When releasing the Slider\n *\n */\nlet Slider = class Slider extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Min value on slider.\n this.limitMin = 0;\n // LimitMax value on slider.\n this.limitMax = 100;\n // Show value above the slider.\n this.showValue = false;\n // Show limits beneath the slider.\n this.showLimits = false;\n // Disabled state.\n this.disabled = false;\n // Steps, 1 is default.\n this.step = 1;\n // Slider value prefix.\n this.valuePrefix = null;\n // Slider value suffix.\n this.valueSuffix = null;\n this.isActive = false;\n this.resizeObserver = new ResizeObserver(() => {\n this.requestUpdate();\n });\n this.thumbSize = 0;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n this.thumbSize = THUMB_SIZE;\n const value = this.values ? this.values[0] : 0;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t\t${this.getValueLabel()}\n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t${this.getLimits()}\n\t\t\t
    \n\t\t`;\n }\n /**\n * @override\n */\n update() {\n super.update();\n this.updateValuePosition();\n }\n /**\n * @override\n */\n disconnected() {\n this.resizeObserver.disconnect();\n }\n /**\n * @override\n */\n connected() {\n this.resizeObserver.observe(this);\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n var _a, _b;\n if (changedProperties.has('values')) {\n const input = (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.children[2]) === null || _b === void 0 ? void 0 : _b.children[0].children[0];\n if (input) {\n this.updateValuePosition();\n return false;\n }\n }\n return true;\n }\n /**\n *\n * @returns Limits.\n */\n getLimits() {\n if (!this.showLimits) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${this.valuePrefix || ''}${this.limitMin}${this.valueSuffix || ''}\n\t\t\t\t${this.valuePrefix || ''}${this.limitMax}${this.valueSuffix || ''}\n\t\t\t
    \n\t\t`;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n getValueLabel() {\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${this.getValueText()}\n\t\t\t
    \n\t\t`;\n }\n /**\n * @param event\n */\n onChange(event) {\n event.stopPropagation();\n const target = event.target;\n const value = target.value;\n target.value = String(this.values ? this.values[0] : 0);\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, detail: { values: [Number(value)] } }));\n }\n /**\n * Triggered on focus in.\n */\n onFocusIn() {\n if (this.isActive) {\n return;\n }\n this.isActive = true;\n this.requestUpdate();\n }\n /**\n * Triggered on focus out.\n *\n * @param event\n */\n onFocusOut(event) {\n if (!this.isActive) {\n return;\n }\n this.isActive = false;\n if (!this.disabled) {\n const target = event.target;\n const value = target.value;\n this.dispatchEvent(new CustomEvent('focusOut', { bubbles: true, detail: { values: [Number(value)] } }));\n }\n this.requestUpdate();\n }\n /**\n * Updates the values left position.\n */\n updateValuePosition() {\n var _a, _b, _c, _d, _e, _f;\n const input = (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.children[2]) === null || _b === void 0 ? void 0 : _b.children[0].children[0];\n const valueLabel = (_d = (_c = this.shadowRoot) === null || _c === void 0 ? void 0 : _c.children[2]) === null || _d === void 0 ? void 0 : _d.children[0].children[1];\n if (input) {\n const sliderBackground = (_f = (_e = this.shadowRoot) === null || _e === void 0 ? void 0 : _e.children[2]) === null || _f === void 0 ? void 0 : _f.children[0].children[2];\n const isRtl = window.getComputedStyle(this).direction === 'rtl';\n sliderBackground.style.background = this.getFilledBackground(isRtl);\n input.value = String(this.values ? this.values[0] : this.limitMin);\n if (valueLabel) {\n valueLabel.children[0].innerHTML = this.getValueText();\n const transformStyle = `translateX(${isRtl ? '50%' : '-50%'})`;\n const positionStyle = `${this.getValueLabelPosition() / 16}rem`;\n const leftStyle = isRtl ? 'auto' : positionStyle;\n const rightStyle = isRtl ? positionStyle : 'auto';\n if (valueLabel.style.transform !== transformStyle) {\n valueLabel.style.transform = transformStyle;\n }\n if (valueLabel.style.left !== leftStyle) {\n valueLabel.style.left = leftStyle;\n }\n if (valueLabel.style.right !== rightStyle) {\n valueLabel.style.right = rightStyle;\n }\n }\n }\n }\n /**\n * @returns Value width.\n */\n getValueWidth() {\n var _a, _b;\n const value = (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.children[2]) === null || _b === void 0 ? void 0 : _b.children[0].children[1];\n return !value ? 0 : value.offsetWidth;\n }\n /**\n * @param isRtl \"true\" if RTL.\n * @returns Background.\n */\n getFilledBackground(isRtl) {\n const position = this.getThumbPosition();\n if (this.disabled) {\n return `${this.theme.color.disabled.default}`;\n }\n return `linear-gradient(\n\t\t\tto ${isRtl ? 'left' : 'right'},\n\t\t\t${this.theme.color.background.inverse} 0%,\n\t\t\t${this.theme.color.background.inverse} ${position / 16}rem,\n\t\t\t${this.theme.color.neutral.grey200} ${position / 16}rem,\n\t\t\t${this.theme.color.neutral.grey200} 100%)`;\n }\n /**\n * @returns Value position in px.\n */\n getValueLabelPosition() {\n const valueWidth = this.getValueWidth();\n const position = this.getThumbPosition();\n const containerWidth = this.offsetWidth;\n if (position - valueWidth / 2 < 0) {\n return valueWidth / 2;\n }\n else if (position + valueWidth / 2 > containerWidth) {\n return containerWidth - valueWidth / 2;\n }\n return position;\n }\n /**\n * @returns Returns value text.\n */\n getValueText() {\n return `${this.valuePrefix || ''}${this.values ? this.values[0] : 0}${this.valueSuffix || ''}`;\n }\n /**\n * @returns Thumb position in px.\n */\n getThumbPosition() {\n var _a;\n if (!((_a = this.values) === null || _a === void 0 ? void 0 : _a.length)) {\n return this.thumbSize / 2;\n }\n return (((this.values[0] - this.limitMin) / (this.limitMax - this.limitMin)) *\n (this.offsetWidth - this.thumbSize) +\n this.thumbSize / 2);\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Slider.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], Slider.prototype, \"limitMin\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], Slider.prototype, \"limitMax\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Slider.prototype, \"showValue\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Slider.prototype, \"showLimits\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Slider.prototype, \"disabled\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], Slider.prototype, \"step\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Slider.prototype, \"valuePrefix\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Slider.prototype, \"valueSuffix\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, synchronous: true })\n], Slider.prototype, \"values\", void 0);\nSlider = __decorate([\n (0, web_component_1.customElement)('kompis-slider')\n], Slider);\nexports.default = Slider;\n//# sourceMappingURL=Slider.js.map","import \"@inter-ikea-kompis/component-slider/lib/components/slider/Slider\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSlider extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-slider\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.disabled = props.disabled;\n element.limitMax = props.limitMax;\n element.limitMin = props.limitMin;\n element.showLimits = props.showLimits;\n element.showValue = props.showValue;\n element.step = props.step;\n element.theme = props.theme;\n element.valuePrefix = props.valuePrefix;\n element.valueSuffix = props.valueSuffix;\n element.values = props.values;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onChange, \"change\");\n this.updateEventListener(element, props.onFocusOut, \"focusOut\");\n }\n}\nKompisSlider.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n disabled: PropTypes.bool,\n limitMax: PropTypes.number,\n limitMin: PropTypes.number,\n showLimits: PropTypes.bool,\n showValue: PropTypes.bool,\n step: PropTypes.number,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n valuePrefix: PropTypes.string,\n valueSuffix: PropTypes.string,\n values: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n onChange: PropTypes.func,\n onFocusOut: PropTypes.func\n};\nexport default KompisSlider;\n","import \"@inter-ikea-kompis/component-sort-list/lib/components/sort-list-card/SortListCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSortListCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-sort-list-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.localizedInformation = props.localizedInformation;\n element.selected = props.selected;\n element.theme = props.theme;\n element.translations = props.translations;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onChange, \"change\");\n }\n}\nKompisSortListCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n selected: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n onChange: PropTypes.func\n};\nexport default KompisSortListCard;\n","import \"@inter-ikea-kompis/component-sort-list/lib/components/sort-list/SortList\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSortList extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-sort-list\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.localizedInformation = props.localizedInformation;\n element.selected = props.selected;\n element.sheetAlignment = props.sheetAlignment;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onChange, \"change\");\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n }\n}\nKompisSortList.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n selected: PropTypes.string,\n sheetAlignment: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n onChange: PropTypes.func,\n onModalOpen: PropTypes.func,\n onModalClose: PropTypes.func\n};\nexport default KompisSortList;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar StatusIndicatorDotPositionEnum;\n(function (StatusIndicatorDotPositionEnum) {\n StatusIndicatorDotPositionEnum[\"leading\"] = \"leading\";\n StatusIndicatorDotPositionEnum[\"trailing\"] = \"trailing\";\n})(StatusIndicatorDotPositionEnum || (StatusIndicatorDotPositionEnum = {}));\nexports.default = StatusIndicatorDotPositionEnum;\n//# sourceMappingURL=StatusIndicatorDotPositionEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar StatusIndicatorFontSizeEnum;\n(function (StatusIndicatorFontSizeEnum) {\n StatusIndicatorFontSizeEnum[\"small\"] = \"small\";\n StatusIndicatorFontSizeEnum[\"medium\"] = \"medium\";\n})(StatusIndicatorFontSizeEnum || (StatusIndicatorFontSizeEnum = {}));\nexports.default = StatusIndicatorFontSizeEnum;\n//# sourceMappingURL=StatusIndicatorFontSizeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nexports.default = enums_1.StatusIndicatorColorEnum;\n//# sourceMappingURL=StatusIndicatorColorEnum.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst StatusIndicatorColorEnum_1 = __importDefault(require(\"../../enums/StatusIndicatorColorEnum\"));\nconst StatusIndicatorDotPositionEnum_1 = __importDefault(require(\"../../enums/StatusIndicatorDotPositionEnum\"));\nclass StatusIndicatorStyle {\n /**\n * Returns styles.\n *\n * @param options Options.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { theme, statusDotPosition, small } = options;\n const { color, spacing, border } = theme;\n const size = (small ? spacing.space50 : spacing.space75) / 16;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t}\n\t\t\t.container {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tflex-direction: ${statusDotPosition === StatusIndicatorDotPositionEnum_1.default.leading\n ? 'row'\n : 'row-reverse'};\n\t\t\t\tmin-height: ${22 / 16}rem;\n\t\t\t}\n\t\t\t.divider {\n\t\t\t\twidth: ${size}rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t}\n\t\t\t.dot {\n\t\t\t\twidth: ${size}rem;\n\t\t\t\theight: ${size}rem;\n\t\t\t\tborder-radius: ${border.radius.radius64 / 16}rem;\n\t\t\t\tprint-color-adjust: exact;\n\t\t\t\t-webkit-print-color-adjust: exact;\n\t\t\t\tbackground-color: ${this.getDotBackgroundColor(options)};\n\t\t\t\tborder-color: ${this.getStatusIndicatorColor(options)};\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tposition: relative;\n\t\t\t\tborder-style: solid;\n\t\t\t\tborder-width: ${2 / 16}rem;\n\t\t\t\tmargin-top: ${5 / 16}rem;\n\t\t\t}\n\t\t\tkompis-text {\n\t\t\t\tcolor: ${color.neutral.grey700};\n\t\t\t}\n\t\t\t${this.getDotFilledStyle(options)}\n\t\t`;\n }\n /**\n * Returns background color depending on size and color.\n *\n * @param options Options.\n * @returns Color.\n */\n static getDotBackgroundColor(options) {\n const { small, statusColor } = options;\n if (small) {\n return this.getStatusIndicatorColor(options);\n }\n if (statusColor === StatusIndicatorColorEnum_1.default.green) {\n return options.theme.color.semantic.positive;\n }\n return 'transparent';\n }\n /**\n * Returns the correct fill for the dot depending on color.\n *\n * @param options Options.\n * @returns Styles.\n */\n static getDotFilledStyle(options) {\n const { statusColor, theme } = options;\n switch (statusColor) {\n case StatusIndicatorColorEnum_1.default.orange:\n return (0, web_component_1.css) `\n\t\t\t\t\t.dotFill {\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\ttop: 50%;\n\t\t\t\t\t\tbottom: 0;\n\t\t\t\t\t\tleft: 0;\n\t\t\t\t\t\tright: 0;\n\t\t\t\t\t\tbackground-color: ${theme.color.semantic.caution};\n\t\t\t\t\t}\n\t\t\t\t`;\n case StatusIndicatorColorEnum_1.default.grey:\n return (0, web_component_1.css) `\n\t\t\t\t\t.dotFill {\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\ttop: 0;\n\t\t\t\t\t\tbottom: 0;\n\t\t\t\t\t\tleft: 50%;\n\t\t\t\t\t\tbox-shadow: 0 0 0 ${1 / 16}rem ${theme.color.neutral.grey500};\n\t\t\t\t\t\ttransform: rotate(-45deg);\n\t\t\t\t\t}\n\t\t\t\t`;\n default:\n return '';\n }\n }\n /**\n * Retrives Status Color.\n *\n * @param options\n * @returns Color string.\n */\n static getStatusIndicatorColor(options) {\n const { color } = options.theme;\n switch (options.statusColor) {\n case StatusIndicatorColorEnum_1.default.green:\n return color.semantic.positive;\n case StatusIndicatorColorEnum_1.default.orange:\n return color.semantic.caution;\n case StatusIndicatorColorEnum_1.default.grey:\n return color.neutral.grey500;\n case StatusIndicatorColorEnum_1.default.red:\n return color.semantic.negative;\n default:\n return '';\n }\n }\n}\nexports.default = StatusIndicatorStyle;\n//# sourceMappingURL=StatusIndicatorStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nrequire(\"@inter-ikea-kompis/component-icon\");\nrequire(\"@inter-ikea-kompis/component-text\");\nconst StatusIndicatorDotPositionEnum_1 = __importDefault(require(\"../../enums/StatusIndicatorDotPositionEnum\"));\nconst StatusIndicatorFontSizeEnum_1 = __importDefault(require(\"../../enums/StatusIndicatorFontSizeEnum\"));\nconst StatusIndicatorStyle_1 = __importDefault(require(\"./StatusIndicatorStyle\"));\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n */\nlet StatusIndicator = class StatusIndicator extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Status label text\n this.statusLabel = null;\n // Status indicator dot color\n this.statusColor = null;\n // Where the indicator should be.\n this.statusDotPosition = StatusIndicatorDotPositionEnum_1.default.leading;\n // Font size.\n this.size = StatusIndicatorFontSizeEnum_1.default.medium;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n const small = this.size === StatusIndicatorFontSizeEnum_1.default.small;\n return (0, web_component_1.html) `\n\t\t\t\n\n\t\t\t
    ${this.getCircle()}${this.getLabel()}
    \n\t\t`;\n }\n /**\n * Returns Circle.\n *\n * @returns Template.\n */\n getCircle() {\n if (!this.statusColor) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t
    \n\t\t\t
    \n\t\t`;\n }\n /**\n * Returns label.\n *\n * @returns Template.\n */\n getLabel() {\n if (!this.statusLabel) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\n\t\t\t\t${this.statusLabel}\n\t\t\t\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], StatusIndicator.prototype, \"statusLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], StatusIndicator.prototype, \"statusColor\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], StatusIndicator.prototype, \"statusDotPosition\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], StatusIndicator.prototype, \"size\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], StatusIndicator.prototype, \"theme\", void 0);\nStatusIndicator = __decorate([\n (0, web_component_1.customElement)('kompis-status-indicator')\n], StatusIndicator);\nexports.default = StatusIndicator;\n//# sourceMappingURL=StatusIndicator.js.map","import \"@inter-ikea-kompis/component-status-indicator/lib/components/status-indicator/StatusIndicator\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisStatusIndicator extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-status-indicator\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.size = props.size;\n element.statusColor = props.statusColor;\n element.statusDotPosition = props.statusDotPosition;\n element.statusLabel = props.statusLabel;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisStatusIndicator.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n size: PropTypes.string,\n statusColor: PropTypes.string,\n statusDotPosition: PropTypes.string,\n statusLabel: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisStatusIndicator;\n","import \"@inter-ikea-kompis/component-store-selector/lib/components/store-selector-card/StoreSelectorCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisStoreSelectorCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-store-selector-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.localizedInformation = props.localizedInformation;\n element.storeId = props.storeId;\n element.stores = props.stores;\n element.theme = props.theme;\n element.translations = props.translations;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onChange, \"change\");\n }\n}\nKompisStoreSelectorCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n storeId: PropTypes.string,\n stores: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n onChange: PropTypes.func\n};\nexport default KompisStoreSelectorCard;\n","import \"@inter-ikea-kompis/component-store-selector/lib/components/store-selector/StoreSelector\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisStoreSelector extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-store-selector\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.ariaLabel = props.ariaLabel;\n element.layout = props.layout;\n element.localizedInformation = props.localizedInformation;\n element.settings = props.settings;\n element.sheetAlignment = props.sheetAlignment;\n element.storeAvailabilities = props.storeAvailabilities;\n element.storeId = props.storeId;\n element.stores = props.stores;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onChange, \"change\");\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n }\n}\nKompisStoreSelector.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n ariaLabel: PropTypes.string,\n layout: PropTypes.string,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n sheetAlignment: PropTypes.string,\n storeAvailabilities: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n storeId: PropTypes.string,\n stores: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n onChange: PropTypes.func,\n onModalOpen: PropTypes.func,\n onModalClose: PropTypes.func\n};\nexport default KompisStoreSelector;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass ConfigurationSummaryToastMessage {\n /**\n * @param localizedInformationOrTranslations\n */\n static getAddToCartFail(localizedInformationOrTranslations) {\n const label = 'translations' in localizedInformationOrTranslations\n ? localizedInformationOrTranslations.translations.addToShoppingCartErrorMessage\n : localizedInformationOrTranslations.addToShoppingCartErrorMessage;\n return {\n label\n };\n }\n /**\n * @param localizedInformationOrTranslations\n */\n static getAddToListFail(localizedInformationOrTranslations) {\n const label = 'translations' in localizedInformationOrTranslations\n ? localizedInformationOrTranslations.translations.addToShoppingListErrorMessage\n : localizedInformationOrTranslations.addToShoppingListErrorMessage;\n return {\n label\n };\n }\n /**\n * @param localizedInformationOrTranslations\n */\n static getAddToCartAndListFail(localizedInformationOrTranslations) {\n const label = 'translations' in localizedInformationOrTranslations\n ? localizedInformationOrTranslations.translations.addToShoppingBagAndListErrorMessage\n : localizedInformationOrTranslations.addToShoppingBagAndListErrorMessage;\n return {\n label\n };\n }\n}\nexports.default = ConfigurationSummaryToastMessage;\n//# sourceMappingURL=ConfigurationSummaryToastMessage.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ConfirmationSummaryShareDesignStateEnum = exports.ConfirmationSummaryCopyDesignCodeStateEnum = exports.ConfigurationSummaryWeightUtility = exports.ConfigurationSummaryToastMessage = exports.ConfigurationSummaryModalEnum = exports.ConfigurationSummaryConfirmationCardTypeEnum = exports.ConfigurationSummaryConfirmationCardStateEnum = exports.ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum = exports.ConfigurationSummaryConfirmationCard = exports.ConfigurationSummary = void 0;\nconst ConfigurationSummary_1 = __importDefault(require(\"./components/configuration-summary/ConfigurationSummary\"));\nexports.ConfigurationSummary = ConfigurationSummary_1.default;\nconst ConfigurationSummaryConfirmationCard_1 = __importDefault(require(\"./components/configuration-summary-confirmation-card/ConfigurationSummaryConfirmationCard\"));\nexports.ConfigurationSummaryConfirmationCard = ConfigurationSummaryConfirmationCard_1.default;\nconst ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum_1 = __importDefault(require(\"./enums/ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum\"));\nexports.ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum = ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum_1.default;\nconst ConfigurationSummaryConfirmationCardStateEnum_1 = __importDefault(require(\"./enums/ConfigurationSummaryConfirmationCardStateEnum\"));\nexports.ConfigurationSummaryConfirmationCardStateEnum = ConfigurationSummaryConfirmationCardStateEnum_1.default;\nconst ConfigurationSummaryConfirmationCardTypeEnum_1 = __importDefault(require(\"./enums/ConfigurationSummaryConfirmationCardTypeEnum\"));\nexports.ConfigurationSummaryConfirmationCardTypeEnum = ConfigurationSummaryConfirmationCardTypeEnum_1.default;\nconst ConfigurationSummaryModalEnum_1 = __importDefault(require(\"./enums/ConfigurationSummaryModalEnum\"));\nexports.ConfigurationSummaryModalEnum = ConfigurationSummaryModalEnum_1.default;\nconst ConfirmationSummaryCopyDesignCodeStateEnum_1 = __importDefault(require(\"./enums/ConfirmationSummaryCopyDesignCodeStateEnum\"));\nexports.ConfirmationSummaryCopyDesignCodeStateEnum = ConfirmationSummaryCopyDesignCodeStateEnum_1.default;\nconst ConfirmationSummaryShareDesignStateEnum_1 = __importDefault(require(\"./enums/ConfirmationSummaryShareDesignStateEnum\"));\nexports.ConfirmationSummaryShareDesignStateEnum = ConfirmationSummaryShareDesignStateEnum_1.default;\nconst ConfigurationSummaryToastMessage_1 = __importDefault(require(\"./utilities/ConfigurationSummaryToastMessage\"));\nexports.ConfigurationSummaryToastMessage = ConfigurationSummaryToastMessage_1.default;\nconst ConfigurationSummaryWeightUtility_1 = __importDefault(require(\"./utilities/ConfigurationSummaryWeightUtility\"));\nexports.ConfigurationSummaryWeightUtility = ConfigurationSummaryWeightUtility_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ToastAnimationNameEnum;\n(function (ToastAnimationNameEnum) {\n ToastAnimationNameEnum[\"opening\"] = \"opening\";\n ToastAnimationNameEnum[\"closing\"] = \"closing\";\n})(ToastAnimationNameEnum || (ToastAnimationNameEnum = {}));\nexports.default = ToastAnimationNameEnum;\n//# sourceMappingURL=ToastAnimationNameEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Utility class for handling multiple focus requirements.\n */\nclass ToastFocusUtil {\n /**\n * @param callback\n */\n constructor(callback) {\n this.callback = null;\n this.state = {};\n this.element = null;\n this.listeners = {\n pointerenter: () => this.setState({ hasPointer: true }),\n pointerleave: () => this.setState({ hasPointer: false }),\n focusin: () => this.setState({ hasFocus: true }),\n focusout: () => this.setState({ hasFocus: false })\n };\n this.callback = callback;\n }\n /**\n * @param element\n */\n observe(element) {\n if (this.element) {\n throw new Error(`ToastFocusUtil already have an observed element`);\n }\n this.element = element;\n for (const key in this.listeners) {\n element.addEventListener(key, this.listeners[key]);\n }\n }\n disconnect() {\n if (!this.element) {\n return;\n }\n for (const key in this.listeners) {\n this.element.removeEventListener(key, this.listeners[key]);\n }\n this.element = null;\n this.state = {};\n }\n /**\n * @param stateChange\n */\n setState(stateChange) {\n const oldHasFocus = this.state.hasFocus || this.state.hasPointer;\n Object.assign(this.state, stateChange);\n const newHasFocus = this.state.hasFocus || this.state.hasPointer;\n if (oldHasFocus !== newHasFocus && this.callback) {\n this.callback(!!newHasFocus);\n }\n }\n}\nexports.default = ToastFocusUtil;\n//# sourceMappingURL=ToastFocusUtil.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst ToastAnimationNameEnum_1 = __importDefault(require(\"../../enums/ToastAnimationNameEnum\"));\nconst MAX_WIDTH = 360;\nconst MIN_HEIGHT = 66;\nclass ToastStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.isVisible \"true\" if visible.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { color, breakpoint, spacing } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tposition: fixed;\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\tz-index: 9999;\n\t\t\t\ttop: ${options.top}px;\n\t\t\t\tbottom: ${options.bottom}px;\n\t\t\t\tleft: 0;\n\t\t\t\tright: 0;\n\t\t\t\ttransition-duration: ${options.theme.motion.duration.medium};\n\t\t\t\ttransition-property: bottom, top;\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\t.toastContainer {\n\t\t\t\tpointer-events: none;\n\t\t\t\tdisplay: flex;\n\t\t\t\tanimation-name: ${options.isVisible ? 'opening' : 'closing'};\n\t\t\t\t${this.getAnimationName(options)};\n\t\t\t\tanimation-fill-mode: both;\n\t\t\t\tanimation-duration: ${options.theme.motion.duration.medium};\n\t\t\t\tanimation-timing-function: ${options.isVisible\n ? options.theme.motion.ease.enter\n : options.theme.motion.ease.exit};\n\t\t\t}\n\t\t\t.toast {\n\t\t\t\tmax-width: 100%;\n\t\t\t\tflex-grow: 1;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tcolor: ${color.neutral.white};\n\t\t\t\tmin-height: ${MIN_HEIGHT / 16}rem;\n\t\t\t\tpadding: ${spacing.space100 / 16}rem;\n\t\t\t\tbackground-color: ${color.neutral.grey900};\n\t\t\t\tpointer-events: ${options.isVisible ? 'auto' : 'none'};\n\t\t\t}\n\t\t\t* {\n\t\t\t\tz-index: inherit;\n\t\t\t}\n\t\t\t.action {\n\t\t\t\tmargin: 0 ${spacing.space50 / 16}rem;\n\t\t\t}\n\t\t\t.message {\n\t\t\t\tword-break: break-word;\n\t\t\t\tmin-width: 50%;\n\t\t\t\tflex-basis: 0;\n\t\t\t\tflex-grow: 1;\n\t\t\t\tmargin: 0 ${spacing.space50 / 16}rem;\n\t\t\t}\n\t\t\t.close {\n\t\t\t\tcursor: pointer;\n\t\t\t\tflex-shrink: 0;\n\t\t\t}\n\t\t\t.filler {\n\t\t\t\tflex-grow: 1;\n\t\t\t}\n\t\t\t.space-25 {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\twidth: ${spacing.space25 / 16}rem;\n\t\t\t}\n\t\t\t.stripe {\n\t\t\t\talign-self: stretch;\n\t\t\t\tflex-shrink: 0;\n\t\t\t\twidth: ${1 / 16}rem;\n\t\t\t\topacity: 0.2;\n\t\t\t\tbackground-color: ${color.neutral.white};\n\t\t\t\tmargin: 0 ${spacing.space50 / 16}rem;\n\t\t\t}\n\t\t\t.body {\n\t\t\t\tflex-grow: 1;\n\t\t\t\tflex-shrink: 1;\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-wrap: wrap;\n\t\t\t\tflex-basis: auto;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: space-between;\n\t\t\t}\n\t\t\t.content {\n\t\t\t\tflex-basis: auto;\n\t\t\t\tdisplay: inline;\n\t\t\t}\n\t\t\t/* Desktop */\n\t\t\t@media screen and (min-width: ${breakpoint.medium.width / 16}rem) {\n\t\t\t\t${this.getBannerStyle(options)}\n\t\t\t}\n\t\t\t/* Mobile */\n\t\t\t@media screen and (max-width: ${breakpoint.medium.width / 16}rem) {\n\t\t\t\t${this.getBarStyle()}\n\t\t\t}\n\t\t`;\n }\n /**\n * @param options\n */\n static getAnimationName(options) {\n if (!options.isAnimating) {\n return '';\n }\n if (options.isVisible) {\n return (0, web_component_1.css) `\n\t\t\t\tanimation-name: ${ToastAnimationNameEnum_1.default.opening};\n\t\t\t`;\n }\n return (0, web_component_1.css) `\n\t\t\tanimation-name: ${ToastAnimationNameEnum_1.default.closing};\n\t\t`;\n }\n /**\n * @param options\n */\n static getBannerStyle(options) {\n const { spacing, border } = options.theme;\n const translation = options.direction === 'rtl' ? '-100%' : '100%';\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\talign-items: flex-end;\n\t\t\t}\n\t\t\t.toast {\n\t\t\t\twidth: ${MAX_WIDTH / 16}rem;\n\t\t\t\tborder-radius: ${border.radius.radius4 / 16}rem;\n\t\t\t}\n\t\t\t.toastContainer {\n\t\t\t\tpadding: ${spacing.space150 / 16}rem 0;\n\t\t\t}\n\t\t\t.containerSpace {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\twidth: ${spacing.space150 / 16}rem;\n\t\t\t}\n\t\t\t@keyframes closing {\n\t\t\t\tfrom {\n\t\t\t\t\ttransform: translateX(0);\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\ttransform: translateX(${translation});\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes opening {\n\t\t\t\tfrom {\n\t\t\t\t\ttransform: translateX(${translation});\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\ttransform: translateX(0);\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n /**\n * @param options\n */\n static getBarStyle() {\n return (0, web_component_1.css) `\n\t\t\t.toast {\n\t\t\t\tflex-grow: 1;\n\t\t\t}\n\t\t\t@keyframes closing {\n\t\t\t\tfrom {\n\t\t\t\t\ttransform: translateY(0);\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\ttransform: translateY(-100%);\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes opening {\n\t\t\t\tfrom {\n\t\t\t\t\ttransform: translateY(-100%);\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\ttransform: translateY(0);\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = ToastStyle;\n//# sourceMappingURL=ToastStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_hyperlink_1 = require(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@inter-ikea-kompis/component-loading-indicator\");\nrequire(\"@inter-ikea-kompis/component-icon\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"@inter-ikea-kompis/component-collapsible\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/icon-store/cross-small\");\nconst ToastAnimationNameEnum_1 = __importDefault(require(\"../../enums/ToastAnimationNameEnum\"));\nconst ToastFocusUtil_1 = __importDefault(require(\"../../utils/ToastFocusUtil\"));\nconst ToastStyle_1 = __importDefault(require(\"./ToastStyle\"));\nconst TIMEOUT_TIME = {\n min: 5000,\n max: 10000,\n factor: 50\n};\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n *\n * This component should be used for general toasts and it provides with general stylings according to NCL and fixes for common browsers and touch devices.\n *\n *\n * @event close Triggered by user or timeout.\n * @event animationEnd When the animation for opening/closing ends.\n * @event actionClick When user clicks the action\n */\nlet Toast = class Toast extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Visible: Show or hide toast.\n this.visible = false;\n // Title on toast.\n this.label = null;\n // Label for action.\n this.actionLabel = null;\n // Href for action.\n this.actionHref = null;\n // The same as target for a -tag\n this.actionTarget = component_hyperlink_1.HyperlinkTargetEnum.blank;\n // Label for the close button to set as an aria-label for accessibility reasons\n this.closeButtonAriaLabel = null;\n this.isAnimating = false;\n this.toastFocusUtil = new ToastFocusUtil_1.default(this.onFocusChange.bind(this));\n this.timerId = null;\n this.iframeVisibleAreaObserver = utilities_1.IframeUtility.isInsideIframe() && utilities_1.IframeUtility.isParentWindowAccessible()\n ? new utilities_1.IframeVisibleAreaObserver({\n debounceTime: 100,\n overflow: true,\n callback: () => {\n this.requestUpdate();\n }\n })\n : null;\n /**\n * Closes sheet on escape.\n *\n * @param event Event.\n */\n this.onKeyDownListener = (event) => {\n if (event.code === 'Escape' && this.visible) {\n this.dispatchEvent(new CustomEvent('close', { bubbles: true, detail: { type: 'escape' } }));\n }\n };\n }\n /**\n * @override\n */\n render() {\n const area = this.iframeVisibleAreaObserver\n ? this.iframeVisibleAreaObserver.getArea()\n : { top: 0, bottom: 0 };\n if (!this.visible && !this.isAnimating) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\n\t\t\t\t${this.getToastContent()}\n\t\t\t\t
    \n\t\t\t\n\t\t`;\n }\n animateChange() {\n var _a;\n const element = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.toast');\n if (element && 'animate' in element) {\n element.animate([\n {\n transform: 'none',\n opacity: 1\n },\n {\n transform: 'scale(0.8)',\n opacity: 0\n },\n {\n transform: 'none',\n opacity: 1\n }\n ], {\n duration: Number(this.theme.motion.duration.medium.replace('ms', '')),\n easing: this.theme.motion.ease.bob\n });\n }\n }\n startTimer() {\n if (this.timerId) {\n this.stopTimer();\n }\n this.timerId = setTimeout(() => {\n this.timerId = null;\n this.dispatchEvent(new CustomEvent('close', {\n bubbles: true,\n detail: {\n type: 'timeout'\n }\n }));\n }, this.getTimeoutTime());\n }\n stopTimer() {\n if (this.timerId) {\n clearTimeout(this.timerId);\n this.timerId = null;\n }\n }\n /**\n * @override\n */\n connectedCallback() {\n super.connectedCallback();\n window.addEventListener('keydown', this.onKeyDownListener);\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.disconnect();\n this.isAnimating = false;\n window.removeEventListener('keydown', this.onKeyDownListener);\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('visible')) {\n this.isAnimating = true;\n if (this.visible) {\n this.toastFocusUtil.observe(this);\n if (this.iframeVisibleAreaObserver) {\n this.iframeVisibleAreaObserver.observe();\n }\n this.startTimer();\n }\n else {\n this.disconnect();\n }\n }\n return true;\n }\n /**\n * The intersection between iframe and visible area.\n *\n * @returns - Html.\n */\n getToastContent() {\n return (0, web_component_1.html) `
    \n\t\t\t
    \n\t\t\t\t${this.label}\n\t\t\t\t${this.getActionButton()}\n\t\t\t
    \n\t\t\t${this.actionLabel ? (0, web_component_1.html) `
    ` : null}\n\t\t\t
    \n\t\t\t${this.getCloseButton()}\n\t\t
    `;\n }\n disconnect() {\n this.stopTimer();\n this.toastFocusUtil.disconnect();\n if (this.iframeVisibleAreaObserver) {\n this.iframeVisibleAreaObserver.disconnect();\n }\n }\n /**\n * @param hasFocus\n */\n onFocusChange(hasFocus) {\n if (hasFocus) {\n this.stopTimer();\n }\n else {\n this.startTimer();\n }\n }\n /**\n * Returns close button.\n *\n * @returns Template.\n */\n getActionButton() {\n if (!this.actionLabel) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t this.dispatchEvent(new CustomEvent('actionClick', { bubbles: true }))}\"\n\t\t\t\t\t\tclass=\"action\"\n\t\t\t\t\t\t.href=\"${this.actionHref}\"\n\t\t\t\t\t\t.target=\"${this.actionTarget}\"\n\t\t\t\t\t\t.color=\"${component_hyperlink_1.HyperlinkColorEnum.white}\"\n\t\t\t\t\t\t.text=\"${this.actionLabel}\"\n\t\t\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t\t>\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n /**\n * Returns close button.\n *\n * @returns Template.\n */\n getCloseButton() {\n const tertiaryVariant = 'tertiary';\n // The class 'skapa-focus-portal' is used to be able to click \"close\" button when toast is above a modal.\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t this.onCloseButtonClick()}\"\n\t\t\t\t\tinverse\n\t\t\t\t\txsmall\n\t\t\t\t\tvariant=\"${tertiaryVariant}\"\n\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\t${this.closeButtonAriaLabel}\n\t\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * Handles close button click.\n */\n onCloseButtonClick() {\n this.dispatchEvent(new CustomEvent('close', {\n bubbles: true,\n detail: {\n type: 'click'\n }\n }));\n }\n /**\n * Handles animation end.\n *\n * @param event\n */\n onAnimationEnd(event) {\n if (event.animationName.startsWith(ToastAnimationNameEnum_1.default.closing)) {\n this.isAnimating = false;\n this.dispatchEvent(new CustomEvent('animationEnd', {\n bubbles: true,\n detail: {\n type: 'close'\n }\n }));\n }\n else if (event.animationName.startsWith(ToastAnimationNameEnum_1.default.opening)) {\n this.dispatchEvent(new CustomEvent('animationEnd', {\n bubbles: true,\n detail: {\n type: 'open'\n }\n }));\n }\n this.update();\n }\n getTimeoutTime() {\n var _a, _b;\n const numberOfCharacters = (((_a = this.label) === null || _a === void 0 ? void 0 : _a.length) || 0) + (((_b = this.actionLabel) === null || _b === void 0 ? void 0 : _b.length) || 0);\n const calculatedTime = numberOfCharacters * TIMEOUT_TIME.factor;\n if (calculatedTime > TIMEOUT_TIME.max) {\n return TIMEOUT_TIME.max;\n }\n if (calculatedTime < TIMEOUT_TIME.min) {\n return TIMEOUT_TIME.min;\n }\n return calculatedTime;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Toast.prototype, \"visible\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Toast.prototype, \"label\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Toast.prototype, \"actionLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Toast.prototype, \"actionHref\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Toast.prototype, \"actionTarget\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Toast.prototype, \"closeButtonAriaLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Toast.prototype, \"theme\", void 0);\nToast = __decorate([\n (0, web_component_1.customElement)('kompis-toast')\n], Toast);\nexports.default = Toast;\n//# sourceMappingURL=Toast.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_hyperlink_1 = require(\"@inter-ikea-kompis/component-hyperlink\");\nrequire(\"./components/toast/Toast\");\n/**\n * This class is used for calculating the hight of toasts and manage hover events.\n */\nclass ToastManager {\n /**\n * @param options Argument holder object.\n * @param options.theme Theme.\n * @param options.cacheStore GlobalCacheStore.\n */\n constructor({ theme, cacheStore = new utilities_1.GlobalCacheStore() }) {\n this.theme = theme;\n this.store = cacheStore.getStore('ToastManagerToast');\n }\n /**\n * @param options\n * @param options.label The label for the Toast.\n * @param options.actionLabel A label for the action.\n * @param options.actionHref An url for the action (e.g. \"https://www.ikea.com\").\n * @param options.actionTarget Target for hyperlink. The same as for a
    -tag.\n * @param options.onActionClick Called when user clicks on the action in the toast.\n */\n showToast(options) {\n var _a, _b, _c;\n const toastElement = this.getToastElement();\n toastElement.label = options.label;\n toastElement.actionLabel = (_a = options.actionLabel) !== null && _a !== void 0 ? _a : null;\n toastElement.actionHref = (_b = options.actionHref) !== null && _b !== void 0 ? _b : null;\n toastElement.actionTarget = (_c = options.actionTarget) !== null && _c !== void 0 ? _c : component_hyperlink_1.HyperlinkTargetEnum.blank;\n toastElement.visible = true;\n if (options.onActionClick) {\n toastElement.addEventListener('actionClick', options.onActionClick);\n }\n }\n /**\n * @param toastId ToastId.\n */\n hideToast() {\n const toastElement = this.store.get('toast');\n if (toastElement === null || toastElement === void 0 ? void 0 : toastElement.visible) {\n toastElement.visible = false;\n }\n }\n /**\n * @returns A toast element.\n */\n getToastElement() {\n const currentToastElement = this.store.get('toast');\n if (currentToastElement === null || currentToastElement === void 0 ? void 0 : currentToastElement.visible) {\n currentToastElement.animateChange();\n currentToastElement.startTimer();\n return currentToastElement;\n }\n const toastElement = this.createNewToastElement();\n this.store.set('toast', toastElement);\n document.body.appendChild(toastElement);\n return toastElement;\n }\n /**\n * Creates a new toast element hand handle life cycle for this.\n */\n createNewToastElement() {\n const toastElement = document.createElement('kompis-toast');\n toastElement.addEventListener('close', () => {\n this.store.delete('toast');\n toastElement.visible = false;\n });\n toastElement.addEventListener('animationEnd', () => {\n if (!toastElement.visible) {\n toastElement.remove();\n }\n });\n toastElement.theme = this.theme;\n return toastElement;\n }\n}\nexports.default = ToastManager;\n//# sourceMappingURL=ToastManager.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ToastManager = exports.Toast = void 0;\nconst Toast_1 = __importDefault(require(\"./components/toast/Toast\"));\nexports.Toast = Toast_1.default;\nconst ToastManager_1 = __importDefault(require(\"./ToastManager\"));\nexports.ToastManager = ToastManager_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AssemblyServicesStatusButton = exports.AssemblyServices = void 0;\nconst AssemblyServices_1 = __importDefault(require(\"./components/assembly-services/AssemblyServices\"));\nexports.AssemblyServices = AssemblyServices_1.default;\nconst AssemblyServicesStatusButton_1 = __importDefault(require(\"./components/assembly-services-status-button/AssemblyServicesStatusButton\"));\nexports.AssemblyServicesStatusButton = AssemblyServicesStatusButton_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AssistanceCard = void 0;\nconst AssistanceCard_1 = __importDefault(require(\"./components/assistance-card/AssistanceCard\"));\nexports.AssistanceCard = AssistanceCard_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst index_js_1 = require(\"./index.js\");\n(0, index_js_1.registerIcon)('pencil', [{ tag: 'path', att: { 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M13.0009 2.586 4 11.5868v5.4144h5.4142l8.9944-8.9944-5.4077-5.421zM6 15.0012v-2.5859l6.9991-6.9993 2.5828 2.589-6.9961 6.9962H6z' } }, { tag: 'path', att: { d: 'M4 21.0009h16v-2H4v2z' } }]);\n","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nrequire(\"@inter-ikea-kompis/component-media-carousel\");\n/**\n * The view for the Summary Page Images.\n *\n * @event change Triggered when the user changes to a new image\n */\nlet SummaryPageImages = class SummaryPageImages extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // List of media items\n this.images = null;\n // Index of the current main image\n this.selectedImageIndex = 0;\n }\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) ` ${this.getMediaCarousel()} `;\n }\n hasTranslations() {\n return !!this.translations || !!this.localizedInformation;\n }\n /**\n * Get Media Carousel. When images prop is undefined, the carousel is not shown.\n *\n * @returns The store selector.\n */\n getMediaCarousel() {\n if (!this.images) {\n return null;\n }\n // Fallback to first image if selected image is out of range.\n if (this.selectedImageIndex >= this.images.length) {\n this.selectedImageIndex = 0;\n }\n return (0, web_component_1.html) ` {\n this.selectedImageIndex = detail.selectedIndex;\n this.dispatchEvent(new CustomEvent('change', {\n bubbles: true,\n detail: { selectedIndex: detail.selectedIndex }\n }));\n this.requestUpdate();\n }}\"\n\t\t>`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SummaryPageImages.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageImages.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageImages.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageImages.prototype, \"images\", void 0);\nSummaryPageImages = __decorate([\n (0, web_component_1.customElement)('kompis-summary-page-images')\n], SummaryPageImages);\nexports.default = SummaryPageImages;\n//# sourceMappingURL=SummaryPageImages.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProductListTotalPrice = exports.ProductListSection = exports.ProductList = void 0;\nconst ProductList_1 = __importDefault(require(\"./components/product-list/ProductList\"));\nexports.ProductList = ProductList_1.default;\nconst ProductListSection_1 = __importDefault(require(\"./components/product-list-section/ProductListSection\"));\nexports.ProductListSection = ProductListSection_1.default;\nconst ProductListTotalPrice_1 = __importDefault(require(\"./components/product-list-total-price/ProductListTotalPrice\"));\nexports.ProductListTotalPrice = ProductListTotalPrice_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SummaryPageModalEnum;\n(function (SummaryPageModalEnum) {\n SummaryPageModalEnum[\"confirmationCard\"] = \"confirmationCard\";\n SummaryPageModalEnum[\"ecoFeeCard\"] = \"ecoFeeCard\";\n SummaryPageModalEnum[\"energyFicheCard\"] = \"energyFicheCard\";\n SummaryPageModalEnum[\"energyLabelCard\"] = \"energyLabelCard\";\n SummaryPageModalEnum[\"unavailableProductCard\"] = \"unavailableProductCard\";\n SummaryPageModalEnum[\"storeSelectorCard\"] = \"storeSelectorCard\";\n SummaryPageModalEnum[\"shareDesignCard\"] = \"shareDesignCard\";\n SummaryPageModalEnum[\"zipAvailabilityCard\"] = \"zipAvailabilityCard\";\n SummaryPageModalEnum[\"financialServicesCard\"] = \"financialServicesCard\";\n SummaryPageModalEnum[\"sortListCard\"] = \"sortListCard\";\n SummaryPageModalEnum[\"saveDesignToProfileCard\"] = \"saveDesignToProfileCard\";\n SummaryPageModalEnum[\"zipIn\"] = \"zipIn\";\n})(SummaryPageModalEnum || (SummaryPageModalEnum = {}));\nexports.default = SummaryPageModalEnum;\n//# sourceMappingURL=SummaryPageModalEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\n/**\n * This is the style class for SummaryPageProductList.\n */\nclass SummaryPageProductListStyle {\n /**\n * Returns styles.\n *\n * @param options\n * @param options.theme\n * @param options.showAvailabilityOptions\n */\n static getStyle(options) {\n const { spacing, breakpoint } = options.theme;\n const { showAvailabilityOptions } = options;\n if (showAvailabilityOptions) {\n return (0, web_component_1.css) `\n\t\t\t\t.header {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-direction: column;\n\t\t\t\t\tgap: ${spacing.space200 / 16}rem;\n\t\t\t\t\tmargin-bottom: ${spacing.space250 / 16}rem;\n\t\t\t\t}\n\n\t\t\t\t.availability {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-direction: column;\n\t\t\t\t\talign-items: flex-start;\n\t\t\t\t\tjustify-content: center;\n\t\t\t\t\tgap: ${spacing.space100 / 16}rem;\n\t\t\t\t}\n\n\t\t\t\t@media (min-width: ${breakpoint.medium.width / 16}rem) {\n\t\t\t\t\t.header {\n\t\t\t\t\t\tdisplay: grid;\n\t\t\t\t\t\tgrid-auto-flow: row;\n\t\t\t\t\t\tgrid-template-columns: repeat(2, auto);\n\t\t\t\t\t\tgap: ${spacing.space100 / 16}rem;\n\t\t\t\t\t}\n\n\t\t\t\t\t.availability {\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\tflex-direction: column;\n\t\t\t\t\t\talign-items: flex-start;\n\t\t\t\t\t\tjustify-content: center;\n\t\t\t\t\t\tgap: ${spacing.space100 / 16}rem;\n\t\t\t\t\t}\n\n\t\t\t\t\tkompis-sort-list {\n\t\t\t\t\t\tplace-self: end end;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t@media (min-width: ${breakpoint.xlarge.width / 16}rem) {\n\t\t\t\t\t.header {\n\t\t\t\t\t\tgap: ${spacing.space150 / 16}rem;\n\t\t\t\t\t}\n\n\t\t\t\t\t.availability {\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\tflex-direction: row;\n\t\t\t\t\t\talign-items: center;\n\t\t\t\t\t\tjustify-content: flex-start;\n\t\t\t\t\t\tflex-wrap: wrap;\n\t\t\t\t\t\tcolumn-gap: ${spacing.space150 / 16}rem;\n\t\t\t\t\t\trow-gap: ${spacing.space100 / 16}rem;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t${this.getCommonStyle()}\n\t\t\t`;\n }\n else {\n /**\n * We don't want any gaps after the availability container when there are no availability options (the container is hidden).\n *\n * This is why there is separate styling for this case. The grid/flex gap can't be hidden through css.\n */\n return (0, web_component_1.css) `\n\t\t\t\t.header {\n\t\t\t\t\tmargin-bottom: ${spacing.space250 / 16}rem;\n\t\t\t\t}\n\n\t\t\t\t@media (min-width: ${breakpoint.medium.width / 16}rem) {\n\t\t\t\t\t.header {\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\tjustify-content: flex-end;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t${this.getCommonStyle()}\n\t\t\t`;\n }\n }\n /**\n * Returns common styles.\n *\n */\n static getCommonStyle() {\n return (0, web_component_1.css) `\n\t\t\t@media print {\n\t\t\t\t.header {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = SummaryPageProductListStyle;\n//# sourceMappingURL=SummaryPageProductListStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\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};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_product_row_1 = require(\"@inter-ikea-kompis/component-product-row\");\nconst component_store_selector_1 = require(\"@inter-ikea-kompis/component-store-selector\");\nrequire(\"@inter-ikea-kompis/component-sort-list\");\nrequire(\"@inter-ikea-kompis/component-product-list\");\nrequire(\"@inter-ikea-kompis/component-store-selector\");\nrequire(\"@inter-ikea-kompis/component-home-delivery\");\nconst SummaryPageModalEnum_1 = __importDefault(require(\"../../enums/SummaryPageModalEnum\"));\nconst SummaryPageProductListStyle_1 = __importDefault(require(\"./SummaryPageProductListStyle\"));\n/**\n * The view for the Summary Page Product List.\n *\n * @event storeSelectorChange Triggered when the selected store changes.\n * @event sortListChange Triggered when the selected way of sorting changes.\n * @event collectProduct Triggered when a product is collected.\n * @event modalOpen Triggered when a modal should be opened.\n * @event modalClose Triggered when a modal should be closed.\n * @event homeDeliveryStartOverClick User clicks on the start over link or the back button.\n * @event homeDeliveryForgetClick User clicks on the forget link from Home Delivery.\n * @event homeDeliveryInput Input of zip code.\n * @event homeDeliverySubmitButtonClick User clicks the Check availability button.\n * @event productListRemove Triggered when the remove button is clicked on a product in product list.\n * @event productListExpand Triggered when included shopping products in product list gets expanded.\n */\nlet SummaryPageProductList = class SummaryPageProductList extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // A list of store availability objects.\n this.storeAvailabilities = null;\n // A list of stores, when left empty the store selector will be hidden\n this.stores = null;\n // The storeId of the selected store\n this.storeId = null;\n // Controls how measurements should be shown\n this.productMeasures = component_product_row_1.ProductRowProductMeasureEnum.none;\n // Disables outgoing links.\n this.disableLinks = false;\n // Visible modal\n this.visibleModal = null;\n // A collection of props used for the home delivery availability in product list.\n this.homeDelivery = null;\n // Whether to show the collect checkbox in the product list or not.\n this.collectableProducts = false;\n // A list of product ids that are collected.\n this.collectedProducts = null;\n // Show text describing the color and/or material of the product.\n this.showDesignText = false;\n // A list of sections used in the product list.\n this.productListSections = null;\n // A list of included products within SPR products. Must be set (if applicable) for total package weight.\n this.includedProductsWithinSprs = null;\n // A list of product item numbers that can be removed in the product list.\n this.productListRemovable = null;\n // Sets the default sorting of the product list.\n this.defaultSortBy = null;\n // Highest heading on the Summary page will be h2 as opposed to h1. Set to true if planner is e.g. used in an iframe with an h1 header outside of the planner.\n this.startHeadingsAtH2 = false;\n // Layout for summary page. NOTE: ProductRowLayoutEnum.compactPrint should only be used during print. Make sure SPR's has their child articles in includedProductsWithinSprs, since SPR's are not visible in compactPrint.\n this.pickingListPrintLayout = null;\n // How the product list should be sorted\n this.sortBy = null;\n // A list of expanded shopping products.\n this.expanded = null;\n this.dexfSettings = null;\n }\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n const homeDeliveryComponent = this.getHomeDelivery();\n const storeSelectorComponent = this.getStoreSelector();\n const showAvailabilityOptions = !!homeDeliveryComponent || !!storeSelectorComponent;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t
    ${homeDeliveryComponent} ${storeSelectorComponent}
    \n\t\t\t\t${this.getSortList()}\n\t\t\t
    \n\t\t\t${this.getProductList()}\n\t\t`;\n }\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n getSettings() {\n return this.dexfSettings;\n }\n /**\n * Get Home Delivery. When homeDelivery prop is undefined or null, the home delivery is hidden.\n *\n * @returns The home delivery.\n */\n getHomeDelivery() {\n var _a;\n const { zipValidationDataSource, zipAvailabilityDataSource } = this.getSettings().kompis.serviceSettings;\n const dataSourceIsDisabled = zipValidationDataSource === enums_1.ZipValidationDataSourceEnum.disabled ||\n zipAvailabilityDataSource === enums_1.ZipAvailabilityDataSourceEnum.disabled;\n if (!this.homeDelivery || dataSourceIsDisabled) {\n return null;\n }\n return (0, web_component_1.html) ` this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: {\n visibleModal: {\n itemNo: null,\n modal: SummaryPageModalEnum_1.default.zipAvailabilityCard\n },\n homeDeliveryState: state\n }\n }))}\"\n\t\t\t@modalClose=\"${(event) => {\n var _a, _b;\n this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }));\n (_b = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.triggerElement) === null || _b === void 0 ? void 0 : _b.focus();\n }}\"\n\t\t\t@submitButtonClick=${() => this.dispatchEvent(new CustomEvent('homeDeliverySubmitButtonClick', { bubbles: true }))}\n\t\t\t@forgetClick=\"${({ detail }) => {\n const { triggerElement } = detail, restOfDetail = __rest(detail, [\"triggerElement\"]);\n this.dispatchEvent(new CustomEvent('homeDeliveryForgetClick', { bubbles: true, detail: restOfDetail }));\n triggerElement === null || triggerElement === void 0 ? void 0 : triggerElement.focus();\n }}\"\n\t\t\t@startOverClick=\"${(event) => {\n this.dispatchEvent(new CustomEvent('homeDeliveryStartOverClick', {\n bubbles: true,\n detail: Object.assign({}, event.detail)\n }));\n }}\"\n\t\t\t@input=\"${(event) => {\n this.dispatchEvent(new CustomEvent('homeDeliveryInput', { bubbles: true, detail: Object.assign({}, event.detail) }));\n }}\"\n\t\t>`;\n }\n /**\n * Get Store Selector. When stores prop is undefined or empty list, store selector is hidden.\n *\n * @returns The store selector.\n */\n getStoreSelector() {\n var _a, _b;\n if (!this.stores ||\n ((_a = this.stores) === null || _a === void 0 ? void 0 : _a.length) === 0 ||\n // No reason to show the store selector if there are no store availabilties.\n this.getSettings().kompis.serviceSettings.storeAvailabilityDataSource ===\n enums_1.StoreAvailabilityDataSourceEnum.disabled) {\n return null;\n }\n return (0, web_component_1.html) ` this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: {\n visibleModal: {\n itemNo: null,\n modal: SummaryPageModalEnum_1.default.storeSelectorCard\n }\n }\n }))}\"\n\t\t\t@modalClose=\"${() => {\n this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }));\n }}\"\n\t\t\t@change=\"${({ detail }) => {\n this.dispatchEvent(new CustomEvent('storeSelectorChange', {\n bubbles: true,\n detail: { storeId: detail.storeId, visibleModal: null }\n }));\n }}\"\n\t\t>`;\n }\n /**\n * Get Sort List.\n *\n * @returns The sort list.\n */\n getSortList() {\n var _a, _b;\n return (0, web_component_1.html) ` this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: {\n visibleModal: {\n itemNo: null,\n modal: SummaryPageModalEnum_1.default.sortListCard\n }\n }\n }))}\"\n\t\t\t@modalClose=\"${({ detail }) => {\n var _a;\n this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: { visibleModal: null } }));\n (_a = detail.triggerElement) === null || _a === void 0 ? void 0 : _a.focus();\n }}\"\n\t\t\t@change=\"${({ detail }) => {\n var _a;\n this.dispatchEvent(new CustomEvent('sortListChange', {\n bubbles: true,\n detail: { selected: detail.selected, visibleModal: detail.visibleModal }\n }));\n this.sortBy = detail.selected;\n (_a = detail.triggerElement) === null || _a === void 0 ? void 0 : _a.focus();\n this.requestUpdate();\n }}\"\n\t\t>`;\n }\n /**\n * Get Product List.\n *\n * @returns The product list.\n */\n getProductList() {\n var _a, _b, _c;\n return (0, web_component_1.html) ` {\n this.expanded = event.detail.expanded;\n this.requestUpdate();\n this.dispatchEvent(new CustomEvent('productListExpand', { bubbles: true, detail: event.detail }));\n }}\"\n\t\t\t@modalOpen=\"${(event) => this.dispatchEvent(new CustomEvent('modalOpen', { bubbles: true, detail: event.detail }))}\"\n\t\t\t@modalClose=\"${(event) => this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: event.detail }))}\"\n\t\t\t@collect=\"${(event) => this.dispatchEvent(new CustomEvent('collectProduct', { bubbles: true, detail: event.detail }))}\"\n\t\t\t@remove=\"${(event) => {\n this.dispatchEvent(new CustomEvent('productListRemove', { bubbles: true, detail: event.detail }));\n }}\"\n\t\t>\n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SummaryPageProductList.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageProductList.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageProductList.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageProductList.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SummaryPageProductList.prototype, \"shoppingProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageProductList.prototype, \"storeAvailabilities\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageProductList.prototype, \"stores\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageProductList.prototype, \"storeId\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageProductList.prototype, \"productMeasures\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageProductList.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, synchronous: true })\n], SummaryPageProductList.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, synchronous: true })\n], SummaryPageProductList.prototype, \"homeDelivery\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageProductList.prototype, \"collectableProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageProductList.prototype, \"collectedProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageProductList.prototype, \"showDesignText\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageProductList.prototype, \"productListSections\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageProductList.prototype, \"includedProductsWithinSprs\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageProductList.prototype, \"productListRemovable\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageProductList.prototype, \"defaultSortBy\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageProductList.prototype, \"startHeadingsAtH2\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageProductList.prototype, \"pickingListPrintLayout\", void 0);\nSummaryPageProductList = __decorate([\n (0, web_component_1.customElement)('kompis-summary-page-product-list')\n], SummaryPageProductList);\nexports.default = SummaryPageProductList;\n//# sourceMappingURL=SummaryPageProductList.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\n/**\n * This is the style class for SummaryPageSecurity.\n */\nclass SummaryPageSecurityStyle {\n /**\n * Returns styles.\n *\n * @param options\n * @param options.theme\n */\n static getStyle(options) {\n const { spacing, color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\tdiv {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\tgap: ${spacing.space150 / 16}rem;\n\t\t\t}\n\n\t\t\t.title {\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\n\t\t\t.description {\n\t\t\t\tcolor: ${color.text.default};\n\t\t\t}\n\n\t\t\t.no-margin {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t${this.getGridLayoutForBreakpoint(options.theme, enums_1.ThemeBreakpointEnum.medium)}\n\t\t\t${this.getGridLayoutForBreakpoint(options.theme, enums_1.ThemeBreakpointEnum.large)}\n\t\t\t${this.getGridLayoutForBreakpoint(options.theme, enums_1.ThemeBreakpointEnum.xlarge)}\n\t\t\t${this.getGridLayoutForBreakpoint(options.theme, enums_1.ThemeBreakpointEnum.xxlarge)}\n\t\t`;\n }\n /**\n * @param theme\n * @param breakpoint\n */\n static getGridLayoutForBreakpoint(theme, breakpoint) {\n const numberOfColumns = {\n [enums_1.ThemeBreakpointEnum.medium]: 6,\n [enums_1.ThemeBreakpointEnum.large]: 7,\n [enums_1.ThemeBreakpointEnum.xlarge]: 7,\n [enums_1.ThemeBreakpointEnum.xxlarge]: 7\n };\n const imageColumnWidth = {\n [enums_1.ThemeBreakpointEnum.medium]: 5,\n [enums_1.ThemeBreakpointEnum.large]: 6,\n [enums_1.ThemeBreakpointEnum.xlarge]: 5,\n [enums_1.ThemeBreakpointEnum.xxlarge]: 5\n };\n return (0, web_component_1.css) `\n\t\t\t@media (min-width: ${theme.breakpoint[breakpoint].width / 16}rem) {\n\t\t\t\tdiv {\n\t\t\t\t\tdisplay: grid;\n\t\t\t\t\tgrid-template-columns: repeat(${numberOfColumns[breakpoint]}, 1fr);\n\t\t\t\t\tcolumn-gap: ${theme.breakpoint[breakpoint].gridSpacing.gutter / 16}rem;\n\t\t\t\t}\n\t\t\t\tkompis-image {\n\t\t\t\t\tgrid-column: 1 / span ${imageColumnWidth[breakpoint]};\n\t\t\t\t}\n\t\t\t\t.title,\n\t\t\t\t.description {\n\t\t\t\t\tgrid-column: 1 / span ${numberOfColumns[breakpoint]};\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = SummaryPageSecurityStyle;\n//# sourceMappingURL=SummaryPageSecurityStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nrequire(\"@inter-ikea-kompis/component-image\");\nrequire(\"@inter-ikea-kompis/component-text\");\nconst SummaryPageSecurityStyle_1 = __importDefault(require(\"./SummaryPageSecurityStyle\"));\n/**\n * The view for the Summary Page Security.\n */\nlet SummaryPageSecurity = class SummaryPageSecurity extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // The text for the title\n this.title = '';\n // The text for the description\n this.description = null;\n // The src string for the image\n this.imageSrc = null;\n // The alt text for the image\n this.imageAlt = null;\n // Highest heading on the Summary page security will be h3 as opposed to h2. Set to true if planner is e.g. used in an iframe with an h1 header outside of the planner.\n this.startHeadingsAtH3 = false;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    ${this.getTitle()} ${this.getDescription()} ${this.getSecurityImage()}
    \n\t\t`;\n }\n /**\n * Renders the title.\n *\n * @returns The title.\n */\n getTitle() {\n if (!this.title) {\n return null;\n }\n const title = (0, web_component_1.html) `${this.title}`;\n if (this.startHeadingsAtH3) {\n return (0, web_component_1.html) `

    ${title}

    `;\n }\n return (0, web_component_1.html) `

    ${title}

    `;\n }\n /**\n * Renders the description.\n */\n getDescription() {\n if (!this.description) {\n return null;\n }\n return (0, web_component_1.html) ` ${this.description}`;\n }\n /**\n * Renders the security image.\n */\n getSecurityImage() {\n if (!this.imageSrc || !this.imageAlt) {\n return null;\n }\n return (0, web_component_1.html) ``;\n }\n};\nSummaryPageSecurity.eventTypes = [];\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SummaryPageSecurity.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageSecurity.prototype, \"title\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageSecurity.prototype, \"description\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageSecurity.prototype, \"imageSrc\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageSecurity.prototype, \"imageAlt\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageSecurity.prototype, \"startHeadingsAtH3\", void 0);\nSummaryPageSecurity = __decorate([\n (0, web_component_1.customElement)('kompis-summary-page-security')\n], SummaryPageSecurity);\nexports.default = SummaryPageSecurity;\n//# sourceMappingURL=SummaryPageSecurity.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar PrintableContentEnum;\n(function (PrintableContentEnum) {\n PrintableContentEnum[\"productListTab\"] = \"productListTab\";\n PrintableContentEnum[\"imagesTab\"] = \"imagesTab\";\n PrintableContentEnum[\"securityTab\"] = \"securityTab\";\n PrintableContentEnum[\"customPrintContent\"] = \"customPrintContent\";\n})(PrintableContentEnum || (PrintableContentEnum = {}));\nexports.default = PrintableContentEnum;\n//# sourceMappingURL=PrintableContentEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SummaryPageTabEnum;\n(function (SummaryPageTabEnum) {\n SummaryPageTabEnum[\"productList\"] = \"productList\";\n SummaryPageTabEnum[\"images\"] = \"images\";\n SummaryPageTabEnum[\"security\"] = \"security\";\n SummaryPageTabEnum[\"customTab1\"] = \"customTab1\";\n SummaryPageTabEnum[\"customTab2\"] = \"customTab2\";\n SummaryPageTabEnum[\"customTab3\"] = \"customTab3\";\n SummaryPageTabEnum[\"customTab4\"] = \"customTab4\";\n SummaryPageTabEnum[\"customTab5\"] = \"customTab5\";\n})(SummaryPageTabEnum || (SummaryPageTabEnum = {}));\nexports.default = SummaryPageTabEnum;\n//# sourceMappingURL=SummaryPageTabEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass SummaryPageCustomTabsUtility {\n /**\n * @param customTabButtons\n * @throws Error if customTabButtons has more than 5 items.\n */\n static getNumberOfCustomTabsToShow(customTabButtons) {\n var _a;\n const buttons = (_a = customTabButtons === null || customTabButtons === void 0 ? void 0 : customTabButtons.length) !== null && _a !== void 0 ? _a : 0;\n if (buttons > 5) {\n console.error('Maximum five custom tabs are allowed');\n return 5;\n }\n return buttons;\n }\n static getCustomTabSlots(numberOfCustomTabs) {\n const slots = [];\n for (let n = 1; n <= numberOfCustomTabs; n++) {\n slots.push((0, web_component_1.html) ``);\n }\n return slots;\n }\n}\nexports.default = SummaryPageCustomTabsUtility;\n//# sourceMappingURL=SummaryPageCustomTabsUtility.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nclass SummaryPageTabsStyle {\n static getStyle(options) {\n const { spacing, color } = options.theme;\n const hiddenSkapaTabsStyle = options.hideSkapaTabsOnPrint\n ? (0, web_component_1.css) `\n\t\t\t\t\tskapa-tabs {\n\t\t\t\t\t\tdisplay: none;\n\t\t\t\t\t}\n\t\t\t `\n : null;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\n\t\t\t.contentToPrint {\n\t\t\t\tposition: fixed;\n\t\t\t\tvisibility: hidden;\n\t\t\t}\n\n\t\t\tslot[name='panels'] {\n\t\t\t\tscroll-margin-top: ${spacing.space250 / 16}rem;\n\t\t\t}\n\n\t\t\tskapa-tabs > [role='tabpanel'] {\n\t\t\t\tscroll-margin-top: ${(spacing.space300 * 2) / 16}rem;\n\t\t\t}\n\n\t\t\t.imageGrid {\n\t\t\t\tdisplay: grid;\n\t\t\t\tgrid-template-columns: 1fr 1fr;\n\t\t\t\trow-gap: ${spacing.space200 / 16}rem;\n\t\t\t\tcolumn-gap: ${spacing.space300 / 16}rem;\n\t\t\t}\n\n\t\t\t.avoidBreak {\n\t\t\t\tbreak-inside: avoid;\n\t\t\t}\n\n\t\t\t@media print {\n\t\t\t\t${hiddenSkapaTabsStyle !== null && hiddenSkapaTabsStyle !== void 0 ? hiddenSkapaTabsStyle : ''}\n\n\t\t\t\t.contentToPrint {\n\t\t\t\t\tposition: relative;\n\t\t\t\t\tvisibility: visible;\n\t\t\t\t}\n\n\t\t\t\t.subheader {\n\t\t\t\t\tfont-weight: bold;\n\t\t\t\t\tcolor: ${color.text.dark};\n\t\t\t\t\tmargin: 0;\n\t\t\t\t\tmargin-bottom: ${spacing.space50 / 16}rem;\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = SummaryPageTabsStyle;\n//# sourceMappingURL=SummaryPageTabsStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst component_product_row_1 = require(\"@inter-ikea-kompis/component-product-row\");\nconst component_product_row_2 = require(\"@inter-ikea-kompis/component-product-row\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/tabs-webc\");\nrequire(\"@ingka/image-webc\");\nrequire(\"@ingka/icon-store/warning-triangle\");\nrequire(\"../summary-page-product-list/SummaryPageProductList\");\nrequire(\"../summary-page-images/SummaryPageImages\");\nrequire(\"../summary-page-security/SummaryPageSecurity\");\nconst PrintableContentEnum_1 = __importDefault(require(\"../../enums/PrintableContentEnum\"));\nconst SummaryPageTabEnum_1 = __importDefault(require(\"../../enums/SummaryPageTabEnum\"));\nconst SummaryPageCustomTabsUtility_1 = __importDefault(require(\"../../utilities/SummaryPageCustomTabsUtility\"));\nconst SummaryPageTabsStyle_1 = __importDefault(require(\"./SummaryPageTabsStyle\"));\n/**\n * @event storeSelectorChange Triggered when the selected store changes.\n * @event sortListChange Triggered when the selected way of sorting changes.\n * @event modalOpen Triggered when a sheet is opened.\n * @event modalClose Triggered when the user closes a sheet.\n * @event tabChange Triggered when the selected tab changes.\n * @event selectedImageIndexChange Triggered when the selected image changes in the \"Images\" tab.\n * @event collectProduct Triggered when a product is collected.\n * @event homeDeliveryStartOverClick User clicks on the start over link or the back button.\n * @event homeDeliveryForgetClick User clicks on the forget link from Home Delivery.\n * @event homeDeliveryInput Triggered when user writes a zip code.\n * @event homeDeliverySubmitButtonClick User clicks the Check availability button.\n * @event productListRemove Triggered when the remove button is clicked on a product in product list.\n * @event productListExpand Triggered when included shopping products in product list gets expanded.\n */\nlet SummaryPageTabs = class SummaryPageTabs extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // A list of store availability objects.\n this.storeAvailabilities = null;\n // A list of stores, when left empty the store selector will be hidden\n this.stores = null;\n // The storeId of the selected store\n this.storeId = null;\n // Controls how measurements should be shown in the Product list tab\n this.productMeasures = component_product_row_2.ProductRowProductMeasureEnum.none;\n // Disables outgoing links. Should be true for kiosks.\n this.disableLinks = false;\n // The currently visible sheet.\n this.visibleModal = null;\n // A list of images used in the \"Images\" tab\n this.images = null;\n // An object with information for the security tab\n this.securityInformation = null;\n // A collection of props used for the home delivery availability in product list. For more info about the props check the HomeDelivery component.\n this.homeDelivery = null;\n // Whether to show the collect checkbox in the product list or not.\n this.collectableProducts = false;\n // A list of product ids that are collected.\n this.collectedProducts = null;\n // Show text describing the color and/or material of the product.\n this.showDesignText = false;\n // A list of sections used in the product list.\n this.productListSections = null;\n // Defines optional custom tab buttons. Up to five tabs are supported.\n this.customTabButtons = null;\n // Highest heading on the Summary page will be h2 as opposed to h1. Set to true if planner is e.g. used in an iframe with an h1 header outside of the planner.\n this.startHeadingsAtH2 = false;\n // A list of included products within SPR products. Must be set (if applicable) for total package weight.\n this.includedProductsWithinSprs = null;\n // A list of product item numbers that can be removed in the product list.\n this.productListRemovable = null;\n // Sets the default sorting of the product list.\n this.defaultSortBy = null;\n // A sorted list of content to include in the print layout. When not set, the currently shown tab is printed. To include custom content in the print, the content must also be included as the slot \"custom-print-content\". E.g. ['productListTab', 'imagesTab', 'securityTab', 'customPrintContent'].\n this.contentToPrint = null;\n // Layout for summary page. NOTE: ProductRowLayoutEnum.compactPrint should only be used during print. Make sure SPR's has their child articles in includedProductsWithinSprs, since SPR's are not visible in compactPrint.\n this.pickingListPrintLayout = null;\n // Auto id for the tabs component\n this.tabsAutoId = 'summary-page-tabs';\n // Keeps state of selected tab.\n this.selectedTab = `${this.tabsAutoId}-tab-0`;\n this.selectedTabName = SummaryPageTabEnum_1.default.productList;\n this.numberOfCustomTabs = 0;\n }\n render() {\n // We want translations to be required, but since both props to provide translations are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslations()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) ` \n\t\t\t${this.getTabs()}${this.getContentToPrint()}`;\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('customTabButtons')) {\n this.numberOfCustomTabs = SummaryPageCustomTabsUtility_1.default.getNumberOfCustomTabsToShow(this.customTabButtons);\n }\n return true;\n }\n hasTranslations() {\n return !!this.translations || !!this.localizedInformation;\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n showImagesTab() {\n var _a;\n return !!((_a = this.images) === null || _a === void 0 ? void 0 : _a.length);\n }\n showSecurityTab() {\n return !!this.securityInformation;\n }\n getTabName(index) {\n const tabsInOrder = [SummaryPageTabEnum_1.default.productList];\n if (this.showImagesTab()) {\n tabsInOrder.push(SummaryPageTabEnum_1.default.images);\n }\n if (this.showSecurityTab()) {\n tabsInOrder.push(SummaryPageTabEnum_1.default.security);\n }\n for (let n = 1; n <= this.numberOfCustomTabs; n++) {\n tabsInOrder.push(SummaryPageTabEnum_1.default[`customTab${n}`]);\n }\n return tabsInOrder[index];\n }\n getCustomTabs() {\n var _a, _b;\n const tabs = [];\n for (let n = 1; n <= this.numberOfCustomTabs; n++) {\n tabs.push((0, web_component_1.html) `\n\t\t\t\t\n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t`);\n }\n return tabs;\n }\n getTabs() {\n return (0, web_component_1.html) ` {\n this.selectedTab = `${this.tabsAutoId}-tab-${targetIndex}`;\n this.selectedTabName = this.getTabName(targetIndex);\n const tabName = this.getTabName(targetIndex);\n this.dispatchEvent(new CustomEvent('tabChange', {\n bubbles: true,\n detail: { selectedTab: tabName }\n }));\n this.requestUpdate();\n }}\"\n\t\t>\n\t\t\t\n\t\t\t
    \n\t\t\t\t${this.getProductListTab({ pickingListPrintLayout: component_product_row_1.ProductRowLayoutEnum.default })}\n\t\t\t
    \n\t\t\t${this.showImagesTab()\n ? (0, web_component_1.html) `\n\t\t\t\t\t\t\n\t\t\t\t\t\t
    ${this.getImagesTab()}
    \n\t\t\t\t `\n : ''}\n\t\t\t${this.showSecurityTab()\n ? (0, web_component_1.html) `\n\t\t\t\t\t\t\n\t\t\t\t\t\t
    ${this.getSecurityTab()}
    \n\t\t\t\t `\n : ''}\n\t\t\t${this.getCustomTabs()}\n\t\t`;\n }\n getProductListTab(options) {\n return (0, web_component_1.html) ` {\n this.dispatchEvent(new CustomEvent('modalOpen', { bubbles: true, detail: event.detail }));\n }}\"\n\t\t\t@modalClose=\"${(event) => this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: event.detail }))}\"\n\t\t\t@storeSelectorChange=\"${({ detail }) => {\n this.dispatchEvent(new CustomEvent('storeSelectorChange', { bubbles: true, detail }));\n }}\"\n\t\t\t@sortListChange=\"${({ detail }) => this.dispatchEvent(new CustomEvent('sortListChange', {\n bubbles: true,\n detail\n }))}\"\n\t\t\t@homeDeliverySubmitButtonClick=\"${() => {\n this.dispatchEvent(new CustomEvent('homeDeliverySubmitButtonClick', { bubbles: true }));\n }}\"\n\t\t\t@homeDeliveryForgetClick=\"${(event) => {\n this.dispatchEvent(new CustomEvent('homeDeliveryForgetClick', {\n bubbles: true,\n detail: Object.assign({}, event.detail)\n }));\n }}\"\n\t\t\t@homeDeliveryStartOverClick=\"${(event) => {\n this.dispatchEvent(new CustomEvent('homeDeliveryStartOverClick', {\n bubbles: true,\n detail: Object.assign({}, event.detail)\n }));\n }}\"\n\t\t\t@homeDeliveryInput=\"${(event) => {\n this.dispatchEvent(new CustomEvent('homeDeliveryInput', { bubbles: true, detail: Object.assign({}, event.detail) }));\n }}\"\n\t\t\t@collectProduct=\"${(event) => {\n this.dispatchEvent(new CustomEvent('collectProduct', { bubbles: true, detail: event.detail }));\n }}\"\n\t\t\t@productListRemove=\"${(event) => {\n this.dispatchEvent(new CustomEvent('productListRemove', { bubbles: true, detail: event.detail }));\n }}\"\n\t\t\t@productListExpand=\"${(event) => {\n this.dispatchEvent(new CustomEvent('productListExpand', { bubbles: true, detail: event.detail }));\n }}\"\n\t\t>\n\t\t`;\n }\n getImagesTab() {\n return this.selectedTabName === SummaryPageTabEnum_1.default.images\n ? (0, web_component_1.html) ` {\n this.dispatchEvent(new CustomEvent('selectedImageIndexChange', {\n bubbles: true,\n detail: { selectedIndex: detail.selectedIndex }\n }));\n }}\"\n\t\t\t >`\n : null;\n }\n getSecurityTab() {\n if (!this.securityInformation) {\n return null;\n }\n return (0, web_component_1.html) ``;\n }\n getContentToPrint() {\n var _a;\n if (!((_a = this.contentToPrint) === null || _a === void 0 ? void 0 : _a.length)) {\n return null;\n }\n const uniqueContentToPrint = this.contentToPrint.filter((contentToPrint, index, array) => array.indexOf(contentToPrint) === index);\n return (0, web_component_1.html) `
    \n\t\t\t${uniqueContentToPrint.map((contentToPrint) => this.getContentToPrintSection(contentToPrint))}\n\t\t
    `;\n }\n getContentToPrintSection(printableContent) {\n const header = (0, web_component_1.html) `

    \n\t\t\t${this.getHeaderText(printableContent)}\n\t\t

    `;\n switch (printableContent) {\n case PrintableContentEnum_1.default.productListTab:\n return (0, web_component_1.html) `
    \n\t\t\t\t\t${header}${this.getSubHeader()}${this.getProductListTab({\n pickingListPrintLayout: this.pickingListPrintLayout\n })}\n\t\t\t\t
    `;\n case PrintableContentEnum_1.default.imagesTab:\n return this.showImagesTab()\n ? (0, web_component_1.html) `
    ${header}${this.getImageGrid()}
    `\n : null;\n case PrintableContentEnum_1.default.securityTab:\n return this.showSecurityTab()\n ? (0, web_component_1.html) `
    ${header}${this.getSecurityTab()}
    `\n : null;\n case PrintableContentEnum_1.default.customPrintContent:\n return (0, web_component_1.html) `
    `;\n }\n }\n getHeaderText(printableContent) {\n switch (printableContent) {\n case PrintableContentEnum_1.default.productListTab:\n return this.getTranslations().summaryPageProductListTab;\n case PrintableContentEnum_1.default.imagesTab:\n return this.getTranslations().summaryPageImagesTab;\n case PrintableContentEnum_1.default.securityTab:\n return this.getTranslations().summaryPageSecurityTab;\n default:\n return null;\n }\n }\n getSubHeader() {\n return (0, web_component_1.html) `

    \n\t\t\t${this.getTranslations().pickingListHeader}\n\t\t

    `;\n }\n getImageGrid() {\n var _a, _b;\n if (((_a = this.images) === null || _a === void 0 ? void 0 : _a.length) === 1) {\n return (0, web_component_1.html) `\n\t\t\t\t\"\"\n\t\t\t`;\n }\n return (0, web_component_1.html) `
    \n\t\t\t${(_b = this.images) === null || _b === void 0 ? void 0 : _b.map(({ src }) => (0, web_component_1.html) `\n\t\t\t\t\t\n\t\t\t\t\t\t\"\"\n\t\t\t\t\t\n\t\t\t\t`)}\n\t\t
    `;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SummaryPageTabs.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageTabs.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageTabs.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageTabs.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array, required: true })\n], SummaryPageTabs.prototype, \"shoppingProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array })\n], SummaryPageTabs.prototype, \"storeAvailabilities\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array })\n], SummaryPageTabs.prototype, \"stores\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageTabs.prototype, \"storeId\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageTabs.prototype, \"productMeasures\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageTabs.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageTabs.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array })\n], SummaryPageTabs.prototype, \"images\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageTabs.prototype, \"securityInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, synchronous: true })\n], SummaryPageTabs.prototype, \"homeDelivery\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageTabs.prototype, \"collectableProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array })\n], SummaryPageTabs.prototype, \"collectedProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageTabs.prototype, \"showDesignText\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array })\n], SummaryPageTabs.prototype, \"productListSections\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageTabs.prototype, \"customTabButtons\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageTabs.prototype, \"startHeadingsAtH2\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array })\n], SummaryPageTabs.prototype, \"includedProductsWithinSprs\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array })\n], SummaryPageTabs.prototype, \"productListRemovable\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageTabs.prototype, \"defaultSortBy\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageTabs.prototype, \"contentToPrint\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageTabs.prototype, \"pickingListPrintLayout\", void 0);\nSummaryPageTabs = __decorate([\n (0, web_component_1.customElement)('kompis-summary-page-tabs')\n], SummaryPageTabs);\nexports.default = SummaryPageTabs;\n//# sourceMappingURL=SummaryPageTabs.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SummaryPageConfigurationMeasureEnum;\n(function (SummaryPageConfigurationMeasureEnum) {\n SummaryPageConfigurationMeasureEnum[\"short\"] = \"short\";\n SummaryPageConfigurationMeasureEnum[\"long\"] = \"long\";\n})(SummaryPageConfigurationMeasureEnum || (SummaryPageConfigurationMeasureEnum = {}));\nexports.default = SummaryPageConfigurationMeasureEnum;\n//# sourceMappingURL=SummaryPageConfigurationMeasureEnum.js.map","!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports.bowser=t():e.bowser=t()}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\"a\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\"\",r(r.s=90)}({17:function(e,t,r){\"use strict\";t.__esModule=!0,t.default=void 0;var n=r(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var r=t.match(e);return r&&r.length>0&&r[1]||\"\"},e.getSecondMatch=function(e,t){var r=t.match(e);return r&&r.length>1&&r[2]||\"\"},e.matchAndReturnConst=function(e,t,r){if(e.test(t))return r},e.getWindowsVersionName=function(e){switch(e){case\"NT\":return\"NT\";case\"XP\":return\"XP\";case\"NT 5.0\":return\"2000\";case\"NT 5.1\":return\"XP\";case\"NT 5.2\":return\"2003\";case\"NT 6.0\":return\"Vista\";case\"NT 6.1\":return\"7\";case\"NT 6.2\":return\"8\";case\"NT 6.3\":return\"8.1\";case\"NT 10.0\":return\"10\";default:return}},e.getMacOSVersionName=function(e){var t=e.split(\".\").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return\"Leopard\";case 6:return\"Snow Leopard\";case 7:return\"Lion\";case 8:return\"Mountain Lion\";case 9:return\"Mavericks\";case 10:return\"Yosemite\";case 11:return\"El Capitan\";case 12:return\"Sierra\";case 13:return\"High Sierra\";case 14:return\"Mojave\";case 15:return\"Catalina\";default:return}},e.getAndroidVersionName=function(e){var t=e.split(\".\").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?\"Cupcake\":1===t[0]&&t[1]>=6?\"Donut\":2===t[0]&&t[1]<2?\"Eclair\":2===t[0]&&2===t[1]?\"Froyo\":2===t[0]&&t[1]>2?\"Gingerbread\":3===t[0]?\"Honeycomb\":4===t[0]&&t[1]<1?\"Ice Cream Sandwich\":4===t[0]&&t[1]<4?\"Jelly Bean\":4===t[0]&&t[1]>=4?\"KitKat\":5===t[0]?\"Lollipop\":6===t[0]?\"Marshmallow\":7===t[0]?\"Nougat\":8===t[0]?\"Oreo\":9===t[0]?\"Pie\":void 0},e.getVersionPrecision=function(e){return e.split(\".\").length},e.compareVersions=function(t,r,n){void 0===n&&(n=!1);var i=e.getVersionPrecision(t),s=e.getVersionPrecision(r),a=Math.max(i,s),o=0,u=e.map([t,r],(function(t){var r=a-e.getVersionPrecision(t),n=t+new Array(r+1).join(\".0\");return e.map(n.split(\".\"),(function(e){return new Array(20-e.length).join(\"0\")+e})).reverse()}));for(n&&(o=a-Math.min(i,s)),a-=1;a>=o;){if(u[0][a]>u[1][a])return 1;if(u[0][a]===u[1][a]){if(a===o)return 0;a-=1}else if(u[0][a]1?i-1:0),a=1;a0){var a=Object.keys(r),u=o.default.find(a,(function(e){return t.isOS(e)}));if(u){var d=this.satisfies(r[u]);if(void 0!==d)return d}var c=o.default.find(a,(function(e){return t.isPlatform(e)}));if(c){var f=this.satisfies(r[c]);if(void 0!==f)return f}}if(s>0){var l=Object.keys(i),h=o.default.find(l,(function(e){return t.isBrowser(e,!0)}));if(void 0!==h)return this.compareVersion(i[h])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var r=this.getBrowserName().toLowerCase(),n=e.toLowerCase(),i=o.default.getBrowserTypeByAlias(n);return t&&i&&(n=i.toLowerCase()),n===r},t.compareVersion=function(e){var t=[0],r=e,n=!1,i=this.getBrowserVersion();if(\"string\"==typeof i)return\">\"===e[0]||\"<\"===e[0]?(r=e.substr(1),\"=\"===e[1]?(n=!0,r=e.substr(2)):t=[],\">\"===e[0]?t.push(1):t.push(-1)):\"=\"===e[0]?r=e.substr(1):\"~\"===e[0]&&(n=!0,r=e.substr(1)),t.indexOf(o.default.compareVersions(i,r,n))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=d,e.exports=t.default},92:function(e,t,r){\"use strict\";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n};var s=/version\\/(\\d+(\\.?_?\\d+)+)/i,a=[{test:[/googlebot/i],describe:function(e){var t={name:\"Googlebot\"},r=i.default.getFirstMatch(/googlebot\\/(\\d+(\\.\\d+))/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/opera/i],describe:function(e){var t={name:\"Opera\"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:opera)[\\s/](\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\\/|opios/i],describe:function(e){var t={name:\"Opera\"},r=i.default.getFirstMatch(/(?:opr|opios)[\\s/](\\S+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:\"Samsung Internet for Android\"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\\s/](\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe:function(e){var t={name:\"NAVER Whale Browser\"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:whale)[\\s/](\\d+(?:\\.\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:\"MZ Browser\"},r=i.default.getFirstMatch(/(?:MZBrowser)[\\s/](\\d+(?:\\.\\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/focus/i],describe:function(e){var t={name:\"Focus\"},r=i.default.getFirstMatch(/(?:focus)[\\s/](\\d+(?:\\.\\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/swing/i],describe:function(e){var t={name:\"Swing\"},r=i.default.getFirstMatch(/(?:swing)[\\s/](\\d+(?:\\.\\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/coast/i],describe:function(e){var t={name:\"Opera Coast\"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:coast)[\\s/](\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opt\\/\\d+(?:.?_?\\d+)+/i],describe:function(e){var t={name:\"Opera Touch\"},r=i.default.getFirstMatch(/(?:opt)[\\s/](\\d+(\\.?_?\\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe:function(e){var t={name:\"Yandex Browser\"},r=i.default.getFirstMatch(/(?:yabrowser)[\\s/](\\d+(\\.?_?\\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:\"UC Browser\"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:ucbrowser)[\\s/](\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:\"Maxthon\"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\\s/](\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe:function(e){var t={name:\"Epiphany\"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:epiphany)[\\s/](\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe:function(e){var t={name:\"Puffin\"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:puffin)[\\s/](\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe:function(e){var t={name:\"Sleipnir\"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:sleipnir)[\\s/](\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe:function(e){var t={name:\"K-Meleon\"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:k-meleon)[\\s/](\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe:function(e){var t={name:\"WeChat\"},r=i.default.getFirstMatch(/(?:micromessenger)[\\s/](\\d+(\\.?_?\\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?\"QQ Browser Lite\":\"QQ Browser\"},r=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\\d+(\\.?_?\\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe:function(e){var t={name:\"Internet Explorer\"},r=i.default.getFirstMatch(/(?:msie |rv:)(\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\\sedg\\//i],describe:function(e){var t={name:\"Microsoft Edge\"},r=i.default.getFirstMatch(/\\sedg\\/(\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:\"Microsoft Edge\"},r=i.default.getSecondMatch(/edg([ea]|ios)\\/(\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe:function(e){var t={name:\"Vivaldi\"},r=i.default.getFirstMatch(/vivaldi\\/(\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe:function(e){var t={name:\"SeaMonkey\"},r=i.default.getFirstMatch(/seamonkey\\/(\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe:function(e){var t={name:\"Sailfish\"},r=i.default.getFirstMatch(/sailfish\\s?browser\\/(\\d+(\\.\\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe:function(e){var t={name:\"Amazon Silk\"},r=i.default.getFirstMatch(/silk\\/(\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe:function(e){var t={name:\"PhantomJS\"},r=i.default.getFirstMatch(/phantomjs\\/(\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe:function(e){var t={name:\"SlimerJS\"},r=i.default.getFirstMatch(/slimerjs\\/(\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\\bbb\\d+/i,/rim\\stablet/i],describe:function(e){var t={name:\"BlackBerry\"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/blackberry[\\d]+\\/(\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:\"WebOS Browser\"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\\/(\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe:function(e){var t={name:\"Bada\"},r=i.default.getFirstMatch(/dolfin\\/(\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe:function(e){var t={name:\"Tizen\"},r=i.default.getFirstMatch(/(?:tizen\\s?)?browser\\/(\\d+(\\.?_?\\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe:function(e){var t={name:\"QupZilla\"},r=i.default.getFirstMatch(/(?:qupzilla)[\\s/](\\d+(\\.?_?\\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:\"Firefox\"},r=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\\s/](\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe:function(e){var t={name:\"Electron\"},r=i.default.getFirstMatch(/(?:electron)\\/(\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:\"Miui\"},r=i.default.getFirstMatch(/(?:MiuiBrowser)[\\s/](\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe:function(e){var t={name:\"Chromium\"},r=i.default.getFirstMatch(/(?:chromium)[\\s/](\\d+(\\.?_?\\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:\"Chrome\"},r=i.default.getFirstMatch(/(?:chrome|crios|crmo)\\/(\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe:function(e){var t={name:\"Google Search\"},r=i.default.getFirstMatch(/(?:GSA)\\/(\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t={name:\"Android Browser\"},r=i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe:function(e){var t={name:\"PlayStation 4\"},r=i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:\"Safari\"},r=i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search(\"\\\\(\")?/^(.*)\\/(.*)[ \\t]\\((.*)/:/^(.*)\\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=a,e.exports=t.default},93:function(e,t,r){\"use strict\";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},s=r(18);var a=[{test:[/Roku\\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\\/DVP-(\\d+\\.\\d+)/i,e);return{name:s.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\\s?(\\d+(\\.\\d+)*)/i,e);return{name:s.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \\d\\d?.\\d)?)/i,e),r=i.default.getWindowsVersionName(t);return{name:s.OS_MAP.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\\//],describe:function(e){var t={name:s.OS_MAP.iOS},r=i.default.getSecondMatch(/(Version\\/)(\\d[\\d.]+)/,e);return r&&(t.version=r),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\\d+(\\.?_?\\d+)+)/i,e).replace(/[_\\s]/g,\".\"),r=i.default.getMacOSVersionName(t),n={name:s.OS_MAP.MacOS,version:t};return r&&(n.versionName=r),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\\d+([_\\s]\\d+)*) like mac os x/i,e).replace(/[_\\s]/g,\".\");return{name:s.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t=i.default.getFirstMatch(/android[\\s/-](\\d+(\\.\\d+)*)/i,e),r=i.default.getAndroidVersionName(t),n={name:s.OS_MAP.Android,version:t};return r&&(n.versionName=r),n}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\\/(\\d+(\\.\\d+)*)/i,e),r={name:s.OS_MAP.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\\bbb\\d+/i,/rim\\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\\stablet\\sos\\s(\\d+(\\.\\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\\d+\\/(\\d+([_\\s]\\d+)*)/i,e)||i.default.getFirstMatch(/\\bbb(\\d+)/i,e);return{name:s.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\\/(\\d+(\\.\\d+)*)/i,e);return{name:s.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\\s](\\d+(\\.\\d+)*)/i,e);return{name:s.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:s.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:s.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\\s](\\d+(\\.\\d+)*)/i,e);return{name:s.OS_MAP.PlayStation4,version:t}}}];t.default=a,e.exports=t.default},94:function(e,t,r){\"use strict\";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},s=r(18);var a=[{test:[/googlebot/i],describe:function(){return{type:\"bot\",vendor:\"Google\"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&\"Nova\",r={type:s.PLATFORMS_MAP.mobile,vendor:\"Huawei\"};return t&&(r.model=t),r}},{test:[/nexus\\s*(?:7|8|9|10).*/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:\"Nexus\"}}},{test:[/ipad/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:\"Apple\",model:\"iPad\"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\\//],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:\"Apple\",model:\"iPad\"}}},{test:[/kftt build/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:\"Amazon\",model:\"Kindle Fire HD 7\"}}},{test:[/silk/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:\"Amazon\"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:s.PLATFORMS_MAP.mobile,vendor:\"Apple\",model:t}}},{test:[/nexus\\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:\"Nexus\"}}},{test:[/[^-]mobi/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return\"blackberry\"===e.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:\"BlackBerry\"}}},{test:function(e){return\"bada\"===e.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return\"windows phone\"===e.getBrowserName()},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:\"Microsoft\"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(\".\")[0]);return\"android\"===e.getOSName(!0)&&t>=3},describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(e){return\"android\"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return\"macos\"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop,vendor:\"Apple\"}}},{test:function(e){return\"windows\"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(e){return\"linux\"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(e){return\"playstation 4\"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}},{test:function(e){return\"roku\"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}}];t.default=a,e.exports=t.default},95:function(e,t,r){\"use strict\";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},s=r(18);var a=[{test:function(e){return\"microsoft edge\"===e.getBrowserName(!0)},describe:function(e){if(/\\sedg\\//i.test(e))return{name:s.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\\/(\\d+(\\.?_?\\d+)+)/i,e);return{name:s.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:s.ENGINE_MAP.Trident},r=i.default.getFirstMatch(/trident\\/(\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:s.ENGINE_MAP.Presto},r=i.default.getFirstMatch(/presto\\/(\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe:function(e){var t={name:s.ENGINE_MAP.Gecko},r=i.default.getFirstMatch(/gecko\\/(\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\\/537\\.36/i],describe:function(){return{name:s.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:s.ENGINE_MAP.WebKit},r=i.default.getFirstMatch(/webkit\\/(\\d+(\\.?_?\\d+)+)/i,e);return r&&(t.version=r),t}}];t.default=a,e.exports=t.default}})}));","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst bowser_1 = __importDefault(require(\"bowser\"));\n/**\n * Handles browser detection.\n */\nclass BrowserDetection {\n /**\n * Browser support detection.\n *\n * @param browserList Optional browser list in Bowser Format.\n * @returns Boolean value.\n */\n static hasSupport(browserList) {\n const browser = bowser_1.default.getParser(window.navigator.userAgent);\n return browser.satisfies(browserList);\n }\n /**\n * Gets current browser.\n *\n * @returns Current browser information.\n */\n static getBrowser() {\n const browser = bowser_1.default.getParser(window.navigator.userAgent);\n return browser.getBrowser();\n }\n /**\n * Gets current platform.\n *\n * @returns Current platform name.\n */\n static getPlatform() {\n const browser = bowser_1.default.parse(window.navigator.userAgent);\n return browser.platform.type;\n }\n}\nexports.default = BrowserDetection;\n//# sourceMappingURL=BrowserDetection.js.map","module.exports = '%3Csvg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"354px\" height=\"353px\" viewBox=\"0 0 354 353\" version=\"1.1\"%3E%3C!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch --%3E%3Ctitle%3Eillustrations empty state_empty_state_armchair2_mobile%3C/title%3E%3Cdesc%3ECreated with Sketch.%3C/desc%3E%3Cdefs%3E%3ClinearGradient x1=\"5.1175657%25\" y1=\"-1.23859192%25\" x2=\"91.5629322%25\" y2=\"96.7405476%25\" id=\"linearGradient-1\"%3E%3Cstop stop-color=\"%23686868\" offset=\"18%25\"/%3E%3Cstop stop-color=\"%23686868\" stop-opacity=\"0\" offset=\"81%25\"/%3E%3C/linearGradient%3E%3ClinearGradient x1=\"91.283293%25\" y1=\"1.80472004%25\" x2=\"6.41646489%25\" y2=\"99.3984267%25\" id=\"linearGradient-2\"%3E%3Cstop stop-color=\"%23686868\" offset=\"2%25\"/%3E%3Cstop stop-color=\"%23686868\" stop-opacity=\"0\" offset=\"85%25\"/%3E%3C/linearGradient%3E%3ClinearGradient x1=\"-10.0098828%25\" y1=\"50.0142202%25\" x2=\"108.753353%25\" y2=\"50.0142202%25\" id=\"linearGradient-3\"%3E%3Cstop stop-color=\"%23686868\" stop-opacity=\"0\" offset=\"4%25\"/%3E%3Cstop stop-color=\"%23686868\" offset=\"18%25\"/%3E%3Cstop stop-color=\"%23686868\" offset=\"82%25\"/%3E%3Cstop stop-color=\"%23686868\" stop-opacity=\"0\" offset=\"97%25\"/%3E%3C/linearGradient%3E%3ClinearGradient x1=\"48.9883223%25\" y1=\"87.7486009%25\" x2=\"44.9382588%25\" y2=\"76.4951356%25\" id=\"linearGradient-4\"%3E%3Cstop stop-color=\"%23F6EF76\" stop-opacity=\"0\" offset=\"0%25\"/%3E%3Cstop stop-color=\"%23F6EF76\" offset=\"100%25\"/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg id=\"Symbols\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\"%3E%3Cg id=\"Messaging-/-Full-Page-/-Empty-Page\" transform=\"translate(-150.000000, -67.000000)\"%3E%3Cg id=\"Group-2\" transform=\"translate(127.000000, 67.000000)\"%3E%3Cg id=\"illustrations-empty-state_empty_state_armchair2_mobile\" transform=\"translate(23.000000, 0.000000)\"%3E%3Cg id=\"bg\"%3E%3Cpath d=\"M344.832853,120.48503 L334.955362,120.48503 C332.66286,120.484001 330.784871,122.300614 330.716096,124.585749 L330.716096,124.860539 C330.784871,127.145674 332.66286,128.962286 334.955362,128.961257 L339.194629,128.961257 C340.709173,128.961257 342.108669,129.767023 342.865941,131.07503 C343.623213,132.383037 343.623213,133.994568 342.865941,135.302575 C342.108669,136.610582 340.709173,137.416347 339.194629,137.416347 L288.323434,137.416347 C285.982152,137.416347 284.084168,135.523611 284.084168,133.188802 C284.084168,130.853994 285.982152,128.961257 288.323434,128.961257 L294.682333,128.961257 C296.974835,128.962286 298.852825,127.145674 298.9216,124.860539 L298.9216,124.585749 C298.852825,122.300614 296.974835,120.484001 294.682333,120.48503 L284.084168,120.48503 C281.742886,120.48503 279.844902,118.592294 279.844902,116.257485 C279.844902,113.922676 281.742886,112.02994 284.084168,112.02994 L307.209365,112.02994 C308.344613,112.081413 309.453051,111.676191 310.285954,110.905203 C311.118858,110.134215 311.606478,109.062024 311.639398,107.929222 L311.639398,107.654431 C311.601239,106.517637 311.105337,105.444135 310.263723,104.676446 C309.422109,103.908757 308.305795,103.511655 307.166972,103.57485 L305.238106,103.57485 C302.896824,103.57485 300.99884,101.682114 300.99884,99.3473054 C300.99884,97.0124968 302.896824,95.1197605 305.238106,95.1197605 L334.022724,95.1197605 C306.063392,41.4415892 252.481914,5.78535127 192.046387,0.640433296 C131.61086,-4.50448468 72.7442528,21.5789704 36.0658981,69.754491 L74.219294,69.754491 C76.5605761,69.754491 78.4585602,71.6472273 78.4585602,73.9820359 C78.4585602,76.3168445 76.5605761,78.2095808 74.219294,78.2095808 L70.2555801,78.2095808 C69.1025693,78.1284566 67.9663379,78.5203578 67.1099726,79.2945425 C66.2536073,80.0687271 65.7513754,81.1580549 65.7195653,82.3102994 L65.7195653,82.5850898 C65.7570267,83.73361 66.2617094,84.8174366 67.1174216,85.5870433 C67.9731339,86.3566499 69.106136,86.745717 70.2555801,86.6646707 L93.2747956,86.6646707 C95.6160777,86.6646707 97.5140619,88.557407 97.5140619,90.8922156 C97.5140619,93.2270242 95.6160777,95.1197605 93.2747956,95.1197605 L31.8054356,95.1197605 C29.4641535,95.1197605 27.5661694,93.2270242 27.5661694,90.8922156 C27.5661694,88.557407 29.4641535,86.6646707 31.8054356,86.6646707 L31.508687,86.6646707 C32.6616978,86.7457949 33.7979292,86.3538937 34.6542945,85.579709 C35.5106598,84.8055244 36.0128917,83.7161966 36.0447018,82.5639521 L36.0447018,82.2891617 C36.0075342,81.1366907 35.4999287,80.0493674 34.6394903,79.2791095 C33.7790519,78.5088516 32.6404527,78.122505 31.4874906,78.2095808 L29.9825511,78.2095808 C-16.1956039,146.89862 -8.35814017,238.351941 48.8381638,298.230808 C106.034468,358.109675 197.252515,370.357667 268.293363,327.697406 C339.334211,285.037144 371.148371,198.90791 344.832853,120.48503 L344.832853,120.48503 Z\" id=\"Shape\" fill=\"%23F7F7F7\"/%3E%3Cpath d=\"M294.646707,78.2095808 C287.663966,79.0302219 286.990631,79.7016555 286.167665,86.6646707 C285.344699,79.7016555 284.671363,79.0302219 277.688623,78.2095808 C284.671363,77.3889398 285.344699,76.7175062 286.167665,69.754491 C286.990631,76.7175062 287.663966,77.3889398 294.646707,78.2095808 Z\" id=\"Shape\" fill=\"%23B8B9B9\"/%3E%3Cpath d=\"M114.467066,46.502994 C110.975696,46.9257485 110.651497,47.2490313 110.227545,50.7305389 C109.803593,47.2490313 109.479394,46.9257485 105.988024,46.502994 C109.479394,46.0802395 109.803593,45.7569567 110.227545,42.2754491 C110.626559,45.7569567 110.975696,46.0802395 114.467066,46.502994 Z\" id=\"Shape\" fill=\"%23B8B9B9\"/%3E%3Cpath d=\"M218.335329,101.461078 C214.843959,101.883832 214.51976,102.207115 214.095808,105.688623 C213.671856,102.207115 213.347658,101.883832 209.856287,101.461078 C213.347658,101.038323 213.671856,100.715041 214.095808,97.2335329 C214.494822,100.715041 214.843959,101.038323 218.335329,101.461078 Z\" id=\"Shape\" fill=\"%23B8B9B9\"/%3E%3Cpath d=\"M254.371257,38.0479042 C250.879887,38.4706587 250.555689,38.7939415 250.131737,42.2754491 C249.707784,38.7939415 249.383586,38.4706587 245.892216,38.0479042 C249.383586,37.6251497 249.707784,37.3018669 250.131737,33.8203593 C250.53075,37.3018669 250.879887,37.6251497 254.371257,38.0479042 Z\" id=\"Shape\" fill=\"%23B8B9B9\"/%3E%3Cpath d=\"M313.724551,158.532934 C310.233181,158.955689 309.908982,159.278971 309.48503,162.760479 C309.061078,159.278971 308.736879,158.955689 305.245509,158.532934 C308.736879,158.11018 309.061078,157.786897 309.48503,154.305389 C309.884044,157.786897 310.233181,158.11018 313.724551,158.532934 Z\" id=\"Shape\" fill=\"%23B8B9B9\"/%3E%3Cpath d=\"M55.1137725,145.850299 C48.1310321,146.67094 47.4576964,147.342374 46.6347305,154.305389 C45.8117647,147.342374 45.138429,146.67094 38.1556886,145.850299 C45.138429,145.029658 45.8117647,144.358225 46.6347305,137.39521 C47.4576964,144.358225 48.1310321,145.029658 55.1137725,145.850299 Z\" id=\"Shape\" fill=\"%23B8B9B9\"/%3E%3Cpath d=\"M169.580838,16.9101796 C162.598098,17.7308207 161.924762,18.4022543 161.101796,25.3652695 C160.278831,18.4022543 159.605495,17.7308207 152.622754,16.9101796 C159.605495,16.0895386 160.278831,15.418105 161.101796,8.45508982 C161.924762,15.418105 162.598098,16.0895386 169.580838,16.9101796 Z\" id=\"Shape\" fill=\"%23B8B9B9\"/%3E%3Cpath d=\"M131.42515,310.724551 C131.42515,308.389742 133.309143,306.497006 135.646987,306.497006 L222.592534,306.497006 C224.92419,306.497006 226.814371,308.394493 226.814371,310.724551 L226.814371,310.724551 C226.814371,313.059359 224.930378,314.952096 222.592534,314.952096 L135.646987,314.952096 C133.31533,314.952096 131.42515,313.054609 131.42515,310.724551 L131.42515,310.724551 Z\" id=\"Rectangle-path\" fill=\"%23111\" fill-rule=\"nonzero\" opacity=\"0.03\"/%3E%3C/g%3E%3Cg id=\"ufo\" transform=\"translate(133.544910, 29.592814)\"%3E%3Cpath d=\"M41.6956886,1.05688623 C26.4764406,1.05688623 14.1388024,13.3596724 14.1388024,28.5359281 L14.1388024,32.7634731 C14.1375922,38.8975414 16.2057504,44.8536887 20.0105389,49.6736527 L63.3808383,49.6736527 C67.1856268,44.8536887 69.2537851,38.8975414 69.2525749,32.7634731 L69.2525749,28.5359281 C69.2525749,21.2480331 66.3492684,14.2586313 61.1813497,9.10531126 C56.0134311,3.95199126 49.0042293,1.05688623 41.6956886,1.05688623 Z\" id=\"Shape\" fill=\"%23EBEBEB\"/%3E%3Cpath d=\"M41.6956886,1.05688623 C26.4764406,1.05688623 14.1388024,13.3596724 14.1388024,28.5359281 L14.1388024,32.7634731 C14.1375922,38.8975414 16.2057504,44.8536887 20.0105389,49.6736527 L63.3808383,49.6736527 C67.1856268,44.8536887 69.2537851,38.8975414 69.2525749,32.7634731 L69.2525749,28.5359281 C69.2525749,21.2480331 66.3492684,14.2586313 61.1813497,9.10531126 C56.0134311,3.95199126 49.0042293,1.05688623 41.6956886,1.05688623 Z\" id=\"Shape\" stroke=\"%23686868\"/%3E%3Cpath d=\"M67.2176048,24.3083832 L16.1525749,24.3083832 C11.9475395,24.3139438 7.91788944,25.9893689 4.95443889,28.9642809 C1.99098833,31.9391928 0.337808458,35.9685765 0.360359281,40.1616766 L0.360359281,45.1713174 C0.400494583,45.6969981 0.662444582,46.181005 1.08107784,46.502994 C4.59988024,43.5437126 21.4307784,41.3031138 41.6956886,41.3031138 C61.9605988,41.3031138 78.791497,43.5437126 82.3102994,46.502994 C82.7289327,46.181005 82.9908827,45.6969981 83.031018,45.1713174 L83.031018,40.1616766 C83.0535848,35.9649158 81.3975012,31.9323189 78.4294615,28.9567941 C75.4614218,25.9812692 71.426315,24.3083229 67.2176048,24.3083832 L67.2176048,24.3083832 Z\" id=\"Shape\" fill=\"%23EBEBEB\"/%3E%3Cpath d=\"M67.2176048,24.3083832 L16.1525749,24.3083832 C11.9475395,24.3139438 7.91788944,25.9893689 4.95443889,28.9642809 C1.99098833,31.9391928 0.337808458,35.9685765 0.360359281,40.1616766 L0.360359281,45.1713174 C0.400494583,45.6969981 0.662444582,46.181005 1.08107784,46.502994 C4.59988024,43.5437126 21.4307784,41.3031138 41.6956886,41.3031138 C61.9605988,41.3031138 78.791497,43.5437126 82.3102994,46.502994 C82.7289327,46.181005 82.9908827,45.6969981 83.031018,45.1713174 L83.031018,40.1616766 C83.0535848,35.9649158 81.3975012,31.9323189 78.4294615,28.9567941 C75.4614218,25.9812692 71.426315,24.3083229 67.2176048,24.3083832 L67.2176048,24.3083832 Z\" id=\"Shape\" stroke=\"%23686868\" stroke-linejoin=\"round\"/%3E%3Crect id=\"Rectangle-path\" stroke=\"%23686868\" stroke-width=\"0.5\" fill=\"%23F1E48F\" fill-rule=\"nonzero\" transform=\"translate(12.548982, 33.820359) rotate(90.000000) translate(-12.548982, -33.820359) \" x=\"9.36934132\" y=\"30.6497006\" width=\"6.35928144\" height=\"6.34131737\" rx=\"1.5\"/%3E%3Crect id=\"Rectangle-path\" stroke=\"%23686868\" stroke-width=\"0.5\" fill=\"%23F1E48F\" fill-rule=\"nonzero\" transform=\"translate(27.387305, 31.706587) rotate(90.000000) translate(-27.387305, -31.706587) \" x=\"24.2076647\" y=\"28.5359281\" width=\"6.35928144\" height=\"6.34131737\" rx=\"1.5\"/%3E%3Crect id=\"Rectangle-path\" stroke=\"%23686868\" stroke-width=\"0.5\" fill=\"%23F1E48F\" fill-rule=\"nonzero\" transform=\"translate(42.225629, 31.706587) rotate(90.000000) translate(-42.225629, -31.706587) \" x=\"39.045988\" y=\"28.5359281\" width=\"6.35928144\" height=\"6.34131737\" rx=\"1.5\"/%3E%3Crect id=\"Rectangle-path\" stroke=\"%23686868\" stroke-width=\"0.5\" fill=\"%23F1E48F\" fill-rule=\"nonzero\" transform=\"translate(57.063952, 31.706587) rotate(90.000000) translate(-57.063952, -31.706587) \" x=\"53.8843114\" y=\"28.5359281\" width=\"6.35928144\" height=\"6.34131737\" rx=\"1.5\"/%3E%3Crect id=\"Rectangle-path\" stroke=\"%23686868\" stroke-width=\"0.5\" fill=\"%23F1E48F\" fill-rule=\"nonzero\" transform=\"translate(71.902275, 33.820359) rotate(90.000000) translate(-71.902275, -33.820359) \" x=\"68.7226347\" y=\"30.6497006\" width=\"6.35928144\" height=\"6.34131737\" rx=\"1.5\"/%3E%3Cpath d=\"M83.0734132,46.502994 C83.0734132,49.3777246 64.5679042,51.7028743 41.7168862,51.7028743 C18.8658683,51.7028743 0.360359281,49.2931737 0.360359281,46.502994 C0.360359281,43.7128144 18.8658683,40.0137126 41.7168862,40.0137126 C64.5679042,40.0137126 83.0734132,43.5437126 83.0734132,46.502994 Z\" id=\"Shape\" stroke=\"%23686868\" fill=\"%23B8B9B9\"/%3E%3C/g%3E%3Cg id=\"shine\" transform=\"translate(82.670659, 71.868263)\"%3E%3Cpolygon id=\"Shape\" fill=\"url(%23linearGradient-1)\" fill-rule=\"nonzero\" points=\"178.335449 187.956647 180.243234 187.174551 166.952335 155.531377 164.917365 156.05982\"/%3E%3Cpolygon id=\"Shape\" fill=\"url(%23linearGradient-2)\" fill-rule=\"nonzero\" points=\"1.92898204 239.046527 3.90035928 239.722934 19.4382036 194.044311 17.0216766 194.657305\"/%3E%3Cpath d=\"M103.423114,4.52347305 L103.083952,4.22754491 C100.076443,2.01795969 96.3823648,0.939820279 92.6547305,1.18371257 C87.8852695,1.18371257 83.7517365,2.47311377 81.8651497,4.5657485 L81.5683832,4.88281437 L16.9580838,194.657305 L19.3746108,194.023174 L83.3701796,5.89742515 C84.7904192,4.31209581 88.394012,3.19179641 92.6123353,3.19179641 C95.8594006,2.96673576 99.0852763,3.86235425 101.748503,5.72832335 L164.980958,156.05982 L167.100719,155.531377 L103.592695,4.92508982 L103.423114,4.52347305 Z\" id=\"Shape\" fill=\"url(%23linearGradient-3)\" fill-rule=\"nonzero\"/%3E%3Cpath d=\"M103.423114,4.52347305 L103.083952,4.22754491 C100.076443,2.01795969 96.3823648,0.939820279 92.6547305,1.18371257 C87.8852695,1.18371257 83.7517365,2.47311377 81.8651497,4.5657485 L81.5683832,4.88281437 L16.9580838,194.657305 L19.3746108,194.023174 L83.3701796,5.89742515 C84.7904192,4.31209581 88.394012,3.19179641 92.6123353,3.19179641 C95.8594006,2.96673576 99.0852763,3.86235425 101.748503,5.72832335 L164.980958,156.05982 L167.100719,155.531377 L103.592695,4.92508982 L103.423114,4.52347305 Z\" id=\"Shape\" fill=\"%23686868\" fill-rule=\"nonzero\"/%3E%3Cg id=\"Group\" opacity=\"0.6\" transform=\"translate(0.000000, 2.113772)\" fill=\"url(%23linearGradient-4)\"%3E%3Cpath d=\"M102.363234,5.28443114 L102.257246,5.28443114 C102.245746,5.08178124 102.202843,4.88212964 102.13006,4.69257485 L101.939281,4.22754491 C100.900599,2.4097006 97.1698204,1.0357485 92.6971257,1.0357485 C87.4189222,1.0357485 83.137006,2.91700599 83.137006,5.26329341 L82.9250299,5.26329341 L1.08107784,246.550419 L184.419162,200.47018 L102.363234,5.28443114 Z\" id=\"Shape\"/%3E%3C/g%3E%3Cg id=\"Group\" opacity=\"0.5\" transform=\"translate(42.395210, 12.682635)\" stroke=\"%23E5BE60\" stroke-width=\"0.5\"%3E%3Cpath d=\"M10.725988,125.938563 L1.65341317,153.840359\" id=\"Shape\"/%3E%3Cpath d=\"M62.7661078,28.9375449 L69.3585629,48.0037725\" id=\"Shape\"/%3E%3Cpath d=\"M43.3067066,4.37550898 L41.3565269,12.6826347\" id=\"Shape\"/%3E%3Cpath d=\"M46.931497,46.4395808 L46.4439521,62.1660479\" id=\"Shape\"/%3E%3Cpath d=\"M102.850778,126.572695 L113.915928,155.615928\" id=\"Shape\"/%3E%3Cpath d=\"M56.3220359,1.56419162 L58.6961677,8.51850299\" id=\"Shape\"/%3E%3Cpath d=\"M33.7041916,38.4706587 L29.4222754,52.6117964\" id=\"Shape\"/%3E%3C/g%3E%3C/g%3E%3Cg id=\"product\" transform=\"translate(137.784431, 183.898204)\" fill-rule=\"nonzero\" stroke=\"%23686868\"%3E%3Cpath d=\"M78.4311377,42.3811377 L81.5683832,36.1666467 L87.9276647,21.6027545 C88.8179641,19.1507784 86.8677844,15.6841916 83.5609581,13.3801796 C72.2076711,6.3881588 59.3446347,2.19955276 46.0411976,1.16257485 C32.8707753,-0.192719708 19.5671927,1.65683221 7.27077844,6.55269461 C3.60359281,8.24371257 1.05988024,11.3086826 1.50502994,13.887485 L5.10862275,29.3391617 L7.08,36.0186826 L78.4311377,42.3811377 Z\" id=\"Shape\" fill=\"%23B8B9B9\"/%3E%3Cpath d=\"M5.49017964,65.1041916 L5.95652695,76.3705988 C5.97594861,76.6928189 6.22780708,76.9529354 6.55005988,76.9835928 L7.99149701,77.1104192 C8.32574296,77.1380965 8.62725297,76.910325 8.69101796,76.581976 L10.9379641,65.5269461 C10.9748206,65.3464259 10.9337697,65.1587734 10.8248681,65.0099594 C10.7159664,64.8611454 10.5492747,64.7649178 10.3656287,64.7448503 L6.12610778,64.3643713 C5.93980011,64.3688055 5.7641426,64.4519145 5.64286064,64.5930104 C5.52157868,64.7341063 5.46608003,64.9199177 5.49017964,65.1041916 Z\" id=\"Shape\" fill=\"%23B8B9B9\"/%3E%3Cpath d=\"M69.4009581,70.8113772 L69.8673054,82.0777844 C69.8867271,82.4000045 70.1385855,82.6601211 70.4608383,82.6907784 L71.9234731,82.8176048 C72.257719,82.8452821 72.559229,82.6175107 72.622994,82.2891617 L74.8699401,71.2552695 C74.9067966,71.0747493 74.8657458,70.8870968 74.7568441,70.7382828 C74.6479425,70.5894688 74.4812508,70.4932412 74.2976048,70.4731737 L70.0580838,70.0926946 C69.8722042,70.0918244 69.6946504,70.1694962 69.5694119,70.3064665 C69.4441734,70.4434369 69.3829675,70.6268908 69.4009581,70.8113772 L69.4009581,70.8113772 Z\" id=\"Shape\" fill=\"%23B8B9B9\"/%3E%3Cpath d=\"M56.3432335,60.6018563 L56.8731737,70.9593413 C56.8833651,71.2855258 57.1401568,71.5507374 57.4667066,71.5723353 L58.9505389,71.6991617 C59.2732063,71.7269745 59.5652914,71.5085295 59.6288623,71.1918563 L61.7486228,61.088024 C61.7927532,60.9067545 61.7546089,60.7153042 61.6443411,60.5646233 C61.5340733,60.4139425 61.3628679,60.3193165 61.1762874,60.3059281 L56.9367665,59.9254491 C56.7679681,59.9362949 56.6104579,60.0137523 56.4990729,60.1406898 C56.3876879,60.2676274 56.3316069,60.4335847 56.3432335,60.6018563 L56.3432335,60.6018563 Z\" id=\"Shape\" fill=\"%23B8B9B9\"/%3E%3Cpath d=\"M21.0492216,56.712515 L21.6215569,67.7464072 C21.6308497,68.1000603 21.9041664,68.3907744 22.257485,68.4228144 L23.6353293,68.5496407 C23.9937518,68.5900384 24.3242122,68.3520467 24.3984431,68.0000599 L26.6877844,57.2409581 L21.0492216,56.712515 Z\" id=\"Shape\" fill=\"%23B8B9B9\"/%3E%3Cpath d=\"M40.1270659,68.8667066 C47.6946108,69.5431138 61.7698204,70.5577246 66.1577246,69.9447305 C66.9312202,69.8372195 67.7187978,69.8948601 68.4682635,70.1138323 C70.1406657,70.551447 71.8514298,70.8275106 73.5768862,70.9382036 C77.4772455,71.2975449 78.579521,70.9382036 78.6431138,70.1561078 C78.7067066,69.374012 83.3065868,37.2235329 84.3664671,33.4821557 C85.4263473,29.7407784 87.694491,23.3783234 88.0972455,22.2791617 C88.5,21.18 88.6271856,17.9459281 84.3664671,17.5654491 C81.5177306,17.3062546 78.846041,18.9756685 77.8376048,21.6450299 C76.0358084,24.6254491 72.2202395,38.9779641 71.7326946,42.5079641 L71.0967665,46.968024 C70.6795572,49.9337242 68.0044537,52.0528903 65.0130539,51.7874251 L19.0778443,47.7078443 C16.0806915,47.4397022 13.8228578,44.8719263 13.948024,41.8738323 L14.1176048,37.371497 C14.265988,33.7992216 13.0577246,19.0028144 11.8282635,15.7476048 C11.3055786,12.9094794 8.92724098,10.7811032 6.04131737,10.5688623 C1.80179641,10.1883832 1.35664671,13.4013174 1.52622754,14.5427545 C1.69580838,15.6841916 2.81928144,22.3425749 3.20083832,26.2319162 C3.58239521,30.1212575 2.35293413,62.6310778 2.28934132,63.3497605 C2.2257485,64.0684431 3.24323353,64.6602994 7.14359281,65.0196407 C8.85331507,65.2182265 10.5781437,65.2536165 12.2946108,65.1253293 C13.0810985,65.0446805 13.8757975,65.1311301 14.6263473,65.378982 C18.7598802,66.7317964 32.0083832,68.1691617 39.5547305,68.8244311 L40.1270659,68.8667066 Z\" id=\"Shape\" fill=\"%23EBEBEB\"/%3E%3Cpath d=\"M67.2176048,52.6117964 C67.2176048,52.6117964 60.6463473,53.7320958 41.780479,52.0622156 C22.9146108,50.3923353 16.7461078,48.1094611 16.7461078,48.1094611 C14.8886269,47.8988722 13.5413263,46.2453403 13.7148503,44.3892216 L14.4567665,36.1243713 C14.6359227,34.2556178 16.2905347,32.8790982 18.1663473,33.0382635 C26.6469292,32.5679098 35.1512799,32.7516502 43.6034731,33.5878443 C52.0357666,34.2783289 60.4041133,35.5996331 68.6378443,37.5405988 C70.5118917,37.7192489 71.8923108,39.3691869 71.7326946,41.2397006 L70.9907784,49.5045509 C70.9104569,50.4183344 70.4658381,51.2617802 69.7565564,51.8458805 C69.0472748,52.4299809 68.1326373,52.7058962 67.2176048,52.6117964 Z\" id=\"Shape\" fill=\"%23EBEBEB\"/%3E%3C/g%3E%3Cg id=\"product_shine\" transform=\"translate(135.664671, 181.784431)\" fill=\"%23F1E48F\" fill-rule=\"nonzero\" opacity=\"0.3\"%3E%3Cg id=\"Group\"%3E%3Cpath d=\"M72.4958084,85.8825749 C71.6458466,85.7993093 70.9864669,85.105764 70.9483832,84.2549701 L70.5032335,73.3479042 L70.2912575,73.3479042 C69.8787096,73.223725 69.4503301,73.1596496 69.0194012,73.1576647 L68.4258683,73.1576647 C67.0606129,73.3091223 65.6869866,73.3726672 64.3135329,73.3479042 L62.8508982,73.3479042 L62.8508982,73.5804192 C62.6813521,74.3680445 61.9841336,74.9312842 61.1762874,74.9332335 L59.5440719,74.7852695 C58.7091744,74.704677 58.0548773,74.0343529 57.9966467,73.1999401 C51.3405988,72.904012 44.2817964,72.291018 42.1832335,72.1007784 L41.6320958,72.1007784 C39.2791617,71.8894012 33.3650299,71.3398204 27.5356886,70.5788623 C27.3042187,71.3192675 26.617624,71.8242007 25.8398802,71.825988 L24.3136527,71.6991617 C23.4362198,71.6168005 22.7512149,70.9067674 22.7026347,70.0292814 L22.7026347,69.754491 C20.5974145,69.4715536 18.5148665,69.0406809 16.4705389,68.4650898 C16.0128172,68.3116412 15.5331959,68.2331198 15.0502994,68.2325749 L14.5627545,68.2325749 L14.054012,68.2325749 L11.9342515,78.8014371 C11.7734079,79.5974613 11.0739526,80.1713368 10.2596407,80.1753892 L8.64862275,80.0485629 C7.79033349,79.975227 7.11939489,79.2790603 7.08,78.4209581 L6.6348503,67.7464072 C5.15101796,67.4927545 3.26443114,66.9008982 3.41281437,65.2732934 C3.41281437,65.0196407 4.68467066,32.2138922 4.32431138,28.3668263 C4.00634731,25.0059281 3.1160479,19.488982 2.77688623,17.417485 L2.60730539,16.9101796 C2.58607085,16.6569689 2.58607085,16.4024323 2.60730539,16.1492216 C2.18335329,13.1265269 4.72706587,9.80790419 8.96658683,7.69413174 C18.8562765,3.65919327 29.4641904,1.66728869 40.1482635,1.83898204 C42.8403593,1.83898204 45.5748503,1.96580838 48.2669461,2.19832335 C61.7683963,3.21215395 74.8232284,7.46927872 86.3166467,14.6061677 C88.9615746,16.248533 90.7748208,18.9414836 91.2980838,22.0043713 C91.5542925,22.8953401 91.5542925,23.8401688 91.2980838,24.7311377 L91.0649102,25.3652695 C90.3653892,27.3522156 88.5,32.615509 87.588503,35.9341317 C86.677006,39.2527545 82.0559281,70.8113772 81.9075449,72.4178443 C81.7591617,74.0243114 79.1730539,74.2779641 78.1767665,74.2779641 L77.985988,74.2779641 L75.8662275,84.6777246 C75.705384,85.4737487 75.0059286,86.0476242 74.1916168,86.0516766 L72.4958084,85.8825749 Z\" id=\"Shape\"/%3E%3Cpath d=\"M40.1270659,2.91700599 C42.691976,2.91700599 45.3840719,3.02269461 48.1609581,3.27634731 C61.4643951,4.31332522 74.3274315,8.50193126 85.6807186,15.4939521 C88.0966472,16.9688549 89.7575707,19.4108335 90.2382036,22.1946108 C90.4361287,22.8853803 90.4361287,23.6176137 90.2382036,24.3083832 C89.8566467,25.4075449 87.5673054,31.77 86.5074251,35.5113772 C85.4475449,39.2527545 80.8476647,71.445509 80.7840719,72.1853293 C80.720479,72.9251497 80.0845509,73.0942515 78.091976,73.0942515 L76.9897006,73.0942515 C77.0040719,73.171094 77.0040719,73.2499239 76.9897006,73.3267665 L74.7427545,84.3606587 C74.6826644,84.6645389 74.4174076,84.8849618 74.1068263,84.8891018 L74.1068263,84.8891018 L72.6441916,84.7622754 C72.3219388,84.7316181 72.0700803,84.4715015 72.0506587,84.1492814 L71.5843114,72.8828743 C71.5795842,72.7384626 71.6244556,72.5967714 71.711497,72.4812575 L70.6304192,72.2064671 C70.1213276,72.0548207 69.5931105,71.9765238 69.0617964,71.9739521 L68.3198802,71.9739521 C67.0037594,72.1187929 65.679915,72.1823273 64.3559281,72.1641916 L61.9817964,72.1641916 L61.7486228,73.2422156 C61.6872725,73.542238 61.4196958,73.7556947 61.1126946,73.749521 L61.1126946,73.749521 L59.6288623,73.6226946 C59.3023125,73.6010967 59.0455207,73.3358851 59.0353293,73.0097006 L59.0353293,72.058503 C53.3967665,71.825988 46.7407186,71.3186826 42.3104192,70.9170659 L41.7592814,70.9170659 C37.6469461,70.5577246 31.8388024,69.9658683 26.7513772,69.2683234 L26.5817964,70.0715569 C26.510782,70.3982119 26.2173786,70.6287253 25.8822754,70.6211377 L25.8822754,70.6211377 L24.5044311,70.4943114 C24.1511125,70.4622714 23.8777958,70.1715573 23.868503,69.8179042 L23.868503,68.8244311 C21.5279592,68.5224018 19.211679,68.0562164 16.9368862,67.4293413 C16.3756456,67.2469 15.7889915,67.1541566 15.1986826,67.1545509 L14.6051497,67.1545509 L13.2061078,67.1545509 C13.2451629,67.2783875 13.2451629,67.4111933 13.2061078,67.5350299 L10.9591617,78.5689222 C10.8990716,78.8728024 10.6338148,79.0932253 10.3232335,79.0973653 L10.3232335,79.0973653 L8.88179641,78.9705389 C8.5595436,78.9398815 8.30768514,78.679765 8.28826347,78.3575449 L7.82191617,67.0911377 C7.80534848,67.0073939 7.80534848,66.9212289 7.82191617,66.837485 C5.25700599,66.4781437 4.51508982,65.9497006 4.55748503,65.3578443 C4.59988024,64.765988 5.82934132,32.1293413 5.46898204,28.24 C5.10862275,24.3506587 3.9851497,17.6711377 3.79437126,16.5508383 C3.77283102,16.3329432 3.77283102,16.113464 3.79437126,15.8955689 L3.79437126,15.8955689 C3.34922156,13.3379042 5.91413174,10.2517964 9.56011976,8.56077844 C19.3178023,4.61678214 29.768909,2.66183677 40.2966467,2.81131737 L40.1270659,2.91700599 Z M40.2966467,0.69754491 C29.3887637,0.532993298 18.5619615,2.5901008 8.47904192,6.74293413 C3.87916168,8.85670659 1.01748503,12.6826347 1.48383234,16.1280838 C1.45964856,16.4164628 1.45964856,16.7063516 1.48383234,16.9947305 L1.58982036,17.6922754 C1.92898204,19.8060479 2.81928144,25.2384431 3.1160479,28.5570659 C3.41281437,31.8756886 2.31053892,63.7091018 2.2045509,65.2944311 C2.01377246,67.4082036 3.83676647,68.2748503 5.46898204,68.6976048 L5.87173653,78.5689222 C5.9342902,79.9854058 7.05973921,81.1259238 8.47904192,81.2111377 L9.92047904,81.3379641 L10.1748503,81.3379641 C11.4610599,81.3450164 12.5837884,80.4703625 12.8881437,79.2241916 L14.8383234,69.3317365 L14.965509,69.3317365 C15.3325611,69.3308393 15.6974398,69.3879135 16.0465868,69.5008383 C17.9020376,70.0412278 19.7932848,70.4509 21.7063473,70.7268263 C22.0637577,71.7938376 23.0205321,72.5487986 24.1440719,72.6503593 L25.5007186,72.7771856 L25.7550898,72.7771856 C26.6603902,72.7755957 27.5107098,72.3437858 28.0444311,71.6146108 C33.6617964,72.3332934 39.1943713,72.8405988 41.4413174,73.051976 L41.9924551,73.051976 C44.0062275,73.2210778 50.6198802,73.7917964 57.0639521,74.1088623 C57.4712316,75.0188402 58.3374315,75.6404195 59.3320958,75.7364671 L60.8159281,75.8632934 L61.0702994,75.8632934 C62.1283365,75.8556356 63.0900676,75.2490795 63.5504192,74.2991018 L64.2287425,74.2991018 C65.644984,74.3185028 67.0610263,74.2479007 68.4682635,74.0877246 L69.3797605,74.0877246 L69.8037126,84.1915569 C69.8617176,85.5782059 70.940182,86.7078465 72.3262275,86.8337725 L73.7888623,86.9605988 L74.1916168,86.9605988 C75.4778263,86.9676511 76.6005548,86.0929972 76.9049102,84.8468263 L78.8550898,75.2925749 C81.42,75.1446108 82.7978443,74.2145509 82.9674251,72.4812575 C83.137006,70.7479641 87.6520958,39.6120958 88.6271856,36.1877844 C89.6022754,32.7634731 91.3828743,27.7326946 92.0823952,25.7668862 L92.3155689,25.090479 C92.6602524,24.0382341 92.7042924,22.9110666 92.4427545,21.8352695 C91.8337352,18.4817591 89.8217832,15.5453815 86.9101796,13.7606587 C75.2730849,6.49006536 62.0430673,2.13845085 48.3517365,1.07802395 C45.6172455,0.824371257 42.8615569,0.718682635 40.1270659,0.718682635 L40.2966467,0.69754491 Z\" id=\"Shape\"/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E';","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst IllAlien_js_1 = __importDefault(require(\"../../lib/browser-support-message/image/IllAlien.js\"));\n/**\n * Show error message.\n */\nclass BrowserSupportMessage {\n /**\n * Creates new HTML Element with error message and attaches it to the DOM.\n *\n * @param localizedInformationOrTranslations LocalizedInformation or Translations.\n * @param theme Theme.\n */\n static show(localizedInformationOrTranslations, theme) {\n const element = this.createMessageElement(localizedInformationOrTranslations, theme);\n const wrapper = this.createWrapper(theme);\n wrapper.appendChild(element);\n document.body.appendChild(wrapper);\n }\n /**\n * Creates new HTML Element with error message.\n *\n * @param localizedInformationOrTranslations LocalizedInformation or Translations.\n * @param theme Theme.\n * @returns HTMLElement.\n */\n static createMessageElement(localizedInformationOrTranslations, theme) {\n const container = this.createContainer(theme);\n const image = this.createImage(theme);\n const fontFamily = this.getFontFamily(theme);\n const header = document.createElement('p');\n header.innerHTML = this.getErrorMessageHeader(localizedInformationOrTranslations);\n header.style.fontFamily = fontFamily;\n header.style.fontSize = theme.breakpoint.medium.fontStyle.headingMedium.size + 'px';\n header.style.fontWeight = String(theme.breakpoint.medium.fontStyle.headingXSmall.weight);\n header.style.color = theme.color.text.default;\n const description = document.createElement('p');\n description.innerHTML = this.getErrorMessageDescription(localizedInformationOrTranslations);\n description.style.fontFamily = fontFamily;\n description.style.fontSize = theme.breakpoint.medium.fontStyle.bodyMedium.size + 'px';\n description.style.color = theme.color.neutral.grey700;\n container.appendChild(image);\n container.appendChild(header);\n container.appendChild(description);\n themes_1.FontLoader.loadFont(theme);\n return container;\n }\n /**\n * Creates full screen wrapper container.\n *\n * @param theme Theme.\n * @returns HTMLElement.\n */\n static createWrapper(theme) {\n const wrapper = document.createElement('div');\n wrapper.style.display = 'block';\n wrapper.style.position = 'fixed';\n wrapper.style.top = '0';\n wrapper.style.left = '0';\n wrapper.style.bottom = '0';\n wrapper.style.right = '0';\n wrapper.style.backgroundColor = theme.color.neutral.white;\n wrapper.style.padding = theme.spacing.space150 + 'px';\n wrapper.style.zIndex = '9000';\n return wrapper;\n }\n /**\n * Creates Message container.\n *\n * @param theme Theme.\n * @returns HTMLElement.\n */\n static createContainer(theme) {\n const div = document.createElement('div');\n div.style.display = 'block';\n div.style.maxWidth = '25rem';\n div.style.margin = '0 auto';\n div.style.textAlign = 'center';\n div.style.padding = '0' + theme.spacing.space100;\n return div;\n }\n /**\n * Creates Image.\n *\n * @param theme Theme.\n * @returns HTMLElement.\n */\n static createImage(theme) {\n const image = document.createElement('div');\n const svgData = 'data:image/svg+xml,' + IllAlien_js_1.default;\n image.style.backgroundImage = \"url('\" + svgData + \"')\";\n image.style.backgroundRepeat = 'no-repeat';\n image.style.backgroundPosition = 'center';\n image.style.backgroundSize = 'contain';\n image.style.height = '50vh';\n image.style.marginBottom = theme.spacing.space150 + 'px';\n return image;\n }\n /**\n * Gets translated no browser support error message header.\n *\n * @param localizedInformationOrTranslations LocalizedInformation or Translations.\n * @returns Translated Error Message.\n */\n static getErrorMessageHeader(localizedInformationOrTranslations) {\n if ('translations' in localizedInformationOrTranslations) {\n return localizedInformationOrTranslations.translations.browserNotSupportedTitle;\n }\n return localizedInformationOrTranslations.browserNotSupportedTitle;\n }\n /**\n * Gets translated no browser support error message description.\n *\n * @param localizedInformationOrTranslations LocalizedInformation or Translations.\n * @returns Translated Error Message.\n */\n static getErrorMessageDescription(localizedInformationOrTranslations) {\n if ('translations' in localizedInformationOrTranslations) {\n return localizedInformationOrTranslations.translations.browserNotSupportedText;\n }\n return localizedInformationOrTranslations.browserNotSupportedText;\n }\n /**\n * Returns font styles.\n *\n * @param theme Theme.\n * @returns Font family.\n */\n static getFontFamily(theme) {\n return [theme.fontFace.family, ...theme.fontFace.fallbacks]\n .map((font) => `'${font}'`)\n .join(',');\n }\n}\nexports.default = BrowserSupportMessage;\n//# sourceMappingURL=BrowserSupportMessage.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BrowserSupportMessage = exports.BrowserList = exports.BrowserDetection = exports.BowserBrowserList = void 0;\nconst BrowserDetection_1 = __importDefault(require(\"./browser-detection/BrowserDetection\"));\nexports.BrowserDetection = BrowserDetection_1.default;\nconst BrowserSupportMessage_1 = __importDefault(require(\"./browser-support-message/BrowserSupportMessage\"));\nexports.BrowserSupportMessage = BrowserSupportMessage_1.default;\nconst BowserBrowserList_json_1 = __importDefault(require(\"./BowserBrowserList.json\"));\nexports.BowserBrowserList = BowserBrowserList_json_1.default;\nconst BrowserList_json_1 = __importDefault(require(\"./BrowserList.json\"));\nexports.BrowserList = BrowserList_json_1.default;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst browser_support_1 = require(\"@inter-ikea-kompis/browser-support\");\nclass SummaryPageBrowserUtility {\n static isSafari14OrOlder() {\n var _a, _b, _c;\n const browser = browser_support_1.BrowserDetection.getBrowser();\n if (((_a = browser === null || browser === void 0 ? void 0 : browser.name) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== 'safari') {\n return false;\n }\n const major = (_c = (_b = browser === null || browser === void 0 ? void 0 : browser.version) === null || _b === void 0 ? void 0 : _b.split('.')) === null || _c === void 0 ? void 0 : _c[0];\n if (!major) {\n return false;\n }\n return parseInt(major) <= 14;\n }\n static isSafari() {\n var _a;\n const browser = browser_support_1.BrowserDetection.getBrowser();\n return ((_a = browser === null || browser === void 0 ? void 0 : browser.name) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'safari';\n }\n}\nexports.default = SummaryPageBrowserUtility;\n//# sourceMappingURL=SummaryPageBrowserUtility.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\n/**\n * Handles Measurement utilities.\n */\nclass SummaryPageMeasurementUtility {\n /**\n * @param translations Translations from the translations service.\n * @param localisation Localizations from DEXF settings retrieved from settings service.\n * @param locale Locale in format xx-XX, e.g., en-GB.\n * @param measurements The measurements.\n * @param useLongFormat Use a long (three rows) format with labels.\n * @returns Formatted and localized measurement row(s) with the correct unit (cm/inches).\n */\n static getLocalizedMeasurementRows(translations, localisation, locale, measurements, useLongFormat = false) {\n const { useMetricMeasures } = localisation;\n const { measureValueCm, measureValueIn } = translations;\n let convertedMeasurements = {};\n let unit = '';\n if (useMetricMeasures) {\n convertedMeasurements = Object.fromEntries(Object.entries(measurements).map(([dimension, millimeter]) => {\n const millimeterToCm = Math.round(millimeter) / 10;\n const toLocaleCm = millimeterToCm.toLocaleString(locale);\n return [dimension, toLocaleCm];\n }));\n unit = measureValueCm;\n }\n else {\n convertedMeasurements = Object.fromEntries(Object.entries(measurements).map(([dimension, millimeter]) => {\n const toLocaleIn = utilities_1.MeasurementUtility.metricToImperial(millimeter, false, true);\n return [dimension, toLocaleIn];\n }));\n unit = measureValueIn;\n }\n if (useLongFormat) {\n const { labelHeight, labelWidth, labelDepth } = translations;\n return [\n `${labelHeight} ${convertedMeasurements.height} ${unit}`,\n `${labelWidth} ${convertedMeasurements.width} ${unit}`,\n `${labelDepth} ${convertedMeasurements.depth} ${unit}`\n ];\n }\n else {\n return [\n `${convertedMeasurements.width}x${convertedMeasurements.depth}x${convertedMeasurements.height} ${unit}`\n ];\n }\n }\n}\nexports.default = SummaryPageMeasurementUtility;\n//# sourceMappingURL=SummaryPageMeasurementUtility.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst IkeaLogo = `\n\n\n\n\n`;\nexports.default = IkeaLogo;\n//# sourceMappingURL=IkeaLogo.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.colourInteractiveSecondaryBgHoverRgb = exports.colourInteractiveSecondaryBgHover = exports.colourInteractiveSecondaryBgDefaultRgb = exports.colourInteractiveSecondaryBgDefault = exports.colourInteractiveEmphasisedBgPressedRgb = exports.colourInteractiveEmphasisedBgPressed = exports.colourInteractiveEmphasisedBgHoverRgb = exports.colourInteractiveEmphasisedBgHover = exports.colourInteractiveEmphasisedBgDefaultRgb = exports.colourInteractiveEmphasisedBgDefault = exports.colourInteractivePrimaryBgPressedRgb = exports.colourInteractivePrimaryBgPressed = exports.colourInteractivePrimaryBgHoverRgb = exports.colourInteractivePrimaryBgHover = exports.colourInteractivePrimaryBgDefaultRgb = exports.colourInteractivePrimaryBgDefault = exports.colourSemanticNegativeRgb = exports.colourSemanticNegative = exports.colourSemanticCautionTextRgb = exports.colourSemanticCautionText = exports.colourSemanticCautionRgb = exports.colourSemanticCaution = exports.colourSemanticPositiveRgb = exports.colourSemanticPositive = exports.colourSemanticInformativeRgb = exports.colourSemanticInformative = exports.colourNeutral7Rgb = exports.colourNeutral7 = exports.colourNeutral6Rgb = exports.colourNeutral6 = exports.colourNeutral5Rgb = exports.colourNeutral5 = exports.colourNeutral4Rgb = exports.colourNeutral4 = exports.colourNeutral3Rgb = exports.colourNeutral3 = exports.colourNeutral2Rgb = exports.colourNeutral2 = exports.colourNeutral1Rgb = exports.colourNeutral1 = exports.colourTextAndIcon5Rgb = exports.colourTextAndIcon5 = exports.colourTextAndIcon4Rgb = exports.colourTextAndIcon4 = exports.colourTextAndIcon3Rgb = exports.colourTextAndIcon3 = exports.colourTextAndIcon2Rgb = exports.colourTextAndIcon2 = exports.colourTextAndIcon1Rgb = exports.colourTextAndIcon1 = void 0;\nexports.colourStaticWhiteRgb = exports.colourStaticWhite = exports.colourStaticIkeaFamilyRgb = exports.colourStaticIkeaFamily = exports.colourStaticIkeaBrandYellowRgb = exports.colourStaticIkeaBrandYellow = exports.colourStaticIkeaBrandBlueRgb = exports.colourStaticIkeaBrandBlue = exports.colourInteractiveStaticSecondaryBgPressedRgb = exports.colourInteractiveStaticSecondaryBgPressed = exports.colourInteractiveStaticSecondaryBgHoverRgb = exports.colourInteractiveStaticSecondaryBgHover = exports.colourInteractiveStaticSecondaryBgDefaultRgb = exports.colourInteractiveStaticSecondaryBgDefault = exports.colourInteractiveStaticPrimaryBgPressedRgb = exports.colourInteractiveStaticPrimaryBgPressed = exports.colourInteractiveStaticPrimaryBgHoverRgb = exports.colourInteractiveStaticPrimaryBgHover = exports.colourInteractiveStaticPrimaryBgDefaultRgb = exports.colourInteractiveStaticPrimaryBgDefault = exports.colourInteractiveSubtleBorderPressedRgb = exports.colourInteractiveSubtleBorderPressed = exports.colourInteractiveSubtleBorderHoverRgb = exports.colourInteractiveSubtleBorderHover = exports.colourInteractiveSubtleBorderDefaultRgb = exports.colourInteractiveSubtleBorderDefault = exports.colourInteractiveSubtleBorderSelectedRgb = exports.colourInteractiveSubtleBorderSelected = exports.colourInteractiveEmphasisedBorderSelectedRgb = exports.colourInteractiveEmphasisedBorderSelected = exports.colourInteractiveDisabled3Rgb = exports.colourInteractiveDisabled3 = exports.colourInteractiveDisabled2Rgb = exports.colourInteractiveDisabled2 = exports.colourInteractiveDisabled1Rgb = exports.colourInteractiveDisabled1 = exports.colourInteractiveDestructiveBgPressedRgb = exports.colourInteractiveDestructiveBgPressed = exports.colourInteractiveDestructiveBgHoverRgb = exports.colourInteractiveDestructiveBgHover = exports.colourInteractiveDestructiveBgDefaultRgb = exports.colourInteractiveDestructiveBgDefault = exports.colourInteractiveSubtleBgPressedRgb = exports.colourInteractiveSubtleBgPressed = exports.colourInteractiveSubtleBgHoverRgb = exports.colourInteractiveSubtleBgHover = exports.colourInteractiveSubtleBgDefaultRgb = exports.colourInteractiveSubtleBgDefault = exports.colourInteractiveSecondaryBgPressedRgb = exports.colourInteractiveSecondaryBgPressed = void 0;\nexports.colourCampaignSustainabilityRgb = exports.colourCampaignSustainability = exports.colourCommercialMessageBtiRedRgb = exports.colourCommercialMessageBtiRed = exports.colourCommercialMessageBtiYellowRgb = exports.colourCommercialMessageBtiYellow = exports.colourCommercialMessageIkeaFamilyRgb = exports.colourCommercialMessageIkeaFamily = exports.colourCommercialMessageNewLowerPriceRgb = exports.colourCommercialMessageNewLowerPrice = exports.colourCommercialMessageNewRgb = exports.colourCommercialMessageNew = exports.colourElevation2BorderRgb = exports.colourElevation2Border = exports.colourElevation1BorderRgb = exports.colourElevation1Border = exports.colourElevation3Rgb = exports.colourElevation3 = exports.colourElevation2Rgb = exports.colourElevation2 = exports.colourElevation1Rgb = exports.colourElevation1 = exports.colourStaticIkeaBusinessNetworkRgb = exports.colourStaticIkeaBusinessNetwork = exports.colourStaticLightGreyRgb = exports.colourStaticLightGrey = exports.colourStaticGreyRgb = exports.colourStaticGrey = exports.colourStaticDarkGreyRgb = exports.colourStaticDarkGrey = exports.colourStaticBlackRgb = exports.colourStaticBlack = void 0;\n/** css rgb function with reference to var, default value 17, 17, 17 (#111111) */\nexports.colourTextAndIcon1 = 'rgb(var(--colour-text-and-icon-1, 17, 17, 17))';\n/** css var reference, default value 17, 17, 17 (#111111) */\nexports.colourTextAndIcon1Rgb = 'var(--colour-text-and-icon-1, 17, 17, 17)';\n/** css rgb function with reference to var, default value 72, 72, 72 (#484848) */\nexports.colourTextAndIcon2 = 'rgb(var(--colour-text-and-icon-2, 72, 72, 72))';\n/** css var reference, default value 72, 72, 72 (#484848) */\nexports.colourTextAndIcon2Rgb = 'var(--colour-text-and-icon-2, 72, 72, 72)';\n/** css rgb function with reference to var, default value 118, 118, 118 (#767676) */\nexports.colourTextAndIcon3 = 'rgb(var(--colour-text-and-icon-3, 118, 118, 118))';\n/** css var reference, default value 118, 118, 118 (#767676) */\nexports.colourTextAndIcon3Rgb = 'var(--colour-text-and-icon-3, 118, 118, 118)';\n/** css rgb function with reference to var, default value 146, 146, 146 (#929292) */\nexports.colourTextAndIcon4 = 'rgb(var(--colour-text-and-icon-4, 146, 146, 146))';\n/** css var reference, default value 146, 146, 146 (#929292) */\nexports.colourTextAndIcon4Rgb = 'var(--colour-text-and-icon-4, 146, 146, 146)';\n/** css rgb function with reference to var, default value 255, 255, 255 (#ffffff) */\nexports.colourTextAndIcon5 = 'rgb(var(--colour-text-and-icon-5, 255, 255, 255))';\n/** css var reference, default value 255, 255, 255 (#ffffff) */\nexports.colourTextAndIcon5Rgb = 'var(--colour-text-and-icon-5, 255, 255, 255)';\n/** css rgb function with reference to var, default value 255, 255, 255 (#ffffff) */\nexports.colourNeutral1 = 'rgb(var(--colour-neutral-1, 255, 255, 255))';\n/** css var reference, default value 255, 255, 255 (#ffffff) */\nexports.colourNeutral1Rgb = 'var(--colour-neutral-1, 255, 255, 255)';\n/** css rgb function with reference to var, default value 245, 245, 245 (#f5f5f5) */\nexports.colourNeutral2 = 'rgb(var(--colour-neutral-2, 245, 245, 245))';\n/** css var reference, default value 245, 245, 245 (#f5f5f5) */\nexports.colourNeutral2Rgb = 'var(--colour-neutral-2, 245, 245, 245)';\n/** css rgb function with reference to var, default value 223, 223, 223 (#dfdfdf) */\nexports.colourNeutral3 = 'rgb(var(--colour-neutral-3, 223, 223, 223))';\n/** css var reference, default value 223, 223, 223 (#dfdfdf) */\nexports.colourNeutral3Rgb = 'var(--colour-neutral-3, 223, 223, 223)';\n/** css rgb function with reference to var, default value 204, 204, 204 (#cccccc) */\nexports.colourNeutral4 = 'rgb(var(--colour-neutral-4, 204, 204, 204))';\n/** css var reference, default value 204, 204, 204 (#cccccc) */\nexports.colourNeutral4Rgb = 'var(--colour-neutral-4, 204, 204, 204)';\n/** css rgb function with reference to var, default value 146, 146, 146 (#929292) */\nexports.colourNeutral5 = 'rgb(var(--colour-neutral-5, 146, 146, 146))';\n/** css var reference, default value 146, 146, 146 (#929292) */\nexports.colourNeutral5Rgb = 'var(--colour-neutral-5, 146, 146, 146)';\n/** css rgb function with reference to var, default value 72, 72, 72 (#484848) */\nexports.colourNeutral6 = 'rgb(var(--colour-neutral-6, 72, 72, 72))';\n/** css var reference, default value 72, 72, 72 (#484848) */\nexports.colourNeutral6Rgb = 'var(--colour-neutral-6, 72, 72, 72)';\n/** css rgb function with reference to var, default value 17, 17, 17 (#111111) */\nexports.colourNeutral7 = 'rgb(var(--colour-neutral-7, 17, 17, 17))';\n/** css var reference, default value 17, 17, 17 (#111111) */\nexports.colourNeutral7Rgb = 'var(--colour-neutral-7, 17, 17, 17)';\n/** css rgb function with reference to var, default value 0, 88, 163 (#0058a3) */\nexports.colourSemanticInformative = 'rgb(var(--colour-semantic-informative, 0, 88, 163))';\n/** css var reference, default value 0, 88, 163 (#0058a3) */\nexports.colourSemanticInformativeRgb = 'var(--colour-semantic-informative, 0, 88, 163)';\n/** css rgb function with reference to var, default value 10, 138, 0 (#0a8a00) */\nexports.colourSemanticPositive = 'rgb(var(--colour-semantic-positive, 10, 138, 0))';\n/** css var reference, default value 10, 138, 0 (#0a8a00) */\nexports.colourSemanticPositiveRgb = 'var(--colour-semantic-positive, 10, 138, 0)';\n/** css rgb function with reference to var, default value 242, 106, 47 (#F26A2F) */\nexports.colourSemanticCaution = 'rgb(var(--colour-semantic-caution, 242, 106, 47))';\n/** css var reference, default value 242, 106, 47 (#F26A2F) */\nexports.colourSemanticCautionRgb = 'var(--colour-semantic-caution, 242, 106, 47)';\n/** css rgb function with reference to var, default value 202, 80, 8 (#ca5008) */\nexports.colourSemanticCautionText = 'rgb(var(--colour-semantic-caution-text, 202, 80, 8))';\n/** css var reference, default value 202, 80, 8 (#ca5008) */\nexports.colourSemanticCautionTextRgb = 'var(--colour-semantic-caution-text, 202, 80, 8)';\n/** css rgb function with reference to var, default value 224, 7, 81 (#e00751) */\nexports.colourSemanticNegative = 'rgb(var(--colour-semantic-negative, 224, 7, 81))';\n/** css var reference, default value 224, 7, 81 (#e00751) */\nexports.colourSemanticNegativeRgb = 'var(--colour-semantic-negative, 224, 7, 81)';\n/** css rgb function with reference to var, default value 17, 17, 17 (#111111) */\nexports.colourInteractivePrimaryBgDefault = 'rgb(var(--colour-interactive-primary-bg-default, 17, 17, 17))';\n/** css var reference, default value 17, 17, 17 (#111111) */\nexports.colourInteractivePrimaryBgDefaultRgb = 'var(--colour-interactive-primary-bg-default, 17, 17, 17)';\n/** css rgb function with reference to var, default value 51, 51, 51 (#333333) */\nexports.colourInteractivePrimaryBgHover = 'rgb(var(--colour-interactive-primary-bg-hover, 51, 51, 51))';\n/** css var reference, default value 51, 51, 51 (#333333) */\nexports.colourInteractivePrimaryBgHoverRgb = 'var(--colour-interactive-primary-bg-hover, 51, 51, 51)';\n/** css rgb function with reference to var, default value 0, 0, 0 (#000000) */\nexports.colourInteractivePrimaryBgPressed = 'rgb(var(--colour-interactive-primary-bg-pressed, 0, 0, 0))';\n/** css var reference, default value 0, 0, 0 (#000000) */\nexports.colourInteractivePrimaryBgPressedRgb = 'var(--colour-interactive-primary-bg-pressed, 0, 0, 0)';\n/** css rgb function with reference to var, default value 0, 88, 163 (#0058a3) */\nexports.colourInteractiveEmphasisedBgDefault = 'rgb(var(--colour-interactive-emphasised-bg-default, 0, 88, 163))';\n/** css var reference, default value 0, 88, 163 (#0058a3) */\nexports.colourInteractiveEmphasisedBgDefaultRgb = 'var(--colour-interactive-emphasised-bg-default, 0, 88, 163)';\n/** css rgb function with reference to var, default value 0, 79, 147 (#004f93) */\nexports.colourInteractiveEmphasisedBgHover = 'rgb(var(--colour-interactive-emphasised-bg-hover, 0, 79, 147))';\n/** css var reference, default value 0, 79, 147 (#004f93) */\nexports.colourInteractiveEmphasisedBgHoverRgb = 'var(--colour-interactive-emphasised-bg-hover, 0, 79, 147)';\n/** css rgb function with reference to var, default value 0, 62, 114 (#003e72) */\nexports.colourInteractiveEmphasisedBgPressed = 'rgb(var(--colour-interactive-emphasised-bg-pressed, 0, 62, 114))';\n/** css var reference, default value 0, 62, 114 (#003e72) */\nexports.colourInteractiveEmphasisedBgPressedRgb = 'var(--colour-interactive-emphasised-bg-pressed, 0, 62, 114)';\n/** css rgb function with reference to var, default value 245, 245, 245 (#f5f5f5) */\nexports.colourInteractiveSecondaryBgDefault = 'rgb(var(--colour-interactive-secondary-bg-default, 245, 245, 245))';\n/** css var reference, default value 245, 245, 245 (#f5f5f5) */\nexports.colourInteractiveSecondaryBgDefaultRgb = 'var(--colour-interactive-secondary-bg-default, 245, 245, 245)';\n/** css rgb function with reference to var, default value 223, 223, 223 (#dfdfdf) */\nexports.colourInteractiveSecondaryBgHover = 'rgb(var(--colour-interactive-secondary-bg-hover, 223, 223, 223))';\n/** css var reference, default value 223, 223, 223 (#dfdfdf) */\nexports.colourInteractiveSecondaryBgHoverRgb = 'var(--colour-interactive-secondary-bg-hover, 223, 223, 223)';\n/** css rgb function with reference to var, default value 204, 204, 204 (#cccccc) */\nexports.colourInteractiveSecondaryBgPressed = 'rgb(var(--colour-interactive-secondary-bg-pressed, 204, 204, 204))';\n/** css var reference, default value 204, 204, 204 (#cccccc) */\nexports.colourInteractiveSecondaryBgPressedRgb = 'var(--colour-interactive-secondary-bg-pressed, 204, 204, 204)';\n/** css rgb function with reference to var, default value 255, 255, 255 (#ffffff) */\nexports.colourInteractiveSubtleBgDefault = 'rgb(var(--colour-interactive-subtle-bg-default, 255, 255, 255))';\n/** css var reference, default value 255, 255, 255 (#ffffff) */\nexports.colourInteractiveSubtleBgDefaultRgb = 'var(--colour-interactive-subtle-bg-default, 255, 255, 255)';\n/** css rgb function with reference to var, default value 245, 245, 245 (#f5f5f5) */\nexports.colourInteractiveSubtleBgHover = 'rgb(var(--colour-interactive-subtle-bg-hover, 245, 245, 245))';\n/** css var reference, default value 245, 245, 245 (#f5f5f5) */\nexports.colourInteractiveSubtleBgHoverRgb = 'var(--colour-interactive-subtle-bg-hover, 245, 245, 245)';\n/** css rgb function with reference to var, default value 223, 223, 223 (#dfdfdf) */\nexports.colourInteractiveSubtleBgPressed = 'rgb(var(--colour-interactive-subtle-bg-pressed, 223, 223, 223))';\n/** css var reference, default value 223, 223, 223 (#dfdfdf) */\nexports.colourInteractiveSubtleBgPressedRgb = 'var(--colour-interactive-subtle-bg-pressed, 223, 223, 223)';\n/** css rgb function with reference to var, default value 224, 7, 81 (#e00751) */\nexports.colourInteractiveDestructiveBgDefault = 'rgb(var(--colour-interactive-destructive-bg-default, 224, 7, 81))';\n/** css var reference, default value 224, 7, 81 (#e00751) */\nexports.colourInteractiveDestructiveBgDefaultRgb = 'var(--colour-interactive-destructive-bg-default, 224, 7, 81)';\n/** css rgb function with reference to var, default value 204, 0, 61 (#cc003d) */\nexports.colourInteractiveDestructiveBgHover = 'rgb(var(--colour-interactive-destructive-bg-hover, 204, 0, 61))';\n/** css var reference, default value 204, 0, 61 (#cc003d) */\nexports.colourInteractiveDestructiveBgHoverRgb = 'var(--colour-interactive-destructive-bg-hover, 204, 0, 61)';\n/** css rgb function with reference to var, default value 184, 0, 41 (#b80029) */\nexports.colourInteractiveDestructiveBgPressed = 'rgb(var(--colour-interactive-destructive-bg-pressed, 184, 0, 41))';\n/** css var reference, default value 184, 0, 41 (#b80029) */\nexports.colourInteractiveDestructiveBgPressedRgb = 'var(--colour-interactive-destructive-bg-pressed, 184, 0, 41)';\n/** css rgb function with reference to var, default value 204, 204, 204 (#cccccc) */\nexports.colourInteractiveDisabled1 = 'rgb(var(--colour-interactive-disabled-1, 204, 204, 204))';\n/** css var reference, default value 204, 204, 204 (#cccccc) */\nexports.colourInteractiveDisabled1Rgb = 'var(--colour-interactive-disabled-1, 204, 204, 204)';\n/** css rgb function with reference to var, default value 146, 146, 146 (#929292) */\nexports.colourInteractiveDisabled2 = 'rgb(var(--colour-interactive-disabled-2, 146, 146, 146))';\n/** css var reference, default value 146, 146, 146 (#929292) */\nexports.colourInteractiveDisabled2Rgb = 'var(--colour-interactive-disabled-2, 146, 146, 146)';\n/** css rgb function with reference to var, default value 255, 255, 255 (#ffffff) */\nexports.colourInteractiveDisabled3 = 'rgb(var(--colour-interactive-disabled-3, 255, 255, 255))';\n/** css var reference, default value 255, 255, 255 (#ffffff) */\nexports.colourInteractiveDisabled3Rgb = 'var(--colour-interactive-disabled-3, 255, 255, 255)';\n/** css rgb function with reference to var, default value 0, 88, 163 (#0058a3) */\nexports.colourInteractiveEmphasisedBorderSelected = 'rgb(var(--colour-interactive-emphasised-border-selected, 0, 88, 163))';\n/** css var reference, default value 0, 88, 163 (#0058a3) */\nexports.colourInteractiveEmphasisedBorderSelectedRgb = 'var(--colour-interactive-emphasised-border-selected, 0, 88, 163)';\n/** css rgb function with reference to var, default value 17, 17, 17 (#111111) */\nexports.colourInteractiveSubtleBorderSelected = 'rgb(var(--colour-interactive-subtle-border-selected, 17, 17, 17))';\n/** css var reference, default value 17, 17, 17 (#111111) */\nexports.colourInteractiveSubtleBorderSelectedRgb = 'var(--colour-interactive-subtle-border-selected, 17, 17, 17)';\n/** css rgb function with reference to var, default value 146, 146, 146 (#929292) */\nexports.colourInteractiveSubtleBorderDefault = 'rgb(var(--colour-interactive-subtle-border-default, 146, 146, 146))';\n/** css var reference, default value 146, 146, 146 (#929292) */\nexports.colourInteractiveSubtleBorderDefaultRgb = 'var(--colour-interactive-subtle-border-default, 146, 146, 146)';\n/** css rgb function with reference to var, default value 17, 17, 17 (#111111) */\nexports.colourInteractiveSubtleBorderHover = 'rgb(var(--colour-interactive-subtle-border-hover, 17, 17, 17))';\n/** css var reference, default value 17, 17, 17 (#111111) */\nexports.colourInteractiveSubtleBorderHoverRgb = 'var(--colour-interactive-subtle-border-hover, 17, 17, 17)';\n/** css rgb function with reference to var, default value 17, 17, 17 (#111111) */\nexports.colourInteractiveSubtleBorderPressed = 'rgb(var(--colour-interactive-subtle-border-pressed, 17, 17, 17))';\n/** css var reference, default value 17, 17, 17 (#111111) */\nexports.colourInteractiveSubtleBorderPressedRgb = 'var(--colour-interactive-subtle-border-pressed, 17, 17, 17)';\n/** css rgb function with reference to var, default value 17, 17, 17 (#111111) */\nexports.colourInteractiveStaticPrimaryBgDefault = 'rgb(var(--colour-interactive-static-primary-bg-default, 17, 17, 17))';\n/** css var reference, default value 17, 17, 17 (#111111) */\nexports.colourInteractiveStaticPrimaryBgDefaultRgb = 'var(--colour-interactive-static-primary-bg-default, 17, 17, 17)';\n/** css rgb function with reference to var, default value 51, 51, 51 (#333333) */\nexports.colourInteractiveStaticPrimaryBgHover = 'rgb(var(--colour-interactive-static-primary-bg-hover, 51, 51, 51))';\n/** css var reference, default value 51, 51, 51 (#333333) */\nexports.colourInteractiveStaticPrimaryBgHoverRgb = 'var(--colour-interactive-static-primary-bg-hover, 51, 51, 51)';\n/** css rgb function with reference to var, default value 0, 0, 0 (#000000) */\nexports.colourInteractiveStaticPrimaryBgPressed = 'rgb(var(--colour-interactive-static-primary-bg-pressed, 0, 0, 0))';\n/** css var reference, default value 0, 0, 0 (#000000) */\nexports.colourInteractiveStaticPrimaryBgPressedRgb = 'var(--colour-interactive-static-primary-bg-pressed, 0, 0, 0)';\n/** css rgb function with reference to var, default value 245, 245, 245 (#f5f5f5) */\nexports.colourInteractiveStaticSecondaryBgDefault = 'rgb(var(--colour-interactive-static-secondary-bg-default, 245, 245, 245))';\n/** css var reference, default value 245, 245, 245 (#f5f5f5) */\nexports.colourInteractiveStaticSecondaryBgDefaultRgb = 'var(--colour-interactive-static-secondary-bg-default, 245, 245, 245)';\n/** css rgb function with reference to var, default value 223, 223, 223 (#dfdfdf) */\nexports.colourInteractiveStaticSecondaryBgHover = 'rgb(var(--colour-interactive-static-secondary-bg-hover, 223, 223, 223))';\n/** css var reference, default value 223, 223, 223 (#dfdfdf) */\nexports.colourInteractiveStaticSecondaryBgHoverRgb = 'var(--colour-interactive-static-secondary-bg-hover, 223, 223, 223)';\n/** css rgb function with reference to var, default value 204, 204, 204 (#cccccc) */\nexports.colourInteractiveStaticSecondaryBgPressed = 'rgb(var(--colour-interactive-static-secondary-bg-pressed, 204, 204, 204))';\n/** css var reference, default value 204, 204, 204 (#cccccc) */\nexports.colourInteractiveStaticSecondaryBgPressedRgb = 'var(--colour-interactive-static-secondary-bg-pressed, 204, 204, 204)';\n/** css rgb function with reference to var, default value 0, 88, 163 (#0058a3) */\nexports.colourStaticIkeaBrandBlue = 'rgb(var(--colour-static-ikea-brand-blue, 0, 88, 163))';\n/** css var reference, default value 0, 88, 163 (#0058a3) */\nexports.colourStaticIkeaBrandBlueRgb = 'var(--colour-static-ikea-brand-blue, 0, 88, 163)';\n/** css rgb function with reference to var, default value 255, 219, 0 (#ffdb00) */\nexports.colourStaticIkeaBrandYellow = 'rgb(var(--colour-static-ikea-brand-yellow, 255, 219, 0))';\n/** css var reference, default value 255, 219, 0 (#ffdb00) */\nexports.colourStaticIkeaBrandYellowRgb = 'var(--colour-static-ikea-brand-yellow, 255, 219, 0)';\n/** css rgb function with reference to var, default value 0, 124, 193 (#007cc1) */\nexports.colourStaticIkeaFamily = 'rgb(var(--colour-static-ikea-family, 0, 124, 193))';\n/** css var reference, default value 0, 124, 193 (#007cc1) */\nexports.colourStaticIkeaFamilyRgb = 'var(--colour-static-ikea-family, 0, 124, 193)';\n/** css rgb function with reference to var, default value 255, 255, 255 (#ffffff) */\nexports.colourStaticWhite = 'rgb(var(--colour-static-white, 255, 255, 255))';\n/** css var reference, default value 255, 255, 255 (#ffffff) */\nexports.colourStaticWhiteRgb = 'var(--colour-static-white, 255, 255, 255)';\n/** css rgb function with reference to var, default value 17, 17, 17 (#111111) */\nexports.colourStaticBlack = 'rgb(var(--colour-static-black, 17, 17, 17))';\n/** css var reference, default value 17, 17, 17 (#111111) */\nexports.colourStaticBlackRgb = 'var(--colour-static-black, 17, 17, 17)';\n/** css rgb function with reference to var, default value 118, 118, 118 (#767676) */\nexports.colourStaticDarkGrey = 'rgb(var(--colour-static-dark-grey, 118, 118, 118))';\n/** css var reference, default value 118, 118, 118 (#767676) */\nexports.colourStaticDarkGreyRgb = 'var(--colour-static-dark-grey, 118, 118, 118)';\n/** css rgb function with reference to var, default value 223, 223, 223 (#dfdfdf) */\nexports.colourStaticGrey = 'rgb(var(--colour-static-grey, 223, 223, 223))';\n/** css var reference, default value 223, 223, 223 (#dfdfdf) */\nexports.colourStaticGreyRgb = 'var(--colour-static-grey, 223, 223, 223)';\n/** css rgb function with reference to var, default value 245, 245, 245 (#f5f5f5) */\nexports.colourStaticLightGrey = 'rgb(var(--colour-static-light-grey, 245, 245, 245))';\n/** css var reference, default value 245, 245, 245 (#f5f5f5) */\nexports.colourStaticLightGreyRgb = 'var(--colour-static-light-grey, 245, 245, 245)';\n/** css rgb function with reference to var, default value 222, 188, 156 (#DEBC9C) */\nexports.colourStaticIkeaBusinessNetwork = 'rgb(var(--colour-static-ikea-business-network, 222, 188, 156))';\n/** css var reference, default value 222, 188, 156 (#DEBC9C) */\nexports.colourStaticIkeaBusinessNetworkRgb = 'var(--colour-static-ikea-business-network, 222, 188, 156)';\n/** css rgb function with reference to var, default value 255, 255, 255 (#ffffff) */\nexports.colourElevation1 = 'rgb(var(--colour-elevation-1, 255, 255, 255))';\n/** css var reference, default value 255, 255, 255 (#ffffff) */\nexports.colourElevation1Rgb = 'var(--colour-elevation-1, 255, 255, 255)';\n/** css rgb function with reference to var, default value 255, 255, 255 (#ffffff) */\nexports.colourElevation2 = 'rgb(var(--colour-elevation-2, 255, 255, 255))';\n/** css var reference, default value 255, 255, 255 (#ffffff) */\nexports.colourElevation2Rgb = 'var(--colour-elevation-2, 255, 255, 255)';\n/** css rgb function with reference to var, default value 17, 17, 17 (#111111) */\nexports.colourElevation3 = 'rgb(var(--colour-elevation-3, 17, 17, 17))';\n/** css var reference, default value 17, 17, 17 (#111111) */\nexports.colourElevation3Rgb = 'var(--colour-elevation-3, 17, 17, 17)';\n/** css rgb function with reference to var, default value 223, 223, 223 (#dfdfdf) */\nexports.colourElevation1Border = 'rgb(var(--colour-elevation-1-border, 223, 223, 223))';\n/** css var reference, default value 223, 223, 223 (#dfdfdf) */\nexports.colourElevation1BorderRgb = 'var(--colour-elevation-1-border, 223, 223, 223)';\n/** css rgb function with reference to var, default value 72, 72, 72 (#484848) */\nexports.colourElevation2Border = 'rgb(var(--colour-elevation-2-border, 72, 72, 72))';\n/** css var reference, default value 72, 72, 72 (#484848) */\nexports.colourElevation2BorderRgb = 'var(--colour-elevation-2-border, 72, 72, 72)';\n/** css rgb function with reference to var, default value 202, 80, 8 (#ca5008) */\nexports.colourCommercialMessageNew = 'rgb(var(--colour-commercial-message-new, 202, 80, 8))';\n/** css var reference, default value 202, 80, 8 (#ca5008) */\nexports.colourCommercialMessageNewRgb = 'var(--colour-commercial-message-new, 202, 80, 8)';\n/** css rgb function with reference to var, default value 204, 0, 8 (#cc0008) */\nexports.colourCommercialMessageNewLowerPrice = 'rgb(var(--colour-commercial-message-new-lower-price, 204, 0, 8))';\n/** css var reference, default value 204, 0, 8 (#cc0008) */\nexports.colourCommercialMessageNewLowerPriceRgb = 'var(--colour-commercial-message-new-lower-price, 204, 0, 8)';\n/** css rgb function with reference to var, default value 0, 124, 193 (#007cc1) */\nexports.colourCommercialMessageIkeaFamily = 'rgb(var(--colour-commercial-message-ikea-family, 0, 124, 193))';\n/** css var reference, default value 0, 124, 193 (#007cc1) */\nexports.colourCommercialMessageIkeaFamilyRgb = 'var(--colour-commercial-message-ikea-family, 0, 124, 193)';\n/** css rgb function with reference to var, default value 255, 219, 0 (#ffdb00) */\nexports.colourCommercialMessageBtiYellow = 'rgb(var(--colour-commercial-message-bti-yellow, 255, 219, 0))';\n/** css var reference, default value 255, 219, 0 (#ffdb00) */\nexports.colourCommercialMessageBtiYellowRgb = 'var(--colour-commercial-message-bti-yellow, 255, 219, 0)';\n/** css rgb function with reference to var, default value 204, 0, 8 (#cc0008) */\nexports.colourCommercialMessageBtiRed = 'rgb(var(--colour-commercial-message-bti-red, 204, 0, 8))';\n/** css var reference, default value 204, 0, 8 (#cc0008) */\nexports.colourCommercialMessageBtiRedRgb = 'var(--colour-commercial-message-bti-red, 204, 0, 8)';\n/** css rgb function with reference to var, default value 0, 133, 62 (#00853e) */\nexports.colourCampaignSustainability = 'rgb(var(--colour-campaign-sustainability, 0, 133, 62))';\n/** css var reference, default value 0, 133, 62 (#00853e) */\nexports.colourCampaignSustainabilityRgb = 'var(--colour-campaign-sustainability, 0, 133, 62)';\nexports.default = {\n colourTextAndIcon1: exports.colourTextAndIcon1,\n colourTextAndIcon1Rgb: exports.colourTextAndIcon1Rgb,\n colourTextAndIcon2: exports.colourTextAndIcon2,\n colourTextAndIcon2Rgb: exports.colourTextAndIcon2Rgb,\n colourTextAndIcon3: exports.colourTextAndIcon3,\n colourTextAndIcon3Rgb: exports.colourTextAndIcon3Rgb,\n colourTextAndIcon4: exports.colourTextAndIcon4,\n colourTextAndIcon4Rgb: exports.colourTextAndIcon4Rgb,\n colourTextAndIcon5: exports.colourTextAndIcon5,\n colourTextAndIcon5Rgb: exports.colourTextAndIcon5Rgb,\n colourNeutral1: exports.colourNeutral1,\n colourNeutral1Rgb: exports.colourNeutral1Rgb,\n colourNeutral2: exports.colourNeutral2,\n colourNeutral2Rgb: exports.colourNeutral2Rgb,\n colourNeutral3: exports.colourNeutral3,\n colourNeutral3Rgb: exports.colourNeutral3Rgb,\n colourNeutral4: exports.colourNeutral4,\n colourNeutral4Rgb: exports.colourNeutral4Rgb,\n colourNeutral5: exports.colourNeutral5,\n colourNeutral5Rgb: exports.colourNeutral5Rgb,\n colourNeutral6: exports.colourNeutral6,\n colourNeutral6Rgb: exports.colourNeutral6Rgb,\n colourNeutral7: exports.colourNeutral7,\n colourNeutral7Rgb: exports.colourNeutral7Rgb,\n colourSemanticInformative: exports.colourSemanticInformative,\n colourSemanticInformativeRgb: exports.colourSemanticInformativeRgb,\n colourSemanticPositive: exports.colourSemanticPositive,\n colourSemanticPositiveRgb: exports.colourSemanticPositiveRgb,\n colourSemanticCaution: exports.colourSemanticCaution,\n colourSemanticCautionRgb: exports.colourSemanticCautionRgb,\n colourSemanticCautionText: exports.colourSemanticCautionText,\n colourSemanticCautionTextRgb: exports.colourSemanticCautionTextRgb,\n colourSemanticNegative: exports.colourSemanticNegative,\n colourSemanticNegativeRgb: exports.colourSemanticNegativeRgb,\n colourInteractivePrimaryBgDefault: exports.colourInteractivePrimaryBgDefault,\n colourInteractivePrimaryBgDefaultRgb: exports.colourInteractivePrimaryBgDefaultRgb,\n colourInteractivePrimaryBgHover: exports.colourInteractivePrimaryBgHover,\n colourInteractivePrimaryBgHoverRgb: exports.colourInteractivePrimaryBgHoverRgb,\n colourInteractivePrimaryBgPressed: exports.colourInteractivePrimaryBgPressed,\n colourInteractivePrimaryBgPressedRgb: exports.colourInteractivePrimaryBgPressedRgb,\n colourInteractiveEmphasisedBgDefault: exports.colourInteractiveEmphasisedBgDefault,\n colourInteractiveEmphasisedBgDefaultRgb: exports.colourInteractiveEmphasisedBgDefaultRgb,\n colourInteractiveEmphasisedBgHover: exports.colourInteractiveEmphasisedBgHover,\n colourInteractiveEmphasisedBgHoverRgb: exports.colourInteractiveEmphasisedBgHoverRgb,\n colourInteractiveEmphasisedBgPressed: exports.colourInteractiveEmphasisedBgPressed,\n colourInteractiveEmphasisedBgPressedRgb: exports.colourInteractiveEmphasisedBgPressedRgb,\n colourInteractiveSecondaryBgDefault: exports.colourInteractiveSecondaryBgDefault,\n colourInteractiveSecondaryBgDefaultRgb: exports.colourInteractiveSecondaryBgDefaultRgb,\n colourInteractiveSecondaryBgHover: exports.colourInteractiveSecondaryBgHover,\n colourInteractiveSecondaryBgHoverRgb: exports.colourInteractiveSecondaryBgHoverRgb,\n colourInteractiveSecondaryBgPressed: exports.colourInteractiveSecondaryBgPressed,\n colourInteractiveSecondaryBgPressedRgb: exports.colourInteractiveSecondaryBgPressedRgb,\n colourInteractiveSubtleBgDefault: exports.colourInteractiveSubtleBgDefault,\n colourInteractiveSubtleBgDefaultRgb: exports.colourInteractiveSubtleBgDefaultRgb,\n colourInteractiveSubtleBgHover: exports.colourInteractiveSubtleBgHover,\n colourInteractiveSubtleBgHoverRgb: exports.colourInteractiveSubtleBgHoverRgb,\n colourInteractiveSubtleBgPressed: exports.colourInteractiveSubtleBgPressed,\n colourInteractiveSubtleBgPressedRgb: exports.colourInteractiveSubtleBgPressedRgb,\n colourInteractiveDestructiveBgDefault: exports.colourInteractiveDestructiveBgDefault,\n colourInteractiveDestructiveBgDefaultRgb: exports.colourInteractiveDestructiveBgDefaultRgb,\n colourInteractiveDestructiveBgHover: exports.colourInteractiveDestructiveBgHover,\n colourInteractiveDestructiveBgHoverRgb: exports.colourInteractiveDestructiveBgHoverRgb,\n colourInteractiveDestructiveBgPressed: exports.colourInteractiveDestructiveBgPressed,\n colourInteractiveDestructiveBgPressedRgb: exports.colourInteractiveDestructiveBgPressedRgb,\n colourInteractiveDisabled1: exports.colourInteractiveDisabled1,\n colourInteractiveDisabled1Rgb: exports.colourInteractiveDisabled1Rgb,\n colourInteractiveDisabled2: exports.colourInteractiveDisabled2,\n colourInteractiveDisabled2Rgb: exports.colourInteractiveDisabled2Rgb,\n colourInteractiveDisabled3: exports.colourInteractiveDisabled3,\n colourInteractiveDisabled3Rgb: exports.colourInteractiveDisabled3Rgb,\n colourInteractiveEmphasisedBorderSelected: exports.colourInteractiveEmphasisedBorderSelected,\n colourInteractiveEmphasisedBorderSelectedRgb: exports.colourInteractiveEmphasisedBorderSelectedRgb,\n colourInteractiveSubtleBorderSelected: exports.colourInteractiveSubtleBorderSelected,\n colourInteractiveSubtleBorderSelectedRgb: exports.colourInteractiveSubtleBorderSelectedRgb,\n colourInteractiveSubtleBorderDefault: exports.colourInteractiveSubtleBorderDefault,\n colourInteractiveSubtleBorderDefaultRgb: exports.colourInteractiveSubtleBorderDefaultRgb,\n colourInteractiveSubtleBorderHover: exports.colourInteractiveSubtleBorderHover,\n colourInteractiveSubtleBorderHoverRgb: exports.colourInteractiveSubtleBorderHoverRgb,\n colourInteractiveSubtleBorderPressed: exports.colourInteractiveSubtleBorderPressed,\n colourInteractiveSubtleBorderPressedRgb: exports.colourInteractiveSubtleBorderPressedRgb,\n colourInteractiveStaticPrimaryBgDefault: exports.colourInteractiveStaticPrimaryBgDefault,\n colourInteractiveStaticPrimaryBgDefaultRgb: exports.colourInteractiveStaticPrimaryBgDefaultRgb,\n colourInteractiveStaticPrimaryBgHover: exports.colourInteractiveStaticPrimaryBgHover,\n colourInteractiveStaticPrimaryBgHoverRgb: exports.colourInteractiveStaticPrimaryBgHoverRgb,\n colourInteractiveStaticPrimaryBgPressed: exports.colourInteractiveStaticPrimaryBgPressed,\n colourInteractiveStaticPrimaryBgPressedRgb: exports.colourInteractiveStaticPrimaryBgPressedRgb,\n colourInteractiveStaticSecondaryBgDefault: exports.colourInteractiveStaticSecondaryBgDefault,\n colourInteractiveStaticSecondaryBgDefaultRgb: exports.colourInteractiveStaticSecondaryBgDefaultRgb,\n colourInteractiveStaticSecondaryBgHover: exports.colourInteractiveStaticSecondaryBgHover,\n colourInteractiveStaticSecondaryBgHoverRgb: exports.colourInteractiveStaticSecondaryBgHoverRgb,\n colourInteractiveStaticSecondaryBgPressed: exports.colourInteractiveStaticSecondaryBgPressed,\n colourInteractiveStaticSecondaryBgPressedRgb: exports.colourInteractiveStaticSecondaryBgPressedRgb,\n colourStaticIkeaBrandBlue: exports.colourStaticIkeaBrandBlue,\n colourStaticIkeaBrandBlueRgb: exports.colourStaticIkeaBrandBlueRgb,\n colourStaticIkeaBrandYellow: exports.colourStaticIkeaBrandYellow,\n colourStaticIkeaBrandYellowRgb: exports.colourStaticIkeaBrandYellowRgb,\n colourStaticIkeaFamily: exports.colourStaticIkeaFamily,\n colourStaticIkeaFamilyRgb: exports.colourStaticIkeaFamilyRgb,\n colourStaticWhite: exports.colourStaticWhite,\n colourStaticWhiteRgb: exports.colourStaticWhiteRgb,\n colourStaticBlack: exports.colourStaticBlack,\n colourStaticBlackRgb: exports.colourStaticBlackRgb,\n colourStaticDarkGrey: exports.colourStaticDarkGrey,\n colourStaticDarkGreyRgb: exports.colourStaticDarkGreyRgb,\n colourStaticGrey: exports.colourStaticGrey,\n colourStaticGreyRgb: exports.colourStaticGreyRgb,\n colourStaticLightGrey: exports.colourStaticLightGrey,\n colourStaticLightGreyRgb: exports.colourStaticLightGreyRgb,\n colourStaticIkeaBusinessNetwork: exports.colourStaticIkeaBusinessNetwork,\n colourStaticIkeaBusinessNetworkRgb: exports.colourStaticIkeaBusinessNetworkRgb,\n colourElevation1: exports.colourElevation1,\n colourElevation1Rgb: exports.colourElevation1Rgb,\n colourElevation2: exports.colourElevation2,\n colourElevation2Rgb: exports.colourElevation2Rgb,\n colourElevation3: exports.colourElevation3,\n colourElevation3Rgb: exports.colourElevation3Rgb,\n colourElevation1Border: exports.colourElevation1Border,\n colourElevation1BorderRgb: exports.colourElevation1BorderRgb,\n colourElevation2Border: exports.colourElevation2Border,\n colourElevation2BorderRgb: exports.colourElevation2BorderRgb,\n colourCommercialMessageNew: exports.colourCommercialMessageNew,\n colourCommercialMessageNewRgb: exports.colourCommercialMessageNewRgb,\n colourCommercialMessageNewLowerPrice: exports.colourCommercialMessageNewLowerPrice,\n colourCommercialMessageNewLowerPriceRgb: exports.colourCommercialMessageNewLowerPriceRgb,\n colourCommercialMessageIkeaFamily: exports.colourCommercialMessageIkeaFamily,\n colourCommercialMessageIkeaFamilyRgb: exports.colourCommercialMessageIkeaFamilyRgb,\n colourCommercialMessageBtiYellow: exports.colourCommercialMessageBtiYellow,\n colourCommercialMessageBtiYellowRgb: exports.colourCommercialMessageBtiYellowRgb,\n colourCommercialMessageBtiRed: exports.colourCommercialMessageBtiRed,\n colourCommercialMessageBtiRedRgb: exports.colourCommercialMessageBtiRedRgb,\n colourCampaignSustainability: exports.colourCampaignSustainability,\n colourCampaignSustainabilityRgb: exports.colourCampaignSustainabilityRgb\n};\n","\"use strict\";\n// Do not make edits in this file!\n// This file is automatically generated and any changes will be overwritten.\n// To fetch new design tokens check the design-system/README.md\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.durationStandardMobileNative = exports.durationStandardXlScreen = exports.durationSlowWeb = exports.durationSlowMobileNative = exports.durationSlowXlScreen = exports.shadowSizeDefault = exports.space1350 = exports.space1000 = exports.space750 = exports.space550 = exports.space400 = exports.space300 = exports.space250 = exports.space200 = exports.space150 = exports.space125 = exports.space100 = exports.space75 = exports.space50 = exports.space25 = exports.radiusCap = exports.radiusXl = exports.radiusL = exports.radiusM = exports.radiusS = exports.radiusNone = exports.thicknessThick = exports.thicknessThin = exports.fontWeightRegular = exports.fontWeightBold = exports.fontSize1600 = exports.fontSize1500 = exports.fontSize1400 = exports.fontSize1300 = exports.fontSize1200 = exports.fontSize1100 = exports.fontSize1000 = exports.fontSize900 = exports.fontSize800 = exports.fontSize700 = exports.fontSize600 = exports.fontSize500 = exports.fontSize400 = exports.fontSize300 = exports.fontSize200 = exports.fontSize100 = exports.fontSize75 = exports.fontSize50 = exports.fontSize25 = exports.fontSize20 = void 0;\nexports.lineHeight1200Short = exports.lineHeight1100Long = exports.lineHeight1100Short = exports.lineHeight1000Long = exports.lineHeight1000Short = exports.lineHeight900Long = exports.lineHeight900Short = exports.lineHeight800Long = exports.lineHeight800Short = exports.lineHeight700Long = exports.lineHeight700Short = exports.lineHeight600Long = exports.lineHeight600Short = exports.lineHeight500Long = exports.lineHeight500Short = exports.lineHeight400Long = exports.lineHeight400Short = exports.lineHeight300Long = exports.lineHeight300Short = exports.lineHeight200Long = exports.lineHeight200Short = exports.lineHeight100Long = exports.lineHeight100Short = exports.lineHeight75Long = exports.lineHeight75Short = exports.lineHeight50Long = exports.lineHeight50Short = exports.lineHeight25Long = exports.lineHeight25Short = exports.lineHeight20Long = exports.lineHeight20Short = exports.breakpointM = exports.breakpointL = exports.breakpointXl = exports.delayTight = exports.delayStandard = exports.delayEmphasised = exports.easeEasy = exports.easeExpressive = exports.easeEnter = exports.easeExit = exports.easeBob = exports.easeLinear = exports.durationInstantWeb = exports.durationInstantMobileNative = exports.durationInstantXlScreen = exports.durationQuickWeb = exports.durationQuickMobileNative = exports.durationQuickXlScreen = exports.durationStandardWeb = void 0;\nexports.letterSpacing1600 = exports.letterSpacing1500 = exports.letterSpacing1400 = exports.letterSpacing1300 = exports.letterSpacing1200 = exports.letterSpacing1100 = exports.letterSpacing1000 = exports.letterSpacing900 = exports.letterSpacing800 = exports.letterSpacing700 = exports.letterSpacing600 = exports.letterSpacing500 = exports.letterSpacing400 = exports.letterSpacing300 = exports.letterSpacing200 = exports.letterSpacing100 = exports.letterSpacing75 = exports.letterSpacing50 = exports.letterSpacing25 = exports.letterSpacing20 = exports.lineHeight1600Long = exports.lineHeight1600Short = exports.lineHeight1500Long = exports.lineHeight1500Short = exports.lineHeight1400Long = exports.lineHeight1400Short = exports.lineHeight1300Long = exports.lineHeight1300Short = exports.lineHeight1200Long = void 0;\n/**\n * 0.625rem\n */\nexports.fontSize20 = '0.625rem';\n/**\n * 0.6875rem\n */\nexports.fontSize25 = '0.6875rem';\n/**\n * 0.75rem\n */\nexports.fontSize50 = '0.75rem';\n/**\n * 0.875rem\n */\nexports.fontSize75 = '0.875rem';\n/**\n * 1rem\n */\nexports.fontSize100 = '1rem';\n/**\n * 1.125rem\n */\nexports.fontSize200 = '1.125rem';\n/**\n * 1.25rem\n */\nexports.fontSize300 = '1.25rem';\n/**\n * 1.375rem\n */\nexports.fontSize400 = '1.375rem';\n/**\n * 1.5rem\n */\nexports.fontSize500 = '1.5rem';\n/**\n * 1.75rem\n */\nexports.fontSize600 = '1.75rem';\n/**\n * 2rem\n */\nexports.fontSize700 = '2rem';\n/**\n * 2.25rem\n */\nexports.fontSize800 = '2.25rem';\n/**\n * 2.5rem\n */\nexports.fontSize900 = '2.5rem';\n/**\n * 3rem\n */\nexports.fontSize1000 = '3rem';\n/**\n * 3.25rem\n */\nexports.fontSize1100 = '3.25rem';\n/**\n * 3.5rem\n */\nexports.fontSize1200 = '3.5rem';\n/**\n * 4rem\n */\nexports.fontSize1300 = '4rem';\n/**\n * 4.4375rem\n */\nexports.fontSize1400 = '4.4375rem';\n/**\n * 5rem\n */\nexports.fontSize1500 = '5rem';\n/**\n * 6rem\n */\nexports.fontSize1600 = '6rem';\n/**\n * 700\n */\nexports.fontWeightBold = 700;\n/**\n * 400\n */\nexports.fontWeightRegular = 400;\n/**\n * 1px\n */\nexports.thicknessThin = '1px';\n/**\n * 2px\n */\nexports.thicknessThick = '2px';\n/**\n * 0px\n */\nexports.radiusNone = '0px';\n/**\n * 4px\n */\nexports.radiusS = '4px';\n/**\n * 8px\n */\nexports.radiusM = '8px';\n/**\n * 12px\n */\nexports.radiusL = '12px';\n/**\n * 20px\n */\nexports.radiusXl = '20px';\n/**\n * 64px\n */\nexports.radiusCap = '64px';\n/**\n * 0.25rem\n */\nexports.space25 = '0.25rem';\n/**\n * 0.5rem\n */\nexports.space50 = '0.5rem';\n/**\n * 0.75rem\n */\nexports.space75 = '0.75rem';\n/**\n * 1rem\n */\nexports.space100 = '1rem';\n/**\n * 1.25rem\n */\nexports.space125 = '1.25rem';\n/**\n * 1.5rem\n */\nexports.space150 = '1.5rem';\n/**\n * 2rem\n */\nexports.space200 = '2rem';\n/**\n * 2.5rem\n */\nexports.space250 = '2.5rem';\n/**\n * 3rem\n */\nexports.space300 = '3rem';\n/**\n * 4rem\n */\nexports.space400 = '4rem';\n/**\n * 5.5rem\n */\nexports.space550 = '5.5rem';\n/**\n * 7.5rem\n */\nexports.space750 = '7.5rem';\n/**\n * 10rem\n */\nexports.space1000 = '10rem';\n/**\n * 13.5rem\n */\nexports.space1350 = '13.5rem';\n/**\n * 0px 4px 16px rgba(0, 0, 0, 0.1)\n */\nexports.shadowSizeDefault = '0px 4px 16px rgba(0, 0, 0, 0.1)';\n/**\n * 800ms\n */\nexports.durationSlowXlScreen = '800ms';\n/**\n * 400ms\n */\nexports.durationSlowMobileNative = '400ms';\n/**\n * 250ms\n */\nexports.durationSlowWeb = '250ms';\n/**\n * 600ms\n */\nexports.durationStandardXlScreen = '600ms';\n/**\n * 300ms\n */\nexports.durationStandardMobileNative = '300ms';\n/**\n * 200ms\n */\nexports.durationStandardWeb = '200ms';\n/**\n * 300ms\n */\nexports.durationQuickXlScreen = '300ms';\n/**\n * 150ms\n */\nexports.durationQuickMobileNative = '150ms';\n/**\n * 100ms\n */\nexports.durationQuickWeb = '100ms';\n/**\n * 0\n */\nexports.durationInstantXlScreen = 0;\n/**\n * 0\n */\nexports.durationInstantMobileNative = 0;\n/**\n * 0\n */\nexports.durationInstantWeb = 0;\n/**\n * cubic-bezier(0,0,1,1)\n */\nexports.easeLinear = 'cubic-bezier(0,0,1,1)';\n/**\n * cubic-bezier(0.45, 1.45, 0.65, 1.0)\n */\nexports.easeBob = 'cubic-bezier(0.45, 1.45, 0.65, 1.0)';\n/**\n * cubic-bezier(0.9, 0.0, 1.0, 1.0)\n */\nexports.easeExit = 'cubic-bezier(0.9, 0.0, 1.0, 1.0)';\n/**\n * cubic-bezier(0.0, 0.0, 0.1, 1.0)\n */\nexports.easeEnter = 'cubic-bezier(0.0, 0.0, 0.1, 1.0)';\n/**\n * cubic-bezier(0.8, 0.0, 0.0, 1.0)\n */\nexports.easeExpressive = 'cubic-bezier(0.8, 0.0, 0.0, 1.0)';\n/**\n * cubic-bezier(0.4, 0.0, 0.4, 1.0)\n */\nexports.easeEasy = 'cubic-bezier(0.4, 0.0, 0.4, 1.0)';\n/**\n * 150ms\n */\nexports.delayEmphasised = '150ms';\n/**\n * 100ms\n */\nexports.delayStandard = '100ms';\n/**\n * 33ms\n */\nexports.delayTight = '33ms';\n/**\n * 75em\n */\nexports.breakpointXl = '75em';\n/**\n * 56.25em\n */\nexports.breakpointL = '56.25em';\n/**\n * 37.5em\n */\nexports.breakpointM = '37.5em';\n/**\n * 1.400\n */\nexports.lineHeight20Short = '1.400';\n/**\n * 1.400\n */\nexports.lineHeight20Long = '1.400';\n/**\n * 1.450\n */\nexports.lineHeight25Short = '1.450';\n/**\n * 1.450\n */\nexports.lineHeight25Long = '1.450';\n/**\n * 1.500\n */\nexports.lineHeight50Short = '1.500';\n/**\n * 1.500\n */\nexports.lineHeight50Long = '1.500';\n/**\n * 1.571\n */\nexports.lineHeight75Short = '1.571';\n/**\n * 1.571\n */\nexports.lineHeight75Long = '1.571';\n/**\n * 1.500\n */\nexports.lineHeight100Short = '1.500';\n/**\n * 1.625\n */\nexports.lineHeight100Long = '1.625';\n/**\n * 1.444\n */\nexports.lineHeight200Short = '1.444';\n/**\n * 1.555\n */\nexports.lineHeight200Long = '1.555';\n/**\n * 1.400\n */\nexports.lineHeight300Short = '1.400';\n/**\n * 1.600\n */\nexports.lineHeight300Long = '1.600';\n/**\n * 1.364\n */\nexports.lineHeight400Short = '1.364';\n/**\n * 1.545\n */\nexports.lineHeight400Long = '1.545';\n/**\n * 1.450\n */\nexports.lineHeight500Short = '1.450';\n/**\n * 1.670\n */\nexports.lineHeight500Long = '1.670';\n/**\n * 1.357\n */\nexports.lineHeight600Short = '1.357';\n/**\n * 1.570\n */\nexports.lineHeight600Long = '1.570';\n/**\n * 1.375\n */\nexports.lineHeight700Short = '1.375';\n/**\n * 1.500\n */\nexports.lineHeight700Long = '1.500';\n/**\n * 1.333\n */\nexports.lineHeight800Short = '1.333';\n/**\n * 1.500\n */\nexports.lineHeight800Long = '1.500';\n/**\n * 1.300\n */\nexports.lineHeight900Short = '1.300';\n/**\n * 1.500\n */\nexports.lineHeight900Long = '1.500';\n/**\n * 1.300\n */\nexports.lineHeight1000Short = '1.300';\n/**\n * 1.460\n */\nexports.lineHeight1000Long = '1.460';\n/**\n * 1.320\n */\nexports.lineHeight1100Short = '1.320';\n/**\n * 1.520\n */\nexports.lineHeight1100Long = '1.520';\n/**\n * 1.357\n */\nexports.lineHeight1200Short = '1.357';\n/**\n * 1.500\n */\nexports.lineHeight1200Long = '1.500';\n/**\n * 1.300\n */\nexports.lineHeight1300Short = '1.300';\n/**\n * 1.500\n */\nexports.lineHeight1300Long = '1.500';\n/**\n * 1.280\n */\nexports.lineHeight1400Short = '1.280';\n/**\n * 1.500\n */\nexports.lineHeight1400Long = '1.500';\n/**\n * 1.300\n */\nexports.lineHeight1500Short = '1.300';\n/**\n * 1.500\n */\nexports.lineHeight1500Long = '1.500';\n/**\n * 1.290\n */\nexports.lineHeight1600Short = '1.290';\n/**\n * 1.500\n */\nexports.lineHeight1600Long = '1.500';\n/**\n * 0em\n */\nexports.letterSpacing20 = '0em';\n/**\n * 0em\n */\nexports.letterSpacing25 = '0em';\n/**\n * 0em\n */\nexports.letterSpacing50 = '0em';\n/**\n * 0em\n */\nexports.letterSpacing75 = '0em';\n/**\n * 0em\n */\nexports.letterSpacing100 = '0em';\n/**\n * 0em\n */\nexports.letterSpacing200 = '0em';\n/**\n * 0em\n */\nexports.letterSpacing300 = '0em';\n/**\n * -0.0039em\n */\nexports.letterSpacing400 = '-0.0039em';\n/**\n * -0.0042em\n */\nexports.letterSpacing500 = '-0.0042em';\n/**\n * -0.0049em\n */\nexports.letterSpacing600 = '-0.0049em';\n/**\n * -0.0056em\n */\nexports.letterSpacing700 = '-0.0056em';\n/**\n * -0.0063em\n */\nexports.letterSpacing800 = '-0.0063em';\n/**\n * -0.007em\n */\nexports.letterSpacing900 = '-0.007em';\n/**\n * -0.0084em\n */\nexports.letterSpacing1000 = '-0.0084em';\n/**\n * -0.0091em\n */\nexports.letterSpacing1100 = '-0.0091em';\n/**\n * -0.0098em\n */\nexports.letterSpacing1200 = '-0.0098em';\n/**\n * -0.011em\n */\nexports.letterSpacing1300 = '-0.011em';\n/**\n * -0.0124em\n */\nexports.letterSpacing1400 = '-0.0124em';\n/**\n * -0.014em\n */\nexports.letterSpacing1500 = '-0.014em';\n/**\n * -0.0168em\n */\nexports.letterSpacing1600 = '-0.0168em';\nexports.default = {\n fontSize20: exports.fontSize20,\n fontSize25: exports.fontSize25,\n fontSize50: exports.fontSize50,\n fontSize75: exports.fontSize75,\n fontSize100: exports.fontSize100,\n fontSize200: exports.fontSize200,\n fontSize300: exports.fontSize300,\n fontSize400: exports.fontSize400,\n fontSize500: exports.fontSize500,\n fontSize600: exports.fontSize600,\n fontSize700: exports.fontSize700,\n fontSize800: exports.fontSize800,\n fontSize900: exports.fontSize900,\n fontSize1000: exports.fontSize1000,\n fontSize1100: exports.fontSize1100,\n fontSize1200: exports.fontSize1200,\n fontSize1300: exports.fontSize1300,\n fontSize1400: exports.fontSize1400,\n fontSize1500: exports.fontSize1500,\n fontSize1600: exports.fontSize1600,\n fontWeightBold: exports.fontWeightBold,\n fontWeightRegular: exports.fontWeightRegular,\n thicknessThin: exports.thicknessThin,\n thicknessThick: exports.thicknessThick,\n radiusNone: exports.radiusNone,\n radiusS: exports.radiusS,\n radiusM: exports.radiusM,\n radiusL: exports.radiusL,\n radiusXl: exports.radiusXl,\n radiusCap: exports.radiusCap,\n space25: exports.space25,\n space50: exports.space50,\n space75: exports.space75,\n space100: exports.space100,\n space125: exports.space125,\n space150: exports.space150,\n space200: exports.space200,\n space250: exports.space250,\n space300: exports.space300,\n space400: exports.space400,\n space550: exports.space550,\n space750: exports.space750,\n space1000: exports.space1000,\n space1350: exports.space1350,\n shadowSizeDefault: exports.shadowSizeDefault,\n durationSlowXlScreen: exports.durationSlowXlScreen,\n durationSlowMobileNative: exports.durationSlowMobileNative,\n durationSlowWeb: exports.durationSlowWeb,\n durationStandardXlScreen: exports.durationStandardXlScreen,\n durationStandardMobileNative: exports.durationStandardMobileNative,\n durationStandardWeb: exports.durationStandardWeb,\n durationQuickXlScreen: exports.durationQuickXlScreen,\n durationQuickMobileNative: exports.durationQuickMobileNative,\n durationQuickWeb: exports.durationQuickWeb,\n durationInstantXlScreen: exports.durationInstantXlScreen,\n durationInstantMobileNative: exports.durationInstantMobileNative,\n durationInstantWeb: exports.durationInstantWeb,\n easeLinear: exports.easeLinear,\n easeBob: exports.easeBob,\n easeExit: exports.easeExit,\n easeEnter: exports.easeEnter,\n easeExpressive: exports.easeExpressive,\n easeEasy: exports.easeEasy,\n delayEmphasised: exports.delayEmphasised,\n delayStandard: exports.delayStandard,\n delayTight: exports.delayTight,\n breakpointXl: exports.breakpointXl,\n breakpointL: exports.breakpointL,\n breakpointM: exports.breakpointM,\n lineHeight20Short: exports.lineHeight20Short,\n lineHeight20Long: exports.lineHeight20Long,\n lineHeight25Short: exports.lineHeight25Short,\n lineHeight25Long: exports.lineHeight25Long,\n lineHeight50Short: exports.lineHeight50Short,\n lineHeight50Long: exports.lineHeight50Long,\n lineHeight75Short: exports.lineHeight75Short,\n lineHeight75Long: exports.lineHeight75Long,\n lineHeight100Short: exports.lineHeight100Short,\n lineHeight100Long: exports.lineHeight100Long,\n lineHeight200Short: exports.lineHeight200Short,\n lineHeight200Long: exports.lineHeight200Long,\n lineHeight300Short: exports.lineHeight300Short,\n lineHeight300Long: exports.lineHeight300Long,\n lineHeight400Short: exports.lineHeight400Short,\n lineHeight400Long: exports.lineHeight400Long,\n lineHeight500Short: exports.lineHeight500Short,\n lineHeight500Long: exports.lineHeight500Long,\n lineHeight600Short: exports.lineHeight600Short,\n lineHeight600Long: exports.lineHeight600Long,\n lineHeight700Short: exports.lineHeight700Short,\n lineHeight700Long: exports.lineHeight700Long,\n lineHeight800Short: exports.lineHeight800Short,\n lineHeight800Long: exports.lineHeight800Long,\n lineHeight900Short: exports.lineHeight900Short,\n lineHeight900Long: exports.lineHeight900Long,\n lineHeight1000Short: exports.lineHeight1000Short,\n lineHeight1000Long: exports.lineHeight1000Long,\n lineHeight1100Short: exports.lineHeight1100Short,\n lineHeight1100Long: exports.lineHeight1100Long,\n lineHeight1200Short: exports.lineHeight1200Short,\n lineHeight1200Long: exports.lineHeight1200Long,\n lineHeight1300Short: exports.lineHeight1300Short,\n lineHeight1300Long: exports.lineHeight1300Long,\n lineHeight1400Short: exports.lineHeight1400Short,\n lineHeight1400Long: exports.lineHeight1400Long,\n lineHeight1500Short: exports.lineHeight1500Short,\n lineHeight1500Long: exports.lineHeight1500Long,\n lineHeight1600Short: exports.lineHeight1600Short,\n lineHeight1600Long: exports.lineHeight1600Long,\n letterSpacing20: exports.letterSpacing20,\n letterSpacing25: exports.letterSpacing25,\n letterSpacing50: exports.letterSpacing50,\n letterSpacing75: exports.letterSpacing75,\n letterSpacing100: exports.letterSpacing100,\n letterSpacing200: exports.letterSpacing200,\n letterSpacing300: exports.letterSpacing300,\n letterSpacing400: exports.letterSpacing400,\n letterSpacing500: exports.letterSpacing500,\n letterSpacing600: exports.letterSpacing600,\n letterSpacing700: exports.letterSpacing700,\n letterSpacing800: exports.letterSpacing800,\n letterSpacing900: exports.letterSpacing900,\n letterSpacing1000: exports.letterSpacing1000,\n letterSpacing1100: exports.letterSpacing1100,\n letterSpacing1200: exports.letterSpacing1200,\n letterSpacing1300: exports.letterSpacing1300,\n letterSpacing1400: exports.letterSpacing1400,\n letterSpacing1500: exports.letterSpacing1500,\n letterSpacing1600: exports.letterSpacing1600\n};\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nconst colors = __importStar(require(\"@ingka/variables/colours-css\"));\nconst tokens = __importStar(require(\"@ingka/variables/design-tokens\"));\n/**\n * This is the style class for SummaryPage.\n */\nclass SummaryPagePrintStyle {\n /**\n * Returns styles.\n *\n * @param options\n * @param options.isSafari\n */\n static getStyle(options) {\n const safariStyles = (0, web_component_1.css) `\n\t\t\t/* Safari doesn't support using vh to target page height in print. Instead\n\t\t\twe set the screenshot to a fixed height that should fit most of the time. */\n\t\t\t.print-header {\n\t\t\t\theight: auto;\n\t\t\t}\n\n\t\t\t.screenshot {\n\t\t\t\tmax-height: 120mm;\n\t\t\t}\n\t\t`;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\n\t\t\t:host {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\t.copyright-notice,\n\t\t\t.footer-text,\n\t\t\t.footer-logo {\n\t\t\t\twhite-space: nowrap;\n\t\t\t\tcolor: ${colors.colourTextAndIcon3};\n\t\t\t\tprint-color-adjust: exact;\n\t\t\t\t-webkit-print-color-adjust: exact;\n\t\t\t}\n\n\t\t\t.copyright-notice {\n\t\t\t\tposition: fixed;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 100%;\n\t\t\t\ttransform-origin: top left;\n\t\t\t\ttransform: rotate(90deg);\n\t\t\t\tfont-size: 8px;\n\t\t\t}\n\n\t\t\t.footer-text {\n\t\t\t\tposition: fixed;\n\t\t\t\tbottom: 0;\n\t\t\t\tleft: 0.25in;\n\t\t\t\tfont-size: 12px;\n\t\t\t}\n\n\t\t\t.footer-logo {\n\t\t\t\tposition: absolute;\n\t\t\t\tbottom: 0;\n\t\t\t\tright: 0.25in;\n\t\t\t}\n\n\t\t\t.footer-logo svg {\n\t\t\t\tdisplay: block;\n\t\t\t\twidth: 120px;\n\t\t\t\theight: 48px;\n\t\t\t}\n\n\t\t\t/* Making the IKEA logo black and white */\n\t\t\t.footer-logo svg path:nth-child(1),\n\t\t\t.footer-logo svg path:nth-child(3) {\n\t\t\t\tfill: black;\n\t\t\t}\n\t\t\t.footer-logo svg path:nth-child(2) {\n\t\t\t\tfill: white;\n\t\t\t}\n\n\t\t\t.title {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t.qr-code {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-shrink: 0;\n\t\t\t\twidth: ${130 / 16}rem;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\t.qr-code-text {\n\t\t\t\tmargin: 0;\n\t\t\t\ttext-align: center;\n\t\t\t}\n\n\t\t\t.print-header {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\tbreak-after: page;\n\t\t\t\theight: calc(100vh - 48px - ${tokens.space300});\n\t\t\t}\n\n\t\t\t.print-details {\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: space-between;\n\t\t\t\tmargin-top: ${tokens.space150};\n\t\t\t\tgap: ${tokens.space200};\n\t\t\t}\n\n\t\t\t.compactPriceWrapper {\n\t\t\t\tmargin-top: ${tokens.space25};\n\t\t\t}\n\n\t\t\t.compactPrice {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t.compactPrice,\n\t\t\t.compactCommercialMessage {\n\t\t\t\tfont-weight: 600;\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t.designCodeInfo {\n\t\t\t\tmargin-top: ${tokens.space200};\n\t\t\t}\n\n\t\t\t.screenshot-wrapper {\n\t\t\t\twidth: 100%;\n\t\t\t\tflex: 1;\n\t\t\t}\n\n\t\t\t.screenshot {\n\t\t\t\twidth: 100%;\n\t\t\t\tflex: 1;\n\t\t\t\tmin-height: 0;\n\t\t\t\tobject-fit: contain;\n\t\t\t\tobject-position: top;\n\t\t\t\tmargin-top: ${tokens.space150};\n\t\t\t}\n\n\t\t\t@media print {\n\t\t\t\t:host {\n\t\t\t\t\tdisplay: initial;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t${options.isSafari ? safariStyles : ''}\n\t\t`;\n }\n static getPrintStyle() {\n // We need this @page rule to be set in the root document and not the shadow\n // dom of the current component for the browser to pick it up. The style\n // returned by printPrintStyle will be inserted into the DOM before print\n // and removed after print. This prevents \"collisions\" with other print\n // rules that the planner might have.\n return (0, web_component_1.css) `\n\t\t\t@page {\n\t\t\t\tsize: A4 portrait;\n\t\t\t\t/* Most printers add a 0.25 inch margin to the printed page. Safari\n\t\t\t\tdoesn't have support for the @page rule so we set the side margin to\n\t\t\t\t0.25 in all browsers to match Safari. We then add the additional 0.5\n\t\t\t\tinch using standard CSS margin in the parent component to make out the\n\t\t\t\tfull 1 inch required by the IKEA guidelines. We don't care as much about\n\t\t\t\tthe top and bottom margin as browsers will set these differently to fit\n\t\t\t\tthe browser generated page numbers and meta data. For those browsers\n\t\t\t\tthat respect it we set the margin to 0.75 to once again reach the 1\n\t\t\t\tinch. */\n\t\t\t\tmargin: 0.75in 0.25in;\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = SummaryPagePrintStyle;\n//# sourceMappingURL=SummaryPagePrintStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_configuration_summary_1 = require(\"@inter-ikea-kompis/component-configuration-summary\");\nconst insights_data_provider_1 = require(\"@insights/insights-data-provider\");\nrequire(\"@inter-ikea-kompis/component-qr-code\");\nrequire(\"@inter-ikea-kompis/component-price-formatter\");\nconst SummaryPageConfigurationMeasureEnum_1 = __importDefault(require(\"../../enums/SummaryPageConfigurationMeasureEnum\"));\nconst SummaryPageBrowserUtility_1 = __importDefault(require(\"../../utilities/SummaryPageBrowserUtility\"));\nconst SummaryPageMeasurementUtility_1 = __importDefault(require(\"../../utilities/SummaryPageMeasurementUtility\"));\nconst IkeaLogo_1 = __importDefault(require(\"../summary-page-header/IkeaLogo\"));\nconst SummaryPagePrintStyle_1 = __importDefault(require(\"./SummaryPagePrintStyle\"));\n/**\n * The printview for the Summary Page.\n */\nlet SummaryPagePrint = class SummaryPagePrint extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // Controls how measurements should be shown in the configuration summary.\n this.configurationMeasures = SummaryPageConfigurationMeasureEnum_1.default.short;\n // The url for the screenshot.\n this.screenshotUrl = null;\n // The alt text for the screenshot. If not set, a default alt text will be used.\n this.screenshotAlt = null;\n // The name of the product, e.g. PLATSA. If set is transformed to uppercase and used in the title of the printed page.\n this.productName = null;\n // VPC code for the solution.\n this.vpcCode = null;\n // Measurements of height, width and depth in millimeter. Can be left empty to hide dimensions.\n this.measurements = null;\n // Used as a link for the QR code. When copied, query parameter with vpc source is added.\n this.designLink = null;\n // Shows total package weight of the shopping products.\n this.showTotalPackageWeight = false;\n // A list of included products within SPR products. Must be set when using layout compact print and printing SPR's. Must also be set (if applicable) for total package weight.\n this.includedProductsWithinSprs = null;\n // Name of the store to show in the page footer\n this.storeName = null;\n // Retail unit to show in the page footer\n this.retailUnit = null;\n this.dexfSettings = null;\n this.listeners = {\n beforeprint: this.onBeforePrint.bind(this),\n afterprint: this.onAfterPrint.bind(this)\n };\n this.printStyleTag = null;\n }\n render() {\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.getCopyrightNotice()} ${this.getFooterText()} ${this.getFooterLogo()}\n\t\t\t${this.getPrintHeader()}\n\t\t`;\n }\n /**\n * @override\n */\n connectedCallback() {\n super.connectedCallback();\n window.addEventListener('beforeprint', this.listeners.beforeprint);\n window.addEventListener('afterprint', this.listeners.afterprint);\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n window.removeEventListener('beforeprint', this.listeners.beforeprint);\n window.removeEventListener('afterprint', this.listeners.afterprint);\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n getSettings() {\n return this.dexfSettings;\n }\n onBeforePrint() {\n // For future developers:\n // Anything here must be done synchronously for it to show up in the print\n // view. That means no promises or callbacks. You can modify the content of\n // the component and even re-render it but when you've done your state\n // changes you must call `this.update()` and not `this.requestUpdate()`\n // since the latter returns a promise which you have to await if you want to\n // be sure the update has been applied.\n this.injectPrintCss();\n }\n onAfterPrint() {\n this.removePrintCss();\n }\n injectPrintCss() {\n this.printStyleTag = document.createElement('style');\n this.printStyleTag.textContent = SummaryPagePrintStyle_1.default.getPrintStyle();\n document.head.appendChild(this.printStyleTag);\n }\n removePrintCss() {\n var _a;\n (_a = this.printStyleTag) === null || _a === void 0 ? void 0 : _a.remove();\n this.printStyleTag = null;\n }\n getCopyrightNotice() {\n const year = new Date().getFullYear().toString();\n const text = this.getTranslations().copyrightNotice.replace('{{year}}', year);\n return (0, web_component_1.html) `
    ${text}
    `;\n }\n getFooterText() {\n var _a, _b;\n const retailUnit = (_b = (_a = this.retailUnit) === null || _a === void 0 ? void 0 : _a.toUpperCase()) !== null && _b !== void 0 ? _b : '';\n let text = '';\n if (this.storeName && retailUnit) {\n text = `${this.storeName} (${retailUnit})`;\n }\n else if (retailUnit) {\n text = retailUnit;\n }\n else if (this.storeName) {\n text = this.storeName;\n }\n if (text) {\n text += ', ';\n }\n return (0, web_component_1.html) `
    ${text}${this.getDateString()}
    `;\n }\n getDateString() {\n return utilities_1.DateFormatter.dateToString(new Date(), this.getSettings().localisation.dateFormat);\n }\n getFooterLogo() {\n const footerLogoDiv = document.createElement('div');\n footerLogoDiv.classList.add('footer-logo');\n footerLogoDiv.innerHTML = IkeaLogo_1.default;\n return footerLogoDiv;\n }\n getPrintHeader() {\n var _a, _b;\n // Double spaces left by supplying no product name will be collapsed by the browser.\n const titleText = this.getTranslations().summaryPagePrintTitle.replace('{{product_name}}', (_b = (_a = this.productName) === null || _a === void 0 ? void 0 : _a.toUpperCase()) !== null && _b !== void 0 ? _b : '');\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t

    ${titleText}

    \n\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t${this.getMeasurements()}${this.getTotalPackageWeight()}\n\t\t\t\t\t\t${this.getCompactPrice()}${this.getDesignCodeInfo()}\n\t\t\t\t\t
    \n\n\t\t\t\t\t${this.getQrCode()}\n\t\t\t\t
    \n\n\t\t\t\t${this.getScreenshot()}\n\t\t\t
    \n\t\t`;\n }\n getCompactPrice() {\n const { priceInfoIkeaFamilyPrice, priceInfoRegularPrice } = this.getTranslations();\n const totalPrice = utilities_1.TotalPriceCalculator.calculate(this.shoppingProducts, this.getSettings().localisation.dateFormat);\n const listTotalPrice = utilities_1.PriceUtility.getPrice(totalPrice);\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${totalPrice.family\n ? (0, web_component_1.html) `\n\t\t\t\t\t\t\t

    ${priceInfoIkeaFamilyPrice}

    \n\t\t\t\t\t `\n : ''}\n\t\t\t\t

    \n\t\t\t\t\t\n\t\t\t\t

    \n\t\t\t\t${totalPrice.family\n ? (0, web_component_1.html) `\n\t\t\t\t\t\t\t

    ${priceInfoRegularPrice}

    \n\t\t\t\t\t\t\t

    \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

    \n\t\t\t\t\t `\n : ''}\n\t\t\t
    \n\t\t`;\n }\n getDesignCodeInfo() {\n if (!this.vpcCode) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${this.getTranslations().designCodeTitle} ${this.vpcCode}\n\t\t\t
    \n\t\t`;\n }\n /**\n * Get Measurements.\n * Short or long format depending on prop. Unit is cm/in depending on localizedInformation.\n */\n getMeasurements() {\n if (!this.measurements) {\n return null;\n }\n const useLongFormat = this.configurationMeasures === SummaryPageConfigurationMeasureEnum_1.default.long;\n const measurementRows = SummaryPageMeasurementUtility_1.default.getLocalizedMeasurementRows(this.getTranslations(), this.getSettings().localisation, this.locale, this.measurements, useLongFormat);\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${measurementRows.map((row) => (0, web_component_1.html) `${row}
    `)}\n\t\t\t
    \n\t\t`;\n }\n getTotalPackageWeight() {\n if (!this.showTotalPackageWeight || !this.locale) {\n return null;\n }\n const totalPackageWeightKgs = component_configuration_summary_1.ConfigurationSummaryWeightUtility.getTotalWeightInKg(this.shoppingProducts, this.includedProductsWithinSprs);\n const localizedWeight = component_configuration_summary_1.ConfigurationSummaryWeightUtility.getLocalizedWeight(totalPackageWeightKgs, this.locale, this.getTranslations(), this.getSettings().localisation.useMetricMeasures);\n const localizedWeightText = component_configuration_summary_1.ConfigurationSummaryWeightUtility.getLocalizedWeightHtmlString(localizedWeight);\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t${this.getTranslations().configurationSummaryTotalPackageWeight}: ${localizedWeightText}\n\t\t\t\n\t\t`;\n }\n getScreenshot() {\n var _a;\n // Don't use Kompis image! It loads the image asynchronously and that\n // doesn't work consistently with print.\n return (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n }\n getQrCode() {\n if (!this.designLink) {\n return null;\n }\n return (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t

    ${this.getTranslations().summaryPageQrCodeText}

    \n\t\t\t
    \n\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPagePrint.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPagePrint.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPagePrint.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, required: true })\n], SummaryPagePrint.prototype, \"locale\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array, required: true })\n], SummaryPagePrint.prototype, \"shoppingProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPagePrint.prototype, \"configurationMeasures\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPagePrint.prototype, \"screenshotUrl\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPagePrint.prototype, \"screenshotAlt\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPagePrint.prototype, \"productName\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPagePrint.prototype, \"vpcCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPagePrint.prototype, \"measurements\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPagePrint.prototype, \"designLink\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPagePrint.prototype, \"showTotalPackageWeight\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array })\n], SummaryPagePrint.prototype, \"includedProductsWithinSprs\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPagePrint.prototype, \"storeName\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPagePrint.prototype, \"retailUnit\", void 0);\nSummaryPagePrint = __decorate([\n (0, web_component_1.customElement)('kompis-summary-page-print')\n], SummaryPagePrint);\nexports.default = SummaryPagePrint;\n//# sourceMappingURL=SummaryPagePrint.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar InlineMessageIconEnum;\n(function (InlineMessageIconEnum) {\n InlineMessageIconEnum[\"information\"] = \"information-circle\";\n InlineMessageIconEnum[\"incorrect\"] = \"incorrect\";\n InlineMessageIconEnum[\"warning\"] = \"warning-triangle\";\n InlineMessageIconEnum[\"checkmark\"] = \"checkmark-circle\";\n})(InlineMessageIconEnum || (InlineMessageIconEnum = {}));\nexports.default = InlineMessageIconEnum;\n//# sourceMappingURL=InlineMessageIconEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar InlineMessageLayoutEnum;\n(function (InlineMessageLayoutEnum) {\n InlineMessageLayoutEnum[\"positive\"] = \"positive\";\n InlineMessageLayoutEnum[\"informative\"] = \"informative\";\n InlineMessageLayoutEnum[\"negative\"] = \"negative\";\n InlineMessageLayoutEnum[\"caution\"] = \"caution\";\n InlineMessageLayoutEnum[\"cautionary\"] = \"cautionary\";\n})(InlineMessageLayoutEnum || (InlineMessageLayoutEnum = {}));\nexports.default = InlineMessageLayoutEnum;\n//# sourceMappingURL=InlineMessageLayoutEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst SummaryPageAnalyticsContext = { page: 'summary_page' };\nexports.default = SummaryPageAnalyticsContext;\n//# sourceMappingURL=SummaryPageAnalyticsContext.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst analytics_1 = require(\"@inter-ikea-kompis/analytics\");\nconst insights_data_provider_1 = require(\"@insights/insights-data-provider\");\nconst moduleId = 'summary_page';\n/**\n * Tracks events from Summary Page and sends them to a reporter.\n *\n * @event store_selector_change When store is changed, sends an event with the storeId.\n * @event selected_image_index_change When image is changed in the images tab.\n * @event tab_change When selected tab is changed.\n * @event home_delivery_enter_zip_code When home delivery's check availability button is clicked.\n * @event home_delivery_remove_zip_code When home delivery's forget link or back button is clicked.\n * @event home_delivery_change_zip_code When home delivery's check for another postcode link is clicked.\n * @event home_delivery_open_sheet When home delivery's add postcode link is clicked.\n * @event add_to_cart_availability When add to cart button is clicked. The currently selected availability.\n * @event add_to_list_availability When add to list button is clicked. The currently selected availability.\n * @event product_collected_checked When a product is marked as collected in the product list.\n * @event product_collected_unchecked When a collected product is unchecked in the product list.\n * @event summary_page_initial_configuration When the component is rendered the first time.\n * @event book_assistance_link_click When the book assistance link is clicked.\n * @event click When edit design button or print button is clicked.\n * {@nestedTracker component-save-design-card/src/trackers/SaveDesignCardTracker.ts}.\n * {@nestedTracker component-configuration-summary/src/trackers/ConfigurationSummaryTracker.ts}.\n * {@nestedTracker component-assembly-services/src/trackers/AssemblyServicesTracker.ts}.\n */\nclass SummaryPageTracker extends analytics_1.AbstractAnalyticsTracker {\n constructor(options) {\n super(Object.assign({ moduleId }, options));\n this.context = options.context;\n }\n /**\n * @param payload\n * @param payload.enabledTabs\n * @param payload.qrCode\n * @param payload.screenshot\n * @param payload.measurements\n * @param payload.productList\n * @param payload.productList.designText\n * @param payload.productList.productMeasures\n * @param payload.productList.collectable\n */\n sendInitialConfiguration(payload) {\n this.getReporter().report({\n event: 'summary_page_initial_configuration',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.nonInteraction,\n payload: Object.assign(Object.assign({}, payload), { context: this.context })\n });\n }\n /**\n * @param storeId\n */\n sendStoreSelectorChange(storeId) {\n this.getReporter().report({\n event: 'store_selector_change',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe,\n payload: { storeId, context: this.context }\n });\n }\n /**\n * @param selectedIndex\n * @param numberOfImages\n */\n sendSelectedImageIndexChange(selectedIndex, numberOfImages) {\n this.getReporter().report({\n event: 'selected_image_index_change',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe,\n payload: { selectedIndex, numberOfImages, context: this.context }\n });\n }\n /**\n * @param selectedTab\n */\n sendTabChange(selectedTab) {\n this.getReporter().report({\n event: 'tab_change',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe,\n payload: { selectedTab, context: this.context }\n });\n }\n /**\n * @param zipAvailabilities\n * @param storeAvailabilities\n */\n sendAddToCartAvailability(zipAvailabilities, storeAvailabilities) {\n this.sendAvailabilityEvent('add_to_cart_availability', zipAvailabilities, storeAvailabilities);\n }\n /**\n * @param zipAvailabilities\n * @param storeAvailabilities\n */\n sendAddToListAvailability(zipAvailabilities, storeAvailabilities) {\n this.sendAvailabilityEvent('add_to_list_availability', zipAvailabilities, storeAvailabilities);\n }\n sendHomeDeliveryEnterZipCode() {\n this.getReporter().report({\n event: 'home_delivery_enter_zip_code',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe,\n payload: { context: this.context }\n });\n }\n sendHomeDeliveryRemoveZipCode() {\n this.getReporter().report({\n event: 'home_delivery_remove_zip_code',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe,\n payload: { context: this.context }\n });\n }\n sendHomeDeliveryChangeZipCode() {\n this.getReporter().report({\n event: 'home_delivery_change_zip_code',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe,\n payload: { context: this.context }\n });\n }\n /**\n * @param detail\n * @param detail.collectId\n * @param detail.collected\n * @param vpcCode\n */\n sendCollectProduct({ collectId, collected }, vpcCode) {\n const payload = { collectId, designId: vpcCode, context: this.context };\n if (collected.includes(collectId)) {\n this.getReporter().report({\n event: 'product_collected_checked',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.giveMe,\n payload\n });\n }\n else {\n this.getReporter().report({\n event: 'product_collected_unchecked',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe,\n payload\n });\n }\n }\n /**\n * @param modal\n */\n sendHomeDeliveryOpenSheet() {\n this.getReporter().report({\n event: 'home_delivery_open_sheet',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe,\n payload: { context: this.context }\n });\n }\n /**\n * @param addUnavailableProductsToList\n */\n sendUnavailableProductsModalContinue(addUnavailableProductsToList) {\n this.getReporter().report({\n event: 'unavailable_products_modal_continue',\n payload: { addToList: addUnavailableProductsToList, context: this.context },\n ipexMoment: insights_data_provider_1.IpexMomentEnum.giveMe\n });\n }\n /**\n * @param zipAvailabilities\n * @param storeAvailabilities\n */\n sendAddToCartClickWithAvailability(zipAvailabilities, storeAvailabilities) {\n const homeDeliveryStatus = this.getHomeDeliveryStatus(zipAvailabilities);\n const storeAvailabilityStatus = this.getStoreDeliveryStatus(storeAvailabilities);\n this.getReporter().report({\n event: 'add_to_cart_click',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.giveMe,\n payload: {\n availability: {\n homeDelivery: homeDeliveryStatus,\n store: storeAvailabilityStatus\n },\n context: this.context\n }\n });\n }\n sendBookAssistanceLinkClick() {\n this.getReporter().report({\n event: 'book_assistance_link_click',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.helpMe,\n payload: { context: this.context }\n });\n }\n sendPrintButtonClick() {\n this.getReporter().report({\n event: 'click',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe,\n payload: {\n common: { component: moduleId },\n data: {\n action: 'print'\n },\n context: this.context\n }\n });\n }\n sendEditDesignButtonClick() {\n this.getReporter().report({\n event: 'click',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.whatIsMe,\n payload: {\n common: { component: moduleId },\n data: {\n action: 'edit_design'\n },\n context: this.context\n }\n });\n }\n /**\n * Gets the home delivery status based on current state of summaryPage.zipAvailabilities.\n *\n * - If zipAvailabilities contains only available objects, the result will be 'available'.\n * - If zipAvailabilities contains only unavailable objects, the result will be 'unavailable'.\n * - If zipAvailabilities contains both available and unavailable objects, the result will be 'mixed'.\n * - If zipAvailabilities is empty or homeDelivery is not present, the result will be 'unknown'.\n *\n * @param zipAvailabilities\n * @returns A {@link DeliveryStatus}.\n */\n getHomeDeliveryStatus(zipAvailabilities) {\n return (zipAvailabilities !== null && zipAvailabilities !== void 0 ? zipAvailabilities : []).reduce((deliveryStatus, zipAvailability) => this.maybeUpdateDeliveryStatus(deliveryStatus, zipAvailability.content.availableForHomeDelivery), 'unknown');\n }\n /**\n * Gets the store delivery status based on current state of summaryPage.storeAvailabilities.\n *\n * - If storeAvailabilities contains only available objects, the result will be 'available'.\n * - If storeAvailabilities contains only unavailable objects, the result will be 'unavailable'.\n * - If storeAvailabilities contains both available and unavailable objects, the result will be 'mixed'.\n * - If storeAvailabilities is empty, the result will be 'unknown'.\n *\n * @param storeAvailabilities\n * @returns A {@link DeliveryStatus}.\n */\n getStoreDeliveryStatus(storeAvailabilities) {\n return (storeAvailabilities !== null && storeAvailabilities !== void 0 ? storeAvailabilities : []).reduce((deliveryStatus, storeAvailability) => this.maybeUpdateDeliveryStatus(deliveryStatus, storeAvailability.content.availableForCashCarry), 'unknown');\n }\n /**\n * @param currentStatus The current accumulated status based on product availability.\n * @param availableForDelivery Whether a product is available for delivery.\n * @returns A possibly updated {@link DeliveryStatus}.\n */\n maybeUpdateDeliveryStatus(currentStatus, availableForDelivery) {\n // If already mixed, the status won't change.\n if (currentStatus === 'mixed') {\n return currentStatus;\n }\n if (availableForDelivery) {\n return currentStatus === 'unavailable' ? 'mixed' : 'available';\n }\n else {\n return currentStatus === 'available' ? 'mixed' : 'unavailable';\n }\n }\n /**\n * @param event\n * @param zipAvailabilities\n * @param storeAvailabilities\n */\n sendAvailabilityEvent(event, zipAvailabilities, storeAvailabilities) {\n const homeDeliveryStatus = this.getHomeDeliveryStatus(zipAvailabilities);\n const storeAvailabilityStatus = this.getStoreDeliveryStatus(storeAvailabilities);\n this.getReporter().report({\n event,\n ipexMoment: insights_data_provider_1.IpexMomentEnum.giveMe,\n payload: {\n availability: { homeDelivery: homeDeliveryStatus, store: storeAvailabilityStatus },\n context: this.context\n }\n });\n }\n}\nexports.default = SummaryPageTracker;\n//# sourceMappingURL=SummaryPageTracker.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass SummaryPagePaddingUtility {\n /**\n * Get styles for padding.\n *\n * @param selector The selector for the element which should get a padding.\n * @param theme\n */\n static getHorizontalPadding(selector, theme) {\n const { breakpoint, spacing } = theme;\n const paddings = {\n small: spacing.space150,\n medium: spacing.space200,\n large: spacing.space250,\n xlarge: spacing.space300\n };\n /* XXL in Kompis SkapaTheme is 1920, while Skapas is 1600, so we hardcode it here */\n const xxLargeBreakPoint = 1600;\n return (0, web_component_1.css) `\n\t\t\t${selector} {\n\t\t\t\tpadding-left: ${paddings.small / 16}rem;\n\t\t\t\tpadding-right: ${paddings.small / 16}rem;\n\t\t\t}\n\t\t\t@media (min-width: ${breakpoint.medium.width / 16}rem) {\n\t\t\t\t${selector} {\n\t\t\t\t\tpadding-left: ${paddings.medium / 16}rem;\n\t\t\t\t\tpadding-right: ${paddings.medium / 16}rem;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@media (min-width: ${breakpoint.large.width / 16}rem) {\n\t\t\t\t${selector} {\n\t\t\t\t\tpadding-left: ${paddings.large / 16}rem;\n\t\t\t\t\tpadding-right: ${paddings.large / 16}rem;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@media (min-width: ${breakpoint.xlarge.width / 16}rem) {\n\t\t\t\t${selector} {\n\t\t\t\t\tpadding-left: ${paddings.xlarge / 16}rem;\n\t\t\t\t\tpadding-right: ${paddings.xlarge / 16}rem;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@media (min-width: ${xxLargeBreakPoint / 16}rem) {\n\t\t\t\t${selector} {\n\t\t\t\t\tmargin: auto;\n\t\t\t\t\tmax-width: ${xxLargeBreakPoint / 16}rem;\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = SummaryPagePaddingUtility;\n//# sourceMappingURL=SummaryPagePaddingUtility.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst component_content_margins_1 = require(\"@inter-ikea-kompis/component-content-margins\");\nconst common_styles_webc_1 = require(\"@ingka/common-styles-webc\");\nconst SummaryPagePaddingUtility_1 = __importDefault(require(\"../../utilities/SummaryPagePaddingUtility\"));\n/**\n * This is the style class for SummaryPage.\n */\nclass SummaryPageStyle {\n /**\n * Returns styles.\n *\n * @param options\n * @param options.theme\n * @param options.isOldSafari\n * @param options.enableMargins\n * @param options.enableMainMargins\n * @param options.direction\n */\n static getStyle(options) {\n const { breakpoint, spacing, color } = options.theme;\n const margins = {\n horizontal: {\n small: spacing.space150,\n medium: spacing.space200,\n large: spacing.space250,\n xlarge: spacing.space300,\n xxlarge: spacing.space300\n },\n vertical: {\n small: spacing.space150,\n medium: spacing.space125,\n large: spacing.space200,\n xlarge: spacing.space250,\n xxlarge: spacing.space250\n }\n };\n const gutters = {\n small: spacing.space75,\n medium: spacing.space200,\n large: spacing.space150,\n xlarge: spacing.space75,\n xxlarge: spacing.space75\n };\n const { theme, direction } = options;\n /* XXL in Kompis SkapaTheme is 1920, while Skapas is 1600, so we hardcode it here */\n const xxLargeBreakPoint = 1600;\n const oldSafariStyles = (0, web_component_1.css) `\n\t\t\t.grid {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column-reverse;\n\t\t\t}\n\t\t`;\n const marginStyles = (0, web_component_1.css) `\n\t\t\t.container {\n\t\t\t\tpadding-top: ${margins.vertical.small / 16}rem;\n\t\t\t\tpadding-bottom: ${margins.vertical.small / 16}rem;\n\t\t\t}\n\t\t\t@media (min-width: ${breakpoint.medium.width / 16}rem) {\n\t\t\t\t.container {\n\t\t\t\t\tpadding-top: ${margins.vertical.medium / 16}rem;\n\t\t\t\t\tpadding-bottom: ${margins.vertical.medium / 16}rem;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@media (min-width: ${breakpoint.large.width / 16}rem) {\n\t\t\t\t.container {\n\t\t\t\t\tpadding-top: ${margins.vertical.large / 16}rem;\n\t\t\t\t\tpadding-bottom: ${margins.vertical.large / 16}rem;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@media (min-width: ${breakpoint.xlarge.width / 16}rem) {\n\t\t\t\t.container {\n\t\t\t\t\tpadding-top: ${margins.vertical.xlarge / 16}rem;\n\t\t\t\t\tpadding-bottom: ${margins.vertical.xlarge / 16}rem;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t${SummaryPagePaddingUtility_1.default.getHorizontalPadding('.container', options.theme)}\n\t\t`;\n const layoutMargins = (0, web_component_1.css) `\n\t\t\t${component_content_margins_1.StyleUtility.getSpaceForHeader({ cssSelector: '.wrapper', theme })}\n\t\t\t${component_content_margins_1.StyleUtility.getLayoutParentStyling({ cssSelector: '.wrapper', theme })}\n\t\t\t${component_content_margins_1.StyleUtility.getHorizontalSpacing({ cssSelector: '.wrapper', theme, direction })};\n\t\t\t${component_content_margins_1.StyleUtility.getLayoutChildStyling({ cssSelector: '.container', theme })}\n\t\t`;\n return (0, web_component_1.css) `\n\t\t\t${common_styles_webc_1.Text.CSS}\n\n\t\t\t${options.isOldSafari ? oldSafariStyles : ''}\n\t\t\t${options.enableMargins ? marginStyles : ''}\n\t\t\t${options.enableMainMargins ? layoutMargins : ''}\n\n\t\t\t.title {\n\t\t\t\tdisplay: block;\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t.heading-area {\n\t\t\t\tmargin-bottom: ${spacing.space250 / 16}rem;\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-wrap: wrap;\n\t\t\t\tgap: ${spacing.space50 / 16}rem;\n\t\t\t\talign-items: center;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\n\t\t\t.heading-area :first-child {\n\t\t\t\tflex-grow: 1;\n\t\t\t}\n\n\t\t\t.details {\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\n\t\t\t.overview {\n\t\t\t\tdisplay: grid;\n\t\t\t\tgrid-template-columns: repeat(4, 1fr);\n\t\t\t\tcolumn-gap: ${gutters.small / 16}rem;\n\t\t\t}\n\n\t\t\t.screenshot,\n\t\t\t.overview-sticky {\n\t\t\t\tgrid-column: 1 / span 4;\n\t\t\t}\n\n\t\t\t.screenshot {\n\t\t\t\twidth: 100%;\n\t\t\t\tmargin-bottom: ${spacing.space200 / 16}rem;\n\t\t\t}\n\n\t\t\tkompis-configuration-summary,\n\t\t\tkompis-assistance-card,\n\t\t\tkompis-assembly-services,\n\t\t\tskapa-inline-message:last-of-type {\n\t\t\t\tmargin-bottom: ${spacing.space300 / 16}rem;\n\t\t\t}\n\n\t\t\t.measurements {\n\t\t\t\tcolor: ${color.text.default};\n\t\t\t}\n\n\t\t\t.qr-code {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\t.no-margin {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t@media (min-width: ${breakpoint.medium.width / 16}rem) {\n\t\t\t\t.overview {\n\t\t\t\t\tgrid-template-columns: repeat(6, 1fr);\n\t\t\t\t\tcolumn-gap: ${gutters.medium / 16}rem;\n\t\t\t\t}\n\n\t\t\t\t.overview-sticky {\n\t\t\t\t\tgrid-column: 4 / span 3;\n\t\t\t\t}\n\n\t\t\t\t.screenshot {\n\t\t\t\t\tgrid-column: 1 / span 3;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@media (min-width: ${breakpoint.large.width / 16}rem) {\n\t\t\t\t.grid {\n\t\t\t\t\tdisplay: grid;\n\t\t\t\t\tgrid-auto-flow: column dense;\n\t\t\t\t\tgrid-template-columns: repeat(12, 1fr);\n\t\t\t\t\tcolumn-gap: ${gutters.large / 16}rem;\n\t\t\t\t}\n\n\t\t\t\t.details,\n\t\t\t\t.heading-area {\n\t\t\t\t\tgrid-column: 1 / span 7;\n\t\t\t\t}\n\n\t\t\t\t.details,\n\t\t\t\t.overview {\n\t\t\t\t\tgrid-row: 2;\n\t\t\t\t}\n\n\t\t\t\t.overview {\n\t\t\t\t\tgrid-column: 9 / span 4;\n\t\t\t\t\tgrid-template-columns: repeat(4, 1fr);\n\t\t\t\t\tcolumn-gap: ${gutters.large / 16}rem;\n\t\t\t\t\talign-content: start;\n\t\t\t\t}\n\n\t\t\t\t.overview-sticky {\n\t\t\t\t\tposition: sticky;\n\t\t\t\t\tdisplay: grid;\n\t\t\t\t\ttop: ${spacing.space250 / 16}rem;\n\t\t\t\t\tgrid-template-columns: repeat(4, 1fr);\n\t\t\t\t}\n\n\t\t\t\tkompis-configuration-summary {\n\t\t\t\t\tmax-width: unset;\n\t\t\t\t\tgrid-row: unset;\n\t\t\t\t}\n\n\t\t\t\tkompis-configuration-summary,\n\t\t\t\t.screenshot,\n\t\t\t\tkompis-assistance-card,\n\t\t\t\tkompis-assembly-services,\n\t\t\t\tskapa-inline-message,\n\t\t\t\t.overview-sticky,\n\t\t\t\t.qr-code {\n\t\t\t\t\tgrid-column: 1 / span 4;\n\t\t\t\t}\n\n\t\t\t\t.qr-code {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-direction: column;\n\t\t\t\t\tpadding: ${spacing.space125 / 16}rem;\n\t\t\t\t\tbackground-color: ${color.neutral.grey100};\n\t\t\t\t}\n\n\t\t\t\tkompis-qr-code {\n\t\t\t\t\twidth: ${132 / 16}rem;\n\t\t\t\t\tmargin: 0 auto;\n\t\t\t\t\tbackground-color: ${color.neutral.white};\n\t\t\t\t}\n\n\t\t\t\t.qr-code-text {\n\t\t\t\t\tmargin-top: ${spacing.space125 / 16}rem;\n\t\t\t\t\ttext-align: center;\n\t\t\t\t\tcolor: ${color.text.dark};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@media (min-width: ${breakpoint.xlarge.width / 16}rem) {\n\t\t\t\t.grid,\n\t\t\t\t.overview {\n\t\t\t\t\tcolumn-gap: ${gutters.xlarge / 16}rem;\n\t\t\t\t}\n\n\t\t\t\t.heading-area {\n\t\t\t\t\tgap: ${spacing.space75 / 16}rem;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@media (min-width: ${xxLargeBreakPoint / 16}rem) {\n\t\t\t\t.container {\n\t\t\t\t\tmargin: auto;\n\t\t\t\t\tmax-width: ${xxLargeBreakPoint / 16}rem;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tskapa-inline-message {\n\t\t\t\tmargin-bottom: ${spacing.space200 / 16}rem;\n\t\t\t}\n\n\t\t\t@media print {\n\t\t\t\t.container {\n\t\t\t\t\tpadding: 0 0.25in;\n\t\t\t\t}\n\n\t\t\t\t.grid {\n\t\t\t\t\t/* Chrome doesn't support \"break-inside: avoid\" in product list if parent container is flex display. Using table to reorder child container instead. */\n\t\t\t\t\tdisplay: table;\n\t\t\t\t\t/* Safari doesn't resize when printing, so we do it here. */\n\t\t\t\t\tmargin: auto;\n\t\t\t\t}\n\n\t\t\t\t.heading-area,\n\t\t\t\t.overview {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\n\t\t\t\t.details {\n\t\t\t\t\tdisplay: table-footer-group;\n\t\t\t\t}\n\n\t\t\t\t.print-header {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t}\n\n\t\t\t\t.hidden-print {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\t\t\t}\n\t\t`;\n }\n}\nexports.default = SummaryPageStyle;\n//# sourceMappingURL=SummaryPageStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\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};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_add_to_bag_1 = require(\"@inter-ikea-kompis/component-add-to-bag\");\nconst component_configuration_summary_1 = require(\"@inter-ikea-kompis/component-configuration-summary\");\nconst component_configuration_summary_2 = require(\"@inter-ikea-kompis/component-configuration-summary\");\nconst component_product_row_1 = require(\"@inter-ikea-kompis/component-product-row\");\nconst component_zip_in_1 = require(\"@inter-ikea-kompis/component-zip-in\");\nconst insights_data_provider_1 = require(\"@insights/insights-data-provider\");\nrequire(\"@inter-ikea-kompis/component-assembly-services\");\nrequire(\"@inter-ikea-kompis/component-assistance-card\");\nrequire(\"@inter-ikea-kompis/component-configuration-summary\");\nrequire(\"@inter-ikea-kompis/component-image\");\nrequire(\"@inter-ikea-kompis/component-qr-code\");\nrequire(\"@inter-ikea-kompis/component-text\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/inline-message-webc\");\nrequire(\"@ingka/tabs-webc\");\nrequire(\"@ingka/icon-store/checkmark-circle\");\nrequire(\"@ingka/icon-store/incorrect\");\nrequire(\"@ingka/icon-store/information-circle\");\nrequire(\"@ingka/icon-store/pencil\");\nrequire(\"@ingka/icon-store/printer\");\nrequire(\"@ingka/icon-store/warning-triangle\");\nrequire(\"../summary-page-images/SummaryPageImages\");\nrequire(\"../summary-page-product-list/SummaryPageProductList\");\nrequire(\"../summary-page-security/SummaryPageSecurity\");\nrequire(\"../summary-page-tabs/SummaryPageTabs\");\nrequire(\"../summary-page-print/SummaryPagePrint\");\nconst InlineMessageIconEnum_1 = __importDefault(require(\"../../enums/InlineMessageIconEnum\"));\nconst InlineMessageLayoutEnum_1 = __importDefault(require(\"../../enums/InlineMessageLayoutEnum\"));\nconst SummaryPageConfigurationMeasureEnum_1 = __importDefault(require(\"../../enums/SummaryPageConfigurationMeasureEnum\"));\nconst SummaryPageModalEnum_1 = __importDefault(require(\"../../enums/SummaryPageModalEnum\"));\nconst SummaryPageTabEnum_1 = __importDefault(require(\"../../enums/SummaryPageTabEnum\"));\nconst SummaryPageAnalyticsContext_1 = __importDefault(require(\"../../trackers/SummaryPageAnalyticsContext\"));\nconst SummaryPageTracker_1 = __importDefault(require(\"../../trackers/SummaryPageTracker\"));\nconst SummaryPageBrowserUtility_1 = __importDefault(require(\"../../utilities/SummaryPageBrowserUtility\"));\nconst SummaryPageCustomTabsUtility_1 = __importDefault(require(\"../../utilities/SummaryPageCustomTabsUtility\"));\nconst SummaryPageMeasurementUtility_1 = __importDefault(require(\"../../utilities/SummaryPageMeasurementUtility\"));\nconst SummaryPageStyle_1 = __importDefault(require(\"./SummaryPageStyle\"));\n/**\n * The view for the Summary Page.\n *\n * @event storeSelectorChange Triggered when the selected store changes.\n * @event sortListChange Triggered when the selected way of sorting changes.\n * @event addToCart When add to cart is clicked.\n * @event addToList When add to shopping list is clicked.\n * @event addToCartClick User clicks on add to cart button.\n * @event shareDesign When share design is clicked.\n * @event saveDesign When save design is clicked.\n * @event logInAndSaveDesign When save design is clicked inside the confirmation card.\n * @event saveDesignToProfile When save in save design to profile sheet is clicked.\n * @event saveDesignToProfileLogIn When login in save design to profile sheet is clicked.\n * @event modalOpen Triggered when a sheet is opened.\n * @event modalClose Triggered when the user closes a sheet.\n * @event tabChange Triggered when the selected tab changes.\n * @event selectedImageIndexChange Triggered when the selected image changes in the \"Images\" tab.\n * @event copyDesign When copy design is clicked.\n * @event addUnavailableProductsToListChange Changes the option \"addUnavailableProductsToList\". Triggered by user clicking the checkbox.\n * @event addUnavailableToCartAndList Start adding unavailable products to shopping cart and shopping list.\n * @event unavailableProductsModalContinue Click on continue in the unavailable products modal.\n * @event collectProduct Triggered when a product is collected.\n * @event shareDesignCardStateChange Triggered when the state for ShareDesignCard changes.\n * @event sendByEmailInput Triggered when the user writes in the sendByEmail view.\n * @event sendByEmailValidation Triggered when the user tries to send with an invalid email.\n * @event sendByEmailSend Triggered when the user clicks send in the sendByEmail view.\n * @event sendByEmailReset Triggered 3 seconds after SendByEmailState is set to success.\n * @event sendBySmsInput Triggered when the user writes in the sendBySms view.\n * @event sendBySmsValidation Triggered when the user tries to send with an invalid number.\n * @event sendBySmsSend Triggered when the user clicks send in the sendBySms view.\n * @event sendBySmsReset Triggered 3 seconds after SendBySmsState is set to success.\n * @event copyDesignCodeClick Triggered when the user clicks the copy design code button.\n * @event copyDesignCodeReset Triggered 3 seconds after copyDesignCodeState is set to success.\n * @event copyDesignLinkClick Triggered when the user clicks the copy design link button.\n * @event copyDesignLinkReset Triggered 3 seconds after copyDesignLinkState is set to success.\n * @event homeDeliveryStartOverClick User clicks on the start over link or the back button.\n * @event homeDeliveryForgetClick User clicks on the forget link from Home Delivery.\n * @event homeDeliveryInput Triggered when user writes a zip code.\n * @event homeDeliverySubmitButtonClick User clicks the Check availability button.\n * @event confirmationCardStateChange Triggered when the state for ConfirmationCard in ConfigurationSummary changes.\n * @event financialServicesContinueButtonClick Triggered when continue planning button is clicked in financial services sheet.\n * @event financialServicesMoreInfoClick Triggered when read more is clicked in financial services sheet.\n * @event resetAddToCartState Sent after 3 seconds after addToCartState confirmation to be able to reset the state of the button.\n * @event resetAddToListState Sent after 3 seconds after addToListState confirmation to be able to reset the state of the button.\n * @event productListRemove Triggered when the remove button is clicked on a product in product list.\n * @event kioskMainCtaButtonClick Triggered when main call to action button on kiosk is clicked.\n * @event productListExpand Triggered when included shopping products in product list gets expanded.\n * @event linkCardClick When the link card is clicked.\n * @event printButtonClick When the print button is clicked.\n * @event editDesignButtonClick When the edit design button is clicked.\n * @event saveZipCode When the user sets their ZIP code in a sub component (like AssemblyServices).\n * @event forgetZipCode When the user chooses to forget their ZIP code in a sub component (like AssemblyServices).\n */\nlet SummaryPage = class SummaryPage extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Localized information. Deprecated - use \"translations\" and \"settings\" instead.\n this.localizedInformation = null;\n // The translations retrieved from translations service.\n this.translations = null;\n // The settings retrieved from settings service.\n this.settings = null;\n // A list of store availability objects.\n this.storeAvailabilities = null;\n // A list of stores, when left empty the store selector will be hidden\n this.stores = null;\n // The storeId of the selected store\n this.storeId = null;\n // Controls how measurements should be shown in the Product list tab\n this.productMeasures = component_product_row_1.ProductRowProductMeasureEnum.none;\n // Controls how measurements should be shown in the configuration summary.\n this.configurationMeasures = SummaryPageConfigurationMeasureEnum_1.default.short;\n // The url for the screenshot.\n this.screenshotUrl = null;\n // The alt text for the screenshot. If not set, a default alt text will be used.\n this.screenshotAlt = null;\n // The name of the product, e.g. PLATSA\n this.productName = null;\n // Description of the product, e.g. \"Wardrobe, 200x300x55 cm\". Used in SaveDesignToProfile and ShareDesignCard.\n this.productDescription = null;\n // Shows the share design button.\n this.showShareDesign = false;\n // Shows the save design button.\n this.showSaveDesign = false;\n // Shows the add to bag component. This attribute should be set to \"false\" when in a Kiosk. Setting this to \"false\" also moves the share button from the priceHeader down to the text buttons.\n this.showAddToBag = false;\n // VPC code for the solution.\n this.vpcCode = null;\n // Disables outgoing links. Should be true for kiosks.\n this.disableLinks = false;\n // The currently visible sheet.\n this.visibleModal = null;\n // Defines the state for add to bag button\n this.addToCartState = component_add_to_bag_1.AddToBagStateEnum.default;\n // Defines the state for add to list button\n this.addToListState = component_add_to_bag_1.AddToBagStateEnum.default;\n // Defines the state for the share design button.\n this.shareDesignState = component_configuration_summary_2.ConfirmationSummaryShareDesignStateEnum.default;\n // Defines the state for the confirmation card in configuration summary\n this.confirmationCardState = component_configuration_summary_2.ConfigurationSummaryConfirmationCardStateEnum.default;\n // Type of sheet to show for add to cart, shopping list buttons and when clicking the save design button fails.\n this.confirmationCardType = null;\n // A list of images used in the \"Images\" tab\n this.images = null;\n // An object with information for the security tab\n this.securityInformation = null;\n // Measurements of height, width and depth in millimeter. Can be left empty to hide dimensions.\n this.measurements = null;\n // Value for checkbox to add unavailable items to shopping list when they are not available to be added to the cart.\n this.addUnavailableProductsToList = false;\n // Used as a link for the QR code and in ShareDesignCard. When copied, query parameter with vpc source is added.\n this.designLink = null;\n // A collection of props used for the sheet shown after clicking share design. For more info about the props check the ShareDesignCard component.\n this.shareDesignCard = null;\n // A collection of props used for the sheet shown after clicking save design. For more info about the props check the SaveDesignToProfile component.\n this.saveDesignToProfile = null;\n // Defines the state for the log in and save button.\n this.logInAndSaveState = component_configuration_summary_1.ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum.default;\n // A collection of props used for the home delivery availability in product list. For more info about the props check the HomeDelivery component.\n this.homeDelivery = null;\n // A collection of props used for the sheet shown after clicking assembly services. For more info about the props check the AssemblyServices component.\n this.assemblyServices = null;\n // Zip code will be passed down to assembly services. In the future this will also be used for other sub components consuming zip code such as home delivery.\n this.zipCode = null;\n // Whether to show the collect checkbox in the product list or not.\n this.collectableProducts = false;\n // A list of product ids that are collected.\n this.collectedProducts = null;\n // Show text describing the color and/or material of the product.\n this.showDesignText = false;\n // A list of sections used in the product list.\n this.productListSections = null;\n // Defines optional custom tab buttons. Up to five tabs are supported.\n this.customTabButtons = null;\n // List of failed shopping products returned when trying to add to cart.\n this.failedShoppingItems = null;\n // Highest heading on the Summary page will be h2 as opposed to h1. Set to true if planner is e.g. used in an iframe with an h1 header outside of the planner.\n this.startHeadingsAtH2 = false;\n // Shows financial services. The financing option is retrieved by service.\n this.financingOption = null;\n // Deprecated. Adds balanced margins on all sides of SummaryPage when true. To be used with the summary header and footer. This prop is deprecated - use the Main Header and Main Footer components together with the enableMainMargins prop instead.\n this.enableMargins = false;\n // Adds margins on all sides of SummaryPage when true. To be used with the main header and footer.\n this.enableMainMargins = false;\n // Shows total package weight of the shopping products.\n this.showTotalPackageWeight = false;\n // Shows the assistance card, which informs the user how to get assistance with their design. It has a kiosk state with a different look when the prop disableLinks is set to true.\n this.showAssistanceCard = false;\n // Shows the assembly services card, which presents the assembly service availability to the user.\n this.showAssemblyServices = false;\n // The name of the application, e.g. \"pax\". Used in the booking url in the assistance card.\n this.assistanceCardApplicationName = null;\n // Shows call to action button to give user the possibilitiy to complete their purchase on kiosk. Won't be shown if showAddToBag is true.\n this.showKioskMainCTAButton = false;\n // Shows print button. For example to be used on kiosks with print functionality.\n this.showPrintButton = false;\n // Shows edit design button.\n this.showEditDesignButton = false;\n // Used for automatic analytics. If null or not set, analytics is turned off.\n this.analytics = null;\n // A list of included products within SPR products. Must be set when using layout compact print and printing SPR's. Must also be set (if applicable) for total package weight.\n this.includedProductsWithinSprs = null;\n // A list of product item numbers that can be removed in the product list.\n this.productListRemovable = null;\n // Sets the default sorting of the product list.\n this.defaultSortBy = null;\n // Inline messages, displayed below ConfigurationSummary.\n this.messageSection = null;\n // Displays link card when data and Översätta key showLinkCard are set. For image ratio guidelines, see Skapa Card. Hidden on kiosks when disableLinks is true.\n this.linkCard = null;\n // A sorted list of content to include in the print layout. When not set, the currently shown tab is printed. To include custom content in the print, the content must also be included as the slot \"custom-print-content\". E.g. ['productListTab', 'imagesTab', 'securityTab', 'customPrintContent'].\n this.contentToPrint = null;\n // Layout for summary page. NOTE: ProductRowLayoutEnum.compactPrint should only be used during print. Make sure SPR's has their child articles in includedProductsWithinSprs, since SPR's are not visible in compactPrint.\n this.pickingListPrintLayout = null;\n this.breakpointObserver = new themes_1.ThemeBreakpointObserver(() => this.requestUpdate());\n // Defines the state for copy design code in the shopping list and add to bag sheets.\n this.copyDesignState = null;\n this.tracker = null;\n this.dexfSettings = null;\n this.numberOfCustomTabs = 0;\n this.customTabSlots = [];\n }\n render() {\n var _a;\n // We want translations and settings to be required, but since all props to provide translations and settings are optional, this check is needed until localizedInformation is removed.\n if (!this.hasTranslationsAndSettings()) {\n // We can't throw an error because on the first render no props are set.\n return null;\n }\n const direction = utilities_1.SafariWriteDirectionUtility.getWriteDirection(this);\n const breakpointIndex = (_a = this.breakpointObserver.getBreakpointIndex()) !== null && _a !== void 0 ? _a : enums_1.ThemeBreakpointIndexEnum.small;\n const details = (0, web_component_1.html) `
    ${this.getTabs()}
    `;\n const headingArea = (0, web_component_1.html) `\n\t\t\t
    \n\t\t\t\t${this.getTitle()} ${this.getEditDesignButton(breakpointIndex)} ${this.getPrintButton()}\n\t\t\t
    \n\t\t`;\n const overview = (0, web_component_1.html) `
    \n\t\t\t${this.getScreenshot()}\n\t\t\t
    \n\t\t\t\t${this.getConfigurationSummary()} ${this.getInlineMessages()} ${this.getAssistanceCard()}\n\t\t\t\t${this.getAssemblyServices()} ${this.getQrCode()}\n\t\t\t
    \n\t\t
    `;\n const content = breakpointIndex < enums_1.ThemeBreakpointIndexEnum.large &&\n !SummaryPageBrowserUtility_1.default.isSafari14OrOlder()\n ? (0, web_component_1.html) `${headingArea} ${overview} ${details}`\n : (0, web_component_1.html) `${headingArea} ${details} ${overview}`;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t${this.getSummaryPagePrint()}\n\t\t\t\t\t\t${content}\n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t
    \n\t\t\t\n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.breakpointObserver.disconnect();\n this.disconnectTracker();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('localizedInformation') &&\n this.localizedInformation &&\n !this.settings) {\n this.dexfSettings = utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation);\n }\n if (changedProperties.has('settings') && this.settings) {\n this.dexfSettings = this.settings;\n }\n if (changedProperties.has('theme')) {\n this.breakpointObserver.observe(this.theme);\n }\n if (changedProperties.has('analytics') && this.hasTranslationsAndSettings()) {\n this.disconnectTracker();\n this.connectTracker().then(() => this.sendInitialConfigurationEvent());\n }\n if (changedProperties.has('customTabButtons')) {\n this.numberOfCustomTabs = SummaryPageCustomTabsUtility_1.default.getNumberOfCustomTabsToShow(this.customTabButtons);\n this.customTabSlots = SummaryPageCustomTabsUtility_1.default.getCustomTabSlots(this.numberOfCustomTabs);\n }\n return true;\n }\n hasTranslationsAndSettings() {\n return (!!this.translations && !!this.settings) || !!this.localizedInformation;\n }\n getTranslations() {\n var _a;\n return this.translations\n ? this.translations\n : (_a = this.localizedInformation) === null || _a === void 0 ? void 0 : _a.translations;\n }\n getSettings() {\n return this.dexfSettings;\n }\n connectTracker() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n if (this.analytics) {\n this.tracker = new SummaryPageTracker_1.default(Object.assign(Object.assign({}, this.analytics), { settings: this.getSettings(), locale: this.locale }));\n yield ((_a = this.tracker) === null || _a === void 0 ? void 0 : _a.connect());\n // Make sure child components with analytics connect their trackers when the id is available.\n this.requestUpdate();\n }\n });\n }\n disconnectTracker() {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.disconnect();\n this.tracker = null;\n }\n /**\n * Get title.\n *\n * @returns The title.\n */\n getTitle() {\n const screenTitleText = this.getTranslations().summaryPageTitle;\n return this.startHeadingsAtH2\n ? (0, web_component_1.html) `

    ${screenTitleText}

    `\n : (0, web_component_1.html) `

    ${screenTitleText}

    `;\n }\n getPrintButton() {\n if (!this.showPrintButton) {\n return null;\n }\n return (0, web_component_1.html) ` {\n var _a;\n event.preventDefault();\n event.stopPropagation();\n this.dispatchEvent(new CustomEvent('printButtonClick', {\n bubbles: true\n }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendPrintButtonClick();\n }}\"\n\t\t\t>${this.getTranslations()\n .print}`;\n }\n getEditDesignButton(breakpointIndex) {\n if (!this.showEditDesignButton) {\n return null;\n }\n const buttonText = this.getTranslations().navMenuNavigationButtonSummary;\n if (breakpointIndex <= enums_1.ThemeBreakpointIndexEnum.small) {\n return (0, web_component_1.html) `${buttonText}`;\n }\n return (0, web_component_1.html) `${buttonText}`;\n }\n onEditDesignButtonClick() {\n var _a;\n this.dispatchEvent(new CustomEvent('editDesignButtonClick', { bubbles: true }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendEditDesignButtonClick();\n }\n /**\n * Get inline messages. Limits to three to prevent too many messages.\n *\n * @returns Inline messages.\n */\n getInlineMessages() {\n var _a;\n const firstThreeMessages = (_a = this.messageSection) === null || _a === void 0 ? void 0 : _a.slice(0, 3);\n return (0, web_component_1.html) `${firstThreeMessages === null || firstThreeMessages === void 0 ? void 0 : firstThreeMessages.map(({ title, message, icon = InlineMessageIconEnum_1.default.information, variant = InlineMessageLayoutEnum_1.default.informative }) => {\n const inlineMessageVariant = variant === 'caution' ? InlineMessageLayoutEnum_1.default.cautionary : variant;\n return (0, web_component_1.html) `\n\t\t\t\t\t\n\t\t\t\t\t${title}\n\t\t\t\t\t${message}\n\t\t\t\t`;\n })}`;\n }\n sendInitialConfigurationEvent() {\n var _a;\n const tabs = [SummaryPageTabEnum_1.default.productList];\n if (this.showImagesTab()) {\n tabs.push(SummaryPageTabEnum_1.default.images);\n }\n if (this.showSecurityTab()) {\n tabs.push(SummaryPageTabEnum_1.default.security);\n }\n for (let n = 1; n <= this.numberOfCustomTabs; n++) {\n tabs.push(SummaryPageTabEnum_1.default[`customTab${n}`]);\n }\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendInitialConfiguration({\n enabledTabs: tabs,\n qrCode: !!this.designLink,\n screenshot: !!this.screenshotUrl,\n measurements: !!this.measurements,\n productList: {\n designText: this.showDesignText,\n productMeasures: this.productMeasures,\n collectable: this.collectableProducts\n }\n });\n }\n showImagesTab() {\n var _a;\n return !!((_a = this.images) === null || _a === void 0 ? void 0 : _a.length);\n }\n showSecurityTab() {\n return !!this.securityInformation;\n }\n getTabs() {\n return (0, web_component_1.html) ` {\n var _a, _b;\n this.dispatchEvent(new CustomEvent('modalOpen', { bubbles: true, detail: event.detail }));\n if (((_a = event.detail.visibleModal) === null || _a === void 0 ? void 0 : _a.modal) === SummaryPageModalEnum_1.default.zipAvailabilityCard) {\n (_b = this.tracker) === null || _b === void 0 ? void 0 : _b.sendHomeDeliveryOpenSheet();\n }\n }}\"\n\t\t\t@modalClose=\"${(event) => this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: event.detail }))}\"\n\t\t\t@storeSelectorChange=\"${({ detail }) => {\n var _a;\n this.dispatchEvent(new CustomEvent('storeSelectorChange', { bubbles: true, detail }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendStoreSelectorChange(detail.storeId);\n }}\"\n\t\t\t@sortListChange=\"${({ detail }) => this.dispatchEvent(new CustomEvent('sortListChange', {\n bubbles: true,\n detail\n }))}\"\n\t\t\t@homeDeliverySubmitButtonClick=\"${() => {\n var _a;\n this.dispatchEvent(new CustomEvent('homeDeliverySubmitButtonClick', { bubbles: true }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendHomeDeliveryEnterZipCode();\n }}\"\n\t\t\t@homeDeliveryForgetClick=\"${(event) => {\n var _a;\n this.dispatchEvent(new CustomEvent('homeDeliveryForgetClick', { bubbles: true, detail: Object.assign({}, event.detail) }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendHomeDeliveryRemoveZipCode();\n }}\"\n\t\t\t@homeDeliveryStartOverClick=\"${(event) => {\n var _a;\n this.dispatchEvent(new CustomEvent('homeDeliveryStartOverClick', {\n bubbles: true,\n detail: Object.assign({}, event.detail)\n }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendHomeDeliveryChangeZipCode();\n }}\"\n\t\t\t@homeDeliveryInput=\"${(event) => {\n this.dispatchEvent(new CustomEvent('homeDeliveryInput', { bubbles: true, detail: Object.assign({}, event.detail) }));\n }}\"\n\t\t\t@collectProduct=\"${(event) => {\n var _a;\n this.dispatchEvent(new CustomEvent('collectProduct', { bubbles: true, detail: event.detail }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendCollectProduct({ collectId: event.detail.collectId, collected: event.detail.collected }, this.vpcCode);\n }}\"\n\t\t\t@productListRemove=\"${(event) => {\n this.dispatchEvent(new CustomEvent('productListRemove', { bubbles: true, detail: event.detail }));\n }}\"\n\t\t\t@productListExpand=\"${(event) => {\n this.dispatchEvent(new CustomEvent('productListExpand', { bubbles: true, detail: event.detail }));\n }}\"\n\t\t\t@selectedImageIndexChange=\"${({ detail }) => {\n var _a, _b;\n this.dispatchEvent(new CustomEvent('selectedImageIndexChange', {\n bubbles: true,\n detail\n }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendSelectedImageIndexChange(detail.selectedIndex, (_b = this.images) === null || _b === void 0 ? void 0 : _b.length);\n }}\"\n\t\t\t@tabChange=\"${({ detail }) => {\n var _a;\n this.dispatchEvent(new CustomEvent('tabChange', {\n bubbles: true,\n detail\n }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendTabChange(detail.selectedTab);\n }}\"\n\t\t>\n\t\t\t${this.customTabSlots}\n\t\t\t\n\t\t`;\n }\n getValidShoppingProducts() {\n return this.shoppingProducts.filter((shoppingProduct) => shoppingProduct.product.valid);\n }\n /**\n * Get Configuration Summary.\n *\n * @returns The Configuration Summary.\n */\n getConfigurationSummary() {\n var _a;\n const shareDesignCard = this.shareDesignCard\n ? Object.assign(Object.assign({}, this.shareDesignCard), { designLink: this.designLink }) : null;\n return (0, web_component_1.html) ` {\n const { triggerElement } = detail, restOfDetail = __rest(detail, [\"triggerElement\"]);\n this.dispatchEvent(new CustomEvent('shareDesign', { bubbles: true, detail: restOfDetail }));\n }}\"\n\t\t\t@saveDesign=\"${() => {\n this.dispatchEvent(new CustomEvent('saveDesign', { bubbles: true }));\n }}\"\n\t\t\t@logInAndSaveDesign=\"${() => {\n this.dispatchEvent(new CustomEvent('logInAndSaveDesign', { bubbles: true }));\n }}\"\n\t\t\t@saveDesignToProfile=\"${() => this.dispatchEvent(new CustomEvent('saveDesignToProfile', { bubbles: true }))}\"\n\t\t\t@saveDesignToProfileLogIn=\"${() => this.dispatchEvent(new CustomEvent('saveDesignToProfileLogIn', { bubbles: true }))}\"\n\t\t\t@addToCart=\"${({ detail }) => {\n var _a, _b, _c;\n this.dispatchEvent(new CustomEvent('addToCart', { bubbles: true, detail: Object.assign({}, detail) }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendAddToCartAvailability((_c = (_b = this.homeDelivery) === null || _b === void 0 ? void 0 : _b.zipAvailabilities) !== null && _c !== void 0 ? _c : null, this.storeAvailabilities);\n }}\"\n\t\t\t@addToList=\"${({ detail }) => {\n var _a, _b, _c;\n const { triggerElement } = detail, restOfDetail = __rest(detail, [\"triggerElement\"]);\n this.dispatchEvent(new CustomEvent('addToList', { bubbles: true, detail: restOfDetail }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendAddToListAvailability((_c = (_b = this.homeDelivery) === null || _b === void 0 ? void 0 : _b.zipAvailabilities) !== null && _c !== void 0 ? _c : null, this.storeAvailabilities);\n }}\"\n\t\t\t@resetAddToCartState=\"${() => this.dispatchEvent(new CustomEvent('resetAddToCartState', { bubbles: true }))}\"\n\t\t\t@resetAddToListState=\"${() => this.dispatchEvent(new CustomEvent('resetAddToListState', { bubbles: true }))}\"\n\t\t\t@addToCartClick=\"${() => this.dispatchEvent(new CustomEvent('addToCartClick', {\n bubbles: true\n }))}}\"\n\t\t\t@unavailableProductsModalContinue=\"${() => this.dispatchEvent(new CustomEvent('unavailableProductsModalContinue', {\n bubbles: true\n }))}}\"\n\t\t\t@modalOpen=\"${(event) => {\n this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: {\n visibleModal: { modal: event.detail.visibleModal, itemNo: null }\n }\n }));\n }}\"\n\t\t\t@modalClose=\"${({ detail }) => {\n const { triggerElement } = detail, restOfDetail = __rest(detail, [\"triggerElement\"]);\n this.dispatchEvent(new CustomEvent('modalClose', { bubbles: true, detail: restOfDetail }));\n triggerElement === null || triggerElement === void 0 ? void 0 : triggerElement.focus();\n }}\"\n\t\t\t@copyDesign=\"${(event) => {\n this.copyDesignState = event.detail.copyDesignState;\n this.dispatchEvent(new CustomEvent('copyDesign', { bubbles: true, detail: event.detail }));\n this.requestUpdate();\n }}\"\n\t\t\t@addUnavailableProductsToListChange=\"${(event) => this.dispatchEvent(new CustomEvent('addUnavailableProductsToListChange', {\n bubbles: true,\n detail: event.detail\n }))}\"\n\t\t\t@addUnavailableToCartAndList=\"${(event) => this.dispatchEvent(new CustomEvent('addUnavailableToCartAndList', { bubbles: true, detail: event.detail }))}\"\n\t\t\t@confirmationCardStateChange=\"${(event) => this.dispatchEvent(new CustomEvent('confirmationCardStateChange', { bubbles: true, detail: event.detail }))}\"\n\t\t\t@financialServicesContinueButtonClick=\"${({ detail }) => this.dispatchEvent(new CustomEvent('financialServicesContinueButtonClick', { bubbles: true, detail }))}\"\n\t\t\t@financialServicesMoreInfoClick=\"${({ detail }) => {\n this.dispatchEvent(new CustomEvent('financialServicesMoreInfoClick', { bubbles: true, detail }));\n }}\"\n\t\t\t@kioskMainCtaButtonClick=\"${(event) => this.dispatchEvent(new CustomEvent('kioskMainCtaButtonClick', { bubbles: true, detail: event.detail }))}\"\n\t\t\t@linkCardClick=\"${(event) => this.dispatchEvent(new CustomEvent('linkCardClick', { bubbles: true, detail: event.detail }))}\"\n\t\t\t@shareDesignCardStateChange=\"${({ detail }) => this.dispatchEvent(new CustomEvent('shareDesignCardStateChange', { bubbles: true, detail }))}\"\n\t\t\t@sendByEmailInput=\"${({ detail }) => this.dispatchEvent(new CustomEvent('sendByEmailInput', { bubbles: true, detail }))}\"\n\t\t\t@sendByEmailValidation=\"${({ detail }) => this.dispatchEvent(new CustomEvent('sendByEmailValidation', { bubbles: true, detail }))}\"\n\t\t\t@sendByEmailSend=\"${({ detail }) => this.dispatchEvent(new CustomEvent('sendByEmailSend', { bubbles: true, detail }))}\"\n\t\t\t@sendByEmailReset=\"${({ detail }) => this.dispatchEvent(new CustomEvent('sendByEmailReset', { bubbles: true, detail }))}\"\n\t\t\t@sendBySmsInput=\"${({ detail }) => this.dispatchEvent(new CustomEvent('sendBySmsInput', { bubbles: true, detail }))}\"\n\t\t\t@sendBySmsValidation=\"${({ detail }) => this.dispatchEvent(new CustomEvent('sendBySmsValidation', { bubbles: true, detail }))}\"\n\t\t\t@sendBySmsSend=\"${({ detail }) => this.dispatchEvent(new CustomEvent('sendBySmsSend', { bubbles: true, detail }))}\"\n\t\t\t@sendBySmsReset=\"${({ detail }) => this.dispatchEvent(new CustomEvent('sendBySmsReset', { bubbles: true, detail }))}\"\n\t\t\t@copyDesignCodeClick=\"${({ detail }) => this.dispatchEvent(new CustomEvent('copyDesignCodeClick', { bubbles: true, detail }))}\"\n\t\t\t@copyDesignCodeReset=\"${() => this.dispatchEvent(new CustomEvent('copyDesignCodeReset', { bubbles: true }))}\"\n\t\t\t@copyDesignLinkClick=\"${({ detail }) => this.dispatchEvent(new CustomEvent('copyDesignLinkClick', { bubbles: true, detail }))}\"\n\t\t\t@copyDesignLinkReset=\"${() => this.dispatchEvent(new CustomEvent('copyDesignLinkReset', { bubbles: true }))}\"\n\t\t>\n\t\t\t${this.getMeasurements()}\n\t\t`;\n }\n /**\n * Get Measurements.\n * Short or long format depending on prop. Unit is cm/in depending on localizedInformation.\n */\n getMeasurements() {\n if (!this.measurements) {\n return null;\n }\n const useLongFormat = this.configurationMeasures === SummaryPageConfigurationMeasureEnum_1.default.long;\n const measurementRows = SummaryPageMeasurementUtility_1.default.getLocalizedMeasurementRows(this.getTranslations(), this.getSettings().localisation, this.locale, this.measurements, useLongFormat);\n return (0, web_component_1.html) `\n\t\t\t${measurementRows.map((row) => (0, web_component_1.html) `${row}
    `)}\n\t\t
    `;\n }\n /**\n * Get Screenshot.\n *\n * @returns The screenshot.\n */\n getScreenshot() {\n var _a;\n return (0, web_component_1.html) ``;\n }\n getAssistanceCard() {\n if (!this.showAssistanceCard) {\n return null;\n }\n return (0, web_component_1.html) ` {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendBookAssistanceLinkClick();\n }}\"\n\t\t>`;\n }\n getAssemblyServices() {\n var _a, _b, _c;\n if (!this.showAssemblyServices) {\n return null;\n }\n // We need (or I guess should) convert this to a ZipInModalEnum so that\n // we're passing the correct thing to the assembly services component.\n const visibleModal = ((_a = this.visibleModal) === null || _a === void 0 ? void 0 : _a.modal) === SummaryPageModalEnum_1.default.zipIn ? component_zip_in_1.ZipInModalEnum.zipIn : null;\n return (0, web_component_1.html) ` {\n this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: {\n visibleModal: { modal: SummaryPageModalEnum_1.default.zipIn, itemNo: null }\n }\n }));\n }}\"\n\t\t\t@modalOpen=\"${(event) => {\n this.dispatchEvent(new CustomEvent('modalOpen', {\n bubbles: true,\n detail: {\n visibleModal: { modal: event.detail.visibleModal, itemNo: null }\n }\n }));\n }}\"\n\t\t\t@modalClose=\"${() => this.dispatchEvent(new CustomEvent('modalClose', {\n bubbles: true,\n detail: {\n visibleModal: null\n }\n }))}\"\n\t\t\t@saveZipCode=\"${(event) => this.dispatchEvent(new CustomEvent('saveZipCode', {\n bubbles: true,\n detail: event.detail\n }))}\"\n\t\t\t@forgetZipCode=\"${(event) => this.dispatchEvent(new CustomEvent('forgetZipCode', {\n bubbles: true,\n detail: event.detail\n }))}\"\n\t\t>`;\n }\n /**\n * Get QR Code.\n *\n * @returns The QR code.\n */\n getQrCode() {\n if (!this.designLink) {\n return null;\n }\n return (0, web_component_1.html) `
    \n\t\t\t\n\t\t\t

    ${this.getTranslations().summaryPageQrCodeText}

    \n\t\t
    `;\n }\n getSummaryPagePrint() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t`;\n }\n getStoreName() {\n var _a;\n if (!this.storeId || !this.stores) {\n return null;\n }\n const store = this.stores.find((store) => store.id === this.storeId);\n return (_a = store === null || store === void 0 ? void 0 : store.name) !== null && _a !== void 0 ? _a : null;\n }\n getRetailUnit() {\n var _a;\n return (_a = this.locale.split('-').pop()) !== null && _a !== void 0 ? _a : null;\n }\n getAnalyticsForSubComponents() {\n var _a, _b;\n if (!this.analytics) {\n return null;\n }\n const reporterId = (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.getConnectedReporterId();\n return Object.assign(Object.assign({}, this.analytics), { context: (_b = this.analytics.context) !== null && _b !== void 0 ? _b : SummaryPageAnalyticsContext_1.default, locale: this.getLocaleForAnalyticsOrThrow(), \n // eslint-disable-next-line camelcase\n __INTERNAL__reporter: reporterId ? { connected: true, id: reporterId } : { connected: false } });\n }\n /**\n * Get the locale or throw error if locale is null.\n *\n * @returns The locale.\n */\n getLocaleForAnalyticsOrThrow() {\n if (!this.locale) {\n throw Error(\"The property 'locale' must be set when analytics is enabled.\");\n }\n return this.locale;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SummaryPage.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPage.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPage.prototype, \"translations\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPage.prototype, \"settings\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String, required: true })\n], SummaryPage.prototype, \"locale\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array, required: true })\n], SummaryPage.prototype, \"shoppingProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array })\n], SummaryPage.prototype, \"storeAvailabilities\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array })\n], SummaryPage.prototype, \"stores\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPage.prototype, \"storeId\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPage.prototype, \"productMeasures\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPage.prototype, \"configurationMeasures\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPage.prototype, \"screenshotUrl\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPage.prototype, \"screenshotAlt\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPage.prototype, \"productName\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPage.prototype, \"productDescription\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPage.prototype, \"showShareDesign\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPage.prototype, \"showSaveDesign\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPage.prototype, \"showAddToBag\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPage.prototype, \"vpcCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPage.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPage.prototype, \"visibleModal\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPage.prototype, \"addToCartState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPage.prototype, \"addToListState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPage.prototype, \"shareDesignState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPage.prototype, \"confirmationCardState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPage.prototype, \"confirmationCardType\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array })\n], SummaryPage.prototype, \"images\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPage.prototype, \"securityInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPage.prototype, \"measurements\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPage.prototype, \"addUnavailableProductsToList\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPage.prototype, \"designLink\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPage.prototype, \"shareDesignCard\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPage.prototype, \"saveDesignToProfile\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPage.prototype, \"logInAndSaveState\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, synchronous: true })\n], SummaryPage.prototype, \"homeDelivery\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPage.prototype, \"assemblyServices\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPage.prototype, \"zipCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPage.prototype, \"collectableProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array })\n], SummaryPage.prototype, \"collectedProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPage.prototype, \"showDesignText\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array })\n], SummaryPage.prototype, \"productListSections\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPage.prototype, \"customTabButtons\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array })\n], SummaryPage.prototype, \"failedShoppingItems\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPage.prototype, \"startHeadingsAtH2\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPage.prototype, \"financingOption\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n /**\n * @deprecated Use the Main Header and Main Footer components together with the enableMainMargins prop instead.\n */\n], SummaryPage.prototype, \"enableMargins\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPage.prototype, \"enableMainMargins\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPage.prototype, \"showTotalPackageWeight\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPage.prototype, \"showAssistanceCard\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPage.prototype, \"showAssemblyServices\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPage.prototype, \"assistanceCardApplicationName\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPage.prototype, \"showKioskMainCTAButton\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPage.prototype, \"showPrintButton\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPage.prototype, \"showEditDesignButton\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPage.prototype, \"analytics\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array })\n], SummaryPage.prototype, \"includedProductsWithinSprs\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array })\n], SummaryPage.prototype, \"productListRemovable\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPage.prototype, \"defaultSortBy\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array })\n], SummaryPage.prototype, \"messageSection\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPage.prototype, \"linkCard\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPage.prototype, \"contentToPrint\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPage.prototype, \"pickingListPrintLayout\", void 0);\nSummaryPage = __decorate([\n (0, web_component_1.customElement)('kompis-summary-page')\n], SummaryPage);\nexports.default = SummaryPage;\n//# sourceMappingURL=SummaryPage.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Contains everything from ConfigurationSummaryConfirmationCardTypeEnum except\n * those related to VPC success, since SummaryPage uses a different card for that.\n */\nvar SummaryPageConfirmationCardTypeEnum;\n(function (SummaryPageConfirmationCardTypeEnum) {\n SummaryPageConfirmationCardTypeEnum[\"addToCartSuccess\"] = \"addToCartSuccess\";\n SummaryPageConfirmationCardTypeEnum[\"addToListSuccess\"] = \"addToListSuccess\";\n SummaryPageConfirmationCardTypeEnum[\"saveVpcFail\"] = \"saveVpcFail\";\n SummaryPageConfirmationCardTypeEnum[\"addUnavailabeToCartAndListSuccess\"] = \"addUnavailabeToCartAndListSuccess\";\n SummaryPageConfirmationCardTypeEnum[\"addUnavailabeToCartFailAndListSuccess\"] = \"addUnavailabeToCartFailAndListSuccess\";\n SummaryPageConfirmationCardTypeEnum[\"addUnavailabeToCartSuccessAndListFail\"] = \"addUnavailabeToCartSuccessAndListFail\";\n})(SummaryPageConfirmationCardTypeEnum || (SummaryPageConfirmationCardTypeEnum = {}));\nexports.default = SummaryPageConfirmationCardTypeEnum;\n//# sourceMappingURL=SummaryPageConfirmationCardTypeEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SummaryPageControllerLoginBehaviourEnum;\n(function (SummaryPageControllerLoginBehaviourEnum) {\n SummaryPageControllerLoginBehaviourEnum[\"redirect\"] = \"redirect\";\n SummaryPageControllerLoginBehaviourEnum[\"disabled\"] = \"disabled\";\n})(SummaryPageControllerLoginBehaviourEnum || (SummaryPageControllerLoginBehaviourEnum = {}));\nexports.default = SummaryPageControllerLoginBehaviourEnum;\n//# sourceMappingURL=SummaryPageControllerLoginBehaviourEnum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst component_add_to_bag_1 = require(\"@inter-ikea-kompis/component-add-to-bag\");\nconst component_configuration_summary_1 = require(\"@inter-ikea-kompis/component-configuration-summary\");\nconst component_home_delivery_1 = require(\"@inter-ikea-kompis/component-home-delivery\");\nconst component_save_design_to_profile_1 = require(\"@inter-ikea-kompis/component-save-design-to-profile\");\nconst component_send_by_email_1 = require(\"@inter-ikea-kompis/component-send-by-email\");\nconst component_send_by_sms_1 = require(\"@inter-ikea-kompis/component-send-by-sms\");\nconst component_share_design_card_1 = require(\"@inter-ikea-kompis/component-share-design-card\");\nconst component_zip_in_1 = require(\"@inter-ikea-kompis/component-zip-in\");\nexports.default = {\n translations: null,\n settings: null,\n shoppingProducts: null,\n storeAvailabilities: null,\n stores: null,\n financingOption: null,\n includedProductsWithinSprs: null,\n failedShoppingItems: null,\n addToCartState: component_add_to_bag_1.AddToBagStateEnum.default,\n addToListState: component_add_to_bag_1.AddToBagStateEnum.default,\n shareDesignState: component_configuration_summary_1.ConfirmationSummaryShareDesignStateEnum.default,\n shareDesignCard: {\n state: component_share_design_card_1.ShareDesignCardStateEnum.default,\n autocomplete: true,\n showGetLink: true,\n showSendByEmail: true,\n sendByEmailState: component_send_by_email_1.SendByEmailStateEnum.default,\n showSendBySms: true,\n sendBySmsState: component_send_by_sms_1.SendBySmsStateEnum.default,\n showCopyDesignCodeButton: true,\n showCopyLink: true\n },\n saveDesignToProfile: {\n saveDesignState: component_save_design_to_profile_1.SaveDesignToProfileStateEnum.default,\n loggedIn: false\n },\n logInAndSaveState: component_configuration_summary_1.ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum.default,\n confirmationCardType: null,\n confirmationCardState: component_configuration_summary_1.ConfigurationSummaryConfirmationCardStateEnum.default,\n addUnavailableProductsToList: false,\n collectedProducts: null,\n visibleModal: null,\n storeId: null,\n homeDelivery: {\n state: component_home_delivery_1.HomeDeliveryStateEnum.default,\n zipCode: null,\n inputValue: '',\n zipAvailabilities: null\n },\n vpcCode: null,\n designSaved: false,\n productListRemovable: [],\n serviceOptionsWithSettings: null,\n saveDesignOnReload: false,\n zipCode: null,\n assemblyServices: {\n state: component_zip_in_1.ZipInCardStateEnum.default,\n assemblyServicesData: null\n }\n};\n//# sourceMappingURL=SummaryPageControllerDefaultState.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst services_1 = require(\"@inter-ikea-kompis/services\");\nconst services_2 = require(\"@inter-ikea-kompis/services\");\nconst services_3 = require(\"@inter-ikea-kompis/services\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nconst component_add_to_bag_1 = require(\"@inter-ikea-kompis/component-add-to-bag\");\nconst component_configuration_summary_1 = require(\"@inter-ikea-kompis/component-configuration-summary\");\nconst component_home_delivery_1 = require(\"@inter-ikea-kompis/component-home-delivery\");\nconst component_product_row_1 = require(\"@inter-ikea-kompis/component-product-row\");\nconst component_save_design_to_profile_1 = require(\"@inter-ikea-kompis/component-save-design-to-profile\");\nconst component_send_by_email_1 = require(\"@inter-ikea-kompis/component-send-by-email\");\nconst component_send_by_sms_1 = require(\"@inter-ikea-kompis/component-send-by-sms\");\nconst component_toast_1 = require(\"@inter-ikea-kompis/component-toast\");\nconst component_zip_in_1 = require(\"@inter-ikea-kompis/component-zip-in\");\nrequire(\"../summary-page/SummaryPage\");\nconst SummaryPageConfigurationMeasureEnum_1 = __importDefault(require(\"../../enums/SummaryPageConfigurationMeasureEnum\"));\nconst SummaryPageConfirmationCardTypeEnum_1 = __importDefault(require(\"../../enums/SummaryPageConfirmationCardTypeEnum\"));\nconst SummaryPageControllerLoginBehaviourEnum_1 = __importDefault(require(\"../../enums/SummaryPageControllerLoginBehaviourEnum\"));\nconst SummaryPageModalEnum_1 = __importDefault(require(\"../../enums/SummaryPageModalEnum\"));\nconst SummaryPageCustomTabsUtility_1 = __importDefault(require(\"../../utilities/SummaryPageCustomTabsUtility\"));\nconst SummaryPageControllerDefaultState_1 = __importDefault(require(\"./SummaryPageControllerDefaultState\"));\n/**\n * Controller for the Summary Page.\n *\n * @event stateChange Fired when the state of the component changes.\n * @event kioskMainCtaButtonClick Fired when the main CTA button is clicked on a kiosk.\n * @event productListRemove Fired when a product is removed from the product list to be able to sync removed items with the planner. However, it is optional to listen to this event as the list will be updated internally.\n * @event saveDesignToProfileLogIn Fired when the user clicks the login button in the save design to profile card.\n * @event logInAndSaveDesign Fired when the user clicks the save button in the confirmation card.\n * @event linkCardClick Fired when the link card is clicked.\n * @event trackAnalytics Fired for each event that should be tracked when implementing a custom analytics solution. The event detail contains the event name and the event data.\n * @event printButtonClick Fired when the print button is clicked.\n * @event editDesignButtonClick Fired when the edit design button is clicked.\n */\nlet SummaryPageController = class SummaryPageController extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Design configuration containing data about the created design that should be stored in the VPC service or by using \"save to profile\".\n this.designConfiguration = null;\n // Login behaviour for the save design to profile card.\n this.loginBehaviour = SummaryPageControllerLoginBehaviourEnum_1.default.redirect;\n // Theme.\n this.theme = themes_1.SkapaTheme;\n // Controls how measurements should be shown in the Product list tab\n this.productMeasures = component_product_row_1.ProductRowProductMeasureEnum.none;\n // Controls how measurements should be shown in the configuration summary.\n this.configurationMeasures = SummaryPageConfigurationMeasureEnum_1.default.short;\n // The url for the screenshot.\n this.screenshotUrl = null;\n // The alt text for the screenshot. If not set, a default alt text will be used.\n this.screenshotAlt = null;\n // The name of the product, e.g. PLATSA\n this.productName = null;\n // Description of the product, e.g. \"Wardrobe, 200x300x55 cm\". Used in SaveDesignToProfile and ShareDesignCard.\n this.productDescription = null;\n // Shows the save design button.\n this.showSaveDesign = false;\n // VPC code for the solution (this or \"designConfiguration\" must be set to use VPC features)\n this.vpcCode = null;\n // Whether the current design is saved to the user's profile. If this is true, the design will not auto-save. This has no effect if the save to profile feature is not active.\n this.designSaved = false;\n // Set to \"true\" if kiosk.\n this.kiosk = false;\n // A list of images used in the \"Images\" tab\n this.images = null;\n // An object with information for the security tab\n this.securityInformation = null;\n // Measurements of height, width and depth in millimeter. Can be left empty to hide dimensions.\n this.measurements = null;\n // Whether to show the collect checkbox in the product list or not.\n this.collectableProducts = false;\n // Show text describing the color and/or material of the product.\n this.showDesignText = false;\n // A list of sections used in the product list.\n this.productListSections = null;\n // Defines optional custom tab buttons. Up to five tabs are supported.\n this.customTabButtons = null;\n // Highest heading on the Summary page will be h2 as opposed to h1. Set to true if planner is e.g. used in an iframe with an h1 header outside of the planner.\n this.startHeadingsAtH2 = false;\n // Deprecated. Adds balanced margins on all sides of SummaryPage when true. To be used with the summary header and footer. This prop is deprecated - use the Main Header and Main Footer components together with the enableMainMargins prop instead.\n this.enableMargins = false;\n // Adds margins on all sides of SummaryPage when true. To be used with the main header and footer.\n this.enableMainMargins = false;\n // Used as a link for the QR code and in ShareDesignCard. It should be in the same format as the \"deeplink\" property in DEXF Settings (e.g. \"https://{dexf-addon-app}/storageone/pax/web/latest/{ru}/{lc}/#/u/{CODE}\").\n this.designLink = null;\n // Shows total package weight of the shopping products.\n this.showTotalPackageWeight = false;\n // Shows the assistance card, which informs the user how to get assistance with their design. It has a kiosk state with a different look when the prop kiosk is set to true.\n this.showAssistanceCard = false;\n // Shows the assembly services card, which presents the assembly service availability to the user.\n this.showAssemblyServices = false;\n // The name of the application, e.g. \"pax\". Used in the booking url in the assistance card.\n this.assistanceCardApplicationName = null;\n // Shows call to action button to give user the possibility to complete their purchase on kiosk. Won't be shown if showAddToBag is true.\n this.showKioskMainCTAButton = false;\n // Used for automatic analytics. If null or not set, analytics is turned off.\n this.analytics = null;\n // A list of product item numbers that can be removed in the product list.\n this.productListRemovable = null;\n // Sets the default sorting of the product list.\n this.defaultSortBy = null;\n // Inline messages, displayed below ConfigurationSummary.\n this.messageSection = null;\n // Displays link card when data and Översätta key showLinkCard are set. For image ratio guidelines, see Skapa Card. Hidden on kiosks when kiosk is true.\n this.linkCard = null;\n // State of the component. By using the \"stateChange\" event combined with this prop it is possible to take over state management. If not set, state is managed internally.\n this.state = null;\n // Shows print button. For example to be used on kiosks with print functionality.\n this.showPrintButton = false;\n // Shows edit design button.\n this.showEditDesignButton = false;\n // A sorted list of content to include in the print layout. When not set, the currently shown tab is printed. To include custom content in the print, the content must also be included as the slot \"custom-print-content\". E.g. ['productListTab', 'imagesTab', 'securityTab', 'customPrintContent'].\n this.contentToPrint = null;\n this.internalState = Object.assign({}, SummaryPageControllerDefaultState_1.default);\n this.toastManager = new component_toast_1.ToastManager({ theme: this.theme });\n this.listeners = {\n storeIdChange: this.onStoreIdChange.bind(this),\n zipCodeChange: this.onZipCodeChange.bind(this)\n };\n this.storeIdCookieInformationService = null;\n this.zipCodeCookieInformationService = null;\n this.customTabSlots = [];\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n var _a, _b, _c, _d, _e, _f;\n const state = this.getState();\n return (0, web_component_1.html) `\n\t\t\t {\n this.dispatchTrackAnalyticsEvent(event);\n this.setState({\n addUnavailableProductsToList: event.detail.addUnavailableProductsToList\n });\n }}\"\n\t\t\t\t@addUnavailableToCartAndList=\"${this.onAddUnavailableToCartAndList.bind(this)}\"\n\t\t\t\t@shareDesign=\"${this.onShareDesign.bind(this)}\"\n\t\t\t\t@confirmationCardStateChange=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n this.setState({ confirmationCardState: event.detail.selectedState });\n }}\"\n\t\t\t\t@modalClose=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n this.setState({ visibleModal: null });\n // If the zip validation failed, go back to the previous state\n if (!this.getZipInStateValid()) {\n this.setState({\n assemblyServices: Object.assign(Object.assign({}, this.getState().assemblyServices), { \n // If zip code has been set it must be correct\n state: this.getState().zipCode\n ? component_zip_in_1.ZipInCardStateEnum.submitted\n : component_zip_in_1.ZipInCardStateEnum.default })\n });\n }\n }}\"\n\t\t\t\t@modalOpen=\"${(event) => {\n var _a;\n this.dispatchTrackAnalyticsEvent(event);\n this.setState({ visibleModal: event.detail.visibleModal });\n if ((_a = event.detail) === null || _a === void 0 ? void 0 : _a.homeDeliveryState) {\n this.setState({\n homeDelivery: Object.assign(Object.assign({}, this.getState().homeDelivery), { state: event.detail.homeDeliveryState })\n });\n }\n }}}\"\n\t\t\t\t@storeSelectorChange=\"${(event) => {\n var _a;\n this.dispatchTrackAnalyticsEvent(event);\n this.setState({ storeId: event.detail.storeId, visibleModal: null });\n (_a = this.storeIdCookieInformationService) === null || _a === void 0 ? void 0 : _a.setStoreId(event.detail.storeId);\n }}\"\n\t\t\t\t@sortListChange=\"${(event) => {\n var _a;\n this.dispatchTrackAnalyticsEvent(event);\n // TODO: Should this state really be stored internally in SummaryPageProductList?\n this.setState({ visibleModal: (_a = event.detail.visibleModal) !== null && _a !== void 0 ? _a : null });\n }}\"\n\t\t\t\t@resetAddToCartState=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n this.setState({ addToCartState: component_add_to_bag_1.AddToBagStateEnum.default });\n }}\"\n\t\t\t\t@resetAddToListState=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n this.setState({ addToListState: component_add_to_bag_1.AddToBagStateEnum.default });\n }}\"\n\t\t\t\t@kioskMainCtaButtonClick=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n this.dispatchEvent(new CustomEvent('kioskMainCtaButtonClick', { bubbles: true }));\n }}\"\n\t\t\t\t@shareDesignCardStateChange=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n this.setState({\n shareDesignCard: Object.assign(Object.assign({}, this.getState().shareDesignCard), { state: event.detail.selectedState })\n });\n }}\"\n\t\t\t\t@sendByEmailInput=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n }}\"\n\t\t\t\t@sendByEmailValidation=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n // TODO: Should this state really be handled internally in SummaryPageSheet?\n }}\"\n\t\t\t\t@sendByEmailSend=\"${this.onSendByEmailSend.bind(this)}\"\n\t\t\t\t@sendByEmailReset=\"${(event) => {\n // TODO: Should this state really be handled internally in SummaryPageSheet?\n this.dispatchTrackAnalyticsEvent(event);\n this.setState({\n shareDesignCard: Object.assign(Object.assign({}, this.getState().shareDesignCard), { sendByEmailState: component_send_by_email_1.SendByEmailStateEnum.default })\n });\n }}\"\n\t\t\t\t@sendBySmsInput=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n }}\"\n\t\t\t\t@sendBySmsValidation=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n // TODO: Should this state really be handled internally in SummaryPageSheet?\n }}\"\n\t\t\t\t@sendBySmsSend=\"${this.onSendBySmsSend.bind(this)}\"\n\t\t\t\t@sendBySmsReset=\"${(event) => {\n // TODO: Should this state really be handled internally in SummaryPageSheet?\n this.dispatchTrackAnalyticsEvent(event);\n this.setState({\n shareDesignCard: Object.assign(Object.assign({}, this.getState().shareDesignCard), { sendBySmsState: component_send_by_sms_1.SendBySmsStateEnum.default })\n });\n }}\"\n\t\t\t\t@saveDesign=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n // TODO: This could be handled by the \"modalOpen\" event?\n this.setState({\n visibleModal: { itemNo: null, modal: SummaryPageModalEnum_1.default.saveDesignToProfileCard }\n });\n }}\"\n\t\t\t\t@saveDesignToProfile=\"${this.onSaveDesignToProfile.bind(this)}\"\n\t\t\t\t@saveDesignToProfileLogIn=\"${this.onSaveDesignToProfileLogIn.bind(this)}\"\n\t\t\t\t@logInAndSaveDesign=\"${this.onLogInAndSaveDesign.bind(this)}\"\n\t\t\t\t@homeDeliveryStartOverClick=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n this.setState({\n homeDelivery: Object.assign(Object.assign({}, this.getState().homeDelivery), { state: event.detail.state, inputValue: event.detail.inputValue })\n });\n }}\"\n\t\t\t\t@homeDeliveryForgetClick=\"${(event) => {\n var _a;\n this.dispatchTrackAnalyticsEvent(event);\n const { detail: { visibleModal, state, inputValue, zipCode, zipAvailabilities } } = event;\n this.setState({\n visibleModal,\n homeDelivery: Object.assign(Object.assign({}, this.getState().homeDelivery), { state,\n inputValue,\n zipCode,\n zipAvailabilities })\n });\n (_a = this.zipCodeCookieInformationService) === null || _a === void 0 ? void 0 : _a.clearZipCode();\n }}\"\n\t\t\t\t@homeDeliveryInput=\"${(event) => {\n var _a;\n this.dispatchTrackAnalyticsEvent(event);\n this.setState({\n homeDelivery: Object.assign(Object.assign({}, this.getState().homeDelivery), { state: (_a = event.detail.state) !== null && _a !== void 0 ? _a : this.getState().homeDelivery.state, inputValue: event.detail.inputValue })\n });\n }}\"\n\t\t\t\t@homeDeliverySubmitButtonClick=\"${this.onHomeDeliverySubmitButtonClick.bind(this)}\"\n\t\t\t\t@collectProduct=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n this.setState({ collectedProducts: event.detail.collectedProducts });\n }}\"\n\t\t\t\t@productListRemove=\"${(event) => {\n var _a, _b;\n this.dispatchTrackAnalyticsEvent(event);\n const shoppingProducts = (_b = (_a = this.getState().shoppingProducts) === null || _a === void 0 ? void 0 : _a.filter((p) => {\n var _a;\n return ((_a = p.product.content) === null || _a === void 0 ? void 0 : _a.itemNoGlobal) !== event.detail.itemNo;\n })) !== null && _b !== void 0 ? _b : [];\n this.setState({\n shoppingProducts\n });\n this.dispatchEvent(new CustomEvent('productListRemove', {\n bubbles: true,\n detail: { itemNo: event.detail.itemNo, shoppingItems: this.getShoppingItems() }\n }));\n }}}\"\n\t\t\t\t@financialServicesContinueButtonClick=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n // TODO: This could be handled by the modalClose event.\n this.setState({ visibleModal: null });\n }}\"\n\t\t\t\t@linkCardClick=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n this.dispatchEvent(new CustomEvent('linkCardClick', {\n bubbles: true,\n detail: event.detail\n }));\n }}\"\n\t\t\t\t@productListExpand=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n // TODO: Should this state really be stored internally in SummaryPageProductList?\n }}\"\n\t\t\t\t@financialServicesMoreInfoClick=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n }}\"\n\t\t\t\t@selectedImageIndexChange=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n // TODO: Should this state really be stored internally in SummaryPageImages?\n }}\"\n\t\t\t\t@copyDesign=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n }}\"\n\t\t\t\t@copyDesignCodeClick=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n }}\"\n\t\t\t\t@copyDesignCodeReset=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n }}\"\n\t\t\t\t@copyDesignLinkClick=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n }}\"\n\t\t\t\t@copyDesignLinkReset=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n }}\"\n\t\t\t\t@addToCartClick=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n }}\"\n\t\t\t\t@unavailableProductsModalContinue=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n this.setState({ visibleModal: null });\n }}\"\n\t\t\t\t@tabChange=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n // TODO: Should this state really be stored internally in SummaryPage?\n }}\"\n\t\t\t\t@printButtonClick=\"${(event) => {\n this.dispatchEvent(new CustomEvent('printButtonClick', { bubbles: true }));\n this.dispatchTrackAnalyticsEvent(event);\n }}\"\n\t\t\t\t@editDesignButtonClick=\"${(event) => {\n this.dispatchTrackAnalyticsEvent(event);\n this.dispatchEvent(new CustomEvent('editDesignButtonClick', { bubbles: true }));\n }}\"\n\t\t\t\t@forgetZipCode=\"${(event) => {\n var _a;\n this.dispatchTrackAnalyticsEvent(event);\n const { zipCode, visibleModal, state } = event.detail;\n this.setState({\n visibleModal,\n zipCode,\n assemblyServices: Object.assign(Object.assign({}, this.getState().assemblyServices), { state })\n });\n (_a = this.zipCodeCookieInformationService) === null || _a === void 0 ? void 0 : _a.clearZipCode();\n }}\"\n\t\t\t\t@saveZipCode=\"${this.onSaveZipCode.bind(this)}\"\n\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t.translations=\"${state.translations}\"\n\t\t\t\t.settings=\"${state.settings}\"\n\t\t\t\t.locale=\"${this.serviceOptions.locale}\"\n\t\t\t\t.shoppingProducts=\"${(_a = state.shoppingProducts) !== null && _a !== void 0 ? _a : []}\"\n\t\t\t\t.storeAvailabilities=\"${(_b = state.storeAvailabilities) !== null && _b !== void 0 ? _b : null}\"\n\t\t\t\t.stores=\"${(_c = state.stores) !== null && _c !== void 0 ? _c : []}\"\n\t\t\t\t.storeId=\"${(_d = state.storeId) !== null && _d !== void 0 ? _d : null}\"\n\t\t\t\t.productMeasures=\"${this.productMeasures}\"\n\t\t\t\t.configurationMeasures=\"${this.configurationMeasures}\"\n\t\t\t\t.screenshotUrl=\"${this.screenshotUrl}\"\n\t\t\t\t.screenshotAlt=\"${this.screenshotAlt}\"\n\t\t\t\t.productName=\"${this.productName}\"\n\t\t\t\t.productDescription=\"${this.productDescription}\"\n\t\t\t\t.showShareDesign=\"${!!this.vpcCode ||\n (!!this.designConfiguration &&\n !!this.designConfiguration.images &&\n !!this.designConfiguration.description)}\"\n\t\t\t\t.showSaveDesign=\"${this.showSaveDesign &&\n !this.kiosk &&\n ((_e = state.settings) === null || _e === void 0 ? void 0 : _e.kompis.serviceSettings.saveDataSource) !== enums_1.SaveDataSourceEnum.disabled}\"\n\t\t\t\t.showAddToBag=\"${!this.kiosk}\"\n\t\t\t\t.vpcCode=\"${this.vpcCode || state.vpcCode}\"\n\t\t\t\t.disableLinks=\"${this.kiosk}\"\n\t\t\t\t.visibleModal=\"${state.visibleModal}\"\n\t\t\t\t.addToCartState=\"${state.addToCartState}\"\n\t\t\t\t.addToListState=\"${state.addToListState}\"\n\t\t\t\t.shareDesignState=\"${state.shareDesignState}\"\n\t\t\t\t.confirmationCardState=\"${state.confirmationCardState}\"\n\t\t\t\t.confirmationCardType=\"${state.confirmationCardType}\"\n\t\t\t\t.images=\"${this.images}\"\n\t\t\t\t.securityInformation=\"${this.securityInformation}\"\n\t\t\t\t.measurements=\"${this.measurements}\"\n\t\t\t\t.addUnavailableProductsToList=\"${state.addUnavailableProductsToList}\"\n\t\t\t\t.designLink=\"${this.getDesignLink()}\"\n\t\t\t\t.shareDesignCard=\"${Object.assign(Object.assign({}, state.shareDesignCard), { autocomplete: !this.kiosk, showCopyDesignCodeButton: !this.kiosk, showCopyLink: !this.kiosk })}\"\n\t\t\t\t.saveDesignToProfile=\"${state.saveDesignToProfile}\"\n\t\t\t\t.logInAndSaveState=\"${state.logInAndSaveState}\"\n\t\t\t\t.homeDelivery=\"${state.homeDelivery}\"\n\t\t\t\t.collectableProducts=\"${this.collectableProducts}\"\n\t\t\t\t.collectedProducts=\"${state.collectedProducts}\"\n\t\t\t\t.showDesignText=\"${this.showDesignText}\"\n\t\t\t\t.productListSections=\"${this.productListSections}\"\n\t\t\t\t.customTabButtons=\"${this.customTabButtons}\"\n\t\t\t\t.failedShoppingItems=\"${state.failedShoppingItems}\"\n\t\t\t\t.startHeadingsAtH2=\"${this.startHeadingsAtH2}\"\n\t\t\t\t.enableMargins=\"${this.enableMargins}\"\n\t\t\t\t.enableMainMargins=\"${this.enableMainMargins}\"\n\t\t\t\t.financingOption=\"${state.financingOption}\"\n\t\t\t\t.showTotalPackageWeight=\"${this.showTotalPackageWeight}\"\n\t\t\t\t.showAssistanceCard=\"${this.showAssistanceCard}\"\n\t\t\t\t.assistanceCardApplicationName=\"${this.assistanceCardApplicationName}\"\n\t\t\t\t.showKioskMainCTAButton=\"${this.kiosk && this.showKioskMainCTAButton}\"\n\t\t\t\t.analytics=\"${this.analytics}\"\n\t\t\t\t.includedProductsWithinSprs=\"${state.includedProductsWithinSprs}\"\n\t\t\t\t.productListRemovable=\"${this.productListRemovable}\"\n\t\t\t\t.defaultSortBy=\"${this.defaultSortBy}\"\n\t\t\t\t.messageSection=\"${this.messageSection}\"\n\t\t\t\t.linkCard=\"${this.linkCard}\"\n\t\t\t\t.showPrintButton=\"${this.showPrintButton}\"\n\t\t\t\t.showEditDesignButton=\"${this.showEditDesignButton}\"\n\t\t\t\t.contentToPrint=\"${this.contentToPrint}\"\n\t\t\t\t.pickingListPrintLayout=\"${component_product_row_1.ProductRowLayoutEnum.compactPrint}\"\n\t\t\t\t.showAssemblyServices=\"${this.showAssemblyServices &&\n ((_f = state.settings) === null || _f === void 0 ? void 0 : _f.kompis.serviceSettings.assemblyServicesDataSource) !==\n enums_1.AssemblyServicesDataSourceEnum.disabled}\"\n\t\t\t\t.zipCode=\"${state.zipCode}\"\n\t\t\t\t.assemblyServices=\"${state.assemblyServices}\"\n\t\t\t>\n\t\t\t\t${this.customTabSlots}\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n /**\n * Returns state.\n *\n * @returns State.\n */\n getState() {\n var _a;\n return (_a = this.state) !== null && _a !== void 0 ? _a : this.internalState;\n }\n /**\n * Sets state.\n *\n * @param state State.\n * @returns Promise.\n */\n setState(state) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const oldState = this.internalState;\n this.internalState = Object.assign({}, this.internalState, state);\n this.dispatchEvent(new CustomEvent('stateChange', {\n bubbles: true,\n detail: { state: this.internalState, oldState: (_a = this.state) !== null && _a !== void 0 ? _a : oldState }\n }));\n if (!this.state) {\n yield this.requestUpdate();\n }\n });\n }\n /**\n * @override\n */\n connectedCallback() {\n super.connectedCallback();\n // State is stored in session storage when redirecting to the login page.\n // Therefore we need to load it back if it exists.\n this.loadStateFromSessionStorage();\n }\n /**\n * @override\n */\n disconnectedCallback() {\n var _a, _b, _c;\n super.disconnectedCallback();\n (_a = this.storeIdCookieInformationService) === null || _a === void 0 ? void 0 : _a.unsubscribe(this.listeners.storeIdChange);\n this.storeIdCookieInformationService = null;\n (_b = this.zipCodeCookieInformationService) === null || _b === void 0 ? void 0 : _b.unsubscribe(this.listeners.zipCodeChange);\n this.zipCodeCookieInformationService = null;\n const oldState = this.internalState;\n this.internalState = Object.assign({}, SummaryPageControllerDefaultState_1.default);\n this.dispatchEvent(new CustomEvent('stateChange', {\n bubbles: true,\n detail: { state: this.internalState, oldState: (_c = this.state) !== null && _c !== void 0 ? _c : oldState }\n }));\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n this.fetchChangedProperties(changedProperties);\n if (changedProperties.has('theme')) {\n this.toastManager = new component_toast_1.ToastManager({ theme: this.theme });\n }\n if (changedProperties.has('customTabButtons')) {\n const numberOfCustomTabs = SummaryPageCustomTabsUtility_1.default.getNumberOfCustomTabsToShow(this.customTabButtons);\n this.customTabSlots = SummaryPageCustomTabsUtility_1.default.getCustomTabSlots(numberOfCustomTabs);\n }\n return true;\n }\n getZipInStateValid() {\n if (!this.internalState.assemblyServices || !this.internalState.assemblyServices.state) {\n return false;\n }\n return ![\n component_zip_in_1.ZipInCardStateEnum.emptyInput,\n component_zip_in_1.ZipInCardStateEnum.invalidInput,\n component_zip_in_1.ZipInCardStateEnum.noZipInfo\n ].includes(this.internalState.assemblyServices.state);\n }\n onAddToCart(event) {\n return __awaiter(this, void 0, void 0, function* () {\n this.dispatchTrackAnalyticsEvent(event);\n this.setState({ addToCartState: component_add_to_bag_1.AddToBagStateEnum.loading });\n const vpcCode = yield this.getExistingVpcCodeOrCreateNew();\n let cart = null;\n let error = null;\n try {\n const options = this.getServiceOptionsWithSettings();\n cart = yield new services_3.ShoppingCartService(options).addToCart({\n items: event.detail.shoppingItems,\n designCode: vpcCode !== null && vpcCode !== void 0 ? vpcCode : undefined,\n addDesignCodeAsGroup: !!event.detail.completeConfiguration && !!vpcCode\n });\n }\n catch (e) {\n error = e;\n }\n if (error || (cart === null || cart === void 0 ? void 0 : cart.errorList.length)) {\n const failedShoppingItems = cart\n ? this.getFailedShoppingItemsFromCart(cart)\n : error && error.failedShoppingItems\n ? error.failedShoppingItems\n : [];\n if (failedShoppingItems.length) {\n this.setState({\n failedShoppingItems,\n addToCartState: component_add_to_bag_1.AddToBagStateEnum.default,\n visibleModal: {\n itemNo: null,\n modal: SummaryPageModalEnum_1.default.unavailableProductCard\n }\n });\n }\n else {\n this.setState({ addToCartState: component_add_to_bag_1.AddToBagStateEnum.default });\n }\n this.toastManager.showToast(component_configuration_summary_1.ConfigurationSummaryToastMessage.getAddToCartFail(this.getState().translations));\n if (error) {\n console.error(error);\n window.dispatchEvent(new ErrorEvent('error', { error, message: error.message }));\n }\n return;\n }\n this.setState({\n confirmationCardType: SummaryPageConfirmationCardTypeEnum_1.default.addToCartSuccess,\n visibleModal: { itemNo: null, modal: SummaryPageModalEnum_1.default.confirmationCard },\n addToCartState: component_add_to_bag_1.AddToBagStateEnum.confirmation\n });\n yield this.saveDesignIfLoggedIn();\n });\n }\n onAddToList(event) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n this.dispatchTrackAnalyticsEvent(event);\n this.setState({ addToListState: component_add_to_bag_1.AddToBagStateEnum.loading });\n const vpcCode = yield this.getExistingVpcCodeOrCreateNew();\n const options = Object.assign(Object.assign({}, this.getServiceOptionsWithSettings()), { translations: (_a = this.getState().translations) !== null && _a !== void 0 ? _a : undefined });\n try {\n yield new services_3.ShoppingListService(options).addToList({\n items: this.getShoppingItems(),\n designCode: vpcCode !== null && vpcCode !== void 0 ? vpcCode : undefined\n });\n }\n catch (error) {\n this.setState({ addToListState: component_add_to_bag_1.AddToBagStateEnum.default });\n this.toastManager.showToast(component_configuration_summary_1.ConfigurationSummaryToastMessage.getAddToListFail(this.getState().translations));\n console.error(error);\n window.dispatchEvent(new ErrorEvent('error', { error, message: error.message }));\n return;\n }\n this.setState({\n addToListState: component_add_to_bag_1.AddToBagStateEnum.confirmation,\n confirmationCardType: SummaryPageConfirmationCardTypeEnum_1.default.addToListSuccess,\n visibleModal: { itemNo: null, modal: SummaryPageModalEnum_1.default.confirmationCard }\n });\n yield this.saveDesignIfLoggedIn();\n });\n }\n onAddUnavailableToCartAndList(event) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n this.dispatchTrackAnalyticsEvent(event);\n this.setState({\n addToCartState: component_add_to_bag_1.AddToBagStateEnum.loading,\n addToListState: component_add_to_bag_1.AddToBagStateEnum.loading\n });\n const vpcCode = yield this.getExistingVpcCodeOrCreateNew();\n let cart = null;\n let shoppingList = null;\n const options = Object.assign(Object.assign({}, this.getServiceOptionsWithSettings()), { translations: (_a = this.getState().translations) !== null && _a !== void 0 ? _a : undefined });\n try {\n [cart, shoppingList] = yield Promise.all([\n new services_3.ShoppingCartService(options).addToCart({\n items: event.detail.shoppingCartItems,\n designCode: vpcCode !== null && vpcCode !== void 0 ? vpcCode : undefined\n }),\n new services_3.ShoppingListService(options).addToList({\n items: event.detail.shoppingListItems\n })\n ]);\n }\n catch (error) {\n this.setState({\n addToCartState: component_add_to_bag_1.AddToBagStateEnum.default,\n addToListState: component_add_to_bag_1.AddToBagStateEnum.default\n });\n this.toastManager.showToast(component_configuration_summary_1.ConfigurationSummaryToastMessage.getAddToCartFail(this.getState().translations));\n console.error(error);\n window.dispatchEvent(new ErrorEvent('error', { error, message: error.message }));\n return;\n }\n const hasErrors = (cartOrList) => {\n return !!cartOrList.errorList.length;\n };\n if (hasErrors(cart) && hasErrors(shoppingList)) {\n this.setState({\n addToCartState: component_add_to_bag_1.AddToBagStateEnum.default,\n addToListState: component_add_to_bag_1.AddToBagStateEnum.default\n });\n this.toastManager.showToast(component_configuration_summary_1.ConfigurationSummaryToastMessage.getAddToCartAndListFail(this.getState().translations));\n return;\n }\n if (hasErrors(cart)) {\n this.setState({\n addToCartState: component_add_to_bag_1.AddToBagStateEnum.default,\n addToListState: component_add_to_bag_1.AddToBagStateEnum.default,\n visibleModal: { itemNo: null, modal: SummaryPageModalEnum_1.default.confirmationCard },\n confirmationCardType: SummaryPageConfirmationCardTypeEnum_1.default.addUnavailabeToCartFailAndListSuccess\n });\n }\n else if (hasErrors(shoppingList)) {\n this.setState({\n addToCartState: component_add_to_bag_1.AddToBagStateEnum.default,\n addToListState: component_add_to_bag_1.AddToBagStateEnum.default,\n visibleModal: { itemNo: null, modal: SummaryPageModalEnum_1.default.confirmationCard },\n confirmationCardType: SummaryPageConfirmationCardTypeEnum_1.default.addUnavailabeToCartSuccessAndListFail\n });\n }\n else {\n this.setState({\n addToCartState: component_add_to_bag_1.AddToBagStateEnum.confirmation,\n addToListState: component_add_to_bag_1.AddToBagStateEnum.confirmation,\n visibleModal: { itemNo: null, modal: SummaryPageModalEnum_1.default.confirmationCard },\n confirmationCardType: SummaryPageConfirmationCardTypeEnum_1.default.addUnavailabeToCartAndListSuccess\n });\n }\n yield this.saveDesignIfLoggedIn();\n });\n }\n onShareDesign(event) {\n return __awaiter(this, void 0, void 0, function* () {\n this.dispatchTrackAnalyticsEvent(event);\n const vpcCode = this.vpcCode || this.getState().vpcCode;\n if (vpcCode) {\n this.setState({\n visibleModal: { itemNo: null, modal: SummaryPageModalEnum_1.default.shareDesignCard },\n vpcCode,\n shareDesignState: component_configuration_summary_1.ConfirmationSummaryShareDesignStateEnum.default,\n shareDesignCard: Object.assign({}, SummaryPageControllerDefaultState_1.default.shareDesignCard)\n });\n return;\n }\n if (!this.designConfiguration || !this.designConfiguration.configuration) {\n return;\n }\n this.setState({\n shareDesignState: component_configuration_summary_1.ConfirmationSummaryShareDesignStateEnum.loading,\n shareDesignCard: Object.assign({}, SummaryPageControllerDefaultState_1.default.shareDesignCard)\n });\n try {\n yield this.saveVpcConfigurationAndSetToState();\n }\n catch (error) {\n this.setState({\n confirmationCardType: SummaryPageConfirmationCardTypeEnum_1.default.saveVpcFail,\n visibleModal: { itemNo: null, modal: SummaryPageModalEnum_1.default.confirmationCard },\n vpcCode: null,\n shareDesignState: component_configuration_summary_1.ConfirmationSummaryShareDesignStateEnum.default\n });\n console.error(error);\n window.dispatchEvent(new ErrorEvent('error', { error, message: error.message }));\n return;\n }\n this.setState({\n visibleModal: { itemNo: null, modal: SummaryPageModalEnum_1.default.shareDesignCard },\n shareDesignState: component_configuration_summary_1.ConfirmationSummaryShareDesignStateEnum.default\n });\n });\n }\n onSendByEmailSend(event) {\n return __awaiter(this, void 0, void 0, function* () {\n this.dispatchTrackAnalyticsEvent(event);\n this.setState({\n shareDesignCard: Object.assign(Object.assign({}, this.getState().shareDesignCard), { sendByEmailState: component_send_by_email_1.SendByEmailStateEnum.loading })\n });\n const vpcCode = this.vpcCode || this.getState().vpcCode;\n if (!vpcCode) {\n throw new Error('VPC code is missing');\n }\n const options = this.getServiceOptionsWithSettings();\n try {\n yield new services_3.NotificationService(options).sendEmail({\n vpcCode,\n email: event.detail.value,\n linkType: enums_1.NotificationLinkTypeEnum.deeplink\n });\n }\n catch (error) {\n this.setState({\n shareDesignCard: Object.assign(Object.assign({}, this.getState().shareDesignCard), { sendByEmailState: component_send_by_email_1.SendByEmailStateEnum.failed })\n });\n console.error(error);\n window.dispatchEvent(new ErrorEvent('error', { error, message: error.message }));\n return;\n }\n this.setState({\n shareDesignCard: Object.assign(Object.assign({}, this.getState().shareDesignCard), { sendByEmailState: component_send_by_email_1.SendByEmailStateEnum.success })\n });\n });\n }\n getServiceOptionsWithSettings() {\n const serviceOptionsWithSettings = this.getState().serviceOptionsWithSettings;\n if (!serviceOptionsWithSettings) {\n throw new Error('Settings must be fetched before using other services.');\n }\n return serviceOptionsWithSettings;\n }\n onSendBySmsSend(event) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n this.dispatchTrackAnalyticsEvent(event);\n this.setState({\n shareDesignCard: Object.assign(Object.assign({}, this.getState().shareDesignCard), { sendBySmsState: component_send_by_sms_1.SendBySmsStateEnum.loading })\n });\n const vpcCode = this.vpcCode || this.getState().vpcCode;\n if (!vpcCode) {\n throw new Error('VPC code is missing');\n }\n const options = this.getServiceOptionsWithSettings();\n try {\n yield new services_3.NotificationService(options).sendSms({\n vpcCode,\n phoneNumber: event.detail.value,\n linkType: enums_1.NotificationLinkTypeEnum.deeplink,\n storeId: (_a = this.getState().storeId) !== null && _a !== void 0 ? _a : undefined\n });\n }\n catch (error) {\n this.setState({\n shareDesignCard: Object.assign(Object.assign({}, this.getState().shareDesignCard), { sendBySmsState: component_send_by_sms_1.SendBySmsStateEnum.failed })\n });\n console.error(error);\n window.dispatchEvent(new ErrorEvent('error', { error, message: error.message }));\n return;\n }\n this.setState({\n shareDesignCard: Object.assign(Object.assign({}, this.getState().shareDesignCard), { sendBySmsState: component_send_by_sms_1.SendBySmsStateEnum.success })\n });\n });\n }\n onSaveDesignToProfile(event) {\n return __awaiter(this, void 0, void 0, function* () {\n this.dispatchTrackAnalyticsEvent(event);\n this.setState({\n saveDesignToProfile: Object.assign(Object.assign({}, this.getState().saveDesignToProfile), { saveDesignState: component_save_design_to_profile_1.SaveDesignToProfileStateEnum.loading })\n });\n let saveConfiguration = null;\n let error = null;\n try {\n const token = yield this.getAccountService().retrieveAccessToken();\n if (!token) {\n yield this.onSaveDesignToProfileLogIn();\n return;\n }\n saveConfiguration = yield this.saveDesignToProfile(token);\n }\n catch (e) {\n error = e;\n }\n this.setState({\n visibleModal: null,\n saveDesignToProfile: Object.assign(Object.assign({}, this.getState().saveDesignToProfile), { saveDesignState: component_save_design_to_profile_1.SaveDesignToProfileStateEnum.default })\n });\n if (saveConfiguration) {\n this.toastManager.showToast(component_save_design_to_profile_1.SaveDesignToProfileToastMessage.getSaveDesignSuccess(this.getState().translations));\n }\n else {\n this.toastManager.showToast(component_save_design_to_profile_1.SaveDesignToProfileToastMessage.getSaveDesignFailure(this.getState().translations));\n }\n if (error) {\n console.error(error);\n window.dispatchEvent(new ErrorEvent('error', { error, message: error.message }));\n }\n });\n }\n designIsAlreadySaved() {\n return this.designSaved || this.getState().designSaved;\n }\n saveDesignIfLoggedIn() {\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.showSaveDesign || this.designIsAlreadySaved()) {\n return;\n }\n const accountService = this.getAccountService();\n try {\n const token = yield accountService.retrieveAccessToken();\n if (token) {\n const saveConfiguration = yield this.saveDesignToProfile(token);\n if (saveConfiguration) {\n this.toastManager.showToast(component_save_design_to_profile_1.SaveDesignToProfileToastMessage.getSaveDesignSuccess(this.getState().translations));\n }\n }\n }\n catch (error) {\n console.error(error);\n window.dispatchEvent(new ErrorEvent('error', { error, message: error.message }));\n }\n });\n }\n saveDesignToProfile(token) {\n return __awaiter(this, void 0, void 0, function* () {\n const options = this.getServiceOptionsWithSettings();\n if (!this.designConfiguration ||\n !this.designConfiguration.images ||\n !this.designConfiguration.description) {\n throw new Error('Failed to save design. The prop \"designConfiguration\" has not been defined.');\n }\n const saveConfiguration = yield new services_3.SaveService(options).saveConfiguration(token, {\n shoppingItems: this.getShoppingItems(),\n configuration: this.designConfiguration.configuration,\n // Base64 string with an image of the configuration.\n configurationImage: this.designConfiguration.images,\n // The description is used to describe the saved design in other components.\n configurationDescription: this.designConfiguration.description\n });\n if (saveConfiguration) {\n this.setState({ designSaved: true });\n }\n return saveConfiguration;\n });\n }\n onSaveDesignToProfileLogIn(event) {\n return __awaiter(this, void 0, void 0, function* () {\n if (event) {\n this.dispatchTrackAnalyticsEvent(event);\n }\n this.dispatchEvent(new CustomEvent('saveDesignToProfileLogIn', { bubbles: true }));\n yield this.logIn();\n });\n }\n onLogInAndSaveDesign(event) {\n return __awaiter(this, void 0, void 0, function* () {\n this.dispatchTrackAnalyticsEvent(event);\n this.dispatchEvent(new CustomEvent('logInAndSaveDesign', { bubbles: true }));\n if (this.loginBehaviour === SummaryPageControllerLoginBehaviourEnum_1.default.redirect) {\n yield this.logInUsingRedirectAndPrepareSaveDesign();\n }\n });\n }\n logInUsingRedirectAndPrepareSaveDesign() {\n return __awaiter(this, void 0, void 0, function* () {\n // The button to log in and save should never appear when already logged in.\n // We can assume that the page will be redirected when attempting to log in.\n this.setState({\n saveDesignOnReload: true,\n logInAndSaveState: component_configuration_summary_1.ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum.loading\n });\n yield this.logIn();\n });\n }\n logIn() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.loginBehaviour === SummaryPageControllerLoginBehaviourEnum_1.default.disabled) {\n return null;\n }\n const accountService = this.getAccountService();\n const token = yield accountService.retrieveAccessToken();\n if (token) {\n // User is already logged in.\n this.setState({\n saveDesignToProfile: Object.assign(Object.assign({}, this.getState().saveDesignToProfile), { loggedIn: true })\n });\n return token;\n }\n if (this.loginBehaviour === SummaryPageControllerLoginBehaviourEnum_1.default.redirect) {\n this.storeStateInSessionStorage();\n }\n try {\n const newToken = yield accountService.initiateLogin();\n // A token will only be returned when using popup.\n if (newToken) {\n this.setState({\n saveDesignToProfile: Object.assign(Object.assign({}, this.getState().saveDesignToProfile), { loggedIn: true })\n });\n }\n return newToken !== null && newToken !== void 0 ? newToken : null;\n }\n catch (error) {\n this.clearStateInSessionStorage();\n console.error(error);\n window.dispatchEvent(new ErrorEvent('error', { error, message: error.message }));\n return null;\n }\n });\n }\n onHomeDeliverySubmitButtonClick(event) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n const inputValue = this.getState().homeDelivery.inputValue;\n this.dispatchTrackAnalyticsEvent(event);\n if (!inputValue) {\n this.setState({\n homeDelivery: Object.assign(Object.assign({}, this.getState().homeDelivery), { state: component_home_delivery_1.HomeDeliveryStateEnum.default, zipAvailabilities: null })\n });\n return;\n }\n if (!inputValue.replace(/\\s/g, '').length) {\n this.setState({\n homeDelivery: Object.assign(Object.assign({}, this.getState().homeDelivery), { state: component_home_delivery_1.HomeDeliveryStateEnum.invalidInput })\n });\n return;\n }\n this.setState({\n homeDelivery: Object.assign(Object.assign({}, this.getState().homeDelivery), { state: component_home_delivery_1.HomeDeliveryStateEnum.loading })\n });\n let zipValidation = null;\n const options = this.getServiceOptionsWithSettings();\n try {\n zipValidation = yield new services_3.ZipValidationService(options).getZipValidation(inputValue);\n }\n catch (error) {\n this.setState({\n homeDelivery: Object.assign(Object.assign({}, this.getState().homeDelivery), { state: component_home_delivery_1.HomeDeliveryStateEnum.noDeliveryInfo, zipCode: inputValue, zipAvailabilities: null })\n });\n (_a = this.zipCodeCookieInformationService) === null || _a === void 0 ? void 0 : _a.setZipCode(inputValue);\n console.error(error);\n window.dispatchEvent(new ErrorEvent('error', { error, message: error.message }));\n return;\n }\n if (zipValidation.valid && zipValidation.content) {\n const zipCode = zipValidation.content.formatted;\n this.setState({\n homeDelivery: Object.assign(Object.assign({}, this.getState().homeDelivery), { state: component_home_delivery_1.HomeDeliveryStateEnum.submitted, inputValue: zipCode, zipCode })\n });\n (_b = this.zipCodeCookieInformationService) === null || _b === void 0 ? void 0 : _b.setZipCode(zipCode);\n }\n else {\n this.setState({\n homeDelivery: Object.assign(Object.assign({}, this.getState().homeDelivery), { state: component_home_delivery_1.HomeDeliveryStateEnum.invalidInput })\n });\n }\n });\n }\n onSaveZipCode(event) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n this.dispatchTrackAnalyticsEvent(event);\n const { zipCode } = event.detail;\n if (zipCode.length < 1) {\n this.setState({\n assemblyServices: Object.assign(Object.assign({}, this.getState().assemblyServices), { state: component_zip_in_1.ZipInCardStateEnum.emptyInput })\n });\n return;\n }\n // Retrieve the assembly services data\n yield this.fetchAssemblyServices(zipCode);\n if (this.getZipInStateValid()) {\n this.setState({\n visibleModal: null\n });\n const formattedZipCode = this.getState().zipCode;\n (_a = this.zipCodeCookieInformationService) === null || _a === void 0 ? void 0 : _a.setZipCode(formattedZipCode);\n this.toastManager.showToast(component_zip_in_1.ZipInToastMessage.getZipCodeToastLabel(this.getState().translations, formattedZipCode));\n }\n });\n }\n onStoreIdChange(storeId) {\n this.setState({ storeId });\n this.fetchStoreAvailabilities();\n }\n onZipCodeChange(zipCode) {\n if (this.getState().zipCode && !zipCode) {\n this.setState(Object.assign(Object.assign({}, this.getState()), { assemblyServices: null }));\n return;\n }\n this.setState({\n zipCode,\n homeDelivery: Object.assign(Object.assign({}, this.getState().homeDelivery), { zipCode, inputValue: zipCode !== null && zipCode !== void 0 ? zipCode : '' })\n });\n this.fetchZipAvailabilities();\n this.fetchAssemblyServices(zipCode);\n }\n fetchChangedProperties(changedProperties) {\n return __awaiter(this, void 0, void 0, function* () {\n if (changedProperties.has('serviceOptions')) {\n yield this.fetchDexfSettings();\n this.subscribeToCookieInformation();\n yield Promise.all([\n this.fetchPhraseTranslations(),\n this.fetchShoppingProducts(),\n this.fetchStores(),\n this.fetchStoreId(),\n this.fetchZipCode(),\n this.fetchUserLoggedInState()\n ]);\n yield Promise.all([\n this.fetchFinancingOption(),\n this.fetchZipAvailabilities(),\n this.fetchAssemblyServices(this.getState().zipCode),\n this.fetchStoreAvailabilities()\n ]);\n if (!this.vpcCode && (this.showAssistanceCard || this.designLink)) {\n yield this.fetchVpcCode();\n }\n if (this.getState().saveDesignOnReload) {\n yield this.saveDesignAfterPageReload();\n }\n }\n else {\n if (changedProperties.has('shoppingItems')) {\n yield this.fetchShoppingProducts();\n yield Promise.all([\n this.fetchFinancingOption(),\n this.fetchZipAvailabilities(),\n this.fetchAssemblyServices(this.getState().zipCode),\n this.fetchStoreAvailabilities()\n ]);\n }\n if (!this.vpcCode &&\n (changedProperties.has('showAssistanceCard') || changedProperties.has('designLink')) &&\n (this.showAssistanceCard || this.designLink)) {\n yield this.fetchVpcCode();\n }\n }\n });\n }\n saveDesignAfterPageReload() {\n return __awaiter(this, void 0, void 0, function* () {\n const accountService = this.getAccountService();\n try {\n const token = yield accountService.retrieveAccessToken();\n if (token) {\n const saveConfiguration = yield this.saveDesignToProfile(token);\n if (saveConfiguration) {\n this.toastManager.showToast(component_save_design_to_profile_1.SaveDesignToProfileToastMessage.getSaveDesignSuccess(this.getState().translations));\n this.setState({\n logInAndSaveState: component_configuration_summary_1.ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum.default,\n saveDesignOnReload: false\n });\n return;\n }\n }\n }\n catch (error) {\n console.error(error);\n window.dispatchEvent(new ErrorEvent('error', { error, message: error.message }));\n }\n this.toastManager.showToast(component_save_design_to_profile_1.SaveDesignToProfileToastMessage.getSaveDesignFailure(this.getState().translations));\n this.setState({\n logInAndSaveState: component_configuration_summary_1.ConfigurationSummaryConfirmationCardLogInAndSaveStateEnum.failed,\n saveDesignOnReload: false\n });\n });\n }\n fetchPhraseTranslations() {\n return __awaiter(this, void 0, void 0, function* () {\n const translations = yield new services_3.TranslationsService(this.serviceOptions).getTranslations();\n this.setState({ translations: translations.kompis });\n });\n }\n fetchDexfSettings() {\n return __awaiter(this, void 0, void 0, function* () {\n const settings = yield new services_3.SettingsService(this.serviceOptions).getApplicationSettings(this.serviceOptions.filterSegment);\n this.setState({\n settings,\n serviceOptionsWithSettings: Object.assign(Object.assign({}, this.serviceOptions), { settings })\n });\n });\n }\n fetchShoppingProducts() {\n return __awaiter(this, void 0, void 0, function* () {\n const options = this.getServiceOptionsWithSettings();\n const shoppingProducts = yield new services_3.ProductService(options).getShoppingProducts(this.shoppingItems, services_3.KompisDefaultFields);\n this.setState({ shoppingProducts });\n });\n }\n pageHasBeenRedirectedBackAfterLogIn() {\n // After log in, we are redirected back to the value of serviceOptions.redirectUri.\n // This URI is controlled by the planner.\n // The only way the controller knows that we have logged in and been redirected back is to check whether the \"code verifier\" is set as a query parameter in the URI.\n return new URL(window.location.href).searchParams.has('code');\n }\n fetchUserLoggedInState() {\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.showSaveDesign || this.getState().saveDesignToProfile.loggedIn) {\n return;\n }\n const accountService = this.getAccountService();\n if (this.pageHasBeenRedirectedBackAfterLogIn()) {\n try {\n yield accountService.handleAuthorizationCallback();\n }\n catch (error) {\n console.error(error);\n window.dispatchEvent(new ErrorEvent('error', { error, message: error.message }));\n }\n }\n const token = yield accountService.retrieveAccessToken();\n if (token) {\n this.setState({\n saveDesignToProfile: Object.assign(Object.assign({}, this.getState().saveDesignToProfile), { loggedIn: true })\n });\n }\n });\n }\n fetchStoreAvailabilities() {\n return __awaiter(this, void 0, void 0, function* () {\n const storeId = this.getState().storeId;\n if (!storeId) {\n this.setState({ storeAvailabilities: null });\n return;\n }\n const options = this.getServiceOptionsWithSettings();\n let storeAvailabilities = null;\n try {\n storeAvailabilities = yield new services_3.CheckoutAvailabilityService(options).getStoreAvailabilities(storeId, this.getShoppingItems());\n }\n catch (error) {\n this.setState({ storeAvailabilities: null });\n console.error(error);\n window.dispatchEvent(new ErrorEvent('error', { error, message: error.message }));\n return;\n }\n this.setState({ storeAvailabilities });\n });\n }\n fetchZipAvailabilities() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const homeDelivery = this.getState().homeDelivery;\n const zipCode = (_a = homeDelivery.zipCode) !== null && _a !== void 0 ? _a : homeDelivery.inputValue;\n if (!zipCode) {\n this.setState({\n homeDelivery: Object.assign(Object.assign({}, this.getState().homeDelivery), { state: component_home_delivery_1.HomeDeliveryStateEnum.default, zipAvailabilities: null })\n });\n return;\n }\n const options = this.getServiceOptionsWithSettings();\n let zipAvailabilities = null;\n try {\n zipAvailabilities = yield new services_3.CheckoutAvailabilityService(options).getZipAvailabilities(zipCode, this.getShoppingItems());\n }\n catch (error) {\n this.setState({\n homeDelivery: Object.assign(Object.assign({}, this.getState().homeDelivery), { zipAvailabilities: null, state: component_home_delivery_1.HomeDeliveryStateEnum.noDeliveryInfo })\n });\n console.error(error);\n window.dispatchEvent(new ErrorEvent('error', { error, message: error.message }));\n return;\n }\n if (!zipAvailabilities.length) {\n this.setState({\n homeDelivery: Object.assign(Object.assign({}, this.getState().homeDelivery), { zipAvailabilities: null, state: component_home_delivery_1.HomeDeliveryStateEnum.noDeliveryInfo })\n });\n return;\n }\n this.setState({\n homeDelivery: Object.assign(Object.assign({}, this.getState().homeDelivery), { zipAvailabilities, state: component_home_delivery_1.HomeDeliveryStateEnum.submitted })\n });\n });\n }\n fetchAssemblyServices(zipCode) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n this.setState({\n assemblyServices: Object.assign(Object.assign({}, this.getState().assemblyServices), { state: component_zip_in_1.ZipInCardStateEnum.loading })\n });\n if (!zipCode) {\n this.setState({\n assemblyServices: Object.assign(Object.assign({}, this.getState().assemblyServices), { state: component_zip_in_1.ZipInCardStateEnum.default })\n });\n return;\n }\n const options = this.getServiceOptionsWithSettings();\n let zipValidation = null;\n try {\n zipValidation = yield new services_3.ZipValidationService(options).getZipValidation(zipCode);\n }\n catch (error) {\n this.setState({\n assemblyServices: Object.assign(Object.assign({}, this.getState().assemblyServices), { state: component_zip_in_1.ZipInCardStateEnum.noZipInfo })\n });\n console.error(error);\n window.dispatchEvent(new ErrorEvent('error', { error, message: error.message }));\n return;\n }\n if (!zipValidation.valid) {\n this.setState({\n assemblyServices: Object.assign(Object.assign({}, this.getState().assemblyServices), { state: component_zip_in_1.ZipInCardStateEnum.invalidInput })\n });\n return;\n }\n let assemblyServices = null;\n try {\n assemblyServices = yield new services_1.AssemblyServicesService(options).getAssemblyServices(zipCode, this.getShoppingItems());\n }\n catch (error) {\n this.setState({\n assemblyServices: Object.assign(Object.assign({}, this.getState().assemblyServices), { state: component_zip_in_1.ZipInCardStateEnum.noZipInfo })\n });\n console.error(error);\n window.dispatchEvent(new ErrorEvent('error', { error, message: error.message }));\n return;\n }\n this.setState({\n // Content should not be undefined, but just in case let's keep the\n // non-formatted zip code.\n zipCode: (_b = (_a = zipValidation.content) === null || _a === void 0 ? void 0 : _a.formatted) !== null && _b !== void 0 ? _b : zipCode,\n assemblyServices: Object.assign(Object.assign({}, this.getState().assemblyServices), { state: component_zip_in_1.ZipInCardStateEnum.submitted, assemblyServicesData: assemblyServices })\n });\n });\n }\n fetchStores() {\n return __awaiter(this, void 0, void 0, function* () {\n const options = this.getServiceOptionsWithSettings();\n const stores = yield new services_3.StoreService(options).getStores();\n this.setState({ stores });\n });\n }\n fetchFinancingOption() {\n return __awaiter(this, void 0, void 0, function* () {\n const shoppingProducts = this.getState().shoppingProducts;\n if (!shoppingProducts) {\n return;\n }\n const options = this.getServiceOptionsWithSettings();\n const financingOption = yield new services_3.FinancingService(options).getFinancingOption(shoppingProducts);\n this.setState({ financingOption });\n });\n }\n fetchStoreId() {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n const storeId = (_b = (yield ((_a = this.storeIdCookieInformationService) === null || _a === void 0 ? void 0 : _a.getStoreId()))) !== null && _b !== void 0 ? _b : null;\n this.setState({ storeId });\n });\n }\n fetchZipCode() {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n const zipCode = (_b = (yield ((_a = this.zipCodeCookieInformationService) === null || _a === void 0 ? void 0 : _a.getZipCode()))) !== null && _b !== void 0 ? _b : null;\n this.setState({\n homeDelivery: Object.assign(Object.assign({}, this.getState().homeDelivery), { zipCode })\n });\n });\n }\n fetchVpcCode() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.vpcCode) {\n return;\n }\n yield this.saveVpcConfigurationAndSetToState();\n });\n }\n getExistingVpcCodeOrCreateNew() {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n const vpcCode = (_a = this.vpcCode) !== null && _a !== void 0 ? _a : this.getState().vpcCode;\n if (vpcCode) {\n return vpcCode;\n }\n else {\n try {\n const vpcConfiguration = yield this.saveVpcConfigurationAndSetToState();\n return (_b = vpcConfiguration === null || vpcConfiguration === void 0 ? void 0 : vpcConfiguration.configurationId) !== null && _b !== void 0 ? _b : null;\n }\n catch (error) {\n console.error(error);\n window.dispatchEvent(new ErrorEvent('error', { error, message: error.message }));\n }\n }\n return null;\n });\n }\n saveVpcConfigurationAndSetToState() {\n return __awaiter(this, void 0, void 0, function* () {\n const vpcConfiguration = yield this.saveVpcConfiguration();\n if (vpcConfiguration) {\n this.setState({ vpcCode: vpcConfiguration.configurationId });\n }\n return vpcConfiguration;\n });\n }\n saveVpcConfiguration() {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.designConfiguration) {\n return null;\n }\n const options = this.getServiceOptionsWithSettings();\n return yield new services_3.VpcService(options).saveConfiguration(this.designConfiguration.configuration, this.getShoppingItems(), (_a = this.designConfiguration.images) !== null && _a !== void 0 ? _a : undefined, (_b = this.designConfiguration.insightsCombinationFormat) !== null && _b !== void 0 ? _b : undefined);\n });\n }\n subscribeToCookieInformation() {\n const options = this.getServiceOptionsWithSettings();\n if (this.storeIdCookieInformationService) {\n this.storeIdCookieInformationService.unsubscribe(this.listeners.storeIdChange);\n }\n if (this.zipCodeCookieInformationService) {\n this.zipCodeCookieInformationService.unsubscribe(this.listeners.zipCodeChange);\n }\n this.storeIdCookieInformationService = new services_2.StoreIdCookieInformationService(options);\n this.storeIdCookieInformationService.subscribe(this.listeners.storeIdChange);\n this.zipCodeCookieInformationService = new services_2.ZipCodeCookieInformationService(options);\n this.zipCodeCookieInformationService.subscribe(this.listeners.zipCodeChange);\n }\n getFailedShoppingItemsFromCart(cart) {\n var _a;\n const shoppingItems = [];\n if (!((_a = cart.errorList) === null || _a === void 0 ? void 0 : _a.length)) {\n return shoppingItems;\n }\n for (const error of cart.errorList) {\n for (const itemNo of error.items) {\n shoppingItems.push({\n itemNo,\n message: error.message\n });\n }\n }\n return shoppingItems;\n }\n getShoppingItems() {\n return utilities_1.ProductUtility.getShoppingItems(this.getState().shoppingProducts || []);\n }\n dispatchTrackAnalyticsEvent(event) {\n this.dispatchEvent(new CustomEvent('trackAnalytics', {\n bubbles: true,\n detail: { event: event.type, data: event.detail }\n }));\n }\n storeStateInSessionStorage() {\n // eslint-disable-next-line no-console\n console.log('SummaryPageController: Storing state in session storage.');\n // We should not store fetchable data as it may reach the limit of the session storage.\n // Therefore only store the state that is needed to restore the page.\n const state = Object.assign(Object.assign({}, this.getState()), { homeDelivery: Object.assign(Object.assign({}, this.getState().homeDelivery), { zipAvailabilities: [] }) });\n delete state.translations;\n delete state.settings;\n delete state.serviceOptionsWithSettings;\n delete state.shoppingProducts;\n delete state.storeAvailabilities;\n delete state.addToCartState;\n delete state.addToListState;\n delete state.shareDesignState;\n delete state.confirmationCardState;\n delete state.financingOption;\n sessionStorage.setItem('kompis-summary-page-controller-state', JSON.stringify(state));\n }\n loadStateFromSessionStorage() {\n const state = sessionStorage.getItem('kompis-summary-page-controller-state');\n if (state) {\n // eslint-disable-next-line no-console\n console.log('SummaryPageController: Restoring state from session storage.');\n sessionStorage.removeItem('kompis-summary-page-controller-state');\n this.setState(JSON.parse(state));\n }\n }\n clearStateInSessionStorage() {\n // eslint-disable-next-line no-console\n console.log('SummaryPageController: Clearing state in session storage.');\n sessionStorage.removeItem('kompis-summary-page-controller-state');\n }\n getDesignLink() {\n var _a;\n const [language, country] = (_a = this.serviceOptions.locale) === null || _a === void 0 ? void 0 : _a.split('-');\n const vpcCode = this.vpcCode || this.getState().vpcCode;\n return vpcCode && this.designLink\n ? this.designLink\n .replace('{dexf-addon-app}', 'www.ikea.com/addon-app/')\n .replace('{ru}', language)\n .replace('{lc}', country.toLowerCase())\n .replace('{CODE}', vpcCode !== null && vpcCode !== void 0 ? vpcCode : '')\n : null;\n }\n getAccountService() {\n const options = this.getServiceOptionsWithSettings();\n return new services_3.AccountService(Object.assign(Object.assign({}, options), { \n // Use same segment for login as for DEXF settings.\n settingsSegment: options.filterSegment }));\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SummaryPageController.prototype, \"serviceOptions\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array, required: true })\n], SummaryPageController.prototype, \"shoppingItems\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageController.prototype, \"designConfiguration\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageController.prototype, \"loginBehaviour\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageController.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageController.prototype, \"productMeasures\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageController.prototype, \"configurationMeasures\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageController.prototype, \"screenshotUrl\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageController.prototype, \"screenshotAlt\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageController.prototype, \"productName\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageController.prototype, \"productDescription\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageController.prototype, \"showSaveDesign\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageController.prototype, \"vpcCode\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageController.prototype, \"designSaved\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageController.prototype, \"kiosk\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array })\n], SummaryPageController.prototype, \"images\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageController.prototype, \"securityInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageController.prototype, \"measurements\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageController.prototype, \"collectableProducts\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageController.prototype, \"showDesignText\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array })\n], SummaryPageController.prototype, \"productListSections\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageController.prototype, \"customTabButtons\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageController.prototype, \"startHeadingsAtH2\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n /**\n * @deprecated Use the Main Header and Main Footer components together with the enableMainMargins prop instead.\n */\n], SummaryPageController.prototype, \"enableMargins\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageController.prototype, \"enableMainMargins\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageController.prototype, \"designLink\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageController.prototype, \"showTotalPackageWeight\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageController.prototype, \"showAssistanceCard\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageController.prototype, \"showAssemblyServices\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageController.prototype, \"assistanceCardApplicationName\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageController.prototype, \"showKioskMainCTAButton\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageController.prototype, \"analytics\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array })\n], SummaryPageController.prototype, \"productListRemovable\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], SummaryPageController.prototype, \"defaultSortBy\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Array })\n], SummaryPageController.prototype, \"messageSection\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageController.prototype, \"linkCard\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageController.prototype, \"state\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageController.prototype, \"showPrintButton\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageController.prototype, \"showEditDesignButton\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageController.prototype, \"contentToPrint\", void 0);\nSummaryPageController = __decorate([\n (0, web_component_1.customElement)('kompis-summary-page-controller')\n], SummaryPageController);\nexports.default = SummaryPageController;\n//# sourceMappingURL=SummaryPageController.js.map","import \"@inter-ikea-kompis/component-summary-page/lib/components/summary-page-controller/SummaryPageController\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSummaryPageController extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-summary-page-controller\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.analytics = props.analytics;\n element.assistanceCardApplicationName = props.assistanceCardApplicationName;\n element.collectableProducts = props.collectableProducts;\n element.configurationMeasures = props.configurationMeasures;\n element.contentToPrint = props.contentToPrint;\n element.customTabButtons = props.customTabButtons;\n element.defaultSortBy = props.defaultSortBy;\n element.designConfiguration = props.designConfiguration;\n element.designLink = props.designLink;\n element.designSaved = props.designSaved;\n element.enableMainMargins = props.enableMainMargins;\n element.enableMargins = props.enableMargins;\n element.images = props.images;\n element.kiosk = props.kiosk;\n element.linkCard = props.linkCard;\n element.loginBehaviour = props.loginBehaviour;\n element.measurements = props.measurements;\n element.messageSection = props.messageSection;\n element.productDescription = props.productDescription;\n element.productListRemovable = props.productListRemovable;\n element.productListSections = props.productListSections;\n element.productMeasures = props.productMeasures;\n element.productName = props.productName;\n element.screenshotAlt = props.screenshotAlt;\n element.screenshotUrl = props.screenshotUrl;\n element.securityInformation = props.securityInformation;\n element.serviceOptions = props.serviceOptions;\n element.shoppingItems = props.shoppingItems;\n element.showAssemblyServices = props.showAssemblyServices;\n element.showAssistanceCard = props.showAssistanceCard;\n element.showDesignText = props.showDesignText;\n element.showEditDesignButton = props.showEditDesignButton;\n element.showKioskMainCTAButton = props.showKioskMainCTAButton;\n element.showPrintButton = props.showPrintButton;\n element.showSaveDesign = props.showSaveDesign;\n element.showTotalPackageWeight = props.showTotalPackageWeight;\n element.startHeadingsAtH2 = props.startHeadingsAtH2;\n element.state = props.state;\n element.theme = props.theme;\n element.vpcCode = props.vpcCode;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onEditDesignButtonClick, \"editDesignButtonClick\");\n this.updateEventListener(element, props.onKioskMainCtaButtonClick, \"kioskMainCtaButtonClick\");\n this.updateEventListener(element, props.onLinkCardClick, \"linkCardClick\");\n this.updateEventListener(element, props.onLogInAndSaveDesign, \"logInAndSaveDesign\");\n this.updateEventListener(element, props.onPrintButtonClick, \"printButtonClick\");\n this.updateEventListener(element, props.onProductListRemove, \"productListRemove\");\n this.updateEventListener(element, props.onSaveDesignToProfileLogIn, \"saveDesignToProfileLogIn\");\n this.updateEventListener(element, props.onStateChange, \"stateChange\");\n this.updateEventListener(element, props.onTrackAnalytics, \"trackAnalytics\");\n }\n}\nKompisSummaryPageController.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n analytics: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n assistanceCardApplicationName: PropTypes.string,\n collectableProducts: PropTypes.bool,\n configurationMeasures: PropTypes.string,\n contentToPrint: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n customTabButtons: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n defaultSortBy: PropTypes.string,\n designConfiguration: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n designLink: PropTypes.string,\n designSaved: PropTypes.bool,\n enableMainMargins: PropTypes.bool,\n enableMargins: PropTypes.bool,\n images: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n kiosk: PropTypes.bool,\n linkCard: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n loginBehaviour: PropTypes.string,\n measurements: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n messageSection: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n productDescription: PropTypes.string,\n productListRemovable: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n productListSections: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n productMeasures: PropTypes.string,\n productName: PropTypes.string,\n screenshotAlt: PropTypes.string,\n screenshotUrl: PropTypes.string,\n securityInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n serviceOptions: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n shoppingItems: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n showAssemblyServices: PropTypes.bool,\n showAssistanceCard: PropTypes.bool,\n showDesignText: PropTypes.bool,\n showEditDesignButton: PropTypes.bool,\n showKioskMainCTAButton: PropTypes.bool,\n showPrintButton: PropTypes.bool,\n showSaveDesign: PropTypes.bool,\n showTotalPackageWeight: PropTypes.bool,\n startHeadingsAtH2: PropTypes.bool,\n state: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n vpcCode: PropTypes.string,\n onStateChange: PropTypes.func,\n onKioskMainCtaButtonClick: PropTypes.func,\n onProductListRemove: PropTypes.func,\n onSaveDesignToProfileLogIn: PropTypes.func,\n onLogInAndSaveDesign: PropTypes.func,\n onLinkCardClick: PropTypes.func,\n onTrackAnalytics: PropTypes.func,\n onPrintButtonClick: PropTypes.func,\n onEditDesignButtonClick: PropTypes.func\n};\nexport default KompisSummaryPageController;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst SummaryPagePaddingUtility_1 = __importDefault(require(\"../../utilities/SummaryPagePaddingUtility\"));\nclass SummaryPageFooterStyle {\n /**\n * Returns styles.\n *\n * @param options\n * @param options.theme\n * @param options.enableMargins\n * @param options.direction\n */\n static getStyle(options) {\n const { color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\tkompis-text {\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\n\t\t\tfooter {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tbackground-color: ${color.background.default};\n\t\t\t\t/* Align left/right in Safari */\n\t\t\t\tjustify-content: ${options.direction === 'rtl' ? 'right' : 'left'};\n\t\t\t\theight: ${90 / 16}rem;\n\t\t\t}\n\n\t\t\t/* Align left/right in Firefox */\n\t\t\t:host(:dir(rtl)) footer {\n\t\t\t\tjustify-content: right;\n\t\t\t}\n\t\t\t/* Align left/right in Chrome/Edge */\n\t\t\t:host-context([dir='rtl']) footer {\n\t\t\t\tjustify-content: right;\n\t\t\t}\n\n\t\t\t${options.enableMargins\n ? SummaryPagePaddingUtility_1.default.getHorizontalPadding('footer', options.theme)\n : ''}\n\t\t`;\n }\n}\nexports.default = SummaryPageFooterStyle;\n//# sourceMappingURL=SummaryPageFooterStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@inter-ikea-kompis/component-text\");\nconst SummaryPageFooterStyle_1 = __importDefault(require(\"./SummaryPageFooterStyle\"));\n/**\n * @deprecated This component has been deprecated, use Main Footer instead.\n */\nlet SummaryPageFooter = class SummaryPageFooter extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Adds margins on all sides of SummaryPageFooter when true.\n this.enableMargins = false;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n const direction = utilities_1.SafariWriteDirectionUtility.getWriteDirection(this);\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    ${this.getText()}
    \n\t\t`;\n }\n getText() {\n // Setting dir=ltr so that the '©' will stay on the left side in when in rtl.\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t\t© Inter IKEA Systems B.V. 1999-${this.getCurrentYear()}\n\t\t\t\n\t\t`;\n }\n getCurrentYear() {\n return new Date().getFullYear();\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SummaryPageFooter.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageFooter.prototype, \"enableMargins\", void 0);\nSummaryPageFooter = __decorate([\n (0, web_component_1.customElement)('kompis-summary-page-footer')\n], SummaryPageFooter);\nexports.default = SummaryPageFooter;\n//# sourceMappingURL=SummaryPageFooter.js.map","import \"@inter-ikea-kompis/component-summary-page/lib/components/summary-page-footer/SummaryPageFooter\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSummaryPageFooter extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-summary-page-footer\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.enableMargins = props.enableMargins;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisSummaryPageFooter.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n enableMargins: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisSummaryPageFooter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst analytics_1 = require(\"@inter-ikea-kompis/analytics\");\nconst insights_data_provider_1 = require(\"@insights/insights-data-provider\");\nconst moduleId = 'summary_page_header';\n/**\n * Tracks events from Summary Page Header and sends them to a reporter.\n *\n * @event summary_page_header_change_design When change design button/link is clicked.\n * @event summary_page_header_go_to_shopping_list When shopping list icon is clicked.\n * @event summary_page_header_go_to_shopping_cart When shopping cart icon is clicked.\n * @event summary_page_header_go_to_ikea When IKEA logo is clicked.\n */\nclass SummaryPageHeaderTracker extends analytics_1.AbstractAnalyticsTracker {\n constructor(options) {\n super(Object.assign({ moduleId }, options));\n }\n sendChangeDesignClick() {\n this.getReporter().report({\n event: 'summary_page_header_change_design',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe\n });\n }\n sendShoppingListClick() {\n this.getReporter().report({\n event: 'summary_page_header_go_to_shopping_list',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe\n });\n }\n sendShoppingCartClick() {\n this.getReporter().report({\n event: 'summary_page_header_go_to_shopping_cart',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe\n });\n }\n sendIkeaLogoClick() {\n this.getReporter().report({\n event: 'summary_page_header_go_to_ikea',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe\n });\n }\n /***/\n sendMenuClick() {\n this.getReporter().report({\n event: 'summary_page_header_menu_click',\n ipexMoment: insights_data_provider_1.IpexMomentEnum.showMe\n });\n }\n}\nexports.default = SummaryPageHeaderTracker;\n//# sourceMappingURL=SummaryPageHeaderTracker.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst SummaryPagePaddingUtility_1 = __importDefault(require(\"../../utilities/SummaryPagePaddingUtility\"));\n// The offset for the hamburger menu icon to get right next to the edge of the menu.\nconst MENU_ICON_OFFSET = 12;\nclass SummaryPageHeaderStyle {\n /**\n * Returns styles.\n *\n * @param options\n * @param options.theme The theme.\n * @param options.enableMargins Whether margins are enabled or not.\n */\n static getStyle(options) {\n const { breakpoint, spacing, color } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: block;\n\t\t\t}\n\n\t\t\tnav {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: row;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: space-between;\n\t\t\t\theight: ${60 / 16}rem;\n\t\t\t\twidth: 100%;\n\t\t\t\tbackground-color: ${color.background.default};\n\t\t\t}\n\n\t\t\tul {\n\t\t\t\tmargin: 0;\n\t\t\t\tpadding: 0;\n\t\t\t\tlist-style-type: none;\n\t\t\t}\n\n\t\t\t.left-navigation {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: row;\n\t\t\t\tjustify-content: center;\n\t\t\t\talign-items: center;\n\t\t\t\tgap: ${spacing.space100 / 16}rem;\n\t\t\t}\n\n\t\t\t.left-navigation a {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\n\t\t\t/* Basic focus styles, for browsers which don't support focus-visible */\n\t\t\t.left-navigation a:focus {\n\t\t\t\t${this.getFocusOutlineStyle(options.theme)}\n\t\t\t}\n\t\t\t/* Unsetting focus styles from above, happens in browsers which support focus-visible */\n\t\t\t.left-navigation a:not(:focus-visible) {\n\t\t\t\tbox-shadow: unset;\n\t\t\t\ttransition-property: unset;\n\t\t\t\ttransition-duration: unset;\n\t\t\t\ttransition-timing-function: unset;\n\t\t\t}\n\t\t\t/* Setting focus styles, happens in browsers which support focus-visible */\n\t\t\t.left-navigation a:focus-visible {\n\t\t\t\t${this.getFocusOutlineStyle(options.theme)}\n\t\t\t}\n\n\t\t\t.ikea-logo {\n\t\t\t\twidth: ${75 / 16}rem;\n\t\t\t\theight: ${30 / 16}rem;\n\t\t\t}\n\n\t\t\t#menu-button {\n\t\t\t\tmargin-right: -${MENU_ICON_OFFSET / 16}rem;\n\t\t\t}\n\n\t\t\t@media (min-width: ${breakpoint.medium.width / 16}rem) {\n\t\t\t\tnav {\n\t\t\t\t\theight: ${90 / 16}rem;\n\t\t\t\t}\n\n\t\t\t\t.ikea-logo {\n\t\t\t\t\twidth: ${90 / 16}rem;\n\t\t\t\t\theight: ${36 / 16}rem;\n\t\t\t\t}\n\n\t\t\t\t.right-navigation-list {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-direction: row;\n\t\t\t\t\tjustify-content: center;\n\t\t\t\t\talign-items: center;\n\t\t\t\t\tgap: ${spacing.space50 / 16}rem;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t${options.enableMargins\n ? SummaryPagePaddingUtility_1.default.getHorizontalPadding('nav', options.theme)\n : ''}\n\n\t\t\t${this.getIconLinkStyle(options.theme)}\n\t\t`;\n }\n /**\n * Style is copied from IconButtonStyle.ts, should be removed when Skapa Icon Button with href support is available.\n *\n * @param theme\n */\n static getIconLinkStyle(theme) {\n const { motion, border, color } = theme;\n return (0, web_component_1.css) `\n\t\t\t.right-navigation-list a {\n\t\t\t\tposition: relative;\n\t\t\t\tborder-radius: 50%;\n\t\t\t\tpointer-events: initial;\n\t\t\t\ttransition-property: background, transform;\n\t\t\t\ttransition-duration: ${motion.duration.small};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t\theight: ${40 / 16}rem;\n\t\t\t\twidth: ${40 / 16}rem;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tcursor: pointer;\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\t\t\t\toverflow: visible;\n\t\t\t\talign-items: center;\n\t\t\t\t/* Override user agent styling */\n\t\t\t\tpadding: 0;\n\t\t\t\tborder: 0;\n\t\t\t\toutline: none;\n\t\t\t\tfont-weight: bold;\n\t\t\t\tbackground: 'transparent';\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\n\t\t\t.right-navigation-list a:active {\n\t\t\t\tbackground: ${color.neutral.grey200};\n\t\t\t\ttransform: scale(0.98);\n\t\t\t}\n\n\t\t\t.right-navigation-list a,\n\t\t\t.right-navigation-list a:visited,\n\t\t\t.right-navigation-list a:hover,\n\t\t\t.right-navigation-list a:active {\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\n\t\t\t/* Prevents hover effect on touch. */\n\t\t\t@media (-moz-touch-enabled: 0), (pointer: fine) {\n\t\t\t\t.right-navigation-list a:hover {\n\t\t\t\t\tbackground: ${color.background.alt};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.right-navigation-list a::-moz-focus-inner {\n\t\t\t\tborder: 0;\n\t\t\t}\n\n\t\t\t.right-navigation-list a:focus {\n\t\t\t\tbackground: ${color.background.alt};\n\t\t\t}\n\n\t\t\t.right-navigation-list kompis-focus-outline {\n\t\t\t\tdisplay: flex;\n\t\t\t\tborder-radius: ${border.radius.radius64 / 16}rem;\n\t\t\t}\n\n\t\t\t.visuallyHidden {\n\t\t\t\tborder: 0 !important;\n\t\t\t\tclip: rect(${1 / 16}rem, ${1 / 16}rem, ${1 / 16}rem, ${1 / 16}rem) !important;\n\t\t\t\t-webkit-clip-path: inset(50%) !important;\n\t\t\t\tclip-path: inset(50%) !important;\n\t\t\t\theight: ${1 / 16}rem !important;\n\t\t\t\tmargin: -${1 / 16}rem !important;\n\t\t\t\toverflow: hidden !important;\n\t\t\t\tpadding: 0 !important;\n\t\t\t\tposition: absolute !important;\n\t\t\t\twidth: ${1 / 16}rem !important;\n\t\t\t\twhite-space: nowrap !important;\n\t\t\t\ttop: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\tleft: 0;\n\t\t\t\tright: 0;\n\t\t\t}\n\t\t`;\n }\n /**\n * @param theme\n */\n static getFocusOutlineStyle(theme) {\n const { color, focusOutline } = theme;\n return (0, web_component_1.css) `\n\t\t\tbox-shadow: 0 0 0 ${focusOutline.offset / 16}rem ${color.border.inverse},\n\t\t\t\t0 0 0 ${(focusOutline.width + focusOutline.offset) / 16}rem ${focusOutline.color};\n\t\t\toutline: none;\n\t\t\ttransition-property: box-shadow;\n\t\t\ttransition-duration: 200ms;\n\t\t\ttransition-timing-function: ease-out;\n\t\t`;\n }\n}\nexports.default = SummaryPageHeaderStyle;\n//# sourceMappingURL=SummaryPageHeaderStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst themes_1 = require(\"@inter-ikea-kompis/themes\");\nconst icons_1 = require(\"@inter-ikea-kompis/icons\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@inter-ikea-kompis/component-focus-outline\");\nrequire(\"@inter-ikea-kompis/component-icon\");\nrequire(\"@inter-ikea-kompis/component-image\");\nrequire(\"@ingka/icon-webc\");\nrequire(\"@ingka/button-webc\");\nrequire(\"@ingka/icon-store/arrow-left\");\nrequire(\"@ingka/icon-store/menu\");\nconst SummaryPageHeaderTracker_1 = __importDefault(require(\"../../trackers/SummaryPageHeaderTracker\"));\nconst IkeaLogo_1 = __importDefault(require(\"./IkeaLogo\"));\nconst SummaryPageHeaderStyle_1 = __importDefault(require(\"./SummaryPageHeaderStyle\"));\n/**\n * @deprecated This component has been deprecated, use Main Header instead.\n *\n * @event changeDesignClick Triggered when change design button is clicked.\n * @event menuClick Triggered when the (hamburger) menu button is clicked.\n */\nlet SummaryPageHeader = class SummaryPageHeader extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Changes the icon for the shopping bag icon.\n this.activeShoppingBag = false;\n // Disables links. This attribute should be set to \"true\" when in a Kiosk.\n this.disableLinks = false;\n // Adds margins left and right of SummaryPageHeader when true.\n this.enableMargins = false;\n // Displays the menu on the right side of the header.\n this.showMenu = false;\n // Used for automatic analytics. If null or not set, analytics is turned off.\n this.analytics = null;\n this.breakpointObserver = new themes_1.ThemeBreakpointObserver(() => this.requestUpdate(), this);\n this.tracker = null;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.breakpointObserver.disconnect();\n this.disconnectTracker();\n }\n /**\n * @override\n */\n shouldUpdate(changedProperties) {\n if (changedProperties.has('theme')) {\n this.breakpointObserver.observe(this.theme);\n }\n if (changedProperties.has('analytics')) {\n this.disconnectTracker();\n this.connectTracker();\n }\n return true;\n }\n connectTracker() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n if (this.analytics) {\n this.tracker = new SummaryPageHeaderTracker_1.default(Object.assign(Object.assign({}, this.analytics), { settings: utilities_1.DexfSettingsUtility.parseLocalizedInformation(this.localizedInformation) }));\n yield ((_a = this.tracker) === null || _a === void 0 ? void 0 : _a.connect());\n }\n });\n }\n disconnectTracker() {\n var _a;\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.disconnect();\n this.tracker = null;\n }\n /**\n * @returns Get left navigation content.\n */\n getLeftNavigation() {\n return (0, web_component_1.html) `
    \n\t\t\t${this.getIkeaLogo()} ${this.getChangeDesignButton()}\n\t\t
    `;\n }\n /**\n * @returns The IKEA logo.\n */\n getIkeaLogo() {\n const encodedLogo = encodeURIComponent(IkeaLogo_1.default);\n const svgSource = `data:image/svg+xml,${encodedLogo}`;\n const image = (0, web_component_1.html) ``;\n if (this.disableLinks) {\n return image;\n }\n return (0, web_component_1.html) `${image}`;\n }\n /**\n * Click event.\n *\n * @param event Event.\n */\n onIkeaLogoLinkClick(event) {\n var _a;\n event.stopPropagation();\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendIkeaLogoClick();\n }\n /**\n * @returns Get change design button.\n */\n getChangeDesignButton() {\n if (this.isMobile()) {\n const label = this.localizedInformation.translations.summaryPageHeaderChangeDesignButton;\n return (0, web_component_1.html) `\n\t\t\t\t${label}\n\t\t\t\t`;\n }\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t${this.localizedInformation.translations.summaryPageHeaderChangeDesignButton}`;\n }\n onChangeDesignClick() {\n var _a;\n this.dispatchEvent(new CustomEvent('changeDesignClick', { bubbles: true }));\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendChangeDesignClick();\n }\n /**\n * @returns Get right navigation content.\n */\n getRightNavigationList() {\n const hideShoppingIcons = this.isMobile() || this.disableLinks;\n return (0, web_component_1.html) `
      \n\t\t\t${hideShoppingIcons ? null : (0, web_component_1.html) `
    • ${this.getShoppingListIcon()}
    • `}\n\t\t\t${hideShoppingIcons ? null : (0, web_component_1.html) `
    • ${this.getShoppingCartIcon()}
    • `}\n\t\t\t${this.showMenu ? (0, web_component_1.html) `
    • ${this.getMenuButton()}
    • ` : null}\n\t\t
    `;\n }\n /**\n * @returns Get the shopping list icon.\n */\n getShoppingListIcon() {\n if (!utilities_1.ShoppingSupport.hasListSupport(this.localizedInformation)) {\n return null;\n }\n return this.getIconLink({\n href: this.localizedInformation.urls.shoppingListLink,\n ariaLabel: this.localizedInformation.translations.summaryPageHeaderShoppingListAriaLabel,\n clickFunction: this.onShoppingListClick.bind(this),\n icon: icons_1.HeartIcon\n });\n }\n /**\n * @returns Get the shopping cart icon.\n */\n getShoppingCartIcon() {\n if (!utilities_1.ShoppingSupport.hasCartSupport(this.localizedInformation)) {\n return null;\n }\n return this.getIconLink({\n href: this.localizedInformation.urls.shoppingCartLink,\n ariaLabel: this.localizedInformation.translations.summaryPageHeaderShoppingCartAriaLabel,\n clickFunction: this.onShoppingCartClick.bind(this),\n icon: this.activeShoppingBag ? icons_1.ShoppingBagActiveIcon : icons_1.ShoppingBagIcon\n });\n }\n /**\n * Get an icon link based on the options.\n *\n * @param options\n * @param options.href The href of the link.\n * @param options.ariaLabel An aria label to represent the icon.\n * @param options.clickFunction The function to be called when the link is clicked.\n * @param options.icon The icon representing the link.\n */\n getIconLink(options) {\n // Should be replaced with Skapa Icon Button with href support when available.\n return (0, web_component_1.html) ` event.preventDefault()}\"\n\t\t\t\t@click=\"${options.clickFunction}\"\n\t\t\t>\n\t\t\t\t${options.ariaLabel ? options.ariaLabel : null}\n\t\t\t\t`;\n }\n /**\n *\n */\n getMenuButton() {\n const label = this.localizedInformation.translations.menuButtonAriaLabel;\n return (0, web_component_1.html) `\n\t\t\t${label}\n\t\t\t`;\n }\n /**\n * @param event\n */\n onShoppingListClick(event) {\n var _a;\n event.stopPropagation();\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendShoppingListClick();\n }\n /**\n * @param event\n */\n onShoppingCartClick(event) {\n var _a;\n event.stopPropagation();\n (_a = this.tracker) === null || _a === void 0 ? void 0 : _a.sendShoppingCartClick();\n }\n /***/\n onMenuClick() {\n var _a, _b;\n const menuButton = this.shadowRoot.querySelector('#menu-button');\n const triggerElement = (_a = menuButton === null || menuButton === void 0 ? void 0 : menuButton.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('button');\n this.dispatchEvent(new CustomEvent('menuClick', { bubbles: true, detail: { triggerElement } }));\n (_b = this.tracker) === null || _b === void 0 ? void 0 : _b.sendMenuClick();\n }\n /**\n * @returns Returns \"true\" if mobile.\n */\n isMobile() {\n var _a;\n return (((_a = this.breakpointObserver.getBreakpointIndex()) !== null && _a !== void 0 ? _a : enums_1.ThemeBreakpointIndexEnum.small) <=\n enums_1.ThemeBreakpointIndexEnum.small);\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SummaryPageHeader.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], SummaryPageHeader.prototype, \"localizedInformation\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageHeader.prototype, \"activeShoppingBag\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageHeader.prototype, \"disableLinks\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageHeader.prototype, \"enableMargins\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], SummaryPageHeader.prototype, \"showMenu\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], SummaryPageHeader.prototype, \"analytics\", void 0);\nSummaryPageHeader = __decorate([\n (0, web_component_1.customElement)('kompis-summary-page-header')\n], SummaryPageHeader);\nexports.default = SummaryPageHeader;\n//# sourceMappingURL=SummaryPageHeader.js.map","import \"@inter-ikea-kompis/component-summary-page/lib/components/summary-page-header/SummaryPageHeader\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSummaryPageHeader extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-summary-page-header\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.activeShoppingBag = props.activeShoppingBag;\n element.analytics = props.analytics;\n element.disableLinks = props.disableLinks;\n element.enableMargins = props.enableMargins;\n element.localizedInformation = props.localizedInformation;\n element.showMenu = props.showMenu;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onChangeDesignClick, \"changeDesignClick\");\n this.updateEventListener(element, props.onMenuClick, \"menuClick\");\n }\n}\nKompisSummaryPageHeader.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n activeShoppingBag: PropTypes.bool,\n analytics: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n disableLinks: PropTypes.bool,\n enableMargins: PropTypes.bool,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n showMenu: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n onChangeDesignClick: PropTypes.func,\n onMenuClick: PropTypes.func\n};\nexport default KompisSummaryPageHeader;\n","import \"@inter-ikea-kompis/component-summary-page/lib/components/summary-page-images/SummaryPageImages\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSummaryPageImages extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-summary-page-images\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.images = props.images;\n element.localizedInformation = props.localizedInformation;\n element.theme = props.theme;\n element.translations = props.translations;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onChange, \"change\");\n }\n}\nKompisSummaryPageImages.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n images: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n onChange: PropTypes.func\n};\nexport default KompisSummaryPageImages;\n","import \"@inter-ikea-kompis/component-summary-page/lib/components/summary-page-print/SummaryPagePrint\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSummaryPagePrint extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-summary-page-print\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.configurationMeasures = props.configurationMeasures;\n element.designLink = props.designLink;\n element.includedProductsWithinSprs = props.includedProductsWithinSprs;\n element.locale = props.locale;\n element.localizedInformation = props.localizedInformation;\n element.measurements = props.measurements;\n element.productName = props.productName;\n element.retailUnit = props.retailUnit;\n element.screenshotAlt = props.screenshotAlt;\n element.screenshotUrl = props.screenshotUrl;\n element.settings = props.settings;\n element.shoppingProducts = props.shoppingProducts;\n element.showTotalPackageWeight = props.showTotalPackageWeight;\n element.storeName = props.storeName;\n element.translations = props.translations;\n element.vpcCode = props.vpcCode;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisSummaryPagePrint.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n configurationMeasures: PropTypes.string,\n designLink: PropTypes.string,\n includedProductsWithinSprs: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n locale: PropTypes.string.isRequired,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n measurements: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n productName: PropTypes.string,\n retailUnit: PropTypes.string,\n screenshotAlt: PropTypes.string,\n screenshotUrl: PropTypes.string,\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n shoppingProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n showTotalPackageWeight: PropTypes.bool,\n storeName: PropTypes.string,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n vpcCode: PropTypes.string\n};\nexport default KompisSummaryPagePrint;\n","import \"@inter-ikea-kompis/component-summary-page/lib/components/summary-page-product-list/SummaryPageProductList\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSummaryPageProductList extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-summary-page-product-list\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.collectableProducts = props.collectableProducts;\n element.collectedProducts = props.collectedProducts;\n element.defaultSortBy = props.defaultSortBy;\n element.disableLinks = props.disableLinks;\n element.homeDelivery = props.homeDelivery;\n element.includedProductsWithinSprs = props.includedProductsWithinSprs;\n element.localizedInformation = props.localizedInformation;\n element.pickingListPrintLayout = props.pickingListPrintLayout;\n element.productListRemovable = props.productListRemovable;\n element.productListSections = props.productListSections;\n element.productMeasures = props.productMeasures;\n element.settings = props.settings;\n element.shoppingProducts = props.shoppingProducts;\n element.showDesignText = props.showDesignText;\n element.startHeadingsAtH2 = props.startHeadingsAtH2;\n element.storeAvailabilities = props.storeAvailabilities;\n element.storeId = props.storeId;\n element.stores = props.stores;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onCollectProduct, \"collectProduct\");\n this.updateEventListener(element, props.onHomeDeliveryForgetClick, \"homeDeliveryForgetClick\");\n this.updateEventListener(element, props.onHomeDeliveryInput, \"homeDeliveryInput\");\n this.updateEventListener(element, props.onHomeDeliveryStartOverClick, \"homeDeliveryStartOverClick\");\n this.updateEventListener(element, props.onHomeDeliverySubmitButtonClick, \"homeDeliverySubmitButtonClick\");\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n this.updateEventListener(element, props.onProductListExpand, \"productListExpand\");\n this.updateEventListener(element, props.onProductListRemove, \"productListRemove\");\n this.updateEventListener(element, props.onSortListChange, \"sortListChange\");\n this.updateEventListener(element, props.onStoreSelectorChange, \"storeSelectorChange\");\n }\n}\nKompisSummaryPageProductList.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n collectableProducts: PropTypes.bool,\n collectedProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n defaultSortBy: PropTypes.string,\n disableLinks: PropTypes.bool,\n homeDelivery: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n includedProductsWithinSprs: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n pickingListPrintLayout: PropTypes.string,\n productListRemovable: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n productListSections: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n productMeasures: PropTypes.string,\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n shoppingProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n showDesignText: PropTypes.bool,\n startHeadingsAtH2: PropTypes.bool,\n storeAvailabilities: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n storeId: PropTypes.string,\n stores: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n onStoreSelectorChange: PropTypes.func,\n onSortListChange: PropTypes.func,\n onCollectProduct: PropTypes.func,\n onModalOpen: PropTypes.func,\n onModalClose: PropTypes.func,\n onHomeDeliveryStartOverClick: PropTypes.func,\n onHomeDeliveryForgetClick: PropTypes.func,\n onHomeDeliveryInput: PropTypes.func,\n onHomeDeliverySubmitButtonClick: PropTypes.func,\n onProductListRemove: PropTypes.func,\n onProductListExpand: PropTypes.func\n};\nexport default KompisSummaryPageProductList;\n","import \"@inter-ikea-kompis/component-summary-page/lib/components/summary-page-security/SummaryPageSecurity\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSummaryPageSecurity extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-summary-page-security\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.description = props.description;\n element.imageAlt = props.imageAlt;\n element.imageSrc = props.imageSrc;\n element.startHeadingsAtH3 = props.startHeadingsAtH3;\n element.theme = props.theme;\n element.title = props.title;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisSummaryPageSecurity.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n description: PropTypes.string,\n imageAlt: PropTypes.string,\n imageSrc: PropTypes.string,\n startHeadingsAtH3: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n title: PropTypes.string\n};\nexport default KompisSummaryPageSecurity;\n","import \"@inter-ikea-kompis/component-summary-page/lib/components/summary-page-tabs/SummaryPageTabs\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSummaryPageTabs extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-summary-page-tabs\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.collectableProducts = props.collectableProducts;\n element.collectedProducts = props.collectedProducts;\n element.contentToPrint = props.contentToPrint;\n element.customTabButtons = props.customTabButtons;\n element.defaultSortBy = props.defaultSortBy;\n element.disableLinks = props.disableLinks;\n element.homeDelivery = props.homeDelivery;\n element.images = props.images;\n element.includedProductsWithinSprs = props.includedProductsWithinSprs;\n element.localizedInformation = props.localizedInformation;\n element.pickingListPrintLayout = props.pickingListPrintLayout;\n element.productListRemovable = props.productListRemovable;\n element.productListSections = props.productListSections;\n element.productMeasures = props.productMeasures;\n element.securityInformation = props.securityInformation;\n element.settings = props.settings;\n element.shoppingProducts = props.shoppingProducts;\n element.showDesignText = props.showDesignText;\n element.startHeadingsAtH2 = props.startHeadingsAtH2;\n element.storeAvailabilities = props.storeAvailabilities;\n element.storeId = props.storeId;\n element.stores = props.stores;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onCollectProduct, \"collectProduct\");\n this.updateEventListener(element, props.onHomeDeliveryForgetClick, \"homeDeliveryForgetClick\");\n this.updateEventListener(element, props.onHomeDeliveryInput, \"homeDeliveryInput\");\n this.updateEventListener(element, props.onHomeDeliveryStartOverClick, \"homeDeliveryStartOverClick\");\n this.updateEventListener(element, props.onHomeDeliverySubmitButtonClick, \"homeDeliverySubmitButtonClick\");\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n this.updateEventListener(element, props.onProductListExpand, \"productListExpand\");\n this.updateEventListener(element, props.onProductListRemove, \"productListRemove\");\n this.updateEventListener(element, props.onSelectedImageIndexChange, \"selectedImageIndexChange\");\n this.updateEventListener(element, props.onSortListChange, \"sortListChange\");\n this.updateEventListener(element, props.onStoreSelectorChange, \"storeSelectorChange\");\n this.updateEventListener(element, props.onTabChange, \"tabChange\");\n }\n}\nKompisSummaryPageTabs.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n collectableProducts: PropTypes.bool,\n collectedProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n contentToPrint: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n customTabButtons: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n defaultSortBy: PropTypes.string,\n disableLinks: PropTypes.bool,\n homeDelivery: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n images: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n includedProductsWithinSprs: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n pickingListPrintLayout: PropTypes.string,\n productListRemovable: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n productListSections: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n productMeasures: PropTypes.string,\n securityInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n shoppingProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n showDesignText: PropTypes.bool,\n startHeadingsAtH2: PropTypes.bool,\n storeAvailabilities: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n storeId: PropTypes.string,\n stores: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n onStoreSelectorChange: PropTypes.func,\n onSortListChange: PropTypes.func,\n onModalOpen: PropTypes.func,\n onModalClose: PropTypes.func,\n onTabChange: PropTypes.func,\n onSelectedImageIndexChange: PropTypes.func,\n onCollectProduct: PropTypes.func,\n onHomeDeliveryStartOverClick: PropTypes.func,\n onHomeDeliveryForgetClick: PropTypes.func,\n onHomeDeliveryInput: PropTypes.func,\n onHomeDeliverySubmitButtonClick: PropTypes.func,\n onProductListRemove: PropTypes.func,\n onProductListExpand: PropTypes.func\n};\nexport default KompisSummaryPageTabs;\n","import \"@inter-ikea-kompis/component-summary-page/lib/components/summary-page/SummaryPage\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSummaryPage extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-summary-page\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.addToCartState = props.addToCartState;\n element.addToListState = props.addToListState;\n element.addUnavailableProductsToList = props.addUnavailableProductsToList;\n element.analytics = props.analytics;\n element.assemblyServices = props.assemblyServices;\n element.assistanceCardApplicationName = props.assistanceCardApplicationName;\n element.collectableProducts = props.collectableProducts;\n element.collectedProducts = props.collectedProducts;\n element.configurationMeasures = props.configurationMeasures;\n element.confirmationCardState = props.confirmationCardState;\n element.confirmationCardType = props.confirmationCardType;\n element.contentToPrint = props.contentToPrint;\n element.customTabButtons = props.customTabButtons;\n element.defaultSortBy = props.defaultSortBy;\n element.designLink = props.designLink;\n element.disableLinks = props.disableLinks;\n element.enableMainMargins = props.enableMainMargins;\n element.enableMargins = props.enableMargins;\n element.failedShoppingItems = props.failedShoppingItems;\n element.financingOption = props.financingOption;\n element.homeDelivery = props.homeDelivery;\n element.images = props.images;\n element.includedProductsWithinSprs = props.includedProductsWithinSprs;\n element.linkCard = props.linkCard;\n element.locale = props.locale;\n element.localizedInformation = props.localizedInformation;\n element.logInAndSaveState = props.logInAndSaveState;\n element.measurements = props.measurements;\n element.messageSection = props.messageSection;\n element.pickingListPrintLayout = props.pickingListPrintLayout;\n element.productDescription = props.productDescription;\n element.productListRemovable = props.productListRemovable;\n element.productListSections = props.productListSections;\n element.productMeasures = props.productMeasures;\n element.productName = props.productName;\n element.saveDesignToProfile = props.saveDesignToProfile;\n element.screenshotAlt = props.screenshotAlt;\n element.screenshotUrl = props.screenshotUrl;\n element.securityInformation = props.securityInformation;\n element.settings = props.settings;\n element.shareDesignCard = props.shareDesignCard;\n element.shareDesignState = props.shareDesignState;\n element.shoppingProducts = props.shoppingProducts;\n element.showAddToBag = props.showAddToBag;\n element.showAssemblyServices = props.showAssemblyServices;\n element.showAssistanceCard = props.showAssistanceCard;\n element.showDesignText = props.showDesignText;\n element.showEditDesignButton = props.showEditDesignButton;\n element.showKioskMainCTAButton = props.showKioskMainCTAButton;\n element.showPrintButton = props.showPrintButton;\n element.showSaveDesign = props.showSaveDesign;\n element.showShareDesign = props.showShareDesign;\n element.showTotalPackageWeight = props.showTotalPackageWeight;\n element.startHeadingsAtH2 = props.startHeadingsAtH2;\n element.storeAvailabilities = props.storeAvailabilities;\n element.storeId = props.storeId;\n element.stores = props.stores;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n element.vpcCode = props.vpcCode;\n element.zipCode = props.zipCode;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onAddToCart, \"addToCart\");\n this.updateEventListener(element, props.onAddToCartClick, \"addToCartClick\");\n this.updateEventListener(element, props.onAddToList, \"addToList\");\n this.updateEventListener(element, props.onAddUnavailableProductsToListChange, \"addUnavailableProductsToListChange\");\n this.updateEventListener(element, props.onAddUnavailableToCartAndList, \"addUnavailableToCartAndList\");\n this.updateEventListener(element, props.onCollectProduct, \"collectProduct\");\n this.updateEventListener(element, props.onConfirmationCardStateChange, \"confirmationCardStateChange\");\n this.updateEventListener(element, props.onCopyDesign, \"copyDesign\");\n this.updateEventListener(element, props.onCopyDesignCodeClick, \"copyDesignCodeClick\");\n this.updateEventListener(element, props.onCopyDesignCodeReset, \"copyDesignCodeReset\");\n this.updateEventListener(element, props.onCopyDesignLinkClick, \"copyDesignLinkClick\");\n this.updateEventListener(element, props.onCopyDesignLinkReset, \"copyDesignLinkReset\");\n this.updateEventListener(element, props.onEditDesignButtonClick, \"editDesignButtonClick\");\n this.updateEventListener(element, props.onFinancialServicesContinueButtonClick, \"financialServicesContinueButtonClick\");\n this.updateEventListener(element, props.onFinancialServicesMoreInfoClick, \"financialServicesMoreInfoClick\");\n this.updateEventListener(element, props.onForgetZipCode, \"forgetZipCode\");\n this.updateEventListener(element, props.onHomeDeliveryForgetClick, \"homeDeliveryForgetClick\");\n this.updateEventListener(element, props.onHomeDeliveryInput, \"homeDeliveryInput\");\n this.updateEventListener(element, props.onHomeDeliveryStartOverClick, \"homeDeliveryStartOverClick\");\n this.updateEventListener(element, props.onHomeDeliverySubmitButtonClick, \"homeDeliverySubmitButtonClick\");\n this.updateEventListener(element, props.onKioskMainCtaButtonClick, \"kioskMainCtaButtonClick\");\n this.updateEventListener(element, props.onLinkCardClick, \"linkCardClick\");\n this.updateEventListener(element, props.onLogInAndSaveDesign, \"logInAndSaveDesign\");\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n this.updateEventListener(element, props.onPrintButtonClick, \"printButtonClick\");\n this.updateEventListener(element, props.onProductListExpand, \"productListExpand\");\n this.updateEventListener(element, props.onProductListRemove, \"productListRemove\");\n this.updateEventListener(element, props.onResetAddToCartState, \"resetAddToCartState\");\n this.updateEventListener(element, props.onResetAddToListState, \"resetAddToListState\");\n this.updateEventListener(element, props.onSaveDesign, \"saveDesign\");\n this.updateEventListener(element, props.onSaveDesignToProfile, \"saveDesignToProfile\");\n this.updateEventListener(element, props.onSaveDesignToProfileLogIn, \"saveDesignToProfileLogIn\");\n this.updateEventListener(element, props.onSaveZipCode, \"saveZipCode\");\n this.updateEventListener(element, props.onSelectedImageIndexChange, \"selectedImageIndexChange\");\n this.updateEventListener(element, props.onSendByEmailInput, \"sendByEmailInput\");\n this.updateEventListener(element, props.onSendByEmailReset, \"sendByEmailReset\");\n this.updateEventListener(element, props.onSendByEmailSend, \"sendByEmailSend\");\n this.updateEventListener(element, props.onSendByEmailValidation, \"sendByEmailValidation\");\n this.updateEventListener(element, props.onSendBySmsInput, \"sendBySmsInput\");\n this.updateEventListener(element, props.onSendBySmsReset, \"sendBySmsReset\");\n this.updateEventListener(element, props.onSendBySmsSend, \"sendBySmsSend\");\n this.updateEventListener(element, props.onSendBySmsValidation, \"sendBySmsValidation\");\n this.updateEventListener(element, props.onShareDesign, \"shareDesign\");\n this.updateEventListener(element, props.onShareDesignCardStateChange, \"shareDesignCardStateChange\");\n this.updateEventListener(element, props.onSortListChange, \"sortListChange\");\n this.updateEventListener(element, props.onStoreSelectorChange, \"storeSelectorChange\");\n this.updateEventListener(element, props.onTabChange, \"tabChange\");\n this.updateEventListener(element, props.onUnavailableProductsModalContinue, \"unavailableProductsModalContinue\");\n }\n}\nKompisSummaryPage.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n addToCartState: PropTypes.string,\n addToListState: PropTypes.string,\n addUnavailableProductsToList: PropTypes.bool,\n analytics: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n assemblyServices: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n assistanceCardApplicationName: PropTypes.string,\n collectableProducts: PropTypes.bool,\n collectedProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n configurationMeasures: PropTypes.string,\n confirmationCardState: PropTypes.string,\n confirmationCardType: PropTypes.string,\n contentToPrint: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n customTabButtons: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n defaultSortBy: PropTypes.string,\n designLink: PropTypes.string,\n disableLinks: PropTypes.bool,\n enableMainMargins: PropTypes.bool,\n enableMargins: PropTypes.bool,\n failedShoppingItems: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n financingOption: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n homeDelivery: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n images: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n includedProductsWithinSprs: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n linkCard: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n locale: PropTypes.string.isRequired,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n logInAndSaveState: PropTypes.string,\n measurements: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n messageSection: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n pickingListPrintLayout: PropTypes.string,\n productDescription: PropTypes.string,\n productListRemovable: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n productListSections: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n productMeasures: PropTypes.string,\n productName: PropTypes.string,\n saveDesignToProfile: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n screenshotAlt: PropTypes.string,\n screenshotUrl: PropTypes.string,\n securityInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n shareDesignCard: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n shareDesignState: PropTypes.string,\n shoppingProducts: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n showAddToBag: PropTypes.bool,\n showAssemblyServices: PropTypes.bool,\n showAssistanceCard: PropTypes.bool,\n showDesignText: PropTypes.bool,\n showEditDesignButton: PropTypes.bool,\n showKioskMainCTAButton: PropTypes.bool,\n showPrintButton: PropTypes.bool,\n showSaveDesign: PropTypes.bool,\n showShareDesign: PropTypes.bool,\n showTotalPackageWeight: PropTypes.bool,\n startHeadingsAtH2: PropTypes.bool,\n storeAvailabilities: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n storeId: PropTypes.string,\n stores: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n vpcCode: PropTypes.string,\n zipCode: PropTypes.string,\n onStoreSelectorChange: PropTypes.func,\n onSortListChange: PropTypes.func,\n onAddToCart: PropTypes.func,\n onAddToList: PropTypes.func,\n onAddToCartClick: PropTypes.func,\n onShareDesign: PropTypes.func,\n onSaveDesign: PropTypes.func,\n onLogInAndSaveDesign: PropTypes.func,\n onSaveDesignToProfile: PropTypes.func,\n onSaveDesignToProfileLogIn: PropTypes.func,\n onModalOpen: PropTypes.func,\n onModalClose: PropTypes.func,\n onTabChange: PropTypes.func,\n onSelectedImageIndexChange: PropTypes.func,\n onCopyDesign: PropTypes.func,\n onAddUnavailableProductsToListChange: PropTypes.func,\n onAddUnavailableToCartAndList: PropTypes.func,\n onUnavailableProductsModalContinue: PropTypes.func,\n onCollectProduct: PropTypes.func,\n onShareDesignCardStateChange: PropTypes.func,\n onSendByEmailInput: PropTypes.func,\n onSendByEmailValidation: PropTypes.func,\n onSendByEmailSend: PropTypes.func,\n onSendByEmailReset: PropTypes.func,\n onSendBySmsInput: PropTypes.func,\n onSendBySmsValidation: PropTypes.func,\n onSendBySmsSend: PropTypes.func,\n onSendBySmsReset: PropTypes.func,\n onCopyDesignCodeClick: PropTypes.func,\n onCopyDesignCodeReset: PropTypes.func,\n onCopyDesignLinkClick: PropTypes.func,\n onCopyDesignLinkReset: PropTypes.func,\n onHomeDeliveryStartOverClick: PropTypes.func,\n onHomeDeliveryForgetClick: PropTypes.func,\n onHomeDeliveryInput: PropTypes.func,\n onHomeDeliverySubmitButtonClick: PropTypes.func,\n onConfirmationCardStateChange: PropTypes.func,\n onFinancialServicesContinueButtonClick: PropTypes.func,\n onFinancialServicesMoreInfoClick: PropTypes.func,\n onResetAddToCartState: PropTypes.func,\n onResetAddToListState: PropTypes.func,\n onProductListRemove: PropTypes.func,\n onKioskMainCtaButtonClick: PropTypes.func,\n onProductListExpand: PropTypes.func,\n onLinkCardClick: PropTypes.func,\n onPrintButtonClick: PropTypes.func,\n onEditDesignButtonClick: PropTypes.func,\n onSaveZipCode: PropTypes.func,\n onForgetZipCode: PropTypes.func\n};\nexport default KompisSummaryPage;\n","import \"@inter-ikea-kompis/component-switch/lib/components/switch/Switch\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisSwitch extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-switch\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.checked = props.checked;\n element.disabled = props.disabled;\n element.id = props.id;\n element.label = props.label;\n element.layout = props.layout;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onChange, \"change\");\n }\n}\nKompisSwitch.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n checked: PropTypes.bool,\n disabled: PropTypes.bool,\n id: PropTypes.string,\n label: PropTypes.string,\n layout: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n onChange: PropTypes.func\n};\nexport default KompisSwitch;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst ICON_BASE_SIZE = 24;\nclass TabButtonStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @param options.isSelected \"true\" if selected.\n * @param options.isDisabled \"true\" if disabled.\n * @param options.theme Theme.\n * @returns Styles.\n */\n static getStyle(options) {\n const { spacing, color, focusOutline, motion } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t:host {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\t\t\t.divider {\n\t\t\t\twidth: ${spacing.space150 / 16}rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t}\n\t\t\tbutton {\n\t\t\t\tposition: relative;\n\t\t\t\t-webkit-appearance: none;\n\t\t\t\t-moz-appearance: none;\n\t\t\t\tbackground: none;\n\t\t\t\tborder: none;\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\talign-items: center;\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tmargin: 0;\n\t\t\t\tpadding: ${spacing.space100 / 16}rem ${spacing.space25 / 16}rem;\n\t\t\t\ttext-align: start;\n\t\t\t\tcursor: ${options.isDisabled ? 'auto' : 'pointer'};\n\t\t\t\tcolor: ${this.getColor(options)};\n\t\t\t}\n\n\t\t\tbutton:after {\n\t\t\t\tcontent: '';\n\t\t\t\tposition: absolute;\n\t\t\t\tleft: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\tdisplay: block;\n\t\t\t\twidth: 100%;\n\t\t\t\tborder-radius: ${1.5 / 16}rem;\n\t\t\t\tborder-bottom-width: ${3 / 16}rem;\n\t\t\t\tborder-bottom-style: solid;\n\t\t\t\tborder-bottom-color: ${options.isSelected && !options.isDisabled\n ? color.accent.primaryAccent\n : 'transparent'};\n\t\t\t\ttransition-property: border;\n\t\t\t\ttransition-duration: ${motion.duration.medium};\n\t\t\t\ttransition-timing-function: ${motion.ease.easy};\n\t\t\t}\n\n\t\t\tbutton:hover {\n\t\t\t\tcolor: ${this.getHoverColor(options)};\n\t\t\t}\n\n\t\t\tbutton:focus {\n\t\t\t\toutline-color: ${focusOutline.color};\n\t\t\t\toutline-style: solid;\n\t\t\t\toutline-width: ${focusOutline.width / 16}rem;\n\t\t\t\toutline-offset: ${-focusOutline.width / 16}rem;\n\t\t\t\ttransition-property: outline;\n\t\t\t\ttransition-duration: ${focusOutline.transitionTime}s;\n\t\t\t}\n\n\t\t\tbutton::-moz-focus-inner {\n\t\t\t\tborder: none;\n\t\t\t}\n\n\t\t\tkompis-icon {\n\t\t\t\tdisplay: flex;\n\t\t\t\theight: ${ICON_BASE_SIZE / 16}rem;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t}\n\t\t\t.icon-divider {\n\t\t\t\twidth: ${spacing.space50 / 16}rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t}\n\t\t\t.dot-divider {\n\t\t\t\twidth: ${spacing.space25 / 16}rem;\n\t\t\t\tflex-shrink: 0;\n\t\t\t}\n\t\t\t.dot {\n\t\t\t\theight: ${spacing.space50 / 16}rem;\n\t\t\t\twidth: ${spacing.space50 / 16}rem;\n\t\t\t\tbackground-color: ${color.background.accent};\n\t\t\t\tborder-radius: 50%;\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns color.\n *\n * @param options Options object.\n * @param options.isSelected \"true\" if selected.\n * @param options.isDisabled \"true\" if disabled.\n * @param options.theme Theme.\n * @returns Color.\n */\n static getColor(options) {\n const { color } = options.theme;\n if (options.isDisabled) {\n return color.disabled.default;\n }\n if (options.isSelected) {\n return color.text.dark;\n }\n return color.text.lightest;\n }\n /**\n * Returns hover color.\n *\n * @param options Options object.\n * @param options.isSelected \"true\" if selected.\n * @param options.isDisabled \"true\" if disabled.\n * @param options.theme Theme.\n * @returns Hover color.\n */\n static getHoverColor(options) {\n const { color } = options.theme;\n if (options.isDisabled) {\n return color.disabled.default;\n }\n if (options.isSelected) {\n return color.text.dark;\n }\n return color.text.default;\n }\n}\nexports.default = TabButtonStyle;\n//# sourceMappingURL=TabButtonStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst utilities_1 = require(\"@inter-ikea-kompis/utilities\");\nrequire(\"@inter-ikea-kompis/component-icon\");\nrequire(\"@inter-ikea-kompis/component-text\");\nconst TabButtonStyle_1 = __importDefault(require(\"./TabButtonStyle\"));\n/**\n * This component should be used for rendering a tab item.\n *\n * @event select On select event.\n */\nlet TabButton = class TabButton extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Icon name\n this.icon = null;\n // Show or hide a notification dot\n this.showNotification = false;\n // Title of tab\n this.label = null;\n // Styling applied when selected\n this.selected = false;\n // Disabled\n this.disabled = false;\n this.uniqueId = new utilities_1.IdGenerator().generateId();\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t this.dispatchEvent(new CustomEvent('select', { bubbles: true, detail: { selected: !this.selected } }))}\"\n\t\t\t\trole=\"tab\"\n\t\t\t\taria-controls=\"${this.uniqueId}\"\n\t\t\t\taria-selected=\"${this.selected}\"\n\t\t\t\taria-label=\"${this.label || ''}\"\n\t\t\t\t?disabled=\"${this.disabled}\"\n\t\t\t>\n\t\t\t\t${this.getIcon()}\n\t\t\t\t${this.label}\n\t\t\t\t${this.getDot()}\n\t\t\t\n\t\t\t
    \n\t\t`;\n }\n /**\n * When focusing.\n */\n focus() {\n var _a, _b;\n (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('button')) === null || _b === void 0 ? void 0 : _b.focus();\n }\n /**\n * @override\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n clearTimeout(this.pointerDownTimeout);\n }\n /**\n * On click.\n *\n * @param event Event object.\n */\n onPointerDown(event) {\n event.currentTarget.style.outline = 'none';\n }\n /**\n * On blur.\n *\n * @param event Event object.\n */\n onBlur(event) {\n event.currentTarget.style.outline = '';\n }\n /**\n * Returns icon.\n *\n * @returns Template.\n */\n getIcon() {\n if (!this.icon) {\n return null;\n }\n return (0, web_component_1.html) ` \n\t\t\t
    `;\n }\n /**\n * Returns dot.\n *\n * @returns Template.\n */\n getDot() {\n if (!this.showNotification || this.disabled) {\n return null;\n }\n return (0, web_component_1.html) `
    \n\t\t\t`;\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: String })\n], TabButton.prototype, \"icon\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], TabButton.prototype, \"showNotification\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], TabButton.prototype, \"label\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], TabButton.prototype, \"selected\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], TabButton.prototype, \"disabled\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], TabButton.prototype, \"theme\", void 0);\nTabButton = __decorate([\n (0, web_component_1.customElement)('kompis-tab-button')\n], TabButton);\nexports.default = TabButton;\n//# sourceMappingURL=TabButton.js.map","import \"@inter-ikea-kompis/component-tabs/lib/components/tab-button/TabButton\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisTabButton extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-tab-button\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.disabled = props.disabled;\n element.icon = props.icon;\n element.label = props.label;\n element.selected = props.selected;\n element.showNotification = props.showNotification;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onSelect, \"select\");\n }\n}\nKompisTabButton.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n disabled: PropTypes.bool,\n icon: PropTypes.string,\n label: PropTypes.string,\n selected: PropTypes.bool,\n showNotification: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n onSelect: PropTypes.func\n};\nexport default KompisTabButton;\n","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst component_carousel_1 = require(\"@inter-ikea-kompis/component-carousel\");\nrequire(\"@inter-ikea-kompis/component-carousel\");\nrequire(\"@inter-ikea-kompis/component-icon\");\nrequire(\"@inter-ikea-kompis/component-text\");\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n *\n * This component should be used for tabs with tab items inside it.\n *\n * @event change Event forwarded from kompis-carousel\n */\nlet Tabs = class Tabs extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Set which slide index that should be active\n this.selectedIndex = 0;\n // Accessibility description that will be set as an \"aria-label\" attribute on the tabs.\n this.ariaLabel = null;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n const { border, color } = this.theme;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t this.onKeyDown(event)}\"\n\t\t\t>\n\t\t\t\t this.dispatchEvent(new CustomEvent('change', {\n bubbles: true,\n detail: { selectedIndex: event.detail.selectedIndex }\n }))}\n\t\t\t\t\t.theme=\"${this.theme}\"\n\t\t\t\t\t.showArrows=\"${true}\"\n\t\t\t\t\t.layout=\"${component_carousel_1.CarouselLayoutEnum.overflow}\"\n\t\t\t\t\t.selectedIndex=\"${this.selectedIndex}\"\n\t\t\t\t\t.slideVisibleItems=\"${true}\"\n\t\t\t\t\t.pointerSwipe=\"${true}\"\n\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n /**\n * When key down.\n *\n * @param event Keyboard event.\n */\n onKeyDown(event) {\n var _a, _b;\n const tabButtons = Array.from(this.querySelectorAll('kompis-tab-button'));\n switch (event.key) {\n case 'ArrowLeft':\n this.changeButtonFocus(-1);\n break;\n case 'ArrowRight':\n this.changeButtonFocus(+1);\n break;\n case 'Home':\n // Activate first tab\n event.preventDefault();\n (_a = tabButtons[0]) === null || _a === void 0 ? void 0 : _a.focus();\n break;\n case 'End':\n // Activate last tab\n event.preventDefault();\n (_b = tabButtons[tabButtons.length - 1]) === null || _b === void 0 ? void 0 : _b.focus();\n break;\n }\n }\n /**\n * @param increment\n */\n changeButtonFocus(increment) {\n var _a;\n const tabButtons = Array.from(this.querySelectorAll('kompis-tab-button'));\n const focusTabButton = (tabButtons.find((element) => element.matches(':focus-within')));\n if (focusTabButton) {\n const index = tabButtons.indexOf(focusTabButton);\n (_a = tabButtons[(tabButtons.length + index + increment) % tabButtons.length]) === null || _a === void 0 ? void 0 : _a.focus();\n }\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Number, synchronous: true })\n], Tabs.prototype, \"selectedIndex\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Tabs.prototype, \"ariaLabel\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Tabs.prototype, \"theme\", void 0);\nTabs = __decorate([\n (0, web_component_1.customElement)('kompis-tabs')\n], Tabs);\nexports.default = Tabs;\n//# sourceMappingURL=Tabs.js.map","import \"@inter-ikea-kompis/component-tabs/lib/components/tabs/Tabs\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisTabs extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-tabs\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.ariaLabel = props.ariaLabel;\n element.selectedIndex = props.selectedIndex;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onChange, \"change\");\n }\n}\nKompisTabs.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n ariaLabel: PropTypes.string,\n selectedIndex: PropTypes.number,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n onChange: PropTypes.func\n};\nexport default KompisTabs;\n","import \"@inter-ikea-kompis/component-text/lib/components/text/Text\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisText extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-text\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.bold = props.bold;\n element.italic = props.italic;\n element.theme = props.theme;\n element.type = props.type;\n element.underline = props.underline;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisText.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n bold: PropTypes.bool,\n italic: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n type: PropTypes.string,\n underline: PropTypes.bool\n};\nexport default KompisText;\n","import \"@inter-ikea-kompis/component-text-toggle/lib/components/text-toggle/TextToggle\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisTextToggle extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-text-toggle\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.ariaLabel = props.ariaLabel;\n element.expanded = props.expanded;\n element.label = props.label;\n element.layout = props.layout;\n element.printLabel = props.printLabel;\n element.size = props.size;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onAnimationEnd, \"animationEnd\");\n this.updateEventListener(element, props.onExpand, \"expand\");\n }\n}\nKompisTextToggle.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n ariaLabel: PropTypes.string,\n expanded: PropTypes.bool,\n label: PropTypes.string,\n layout: PropTypes.string,\n printLabel: PropTypes.string,\n size: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n onExpand: PropTypes.func,\n onAnimationEnd: PropTypes.func\n};\nexport default KompisTextToggle;\n","import \"@inter-ikea-kompis/component-toast/lib/components/toast/Toast\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisToast extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-toast\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.actionHref = props.actionHref;\n element.actionLabel = props.actionLabel;\n element.actionTarget = props.actionTarget;\n element.closeButtonAriaLabel = props.closeButtonAriaLabel;\n element.label = props.label;\n element.theme = props.theme;\n element.visible = props.visible;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onActionClick, \"actionClick\");\n this.updateEventListener(element, props.onAnimationEnd, \"animationEnd\");\n this.updateEventListener(element, props.onClose, \"close\");\n }\n}\nKompisToast.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n actionHref: PropTypes.string,\n actionLabel: PropTypes.string,\n actionTarget: PropTypes.string,\n closeButtonAriaLabel: PropTypes.string,\n label: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n visible: PropTypes.bool,\n onClose: PropTypes.func,\n onAnimationEnd: PropTypes.func,\n onActionClick: PropTypes.func\n};\nexport default KompisToast;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nclass ToggleStyle {\n /**\n * Returns styles.\n *\n * @param options Options object.\n * @returns Styles.\n */\n static getStyle(options) {\n const { color } = options.theme;\n const selected = options.selectedIndex;\n return (0, web_component_1.css) `\n\t\t\t.container {\n\t\t\t\tdisplay: flex;\n\t\t\t}\n\t\t\tbutton {\n\t\t\t\tposition: relative;\n\t\t\t\toutline: none;\n\t\t\t\tborder-radius: 0;\n\t\t\t\tbackground: none;\n\t\t\t\tpadding: ${5 / 16}rem ${12 / 16}rem;\n\t\t\t\tmargin: 0;\n\t\t\t\tborder: ${1 / 16}rem solid;\n\t\t\t\tborder-color: ${color.border.light};\n\t\t\t\tcolor: ${options.disabled ? color.border.light : color.text.dark};\n\t\t\t\tcursor: ${options.disabled ? 'not-allowed' : 'pointer'};\n\t\t\t\tfont-size: ${12 / 16}rem;\n\t\t\t\tfont-weight: bold;\n\t\t\t\ttext-align: center;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\tuser-select: none;\n\t\t\t}\n\t\t\tbutton:hover {\n\t\t\t\tborder-color: ${color.border.default};\n\t\t\t}\n\t\t\t#item-${selected} {\n\t\t\t\tborder-color: ${color.border.dark};\n\t\t\t\tcolor: ${color.text.dark};\n\t\t\t}\n\t\t\t${this.getFluidWidth(options)}\n\t\t\t${this.getRtl(options)}\n\t\t\t${this.getOutlineStyle(options)}\n\t\t\t${this.getOutlineBorderRadius(options)}\n\t\t`;\n }\n /**\n * Style for fluid width.\n *\n * @param options Options.\n * @returns Style.\n */\n static getFluidWidth(options) {\n if (!options.fluidWidth) {\n return '';\n }\n return (0, web_component_1.css) `\n\t\t\tbutton {\n\t\t\t\twidth: ${100 / options.numberOfItems}%;\n\t\t\t}\n\t\t`;\n }\n /**\n * Style for LTR and RTL.\n *\n * @param options Options.\n * @returns Style.\n */\n static getRtl(options) {\n const { color, border } = options.theme;\n if (options.direction === 'rtl') {\n return (0, web_component_1.css) `\n\t\t\t\tbutton:first-child {\n\t\t\t\t\tborder-radius: 0 ${border.radius.radius4 / 16}rem ${border.radius.radius4 / 16}rem 0;\n\t\t\t\t}\n\t\t\t\tbutton:last-child {\n\t\t\t\t\tborder-radius: ${border.radius.radius4 / 16}rem 0 0 ${border.radius.radius4 / 16}rem;\n\t\t\t\t}\n\t\t\t\tbutton:not(:last-child) {\n\t\t\t\t\tborder-left: none;\n\t\t\t\t}\n\t\t\t\tbutton:only-child {\n\t\t\t\t\tborder-radius: ${border.radius.radius4 / 16}rem;\n\t\t\t\t}\n\t\t\t\tbutton:hover + button {\n\t\t\t\t\tborder-right-color: ${color.border.default};\n\t\t\t\t}\n\t\t\t\t#item-${options.selectedIndex} + button {\n\t\t\t\t\tborder-right-color: ${color.border.dark};\n\t\t\t\t}\n\t\t\t`;\n }\n return (0, web_component_1.css) `\n\t\t\tbutton:first-child {\n\t\t\t\tborder-radius: ${border.radius.radius4 / 16}rem 0 0 ${border.radius.radius4 / 16}rem;\n\t\t\t}\n\t\t\tbutton:last-child {\n\t\t\t\tborder-radius: 0 ${border.radius.radius4 / 16}rem ${border.radius.radius4 / 16}rem 0;\n\t\t\t}\n\t\t\tbutton:not(:last-child) {\n\t\t\t\tborder-right: none;\n\t\t\t}\n\t\t\tbutton:only-child {\n\t\t\t\tborder-radius: ${border.radius.radius4 / 16}rem;\n\t\t\t}\n\t\t\tbutton:hover + button {\n\t\t\t\tborder-left-color: ${color.border.default};\n\t\t\t}\n\t\t\t#item-${options.selectedIndex} + button {\n\t\t\t\tborder-left-color: ${color.border.dark};\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns the outline style when focusing.\n *\n * @param options Options.\n * @returns Style.\n */\n static getOutlineStyle(options) {\n const { focusOutline } = options.theme;\n return (0, web_component_1.css) `\n\t\t\t#outline-${options.focusIndex} {\n\t\t\t\topacity: ${options.hasFocus ? '1' : '0'};\n\t\t\t\tz-index: 100;\n\t\t\t\tposition: absolute;\n\t\t\t\tborder-radius: 0;\n\t\t\t\tbox-shadow: 0 0 0 ${focusOutline.width / 16}rem ${focusOutline.color};\n\t\t\t\tleft: -${focusOutline.offset / 16}rem;\n\t\t\t\ttop: -${focusOutline.offset / 16}rem;\n\t\t\t\tright: -${focusOutline.offset / 16}rem;\n\t\t\t\tbottom: -${focusOutline.offset / 16}rem;\n\t\t\t}\n\t\t`;\n }\n /**\n * Returns the outline border radius.\n *\n * @param options Options.\n * @returns Style.\n */\n static getOutlineBorderRadius(options) {\n const { border } = options.theme;\n const itemLeft = (0, web_component_1.css) `\n\t\t\t#outline-${options.focusIndex} {\n\t\t\t\tborder-radius: ${border.radius.radius4 / 16}rem 0 0 ${border.radius.radius4 / 16}rem;\n\t\t\t}\n\t\t`;\n const itemRight = (0, web_component_1.css) `\n\t\t\t#outline-${options.focusIndex} {\n\t\t\t\tborder-radius: 0 ${border.radius.radius4 / 16}rem ${border.radius.radius4 / 16}rem 0;\n\t\t\t}\n\t\t`;\n if (options.focusIndex === 0 && options.direction === 'rtl') {\n return itemRight;\n }\n if (options.numberOfItems - 1 === options.focusIndex && options.direction === 'rtl') {\n return itemLeft;\n }\n if (options.focusIndex === 0) {\n return itemLeft;\n }\n if (options.numberOfItems - 1 === options.focusIndex) {\n return itemRight;\n }\n return '';\n }\n}\nexports.default = ToggleStyle;\n//# sourceMappingURL=ToggleStyle.js.map","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst web_component_1 = require(\"@inter-ikea-kompis/web-component\");\nconst enums_1 = require(\"@inter-ikea-kompis/enums\");\nconst ToggleStyle_1 = __importDefault(require(\"./ToggleStyle\"));\n/**\n * @deprecated This component has been deprecated, see Kompis page for more info.\n * This component is a toggle with toggle items inside it.\n *\n * @event select On select event.\n */\nlet Toggle = class Toggle extends web_component_1.KompisElement {\n constructor() {\n super(...arguments);\n // Index of selected item\n this.selectedIndex = 0;\n // Fill available width\n this.fluidWidth = false;\n // Toggle disabled\n this.disabled = false;\n // Label for the toggle group to set as an aria-label for accessibility reasons\n this.ariaLabel = null;\n this.hasFocus = false;\n this.focusIndex = 0;\n }\n /**\n * Renders the component.\n *\n * @returns Template.\n */\n render() {\n const direction = window.getComputedStyle(this).direction;\n return (0, web_component_1.html) `\n\t\t\t\n\t\t\t
    \n\t\t\t\t${this.getItems()}\n\t\t\t
    \n\t\t`;\n }\n /**\n * Get button items in toggle.\n *\n * @returns Template.\n */\n getItems() {\n return (0, web_component_1.html) `${this.items.map((item, index) => (0, web_component_1.html) ` this.dispatchEvent(new CustomEvent('select', { bubbles: true, detail: { selectedIndex: index } }))}\"\n\t\t\t\t\t@mousedown=\"${this.onMouseDown.bind(this)}\"\n\t\t\t\t\t@focusin=\"${() => this.onFocusIn(index)}\"\n\t\t\t\t\t@focusout=\"${this.onFocusOut.bind(this)}\"\n\t\t\t\t\t?disabled=\"${this.disabled}\"\n\t\t\t\t\taria-pressed=\"${this.selectedIndex === index}\"\n\t\t\t\t>\n\t\t\t\t\t
    \n\t\t\t\t\t${this.getIcon(index)}\n\t\t\t\t\t\n\t\t\t\t\t\t${item.label}\n\t\t\t\t\t\n\t\t\t\t`)}`;\n }\n /**\n * Returns icon.\n *\n * @param index\n * @returns Template.\n */\n getIcon(index) {\n if (!this.items[index].icon) {\n return null;\n }\n return (0, web_component_1.html) ` \n\t\t\t
    `;\n }\n /**\n * Event handler.\n *\n * @param event Event.\n */\n onMouseDown(event) {\n event.preventDefault();\n if (this.hasFocus) {\n this.hasFocus = false;\n this.update();\n }\n }\n /**\n * Event handler.\n *\n * @param index\n */\n onFocusIn(index) {\n this.hasFocus = true;\n this.focusIndex = index;\n this.update();\n }\n /**\n * Event handler.\n */\n onFocusOut() {\n this.hasFocus = false;\n this.update();\n }\n};\n__decorate([\n (0, web_component_1.property)({ type: Object })\n], Toggle.prototype, \"items\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Number })\n], Toggle.prototype, \"selectedIndex\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Toggle.prototype, \"fluidWidth\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Boolean })\n], Toggle.prototype, \"disabled\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: Object, required: true })\n], Toggle.prototype, \"theme\", void 0);\n__decorate([\n (0, web_component_1.property)({ type: String })\n], Toggle.prototype, \"ariaLabel\", void 0);\nToggle = __decorate([\n (0, web_component_1.customElement)('kompis-toggle')\n], Toggle);\nexports.default = Toggle;\n//# sourceMappingURL=Toggle.js.map","import \"@inter-ikea-kompis/component-toggle/lib/components/toggle/Toggle\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisToggle extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-toggle\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.ariaLabel = props.ariaLabel;\n element.disabled = props.disabled;\n element.fluidWidth = props.fluidWidth;\n element.items = props.items;\n element.selectedIndex = props.selectedIndex;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onSelect, \"select\");\n }\n}\nKompisToggle.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n ariaLabel: PropTypes.string,\n disabled: PropTypes.bool,\n fluidWidth: PropTypes.bool,\n items: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n selectedIndex: PropTypes.number,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n onSelect: PropTypes.func\n};\nexport default KompisToggle;\n","import \"@inter-ikea-kompis/component-tooltip/lib/components/tooltip/Tooltip\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisTooltip extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-tooltip\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.alignment = props.alignment;\n element.ariaLabel = props.ariaLabel;\n element.direction = props.direction;\n element.maxWidth = props.maxWidth;\n element.text = props.text;\n element.theme = props.theme;\n element.timeout = props.timeout;\n element.toggle = props.toggle;\n element.uniqueId = props.uniqueId;\n element.zIndex = props.zIndex;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onAnimationEnd, \"animationEnd\");\n }\n}\nKompisTooltip.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n alignment: PropTypes.string,\n ariaLabel: PropTypes.string,\n direction: PropTypes.string,\n maxWidth: PropTypes.number,\n text: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n timeout: PropTypes.number,\n toggle: PropTypes.bool,\n uniqueId: PropTypes.string,\n zIndex: PropTypes.number,\n onAnimationEnd: PropTypes.func\n};\nexport default KompisTooltip;\n","import \"@inter-ikea-kompis/component-water-efficiency-class/lib/components/water-efficiency-class/WaterEfficiencyClass\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisWaterEfficiencyClass extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-water-efficiency-class\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.localizedInformation = props.localizedInformation;\n element.product = props.product;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n }\n}\nKompisWaterEfficiencyClass.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n onModalOpen: PropTypes.func,\n onModalClose: PropTypes.func\n};\nexport default KompisWaterEfficiencyClass;\n","import \"@inter-ikea-kompis/component-water-efficiency-class/lib/components/water-label-card/WaterLabelCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisWaterLabelCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-water-label-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.disableLinks = props.disableLinks;\n element.localizedInformation = props.localizedInformation;\n element.product = props.product;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisWaterLabelCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n disableLinks: PropTypes.bool,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisWaterLabelCard;\n","import \"@inter-ikea-kompis/component-wood-declaration/lib/components/wood-declaration-card/WoodDeclarationCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisWoodDeclarationCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-wood-declaration-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.product = props.product;\n element.showHeader = props.showHeader;\n element.theme = props.theme;\n }\n updateAllEventListeners(element, props) { }\n}\nKompisWoodDeclarationCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n showHeader: PropTypes.bool,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired\n};\nexport default KompisWoodDeclarationCard;\n","import \"@inter-ikea-kompis/component-wood-declaration/lib/components/wood-declaration/WoodDeclaration\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisWoodDeclaration extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-wood-declaration\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.product = props.product;\n element.theme = props.theme;\n element.woodDeclarationExpanded = props.woodDeclarationExpanded;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onWoodDeclarationExpand, \"woodDeclarationExpand\");\n }\n}\nKompisWoodDeclaration.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n product: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n woodDeclarationExpanded: PropTypes.bool,\n onWoodDeclarationExpand: PropTypes.func\n};\nexport default KompisWoodDeclaration;\n","import \"@inter-ikea-kompis/component-zip-in/lib/components/zip-in-card/ZipInCard\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisZipInCard extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-zip-in-card\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.localizedInformation = props.localizedInformation;\n element.state = props.state;\n element.theme = props.theme;\n element.translations = props.translations;\n element.zipCode = props.zipCode;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onInput, \"input\");\n this.updateEventListener(element, props.onSave, \"save\");\n }\n}\nKompisZipInCard.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n state: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n zipCode: PropTypes.string,\n onSave: PropTypes.func,\n onInput: PropTypes.func\n};\nexport default KompisZipInCard;\n","import \"@inter-ikea-kompis/component-zip-in/lib/components/zip-in/ZipIn\";\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nclass KompisZipIn extends React.Component {\n constructor() {\n super(...arguments);\n this.listeners = {};\n this.ref = {\n current: null\n };\n }\n render() {\n return React.createElement(\"kompis-zip-in\", this.getForwardedProps(), this.props.children);\n }\n componentWillUnmount() {\n this.setState({\n element: null\n });\n this.removeAllListeners(this.ref.current);\n this.ref.current = null;\n }\n removeAllListeners(element) {\n for (const eventType in this.listeners) {\n const callback = this.listeners[eventType];\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, callback);\n }\n delete this.listeners[eventType];\n }\n }\n updateEventListener(element, callback, eventType) {\n if (callback !== this.listeners[eventType]) {\n if (typeof callback === 'function') {\n element.removeEventListener(eventType, this.listeners[eventType]);\n }\n this.listeners[eventType] = callback;\n if (typeof callback === 'function') {\n element.addEventListener(eventType, this.listeners[eventType]);\n }\n }\n }\n getForwardedProps() {\n const forwardedProps = {\n ref: this.onRef.bind(this),\n class: this.props.className\n };\n for (const key in this.props) {\n if (!(key in this['constructor']['propTypes'])) {\n forwardedProps[key] = this.props[key];\n }\n }\n return forwardedProps;\n }\n onRef(element) {\n if (element === null) {\n return;\n }\n if (element !== this.ref.current && this.ref.current !== null) {\n this.removeAllListeners(this.ref.current);\n }\n this.updateAllEventListeners(element, this.props);\n this.updateAllPropValues(element, this.props);\n this.ref.current = element;\n }\n updateAllPropValues(element, props) {\n element.analytics = props.analytics;\n element.localizedInformation = props.localizedInformation;\n element.settings = props.settings;\n element.sheetAlignment = props.sheetAlignment;\n element.state = props.state;\n element.theme = props.theme;\n element.translations = props.translations;\n element.visibleModal = props.visibleModal;\n element.zipCode = props.zipCode;\n }\n updateAllEventListeners(element, props) {\n this.updateEventListener(element, props.onForget, \"forget\");\n this.updateEventListener(element, props.onModalClose, \"modalClose\");\n this.updateEventListener(element, props.onModalOpen, \"modalOpen\");\n this.updateEventListener(element, props.onSave, \"save\");\n }\n}\nKompisZipIn.propTypes = {\n className: PropTypes.string,\n children: PropTypes.any,\n analytics: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n localizedInformation: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n settings: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n sheetAlignment: PropTypes.string,\n state: PropTypes.string,\n theme: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,\n translations: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n visibleModal: PropTypes.string,\n zipCode: PropTypes.string,\n onModalClose: PropTypes.func,\n onModalOpen: PropTypes.func,\n onSave: PropTypes.func,\n onForget: PropTypes.func\n};\nexport default KompisZipIn;\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': '\n\t\t\t * \n\t\t\t * \n\t\t\t * \n\t\t\t * \n\t\t\t *\n\t\t\t * @param {!string} ns The namespace of the class definition, leaving off \"com.greensock.\" as that's assumed. For example, \"TweenLite\" or \"plugins.CSSPlugin\" or \"easing.Back\".\n\t\t\t * @param {!Array.} dependencies An array of dependencies (described as their namespaces minus \"com.greensock.\" prefix). For example [\"TweenLite\",\"plugins.TweenPlugin\",\"core.Animation\"]\n\t\t\t * @param {!function():Object} func The function that should be called and passed the resolved dependencies which will return the actual class for this definition.\n\t\t\t * @param {boolean=} global If true, the class will be added to the global scope (typically window unless you define a window.GreenSockGlobals object)\n\t\t\t */\n\t\t\tDefinition = function(ns, dependencies, func, global) {\n\t\t\t\tthis.sc = (_defLookup[ns]) ? _defLookup[ns].sc : []; //subclasses\n\t\t\t\t_defLookup[ns] = this;\n\t\t\t\tthis.gsClass = null;\n\t\t\t\tthis.func = func;\n\t\t\t\tvar _classes = [];\n\t\t\t\tthis.check = function(init) {\n\t\t\t\t\tvar i = dependencies.length,\n\t\t\t\t\t\tmissing = i,\n\t\t\t\t\t\tcur, a, n, cl;\n\t\t\t\t\twhile (--i > -1) {\n\t\t\t\t\t\tif ((cur = _defLookup[dependencies[i]] || new Definition(dependencies[i], [])).gsClass) {\n\t\t\t\t\t\t\t_classes[i] = cur.gsClass;\n\t\t\t\t\t\t\tmissing--;\n\t\t\t\t\t\t} else if (init) {\n\t\t\t\t\t\t\tcur.sc.push(this);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (missing === 0 && func) {\n\t\t\t\t\t\ta = (\"com.greensock.\" + ns).split(\".\");\n\t\t\t\t\t\tn = a.pop();\n\t\t\t\t\t\tcl = _namespace(a.join(\".\"))[n] = this.gsClass = func.apply(func, _classes);\n\n\t\t\t\t\t\t//exports to multiple environments\n\t\t\t\t\t\tif (global) {\n\t\t\t\t\t\t\t_globals[n] = _exports[n] = cl; //provides a way to avoid global namespace pollution. By default, the main classes like TweenLite, Power1, Strong, etc. are added to window unless a GreenSockGlobals is defined. So if you want to have things added to a custom object instead, just do something like window.GreenSockGlobals = {} before loading any GreenSock files. You can even set up an alias like window.GreenSockGlobals = windows.gs = {} so that you can access everything like gs.TweenLite. Also remember that ALL classes are added to the window.com.greensock object (in their respective packages, like com.greensock.easing.Power1, com.greensock.TweenLite, etc.)\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\tif (typeof(module) !== \"undefined\" && module.exports) { //node\n\t\t\t\t\t\t\t\tif (ns === moduleName) {\n\t\t\t\t\t\t\t\t\tmodule.exports = _exports[moduleName] = cl;\n\t\t\t\t\t\t\t\t\tfor (i in _exports) {\n\t\t\t\t\t\t\t\t\t\tcl[i] = _exports[i];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (_exports[moduleName]) {\n\t\t\t\t\t\t\t\t\t_exports[moduleName][n] = cl;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (typeof(define) === \"function\" && define.amd){ //AMD\n\t\t\t\t\t\t\t\tdefine((window.GreenSockAMDPath ? window.GreenSockAMDPath + \"/\" : \"\") + ns.split(\".\").pop(), [], function() { return cl; });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (i = 0; i < this.sc.length; i++) {\n\t\t\t\t\t\t\tthis.sc[i].check();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis.check(true);\n\t\t\t},\n\n\t\t\t//used to create Definition instances (which basically registers a class that has dependencies).\n\t\t\t_gsDefine = window._gsDefine = function(ns, dependencies, func, global) {\n\t\t\t\treturn new Definition(ns, dependencies, func, global);\n\t\t\t},\n\n\t\t\t//a quick way to create a class that doesn't have any dependencies. Returns the class, but first registers it in the GreenSock namespace so that other classes can grab it (other classes might be dependent on the class).\n\t\t\t_class = gs._class = function(ns, func, global) {\n\t\t\t\tfunc = func || function() {};\n\t\t\t\t_gsDefine(ns, [], function(){ return func; }, global);\n\t\t\t\treturn func;\n\t\t\t};\n\n\t\t_gsDefine.globals = _globals;\n\n\n\n/*\n * ----------------------------------------------------------------\n * Ease\n * ----------------------------------------------------------------\n */\n\t\tvar _baseParams = [0, 0, 1, 1],\n\t\t\tEase = _class(\"easing.Ease\", function(func, extraParams, type, power) {\n\t\t\t\tthis._func = func;\n\t\t\t\tthis._type = type || 0;\n\t\t\t\tthis._power = power || 0;\n\t\t\t\tthis._params = extraParams ? _baseParams.concat(extraParams) : _baseParams;\n\t\t\t}, true),\n\t\t\t_easeMap = Ease.map = {},\n\t\t\t_easeReg = Ease.register = function(ease, names, types, create) {\n\t\t\t\tvar na = names.split(\",\"),\n\t\t\t\t\ti = na.length,\n\t\t\t\t\tta = (types || \"easeIn,easeOut,easeInOut\").split(\",\"),\n\t\t\t\t\te, name, j, type;\n\t\t\t\twhile (--i > -1) {\n\t\t\t\t\tname = na[i];\n\t\t\t\t\te = create ? _class(\"easing.\"+name, null, true) : gs.easing[name] || {};\n\t\t\t\t\tj = ta.length;\n\t\t\t\t\twhile (--j > -1) {\n\t\t\t\t\t\ttype = ta[j];\n\t\t\t\t\t\t_easeMap[name + \".\" + type] = _easeMap[type + name] = e[type] = ease.getRatio ? ease : ease[type] || new ease();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\tp = Ease.prototype;\n\t\tp._calcEnd = false;\n\t\tp.getRatio = function(p) {\n\t\t\tif (this._func) {\n\t\t\t\tthis._params[0] = p;\n\t\t\t\treturn this._func.apply(null, this._params);\n\t\t\t}\n\t\t\tvar t = this._type,\n\t\t\t\tpw = this._power,\n\t\t\t\tr = (t === 1) ? 1 - p : (t === 2) ? p : (p < 0.5) ? p * 2 : (1 - p) * 2;\n\t\t\tif (pw === 1) {\n\t\t\t\tr *= r;\n\t\t\t} else if (pw === 2) {\n\t\t\t\tr *= r * r;\n\t\t\t} else if (pw === 3) {\n\t\t\t\tr *= r * r * r;\n\t\t\t} else if (pw === 4) {\n\t\t\t\tr *= r * r * r * r;\n\t\t\t}\n\t\t\treturn (t === 1) ? 1 - r : (t === 2) ? r : (p < 0.5) ? r / 2 : 1 - (r / 2);\n\t\t};\n\n\t\t//create all the standard eases like Linear, Quad, Cubic, Quart, Quint, Strong, Power0, Power1, Power2, Power3, and Power4 (each with easeIn, easeOut, and easeInOut)\n\t\ta = [\"Linear\",\"Quad\",\"Cubic\",\"Quart\",\"Quint,Strong\"];\n\t\ti = a.length;\n\t\twhile (--i > -1) {\n\t\t\tp = a[i]+\",Power\"+i;\n\t\t\t_easeReg(new Ease(null,null,1,i), p, \"easeOut\", true);\n\t\t\t_easeReg(new Ease(null,null,2,i), p, \"easeIn\" + ((i === 0) ? \",easeNone\" : \"\"));\n\t\t\t_easeReg(new Ease(null,null,3,i), p, \"easeInOut\");\n\t\t}\n\t\t_easeMap.linear = gs.easing.Linear.easeIn;\n\t\t_easeMap.swing = gs.easing.Quad.easeInOut; //for jQuery folks\n\n\n/*\n * ----------------------------------------------------------------\n * EventDispatcher\n * ----------------------------------------------------------------\n */\n\t\tvar EventDispatcher = _class(\"events.EventDispatcher\", function(target) {\n\t\t\tthis._listeners = {};\n\t\t\tthis._eventTarget = target || this;\n\t\t});\n\t\tp = EventDispatcher.prototype;\n\n\t\tp.addEventListener = function(type, callback, scope, useParam, priority) {\n\t\t\tpriority = priority || 0;\n\t\t\tvar list = this._listeners[type],\n\t\t\t\tindex = 0,\n\t\t\t\tlistener, i;\n\t\t\tif (this === _ticker && !_tickerActive) {\n\t\t\t\t_ticker.wake();\n\t\t\t}\n\t\t\tif (list == null) {\n\t\t\t\tthis._listeners[type] = list = [];\n\t\t\t}\n\t\t\ti = list.length;\n\t\t\twhile (--i > -1) {\n\t\t\t\tlistener = list[i];\n\t\t\t\tif (listener.c === callback && listener.s === scope) {\n\t\t\t\t\tlist.splice(i, 1);\n\t\t\t\t} else if (index === 0 && listener.pr < priority) {\n\t\t\t\t\tindex = i + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlist.splice(index, 0, {c:callback, s:scope, up:useParam, pr:priority});\n\t\t};\n\n\t\tp.removeEventListener = function(type, callback) {\n\t\t\tvar list = this._listeners[type], i;\n\t\t\tif (list) {\n\t\t\t\ti = list.length;\n\t\t\t\twhile (--i > -1) {\n\t\t\t\t\tif (list[i].c === callback) {\n\t\t\t\t\t\tlist.splice(i, 1);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tp.dispatchEvent = function(type) {\n\t\t\tvar list = this._listeners[type],\n\t\t\t\ti, t, listener;\n\t\t\tif (list) {\n\t\t\t\ti = list.length;\n\t\t\t\tif (i > 1) {\n\t\t\t\t\tlist = list.slice(0); //in case addEventListener() is called from within a listener/callback (otherwise the index could change, resulting in a skip)\n\t\t\t\t}\n\t\t\t\tt = this._eventTarget;\n\t\t\t\twhile (--i > -1) {\n\t\t\t\t\tlistener = list[i];\n\t\t\t\t\tif (listener) {\n\t\t\t\t\t\tif (listener.up) {\n\t\t\t\t\t\t\tlistener.c.call(listener.s || t, {type:type, target:t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlistener.c.call(listener.s || t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\n/*\n * ----------------------------------------------------------------\n * Ticker\n * ----------------------------------------------------------------\n */\n \t\tvar _reqAnimFrame = window.requestAnimationFrame,\n\t\t\t_cancelAnimFrame = window.cancelAnimationFrame,\n\t\t\t_getTime = Date.now || function() {return new Date().getTime();},\n\t\t\t_lastUpdate = _getTime();\n\n\t\t//now try to determine the requestAnimationFrame and cancelAnimationFrame functions and if none are found, we'll use a setTimeout()/clearTimeout() polyfill.\n\t\ta = [\"ms\",\"moz\",\"webkit\",\"o\"];\n\t\ti = a.length;\n\t\twhile (--i > -1 && !_reqAnimFrame) {\n\t\t\t_reqAnimFrame = window[a[i] + \"RequestAnimationFrame\"];\n\t\t\t_cancelAnimFrame = window[a[i] + \"CancelAnimationFrame\"] || window[a[i] + \"CancelRequestAnimationFrame\"];\n\t\t}\n\n\t\t_class(\"Ticker\", function(fps, useRAF) {\n\t\t\tvar _self = this,\n\t\t\t\t_startTime = _getTime(),\n\t\t\t\t_useRAF = (useRAF !== false && _reqAnimFrame) ? \"auto\" : false,\n\t\t\t\t_lagThreshold = 500,\n\t\t\t\t_adjustedLag = 33,\n\t\t\t\t_tickWord = \"tick\", //helps reduce gc burden\n\t\t\t\t_fps, _req, _id, _gap, _nextTime,\n\t\t\t\t_tick = function(manual) {\n\t\t\t\t\tvar elapsed = _getTime() - _lastUpdate,\n\t\t\t\t\t\toverlap, dispatch;\n\t\t\t\t\tif (elapsed > _lagThreshold) {\n\t\t\t\t\t\t_startTime += elapsed - _adjustedLag;\n\t\t\t\t\t}\n\t\t\t\t\t_lastUpdate += elapsed;\n\t\t\t\t\t_self.time = (_lastUpdate - _startTime) / 1000;\n\t\t\t\t\toverlap = _self.time - _nextTime;\n\t\t\t\t\tif (!_fps || overlap > 0 || manual === true) {\n\t\t\t\t\t\t_self.frame++;\n\t\t\t\t\t\t_nextTime += overlap + (overlap >= _gap ? 0.004 : _gap - overlap);\n\t\t\t\t\t\tdispatch = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (manual !== true) { //make sure the request is made before we dispatch the \"tick\" event so that timing is maintained. Otherwise, if processing the \"tick\" requires a bunch of time (like 15ms) and we're using a setTimeout() that's based on 16.7ms, it'd technically take 31.7ms between frames otherwise.\n\t\t\t\t\t\t_id = _req(_tick);\n\t\t\t\t\t}\n\t\t\t\t\tif (dispatch) {\n\t\t\t\t\t\t_self.dispatchEvent(_tickWord);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\tEventDispatcher.call(_self);\n\t\t\t_self.time = _self.frame = 0;\n\t\t\t_self.tick = function() {\n\t\t\t\t_tick(true);\n\t\t\t};\n\n\t\t\t_self.lagSmoothing = function(threshold, adjustedLag) {\n\t\t\t\tif (!arguments.length) { //if lagSmoothing() is called with no arguments, treat it like a getter that returns a boolean indicating if it's enabled or not. This is purposely undocumented and is for internal use.\n\t\t\t\t\treturn (_lagThreshold < 1 / _tinyNum);\n\t\t\t\t}\n\t\t\t\t_lagThreshold = threshold || (1 / _tinyNum); //zero should be interpreted as basically unlimited\n\t\t\t\t_adjustedLag = Math.min(adjustedLag, _lagThreshold, 0);\n\t\t\t};\n\n\t\t\t_self.sleep = function() {\n\t\t\t\tif (_id == null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!_useRAF || !_cancelAnimFrame) {\n\t\t\t\t\tclearTimeout(_id);\n\t\t\t\t} else {\n\t\t\t\t\t_cancelAnimFrame(_id);\n\t\t\t\t}\n\t\t\t\t_req = _emptyFunc;\n\t\t\t\t_id = null;\n\t\t\t\tif (_self === _ticker) {\n\t\t\t\t\t_tickerActive = false;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t_self.wake = function(seamless) {\n\t\t\t\tif (_id !== null) {\n\t\t\t\t\t_self.sleep();\n\t\t\t\t} else if (seamless) {\n\t\t\t\t\t_startTime += -_lastUpdate + (_lastUpdate = _getTime());\n\t\t\t\t} else if (_self.frame > 10) { //don't trigger lagSmoothing if we're just waking up, and make sure that at least 10 frames have elapsed because of the iOS bug that we work around below with the 1.5-second setTimout().\n\t\t\t\t\t_lastUpdate = _getTime() - _lagThreshold + 5;\n\t\t\t\t}\n\t\t\t\t_req = (_fps === 0) ? _emptyFunc : (!_useRAF || !_reqAnimFrame) ? function(f) { return setTimeout(f, ((_nextTime - _self.time) * 1000 + 1) | 0); } : _reqAnimFrame;\n\t\t\t\tif (_self === _ticker) {\n\t\t\t\t\t_tickerActive = true;\n\t\t\t\t}\n\t\t\t\t_tick(2);\n\t\t\t};\n\n\t\t\t_self.fps = function(value) {\n\t\t\t\tif (!arguments.length) {\n\t\t\t\t\treturn _fps;\n\t\t\t\t}\n\t\t\t\t_fps = value;\n\t\t\t\t_gap = 1 / (_fps || 60);\n\t\t\t\t_nextTime = this.time + _gap;\n\t\t\t\t_self.wake();\n\t\t\t};\n\n\t\t\t_self.useRAF = function(value) {\n\t\t\t\tif (!arguments.length) {\n\t\t\t\t\treturn _useRAF;\n\t\t\t\t}\n\t\t\t\t_self.sleep();\n\t\t\t\t_useRAF = value;\n\t\t\t\t_self.fps(_fps);\n\t\t\t};\n\t\t\t_self.fps(fps);\n\n\t\t\t//a bug in iOS 6 Safari occasionally prevents the requestAnimationFrame from working initially, so we use a 1.5-second timeout that automatically falls back to setTimeout() if it senses this condition.\n\t\t\tsetTimeout(function() {\n\t\t\t\tif (_useRAF === \"auto\" && _self.frame < 5 && (_doc || {}).visibilityState !== \"hidden\") {\n\t\t\t\t\t_self.useRAF(false);\n\t\t\t\t}\n\t\t\t}, 1500);\n\t\t});\n\n\t\tp = gs.Ticker.prototype = new gs.events.EventDispatcher();\n\t\tp.constructor = gs.Ticker;\n\n\n/*\n * ----------------------------------------------------------------\n * Animation\n * ----------------------------------------------------------------\n */\n\t\tvar Animation = _class(\"core.Animation\", function(duration, vars) {\n\t\t\t\tthis.vars = vars = vars || {};\n\t\t\t\tthis._duration = this._totalDuration = duration || 0;\n\t\t\t\tthis._delay = Number(vars.delay) || 0;\n\t\t\t\tthis._timeScale = 1;\n\t\t\t\tthis._active = !!vars.immediateRender;\n\t\t\t\tthis.data = vars.data;\n\t\t\t\tthis._reversed = !!vars.reversed;\n\n\t\t\t\tif (!_rootTimeline) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!_tickerActive) { //some browsers (like iOS 6 Safari) shut down JavaScript execution when the tab is disabled and they [occasionally] neglect to start up requestAnimationFrame again when returning - this code ensures that the engine starts up again properly.\n\t\t\t\t\t_ticker.wake();\n\t\t\t\t}\n\n\t\t\t\tvar tl = this.vars.useFrames ? _rootFramesTimeline : _rootTimeline;\n\t\t\t\ttl.add(this, tl._time);\n\n\t\t\t\tif (this.vars.paused) {\n\t\t\t\t\tthis.paused(true);\n\t\t\t\t}\n\t\t\t});\n\n\t\t_ticker = Animation.ticker = new gs.Ticker();\n\t\tp = Animation.prototype;\n\t\tp._dirty = p._gc = p._initted = p._paused = false;\n\t\tp._totalTime = p._time = 0;\n\t\tp._rawPrevTime = -1;\n\t\tp._next = p._last = p._onUpdate = p._timeline = p.timeline = null;\n\t\tp._paused = false;\n\n\n\t\t//some browsers (like iOS) occasionally drop the requestAnimationFrame event when the user switches to a different tab and then comes back again, so we use a 2-second setTimeout() to sense if/when that condition occurs and then wake() the ticker.\n\t\tvar _checkTimeout = function() {\n\t\t\t\tif (_tickerActive && _getTime() - _lastUpdate > 2000 && ((_doc || {}).visibilityState !== \"hidden\" || !_ticker.lagSmoothing())) { //note: if the tab is hidden, we should still wake if lagSmoothing has been disabled.\n\t\t\t\t\t_ticker.wake();\n\t\t\t\t}\n\t\t\t\tvar t = setTimeout(_checkTimeout, 2000);\n\t\t\t\tif (t.unref) {\n\t\t\t\t\t// allows a node process to exit even if the timeout’s callback hasn't been invoked. Without it, the node process could hang as this function is called every two seconds.\n\t\t\t\t\tt.unref();\n\t\t\t\t}\n\t\t\t};\n\t\t_checkTimeout();\n\n\n\t\tp.play = function(from, suppressEvents) {\n\t\t\tif (from != null) {\n\t\t\t\tthis.seek(from, suppressEvents);\n\t\t\t}\n\t\t\treturn this.reversed(false).paused(false);\n\t\t};\n\n\t\tp.pause = function(atTime, suppressEvents) {\n\t\t\tif (atTime != null) {\n\t\t\t\tthis.seek(atTime, suppressEvents);\n\t\t\t}\n\t\t\treturn this.paused(true);\n\t\t};\n\n\t\tp.resume = function(from, suppressEvents) {\n\t\t\tif (from != null) {\n\t\t\t\tthis.seek(from, suppressEvents);\n\t\t\t}\n\t\t\treturn this.paused(false);\n\t\t};\n\n\t\tp.seek = function(time, suppressEvents) {\n\t\t\treturn this.totalTime(Number(time), suppressEvents !== false);\n\t\t};\n\n\t\tp.restart = function(includeDelay, suppressEvents) {\n\t\t\treturn this.reversed(false).paused(false).totalTime(includeDelay ? -this._delay : 0, (suppressEvents !== false), true);\n\t\t};\n\n\t\tp.reverse = function(from, suppressEvents) {\n\t\t\tif (from != null) {\n\t\t\t\tthis.seek((from || this.totalDuration()), suppressEvents);\n\t\t\t}\n\t\t\treturn this.reversed(true).paused(false);\n\t\t};\n\n\t\tp.render = function(time, suppressEvents, force) {\n\t\t\t//stub - we override this method in subclasses.\n\t\t};\n\n\t\tp.invalidate = function() {\n\t\t\tthis._time = this._totalTime = 0;\n\t\t\tthis._initted = this._gc = false;\n\t\t\tthis._rawPrevTime = -1;\n\t\t\tif (this._gc || !this.timeline) {\n\t\t\t\tthis._enabled(true);\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\tp.isActive = function() {\n\t\t\tvar tl = this._timeline, //the 2 root timelines won't have a _timeline; they're always active.\n\t\t\t\tstartTime = this._startTime,\n\t\t\t\trawTime;\n\t\t\treturn (!tl || (!this._gc && !this._paused && tl.isActive() && (rawTime = tl.rawTime(true)) >= startTime && rawTime < startTime + this.totalDuration() / this._timeScale - _tinyNum));\n\t\t};\n\n\t\tp._enabled = function (enabled, ignoreTimeline) {\n\t\t\tif (!_tickerActive) {\n\t\t\t\t_ticker.wake();\n\t\t\t}\n\t\t\tthis._gc = !enabled;\n\t\t\tthis._active = this.isActive();\n\t\t\tif (ignoreTimeline !== true) {\n\t\t\t\tif (enabled && !this.timeline) {\n\t\t\t\t\tthis._timeline.add(this, this._startTime - this._delay);\n\t\t\t\t} else if (!enabled && this.timeline) {\n\t\t\t\t\tthis._timeline._remove(this, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\n\t\tp._kill = function(vars, target) {\n\t\t\treturn this._enabled(false, false);\n\t\t};\n\n\t\tp.kill = function(vars, target) {\n\t\t\tthis._kill(vars, target);\n\t\t\treturn this;\n\t\t};\n\n\t\tp._uncache = function(includeSelf) {\n\t\t\tvar tween = includeSelf ? this : this.timeline;\n\t\t\twhile (tween) {\n\t\t\t\ttween._dirty = true;\n\t\t\t\ttween = tween.timeline;\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\tp._swapSelfInParams = function(params) {\n\t\t\tvar i = params.length,\n\t\t\t\tcopy = params.concat();\n\t\t\twhile (--i > -1) {\n\t\t\t\tif (params[i] === \"{self}\") {\n\t\t\t\t\tcopy[i] = this;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn copy;\n\t\t};\n\n\t\tp._callback = function(type) {\n\t\t\tvar v = this.vars,\n\t\t\t\tcallback = v[type],\n\t\t\t\tparams = v[type + \"Params\"],\n\t\t\t\tscope = v[type + \"Scope\"] || v.callbackScope || this,\n\t\t\t\tl = params ? params.length : 0;\n\t\t\tswitch (l) { //speed optimization; call() is faster than apply() so use it when there are only a few parameters (which is by far most common). Previously we simply did var v = this.vars; v[type].apply(v[type + \"Scope\"] || v.callbackScope || this, v[type + \"Params\"] || _blankArray);\n\t\t\t\tcase 0: callback.call(scope); break;\n\t\t\t\tcase 1: callback.call(scope, params[0]); break;\n\t\t\t\tcase 2: callback.call(scope, params[0], params[1]); break;\n\t\t\t\tdefault: callback.apply(scope, params);\n\t\t\t}\n\t\t};\n\n//----Animation getters/setters --------------------------------------------------------\n\n\t\tp.eventCallback = function(type, callback, params, scope) {\n\t\t\tif ((type || \"\").substr(0,2) === \"on\") {\n\t\t\t\tvar v = this.vars;\n\t\t\t\tif (arguments.length === 1) {\n\t\t\t\t\treturn v[type];\n\t\t\t\t}\n\t\t\t\tif (callback == null) {\n\t\t\t\t\tdelete v[type];\n\t\t\t\t} else {\n\t\t\t\t\tv[type] = callback;\n\t\t\t\t\tv[type + \"Params\"] = (_isArray(params) && params.join(\"\").indexOf(\"{self}\") !== -1) ? this._swapSelfInParams(params) : params;\n\t\t\t\t\tv[type + \"Scope\"] = scope;\n\t\t\t\t}\n\t\t\t\tif (type === \"onUpdate\") {\n\t\t\t\t\tthis._onUpdate = callback;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\tp.delay = function(value) {\n\t\t\tif (!arguments.length) {\n\t\t\t\treturn this._delay;\n\t\t\t}\n\t\t\tif (this._timeline.smoothChildTiming) {\n\t\t\t\tthis.startTime( this._startTime + value - this._delay );\n\t\t\t}\n\t\t\tthis._delay = value;\n\t\t\treturn this;\n\t\t};\n\n\t\tp.duration = function(value) {\n\t\t\tif (!arguments.length) {\n\t\t\t\tthis._dirty = false;\n\t\t\t\treturn this._duration;\n\t\t\t}\n\t\t\tthis._duration = this._totalDuration = value;\n\t\t\tthis._uncache(true); //true in case it's a TweenMax or TimelineMax that has a repeat - we'll need to refresh the totalDuration.\n\t\t\tif (this._timeline.smoothChildTiming) if (this._time > 0) if (this._time < this._duration) if (value !== 0) {\n\t\t\t\tthis.totalTime(this._totalTime * (value / this._duration), true);\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\tp.totalDuration = function(value) {\n\t\t\tthis._dirty = false;\n\t\t\treturn (!arguments.length) ? this._totalDuration : this.duration(value);\n\t\t};\n\n\t\tp.time = function(value, suppressEvents) {\n\t\t\tif (!arguments.length) {\n\t\t\t\treturn this._time;\n\t\t\t}\n\t\t\tif (this._dirty) {\n\t\t\t\tthis.totalDuration();\n\t\t\t}\n\t\t\treturn this.totalTime((value > this._duration) ? this._duration : value, suppressEvents);\n\t\t};\n\n\t\tp.totalTime = function(time, suppressEvents, uncapped) {\n\t\t\tif (!_tickerActive) {\n\t\t\t\t_ticker.wake();\n\t\t\t}\n\t\t\tif (!arguments.length) {\n\t\t\t\treturn this._totalTime;\n\t\t\t}\n\t\t\tif (this._timeline) {\n\t\t\t\tif (time < 0 && !uncapped) {\n\t\t\t\t\ttime += this.totalDuration();\n\t\t\t\t}\n\t\t\t\tif (this._timeline.smoothChildTiming) {\n\t\t\t\t\tif (this._dirty) {\n\t\t\t\t\t\tthis.totalDuration();\n\t\t\t\t\t}\n\t\t\t\t\tvar totalDuration = this._totalDuration,\n\t\t\t\t\t\ttl = this._timeline;\n\t\t\t\t\tif (time > totalDuration && !uncapped) {\n\t\t\t\t\t\ttime = totalDuration;\n\t\t\t\t\t}\n\t\t\t\t\tthis._startTime = (this._paused ? this._pauseTime : tl._time) - ((!this._reversed ? time : totalDuration - time) / this._timeScale);\n\t\t\t\t\tif (!tl._dirty) { //for performance improvement. If the parent's cache is already dirty, it already took care of marking the ancestors as dirty too, so skip the function call here.\n\t\t\t\t\t\tthis._uncache(false);\n\t\t\t\t\t}\n\t\t\t\t\t//in case any of the ancestor timelines had completed but should now be enabled, we should reset their totalTime() which will also ensure that they're lined up properly and enabled. Skip for animations that are on the root (wasteful). Example: a TimelineLite.exportRoot() is performed when there's a paused tween on the root, the export will not complete until that tween is unpaused, but imagine a child gets restarted later, after all [unpaused] tweens have completed. The startTime of that child would get pushed out, but one of the ancestors may have completed.\n\t\t\t\t\tif (tl._timeline) {\n\t\t\t\t\t\twhile (tl._timeline) {\n\t\t\t\t\t\t\tif (tl._timeline._time !== (tl._startTime + tl._totalTime) / tl._timeScale) {\n\t\t\t\t\t\t\t\ttl.totalTime(tl._totalTime, true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttl = tl._timeline;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this._gc) {\n\t\t\t\t\tthis._enabled(true, false);\n\t\t\t\t}\n\t\t\t\tif (this._totalTime !== time || this._duration === 0) {\n\t\t\t\t\tif (_lazyTweens.length) {\n\t\t\t\t\t\t_lazyRender();\n\t\t\t\t\t}\n\t\t\t\t\tthis.render(time, suppressEvents, false);\n\t\t\t\t\tif (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when someone calls seek() or time() or progress(), they expect an immediate render.\n\t\t\t\t\t\t_lazyRender();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\tp.progress = p.totalProgress = function(value, suppressEvents) {\n\t\t\tvar duration = this.duration();\n\t\t\treturn (!arguments.length) ? (duration ? this._time / duration : this.ratio) : this.totalTime(duration * value, suppressEvents);\n\t\t};\n\n\t\tp.startTime = function(value) {\n\t\t\tif (!arguments.length) {\n\t\t\t\treturn this._startTime;\n\t\t\t}\n\t\t\tif (value !== this._startTime) {\n\t\t\t\tthis._startTime = value;\n\t\t\t\tif (this.timeline) if (this.timeline._sortChildren) {\n\t\t\t\t\tthis.timeline.add(this, value - this._delay); //ensures that any necessary re-sequencing of Animations in the timeline occurs to make sure the rendering order is correct.\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\tp.endTime = function(includeRepeats) {\n\t\t\treturn this._startTime + ((includeRepeats != false) ? this.totalDuration() : this.duration()) / this._timeScale;\n\t\t};\n\n\t\tp.timeScale = function(value) {\n\t\t\tif (!arguments.length) {\n\t\t\t\treturn this._timeScale;\n\t\t\t}\n\t\t\tvar pauseTime, t;\n\t\t\tvalue = value || _tinyNum; //can't allow zero because it'll throw the math off\n\t\t\tif (this._timeline && this._timeline.smoothChildTiming) {\n\t\t\t\tpauseTime = this._pauseTime;\n\t\t\t\tt = (pauseTime || pauseTime === 0) ? pauseTime : this._timeline.totalTime();\n\t\t\t\tthis._startTime = t - ((t - this._startTime) * this._timeScale / value);\n\t\t\t}\n\t\t\tthis._timeScale = value;\n\t\t\tt = this.timeline;\n\t\t\twhile (t && t.timeline) { //must update the duration/totalDuration of all ancestor timelines immediately in case in the middle of a render loop, one tween alters another tween's timeScale which shoves its startTime before 0, forcing the parent timeline to shift around and shiftChildren() which could affect that next tween's render (startTime). Doesn't matter for the root timeline though.\n\t\t\t\tt._dirty = true;\n\t\t\t\tt.totalDuration();\n\t\t\t\tt = t.timeline;\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\tp.reversed = function(value) {\n\t\t\tif (!arguments.length) {\n\t\t\t\treturn this._reversed;\n\t\t\t}\n\t\t\tif (value != this._reversed) {\n\t\t\t\tthis._reversed = value;\n\t\t\t\tthis.totalTime(((this._timeline && !this._timeline.smoothChildTiming) ? this.totalDuration() - this._totalTime : this._totalTime), true);\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\tp.paused = function(value) {\n\t\t\tif (!arguments.length) {\n\t\t\t\treturn this._paused;\n\t\t\t}\n\t\t\tvar tl = this._timeline,\n\t\t\t\traw, elapsed;\n\t\t\tif (value != this._paused) if (tl) {\n\t\t\t\tif (!_tickerActive && !value) {\n\t\t\t\t\t_ticker.wake();\n\t\t\t\t}\n\t\t\t\traw = tl.rawTime();\n\t\t\t\telapsed = raw - this._pauseTime;\n\t\t\t\tif (!value && tl.smoothChildTiming) {\n\t\t\t\t\tthis._startTime += elapsed;\n\t\t\t\t\tthis._uncache(false);\n\t\t\t\t}\n\t\t\t\tthis._pauseTime = value ? raw : null;\n\t\t\t\tthis._paused = value;\n\t\t\t\tthis._active = this.isActive();\n\t\t\t\tif (!value && elapsed !== 0 && this._initted && this.duration()) {\n\t\t\t\t\traw = tl.smoothChildTiming ? this._totalTime : (raw - this._startTime) / this._timeScale;\n\t\t\t\t\tthis.render(raw, (raw === this._totalTime), true); //in case the target's properties changed via some other tween or manual update by the user, we should force a render.\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this._gc && !value) {\n\t\t\t\tthis._enabled(true, false);\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\n/*\n * ----------------------------------------------------------------\n * SimpleTimeline\n * ----------------------------------------------------------------\n */\n\t\tvar SimpleTimeline = _class(\"core.SimpleTimeline\", function(vars) {\n\t\t\tAnimation.call(this, 0, vars);\n\t\t\tthis.autoRemoveChildren = this.smoothChildTiming = true;\n\t\t});\n\n\t\tp = SimpleTimeline.prototype = new Animation();\n\t\tp.constructor = SimpleTimeline;\n\t\tp.kill()._gc = false;\n\t\tp._first = p._last = p._recent = null;\n\t\tp._sortChildren = false;\n\n\t\tp.add = p.insert = function(child, position, align, stagger) {\n\t\t\tvar prevTween, st;\n\t\t\tchild._startTime = Number(position || 0) + child._delay;\n\t\t\tif (child._paused) if (this !== child._timeline) { //we only adjust the _pauseTime if it wasn't in this timeline already. Remember, sometimes a tween will be inserted again into the same timeline when its startTime is changed so that the tweens in the TimelineLite/Max are re-ordered properly in the linked list (so everything renders in the proper order).\n\t\t\t\tchild._pauseTime = this.rawTime() - (child._timeline.rawTime() - child._pauseTime);\n\t\t\t}\n\t\t\tif (child.timeline) {\n\t\t\t\tchild.timeline._remove(child, true); //removes from existing timeline so that it can be properly added to this one.\n\t\t\t}\n\t\t\tchild.timeline = child._timeline = this;\n\t\t\tif (child._gc) {\n\t\t\t\tchild._enabled(true, true);\n\t\t\t}\n\t\t\tprevTween = this._last;\n\t\t\tif (this._sortChildren) {\n\t\t\t\tst = child._startTime;\n\t\t\t\twhile (prevTween && prevTween._startTime > st) {\n\t\t\t\t\tprevTween = prevTween._prev;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (prevTween) {\n\t\t\t\tchild._next = prevTween._next;\n\t\t\t\tprevTween._next = child;\n\t\t\t} else {\n\t\t\t\tchild._next = this._first;\n\t\t\t\tthis._first = child;\n\t\t\t}\n\t\t\tif (child._next) {\n\t\t\t\tchild._next._prev = child;\n\t\t\t} else {\n\t\t\t\tthis._last = child;\n\t\t\t}\n\t\t\tchild._prev = prevTween;\n\t\t\tthis._recent = child;\n\t\t\tif (this._timeline) {\n\t\t\t\tthis._uncache(true);\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\tp._remove = function(tween, skipDisable) {\n\t\t\tif (tween.timeline === this) {\n\t\t\t\tif (!skipDisable) {\n\t\t\t\t\ttween._enabled(false, true);\n\t\t\t\t}\n\n\t\t\t\tif (tween._prev) {\n\t\t\t\t\ttween._prev._next = tween._next;\n\t\t\t\t} else if (this._first === tween) {\n\t\t\t\t\tthis._first = tween._next;\n\t\t\t\t}\n\t\t\t\tif (tween._next) {\n\t\t\t\t\ttween._next._prev = tween._prev;\n\t\t\t\t} else if (this._last === tween) {\n\t\t\t\t\tthis._last = tween._prev;\n\t\t\t\t}\n\t\t\t\ttween._next = tween._prev = tween.timeline = null;\n\t\t\t\tif (tween === this._recent) {\n\t\t\t\t\tthis._recent = this._last;\n\t\t\t\t}\n\n\t\t\t\tif (this._timeline) {\n\t\t\t\t\tthis._uncache(true);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\tp.render = function(time, suppressEvents, force) {\n\t\t\tvar tween = this._first,\n\t\t\t\tnext;\n\t\t\tthis._totalTime = this._time = this._rawPrevTime = time;\n\t\t\twhile (tween) {\n\t\t\t\tnext = tween._next; //record it here because the value could change after rendering...\n\t\t\t\tif (tween._active || (time >= tween._startTime && !tween._paused && !tween._gc)) {\n\t\t\t\t\tif (!tween._reversed) {\n\t\t\t\t\t\ttween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttween = next;\n\t\t\t}\n\t\t};\n\n\t\tp.rawTime = function() {\n\t\t\tif (!_tickerActive) {\n\t\t\t\t_ticker.wake();\n\t\t\t}\n\t\t\treturn this._totalTime;\n\t\t};\n\n/*\n * ----------------------------------------------------------------\n * TweenLite\n * ----------------------------------------------------------------\n */\n\t\tvar TweenLite = _class(\"TweenLite\", function(target, duration, vars) {\n\t\t\t\tAnimation.call(this, duration, vars);\n\t\t\t\tthis.render = TweenLite.prototype.render; //speed optimization (avoid prototype lookup on this \"hot\" method)\n\n\t\t\t\tif (target == null) {\n\t\t\t\t\tthrow \"Cannot tween a null target.\";\n\t\t\t\t}\n\n\t\t\t\tthis.target = target = (typeof(target) !== \"string\") ? target : TweenLite.selector(target) || target;\n\n\t\t\t\tvar isSelector = (target.jquery || (target.length && target !== window && target[0] && (target[0] === window || (target[0].nodeType && target[0].style && !target.nodeType)))),\n\t\t\t\t\toverwrite = this.vars.overwrite,\n\t\t\t\t\ti, targ, targets;\n\n\t\t\t\tthis._overwrite = overwrite = (overwrite == null) ? _overwriteLookup[TweenLite.defaultOverwrite] : (typeof(overwrite) === \"number\") ? overwrite >> 0 : _overwriteLookup[overwrite];\n\n\t\t\t\tif ((isSelector || target instanceof Array || (target.push && _isArray(target))) && typeof(target[0]) !== \"number\") {\n\t\t\t\t\tthis._targets = targets = _slice(target); //don't use Array.prototype.slice.call(target, 0) because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll()\n\t\t\t\t\tthis._propLookup = [];\n\t\t\t\t\tthis._siblings = [];\n\t\t\t\t\tfor (i = 0; i < targets.length; i++) {\n\t\t\t\t\t\ttarg = targets[i];\n\t\t\t\t\t\tif (!targ) {\n\t\t\t\t\t\t\ttargets.splice(i--, 1);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t} else if (typeof(targ) === \"string\") {\n\t\t\t\t\t\t\ttarg = targets[i--] = TweenLite.selector(targ); //in case it's an array of strings\n\t\t\t\t\t\t\tif (typeof(targ) === \"string\") {\n\t\t\t\t\t\t\t\ttargets.splice(i+1, 1); //to avoid an endless loop (can't imagine why the selector would return a string, but just in case)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t} else if (targ.length && targ !== window && targ[0] && (targ[0] === window || (targ[0].nodeType && targ[0].style && !targ.nodeType))) { //in case the user is passing in an array of selector objects (like jQuery objects), we need to check one more level and pull things out if necessary. Also note that