{"version":3,"sources":["webpack:///./ClientApp/services/Localizer.tsx","webpack:///./ClientApp/shared/components/svg/DownChevronSVG.tsx","webpack:///./ClientApp/shared/components/svg/UpChevronSVG.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/OrderMessages.tsx","webpack:///./ClientApp/shared/assets/LazyImage.tsx","webpack:///./ClientApp/shared/polyfills/customEvent.js","webpack:///./ClientApp/shared/components/svg/RightChevronSVG.tsx","webpack:///./ClientApp/shared/hooks/useInViewOnce.ts","webpack:///./ClientApp/styles/node-modules/@reach/dialog/styles.css?d0c1","webpack:///./ClientApp/features/commerce/product-details/data.ts","webpack:///./ClientApp/styles/node-modules/@reach/dialog/styles.css","webpack:///./ClientApp/shared/components/svg/QuestionMarkCircleSVG.tsx","webpack:///./ClientApp/shared/components/svg/FileSVG.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/ProductSelectionsList.tsx","webpack:///./ClientApp/shared/components/svg/PlayMediaSVG.tsx","webpack:///./ClientApp/shared/components/svg/FilePDFSVG.tsx","webpack:///./ClientApp/shared/components/svg/FileWithTextSVG.tsx","webpack:///./ClientApp/shared/components/svg/FileWordDocSVG.tsx","webpack:///./ClientApp/shared/components/svg/FileExcelSVG.tsx","webpack:///./ClientApp/shared/assets/AssetIcon.tsx","webpack:///./ClientApp/shared/components/svg/DownloadSVG.tsx","webpack:///./ClientApp/shared/assets/AssetDownloadIcon.tsx","webpack:///./ClientApp/shared/assets/ExternalMediaIFrame.tsx","webpack:///./ClientApp/shared/components/svg/EnlargeSVG.tsx","webpack:///./ClientApp/features/commerce/product-details/ProductImageModal.tsx","webpack:///./ClientApp/features/commerce/product-details/ProductAssets.tsx","webpack:///./ClientApp/shared/hooks/useSmoothScrollingPolyfill.tsx","webpack:///./ClientApp/shared/breakpoints.ts","webpack:///./ClientApp/shared/components/Spinner.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/ShoppingCartContext.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/useShoppingCart.ts","webpack:///./ClientApp/shared/components/FauxDropdown.tsx","webpack:///./ClientApp/shared/components/VisuallyHiddenAnnouncementContext.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/KeepOrDiscardCart.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/SavedCarts.tsx","webpack:///./ClientApp/services/AxiosHelper.ts","webpack:///./ClientApp/features/commerce/shopping-cart/useSavedShoppingCart.tsx","webpack:///./ClientApp/shared/edit/fields/FieldInputErrorWrapper.tsx","webpack:///./ClientApp/shared/components/VisuallyHiddenAnnouncement.tsx","webpack:///./ClientApp/shared/components/commerce/ChangeConfirmationWithUndo.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/ShoppingCartItemActionInfo.tsx","webpack:///./ClientApp/shared/components/commerce/Quantity.tsx","webpack:///./ClientApp/shared/components/svg/LockSVG.tsx","webpack:///./ClientApp/features/commerce/recently-viewed/RecentlyViewedProduct.tsx","webpack:///./ClientApp/features/commerce/recently-viewed/useRecentlyViewedProducts.ts","webpack:///./ClientApp/features/commerce/recently-viewed/RecentlyViewedProducts.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/ShoppingCartPromoItem.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/ShoppingCartPromo.tsx","webpack:///./ClientApp/shared/edit/fields/FieldLabel.tsx","webpack:///./ClientApp/shared/edit/InlineAlert.tsx","webpack:///./ClientApp/shared/components/svg/XSVG.tsx","webpack:///./ClientApp/services/UserData.ts","webpack:///./ClientApp/shared/edit/fields/CheckboxInputField.tsx","webpack:///./ClientApp/shared/edit/fields/CheckBoxField.tsx","webpack:///./ClientApp/shared/edit/fields/DropdownField.tsx","webpack:///./ClientApp/shared/edit/fields/ValidationMessages.tsx","webpack:///./ClientApp/shared/edit/fields/StarRatingField.tsx","webpack:///./ClientApp/shared/edit/fields/TextAreaField.tsx","webpack:///./ClientApp/shared/edit/fields/InputField.tsx","webpack:///./ClientApp/shared/edit/fields/TextBoxField.tsx","webpack:///../Roc.SharedClientApp/types/model-status.ts","webpack:///./ClientApp/shared/util/AccountUrls.ts","webpack:///./ClientApp/features/commerce/shopping-cart/useShoppingCartLoader.ts","webpack:///./ClientApp/shared/hooks/useRocEventHandler.tsx","webpack:///./ClientApp/shared/util/ErrorBoundary.tsx","webpack:///./ClientApp/shared/polyfills/getAttributeNames.js","webpack:///./ClientApp/shared/util/ApplicationInit.tsx","webpack:///./ClientApp/features/my-account/routes.roc.tsx","webpack:///./ClientApp/shared/edit/OptionalFieldMarker.tsx","webpack:///./ClientApp/shared/hooks/useDelayedDisplay.tsx","webpack:///./ClientApp/shared/components/svg/CheckCircleSVG.tsx","webpack:///./ClientApp/shared/util/Misc.ts","webpack:///./ClientApp/features/setup/recaptcha.ts","webpack:///./ClientApp/features/commerce/shopping-cart/types.ts","webpack:///./ClientApp/shared/util/events/rocEventUtils.ts","webpack:///./ClientApp/shared/components/hawksearch/components/svg/DashCircleSVG.tsx","webpack:///./ClientApp/shared/components/svg/CircleExclamationSVG.tsx","webpack:///./ClientApp/shared/components/commerce/ProductPricing.tsx","webpack:///./ClientApp/shared/components/CircleButton.tsx","webpack:///./ClientApp/shared/components/svg/StarEmptySVG.tsx","webpack:///./ClientApp/shared/components/svg/StarSVG.tsx","webpack:///./ClientApp/shared/components/star-rating/StarRating.tsx","webpack:///./ClientApp/shared/components/star-rating/useStarRating.ts","webpack:///./ClientApp/shared/components/svg/PencilSVG.tsx","webpack:///./ClientApp/shared/components/svg/CheckSVG.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/ShoppingCartTitle.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/EditableShoppingCartTitle.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/UserSavedProduct.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/SavedProductsListing.tsx","webpack:///./ClientApp/shared/components/svg/PhoneSVG.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/ShoppingCartHelp.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/ShoppingCartItem.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/ShoppingCartOptions.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/ShoppingCartSummaryItem.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/ShoppingCartSummary.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/ShoppingCart.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/index.tsx","webpack:///./ClientApp/services/ServerData.ts","webpack:///./ClientApp/shared/hooks/useLoader.ts","webpack:///./ClientApp/shared/components/svg/FolderSVG.tsx","webpack:///./ClientApp/shared/components/svg/GarbageCanCircleSVG.tsx","webpack:///./ClientApp/shared/components/StatusDisplay.tsx","webpack:///./ClientApp/shared/assets/types.ts","webpack:///../Roc.SharedClientApp/types/commerce/display-price.ts","webpack:///./ClientApp/shared/hooks/useInterval.tsx","webpack:///./ClientApp/shared/hooks/useReCaptchaToken.tsx","webpack:///./ClientApp/shared/hooks/useRocReCaptchaToken.tsx","webpack:///./ClientApp/shared/hooks/useBaseAxiosFormSubmitter.ts","webpack:///./ClientApp/shared/hooks/useBaseAxiosSubmitter.ts","webpack:///./ClientApp/util/StringUtil.ts","webpack:///./ClientApp/shared/edit/RocForm.tsx","webpack:///./ClientApp/shared/components/Modal.tsx","webpack:///./ClientApp/features/commerce/product-details/types.ts","webpack:///./ClientApp/shared/components/svg/LeftChevronSVG.tsx","webpack:///./ClientApp/styles/node-modules/react-toggle/style.css?5a6e","webpack:///./ClientApp/styles/node-modules/react-toggle/style.css","webpack:///./ClientApp/features/commerce/pricing/pricing-result.ts"],"names":["LocalizerResources","isAlreadyLogged","initializeLocalizerResources","windowWithResources","window","__ROC_LOCALIZER_RESOURCES__","Array","isArray","forEach","obj","Object","keys","key","Localizer","replaceStrings","length","console","warn","resource","replace","match","index","LocalizedSpan","props","resourceKey","args","localizedString","data-testid","toKebabCase","dangerouslySetInnerHTML","__html","DownChevronSVG","className","rest","viewBox","classnames","focusable","aria-hidden","d","UpChevronSVG","OrderMessageAction","OrderMessages","orderMessages","actions","messages","filter","orderMessage","includes","messageAction","headerText","some","m","RedirectToCart","PaymentError","map","message","LazyImage","placeholderImg","src","alt","backgroundImg","delay","inactiveClassName","loadedClassName","useInViewOnce","threshold","ref","viewed","useState","loadedClassDisplayed","setLoadedClassDisplayed","useEffect","setTimeout","imageSrc","classes","style","backgroundImage","CustomEvent","event","params","bubbles","cancelable","detail","undefined","evt","document","createEvent","initCustomEvent","prototype","Event","RightChevronSVG","makeIterator","options","inViewHookResponse","useInView","setViewed","inView","newResponse","Symbol","iterator","api","content","__esModule","default","module","i","exports","locals","partialDataCache","partialProductsDataCache","getPartialProductData","cacheKey","id","missingKeys","sort","join","additionalParams","name","paramValue","Promise","resolve","AxiosHelper","get","response","data","getBulkPartialProductsData","productIds","post","productTableCacheData","getProductsForTable","groupdProductId","formatShapeId","groupProductId","___CSS_LOADER_API_IMPORT___","push","QuestionMarkCircleSVG","stroke","strokeWidth","fill","fillRule","transform","FileSVG","ProductSelectionsList","selections","classNamePrefix","parentPrefixClass","itemPrefixClass","labelPrefixClass","valuePrefixClass","sel","toUpperCase","selection","parentClass","label","PlayMediaSVG","FilePDFSVG","FileWithTextSVG","FileWordDocSVG","FileExcelSVG","AssetIcon","asset","assetIconClasses","assetType","AssetType","Media","YouTube","color","Document","assetUrl","split","pop","DownloadSVG","AssetDownloadIcon","downloadIconClasses","ExternalMediaIFrame","embeddedUrl","title","frameBorder","allow","allowFullScreen","EnlargeSVG","LazyDialog","React","lazy","then","Dialog","ProductImageModal","isOpen","closeModal","children","Suspense","fallback","Spinner","onDismiss","aria-label","as","onClick","type","XSVG","LazyMediaQuery","productAssetPlaceholder","altText","sortOrder","thumbnailUrl","mainImageUrl","enlargedImageUrl","Image","compareAssets","a","b","ProductAssets","mainAsset","setMainAsset","altAssets","setAltAssets","isImageSliderModalOpen","setIsImageSliderModalOpen","carousel","useRef","nodes","Map","scrollCarousel","up","from","values","current","item","node","innerWidth","scrollBy","clientHeight","smoothscroll","polyfill","assets","newMainAsset","find","initialThumbnails","initAltAssets","assetScroller","maxWidth","LeftChevronSVG","minWidth","altAsset","c","set","preventDefault","href","download","mainImageContent","lg","md","sm","light","waitMs","align","block","parentCentered","useDelayedDisplay","spinner","ShoppingCartContext","createContext","useShoppingCartContext","shoppingCartContext","useContext","Error","useShoppingCart","useShoppingCartParams","order","setOrder","savedProducts","setSavedProducts","setCartSummary","setOrderMessages","updatingOrderItemId","setUpdatingOrderItemId","orderItemBeingRemovedId","setOrderItemBeingRemovedId","cartTotalItemCount","setCartTotalItemCount","updatingSavedProductId","setUpdatingSavedProductId","updatingSavedProductPricingLineId","setUpdatingSavedProductPricingLineId","savedProductBeingRemovedId","setSavedProductBeingRemovedId","savedProductBeingRemovedPricingLineId","setSavedProductBeingRemovedPricingLineId","storedForUndoItem","setStoredForUndoItem","storedForUndoItemIndex","setStoredForUndoItemIndex","lastMoveStatus","setLastMoveStatus","isUndoClicked","isUndoClickedState","setIsUndoClickedState","error","setError","errorMessage","setErrorMessage","errorType","setErrorType","orderIsUpdating","clearUndoState","dispatchAddToCartEvent","result","dispatchRocEvent","items","productId","adjustedQuantity","price","snapshotSalePrice","snapshotBasePrice","sku","currency","snapshotCurrencyISO","productGroupId","updateCartState","cart","cartSummary","updateOrderMessages","itemsCount","recipients","reduce","itemsQty","orderRecipient","recipientQty","orderItem","quantity","addToCart","itemId","productPricingLineId","savedProductsPageNumber","pagination","pageNumber","savedProductsPageSize","pageSize","axiosError","exceptionCode","bulkAddToCart","element","request","productInfo","processedItems","addAllFromListToCurrentCart","shoppingListId","displayedItemsCount","shoppingListProductIds","selectedShoppingListProductIds","addAllFromListToNewCart","moveItemToSaved","itemToMove","product","pricingLine","recipient","recipientId","itemIndex","indexOf","MoveStatus","MovedToSaved","changeOrderItemQuantity","itemToUpdate","newQuantity","removeOrderItem","itemToRemove","RemovedFromCart","addToSavedProducts","itemToAdd","moveSavedProductToCart","productToMoveId","productName","results","savedProductIndex","findIndex","addToOrderResult","lastMovedItem","MovedToCart","removeSavedProduct","productToRemoveId","productToRemoveName","savedProduct","delete","toString","orderItemFromSaved","totalPrice","unitPrice","snapshotMinimumOrderQuantity","RemovedFromSaved","handleUndo","state","actor","updateOrder","newCart","ListboxInput","ListboxButton","ListboxPopover","ListboxList","ListboxOption","FauxDropdown","lists","accessibleValue","value","activeValue","defaultText","defaultValueId","testId","size","onChange","aria-labelledby","isExpanded","arrow","portal","list","listIndex","Fragment","option","text","KeepOrDiscardCart","cartName","orderCode","setCartName","htmlFor","e","target","switchCart","isSwitching","selectedOrderCode","SavedCarts","setOrderCode","orderStatus","setOrderStatus","setSelectedOrderCode","savedCarts","setSavedCarts","modalOpen","setModalOpen","deleteModalOpen","setDeleteModalOpen","isLoading","setIsLoading","isUserSignedIn","setIsUserSignedIn","setIsSwitching","useSavedShoppingCarts","useSavedShoppingCart","switchOrUpdateCart","getSavedShoppingCarts","getSavedCarts","updateCurrentCartName","useRocEventHandler","OrderStatus","New","Saved","saveCurrentCart","deleteCart","returnCartSummary","savedCartsList","savedCart","itemCount","lastModifiedDate","savedCartsOptionsList","InlineAlert","cartId","location","MY_ACCOUNT_LOGIN_URL","encodeURIComponent","Modal","renderTitle","titleIcon","CheckCircleSVG","renderActions","axios","create","defaults","headers","common","interceptors","use","config","method","toLowerCase","getCsrfToken","csrfToken","RequestVerificationToken","addUnauthorizedAccessInterceptor","history","status","AccountUrls","Login","pathname","reject","FieldInputErrorWrapper","hideIcon","inline","meta","useField","invalid","submitError","dirtySinceLastSubmit","submitting","touched","VisuallyHiddenAnnouncement","alert","setAlert","mainRef","setMainRef","Provider","role","aria-live","aria-atomic","ChangeConfirmationWithUndo","itemName","itemUrl","onUndo","messageResourceKey","disabled","ShoppingCartItemActionInfo","groupUrl","url","Quantity","initialQuantity","updateQuantity","MAX_NUMBER_FOR_DROPDOWN","ServerData","MaxNumberForQuantityDropdown","currentQuantity","setCurrentQuantity","showDropDown","setShowDropDown","isEditingQuantity","setIsEditingQuantity","n","handleItemQuantityUpdate","Number","parseInt","autoComplete","changeEvent","isNaN","Infinity","onKeyDown","autoFocus","minimumOrderQuantity","LockSVG","RecentlyViewedProduct","defaultAsset","mainImage","customUrl","summary","line","displayPricing","GetPricingLine","displayPrice","GetPriceForMinimumAvailableQuantity","prices","useTinySliderLazyLoading","data-src","ProductPricing","sparseProductDetailsStateKeys","repository","context","stateStr","localStorage","getItem","this","keyName","JSON","parse","timestamp","Date","valueOf","removeItem","products","filterOutInvalid","getAllMayIncludeInvalid","validProducts","setAll","now","timeSpan","MinimumTimeBeforeRecentlyViewedProductsAreValidated","outsideTimeSpan","p","lastViewed","withinTimeSpan","validProductIds","validOutsideTimeSpan","concat","setItem","stringify","RecentlyViewedProducts","recentlyViewedProducts","currentProduct","active","setRecentlyViewedProducts","getProductStateAsync","productState","recentlyViewedProduct","getAllValidOnly","recentlyViewedProductDtos","currentProductDto","pricingLines","currentProductIndex","splice","groupId","unshift","groupIndex","groupProducts","currentGroupDto","slice","useRecentlyViewedProducts","getInitialProductDetailsState","currentInstanceId","uuid","sliderRef","displaytitle","tnsPromise","tns","oneItemClass","twoItemClass","threeItemClass","fiveItemClass","executeResizeDebounced","debounce","initializeSlider","destroy","currentSliderDiv","getElementById","getTinySliderInstance","container","itemsToShow","slideBy","controls","mouseDrag","gutter","lazyload","loop","trackElement","parentElement","parentRocProductList","closest","containerWidth","offsetWidth","classList","remove","add","handleResize","addEventListener","removeEventListener","ShoppingCartPromoItem","orderPromotion","couponRemovedCallback","isRemoveSpinnerDisplayed","setIsRemoveSpinnerDisplayed","removeCouponSubmitter","useBaseAxiosSubmitter","invalidateToken","couponCode","CircleButton","submit","orderId","orderPromotionId","ShoppingCartPromo","cartIsUpdating","couponAddedCallback","isShown","setIsShown","promotionMessage","setPromotionMessage","redeemCouponSubmitter","useAxiosFormSubmitter","RocForm","onSubmit","handleSubmit","initialValues","render","input","placeholder","CircleExclamationSVG","promotions","FieldLabel","isRequired","trim","defaultProps","theme","isTitleOnOwnRow","isCollapsed","onCollapse","isAxiosError","userDataPromise","getUserData","getUserDataNoCache","userData","requestToken","CheckboxInputField","checked","readOnly","step","defaultValue","dirty","defaultChecked","aria-describedby","CheckBoxField","afterSubmit","allowNull","beforeSubmit","formatOnBlur","initialValue","isEqual","subscription","DropdownField","addSelectOption","validateFields","onFocus","onBlur","getErrorArray","errorOrSubmitError","errors","ValidationMessages","StarRatingField","maxRating","OptionalFieldMarker","StarRating","readonly","TextAreaField","rows","validate","component","format","InputField","forwardRef","TextBoxField","ModelStatus","BaseUrl","ACCOUNT_URL_BASE","ACCOUNT_LOGIN_URL","Login2fa","ACCOUNT_LOGIN_WITH_2FA_URL","Register","ACCOUNT_REGISTER_URL","ForgotPassword","ACCOUNT_FORGOT_PASSWORD_URL","LoginWithRecoveryCode","ACCOUNT_LOGIN_WITH_RECOVERY_CODE_URL","Logout","ACCOUNT_LOGOUT_URL","OrganizationReview","ACCOUNT_ORGANIZATION_REVIEW_URL","OrganizationSelector","ACCOUNT_ORGANIZATION_SELECTOR_URL","useShoppingCartLoader","isLoaded","setIsLoaded","initialSavedProductsPageNumber","initialSavedProductsPageSize","reloadCart","cancelToken","token","Axios","isCancel","goToSavedProductsPage","newPageNumber","CancelToken","source","cancel","goToNextSavedProductsPage","totalPages","goToPreviousSavedProductsPage","setSavedProductsPageSize","newPageSize","eventType","dispatchEvent","eventHandler","deps","removeHandlerCallback","addRocEventHandler","ErrorBoundary","setState","renderError","Component","renderProps","Element","getAttributeNames","attributes","getDataPropsFromAttributes","s","startsWith","attributeName","toCamelCase","substring","getAttribute","initReactApp","getReactElement","elementId","ReactDOM","initReactAppByAttribute","attribute","elements","querySelectorAll","MY_ACCOUNT_PATH_PREFIX","MY_ACCOUNT_AUTHENTICATOR_URL","MY_ACCOUNT_GENERATE_RECOVERY_CODES_URL","MY_ACCOUNT_CONFIGURE_AUTHENTICATOR_URL","MY_ACCOUNT_WALLET_URL","MY_ACCOUNT_WALLET_CREATE_URL","MY_ACCOUNT_ADDRESS_BOOK_URL","MY_ACCOUNT_ADDRESS_BOOK_CREATE_URL","MY_ACCOUNT_ADDRESS_BOOK_EDIT_URL","MY_ACCOUNT_SETTINGS_URL","SettingsComponent","rocRoutes","exact","path","memo","display","setDisplay","timeout","clearTimeout","ms","sleep","handleAxiosErrorWithValidation","validationErrorCallback","genericErrorCallback","globalErrors","errorsWithModifiedArrayIndex","acc","newValidationState","unflatten","FORM_ERROR","getQueryParam","paramName","decodeParam","urlParams","URLSearchParams","search","decodeURIComponent","reCaptchaCallbackPromise","setupReCaptcha","windowWithReCaptchaCallbacks","onReCaptchaLoadCallback","PaymentTypeEnum","CreditCardType","handler","DashCircleSVG","class","renderResult","css","priceClass","base","normalPrice","crossedOutPrice","highlightedPrice","GetCssClasses","displayRule","PriceDisplayRule","Missing","Normal","basePriceClass","salePrice","VariantPriceComponent","basePrice","renderNormalPrice","AmbiguousRange","FormatAmbiguousPriceSpan","unitName","unit","renderAmbiguousPrice","FormatPrice","FormatPriceSpan","priceRange","to","icon","otherProps","StarEmptySVG","StarSVG","ratingStars","setRatingStars","ratingHovered","setRatingHovered","newState","isFull","isPending","isHighlighted","isChecked","ratingValue","useStarRating","onInputChange","currentTarget","modifierClasses","onMouseEnter","onMouseLeave","PencilSVG","CheckSVG","ShoppingCartTitle","EditableShoppingCartTitle","showForm","setShowForm","userIsSignedIn","setUserIsSignedIn","inputRef","buttonRef","wrapperRef","escFunction","useCallback","keyCode","showSelectableTitle","handleClickOutside","contains","focus","isSignedIn","submitForm","submitSucceeded","UserSavedProduct","updatingSavedProductUnitOfMeasureId","savedProductBeingRemovedUnitOfMeasureId","_","SavedProductsListing","productIndex","PhoneSVG","ShoppingCartHelp","supportPhoneNumber","ShoppingCartItem","VisuallyHiddenAnnouncementContext","ShoppingCartOptions","ShoppingCartSummaryItem","rawValue","ShoppingCartSummary","baseSubtotal","shipping","tax","discount","ShoppingCart","cartPageLoadedEventDispatched","setCartPageLoadedEventDispatched","UseShoppingCartResult","selectClassName","total","recipientIndex","windowWithServerData","__ROC_SERVER_DATA__","initializeServerData","useLoader","loading","setLoading","setResponse","FolderSVG","GarbageCanCircleSVG","StatusDisplay","Published","Inactive","Deleted","Draft","Archived","useInterval","callback","enabled","savedCallback","intervalId","setInterval","clearInterval","ReCaptchaKeyWarning","useReCaptchaToken","reCaptchaKey","action","initialEnabled","reCaptchaWindow","tokenPromise","tokenPromiseIsResolved","initPromise","setEnabled","useLayoutEffect","grecaptcha","ready","getToken","force","execute","useRocReCaptchaToken","ReCaptchaV3Key","isReCaptchaEnabled","IsReCaptchaEnabled","useRocFormSubmitter","axiosParams","reCaptchaActionName","csrfEnabled","stateful","invalidateTokenOnSuccess","useBaseAxiosFormSubmitter","responseCallback","submitterCallback","formValidationState","submitter","formValues","submitResult","submitted","responseData","getRecaptchaToken","payload","promises","all","reCaptchaToken","serverResponse","toLocaleLowerCase","word","stripHtml","html","tmp","createElement","innerHTML","textContent","innerText","trimString","focusOnError","createDecorator","debug","destroyOnUnregister","form","initialValuesEqual","keepDirtyOnReinitialize","validateOnBlur","decorators","mutators","LazyDialogContent","DialogContent","LazyDialogOverlay","DialogOverlay","hideCloseButton","renderSubtitle","headerDivider","bypassFocusLock","subTitle","innerModal","ariaLabel","dangerouslyBypassFocusLock","__ROC_COMMERCE_PRODUCT_DETAILS__","ProductType","AddToCartExceptionCode","ParseQuantityRange","quantityRange","GetPriceForQuantity","min","max","pricingResult","pricingLineId","isDefault","qtyRange","startingQty","range","qtyRangeInfo","GetMinimumOrderQuantity","moq","GetMinimumOrderQuantityForPricingLine","productPricing","selectedPricingLineId","selectedPricingLine","Math"],"mappings":"6/BAwJA,IAAMA,EAAwC,GAKxCC,EAA2C,GAKjD,SAASC,IACR,IAAMC,EAAsBC,OAG3BD,GACAA,EAAoBE,6BACpBC,MAAMC,QAAQJ,EAAoBE,8BAElCF,EAAoBE,4BAA4BG,SAAQ,SAACC,GACxD,cAAkBC,OAAOC,KAAKF,GAA9B,eAAoC,CAA/B,IAAMG,EAAG,KACbZ,EAAmBY,GAAOH,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wB,MAAM,sDAUV,SAAS8wB,EAA2BhuB,GAC1C,IAAIiuB,EAAqB,KACzB,IAAK,IAAMZ,KAAiBrtB,EAAMmP,OAAQ,KAClCoe,EADkC,EAC3BH,EAAmBC,GADQ,OAE9B,MAAPY,GAAeV,EAAMU,KACxBA,EAAMV,GAGR,OAAOU,EAMD,SAASC,EACfC,EACAruB,EACAsuB,GACC,MACD,IAAKtuB,IAAcquB,IAAmBC,EACrC,OAAO,EAER,IAAMC,EAAsBrf,EAAemf,EAAgBruB,EAAWsuB,GACtE,IAAKC,EACJ,OAAO,EAGR,IAAM9f,EAAoB,UAAGyf,EAAwBK,UAA3B,QAAmD,EAE7E,OAAOC,KAAKd,IAAI,EAAGjf,M","file":"shopping-cart.js","sourcesContent":["import { AddressResourceKeys } from 'features/address-book/resources';\r\nimport { ContactFormResourceKeys } from 'features/contact-form/resources';\r\nimport { CreatePasswordResourceKeys } from 'features/create-password/resources';\r\nimport { LoginWith2faResourceKeys } from 'features/login-with-2fa/resources';\r\nimport { LoginWithRecoveryCodeResourceKeys } from 'features/login-with-recovery-code/resources';\r\nimport { LoginResourceKeys } from 'features/login/resources';\r\nimport { MyAccountResourceKeys } from 'features/my-account/resources';\r\nimport { ResetPasswordResourceKeys } from 'features/reset-password/resources';\r\nimport { SubmitQuestionResourceKeys } from 'features/submit-question/resources';\r\nimport * as React from 'react';\r\nimport { toKebabCase } from 'util/StringUtil';\r\n\r\n// #region Commerce\r\nimport { CommerceResourceKeys } from 'features/commerce/CommerceResourceKeys';\r\n// #endregion\r\n\r\n// #region TapeCase Customization\r\nimport { SubmitQuoteResourceKeys } from 'features/submit-quote/resources';\r\nimport { TapeCaseRegistrationResourceKeys } from 'features/register-tapecase/resources';\r\nimport { CareersFormResourceKeys } from 'features/careers-form/resources';\r\nimport { FileUploadResourceKeys } from 'features/file-upload/resources';\r\n// #endregion\r\n\r\n/**\r\n * Type that will hold all the global localization keys\r\n */\r\ntype LocalizerGlobalResourceKeys =\r\n\t| 'Success'\r\n\t| 'OfTotalPages'\r\n\t| 'Cancel'\r\n\t| 'Confirm'\r\n\t| 'FirstName'\r\n\t| 'LastName'\r\n\t| 'Email'\r\n\t| 'Username'\r\n\t| 'Amount'\r\n\t| 'NameOnCard'\r\n\t| 'CardNumber'\r\n\t| 'ExpDate'\r\n\t| 'ExpMonth'\r\n\t| 'ExpYear'\r\n\t| 'Expires'\r\n\t| 'Expired'\r\n\t| 'SecurityCode'\r\n\t| 'Submit'\r\n\t| 'Save'\r\n\t| 'ZipCode'\r\n\t| 'Remove'\r\n\t| 'Removed'\r\n\t| 'Update'\r\n\t| 'Undo'\r\n\t| 'Cancel'\r\n\t| 'Enter'\r\n\t| 'Close'\r\n\t| 'SortBy'\r\n\t| 'PleaseWait'\r\n\t| 'Unknown'\r\n\t| 'Yes'\r\n\t| 'No'\r\n\t| 'Delete'\r\n\t| 'Update'\r\n\t| 'SaveAndContinueButtonText'\r\n\t| 'SaveAndContinue'\r\n\t| 'Continue'\r\n\t| 'SaveErrorMessage'\r\n\t| 'Edit'\r\n\t| 'ErrorMessageGenericTitle'\r\n\t| 'CheckEnteredValues'\r\n\t| 'ErrorMessageForbidden'\r\n\t| 'ErrorMessageNetwork'\r\n\t| 'ErrorOccurredSubmittingTheForm'\r\n\t| 'UnexpectedErrorOccurred'\r\n\t| 'Login'\r\n\t| 'ReturnToShipping'\r\n\t| 'BreadcrumbsLabel'\r\n\t| 'Other'\r\n\t| 'RememberMe'\r\n\t| 'ForgotYourPassword'\r\n\t| 'RegisterNewUserLinkText'\r\n\t| 'LoginPageTitleText'\r\n\t| 'ForgotPasswordPageTitle'\r\n\t| 'ForgotPasswordConfirmationPageTitle'\r\n\t| 'ForgotPasswordConfirmation'\r\n\t| 'Optional'\r\n\t| 'SearchBoxPlaceholder'\r\n\t| 'XOutOfYStars'\r\n\t| 'XToYOfZ'\r\n\t| 'ModalLabel'\r\n\t| 'RequiredFields'\r\n\t| 'Status'\r\n\t| 'Version'\r\n\t| 'CreatedOn'\r\n\t| 'CreatedBy'\r\n\t| 'ModifiedOn'\r\n\t| 'ModifiedBy'\r\n\t| 'OpenStatusInformation'\r\n\t| 'CloseStatusInformation'\r\n\t| 'SearchFilter'\r\n\t| 'Pagination'\r\n\t| 'Previous'\r\n\t| 'Next'\r\n\t| 'ClearFilter';\r\n\r\n/**\r\n * Type that will hold all the localization keys\r\n */\r\nexport type LocalizerResourceKey =\r\n\t| LocalizerGlobalResourceKeys\r\n\t| LoginResourceKeys\r\n\t| ContactFormResourceKeys\r\n\t// #region Commerce\r\n\t| CommerceResourceKeys\r\n\t// #endregion\r\n\t| ResetPasswordResourceKeys\r\n\t| CreatePasswordResourceKeys\r\n\t| SubmitQuestionResourceKeys\r\n\t| ResetPasswordResourceKeys\r\n\t| CreatePasswordResourceKeys\r\n\t| MyAccountResourceKeys\r\n\t| LoginWith2faResourceKeys\r\n\t| LoginWithRecoveryCodeResourceKeys\r\n\t| AddressResourceKeys\r\n\t// #region TapeCase Customization\r\n\t| SubmitQuoteResourceKeys\r\n\t| TapeCaseRegistrationResourceKeys\r\n\t| CareersFormResourceKeys\r\n\t| FileUploadResourceKeys;\r\n// #endregion\r\n\r\n/**\r\n * Interface for the resources\r\n *\r\n * @export\r\n * @interface LocalizerResource\r\n */\r\ninterface LocalizerResource {\r\n\t[id: string]: string;\r\n}\r\n\r\n/**\r\n * Extends Window with a property that will hold the localizer resources\r\n *\r\n * @interface WindowWithResources\r\n * @extends {Window}\r\n */\r\nexport interface WindowWithResources extends Window {\r\n\t__ROC_LOCALIZER_RESOURCES__?: LocalizerResource[];\r\n}\r\n\r\n/**\r\n * Main object that will hold all the localized resources\r\n */\r\nconst LocalizerResources: LocalizerResource = {};\r\n\r\n/**\r\n * To prevent redundant logging\r\n */\r\nconst isAlreadyLogged: Record = {};\r\n\r\n/**\r\n * Initializer function that will populate the main localized resources object\r\n */\r\nfunction initializeLocalizerResources() {\r\n\tconst windowWithResources = window as WindowWithResources;\r\n\r\n\tif (\r\n\t\twindowWithResources &&\r\n\t\twindowWithResources.__ROC_LOCALIZER_RESOURCES__ &&\r\n\t\tArray.isArray(windowWithResources.__ROC_LOCALIZER_RESOURCES__)\r\n\t) {\r\n\t\twindowWithResources.__ROC_LOCALIZER_RESOURCES__.forEach((obj) => {\r\n\t\t\tfor (const key of Object.keys(obj)) {\r\n\t\t\t\tLocalizerResources[key] = obj[key];\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\n/**\r\n * Function that can be used to load the localized strings with support to parameter replacements\r\n *\r\n * @export\r\n * @param {string} key\r\n * @param {...string[]} replaceStrings\r\n * @returns\r\n */\r\nexport function Localizer(\r\n\tkey: TResourceKey,\r\n\t...replaceStrings: string[]\r\n) {\r\n\tif (Object.keys(LocalizerResources).length === 0) {\r\n\t\tinitializeLocalizerResources();\r\n\t}\r\n\r\n\tif (!LocalizerResources || !LocalizerResources[key]) {\r\n\t\t// if running in a test environment, just skip any warnings.\r\n\t\tif (process.env.NODE_ENV !== 'test') {\r\n\t\t\tif (!isAlreadyLogged[key]) {\r\n\t\t\t\tconsole.warn(key, 'Localizer Resource not found. Key will be used instead.');\r\n\t\t\t\tisAlreadyLogged[key] = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn key;\r\n\t}\r\n\r\n\tconst resource = LocalizerResources[key];\r\n\r\n\tif (!replaceStrings) {\r\n\t\treturn resource;\r\n\t}\r\n\r\n\treturn resource.replace(/{(\\d+)}/g, (match: string, index: number) => {\r\n\t\treturn replaceStrings[index] ? replaceStrings[index] : '';\r\n\t});\r\n}\r\n\r\n/**\r\n * Interface for the LocalizedSpan component\r\n *\r\n * @interface LocalizedSpanProps\r\n */\r\ninterface LocalizedSpanProps {\r\n\tresourceKey: LocalizerResourceKey;\r\n\targs?: string[];\r\n}\r\n\r\n/**\r\n * Component responsible for the initialization of the react app\r\n */\r\nexport function LocalizedSpan(props: LocalizedSpanProps) {\r\n\tconst { resourceKey, args = [] } = props;\r\n\tconst localizedString = Localizer(resourceKey, ...args);\r\n\r\n\treturn (\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Up chevron SVG\r\n *\r\n * @returns\r\n */\r\nfunction DownChevronSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default DownChevronSVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Up chevron SVG\r\n *\r\n * @returns\r\n */\r\nfunction UpChevronSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default UpChevronSVG;\r\n","import React from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\n\r\n/**\r\n * An alert sent to users regarding products or promotions\r\n */\r\nexport interface OrderMessage {\r\n\tmessage: string;\r\n\tmessageAction: OrderMessageAction;\r\n}\r\n\r\n/**\r\n * The level of action to be taken with an order message\r\n */\r\nexport enum OrderMessageAction {\r\n\t/** Display a generic info message */\r\n\tInfo = 'Info',\r\n\r\n\t/** Display a generic warning message */\r\n\tWarning = 'Warning',\r\n\r\n\t/** Display a generic error message */\r\n\tError = 'Error',\r\n\r\n\t/** Display a message and also ask the user to redirect to the cart page */\r\n\tRedirectToCart = 'RedirectToCart',\r\n\r\n\t/** Display an error message related to a failure which occurred during payment processing */\r\n\tPaymentError = 'PaymentError',\r\n}\r\n\r\ninterface OrderMessagesProps {\r\n\torderMessages?: OrderMessage[];\r\n\r\n\t/** Optional list of the actions which should be displayed. If this is undefined, all actions will be displayed. */\r\n\tactions?: OrderMessageAction[];\r\n}\r\n\r\n/**\r\n * Body of the order messages modal which will notify the customer if there were issues with their order including the following states:\r\n * 1- Redirect to Cart\r\n * 2- Payment Failure\r\n * 3- Generic Update Order Errors\r\n */\r\nfunction OrderMessages(props: OrderMessagesProps) {\r\n\tconst { orderMessages, actions } = props;\r\n\r\n\t// Filter by action if actions were passed in as a prop\r\n\tconst messages =\r\n\t\tactions == null\r\n\t\t\t? orderMessages\r\n\t\t\t: orderMessages?.filter((orderMessage) => actions?.includes(orderMessage.messageAction));\r\n\r\n\t// Component is omitted if actions filtered out all the messages or there were none to begin with\r\n\tif (messages == null || messages.length === 0) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tlet headerText = Localizer('GenericOrderMessageHeader');\r\n\r\n\t// Update header to be more specific if any of the message actions warrant it\r\n\tif (messages.some((m) => m.messageAction === OrderMessageAction.RedirectToCart)) {\r\n\t\t// Prioritize RedirectToCart over PaymentError as a RedirectToCart message will also change the modal's button\r\n\t\t// to be 'Review Cart' and send the user to the cart page\r\n\t\theaderText = Localizer('RedirectToCartOrderMessageHeader');\r\n\t} else if (messages.some((m) => m.messageAction === OrderMessageAction.PaymentError)) {\r\n\t\theaderText = Localizer('PaymentFailureOrderMessageHeader');\r\n\t}\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t{headerText}\r\n\t\t\t\t
    \r\n\t\t\t\t\t{messages.map((orderMessage, index) => (\r\n\t\t\t\t\t\t
  • \r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
  • \r\n\t\t\t\t\t))}\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n}\r\n\r\nexport default OrderMessages;\r\n","import classnames from 'classnames';\r\nimport React, { ImgHTMLAttributes, useEffect, useState } from 'react';\r\nimport { useInViewOnce } from 'shared/hooks/useInViewOnce';\r\n\r\ninterface LazyImageProps extends ImgHTMLAttributes {\r\n\tplaceholderImg?: string;\r\n\tbackgroundImg?: boolean;\r\n\tclassName?: string;\r\n\tinactiveClassName?: string;\r\n\tloadedClassName?: string;\r\n\tdelay?: number;\r\n\talt: string;\r\n\tsrc: string;\r\n}\r\n\r\n/**\r\n * Component that will render an tag that will have its source image lazily loaded only once\r\n * the element is visible in the viewport.\r\n * @param props\r\n */\r\nexport default function LazyImage({\r\n\tplaceholderImg = '/images/placeholder/placeholder-image.png',\r\n\tsrc,\r\n\talt,\r\n\tbackgroundImg = false,\r\n\tdelay = 0,\r\n\tclassName,\r\n\tinactiveClassName = 'roc-lazy-image--inactive',\r\n\tloadedClassName = 'roc-lazy-image--loaded',\r\n\t...rest\r\n}: LazyImageProps) {\r\n\tconst [ref, viewed] = useInViewOnce({\r\n\t\tthreshold: 0,\r\n\t});\r\n\r\n\tconst [loadedClassDisplayed, setLoadedClassDisplayed] = useState(false);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (viewed) {\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tsetLoadedClassDisplayed(true);\r\n\t\t\t}, delay);\r\n\t\t}\r\n\t}, [viewed, delay]);\r\n\r\n\tconst imageSrc = viewed ? src : placeholderImg;\r\n\r\n\tconst classes = classnames(className, {\r\n\t\t[inactiveClassName]: !viewed,\r\n\t\t[loadedClassName]: loadedClassDisplayed,\r\n\t});\r\n\r\n\tif (backgroundImg) {\r\n\t\treturn
;\r\n\t} else {\r\n\t\treturn {alt};\r\n\t}\r\n}\r\n","// source: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent\r\n(function () {\r\n\tif (typeof window.CustomEvent === 'function') {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfunction CustomEvent(event, params) {\r\n\t\tparams = params || { bubbles: false, cancelable: false, detail: undefined };\r\n\t\t// eslint-disable-next-line\r\n\t\tvar evt = document.createEvent('CustomEvent');\r\n\t\tevt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\r\n\t\treturn evt;\r\n\t}\r\n\r\n\tCustomEvent.prototype = window.Event.prototype;\r\n\r\n\twindow.CustomEvent = CustomEvent;\r\n})();\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Right chevron SVG\r\n *\r\n * @returns\r\n */\r\nfunction RightChevronSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default RightChevronSVG;\r\n","import { useInView, IntersectionOptions, InViewHookResponse } from 'react-intersection-observer';\r\nimport { useEffect, useState } from 'react';\r\n\r\n/**\r\n * Wrapper hook to useInView so that it only triggers once. Useful for lazy-loaded content that\r\n * doesn't need to change once it's out of view.\r\n */\r\nexport function useInViewOnce(options: IntersectionOptions = {}): InViewHookResponse {\r\n\tconst inViewHookResponse = useInView(options);\r\n\tconst [viewed, setViewed] = useState(false);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (inViewHookResponse.inView) {\r\n\t\t\tsetViewed(true);\r\n\t\t}\r\n\t}, [inViewHookResponse.inView]);\r\n\r\n\tconst newResponse: InViewHookResponse = {\r\n\t\t...inViewHookResponse,\r\n\t\tinView: viewed,\r\n\t\t[0]: inViewHookResponse[0],\r\n\t\t[1]: viewed,\r\n\t\t[2]: inViewHookResponse[2],\r\n\t};\r\n\r\n\tfunction* makeIterator() {\r\n\t\tyield newResponse[0];\r\n\t\tyield newResponse[1];\r\n\t\tyield newResponse[2];\r\n\t}\r\n\r\n\tnewResponse[Symbol.iterator] = makeIterator;\r\n\r\n\treturn newResponse;\r\n}\r\n","var api = require(\"!../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../../../../node_modules/css-loader/dist/cjs.js!./styles.css\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","import AxiosHelper from 'services/AxiosHelper';\r\nimport { BasePartialDataOptions } from 'shared/types';\r\nimport { DisplayPrice, VariantPrice } from '../../../../../Roc.SharedClientApp/types/commerce/display-price';\r\nimport { PricingLine } from '../../../../../Roc.SharedClientApp/types/commerce/pricing-result';\r\nimport { BaseBulkPartialProductsDataOptions, ProductDetailsState, ProductTableProductDetails } from './types';\r\n\r\nconst partialDataCache: { [index: string]: Partial } = {};\r\nconst partialProductsDataCache: { [index: string]: BulkProductsPartialDataResponse } = {};\r\n\r\nexport async function getPartialProductData(\r\n\toptions: BasePartialDataOptions,\r\n) {\r\n\tlet cacheKey = `${options.id}_${options.missingKeys.sort().join('_')}`;\r\n\r\n\t// include additional params in the cache key and preserve their order by param name\r\n\tconst additionalParams = options.additionalParams;\r\n\tif (additionalParams) {\r\n\t\tconst additionalKeys = Object.keys(additionalParams).sort();\r\n\t\tadditionalKeys.forEach((name) => {\r\n\t\t\tconst paramValue = additionalParams[name];\r\n\t\t\tif (paramValue) {\r\n\t\t\t\tcacheKey += `_${name}=${paramValue}`;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tif (partialDataCache[cacheKey]) {\r\n\t\treturn Promise.resolve(partialDataCache[cacheKey]);\r\n\t}\r\n\r\n\tconst response = await AxiosHelper.get>(`/ajax/products/${options.id}`, {\r\n\t\tparams: {\r\n\t\t\t...options.additionalParams,\r\n\t\t\tkeys: options.missingKeys.join(','),\r\n\t\t},\r\n\t});\r\n\r\n\tpartialDataCache[cacheKey] = response.data;\r\n\r\n\t// if the key is requested, always return the value as null. this is important\r\n\t// on the client undefined vs null can have different meanings\r\n\t// undefined means nothing has even tried to set it, the data is simply missing.\r\n\t// null means we tried to load something, but there's no value associated.\r\n\treturn Promise.resolve(response.data);\r\n}\r\n\r\n/**\r\n * Dictionary of bulk products data , key is product id\r\n */\r\nexport interface BulkProductsPartialDataResponse {\r\n\t[key: string]: Partial;\r\n}\r\n\r\n/**\r\n * Gets partial data for bulk products using the product ids and the missing keys\r\n */\r\nexport async function getBulkPartialProductsData(options: BaseBulkPartialProductsDataOptions) {\r\n\tconst cacheKey = `${options.productIds?.sort().join('_')}___${options.missingKeys.sort().join('_')}`;\r\n\tif (partialProductsDataCache[cacheKey]) {\r\n\t\treturn Promise.resolve(partialProductsDataCache[cacheKey]);\r\n\t}\r\n\r\n\tconst response = await AxiosHelper.post(`/ajax/products`, {\r\n\t\tproductIds: options.productIds,\r\n\t\tmissingKeys: options.missingKeys.join(','),\r\n\t});\r\n\r\n\tpartialProductsDataCache[cacheKey] = response.data;\r\n\r\n\t// if the key is requested, always return the value as null. this is important\r\n\t// on the client undefined vs null can have different meanings\r\n\t// undefined means nothing has even tried to set it, the data is simply missing.\r\n\t// null means we tried to load something, but there's no value associated.\r\n\treturn Promise.resolve(response.data);\r\n}\r\n\r\n//#region TapeCase\r\nconst productTableCacheData: { [index: string]: ProductTableProductDetails[] } = {};\r\nexport interface ProductsDisplayPricing {\r\n\t[key: string]: PricingLine>;\r\n}\r\n\r\nexport async function getProductsForTable(\r\n\tgroupdProductId: string,\r\n\tformatShapeId: string,\r\n): Promise {\r\n\tconst cacheKey = `${groupdProductId}___${formatShapeId == null ? 'default' : formatShapeId}`;\r\n\tif (productTableCacheData[cacheKey]) {\r\n\t\treturn Promise.resolve(productTableCacheData[cacheKey]);\r\n\t}\r\n\r\n\tconst response = await AxiosHelper.post(`/ajax/products/table`, {\r\n\t\tgroupProductId: groupdProductId,\r\n\t\tformatShapeId: formatShapeId,\r\n\t});\r\n\r\n\tproductTableCacheData[cacheKey] = response.data;\r\n\r\n\treturn Promise.resolve(response.data);\r\n}\r\n//#endregion\r\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"/* This code is subject to LICENSE in root of this repository */\\n\\n/* Used to detect in JavaScript if apps have loaded styles or not. */\\n:root {\\n --reach-dialog: 1;\\n}\\n\\n[data-reach-dialog-overlay] {\\n background: hsla(0, 0%, 0%, 0.33);\\n position: fixed;\\n top: 0;\\n right: 0;\\n bottom: 0;\\n left: 0;\\n overflow: auto;\\n}\\n\\n[data-reach-dialog-content] {\\n width: 50vw;\\n margin: 10vh auto;\\n background: white;\\n padding: 2rem;\\n outline: none;\\n}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Question Mark within a Circle SVG\r\n */\r\nfunction QuestionMarkCircleSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default QuestionMarkCircleSVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Generic file SVG\r\n */\r\nfunction FileSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default FileSVG;\r\n","import React from 'react';\r\nimport { SimpleSelectionDto } from '../product-details/types';\r\nimport classnames from 'classnames';\r\n\r\ninterface ProductAttributeListprops {\r\n\tselections?: SimpleSelectionDto[];\r\n\tclassNamePrefix?: string;\r\n}\r\n\r\nexport default function ProductSelectionsList(props: ProductAttributeListprops) {\r\n\tconst { selections, classNamePrefix = '' } = props;\r\n\r\n\tconst parentClass = 'roc-bare-table';\r\n\tconst parentPrefixClass = classNamePrefix + '-' + parentClass;\r\n\r\n\tconst itemClass = parentClass + '__item';\r\n\tconst itemPrefixClass = classNamePrefix + '-' + itemClass;\r\n\r\n\tconst labelClass = parentClass + '__label';\r\n\tconst labelPrefixClass = classNamePrefix + '-' + labelClass;\r\n\r\n\tconst valueClass = parentClass + '__value';\r\n\tconst valuePrefixClass = classNamePrefix + '-' + valueClass;\r\n\r\n\treturn (\r\n\t\t
    \r\n\t\t\t{selections !== undefined &&\r\n\t\t\t\tArray.isArray(selections) &&\r\n\t\t\t\tselections.length > 0 &&\r\n\t\t\t\t//#region Tapecase customization\r\n\t\t\t\tselections\r\n\t\t\t\t\t.filter((sel) => sel.name.toUpperCase() != 'SKU')\r\n\t\t\t\t\t.map((selection, i) => (\r\n\t\t\t\t\t\t//#end region\r\n\t\t\t\t\t\t
  • \r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{selection.name}:\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{selection.label}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
  • \r\n\t\t\t\t\t))}\r\n\t\t
\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Play Media Button SVG\r\n */\r\nfunction PlayMediaSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default PlayMediaSVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * PDF file SVG\r\n */\r\nfunction FilePDFSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default FilePDFSVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Text file SVG\r\n */\r\nfunction FileWithTextSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default FileWithTextSVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Word Document file SVG\r\n */\r\nfunction FileWordDocSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default FileWordDocSVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Excel file SVG\r\n */\r\nfunction FileExcelSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default FileExcelSVG;\r\n","import React from 'react';\r\nimport { Asset, AssetType } from './types';\r\nimport PlayMediaSVG from 'shared/components/svg/PlayMediaSVG';\r\nimport FilePDFSVG from 'shared/components/svg/FilePDFSVG';\r\nimport FileWithTextSVG from 'shared/components/svg/FileWithTextSVG';\r\nimport FileWordDocSVG from 'shared/components/svg/FileWordDocSVG';\r\nimport FileExcelSVG from 'shared/components/svg/FileExcelSVG';\r\nimport FileSVG from 'shared/components/svg/FileSVG';\r\nimport QuestionMarkCircleSVG from 'shared/components/svg/QuestionMarkCircleSVG';\r\n\r\ninterface AssetDownloadIconProps {\r\n\tasset: Asset;\r\n\tassetIconClasses?: string;\r\n}\r\n\r\n/**\r\n * Icon for an asset based on its file type.\r\n */\r\nexport default function AssetIcon(props: AssetDownloadIconProps) {\r\n\tconst { asset, assetIconClasses } = props;\r\n\r\n\tif (asset.assetType === AssetType.Media || asset.assetType === AssetType.YouTube) {\r\n\t\treturn ;\r\n\t} else if (asset.assetType === AssetType.Document) {\r\n\t\tconst fileExtension = asset.assetUrl.split('.').pop();\r\n\r\n\t\tswitch (fileExtension) {\r\n\t\t\tcase 'pdf':\r\n\t\t\t\treturn ;\r\n\t\t\tcase 'txt':\r\n\t\t\tcase 'html':\r\n\t\t\tcase 'htm':\r\n\t\t\tcase 'xml':\r\n\t\t\t\treturn ;\r\n\t\t\tcase 'docx':\r\n\t\t\tcase 'doc':\r\n\t\t\tcase 'docm':\r\n\t\t\tcase 'dot':\r\n\t\t\tcase 'dotm':\r\n\t\t\tcase 'dotx':\r\n\t\t\t\treturn ;\r\n\t\t\tcase 'csv':\r\n\t\t\tcase 'xls':\r\n\t\t\tcase 'xlsx':\r\n\t\t\tcase 'xlsb':\r\n\t\t\tcase 'xlsm':\r\n\t\t\tcase 'xlt':\r\n\t\t\tcase 'xltm':\r\n\t\t\tcase 'xltx':\r\n\t\t\tcase 'xlw':\r\n\t\t\t\treturn ;\r\n\t\t\tdefault:\r\n\t\t\t\treturn ;\r\n\t\t}\r\n\t} else {\r\n\t\treturn ;\r\n\t}\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Download SVG\r\n *\r\n * @returns\r\n */\r\nfunction DownloadSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default DownloadSVG;\r\n","import React from 'react';\r\nimport { Asset } from './types';\r\nimport AssetIcon from './AssetIcon';\r\nimport DownloadSVG from 'shared/components/svg/DownloadSVG';\r\n\r\ninterface AssetDownloadIconProps {\r\n\tasset: Asset;\r\n\tassetIconClasses?: string;\r\n\tdownloadIconClasses?: string;\r\n}\r\n\r\n/**\r\n * Icon for downloading assets.\r\n */\r\nexport default function AssetDownloadIcon(props: AssetDownloadIconProps) {\r\n\tconst { asset, assetIconClasses, downloadIconClasses } = props;\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\n\r\ninterface ExternalMediaIFrameProps {\r\n\tembeddedUrl: string;\r\n\ttitle: string;\r\n}\r\n/**\r\n * This component display external media videos on front end\r\n */\r\nexport default function ExternalMediaIFrame(props: ExternalMediaIFrameProps) {\r\n\tconst { embeddedUrl, title } = props;\r\n\treturn (\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Enlarge chevron SVG\r\n *\r\n * @returns\r\n */\r\nfunction EnlargeSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default EnlargeSVG;\r\n","import React from 'react';\r\nimport type { Dialog } from '@reach/dialog';\r\nimport { Localizer } from 'services/Localizer';\r\nimport XSVG from 'shared/components/svg/XSVG';\r\nimport Spinner from 'shared/components/Spinner';\r\nconst LazyDialog = React.lazy(() =>\r\n\timport('@reach/dialog').then((module) => ({ default: module.Dialog })),\r\n);\r\n\r\ninterface ModalProps {\r\n\tisOpen: boolean;\r\n\tcloseModal: () => void;\r\n\tchildren?: React.ReactNode;\r\n}\r\n\r\nexport default function ProductImageModal(props: ModalProps) {\r\n\tconst { isOpen, closeModal, children } = props;\r\n\r\n\treturn (\r\n\t\t}>\r\n\t\t\t closeModal()}\r\n\t\t\t\taria-label={Localizer('ProductImageModal')}\r\n\t\t\t\tas={'div'}\r\n\t\t\t>\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\r\n\t\t\t\t
{children}
\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n","import classnames from 'classnames';\r\nimport React, { useEffect, useRef, useState } from 'react';\r\nimport type MediaQuery from 'react-responsive';\r\nimport { Localizer } from 'services/Localizer';\r\nimport AssetDownloadIcon from 'shared/assets/AssetDownloadIcon';\r\nimport AssetIcon from 'shared/assets/AssetIcon';\r\nimport ExternalMediaIFrame from 'shared/assets/ExternalMediaIFrame';\r\nimport LazyImage from 'shared/assets/LazyImage';\r\nimport { AssetType } from 'shared/assets/types';\r\nimport DownChevronSVG from 'shared/components/svg/DownChevronSVG';\r\nimport EnlargeSVG from 'shared/components/svg/EnlargeSVG';\r\nimport LeftChevronSVG from 'shared/components/svg/LeftChevronSVG';\r\nimport RightChevronSVG from 'shared/components/svg/RightChevronSVG';\r\nimport UpChevronSVG from 'shared/components/svg/UpChevronSVG';\r\nimport useSmoothScrollingPolyfill from 'shared/hooks/useSmoothScrollingPolyfill';\r\nimport ProductImageModal from './ProductImageModal';\r\nimport { ProductAsset } from './types';\r\nimport Spinner from 'shared/components/Spinner';\r\nconst LazyMediaQuery = React.lazy(() => import('react-responsive'));\r\n\r\ninterface ProductAssetsProps {\r\n\tassets?: ProductAsset[] | null;\r\n}\r\n\r\nexport const productAssetPlaceholder: ProductAsset = {\r\n\taltText: 'Image not available',\r\n\tsortOrder: 1,\r\n\tthumbnailUrl: '/images/image-not-found-thumb.png',\r\n\tmainImageUrl: '/images/image-not-found.png',\r\n\tenlargedImageUrl: '/images/image-not-found.png',\r\n\tassetType: AssetType.Image,\r\n\tassetUrl: '/images/image-not-found.png',\r\n\tembeddedUrl: '',\r\n};\r\n\r\n/**\r\n * Returns the first asset from the set of provided assets or null if no default found\r\n */\r\nfunction initMainProductAsset(assets?: ProductAsset[] | null): ProductAsset | null {\r\n\tif (assets == null || assets.length === 0) {\r\n\t\treturn null;\r\n\t}\r\n\tconst defaultAsset = assets\r\n\t\t.sort(compareAssets)\r\n\t\t.find((asset) => asset.assetType === AssetType.Image || asset.assetType === AssetType.YouTube);\r\n\treturn defaultAsset || null;\r\n}\r\n\r\n/**\r\n * Returns list of alternative assets (including the main asset).\r\n */\r\nfunction initAltAssets(assets?: ProductAsset[] | null): ProductAsset[] {\r\n\tif (!assets || assets === null || assets.length === 0) {\r\n\t\treturn [productAssetPlaceholder];\r\n\t}\r\n\treturn assets.sort(compareAssets);\r\n}\r\n\r\nconst compareAssets = (a: ProductAsset, b: ProductAsset) => a.sortOrder - b.sortOrder;\r\n\r\n/**\r\n * Displays assets for a product, including alternate assets, and handles swapping\r\n */\r\nexport default function ProductAssets(props: ProductAssetsProps) {\r\n\tconst [mainAsset, setMainAsset] = useState(productAssetPlaceholder);\r\n\tconst [altAssets, setAltAssets] = useState([]);\r\n\tconst [isImageSliderModalOpen, setIsImageSliderModalOpen] = useState(false);\r\n\r\n\tconst carousel = useRef(null);\r\n\r\n\tconst nodes = new Map();\r\n\tuseSmoothScrollingPolyfill();\r\n\r\n\tuseEffect(() => {\r\n\t\tconst newMainAsset = initMainProductAsset(props.assets);\r\n\r\n\t\tif (newMainAsset) {\r\n\t\t\tsetMainAsset(newMainAsset);\r\n\t\t} else {\r\n\t\t\tsetMainAsset(productAssetPlaceholder);\r\n\t\t}\r\n\r\n\t\tconst initialThumbnails = initAltAssets(props.assets);\r\n\t\tsetAltAssets(initialThumbnails);\r\n\t}, [props.assets]);\r\n\r\n\t/**\r\n\t * Replaces the main image with the provided one\r\n\t * @param e\r\n\t * @param asset\r\n\t */\r\n\tfunction changeMainImage(e: React.MouseEvent, asset: ProductAsset): void {\r\n\t\te.preventDefault();\r\n\t\tsetMainAsset(asset);\r\n\t}\r\n\r\n\t/**\r\n\t * Scrolsl the carousel\r\n\t *\r\n\t * @param {boolean} up\r\n\t * @returns\r\n\t */\r\n\tfunction scrollCarousel(up: boolean) {\r\n\t\tif (Array.from(nodes.values()).length === 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (!carousel || !carousel.current) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst item = Array.from(nodes.values()).filter((node) => node != null)[0];\r\n\r\n\t\tif (window.innerWidth > 767) {\r\n\t\t\tcarousel.current.scrollBy(0, up ? -item.clientHeight : item.clientHeight);\r\n\t\t} else {\r\n\t\t\tcarousel.current.scrollBy(up ? -item.clientHeight : item.clientHeight, 0);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Handle previous button click\r\n\t *\r\n\t */\r\n\tfunction handlePreviousButton() {\r\n\t\tscrollCarousel(true);\r\n\t}\r\n\r\n\t/**\r\n\t * Handle next button click\r\n\t *\r\n\t */\r\n\tfunction handleNextButton() {\r\n\t\tscrollCarousel(false);\r\n\t}\r\n\r\n\tconst assetScroller = (\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t
    \r\n\t\t\t\t\t{altAssets.map((altAsset, i) => (\r\n\t\t\t\t\t\t nodes.set(i, c)}\r\n\t\t\t\t\t\t\tclassName=\"roc-pdp-asset-scroller__item\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{altAsset.assetType === AssetType.Image || altAsset.assetType === AssetType.YouTube ? (\r\n\t\t\t\t\t\t\t\t changeMainImage(event, altAsset)}\r\n\t\t\t\t\t\t\t\t\taria-label=\"Select image\"\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t{altAsset.assetType === AssetType.Image ? (\r\n\t\t\t\t\t\t\t\t\t\t\r\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t\t\t\t\t\t}}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{mainImageContent}\r\n\t\t\t\t\t\t{assetScroller}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{assetScroller}\r\n\t\t\t\t\t\t{mainImageContent}\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n}\r\n","import { useEffect } from 'react';\r\nimport smoothscroll from 'smoothscroll-polyfill';\r\n\r\nexport default function useSmoothScrollingPolyfill() {\r\n\tuseEffect(() => {\r\n\t\tsmoothscroll.polyfill();\r\n\t}, []);\r\n}\r\n","// Extra large desktop breakpoint.\r\nexport const xlg = 1200;\r\n\r\n// Desktop breakpoint.\r\nexport const lg = 992;\r\n\r\n// Tablet breakpoint.\r\nexport const md = 768;\r\n\r\n// Mobile breakpoint.\r\nexport const sm = 576;\r\n","import React from 'react';\r\nimport useDelayedDisplay from 'shared/hooks/useDelayedDisplay';\r\nimport classnames from 'classnames';\r\n\r\ntype SpinnerAlignment = 'left' | 'right' | 'none';\r\n\r\ninterface SpinnerProps {\r\n\tlight?: boolean;\r\n\twaitMs?: number;\r\n\talign?: SpinnerAlignment;\r\n\tblock?: boolean;\r\n\tparentCentered?: boolean;\r\n}\r\n\r\n/**\r\n * Reusable roc-spinner component with color, alignment and wait time props.\r\n *\r\n * @export\r\n * @param {SpinnerProps} { light = false, waitMs = 200, align = 'right', block }\r\n * @returns\r\n */\r\nexport default function Spinner({\r\n\tlight = false,\r\n\twaitMs = 200,\r\n\talign = 'right',\r\n\tblock,\r\n\tparentCentered = false,\r\n}: SpinnerProps) {\r\n\tconst display = useDelayedDisplay(waitMs);\r\n\r\n\tif (!display) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst spinner = (\r\n\t\t\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n\r\n\tif (parentCentered) {\r\n\t\treturn
{spinner}
;\r\n\t}\r\n\r\n\treturn spinner;\r\n}\r\n","import React, { useContext } from 'react';\r\nimport { UseShoppingCartState, UseShoppingCartActor } from './useShoppingCart';\r\n\r\nexport interface ShoppingCartContext {\r\n\tstate: UseShoppingCartState;\r\n\tactor: UseShoppingCartActor;\r\n}\r\n\r\n/**\r\n * Shopping Cart Context that prevents prop drilling and provides access to all lifted shopping cart state\r\n */\r\nconst ShoppingCartContext = React.createContext(null);\r\n\r\nexport default ShoppingCartContext;\r\n\r\n/**\r\n * Custom hook that provides a shortcut to accessing Shopping Cart Context. It also checks to make sure\r\n * that there's a value provided for context, meaning that any components calling it are underneath\r\n * the ShoppingCartContext.Provider component.\r\n */\r\nexport function useShoppingCartContext() {\r\n\tconst shoppingCartContext = useContext(ShoppingCartContext);\r\n\r\n\tif (shoppingCartContext === null) {\r\n\t\tthrow new Error('No ShoppingCartContext.Provider found.');\r\n\t}\r\n\r\n\treturn shoppingCartContext;\r\n}\r\n","import { AxiosError } from 'axios';\r\nimport { useEffect, useState } from 'react';\r\nimport AxiosHelper from 'services/AxiosHelper';\r\nimport { Localizer } from 'services/Localizer';\r\nimport {\r\n\tAddAllToCartResponse,\r\n\tAddToCartResponse,\r\n\tBulkAddToCartResponse,\r\n\tCartSummary,\r\n\tGetCartResult,\r\n\tMoveSavedProductToCartResult,\r\n} from 'services/UserData.Commerce';\r\nimport { dispatchRocEvent } from 'shared/hooks/useRocEventHandler';\r\nimport { AddToCartExceptionCode } from '../product-details/types';\r\nimport { OrderMessage } from './OrderMessages';\r\nimport {\r\n\tAddAllToCartProps as AddAllToCartParams,\r\n\tAddToCartProps as AddToCartParams,\r\n\tBulkAddToCartProps,\r\n\tGetSavedProductsResult,\r\n\tMoveStatus,\r\n\tOrder,\r\n\tOrderItem,\r\n\tOrderRecipient,\r\n} from './types';\r\n\r\nexport interface UseShoppingCart {\r\n\tstate: UseShoppingCartState;\r\n\tactor: UseShoppingCartActor;\r\n}\r\n\r\nexport interface UseShoppingCartState {\r\n\torder?: Order | null;\r\n\tsavedProducts?: GetSavedProductsResult | null;\r\n\tcartTotalItemCount: number;\r\n\r\n\torderIsUpdating: boolean;\r\n\tupdatingOrderItemId: string | null;\r\n\torderItemBeingRemovedId: string | null;\r\n\tupdatingSavedProductId: string | null;\r\n\tupdatingSavedProductPricingLineId: string | null;\r\n\tsavedProductBeingRemovedId: string | null;\r\n\tsavedProductBeingRemovedPricingLineId: string | null;\r\n\r\n\tstoredForUndoItem: OrderItem | null;\r\n\tstoredForUndoItemIndex: {\r\n\t\trecipientId: string;\r\n\t\titemIndex: number;\r\n\t} | null;\r\n\tlastMoveStatus: MoveStatus | null;\r\n\tisUndoClickedState: boolean;\r\n\r\n\terrorMessage: string | null;\r\n\terror: Error | AxiosError | null;\r\n\terrorType: AddToCartExceptionCode | null;\r\n}\r\n\r\nexport interface UseShoppingCartActor {\r\n\taddToCart: (props: AddToCartParams) => Promise;\r\n\tbulkAddToCart: (props: BulkAddToCartProps) => Promise;\r\n\taddAllFromListToCurrentCart: (props: AddAllToCartParams) => Promise;\r\n\taddAllFromListToNewCart: (props: AddAllToCartParams) => Promise;\r\n\tchangeOrderItemQuantity: (itemToUpdate: OrderItem, newQuantity: number) => Promise;\r\n\tmoveItemToSaved: (itemToMove: OrderItem) => Promise;\r\n\tremoveOrderItem: (itemToRemove: OrderItem) => Promise;\r\n\r\n\taddToSavedProducts: (itemToAdd: OrderItem) => Promise;\r\n\tmoveSavedProductToCart: (\r\n\t\tproductToMoveId: string,\r\n\t\tproductName: string,\r\n\t\tpricingLineId: string,\r\n\t\tquantity: number,\r\n\t) => Promise;\r\n\tremoveSavedProduct: (\r\n\t\tproductToRemoveId: string,\r\n\t\tproductToRemoveName: string,\r\n\t\tpricingLineId: string,\r\n\t) => Promise;\r\n\r\n\tsetErrorMessage: (errorMessage: string | null) => void;\r\n\tsetError: (error: Error | AxiosError | null) => void;\r\n\thandleUndo: () => Promise;\r\n\r\n\tupdateOrder: (newCart: Order) => void;\r\n\t/**\r\n\t * Sets order messages to displayed whenever the server returns order related ajax requests\r\n\t * within any component tgat is using this hook.\r\n\t */\r\n\tupdateOrderMessages: (orderMessages: OrderMessage[]) => void;\r\n}\r\n\r\nexport interface UseShoppingCartParams {\r\n\torder?: Order | null;\r\n\tsetOrder?: (order: Order) => void;\r\n\tsavedProducts?: GetSavedProductsResult | null;\r\n\tsetSavedProducts?: (savedProducts: GetSavedProductsResult) => void;\r\n\tcartSummary?: CartSummary | null;\r\n\tsetCartSummary?: (cartSummary: CartSummary) => void;\r\n\torderMessages?: OrderMessage[];\r\n\tsetOrderMessages?: (orderMessages: OrderMessage[]) => void;\r\n}\r\n\r\n/**\r\n * Reusable hook to access ShoppingCart-related endpoints on the server, as well as helping manage\r\n * the items inside the shopping cart.\r\n */\r\nexport default function useShoppingCart(useShoppingCartParams?: UseShoppingCartParams): UseShoppingCart {\r\n\tconst params = useShoppingCartParams || {};\r\n\tconst { order, setOrder, savedProducts, setSavedProducts, setCartSummary, setOrderMessages } = params;\r\n\r\n\t// to indicate that a cart is being updated after its item has been removed/updated\r\n\tconst [updatingOrderItemId, setUpdatingOrderItemId] = useState(null);\r\n\r\n\t// to store the id of the order item being removed\r\n\tconst [orderItemBeingRemovedId, setOrderItemBeingRemovedId] = useState(null);\r\n\r\n\t// total items count in the cart\r\n\tconst [cartTotalItemCount, setCartTotalItemCount] = useState(0);\r\n\r\n\t// to store the id and the unit of measure id of the item being moved\r\n\tconst [updatingSavedProductId, setUpdatingSavedProductId] = useState(null);\r\n\tconst [updatingSavedProductPricingLineId, setUpdatingSavedProductPricingLineId] = useState(null);\r\n\r\n\t// to store the id and the unit of measure id of the item being removed\r\n\tconst [savedProductBeingRemovedId, setSavedProductBeingRemovedId] = useState(null);\r\n\tconst [savedProductBeingRemovedPricingLineId, setSavedProductBeingRemovedPricingLineId] = useState(\r\n\t\tnull,\r\n\t);\r\n\r\n\t// stores the last removed item and item index to be able to undo the last move or removal\r\n\tconst [storedForUndoItem, setStoredForUndoItem] = useState(null);\r\n\tconst [storedForUndoItemIndex, setStoredForUndoItemIndex] = useState<{\r\n\t\trecipientId: string;\r\n\t\titemIndex: number;\r\n\t} | null>(null);\r\n\r\n\t// stores what the last action was, such as removing an item from the cart or moving an item to the saved products list\r\n\tconst [lastMoveStatus, setLastMoveStatus] = useState(null);\r\n\r\n\t// stores whether the undo button was clicked, to decide whether to clear the undo state when running a function or not\r\n\tlet isUndoClicked: boolean = false;\r\n\tconst [isUndoClickedState, setIsUndoClickedState] = useState(false);\r\n\r\n\t// stores the error message and error type to display\r\n\tconst [error, setError] = useState(null);\r\n\tconst [errorMessage, setErrorMessage] = useState(null);\r\n\tconst [errorType, setErrorType] = useState(null);\r\n\r\n\t// whether the order is updating\r\n\tconst orderIsUpdating =\r\n\t\t(orderItemBeingRemovedId ||\r\n\t\t\tupdatingOrderItemId ||\r\n\t\t\tupdatingSavedProductId ||\r\n\t\t\tupdatingSavedProductPricingLineId ||\r\n\t\t\tsavedProductBeingRemovedId ||\r\n\t\t\tsavedProductBeingRemovedPricingLineId) != null || isUndoClickedState;\r\n\r\n\tconst clearUndoState = () => {\r\n\t\tsetStoredForUndoItem(null);\r\n\t\tsetStoredForUndoItemIndex(null);\r\n\t\tsetLastMoveStatus(null);\r\n\t};\r\n\r\n\tconst dispatchAddToCartEvent = (result: AddToCartResponse) => {\r\n\t\tdispatchRocEvent('added-to-cart', {\r\n\t\t\titems: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: result.productId,\r\n\t\t\t\t\tadjustedQuantity: result.adjustedQuantity,\r\n\t\t\t\t\tname: result.name,\r\n\t\t\t\t\tprice: result.snapshotSalePrice ? result.snapshotSalePrice : result.snapshotBasePrice,\r\n\t\t\t\t\tsku: result.sku,\r\n\t\t\t\t\tcurrency: result.snapshotCurrencyISO,\r\n\t\t\t\t\tproductGroupId: result.productGroupId,\r\n\t\t\t\t\tselections: result.selections,\r\n\t\t\t\t},\r\n\t\t\t],\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the cart, saved products, and cart summary\r\n\t * @param response\r\n\t * @param cartSummary\r\n\t */\r\n\tconst updateCartState = (response?: GetCartResult | null) => {\r\n\t\tif (!response) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (response.cart) {\r\n\t\t\tif (!setOrder) {\r\n\t\t\t\tconsole.warn('setOrder called but not defined.');\r\n\t\t\t} else {\r\n\t\t\t\tsetOrder(response.cart);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (response.savedProducts) {\r\n\t\t\tif (!setSavedProducts) {\r\n\t\t\t\tconsole.warn('setSavedProducts called but not defined.');\r\n\t\t\t} else {\r\n\t\t\t\tsetSavedProducts(response.savedProducts);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (response.cartSummary) {\r\n\t\t\tif (!setCartSummary) {\r\n\t\t\t\tconsole.warn('setCartSummary called but not defined.');\r\n\t\t\t} else {\r\n\t\t\t\tsetCartSummary(response.cartSummary);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tupdateOrderMessages(response.orderMessages);\r\n\t};\r\n\r\n\t// this runs when the component is mounted and every time the order changes because we want\r\n\t// to recalculate cart total item count\r\n\tuseEffect(() => {\r\n\t\tif (!order) {\r\n\t\t\tsetCartTotalItemCount(0);\r\n\t\t} else {\r\n\t\t\tconst itemsCount = order.recipients.reduce((itemsQty: number, orderRecipient: OrderRecipient) => {\r\n\t\t\t\titemsQty += orderRecipient.items.reduce((recipientQty: number, orderItem: OrderItem) => {\r\n\t\t\t\t\trecipientQty += orderItem.quantity;\r\n\t\t\t\t\treturn recipientQty;\r\n\t\t\t\t}, 0);\r\n\t\t\t\treturn itemsQty;\r\n\t\t\t}, 0);\r\n\r\n\t\t\tsetCartTotalItemCount(itemsCount);\r\n\t\t}\r\n\t\tclearUndoState();\r\n\t}, [order]);\r\n\r\n\t//#region Shopping Cart\r\n\r\n\t/**\r\n\t * Adds the last removed item to the cart\r\n\t */\r\n\tconst addToCart = async (props: AddToCartParams) => {\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\tif (!isUndoClicked) {\r\n\t\t\tclearUndoState();\r\n\t\t}\r\n\r\n\t\tsetUpdatingOrderItemId(props.itemId);\r\n\r\n\t\ttry {\r\n\t\t\tconst response = await AxiosHelper.post('/ajax/cart', {\r\n\t\t\t\tproductId: props.itemId,\r\n\t\t\t\tquantity: props.quantity,\r\n\t\t\t\tproductPricingLineId: props.productPricingLineId,\r\n\t\t\t\tsavedProductsPageNumber: savedProducts?.pagination?.pageNumber || 1,\r\n\t\t\t\tsavedProductsPageSize: savedProducts?.pagination?.pageSize || 1000000,\r\n\t\t\t});\r\n\r\n\t\t\tupdateCartState(response.data);\r\n\r\n\t\t\tif (response.data) {\r\n\t\t\t\tdispatchAddToCartEvent(response.data);\r\n\t\t\t}\r\n\r\n\t\t\treturn response.data;\r\n\t\t} catch (error) {\r\n\t\t\tclearUndoState();\r\n\t\t\tsetError(error);\r\n\r\n\t\t\tconsole.warn('Error when undoing a remove from cart action', error);\r\n\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.data) {\r\n\t\t\t\tif (axiosError.response.data.message) {\r\n\t\t\t\t\tsetErrorMessage(axiosError.response.data.message);\r\n\t\t\t\t}\r\n\t\t\t\tif (axiosError.response.data.exceptionCode) {\r\n\t\t\t\t\tsetErrorType(axiosError.response.data.exceptionCode);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tthrow error;\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t} finally {\r\n\t\t\tsetUpdatingOrderItemId(null);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Adds multiple items to cart\r\n\t */\r\n\tconst bulkAddToCart = async (props: BulkAddToCartProps) => {\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\tif (!isUndoClicked) {\r\n\t\t\tclearUndoState();\r\n\t\t}\r\n\r\n\t\tprops.items.forEach((element) => {\r\n\t\t\tsetUpdatingOrderItemId(element.itemId);\r\n\t\t});\r\n\r\n\t\ttry {\r\n\t\t\tconst request = {\r\n\t\t\t\tproductInfo: props.items.map((item, index) => {\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\tproductId: item.itemId,\r\n\t\t\t\t\t\tproductPricingLineId: item.productPricingLineId,\r\n\t\t\t\t\t\tquantity: item.quantity,\r\n\t\t\t\t\t\tindex: index,\r\n\t\t\t\t\t};\r\n\t\t\t\t}),\r\n\t\t\t};\r\n\t\t\tconst response = await AxiosHelper.post('/ajax/cart/bulk', request);\r\n\r\n\t\t\tupdateCartState(response.data);\r\n\r\n\t\t\tif (response.data.processedItems && response.data.processedItems.length > 0) {\r\n\t\t\t\tdispatchRocEvent('added-to-cart', {\r\n\t\t\t\t\titems: response.data.processedItems.map((item) => {\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tadjustedQuantity: item.adjustedQuantity,\r\n\t\t\t\t\t\t\tid: item.productId,\r\n\t\t\t\t\t\t\tname: item.name,\r\n\t\t\t\t\t\t\tsku: item.sku,\r\n\t\t\t\t\t\t\tprice: item.snapshotSalePrice ? item.snapshotSalePrice : item.snapshotBasePrice,\r\n\t\t\t\t\t\t\tcurrency: item.snapshotCurrencyISO,\r\n\t\t\t\t\t\t\tproductGroupId: item.productGroupId,\r\n\t\t\t\t\t\t\tselections: item.selections,\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}),\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\treturn response.data;\r\n\t\t} catch (error) {\r\n\t\t\tclearUndoState();\r\n\t\t\tsetError(error);\r\n\r\n\t\t\tconsole.warn('Error when undoing a remove from cart action', error);\r\n\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.data) {\r\n\t\t\t\tif (axiosError.response.data.message) {\r\n\t\t\t\t\tsetErrorMessage(axiosError.response.data.message);\r\n\t\t\t\t}\r\n\t\t\t\tif (axiosError.response.data.exceptionCode) {\r\n\t\t\t\t\tsetErrorType(axiosError.response.data.exceptionCode);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tthrow error;\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t} finally {\r\n\t\t\tsetUpdatingOrderItemId(null);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Add all items from the specified shopping list to the cart\r\n\t */\r\n\tconst addAllFromListToCurrentCart = async (props: AddAllToCartParams) => {\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\ttry {\r\n\t\t\tconst response = await AxiosHelper.post(\r\n\t\t\t\t`/ajax/shopping-lists/${props.shoppingListId}/to-cart`,\r\n\t\t\t\t{\r\n\t\t\t\t\tdisplayedItemsCount: 3,\r\n\t\t\t\t\tshoppingListProductIds: props.selectedShoppingListProductIds,\r\n\t\t\t\t},\r\n\t\t\t);\r\n\r\n\t\t\treturn response.data;\r\n\t\t} catch (error) {\r\n\t\t\tclearUndoState();\r\n\t\t\tsetError(error);\r\n\r\n\t\t\tconsole.warn('Error when adding all products to cart', error);\r\n\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.data) {\r\n\t\t\t\tif (axiosError.response.data.message) {\r\n\t\t\t\t\tsetErrorMessage(axiosError.response.data.message);\r\n\t\t\t\t}\r\n\t\t\t\tif (axiosError.response.data.exceptionCode) {\r\n\t\t\t\t\tsetErrorType(axiosError.response.data.exceptionCode);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tthrow error;\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Add all items from the specified shopping list to the new cart\r\n\t */\r\n\tconst addAllFromListToNewCart = async (props: AddAllToCartParams) => {\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\ttry {\r\n\t\t\tconst response = await AxiosHelper.post(\r\n\t\t\t\t`/ajax/shopping-lists/${props.shoppingListId}/to-new-cart`,\r\n\t\t\t\t{\r\n\t\t\t\t\tdisplayedItemsCount: 3,\r\n\t\t\t\t\tshoppingListProductIds: props.selectedShoppingListProductIds,\r\n\t\t\t\t},\r\n\t\t\t);\r\n\r\n\t\t\treturn response.data;\r\n\t\t} catch (error) {\r\n\t\t\tclearUndoState();\r\n\t\t\tsetError(error);\r\n\r\n\t\t\tconsole.warn('Error when adding all products to cart', error);\r\n\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.data) {\r\n\t\t\t\tif (axiosError.response.data.message) {\r\n\t\t\t\t\tsetErrorMessage(axiosError.response.data.message);\r\n\t\t\t\t}\r\n\t\t\t\tif (axiosError.response.data.exceptionCode) {\r\n\t\t\t\t\tsetErrorType(axiosError.response.data.exceptionCode);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tthrow error;\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Moves a product from the shopping cart to the user's saved products list\r\n\t * @param itemToMove\r\n\t */\r\n\tconst moveItemToSaved = async (itemToMove: OrderItem) => {\r\n\t\tif (!setSavedProducts || !setOrder || !order) {\r\n\t\t\tconsole.warn(\r\n\t\t\t\t'Saved product move to cart requested with one or more of the following undefined:\\n' +\r\n\t\t\t\t\t'setSavedProducts, setOrder, order',\r\n\t\t\t);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\tif (!isUndoClicked) {\r\n\t\t\tclearUndoState();\r\n\t\t}\r\n\r\n\t\tsetUpdatingOrderItemId(itemToMove.id);\r\n\r\n\t\ttry {\r\n\t\t\tif (!order || !order.recipients) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst response = await AxiosHelper.post('/ajax/saved-products/from-cart', {\r\n\t\t\t\tproductId: itemToMove.product.id,\r\n\t\t\t\titemId: itemToMove.id,\r\n\t\t\t\tproductPricingLineId: itemToMove.pricingLine.id,\r\n\t\t\t\tquantity: itemToMove.quantity,\r\n\t\t\t\tsavedProductsPageNumber:\r\n\t\t\t\t\t(savedProducts && savedProducts.pagination && savedProducts.pagination.pageNumber) || 1,\r\n\t\t\t\tsavedProductsPageSize:\r\n\t\t\t\t\t(savedProducts && savedProducts.pagination && savedProducts.pagination.pageSize) || 1000000,\r\n\t\t\t});\r\n\r\n\t\t\t// Find and save the moved item index\r\n\t\t\torder.recipients.map((recipient) => {\r\n\t\t\t\tsetStoredForUndoItemIndex({\r\n\t\t\t\t\trecipientId: recipient.id,\r\n\t\t\t\t\titemIndex: recipient.items.indexOf(itemToMove),\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\tupdateCartState(response.data);\r\n\t\t\tsetStoredForUndoItem(itemToMove);\r\n\t\t\tsetLastMoveStatus(MoveStatus.MovedToSaved);\r\n\t\t} catch (error) {\r\n\t\t\tclearUndoState();\r\n\r\n\t\t\tsetError(error);\r\n\r\n\t\t\tconsole.warn('Error when saving order item for later', error);\r\n\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.data && axiosError.response.data.message) {\r\n\t\t\t\tsetErrorMessage(axiosError.response.data.message);\r\n\t\t\t} else {\r\n\t\t\t\tsetErrorMessage(Localizer('ProblemWhenSavingItem', itemToMove.name));\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tsetUpdatingOrderItemId(null);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the quantity of the requested item with the new one\r\n\t * @param itemToUpdate\r\n\t * @param newQuantity\r\n\t */\r\n\tconst changeOrderItemQuantity = async (itemToUpdate: OrderItem, newQuantity: number) => {\r\n\t\tif (!setOrder) {\r\n\t\t\tconsole.warn('Item order quantity change requested with no setOrder function defined.');\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\tif (!isUndoClicked) {\r\n\t\t\tclearUndoState();\r\n\t\t}\r\n\r\n\t\tsetUpdatingOrderItemId(itemToUpdate.id);\r\n\r\n\t\ttry {\r\n\t\t\tif (!order) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst response = await AxiosHelper.post('/ajax/cart/update', {\r\n\t\t\t\titemId: itemToUpdate.id,\r\n\t\t\t\tquantity: newQuantity,\r\n\t\t\t\tsavedProductsPageNumber:\r\n\t\t\t\t\t(savedProducts && savedProducts.pagination && savedProducts.pagination.pageNumber) || 1,\r\n\t\t\t\tsavedProductsPageSize:\r\n\t\t\t\t\t(savedProducts && savedProducts.pagination && savedProducts.pagination.pageSize) || 1000000,\r\n\t\t\t});\r\n\r\n\t\t\tupdateCartState(response.data);\r\n\t\t} catch (error) {\r\n\t\t\tconsole.warn(`Error when updating ${itemToUpdate.name}' quantity`, error);\r\n\r\n\t\t\tsetError(error);\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.data && axiosError.response.data.message) {\r\n\t\t\t\tsetErrorMessage(axiosError.response.data.message);\r\n\t\t\t} else {\r\n\t\t\t\tsetErrorMessage(Localizer('ProblemWhenUpdatingItem', itemToUpdate.name));\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tsetUpdatingOrderItemId(null);\r\n\t\t\tclearUndoState();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Removes the requested item from the cart\r\n\t * @param itemToRemove\r\n\t */\r\n\tconst removeOrderItem = async (itemToRemove: OrderItem) => {\r\n\t\tif (!setOrder || !order) {\r\n\t\t\tconsole.warn('Order item removal requested with no order or setOrder defined.');\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\tif (!isUndoClicked) {\r\n\t\t\tclearUndoState();\r\n\t\t}\r\n\r\n\t\tsetOrderItemBeingRemovedId(itemToRemove.id);\r\n\r\n\t\ttry {\r\n\t\t\t// Find and save the moved item index\r\n\t\t\torder.recipients.map((recipient) => {\r\n\t\t\t\tsetStoredForUndoItemIndex({\r\n\t\t\t\t\trecipientId: recipient.id,\r\n\t\t\t\t\titemIndex: recipient.items.indexOf(itemToRemove),\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\tconst response = await AxiosHelper.post('/ajax/cart/remove', {\r\n\t\t\t\titemId: itemToRemove.id,\r\n\t\t\t\tsavedProductsPageNumber:\r\n\t\t\t\t\t(savedProducts && savedProducts.pagination && savedProducts.pagination.pageNumber) || 1,\r\n\t\t\t\tsavedProductsPageSize:\r\n\t\t\t\t\t(savedProducts && savedProducts.pagination && savedProducts.pagination.pageSize) || 1000000,\r\n\t\t\t});\r\n\r\n\t\t\tupdateCartState(response.data);\r\n\t\t\tsetStoredForUndoItem(itemToRemove);\r\n\t\t\tsetLastMoveStatus(MoveStatus.RemovedFromCart);\r\n\t\t} catch (error) {\r\n\t\t\tclearUndoState();\r\n\r\n\t\t\tsetErrorMessage(Localizer('ProblemWhenRemovingItem', itemToRemove.name));\r\n\t\t\tsetError(error);\r\n\t\t} finally {\r\n\t\t\tsetOrderItemBeingRemovedId(null);\r\n\t\t}\r\n\t};\r\n\t//#endregion\r\n\r\n\t//#region Save For Later\r\n\r\n\t/**\r\n\t * Handles adding an item to a saved products list\r\n\t * @param itemToAdd\r\n\t */\r\n\tconst addToSavedProducts = async (itemToAdd: OrderItem) => {\r\n\t\tif (!setSavedProducts) {\r\n\t\t\tconsole.warn('Add to saved products requested with no setSavedProducts defined.');\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\tif (!isUndoClicked) {\r\n\t\t\tclearUndoState();\r\n\t\t}\r\n\r\n\t\tsetUpdatingSavedProductId(itemToAdd.product.id);\r\n\r\n\t\ttry {\r\n\t\t\t// Don't need to set undo info here as there is no way to run this function unless you are undoing a removal\r\n\t\t\tconst response = await AxiosHelper.post('/ajax/saved-products/save-for-later', {\r\n\t\t\t\tproductId: itemToAdd.product.id,\r\n\t\t\t\tproductPricingLineId: itemToAdd.pricingLine.id,\r\n\t\t\t\tquantity: itemToAdd.quantity,\r\n\t\t\t\tsavedProductsPageNumber:\r\n\t\t\t\t\t(savedProducts && savedProducts.pagination && savedProducts.pagination.pageNumber) || 1,\r\n\t\t\t\tsavedProductsPageSize:\r\n\t\t\t\t\t(savedProducts && savedProducts.pagination && savedProducts.pagination.pageSize) || 1000000,\r\n\t\t\t});\r\n\r\n\t\t\tupdateCartState(response.data);\r\n\t\t} catch (error) {\r\n\t\t\tclearUndoState();\r\n\t\t\tsetError(error);\r\n\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.data && axiosError.response.data.message) {\r\n\t\t\t\tsetErrorMessage(axiosError.response.data.message);\r\n\t\t\t} else {\r\n\t\t\t\tsetErrorMessage(Localizer('ProblemWhenSavingItem', itemToAdd.name));\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tsetUpdatingSavedProductId(null);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Moves a user's saved product to the shopping cart\r\n\t * @param productToMoveId\r\n\t * @param productName\r\n\t * @param productPricingLineId\r\n\t * @param quantity\r\n\t */\r\n\tconst moveSavedProductToCart = async (\r\n\t\tproductToMoveId: string,\r\n\t\tproductName: string,\r\n\t\tproductPricingLineId: string,\r\n\t\tquantity: number,\r\n\t) => {\r\n\t\tif (!setSavedProducts || !setOrder || !savedProducts) {\r\n\t\t\tconsole.warn(\r\n\t\t\t\t'Saved product move to cart requested with one or more of the following undefined:\\n' +\r\n\t\t\t\t\t'setSavedProducts, setOrder, savedProducts.',\r\n\t\t\t);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(error);\r\n\r\n\t\tif (!isUndoClicked) {\r\n\t\t\tclearUndoState();\r\n\t\t}\r\n\r\n\t\tsetUpdatingSavedProductId(productToMoveId);\r\n\t\tsetUpdatingSavedProductPricingLineId(productPricingLineId);\r\n\r\n\t\ttry {\r\n\t\t\tif (!savedProducts || !savedProducts.results) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// find the index of the moved item in the saved products list\r\n\t\t\tconst savedProductIndex = savedProducts.results.findIndex(\r\n\t\t\t\t(product) => product.productId === productToMoveId,\r\n\t\t\t);\r\n\r\n\t\t\tconst response = await AxiosHelper.post('/ajax/saved-products/to-cart', {\r\n\t\t\t\tproductId: productToMoveId,\r\n\t\t\t\tquantity,\r\n\t\t\t\tproductPricingLineId: productPricingLineId,\r\n\t\t\t\tsavedProductsPageNumber:\r\n\t\t\t\t\t(savedProducts && savedProducts.pagination && savedProducts.pagination.pageNumber) || 1,\r\n\t\t\t\tsavedProductsPageSize:\r\n\t\t\t\t\t(savedProducts && savedProducts.pagination && savedProducts.pagination.pageSize) || 1000000,\r\n\t\t\t});\r\n\r\n\t\t\tupdateCartState(response.data);\r\n\r\n\t\t\tif (response.data.addToOrderResult) {\r\n\t\t\t\tdispatchAddToCartEvent(response.data.addToOrderResult);\r\n\t\t\t}\r\n\r\n\t\t\t// Find and save the moved item\r\n\t\t\tconst recipients = response.data.cart.recipients;\r\n\r\n\t\t\tfor (const recipient of recipients) {\r\n\t\t\t\tconst lastMovedItem = recipient.items.find(\r\n\t\t\t\t\t(item) => item.product.id === productToMoveId && item.pricingLine.id === productPricingLineId,\r\n\t\t\t\t);\r\n\t\t\t\tif (lastMovedItem) {\r\n\t\t\t\t\tsetStoredForUndoItem({ ...lastMovedItem, quantity });\r\n\t\t\t\t\tsetStoredForUndoItemIndex({ recipientId: recipient.id, itemIndex: savedProductIndex });\r\n\t\t\t\t\tconsole.log('Found last moved item');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tsetLastMoveStatus(MoveStatus.MovedToCart);\r\n\t\t} catch (error) {\r\n\t\t\tclearUndoState();\r\n\t\t\tsetError(error);\r\n\r\n\t\t\tconsole.warn('Error when moving the saved product to the cart.', error);\r\n\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.data && axiosError.response.data.message) {\r\n\t\t\t\tsetErrorMessage(axiosError.response.data.message);\r\n\t\t\t} else {\r\n\t\t\t\tsetErrorMessage(Localizer('ProblemWhenMovingSavedItemToCart', productName));\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tsetUpdatingSavedProductId(null);\r\n\t\t\tsetUpdatingSavedProductPricingLineId(null);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Remove a user's saved product from their saved products list\r\n\t * @param productToRemoveId\r\n\t * @param productPricingLineId\r\n\t */\r\n\tconst removeSavedProduct = async (\r\n\t\tproductToRemoveId: string,\r\n\t\tproductToRemoveName: string,\r\n\t\tproductPricingLineId: string,\r\n\t) => {\r\n\t\tif (!setSavedProducts || !savedProducts) {\r\n\t\t\tconsole.warn('Saved product removal requested with savedProducts or setSavedProducts undefined');\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\tif (!isUndoClicked) {\r\n\t\t\tclearUndoState();\r\n\t\t}\r\n\r\n\t\tsetSavedProductBeingRemovedId(productToRemoveId);\r\n\t\tsetSavedProductBeingRemovedPricingLineId(productPricingLineId);\r\n\r\n\t\ttry {\r\n\t\t\tif (!savedProducts.results) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst savedProductIndex = savedProducts.results.findIndex(\r\n\t\t\t\t(product) => product.productId === productToRemoveId,\r\n\t\t\t);\r\n\t\t\tconst savedProduct = savedProducts.results[savedProductIndex];\r\n\t\t\tconst response = await AxiosHelper.delete(\r\n\t\t\t\t'/ajax/saved-products/' +\r\n\t\t\t\t\tproductToRemoveId +\r\n\t\t\t\t\t'/' +\r\n\t\t\t\t\tproductPricingLineId +\r\n\t\t\t\t\t'?savedProductsPageNumber=' +\r\n\t\t\t\t\tsavedProducts.pagination.pageNumber.toString() +\r\n\t\t\t\t\t'&savedProductsPageSize=' +\r\n\t\t\t\t\tsavedProducts.pagination.pageSize.toString(),\r\n\t\t\t);\r\n\r\n\t\t\tif (savedProduct) {\r\n\t\t\t\t// Convert the SavedProduct into an OrderItem\r\n\t\t\t\tconst orderItemFromSaved: OrderItem = {\r\n\t\t\t\t\t...savedProduct,\r\n\t\t\t\t\tproduct: { ...savedProduct, id: savedProduct.productId },\r\n\t\t\t\t\ttotalPrice: savedProduct.totalPrice,\r\n\t\t\t\t\tunitPrice: savedProduct.unitPrice,\r\n\t\t\t\t\tsnapshotMinimumOrderQuantity: null,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tsetStoredForUndoItem(orderItemFromSaved);\r\n\t\t\t\tsetStoredForUndoItemIndex({ recipientId: '', itemIndex: savedProductIndex });\r\n\t\t\t}\r\n\r\n\t\t\tupdateCartState(response.data);\r\n\t\t\tsetLastMoveStatus(MoveStatus.RemovedFromSaved);\r\n\t\t} catch (error) {\r\n\t\t\tclearUndoState();\r\n\t\t\tsetError(error);\r\n\r\n\t\t\tconsole.warn('Error when removing the saved product.', error);\r\n\r\n\t\t\tsetErrorMessage(Localizer('ProblemWhenRemovingSavedItem', productToRemoveName));\r\n\t\t} finally {\r\n\t\t\tsetSavedProductBeingRemovedId(null);\r\n\t\t\tsetSavedProductBeingRemovedPricingLineId(null);\r\n\t\t}\r\n\t};\r\n\t//#endregion\r\n\r\n\t/**\r\n\t * Handle what happens when the Undo button is pressed\r\n\t */\r\n\tconst handleUndo = async () => {\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\tif (!lastMoveStatus == null || !storedForUndoItem) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tisUndoClicked = true;\r\n\t\tsetIsUndoClickedState(true);\r\n\r\n\t\ttry {\r\n\t\t\tswitch (lastMoveStatus) {\r\n\t\t\t\tcase MoveStatus.RemovedFromCart:\r\n\t\t\t\t\tawait addToCart({\r\n\t\t\t\t\t\titemId: storedForUndoItem.product.id,\r\n\t\t\t\t\t\tquantity: storedForUndoItem.quantity,\r\n\t\t\t\t\t\tproductPricingLineId: storedForUndoItem.pricingLine.id,\r\n\t\t\t\t\t});\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase MoveStatus.MovedToCart:\r\n\t\t\t\t\tawait moveItemToSaved(storedForUndoItem);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase MoveStatus.MovedToSaved:\r\n\t\t\t\t\tawait moveSavedProductToCart(\r\n\t\t\t\t\t\tstoredForUndoItem.product.id,\r\n\t\t\t\t\t\tstoredForUndoItem.name,\r\n\t\t\t\t\t\tstoredForUndoItem.pricingLine.id,\r\n\t\t\t\t\t\tstoredForUndoItem.quantity,\r\n\t\t\t\t\t);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase MoveStatus.RemovedFromSaved:\r\n\t\t\t\t\tawait addToSavedProducts(storedForUndoItem);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tisUndoClicked = false;\r\n\t\t\tsetIsUndoClickedState(false);\r\n\t\t\tclearUndoState();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Handles updating order\r\n\t * @param newCart\r\n\t */\r\n\tconst updateOrder = (newCart: Order) => {\r\n\t\tif (setOrder) {\r\n\t\t\tsetOrder(newCart);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Handles updating order messages\r\n\t * @param orderMessages Updated order messages\r\n\t */\r\n\tconst updateOrderMessages = (orderMessages: OrderMessage[]) => {\r\n\t\tif (!setOrderMessages) {\r\n\t\t\tconsole.warn('setOrderMessages called but not defined.');\r\n\t\t} else {\r\n\t\t\tsetOrderMessages(orderMessages);\r\n\t\t}\r\n\t};\r\n\r\n\treturn {\r\n\t\tstate: {\r\n\t\t\torderIsUpdating,\r\n\t\t\torder: useShoppingCartParams ? useShoppingCartParams.order : null,\r\n\t\t\tsavedProducts: useShoppingCartParams ? useShoppingCartParams.savedProducts : null,\r\n\t\t\tcartTotalItemCount,\r\n\r\n\t\t\tupdatingOrderItemId,\r\n\t\t\torderItemBeingRemovedId,\r\n\t\t\tupdatingSavedProductId,\r\n\t\t\tupdatingSavedProductPricingLineId,\r\n\t\t\tsavedProductBeingRemovedId,\r\n\t\t\tsavedProductBeingRemovedPricingLineId,\r\n\r\n\t\t\tstoredForUndoItem,\r\n\t\t\tstoredForUndoItemIndex,\r\n\t\t\tlastMoveStatus,\r\n\t\t\tisUndoClickedState,\r\n\r\n\t\t\terror,\r\n\t\t\terrorMessage,\r\n\t\t\terrorType,\r\n\t\t},\r\n\t\tactor: {\r\n\t\t\taddToCart,\r\n\t\t\tbulkAddToCart,\r\n\t\t\taddAllFromListToCurrentCart,\r\n\t\t\taddAllFromListToNewCart,\r\n\t\t\tchangeOrderItemQuantity,\r\n\t\t\tmoveItemToSaved,\r\n\t\t\tremoveOrderItem,\r\n\r\n\t\t\taddToSavedProducts,\r\n\t\t\tmoveSavedProductToCart,\r\n\t\t\tremoveSavedProduct,\r\n\r\n\t\t\thandleUndo,\r\n\t\t\tsetErrorMessage,\r\n\t\t\tsetError,\r\n\r\n\t\t\tupdateOrder,\r\n\t\t\tupdateOrderMessages,\r\n\t\t},\r\n\t};\r\n}\r\n","import React from 'react';\r\nimport type {\r\n\tListboxInput as ListboxInputType,\r\n\tListboxButton as ListboxButtonType,\r\n\tListboxPopover as ListboxPopoverType,\r\n\tListboxList as ListboxListType,\r\n\tListboxOption as ListboxOptionType,\r\n} from '@reach/listbox';\r\n\r\nimport '@reach/listbox/styles.css';\r\nimport classnames from 'classnames';\r\nimport UpChevronSVG from './svg/UpChevronSVG';\r\nimport DownChevronSVG from './svg/DownChevronSVG';\r\nimport { WithTestId } from 'shared-client/types/test';\r\nimport Spinner from './Spinner';\r\n\r\nconst ListboxInput = React.lazy(() =>\r\n\timport('@reach/listbox').then((module) => ({ default: module.ListboxInput })),\r\n);\r\n\r\nconst ListboxButton = React.lazy(() =>\r\n\timport('@reach/listbox').then((module) => ({ default: module.ListboxButton })),\r\n);\r\n\r\nconst ListboxPopover = React.lazy(() =>\r\n\timport('@reach/listbox').then((module) => ({ default: module.ListboxPopover })),\r\n);\r\n\r\nconst ListboxList = React.lazy(() =>\r\n\timport('@reach/listbox').then((module) => ({ default: module.ListboxList })),\r\n);\r\n\r\nconst ListboxOption = React.lazy(() =>\r\n\timport('@reach/listbox').then((module) => ({ default: module.ListboxOption })),\r\n);\r\n\r\nexport interface FauxDropdownProps extends WithTestId {\r\n\t/**\r\n\t * A list of lists of options.\r\n\t *\r\n\t * @type {FauxDropdownOptionList[]}\r\n\t * @memberof FauxDropdownProps\r\n\t */\r\n\tlists: FauxDropdownOptionList[];\r\n\r\n\t/**\r\n\t * The ID for a11y purposes. Must not include unfriendly characters.\r\n\t *\r\n\t * @type {string}\r\n\t * @memberof FauxDropdownProps\r\n\t */\r\n\tid: string;\r\n\r\n\t/**\r\n\t * A visually hidden value of the dropdown provided for accessibility.\r\n\t *\r\n\t * @type {string}\r\n\t * @memberof FauxDropdownProps\r\n\t */\r\n\taccessibleValue: string;\r\n\r\n\t/**\r\n\t * The value (source of truth) for this controlled dropdown.\r\n\t *\r\n\t * @type {(string | null)}\r\n\t * @memberof FauxDropdownProps\r\n\t */\r\n\tvalue: string | null;\r\n\r\n\t/**\r\n\t * The active option value for styling purposes.\r\n\t *\r\n\t * @type {(string | null)}\r\n\t * @memberof FauxDropdownProps\r\n\t */\r\n\tactiveValue: string | null;\r\n\r\n\t/**\r\n\t * The text of the first (default) option.\r\n\t *\r\n\t * @type {(string | null)}\r\n\t * @memberof FauxDropdownProps\r\n\t */\r\n\tdefaultText?: string;\r\n\r\n\t/**\r\n\t * The value of the first (default) option.\r\n\t *\r\n\t * @type {string}\r\n\t * @memberof FauxDropdownProps\r\n\t */\r\n\tdefaultValueId: string;\r\n\r\n\t/**\r\n\t * Width size of the dropdown (min-width in CSS).\r\n\t *\r\n\t * @type {FauxDropdownSize}\r\n\t * @memberof FauxDropdownProps\r\n\t */\r\n\tsize?: FauxDropdownSize;\r\n\r\n\t/**\r\n\t * The method that triggers when an option is selected. Takes the option value as a parameter.\r\n\t *\r\n\t * @memberof FauxDropdownProps\r\n\t */\r\n\tonChange: (value) => void;\r\n}\r\n\r\nexport type FauxDropdownSize = 'small' | 'default';\r\n\r\n/**\r\n * The class for an option list.\r\n *\r\n * @export\r\n * @interface FauxDropdownOptionList\r\n */\r\nexport interface FauxDropdownOptionList {\r\n\t/**\r\n\t * A list of options with value and text.\r\n\t *\r\n\t * @type {FauxDropdownOption[]}\r\n\t * @memberof FauxDropdownOptionList\r\n\t */\r\n\tlist?: FauxDropdownOption[];\r\n\r\n\t/**\r\n\t * The title for this list.\r\n\t *\r\n\t * @type {string}\r\n\t * @memberof FauxDropdownOptionList\r\n\t */\r\n\tname?: string;\r\n}\r\n\r\n/**\r\n * An option with value and text\r\n *\r\n * @export\r\n * @interface FauxDropdownOption\r\n */\r\nexport interface FauxDropdownOption {\r\n\tvalue: string;\r\n\ttext: string;\r\n}\r\n\r\nconst toggleButtonSVGClass = 'roc-faux-dropdown__button-toggle-icon';\r\n\r\n/**\r\n * Reusable component for dropdowns and lists of dropdowns. Alternative to select. Fully a11y compliant.\r\n *\r\n * @export\r\n * @param {FauxDropdownProps} props\r\n * @returns\r\n */\r\nexport default function FauxDropdown(props: FauxDropdownProps) {\r\n\tconst {\r\n\t\tlists,\r\n\t\tid,\r\n\t\taccessibleValue,\r\n\t\tvalue,\r\n\t\tactiveValue,\r\n\t\tdefaultText,\r\n\t\tdefaultValueId,\r\n\t\ttestId,\r\n\t\tsize = 'default',\r\n\t\tonChange,\r\n\t} = props;\r\n\r\n\treturn (\r\n\t\t}>\r\n\t\t\t\r\n\t\t\t\t

\r\n\t\t\t\t\t{accessibleValue}\r\n\t\t\t\t

\r\n\r\n\t\t\t\t\r\n\t\t\t\t\t{({ isExpanded }) => (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t{isExpanded ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tclassName=\"roc-faux-dropdown__button\"\r\n\t\t\t\t\t\t\t\tas={'button'}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t{value}\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{defaultText && (\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{defaultText ? defaultText : ''}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t\t\t\t{lists.map((list, listIndex) => (\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{list.list && list.list.length > 0 ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{list.name ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{list.name}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{list.name}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{list.list.map((option, index) => (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{option.text}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)}\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n}\r\n","import React, { RefObject } from 'react';\r\n\r\nexport type RefElementType = RefObject | null;\r\n\r\n/**\r\n * Context to provide ability to set page change alerts from anywhere\r\n *\r\n * @interface VisuallyHiddenAnnouncementContext\r\n */\r\ninterface VisuallyHiddenAnnouncementContext {\r\n\tsetAlert: (message: string) => void;\r\n\tmainRef: RefElementType;\r\n\tsetMainRef: (value: RefElementType) => void;\r\n}\r\n\r\nexport default React.createContext({} as VisuallyHiddenAnnouncementContext);\r\n","/* eslint-disable jsx-a11y/label-has-for */\r\nimport React, { useState } from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\n\r\nexport interface KeepOrDiscardCartProps {\r\n\torderCode: string | null;\r\n\tisSwitching: boolean;\r\n\tselectedOrderCode: string | null;\r\n\tcartName: string | null;\r\n\tswitchCart: (cartName: string | null, discardCart: boolean, orderCode: string | null) => void;\r\n}\r\n\r\n/**\r\n * Displays the interface of keeping or discarding current cart\r\n */\r\nexport default function KeepOrDiscardCart(props: KeepOrDiscardCartProps) {\r\n\tconst [cartName, setCartName] = useState(\r\n\t\tprops.cartName === props.orderCode || props.cartName === Localizer('ShoppingCart') ? '' : props.cartName,\r\n\t);\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t
\r\n\t\t\t\t\r\n\r\n\t\t\t\t
\r\n\t\t\t\t\t setCartName(e.target.value)}\r\n\t\t\t\t\t\tvalue={cartName ?? ''}\r\n\t\t\t\t\t\tdata-testid={`save-cart-input-field`}\r\n\t\t\t\t\t/>\r\n\t\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t\t
\r\n\t\t\t\t props.switchCart(cartName, true, props.isSwitching ? props.selectedOrderCode : null)}\r\n\t\t\t\t\tdata-testid={`cart-save-button`}\r\n\t\t\t\t>\r\n\t\t\t\t\t{Localizer('Save')}\r\n\t\t\t\t\r\n\r\n\t\t\t\t\r\n\t\t\t\t\t\tprops.switchCart(null, false, props.isSwitching ? props.selectedOrderCode ?? null : null)\r\n\t\t\t\t\t}\r\n\t\t\t\t>\r\n\t\t\t\t\t{Localizer('Discard')}\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\r\n\t);\r\n}\r\n","import React, { useEffect, useState } from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport Modal from 'shared/components/Modal';\r\nimport CheckCircleSVG from 'shared/components/svg/CheckCircleSVG';\r\nimport KeepOrDiscardCart from './KeepOrDiscardCart';\r\nimport { OrderStatus, SavedCart } from './types';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport useRocEventHandler, { dispatchRocEvent } from 'shared/hooks/useRocEventHandler';\r\nimport InlineAlert from 'shared/edit/InlineAlert';\r\nimport { MY_ACCOUNT_LOGIN_URL } from 'features/my-account/routes.roc';\r\nimport FauxDropdown, { FauxDropdownOption } from 'shared/components/FauxDropdown';\r\nimport useSavedShoppingCart from './useSavedShoppingCart';\r\n\r\ninterface SavedCartsProps {\r\n\treturnCartSummary?: boolean;\r\n\tselectClassName?: string;\r\n}\r\n\r\n// Default option values for new cart or saved cart\r\nconst NewCartValue = 'newCart';\r\nconst DeleteCartValue = 'deleteCart';\r\nconst SavedCartsValue = 'manageCart';\r\n\r\n/**\r\n * Displays the dropdown with list of saved carts\r\n */\r\nexport default function SavedCarts(props: SavedCartsProps) {\r\n\tconst [orderCode, setOrderCode] = useState();\r\n\tconst [orderStatus, setOrderStatus] = useState();\r\n\tconst [cartTotalItemCount, setCartTotalItemCount] = useState(0);\r\n\tconst [selectedOrderCode, setSelectedOrderCode] = useState(null);\r\n\tconst [savedCarts, setSavedCarts] = useState();\r\n\tconst [cartName, setCartName] = useState(null);\r\n\r\n\tconst [modalOpen, setModalOpen] = useState(false);\r\n\tconst [deleteModalOpen, setDeleteModalOpen] = useState(false);\r\n\r\n\tconst [isLoading, setIsLoading] = useState(false);\r\n\tconst [isUserSignedIn, setIsUserSignedIn] = useState(false);\r\n\tconst [isSwitching, setIsSwitching] = useState(false);\r\n\r\n\tconst useSavedShoppingCarts = useSavedShoppingCart();\r\n\tconst { errorMessage } = useSavedShoppingCarts.state;\r\n\tconst { switchOrUpdateCart, getSavedShoppingCarts } = useSavedShoppingCarts.actor;\r\n\r\n\t// Gets saved carts\r\n\tconst getSavedCarts = async () => {\r\n\t\tconst result = await getSavedShoppingCarts();\r\n\t\tif (!result) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (result.savedCarts) {\r\n\t\t\tsetSavedCarts(result.savedCarts);\r\n\t\t}\r\n\r\n\t\tif (result.orderCode) {\r\n\t\t\tsetOrderCode(result.orderCode);\r\n\t\t}\r\n\r\n\t\tsetOrderStatus(result.orderStatus);\r\n\t\tsetCartTotalItemCount(result.cartTotalItemCount ?? 0);\r\n\t\tsetIsUserSignedIn(result.isUserSignedIn);\r\n\r\n\t\tif (result.cartName) {\r\n\t\t\tsetCartName(result.cartName);\r\n\t\t}\r\n\r\n\t\tdispatchRocEvent('shopping-cart-name-updated', {\r\n\t\t\tcartName: result.cartName,\r\n\t\t});\r\n\t};\r\n\r\n\t// Handles renaming the cart in the list after renaming\r\n\tconst updateCurrentCartName = (cartName: string) => {\r\n\t\tsavedCarts?.forEach((c) => {\r\n\t\t\tif (c.orderCode === orderCode) {\r\n\t\t\t\tc.name = cartName;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tsetCartName(cartName);\r\n\t\tsetSavedCarts(savedCarts);\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tif (orderCode) {\r\n\t\t\tsetIsLoading(false);\r\n\t\t\tsetModalOpen(false);\r\n\t\t}\r\n\t\tif (!savedCarts) {\r\n\t\t\tgetSavedCarts();\r\n\t\t}\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [orderCode]);\r\n\r\n\t// Reloads saved carts\r\n\tuseRocEventHandler(\r\n\t\t'roc-cart-summary-updated',\r\n\t\t(cartSummary) => {\r\n\t\t\tif (orderStatus == OrderStatus.New && cartSummary.cartSummary.items != cartTotalItemCount) {\r\n\t\t\t\tsetCartTotalItemCount(cartSummary.cartSummary.items);\r\n\t\t\t\tdispatchRocEvent('shopping-cart-name-updated', {\r\n\t\t\t\t\tcartName: cartName ? cartName : cartSummary.cartSummary.orderCode,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (cartSummary.cartSummary.items != cartTotalItemCount && orderStatus != OrderStatus.New) {\r\n\t\t\t\tgetSavedCarts();\r\n\t\t\t}\r\n\t\t},\r\n\t\t[getSavedCarts, setCartTotalItemCount],\r\n\t);\r\n\r\n\t// Handles naming the cart and based on this updates the selector\r\n\tuseRocEventHandler(\r\n\t\t'shopping-cart-name-updated',\r\n\t\t(params) => {\r\n\t\t\tif (!params.cartName) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (params.cartName != cartName && orderStatus === OrderStatus.Saved) {\r\n\t\t\t\tupdateCurrentCartName(params.cartName);\r\n\t\t\t}\r\n\r\n\t\t\tconst currentNewCartNamedForTheFirstTime =\r\n\t\t\t\t!cartName && params.cartName != cartName && orderStatus === OrderStatus.New;\r\n\t\t\tif (currentNewCartNamedForTheFirstTime) {\r\n\t\t\t\tgetSavedCarts();\r\n\t\t\t}\r\n\t\t},\r\n\t\t[updateCurrentCartName, getSavedCarts],\r\n\t);\r\n\r\n\t// Saves or discards the current cart and returns the new one or selected one by orderCode\r\n\tconst switchCart = async (\r\n\t\tcartName: string | null,\r\n\t\tsaveCurrentCart: boolean,\r\n\t\torderCode: string | null,\r\n\t\tdeleteCart?: boolean,\r\n\t) => {\r\n\t\tconst result = await switchOrUpdateCart({\r\n\t\t\tname: cartName,\r\n\t\t\tsaveCurrentCart: saveCurrentCart,\r\n\t\t\torderCode: orderCode,\r\n\t\t\treturnCartSummary: props.returnCartSummary,\r\n\t\t\tdeleteCart: deleteCart,\r\n\t\t});\r\n\r\n\t\tif (result) {\r\n\t\t\tsetOrderCode(result.orderCode);\r\n\t\t\tsetOrderStatus(result.orderStatus);\r\n\t\t\tsetCartTotalItemCount(result.cartTotalItemCount ?? 0);\r\n\t\t\tsetSavedCarts(result.savedCarts);\r\n\r\n\t\t\tdispatchRocEvent('shopping-cart-name-updated', {\r\n\t\t\t\tcartName: result.cartName,\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// Reloads the switched or created the new cart\r\n\t\tdispatchRocEvent('cart-switched', {});\r\n\t};\r\n\r\n\t// Handles creating a new cart or switching between existing carts\r\n\tconst handleOnChangeAndBlur = (id: string) => {\r\n\t\tlet cartId: string | null = id;\r\n\r\n\t\tif (cartId === SavedCartsValue) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (!cartId) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (cartId === DeleteCartValue) {\r\n\t\t\tsetDeleteModalOpen(true);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// If the user wants to switch cart for the same one\r\n\t\tif (cartId === orderCode) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (cartId === NewCartValue && !isUserSignedIn) {\r\n\t\t\twindow.location.href = MY_ACCOUNT_LOGIN_URL + '?ReturnUrl=' + encodeURIComponent('/cart');\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (cartId === NewCartValue) {\r\n\t\t\tcartId = null;\r\n\t\t}\r\n\r\n\t\tsetIsLoading(true);\r\n\t\tsetSelectedOrderCode(cartId);\r\n\r\n\t\tif (cartTotalItemCount === 0) {\r\n\t\t\t// If no items are in the current shopping cart it will be discarded if new\r\n\t\t\tswitchCart(null, orderStatus === OrderStatus.New ? false : true, cartId);\r\n\t\t} else {\r\n\t\t\t// Show modal to save or discard the current cart\r\n\t\t\tif (!orderStatus || orderStatus === OrderStatus.New) {\r\n\t\t\t\t// if the user edited the name of the cart, then the modal will not appear\r\n\t\t\t\tif (cartName && cartName != orderCode) {\r\n\t\t\t\t\tswitchCart(cartName, true, selectedOrderCode !== NewCartValue ? selectedOrderCode : null);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tsetIsSwitching(selectedOrderCode !== NewCartValue);\r\n\t\t\t\tsetModalOpen(true);\r\n\t\t\t} else {\r\n\t\t\t\t// Save the current cart and create a new one\r\n\t\t\t\tswitchCart(null, false, cartId);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn;\r\n\t};\r\n\r\n\tconst savedCartsList: FauxDropdownOption[] | undefined = savedCarts?.map((savedCart) => ({\r\n\t\tvalue: savedCart.orderCode,\r\n\t\ttext: `${savedCart.name ?? savedCart.orderCode} - [${savedCart.itemCount}] - ${savedCart.lastModifiedDate}`,\r\n\t}));\r\n\r\n\tlet savedCartsOptionsList: FauxDropdownOption[] = [];\r\n\r\n\tif (cartTotalItemCount > 0) {\r\n\t\tlet newCartText;\r\n\r\n\t\tif (isUserSignedIn) {\r\n\t\t\tnewCartText = Localizer('NewCart');\r\n\t\t} else {\r\n\t\t\tnewCartText = Localizer('NewCart') + ' (' + Localizer('Login') + ')';\r\n\t\t}\r\n\r\n\t\tsavedCartsOptionsList = [{ value: NewCartValue, text: newCartText }];\r\n\r\n\t\tif (isUserSignedIn) {\r\n\t\t\tsavedCartsOptionsList = [\r\n\t\t\t\t...savedCartsOptionsList,\r\n\t\t\t\t{ value: DeleteCartValue, text: Localizer('DeleteCart') },\r\n\t\t\t];\r\n\t\t}\r\n\t}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{errorMessage && }\r\n\r\n\t\t\t
\r\n\t\t\t\t{isLoading && (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\r\n\t\t\t\t{savedCartsOptionsList.length > 0 || (savedCartsList && savedCartsList.length > 0) ? (\r\n\t\t\t\t\t\r\n\t\t\t\t) : null}\r\n\t\t\t
\r\n\r\n\t\t\t Localizer('KeepOrDiscardCart')}\r\n\t\t\t\tcloseModal={() => {\r\n\t\t\t\t\tsetModalOpen(false);\r\n\t\t\t\t\tsetIsLoading(false);\r\n\t\t\t\t}}\r\n\t\t\t\ttitleIcon={}\r\n\t\t\t>\r\n\t\t\t\t\r\n\t\t\t\r\n\r\n\t\t\t Localizer('DeleteCartTitle', cartName ? cartName ?? '' : orderCode ?? '')}\r\n\t\t\t\tcloseModal={() => {\r\n\t\t\t\t\tsetDeleteModalOpen(false);\r\n\t\t\t\t\tsetIsLoading(false);\r\n\t\t\t\t}}\r\n\t\t\t\trenderActions={() => (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\tswitchCart(null, false, null, true);\r\n\t\t\t\t\t\t\t\tsetDeleteModalOpen(false);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{Localizer('Yes')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t setDeleteModalOpen(false)}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{Localizer('No')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t)}\r\n\t\t\t\ttitleIcon={}\r\n\t\t\t>\r\n\t\t\t\t{Localizer('DoYouWantDeleteCurrentCart')}\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n","import axios, { AxiosInstance, AxiosResponse, AxiosError } from 'axios';\r\nimport AccountUrls from 'shared/util/AccountUrls';\r\nimport { getCsrfToken } from './UserData';\r\n\r\n/**\r\n * Helper that creates an instance of Axios to be used throughout the client application\r\n * and adds a default X-Requested-With header to all requests.\r\n *\r\n */\r\nconst AxiosHelper: AxiosInstance = axios.create();\r\nAxiosHelper.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';\r\n\r\n// Add CSRF tokens to all commands that are not GET, HEAD, or OPTIONS\r\nAxiosHelper.interceptors.request.use(async (config) => {\r\n\tif (\r\n\t\tconfig.method?.toLowerCase() !== 'get' &&\r\n\t\tconfig.method?.toLowerCase() !== 'head' &&\r\n\t\tconfig.method?.toLowerCase() !== 'options'\r\n\t) {\r\n\t\tconst csrfToken = await getCsrfToken();\r\n\t\tconfig.headers = { RequestVerificationToken: csrfToken, ...config.headers };\r\n\t}\r\n\treturn config;\r\n});\r\n\r\nexport default AxiosHelper;\r\n\r\n// eslint-disable-next-line no-unused-vars\r\nexport const addUnauthorizedAccessInterceptor = (history) => {\r\n\t// this allows us to act when any request going through axios succeeds or fails.\r\n\tAxiosHelper.interceptors.response.use(\r\n\t\t(response: AxiosResponse) => {\r\n\t\t\treturn response;\r\n\t\t},\r\n\t\t(error: AxiosError) => {\r\n\t\t\tif (error.response && error.response.status === 401) {\r\n\t\t\t\twindow.location.replace(\r\n\t\t\t\t\t`${AccountUrls.Login}?ReturnUrl=${encodeURIComponent(window.location.pathname)}`,\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\treturn Promise.reject(error);\r\n\t\t},\r\n\t);\r\n};\r\n","import { AxiosError } from 'axios';\r\nimport { useState } from 'react';\r\nimport AxiosHelper from 'services/AxiosHelper';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { CartSummary } from 'services/UserData.Commerce';\r\nimport { dispatchRocEvent } from 'shared/hooks/useRocEventHandler';\r\nimport { OrderStatus, SavedCart } from './types';\r\n\r\nexport interface SavedCartResponse {\r\n\tsavedCarts: SavedCart[] | null;\r\n\torderCode?: string;\r\n\torderStatus?: OrderStatus;\r\n\tcartTotalItemCount?: number;\r\n\tcartSummary: CartSummary;\r\n\tisUserSignedIn: boolean;\r\n\tcartName: string;\r\n}\r\n\r\nexport interface SwitchCartRequest {\r\n\tname?: string | null;\r\n\tsaveCurrentCart?: boolean;\r\n\torderCode?: string | null;\r\n\tdeleteCart?: boolean;\r\n\treturnCartSummary: boolean | undefined;\r\n}\r\n\r\nexport interface UseSavedShoppingCart {\r\n\tstate: UseSavedShoppingCartState;\r\n\tactor: UseSavedShoppingCartActor;\r\n}\r\n\r\nexport interface UseSavedShoppingCartState {\r\n\terrorMessage: string | null;\r\n}\r\n\r\nexport interface UseSavedShoppingCartActor {\r\n\tgetSavedShoppingCarts: () => Promise;\r\n\tswitchOrUpdateCart: ({}: SwitchCartRequest) => Promise;\r\n}\r\n\r\nexport interface UseSavedShoppingCartParams {}\r\n\r\nexport default function useShoppingCart(): UseSavedShoppingCart {\r\n\tconst [errorMessage, setErrorMessage] = useState(null);\r\n\r\n\t// Gets saved carts\r\n\tconst getSavedShoppingCarts = async (): Promise => {\r\n\t\tsetErrorMessage(null);\r\n\r\n\t\ttry {\r\n\t\t\tconst result = await AxiosHelper.get('/ajax/cart/get-saved-carts');\r\n\t\t\treturn result.data;\r\n\t\t} catch (error) {\r\n\t\t\tconsole.warn(`Error when getting saved carts`, error);\r\n\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.data && axiosError.response.data.message) {\r\n\t\t\t\tsetErrorMessage(axiosError.response.data.message);\r\n\t\t\t} else {\r\n\t\t\t\tsetErrorMessage(Localizer('ProblemWithGettingSavedCarts'));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t};\r\n\r\n\t// Saves or discards the current cart and returns the new one or selected one by orderCode\r\n\tconst switchOrUpdateCart = async ({\r\n\t\tname = null,\r\n\t\tsaveCurrentCart = false,\r\n\t\torderCode = null,\r\n\t\tdeleteCart = false,\r\n\t\treturnCartSummary = true,\r\n\t}: SwitchCartRequest): Promise => {\r\n\t\tsetErrorMessage(null);\r\n\r\n\t\ttry {\r\n\t\t\tconst result = await AxiosHelper.post('/ajax/cart/switch', {\r\n\t\t\t\tname: name,\r\n\t\t\t\tsaveCurrentCart: saveCurrentCart,\r\n\t\t\t\torderCode: orderCode,\r\n\t\t\t\treturnCartSummary: returnCartSummary,\r\n\t\t\t\tdeleteCart: deleteCart,\r\n\t\t\t});\r\n\r\n\t\t\tif (result.data && returnCartSummary) {\r\n\t\t\t\tdispatchRocEvent('roc-cart-summary-updated', { cartSummary: result.data.cartSummary });\r\n\t\t\t}\r\n\r\n\t\t\treturn result.data;\r\n\t\t} catch (error) {\r\n\t\t\tconsole.warn(`Error when saving or discarding ${orderCode}' cart`, error);\r\n\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.data && axiosError.response.data.message) {\r\n\t\t\t\tsetErrorMessage(axiosError.response.data.message);\r\n\t\t\t} else {\r\n\t\t\t\tsetErrorMessage(Localizer('ProblemWithSwitchingCart'));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t};\r\n\r\n\treturn {\r\n\t\tstate: {\r\n\t\t\terrorMessage,\r\n\t\t},\r\n\t\tactor: {\r\n\t\t\tgetSavedShoppingCarts,\r\n\t\t\tswitchOrUpdateCart,\r\n\t\t},\r\n\t};\r\n}\r\n","import React from 'react';\r\nimport classnames from 'classnames';\r\nimport CircleExclamationSVG from 'shared/components/svg/CircleExclamationSVG';\r\nimport { useField } from 'react-final-form';\r\n\r\ninterface FieldInputErrorWrapperProps {\r\n\thideIcon?: boolean;\r\n\tchildren: React.ReactNode;\r\n\tinline?: boolean;\r\n\tname: string;\r\n}\r\n\r\n/**\r\n * Component for handling the invalid styles for inputs.\r\n *\r\n * @export\r\n * @param {FieldInputErrorWrapperProps} props\r\n * @returns\r\n */\r\nexport default function FieldInputErrorWrapper(props: FieldInputErrorWrapperProps) {\r\n\tconst { hideIcon = false, children, inline = false, name } = props;\r\n\tconst { meta } = useField(name);\r\n\tconst invalid =\r\n\t\t(meta.error || (meta.submitError && !meta.dirtySinceLastSubmit && !meta.submitting)) &&\r\n\t\tmeta.touched &&\r\n\t\tmeta.invalid\r\n\t\t\t? meta.invalid\r\n\t\t\t: false;\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{children}\r\n\t\t\t{invalid && !hideIcon ? : null}\r\n\t\t
\r\n\t);\r\n}\r\n","import React, { useState } from 'react';\r\nimport VisuallyHiddenAnnouncementContext, { RefElementType } from './VisuallyHiddenAnnouncementContext';\r\n\r\ninterface VisuallyHiddenAnnouncementProps {\r\n\tchildren: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Displays a page change alert for screen readers\r\n *\r\n * @param {*} props\r\n * @returns\r\n */\r\nfunction VisuallyHiddenAnnouncement(props: VisuallyHiddenAnnouncementProps) {\r\n\tconst [alert, setAlert] = useState('');\r\n\tconst [mainRef, setMainRef] = useState(null);\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{props.children}\r\n\t\t\t
\r\n\t\t\t\t{alert}\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n}\r\n\r\nexport default VisuallyHiddenAnnouncement;\r\n","import React from 'react';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport { Localizer, LocalizedSpan, LocalizerResourceKey } from 'services/Localizer';\r\n\r\n/**\r\n * Removal Confirmation With Undo Props\r\n */\r\ninterface ChangeConfirmationWithUndoProps {\r\n\titemName: string;\r\n\titemUrl: string;\r\n\tisLoading: boolean;\r\n\tmessageResourceKey: LocalizerResourceKey;\r\n\tonUndo: () => void;\r\n}\r\n\r\n/**\r\n * Removal Confirmation WithUndo Component. Renders a shopping cart remove undo button with some info.\r\n * @param props\r\n */\r\nexport default function ChangeConfirmationWithUndo(props: ChangeConfirmationWithUndoProps) {\r\n\tconst { isLoading, itemName, itemUrl, onUndo, messageResourceKey } = props;\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t${itemName}`]}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{Localizer('Undo')} {isLoading ? : null}\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { MoveStatus } from './types';\r\nimport ChangeConfirmationWithUndo from 'shared/components/commerce/ChangeConfirmationWithUndo';\r\nimport { LocalizerResourceKey } from 'services/Localizer';\r\nimport { useShoppingCartContext } from './ShoppingCartContext';\r\n\r\n/**\r\n * Shopping Cart Item Action Info Component\r\n * Displays the last cart action and an undo button\r\n */\r\nexport default function ShoppingCartItemActionInfo() {\r\n\tconst {\r\n\t\tstate: { lastMoveStatus, isUndoClickedState, storedForUndoItem: item },\r\n\t\tactor: { handleUndo },\r\n\t} = useShoppingCartContext();\r\n\r\n\t// no last removed item\r\n\tif (!item) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\t// Choose correct string to show\r\n\tlet messageResourceKey: LocalizerResourceKey;\r\n\tswitch (lastMoveStatus) {\r\n\t\tcase MoveStatus.RemovedFromCart:\r\n\t\tcase MoveStatus.RemovedFromSaved:\r\n\t\t\tmessageResourceKey = 'RemovedItemWithLink';\r\n\t\t\tbreak;\r\n\t\tcase MoveStatus.MovedToCart:\r\n\t\t\tmessageResourceKey = 'MovedToCartItemWithLink';\r\n\t\t\tbreak;\r\n\t\tcase MoveStatus.MovedToSaved:\r\n\t\t\tmessageResourceKey = 'SavedItemWithLink';\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\treturn null;\r\n\t}\r\n\r\n\tconst itemUrl = item.groupUrl ? item.groupUrl : item.url;\r\n\r\n\treturn (\r\n\t\t\r\n\t);\r\n}\r\n","import React, { useEffect, useState } from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { ServerData } from 'services/ServerData';\r\nimport FauxDropdown from '../FauxDropdown';\r\n\r\nexport interface QuantityProps {\r\n\tdisabled: boolean;\r\n\tindex: number;\r\n\titemId: string;\r\n\titemName: string;\r\n\tinitialQuantity: number;\r\n\tupdateQuantity: (quantity: number) => void;\r\n\t//#region TapeCase\r\n\tminimumOrderQuantity: number | null;\r\n\t//#endregion\r\n}\r\n\r\n/**\r\n * The quantity field displaying drop down or input based on MaxNumberForQuantityDropdown setting\r\n * @param props\r\n * @returns\r\n */\r\nexport default function Quantity(props: QuantityProps) {\r\n\tconst { disabled, index, itemId, itemName, initialQuantity, updateQuantity } = props;\r\n\tconst MAX_NUMBER_FOR_DROPDOWN = ServerData.MaxNumberForQuantityDropdown || 10;\r\n\r\n\tconst [currentQuantity, setCurrentQuantity] = useState(initialQuantity);\r\n\t//#region TapeCase\r\n\t//const [showDropDown, setShowDropDown] = useState(initialQuantity < MAX_NUMBER_FOR_DROPDOWN);\r\n\tconst [showDropDown, setShowDropDown] = useState(false);\r\n\t//#endregion\r\n\tconst [isEditingQuantity, setIsEditingQuantity] = useState(false);\r\n\r\n\tconst range = (n) => Array.from({ length: n - 1 }, (value, key) => key + 1);\r\n\r\n\tuseEffect(() => {\r\n\t\t// Set separate state quantity for user updates cart item quantity.\r\n\t\tsetCurrentQuantity(initialQuantity);\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [initialQuantity, itemId]);\r\n\r\n\t/**\r\n\t * Switching dropdown to input or calling the provided callback in component's properties which is supposed to handle item's quantity update\r\n\t * @param value\r\n\t * @returns\r\n\t */\r\n\tconst handleQuantityChange = (value) => {\r\n\t\tconst newQuantity = Number.parseInt(value);\r\n\t\tif (newQuantity >= MAX_NUMBER_FOR_DROPDOWN) {\r\n\t\t\tsetShowDropDown(false);\r\n\t\t\tsetIsEditingQuantity(true);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetCurrentQuantity(newQuantity);\r\n\t\tupdateQuantity(newQuantity);\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the state with the provided quantity but no changes are made to the item itself\r\n\t * @param changeEvent\r\n\t */\r\n\tconst handleItemQuantityEdit = (changeEvent: React.ChangeEvent) => {\r\n\t\tconst newQuantity = Number.parseInt(changeEvent.target.value);\r\n\t\tif (isNaN(newQuantity) || newQuantity == Infinity || newQuantity == -Infinity) {\r\n\t\t\tsetCurrentQuantity(null);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (newQuantity < 1) {\r\n\t\t\t// do not allow to set quantity < 1\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetCurrentQuantity(newQuantity);\r\n\t\tsetIsEditingQuantity(newQuantity !== initialQuantity);\r\n\t};\r\n\r\n\t/**\r\n\t * Runs when the update input keydown is fired.\r\n\t *\r\n\t * @param {*} e\r\n\t */\r\n\tfunction handleUpdateKeyDown(e) {\r\n\t\tif (e.key === 'Enter') {\r\n\t\t\thandleItemQuantityUpdate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Handles item quantity update by calling the provided callback in component's properties which is supposed to handle item's quantity update\r\n\t * @param mouseEvent\r\n\t */\r\n\tconst handleItemQuantityUpdate = () => {\r\n\t\tsetIsEditingQuantity(false);\r\n\r\n\t\tif (currentQuantity === null) {\r\n\t\t\tsetCurrentQuantity(initialQuantity);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tupdateQuantity(currentQuantity);\r\n\t\t//#region TapeCase\r\n\t\t//setShowDropDown(currentQuantity < MAX_NUMBER_FOR_DROPDOWN);\r\n\t\t//#endregion\r\n\t\tsetIsEditingQuantity(false);\r\n\t};\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{showDropDown ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t{/* eslint-disable-next-line jsx-a11y/label-has-for */}\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t) : (\r\n\t\t\t\t<>\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\t{props.minimumOrderQuantity != null && props.minimumOrderQuantity > 1 ? (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\tMOQ: \r\n\t\t\t\t\t\t\t\t{props.minimumOrderQuantity}{' '}\r\n\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t{isEditingQuantity && (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t currentQuantity\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//#endregion}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t{Localizer('Update')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)}\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Lock SVG component\r\n *\r\n * @returns\r\n */\r\nfunction LockSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default LockSVG;\r\n","import React from 'react';\r\nimport LazyImage from 'shared/assets/LazyImage';\r\nimport { AssetType } from 'shared/assets/types';\r\nimport ProductPricing from 'shared/components/commerce/ProductPricing';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport {\r\n\t/*#region TapeCase */ GetPriceForMinimumAvailableQuantity,\r\n\t/*GetPriceForQuantity,#endregion*/ GetPricingLine,\r\n} from '../pricing/pricing-result';\r\nimport { productAssetPlaceholder } from '../product-details/ProductAssets';\r\nimport { ProductAsset } from '../product-details/types';\r\nimport { RecentlyViewedProduct as Model } from './useRecentlyViewedProducts';\r\nimport { dispatchRocEvent } from 'shared/hooks/useRocEventHandler';\r\n\r\ninterface RecentlyViewedProductProps {\r\n\tproduct: Model;\r\n\tuseTinySliderLazyLoading?: boolean;\r\n}\r\n\r\n/**\r\n * Renders a single product that was recently viewed\r\n */\r\nexport default function RecentlyViewedProduct(props: RecentlyViewedProductProps) {\r\n\tconst { product } = props;\r\n\tconst compareAssets = (a: ProductAsset, b: ProductAsset) => a.sortOrder - b.sortOrder;\r\n\tconst defaultAsset = product?.assets?.sort(compareAssets).find((asset) => asset.assetType === AssetType.Image);\r\n\tconst mainImage = defaultAsset ?? productAssetPlaceholder;\r\n\r\n\tlet customUrl: string = '#';\r\n\tif (product?.summary?.meta?.url) {\r\n\t\tcustomUrl = product.summary.meta.url;\r\n\t}\r\n\r\n\tconst line = product.displayPricing && GetPricingLine(product.displayPricing, product.id);\r\n\tconst displayPrice =\r\n\t\tline &&\r\n\t\t/*#region TapeCase GetPriceForQuantity(line.prices, 1)*/ GetPriceForMinimumAvailableQuantity(\r\n\t\t\tline.prices,\r\n\t\t); /*#endregion*/\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t\r\n\t\t\t\t\tdispatchRocEvent('product-clicked', {\r\n\t\t\t\t\t\tproductId: product.id,\r\n\t\t\t\t\t\turl: customUrl,\r\n\t\t\t\t\t\tproductName: product.summary ? product.summary.name : '',\r\n\t\t\t\t\t\tproductGroupId: product.summary?.productGroupId ?? null,\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t>\r\n\t\t\t\t{mainImage !== null ? (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t{props.useTinySliderLazyLoading ? (\r\n\t\t\t\t\t\t\t// Use tiny-slider's built-in lazy image loading to lazily load the image\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t
\r\n\t\t\t\t) : null}\r\n\t\t\t\t{product.summary ? (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{product.summary.name}\r\n\t\t\t\t\t\r\n\t\t\t\t) : null}\r\n\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n}\r\n","import { ProductDetailsState } from '../product-details/types';\r\nimport { useEffect, useState } from 'react';\r\nimport AxiosHelper from 'services/AxiosHelper';\r\nimport { ServerData } from '../../../services/ServerData';\r\nimport { getPartialProductData } from '../product-details/data';\r\n\r\ntype ViewTracked = {\r\n\tlastViewed: number;\r\n};\r\n\r\ntype SparseProductDetailsState = Pick &\r\n\tPartial>;\r\n\r\nconst sparseProductDetailsStateKeys: (keyof SparseProductDetailsState)[] = [\r\n\t'summary',\r\n\t'assets',\r\n\t'pricingLines',\r\n\t'displayPricing',\r\n];\r\n\r\n/**\r\n * Recently viewed product\r\n */\r\nexport type RecentlyViewedProduct = SparseProductDetailsState & ViewTracked;\r\n\r\n/**\r\n * Use recently viewed products hook params\r\n */\r\ninterface UseRecentlyViewedProductsParams {\r\n\tcurrentProduct?: ProductDetailsState | null;\r\n\tactive?: boolean;\r\n}\r\n\r\n/**\r\n * Use recently viewed products context\r\n */\r\ninterface RecentlyViewedProductsContext {\r\n\tproducts: RecentlyViewedProduct[];\r\n\ttimestamp: number | null;\r\n}\r\n\r\nclass RecentlyViewedProductsRepository {\r\n\t/**\r\n\t * Recently viewed product local storage key name\r\n\t */\r\n\tprivate keyName: string = 'RocRecentlyViewedProductsContext';\r\n\r\n\t/**\r\n\t * Get all recently viewed products from the local storage, including those that may no longer be valid.\r\n\t */\r\n\tpublic getAllMayIncludeInvalid(): RecentlyViewedProduct[] {\r\n\t\tlet context: RecentlyViewedProductsContext | null = null;\r\n\t\ttry {\r\n\t\t\tconst stateStr = localStorage.getItem(this.keyName);\r\n\t\t\tif (stateStr !== null) {\r\n\t\t\t\tcontext = JSON.parse(stateStr);\r\n\t\t\t\tif (context && context.timestamp) {\r\n\t\t\t\t\tconst expirationTime = 1000 * 60 * 60 * 24 * 64; // 60 days in milliseconds\r\n\t\t\t\t\tif (new Date().valueOf() - context.timestamp >= expirationTime) {\r\n\t\t\t\t\t\tlocalStorage.removeItem(this.keyName); // remove data because it has expired\r\n\t\t\t\t\t\tcontext = null;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\tconsole.warn('Error when getting recently viewed products from local storage.', error);\r\n\t\t}\r\n\r\n\t\tif (!context || context.products === null) {\r\n\t\t\treturn new Array();\r\n\t\t}\r\n\r\n\t\treturn context.products;\r\n\t}\r\n\r\n\t/**\r\n\t * Get all recently viewed products from the local storage, except those that the server deems are invalid.\r\n\t */\r\n\tpublic async getAllValidOnly(): Promise {\r\n\t\tconst validProducts = await this.filterOutInvalid(this.getAllMayIncludeInvalid());\r\n\r\n\t\tthis.setAll(validProducts);\r\n\r\n\t\treturn validProducts;\r\n\t}\r\n\r\n\t/**\r\n\t * Filter out invalid products from the passed in list by querying the server.\r\n\t */\r\n\tprivate async filterOutInvalid(products: RecentlyViewedProduct[]) {\r\n\t\ttry {\r\n\t\t\tconst now: number = new Date().valueOf();\r\n\t\t\t// Obtain timespan from settings; default to 1 hour in milliseconds.\r\n\t\t\tconst timeSpan: number = ServerData.MinimumTimeBeforeRecentlyViewedProductsAreValidated || 60 * 60 * 1000;\r\n\r\n\t\t\tconst outsideTimeSpan: RecentlyViewedProduct[] = products.filter((p) => now - p.lastViewed > timeSpan);\r\n\t\t\tconst withinTimeSpan: RecentlyViewedProduct[] = products.filter((p) => now - p.lastViewed <= timeSpan);\r\n\r\n\t\t\tif (outsideTimeSpan.length > 0) {\r\n\t\t\t\tconst validProductIds: string[] = (\r\n\t\t\t\t\tawait AxiosHelper.get('/ajax/commerce/products/recently-viewed/filter-out-invalid', {\r\n\t\t\t\t\t\tparams: { productIds: outsideTimeSpan.map((product) => product.id) },\r\n\t\t\t\t\t})\r\n\t\t\t\t).data.map((id) => id.toLowerCase());\r\n\r\n\t\t\t\tconst validOutsideTimeSpan: RecentlyViewedProduct[] = outsideTimeSpan.filter((product) =>\r\n\t\t\t\t\tvalidProductIds.includes(product.id.toLowerCase()),\r\n\t\t\t\t);\r\n\r\n\t\t\t\tfor (const product of validOutsideTimeSpan) {\r\n\t\t\t\t\tproduct.lastViewed = now;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn withinTimeSpan.concat(validOutsideTimeSpan);\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error(`An error occurred while filtering out invalid products: ${error.message}`);\r\n\t\t}\r\n\r\n\t\treturn products;\r\n\t}\r\n\r\n\t/**\r\n\t * Update recently viewed products state in the local storage\r\n\t */\r\n\tpublic setAll(products: RecentlyViewedProduct[]) {\r\n\t\tconst context: RecentlyViewedProductsContext = {\r\n\t\t\tproducts,\r\n\t\t\ttimestamp: new Date().valueOf(),\r\n\t\t};\r\n\t\tlocalStorage.setItem(this.keyName, JSON.stringify(context));\r\n\t}\r\n}\r\n\r\nconst repository = new RecentlyViewedProductsRepository();\r\n\r\n/**\r\n * Custom hook for recently viewed products\r\n */\r\nexport default function useRecentlyViewedProducts({\r\n\tcurrentProduct,\r\n\tactive = true,\r\n}: UseRecentlyViewedProductsParams): RecentlyViewedProduct[] {\r\n\tconst maxPersistedProducts = 5;\r\n\tconst [recentlyViewedProducts, setRecentlyViewedProducts] = useState([]);\r\n\r\n\t/** Retrieve the partial product state for an arbitrary product */\r\n\tasync function getProductStateAsync(productId: string) {\r\n\t\ttry {\r\n\t\t\tconst productState = await getPartialProductData({\r\n\t\t\t\tid: productId,\r\n\t\t\t\tmissingKeys: sparseProductDetailsStateKeys,\r\n\t\t\t});\r\n\t\t\tconsole.debug('Product state retrieved:', productState);\r\n\r\n\t\t\tif (productState != null) {\r\n\t\t\t\tconst recentlyViewedProduct: RecentlyViewedProduct = {\r\n\t\t\t\t\t...productState,\r\n\t\t\t\t\tid: productId,\r\n\t\t\t\t\tlastViewed: new Date().valueOf(),\r\n\t\t\t\t};\r\n\r\n\t\t\t\treturn recentlyViewedProduct;\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error(error);\r\n\t\t}\r\n\r\n\t\tconsole.error('Failed to retrieve the product with the given id:', productId);\r\n\t\treturn null;\r\n\t}\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!active) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t(async () => {\r\n\t\t\tlet recentlyViewedProductDtos = await repository.getAllValidOnly();\r\n\r\n\t\t\t// process current product only when it was fully loaded w/o any errors\r\n\t\t\tif (currentProduct != null) {\r\n\t\t\t\tconst currentProductDto: RecentlyViewedProduct = {\r\n\t\t\t\t\tid: currentProduct.id,\r\n\t\t\t\t\tsummary: currentProduct.summary,\r\n\t\t\t\t\tassets: currentProduct.assets,\r\n\t\t\t\t\tpricingLines: currentProduct.pricingLines,\r\n\t\t\t\t\tdisplayPricing: currentProduct.displayPricing,\r\n\t\t\t\t\tlastViewed: new Date().valueOf(),\r\n\t\t\t\t};\r\n\r\n\t\t\t\t// If the product is already in the recently review list, remove it because it will be reinserted at the end of this method in order to refresh it with up to date data.\r\n\t\t\t\tconst currentProductIndex = recentlyViewedProductDtos.findIndex(\r\n\t\t\t\t\t(item) => item.id === currentProductDto.id,\r\n\t\t\t\t);\r\n\t\t\t\tif (currentProductIndex > -1) {\r\n\t\t\t\t\trecentlyViewedProductDtos.splice(currentProductIndex, 1);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// If the product doesn't have a parent, add it to recently viewed.\r\n\t\t\t\t// If the user ended up following a direct link to a simple with a parent, it will not be added to recently viewed despite this being undesirable.\r\n\t\t\t\tif (currentProductDto.summary != null) {\r\n\t\t\t\t\tconst groupId = currentProductDto.summary.productGroupId;\r\n\t\t\t\t\tif (groupId == null) {\r\n\t\t\t\t\t\trecentlyViewedProductDtos.unshift(currentProductDto); // insert current item at the first place\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconst groupIndex = recentlyViewedProductDtos.findIndex((item) => item.id === groupId);\r\n\t\t\t\t\t\tif (groupIndex > 0) {\r\n\t\t\t\t\t\t\t// Move the group to the front of the list but don't reload it.\r\n\t\t\t\t\t\t\tconst groupProducts = recentlyViewedProductDtos.splice(groupIndex, 1);\r\n\t\t\t\t\t\t\trecentlyViewedProductDtos.unshift(groupProducts[0]);\r\n\t\t\t\t\t\t} else if (groupIndex === -1) {\r\n\t\t\t\t\t\t\t// Attempt to retrieve enough product state information to insert a recently viewed product entry for the group.\r\n\t\t\t\t\t\t\tconst currentGroupDto = await getProductStateAsync(groupId);\r\n\t\t\t\t\t\t\tif (currentGroupDto != null) {\r\n\t\t\t\t\t\t\t\trecentlyViewedProductDtos.unshift(currentGroupDto);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trecentlyViewedProductDtos = recentlyViewedProductDtos.slice(0, maxPersistedProducts);\r\n\t\t\t\trepository.setAll(recentlyViewedProductDtos);\r\n\t\t\t\trecentlyViewedProductDtos = recentlyViewedProductDtos.filter(\r\n\t\t\t\t\t(p) => p.id !== currentProductDto.id && p.id !== currentProductDto.summary?.productGroupId,\r\n\t\t\t\t); // exclude current product and/or group from being rendered\r\n\t\t\t}\r\n\r\n\t\t\tsetRecentlyViewedProducts(recentlyViewedProductDtos);\r\n\t\t})();\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [currentProduct && currentProduct.id, active]);\r\n\r\n\treturn recentlyViewedProducts;\r\n}\r\n","import debounce from 'lodash-es/debounce';\r\nimport React, { useEffect, useRef } from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport { useInViewOnce } from 'shared/hooks/useInViewOnce';\r\nimport type { TinySliderInstance, TinySliderSettings } from 'tiny-slider/src/tiny-slider';\r\nimport uuid from 'uuid/v4';\r\nimport { getInitialProductDetailsState } from '../product-details/types';\r\nimport RecentlyViewedProduct from './RecentlyViewedProduct';\r\nimport useRecentlyViewedProducts from './useRecentlyViewedProducts';\r\nimport { sm, md, lg } from 'shared/breakpoints';\r\n\r\ninterface RecentlyViewedProductsProps {\r\n\t/** If this originated from a tab, this will be the ID of that tab */\r\n\ttabId?: string;\r\n\tdisplaytitle?: boolean;\r\n}\r\n\r\n/**\r\n * Represents a listing of recently viewed products for a user, found as a \"tab\" under the product details page.\r\n * This is not a standard react component and relies on global state to function properly.\r\n */\r\nexport default function RecentlyViewedProducts(props: RecentlyViewedProductsProps) {\r\n\tconst productDetailsState = getInitialProductDetailsState();\r\n\tconst recentlyViewedProducts = useRecentlyViewedProducts({ currentProduct: productDetailsState, active: true });\r\n\tconst currentInstanceId = useRef('recently-viewed-products-slider-' + uuid()).current;\r\n\tconst sliderRef = useRef(null);\r\n\r\n\tconst { displaytitle = false } = props;\r\n\r\n\tconst [ref, inView] = useInViewOnce({\r\n\t\tthreshold: 0,\r\n\t});\r\n\r\n\tconst tnsPromise = import('tiny-slider/src/tiny-slider').then((module) => module.tns);\r\n\tconst oneItemClass = 'roc-product-list--one-item';\r\n\tconst twoItemClass = 'roc-product-list--two-items';\r\n\tconst threeItemClass = 'roc-product-list--three-items';\r\n\tconst fiveItemClass = 'roc-product-list--five-items';\r\n\r\n\t// Handle debouncing the recreation of tiny-slider on resize\r\n\tconst handleResizeDebounced = () => {\r\n\t\tinitializeSlider();\r\n\t};\r\n\r\n\tconst executeResizeDebounced = debounce(handleResizeDebounced, 200);\r\n\r\n\t// bind tiny-slider on startup or resize\r\n\tconst initializeSlider = () => {\r\n\t\tif (sliderRef.current) {\r\n\t\t\tsliderRef.current.destroy();\r\n\t\t}\r\n\r\n\t\t(async () => {\r\n\t\t\tconst currentSliderDiv = document.getElementById(currentInstanceId);\r\n\t\t\tconst tns = await tnsPromise;\r\n\r\n\t\t\tconst getTinySliderInstance = (props: { itemsToShow: number }) => {\r\n\t\t\t\tconst options: TinySliderSettings = {\r\n\t\t\t\t\tcontainer: `#${currentInstanceId}`,\r\n\t\t\t\t\titems: props.itemsToShow,\r\n\t\t\t\t\tslideBy: 'page',\r\n\t\t\t\t\tcontrols: false,\r\n\t\t\t\t\tmouseDrag: true,\r\n\t\t\t\t\tgutter: 15,\r\n\t\t\t\t\tlazyload: true,\r\n\t\t\t\t\tloop: false,\r\n\t\t\t\t};\r\n\r\n\t\t\t\treturn tns(options);\r\n\t\t\t};\r\n\r\n\t\t\tif (currentSliderDiv) {\r\n\t\t\t\tconst trackElement = currentSliderDiv.parentElement;\r\n\t\t\t\tconst parentRocProductList = currentSliderDiv.closest('.roc-product-list');\r\n\t\t\t\tif (trackElement && parentRocProductList) {\r\n\t\t\t\t\tconst containerWidth = trackElement.offsetWidth;\r\n\t\t\t\t\t// Different tiny-slider settings based on parent element width.\r\n\t\t\t\t\t// The \"responsive\" option on tiny slider is based on window width, not container element width, so we can't use it in this case\r\n\t\t\t\t\tif (containerWidth < sm) {\r\n\t\t\t\t\t\t// 1 item\r\n\t\t\t\t\t\tparentRocProductList.classList.remove(twoItemClass, threeItemClass, fiveItemClass);\r\n\t\t\t\t\t\tparentRocProductList.classList.add(oneItemClass);\r\n\r\n\t\t\t\t\t\tsliderRef.current = getTinySliderInstance({ itemsToShow: 1 });\r\n\t\t\t\t\t} else if (containerWidth < md) {\r\n\t\t\t\t\t\t// 2 items\r\n\t\t\t\t\t\tparentRocProductList.classList.remove(oneItemClass, threeItemClass, fiveItemClass);\r\n\t\t\t\t\t\tparentRocProductList.classList.add(twoItemClass);\r\n\r\n\t\t\t\t\t\tsliderRef.current = getTinySliderInstance({ itemsToShow: 2 });\r\n\t\t\t\t\t} else if (containerWidth < lg) {\r\n\t\t\t\t\t\t// 3 items\r\n\t\t\t\t\t\tparentRocProductList.classList.remove(oneItemClass, twoItemClass, fiveItemClass);\r\n\t\t\t\t\t\tparentRocProductList.classList.add(threeItemClass);\r\n\r\n\t\t\t\t\t\tsliderRef.current = getTinySliderInstance({ itemsToShow: 3 });\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// 5 items\r\n\t\t\t\t\t\tparentRocProductList.classList.remove(oneItemClass, twoItemClass, threeItemClass);\r\n\t\t\t\t\t\tparentRocProductList.classList.add(fiveItemClass);\r\n\r\n\t\t\t\t\t\tsliderRef.current = getTinySliderInstance({ itemsToShow: 5 });\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// if there's a re-render, or possibly hmr, make sure to destroy the instance\r\n\t\t\t// to avoid memory leaks.\r\n\t\t\treturn () => {\r\n\t\t\t\tif (sliderRef.current) {\r\n\t\t\t\t\tsliderRef.current.destroy();\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t})();\r\n\t};\r\n\r\n\t// Bind tiny-slider on startup\r\n\tuseEffect(() => {\r\n\t\tinitializeSlider();\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [inView, recentlyViewedProducts]);\r\n\r\n\t// Set up an event handler to re-create the tiny slider when the window is resized\r\n\tuseEffect(() => {\r\n\t\tconst handleResize = () => {\r\n\t\t\texecuteResizeDebounced();\r\n\t\t};\r\n\r\n\t\twindow.addEventListener('resize', handleResize);\r\n\r\n\t\treturn () => {\r\n\t\t\twindow.removeEventListener('resize', handleResize);\r\n\t\t};\r\n\t}, [executeResizeDebounced]);\r\n\r\n\tif (!recentlyViewedProducts || recentlyViewedProducts.length === 0 || !inView) {\r\n\t\treturn
;\r\n\t}\r\n\r\n\treturn (\r\n\t\t}>\r\n\t\t\t
\r\n\t\t\t\t{displaytitle ?

{Localizer('RecentlyViewedProducts')}

: null}\r\n\r\n\t\t\t\t
\r\n\t\t\t\t\t{recentlyViewedProducts.map((item, i) => (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t))}\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n}\r\n","import React, { useState } from 'react';\r\nimport CircleButton from 'shared/components/CircleButton';\r\nimport { useBaseAxiosSubmitter } from 'shared/hooks/useBaseAxiosSubmitter';\r\nimport { AxiosError } from 'axios';\r\nimport { Order, OrderPromotion } from './types';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport { OrderMessage } from './OrderMessages';\r\n\r\ninterface ShoppingCartPromoItemProps {\r\n\torder: Order;\r\n\torderPromotion: OrderPromotion;\r\n\tupdateOrder: (newCart: Order) => void;\r\n\tcouponRemovedCallback?: () => void;\r\n\t/**\r\n\t * Sets order messages to displayed whenever the server returns order related ajax requests\r\n\t * within this component or its children.\r\n\t */\r\n\tupdateOrderMessages: (orderMessages: OrderMessage[]) => void;\r\n}\r\n\r\ninterface RemoveCouponRequest {\r\n\torderId: string | null | undefined;\r\n\torderPromotionId: string | null;\r\n}\r\n\r\ninterface RemoveCouponResponse {\r\n\tcart: Order;\r\n\torderMessages: OrderMessage[];\r\n}\r\n\r\n/**\r\n * Shopping Cart Promo Item\r\n */\r\nfunction ShoppingCartPromoItem(props: ShoppingCartPromoItemProps) {\r\n\tconst { order, orderPromotion, updateOrder, couponRemovedCallback, updateOrderMessages } = props;\r\n\r\n\tconst [isRemoveSpinnerDisplayed, setIsRemoveSpinnerDisplayed] = useState(false);\r\n\r\n\tconst removeCouponSubmitter = useBaseAxiosSubmitter(\r\n\t\t{\r\n\t\t\turl: '/ajax/cart/remove-coupon',\r\n\t\t},\r\n\t\t(response, error, invalidateToken) => {\r\n\t\t\tsetIsRemoveSpinnerDisplayed(false);\r\n\r\n\t\t\tif (error) {\r\n\t\t\t\tconst axiosError = error as AxiosError;\r\n\t\t\t\tif (axiosError.response && axiosError.response.status === 400 && invalidateToken) {\r\n\t\t\t\t\t// only invalidate the token if we have a bad request on the server.\r\n\t\t\t\t\tinvalidateToken();\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn Promise.resolve({});\r\n\t\t\t} else {\r\n\t\t\t\tcouponRemovedCallback && couponRemovedCallback();\r\n\t\t\t}\r\n\r\n\t\t\tupdateOrder(response.cart);\r\n\t\t\tupdateOrderMessages(response.orderMessages);\r\n\r\n\t\t\treturn Promise.resolve({});\r\n\t\t},\r\n\t\tundefined,\r\n\t\ttrue,\r\n\t\ttrue,\r\n\t);\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t{orderPromotion.couponCode}\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t\t
\r\n\t\t\t\t{isRemoveSpinnerDisplayed ? (\r\n\t\t\t\t\t\r\n\t\t\t\t) : (\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t\tsetIsRemoveSpinnerDisplayed(true);\r\n\r\n\t\t\t\t\t\t\tremoveCouponSubmitter.submit({\r\n\t\t\t\t\t\t\t\torderId: order.id,\r\n\t\t\t\t\t\t\t\torderPromotionId: orderPromotion.id,\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tdata-testid={`button-remove-promotion-${toKebabCase(orderPromotion.couponCode)}`}\r\n\t\t\t\t\t/>\r\n\t\t\t\t)}\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n}\r\n\r\nexport default ShoppingCartPromoItem;\r\n","import React, { useState } from 'react';\r\nimport { Order } from './types';\r\nimport { Localizer } from 'services/Localizer';\r\nimport DownChevronSVG from 'shared/components/svg/DownChevronSVG';\r\nimport UpChevronSVG from 'shared/components/svg/UpChevronSVG';\r\nimport { useAxiosFormSubmitter } from 'shared/hooks/useBaseAxiosFormSubmitter';\r\nimport RocForm from 'shared/edit/RocForm';\r\nimport { Field } from 'react-final-form';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport { AxiosError } from 'axios';\r\nimport CircleExclamationSVG from 'shared/components/svg/CircleExclamationSVG';\r\nimport CheckCircleSVG from 'shared/components/svg/CheckCircleSVG';\r\nimport classnames from 'classnames';\r\nimport ShoppingCartPromoItem from './ShoppingCartPromoItem';\r\nimport { OrderMessage } from './OrderMessages';\r\n\r\ninterface ShoppingCartPromoProps {\r\n\torder: Order;\r\n\tcartIsUpdating: boolean;\r\n\tupdateOrder: (newCart: Order) => void;\r\n\t/**\r\n\t * Optional callback that will be invoked when promotion has been added successfuly\r\n\t */\r\n\tcouponAddedCallback?: () => void;\r\n\t/**\r\n\t * Optional callback that will be invoked when promotion has been removed successfuly\r\n\t */\r\n\tcouponRemovedCallback?: () => void;\r\n\t/**\r\n\t * Sets order messages to displayed whenever the server returns order related ajax requests\r\n\t * within this component or its children.\r\n\t */\r\n\tupdateOrderMessages: (orderMessages: OrderMessage[]) => void;\r\n}\r\n\r\ninterface RedeemCouponFormValues {\r\n\torderId: string | null | undefined;\r\n\tcouponCode: string | null;\r\n}\r\n\r\ninterface RedeemCouponResponse {\r\n\tcart: Order;\r\n\tmessage: string;\r\n\torderMessages: OrderMessage[];\r\n}\r\n\r\n/**\r\n * Placeholder for shopping cart promotions.\r\n */\r\nfunction ShoppingCartPromo(props: ShoppingCartPromoProps) {\r\n\tconst {\r\n\t\tcartIsUpdating,\r\n\t\torder,\r\n\t\tupdateOrder,\r\n\t\tcouponAddedCallback,\r\n\t\tcouponRemovedCallback,\r\n\t\tupdateOrderMessages,\r\n\t} = props;\r\n\r\n\tconst [isShown, setIsShown] = useState(false);\r\n\tconst [promotionMessage, setPromotionMessage] = useState('');\r\n\r\n\tconst iconClass = 'roc-toggle-form__icon';\r\n\r\n\tconst redeemCouponSubmitter = useAxiosFormSubmitter(\r\n\t\t{\r\n\t\t\turl: '/ajax/cart/redeem-coupon',\r\n\t\t},\r\n\t\tundefined,\r\n\t\ttrue,\r\n\t\t(response: RedeemCouponResponse, error: AxiosError) => {\r\n\t\t\tif (!error) {\r\n\t\t\t\tsetPromotionMessage(response.message);\r\n\t\t\t\tupdateOrder(response.cart);\r\n\t\t\t\tcouponAddedCallback && couponAddedCallback();\r\n\t\t\t\tupdateOrderMessages(response.orderMessages);\r\n\t\t\t}\r\n\t\t},\r\n\t);\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\tonSubmit={redeemCouponSubmitter.handleSubmit}\r\n\t\t\tinitialValues={{ couponCode: '', orderId: order && order.id }}\r\n\t\t\trender={({ handleSubmit, submitting, submitError }) => {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t setIsShown(!isShown)}\r\n\t\t\t\t\t\t\tdata-testid=\"have-a-promo-code-button\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{isShown ? Localizer('PromoCodeFormDisplayed') : Localizer('PromoCodeFormHidden')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{Localizer('HaveAPromoCode')}\r\n\t\t\t\t\t\t\t{isShown ? (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{({ input }) => (\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{Localizer('Apply')} {submitting ? : null}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t{Array.isArray(submitError) && submitError.length > 0\r\n\t\t\t\t\t\t\t? submitError.map((error, index) => {\r\n\t\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t
{error}
\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t })\r\n\t\t\t\t\t\t\t: null}\r\n\r\n\t\t\t\t\t\t{promotionMessage &&\r\n\t\t\t\t\t\tpromotionMessage !== '' &&\r\n\t\t\t\t\t\torder.promotions.length > 0 &&\r\n\t\t\t\t\t\t!submitError &&\r\n\t\t\t\t\t\t!submitting ? (\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t{order.promotions && order.promotions.length > 0 && (\r\n\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t{Localizer('ActiveCodes')}\r\n\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t{order.promotions.map((orderPromotion, index) => (\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t\r\n\t\t\t\t);\r\n\t\t\t}}\r\n\t\t/>\r\n\t);\r\n}\r\n\r\nexport default ShoppingCartPromo;\r\n","/* eslint-disable jsx-a11y/label-has-for */\r\nimport React from 'react';\r\nimport { WithTestIdOptional } from 'shared-client/types/test';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport OptionalFieldMarker from '../OptionalFieldMarker';\r\n\r\nexport interface FieldLabelProps extends WithTestIdOptional {\r\n\tlabel: string;\r\n\tname: string;\r\n\tid?: string;\r\n\tisRequired: boolean;\r\n\thtmlFor?: string;\r\n\tchildren?: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Wrapper component for all field labels for ease of use.\r\n */\r\nexport default function FieldLabel(props: FieldLabelProps) {\r\n\tconst { label, id, isRequired, htmlFor, children, testId } = props;\r\n\r\n\tif (!label || !label.trim()) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{label}\r\n\t\t\t{!isRequired ? : null}\r\n\t\t\t{children ? children : null}\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport classnames from 'classnames';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { AxiosError } from 'axios';\r\nimport XSVG from 'shared/components/svg/XSVG';\r\n\r\ntype Theme = 'danger' | 'warning' | 'info' | 'success';\r\n\r\nexport interface ErrorAlertProps {\r\n\t/**\r\n\t * The title of the error message such as \"Uh Oh!\" or \"An Unexpected Error has Occurred!\"\r\n\t */\r\n\ttitle: string;\r\n\r\n\t/**\r\n\t * The error message to display if an error object doesn't have a more appropriate message.\r\n\t */\r\n\tmessage: React.ReactNode | string;\r\n\r\n\tchildren?: any;\r\n\r\n\ttheme?: Theme;\r\n\r\n\tisTitleOnOwnRow?: boolean;\r\n\r\n\t/** The error responsible for this message. */\r\n\terror: AxiosError | Error | null;\r\n\r\n\t/**\r\n\t * Method from parent that handles collapse state.\r\n\t */\r\n\tonCollapse?: (collased: boolean) => void;\r\n\r\n\t/**\r\n\t * Controlled collapse state from parent.\r\n\t */\r\n\tisCollapsed?: boolean;\r\n}\r\n\r\n/**\r\n * Reusable Error Alert Component.\r\n */\r\nexport default function InlineAlert(props: ErrorAlertProps) {\r\n\tconst {\r\n\t\ttitle = InlineAlert.defaultProps.title,\r\n\t\tchildren,\r\n\t\ttheme = 'danger',\r\n\t\tisTitleOnOwnRow = false,\r\n\t\terror = InlineAlert.defaultProps.error,\r\n\t\tisCollapsed = false,\r\n\t\tonCollapse,\r\n\t} = props;\r\n\r\n\tlet { message = InlineAlert.defaultProps.message } = props;\r\n\r\n\tconst axiosError = error as AxiosError | null;\r\n\tif (axiosError?.isAxiosError && axiosError != null && axiosError.response == null && axiosError.request != null) {\r\n\t\tmessage = Localizer('ErrorMessageNetwork');\r\n\t}\r\n\r\n\tif (axiosError?.isAxiosError && (axiosError?.response?.status === 401 || axiosError?.response?.status === 403)) {\r\n\t\tmessage = Localizer('ErrorMessageForbidden');\r\n\t}\r\n\r\n\tif (axiosError?.response?.data?.message) {\r\n\t\tmessage = axiosError.response.data.message;\r\n\t}\r\n\r\n\tif (isCollapsed) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{onCollapse ? (\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\r\n\t\t\t{title ? (\r\n\t\t\t\t\r\n\t\t\t\t\t{title}\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\r\n\t\t\t{message ? {message} : null}\r\n\r\n\t\t\t{children ? <> {children} : null}\r\n\t\t\r\n\t);\r\n}\r\n\r\n/**\r\n * Error Alert Default Props\r\n */\r\nInlineAlert.defaultProps = {\r\n\ttitle: Localizer('ErrorMessageGenericTitle'),\r\n\tmessage: Localizer('UnexpectedErrorOccurred'),\r\n\terror: null,\r\n};\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * X SVG\r\n *\r\n * @returns\r\n */\r\nfunction XSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default XSVG;\r\n","import AxiosHelper from 'services/AxiosHelper';\r\nimport { AxiosResponse } from 'axios';\r\n\r\nexport interface UserSummary {\r\n\tisSignedIn: boolean;\r\n\tuserName: string | null;\r\n\tfirstName: string | null;\r\n\tlastName: string | null;\r\n\temail: string | null;\r\n\tphoneNumber: string | null;\r\n\ttwoFactorEnabled: boolean;\r\n\thasRecoveryCodes: boolean;\r\n\tisMachineRemembered: boolean;\r\n\tannouncements: UserAnnouncement[];\r\n\tisExternalLoginUser: boolean;\r\n\r\n\t// #region TapeCase\r\n\tisOptedInForMarketingEmails: boolean;\r\n\t// #endregion\r\n}\r\n\r\n/** Represents the details about an admin impersonation session of the logged in user. */\r\nexport interface Impersonation {\r\n\t/** The id of the admin impersonating the front end user. */\r\n\timpersonatorId: string;\r\n\r\n\t/** The name of the admin impersonating the front end user. */\r\n\timpersonatorName: string;\r\n\r\n\t/** The id of the active user impersonation session. */\r\n\tsessionId: string;\r\n}\r\n\r\nexport interface UserData {\r\n\t/**\r\n\t * Summary of user-specific details\r\n\t */\r\n\tsummary?: UserSummary;\r\n\r\n\t/**\r\n\t * CSRF validation token generated by the server\r\n\t */\r\n\trequestToken?: string;\r\n\r\n\t/**\r\n\t * The information on an impersonation session if one is active.\r\n\t * If an impersonation session isn't active this field will be undefined.\r\n\t */\r\n\timpersonation?: Impersonation;\r\n}\r\n\r\nexport interface UserAnnouncement {\r\n\t/** The id used as the primary key for the announcement in the database */\r\n\tid: string;\r\n\r\n\t/** An announcement to be displayed to the user */\r\n\tmessage: string;\r\n\r\n\t/** A list of pages where the announcement will be displayed. This will be an empty array if it is to be displayed on all pages. */\r\n\tpages: string[];\r\n}\r\n\r\nlet userDataPromise: Promise> | null = null;\r\n\r\n/**\r\n * Returns details related to the current user. By default, this is primarily their first/last name\r\n * and whether they are logged in or not. This can customized to include more details if necessary.\r\n */\r\nexport const getUserData = () => {\r\n\tif (userDataPromise === null) {\r\n\t\tuserDataPromise = AxiosHelper.get('/ajax/user');\r\n\t}\r\n\r\n\treturn userDataPromise;\r\n};\r\n\r\n/**\r\n * Returns non-cached details related to the current user. By default, this is primarily their first/last name\r\n * and whether they are logged in or not. This can customized to include more details if necessary.\r\n */\r\nexport const getUserDataNoCache = () => {\r\n\treturn AxiosHelper.get('/ajax/user');\r\n};\r\n\r\n/**\r\n * Returns a promise that will contain the CSRF token generated on the server to be used to validate\r\n * forms being posted via AJAX.\r\n */\r\nexport async function getCsrfToken() {\r\n\ttry {\r\n\t\tconst userData = await getUserData();\r\n\t\treturn userData.data.requestToken;\r\n\t} catch (error) {\r\n\t\tconsole.warn('Unable to load CSRF token.');\r\n\t\treturn '';\r\n\t}\r\n}\r\n\r\n// #region Commerce\r\nimport { CartSummary } from './UserData.Commerce';\r\nimport { LocationDto } from 'features/commerce/store-locator/types';\r\nimport { OrganizationInvite, OrganizationShipTo } from 'shared-client/types/commerce/organization';\r\nimport { AutoSuggestOption } from '../../../Roc.SharedClientApp/types/fields';\r\n\r\n// Commerce extensions to the UserData interface\r\nexport interface UserData {\r\n\tcartSummary?: CartSummary;\r\n\r\n\t/***\r\n\t * The customer's default store location or null if not set\r\n\t */\r\n\tdefaultStoreLocation?: LocationDto | null;\r\n\r\n\t/**\r\n\t * If store is enabled for this site\r\n\t */\r\n\tenableStoreLocation?: boolean;\r\n}\r\n\r\n/***\r\n * Organization data and permissions\r\n */\r\nexport interface Organization {\r\n\tid: string;\r\n\tpurchaseOrderNumberRequired: boolean;\r\n\tcreditCardAllowed: boolean;\r\n\tgiftCardAllowed: boolean;\r\n\torganizationName: string;\r\n\tcorpAccountAllowed: boolean;\r\n\t//#region TapeCase Customization\r\n\tisApprovedDistributor: boolean;\r\n\tpurchaseOrderAllowed: boolean;\r\n\t//#endregion\r\n}\r\n\r\n/***\r\n * Organization dto data\r\n */\r\nexport interface OrganizationDto extends AutoSuggestOption {}\r\n\r\n/***\r\n * User's organization and permissions data\r\n */\r\nexport interface UserSummary {\r\n\t/***\r\n\t * User's current default organization\r\n\t */\r\n\torganization: Organization | null;\r\n\r\n\t/***\r\n\t * The list of organizations the user is part of\r\n\t */\r\n\tuserOrganizations?: OrganizationDto[] | null;\r\n\r\n\t/***\r\n\t * The selected organization ship to\r\n\t */\r\n\tselectedShipTo: OrganizationShipTo | null;\r\n\r\n\t/***\r\n\t * Defines if the user has multiple shiptos to select from\r\n\t */\r\n\thasMultipleShipTos: boolean | null;\r\n\r\n\t/***\r\n\t * Defines if the user has saved payment methods\r\n\t */\r\n\thasSavedPaymentMethods: boolean | null;\r\n\r\n\t/***\r\n\t * The list of user permissions\r\n\t */\r\n\tpermissions?: UserPermissions;\r\n\r\n\t/***\r\n\t * The list of organizations the user is invited to join\r\n\t */\r\n\torganizationInvites?: OrganizationInvite[];\r\n\r\n\t/***\r\n\t * The user organization removal notification\r\n\t * Used to notify the user if he is no more part of his default organization\r\n\t */\r\n\tuserOrganizationRemovalNotification?: string;\r\n}\r\n\r\n/***\r\n * User's permissions\r\n */\r\nexport interface UserPermissions {\r\n\t/***\r\n\t * Defines if the current user can see organization users\r\n\t */\r\n\tcanSeeOrganizationUsers?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can assign roles to organization users\r\n\t */\r\n\tcanAssignRolesToOrganizationUsers?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can remove users from an organization\r\n\t */\r\n\tremoveUserFromOrganization?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can create organization users\r\n\t */\r\n\tcreateOrganizationUser?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can enable/disable ShipTos for organization users\r\n\t */\r\n\tmanageShipTosAssociation?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can see status of the organization users\r\n\t */\r\n\tcanSeePendingOrganizationUsers?: boolean;\r\n}\r\n// #endregion\r\n","import React from 'react';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { ValidationMessages } from '.';\r\nimport FieldInputErrorWrapper from './FieldInputErrorWrapper';\r\nimport { BaseInputProps } from './InputField';\r\nimport { toKebabCase } from 'util/StringUtil';\r\n\r\nexport type InputFieldProps = FieldRenderProps &\r\n\tBaseInputProps & {\r\n\t\tplaceholder?: string;\r\n\t};\r\n\r\n/**\r\n * Component that renders a checkbox input with form field.\r\n */\r\nexport default function CheckboxInputField({\r\n\tinput: { name, onChange, checked }, //#region TapeCase Customization (bugfix), added attribute `checked` instead of value\r\n\tmeta,\r\n\ttype,\r\n\tlabel = '',\r\n\tdisabled = false,\r\n\treadOnly = false,\r\n\tplaceholder = '',\r\n\tstep,\r\n\ttestId,\r\n\tdefaultValue = false,\r\n}: InputFieldProps) {\r\n\treturn (\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { Field, FieldProps, FieldRenderProps } from 'react-final-form';\r\nimport CheckboxInputField from './CheckboxInputField';\r\nimport { BaseInputProps } from './InputField';\r\n\r\nexport type InputFieldProps = FieldProps> & BaseInputProps;\r\n\r\n/**\r\n * Component that renders a checkbox field\r\n */\r\nexport default function CheckBoxField({\r\n\tname,\r\n\treadOnly = false,\r\n\tdisabled = false,\r\n\tlabel = '',\r\n\tafterSubmit,\r\n\tallowNull,\r\n\tbeforeSubmit,\r\n\tformatOnBlur,\r\n\tinitialValue,\r\n\tisEqual,\r\n\tsubscription,\r\n\tdefaultValue,\r\n\t//#region TapeCase Customization (bugfix)\r\n\tchecked,\r\n}: //endregion\r\nInputFieldProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ input, meta }) => (\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { Field, FieldProps, FieldRenderProps } from 'react-final-form';\r\nimport { DropdownOption } from 'shared-client/types/fields';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport { FormFieldProps, ValidationMessages } from '.';\r\nimport FieldInputErrorWrapper from './FieldInputErrorWrapper';\r\nimport FieldLabel from './FieldLabel';\r\nexport type DropdownProps = FormFieldProps & {\r\n\taddSelectOption?: boolean;\r\n\toptions: DropdownOption[];\r\n};\r\n\r\nexport type DropdownFieldProps = DropdownProps &\r\n\tFieldProps>;\r\n\r\n/**\r\n * Component that renders a Dropdown field component\r\n */\r\nexport default function DropdownField({\r\n\tname,\r\n\tisRequired = true,\r\n\treadOnly = false,\r\n\tdisabled = false,\r\n\taddSelectOption = true,\r\n\toptions,\r\n\tlabel = '',\r\n\tafterSubmit,\r\n\tallowNull,\r\n\tbeforeSubmit,\r\n\tformatOnBlur,\r\n\tisEqual,\r\n\tsubscription,\r\n\tvalidateFields,\r\n\ttestId,\r\n}: DropdownFieldProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ input: { value, onChange, onFocus, onBlur }, meta }) => (\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{addSelectOption ? \r\n\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { FieldRenderProps } from 'react-final-form';\r\n\r\ntype ValidationMessagesProps = Pick, 'meta'> & {\r\n\tid: string;\r\n};\r\n\r\nfunction getErrorArray(errorOrSubmitError) {\r\n\tlet errors: string[] = [];\r\n\tif (typeof errorOrSubmitError === 'string') {\r\n\t\terrors.push(errorOrSubmitError);\r\n\t} else if (Array.isArray(errorOrSubmitError)) {\r\n\t\terrors = errorOrSubmitError.filter((error) => !Array.isArray(error) && typeof error === 'string');\r\n\t}\r\n\r\n\treturn errors;\r\n}\r\n\r\n/**\r\n * Displays validation errors for fields\r\n *\r\n * @class ValidationMessages\r\n * @extends {React.Component}\r\n */\r\nfunction ValidationMessages(props: ValidationMessagesProps) {\r\n\tconst { meta } = props;\r\n\r\n\tif (!meta) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tlet errors: string[] = [];\r\n\r\n\t/* \r\n\t almost all validation comes from the server, so we only need to check `submitError` despite there being `error`\r\n\t there are 3 kinds of values for submitError, string, string[] and [string|[]|object]\r\n\t the third type happens when you're using FieldArray, so we're going to filter those out and only\r\n\t take the strings if submitError is an array. this is due to a bug (possibly feature?) of final form\r\n\t where the submit errors for field array fields bubble up into the parent field.\r\n\t */\r\n\tif (meta.submitError) {\r\n\t\terrors = errors.concat(getErrorArray(meta.submitError));\r\n\r\n\t\t// for server-side validation, we need to stop showing these after any changes are made.\r\n\t\tif (meta.dirtySinceLastSubmit || meta.submitting) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t} else if (meta.error) {\r\n\t\t// sometimes we validate on the client, so we need to support these as well.\r\n\t\terrors = errors.concat(getErrorArray(meta.error));\r\n\t}\r\n\r\n\treturn (\r\n\t\t// #region Tapecase\r\n\t\t\r\n\t\t\t{/* #endregion */}\r\n\t\t\t{(meta.submitError || meta.error) &&\r\n\t\t\t\tmeta.touched &&\r\n\t\t\t\terrors.length > 0 &&\r\n\t\t\t\terrors.map((error, index) => (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{error}\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t))}\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default ValidationMessages;\r\n","import React from 'react';\r\nimport StarRating from '~/shared/components/star-rating/StarRating';\r\nimport { Field } from 'react-final-form';\r\nimport OptionalFieldMarker from '../OptionalFieldMarker';\r\nimport ValidationMessages from './ValidationMessages';\r\nimport { FormFieldProps } from '.';\r\nimport FieldInputErrorWrapper from './FieldInputErrorWrapper';\r\nimport { LocalizedSpan } from 'services/Localizer';\r\nimport { toKebabCase } from 'util/StringUtil';\r\n\r\nexport interface StarRatingFieldProps extends FormFieldProps {\r\n\t/**\r\n\t * The maximum number of stars to display (default is 5)\r\n\t */\r\n\tmaxRating?: number;\r\n}\r\n\r\n/**\r\n * Reusable RFF-compatible field that displays a star rating input\r\n * @param props\r\n */\r\nexport default function StarRatingField({\r\n\tname,\r\n\tlabel = '',\r\n\treadOnly = false,\r\n\tdisabled = false,\r\n\tmaxRating = 5,\r\n\tisRequired = true,\r\n\ttestId,\r\n}: StarRatingFieldProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ input: { value, onChange }, meta }) => (\r\n\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{label} {!isRequired ? : null}\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t${value}\r\n\t\t\t\t\t\t\t`,\r\n\t\t\t\t\t\t\t\t\t`${maxRating}\r\n\t\t\t\t\t\t\t`,\r\n\t\t\t\t\t\t\t\t]}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t)}\r\n\t\t
\r\n\t);\r\n}\r\n","import * as React from 'react';\r\nimport { ValidationMessages, FormFieldProps } from '.';\r\nimport { FieldProps, Field, FieldRenderProps } from 'react-final-form';\r\nimport FieldLabel from './FieldLabel';\r\nimport FieldInputErrorWrapper from './FieldInputErrorWrapper';\r\nimport { toKebabCase } from 'util/StringUtil';\r\n\r\nexport type TextAreaFieldProps = FieldProps> &\r\n\tFormFieldProps & {\r\n\t\trows?: number;\r\n\t\tplaceholder?: string;\r\n\t};\r\n\r\n/**\r\n * Component that renders a textarea input component.\r\n */\r\nexport default function TextAreaField({\r\n\tname,\r\n\tisRequired = true,\r\n\treadOnly = false,\r\n\tdisabled = false,\r\n\tplaceholder = '',\r\n\tlabel = '',\r\n\trows = 5,\r\n\tvalidate,\r\n\tafterSubmit,\r\n\tallowNull,\r\n\tbeforeSubmit,\r\n\tcomponent,\r\n\tdefaultValue,\r\n\tformat,\r\n\tformatOnBlur,\r\n\tinitialValue,\r\n\tisEqual,\r\n\tparse,\r\n\trender,\r\n\tsubscription,\r\n\tvalue,\r\n\ttestId,\r\n}: TextAreaFieldProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ input, meta }) => (\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport { FormFieldProps, ValidationMessages } from '.';\r\nimport FieldInputErrorWrapper from './FieldInputErrorWrapper';\r\nimport FieldLabel from './FieldLabel';\r\n\r\nexport interface BaseInputProps extends FormFieldProps {\r\n\ttype?: string;\r\n\tstep?: string;\r\n}\r\n\r\nexport type InputFieldProps = FieldRenderProps &\r\n\tBaseInputProps & {\r\n\t\tplaceholder?: string;\r\n\t};\r\n\r\nexport type HTMLInputRef = React.MutableRefObject;\r\n/**\r\n * Component that renders an input with form field.\r\n */\r\nconst InputField = React.forwardRef((props: InputFieldProps, ref: HTMLInputRef) => {\r\n\tconst {\r\n\t\tinput: { name, onChange, value },\r\n\t\tmeta,\r\n\t\ttype,\r\n\t\tlabel = '',\r\n\t\tisRequired = true,\r\n\t\tdisabled = false,\r\n\t\treadOnly = false,\r\n\t\tplaceholder = '',\r\n\t\tstep,\r\n\t\ttestId,\r\n\t} = props;\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n});\r\n\r\nexport default InputField;\r\n","import React from 'react';\r\nimport { Field, FieldProps, FieldRenderProps } from 'react-final-form';\r\nimport InputField, { BaseInputProps, HTMLInputRef } from './InputField';\r\n\r\nexport type InputFieldProps = FieldProps> & BaseInputProps;\r\n\r\n/**\r\n * Component that renders a text box component, of the specified type\r\n */\r\nconst TextBoxField = React.forwardRef((props: InputFieldProps, ref: HTMLInputRef) => {\r\n\tconst {\r\n\t\tname,\r\n\t\ttype = 'text',\r\n\t\tisRequired = true,\r\n\t\treadOnly = false,\r\n\t\tdisabled = false,\r\n\t\tplaceholder = '',\r\n\t\tlabel = '',\r\n\t\tvalidate,\r\n\t\tafterSubmit,\r\n\t\tallowNull,\r\n\t\tbeforeSubmit,\r\n\t\tcomponent,\r\n\t\tdefaultValue,\r\n\t\tformat,\r\n\t\tformatOnBlur,\r\n\t\tinitialValue,\r\n\t\tisEqual,\r\n\t\tparse,\r\n\t\trender,\r\n\t\tsubscription,\r\n\t\tvalue,\r\n\t\ttestId,\r\n\t} = props;\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ input, meta }) => (\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n});\r\n\r\nexport default TextBoxField;\r\n","export enum ModelStatus {\r\n\tPublished = 'Published',\r\n\tInactive = 'Inactive',\r\n\tDeleted = 'Deleted',\r\n\tDraft = 'Draft',\r\n\tArchived = 'Archived',\r\n}\r\n","import { ServerData } from 'services/ServerData';\r\n\r\nexport default {\r\n\tBaseUrl: ServerData.ACCOUNT_URL_BASE ?? '/my-account',\r\n\tLogin: ServerData.ACCOUNT_LOGIN_URL ?? '/my-account/login',\r\n\tLogin2fa: ServerData.ACCOUNT_LOGIN_WITH_2FA_URL ?? '/my-account/login-with-2fa',\r\n\tRegister: ServerData.ACCOUNT_REGISTER_URL ?? '/my-account/register',\r\n\tForgotPassword: ServerData.ACCOUNT_FORGOT_PASSWORD_URL ?? '/my-account/forgot-password',\r\n\tLoginWithRecoveryCode: ServerData.ACCOUNT_LOGIN_WITH_RECOVERY_CODE_URL ?? '/my-account/login-with-recovery-code',\r\n\tLogout: ServerData.ACCOUNT_LOGOUT_URL ?? '/my-account/logout',\r\n\t// #region Commerce\r\n\tOrganizationReview: ServerData.ACCOUNT_ORGANIZATION_REVIEW_URL ?? '/my-account/organization-review',\r\n\tOrganizationSelector: ServerData.ACCOUNT_ORGANIZATION_SELECTOR_URL ?? '/my-account/organization-selector',\r\n\t// #endregion\r\n};\r\n","import Axios, { AxiosError, CancelTokenSource } from 'axios';\r\nimport { useEffect, useState } from 'react';\r\nimport AxiosHelper from 'services/AxiosHelper';\r\nimport { CartSummary, GetCartResult } from 'services/UserData.Commerce';\r\nimport { dispatchRocEvent } from 'shared/hooks/useRocEventHandler';\r\nimport { OrderMessage } from './OrderMessages';\r\nimport { GetSavedProductsResult, Order } from './types';\r\n\r\nexport interface UseShoppingCartLoader {\r\n\tstate: UseShoppingCartLoaderState;\r\n\tactor: UseShoppingCartLoaderActor;\r\n}\r\n\r\nexport interface UseShoppingCartLoaderState {\r\n\terror: Error | AxiosError | null;\r\n\tisLoaded: boolean;\r\n\r\n\torder: Order | null;\r\n\tsavedProducts: GetSavedProductsResult | null;\r\n\tcartSummary: CartSummary | null;\r\n\torderMessages?: OrderMessage[];\r\n}\r\n\r\nexport interface UseShoppingCartLoaderActor {\r\n\tsetOrder: (order: Order) => void;\r\n\tsetSavedProducts: (savedProducts: GetSavedProductsResult) => void;\r\n\tsetCartSummary: (cartSummary: CartSummary) => void;\r\n\tsetOrderMessages: (orderMessages: OrderMessage[]) => void;\r\n\treloadCart: (requestToken: CancelTokenSource) => Promise;\r\n\tsetSavedProductsPageSize: (newPageSize: number) => void;\r\n\tgoToSavedProductsPage: (newPageNumber: number) => void;\r\n\tgoToNextSavedProductsPage: () => void;\r\n\tgoToPreviousSavedProductsPage: () => void;\r\n}\r\n\r\nexport interface UseShoppingCartLoaderProps {\r\n\tinitialSavedProductsPageNumber?: number;\r\n\tinitialSavedProductsPageSize?: number;\r\n}\r\n\r\n/**\r\n * Custom hook to load the cart\r\n */\r\nexport function useShoppingCartLoader(props?: UseShoppingCartLoaderProps): UseShoppingCartLoader {\r\n\tconst [error, setError] = useState(null);\r\n\tconst [isLoaded, setIsLoaded] = useState(false);\r\n\tconst [order, setOrder] = useState(null);\r\n\tconst [savedProducts, setSavedProducts] = useState(null);\r\n\tconst [cartSummary, setCartSummary] = useState(null);\r\n\tconst [orderMessages, setOrderMessages] = useState([]);\r\n\r\n\tlet savedProductsPageNumber: number = (props && props.initialSavedProductsPageNumber) || 1;\r\n\tlet savedProductsPageSize: number = (props && props.initialSavedProductsPageSize) || 1000000;\r\n\r\n\t// when the component mounts, begin loading the cart.\r\n\tuseEffect(() => {\r\n\t\tsetIsLoaded(false);\r\n\t\tconst requestToken: CancelTokenSource = Axios.CancelToken.source();\r\n\r\n\t\treloadCart(requestToken);\r\n\r\n\t\treturn () => {\r\n\t\t\t// cleanup\r\n\t\t\trequestToken.cancel();\r\n\t\t};\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, []);\r\n\r\n\tasync function reloadCart(requestToken: CancelTokenSource) {\r\n\t\tsetIsLoaded(false);\r\n\t\tsetError(null);\r\n\r\n\t\tif (error) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst url = `/ajax/cart?savedProductsPageSize=${savedProductsPageSize}&savedProductsPageNumber=${savedProductsPageNumber}`;\r\n\r\n\t\ttry {\r\n\t\t\tconst response = await AxiosHelper.get(url, {\r\n\t\t\t\tcancelToken: requestToken.token,\r\n\t\t\t});\r\n\r\n\t\t\tconsole.debug('Loaded cart');\r\n\r\n\t\t\tif (response.data.cart) {\r\n\t\t\t\tsetOrder(response.data.cart);\r\n\t\t\t}\r\n\t\t\tif (response.data.savedProducts) {\r\n\t\t\t\tsetSavedProducts(response.data.savedProducts);\r\n\t\t\t}\r\n\t\t\tif (response.data.cartSummary) {\r\n\t\t\t\tsetCartSummary(response.data.cartSummary);\r\n\t\t\t}\r\n\t\t\tif (response.data.orderMessages) {\r\n\t\t\t\tsetOrderMessages(response.data.orderMessages);\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\tif (Axios.isCancel(error)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tsetError(error);\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\t\t\tconsole.error(`An error occurred while loading the cart: ${axiosError.message}`);\r\n\t\t} finally {\r\n\t\t\tsetIsLoaded(true);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction goToSavedProductsPage(newPageNumber: number) {\r\n\t\tsavedProductsPageNumber = newPageNumber;\r\n\t\treloadCart(Axios.CancelToken.source());\r\n\t}\r\n\r\n\tfunction goToNextSavedProductsPage() {\r\n\t\tif (savedProducts && savedProductsPageNumber < savedProducts.pagination.totalPages) {\r\n\t\t\tgoToSavedProductsPage(savedProductsPageNumber + 1);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction goToPreviousSavedProductsPage() {\r\n\t\tif (savedProductsPageNumber === 1) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tgoToSavedProductsPage(savedProductsPageNumber - 1);\r\n\t}\r\n\r\n\tfunction setSavedProductsPageSize(newPageSize: number) {\r\n\t\tsavedProductsPageSize = newPageSize;\r\n\t\treloadCart(Axios.CancelToken.source());\r\n\t}\r\n\r\n\t// Dispatch the event when the cartSummary is updated\r\n\tuseEffect(() => {\r\n\t\tif (!cartSummary) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tdispatchRocEvent('roc-cart-summary-updated', { cartSummary });\r\n\t}, [cartSummary]);\r\n\r\n\treturn {\r\n\t\tstate: {\r\n\t\t\terror: error,\r\n\t\t\tisLoaded,\r\n\t\t\torder,\r\n\t\t\tsavedProducts,\r\n\t\t\tcartSummary,\r\n\t\t\torderMessages,\r\n\t\t},\r\n\t\tactor: {\r\n\t\t\tsetOrder,\r\n\t\t\tsetSavedProducts,\r\n\t\t\tsetCartSummary,\r\n\t\t\treloadCart,\r\n\t\t\tgoToSavedProductsPage,\r\n\t\t\tgoToNextSavedProductsPage,\r\n\t\t\tgoToPreviousSavedProductsPage,\r\n\t\t\tsetSavedProductsPageSize,\r\n\t\t\tsetOrderMessages,\r\n\t\t},\r\n\t};\r\n}\r\n","import { useEffect } from 'react';\r\nimport 'shared/polyfills/customEvent';\r\nimport { RocEventType, ExtractEventParameters, RocEvent } from 'shared/events';\r\nimport addRocEventHandler from 'shared/util/events/rocEventUtils';\r\n\r\n/**\r\n * Helper function for dispatching ROC events.\r\n *\r\n * @param eventType The event type for the dispatcher\r\n */\r\nexport function dispatchRocEvent(eventType: T, data: ExtractEventParameters) {\r\n\tconst event = new CustomEvent(eventType, {\r\n\t\tdetail: data,\r\n\t});\r\n\tdocument.dispatchEvent(event);\r\n}\r\n\r\n/**\r\n * Reusable hook for handling ROC events\r\n *\r\n * @param eventType The type of event to handle\r\n * @param eventHandler The event handler\r\n * @param deps List of dependencies\r\n */\r\nexport default function useRocEventHandler(\r\n\teventType: T,\r\n\teventHandler: (data: ExtractEventParameters) => void,\r\n\tdeps?: any[],\r\n) {\r\n\tuseEffect(() => {\r\n\t\tconst removeHandlerCallback = addRocEventHandler(eventType, eventHandler);\r\n\r\n\t\treturn () => {\r\n\t\t\tremoveHandlerCallback();\r\n\t\t};\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, deps);\r\n}\r\n","import React from 'react';\r\nimport InlineAlert from 'shared/edit/InlineAlert';\r\n\r\n// eslint-disable-next-line\r\n// tslint:disable-next-line\r\nexport interface ErrorBoundaryRenderProps extends ErrorBoundaryState {}\r\n\r\nexport interface ErrorBoundaryProps {\r\n\tchildren: React.ReactNode;\r\n\trenderError?: (renderProps: ErrorBoundaryRenderProps) => React.ReactNode;\r\n}\r\n\r\nexport interface ErrorBoundaryState {\r\n\terror?: Error;\r\n}\r\n\r\n/**\r\n * Default Error Boundary component for frontend components, so that in case a JS error occurs, we show\r\n * something instead of nothing.\r\n */\r\nexport default class ErrorBoundary extends React.Component {\r\n\tpublic static defaultProps = {\r\n\t\trenderError: (renderProps: ErrorBoundaryRenderProps) => ,\r\n\t};\r\n\r\n\tpublic state: ErrorBoundaryState = {};\r\n\r\n\tpublic componentDidCatch(error: Error) {\r\n\t\tthis.setState({\r\n\t\t\terror,\r\n\t\t});\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\tif (this.state.error) {\r\n\t\t\treturn this.props.renderError!(this.state);\r\n\t\t}\r\n\r\n\t\treturn this.props.children;\r\n\t}\r\n}\r\n","// source: https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNames\r\n/* eslint-disable no-var */\r\n(function () {\r\n\tif (Element.prototype.getAttributeNames == undefined) {\r\n\t\tElement.prototype.getAttributeNames = function () {\r\n\t\t\tvar attributes = this.attributes;\r\n\t\t\tvar length = attributes.length;\r\n\t\t\tvar result = new Array(length);\r\n\t\t\tfor (var i = 0; i < length; i++) {\r\n\t\t\t\tresult[i] = attributes[i].name;\r\n\t\t\t}\r\n\t\t\treturn result;\r\n\t\t};\r\n\t}\r\n})();\r\n","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport ErrorBoundary from './ErrorBoundary';\r\nimport { toCamelCase } from 'util/StringUtil';\r\nimport 'shared/polyfills/getAttributeNames';\r\nimport Spinner from 'shared/components/Spinner';\r\n\r\ninterface AttributeProps {\r\n\t[index: string]: string;\r\n}\r\n\r\nfunction getDataPropsFromAttributes(element: Element): AttributeProps {\r\n\tconst props: AttributeProps = {};\r\n\r\n\tconst dataAttributePrefix = 'data-';\r\n\r\n\tconst attributeNames = element.getAttributeNames().filter((s) => s.startsWith(dataAttributePrefix));\r\n\tfor (const attributeName of attributeNames) {\r\n\t\tconst strippedName = toCamelCase(attributeName.substring(dataAttributePrefix.length));\r\n\t\tprops[strippedName] = element.getAttribute(attributeName) ?? '';\r\n\t}\r\n\r\n\treturn props;\r\n}\r\n\r\n/**\r\n * A helper function to facilitate initializing react applications on top of server-side rendered elements.\r\n * @param getReactElement Function that returns the react component to render.\r\n * @param elementId The ID of the DOM element being targeted.\r\n */\r\nexport const initReactApp = (getReactElement: (props: unknown) => React.ReactElement, elementId: string) => {\r\n\tif (typeof getReactElement !== 'function' || !elementId) {\r\n\t\treturn () => {\r\n\t\t\tconsole.warn('A react element generator function and element ID are required.');\r\n\t\t};\r\n\t}\r\n\r\n\tconst element = document.getElementById(elementId);\r\n\r\n\tif (!element) {\r\n\t\treturn () => {\r\n\t\t\tconsole.warn(\r\n\t\t\t\t`Element with ID '${elementId}' was not found. Did you forget to render it on the server or is this entry point not supposed to run?`,\r\n\t\t\t);\r\n\t\t};\r\n\t}\r\n\r\n\treturn () => {\r\n\t\tconst props = getDataPropsFromAttributes(element);\r\n\t\tconsole.debug(`Rendering application inside element with ID ${elementId}.`);\r\n\t\tReactDOM.render(\r\n\t\t\t}>\r\n\t\t\t\t{getReactElement(props)}\r\n\t\t\t,\r\n\t\t\telement,\r\n\t\t);\r\n\t};\r\n};\r\n\r\nexport const initReactAppByAttribute = (\r\n\tgetReactElement: (props: unknown, domElement: Element) => React.ReactElement,\r\n\tattribute: string,\r\n) => {\r\n\tif (typeof getReactElement !== 'function' || !attribute) {\r\n\t\treturn () => {\r\n\t\t\tconsole.warn('A react element generator function and element ID are required.');\r\n\t\t};\r\n\t}\r\n\r\n\tconst elements = document.querySelectorAll(`[${attribute}]`);\r\n\r\n\tif (!elements || elements.length == 0) {\r\n\t\treturn () => {\r\n\t\t\tconsole.warn(\r\n\t\t\t\t`No elements with data attribute '${attribute}' were found. Did you forget to render it on the server or is this entry point not supposed to run?`,\r\n\t\t\t);\r\n\t\t};\r\n\t}\r\n\r\n\treturn () => {\r\n\t\tfor (let i = 0; i < elements.length; ++i) {\r\n\t\t\tconst element = elements[i];\r\n\t\t\tconst props = getDataPropsFromAttributes(element);\r\n\t\t\tconsole.debug(`Rendering application inside element with attribute ${attribute}.`);\r\n\t\t\tReactDOM.render(\r\n\t\t\t\t}>\r\n\t\t\t\t\t{getReactElement(props, element)}\r\n\t\t\t\t,\r\n\t\t\t\telement,\r\n\t\t\t);\r\n\t\t}\r\n\t};\r\n};\r\n","import React from 'react';\r\nimport { RouteProps } from 'react-router';\r\n\r\n//#region URLs\r\nexport const MY_ACCOUNT_PATH_PREFIX = '/my-account';\r\nexport const MY_ACCOUNT_PERSONAL_DATA_URL = `${MY_ACCOUNT_PATH_PREFIX}/personal-data`;\r\nexport const MY_ACCOUNT_AUTHENTICATOR_URL = `${MY_ACCOUNT_PATH_PREFIX}/settings/authenticator`;\r\nexport const MY_ACCOUNT_GENERATE_RECOVERY_CODES_URL = `${MY_ACCOUNT_AUTHENTICATOR_URL}/generate-recovery-codes`;\r\nexport const MY_ACCOUNT_CONFIGURE_AUTHENTICATOR_URL = `${MY_ACCOUNT_AUTHENTICATOR_URL}/configure`;\r\nexport const MY_ACCOUNT_LOGIN_URL = `${MY_ACCOUNT_PATH_PREFIX}/login`;\r\nexport const MY_ACCOUNT_LOGOUT_URL = `${MY_ACCOUNT_PATH_PREFIX}/logout`;\r\nexport const MY_ACCOUNT_WALLET_URL = `${MY_ACCOUNT_PATH_PREFIX}/wallet`;\r\nexport const MY_ACCOUNT_WALLET_CREATE_URL = `${MY_ACCOUNT_WALLET_URL}/create`;\r\nexport const MY_ACCOUNT_ADDRESS_BOOK_URL = `${MY_ACCOUNT_PATH_PREFIX}/address-book`;\r\nexport const MY_ACCOUNT_ADDRESS_BOOK_CREATE_URL = `${MY_ACCOUNT_ADDRESS_BOOK_URL}/create`;\r\nexport const MY_ACCOUNT_ADDRESS_BOOK_EDIT_URL = `${MY_ACCOUNT_ADDRESS_BOOK_URL}/edit`;\r\n//#region Commerce\r\nexport const MY_ACCOUNT_SETTINGS_URL = `${MY_ACCOUNT_PATH_PREFIX}/settings`;\r\n//#endregion Commerce\r\n//#endregion URLs\r\n\r\n//#region Components\r\nconst SettingsComponent = React.lazy(() => import(/* webpackChunkName: \"my-account-settings\" */ './settings/Settings'));\r\n\r\nconst GenerateRecoveryCodesComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-generate-recovery-codes\" */ './generate-recovery-codes/GenerateRecoveryCodesContainer'\r\n\t\t),\r\n);\r\nconst ConfigureAuthenticatorComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-configure-authenticator\" */ './configure-authenticator/ConfigureAuthenticator'\r\n\t\t),\r\n);\r\n\r\nconst WalletComponent = React.lazy(() => import(/* webpackChunkName: \"my-account-wallet\" */ './wallet/Wallet'));\r\nconst WalletEditComponent = React.lazy(() => import(/* webpackChunkName: \"my-account-wallet\" */ './wallet/WalletEdit'));\r\n\r\n//#endregion Components\r\n\r\n//#region Routes\r\nconst generateRecoverCodesRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_GENERATE_RECOVERY_CODES_URL,\r\n\tcomponent: GenerateRecoveryCodesComponent,\r\n};\r\n\r\nconst configureAuthenticatorRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_CONFIGURE_AUTHENTICATOR_URL,\r\n\tcomponent: ConfigureAuthenticatorComponent,\r\n};\r\n\r\nconst walletRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_WALLET_URL,\r\n\tcomponent: WalletComponent,\r\n};\r\n\r\nconst walletCreateRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_WALLET_CREATE_URL,\r\n\tcomponent: WalletEditComponent,\r\n};\r\n\r\n//#region Commerce\r\n// Note: in Framework we want MY_ACCOUNT_PATH_PREFIX to point to SettingsComponent,\r\n// but in Commerce we want it to point to AccountOverviewComponent\r\nconst settingsRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_SETTINGS_URL,\r\n\tcomponent: SettingsComponent,\r\n};\r\n//#endregion Commerce\r\n//#endregion Routes\r\n\r\nexport const rocRoutes: RouteProps[] = [\r\n\tgenerateRecoverCodesRoute,\r\n\tconfigureAuthenticatorRoute,\r\n\twalletRoute,\r\n\twalletCreateRoute,\r\n\tsettingsRoute,\r\n];\r\n","import React from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\n\r\n/**\r\n * Reusable component for the optional field marker\r\n */\r\nfunction OptionalFieldMarker() {\r\n\treturn ({Localizer('Optional')});\r\n}\r\n\r\nexport default React.memo(OptionalFieldMarker);\r\n","import { useState, useEffect } from 'react';\r\n\r\n/**\r\n * Reusable hook that returns true after a certain amount of time has passed. Useful to delay\r\n * displaying components in render functions.\r\n *\r\n * @export\r\n * @param {number} [waitMs=200]\r\n * @returns\r\n */\r\nexport default function useDelayedDisplay(waitMs: number = 200) {\r\n\tconst [display, setDisplay] = useState(false);\r\n\r\n\tuseEffect(() => {\r\n\t\t// after a set amount of time, show the spinner\r\n\t\tconst timeout = setTimeout(() => {\r\n\t\t\tsetDisplay(true);\r\n\t\t}, waitMs);\r\n\r\n\t\treturn () => {\r\n\t\t\tclearTimeout(timeout);\r\n\t\t};\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, []);\r\n\r\n\treturn display;\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Check circle SVG\r\n *\r\n * @returns\r\n */\r\nfunction CheckCircleSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default CheckCircleSVG;\r\n","import { AxiosError } from 'axios';\r\nimport { FORM_ERROR } from 'final-form';\r\nimport { unflatten } from 'flat';\r\n\r\nexport const getFormattedPageTitle = (subTitle: string = ''): string => {\r\n\t// load from config?\r\n\tconst siteName = 'ROC';\r\n\r\n\tif (!subTitle || !subTitle.trim()) {\r\n\t\treturn siteName;\r\n\t}\r\n\r\n\treturn `${subTitle.trim()} - ${siteName}`;\r\n};\r\n\r\n/**\r\n * Promise version of setTimeout.\r\n * @param ms The number of milliseconds to wait for.\r\n */\r\nexport const timeout = (ms) => {\r\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\r\n};\r\n\r\n/**\r\n * Allows you to await on a timeout, useful for avoiding setTimeout callbacks and for troubleshooting.\r\n * @param ms The number of milliseconds to wait for.\r\n */\r\nexport const sleep = async (ms: number = 0) => {\r\n\tawait timeout(ms);\r\n};\r\n\r\n/**\r\n * Handles Axios error for React Final Form. If the error is a validation error, the error is transformed into React\r\n * Final Form field validation object. If the error is a generic error, the error is rethrown instead.\r\n *\r\n * @param error - The Axios Error object to handle errors for.\r\n * @param errorMessage - The form error message to provide back to React Final Form.\r\n * @param validationErrorCallback - Optional callback that is triggered right before the validation object is returned\r\n * to Final Form, so that you can run logic that should occur during validation errors.\r\n * @param genericErrorCallback - Optional callback that is triggered right before the generic error is rethrown, so that\r\n * you can run logic that should occur during generic errors.\r\n */\r\nexport const handleAxiosErrorWithValidation = (\r\n\terror: AxiosError,\r\n\terrorMessage: string | null = 'An error occurred while saving.',\r\n\tvalidationErrorCallback?: () => void,\r\n\tgenericErrorCallback?: () => void,\r\n): { [index: string]: string } => {\r\n\tif (error?.response?.status === 400 && error.response.data) {\r\n\t\tlet globalErrors;\r\n\r\n\t\tconst errors = error.response.data;\r\n\r\n\t\tconst errorsWithModifiedArrayIndex = Object.keys(errors).reduce((acc, value) => {\r\n\t\t\tif (value === '') {\r\n\t\t\t\t// in case we are getting back a non field specific error store it in the global errors\r\n\t\t\t\tglobalErrors = errors[value];\r\n\t\t\t} else {\r\n\t\t\t\tconst newKey = value.replace(/\\[([0-9]+)\\]/g, '.$1');\r\n\t\t\t\tacc[newKey] = errors[value];\r\n\t\t\t}\r\n\r\n\t\t\treturn acc;\r\n\t\t}, {});\r\n\r\n\t\tconst newValidationState = { ...unflatten(errorsWithModifiedArrayIndex) };\r\n\r\n\t\tconsole.debug('newValidationState:', newValidationState);\r\n\r\n\t\tif (validationErrorCallback) {\r\n\t\t\tvalidationErrorCallback();\r\n\t\t}\r\n\r\n\t\treturn { ...newValidationState, [FORM_ERROR]: globalErrors ? globalErrors : errorMessage };\r\n\t} else {\r\n\t\t// generic error.\r\n\t\tif (genericErrorCallback) {\r\n\t\t\tgenericErrorCallback();\r\n\t\t}\r\n\r\n\t\tif (error?.response?.data?.message) {\r\n\t\t\treturn { [FORM_ERROR]: error.response.data.message };\r\n\t\t}\r\n\r\n\t\tif (errorMessage) {\r\n\t\t\treturn { [FORM_ERROR]: errorMessage };\r\n\t\t} else {\r\n\t\t\treturn {};\r\n\t\t}\r\n\t}\r\n};\r\n\r\n/**\r\n * Get an html class or ID safe string from provided string.\r\n *\r\n * @function getHtmlSafeName\r\n */\r\nexport const getHtmlSafeName = (name: string = ''): string => {\r\n\treturn name.replace(/[^a-z0-9]/g, (s) => {\r\n\t\tconst c = s.charCodeAt(0);\r\n\t\tif (c === 32) {\r\n\t\t\treturn '-';\r\n\t\t}\r\n\t\tif (c >= 65 && c <= 90) {\r\n\t\t\treturn '_' + s.toLowerCase();\r\n\t\t}\r\n\t\treturn '__' + ('000' + c.toString(16)).slice(-4);\r\n\t});\r\n};\r\n\r\n/**\r\n * Gets the specified param value from the querystring\r\n *\r\n * @param paramName the name of the query string parameter\r\n * @param decodeParam specifies if the param value should be decoded before returning it\r\n */\r\nexport const getQueryParam = (paramName: string = '', decodeParam: boolean = false): string | null => {\r\n\tconst urlParams = new URLSearchParams(window.location.search);\r\n\tconst paramValue = urlParams.get(paramName);\r\n\r\n\tif (!paramValue) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tif (decodeParam) {\r\n\t\treturn decodeURIComponent(paramValue);\r\n\t} else {\r\n\t\treturn paramValue;\r\n\t}\r\n};\r\n","/**\r\n * Extends Window with recaptcha callback fields\r\n */\r\ninterface WindowWithReCaptchaCallbacks extends Window {\r\n\t/**\r\n\t * Executes the methods in the rocReCaptchaCallbacks array\r\n\t */\r\n\tonReCaptchaLoadCallback: () => void;\r\n\t/**\r\n\t * List of recaptcha callbacks\r\n\t */\r\n\trocReCaptchaCallbacks: Array<() => void>;\r\n}\r\n\r\nexport let reCaptchaCallbackPromise: Promise | null = null;\r\n\r\n/**\r\n * Setup function for recaptcha.\r\n * The window.onReCaptchaLoadCallback() gets called when the recaptcha script is loaded.\r\n * Then this method calls the recaptcha instances init functions, stored in window.rocReCaptchaCallbacks\r\n *\r\n * @export\r\n */\r\nexport default function setupReCaptcha() {\r\n\tconst windowWithReCaptchaCallbacks = (window as unknown) as WindowWithReCaptchaCallbacks;\r\n\r\n\treCaptchaCallbackPromise = new Promise((resolve) => {\r\n\t\twindowWithReCaptchaCallbacks.onReCaptchaLoadCallback = resolve;\r\n\t});\r\n}\r\n","import { Address } from 'shared-client/types/address';\r\nimport {\r\n\tHasNoSalePrice,\r\n\tMissingDisplayPrice,\r\n\tPrice,\r\n\tSimpleDisplayPrice,\r\n} from 'shared-client/types/commerce/display-price';\r\nimport { BasicDto, PaginatedResult } from 'shared/types';\r\nimport { ModelStatus } from '../../../../../Roc.SharedClientApp/types/model-status';\r\nimport { ShippingMethod, ShippingOption } from '../checkout/types/shipping';\r\nimport { ProductPricingLine, ProductSelection, SimpleSelectionDto } from '../product-details/types';\r\n\r\n/**\r\n * Represents a single line item on an order\r\n *\r\n */\r\nexport interface OrderItem {\r\n\t/**\r\n\t * The primary key (Guid)\r\n\t */\r\n\tid: string;\r\n\r\n\t/**\r\n\t * The order line item name\r\n\t */\r\n\tname: string;\r\n\r\n\t/**\r\n\t * The order line item Sku\r\n\t */\r\n\tsku: string;\r\n\r\n\t/**\r\n\t * The line item's quantity\r\n\t */\r\n\tquantity: number;\r\n\r\n\t/**\r\n\t *\r\n\t * The order line item product URL\r\n\t */\r\n\turl: string;\r\n\r\n\t/**\r\n\t * The order line item product group URL\r\n\t */\r\n\tgroupUrl: string;\r\n\r\n\t/**\r\n\t * The list of selectable attributes and their values for this line item\r\n\t */\r\n\tselections?: ProductSelection[];\r\n\r\n\t/**\r\n\t * The order line item related product entity\r\n\t */\r\n\tproduct: OrderItemProduct;\r\n\r\n\t/**\r\n\t * The product unit of measure for this line item\r\n\t */\r\n\tpricingLine: ProductPricingLine;\r\n\r\n\t/**\r\n\t * The amount of tax applied to this line item.\r\n\t */\r\n\ttax?: SimpleDisplayPrice & HasNoSalePrice;\r\n\r\n\t/**\r\n\t * The total discount amount applied to this line item across all quantities.\r\n\t */\r\n\tdiscount?: SimpleDisplayPrice & HasNoSalePrice;\r\n\r\n\t/**\r\n\t * The part of the order-level discount that is being spread to this line item.\r\n\t */\r\n\torderDiscount?: SimpleDisplayPrice & HasNoSalePrice;\r\n\r\n\t/**\r\n\t * The displayable price of a single unit of this line item.\r\n\t */\r\n\tunitPrice?: SimpleDisplayPrice;\r\n\r\n\t/**\r\n\t * The displayable total price of this line item.\r\n\t */\r\n\ttotalPrice?: SimpleDisplayPrice & HasNoSalePrice;\r\n\r\n\t/**\r\n\t * The status of the line item\r\n\t */\r\n\tstatus?: OrderStatus;\r\n\r\n\t//#region TapeCase\r\n\r\n\tsnapshotMinimumOrderQuantity: number | null;\r\n\r\n\t//#endregion\r\n}\r\n\r\n/**\r\n * Represents a product related to the order line item\r\n */\r\nexport interface OrderItemProduct {\r\n\t/**\r\n\t * The primary key (Guid)\r\n\t */\r\n\tid: string;\r\n\r\n\t/**\r\n\t * The main image thumbnail url\r\n\t */\r\n\tthumbnailUrl: string | null;\r\n\r\n\t/**\r\n\t * The related brand name\r\n\t */\r\n\tbrandName: string | null;\r\n\r\n\t/**\r\n\t * The alt text for thumbnail\r\n\t */\r\n\taltText?: string;\r\n\r\n\t/**\r\n\t * Status of the Product\r\n\t */\r\n\tstatus?: ModelStatus;\r\n\r\n\t/**\r\n\t * The associated group product Id of a simple product, if applicable.\r\n\t */\r\n\tproductGroupId: string;\r\n}\r\n\r\n/**\r\n * Represents a single recipient on an order\r\n */\r\nexport interface OrderRecipient extends Address {\r\n\t/**\r\n\t * The primary key (Guid)\r\n\t */\r\n\tid: string;\r\n\t/**\r\n\t * The order line items\r\n\t */\r\n\titems: OrderItem[];\r\n\t/**\r\n\t * The available shipping options for this recipient\r\n\t */\r\n\tshippingOptions: ShippingOption[];\r\n\t/**\r\n\t * The shipping service selected for this recipient\r\n\t */\r\n\tshippingMethodId: string | null;\r\n\t/**\r\n\t * The shipping service name selected for this recipient\r\n\t */\r\n\tshippingMethod: ShippingMethod;\r\n\t/**\r\n\t * The addressId of the selected address from the address book (if any)\r\n\t */\r\n\taddressId: string | null;\r\n\t/**\r\n\t * The order recepient's Recipient Name, used for organization orders\r\n\t */\r\n\trecipientName?: string;\r\n\r\n\t//#region TapeCase\r\n\r\n\t/**\r\n\t * The blindship flag for Recipient.\r\n\t */\r\n\tisBlindShip: boolean;\r\n\t/**\r\n\t * The shipping account selected for this recipient\r\n\t */\r\n\tshippingAccountId: string | null;\r\n\r\n\t//#endregion\r\n}\r\n\r\n/**\r\n * Represents totals on an order\r\n */\r\nexport interface OrderTotals {\r\n\t/**\r\n\t * The merchandise subtotal for the order, without consideration of discounts, tax, or shipping\r\n\t */\r\n\tbaseSubtotal: SimpleDisplayPrice & HasNoSalePrice;\r\n\t/**\r\n\t * The total discount amount applied to the order line items. Some discounts are applied at the order level\r\n\t */\r\n\tlineDiscount: SimpleDisplayPrice & HasNoSalePrice;\r\n\t/**\r\n\t * The baseSubtotal amount less the lineDiscount amount\r\n\t */\r\n\tsubtotal: SimpleDisplayPrice & HasNoSalePrice;\r\n\t/**\r\n\t * The sum of the recipients Discount\r\n\t */\r\n\tdiscount: (SimpleDisplayPrice & HasNoSalePrice) | MissingDisplayPrice;\r\n\t/**\r\n\t * The sum of the recipients shipping discount amounts\r\n\t */\r\n\tshippingDiscount: SimpleDisplayPrice & HasNoSalePrice;\r\n\t/**\r\n\t * The sum of the recipients shipping amounts\r\n\t */\r\n\tshipping?: SimpleDisplayPrice & HasNoSalePrice;\r\n\t/**\r\n\t * The sum of the recipients tax amounts\r\n\t */\r\n\ttax?: SimpleDisplayPrice & HasNoSalePrice;\r\n\t/**\r\n\t * The sum of the recipients line tax amounts\r\n\t */\r\n\tlineTax?: SimpleDisplayPrice & HasNoSalePrice;\r\n\t/**\r\n\t * The sum of the recipients shipping tax amounts\r\n\t */\r\n\tshippingTax?: SimpleDisplayPrice & HasNoSalePrice;\r\n\t/**\r\n\t * The total shipping charges determined by subtracting the shipping discount shipping amount then adding the shipping tax\r\n\t */\r\n\tshippingTotal: SimpleDisplayPrice & HasNoSalePrice;\r\n\t/**\r\n\t * The total order charges, which is the sum of the subtotal, the shipping reduced by the shipping discount, and the tax\r\n\t */\r\n\ttotal: SimpleDisplayPrice & HasNoSalePrice;\r\n\t/**\r\n\t * The total order charges after gift cards are applied\r\n\t */\r\n\tmodifiedOrderTotal: SimpleDisplayPrice & HasNoSalePrice;\r\n}\r\n\r\n/**\r\n * Represents a single customer order or shopping cart\r\n */\r\nexport interface Order extends OrderTotals, Address {\r\n\t/**\r\n\t * The primary key (Guid)\r\n\t */\r\n\tid: string;\r\n\t/**\r\n\t * The ID of the organizationShipTo associated with this order.\r\n\t * Null when the order is not created by a user in an organization, or there are no ship-tos available for the user\r\n\t */\r\n\torganizationShipToId: string | null;\r\n\t/**\r\n\t * The shopping cart or completed order recipients\r\n\t */\r\n\trecipients: OrderRecipient[];\r\n\t/**\r\n\t * The shopping cart or completed order unique cart code\r\n\t */\r\n\torderCode: string;\r\n\t/**\r\n\t * The email associated to the order.\r\n\t */\r\n\temail: string;\r\n\t/**\r\n\t * If the billing address is the same as the shipping address of a recipient,\r\n\t * this field will contain the ID of that recipient.\r\n\t */\r\n\tsameAsRecipientId: string | null;\r\n\r\n\t/**\r\n\t * The shopping cart or completed order promtions\r\n\t */\r\n\tpromotions: OrderPromotion[];\r\n\r\n\t/**\r\n\t * The unique order number of the completed order\r\n\t */\r\n\torderNo: string | null;\r\n\r\n\t/**\r\n\t * The date and time that the order was successfully placed. If null, this is still a pending shopping cart.\r\n\t */\r\n\tprocessDate: Date | null;\r\n\r\n\t/**\r\n\t * Modify date\r\n\t */\r\n\tmodifyDate: Date;\r\n\r\n\t/**\r\n\t * The current order status\r\n\t */\r\n\torderStatus: OrderStatus;\r\n\r\n\t/**\r\n\t * The localized order date string, used for display purposes\r\n\t */\r\n\tlocalizedOrderDate: string;\r\n\r\n\t/**\r\n\t * The authorization or sale payment for the current order\r\n\t */\r\n\tpaymentLogs: PaymentLog[];\r\n\r\n\t/**\r\n\t * The gift cards saved on the order.\r\n\t */\r\n\tpaymentMethods: PaymentMethod[];\r\n\r\n\t/**\r\n\t * If the order is locked\r\n\t */\r\n\tisLocked: boolean;\r\n\r\n\t/**\r\n\t * The list of notes associated to the order.\r\n\t */\r\n\tnotes: OrderNote[];\r\n\r\n\t/**\r\n\t * The 3-character ISO 4217 code representing currency of the order\r\n\t */\r\n\tsnapshotCurrencyISO: string;\r\n\r\n\t/**\r\n\t * The purchase order number\r\n\t */\r\n\tpurchaseOrderNumber: string;\r\n\r\n\t/**\r\n\t * Count of all the items in the order\r\n\t */\r\n\ttotalItemsCount: number;\r\n\r\n\t/**\r\n\t * The user specified name of saved cart.\r\n\t * Undefined if the user has not named the cart.\r\n\t */\r\n\tname?: string;\r\n\r\n\t//#region TapeCase\r\n\t/**\r\n\t * The flag indicating whether the free shipping is available for this order.\r\n\t */\r\n\tfreeShippingAvailable: boolean;\r\n\r\n\t/**\r\n\t * The flag indicating whether the tax exempt is available for this order.\r\n\t */\r\n\tisTaxExempt: boolean;\r\n\t//#endregion\r\n}\r\n\r\n/**\r\n * Represents a single order note on an order\r\n */\r\nexport interface OrderNote {\r\n\t/**\r\n\t * The primary key (Guid)\r\n\t */\r\n\tid: string;\r\n\r\n\t/**\r\n\t * The user who created the note.\r\n\t */\r\n\tcreateUser: string;\r\n\r\n\t/**\r\n\t * The localized date note was created used for display purpose.\r\n\t */\r\n\tcreateDate: string | null;\r\n\r\n\t/**\r\n\t * Indicates the type of note.\r\n\t */\r\n\tnoteType: string;\r\n\r\n\t/**\r\n\t * The note entered in the admin.\r\n\t */\r\n\tnote: string;\r\n}\r\n\r\n/**\r\n * Represents a single promotion on an order\r\n */\r\nexport interface OrderPromotion {\r\n\t/**\r\n\t * The primary key (Guid)\r\n\t */\r\n\tid: string;\r\n\r\n\t/**\r\n\t * The identifier for the promotion (Guid)\r\n\t */\r\n\tpromotionId: string;\r\n\r\n\t/**\r\n\t * The coupon code associated with this cart or order promotion\r\n\t */\r\n\tcouponCode: string;\r\n}\r\n\r\n/**\r\n * Represents a list of user saved products\r\n */\r\nexport interface GetSavedProductsResult extends PaginatedResult {}\r\n\r\n/**\r\n * Represents what an item's last action was in the cart\r\n */\r\nexport enum MoveStatus {\r\n\tMovedToCart,\r\n\tMovedToSaved,\r\n\tRemovedFromSaved,\r\n\tRemovedFromCart,\r\n}\r\n\r\n/**\r\n * Represents a single user saved product\r\n * Contains only the information needed to display a product's basic information and move it to the cart\r\n */\r\nexport interface SavedProduct {\r\n\t/**\r\n\t * The UserSavedProduct primary key (Guid)\r\n\t */\r\n\tid: string;\r\n\r\n\t/**\r\n\t * The ID of the product represented by this SavedProduct\r\n\t */\r\n\tproductId: string;\r\n\r\n\tsku: string;\r\n\r\n\tname: string;\r\n\r\n\turl: string;\r\n\r\n\tgroupUrl: string;\r\n\r\n\tunitPrice: SimpleDisplayPrice;\r\n\r\n\ttotalPrice: SimpleDisplayPrice & HasNoSalePrice;\r\n\r\n\tselections?: SimpleSelectionDto[];\r\n\r\n\tisVirtual: boolean;\r\n\r\n\tthumbnailUrl: string | null;\r\n\r\n\tbrandName: string | null;\r\n\r\n\t/**\r\n\t * The pricing line for this line item\r\n\t */\r\n\tpricingLine: ProductPricingLine;\r\n\r\n\tquantity: number;\r\n\r\n\taltText?: string;\r\n\r\n\t/**\r\n\t * The associated group product Id of a simple product, if applicable.\r\n\t */\r\n\tproductGroupId: string;\r\n}\r\n\r\nexport interface AddToCartProps {\r\n\titemId: string;\r\n\tquantity: number | null;\r\n\tproductPricingLineId: string | null;\r\n}\r\n\r\nexport interface AddAllToCartProps {\r\n\tshoppingListId: string;\r\n\r\n\t/**\r\n\t * List of selected products ids to be added to cart\r\n\t */\r\n\tselectedShoppingListProductIds: string[];\r\n}\r\n\r\n/**\r\n * The request used for bulk add to cart\r\n */\r\nexport interface BulkAddToCartProps {\r\n\titems: AddToCartProps[];\r\n}\r\n\r\n/**\r\n * Order status enum\r\n */\r\nexport enum OrderStatus {\r\n\tNew = 'New',\r\n\tSaved = 'Saved',\r\n\tDiscarded = 'Discarded',\r\n\tOrdered = 'Ordered',\r\n\tShipped = 'Shipped',\r\n\tPartiallyShipped = 'PartiallyShipped',\r\n\tCredited = 'Credited',\r\n\tCanceled = 'Canceled',\r\n\tPartiallyCanceled = 'PartiallyCanceled',\r\n\tReturned = 'Returned',\r\n\tCompleted = 'Completed',\r\n}\r\n\r\n/**\r\n * Payment Log DTO\r\n */\r\nexport type PaymentLog =\r\n\t| {\r\n\t\t\tpaymentType: PaymentTypeEnum.CreditCard;\r\n\t\t\tlast4: string;\r\n\t\t\tcreditCardType: CreditCardType | null;\r\n\t\t\tamount: SimpleDisplayPrice & HasNoSalePrice;\r\n\t }\r\n\t| {\r\n\t\t\tpaymentType: PaymentTypeEnum.GiftCard;\r\n\t\t\tgiftCardNumber: string;\r\n\t\t\tamount: SimpleDisplayPrice & HasNoSalePrice;\r\n\t }\r\n\t| {\r\n\t\t\tpaymentType: PaymentTypeEnum.CorporateAccount;\r\n\t\t\tamount: SimpleDisplayPrice & HasNoSalePrice;\r\n\t }\r\n\t//#region TapeCase\r\n\t| {\r\n\t\t\tpaymentType: PaymentTypeEnum.PurchaseOrder;\r\n\t\t\tpurchaseOrderNumber: string;\r\n\t\t\t//#endregion\r\n\t };\r\n\r\nexport enum PaymentTypeEnum {\r\n\tCreditCard = 'CreditCard',\r\n\tGiftCard = 'GiftCard',\r\n\t//TODO(Paradigm): do we comment these out? Also check why 'GiftCard' wasn't here already?\r\n\t// Not implemented yet:\r\n\tApplePay = 'ApplePay',\r\n\tGooglePay = 'GooglePay',\r\n\tPayPal = 'PayPal',\r\n\tPurchaseOrder = 'PurchaseOrder',\r\n\tCorporateAccount = 'CorporateAccount',\r\n}\r\n\r\n/**\r\n * Credit card type enum\r\n */\r\nexport enum CreditCardType {\r\n\tAMERICAN_EXPRESS = 'AMERICAN_EXPRESS',\r\n\tVISA = 'VISA',\r\n\tMASTERCARD = 'MASTERCARD',\r\n\tDISCOVER = 'DISCOVER',\r\n\tOTHER = 'OTHER',\r\n}\r\n\r\nexport interface PaymentMethod extends BasicDto {\r\n\tchargeAmount: SimpleDisplayPrice & HasNoSalePrice;\r\n\tbalanceAmount: SimpleDisplayPrice & HasNoSalePrice;\r\n\tpaymentType: PaymentTypeEnum;\r\n\tcardNumber: string;\r\n}\r\n\r\nexport interface AddToCartEvent {\r\n\t/**\r\n\t * The id of the product\r\n\t */\r\n\tid: string;\r\n\t/**\r\n\t * The name of the product\r\n\t */\r\n\tname: string;\r\n\t/**\r\n\t * The product SKU\r\n\t */\r\n\tsku: string;\r\n\t/**\r\n\t * The price of a product\r\n\t */\r\n\tprice: number;\r\n\t/**\r\n\t * The quantity of a product that actually got added to the cart\r\n\t */\r\n\tadjustedQuantity: number;\r\n\t/**\r\n\t * The 3-character ISO 4217 code representing currency of the item\r\n\t */\r\n\tcurrency: string;\r\n\r\n\t/**\r\n\t * The associated group product Id of a simple product, if applicable.\r\n\t */\r\n\tproductGroupId: string | null;\r\n\r\n\t/**\r\n\t * The list of selectable attributes and their values for the product that was added to cart\r\n\t */\r\n\tselections: ProductSelection[] | null;\r\n}\r\n\r\n/**\r\n * Represents the saved shopping cart\r\n */\r\nexport interface SavedCart {\r\n\torderId: string;\r\n\tname: string;\r\n\torderCode: string;\r\n\titemCount: number;\r\n\tlastModifiedDate: string;\r\n}\r\n","import { RocEventType, RocEvent, ExtractEventParameters } from 'shared/events';\r\n\r\n/**\r\n * Helper function for handling ROC events from non React functions.\r\n * @param eventType The type of event to handle\r\n * @param eventHandler The event handler\r\n * @returns The callback function to remove this handler\r\n */\r\nexport default function addRocEventHandler(\r\n\teventType: T,\r\n\teventHandler: (data: ExtractEventParameters) => void,\r\n): () => void {\r\n\tconst handler = (evt: CustomEvent): void => {\r\n\t\teventHandler(evt.detail);\r\n\t};\r\n\r\n\tdocument.addEventListener(eventType, handler);\r\n\r\n\treturn () => document.removeEventListener(eventType, handler);\r\n}\r\n","import * as React from 'react';\r\n\r\ninterface DashCircleSVGProps {\r\n\tclass?: string;\r\n}\r\n\r\n/**\r\n * Dash circle SVG\r\n *\r\n * @returns\r\n */\r\nfunction DashCircleSVG(props: DashCircleSVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default DashCircleSVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Circle Exclaimation SVG component\r\n *\r\n * @returns\r\n */\r\nfunction CircleExclamationSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default CircleExclamationSVG;\r\n","/**\r\n * THIS HAS A COPY ON ROC.WEB. DO NOT MAKE CHANGES HERE WITHOUT ALSO MAKING THEM IN THE OTHER FILE.\r\n *\r\n * THIS MUST ALSO BE KEPT IN SYNC WITH THE \"RazorDisplayPrice\" VIEW COMPONENT.\r\n *\r\n * DIVERGENCES:\r\n * - The style \"visually-hidden\" DOES NOT EXIST ON ROC.WEB. Change this to \"roc-visually-hidden\"\r\n */\r\n\r\nimport classnames from 'classnames';\r\nimport React from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { CssClasses, ProductPricingProps } from 'shared-client/types/commerce/product-details';\r\nimport {\r\n\tAmbiguousDisplayPrice,\r\n\tMissingDisplayPrice,\r\n\tPartialDisplayPrice,\r\n\tPrice,\r\n\tPriceDisplayRule,\r\n\tPriceSpan,\r\n\tSimpleDisplayPrice,\r\n} from 'shared-client/types/commerce/display-price';\r\n\r\nimport { PricingResourceKeys } from 'features/commerce/pricing/resources';\r\n\r\nconst GetCssClasses = (className: string | undefined, inline: boolean) => {\r\n\tconst priceClass = ['roc-pricing__price', className ? className + '__price' : null];\r\n\r\n\treturn {\r\n\t\tbase: ['roc-pricing', { 'roc-pricing--inline': inline }, className ? className : null],\r\n\t\tnormalPrice: ['roc-pricing__price', className ? className + '__price' : null],\r\n\t\tcrossedOutPrice: [\r\n\t\t\tpriceClass,\r\n\t\t\t'roc-pricing__price--original',\r\n\t\t\tclassName ? className + '__price--original' : null,\r\n\t\t],\r\n\t\thighlightedPrice: [priceClass, 'roc-pricing__price--sale', className ? className + '__price--sale' : null],\r\n\t};\r\n};\r\n\r\n/**\r\n * Renders a product price. This could be a simple price \"$4.99\", a price that's on sale \"~~$4.99~~ $3.99\",\r\n * a range of prices, an ambiguous price or potentially others.\r\n *\r\n * The pricing information is expected to have come from the server where it has already been validated.\r\n * It is the responsibility of the caller to verify pricing objects passed to ProductPricing are valid.\r\n */\r\nexport default function ProductPricing(props: ProductPricingProps) {\r\n\tconst { displayPrice, className, inline = false, testId = 'product-price' } = props;\r\n\r\n\t// The server/caller is trusted to have provided valid props.\r\n\t// Do no validation here.\r\n\r\n\tif (displayPrice == null) {\r\n\t\t// Missing price. Remove this if MissingPrice functionality is ever needed beyond \"don't render\"\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst css = GetCssClasses(className, inline);\r\n\r\n\tlet renderResult: JSX.Element | null;\r\n\tswitch (displayPrice.displayRule) {\r\n\t\tcase PriceDisplayRule.Missing:\r\n\t\t\trenderResult = renderMissingPrice(css, displayPrice);\r\n\t\t\tbreak;\r\n\r\n\t\tcase PriceDisplayRule.Normal:\r\n\t\t\trenderResult = renderNormalPrice(css, displayPrice, testId);\r\n\t\t\tbreak;\r\n\r\n\t\tcase PriceDisplayRule.AmbiguousRange:\r\n\t\t\trenderResult = renderAmbiguousPrice(css, displayPrice, testId);\r\n\t\t\tbreak;\r\n\r\n\t\tdefault:\r\n\t\t\tthrow new Error('Erroneous price display rule');\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{renderResult}\r\n\t\t\r\n\t);\r\n}\r\n\r\n/**\r\n * Renders a missing price, eg nothing. This currently renders nothing but could be updated to render \"Not For Sale\" for example.\r\n * @param css The set of css rules that can be applied.\r\n * @param price The price object\r\n */\r\n// eslint-disable-next-line no-unused-vars\r\nfunction renderMissingPrice(css: CssClasses, price: MissingDisplayPrice) {\r\n\treturn null;\r\n}\r\n\r\n/**\r\n * Renders a normal price. This is a price that might be on sale and may either be a unit price (eg $4.99) or a\r\n * range (eg $3.99 - $7.99).\r\n * @param css The set of css rules that can be applied.\r\n * @param price The price object\r\n */\r\nfunction renderNormalPrice(css: CssClasses, price: SimpleDisplayPrice, testId: string) {\r\n\t// conditionally cross out the base price\r\n\tconst basePriceClass = price.salePrice != null ? css.crossedOutPrice : css.normalPrice;\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\t\t{Localizer('OriginalPrice')}\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t{price.salePrice != null ? (\r\n\t\t\t\t\r\n\t\t\t\t\t{Localizer('SalePrice')}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t\r\n\t);\r\n}\r\n\r\n/**\r\n * Renders an ambiguous price. This is a compound price representing multiple different products where the upperbound of the price\r\n * can't be reported in a useful way. The units of measure between the base and sale price may be different.\r\n * @param css The set of css rules that can be applied.\r\n * @param price The price object\r\n */\r\nfunction renderAmbiguousPrice(css: CssClasses, price: AmbiguousDisplayPrice, testId: string) {\r\n\t// conditionally cross out the base price\r\n\tconst basePriceClass = price.salePrice != null ? css.crossedOutPrice : css.normalPrice;\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\t\t{Localizer('OriginalPrice')}\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t{price.salePrice != null ? (\r\n\t\t\t\t\r\n\t\t\t\t\t{Localizer('SalePrice')}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t\r\n\t);\r\n}\r\n\r\n/**\r\n * Renders a partial display price (eg it may be either a simple price or a range price)\r\n */\r\nfunction VariantPriceComponent({ price }: { price: PartialDisplayPrice }) {\r\n\tconst label = price.unit?.label;\r\n\r\n\tswitch (typeof price.value) {\r\n\t\tcase 'string':\r\n\t\t\treturn ;\r\n\r\n\t\tcase 'object':\r\n\t\t\treturn ;\r\n\t}\r\n}\r\n\r\nfunction FormatAmbiguousPriceSpan(props: { price: Price; unitName: string }) {\r\n\t// Ambiguous prices always have a unit of measure. It is never optional.\r\n\treturn <>{Localizer('AmbiguousPriceRangeWithUnit', props.price, props.unitName)};\r\n}\r\n\r\n/**\r\n * Renders a price range (eg $14.99 - $19.99) with an optional unit of measure\r\n */\r\nfunction FormatPriceSpan(props: { priceRange: PriceSpan; unitName: string | undefined }) {\r\n\treturn props.unitName != null ? (\r\n\t\t<>\r\n\t\t\t{Localizer(\r\n\t\t\t\t'PriceRangeWithUnit',\r\n\t\t\t\tprops.priceRange.from,\r\n\t\t\t\tprops.priceRange.to,\r\n\t\t\t\tprops.unitName,\r\n\t\t\t)}\r\n\t\t\r\n\t) : (\r\n\t\t<>{Localizer('PriceRangeWithoutUnit', props.priceRange.from, props.priceRange.to)}\r\n\t);\r\n}\r\n\r\n/** Formats the price with the unit of measure (if present) appended. */\r\nfunction FormatPrice(props: { price: Price; unitName?: string }) {\r\n\treturn props.unitName != null ? (\r\n\t\t<>{Localizer('PriceWithUnit', props.price, props.unitName)}\r\n\t) : (\r\n\t\t<>{Localizer('PriceWithoutUnit', props.price)}\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport XSVG from './svg/XSVG';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { WithTestIdOptional } from '../../../../Roc.SharedClientApp/types/test';\r\n\r\ninterface CircleButtonProps extends WithTestIdOptional {\r\n\ticon?: React.ReactNode;\r\n}\r\n\r\nfunction CircleButton(props: React.HTMLProps & CircleButtonProps) {\r\n\tconst { icon, testId, ...otherProps } = props;\r\n\r\n\treturn (\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default CircleButton;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Star Empty SVG\r\n *\r\n * @returns\r\n */\r\nfunction StarEmptySVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default StarEmptySVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Star SVG\r\n *\r\n * @returns\r\n */\r\nfunction StarSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default StarSVG;\r\n","/* eslint-disable jsx-a11y/label-has-for */\r\n/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\r\nimport classnames from 'classnames';\r\nimport React from 'react';\r\nimport { WithTestId } from 'shared-client/types/test';\r\nimport StarEmptySVG from 'shared/components/svg/StarEmptySVG';\r\nimport StarSVG from 'shared/components/svg/StarSVG';\r\nimport useStarRating from './useStarRating';\r\n\r\n/**\r\n * Product Rating Props\r\n */\r\ninterface RatingProps extends WithTestId {\r\n\tvalue: number | null;\r\n\tname: string;\r\n\treadonly?: boolean;\r\n\tonChange?: (rating: number) => void;\r\n\tmaxRating?: number;\r\n}\r\n\r\n/**\r\n * If readonly, displays the rating with blank and filled stars (1-maxRating)\r\n * If not readonly, displays the rating picker with blank and filled stars (1-maxRating)\r\n * @param props\r\n */\r\nexport default function StarRating(props: RatingProps) {\r\n\tconst { value, name, readonly = false, onChange, maxRating = 5, testId } = props;\r\n\r\n\tconst { ratingStars, setRatingHovered } = useStarRating({\r\n\t\tvalue,\r\n\t\tname,\r\n\t\tmaxRating,\r\n\t});\r\n\r\n\tif (!readonly && !onChange) {\r\n\t\tthrow new Error('Rating component is set to non-readonly, yet onChange is not defined.');\r\n\t}\r\n\r\n\t/**\r\n\t * Handle changes to the radio button that backs the star rating selection\r\n\t *\r\n\t * @param {*} e\r\n\t */\r\n\tconst onInputChange = (e) => {\r\n\t\tif (onChange) {\r\n\t\t\tonChange(parseInt(e.currentTarget.value));\r\n\t\t}\r\n\t};\r\n\r\n\tif (readonly) {\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t{ratingStars.map(({ id, isFull }) => (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{isFull ? (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t\r\n\t\t\t\t))}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{ratingStars.map(({ id, isFull, isChecked, isPending, isHighlighted, ratingValue }) => {\r\n\t\t\t\tconst modifierClasses = classnames({\r\n\t\t\t\t\t'roc-rating__input--full': isFull,\r\n\t\t\t\t\t'roc-rating__input--pending': isPending,\r\n\t\t\t\t\t'roc-rating__label--highlighted': isHighlighted,\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t setRatingHovered(ratingValue)}\r\n\t\t\t\t\t\t\tonMouseLeave={() => setRatingHovered(null)}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{isFull ? (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t);\r\n\t\t\t})}\r\n\t\t\r\n\t);\r\n}\r\n","import { useEffect, useState } from 'react';\r\n\r\n/**\r\n * The state of all of the stars being displayed, these change together frequently\r\n * so lets store them together. This is also slightly better than calculating\r\n * on every single render. Makes it easier to reuse as well.\r\n */\r\ninterface RatingStarState {\r\n\tid: string;\r\n\tisFull: boolean;\r\n\tisPending: boolean;\r\n\tisHighlighted: boolean;\r\n\tisChecked: boolean;\r\n\tratingValue: number;\r\n}\r\n\r\n/**\r\n * The params for the useStarRating hook.\r\n */\r\ninterface UseStarRatingParams {\r\n\tvalue: number | null;\r\n\tname: string;\r\n\tmaxRating?: number;\r\n}\r\n\r\n/**\r\n * The values returned by the custom star rating hook\r\n */\r\ninterface UseStarRatingResult {\r\n\tratingStars: RatingStarState[];\r\n\tsetRatingHovered: (value: number | null) => void;\r\n}\r\n\r\n/**\r\n * Custom hook that manages state for simple star rating implementations\r\n * @param params\r\n */\r\nexport default function useStarRating(params: UseStarRatingParams): UseStarRatingResult {\r\n\tconst { value, name, maxRating = 5 } = params;\r\n\tconst [ratingStars, setRatingStars] = useState([]);\r\n\tconst [ratingHovered, setRatingHovered] = useState(null);\r\n\r\n\tuseEffect(() => {\r\n\t\tconst newState: RatingStarState[] = [];\r\n\r\n\t\tfor (let i = 1; i <= maxRating; i++) {\r\n\t\t\tconst id = 'rating-group-' + name + '-' + i;\r\n\t\t\tconst isFull = value !== null && value >= i;\r\n\t\t\tconst isPending = ratingHovered ? i > ratingHovered && isFull : false;\r\n\t\t\tconst isHighlighted = ratingHovered ? i <= ratingHovered : false;\r\n\t\t\tconst isChecked = value === i;\r\n\r\n\t\t\tnewState.push({\r\n\t\t\t\tid,\r\n\t\t\t\tisFull,\r\n\t\t\t\tisPending,\r\n\t\t\t\tisHighlighted,\r\n\t\t\t\tisChecked,\r\n\t\t\t\tratingValue: i,\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tsetRatingStars(newState);\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [value, ratingHovered]);\r\n\r\n\treturn { ratingStars, setRatingHovered };\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Pencil SVG\r\n *\r\n * @returns\r\n */\r\nfunction PencilSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default PencilSVG;\r\n","import React from 'react';\r\nimport { WithTestIdOptional } from '../../../../../Roc.SharedClientApp/types/test';\r\n\r\ninterface CheckSVGProps extends WithTestIdOptional {\r\n\tclass: string;\r\n}\r\n\r\n/**\r\n * Check SVG\r\n *\r\n * @returns\r\n */\r\nfunction CheckSVG(props: CheckSVGProps) {\r\n\tconst testId = `${props.testId ? props.testId : 'svg-check'}`;\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\n// Set default props\r\nCheckSVG.defaultProps = {\r\n\tclass: '',\r\n};\r\n\r\nexport default CheckSVG;\r\n","import React from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { ShoppingCartTitleProps } from './EditableShoppingCartTitle';\r\n/**\r\n * Displays page title\r\n */\r\nfunction ShoppingCartTitle(props: ShoppingCartTitleProps) {\r\n\treturn

{props.cartName ?? Localizer('ShoppingCart')}

;\r\n}\r\n\r\nexport default ShoppingCartTitle;\r\n","import React, { useEffect, useState, useRef, useCallback } from 'react';\r\nimport AxiosHelper from 'services/AxiosHelper';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { getUserData } from 'services/UserData';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport CheckSVG from 'shared/components/svg/CheckSVG';\r\nimport PencilSVG from 'shared/components/svg/PencilSVG';\r\nimport XSVG from 'shared/components/svg/XSVG';\r\nimport { TextBoxField } from 'shared/edit/fields';\r\nimport RocForm from 'shared/edit/RocForm';\r\nimport { dispatchRocEvent } from 'shared/hooks/useRocEventHandler';\r\nimport { FormValidationPromise } from 'shared/types';\r\nimport { handleAxiosErrorWithValidation } from 'shared/util/Misc';\r\nimport ShoppingCartTitle from './ShoppingCartTitle';\r\nexport interface ShoppingCartTitleProps {\r\n\tcartName?: string;\r\n\torderCode?: string;\r\n}\r\n\r\ninterface ShoppingCartNameFields {\r\n\tname: string;\r\n}\r\n\r\n/**\r\n * Displays page title and edit panel to change name of the shopping cart\r\n */\r\nexport default function EditableShoppingCartTitle(props: ShoppingCartTitleProps) {\r\n\tconst [showForm, setShowForm] = useState(false);\r\n\tconst [isLoading, setIsLoading] = useState(false);\r\n\tconst [userIsSignedIn, setUserIsSignedIn] = useState(false);\r\n\tconst [cartName, setCartName] = useState(props.cartName ?? Localizer('ShoppingCart'));\r\n\tconst inputRef = useRef(null);\r\n\tconst buttonRef = useRef(null);\r\n\tconst wrapperRef = useRef(null);\r\n\r\n\t/**\r\n\t * Detects the esc key and closes the form.\r\n\t */\r\n\tconst escFunction = useCallback((event) => {\r\n\t\tif (event.keyCode === 27) {\r\n\t\t\tsetShowForm(false);\r\n\t\t}\r\n\t}, []);\r\n\r\n\tconst initialValues: ShoppingCartNameFields = {\r\n\t\tname: cartName,\r\n\t};\r\n\r\n\tconst showSelectableTitle: boolean = userIsSignedIn && !!props.orderCode;\r\n\r\n\t/**\r\n\t * Bind and unbind events for clicking outside the wrapper so we can close the form.\r\n\t */\r\n\tuseEffect(() => {\r\n\t\tfunction handleClickOutside(event) {\r\n\t\t\tif (wrapperRef.current && !wrapperRef.current.contains(event.target)) {\r\n\t\t\t\tsetShowForm(false);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Bind the event listener\r\n\t\tdocument.addEventListener('mousedown', handleClickOutside);\r\n\t\treturn () => {\r\n\t\t\t// Unbind the event listener on clean up\r\n\t\t\tdocument.removeEventListener('mousedown', handleClickOutside);\r\n\t\t};\r\n\t}, [wrapperRef]);\r\n\r\n\t/**\r\n\t * Always focus the form if its visible.\r\n\t */\r\n\tuseEffect(() => {\r\n\t\tif (showForm) {\r\n\t\t\tinputRef.current?.focus();\r\n\t\t}\r\n\t});\r\n\r\n\t/**\r\n\t * Bind the keydown event so we can detect esc key.\r\n\t */\r\n\tuseEffect(() => {\r\n\t\tdocument.addEventListener('keydown', escFunction, false);\r\n\r\n\t\treturn () => {\r\n\t\t\tdocument.removeEventListener('keydown', escFunction, false);\r\n\t\t};\r\n\t}, [escFunction]);\r\n\r\n\tuseEffect(() => {\r\n\t\t(async () => {\r\n\t\t\ttry {\r\n\t\t\t\tconst data = (await getUserData()).data;\r\n\t\t\t\tsetUserIsSignedIn(data.summary?.isSignedIn ?? false);\r\n\t\t\t} catch (error) {\r\n\t\t\t\tconsole.error('Unable to load user data.', error);\r\n\t\t\t}\r\n\t\t})();\r\n\t}, [userIsSignedIn]);\r\n\r\n\t/**\r\n\t * Handles edit cart name\r\n\t * @param values\r\n\t */\r\n\tconst submitForm = async (values: ShoppingCartNameFields): FormValidationPromise => {\r\n\t\tsetIsLoading(true);\r\n\t\ttry {\r\n\t\t\tawait AxiosHelper.post(`/ajax/cart/edit-cart-name`, values);\r\n\t\t\tsetCartName(values.name);\r\n\t\t\tsetShowForm(false);\r\n\t\t\tdispatchRocEvent('shopping-cart-name-updated', { cartName: values.name });\r\n\t\t} catch (error) {\r\n\t\t\tsetIsLoading(false);\r\n\t\t\treturn handleAxiosErrorWithValidation(error, Localizer('ErrorOccurredSubmittingTheForm'));\r\n\t\t}\r\n\t\tsetIsLoading(false);\r\n\t};\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{userIsSignedIn && (\r\n\t\t\t\t
\r\n\t\t\t\t\t{showForm ? (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tonSubmit={submitForm}\r\n\t\t\t\t\t\t\tsubscription={{\r\n\t\t\t\t\t\t\t\tsubmitError: true,\r\n\t\t\t\t\t\t\t\tsubmitting: true,\r\n\t\t\t\t\t\t\t\tsubmitSucceeded: true,\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tinitialValues={initialValues}\r\n\t\t\t\t\t\t\trender={({ handleSubmit }) => (\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t setShowForm(false)}\r\n\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t{isLoading && }\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t) : showSelectableTitle ? (\r\n\t\t\t\t\t\t setShowForm(true)}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t{cartName}\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)}\r\n\t\t\t\t
\r\n\t\t\t)}\r\n\r\n\t\t\t{!userIsSignedIn && }\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport { useShoppingCartContext } from './ShoppingCartContext';\r\nimport { SavedProduct } from './types';\r\nimport ProductPricing from 'shared/components/commerce/ProductPricing';\r\nimport ProductSelectionsList from './ProductSelectionsList';\r\nimport { dispatchRocEvent } from 'shared/hooks/useRocEventHandler';\r\n\r\ninterface UserSavedProductProps {\r\n\tsavedProduct: SavedProduct;\r\n\tindex: number;\r\n}\r\n\r\n/**\r\n * Displays details for saved for later products including their name, image, pricing, and other attributes,\r\n * and buttons to remove it from the user's saved for later products or move the product to the user's cart.\r\n */\r\nfunction UserSavedProduct(props: UserSavedProductProps) {\r\n\tconst { savedProduct, index } = props;\r\n\r\n\tconst {\r\n\t\tstate: {\r\n\t\t\tupdatingSavedProductId,\r\n\t\t\tupdatingSavedProductPricingLineId: updatingSavedProductUnitOfMeasureId,\r\n\t\t\tsavedProductBeingRemovedId,\r\n\t\t\tsavedProductBeingRemovedPricingLineId: savedProductBeingRemovedUnitOfMeasureId,\r\n\t\t\torderIsUpdating,\r\n\t\t},\r\n\t\tactor: { moveSavedProductToCart, removeSavedProduct },\r\n\t} = useShoppingCartContext();\r\n\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tconst handleMoveSavedProductToCart = (_: React.MouseEvent) => {\r\n\t\tmoveSavedProductToCart(\r\n\t\t\tsavedProduct.productId,\r\n\t\t\tsavedProduct.name,\r\n\t\t\tsavedProduct.pricingLine.id,\r\n\t\t\tsavedProduct.quantity,\r\n\t\t);\r\n\t\treturn;\r\n\t};\r\n\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tconst handleRemoveSavedProduct = (_: React.MouseEvent) => {\r\n\t\tremoveSavedProduct(savedProduct.productId, savedProduct.name, savedProduct.pricingLine.id);\r\n\t\treturn;\r\n\t};\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\tdispatchRocEvent('product-clicked', {\r\n\t\t\t\t\t\t\t\tproductId: savedProduct.productId,\r\n\t\t\t\t\t\t\t\turl: savedProduct.url,\r\n\t\t\t\t\t\t\t\tproductName: savedProduct.name,\r\n\t\t\t\t\t\t\t\tproductGroupId: savedProduct.productGroupId,\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\r\n\t\t\t\t
\r\n\t\t\t\t\t

\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tdispatchRocEvent('product-clicked', {\r\n\t\t\t\t\t\t\t\t\tproductId: savedProduct.productId,\r\n\t\t\t\t\t\t\t\t\turl: savedProduct.url,\r\n\t\t\t\t\t\t\t\t\tproductName: savedProduct.name,\r\n\t\t\t\t\t\t\t\t\tproductGroupId: savedProduct.productGroupId,\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tdata-testid={`saved-product-name-link-${index}`}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{savedProduct.name}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t

\r\n\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\t{savedProduct?.pricingLine != null ? null : Localizer('SavedForLaterProductNoLongerAvailable')}\r\n\t\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t{Localizer('Qty')} \r\n\t\t\t\t\t\t{savedProduct.quantity}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{Localizer('RemoveFromSavedProducts')}\r\n\t\t\t\t\t\t\t{savedProduct.productId === savedProductBeingRemovedId &&\r\n\t\t\t\t\t\t\tsavedProductBeingRemovedUnitOfMeasureId === savedProduct.pricingLine.id ? (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t{savedProduct?.pricingLine != null ? (\r\n\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{Localizer('MoveSavedProductToCart')}\r\n\t\t\t\t\t\t\t\t\t{savedProduct.productId === updatingSavedProductId &&\r\n\t\t\t\t\t\t\t\t\tupdatingSavedProductUnitOfMeasureId === savedProduct.pricingLine.id ? (\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n}\r\n\r\nexport default UserSavedProduct;\r\n","import React from 'react';\r\nimport { useShoppingCartContext } from './ShoppingCartContext';\r\nimport { MoveStatus } from './types';\r\nimport ShoppingCartItemActionInfo from './ShoppingCartItemActionInfo';\r\nimport UserSavedProduct from './UserSavedProduct';\r\nimport { Localizer } from 'services/Localizer';\r\n\r\n/**\r\n * Renders a listing of the user's saved products\r\n */\r\nexport default function SavedProductsListing() {\r\n\tconst {\r\n\t\tstate: { savedProducts, lastMoveStatus, storedForUndoItem, storedForUndoItemIndex },\r\n\t} = useShoppingCartContext();\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t{savedProducts && savedProducts.results && savedProducts.results.length ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t

{Localizer('SavedProducts')}

\r\n\t\t\t\t\t{savedProducts.results.map((savedProduct, productIndex) => {\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{storedForUndoItem &&\r\n\t\t\t\t\t\t\t\tstoredForUndoItemIndex &&\r\n\t\t\t\t\t\t\t\tstoredForUndoItemIndex.itemIndex === productIndex &&\r\n\t\t\t\t\t\t\t\t(lastMoveStatus === MoveStatus.MovedToCart ||\r\n\t\t\t\t\t\t\t\t\tlastMoveStatus === MoveStatus.RemovedFromSaved) ? (\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t})}\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t\t{savedProducts &&\r\n\t\t\tsavedProducts.results &&\r\n\t\t\tstoredForUndoItemIndex &&\r\n\t\t\tstoredForUndoItemIndex.itemIndex === savedProducts.results.length &&\r\n\t\t\t(lastMoveStatus === MoveStatus.MovedToCart || lastMoveStatus === MoveStatus.RemovedFromSaved) ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t
\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Phone SVG component\r\n *\r\n * @returns\r\n */\r\nfunction PhoneSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default PhoneSVG;\r\n","import React from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport PhoneSVG from 'shared/components/svg/PhoneSVG';\r\n\r\ninterface ShoppingCartHelpProps {\r\n\torderCode: string;\r\n\tsupportPhoneNumber: string;\r\n}\r\n\r\n/**\r\n * Basic version of shopping cart help section\r\n */\r\nfunction ShoppingCartHelp(props: ShoppingCartHelpProps) {\r\n\tconst { orderCode, supportPhoneNumber } = props;\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t

\r\n\t\t\t\t{Localizer('HaveAnyQuestions')}\r\n\t\t\t

\r\n\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t{Localizer('CallUs')}{' '}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{supportPhoneNumber}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{Localizer('AvailableHoursText')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t

\r\n\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{Localizer('ShoppingCartReferenceCodeText', orderCode)}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{orderCode}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t

\r\n\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{Localizer('ShoppingCartReferenceCodeInfoText')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t

\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n}\r\n\r\nexport default ShoppingCartHelp;\r\n","import React, { useContext } from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport ProductPricing from 'shared/components/commerce/ProductPricing';\r\nimport Quantity from 'shared/components/commerce/Quantity';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport VisuallyHiddenAnnouncementContext from 'shared/components/VisuallyHiddenAnnouncementContext';\r\nimport { dispatchRocEvent } from 'shared/hooks/useRocEventHandler';\r\nimport ProductSelectionsList from './ProductSelectionsList';\r\nimport { useShoppingCartContext } from './ShoppingCartContext';\r\nimport { OrderItem } from './types';\r\n\r\ninterface ShoppingCartItemProps {\r\n\titem: OrderItem;\r\n\tindex: number;\r\n}\r\n\r\n/**\r\n * Displays details for cart item including its name, image, pricing and other attributes,\r\n * buttons to remove it from the cart and update its quantity.\r\n */\r\nfunction ShoppingCartItem(props: ShoppingCartItemProps) {\r\n\tconst { item, index } = props;\r\n\r\n\tconst {\r\n\t\tstate: { orderItemBeingRemovedId, updatingOrderItemId, orderIsUpdating },\r\n\t\tactor: { changeOrderItemQuantity, removeOrderItem, moveItemToSaved },\r\n\t} = useShoppingCartContext();\r\n\r\n\tconst { setAlert } = useContext(VisuallyHiddenAnnouncementContext);\r\n\r\n\t/**\r\n\t * Handles saving a cart item to a user's saved for later products list by calling the provided callback in component's properties,\r\n\t * which is supposed to move the product to the user's saved for later list, removing it from their cart\r\n\t * @param mouseEvent\r\n\t */\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tconst handleProductSaveForLater = (_: React.MouseEvent) => {\r\n\t\tmoveItemToSaved(item);\r\n\t\treturn;\r\n\t};\r\n\r\n\t/**\r\n\t * Handles cart item removal by calling the provided callback in component's properties which is supposed to handle item's removal\r\n\t * @param mouseEvent\r\n\t */\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tconst handleItemRemoval = (_: React.MouseEvent) => {\r\n\t\tremoveOrderItem(item);\r\n\t\tsetAlert(Localizer('RemovedItem', item.name));\r\n\t};\r\n\r\n\tconst itemUrl = item.url;\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\tdispatchRocEvent('product-clicked', {\r\n\t\t\t\t\t\t\t\tproductId: item.product.id,\r\n\t\t\t\t\t\t\t\turl: itemUrl,\r\n\t\t\t\t\t\t\t\tproductName: item.name,\r\n\t\t\t\t\t\t\t\tproductGroupId: item.product.productGroupId,\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t

\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tdispatchRocEvent('product-clicked', {\r\n\t\t\t\t\t\t\t\t\tproductId: item.product.id,\r\n\t\t\t\t\t\t\t\t\turl: itemUrl,\r\n\t\t\t\t\t\t\t\t\tproductName: item.name,\r\n\t\t\t\t\t\t\t\t\tproductGroupId: item.product.productGroupId,\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{item.name}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t

\r\n\t\t\t\t\t{Localizer('SKU')}: \r\n\t\t\t\t\t{item.sku}\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t{/*
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\tsetIsShipItSelected(true);\r\n\t\t\t\t\t\t\t\t\tsetAlert(\r\n\t\t\t\t\t\t\t\t\t\t'Ship it selected for ' +\r\n\t\t\t\t\t\t\t\t\t\t\titem.name +\r\n\t\t\t\t\t\t\t\t\t\t\t'. Ship to dropdown list is now visible below.',\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t

Ship It

\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t{isShipItSelected && (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\tsetIsShipItSelected(false);\r\n\r\n\t\t\t\t\t\t\t\t\tsetAlert(\r\n\t\t\t\t\t\t\t\t\t\t'In store pickup selected for ' +\r\n\t\t\t\t\t\t\t\t\t\t\titem.name +\r\n\t\t\t\t\t\t\t\t\t\t\t'. Change store button is now visible below.',\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t

In-Store Pickup

\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t{!isShipItSelected && (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\tROC Chicago Store name\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t
*/}\r\n\t\t\t
\r\n\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t

{Localizer('ItemPrice')}

\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\tchangeOrderItemQuantity(item, newQuantity);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tminimumOrderQuantity={item.snapshotMinimumOrderQuantity}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t

{Localizer('Total')}

\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t{/*
\r\n\t\t\t\t\t\tIn Stock\r\n\t\t\t\t\t
*/}\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{Localizer('Remove')}\r\n\t\t\t\t\t\t\t{orderItemBeingRemovedId === item.id ? : null}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{Localizer('SaveForLater')} {updatingOrderItemId === item.id ? : null}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n}\r\n\r\nexport default ShoppingCartItem;\r\n","import React from 'react';\r\nimport LockSVG from 'shared/components/svg/LockSVG';\r\nimport { Localizer } from 'services/Localizer';\r\n\r\n/**\r\n * Simple component to display cart options.\r\n */\r\nfunction ShoppingCartOptions() {\r\n\treturn (\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t{Localizer('SecureCheckout')}\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t{/* */}\r\n\t\t
\r\n\t);\r\n}\r\n\r\nexport default ShoppingCartOptions;\r\n","import React from 'react';\r\nimport { HasNoSalePrice, Price, SimpleDisplayPrice } from 'shared-client/types/commerce/display-price';\r\nimport ProductPricing from 'shared/components/commerce/ProductPricing';\r\n\r\ninterface ShoppingCartSummaryItemProps {\r\n\tname: string;\r\n\tdisplayPrice?: SimpleDisplayPrice & HasNoSalePrice;\r\n\tisLoading: boolean;\r\n}\r\n\r\n/**\r\n * Renders a single cart summary line (name and amount)\r\n */\r\nfunction ShoppingCartSummaryItem(props: ShoppingCartSummaryItemProps) {\r\n\tconst { name, displayPrice } = props;\r\n\r\n\tif (!displayPrice) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t
{name}
\r\n\t\t\t
\r\n\t\t\t\t{displayPrice.basePrice?.rawValue > 0 ? (\r\n\t\t\t\t\t\r\n\t\t\t\t) : (\r\n\t\t\t\t\t'-----'\r\n\t\t\t\t)}\r\n\t\t\t
\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default ShoppingCartSummaryItem;\r\n","import React from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { PriceDisplayRule } from 'shared-client/types/commerce/display-price';\r\nimport { useShoppingCartContext } from './ShoppingCartContext';\r\nimport ShoppingCartPromo from './ShoppingCartPromo';\r\nimport ShoppingCartSummaryItem from './ShoppingCartSummaryItem';\r\n\r\n/**\r\n * Displays cart's summary which includes promotions, cart totals and the shipping estimator tool.\r\n */\r\nfunction ShoppingCartSummary() {\r\n\tconst {\r\n\t\tstate: { order, updatingOrderItemId, orderItemBeingRemovedId },\r\n\t\tactor: { updateOrder, updateOrderMessages },\r\n\t} = useShoppingCartContext();\r\n\r\n\tif (!order) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst orderIsUpdating = (updatingOrderItemId || orderItemBeingRemovedId) != null;\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t

{Localizer('OrderSummary')}

\r\n\t\t\t
\r\n\t\t\t\t{/* */}\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\t{order.discount && order.discount.displayRule !== PriceDisplayRule.Missing ? (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t) : null}\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default ShoppingCartSummary;\r\n","import Axios, { CancelTokenSource } from 'axios';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport ProductPricing from 'shared/components/commerce/ProductPricing';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport InlineAlert from 'shared/edit/InlineAlert';\r\nimport useRocEventHandler, { dispatchRocEvent } from 'shared/hooks/useRocEventHandler';\r\nimport RecentlyViewedProducts from '../recently-viewed/RecentlyViewedProducts';\r\nimport EditableShoppingCartTitle from './EditableShoppingCartTitle';\r\nimport OrderMessages from './OrderMessages';\r\nimport SavedCarts from './SavedCarts';\r\nimport SavedProductsListing from './SavedProductsListing';\r\nimport ShoppingCartContext from './ShoppingCartContext';\r\nimport ShoppingCartHelp from './ShoppingCartHelp';\r\nimport ShoppingCartItem from './ShoppingCartItem';\r\nimport ShoppingCartItemActionInfo from './ShoppingCartItemActionInfo';\r\nimport ShoppingCartOptions from './ShoppingCartOptions';\r\nimport ShoppingCartSummary from './ShoppingCartSummary';\r\nimport { MoveStatus } from './types';\r\nimport useShoppingCart, { UseShoppingCart } from './useShoppingCart';\r\nimport { useShoppingCartLoader } from './useShoppingCartLoader';\r\n\r\nexport default function ShoppingCart() {\r\n\t// this is to ensure that cart page loaded event will be dispatched only once and\r\n\t// does NOT happen between cart reloads\r\n\tconst [cartPageLoadedEventDispatched, setCartPageLoadedEventDispatched] = useState(false);\r\n\r\n\t// Don't want pagination on the cart page\r\n\tconst {\r\n\t\tstate: { error, isLoaded, order, savedProducts, cartSummary, orderMessages },\r\n\t\tactor: { setOrder, setSavedProducts, setCartSummary, reloadCart, setOrderMessages },\r\n\t} = useShoppingCartLoader({ initialSavedProductsPageNumber: 1, initialSavedProductsPageSize: 1000000 });\r\n\tconst UseShoppingCartResult: UseShoppingCart = useShoppingCart({\r\n\t\torder,\r\n\t\tsetOrder,\r\n\t\tsavedProducts,\r\n\t\tsetSavedProducts,\r\n\t\tcartSummary,\r\n\t\tsetCartSummary,\r\n\t\torderMessages,\r\n\t\tsetOrderMessages,\r\n\t});\r\n\r\n\tconst {\r\n\t\tstate: { cartTotalItemCount, errorMessage, storedForUndoItemIndex, lastMoveStatus },\r\n\t\tactor: { setErrorMessage },\r\n\t} = UseShoppingCartResult;\r\n\r\n\t// Reload cart whenever the current cart has been switched\r\n\tuseRocEventHandler(\r\n\t\t'cart-switched',\r\n\t\t() => {\r\n\t\t\treloadCart(Axios.CancelToken.source());\r\n\t\t},\r\n\t\t[reloadCart],\r\n\t);\r\n\r\n\t// Reload the cart whenever the error message changes\r\n\tuseEffect(() => {\r\n\t\t(async () => {\r\n\t\t\tif (!errorMessage) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconsole.debug('An unexpected error occurred, reloading cart.');\r\n\r\n\t\t\tconst requestToken: CancelTokenSource = Axios.CancelToken.source();\r\n\t\t\treloadCart(requestToken);\r\n\r\n\t\t\treturn () => {\r\n\t\t\t\t// cleanup\r\n\t\t\t\trequestToken.cancel();\r\n\t\t\t};\r\n\t\t})();\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [errorMessage]);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!isLoaded || !order) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (cartPageLoadedEventDispatched) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tdispatchRocEvent('cart-page-viewed', { cart: order });\r\n\t\tsetCartPageLoadedEventDispatched(true);\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [isLoaded]);\r\n\r\n\tif (error != null) {\r\n\t\tconsole.warn('Unable to load cart details');\r\n\r\n\t\tsetErrorMessage(Localizer('ErrorWhenLoadingOrder'));\r\n\t}\r\n\r\n\tif (!isLoaded) {\r\n\t\t// if you want to change the spinner message please make sure\r\n\t\t// to update it on the server-side as well (Features/Commerce/Cart/Index.cshtml)\r\n\t\treturn ;\r\n\t}\r\n\treturn (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\t\t{errorMessage ? : null}\r\n\t\t\t\t{cartTotalItemCount === 0 || order === null ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t{Localizer('YourCartIsEmpty')}\r\n\t\t\t\t\t\t\t\t{lastMoveStatus === MoveStatus.RemovedFromCart ||\r\n\t\t\t\t\t\t\t\tlastMoveStatus === MoveStatus.MovedToSaved ? (\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t) : (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{/*
\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t
*/}\r\n\t\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t{/*

\r\n\t\t\t\t\t\t\t\t\t\tUse promo code: Spring25 at checkout for 25% off\r\n\t\t\t\t\t\t\t\t\t

*/}\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{Localizer('OrderTotal')}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t{order.recipients.map((orderRecipient, recipientIndex) => {\r\n\t\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{orderRecipient.items.map((orderItem, index) => {\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (orderItem.product) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{storedForUndoItemIndex &&\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstoredForUndoItemIndex.recipientId === orderRecipient.id &&\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstoredForUndoItemIndex.itemIndex === index &&\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(lastMoveStatus === MoveStatus.RemovedFromCart ||\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlastMoveStatus === MoveStatus.MovedToSaved) ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\t\t\t\t\t{storedForUndoItemIndex &&\r\n\t\t\t\t\t\t\t\t\t\t\tstoredForUndoItemIndex.recipientId === orderRecipient.id &&\r\n\t\t\t\t\t\t\t\t\t\t\tstoredForUndoItemIndex.itemIndex === orderRecipient.items.length &&\r\n\t\t\t\t\t\t\t\t\t\t\t(lastMoveStatus === MoveStatus.RemovedFromCart ||\r\n\t\t\t\t\t\t\t\t\t\t\t\tlastMoveStatus === MoveStatus.MovedToSaved) ? (\r\n\t\t\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\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport ShoppingCart from './ShoppingCart';\r\nimport VisuallyHiddenAnnouncement from 'shared/components/VisuallyHiddenAnnouncement';\r\nimport { initReactApp } from 'shared/util/ApplicationInit';\r\n\r\nconst render = initReactApp(\r\n\t() => (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t),\r\n\t'shopping-cart',\r\n);\r\n\r\nrender();\r\n\r\n// optional, use this to enable hot reloading\r\nif ((module as any).hot) {\r\n\t(module as any).hot.accept('./ShoppingCart', () => {\r\n\t\trender();\r\n\t});\r\n}\r\n","import { ExternalLoginProvider } from 'features/login/ExternalLogins';\r\n\r\n/**\r\n * Extends Window with a property that will hold the client data\r\n *\r\n * @interface WindowWithClientData\r\n * @extends {Window}\r\n */\r\ninterface WindowWithServerData extends Window {\r\n\t__ROC_SERVER_DATA__?: Array<{\r\n\t\t[name: string]: string;\r\n\t}>;\r\n}\r\n\r\n/**\r\n * This type will hold all the keys that are used by ServerData\r\n */\r\ninterface ServerData {\r\n\tIsReCaptchaEnabled?: boolean;\r\n\tReCaptchaV3Key?: string;\r\n\tTimeZone?: string;\r\n\tUSE_EMAIL_AS_USERNAME?: boolean;\r\n\tRegistrationThankYouTitle?: string;\r\n\tRegistrationThankYouMessage?: string;\r\n\tForgotPasswordConfirmationTitle?: string;\r\n\tForgotPasswordConfirmationMessage?: string;\r\n\tPageTitleSuffix?: string;\r\n\tRequireConfirmEmail?: boolean;\r\n\tACCOUNT_URL_BASE?: string;\r\n\tACCOUNT_LOGIN_URL?: string;\r\n\tACCOUNT_LOGOUT_URL?: string;\r\n\tACCOUNT_REGISTER_URL?: string;\r\n\tACCOUNT_LOGIN_WITH_2FA_URL?: string;\r\n\tACCOUNT_FORGOT_PASSWORD_URL?: string;\r\n\tACCOUNT_LOGIN_WITH_RECOVERY_CODE_URL?: string;\r\n\tEXTERNAL_LOGIN_PROVIDERS?: ExternalLoginProvider[];\r\n\t// #region Commerce\r\n\tACCOUNT_ORGANIZATION_REVIEW_URL?: string;\r\n\tACCOUNT_ORGANIZATION_SELECTOR_URL?: string;\r\n\tGoogleMapsApiKey?: string; // used in Store Locator\r\n\tMinimumTimeBeforeRecentlyViewedProductsAreValidated?: number;\r\n\tQuickOrderItemMinumumSearchCharacters?: number;\r\n\tMaxAllowedQuickOrderItems?: number;\r\n\tMaxNumberForQuantityDropdown?: number;\r\n\tOrderDetailsUIComponent?: string;\r\n\tGuestCheckoutEnabled?: boolean;\r\n\t// #endregion\r\n\t// #region TapeCase Customizations\r\n\tListPriceMessagingForNotApprovedDistributors?: string;\r\n\tMaxNumberOfDaysToCancelOrders?: number;\r\n\tMaxNumberOfDaysToCancelOrdersMessage?: string;\r\n\t// #endregion\r\n}\r\n\r\n/**\r\n * Main object that will hold all the client data\r\n */\r\nexport const ServerData: ServerData = {};\r\n\r\n/**\r\n * Initializer function that will populate the main settings object\r\n */\r\nfunction initializeServerData() {\r\n\tconst windowWithServerData = window as WindowWithServerData;\r\n\r\n\tif (\r\n\t\twindowWithServerData &&\r\n\t\twindowWithServerData.__ROC_SERVER_DATA__ &&\r\n\t\tArray.isArray(windowWithServerData.__ROC_SERVER_DATA__)\r\n\t) {\r\n\t\tfor (const obj of windowWithServerData.__ROC_SERVER_DATA__) {\r\n\t\t\tfor (const key of Object.keys(obj)) {\r\n\t\t\t\tServerData[key] = obj[key];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\ninitializeServerData();\r\n","import { useState } from 'react';\r\n\r\n/**\r\n * Custom hook for commonly used loading states.\r\n */\r\nexport function useLoader() {\r\n\tconst [loading, setLoading] = useState(false);\r\n\tconst [error, setError] = useState(undefined);\r\n\tconst [response, setResponse] = useState(null);\r\n\r\n\treturn {\r\n\t\tloading,\r\n\t\tsetLoading,\r\n\t\terror,\r\n\t\tsetError,\r\n\t\tresponse,\r\n\t\tsetResponse,\r\n\t};\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Folder SVG\r\n *\r\n * @returns\r\n */\r\nfunction FolderSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default FolderSVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Garbage Can SVG\r\n *\r\n * @returns\r\n */\r\nfunction GarbageCanCircleSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default GarbageCanCircleSVG;\r\n","import React from 'react';\r\nimport { ModelStatus } from '../../../../Roc.SharedClientApp/types/model-status';\r\nimport DashCircleSVG from './hawksearch/components/svg/DashCircleSVG';\r\nimport CheckCircleSVG from './svg/CheckCircleSVG';\r\nimport FolderSVG from './svg/FolderSVG';\r\nimport GarbageCanCircleSVG from './svg/GarbageCanCircleSVG';\r\nimport PencilSVG from './svg/PencilSVG';\r\n\r\ninterface PageEditorStatusDisplayProps {\r\n\tstatus: ModelStatus;\r\n}\r\n\r\nexport function StatusDisplay(props: PageEditorStatusDisplayProps) {\r\n\tconst { status } = props;\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t{status === ModelStatus.Published ? (\r\n\t\t\t\t\r\n\t\t\t) : status === ModelStatus.Inactive ? (\r\n\t\t\t\t\r\n\t\t\t) : status === ModelStatus.Deleted ? (\r\n\t\t\t\t\r\n\t\t\t) : status === ModelStatus.Draft ? (\r\n\t\t\t\t\r\n\t\t\t) : status === ModelStatus.Archived ? (\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t
\r\n\t);\r\n}\r\n","export interface Asset {\r\n\t/**\r\n\t * The asset's type\r\n\t */\r\n\tassetType: AssetType;\r\n\t/**\r\n\t * The asset's url\r\n\t */\r\n\tassetUrl: string;\r\n}\r\n\r\nexport enum AssetType {\r\n\tImage = 'Image',\r\n\tMedia = 'Media',\r\n\tDocument = 'Document',\r\n\tYouTube = 'YouTube',\r\n}\r\n\r\n/**\r\n * Image Dimension\r\n */\r\nexport interface AssetDimension {\r\n\t/**\r\n\t * The label of image dimension\r\n\t */\r\n\tLabel: string;\r\n\tWidth: number;\r\n\tHeight: number;\r\n}\r\n","import { PricingResult } from './pricing-result';\r\n\r\n/**\r\n * Represents a display pricing service result containing all necessary details to render a set of product prices.\r\n */\r\nexport type DisplayPricingResult = PricingResult;\r\n\r\n/**\r\n * Represents a simple price intended to be rendered.\r\n * Comparisons and arithmetic between prices is illegal besides !== and ===.\r\n * This is not suitable for transactions and attempting to use this for transactions is erroneous.\r\n */\r\nexport type Price = string;\r\n\r\n/**\r\n * Represents an inclusive range of prices. It is erroneous for a price span no length (eg the\r\n * from and to field are the same), as this should be represented by a @see Price instead.\r\n *\r\n * PriceSpan is typically used for ambiguous ranges\r\n */\r\nexport type PriceSpan = {\r\n\t/**\r\n\t * The lower bound of the price. If this is associated with a group of products, this\r\n\t * is the price of the cheapest associated product.\r\n\t */\r\n\tfrom: Price;\r\n\r\n\t/**\r\n\t * The upper bound of the price. If this is associated with a group of products, this\r\n\t * is the price of the most expensive associated product.\r\n\t */\r\n\tto: Price;\r\n};\r\n\r\n/**\r\n * Represents a displayable price of unknown type.\r\n */\r\nexport type VariantPrice = Price | PriceSpan;\r\n\r\n/**\r\n * The display rules for rendering a price on the frontend.\r\n */\r\nexport enum PriceDisplayRule {\r\n\t/**\r\n\t * Represents a lack of a price. This is typically used for a product\r\n\t * that isn't purchaseable. Distinct from free.\r\n\t *\r\n\t * If a price is missing, it is illegal to use any display price type besides @see MissingPrice\r\n\t */\r\n\tMissing = 'Missing',\r\n\r\n\t/**\r\n\t * Represents a normal price or price range. Expected price types are @see PriceSpan and @see Price\r\n\t */\r\n\tNormal = 'Normal',\r\n\r\n\t/**\r\n\t * Represents a price without a clearly defined upperbound. This can happen if multiple products in a group product\r\n\t * do not share a common unit of measure. Expected price types are @see Price\r\n\t */\r\n\tAmbiguousRange = 'AmbiguousRange',\r\n}\r\n\r\n/**\r\n * Represents a pricing object that is guaranteed to have a base price\r\n */\r\nexport interface HasBasePrice {\r\n\t/** The price of the product if it isn't on sale. */\r\n\tbasePrice: PartialDisplayPrice;\r\n}\r\n\r\n/**\r\n * Represents a pricing object that is guaranteed to have a sale price\r\n */\r\nexport interface HasSalePrice {\r\n\t/** The sale price of the product. This is always less than the base price. */\r\n\tsalePrice: PartialDisplayPrice;\r\n}\r\n\r\n/**\r\n * Represents a pricing object that has no base price, that is, it cannot be purchased.\r\n */\r\nexport interface HasNoBasePrice {\r\n\t/** The item in question has no base price and as such, it is illegal to access it. */\r\n\tbasePrice?: never;\r\n}\r\n\r\n/**\r\n * Represents a pricing object that has no sale price\r\n */\r\nexport interface HasNoSalePrice {\r\n\t/** The item in question has no sale price and as such, it is illegal to access it. */\r\n\tsalePrice?: never;\r\n}\r\n\r\n/**\r\n * Represents a \"primitive\" price object that would be displayed.\r\n * A product that has a base price and a sale price would have two unit display prices for example.\r\n */\r\nexport type PartialDisplayPrice = TPrice extends Price\r\n\t? UnitPrice & HasRawValue\r\n\t: UnitPrice;\r\n\r\ninterface UnitPrice {\r\n\t/** The unit of measure of the item/product being sold. This is typically appended to a price to yield a value like \"$2.99/ea\" */\r\n\tunit?: { label: string };\r\n\r\n\t/** The price value to be displayed. */\r\n\tvalue: TPrice;\r\n}\r\n\r\ninterface HasRawValue {\r\n\t/**\r\n\t * The raw price value for use in comparing prices to eachother or checking if they are zero or negative.\r\n\t * It is not safe to assume this value for display purposes or price calculations.\r\n\t */\r\n\trawValue: number;\r\n}\r\n\r\n/**\r\n * Constrains a VariantPrice to a more specific price type\r\n */\r\ntype Filter = T extends U ? T : never;\r\n\r\n/**\r\n * Represents a price object that can be displayed.\r\n */\r\nexport type DisplayPrice<\r\n\tTBasePrice extends VariantPrice = VariantPrice,\r\n\tTSalePrice extends VariantPrice = TBasePrice\r\n> =\r\n\t| SimpleDisplayPrice\r\n\t| AmbiguousDisplayPrice, Filter>\r\n\t| MissingDisplayPrice;\r\n\r\n/**\r\n * Represents a missing price, typically if used on an object not for a sale or an erroneous object.\r\n * This would either not be rendered or be rendered as \"Not For Sale\"\r\n */\r\nexport interface MissingDisplayPrice {\r\n\t/** The display rules for rendering a price on the frontend.\r\n\t *\r\n\t * A \"missing\" or \"invisible\" price is for a product that is not on sale and thus should not have\r\n\t * a price rendered on screen */\r\n\tdisplayRule: PriceDisplayRule.Missing;\r\n}\r\n\r\n/**\r\n * Represents a simple price, that is a price that might be on sale with fixed upper and lower bounds. The unit\r\n * of measure for the base and sale price (if present) is expected to be the same\r\n */\r\nexport interface SimpleDisplayPrice<\r\n\tTBasePrice extends VariantPrice = VariantPrice,\r\n\tTSalePrice extends VariantPrice = TBasePrice\r\n> extends HasBasePrice,\r\n\t\tPartial> {\r\n\t/** The display rules for rendering a price on the frontend.\r\n\t *\r\n\t * A normal price is either a simple price like \"$3.12/ea\" or a range like \"$2.00-$5.00/ea\"\r\n\t */\r\n\tdisplayRule: PriceDisplayRule.Normal;\r\n}\r\n\r\n/**\r\n * Represents a price without a predictable upperbound for the price. This would typically be used if a group of products\r\n * didn't have a common unit of measure.\r\n */\r\nexport interface AmbiguousDisplayPrice\r\n\textends HasBasePrice,\r\n\t\tPartial> {\r\n\t/** The display rules for rendering a price on the frontend.\r\n\t *\r\n\t * An ambiguous price doesn't have a a specifiable upperbound because there isn't a common unit of measure\r\n\t * to use as a baseline for what the most expensive unit of measure is. This is will appear like \"From $2.00\"\r\n\t */\r\n\tdisplayRule: PriceDisplayRule.AmbiguousRange;\r\n}\r\n","import { useEffect, useRef } from 'react';\r\n\r\n/**\r\n * Reusable hook that can be used where setInterval is needed.\r\n *\r\n * @export\r\n * @param {() => void} callback\r\n * @param {(number | null)} delay\r\n */\r\nexport default function useInterval(callback: () => void, delay: number, enabled: boolean = true) {\r\n\tconst savedCallback = useRef<(() => void) | null>(null);\r\n\t// eslint-disable-next-line no-undef\r\n\tconst intervalId = useRef(null);\r\n\r\n\t// Remember the latest callback.\r\n\tuseEffect(() => {\r\n\t\tsavedCallback.current = callback;\r\n\t}, [callback]);\r\n\r\n\t// Set up the interval.\r\n\tuseEffect(() => {\r\n\t\tfunction tick() {\r\n\t\t\tsavedCallback.current!();\r\n\t\t}\r\n\r\n\t\tif (delay === null || !enabled) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tintervalId.current = setInterval(tick, delay);\r\n\t\treturn () => {\r\n\t\t\tif (intervalId.current) {\r\n\t\t\t\tclearInterval(intervalId.current);\r\n\t\t\t}\r\n\t\t};\r\n\t}, [delay, enabled]);\r\n}\r\n","import { reCaptchaCallbackPromise } from 'features/setup/recaptcha';\r\nimport { useLayoutEffect, useRef, useState } from 'react';\r\nimport useInterval from './useInterval';\r\n\r\n/**\r\n * Window extended with recaptcha specific fields\r\n */\r\ninterface ReCaptchaWindow extends Window {\r\n\trocReCaptchaCallbacks: Array<() => void>;\r\n\tgrecaptcha: GoogleRecaptcha;\r\n}\r\n\r\n/**\r\n * Google ReCaptcha Interface\r\n */\r\ninterface GoogleRecaptcha {\r\n\tready(callback: () => void): void;\r\n\texecute: (key: string, config: { action: string }) => Promise;\r\n}\r\n\r\nexport interface UseReCaptchaToken {\r\n\tgetToken: () => Promise;\r\n\tinvalidateToken: () => void;\r\n\tenabled: boolean;\r\n\tsetEnabled: (enabled: boolean) => void;\r\n}\r\n\r\nlet ReCaptchaKeyWarning = false;\r\n\r\n/**\r\n * Reusable hook that generates a recaptcha token from google and generates fresh tokens\r\n * frequently as these will expire every 2 minutes\r\n *\r\n * @export\r\n * @param {string} reCaptchaKey\r\n * @param {string} action\r\n * @returns\r\n */\r\nexport default function useReCaptchaToken(\r\n\treCaptchaKey: string,\r\n\taction: string,\r\n\tinitialEnabled: boolean = !!action,\r\n): UseReCaptchaToken {\r\n\tconst reCaptchaWindow = (window as unknown) as ReCaptchaWindow;\r\n\r\n\t// keeps track of the promise that is getting the token across renders. using a ref ensures it updates immediately\r\n\t// state updates are async and therefore we cannot read the state value immediately after.\r\n\t// there is no longer a callback after setting state with hooks 💣\r\n\tconst tokenPromise = useRef | null>(null);\r\n\r\n\t// store whether the promise is resolved in a ref. same reasoning as above.\r\n\tconst tokenPromiseIsResolved = useRef(false);\r\n\r\n\t// this is the promise that will handle waiting on recaptcha initialization\r\n\tconst initPromise = useRef | null>(null);\r\n\r\n\t// this will allow for the recaptcha to be disabled on demand or by an invalid token\r\n\tconst [enabled, setEnabled] = useState(initialEnabled);\r\n\r\n\t// need to use LayoutEffect because we have to make sure this code runs before google's recaptcha handlers\r\n\t// when the dom becomes ready.\r\n\tuseLayoutEffect(() => {\r\n\t\t(async () => {\r\n\t\t\tinitPromise.current = new Promise(async (resolve) => {\r\n\t\t\t\t// wait until google calls this callback.\r\n\t\t\t\tif (reCaptchaCallbackPromise) {\r\n\t\t\t\t\tawait reCaptchaCallbackPromise;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// also wait for recaptcha to be ready for us\r\n\t\t\t\treCaptchaWindow.grecaptcha.ready(() => {\r\n\t\t\t\t\tresolve();\r\n\t\t\t\t\tgetToken();\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\tif (!reCaptchaKey && !ReCaptchaKeyWarning) {\r\n\t\t\t\tReCaptchaKeyWarning = true;\r\n\t\t\t\tconsole.warn('No ReCaptchaKey has been set.');\r\n\t\t\t}\r\n\t\t})();\r\n\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, []);\r\n\r\n\t/**\r\n\t * Invalidates the current token promise as long as it isn't currently unresolved\r\n\t */\r\n\tconst invalidateToken = async () => {\r\n\t\t// scenario 1: not initialized\r\n\t\tawait initPromise.current;\r\n\r\n\t\t// if we are working on getting a token, do nothing\r\n\t\tif (!tokenPromiseIsResolved) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\ttokenPromise.current = getToken(true);\r\n\t};\r\n\r\n\t// tokens expire in 2 minutes, so let's invalidate the token a little more frequently to avoid having a stale one\r\n\tuseInterval(invalidateToken, 2 * 60 * 1000 - 5000, enabled);\r\n\r\n\t/**\r\n\t * Returns a promise that will eventually resolve to a fresh recaptcha token\r\n\t */\r\n\tconst getToken = async (force: boolean = false): Promise => {\r\n\t\tif (!reCaptchaKey || !enabled) {\r\n\t\t\t// if there's no recaptcha key, we'll simple return an empty string. the server will not validate recaptcha\r\n\t\t\t// because the key is missing.\r\n\t\t\treturn Promise.resolve('');\r\n\t\t}\r\n\r\n\t\t// wait for the callback to fire\r\n\t\tawait initPromise.current;\r\n\r\n\t\t// first time or if we need a new one\r\n\t\tif (tokenPromise.current === null || force) {\r\n\t\t\ttokenPromiseIsResolved.current = false;\r\n\r\n\t\t\ttokenPromise.current = new Promise(async (resolve) => {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconst result = await reCaptchaWindow.grecaptcha.execute(reCaptchaKey, { action });\r\n\t\t\t\t\tresolve(result);\r\n\t\t\t\t} catch (error) {\r\n\t\t\t\t\tconsole.warn(\r\n\t\t\t\t\t\t'ReCaptcha warning:',\r\n\t\t\t\t\t\terror?.message || 'An unexpected ReCaptcha error occurred. Ensure you have a valid key.',\r\n\t\t\t\t\t);\r\n\t\t\t\t\tsetEnabled(false);\r\n\t\t\t\t\tresolve('');\r\n\t\t\t\t}\r\n\t\t\t\ttokenPromiseIsResolved.current = true;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// in some cases this is the existing promise because it not resolved yet, so we don't want to\r\n\t\t// start another request separately.\r\n\t\treturn tokenPromise.current;\r\n\t};\r\n\r\n\treturn { getToken: () => getToken(), invalidateToken, enabled, setEnabled };\r\n}\r\n","import { ServerData } from 'services/ServerData';\r\nimport useReCaptchaToken, { UseReCaptchaToken } from './useReCaptchaToken';\r\n\r\n/**\r\n * Reusable hook that calls the generic useReCaptchaToken with key loaded from ServerData\r\n *\r\n * @export\r\n * @param {string} action\r\n * @returns\r\n */\r\nexport default function useRocReCaptchaToken(action: string, initialEnabled: boolean = true): UseReCaptchaToken {\r\n\tconst reCaptchaKey = ServerData.ReCaptchaV3Key;\r\n\tconst isReCaptchaEnabled = initialEnabled && ServerData.IsReCaptchaEnabled;\r\n\r\n\t// the server will not render anything if the keys aren't set, which means we could get null\r\n\t// or even undefined here, so let's just do a truthy check and return an empty string if there\r\n\t// is nothing from the server.\r\n\treturn useReCaptchaToken(reCaptchaKey || '', action, isReCaptchaEnabled);\r\n}\r\n","import { AxiosError, AxiosRequestConfig } from 'axios';\r\nimport { handleAxiosErrorWithValidation } from 'shared/util/Misc';\r\nimport { useBaseAxiosSubmitter } from './useBaseAxiosSubmitter';\r\nimport { Localizer } from 'services/Localizer';\r\n\r\nexport interface UseAxiosFormSubmitterPostResult {\r\n\tformValidationState?: { [index: string]: string };\r\n\terror?: Error | AxiosError;\r\n}\r\n\r\nexport type RocFormSubmitterParams = {\r\n\taxiosParams: AxiosRequestConfig;\r\n\treCaptchaActionName?: string;\r\n\tcsrfEnabled?: boolean;\r\n\tstateful?: boolean;\r\n\tinvalidateTokenOnSuccess?: boolean;\r\n\tresponseCallback?: (response?: TResponse, error?: Error) => void;\r\n};\r\n\r\nexport type ResponseCallback = (response?: TResponse, error?: Error, invalidateToken?: () => void) => void;\r\n\r\n/**\r\n * A custom hook that can be used to facilitate posting forms. It handles processing server-side validation automatically.\r\n * @param axiosParams The parameters for the request being passed into axios. This includes the method, url, data, etc.\r\n * @param reCaptchaActionName An optional action name for the ReCaptcha request sent to Google. If left empty, no ReCaptcha token will be sent to the server.\r\n * @param csrfEnabled Specifies whether CSRF protection should be enabled or not.\r\n * @param stateful A flag for setting the form submitter to store submitting and error state. Not recommended to be true when dealing with react-final-form.\r\n * @param invalidateTokenOnSuccess A flag for invalidating ReCaptcha token on success. This can be helpful for resetting a form with ReCaptcha.\r\n * @param responseCallback An optional callback that can be executed on the response or error that is returned.\r\n */\r\nexport function useRocFormSubmitter({\r\n\taxiosParams,\r\n\treCaptchaActionName,\r\n\tcsrfEnabled = true,\r\n\tstateful = false,\r\n\tinvalidateTokenOnSuccess = false,\r\n\tresponseCallback,\r\n}: RocFormSubmitterParams) {\r\n\treturn useBaseAxiosFormSubmitter(\r\n\t\taxiosParams,\r\n\t\treCaptchaActionName,\r\n\t\tcsrfEnabled,\r\n\t\tstateful,\r\n\t\tinvalidateTokenOnSuccess,\r\n\t\tresponseCallback,\r\n\t);\r\n}\r\n\r\n/**\r\n * Form submitter that only stores the last response in state. Ideal when dealing with react-final-form.\r\n */\r\nexport function useAxiosFormSubmitter(\r\n\taxiosParams: AxiosRequestConfig,\r\n\treCaptchaActionName?: string,\r\n\tcsrfEnabled = true,\r\n\tresponseCallback?: ResponseCallback,\r\n\tinvalidateTokenOnSuccess = false,\r\n) {\r\n\treturn useBaseAxiosFormSubmitter(\r\n\t\taxiosParams,\r\n\t\treCaptchaActionName,\r\n\t\tcsrfEnabled,\r\n\t\tfalse,\r\n\t\tinvalidateTokenOnSuccess,\r\n\t\tresponseCallback,\r\n\t);\r\n}\r\n\r\n/**\r\n * Form submitter that stores submitting and error state. Not recommended when dealing with react-final-form.\r\n */\r\nexport function useStatefulAxiosFormSubmitter(\r\n\taxiosParams: AxiosRequestConfig,\r\n\treCaptchaActionName?: string,\r\n\tcsrfEnabled = true,\r\n\tresponseCallback?: ResponseCallback,\r\n\tinvalidateTokenOnSuccess = false,\r\n) {\r\n\treturn useBaseAxiosFormSubmitter(\r\n\t\taxiosParams,\r\n\t\treCaptchaActionName,\r\n\t\tcsrfEnabled,\r\n\t\ttrue,\r\n\t\tinvalidateTokenOnSuccess,\r\n\t\tresponseCallback,\r\n\t);\r\n}\r\n\r\n/**\r\n * A custom hook that can be used to facilitate posting forms. It handles processing server-side validation automatically.\r\n * Do not use this hook directly unless you know what you're doing. Prefer useAxiosFormSubmitter, useAxiosStatefulFormSubmitter, or useRocFormSubmitter instead.\r\n * @param axiosParams The parameters for the request being passed into axios. This includes the method, url, data, etc.\r\n * @param reCaptchaActionName An optional action name for the ReCaptcha request sent to Google. If left empty, no ReCaptcha token will be sent to the server.\r\n * @param csrfEnabled Specifies whether CSRF protection should be enabled or not.\r\n * @param stateful A flag for setting the form submitter to store submitting and error state. Not recommended to be true when dealing with react-final-form.\r\n * @param invalidateTokenOnSuccess A flag for invalidating ReCaptcha token on success. This can be helpful for resetting a form with ReCaptcha.\r\n * @param responseCallback An optional callback that can be executed on the response or error that is returned.\r\n */\r\nexport function useBaseAxiosFormSubmitter(\r\n\taxiosParams: AxiosRequestConfig,\r\n\treCaptchaActionName?: string,\r\n\tcsrfEnabled = true,\r\n\tstateful = false,\r\n\tinvalidateTokenOnSuccess = false,\r\n\tresponseCallback?: ResponseCallback,\r\n) {\r\n\tif (axiosParams.method === undefined) {\r\n\t\taxiosParams.method = 'POST';\r\n\t}\r\n\r\n\t/**\r\n\t * Callback to be executed after a form submission has taken place.\r\n\t */\r\n\tconst submitterCallback = (response?: R, error?: Error, invalidateToken?: () => void) => {\r\n\t\tif (error) {\r\n\t\t\tconsole.error(error);\r\n\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\t\t\tif (invalidateToken) {\r\n\t\t\t\tinvalidateToken();\r\n\t\t\t}\r\n\r\n\t\t\tif (responseCallback !== undefined) {\r\n\t\t\t\tresponseCallback(response, error);\r\n\t\t\t}\r\n\r\n\t\t\treturn Promise.resolve({\r\n\t\t\t\tformValidationState: handleAxiosErrorWithValidation(\r\n\t\t\t\t\taxiosError,\r\n\t\t\t\t\tLocalizer('ErrorOccurredSubmittingTheForm'),\r\n\t\t\t\t),\r\n\t\t\t\terror,\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (responseCallback !== undefined) {\r\n\t\t\tresponseCallback(response);\r\n\t\t}\r\n\r\n\t\tif (invalidateToken && invalidateTokenOnSuccess) {\r\n\t\t\tinvalidateToken();\r\n\t\t}\r\n\r\n\t\treturn Promise.resolve({});\r\n\t};\r\n\r\n\tconst submitter = useBaseAxiosSubmitter(\r\n\t\taxiosParams,\r\n\t\tsubmitterCallback,\r\n\t\treCaptchaActionName,\r\n\t\tcsrfEnabled,\r\n\t\tstateful,\r\n\t);\r\n\r\n\tlet result = {\r\n\t\thandleSubmit: async (formValues: T) => {\r\n\t\t\tconst submitResult = await submitter.submit(formValues);\r\n\t\t\treturn submitResult && submitResult.formValidationState;\r\n\t\t},\r\n\t\tsubmitted: submitter.response !== null && submitter.response.status === 200,\r\n\t\tresponseData: submitter.response !== null ? submitter.response.data : null,\r\n\t};\r\n\r\n\tif (stateful) {\r\n\t\tresult = {\r\n\t\t\t...submitter,\r\n\t\t\t...result,\r\n\t\t};\r\n\t}\r\n\r\n\treturn result;\r\n}\r\n","import Axios, { AxiosRequestConfig, AxiosError, AxiosResponse, CancelTokenSource } from 'axios';\r\nimport useRocReCaptchaToken from './useRocReCaptchaToken';\r\nimport { useLoader } from './useLoader';\r\nimport { useRef } from 'react';\r\nimport { getCsrfToken } from 'services/UserData';\r\nimport AxiosHelper from 'services/AxiosHelper';\r\n\r\n/**\r\n * A reusable hook to be used to submit data via Axios. Handles CSRF and ReCaptcha tokens.\r\n * Do not call this directly, use useAxiosFormSubmitter or useAxiosStatefulFormSubmitter instead.\r\n * @param axiosParams The parameters for the request being passed into axios. This includes the method, url, data, etc.\r\n * @param submitterCallback An optional callback that will be called after a request is submitted. The error and the function to invalidate the used ReCaptcha token will be passed if something goes wrong.\r\n * @param reCaptchaActionName An optional action name for the ReCaptcha request sent to Google. If left empty, no ReCaptcha token will be sent to the server.\r\n * @param csrfEnabled Specifies whether CSRF protection should be enabled or not.\r\n * @param stateful An optional value to determine whether this component should use all useLoader state.\r\n */\r\nexport function useBaseAxiosSubmitter(\r\n\taxiosParams: AxiosRequestConfig,\r\n\tsubmitterCallback?: (response: R, error?: Error | AxiosError, invalidateRecaptchaToken?: () => void) => Promise,\r\n\treCaptchaActionName?: string,\r\n\tcsrfEnabled = true,\r\n\tstateful = false,\r\n) {\r\n\tif (axiosParams.method === undefined) {\r\n\t\taxiosParams.method = 'POST';\r\n\t}\r\n\r\n\tconst { getToken: getRecaptchaToken, invalidateToken } = useRocReCaptchaToken(reCaptchaActionName || '');\r\n\tconst { loading, setLoading, error, setError, response, setResponse } = useLoader>();\r\n\tconst cancelToken = useRef();\r\n\r\n\t/**\r\n\t * The main method that allows imperative posting of data\r\n\t * @param payload The data that should be posted in the body of the request\r\n\t */\r\n\tasync function submit(payload: T): Promise {\r\n\t\ttry {\r\n\t\t\t// avoid duplicate requests if there's a pending one\r\n\t\t\tif (cancelToken.current) {\r\n\t\t\t\tconsole.warn('Already posting... Did you forget to disable your submit button while this was saving?');\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tcancelToken.current = Axios.CancelToken.source();\r\n\r\n\t\t\tconst promises: Array | undefined> = [];\r\n\r\n\t\t\tpromises.push(csrfEnabled ? getCsrfToken() : undefined);\r\n\t\t\tpromises.push(reCaptchaActionName ? getRecaptchaToken() : undefined);\r\n\r\n\t\t\tconst [csrfToken, reCaptchaToken] = await Promise.all(promises);\r\n\r\n\t\t\tif (stateful) {\r\n\t\t\t\tsetLoading(true);\r\n\t\t\t\tsetError(undefined);\r\n\t\t\t}\r\n\r\n\t\t\t// eslint-disable-next-line no-unused-vars\r\n\t\t\tconst { data, ...rest } = axiosParams;\r\n\t\t\tconst request = {\r\n\t\t\t\t...rest,\r\n\t\t\t\tdata: {\r\n\t\t\t\t\t...payload,\r\n\t\t\t\t\treCaptchaToken: reCaptchaToken || undefined,\r\n\t\t\t\t},\r\n\t\t\t};\r\n\r\n\t\t\tif (csrfToken) {\r\n\t\t\t\tif (!request.headers) {\r\n\t\t\t\t\trequest.headers = {};\r\n\t\t\t\t}\r\n\r\n\t\t\t\trequest.headers.RequestVerificationToken = csrfToken;\r\n\t\t\t}\r\n\r\n\t\t\tconst serverResponse = (await AxiosHelper(request)) as AxiosResponse;\r\n\r\n\t\t\t// reset cancellation token ref to allow new requests.\r\n\t\t\tcancelToken.current = undefined;\r\n\r\n\t\t\tsetResponse(serverResponse);\r\n\r\n\t\t\tif (submitterCallback !== undefined) {\r\n\t\t\t\treturn await submitterCallback(serverResponse.data);\r\n\t\t\t}\r\n\r\n\t\t\treturn;\r\n\t\t} catch (error) {\r\n\t\t\t// reset cancellation token ref to allow new requests.\r\n\t\t\tcancelToken.current = undefined;\r\n\r\n\t\t\tif (Axios.isCancel(error)) {\r\n\t\t\t\t// if the component was unmounted, there's nothing to do\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (stateful) {\r\n\t\t\t\tsetError(error);\r\n\t\t\t}\r\n\r\n\t\t\tif (submitterCallback !== undefined) {\r\n\t\t\t\treturn await submitterCallback(error.data, error, invalidateToken);\r\n\t\t\t}\r\n\r\n\t\t\treturn;\r\n\t\t} finally {\r\n\t\t\tif (stateful) {\r\n\t\t\t\tsetLoading(false);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn {\r\n\t\tsubmitting: loading,\r\n\t\terror,\r\n\t\tresponse,\r\n\t\tcancelToken: cancelToken.current,\r\n\t\tsubmit,\r\n\t};\r\n}\r\n","// These functions may be potentially innaccurate in certain locales that use differing amounts of characters in different cases\r\n\r\n/**\r\n * Tests if a string includes another if casing is ignored\r\n * @param thisString The string to test\r\n * @param otherString The potentially included string being tested for\r\n */\r\nexport function stringWeaklyIncludes(thisString: string, otherString: string) {\r\n\treturn thisString.toLocaleLowerCase().includes(otherString.toLocaleLowerCase());\r\n}\r\n\r\n/**\r\n * Tests if a string starts with another if casing is ignored\r\n * @param thisString The string to test\r\n * @param otherString The potentially included string being tested for\r\n */\r\nexport function stringWeaklyStartsWith(thisString: string, otherString: string) {\r\n\treturn thisString.toLocaleLowerCase().startsWith(otherString.toLocaleLowerCase());\r\n}\r\n\r\n/**\r\n * Tests if a string ends with another if casing is ignored\r\n * @param thisString The string to test\r\n * @param otherString The potentially included string being tested for\r\n */\r\nexport function stringWeaklyEndsWith(thisString: string, otherString: string) {\r\n\treturn thisString.toLocaleLowerCase().endsWith(otherString.toLocaleLowerCase());\r\n}\r\n\r\n/**\r\n * Converts the first character in a string to upper-case. Will not work for all languages (for example Dutch).\r\n *\r\n * @export\r\n * @param {string} thisString\r\n * @returns\r\n */\r\nexport function firstCharacterToUpper(thisString: string) {\r\n\tif (!thisString) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\tlet newString = thisString.substring(0, 1).toLocaleUpperCase();\r\n\r\n\tif (thisString.length > 1) {\r\n\t\tnewString += thisString.substring(1);\r\n\t}\r\n\r\n\treturn newString;\r\n}\r\n\r\n/**\r\n * Converts the first character in a string to upper-case. Will not work for all languages (for example Dutch).\r\n *\r\n * @export\r\n * @param {string} thisString\r\n * @returns\r\n */\r\nexport function firstCharacterToLower(thisString: string) {\r\n\tif (!thisString) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\tlet newString = thisString.substring(0, 1).toLocaleLowerCase();\r\n\r\n\tif (thisString.length > 1) {\r\n\t\tnewString += thisString.substring(1);\r\n\t}\r\n\r\n\treturn newString;\r\n}\r\n\r\n// https://github.com/uxitten/polyfill/blob/master/string.polyfill.js\r\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart\r\nexport function padStart(value, targetLength, padString) {\r\n\t// tslint:disable-next-line:no-bitwise\r\n\ttargetLength = targetLength >> 0; // truncate if number, or convert non-number to 0;\r\n\tpadString = String(typeof padString !== 'undefined' ? padString : ' ');\r\n\tif (value.length >= targetLength) {\r\n\t\treturn String(value);\r\n\t} else {\r\n\t\ttargetLength = targetLength - value.length;\r\n\t\tif (targetLength > padString.length) {\r\n\t\t\tpadString += padString.repeat(targetLength / padString.length); // append to original to ensure we are longer than needed\r\n\t\t}\r\n\t\treturn padString.slice(0, targetLength) + String(value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Converts a string from \" Something Like This\" to \"something-like-this\"\r\n * @param value The string to convert\r\n */\r\nexport function toKebabCase(value: string) {\r\n\tif (!value || !value.trim()) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\treturn value\r\n\t\t.trim()\r\n\t\t.replace(/[^a-zA-Z0-9]+/g, '-')\r\n\t\t.replace(/([a-z0-9])([A-Z])/g, '$1-$2')\r\n\t\t.replace(/([A-Z])([A-Z])(?=[a-z])/g, '$1-$2')\r\n\t\t.replace(/-$/, '')\r\n\t\t.toLocaleLowerCase();\r\n}\r\n\r\n/**\r\n * Converts a string from PascalCase, camelCase, snake_case, or space separated to camelCase. Beginning and trailing whitespace are trimmed.\r\n * @param value The string to convert\r\n */\r\nexport function toCamelCase(value: string) {\r\n\treturn value\r\n\t\t.replace(/(?:^\\w|[A-Z]|\\b\\w)/g, function (word, index) {\r\n\t\t\treturn index === 0 ? word.toLowerCase() : word.toUpperCase();\r\n\t\t})\r\n\t\t.replace(/(?:\\s+|[-_])/g, '');\r\n}\r\n\r\n/**\r\n * Removes html characters\r\n *\r\n * @export\r\n * @param {*} html\r\n * @returns\r\n */\r\nexport function stripHtml(html) {\r\n\tconst tmp = document.createElement('div');\r\n\ttmp.innerHTML = html;\r\n\treturn tmp.textContent || tmp.innerText || '';\r\n}\r\n\r\n/**\r\n * Cuts of text and adds ellipsis (...) after a certain number of characters\r\n * @param text The text to format\r\n * @param cutoff The number of characters to add the ellipsis after\r\n */\r\nexport function addEllipsis(text: string, cutoff: number = 20) {\r\n\tif (!text || text.length < cutoff) {\r\n\t\treturn text;\r\n\t}\r\n\r\n\treturn text.substring(0, cutoff) + '...';\r\n}\r\n\r\n/**\r\n * Trims a string value\r\n */\r\nexport function trimString(value: string) {\r\n\treturn value ? value.trim() : '';\r\n}\r\n","import React from 'react';\r\nimport { FormProps, Form } from 'react-final-form';\r\nimport createDecorator from 'final-form-focus';\r\nimport { AnyObject } from 'final-form';\r\n\r\ntype RocFormProps = FormProps;\r\n\r\nconst focusOnError = createDecorator();\r\n\r\n/**\r\n * Wrapper component for react-final-form so that we can add useful defaults across the board.\r\n * @param props props\r\n */\r\nexport default function RocForm({\r\n\tonSubmit,\r\n\trender,\r\n\tdebug,\r\n\tdestroyOnUnregister,\r\n\tform,\r\n\tcomponent,\r\n\tinitialValues,\r\n\tinitialValuesEqual,\r\n\tkeepDirtyOnReinitialize,\r\n\tvalidate,\r\n\tvalidateOnBlur,\r\n\tdecorators = [focusOnError],\r\n\tmutators,\r\n\tsubscription,\r\n}: RocFormProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\tonSubmit={onSubmit}\r\n\t\t\tdecorators={decorators}\r\n\t\t\trender={render}\r\n\t\t\tdebug={debug}\r\n\t\t\tdestroyOnUnregister={destroyOnUnregister}\r\n\t\t\tform={form}\r\n\t\t\tcomponent={component}\r\n\t\t\tinitialValues={initialValues}\r\n\t\t\tinitialValuesEqual={initialValuesEqual}\r\n\t\t\tkeepDirtyOnReinitialize={keepDirtyOnReinitialize}\r\n\t\t\tmutators={mutators}\r\n\t\t\tsubscription={subscription}\r\n\t\t\tvalidate={validate}\r\n\t\t\tvalidateOnBlur={validateOnBlur}\r\n\t\t/>\r\n\t);\r\n}\r\n","import type { Dialog, DialogContent } from '@reach/dialog';\r\nimport classnames from 'classnames';\r\nimport React from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport 'styles/node-modules/@reach/dialog/styles.css';\r\nimport Spinner from './Spinner';\r\nimport XSVG from './svg/XSVG';\r\n\r\nconst LazyDialog = React.lazy(() =>\r\n\timport('@reach/dialog').then((module) => ({ default: module.Dialog })),\r\n);\r\nconst LazyDialogContent = React.lazy(() =>\r\n\timport('@reach/dialog').then((module) => ({ default: module.DialogContent })),\r\n);\r\n\r\n// TODO: the types are currently out of date so they don't include the definition for dangerouslyBypassFocusLock. Add the types here once they are updated\r\n// https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/reach__dialog\r\nconst LazyDialogOverlay = React.lazy(() =>\r\n\timport('@reach/dialog').then((module) => ({ default: module.DialogOverlay } as any)),\r\n);\r\n\r\nexport type ModalSize = 'xs' | 'sm' | 'md' | 'lg' | 'xlg' | 'full_width';\r\n\r\ninterface ModalProps {\r\n\tisOpen: boolean;\r\n\thideCloseButton?: boolean;\r\n\tchildren: React.ReactNode;\r\n\ttitleIcon?: React.ReactNode;\r\n\tsize?: ModalSize;\r\n\theaderDivider?: boolean;\r\n\tbypassFocusLock?: boolean;\r\n\tsubTitle?: string;\r\n\tclassName?: string;\r\n\trenderActions?: () => React.ReactNode;\r\n\tcloseModal: () => void;\r\n\trenderTitle: () => React.ReactNode;\r\n\trenderSubtitle?: () => React.ReactNode;\r\n}\r\n\r\n/**\r\n * Reusuable modal component with raised open state, takes title and children as props.\r\n *\r\n * @export\r\n * @param {ModalProps} props\r\n * @returns\r\n */\r\nexport default function Modal(props: ModalProps) {\r\n\tconst {\r\n\t\tisOpen,\r\n\t\thideCloseButton,\r\n\t\tsize = 'md',\r\n\t\tcloseModal,\r\n\t\trenderTitle,\r\n\t\trenderSubtitle,\r\n\t\ttitleIcon,\r\n\t\trenderActions,\r\n\t\tchildren,\r\n\t\theaderDivider = false,\r\n\t\tbypassFocusLock = false,\r\n\t\tsubTitle,\r\n\t\tclassName,\r\n\t} = props;\r\n\r\n\tconst innerModal = (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{titleIcon && (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{titleIcon}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{renderTitle()}\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t{renderSubtitle && (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{renderSubtitle()}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t
\r\n\t\t\t\t\t{hideCloseButton ? null : (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t closeModal()}\r\n\t\t\t\t\t\t\t\ttype=\"button\"\r\n\t\t\t\t\t\t\t\tdata-testid=\"close-modal-btn\"\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{Localizer('Close')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t)}\r\n\t\t\t\t\r\n\r\n\t\t\t\t{subTitle ? (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{subTitle}\r\n\t\t\t\t\t

\r\n\t\t\t\t) : null}\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t\t{children}\r\n\t\t\t\r\n\t\t\t{renderActions ? (\r\n\t\t\t\t\r\n\t\t\t\t\t{renderActions()}\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t\r\n\t);\r\n\r\n\tconst ariaLabel = Localizer('ModalLabel');\r\n\r\n\treturn bypassFocusLock ? (\r\n\t\t}>\r\n\t\t\t closeModal()}\r\n\t\t\t\tdangerouslyBypassFocusLock={bypassFocusLock}\r\n\t\t\t>\r\n\t\t\t\t\r\n\t\t\t\t\t{innerModal}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t) : (\r\n\t\t}>\r\n\t\t\t closeModal()}\r\n\t\t\t\taria-label={ariaLabel}\r\n\t\t\t\tas={'div'}\r\n\t\t\t>\r\n\t\t\t\t{innerModal}\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n","import { DisplayPricingResult } from 'shared-client/types/commerce/display-price';\r\nimport { UnitOfMass } from 'shared-client/types/commerce/product-details';\r\nimport { BreadcrumbItem } from 'shared/components/Breadcrumbs';\r\nimport { PartialDataLoaderOptions } from 'shared/data/usePartialDataLoader';\r\nimport { BasePartialDetailsState } from 'shared/types';\r\nimport { Asset } from 'shared/assets/types';\r\n//#region TapeCase\r\nimport { PricingLine } from '../../../../../Roc.SharedClientApp/types/commerce/pricing-result';\r\nimport { VariantPrice, DisplayPrice } from 'shared-client/types/commerce/display-price';\r\nimport { CalculatorType } from '../calculators/quote-confirmation/types';\r\n//#endregion\r\n\r\nexport function getInitialProductDetailsState(): ProductDetailsState {\r\n\treturn window.__ROC_COMMERCE_PRODUCT_DETAILS__ ?? {};\r\n}\r\n\r\ndeclare global {\r\n\tinterface Window {\r\n\t\t__ROC_COMMERCE_PRODUCT_DETAILS__: ProductDetailsState;\r\n\t}\r\n}\r\n\r\nexport interface ProductDetailsState extends BasePartialDetailsState {\r\n\tsummary: Summary;\r\n\r\n\tassets?: ProductAsset[] | null;\r\n\r\n\tavailability?: Availability | null;\r\n\r\n\tbrand?: Brand | null;\r\n\r\n\t/**\r\n\t * Represents the visible tabs for the current product\r\n\t */\r\n\ttabs?: TabViewChunk[];\r\n\r\n\tselections?: ProductDetailSelection[];\r\n\r\n\tchildren?: SimpleProduct[];\r\n\r\n\trelatedProducts?: RelatedProduct[];\r\n\r\n\treviewsSummary: ReviewSummaryDto;\r\n\r\n\t/**\r\n\t * The available pricing lines for the product as well as the selected pricing line state\r\n\t */\r\n\tpricingLines?: ProductPricingLinesDetails;\r\n\r\n\t/**\r\n\t * The pricing result tree containing renderable prices for the product.\r\n\t */\r\n\tdisplayPricing?: DisplayPricingResult;\r\n\r\n\tbreadcrumbPath?: BreadcrumbItem[];\r\n\r\n\t// #region TapeCase\r\n\t/**\r\n\t * The list of products ready to buy (available for group products from abrasive calculator only)\r\n\t */\r\n\tproductsReadyToBuy?: ProductReadyToBuyDto[] | null;\r\n\r\n\tmiminumOrderQuantity: any;\r\n\r\n\thasCustomProducts?: boolean;\r\n\r\n\tavailableFormatShape?: FormatShapeDto[] | null;\r\n\r\n\tavailableCalculators?: CalculatorType[];\r\n\t// #endregion\r\n}\r\n\r\nexport interface Summary {\r\n\tname: string;\r\n\ttype: ProductType;\r\n\tsku?: string;\r\n\tmanufacturerPartNumber?: string;\r\n\tproductUrl: string;\r\n\tdescription?: string;\r\n\tmeta?: Meta;\r\n\tproductGroupId: string | null;\r\n\t/**\r\n\t * \tFlag defining if the current product should use the alternate product details.\r\n\t */\r\n\tuseAlternateProductDetails?: boolean;\r\n\r\n\t//#region TapeCase\r\n\t/**\r\n\t * Flag defining if the current product has been discontinued.\r\n\t */\r\n\tisDiscontinued: boolean;\r\n\t//#endregion\r\n}\r\n\r\nexport interface Meta {\r\n\turl: string;\r\n\tpageTitle?: string;\r\n\tmetaKeywords?: string;\r\n\tmetaDescription?: string;\r\n\tnoIndex: boolean;\r\n\tnoFollow: boolean;\r\n}\r\n\r\nexport interface Availability {\r\n\tbackOrder: boolean;\r\n\toutOfStock: boolean;\r\n}\r\n\r\n/**\r\n * Product Review Summary DTO\r\n */\r\nexport interface ReviewSummaryDto {\r\n\t/**\r\n\t * The average rating of the product. If undefined, the product has no reviews with ratings.\r\n\t */\r\n\taverageRating?: number;\r\n\r\n\t/**\r\n\t * The number of public reviews for the product\r\n\t */\r\n\treviewCount: number;\r\n}\r\n\r\nexport interface ProductAsset extends Asset {\r\n\t/**\r\n\t * The alternate text associated with the image\r\n\t */\r\n\taltText: string;\r\n\t/**\r\n\t * The main image URL\r\n\t */\r\n\tmainImageUrl: string;\r\n\t/**\r\n\t * The thumbnail URL\r\n\t */\r\n\tthumbnailUrl: string;\r\n\t/**\r\n\t * The enlarged image URL\r\n\t */\r\n\tenlargedImageUrl: string;\r\n\t/**\r\n\t * The sort order for this image\r\n\t */\r\n\tsortOrder: number;\r\n\t/**\r\n\t * Embedded URL for external media asset\r\n\t */\r\n\tembeddedUrl: string;\r\n}\r\n\r\nexport interface Brand {\r\n\tname: string;\r\n\tlogoUrl: string | null;\r\n}\r\n\r\nexport interface TabViewChunk {\r\n\ttab: Tab;\r\n\tmodel: T;\r\n\trawHtml?: string;\r\n}\r\n\r\nexport interface Tab {\r\n\tid: string;\r\n\tdisplayName: string;\r\n\ttabType: string;\r\n\tsortOrder: number;\r\n\tname: string;\r\n}\r\n\r\nexport interface TabViewModel {\r\n\tviewName: string;\r\n\tmodel: T;\r\n}\r\n\r\nexport interface ProductDetailSelection {\r\n\tlabel: string;\r\n\tvalues: SelectionValue[];\r\n\r\n\t/**\r\n\t * The selected attribute field name used for adding info to hawk context\r\n\t */\r\n\tfield: string;\r\n}\r\n\r\n/**\r\n * Represents a simple selection DTO object\r\n */\r\nexport interface SimpleSelectionDto {\r\n\t/**\r\n\t * The Code of the product attribute\r\n\t */\r\n\tid: string;\r\n\r\n\t/**\r\n\t * The Name of the product attribute\r\n\t */\r\n\tname: string;\r\n\r\n\t/**\r\n\t * The Id of the attribute value\r\n\t */\r\n\tvalue: string;\r\n\r\n\t/**\r\n\t * The Name of the attribute value\r\n\t */\r\n\tlabel: string;\r\n\r\n\t/**\r\n\t * The selected attribute field name used for adding info to hawk context\r\n\t */\r\n\tfield: string;\r\n}\r\n\r\nexport interface SelectionValue {\r\n\tvalue: string;\r\n\tlabel: string;\r\n\tvalid: boolean;\r\n\tchecked: boolean;\r\n}\r\n\r\nexport interface SimpleProduct {\r\n\tid: string;\r\n\tname: string;\r\n\tselections: string[];\r\n}\r\n\r\nexport interface RelatedProduct {\r\n\tid: string;\r\n\tname: string;\r\n\tdescription: string | null;\r\n\turl: string;\r\n\tmainImage: ProductAsset | null;\r\n}\r\n\r\nexport interface ProductSelectionDispatcherDto {\r\n\tproductId: string;\r\n\tproductDetails: ProductDetailsState;\r\n}\r\n\r\n/*\r\n\tShirt Size: Small, Large\r\n\tColor: Red, Green\r\n\r\n\tScenario #1: All selections match\r\n\r\n\tValid selections:\r\n\tSmall, Red\r\n\tSmall, Green\r\n\tLarge, Red\r\n\tLarge, Green\r\n\r\n\t1. Pick Size\r\n\t2. Pick Color\r\n\t3. Find match and load child\r\n\r\n\tScenario #2: Selections mismatch\r\n\r\n\tValid selections:\r\n\tSmall, Red\r\n\tSmall, Green\r\n\tLarge, Red\r\n\r\n\t1. Pick Size (Small/Large)\r\n\t2. if Large, mark green as invalid\r\n\t3. if Small, show all colors\r\n\t4. Find match and load child\r\n\r\n\tScenario #3: Selections mismatch 2\r\n\r\n\tValid selections:\r\n\tSmall, Red\r\n\tSmall, Green\r\n\tLarge, Red\r\n\r\n\t1. Pick Green, mark large as invalid\r\n\t2. Pick Size\r\n\t3. Find match and load child\r\n\r\n\tScenario #4: Selections mismatch 3\r\n\r\n\tValid selections:\r\n\tSmall, Red\r\n\tSmall, Green\r\n\tLarge, Red\r\n\r\n\t1. Pick Green, mark large as invalid\r\n\t2. Pick Large anyway, remove color selection\r\n\t3. ...\r\n\t4. Find match and load child\r\n\r\n*/\r\n\r\n/**\r\n * All available product types\r\n *\r\n * @export\r\n */\r\nexport enum ProductType {\r\n\tSimple = 'Simple',\r\n\tGroup = 'Group',\r\n\tKit = 'Kit',\r\n\tGiftCard = 'GiftCard',\r\n}\r\n\r\nexport type ProductPartialDataLoaderOptions = Pick<\r\n\tPartialDataLoaderOptions,\r\n\t'initialState' | 'dataLoaderFn'\r\n>;\r\n\r\nexport interface ProductSelection {\r\n\t/**\r\n\t * The code of the product attribute\r\n\t */\r\n\tid: string;\r\n\t/**\r\n\t * The name of the product attribute\r\n\t */\r\n\tname: string;\r\n\t/**\r\n\t * The attribute value name (if available), otherwise attribute value value\r\n\t */\r\n\tlabel: string;\r\n\t/**\r\n\t * The id (Guid) of the attribute value\r\n\t */\r\n\tvalue: string;\r\n\r\n\t/**\r\n\t * The selected attribute field name used for adding info to hawk context\r\n\t */\r\n\tfield: string;\r\n}\r\n\r\n/**\r\n * Base unit of measure\r\n */\r\nexport interface UnitOfMeasure {\r\n\tname: string;\r\n\tdisplayName: string;\r\n}\r\n\r\n/**\r\n * Represents a single pricing line for a product (one of potentially many choices for purchasing a product)\r\n */\r\nexport type ProductPricingLine = {\r\n\t/**\r\n\t * The pricing line's id\r\n\t */\r\n\tid: string;\r\n\r\n\t/**\r\n\t *\r\n\t * Unit of measure id\r\n\t */\r\n\tunitOfMeasureId: string;\r\n\r\n\t/**\r\n\t * Base Unit of measure\r\n\t */\r\n\tunitOfMeasure: UnitOfMeasure;\r\n\r\n\t/**\r\n\t * The unit's of measure display name\r\n\t */\r\n\tlabel: string;\r\n\r\n\t/**\r\n\t * The unit's of measure quantity\r\n\t */\r\n\tquantity: number;\r\n\r\n\t/**\r\n\t * If this pricing line isn't available for purchase, this will contain a string-localizer-key explaining the reason why.\r\n\t */\r\n\tunavailabilityReason: string | undefined;\r\n} & MassPricingLineOptions;\r\n\r\ntype MassPricingLineOptions =\r\n\t| {\r\n\t\t\t/**\r\n\t\t\t * The unit's of measure weight unit\r\n\t\t\t */\r\n\t\t\tunitOfMass: UnitOfMass;\r\n\r\n\t\t\t/**\r\n\t\t\t * The unit's of measure weight\r\n\t\t\t */\r\n\t\t\tweight: number;\r\n\t }\r\n\t| {\r\n\t\t\tunitOfMass?: never;\r\n\t\t\tweight?: never;\r\n\t };\r\n\r\n/**\r\n * Represents state details pricing lines and pricing line selections for a product on a product details page.\r\n */\r\nexport interface ProductPricingLinesDetails {\r\n\t/**\r\n\t * The selected pricing lines\r\n\t */\r\n\tselected?: ProductPricingLine;\r\n\t/**\r\n\t * The array of available pricing lines\r\n\t */\r\n\tavailable: ProductPricingLine[];\r\n}\r\n\r\n/**\r\n * Reason that the exception was thrown when adding an item to the cart\r\n */\r\nexport enum AddToCartExceptionCode {\r\n\tgeneric = 'Generic',\r\n\tcartFull = 'CartFull',\r\n\tproductUnavailable = 'ProductUnavailable',\r\n\tproductOutOfStock = 'ProductOutOfStock',\r\n}\r\n\r\n/**\r\n * Interface used as request for getting bulk products partial data\r\n */\r\nexport interface BaseBulkPartialProductsDataOptions {\r\n\tproductIds: string[] | undefined;\r\n\tmissingKeys: Array;\r\n}\r\n\r\n//#region TapeCase\r\nexport interface ProductReadyToBuyDto {\r\n\tname: string;\r\n\turl: string;\r\n\tattributes: ProductAttributeDto[];\r\n}\r\n\r\nexport interface ProductAttributeDto {\r\n\tname: string;\r\n\tvalue: string;\r\n}\r\n\r\nexport interface UnitOfMeasureDto {\r\n\tid: string;\r\n\tname: string;\r\n}\r\n\r\nexport interface FormatShapeDto {\r\n\tid: string;\r\n\tname: string;\r\n}\r\n\r\nexport interface ProductTableProductDetails {\r\n\tid: string;\r\n\tcolor: string | null;\r\n\tsize: string | null;\r\n\tpackageQuantity: string | null;\r\n\tcustomerPartNumber: string | null;\r\n\tadditionalSkuDescription: string | null;\r\n\tupc: string | null;\r\n\tdistributorPartNumber: string | null;\r\n\tuom: string;\r\n\tformatShape: string | null;\r\n\twidth: string | null;\r\n\twidthUom: string | null;\r\n\tlength: string | null;\r\n\tlengthUom: string | null;\r\n\tdiameter: string | null;\r\n\tdiameterUom: string | null;\r\n\tinnerHoleDiameter: string | null;\r\n\tinnerHoleDiameterUom: string | null;\r\n\tsizeDescription: string | null;\r\n\tpricingLine: PricingLine>[];\r\n\tsummary: Summary;\r\n}\r\n\r\n//#endregion\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Left chevron SVG\r\n *\r\n * @returns\r\n */\r\nfunction LeftChevronSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default LeftChevronSVG;\r\n","var api = require(\"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../../../node_modules/css-loader/dist/cjs.js!./style.css\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".react-toggle {\\n touch-action: pan-x;\\n\\n display: inline-block;\\n position: relative;\\n cursor: pointer;\\n background-color: transparent;\\n border: 0;\\n padding: 0;\\n\\n -webkit-touch-callout: none;\\n -webkit-user-select: none;\\n -khtml-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n\\n -webkit-tap-highlight-color: rgba(0,0,0,0);\\n -webkit-tap-highlight-color: transparent;\\n}\\n\\n.react-toggle-screenreader-only {\\n border: 0;\\n clip: rect(0 0 0 0);\\n height: 1px;\\n margin: -1px;\\n overflow: hidden;\\n padding: 0;\\n position: absolute;\\n width: 1px;\\n}\\n\\n.react-toggle--disabled {\\n cursor: not-allowed;\\n opacity: 0.5;\\n -webkit-transition: opacity 0.25s;\\n transition: opacity 0.25s;\\n}\\n\\n.react-toggle-track {\\n width: 50px;\\n height: 24px;\\n padding: 0;\\n border-radius: 30px;\\n background-color: #4D4D4D;\\n -webkit-transition: all 0.2s ease;\\n -moz-transition: all 0.2s ease;\\n transition: all 0.2s ease;\\n}\\n\\n.react-toggle:hover:not(.react-toggle--disabled) .react-toggle-track {\\n background-color: #000000;\\n}\\n\\n.react-toggle--checked .react-toggle-track {\\n background-color: #19AB27;\\n}\\n\\n.react-toggle--checked:hover:not(.react-toggle--disabled) .react-toggle-track {\\n background-color: #128D15;\\n}\\n\\n.react-toggle-track-check {\\n position: absolute;\\n width: 14px;\\n height: 10px;\\n top: 0px;\\n bottom: 0px;\\n margin-top: auto;\\n margin-bottom: auto;\\n line-height: 0;\\n left: 8px;\\n opacity: 0;\\n -webkit-transition: opacity 0.25s ease;\\n -moz-transition: opacity 0.25s ease;\\n transition: opacity 0.25s ease;\\n}\\n\\n.react-toggle--checked .react-toggle-track-check {\\n opacity: 1;\\n -webkit-transition: opacity 0.25s ease;\\n -moz-transition: opacity 0.25s ease;\\n transition: opacity 0.25s ease;\\n}\\n\\n.react-toggle-track-x {\\n position: absolute;\\n width: 10px;\\n height: 10px;\\n top: 0px;\\n bottom: 0px;\\n margin-top: auto;\\n margin-bottom: auto;\\n line-height: 0;\\n right: 10px;\\n opacity: 1;\\n -webkit-transition: opacity 0.25s ease;\\n -moz-transition: opacity 0.25s ease;\\n transition: opacity 0.25s ease;\\n}\\n\\n.react-toggle--checked .react-toggle-track-x {\\n opacity: 0;\\n}\\n\\n.react-toggle-thumb {\\n transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1) 0ms;\\n position: absolute;\\n top: 1px;\\n left: 1px;\\n width: 22px;\\n height: 22px;\\n border: 1px solid #4D4D4D;\\n border-radius: 50%;\\n background-color: #FAFAFA;\\n\\n -webkit-box-sizing: border-box;\\n -moz-box-sizing: border-box;\\n box-sizing: border-box;\\n\\n -webkit-transition: all 0.25s ease;\\n -moz-transition: all 0.25s ease;\\n transition: all 0.25s ease;\\n}\\n\\n.react-toggle--checked .react-toggle-thumb {\\n left: 27px;\\n border-color: #19AB27;\\n}\\n\\n.react-toggle--focus .react-toggle-thumb {\\n -webkit-box-shadow: 0px 0px 3px 2px #0099E0;\\n -moz-box-shadow: 0px 0px 3px 2px #0099E0;\\n box-shadow: 0px 0px 2px 3px #0099E0;\\n}\\n\\n.react-toggle:active:not(.react-toggle--disabled) .react-toggle-thumb {\\n -webkit-box-shadow: 0px 0px 5px 5px #0099E0;\\n -moz-box-shadow: 0px 0px 5px 5px #0099E0;\\n box-shadow: 0px 0px 5px 5px #0099E0;\\n}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n","/**\r\n * THIS HAS A COPY ON ROC.ADMIN. DO NOT MAKE CHANGES HERE WITHOUT ALSO MAKING THEM IN THE OTHER FILE.\r\n */\r\n\r\nimport { Prices, PricingLine, PricingResult } from 'shared-client/types/commerce/pricing-result';\r\n\r\n/**\r\n * Splits a quantity range of format `\"min:max\"` into a two dimensional array in the form of `[min: number, max: number]`.\r\n * It is illegal for quantity ranges to be fractional.\r\n * @param quantityRange A quantity range string in the form of `\"min:max\"`\r\n */\r\nexport function ParseQuantityRange(quantityRange: string): [number, number] {\r\n\tconst s = quantityRange.split(':');\r\n\treturn [parseInt(s[0]), s[1] === 'Infinity' ? Infinity : parseInt(s[1])];\r\n}\r\n\r\n/**\r\n * Retrieves a price detail of type T from a quantity range index for the specified quantity.\r\n * For example an index with the values `{[1:49]:\"$4.99\", [50:Infinity]:\"$3.99\"}` would return\r\n * \"$4.99\" for the quantity 1 or 25 but \"3.99\" for quantities above 49.\r\n * @param prices\r\n * @param quantity\r\n */\r\nexport function GetPriceForQuantity(prices: Prices, quantity: number): T {\r\n\tif (quantity == null || quantity <= 0) {\r\n\t\tthrow new Error('Erroneous quantity passed to GetPriceForQuantity');\r\n\t}\r\n\r\n\tfor (const quantityRange in prices) {\r\n\t\tconst [min, max] = ParseQuantityRange(quantityRange);\r\n\t\tif (quantity >= min && quantity <= max) {\r\n\t\t\treturn prices[quantityRange];\r\n\t\t}\r\n\t}\r\n\r\n\tthrow new Error('Price not found. Is the prices object well formed?');\r\n}\r\n\r\n/** Retrieves a pricing line for a given pricing result by the specified pricing line ID */\r\nexport function GetPricingLine(pricingResult: PricingResult, productId: string, pricingLineId?: string | null) {\r\n\tconst line = pricingResult.products[productId];\r\n\tif (!line) {\r\n\t\treturn undefined;\r\n\t}\r\n\r\n\tif (pricingLineId == null) {\r\n\t\tfor (const id in line.pricingLines) {\r\n\t\t\tconst pricingLine = line.pricingLines[id];\r\n\t\t\tif (pricingLine && pricingLine.isDefault) {\r\n\t\t\t\treturn pricingLine;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (const id in line.pricingLines) {\r\n\t\t\tconst pricingLine = line.pricingLines[id];\r\n\t\t\tif (pricingLine) {\r\n\t\t\t\treturn pricingLine;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn undefined;\r\n\t}\r\n\r\n\treturn line.pricingLines[pricingLineId];\r\n}\r\n\r\n//#region TapeCase\r\n/**\r\n * Retrieves a price detail of type T from a quantity range index for the minimum quantity available.\r\n * For example an index with the values `{[5:24]:\"$4.99\", [25:Infinity]:\"$3.99\"}` would return \"$4.99\"\r\n * because it will use 5 as the requested quantity.\r\n * @param prices\r\n */\r\nexport function GetPriceForMinimumAvailableQuantity(prices: Prices): T {\r\n\tif (Object.keys(prices).length > 0) {\r\n\t\tconst minQtyAvailable = Object.keys(prices)\r\n\t\t\t.map((qtyRange) => {\r\n\t\t\t\tconst [min] = ParseQuantityRange(qtyRange);\r\n\t\t\t\treturn {\r\n\t\t\t\t\tstartingQty: min,\r\n\t\t\t\t\trange: qtyRange,\r\n\t\t\t\t};\r\n\t\t\t})\r\n\t\t\t.sort((qtyRangeInfo) => qtyRangeInfo.startingQty)[0];\r\n\r\n\t\treturn prices[minQtyAvailable.range];\r\n\t}\r\n\r\n\tthrow new Error('Price not found. Is the prices object well formed?');\r\n}\r\n\r\n/**\r\n * Retrieves a price detail of type T from a quantity range index for the specified quantity.\r\n * For example an index with the values `{[1:49]:\"$4.99\", [50:Infinity]:\"$3.99\"}` would return\r\n * \"$4.99\" for the quantity 1 or 25 but \"3.99\" for quantities above 49.\r\n * @param prices\r\n * @param quantity\r\n */\r\nexport function GetMinimumOrderQuantity(price: PricingLine): number | null {\r\n\tlet moq: number | null = null;\r\n\tfor (const quantityRange in price.prices) {\r\n\t\tconst [min] = ParseQuantityRange(quantityRange);\r\n\t\tif (moq == null || min < moq) {\r\n\t\t\tmoq = min;\r\n\t\t}\r\n\t}\r\n\treturn moq;\r\n}\r\n\r\n/**\r\n * Get the minimum order quantity for the specified product and pricing line. Returns at least 1.\r\n */\r\nexport function GetMinimumOrderQuantityForPricingLine(\r\n\tproductPricing?: PricingResult,\r\n\tproductId?: string,\r\n\tselectedPricingLineId?: string,\r\n) {\r\n\tif (!productId || !productPricing || !selectedPricingLineId) {\r\n\t\treturn 1;\r\n\t}\r\n\tconst selectedPricingLine = GetPricingLine(productPricing, productId, selectedPricingLineId);\r\n\tif (!selectedPricingLine) {\r\n\t\treturn 1;\r\n\t}\r\n\r\n\tconst minimumOrderQuantity = GetMinimumOrderQuantity(selectedPricingLine) ?? 0;\r\n\t// Return at least 1 as the minimum\r\n\treturn Math.max(1, minimumOrderQuantity);\r\n}\r\n\r\n//#endregion\r\n"],"sourceRoot":""}