{"version":3,"sources":["webpack:///./ClientApp/services/Localizer.tsx","webpack:///./ClientApp/features/commerce/product-details/ProductDetailsContext.ts","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/features/commerce/organization/OrganizationUIComponents.ts","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/shared/components/card/CardButton.tsx","webpack:///./ClientApp/styles/node-modules/@reach/dialog/styles.css","webpack:///./ClientApp/shared/components/svg/QuestionMarkCircleSVG.tsx","webpack:///./ClientApp/features/commerce/my-account/shopping-lists/types.ts","webpack:///./ClientApp/shared/components/svg/FileSVG.tsx","webpack:///./ClientApp/shared/hooks/useAxiosLoader.ts","webpack:///./ClientApp/shared/hooks/useAxiosPaginatedLoader.ts","webpack:///./ClientApp/shared/components/Breadcrumbs.tsx","webpack:///./ClientApp/features/commerce/product-details/ProductPricingLines.tsx","webpack:///./ClientApp/shared/components/Alert.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/ProductSelectionsList.tsx","webpack:///./ClientApp/features/commerce/organization/orders lazy ^\\.\\/.*$ namespace object","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/components/Spinner.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/useShoppingCart.ts","webpack:///./ClientApp/features/commerce/calculators/quote-confirmation/types.ts","webpack:///./ClientApp/shared/components/Pagination.tsx","webpack:///./ClientApp/services/AxiosHelper.ts","webpack:///./ClientApp/shared/edit/fields/FieldInputErrorWrapper.tsx","webpack:///./ClientApp/shared/assets/lazy.ts","webpack:///./ClientApp/features/commerce/product-details/useProductDetails.ts","webpack:///./ClientApp/shared/data/usePartialDataLoader.tsx","webpack:///./ClientApp/shared/components/svg/LockSVG.tsx","webpack:///./ClientApp/shared/edit/fields/FieldLabel.tsx","webpack:///./ClientApp/features/commerce/my-account/shopping-lists/useShoppingLists.ts","webpack:///./ClientApp/shared/edit/InlineAlert.tsx","webpack:///./ClientApp/features/commerce/my-account/shopping-lists/ShoppingListEditItemFields.tsx","webpack:///./ClientApp/features/commerce/my-account/shopping-lists/ShoppingListEditItemBody.tsx","webpack:///./ClientApp/features/commerce/my-account/shopping-lists/ShoppingListEditItem.tsx","webpack:///./ClientApp/shared/components/svg/XSVG.tsx","webpack:///./ClientApp/features/commerce/my-account/shopping-lists/useShoppingListLoader.ts","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/shared/hooks/useRocEventHandler.tsx","webpack:///./ClientApp/shared/util/ErrorBoundary.tsx","webpack:///./ClientApp/features/commerce/store/MultipleItemsAddedToCartAlert.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/commerce/organization/routes.tsx","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/hawksearch/helpers/Cookies.ts","webpack:///./ClientApp/shared/components/svg/PencilSVG.tsx","webpack:///./ClientApp/util/type-assertions.ts","webpack:///./ClientApp/features/commerce/store/AddedToCartAlert.tsx","webpack:///./ClientApp/features/commerce/product-details/ProductAddToCart.tsx","webpack:///../Roc.SharedClientApp/types/commerce/product-details.ts","webpack:///./ClientApp/shared/components/roc-options-table/RocOptionsTable.tsx","webpack:///./ClientApp/features/commerce/product-details/ProductPriceList.tsx","webpack:///./ClientApp/features/commerce/product-details/tapecase/ProductTableFormatShapeSelector.tsx","webpack:///./ClientApp/features/commerce/product-details/tapecase/TapeCaseProductDetailsContext.ts","webpack:///./ClientApp/features/commerce/product-details/tapecase/data.ts","webpack:///./ClientApp/features/commerce/product-details/tapecase/ProductCalculatorSelector.tsx","webpack:///./ClientApp/features/commerce/calculators/routes.ts","webpack:///./ClientApp/features/commerce/product-details/tapecase/ProductTable.tsx","webpack:///./ClientApp/features/commerce/product-details/ProductRating.tsx","webpack:///./ClientApp/features/commerce/product-details/ProductDetails.tsx","webpack:///./ClientApp/features/commerce/product-details/tapecase/useTapeCaseProductDetails.ts","webpack:///./ClientApp/features/commerce/product-details/tapecase/TapeCaseProductDetailsContextProvider.tsx","webpack:///./ClientApp/features/commerce/product-details/tapecase/ProductDetailsProvider.tsx","webpack:///./ClientApp/features/commerce/product-details/tapecase/ProductQuantityBreaks.tsx","webpack:///./ClientApp/features/commerce/product-details/tapecase/TapeCaseProductDetails.tsx","webpack:///./ClientApp/features/commerce/product-details/tapecase/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/features/my-account/routes.commerce.tsx","webpack:///./ClientApp/util/StringUtil.ts","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","ProductDetailsContext","React","createContext","useProductDetailsContext","context","useContext","Error","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","OrganizationUIComponents","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","CardButton","type","children","defaultProps","disabled","___CSS_LOADER_API_IMPORT___","push","QuestionMarkCircleSVG","stroke","strokeWidth","fill","fillRule","transform","PrivacyType","PrivacyTypeOptions","value","text","FileSVG","cache","useAxiosLoader","axiosParams","active","callback","method","useLoader","loading","setLoading","error","setError","setResponse","reloadTimes","setReloadTimes","cancelToken","useRef","current","Axios","CancelToken","source","isCancel","cancel","values","reload","useAxiosPaginatedLoader","query","initialPageSize","initialSortByName","initialSortDirection","initialResults","pageSize","setPageSizeState","pageNumber","setPageNumber","sortByName","setSortByName","sortDirection","setSortDirection","dataLoaderActive","setDataLoaderActive","customQuery","setCustomQuery","paginationQuery","url","results","page","goToPage","pagination","totalPages","goToNextPage","goToPreviousPage","setSorting","sortBy","direction","setPageSize","size","setQuery","Breadcrumbs","breadcrumbPath","backToPage","renderPathLink","item","href","label","history","onClick","back","entry","Fragment","NoPricingLine","pricingLine","isInitialization","checked","getCheckedPricingLine","pricingLines","checkedUnit","find","uom","ProductPricingLines","setPricingLines","details","selected","available","statefulPricingLines","line","onPricingLineChange","handleOnChangeAndBlur","e","newLine","updatedPricingLines","newValue","currentTarget","htmlFor","onChange","onBlur","quantity","unitOfMeasure","displayName","getPricingLineDropdownText","LazyDialog","lazy","then","Dialog","Alert","isOpen","theme","onConfirm","onCancel","renderTitle","cancelButtonText","confirmButtonText","renderActions","renderProps","headerDivider","subTitle","Suspense","fallback","onDismiss","as","ProductSelectionsList","selections","classNamePrefix","parentPrefixClass","itemPrefixClass","labelPrefixClass","valuePrefixClass","sel","toUpperCase","selection","parentClass","webpackAsyncContext","req","__webpack_require__","o","code","ids","all","slice","t","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","ProductImageModal","closeModal","Spinner","aria-label","XSVG","LazyMediaQuery","productAssetPlaceholder","altText","sortOrder","thumbnailUrl","mainImageUrl","enlargedImageUrl","Image","compareAssets","a","b","ProductAssets","mainAsset","setMainAsset","altAssets","setAltAssets","isImageSliderModalOpen","setIsImageSliderModalOpen","carousel","nodes","Map","scrollCarousel","up","from","node","innerWidth","scrollBy","clientHeight","smoothscroll","polyfill","assets","newMainAsset","initialThumbnails","initAltAssets","assetScroller","maxWidth","LeftChevronSVG","minWidth","altAsset","c","set","preventDefault","download","mainImageContent","light","waitMs","align","block","parentCentered","useDelayedDisplay","spinner","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","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","addToCart","itemId","productPricingLineId","savedProductsPageNumber","savedProductsPageSize","axiosError","exceptionCode","bulkAddToCart","element","request","productInfo","processedItems","addAllFromListToCurrentCart","shoppingListId","displayedItemsCount","shoppingListProductIds","selectedShoppingListProductIds","addAllFromListToNewCart","moveItemToSaved","itemToMove","product","recipient","recipientId","itemIndex","indexOf","MoveStatus","MovedToSaved","changeOrderItemQuantity","itemToUpdate","newQuantity","removeOrderItem","itemToRemove","RemovedFromCart","addToSavedProducts","itemToAdd","moveSavedProductToCart","productToMoveId","productName","savedProductIndex","findIndex","addToOrderResult","lastMovedItem","MovedToCart","removeSavedProduct","productToRemoveId","productToRemoveName","savedProduct","delete","toString","orderItemFromSaved","totalPrice","unitPrice","snapshotMinimumOrderQuantity","RemovedFromSaved","handleUndo","state","actor","updateOrder","newCart","CalculatorType","Pagination","flush","hasNextPage","hasPreviousPage","uniqueId","createGuid","localPageNumber","setLocalPageNumber","timerRef","attemptGoToPage","newPageNumber","clearTimeout","parseInt","onKeyDown","toLocaleString","axios","create","defaults","headers","common","interceptors","use","config","toLowerCase","getCsrfToken","csrfToken","RequestVerificationToken","addUnauthorizedAccessInterceptor","status","location","AccountUrls","Login","encodeURIComponent","pathname","reject","FieldInputErrorWrapper","hideIcon","inline","meta","useField","invalid","submitError","dirtySinceLastSubmit","submitting","touched","lazyLoadImages","lazyImages","call","querySelectorAll","lazyImageObserver","IntersectionObserver","entries","isIntersecting","lazyImage","target","dataset","attributeDelay","Number","getAttribute","classList","remove","add","unobserve","observe","lazyElements","elements","stopAfterIntersecting","lazyElementObserver","lazyElement","readyState","addEventListener","useProductDetails","loaderOptions","simpleProductLoading","setSimpleProductLoading","loggedInUserFirstName","setLoggedInUserFirstName","productStateOverride","setInternalProductStateOverride","userIsSignedIn","setUserIsSignedIn","productQuantity","setProductQuantity","selectedPricingLine","setSelectedPricingLine","productData","usePartialDataLoader","isLoadingAny","hasError","setHasError","productDetails","partialData","groupId","summary","ProductType","Group","reviewsSummary","setProductStateOverride","originalState","getInitialProductDetailsState","fixedNewState","tabs","newTabs","newTabsMap","tab","oldTab","foldTabs","isPricingLineUnavailable","unavailabilityReason","isPurchaseable","availability","outOfStock","initialState","setPartialData","isLoading","setIsLoading","isKeyLoading","dataLoaderFn","missingData","providedKeys","literal","valueOf","loadData","LockSVG","FieldLabel","isRequired","testId","trim","useShoppingLists","shoppingListBeingEdited","setShoppingListBeingEdited","isSaving","setIsSaving","shoppingList","setShoppingList","isDeleting","setIsDeleting","saveShoppingList","formValues","requestToken","MY_ACCOUNT_SHOPPING_LISTS_URL","token","handleAxiosErrorWithValidation","beginCreateShoppingList","beginEditShoppingList","stopEditingShoppingList","addProductToList","bulkAddProductToList","removeShoppingList","InlineAlert","isTitleOnOwnRow","isCollapsed","onCollapse","isAxiosError","ShoppingListEditItemFields","addSelectOption","ShoppingListEditItemBody","isAlertOpen","setIsAlertOpen","displayCancelButton","displaySaveButton","onRemoveShoppingList","dirty","dirtySaveButtonText","saveButtonText","ShoppingListEditItem","onSaveShoppingList","onSubmit","form","getState","subscription","pristine","initialValues","render","handleSubmit","useShoppingListLoader","userDataPromise","getUserData","getUserDataNoCache","userData","CheckboxInputField","input","readOnly","placeholder","step","defaultValue","defaultChecked","aria-describedby","CheckBoxField","afterSubmit","allowNull","beforeSubmit","formatOnBlur","initialValue","isEqual","DropdownField","validateFields","onFocus","option","getErrorArray","errorOrSubmitError","errors","ValidationMessages","concat","aria-live","aria-atomic","StarRatingField","maxRating","OptionalFieldMarker","StarRating","readonly","TextAreaField","rows","validate","component","format","parse","InputField","forwardRef","TextBoxField","ModelStatus","BaseUrl","ServerData","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","eventType","dispatchEvent","useRocEventHandler","eventHandler","deps","removeHandlerCallback","addRocEventHandler","ErrorBoundary","this","setState","renderError","Component","MultipleItemsAddedToCartAlert","displayAlert","setDisplayAlert","responseItem","AddedToCartLineItem","rowIndex","displayPrice","subtotal","height","role","width","imageUrl","Element","getAttributeNames","attributes","getDataPropsFromAttributes","s","startsWith","attributeName","toCamelCase","substring","initReactApp","getReactElement","elementId","getElementById","ReactDOM","initReactAppByAttribute","attribute","MY_ACCOUNT_PATH_PREFIX","MY_ACCOUNT_AUTHENTICATOR_URL","MY_ACCOUNT_GENERATE_RECOVERY_CODES_URL","MY_ACCOUNT_CONFIGURE_AUTHENTICATOR_URL","MY_ACCOUNT_LOGIN_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","CheckCircleSVG","ms","sleep","validationErrorCallback","genericErrorCallback","globalErrors","errorsWithModifiedArrayIndex","acc","newValidationState","unflatten","FORM_ERROR","getQueryParam","paramName","decodeParam","urlParams","URLSearchParams","search","decodeURIComponent","ORGANIZATION_PREFIX","ORGANIZATION_USERS_URL","ORGANIZATION_USERS_CREATE_URL","UPDATE_ORGANIZATION_USER_URL","UPDATE_USER_ORGANIZATION_STATUS_URL","UPDATE_USER_DEFAULT_ORGANIZATION_URL","INVALIDATE_USER_ORGANIZATION_NOTIFICATION_CACHE_URL","ORGANIZATION_ORDERS_URL","ORGANIZATION_SHIPTOS_URL","ORGANIZATION_ORDER_DETAILS","OrganizationOrderDetailsComponent","orderDetailsComponent","OrderDetailsUIComponent","DefaultOrganizationOrderDetails","ShiptosComponent","UsersComponent","OrganizationOrdersComponent","OrganizationUsersCreateComponent","OrderStatus","PaymentTypeEnum","CreditCardType","handler","removeEventListener","DashCircleSVG","class","CircleExclamationSVG","ProductPricing","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","CircleButton","icon","otherProps","StarEmptySVG","StarSVG","ratingStars","setRatingStars","ratingHovered","setRatingHovered","newState","isFull","isPending","isHighlighted","isChecked","ratingValue","useStarRating","onInputChange","modifierClasses","onMouseEnter","onMouseLeave","getVisitorExpiry","Date","setTime","getTime","toUTCString","getVisitExpiry","substr","Math","floor","random","getCookie","nameEQ","ca","cookie","charAt","setCookie","expiry","expires","PencilSVG","AssertionError","setPrototypeOf","AddedToCartAlert","ProductAddToCart","UseProductDetailsResult","modalOpen","setModalOpen","addingToCart","setAddingToCart","addToCartResponse","setAddToCartResponse","errorMessages","setErrorMessages","isViewCartActive","setIsViewCartActive","UseShoppingCartResult","cartErrorMessage","allSelectionsSelected","Simple","errorTitle","AddToCartExceptionCode","cartFull","productOutOfStock","productUnavailable","minimumOrderQuantity","displayPricing","selectedPricingLineId","GetPricingLine","GetMinimumOrderQuantity","setQuantity","isDiscontinued","handleAddToCart","orderErrorMessages","om","autoComplete","tabIndex","isNaN","updateQuantity","setSelectedProductPricingLineId","arg","assertNotNullish","Modal","titleIcon","UnitOfMass","UnitOfLength","RocOptionsTable","ProductPriceList","GetPriceForQuantity","prices","ProductTableFormatShapeSelector","availableFormatShape","selectedFormatShapeId","changeSelectedFormatShape","formatShape","u","TapeCaseProductDetailsContext","useTapeCaseProductDetailsContext","mapProductDetails","colorFilterValue","dimension1FilterValue","diameter","dimension2FilterValue","innerHoleDiameter","ProductCalculatorSelector","availableCalculators","isModalOpen","setIsModalOpen","calculator","calculatorType","linkDescription","calculatorUrl","AbrasiveBelts","CustomCutTapeShape","CustomShortLength","CustomWidthRoll","renderCalculatorLink","ProductSpecComp","elem","createPortal","ProductTable","productSeriesTableData","setProductSeriesTableData","selectedFormatShape","setFormatShape","isFiltering","setIsFiltering","dimensionColumnNames","dimension1ColumnName","dimension2ColumnName","resolveColumnNames","hideDimension1","setHideDimension1","hideDimension2","setHideDimension2","hideColor","setHideColor","tableData","every","fetchTableData","additionalProductInfoLink","querySelector","contains","model","rawHtml","alternateProductDetailsDom","hasProductsForTable","alternateProductSpecsDomElement","productSpecs","simplesListing","onFilterUpdate","newData","rowSpan","filterkey","row","ProductTableRow","colSpan","pricing","pricesPerPricingLine","numberOfPrices","data-head","ItemDescription","DimensionsColumns","p","quantityRange","hideRange","ParseQuantityRange","min","max","Infinity","formatPricingLine","QuantityInput","onQuantityUpdate","AddToCartButton","pricingLineId","diameterUom","innerHoleDiameterUom","widthUom","lengthUom","sizeDescription","productUrl","upc","additionalSkuDescription","distributorPartNumber","TabType","ProductBreadcrumbs","headerDom","breadcrumbComponent","canGoBack","ProductMedia","mainLeftDom","productAssets","ProductDetails","useTapeCaseProductDetails","isLoggedIn","setIsLoggedIn","checkIfIsLoggedIn","isSignedIn","isContractPricingAvailable","hasValidItem","simpleProductDetails","qtyBreakIndex","isAnyProductPurchasable","displayPriceLine","GetPriceForMinimumAvailableQuantity","getPricingDetail","Provider","TapeCaseProductDetailsProvider","ProductDetailsProvider","ProductQuantityBreaks","qtyRanges","availablePricing","getAvailablePrices","qtyRange","AddToCart","ProductHeader","mainInfoHeaderDom","productHeaderInfo","moq","getDetail","productAddToCartDom","productAddToCart","ContractPricingLoginLink","contractPricingLoginLinkDom","contractPricingLoginLink","TapeCaseProductDetails","setCanGoBack","sessionStorage","getItem","removeItem","windowWithServerData","__ROC_SERVER_DATA__","initializeServerData","FolderSVG","GarbageCanCircleSVG","StatusDisplay","Published","Inactive","Deleted","Draft","Archived","MY_ACCOUNT_ORDERS_URL","MY_ACCOUNT_STORE_URL","MY_ACCOUNT_SAVED_FOR_LATER_URL","MY_ACCOUNT_SAVED_CARTS_URL","MY_ACCOUNT_BUY_AGAIN_URL","MY_ACCOUNT_ORGANIZATION_REVIEW_URL","MY_ACCOUNT_ORGANIZATION_SELECTOR_URL","MY_ACCOUNT_SHOPPING_LISTS_CREATE_URL","MY_ACCOUNT_USER_SHIPPING_ACCOUNT_URL","MY_ACCOUNT_USER_SHIPPING_ACCOUNT_CREATE_URL","MY_ACCOUNT_USER_SHIPPING_ACCOUNT_EDIT_URL","OrdersComponent","OrderDetailsComponent","StoreComponent","AddressBookComponent","AddressBookEditComponent","SavedForLaterComponent","SavedCartsComponent","BuyAgainComponent","AccountOverviewComponent","ShoppingListsComponent","ShoppingListsCreateComponent","ShoppingListDetailsComponent","OrganizationReviewComponent","OrganizationSelectorComponent","OrganizationShiptosComponent","OrganizationUsersComponent","UserShippingAccountsComponent","UserShippingAccountsEditComponent","ordersRoute","orderDetailsRoute","storeRoute","addressBookRoute","addressBookCreateRoute","addressBookEditRoute","savedForLaterRoute","savedCartsRoute","exect","buyAgainRoute","shoppingListsRoute","shoppingListsCreateRoute","shoppingListDetailsRoute","defaultRoute","organizationReviewRoute","organizationSelectorRoute","OrganizationUsersRoute","OrganizationShipTosRoute","OrganizationOrdersRoute","OrganizationCreateUserRoute","OrganizationOrderDetailsRoute","commerceRoutes","toLocaleLowerCase","word","stripHtml","html","tmp","createElement","innerHTML","textContent","innerText","trimString","LazyDialogContent","DialogContent","LazyDialogOverlay","DialogOverlay","hideCloseButton","renderSubtitle","bypassFocusLock","innerModal","ariaLabel","dangerouslyBypassFocusLock","__ROC_COMMERCE_PRODUCT_DETAILS__","pricingResult","products","isDefault","startingQty","range","qtyRangeInfo","GetMinimumOrderQuantityForPricingLine","productPricing"],"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,EAAIG,OAc3B,SAASC,EACfD,GAEC,2BADEE,EACF,iCADEA,EACF,kBAKD,GAJ+C,IAA3CJ,OAAOC,KAAKX,GAAoBe,QACnCb,KAGIF,IAAuBA,EAAmBY,GAQ9C,OALMX,EAAgBW,KACpBI,QAAQC,KAAKL,EAAK,2DAClBX,EAAgBW,IAAO,GAGlBA,EAGR,IAAMM,EAAWlB,EAAmBY,GAEpC,OAAKE,EAIEI,EAASC,QAAQ,YAAY,SAACC,EAAeC,GACnD,OAAOP,EAAeO,GAASP,EAAeO,GAAS,MAJhDH,EAqBF,SAASI,EAAcC,GAA2B,IAChDC,EAA2BD,EAA3BC,YADgD,EACrBD,EAAdE,YADmC,MAC5B,GAD4B,EAElDC,EAAkBb,EAAS,WAAT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,GACtC,GAAI6G,GAAeA,EAAY27B,UAC9B,OAAO37B,EAIT,IAAK,IAAM7G,KAAM2H,EAAKV,aAAc,CACnC,IAAMJ,EAAcc,EAAKV,aAAajH,GACtC,GAAI6G,EACH,OAAOA,IAiBJ,SAAS40B,EAAuCnH,GACtD,GAAIp7B,OAAOC,KAAKm7B,GAAQ/6B,OAAS,EAWhC,OAAO+6B,EAViBp7B,OAAOC,KAAKm7B,GAClCj4B,KAAI,SAAC6/B,GAEL,MAAO,CACNuG,YAHiB,EACJtJ,EAAmB+C,GADf,MAIjBwG,MAAOxG,MAGRh8B,MAAK,SAACyiC,GAAD,OAAkBA,EAAaF,eAAa,GAErBC,OAG/B,MAAM,IAAI7nC,MAAM,sDAUV,SAASq4B,EAA2BlgB,GAC1C,IAAIupB,EAAqB,KACzB,IAAK,IAAMtD,KAAiBjmB,EAAMshB,OAAQ,KAClC8E,EADkC,EAC3BD,EAAmBF,GADQ,OAE9B,MAAPsD,GAAenD,EAAMmD,KACxBA,EAAMnD,GAGR,OAAOmD,EAMD,SAASqG,EACfC,EACA/vB,EACAkgB,GACC,MACD,IAAKlgB,IAAc+vB,IAAmB7P,EACrC,OAAO,EAER,IAAM/V,EAAsBgW,EAAe4P,EAAgB/vB,EAAWkgB,GACtE,IAAK/V,EACJ,OAAO,EAGR,IAAM6V,EAAoB,UAAGI,EAAwBjW,UAA3B,QAAmD,EAE7E,OAAOyT,KAAK2I,IAAI,EAAGvG,M","file":"product-details.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, { useContext } from 'react';\r\nimport { UseProductDetailsState, UseProductDetailsActor } from './useProductDetails';\r\n\r\n/**\r\n * Context for product details\r\n */\r\nexport interface ProductDetailsContext {\r\n\tstate: UseProductDetailsState;\r\n\tactor: UseProductDetailsActor;\r\n}\r\n\r\nconst ProductDetailsContext = React.createContext(null);\r\n\r\nexport default ProductDetailsContext;\r\n\r\n/**\r\n * Custom hook for product details context\r\n */\r\nexport function useProductDetailsContext() {\r\n\tconst context = useContext(ProductDetailsContext);\r\n\r\n\tif (context === null) {\r\n\t\tthrow new Error('No ProductDetailsContext.Provider found.');\r\n\t}\r\n\r\n\treturn context;\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","/**\r\n * Organizations ui components enum\r\n */\r\nexport enum OrganizationUIComponents {\r\n\t//#region orders\r\n\tDefaultOrganizationOrderDetails = 'DefaultOrganizationOrderDetails',\r\n\t//#endregion\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","import React from 'react';\r\n\r\ninterface CardButtonProps extends React.HTMLProps {\r\n\tchildren: React.ReactNode;\r\n}\r\n\r\nexport default function CardButton(props: CardButtonProps) {\r\n\treturn (\r\n\t\t\r\n\t);\r\n}\r\n\r\nCardButton.defaultProps = {\r\n\tdisabled: false,\r\n};\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 { SimpleSelectionDto, ProductPricingLine, Availability } from 'features/commerce/product-details/types';\r\nimport { BaseDto } from 'shared/types';\r\nimport { SimpleDisplayPrice, Price } from '../../../../../../Roc.SharedClientApp/types/commerce/display-price';\r\nimport { DropdownOption } from '../../../../../../Roc.SharedClientApp/types/fields';\r\nimport { ModelStatus } from '../../../../../../Roc.SharedClientApp/types/model-status';\r\n\r\n/**\r\n * Represents a single addable to list product info\r\n */\r\nexport interface ItemToAddToList {\r\n\titemId: string;\r\n\tquantity: number;\r\n\tproductPricingLineId: string | null;\r\n}\r\n\r\n/**\r\n * Represents data needed for adding a single item to list\r\n */\r\nexport interface AddToListProps extends ItemToAddToList {\r\n\tshoppingListId: string;\r\n}\r\n\r\n/**\r\n * Represents data needed for adding multiple items to list\r\n */\r\nexport interface BulkAddToListProps {\r\n\tshoppingListId: string;\r\n\titems: ItemToAddToList[];\r\n}\r\n\r\n/**\r\n * List DTO interface for my account shopping lists\r\n */\r\nexport interface ShoppingListDto extends BaseDto {\r\n\tid: string;\r\n\tname: string;\r\n\tprivacy: PrivacyType;\r\n}\r\n\r\nexport interface ShoppingListResponse extends ShoppingListDto {\r\n\tproductId: string | null;\r\n\tquantity: number | null;\r\n}\r\n\r\n/**\r\n * Shopping List Privacy Type\r\n */\r\nexport enum PrivacyType {\r\n\tPrivate = 'Private',\r\n\tPublic = 'Public',\r\n\tOrganization = 'Organization',\r\n}\r\n\r\n/**\r\n * Privacy Type Dropdown Options\r\n */\r\nexport const PrivacyTypeOptions = Object.keys(PrivacyType).map(\r\n\t(key) => ({ value: key, text: PrivacyType[key] } as DropdownOption),\r\n);\r\n\r\nexport interface ShoppingListProductDto extends BaseDto {\r\n\tid: string;\r\n\r\n\tshoppingListId: string;\r\n\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\tselections?: SimpleSelectionDto[];\r\n\r\n\tpricingLine: ProductPricingLine;\r\n\r\n\tquantity: number;\r\n\r\n\tthumbnailUrl: string | null;\r\n\r\n\tbrandName: string | null;\r\n\r\n\taltText?: string;\r\n\r\n\tstatus?: ModelStatus;\r\n\r\n\tavailability?: Availability;\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\t//#region TapeCase\r\n\tminimumOrderQuantity: number | null;\r\n\t//#endregion\r\n}\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 Axios, { AxiosRequestConfig, AxiosError, AxiosResponse, CancelTokenSource } from 'axios';\r\nimport { useLoader } from './useLoader';\r\nimport { useRef, useEffect, useState } from 'react';\r\nimport AxiosHelper from 'services/AxiosHelper';\r\n\r\n/**\r\n * Use Axios Loader Params\r\n * @param axiosParams The parameters for the request being passed into axios. This includes the method, url, data, etc.\r\n * @param callback A function that is called after a form is posted. It'll include a parameter with the error if something went wrong.\r\n */\r\nexport interface UseAxiosLoaderParams {\r\n\taxiosParams: AxiosRequestConfig;\r\n\tactive?: boolean;\r\n\tcallback?: (error: Error | AxiosError | undefined) => any;\r\n\tcacheKey?: string;\r\n}\r\n\r\nconst cache = {};\r\n\r\n/**\r\n * A reusable hook that facilitates executing axios requests.\r\n */\r\nexport function useAxiosLoader({ axiosParams, active = true, callback, cacheKey }: UseAxiosLoaderParams) {\r\n\tif (axiosParams.method === undefined) {\r\n\t\taxiosParams.method = 'GET';\r\n\t}\r\n\r\n\tconst { ...rest } = axiosParams;\r\n\tconst { loading, setLoading, error, setError, response, setResponse } = useLoader>();\r\n\tconst [reloadTimes, setReloadTimes] = useState(0);\r\n\tconst cancelToken = useRef();\r\n\r\n\tconst reload = () => {\r\n\t\tsetReloadTimes(reloadTimes + 1);\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\t(async () => {\r\n\t\t\ttry {\r\n\t\t\t\tif (!active) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcancelToken.current = Axios.CancelToken.source();\r\n\r\n\t\t\t\tsetLoading(true);\r\n\t\t\t\tsetError(undefined);\r\n\r\n\t\t\t\tlet response: AxiosResponse;\r\n\r\n\t\t\t\tif (cacheKey && cache[cacheKey]) {\r\n\t\t\t\t\tresponse = cache[cacheKey];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresponse = await AxiosHelper(rest);\r\n\t\t\t\t\tif (cacheKey) {\r\n\t\t\t\t\t\tcache[cacheKey] = response;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsetResponse(response);\r\n\r\n\t\t\t\tif (callback !== undefined) {\r\n\t\t\t\t\treturn callback(undefined);\r\n\t\t\t\t}\r\n\t\t\t} catch (error) {\r\n\t\t\t\tif (Axios.isCancel(error)) {\r\n\t\t\t\t\t// if the component was unmounted, there's nothing to do\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsetError(error);\r\n\r\n\t\t\t\tif (callback !== undefined) {\r\n\t\t\t\t\treturn callback(error);\r\n\t\t\t\t}\r\n\t\t\t} finally {\r\n\t\t\t\tsetLoading(false);\r\n\t\t\t}\r\n\t\t})();\r\n\r\n\t\treturn () => {\r\n\t\t\t// cleanup\r\n\t\t\tif (cancelToken.current) {\r\n\t\t\t\tcancelToken.current.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}, [active, reloadTimes, ...Object.values(axiosParams)]); // this may be overkill? this means that if ANY axios params change, a new request will execute\r\n\r\n\treturn {\r\n\t\tloading,\r\n\t\terror,\r\n\t\tresponse,\r\n\t\tcancelToken: cancelToken.current,\r\n\t\treload,\r\n\t};\r\n}\r\n","import { useEffect, useState } from 'react';\r\nimport { SortByDirection } from 'shared-client/types/index';\r\nimport { BaseDto, PaginatedResult } from 'shared/types';\r\nimport { useAxiosLoader, UseAxiosLoaderParams } from './useAxiosLoader';\r\n\r\n/**\r\n * Use Axios Paginated Loader Params\r\n * @param axiosParams The parameters for the request being passed into axios. This includes the method, url, data, etc.\r\n * @param callback A function that is called after a form is posted. It'll include a parameter with the error if something went wrong.\r\n */\r\nexport interface UseAxiosPaginatedLoaderParams>\r\n\textends UseAxiosLoaderParams {\r\n\tquery?: string;\r\n\tinitialPageSize?: number;\r\n\tinitialSortByName?: string;\r\n\tinitialSortDirection?: SortByDirection;\r\n\tinitialResults?: T;\r\n\tcache?: boolean;\r\n}\r\n\r\n/**\r\n * The useAxiosPaginatedLoader hook result object\r\n */\r\nexport interface UseAxiosPaginatedLoaderResult> {\r\n\t/**\r\n\t * Current page number\r\n\t */\r\n\tpage: number;\r\n\t/**\r\n\t * Go to page and load results\r\n\t */\r\n\tgoToPage: (page: number) => void;\r\n\t/**\r\n\t * Go to next page and load results\r\n\t */\r\n\tgoToNextPage: () => void;\r\n\t/**\r\n\t * Go to previous page and load results\r\n\t */\r\n\tgoToPreviousPage: () => void;\r\n\t/**\r\n\t * Set sorting and load the results\r\n\t */\r\n\tsetSorting: (sortBy: string, direction: SortByDirection) => void;\r\n\t/**\r\n\t * Set page size and load the results\r\n\t */\r\n\tsetPageSize: (pageSize: number) => void;\r\n\t/**\r\n\t * Sets the custom query\r\n\t */\r\n\tsetQuery?: (query: string) => void;\r\n\t/**\r\n\t * Sets the sort by name\r\n\t */\r\n\tsetSortByName?: (sortBy: string) => void;\r\n\t/**\r\n\t * Sets the sort direction\r\n\t */\r\n\tsetSortDirection?: (direction: SortByDirection) => void;\r\n\t/**\r\n\t * Current sort by name\r\n\t */\r\n\tsortByName: string | undefined;\r\n\t/**\r\n\t * Current sort by direction\r\n\t */\r\n\tsortDirection: SortByDirection | undefined;\r\n\t/**\r\n\t * True if loading results\r\n\t */\r\n\tloading: boolean;\r\n\t/**\r\n\t * Error object if an error occurred while loading the results\r\n\t */\r\n\terror: Error | undefined;\r\n\t/**\r\n\t * Current paginated results object\r\n\t */\r\n\tresults: T | null | undefined;\r\n\r\n\t/**\r\n\t * Custom query string that includes\r\n\t * all the other parameters other than pagination and sorting ones\r\n\t */\r\n\tcustomQuery?: string | undefined;\r\n\r\n\t/**\r\n\t * If this function has been called another request will be triggered to get fresh results\r\n\t */\r\n\treload?: () => void;\r\n}\r\n\r\n/**\r\n * A reusable hook for pagination (data is loaded with axios).\r\n */\r\nexport function useAxiosPaginatedLoader>({\r\n\taxiosParams,\r\n\tactive = true,\r\n\tcallback,\r\n\tquery,\r\n\tinitialPageSize,\r\n\tinitialSortByName,\r\n\tinitialSortDirection,\r\n\tinitialResults,\r\n\tcache,\r\n}: UseAxiosPaginatedLoaderParams): UseAxiosPaginatedLoaderResult {\r\n\tconst [pageSize, setPageSizeState] = useState(initialPageSize);\r\n\tconst [pageNumber, setPageNumber] = useState(1);\r\n\tconst [sortByName, setSortByName] = useState(initialSortByName);\r\n\tconst [sortDirection, setSortDirection] = useState(initialSortDirection);\r\n\tconst [dataLoaderActive, setDataLoaderActive] = useState(initialResults === undefined);\r\n\tconst [customQuery, setCustomQuery] = useState(query);\r\n\r\n\tuseEffect(() => {\r\n\t\tsetDataLoaderActive(true);\r\n\t}, [pageNumber, sortByName, sortDirection, pageSize]);\r\n\r\n\tconst goToPage = (page: number) => {\r\n\t\tif (results && page > 0 && page <= results.pagination.totalPages) {\r\n\t\t\tsetPageNumber(page);\r\n\t\t}\r\n\t};\r\n\r\n\tconst goToNextPage = () => {\r\n\t\tif (results && pageNumber < results.pagination.totalPages) {\r\n\t\t\tsetPageNumber(pageNumber + 1);\r\n\t\t}\r\n\t};\r\n\r\n\tconst goToPreviousPage = () => {\r\n\t\tif (pageNumber === 1) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetPageNumber(pageNumber - 1);\r\n\t};\r\n\r\n\tconst setSorting = (sortBy: string, direction: SortByDirection) => {\r\n\t\tsetPageNumber(1);\r\n\t\tsetSortByName(sortBy);\r\n\t\tsetSortDirection(direction);\r\n\t};\r\n\r\n\tconst setQuery = (customQuery: string | undefined) => {\r\n\t\tsetPageNumber(1);\r\n\t\tsetCustomQuery(customQuery);\r\n\t};\r\n\r\n\tconst paginationQuery = `${pageSize ? `pagesize=${pageSize}` : ''}&pageNumber=${pageNumber}${\r\n\t\tsortByName ? `&sortBy=${sortByName}` : ''\r\n\t}${sortDirection ? `&sortDirection=${sortDirection}` : ''}`;\r\n\r\n\tconst url = `${axiosParams.url}${customQuery ? `?${customQuery}&${paginationQuery}` : `?${paginationQuery}`}`;\r\n\r\n\tconst { loading, error, response, reload } = useAxiosLoader({\r\n\t\taxiosParams: {\r\n\t\t\t...axiosParams,\r\n\t\t\turl: url,\r\n\t\t},\r\n\t\tactive: active && dataLoaderActive,\r\n\t\tcallback,\r\n\t\tcacheKey: cache ? url : undefined,\r\n\t});\r\n\r\n\tconst results = active && dataLoaderActive ? response && response.data : initialResults;\r\n\r\n\tconst setPageSize = (size: number) => {\r\n\t\tsetPageSizeState(size);\r\n\t};\r\n\r\n\treturn {\r\n\t\tpage: pageNumber,\r\n\t\tgoToPage,\r\n\t\tgoToNextPage,\r\n\t\tgoToPreviousPage,\r\n\t\tsetSorting,\r\n\t\tsetPageSize,\r\n\t\tsetQuery,\r\n\t\tsetSortByName,\r\n\t\tsetSortDirection,\r\n\t\treload,\r\n\t\tcustomQuery,\r\n\t\tsortByName,\r\n\t\tsortDirection,\r\n\t\tloading,\r\n\t\terror,\r\n\t\tresults,\r\n\t};\r\n}\r\n","import React from 'react';\r\nimport UpChevronSVG from 'shared/components/svg/LeftChevronSVG';\r\nimport { Localizer } from 'services/Localizer';\r\n\r\n/**\r\n * Represents one breadcrumb item in a list of breadcrumb items that defines the breadcrumb trail\r\n */\r\nexport interface BreadcrumbItem {\r\n\tlabel: string;\r\n\turl?: string;\r\n}\r\n\r\ninterface BreadcrumbProps {\r\n\tbreadcrumbPath?: BreadcrumbItem[];\r\n\tbackToPage?: BreadcrumbItem;\r\n\trenderPathLink?: (item: BreadcrumbItem) => React.ReactNode;\r\n}\r\n\r\n/**\r\n * Renders a set of links that represent breadcrumbs for the current location.]\r\n * It can optionally render a \"back to page\" link when this is set in sessionStorage.\r\n */\r\nexport default function Breadcrumbs(props: BreadcrumbProps) {\r\n\tconst {\r\n\t\tbreadcrumbPath,\r\n\t\tbackToPage,\r\n\t\trenderPathLink = (item) => (\r\n\t\t\t\r\n\t\t\t\t{item.label}\r\n\t\t\t\r\n\t\t),\r\n\t} = props;\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t{backToPage && backToPage.url && window.history.length > 2 ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t window.history.back()}\r\n\t\t\t\t\t\tclassName=\"roc-breadcrumbs-bar__back-link roc-btn-link\"\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\r\n\t\t\t\t\t\t{backToPage.label}\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) : null}\r\n\t\t\t{breadcrumbPath ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{Localizer('Home')}\r\n\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t{/* #region Tapecase */}/{/* #region Tapecase */}\r\n\t\t\t\t\t
\r\n\t\t\t\t\t{breadcrumbPath.map((entry, i) => (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{renderPathLink(entry)}\r\n\t\t\t\t\t\t\t{i + 1 < breadcrumbPath.length ? (\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t{/* #region Tapecase */}/{/* #region Tapecase */}\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))}\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, { useEffect, useState } from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { ProductPricingLine, ProductPricingLinesDetails } from './types';\r\n\r\ninterface ProductPricingLinesProps {\r\n\tdetails?: ProductPricingLinesDetails;\r\n\tonPricingLineChange: (productPricingLine: CheckableLine) => void;\r\n\tclassName?: string;\r\n}\r\n\r\nexport type CheckableLine =\r\n\t| {\r\n\t\t\t/**\r\n\t\t\t * This is always populated if the product is for sale.\r\n\t\t\t * Under certain circumstances, it may be undefined/null.\r\n\t\t\t * This isn't desirable and will probably change in the future.\r\n\t\t\t */\r\n\t\t\treadonly pricingLine: ProductPricingLine | undefined;\r\n\t\t\treadonly isInitialization: boolean;\r\n\t\t\treadonly checked: boolean;\r\n\t }\r\n\t| {\r\n\t\t\treadonly pricingLine: undefined;\r\n\t\t\treadonly isInitialization: true;\r\n\t\t\treadonly checked: false;\r\n\t };\r\n\r\nexport const NoPricingLine: CheckableLine = {\r\n\tpricingLine: undefined,\r\n\tisInitialization: true,\r\n\tchecked: false,\r\n};\r\n\r\ninterface Checkable {\r\n\tchecked: boolean;\r\n}\r\n\r\ntype CheckablePricingLine = ProductPricingLine & Checkable;\r\n\r\nconst getCheckedPricingLine = (pricingLines: CheckablePricingLine[]): CheckablePricingLine => {\r\n\tconst checkedUnit = pricingLines.find((uom) => uom.checked);\r\n\r\n\tif (!checkedUnit) {\r\n\t\tthrow new Error('Unable to determine the selected unit of measure');\r\n\t}\r\n\r\n\treturn checkedUnit;\r\n};\r\n\r\nconst getPricingLineDropdownText = (pricingLine: ProductPricingLine) => {\r\n\tconst result = `${pricingLine.label} (${pricingLine.quantity} in ${pricingLine.unitOfMeasure.displayName})`;\r\n\r\n\treturn result;\r\n};\r\n\r\n/**\r\n * Displays items required to Add To Cart\r\n */\r\nexport default function ProductPricingLines(props: ProductPricingLinesProps) {\r\n\tconst [pricingLines, setPricingLines] = useState([]);\r\n\r\n\tconst handlePricingLineChange = (newLine: CheckablePricingLine): void => {\r\n\t\tconst updatedPricingLines: CheckablePricingLine[] = pricingLines.map((line) => {\r\n\t\t\treturn {\r\n\t\t\t\t...line,\r\n\t\t\t\tchecked: line.id === newLine.id,\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\tsetPricingLines(updatedPricingLines);\r\n\r\n\t\tprops.onPricingLineChange({\r\n\t\t\tchecked: newLine.checked,\r\n\t\t\tisInitialization: false,\r\n\t\t\tpricingLine: newLine,\r\n\t\t});\r\n\t};\r\n\r\n\tconst { details, className } = props;\r\n\r\n\tuseEffect(() => {\r\n\t\tif (details?.selected == null || !Array.isArray(details.available) || details.available.length === 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst statefulPricingLines: CheckablePricingLine[] = details.available.map((line) => {\r\n\t\t\tconst statefulLine: CheckablePricingLine = {\r\n\t\t\t\t...line,\r\n\t\t\t\tchecked: line.id === details.selected!.id, // pre-select unit that was already loaded on the server-side\r\n\t\t\t};\r\n\t\t\treturn statefulLine;\r\n\t\t});\r\n\r\n\t\tsetPricingLines(statefulPricingLines);\r\n\t\tconst line = getCheckedPricingLine(statefulPricingLines);\r\n\t\tprops.onPricingLineChange({\r\n\t\t\tchecked: true,\r\n\t\t\tisInitialization: false,\r\n\t\t\tpricingLine: line,\r\n\t\t});\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [props.details]);\r\n\r\n\t/**\r\n\t * Event handler for blur and on change.\r\n\t *\r\n\t * @param {*} e\r\n\t */\r\n\tconst handleOnChangeAndBlur = (e) => {\r\n\t\tconst newValue = e.currentTarget.value;\r\n\t\tconst match = pricingLines.find((line) => line.id === newValue);\r\n\r\n\t\tif (match) {\r\n\t\t\tif (match.checked) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tmatch.checked = true;\r\n\t\t\thandlePricingLineChange(match);\r\n\t\t}\r\n\t};\r\n\r\n\tif (pricingLines.length <= 1) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst pricingLine = getCheckedPricingLine(pricingLines);\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","import type { Dialog } from '@reach/dialog';\r\nimport 'styles/node-modules/@reach/dialog/styles.css';\r\nimport classnames from 'classnames';\r\nimport React from 'react';\r\nimport { ModalSize } from './Modal';\r\nimport XSVG from './svg/XSVG';\r\nimport { Localizer } from 'services/Localizer';\r\nimport Spinner from './Spinner';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nconst LazyDialog = React.lazy(() =>\r\n\timport('@reach/dialog').then((module) => ({ default: module.Dialog })),\r\n);\r\n\r\ninterface AlertProps {\r\n\tisOpen: boolean;\r\n\trenderTitle: () => React.ReactNode;\r\n\tchildren: React.ReactNode;\r\n\tonConfirm: () => void;\r\n\tonCancel: () => void;\r\n\tsize?: ModalSize;\r\n\ttheme?: AlertTheme;\r\n\tcancelButtonText?: string;\r\n\tconfirmButtonText?: string;\r\n\trenderActions?: () => React.ReactNode;\r\n\theaderDivider?: boolean;\r\n\tsubTitle?: string;\r\n}\r\n\r\ntype AlertTheme = 'default' | 'info' | 'success' | 'warning' | 'danger';\r\n\r\ninterface ActionsRenderProps {\r\n\ttheme?: AlertTheme;\r\n\tcancelButtonText?: string;\r\n\tconfirmButtonText?: string;\r\n\tonConfirm: () => void;\r\n\tonCancel: () => void;\r\n}\r\n\r\n/**\r\n * Reusuable alert component with raised open state, takes size, theme, title and contents as props.\r\n *\r\n * @export\r\n * @param {AlertProps} props\r\n * @returns\r\n */\r\nexport default function Alert(props: AlertProps) {\r\n\tconst {\r\n\t\tisOpen,\r\n\t\tsize = 'md',\r\n\t\ttheme = 'default',\r\n\t\tonConfirm,\r\n\t\tonCancel,\r\n\t\trenderTitle,\r\n\t\tcancelButtonText = Localizer('Cancel'),\r\n\t\tconfirmButtonText = Localizer('Confirm'),\r\n\t\trenderActions = (renderProps: ActionsRenderProps) => (\r\n\t\t\t<>\r\n\t\t\t\t\r\n\t\t\t\t\t{renderProps.cancelButtonText}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{renderProps.confirmButtonText}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t),\r\n\t\theaderDivider = false,\r\n\t\tsubTitle,\r\n\t\tchildren,\r\n\t} = props;\r\n\r\n\treturn (\r\n\t\t}>\r\n\t\t\t onCancel()}\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\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
\r\n\t\t\t\t\t\t\t onCancel()}\r\n\t\t\t\t\t\t\t\ttype=\"button\"\r\n\t\t\t\t\t\t\t\tdata-testid=\"roc-modal-close-btn\"\r\n\t\t\t\t\t\t\t>\r\n\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\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\r\n\t\t\t\t\t{subTitle ?

{subTitle}

: null}\r\n\t\t\t\t
\r\n\t\t\t\t
{children}
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t{renderActions({ theme, cancelButtonText, confirmButtonText, onCancel, onConfirm })}\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 { 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","var map = {\n\t\"./DefaultOrganizationOrderDetails\": [\n\t\t211,\n\t\t9,\n\t\t11,\n\t\t19\n\t],\n\t\"./DefaultOrganizationOrderDetails.tsx\": [\n\t\t211,\n\t\t9,\n\t\t11,\n\t\t19\n\t],\n\t\"./OrganizationOrderListing\": [\n\t\t208,\n\t\t9,\n\t\t21\n\t],\n\t\"./OrganizationOrderListing.tsx\": [\n\t\t208,\n\t\t9,\n\t\t21\n\t],\n\t\"./OrganizationOrders\": [\n\t\t143,\n\t\t9,\n\t\t3,\n\t\t4,\n\t\t5,\n\t\t10,\n\t\t15\n\t],\n\t\"./OrganizationOrders.tsx\": [\n\t\t143,\n\t\t9,\n\t\t3,\n\t\t4,\n\t\t5,\n\t\t10,\n\t\t15\n\t],\n\t\"./RocOrganizationOrderDetails\": [\n\t\t210,\n\t\t9,\n\t\t11\n\t],\n\t\"./RocOrganizationOrderDetails.tsx\": [\n\t\t210,\n\t\t9,\n\t\t11\n\t],\n\t\"./types\": [\n\t\t212,\n\t\t7,\n\t\t22\n\t],\n\t\"./types.ts\": [\n\t\t212,\n\t\t7,\n\t\t22\n\t],\n\t\"./useOrganizationOrderDetails\": [\n\t\t209,\n\t\t9,\n\t\t20\n\t],\n\t\"./useOrganizationOrderDetails.ts\": [\n\t\t209,\n\t\t9,\n\t\t20\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\treturn Promise.resolve().then(function() {\n\t\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\t\te.code = 'MODULE_NOT_FOUND';\n\t\t\tthrow e;\n\t\t});\n\t}\n\n\tvar ids = map[req], id = ids[0];\n\treturn Promise.all(ids.slice(2).map(__webpack_require__.e)).then(function() {\n\t\treturn __webpack_require__.t(id, ids[1])\n\t});\n}\nwebpackAsyncContext.keys = function webpackAsyncContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackAsyncContext.id = 172;\nmodule.exports = webpackAsyncContext;","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\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\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\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\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
\r\n\t\t
\r\n\t);\r\n\r\n\tconst mainImageContent = (\r\n\t\t
\r\n\t\t\t{mainAsset.assetType !== AssetType.YouTube ? (\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 setIsImageSliderModalOpen(true)}\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\t\t{Localizer('ViewLarger')}\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\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<>\r\n\t\t\t\t{\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t\tsetIsImageSliderModalOpen(false);\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{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","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 { 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 {\r\n\tHasNoSalePrice,\r\n\tPrice,\r\n\tSimpleDisplayPrice,\r\n} from '../../../../../../Roc.SharedClientApp/types/commerce/display-price';\r\n\r\n/**\r\n * The pricing row for pricing table\r\n */\r\nexport interface CalculatorPricingTableRow {\r\n\t/**\r\n\t * The starting quantity for this pricing row/range\r\n\t */\r\n\tquantity: number;\r\n\t/**\r\n\t * The price applicable to this pricing row/range\r\n\t */\r\n\tprice: SimpleDisplayPrice & HasNoSalePrice;\r\n}\r\n\r\n/**\r\n * The calculator quote model\r\n */\r\nexport interface CalculatorQuote {\r\n\t/**\r\n\t * The product name\r\n\t */\r\n\tproductName: string | null;\r\n\t/**\r\n\t * The product number\r\n\t */\r\n\tproductNumber: string;\r\n\t/**\r\n\t * The calculator name\r\n\t */\r\n\tcalculatorName: string;\r\n\t/**\r\n\t * The customer name\r\n\t */\r\n\tcustomerName: string;\r\n\t/**\r\n\t * The size requested by the customer\r\n\t */\r\n\tsizeRequested: string;\r\n\t/**\r\n\t * The lead time\r\n\t */\r\n\tleadTime: string;\r\n\t/**\r\n\t * The minimum order quantity value for requested product\r\n\t */\r\n\tmoq: number;\r\n\t/**\r\n\t * The pricing table (quantity ranges)\r\n\t */\r\n\tpricingTable: CalculatorPricingTableRow[];\r\n\t/**\r\n\t * The message about validity of this quote\r\n\t */\r\n\tvalidFromLocalizedMessage: string;\r\n\t/**\r\n\t * The URL to the product image\r\n\t */\r\n\tproductImageUrl: string;\r\n\t/**\r\n\t * The id of this quote\r\n\t */\r\n\tid: string;\r\n\t/**\r\n\t * The number of this quote\r\n\t */\r\n\tquoteNo: string;\r\n\t/**\r\n\t * The flag indicating whether the quoted product is stock item or non-stock (made to order / cut to order)\r\n\t */\r\n\tisStockProduct: boolean;\r\n\r\n\t/**\r\n\t * The type of calculator that has been used to submit the quote\r\n\t */\r\n\tcalculatorType: CalculatorType;\r\n}\r\n\r\nexport enum CalculatorType {\r\n\tAbrasiveBelts = 'AbrasiveBelts',\r\n\tCustomCutTapeShape = 'CustomCutTapeShape',\r\n\tCustomShortLength = 'CustomShortLength',\r\n\tCustomWidthRoll = 'CustomWidthRoll',\r\n}\r\n\r\nexport interface CalculatorQuoteDetails {\r\n\tnotes: string;\r\n\temailAddresses: string;\r\n}\r\n\r\nexport interface AdditionalUrls {\r\n\tproductUrl: string | null;\r\n\tsafetyDataSheetUrl: string | null;\r\n\tregulatoryDataSheetUrl: string | null;\r\n\tsafetyInsertsUrl: string | null;\r\n}\r\n\r\n/**\r\n * The response model for quote submission\r\n */\r\nexport interface GetQuoteResponse {\r\n\t/**\r\n\t * If quote has been successfully submitted then this is the quote id, otherwise null\r\n\t */\r\n\tquoteId: string | null;\r\n\t/**\r\n\t * The flag indicating whether quote has been successfully submitted or not\r\n\t */\r\n\tsubmitted: boolean;\r\n\t/**\r\n\t * If the selected filters are matching one of ready to buy products then this will be URL of that product and user should be redirected there\r\n\t */\r\n\tredirectUrl: string | null;\r\n\t/**\r\n\t * If something has gone wrong during quote submission then this is be the error message for the custmer, otherwise null\r\n\t */\r\n\terrorMessage: string | null;\r\n}\r\n","import React, { useEffect, useRef, useState } from 'react';\r\nimport { Pagination as PaginationType } from 'shared/types';\r\nimport LeftChevronSVG from './svg/LeftChevronSVG';\r\nimport RightChevronSVG from './svg/RightChevronSVG';\r\nimport { Localizer } from 'services/Localizer';\r\nimport classnames from 'classnames';\r\nimport { createGuid } from './hawksearch/helpers/Cookies';\r\n\r\ninterface PaginationProps {\r\n\tpagination: PaginationType;\r\n\tgoToNextPage: () => void;\r\n\tgoToPreviousPage: () => void;\r\n\tgoToPage: (page: number) => void;\r\n\tflush?: boolean;\r\n}\r\n\r\nexport default function Pagination(props: PaginationProps) {\r\n\tconst {\r\n\t\tflush,\r\n\t\tpagination: { totalPages, hasNextPage, hasPreviousPage, pageNumber },\r\n\t\tgoToNextPage,\r\n\t\tgoToPage,\r\n\t\tgoToPreviousPage,\r\n\t} = props;\r\n\r\n\tconst [uniqueId] = useState(`pagination-input-${createGuid()}`);\r\n\r\n\tconst [localPageNumber, setLocalPageNumber] = useState(undefined);\r\n\r\n\tconst timerRef = useRef(null);\r\n\r\n\t// make sure that the local page number state override is cleared out whenever the pagination page number\r\n\t// changes. this happens whenever a server request is completed and the lifted pagination state is updated\r\n\tuseEffect(() => {\r\n\t\tsetLocalPageNumber(undefined);\r\n\t}, [pageNumber]);\r\n\r\n\tfunction attemptGoToPage(newPageNumber: number) {\r\n\t\tif (newPageNumber < 1 || newPageNumber > totalPages) {\r\n\t\t\t// an invalid page number was entered, so clear out the user entry and do nothing.\r\n\t\t\tsetLocalPageNumber(undefined);\r\n\t\t} else {\r\n\t\t\tgoToPage(newPageNumber);\r\n\t\t}\r\n\t}\r\n\r\n\t// debounce the pager updates\r\n\tuseEffect(() => {\r\n\t\tif (timerRef.current) {\r\n\t\t\tclearTimeout(timerRef.current);\r\n\t\t}\r\n\r\n\t\ttimerRef.current = setTimeout(() => {\r\n\t\t\tif (localPageNumber) {\r\n\t\t\t\tattemptGoToPage(parseInt(localPageNumber));\r\n\t\t\t}\r\n\t\t}, 500);\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [localPageNumber]);\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\r\n\r\n\t\t\t\r\n\r\n\t\t\t{Localizer('OfTotalPages', totalPages.toLocaleString())}\r\n\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 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 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 'intersection-observer';\r\n\r\nif (document.readyState !== 'loading') {\r\n\tlazyLoadImages();\r\n} else {\r\n\tdocument.addEventListener('DOMContentLoaded', function () {\r\n\t\tlazyLoadImages();\r\n\t});\r\n}\r\n\r\n/**\r\n * Initializes lazy loading for image assets.\r\n * Example usage:\r\n * \"\"\r\n */\r\nexport function lazyLoadImages() {\r\n\t// Get our lazy-loaded images\r\n\tconst lazyImages = [].slice.call(document.querySelectorAll('.roc-lazy-image'));\r\n\r\n\tconst defaultDelay = 10;\r\n\t// Create new observer object\r\n\tconst lazyImageObserver = new IntersectionObserver(function (entries) {\r\n\t\t// Loop through IntersectionObserverEntry objects\r\n\t\tentries.forEach(function (entry) {\r\n\t\t\t// Do these if the target intersects with the root\r\n\t\t\tif (entry.isIntersecting) {\r\n\t\t\t\tconst lazyImage = entry.target as HTMLImageElement;\r\n\r\n\t\t\t\tif (lazyImage.dataset.src) {\r\n\t\t\t\t\tlazyImage.src = lazyImage.dataset.src;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst attributeDelay = Number(lazyImage.getAttribute('data-roc-lazy-delay')) || defaultDelay;\r\n\t\t\t\tlazyImage.classList.remove('roc-lazy-image--inactive');\r\n\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tlazyImage.classList.add('roc-lazy-image--loaded');\r\n\t\t\t\t\tlazyImageObserver.unobserve(lazyImage);\r\n\t\t\t\t}, attributeDelay);\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\r\n\t// Loop through and observe each image\r\n\tlazyImages.forEach(function (lazyImage) {\r\n\t\tlazyImageObserver.observe(lazyImage);\r\n\t});\r\n}\r\n\r\ninterface LazyElementsArgs {\r\n\t/**\r\n\t * The elements to observe\r\n\t */\r\n\telements: HTMLElement[];\r\n\r\n\t/**\r\n\t * The callback function called when the intersection observer fires.\r\n\t */\r\n\tcallback: (isIntersecting: boolean) => void;\r\n\r\n\t/**\r\n\t * The amount of time to delay before calling the callback. Defaults to 0.\r\n\t */\r\n\tdelay?: number;\r\n\r\n\t/**\r\n\t * Stop listening to changes once the element has been in the viewport.\r\n\t */\r\n\tstopAfterIntersecting?: boolean;\r\n}\r\n\r\n/**\r\n * Helper to receive a callback when an element becomes visible in a viewport, or when it leaves the viewport.\r\n * This is useful if you need to do a vanilla JS implementation (without React).\r\n */\r\nexport function lazyElements({ elements, callback, delay = 0, stopAfterIntersecting = true }: LazyElementsArgs) {\r\n\tconst lazyElementObserver = new IntersectionObserver(function (entries) {\r\n\t\tentries.forEach((entry) => {\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tcallback(entry.isIntersecting);\r\n\t\t\t}, delay);\r\n\r\n\t\t\tif (stopAfterIntersecting && entry.isIntersecting) {\r\n\t\t\t\tlazyElementObserver.unobserve(entry.target);\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\r\n\telements.forEach((lazyElement) => {\r\n\t\tlazyElementObserver.observe(lazyElement);\r\n\t});\r\n}\r\n","import { useState } from 'react';\r\nimport usePartialDataLoader from 'shared/data/usePartialDataLoader';\r\nimport { CheckableLine, NoPricingLine } from './ProductPricingLines';\r\nimport {\r\n\tAvailability,\r\n\tgetInitialProductDetailsState,\r\n\tProductDetailsState,\r\n\tProductPartialDataLoaderOptions,\r\n\tProductPricingLine,\r\n\tProductType,\r\n\tReviewSummaryDto,\r\n\tTabViewChunk,\r\n} from './types';\r\n\r\nexport interface UseProductDetails {\r\n\tstate: UseProductDetailsState;\r\n\tactor: UseProductDetailsActor;\r\n}\r\n\r\n/**\r\n * Use Product Details Context State\r\n */\r\nexport interface UseProductDetailsState {\r\n\tloggedInUserFirstName: string;\r\n\tproductId: string;\r\n\tgroupId: string;\r\n\treviewsSummary: ReviewSummaryDto;\r\n\tsimpleProductLoading: boolean;\r\n\thasError: boolean;\r\n\tproductDetails: ProductDetailsState;\r\n\tproductStateOverride: Partial | null;\r\n\tuserIsSignedIn: boolean;\r\n\tproductQuantity: number | null;\r\n\tselectedPricingLine: CheckableLine;\r\n}\r\n\r\n/**\r\n * Use Product Details Context Actor\r\n */\r\nexport interface UseProductDetailsActor {\r\n\tsetLoggedInUserFirstName: (name: string) => void;\r\n\tsetSimpleProductLoading: (prop: boolean) => void;\r\n\tsetProductStateOverride: (data: Partial | null) => void;\r\n\tisLoadingAny: (keys: Array) => boolean;\r\n\tsetHasError: (hasError: boolean) => void;\r\n\tsetUserIsSignedIn: (isSignIn: boolean) => void;\r\n\tsetProductQuantity: (qty: number | null) => void;\r\n\tsetSelectedPricingLine: (CheckableLine: CheckableLine) => void;\r\n\tisPricingLineUnavailable: () => boolean;\r\n\tisPurchaseable: (availability?: Availability | null, pricingLine?: ProductPricingLine) => boolean;\r\n}\r\n\r\nexport interface UseProductDetailsProps {\r\n\tloaderOptions: ProductPartialDataLoaderOptions;\r\n}\r\n\r\n/**\r\n * Reusable hook to access product detail related endpoints on the server, as well as helping manage\r\n * product detail information.\r\n */\r\nexport default function useProductDetails(props: UseProductDetailsProps): UseProductDetails {\r\n\tconst { loaderOptions } = props;\r\n\r\n\t// to indicate that a simple product details are being loaded after selections are made\r\n\tconst [simpleProductLoading, setSimpleProductLoading] = useState(false);\r\n\tconst [loggedInUserFirstName, setLoggedInUserFirstName] = useState('');\r\n\r\n\t// defines state that can be used to override the existing state defined by initial state + partial loader\r\n\t// this is primarily used for group products, where a simple product takes over after a selection is made\r\n\tconst [productStateOverride, setInternalProductStateOverride] = useState | null>(null);\r\n\r\n\tconst [userIsSignedIn, setUserIsSignedIn] = useState(false);\r\n\tconst [productQuantity, setProductQuantity] = useState(1);\r\n\r\n\tconst [selectedPricingLine, setSelectedPricingLine] = useState(NoPricingLine);\r\n\r\n\tconst setProductStateOverride = (data: Partial | null) => {\r\n\t\tif (data == null) {\r\n\t\t\tsetInternalProductStateOverride(null);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst originalState = getInitialProductDetailsState();\r\n\r\n\t\tconst foldTabs = () => {\r\n\t\t\tconst newTabs = data.tabs != null ? [...data.tabs] : [];\r\n\t\t\tconst newTabsMap = newTabs.reduce(function (map: { [index: string]: TabViewChunk }, obj) {\r\n\t\t\t\tmap[obj.tab.id] = obj;\r\n\t\t\t\treturn map;\r\n\t\t\t}, {});\r\n\r\n\t\t\tfor (const oldTab of originalState?.tabs ?? []) {\r\n\t\t\t\tif (!newTabsMap[oldTab.tab.id]) {\r\n\t\t\t\t\tnewTabs.push(oldTab);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn newTabs;\r\n\t\t};\r\n\r\n\t\tconst fixedNewState: Partial = {\r\n\t\t\t...data,\r\n\t\t\ttabs: foldTabs(),\r\n\t\t};\r\n\r\n\t\tsetInternalProductStateOverride(fixedNewState);\r\n\t};\r\n\r\n\t// this will grab the details from the server for you, and get you the state necessary\r\n\t// normally, we would just have all of the missing fields here, but sometimes, if we have multiple\r\n\t// integration calls, it may be good to be able to split this up. in this case, this is an example\r\n\t// of splitting up pricing/images and availability into separate calls.\r\n\t// this would apply if you have user-specific pricing, and the availability service is\r\n\t// really slow. you'd want to show pricing right away, and take time before showing availability\r\n\tconst productData = usePartialDataLoader({\r\n\t\tkeys: [\r\n\t\t\t'summary',\r\n\t\t\t'displayPricing',\r\n\t\t\t'pricingLines',\r\n\t\t\t'assets',\r\n\t\t\t'availability',\r\n\t\t\t//#region TapeCase\r\n\t\t\t'brand',\r\n\t\t\t//#endregion\r\n\t\t\t'tabs',\r\n\t\t\t//#region TapeCase\r\n\t\t\t//'selections',\r\n\t\t\t//#endregion\r\n\t\t\t'relatedProducts',\r\n\t\t\t//#region TapeCase\r\n\t\t\t//'reviewsSummary',\r\n\t\t\t//#endregion\r\n\t\t\t'breadcrumbPath',\r\n\t\t\t//#region TapeCase\r\n\t\t\t//'reviewsSummary',\r\n\t\t\t'availableFormatShape',\r\n\t\t\t'availableCalculators',\r\n\t\t\t//#endregion\r\n\t\t],\r\n\t\t...loaderOptions,\r\n\t});\r\n\r\n\tconst { isLoadingAny, hasError, setHasError } = productData;\r\n\r\n\tconst productDetails = { ...productData.partialData, ...productStateOverride };\r\n\r\n\tconst groupId =\r\n\t\tproductDetails.summary.type === ProductType.Group\r\n\t\t\t? productDetails.id\r\n\t\t\t: productDetails.summary.productGroupId || '';\r\n\r\n\t/** Returns true if the selected pricing line is unavailable and can't be purchased. */\r\n\tconst isPricingLineUnavailable = () =>\r\n\t\tselectedPricingLine.pricingLine == null || selectedPricingLine.pricingLine?.unavailabilityReason != null;\r\n\r\n\tconst isPurchaseable = (availability?: Availability | null, pricingLine?: ProductPricingLine) => {\r\n\t\treturn availability?.outOfStock != true && pricingLine != null && pricingLine?.unavailabilityReason == null;\r\n\t};\r\n\r\n\treturn {\r\n\t\tstate: {\r\n\t\t\tloggedInUserFirstName,\r\n\t\t\tproductId: productDetails.id,\r\n\t\t\tgroupId,\r\n\t\t\treviewsSummary: productDetails.reviewsSummary,\r\n\t\t\tsimpleProductLoading,\r\n\t\t\tproductDetails,\r\n\t\t\tproductStateOverride,\r\n\t\t\thasError,\r\n\t\t\tuserIsSignedIn,\r\n\t\t\tproductQuantity,\r\n\t\t\tselectedPricingLine,\r\n\t\t},\r\n\t\tactor: {\r\n\t\t\tsetLoggedInUserFirstName,\r\n\t\t\tsetSimpleProductLoading,\r\n\t\t\tisLoadingAny,\r\n\t\t\tsetProductStateOverride,\r\n\t\t\tsetHasError,\r\n\t\t\tsetUserIsSignedIn,\r\n\t\t\tsetProductQuantity,\r\n\t\t\tsetSelectedPricingLine,\r\n\t\t\tisPricingLineUnavailable,\r\n\t\t\tisPurchaseable,\r\n\t\t},\r\n\t};\r\n}\r\n","import { useEffect, useState } from 'react';\r\nimport { BasePartialDataOptions, BasePartialDetailsState, AvailableKeys, AdditionalParams } from 'shared/types';\r\n\r\ntype InitialStateLoader = () => unknown;\r\ntype PartialDataLoaderFn = (options: BasePartialDataOptions) => Promise>;\r\n\r\nexport interface PartialDataLoaderOptions {\r\n\tkeys: AvailableKeys;\r\n\tinitialState: unknown | InitialStateLoader;\r\n\tdataLoaderFn: PartialDataLoaderFn;\r\n}\r\n\r\nexport interface PartialDataLoaderState {\r\n\tpartialData: T;\r\n\tisLoading: boolean;\r\n}\r\n\r\nexport default function usePartialDataLoader(options: PartialDataLoaderOptions) {\r\n\tconst initialState = typeof options.initialState === 'function' ? options.initialState() : options.initialState;\r\n\tconst [partialData, setPartialData] = useState(initialState);\r\n\tconst [isLoading, setIsLoading] = useState(true);\r\n\tconst [hasError, setHasError] = useState(false);\r\n\r\n\t/**\r\n\t * Helper function to determine if the given chunk of partial (by key) data has been already loaded or if it is still loading.\r\n\t */\r\n\tfunction isKeyLoading(key: keyof T): boolean {\r\n\t\tif (partialData === undefined || partialData === null) {\r\n\t\t\treturn isLoading;\r\n\t\t}\r\n\r\n\t\tif (Object.keys(partialData).includes(key.toString()) && partialData[key] !== undefined) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn isLoading;\r\n\t}\r\n\r\n\t// we'd then make a request to the server to get the data for the missing keys.\r\n\tuseEffect(() => {\r\n\t\tconst providedKeys = Object.keys(partialData);\r\n\t\tconst requiredKeys = options.keys.map((literal) => literal.valueOf().toString()) as Array;\r\n\t\tconst missingKeys = requiredKeys.filter((value) => providedKeys.indexOf(value.valueOf().toString()) === -1);\r\n\t\tloadData(partialData.id, missingKeys, partialData.additionalParams);\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, []);\r\n\r\n\tasync function loadData(id: string, missingKeys: Array, additionalParams: AdditionalParams | undefined) {\r\n\t\ttry {\r\n\t\t\t// await timeout(1000);\r\n\t\t\tconsole.debug('Fetching missing data:', missingKeys);\r\n\t\t\tconst missingData = await options.dataLoaderFn({ id, missingKeys, additionalParams });\r\n\r\n\t\t\tconsole.debug('Missing data loaded:', missingData);\r\n\t\t\tsetPartialData({\r\n\t\t\t\t...partialData,\r\n\t\t\t\t...missingData,\r\n\t\t\t});\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error('Unable to fetch remaining data.');\r\n\t\t\tsetHasError(true);\r\n\t\t} finally {\r\n\t\t\tsetIsLoading(false);\r\n\t\t}\r\n\t}\r\n\r\n\treturn {\r\n\t\tpartialData,\r\n\t\tisLoading: isKeyLoading,\r\n\t\tisLoadingAny: (keys: Array = []) => keys.some((key) => isKeyLoading(key)),\r\n\t\thasError,\r\n\t\tsetHasError,\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","/* 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 { useState } from 'react';\r\nimport Axios, { CancelTokenSource, AxiosError } from 'axios';\r\nimport AxiosHelper from 'services/AxiosHelper';\r\nimport { FormValidationPromise } from 'shared/types';\r\nimport { handleAxiosErrorWithValidation } from 'shared/util/Misc';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { MY_ACCOUNT_SHOPPING_LISTS_URL } from 'features/my-account/routes.commerce';\r\nimport { AddToListProps, BulkAddToListProps, ShoppingListDto } from './types';\r\nimport { AddToListResponse, BulkAddToListResponse } from 'services/UserData.Commerce';\r\n\r\nexport interface ShoppingListsState {\r\n\tisSaving: boolean;\r\n\tshoppingListBeingEdited: ShoppingListDto | null;\r\n\tshoppingList: ShoppingListDto | null;\r\n\terror: Error | AxiosError | null;\r\n\terrorMessage: string | null;\r\n\tisDeleting: boolean;\r\n}\r\n\r\nexport interface ShoppingListsActor {\r\n\tbeginCreateShoppingList: () => void;\r\n\tbeginEditShoppingList: (shopingList: ShoppingListDto) => void;\r\n\tsaveShoppingList: (formValues: ShoppingListDto) => FormValidationPromise;\r\n\tstopEditingShoppingList: () => void;\r\n\taddProductToList: (props: AddToListProps) => Promise;\r\n\tbulkAddProductToList: (props: BulkAddToListProps) => Promise;\r\n\tremoveShoppingList: (shoppingList: ShoppingListDto) => Promise;\r\n}\r\n\r\nexport interface UseShoppingLists {\r\n\tstate: ShoppingListsState;\r\n\tactor: ShoppingListsActor;\r\n}\r\n\r\nexport function useShoppingLists(): UseShoppingLists {\r\n\tconst [shoppingListBeingEdited, setShoppingListBeingEdited] = useState(null);\r\n\tconst [error, setError] = useState(null);\r\n\tconst [errorMessage, setErrorMessage] = useState(null);\r\n\tconst [isSaving, setIsSaving] = useState(false);\r\n\tconst [shoppingList, setShoppingList] = useState(null);\r\n\tconst [isDeleting, setIsDeleting] = useState(false);\r\n\r\n\t/**\r\n\t * Begin creating an shopping list\r\n\t */\r\n\tconst beginEditShoppingList = (shoppingList: ShoppingListDto) => {\r\n\t\tsetShoppingListBeingEdited(shoppingList);\r\n\t};\r\n\r\n\tconst beginCreateShoppingList = () => {\r\n\t\tsetShoppingListBeingEdited({} as ShoppingListDto);\r\n\t};\r\n\r\n\tconst stopEditingShoppingList = () => {\r\n\t\tsetError(null);\r\n\t\tsetShoppingListBeingEdited(null);\r\n\t};\r\n\r\n\t/**\r\n\t * Creates an shopping list associated to the current user on the server\r\n\t */\r\n\tconst saveShoppingList = async (formValues: ShoppingListDto): FormValidationPromise => {\r\n\t\t// sanity check\r\n\t\tif (!shoppingListBeingEdited) {\r\n\t\t\treturn Promise.resolve();\r\n\t\t}\r\n\r\n\t\tsetIsSaving(true);\r\n\r\n\t\tconst requestToken: CancelTokenSource = Axios.CancelToken.source();\r\n\r\n\t\tconst shoppingList: ShoppingListDto = {\r\n\t\t\t...formValues,\r\n\t\t};\r\n\r\n\t\ttry {\r\n\t\t\tconst response = await AxiosHelper.post(\r\n\t\t\t\t`/ajax${MY_ACCOUNT_SHOPPING_LISTS_URL}/edit`,\r\n\t\t\t\tshoppingList,\r\n\t\t\t\t{\r\n\t\t\t\t\tcancelToken: requestToken.token,\r\n\t\t\t\t},\r\n\t\t\t);\r\n\r\n\t\t\tsetShoppingListBeingEdited(null);\r\n\t\t\tsetShoppingList(response.data);\r\n\t\t\tsetError(null);\r\n\t\t} catch (error) {\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\tsetError(error);\r\n\r\n\t\t\treturn handleAxiosErrorWithValidation(error, Localizer('SaveErrorMessage'));\r\n\t\t} finally {\r\n\t\t\tsetIsSaving(false);\r\n\t\t}\r\n\t};\r\n\r\n\tconst addProductToList = async (props: AddToListProps) => {\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}/products/${props.itemId}`,\r\n\t\t\t\t{\r\n\t\t\t\t\tquantity: props.quantity,\r\n\t\t\t\t\tproductPricingLineId: props.productPricingLineId,\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\tsetError(error);\r\n\r\n\t\t\tconsole.warn('Error when adding product to list', 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} 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\tconst bulkAddProductToList = async (props: BulkAddToListProps) => {\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}`,\r\n\t\t\t\t{\r\n\t\t\t\t\titems: props.items,\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\tsetError(error);\r\n\r\n\t\t\tconsole.warn('Error when adding products to list', 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} 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\tconst removeShoppingList = async (shoppingList: ShoppingListDto): Promise => {\r\n\t\tconst requestToken: CancelTokenSource = Axios.CancelToken.source();\r\n\r\n\t\tsetIsDeleting(true);\r\n\t\ttry {\r\n\t\t\tconst response = await AxiosHelper.delete(`/ajax/shopping-lists/${shoppingList.id}`, {\r\n\t\t\t\tcancelToken: requestToken.token,\r\n\t\t\t});\r\n\r\n\t\t\tif (response) {\r\n\t\t\t\tdocument.location.href = MY_ACCOUNT_SHOPPING_LISTS_URL;\r\n\t\t\t}\r\n\t\t} catch (error) {\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\tsetError(error);\r\n\t\t\tconsole.error('An error occurred while deleting.', error);\r\n\t\t} finally {\r\n\t\t\tsetIsDeleting(false);\r\n\t\t}\r\n\t};\r\n\r\n\treturn {\r\n\t\tstate: {\r\n\t\t\tisSaving,\r\n\t\t\terror: error,\r\n\t\t\tshoppingListBeingEdited,\r\n\t\t\tshoppingList: shoppingList,\r\n\t\t\terrorMessage: errorMessage,\r\n\t\t\tisDeleting,\r\n\t\t},\r\n\t\tactor: {\r\n\t\t\tbeginCreateShoppingList,\r\n\t\t\tbeginEditShoppingList,\r\n\t\t\tsaveShoppingList,\r\n\t\t\tstopEditingShoppingList,\r\n\t\t\taddProductToList,\r\n\t\t\tbulkAddProductToList,\r\n\t\t\tremoveShoppingList,\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 { Localizer } from 'services/Localizer';\r\nimport { DropdownField, TextBoxField } from 'shared/edit/fields';\r\nimport { PrivacyTypeOptions } from './types';\r\n\r\nexport function ShoppingListEditItemFields() {\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\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 { Localizer } from 'services/Localizer';\r\nimport Alert from 'shared/components/Alert';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport { ShoppingListEditItemFields } from './ShoppingListEditItemFields';\r\nimport { ShoppingListEditItemBodyProps } from './ShoppingListEditItem';\r\n\r\nexport default function ShoppingListEditItemBody(props: ShoppingListEditItemBodyProps) {\r\n\tconst [isAlertOpen, setIsAlertOpen] = useState(false);\r\n\r\n\tconst {\r\n\t\tdisplayCancelButton,\r\n\t\tdisplaySaveButton,\r\n\t\tstopEditingShoppingList,\r\n\t\tonRemoveShoppingList,\r\n\t\tisSaving,\r\n\t\tdirty,\r\n\t\tdirtySaveButtonText,\r\n\t\tsaveButtonText,\r\n\t\tshoppingListBeingEdited,\r\n\t\tisDeleting,\r\n\t} = props;\r\n\treturn (\r\n\t\t<>\r\n\t\t\t

{Localizer('RequiredFields')}

\r\n\r\n\t\t\t\r\n\r\n\t\t\t
\r\n\t\t\t\t{onRemoveShoppingList ? (\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\tsetIsAlertOpen(true);\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\tdata-testid=\"shopping-list-delete-button\"\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t{isDeleting && }\r\n\t\t\t\t\t\t\t\t{Localizer('Delete')}\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 Localizer('DeleteShoppingList')}\r\n\t\t\t\t\t\t\tonCancel={() => setIsAlertOpen(false)}\r\n\t\t\t\t\t\t\tonConfirm={() => {\r\n\t\t\t\t\t\t\t\tsetIsAlertOpen(false);\r\n\r\n\t\t\t\t\t\t\t\tonRemoveShoppingList(shoppingListBeingEdited);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\ttheme=\"danger\"\r\n\t\t\t\t\t\t\tconfirmButtonText={Localizer('Delete')}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{Localizer('DeleteShoppingListConfirmationQuestion')}\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{displayCancelButton ? (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\tstopEditingShoppingList();\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('Cancel')}\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{displaySaveButton ? (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{dirty ? dirtySaveButtonText : saveButtonText}\r\n\r\n\t\t\t\t\t\t\t{isSaving && }\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
\r\n\t\t\r\n\t);\r\n}\r\n\r\nShoppingListEditItemBody.defaultProps = {\r\n\tdisplayCancelButton: true,\r\n\tdisplaySaveButton: true,\r\n\tsaveButtonText: Localizer('Save'),\r\n\tdirtySaveButtonText: Localizer('Save'),\r\n};\r\n","import * as React from 'react';\r\nimport { Form } from 'react-final-form';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { FormValidationPromise } from 'shared/types';\r\nimport ShoppingListEditItemBody from './ShoppingListEditItemBody';\r\nimport { ShoppingListDto } from './types';\r\n\r\ninterface ShoppingListEditItemProps {\r\n\tshoppingListBeingEdited: ShoppingListDto;\r\n\tonSaveShoppingList: (formValues: ShoppingListDto, hasChanges: boolean) => FormValidationPromise;\r\n\tonRemoveShoppingList?: (shoppingList: ShoppingListDto) => void;\r\n\tstopEditingShoppingList: () => void;\r\n\tisSaving: boolean;\r\n\tdisplayCancelButton: boolean;\r\n\tdisplaySaveButton: boolean;\r\n\tsaveButtonText: string;\r\n\tdirtySaveButtonText: string;\r\n\tshoppingList?: ShoppingListDto[];\r\n\tisDeleting?: boolean;\r\n}\r\n\r\nexport interface ShoppingListEditItemBodyProps {\r\n\tshoppingListBeingEdited: ShoppingListDto;\r\n\tstopEditingShoppingList: () => void;\r\n\tonRemoveShoppingList?: (shoppingList: ShoppingListDto) => void;\r\n\tisSaving: boolean;\r\n\tdisplayCancelButton: boolean;\r\n\tdisplaySaveButton: boolean;\r\n\tsaveButtonText: string;\r\n\tdirtySaveButtonText: string;\r\n\t/** Whether to prevent the \"Set as Default\" checkbox from rendering */\r\n\tshoppingList?: ShoppingListDto[];\r\n\tdirty: boolean;\r\n\tisDeleting?: boolean;\r\n}\r\n\r\n/**\r\n * Handles loading the create/edit component.\r\n * Contains a form with the shopping list fields for add an shopping list.\r\n * Form validation, callbacks and data functions are handled in the containing component (ShoppingList).\r\n */\r\nexport default function ShoppingListEditItem(props: ShoppingListEditItemProps) {\r\n\tconst { onSaveShoppingList, shoppingListBeingEdited } = props;\r\n\r\n\treturn (\r\n\t\t {\r\n\t\t\t\treturn onSaveShoppingList(values, form.getState().dirty);\r\n\t\t\t}}\r\n\t\t\tsubscription={{ pristine: true, dirty: true, submitError: true }}\r\n\t\t\tinitialValues={{\r\n\t\t\t\t...shoppingListBeingEdited,\r\n\t\t\t}}\r\n\t\t\trender={({ handleSubmit, dirty }) => {\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\r\n\t\t\t\t);\r\n\t\t\t}}\r\n\t\t/>\r\n\t);\r\n}\r\n\r\nShoppingListEditItem.defaultProps = {\r\n\tdisplayCancelButton: true,\r\n\tdisplaySaveButton: true,\r\n\tsaveButtonText: Localizer('Save'),\r\n\tdirtySaveButtonText: Localizer('Save'),\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 { UseAxiosPaginatedLoaderResult, useAxiosPaginatedLoader } from 'shared/hooks/useAxiosPaginatedLoader';\r\nimport { PaginatedResult } from 'shared/types';\r\nimport { ShoppingListDto } from './types';\r\n\r\n/**\r\n * useShoppingLists hook result object\r\n */\r\ninterface UseShoppingListsResult\r\n\textends UseAxiosPaginatedLoaderResult> {}\r\n\r\ninterface UseShoppingListsParams {\r\n\tinitialPageSize?: number;\r\n}\r\n\r\n/**\r\n * Custom hook for my account Shopping Lists\r\n */\r\nexport function useShoppingListLoader({ initialPageSize }: UseShoppingListsParams): UseShoppingListsResult {\r\n\tconst {\r\n\t\tpage,\r\n\t\tgoToPage,\r\n\t\tgoToNextPage,\r\n\t\tgoToPreviousPage,\r\n\t\tsetSorting,\r\n\t\tsetPageSize,\r\n\t\terror,\r\n\t\tloading,\r\n\t\tresults,\r\n\t\tsortByName,\r\n\t\tsortDirection,\r\n\t} = useAxiosPaginatedLoader>({\r\n\t\taxiosParams: {\r\n\t\t\turl: `/ajax/shopping-lists`,\r\n\t\t},\r\n\t\tinitialPageSize: initialPageSize || 20,\r\n\t});\r\n\r\n\treturn {\r\n\t\tpage,\r\n\t\tgoToPage,\r\n\t\tgoToNextPage,\r\n\t\tgoToPreviousPage,\r\n\t\tsetSorting,\r\n\t\tsetPageSize,\r\n\t\terror,\r\n\t\tloading,\r\n\t\tresults,\r\n\t\tsortByName,\r\n\t\tsortDirection,\r\n\t};\r\n}\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 { 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","import React, { useEffect, useState } from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { AddToCartResponse, BulkAddToCartResponse } from 'services/UserData.Commerce';\r\nimport ProductPricing from 'shared/components/commerce/ProductPricing';\r\nimport OrderMessages from '../shopping-cart/OrderMessages';\r\n\r\ninterface AddedToCartAlertProps {\r\n\tresponse: BulkAddToCartResponse;\r\n}\r\n\r\n/**\r\n * Displays confirmation when adding multiple items to cart\r\n */\r\nexport default function MultipleItemsAddedToCartAlert(props: AddedToCartAlertProps) {\r\n\tconst { response } = props;\r\n\tconst [displayAlert, setDisplayAlert] = useState(true);\r\n\r\n\tuseEffect(() => {\r\n\t\tsetDisplayAlert(true);\r\n\t}, [response]);\r\n\r\n\tif (!displayAlert) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t\r\n\t\t\t{response.processedItems &&\r\n\t\t\t\tresponse.processedItems.map((responseItem, index) => {\r\n\t\t\t\t\treturn ;\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\t\t\t\t\t\t{Localizer('InCart')} {response.cartSummary?.items}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{Localizer('Subtotal')}:\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 (window.location.href = '/cart')}\r\n\t\t\t\t\t\t\tclassName=\"roc-btn-secondary roc-btn-secondary--big roc-btn-secondary--block roc-item-summary__btn\"\r\n\t\t\t\t\t\t\tdata-testid=\"view-cart-modal-btn\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{Localizer('ViewCart')}\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 (window.location.href = '/checkout')}\r\n\t\t\t\t\t\t\tclassName=\"roc-btn roc-btn--big roc-btn--block roc-item-summary__btn\"\r\n\t\t\t\t\t\t\tdata-testid=\"checkout-modal-btn\"\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\t\r\n\t\t\t\t\t\t\t\t{Localizer('CheckoutNow')}\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\ninterface addedToCartLineItemProps {\r\n\titem: AddToCartResponse;\r\n\trowIndex?: number;\r\n}\r\n\r\n/**\r\n * Displays a single line item on the alert when adding multiple items to cart\r\n */\r\nfunction AddedToCartLineItem(props: addedToCartLineItemProps) {\r\n\tconst { item, rowIndex } = props;\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{item.imageUrl ? (\r\n\t\t\t\t\t\t{item.name}\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{item.name}\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\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{item.selections !== null &&\r\n\t\t\t\t\t\t\t\titem.selections.length > 0 &&\r\n\t\t\t\t\t\t\t\t//#region Tapecase customization\r\n\t\t\t\t\t\t\t\titem.selections\r\n\t\t\t\t\t\t\t\t\t.filter((sel) => sel.name.toUpperCase() != 'SKU')\r\n\t\t\t\t\t\t\t\t\t.map((selection) => (\r\n\t\t\t\t\t\t\t\t\t\t//#end region\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\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\r\n\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\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t{selection.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\t{selection.label}\r\n\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t{Localizer('Qty')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{item.adjustedQuantity}\r\n\t\t\t\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","// 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","//#region TapeCase\r\nimport { MY_ACCOUNT_PATH_PREFIX } from 'features/my-account/routes.roc';\r\n//#endregion TapeCase\r\nimport React from 'react';\r\nimport { Route } from 'react-router';\r\nimport { ServerData } from 'services/ServerData';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport { OrganizationUIComponents } from './OrganizationUIComponents';\r\n\r\n//#region TapeCase\r\nexport const ORGANIZATION_PREFIX = `${MY_ACCOUNT_PATH_PREFIX}/organization`;\r\n//#endregio TapeCase\r\nexport const ORGANIZATION_OVERVIEW_URL = `${ORGANIZATION_PREFIX}`;\r\nexport const ORGANIZATION_USERS_URL = `${ORGANIZATION_PREFIX}/users`;\r\nexport const ORGANIZATION_USERS_CREATE_URL = `${ORGANIZATION_USERS_URL}/create`;\r\nexport const UPDATE_ORGANIZATION_USER_URL = `${ORGANIZATION_PREFIX}/user`;\r\nexport const UPDATE_USER_ORGANIZATION_STATUS_URL = `${UPDATE_ORGANIZATION_USER_URL}/organization-status`;\r\nexport const UPDATE_USER_DEFAULT_ORGANIZATION_URL = `/user/organization`;\r\nexport const INVALIDATE_USER_ORGANIZATION_NOTIFICATION_CACHE_URL = `${UPDATE_USER_DEFAULT_ORGANIZATION_URL}/cache`;\r\nexport const ORGANIZATION_ORDERS_URL = `${ORGANIZATION_PREFIX}/orders`;\r\nexport const ORGANIZATION_SHIPTOS_URL = `${ORGANIZATION_PREFIX}/ship-to`;\r\nexport const ORGANIZATION_ORDER_DETAILS = `${ORGANIZATION_ORDERS_URL}/:orderNo`;\r\nexport const ORGANIZATION_MANAGE_SHIPTOS_URL = ''; // TBD\r\n\r\nconst OrganizationOrderDetailsComponent = React.lazy(() => {\r\n\tconst orderDetailsComponent =\r\n\t\tServerData?.OrderDetailsUIComponent && ServerData?.OrderDetailsUIComponent in OrganizationUIComponents\r\n\t\t\t? ServerData.OrderDetailsUIComponent\r\n\t\t\t: OrganizationUIComponents.DefaultOrganizationOrderDetails;\r\n\treturn import(/* webpackChunkName: \"organization-order-details\" */ `./orders/${orderDetailsComponent}`);\r\n});\r\n\r\nconst ShiptosComponent = React.lazy(() => import(/* webpackChunkName: \"ship-to\" */ './ship-to/OrganizationShipTos'));\r\n\r\nconst UsersComponent = React.lazy(() => import(/* webpackChunkName: \"org-users\" */ './users/OrganizationUsers'));\r\n\r\nconst OrganizationOrdersComponent = React.lazy(\r\n\t() => import(/* webpackChunkName: \"org-orders\" */ './orders/OrganizationOrders'),\r\n);\r\n\r\nconst OrganizationUsersCreateComponent = React.lazy(\r\n\t() => import(/* webpackChunkName: \"org-users-create\" */ './users/OrganizationUsersCreate'),\r\n);\r\n\r\nexport default (\r\n\t}>\r\n\t\t{/* ROC-3667 temporary hidden\r\n\t\t */}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\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","/**\r\n * Returns visitor expiry date for hawksearch visitor id stored in the cookie for the user.\r\n */\r\nexport function getVisitorExpiry() {\r\n\tconst d = new Date();\r\n\t// 1 year\r\n\td.setTime(d.getTime() + 360 * 24 * 60 * 60 * 1000);\r\n\treturn d.toUTCString();\r\n}\r\n\r\n/**\r\n * Returns visitor expiry date for hawksearch visit id stored in the cookie for the user.\r\n */\r\nexport function getVisitExpiry() {\r\n\tconst d = new Date();\r\n\t// 4 hours\r\n\td.setTime(d.getTime() + 4 * 60 * 60 * 1000);\r\n\treturn d.toUTCString();\r\n}\r\n\r\n/**\r\n * Creates GUID.\r\n */\r\nexport function createGuid() {\r\n\tconst s: string[] = [];\r\n\tconst hexDigits = '0123456789abcdef';\r\n\tfor (let i = 0; i < 36; i++) {\r\n\t\ts[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);\r\n\t}\r\n\ts[14] = '4'; // bits 12-15 of the time_hi_and_version field to 0010\r\n\ts[19] = hexDigits.substr(((s[19] as any) & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01\r\n\ts[8] = s[13] = s[18] = s[23] = '-';\r\n\r\n\treturn s.join('');\r\n}\r\n\r\n/**\r\n * Returns the cookie.\r\n */\r\nexport function getCookie(name) {\r\n\tconst nameEQ = name + '=';\r\n\tconst ca = document.cookie.split(';');\r\n\r\n\tfor (let i = 0; i < ca.length; i++) {\r\n\t\tlet cookie = ca[i];\r\n\r\n\t\twhile (cookie.charAt(0) == ' ') {\r\n\t\t\tcookie = cookie.substring(1, cookie.length);\r\n\t\t}\r\n\r\n\t\tif (cookie.indexOf(nameEQ) == 0) {\r\n\t\t\treturn cookie.substring(nameEQ.length, cookie.length);\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n/**\r\n * Sets the cookie.\r\n */\r\nexport function setCookie(name: string, value: string, expiry?: string) {\r\n\tlet expires = '';\r\n\r\n\tif (expiry) {\r\n\t\texpires = '; expires=' + expiry;\r\n\t}\r\n\r\n\tdocument.cookie = name + '=' + value + expires + '; path=/';\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","// This is the Roc.Web variant of type-assertions.ts\r\n// The contents of this file should be identical to the version living in Roc.Admin\r\n// This currently cannot be moved to Roc.SharedClientApp (shared-client) because of transpilation issues with babel and webpack.\r\n// Working around this issue is currently not viable at this time but may be resolved in the future.\r\n// Please see https://github.com/babel/babel/issues/8309\r\n\r\n/**\r\n * Represents an assertion failure, meaning that an invariant that is supposed to always hold true, failed\r\n * Assertion failures should never be handled as they should never happen. They represent a programmer error.\r\n */\r\nexport class AssertionError extends Error {\r\n\tconstructor(m: string) {\r\n\t\tsuper(m);\r\n\r\n\t\t// Set the prototype explicitly.\r\n\t\tObject.setPrototypeOf(this, AssertionError.prototype);\r\n\t}\r\n}\r\n\r\n/**\r\n * Asserts that the specified condition is true and throws an assertion error if it is not.\r\n *\r\n * This is an assertion function and use of this function will impact TypeScript's flow analysis.\r\n */\r\nexport function assert(condition: any, message: string = ''): asserts condition {\r\n\tif (!condition) {\r\n\t\tif (message.length > 0) {\r\n\t\t\tthrow new AssertionError(`Assertion Failure: ${message}`);\r\n\t\t} else {\r\n\t\t\tthrow new AssertionError(`Assertion Failure`);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Asserts that the specified arguments is not null or undefined and throws an assertion error if it is.\r\n *\r\n * This is an assertion function and use of this function will impact TypeScript's flow analysis.\r\n */\r\nexport function assertNotNullish(arg: T): asserts arg is NonNullable {\r\n\tif (arg === null || arg === undefined) {\r\n\t\tthrow new AssertionError(`Assertion Failure: The specified argument was null or undefined`);\r\n\t}\r\n}\r\n","import React, { useEffect, useState } from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { AddToCartResponse } from 'services/UserData.Commerce';\r\nimport ProductPricing from 'shared/components/commerce/ProductPricing';\r\nimport LockSVG from 'shared/components/svg/LockSVG';\r\nimport OrderMessages from '../shopping-cart/OrderMessages';\r\n\r\ninterface AddedToCartAlertProps {\r\n\tresponse: AddToCartResponse;\r\n}\r\n\r\n/**\r\n * Displays Added to Cart confirmation\r\n */\r\nexport default function AddedToCartAlert(props: AddedToCartAlertProps) {\r\n\tconst { response } = props;\r\n\tconst [displayAlert, setDisplayAlert] = useState(true);\r\n\r\n\tuseEffect(() => {\r\n\t\tsetDisplayAlert(true);\r\n\t}, [response]);\r\n\r\n\tif (!displayAlert) {\r\n\t\treturn null;\r\n\t}\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\t\t
\r\n\t\t\t\t\t\t{response.imageUrl ? (\r\n\t\t\t\t\t\t\t{response.name}\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\t
\r\n\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t{response.name}\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('SKU')}: \r\n\t\t\t\t\t\t\t{response.sku}\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{response.selections !== null && response.selections.length > 0\r\n\t\t\t\t\t\t\t\t\t? //#region Tapecase customization\r\n\t\t\t\t\t\t\t\t\t response.selections\r\n\t\t\t\t\t\t\t\t\t\t\t.filter((sel) => sel.name.toUpperCase() != 'SKU')\r\n\t\t\t\t\t\t\t\t\t\t\t.map((selection) => (\r\n\t\t\t\t\t\t\t\t\t\t\t\t//#end region\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\r\n\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))\r\n\t\t\t\t\t\t\t\t\t: null}\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\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\t\t\t\t\t\t\t\t\t{selection.name}:\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{selection.label}\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{Localizer('Qty')} \r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t{response.adjustedQuantity}\r\n\t\t\t\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\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{Localizer('InCart')} {response.cartSummary.items}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{Localizer('Subtotal')}:\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 (window.location.href = '/cart')}\r\n\t\t\t\t\t\t\tclassName=\"roc-btn roc-btn--big roc-btn--block roc-item-summary__btn\"\r\n\t\t\t\t\t\t\tdata-testid=\"view-cart-modal-btn\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{Localizer('ViewCart')}\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 (window.location.href = '/checkout')}\r\n\t\t\t\t\t\t\tclassName=\"roc-btn roc-btn--big roc-btn--block roc-item-summary__btn\"\r\n\t\t\t\t\t\t\tdata-testid=\"checkout-modal-btn\"\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\r\n\t\t\t\t\t\t\t\t{Localizer('CheckoutNow')}\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\r\n\t\t//
\r\n\t\t// \t
\r\n\t\t// \t\t
\r\n\t\t// \t\t\t

Added to Cart

\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
\r\n\t\t// \t
\r\n\t\t// \t
\r\n\t\t// \t\t
\r\n\t\t// \t\t\t{response.imageUrl ? (\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
{response.name}
\r\n\t\t// \t\t\t
\r\n\t\t// \t\t\t\t{response.salePrice != 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\t${formatPrice(response.basePrice)}\r\n\t\t// \t\t\t\t\t\t\r\n\t\t// \t\t\t\t\t\t${formatPrice(response.salePrice)}\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${formatPrice(response.basePrice)}\r\n\t\t// \t\t\t\t)}\r\n\t\t// \t\t\t
\r\n\t\t// \t\t\t{response.selections !== null &&\r\n\t\t// \t\t\t\tresponse.selections.length > 0 &&\r\n\t\t// \t\t\t\tresponse.selections.map(selection => (\r\n\t\t// \t\t\t\t\t
\r\n\t\t// \t\t\t\t\t\t{selection.name}: {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
Qty: {response.adjustedQuantity}
\r\n\t\t// \t\t
\r\n\t\t// \t
\r\n\r\n\t\t// \t
\r\n\t\t// \t
\r\n\t\t// \t\t
\r\n\t\t// \t\t\t{response.cartSummary.items} {response.cartSummary.items === 1 ? 'item' : 'items'} in cart\r\n\t\t// \t\t
\r\n\t\t// \t\t
\r\n\t\t// \t\t\tSubtotal: ${formatPrice(response.cartSummary.subtotal)}\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\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, { useEffect, useState } from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { AddToCartResponse } from 'services/UserData.Commerce';\r\nimport Modal from 'shared/components/Modal';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport CheckCircleSVG from 'shared/components/svg/CheckCircleSVG';\r\nimport InlineAlert from 'shared/edit/InlineAlert';\r\nimport { dispatchRocEvent } from 'shared/hooks/useRocEventHandler';\r\nimport { assertNotNullish } from 'util/type-assertions';\r\nimport { OrderMessageAction } from '../shopping-cart/OrderMessages';\r\nimport useShoppingCart, { UseShoppingCart } from '../shopping-cart/useShoppingCart';\r\nimport AddedToCartAlert from '../store/AddedToCartAlert';\r\nimport { useProductDetailsContext } from './ProductDetailsContext';\r\nimport { CheckableLine, default as ProductPricingLines } from './ProductPricingLines';\r\nimport { AddToCartExceptionCode, Availability, ProductPricingLinesDetails, ProductType, Summary } from './types';\r\nimport { UseProductDetails } from './useProductDetails';\r\n\r\n//#region TapeCase\r\nimport { DisplayPricingResult } from '../../../../../Roc.SharedClientApp/types/commerce/display-price';\r\nimport { GetMinimumOrderQuantity, GetPricingLine } from 'features/commerce/pricing/pricing-result';\r\n//#endregion\r\n\r\n/** The component props for the ProductAddToCart component. */\r\ninterface ProductAddToCartProps {\r\n\tid: string;\r\n\tsummary?: Summary;\r\n\tavailability?: Availability | null;\r\n\tpricingLines?: ProductPricingLinesDetails;\r\n\tonPricingLineChange: (pricingLineId: string) => void;\r\n\r\n\tquantity: number | null;\r\n\tsetQuantity: (qty: number | null) => void;\r\n\r\n\tsetSelectedProductPricingLineId: (id: string | null) => void;\r\n\r\n\t//#region TapeCase\r\n\tdisplayPricing?: DisplayPricingResult;\r\n\t//#endregion\r\n}\r\n\r\n/**\r\n * Represents the component on a product details page that manages pricing line selections,\r\n * quantities, and of coursing, adding a product to the user's shopping cart.\r\n */\r\nexport default function ProductAddToCart(props: ProductAddToCartProps) {\r\n\tconst UseProductDetailsResult: UseProductDetails = useProductDetailsContext();\r\n\r\n\tconst {\r\n\t\tstate: { selectedPricingLine, productDetails },\r\n\t\tactor: { setSelectedPricingLine, isPricingLineUnavailable, isPurchaseable },\r\n\t} = UseProductDetailsResult;\r\n\r\n\tconst [modalOpen, setModalOpen] = useState(true);\r\n\tconst [addingToCart, setAddingToCart] = useState(false);\r\n\tconst [addToCartResponse, setAddToCartResponse] = useState(null);\r\n\tconst [errorMessages, setErrorMessages] = useState>([]);\r\n\tconst [isViewCartActive, setIsViewCartActive] = useState(false);\r\n\r\n\tconst UseShoppingCartResult: UseShoppingCart = useShoppingCart();\r\n\r\n\tconst {\r\n\t\tstate: { error, errorMessage: cartErrorMessage, errorType },\r\n\t\tactor: { addToCart },\r\n\t} = UseShoppingCartResult;\r\n\r\n\tconst allSelectionsSelected = props.summary && props.summary.type === ProductType.Simple;\r\n\tconst errorTitle =\r\n\t\terrorType === AddToCartExceptionCode.cartFull\r\n\t\t\t? Localizer('CartFull')\r\n\t\t\t: errorType === AddToCartExceptionCode.productOutOfStock\r\n\t\t\t? Localizer('OutOfStock')\r\n\t\t\t: errorType === AddToCartExceptionCode.productUnavailable\r\n\t\t\t? Localizer('ProductUnavailable')\r\n\t\t\t: Localizer('ErrorMessageGenericTitle');\r\n\r\n\t//#region TapeCase\r\n\tlet minimumOrderQuantity: number | null = null;\r\n\tif (props.pricingLines && props.displayPricing) {\r\n\t\tconst selectedPricingLineId =\r\n\t\t\tprops.pricingLines && props.pricingLines.selected && props.pricingLines.selected.id;\r\n\t\tconst selectedPricingLine = GetPricingLine(props.displayPricing, props.id, selectedPricingLineId);\r\n\t\tif (selectedPricingLine) {\r\n\t\t\tminimumOrderQuantity = GetMinimumOrderQuantity(selectedPricingLine);\r\n\t\t}\r\n\t}\r\n\r\n\t//#endregion\r\n\r\n\tuseEffect(() => {\r\n\t\tif (allSelectionsSelected) {\r\n\t\t\tsetErrorMessages([]);\r\n\t\t\tsetAddingToCart(false);\r\n\t\t}\r\n\r\n\t\tif (cartErrorMessage) {\r\n\t\t\tsetErrorMessages([cartErrorMessage]);\r\n\t\t}\r\n\t}, [props.summary, allSelectionsSelected, cartErrorMessage]);\r\n\r\n\t//#region TapeCase\r\n\tuseEffect(() => {\r\n\t\tif (minimumOrderQuantity && minimumOrderQuantity > 1) {\r\n\t\t\tprops.setQuantity(minimumOrderQuantity);\r\n\t\t}\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, []);\r\n\r\n\tif (productDetails.summary.isDiscontinued) {\r\n\t\treturn null;\r\n\t}\r\n\t//#endregion\r\n\r\n\t//#region Render method \"subcomponent\" helpers\r\n\r\n\t//#region AddToCartButton Subcomponent\r\n\t// The \"Add to Cart\" button. When pressed, the selected product will be added to the cart.\r\n\t// Manages its own visibility and \"clickability\", disabling itself if the selected option is\r\n\t// erroneous such as if it's not for sale.\r\n\r\n\t/** Event fired when the \"add to cart\" button is clicked. */\r\n\tconst handleAddToCart = async () => {\r\n\t\tsetErrorMessages([]);\r\n\t\tif (!allSelectionsSelected || !selectedPricingLine.checked || isPricingLineUnavailable()) {\r\n\t\t\tsetErrorMessages([Localizer('AddToCartSelectionErrorMessage')]);\r\n\t\t\tsetIsViewCartActive(false);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetAddToCartResponse(null);\r\n\r\n\t\ttry {\r\n\t\t\tconsole.debug('Adding to cart:', props.id, props.quantity);\r\n\t\t\tsetAddingToCart(true);\r\n\t\t\tconst response = await addToCart({\r\n\t\t\t\titemId: props.id,\r\n\t\t\t\tquantity: props.quantity,\r\n\t\t\t\tproductPricingLineId: selectedPricingLine.pricingLine?.id ?? '',\r\n\t\t\t});\r\n\r\n\t\t\tif (!response) {\r\n\t\t\t\tsetAddToCartResponse(null);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tsetAddToCartResponse(response);\r\n\r\n\t\t\tconst orderErrorMessages = response.orderMessages?.filter(\r\n\t\t\t\t(om) =>\r\n\t\t\t\t\tom.messageAction === OrderMessageAction.Error ||\r\n\t\t\t\t\tom.messageAction === OrderMessageAction.RedirectToCart,\r\n\t\t\t);\r\n\r\n\t\t\tif (orderErrorMessages && orderErrorMessages.length > 0) {\r\n\t\t\t\tsetErrorMessages(orderErrorMessages.map((orderMessages) => orderMessages.message));\r\n\t\t\t\tsetModalOpen(false);\r\n\t\t\t\tsetIsViewCartActive(true);\r\n\t\t\t} else {\r\n\t\t\t\tsetModalOpen(true);\r\n\t\t\t}\r\n\r\n\t\t\tdispatchRocEvent('roc-cart-summary-updated', { cartSummary: response.cartSummary });\r\n\t\t} catch (error) {\r\n\t\t\tsetAddToCartResponse(null);\r\n\t\t}\r\n\r\n\t\tsetAddingToCart(false);\r\n\t};\r\n\t//#endregion\r\n\r\n\t//#region PricingLineControls Subcomponent\r\n\t// Represents the pricing line and quantity controls, dictating the number or quantity of products added to the\r\n\t// end user's cart and which pricing line is selected.\r\n\r\n\t/** Callback when a pricing line's quantity is changed in PricingLineControls */\r\n\tconst updateQuantity = (e: React.ChangeEvent): void => {\r\n\t\tconst newQuantity = parseInt(e.currentTarget.value);\r\n\r\n\t\tif (isNaN(newQuantity)) {\r\n\t\t\tprops.setQuantity(null);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (newQuantity > 0) {\r\n\t\t\tprops.setQuantity(newQuantity);\r\n\t\t}\r\n\t};\r\n\r\n\t/** Callback when a pricing line is changed in PricingLineControls */\r\n\tconst handlePricingLineChange = (line: CheckableLine) => {\r\n\t\tif (selectedPricingLine.pricingLine?.id === line.pricingLine?.id) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetSelectedPricingLine(line);\r\n\t\tprops.setSelectedProductPricingLineId(line.pricingLine?.id ?? '');\r\n\r\n\t\t// trigger unit of measure change on the parent component only in case it is not an initialization process\r\n\t\t// because this will reload the data like pricing, availability, etc.\r\n\t\tif (!line.isInitialization) {\r\n\t\t\tassertNotNullish(line.pricingLine);\r\n\t\t\tprops.onPricingLineChange(line.pricingLine.id);\r\n\t\t}\r\n\t};\r\n\t//#endregion\r\n\r\n\t//#region ErrorAlerts Subcomponent\r\n\t/**\r\n\t * Represents the conditional inline error alerts subcomponent that may display if an unexpected error occured during operation.\r\n\t * This component manages its own visibility.\r\n\t */\r\n\t//#endregion\r\n\t//#endregion\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{/* PricingLineControls Subcomponent */}\r\n\t\t\t
\r\n\t\t\t\t{props.pricingLines != null ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t{isPurchaseable(productDetails.availability, selectedPricingLine.pricingLine) ? (\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) : null}\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
\r\n\r\n\t\t\t{/* AddToCart Subcomponent */}\r\n\t\t\t handleAddToCart()}\r\n\t\t\t\ttype=\"button\"\r\n\t\t\t\tclassName=\"roc-btn roc-btn--block roc-btn--big\"\r\n\t\t\t\tdisabled={\r\n\t\t\t\t\taddingToCart ||\r\n\t\t\t\t\tprops.quantity == null ||\r\n\t\t\t\t\t!isPurchaseable(productDetails.availability, selectedPricingLine.pricingLine) ||\r\n\t\t\t\t\t(minimumOrderQuantity != null && minimumOrderQuantity > props.quantity)\r\n\t\t\t\t}\r\n\t\t\t\tdata-testid=\"add-to-cart-button\"\r\n\t\t\t>\r\n\t\t\t\t{Localizer('AddToCart')}\r\n\t\t\t\t{addingToCart && }\r\n\t\t\t\r\n\r\n\t\t\t{/* AddToCartModal Subcomponent */}\r\n\r\n\t\t\t{addToCartResponse !== null ? (\r\n\t\t\t\t Localizer('AddedToCart')}\r\n\t\t\t\t\tcloseModal={() => setModalOpen(false)}\r\n\t\t\t\t\ttitleIcon={}\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\r\n\t\t\t{error != null || errorMessages.length > 0 ? (\r\n\t\t\t\t\r\n\t\t\t\t\t\t\t{errorMessages.map((orderMessage, index) => (\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
\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{isViewCartActive ? (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{Localizer('ViewCart')}\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}\r\n\t\t\t\t\terror={error}\r\n\t\t\t\t/>\r\n\t\t\t) : null}\r\n\t\t\r\n\t);\r\n}\r\n","import { WithTestIdOptional } from '../test';\r\nimport { DisplayPrice } from './display-price';\r\n\r\n/** Render props for ProductPricing */\r\nexport interface ProductPricingProps extends WithTestIdOptional {\r\n\t/**\r\n\t * The pricing object to render. This should typically come from the display pricing service.\r\n\t */\r\n\tdisplayPrice: DisplayPrice | undefined | null;\r\n\r\n\t/**\r\n\t * The custom CSS class name for custom styling\r\n\t */\r\n\tclassName?: string;\r\n\r\n\t/**\r\n\t * Determines whether the prices are displayed inline or not.\r\n\t */\r\n\tinline?: boolean;\r\n}\r\n\r\ntype CssClass = (string | {} | null)[];\r\n\r\nexport interface CssClasses {\r\n\t/** Shared CSS for the entire display price */\r\n\tbase: CssClass;\r\n\t/** Price for a product that isn't on sale */\r\n\tnormalPrice: CssClass;\r\n\t/** Crossed out because something is on sale */\r\n\tcrossedOutPrice: CssClass;\r\n\t/** Bright and highlighted on sale price */\r\n\thighlightedPrice: CssClass;\r\n}\r\n\r\nexport enum UnitOfMass {\r\n\tkg = 'kg',\r\n\tlbs = 'lbs',\r\n\toz = 'oz',\r\n}\r\n\r\nexport enum UnitOfLength {\r\n\tinch = 'Inch',\r\n\tcm = 'Centimeter',\r\n}\r\n\r\nexport enum ProductType {\r\n\tSimple = 'Simple',\r\n\tGroup = 'Group',\r\n\t// TODO: kits\r\n\t// Kit = 'Kit',\r\n\t// TODO: gift cards\r\n\t// GiftCard = 'Gift Card',\r\n}\r\n","import React from 'react';\r\n\r\ninterface RocOptionsTableProps {\r\n\tchildren: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Placeholder component to display simple listing table\r\n */\r\nexport default function RocOptionsTable(props: RocOptionsTableProps) {\r\n\tconst { children } = props;\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t{children}
\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport ProductPricing from 'shared/components/commerce/ProductPricing';\r\nimport { DisplayPrice, VariantPrice } from '../../../../../Roc.SharedClientApp/types/commerce/display-price';\r\nimport { PricingLine } from '../../../../../Roc.SharedClientApp/types/commerce/pricing-result';\r\nimport { GetPriceForQuantity } from '../pricing/pricing-result';\r\n\r\nexport interface ProductPriceListProps {\r\n\tpricingLine: PricingLine>;\r\n\tquantity: number;\r\n}\r\n\r\nfunction ProductPriceList(props: ProductPriceListProps) {\r\n\tconst { pricingLine, quantity } = props;\r\n\r\n\tlet price: DisplayPrice | null = null;\r\n\ttry {\r\n\t\tprice = GetPriceForQuantity(pricingLine.prices, quantity);\r\n\t} catch (error) {\r\n\t\tprice = null;\r\n\t}\r\n\r\n\treturn price == null ? (\r\n\t\tN/A\r\n\t) : (\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default ProductPriceList;\r\n","import React from 'react';\r\nimport { FormatShapeDto } from '../types';\r\n\r\nexport interface ProductTableFormatShapeSelectorProps {\r\n\tavailableFormatShape: FormatShapeDto[];\r\n\tselectedFormatShapeId: string | null;\r\n\tchangeSelectedFormatShape: (uom: FormatShapeDto) => void;\r\n}\r\n\r\nfunction ProductTableFormatShapeSelector(props: ProductTableFormatShapeSelectorProps) {\r\n\tconst { availableFormatShape, selectedFormatShapeId, changeSelectedFormatShape } = props;\r\n\tconst showFormatShapeSelector = availableFormatShape.length > 1;\r\n\r\n\treturn showFormatShapeSelector ? (\r\n\t\t<>\r\n\t\t\t
\r\n\t\t\t\t

Make Your Selections:

\r\n\t\t\t\t
\r\n\t\t\t\t\t{availableFormatShape.map((formatShape) => {\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\treturn (\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\t\t\t
\r\n\t\t\r\n\t) : null;\r\n}\r\n\r\nexport default ProductTableFormatShapeSelector;\r\n","import React, { useContext } from 'react';\r\nimport { UseTapeCaseProductDetailsActor, UseTapeCaseProductDetailsState } from './useTapeCaseProductDetails';\r\n\r\n/**\r\n * TapeCase specific context for product details\r\n */\r\nexport interface TapeCaseProductDetailsContext {\r\n\tstate: UseTapeCaseProductDetailsState;\r\n\tactor: UseTapeCaseProductDetailsActor;\r\n}\r\n\r\nconst TapeCaseProductDetailsContext = React.createContext(null);\r\n\r\nexport default TapeCaseProductDetailsContext;\r\n\r\n/**\r\n * Custom hook for product details context\r\n */\r\nexport function useTapeCaseProductDetailsContext() {\r\n\tconst context = useContext(TapeCaseProductDetailsContext);\r\n\r\n\tif (context === null) {\r\n\t\tthrow new Error('No TapeCaseProductDetailsContext.Provider found.');\r\n\t}\r\n\r\n\treturn context;\r\n}\r\n","import { FormatShapeDto, ProductTableProductDetails } from '../types';\r\nimport { ProductTableProductDetailsRow } from './useTapeCaseProductDetails';\r\n\r\nexport const CIRCLE_WITH_HOLE_SHAPE = 'Circle with Hole';\r\nexport const CIRCLE_SHAPE = 'Circle';\r\nexport const DIAMETER_NAME = 'Diameter';\r\nexport const WIDTH_NAME = 'Width';\r\nexport const LENGTH_NAME = 'Length';\r\n\r\nexport function mapProductDetails(details: ProductTableProductDetails): ProductTableProductDetailsRow {\r\n\tswitch (details.formatShape) {\r\n\t\tcase CIRCLE_SHAPE:\r\n\t\t\treturn {\r\n\t\t\t\tdetails: details,\r\n\t\t\t\tcolorFilterValue: details.color ?? '',\r\n\t\t\t\tdimension1FilterValue: details.diameter ?? '',\r\n\t\t\t\tdimension2FilterValue: '',\r\n\t\t\t};\r\n\r\n\t\tcase CIRCLE_WITH_HOLE_SHAPE:\r\n\t\t\treturn {\r\n\t\t\t\tdetails: details,\r\n\t\t\t\tcolorFilterValue: details.color ?? '',\r\n\t\t\t\tdimension1FilterValue: details.diameter ?? '',\r\n\t\t\t\tdimension2FilterValue: details.innerHoleDiameter ?? '',\r\n\t\t\t};\r\n\r\n\t\tdefault:\r\n\t\t\treturn {\r\n\t\t\t\tdetails: details,\r\n\t\t\t\tcolorFilterValue: details.color ?? '',\r\n\t\t\t\tdimension1FilterValue: details.width ?? '',\r\n\t\t\t\tdimension2FilterValue: details.length ?? '',\r\n\t\t\t};\r\n\t}\r\n}\r\n\r\n/**\r\n * Resolves column names for dimensions depending on the format/shape type\r\n * dimension 1 is always available (Width or Diameter)\r\n * but dimension 2 is optional (Length or Inner Hole Diameter, but no value for Circles)\r\n */\r\nexport function resolveColumnNames(formatShape: FormatShapeDto | null): [string, string | null] {\r\n\tlet dimension1ColumnName = WIDTH_NAME;\r\n\tlet dimension2ColumnName: string | null = LENGTH_NAME;\r\n\tif (formatShape != null) {\r\n\t\tswitch (formatShape.name) {\r\n\t\t\tcase CIRCLE_SHAPE:\r\n\t\t\t\tdimension1ColumnName = DIAMETER_NAME;\r\n\t\t\t\tdimension2ColumnName = null;\r\n\t\t\t\tbreak;\r\n\t\t\tcase CIRCLE_WITH_HOLE_SHAPE:\r\n\t\t\t\tdimension1ColumnName = DIAMETER_NAME;\r\n\t\t\t\tdimension2ColumnName = 'Inner Hole Diameter';\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\treturn [dimension1ColumnName, dimension2ColumnName];\r\n}\r\n","import React, { useState } from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport Modal from 'shared/components/Modal';\r\nimport { CalculatorType } from 'features/commerce/calculators/quote-confirmation/types';\r\nimport CardButton from 'shared/components/card/CardButton';\r\nimport {\r\n\tABRASIVE_BELT_CALCULATOR_URL,\r\n\tCUSTOM_CUT_SHAPES_CALCULATOR_URL,\r\n\tCUSTOM_SHORT_LENGTH_CALCULATOR_URL,\r\n\tCUSTOM_WIDTH_ROLL_CALCULATOR_URL,\r\n} from 'features/commerce/calculators/routes';\r\n\r\nexport interface ProductCalculatorSelectorProps {\r\n\tavailableCalculators: CalculatorType[];\r\n}\r\n\r\nconst renderCalculatorLink = (calculatorType: CalculatorType) => {\r\n\tlet linkDescription: string | undefined;\r\n\tlet calculatorUrl: string | undefined;\r\n\tswitch (calculatorType) {\r\n\t\tcase CalculatorType.AbrasiveBelts:\r\n\t\t\tlinkDescription = Localizer('CustomAbrasiveBeltsCalculatorOptionDescription');\r\n\t\t\tcalculatorUrl = ABRASIVE_BELT_CALCULATOR_URL;\r\n\t\t\tbreak;\r\n\t\tcase CalculatorType.CustomCutTapeShape:\r\n\t\t\tlinkDescription = Localizer('CustomCutShapesCalculatorOptionDescription');\r\n\t\t\tcalculatorUrl = CUSTOM_CUT_SHAPES_CALCULATOR_URL;\r\n\t\t\tbreak;\r\n\t\tcase CalculatorType.CustomShortLength:\r\n\t\t\tlinkDescription = Localizer('CustomShortLengthCalculatorOptionDescription');\r\n\t\t\tcalculatorUrl = CUSTOM_SHORT_LENGTH_CALCULATOR_URL;\r\n\t\t\tbreak;\r\n\t\tcase CalculatorType.CustomWidthRoll:\r\n\t\t\tlinkDescription = Localizer('CustomWidthRollCalculatorOptionDescription');\r\n\t\t\tcalculatorUrl = CUSTOM_WIDTH_ROLL_CALCULATOR_URL;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\treturn {linkDescription};\r\n};\r\n\r\n/**\r\n * The main component for rendering Product Calculator Selector.\r\n */\r\nexport function ProductCalculatorSelector(props: ProductCalculatorSelectorProps) {\r\n\tconst { availableCalculators } = props;\r\n\tconst [isModalOpen, setIsModalOpen] = useState(false);\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t {\r\n\t\t\t\t\tsetIsModalOpen(true);\r\n\t\t\t\t}}\r\n\t\t\t\tdata-testid={`product-available-calculators-button`}\r\n\t\t\t>\r\n\t\t\t\t{Localizer('ProductCalculatorSelection')}\r\n\t\t\t\r\n\r\n\t\t\t {\r\n\t\t\t\t\tsetIsModalOpen(false);\r\n\t\t\t\t}}\r\n\t\t\t\trenderTitle={() => null}\r\n\t\t\t\theaderDivider={false}\r\n\t\t\t\tsize=\"xlg\"\r\n\t\t\t>\r\n\t\t\t\t
    \r\n\t\t\t\t\t{availableCalculators.map((calculator) => {\r\n\t\t\t\t\t\treturn
  • {renderCalculatorLink(calculator)}
  • ;\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","export const CUSTOM_WIDTH_ROLL_CALCULATOR_URL = '/custom-width-roll';\r\nexport const CUSTOM_SHORT_LENGTH_CALCULATOR_URL = '/custom-short-length';\r\nexport const CUSTOM_CUT_SHAPES_CALCULATOR_URL = '/custom-cut-shapes';\r\nexport const ABRASIVE_BELT_CALCULATOR_URL = '/abrasive-calculator';\r\n","import React, { useEffect, useState } from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport { dispatchRocEvent } from 'shared/hooks/useRocEventHandler';\r\nimport { getProductsForTable } from '../data';\r\nimport { useProductDetailsContext } from '../ProductDetailsContext';\r\nimport { FormatShapeDto, ProductTableProductDetails, Summary } from '../types';\r\nimport { ProductType } from '../../../../../../Roc.SharedClientApp/types/commerce/product-details';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport RocOptionsTable from 'shared/components/roc-options-table/RocOptionsTable';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { AddToCartResponse } from 'services/UserData.Commerce';\r\nimport useShoppingCart, { UseShoppingCart } from '../../shopping-cart/useShoppingCart';\r\nimport { OrderMessageAction } from '../../shopping-cart/OrderMessages';\r\nimport Modal from 'shared/components/Modal';\r\nimport CheckCircleSVG from 'shared/components/svg/CheckCircleSVG';\r\nimport AddedToCartAlert from '../../store/AddedToCartAlert';\r\nimport ProductPriceList from '../ProductPriceList';\r\nimport { GetMinimumOrderQuantity, ParseQuantityRange } from '../../pricing/pricing-result';\r\nimport { DisplayPrice, VariantPrice } from '../../../../../../Roc.SharedClientApp/types/commerce/display-price';\r\nimport { Prices, PricingLine } from '../../../../../../Roc.SharedClientApp/types/commerce/pricing-result';\r\nimport ProductTableFormatShapeSelector from './ProductTableFormatShapeSelector';\r\nimport { useTapeCaseProductDetailsContext } from './TapeCaseProductDetailsContext';\r\nimport TableFilter from 'react-table-filter';\r\nimport { ProductTableProductDetailsRow } from './useTapeCaseProductDetails';\r\nimport { CIRCLE_SHAPE, CIRCLE_WITH_HOLE_SHAPE, mapProductDetails, resolveColumnNames } from './data';\r\nimport { ProductCalculatorSelector } from './ProductCalculatorSelector';\r\n\r\nfunction ProductSpecComp({ children }: any) {\r\n\tconst elem = document.getElementById('alternate-product-specs');\r\n\r\n\tif (elem) {\r\n\t\treturn ReactDOM.createPortal(children, elem);\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n/**\r\n * The main component for rendering Product Table.\r\n */\r\nexport function ProductTable() {\r\n\tconst {\r\n\t\tstate: { productId, productDetails },\r\n\t} = useProductDetailsContext();\r\n\r\n\tconst {\r\n\t\tstate: { productSeriesTableData },\r\n\t\tactor: { setProductSeriesTableData },\r\n\t} = useTapeCaseProductDetailsContext();\r\n\r\n\tconst [isLoading, setIsLoading] = useState(false);\r\n\tconst [selectedFormatShape, setFormatShape] = useState(null);\r\n\tconst [isFiltering, setIsFiltering] = useState(false);\r\n\tconst dimensionColumnNames = resolveColumnNames(selectedFormatShape);\r\n\tconst [hideDimension1, setHideDimension1] = useState(false);\r\n\tconst [hideDimension2, setHideDimension2] = useState(false);\r\n\tconst [hideColor, setHideColor] = useState(false);\r\n\r\n\t/**\r\n\t * A callback used by react-table-filter to update list of products when searching/filtering/sorting\r\n\t */\r\n\tconst tableFilterUpdated = (newData: ProductTableProductDetailsRow[]) => {\r\n\t\tsetIsFiltering(true);\r\n\t\tsetProductSeriesTableData(newData);\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tif (\r\n\t\t\tproductDetails.summary.type != ProductType.Group ||\r\n\t\t\tproductDetails.availableFormatShape == null ||\r\n\t\t\tproductDetails.availableFormatShape.length == 0\r\n\t\t) {\r\n\t\t\tsetProductSeriesTableData(null);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (selectedFormatShape == null && productDetails.availableFormatShape.length > 0) {\r\n\t\t\tsetFormatShape(productDetails.availableFormatShape[0]);\r\n\t\t}\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [productDetails.availableFormatShape]);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (selectedFormatShape == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tasync function fetchTableData() {\r\n\t\t\tif (selectedFormatShape != null) {\r\n\t\t\t\tsetIsLoading(true);\r\n\t\t\t\tsetProductSeriesTableData(null);\r\n\t\t\t\tconst results = await getProductsForTable(productId, selectedFormatShape.id);\r\n\t\t\t\tconst tableData = results.map((details) => {\r\n\t\t\t\t\treturn mapProductDetails(details);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tsetHideDimension1(tableData.every((a) => !a.dimension1FilterValue));\r\n\t\t\t\tsetHideDimension2(tableData.every((a) => !a.dimension2FilterValue));\r\n\t\t\t\tsetHideColor(tableData.every((a) => !a.colorFilterValue));\r\n\t\t\t\tsetProductSeriesTableData(tableData);\r\n\t\t\t\tsetIsLoading(false);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfetchTableData();\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [selectedFormatShape]);\r\n\r\n\tuseEffect(() => {\r\n const additionalProductInfoLink = document.querySelector(\r\n `[data-testid=\"product-page-additional-product-info-link\"]`,\r\n );\r\n if (additionalProductInfoLink == null || !additionalProductInfoLink.classList.contains('roc-hidden')) {\r\n\t\t\t// link element not found or it's already displayed - no need for additional manipulation on the client-side\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// this is the case when Additional Product Info link is hidden\r\n\t\t// we need to check if there are any tabs loaded on the client side\r\n\t\tif (productDetails.tabs != null && productDetails.tabs.some((t) => t.model != null || t.rawHtml != null)) {\r\n\t\t\tadditionalProductInfoLink.classList.remove('roc-hidden');\r\n\t\t}\r\n\t}, [productDetails.tabs]);\r\n\r\n\tconst alternateProductDetailsDom = document.getElementById('alternate-product-details-simples');\r\n\tif (!alternateProductDetailsDom) {\r\n\t\tconsole.warn('alternate product details DOM element not found.');\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst hasProductsForTable = productSeriesTableData != null && Object.keys(productSeriesTableData).length > 0;\r\n\r\n\tconst alternateProductSpecsDomElement = document.getElementById('alternate-product-specs');\r\n\tif (\r\n\t\talternateProductSpecsDomElement != null &&\r\n\t\tproductDetails.availableCalculators != undefined &&\r\n\t\tproductDetails.availableCalculators.length > 0\r\n\t) {\r\n\t\talternateProductSpecsDomElement.classList.remove('roc-hidden');\r\n\t}\r\n\r\n\tconst productSpecs = (\r\n\t\t<>\r\n\t\t\t{(hasProductsForTable || isFiltering) &&\r\n\t\t\tproductDetails.availableCalculators != undefined &&\r\n\t\t\tproductDetails.availableCalculators != null &&\r\n\t\t\tproductDetails.availableCalculators.length > 0 ? (\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t\r\n\t);\r\n\r\n\tconst simplesListing = (\r\n\t\t<>\r\n\t\t\t{productSpecs}\r\n\t\t\t{productDetails.availableFormatShape != undefined && productDetails.availableFormatShape != null ? (\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t\t{hasProductsForTable || isFiltering ? (\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\tSize / Description\r\n\t\t\t\t\t\t\t\tType\r\n\t\t\t\t\t\t\t\t{!hideDimension1 ? (\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t{dimensionColumnNames[0]}\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{dimensionColumnNames[1] != null && !hideDimension2 ? (\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t{dimensionColumnNames[1]}\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{!hideColor ? (\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tColor\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t\t\tPricing\r\n\t\t\t\t\t\t\t\tQty\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\t\t{productSeriesTableData != null && productSeriesTableData.length > 0 ? (\r\n\t\t\t\t\t\t\tproductSeriesTableData.map((row) => {\r\n\t\t\t\t\t\t\t\t{\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);\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) : isFiltering ? (\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\tNo results\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) : isLoading ? (\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t\r\n\t);\r\n\r\n\treturn ReactDOM.createPortal(simplesListing, alternateProductDetailsDom);\r\n}\r\n\r\ninterface ProductTableRowProps {\r\n\titem: ProductTableProductDetails;\r\n\tdimensionColumnNames: [string, string | null];\r\n\thideDimension1: boolean;\r\n\thideDimension2: boolean;\r\n\thideColor: boolean;\r\n}\r\n\r\n/**\r\n * The interface that combines available prices for the given pricing line and information about number of all prices.\r\n */\r\ninterface PricingLineDetails {\r\n\tnumberOfPrices: number;\r\n\tprices: Prices>;\r\n}\r\n\r\n/**\r\n * The interface that represents simiplified information about product pricing lines.\r\n */\r\ninterface ProductPricingLines {\r\n\t[key: string]: PricingLineDetails;\r\n}\r\n\r\nexport function formatPricingLine(\r\n\tquantityRange: string,\r\n\tpricingLine: PricingLine>,\r\n\thideRange: boolean,\r\n) {\r\n\tconst [min, max] = ParseQuantityRange(quantityRange);\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{hideRange ? null : max == Infinity ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{min}\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\t\t<>\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{min} - {max} -{' '}\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\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nfunction ProductTableRow(props: ProductTableRowProps) {\r\n\tconst { item, dimensionColumnNames, hideDimension1, hideDimension2, hideColor } = props;\r\n\tconst minimumOrderQuantity = GetMinimumOrderQuantity(item.pricingLine[0]);\r\n\tconst [quantity, setQuantity] = useState(minimumOrderQuantity);\r\n\r\n\tconst pricing = {} as ProductPricingLines;\r\n\tfor (const index in item.pricingLine) {\r\n\t\tconst pricingLine = item.pricingLine[index];\r\n\t\tconst pricesPerPricingLine = pricingLine.prices;\r\n\t\tpricing[index] = {\r\n\t\t\tnumberOfPrices: Object.keys(pricesPerPricingLine).length,\r\n\t\t\tprices: pricesPerPricingLine,\r\n\t\t};\r\n\t}\r\n\r\n\tif (!item) {\r\n\t\treturn null;\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\r\n\t\t\t{item.formatShape}\r\n\r\n\t\t\t{/* Dimensions (Width/Length or Diameter or Diameter/Inner Hole Diameter) */}\r\n\t\t\t\r\n\r\n\t\t\t{!hideColor ? {item.color} : null}\r\n\r\n\t\t\t{!item.summary.isDiscontinued && (\r\n\t\t\t\t\r\n\t\t\t\t\t{item.pricingLine.map((pricingLine, index) => (\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t{Object.keys(pricing[index].prices).map((p) => (\r\n\t\t\t\t\t\t\t\t<>{formatPricingLine(p, pricingLine, pricing[index].numberOfPrices == 1)}\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{!item.summary.isDiscontinued && (\r\n\t\t\t\t\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t\tsetQuantity(quantity);\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tminimumOrderQuantity={minimumOrderQuantity}\r\n\t\t\t\t\t/>\r\n\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{item.summary.isDiscontinued && (\r\n\t\t\t\t\r\n\t\t\t\t\t

{Localizer('QuickOrderDiscontinuedMessage')}

\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n}\r\n\r\ninterface DimensionsColumnsProps {\r\n\titem: ProductTableProductDetails;\r\n\tdimensionColumnNames: [string, string | null];\r\n\thideDimension1: boolean;\r\n\thideDimension2: boolean;\r\n}\r\n\r\nfunction DimensionsColumns(props: DimensionsColumnsProps) {\r\n\tconst { item, dimensionColumnNames, hideDimension1, hideDimension2 } = props;\r\n\tswitch (item.formatShape) {\r\n\t\tcase CIRCLE_SHAPE:\r\n\t\t\treturn (\r\n\t\t\t\t<>\r\n\t\t\t\t\t{!hideDimension1 ? (\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{item.diameter ? {item.diameter} : null}\r\n\t\t\t\t\t\t\t\t{item.diameterUom ? {item.diameterUom} : 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) : null}\r\n\t\t\t\t\r\n\t\t\t);\r\n\t\tcase CIRCLE_WITH_HOLE_SHAPE:\r\n\t\t\treturn (\r\n\t\t\t\t<>\r\n\t\t\t\t\t{!hideDimension1 ? (\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{item.diameter ? {item.diameter} : null}\r\n\t\t\t\t\t\t\t\t{item.diameterUom ? {item.diameterUom} : 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) : null}\r\n\r\n\t\t\t\t\t{!hideDimension2 ? (\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{item.innerHoleDiameter ? {item.innerHoleDiameter} : null}\r\n\t\t\t\t\t\t\t\t{item.innerHoleDiameterUom ? {item.innerHoleDiameterUom} : 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) : null}\r\n\t\t\t\t\r\n\t\t\t);\r\n\t\tdefault:\r\n\t\t\treturn (\r\n\t\t\t\t<>\r\n\t\t\t\t\t{!hideDimension1 ? (\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{item.width ? {item.width} : null}\r\n\t\t\t\t\t\t\t\t{item.widthUom ? {item.widthUom} : 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) : null}\r\n\t\t\t\t\t{!hideDimension2 ? (\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{item.length ? {item.length} : null}\r\n\t\t\t\t\t\t\t\t{item.lengthUom ? {item.lengthUom} : 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) : null}\r\n\t\t\t\t\r\n\t\t\t);\r\n\t}\r\n}\r\n\r\ninterface ItemDescriptionProps {\r\n\titemId: string;\r\n\tsummary: Summary;\r\n\titem: ProductTableProductDetails;\r\n}\r\n\r\nfunction ItemDescription(props: ItemDescriptionProps) {\r\n\tconst { itemId, summary, item } = props;\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t{item.sizeDescription ? (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\tSize: \r\n\t\t\t\t\t\t{item.sizeDescription}\r\n\t\t\t\t\t
\r\n\t\t\t\t) : null}\r\n\r\n\t\t\t\t{summary.sku ? (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\tSKU: \r\n\t\t\t\t\t\t{summary.productUrl ? (\r\n\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\tif (itemId) {\r\n\t\t\t\t\t\t\t\t\t\tdispatchRocEvent('product-clicked', {\r\n\t\t\t\t\t\t\t\t\t\t\tproductId: itemId,\r\n\t\t\t\t\t\t\t\t\t\t\turl: summary?.productUrl ?? '#',\r\n\t\t\t\t\t\t\t\t\t\t\tproductName: summary?.name ?? '',\r\n\t\t\t\t\t\t\t\t\t\t\tproductGroupId: summary.productGroupId,\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\t{summary.sku}\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{summary.sku}\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{summary.sku}\r\n\t\t\t\t)}\r\n\r\n\t\t\t\t{item.upc ? (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\tUPC: \r\n\t\t\t\t\t\t{item.upc}\r\n\t\t\t\t\t
\r\n\t\t\t\t) : null}\r\n\r\n\t\t\t\t{item.additionalSkuDescription ? (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\tAdditional SKU Description: \r\n\t\t\t\t\t\t{item.additionalSkuDescription}\r\n\t\t\t\t\t
\r\n\t\t\t\t) : null}\r\n\r\n\t\t\t\t{item.distributorPartNumber ? (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\tYour Part#: \r\n\t\t\t\t\t\t{item.distributorPartNumber}\r\n\t\t\t\t\t
\r\n\t\t\t\t) : null}\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n}\r\n\r\ninterface AddToCartButtonProps {\r\n\titemId: string;\r\n\tquantity: number | null;\r\n\tpricingLineId: string;\r\n\tminimumOrderQuantity: number | null;\r\n\tisDiscontinued: boolean;\r\n}\r\n\r\nfunction AddToCartButton(props: AddToCartButtonProps) {\r\n\tconst { itemId, quantity, pricingLineId, minimumOrderQuantity, isDiscontinued } = props;\r\n\tconst [modalOpen, setModalOpen] = useState(true);\r\n\tconst [addingToCart, setAddingToCart] = useState(false);\r\n\tconst [addToCartResponse, setAddToCartResponse] = useState(null);\r\n\r\n\tconst UseShoppingCartResult: UseShoppingCart = useShoppingCart();\r\n\tconst {\r\n\t\tactor: { addToCart },\r\n\t\tstate: { errorMessage },\r\n\t} = UseShoppingCartResult;\r\n\r\n\tconst handleAddToCart = async () => {\r\n\t\tsetAddToCartResponse(null);\r\n\t\ttry {\r\n\t\t\tsetAddingToCart(true);\r\n\r\n\t\t\tif (quantity == null || quantity == undefined) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tconst response = await addToCart({\r\n\t\t\t\titemId: itemId,\r\n\t\t\t\tproductPricingLineId: pricingLineId,\r\n\t\t\t\tquantity: quantity,\r\n\t\t\t});\r\n\r\n\t\t\tsetAddToCartResponse(response);\r\n\r\n\t\t\tif (response != null) {\r\n\t\t\t\tconst orderErrorMessages = response.orderMessages?.filter(\r\n\t\t\t\t\t(om) =>\r\n\t\t\t\t\t\tom.messageAction === OrderMessageAction.Error ||\r\n\t\t\t\t\t\tom.messageAction === OrderMessageAction.RedirectToCart,\r\n\t\t\t\t);\r\n\r\n\t\t\t\tif (orderErrorMessages && orderErrorMessages.length > 0) {\r\n\t\t\t\t\tsetModalOpen(false);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsetModalOpen(true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdispatchRocEvent('roc-cart-summary-updated', { cartSummary: response.cartSummary });\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\tsetAddToCartResponse(null);\r\n\t\t}\r\n\r\n\t\tsetAddingToCart(false);\r\n\t};\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t handleAddToCart()}\r\n\t\t\t\ttype=\"button\"\r\n\t\t\t\tclassName=\"roc-btn roc-btn--block roc-btn--big\"\r\n\t\t\t\tdisabled={\r\n\t\t\t\t\taddingToCart ||\r\n\t\t\t\t\tquantity == null ||\r\n\t\t\t\t\t(minimumOrderQuantity != null && quantity != null && quantity < minimumOrderQuantity) ||\r\n\t\t\t\t\tisDiscontinued\r\n\t\t\t\t}\r\n\t\t\t\tdata-testid=\"add-to-cart-button\"\r\n\t\t\t>\r\n\t\t\t\t{Localizer('AddToCart')}\r\n\t\t\t\t{addingToCart && }\r\n\t\t\t\r\n\r\n\t\t\t{addToCartResponse !== null ? (\r\n\t\t\t\t Localizer('AddedToCart')}\r\n\t\t\t\t\tcloseModal={() => setModalOpen(false)}\r\n\t\t\t\t\ttitleIcon={}\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\r\n\t\t\t{errorMessage != null ?

{errorMessage}

: null}\r\n\t\t\r\n\t);\r\n}\r\n\r\ninterface QuantityInputProps {\r\n\titem: ProductTableProductDetails;\r\n\tonQuantityUpdate?: (newQuantity: number | null) => void;\r\n\tminimumOrderQuantity: number | null;\r\n}\r\n\r\nfunction QuantityInput(props: QuantityInputProps) {\r\n\tconst [quantity, setQuantity] = useState(null);\r\n\tconst { onQuantityUpdate, minimumOrderQuantity, item } = props;\r\n\r\n\tconst updateQuantity = (e: React.ChangeEvent): void => {\r\n\t\tconst newQuantity = parseInt(e.currentTarget.value);\r\n\r\n\t\tif (isNaN(newQuantity)) {\r\n\t\t\tsetQuantity(null);\r\n\t\t\tif (onQuantityUpdate) {\r\n\t\t\t\tonQuantityUpdate(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (newQuantity > 0) {\r\n\t\t\tsetQuantity(newQuantity);\r\n\t\t\tif (onQuantityUpdate) {\r\n\t\t\t\tonQuantityUpdate(newQuantity);\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<>\r\n\t\t\t\t\r\n\t\t\t\t{minimumOrderQuantity != null ?
MOQ: {minimumOrderQuantity}
: null}\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport StarRating from 'shared/components/star-rating/StarRating';\r\nimport { dispatchRocEvent } from 'shared/hooks/useRocEventHandler';\r\nimport { useProductDetailsContext } from './ProductDetailsContext';\r\nimport { ReviewSummaryDto } from './types';\r\nimport { warnOnce } from 'util/console';\r\nimport { toKebabCase } from 'util/StringUtil';\r\n\r\nenum TabType {\r\n\tReviews = 'Reviews',\r\n}\r\n\r\n/**\r\n * Placeholder for product review display\r\n */\r\nexport default function ProductRating() {\r\n\tlet reviewsSummary: ReviewSummaryDto;\r\n\tlet displayName: string = '';\r\n\r\n\tconst {\r\n\t\tstate: {\r\n\t\t\treviewsSummary: standardReviewsSummary,\r\n\t\t\tproductDetails: { tabs },\r\n\t\t},\r\n\t} = useProductDetailsContext();\r\n\r\n\tconst hasReviewTab = tabs?.some((tabViewChunk) => tabViewChunk.tab.tabType === TabType.Reviews) === true;\r\n\r\n\tif (hasReviewTab && tabs) {\r\n\t\tconst reviewTabs = tabs.filter((t) => t.tab.tabType === TabType.Reviews);\r\n\t\treviewsSummary = (reviewTabs[0].model as any).reviewsSummary as ReviewSummaryDto;\r\n\t\tdisplayName = reviewTabs[0].tab.displayName;\r\n\t\tif (reviewTabs.length > 1) {\r\n\t\t\twarnOnce('Found more than one product reviews tab!');\r\n\t\t}\r\n\t} else {\r\n\t\treviewsSummary = standardReviewsSummary;\r\n\t}\r\n\r\n\tconst { averageRating, reviewCount } = reviewsSummary;\r\n\r\n\t/**\r\n\t * Handle clicking write a review button.\r\n\t */\r\n\tfunction handleBtnClick() {\r\n\t\tdispatchRocEvent('roc-reviews-write-review', {});\r\n\r\n\t\tconst reviewsTabs = document?.getElementsByClassName('roc-pdp-reviews-listing');\r\n\r\n\t\tconst reviews = reviewsTabs != null && reviewsTabs.length > 0 ? reviewsTabs[0] : null;\r\n\r\n\t\tif (reviews == null || !(reviews instanceof HTMLElement)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\twindow.scrollTo(0, reviews.offsetTop);\r\n\t}\r\n\r\n\tconst rating = Math.round(averageRating ?? 0);\r\n\r\n\tconst reviewText = hasReviewTab ? (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\t\t{reviewCount}{' '}\r\n\t\t\t\t{reviewCount === 0 || reviewCount > 1\r\n\t\t\t\t\t? Localizer('Reviews').toLowerCase()\r\n\t\t\t\t\t: Localizer('Review').toLowerCase()}\r\n\t\t\t\r\n\t\t\r\n\t) : (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\t\t{reviewCount}{' '}\r\n\t\t\t\t{reviewCount === 0 || reviewCount > 1\r\n\t\t\t\t\t? Localizer('Reviews').toLowerCase()\r\n\t\t\t\t\t: Localizer('Review').toLowerCase()}\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
\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n\t\t\t\t{reviewText}\r\n\t\t\t\t{hasReviewTab ? (\r\n\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('WriteAReview')}\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
\r\n\t\t
\r\n\t);\r\n}\r\n","import { GetPriceForQuantity, GetPricingLine } from 'features/commerce/pricing/pricing-result';\r\nimport React, { useEffect, useState } from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { ServerData } from 'services/ServerData';\r\nimport { getUserData, UserData } from 'services/UserData';\r\nimport { getTabDivElement, getTabLiElement } from 'shared-client/types/commerce/tabs';\r\nimport { lazyLoadImages } from 'shared/assets/lazy';\r\nimport Breadcrumbs from 'shared/components/Breadcrumbs';\r\nimport ProductPricing from 'shared/components/commerce/ProductPricing';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport useRocEventHandler, { dispatchRocEvent } from 'shared/hooks/useRocEventHandler';\r\nimport { SimpleProductsListing } from './AlternateProductDetails';\r\nimport { getPartialProductData } from './data';\r\nimport ProductAddToCart from './ProductAddToCart';\r\nimport ProductAddToList from './ProductAddToList';\r\nimport ProductAssets from './ProductAssets';\r\nimport ProductDetailsContext, { useProductDetailsContext } from './ProductDetailsContext';\r\nimport ProductRating from './ProductRating';\r\nimport ProductSelections from './ProductSelections';\r\nimport {\r\n\tgetInitialProductDetailsState,\r\n\tProductDetailsState,\r\n\tProductPartialDataLoaderOptions,\r\n\tTabViewChunk,\r\n} from './types';\r\nimport useProductDetails, { UseProductDetails } from './useProductDetails';\r\n\r\nconst loaderOptions: ProductPartialDataLoaderOptions = {\r\n\tinitialState: getInitialProductDetailsState,\r\n\tdataLoaderFn: getPartialProductData,\r\n};\r\n\r\n/**\r\n * Keys that will be requested from the server when the active product is changed (eg, the user changed selections)\r\n */\r\nconst missingKeys: Array = [\r\n\t'summary',\r\n\t'assets',\r\n\t'availability',\r\n\t'brand',\r\n\t'pricingLines',\r\n\t'displayPricing',\r\n\t'breadcrumbPath',\r\n\t'reviewsSummary',\r\n\t'tabs',\r\n];\r\n\r\n/**\r\n * Main component that renders the product details using react portals\r\n */\r\nfunction ProductDetails() {\r\n\tconst UseProductDetailsResult: UseProductDetails = useProductDetails({ loaderOptions });\r\n\tconst [canGoBack, setCanGoBack] = useState('');\r\n\tconst {\r\n\t\tstate: { productDetails, groupId },\r\n\t\tactor: { setLoggedInUserFirstName, setUserIsSignedIn },\r\n\t} = UseProductDetailsResult;\r\n\r\n\tconst getLoggedInUserFirstName = async (): Promise => {\r\n\t\ttry {\r\n\t\t\tconst data = (await getUserData()).data;\r\n\t\t\tgetUserIsSignedIn(data);\r\n\t\t\treturn (data && data.summary && data.summary.firstName) || '';\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error('Unable to load user data', error);\r\n\t\t}\r\n\t\treturn Promise.resolve('');\r\n\t};\r\n\r\n\tconst getUserIsSignedIn = (data: UserData) => {\r\n\t\tsetUserIsSignedIn((data && data.summary && data.summary.isSignedIn) || false);\r\n\t};\r\n\r\n\tuseRocEventHandler(\r\n\t\t'hawk-recs-widget-loaded',\r\n\t\t({ widgetGuid, hasItems }) => {\r\n\t\t\t// update tab visibility\r\n\t\t\tif (productDetails.tabs === undefined) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// select based on data attributes to prevent this from breaking due to customizations\r\n\t\t\tconst elements = document.querySelectorAll(`[data-tab-id] [data-widgetguid=\"${widgetGuid}\"]`);\r\n\r\n\t\t\tif (elements.length === 0) {\r\n\t\t\t\tconsole.warn(`No matches found for Widget Guid: ${widgetGuid}`);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\telements.forEach((el) => {\r\n\t\t\t\t// have to check for this again inside this closure\r\n\t\t\t\tif (productDetails.tabs === undefined) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// closest attempts to find the tab parent node.\r\n\t\t\t\tconst tabDiv = el.closest(`[data-tab-id]`);\r\n\t\t\t\tif (!tabDiv) {\r\n\t\t\t\t\tconsole.warn('Unable to find tab parent!');\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// grab the tab-id rendered by the server and find the matching tabChunk\r\n\t\t\t\tconst tabId = tabDiv.getAttribute('data-tab-id');\r\n\t\t\t\tconst tabChunk = productDetails.tabs.find((t) => t.tab.id === tabId);\r\n\r\n\t\t\t\tif (!tabChunk) {\r\n\t\t\t\t\tconsole.warn(`Unable to find tab (${tabId})`);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// let the magic happen\r\n\t\t\t\tupdateTabVisibility(tabChunk, hasItems);\r\n\t\t\t});\r\n\t\t},\r\n\t\t[],\r\n\t);\r\n\r\n\tuseEffect(() => {\r\n\t\tgetLoggedInUserFirstName().then((firstName) => {\r\n\t\t\tsetLoggedInUserFirstName(firstName);\r\n\t\t});\r\n\r\n\t\tsetCanGoBack(sessionStorage.getItem('canGoBack') || '');\r\n\t\tsessionStorage.removeItem('canGoBack');\r\n\r\n\t\tdispatchRocEvent('product-viewed', {\r\n\t\t\tproductName: productDetails.summary.name,\r\n\t\t\tsku: productDetails.summary.sku,\r\n\t\t\tproductId: productDetails.id,\r\n\t\t\tproductGroupId: groupId !== '' ? groupId : null,\r\n\t\t\tselections: productDetails.selections ?? null,\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\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t{productDetails.summary && productDetails.summary.useAlternateProductDetails ? (\r\n\t\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\r\n//#region React Portals\r\n\r\n/**\r\n * Product page header containing the breadcrumbs\r\n * @param props\r\n */\r\nexport function ProductBreadcrumbs(props: { canGoBack: string }) {\r\n\tconst {\r\n\t\tstate: { productDetails },\r\n\t} = useProductDetailsContext();\r\n\r\n\tconst headerDom = document.getElementById('product-details-header');\r\n\tif (!headerDom) {\r\n\t\tconsole.warn('Header DOM element not found.');\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst breadcrumbComponent = (\r\n\t\t\r\n\t);\r\n\r\n\treturn ReactDOM.createPortal(breadcrumbComponent, headerDom);\r\n}\r\n\r\n/**\r\n * Product page media component, containing the product images\r\n */\r\nexport function ProductMedia() {\r\n\tconst {\r\n\t\tstate: { productDetails },\r\n\t\tactor: { isLoadingAny },\r\n\t} = useProductDetailsContext();\r\n\r\n\tconst mainLeftDom = document.getElementById('product-details-product-media');\r\n\tif (!mainLeftDom) {\r\n\t\tconsole.warn('Product media DOM element not found.');\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst productAssets = (\r\n\t\t<>{!isLoadingAny(['assets']) ? : }\r\n\t);\r\n\r\n\treturn ReactDOM.createPortal(productAssets, mainLeftDom);\r\n}\r\n\r\n/**\r\n * Product page main info header, containing the pricing and rating components\r\n */\r\nexport function ProductHeader() {\r\n\tconst {\r\n\t\tstate: { productDetails, hasError },\r\n\t\tactor: { isLoadingAny },\r\n\t} = useProductDetailsContext();\r\n\r\n\tconst mainInfoHeaderDom = document.getElementById('product-details-main-info-header');\r\n\tif (!mainInfoHeaderDom) {\r\n\t\tconsole.warn('Main info header DOM element not found.');\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst getDetail = () => {\r\n\t\tif (productDetails.displayPricing == null) {\r\n\t\t\tthrow new Error(\"Display pricing was rendered when it wasn't ready!\");\r\n\t\t}\r\n\t\tconst selectedPricingLineId =\r\n\t\t\tproductDetails.pricingLines &&\r\n\t\t\tproductDetails.pricingLines.selected &&\r\n\t\t\tproductDetails.pricingLines.selected.id;\r\n\r\n\t\tconst displayPriceLine = GetPricingLine(\r\n\t\t\tproductDetails.displayPricing,\r\n\t\t\tproductDetails.id,\r\n\t\t\tselectedPricingLineId,\r\n\t\t);\r\n\r\n\t\treturn displayPriceLine && GetPriceForQuantity(displayPriceLine.prices, 1);\r\n\t};\r\n\r\n\tconst productHeaderInfo = (\r\n\t\t<>\r\n\t\t\t{!isLoadingAny(['displayPricing']) ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t{!productDetails.summary.isDiscontinued && (\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) : !hasError ? (\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\r\n\t\t\t{!isLoadingAny(['reviewsSummary']) ? : }\r\n\t\t\r\n\t);\r\n\r\n\treturn ReactDOM.createPortal(productHeaderInfo, mainInfoHeaderDom);\r\n}\r\n\r\n/**\r\n * Product page product selection component, which takes care of the logic and display\r\n * of the product selections and pricing lines / units of measure\r\n */\r\nexport function ProductSelectionsRegion() {\r\n\tconst [selectedProductPricingLineId, setSelectedProductPricingLineId] = useState(null);\r\n\tconst {\r\n\t\tstate: { productDetails, groupId, hasError, productStateOverride, userIsSignedIn, productQuantity },\r\n\t\tactor: { isLoadingAny, setSimpleProductLoading, setProductStateOverride, setHasError, setProductQuantity },\r\n\t} = useProductDetailsContext();\r\n\r\n\tconst productSelectionsDom = document.getElementById('product-details-selections');\r\n\tif (!productSelectionsDom) {\r\n\t\tconsole.warn('Product selections DOM element not found.');\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst productSelections = (\r\n\t\t
\r\n\t\t\t{!hasError ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t{!isLoadingAny(['selections']) && productDetails.selections && productDetails.children ? (\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\tconsole.debug('Simple Product Selected:', simpleProduct.name);\r\n\r\n\t\t\t\t\t\t\t\tsetSimpleProductLoading(true);\r\n\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\tconst simpleProductData = await getPartialProductData({\r\n\t\t\t\t\t\t\t\t\t\tid: simpleProduct.id,\r\n\t\t\t\t\t\t\t\t\t\tmissingKeys: missingKeys,\r\n\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\tconsole.debug('Simple Product Data:', simpleProductData);\r\n\r\n\t\t\t\t\t\t\t\t\tconst newProductData: ProductDetailsState = {\r\n\t\t\t\t\t\t\t\t\t\t...productStateOverride,\r\n\t\t\t\t\t\t\t\t\t\t...productDetails,\r\n\t\t\t\t\t\t\t\t\t\t...simpleProductData,\r\n\t\t\t\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\t\t\t\tsetProductStateOverride({\r\n\t\t\t\t\t\t\t\t\t\tid: simpleProduct.id,\r\n\t\t\t\t\t\t\t\t\t\t...simpleProductData,\r\n\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\t// Function to change the url, title, product name, brand information, sku and manufacturer part number\r\n\t\t\t\t\t\t\t\t\tUpdateSSRData(newProductData);\r\n\r\n\t\t\t\t\t\t\t\t\tdispatchRocEvent('product-selection-updated', {\r\n\t\t\t\t\t\t\t\t\t\tproduct: {\r\n\t\t\t\t\t\t\t\t\t\t\tproductId: simpleProduct.id,\r\n\t\t\t\t\t\t\t\t\t\t\tproductDetails: newProductData,\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} catch (error) {\r\n\t\t\t\t\t\t\t\t\tconsole.error(error);\r\n\t\t\t\t\t\t\t\t\tsetHasError(error);\r\n\t\t\t\t\t\t\t\t} finally {\r\n\t\t\t\t\t\t\t\t\tsetSimpleProductLoading(false);\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\tonSimpleProductCleared={async () => {\r\n\t\t\t\t\t\t\t\tsetSimpleProductLoading(true);\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\tconst groupProductData = await getPartialProductData({\r\n\t\t\t\t\t\t\t\t\t\tid: groupId,\r\n\t\t\t\t\t\t\t\t\t\tmissingKeys: missingKeys,\r\n\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\tsetProductStateOverride({\r\n\t\t\t\t\t\t\t\t\t\tid: groupId,\r\n\t\t\t\t\t\t\t\t\t\t...groupProductData,\r\n\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\t// Function to change the url, title, product name, brand information, and sku\r\n\t\t\t\t\t\t\t\t\tUpdateSSRData(groupProductData);\r\n\r\n\t\t\t\t\t\t\t\t\tconst newGroupProductData = {\r\n\t\t\t\t\t\t\t\t\t\t...productDetails,\r\n\t\t\t\t\t\t\t\t\t\t...groupProductData,\r\n\t\t\t\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\t\t\t\tdispatchRocEvent('product-selection-updated', {\r\n\t\t\t\t\t\t\t\t\t\tproduct: {\r\n\t\t\t\t\t\t\t\t\t\t\tproductId: groupId,\r\n\t\t\t\t\t\t\t\t\t\t\tproductDetails: newGroupProductData,\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} catch (error) {\r\n\t\t\t\t\t\t\t\t\tconsole.error(error);\r\n\t\t\t\t\t\t\t\t\tsetHasError(error);\r\n\t\t\t\t\t\t\t\t} finally {\r\n\t\t\t\t\t\t\t\t\tsetSimpleProductLoading(false);\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) : null}\r\n\r\n\t\t\t\t\t{!isLoadingAny(['pricingLines']) && (\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\ttry {\r\n\t\t\t\t\t\t\t\t\t\t// reload availability for the selected Unit of Measure\r\n\t\t\t\t\t\t\t\t\t\tconst availability = await getPartialProductData({\r\n\t\t\t\t\t\t\t\t\t\t\tid: productDetails.id,\r\n\t\t\t\t\t\t\t\t\t\t\tmissingKeys: ['availability'],\r\n\t\t\t\t\t\t\t\t\t\t\tadditionalParams: {\r\n\t\t\t\t\t\t\t\t\t\t\t\tunitOfMeasureId: selectedPricingLineId,\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\tconst selectedPricingLine =\r\n\t\t\t\t\t\t\t\t\t\t\tproductDetails.pricingLines &&\r\n\t\t\t\t\t\t\t\t\t\t\tproductDetails.pricingLines.available.find(\r\n\t\t\t\t\t\t\t\t\t\t\t\t(line) => line.id === selectedPricingLineId,\r\n\t\t\t\t\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\t\t\t\tif (!selectedPricingLine) {\r\n\t\t\t\t\t\t\t\t\t\t\tthrow new Error('Invalid unit of measure selected');\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// override state with and availability from the server\r\n\t\t\t\t\t\t\t\t\t\t// and selected unit of measure\r\n\t\t\t\t\t\t\t\t\t\tsetProductStateOverride({\r\n\t\t\t\t\t\t\t\t\t\t\t...productStateOverride,\r\n\t\t\t\t\t\t\t\t\t\t\t...availability,\r\n\t\t\t\t\t\t\t\t\t\t\tselections: productDetails.selections,\r\n\t\t\t\t\t\t\t\t\t\t\tchildren: productDetails.children,\r\n\t\t\t\t\t\t\t\t\t\t\tpricingLines: {\r\n\t\t\t\t\t\t\t\t\t\t\t\tselected: selectedPricingLine,\r\n\t\t\t\t\t\t\t\t\t\t\t\tavailable: productDetails.pricingLines\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t? productDetails.pricingLines.available\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},\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t} catch (error) {\r\n\t\t\t\t\t\t\t\t\t\tconsole.error(error);\r\n\t\t\t\t\t\t\t\t\t\tsetHasError(error);\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
\r\n\t\t\t\t\t)}\r\n\t\t\t\t\r\n\t\t\t) : (\r\n\t\t\t\t
{Localizer('ErrorOccurredLoadingProductData')}
\r\n\t\t\t)}\r\n\t\t
\r\n\t);\r\n\r\n\treturn ReactDOM.createPortal(productSelections, productSelectionsDom);\r\n}\r\n\r\n//#endregion\r\n\r\nfunction updateTabContents(tabChunk: TabViewChunk) {\r\n\tconsole.debug('Updating tab contents:', tabChunk.tab.id);\r\n\r\n\t// Update SSR rendered HTML\r\n\tif (tabChunk.rawHtml == null) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tconst div = getTabDivElement(tabChunk.tab.id);\r\n\tconst li = getTabLiElement(tabChunk.tab.id);\r\n\tlet hidden = false;\r\n\r\n\tif (div != null) {\r\n\t\tdiv.outerHTML = tabChunk.rawHtml;\r\n\t\tconst mutatedDiv = getTabDivElement(tabChunk.tab.id);\r\n\t\tif (mutatedDiv?.classList.contains('roc-hidden')) {\r\n\t\t\thidden = true;\r\n\t\t}\r\n\t}\r\n\r\n\tif (li != null) {\r\n\t\tli.className = hidden ? 'roc-hidden' : 'roc-pdp-sections__nav-item'; // This should match the values set in \\Roc.Web\\Features\\Commerce\\Products\\Index.cshtml\r\n\t}\r\n}\r\n\r\nfunction updateTabVisibility(tabChunk: TabViewChunk, visible: boolean) {\r\n\tconsole.debug('Updating tab visbility:', tabChunk.tab.id);\r\n\r\n\tconst div = getTabDivElement(tabChunk.tab.id);\r\n\tconst li = getTabLiElement(tabChunk.tab.id);\r\n\r\n\tif (div != null) {\r\n\t\tdiv.classList.toggle('roc-hidden', !visible);\r\n\t}\r\n\r\n\tif (li != null) {\r\n\t\tli.classList.toggle('roc-hidden', !visible);\r\n\t\tli.classList.toggle('roc-pdp-sections__nav-item', visible);\r\n\t}\r\n}\r\n\r\n/**\r\n * Function that updates the data on the page that has been server-side rendered when a simple product is chosen\r\n * @param productData\r\n */\r\nfunction UpdateSSRData(productData: Partial) {\r\n\tconst { summary, brand } = productData;\r\n\r\n\t// update URL and page title\r\n\tif (summary?.meta?.pageTitle && ServerData.PageTitleSuffix) {\r\n\t\t// update the url and page title\r\n\t\twindow.history.replaceState('', summary.meta.pageTitle + ServerData.PageTitleSuffix, summary.productUrl);\r\n\r\n\t\t// replace state title is not working in chrome\r\n\t\tdocument.title = summary.meta.pageTitle + ServerData.PageTitleSuffix;\r\n\t}\r\n\r\n\t// Handle updating the product branding\r\n\tconst brandDiv = getElementByTestId('product-page-brand-div');\r\n\tconst brandName = getElementByTestId('product-page-brand-name');\r\n\tconst brandLogo = getElementByTestId('product-page-brand-logo') as HTMLImageElement;\r\n\r\n\tif (!brandDiv || !brandName || !brandLogo) {\r\n\t\tconsole.warn(\r\n\t\t\t'Could not find one of the following DOM elements to change:',\r\n\t\t\t'Brand enclosing div, Brand name, Brand logo',\r\n\t\t);\r\n\t} else {\r\n\t\tif (brand && brand.name) {\r\n\t\t\tbrandDiv.classList.remove('roc-hidden');\r\n\t\t\tbrandName.textContent = brand.name;\r\n\t\t\tif (brand.logoUrl) {\r\n\t\t\t\tbrandLogo.src = brand.logoUrl;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tbrandDiv.classList.add('roc-hidden');\r\n\t\t\tbrandName.textContent = '';\r\n\t\t\tbrandLogo.src = '';\r\n\t\t}\r\n\t}\r\n\r\n\t// update tabs with new ssr'd contents\r\n\tconst tabs = productData.tabs ?? [];\r\n\tif (tabs.length > 0) {\r\n\t\tfor (const tabChunk of tabs) {\r\n\t\t\tupdateTabContents(tabChunk);\r\n\t\t}\r\n\t}\r\n\r\n\t// Handle updating the product name, SKU text and Manufacturer Part Number text\r\n\tconst productName = getElementsByTestId('product-page-product-name');\r\n\r\n\tconst productSkuContainer = getElementByTestId('product-page-sku-container');\r\n\tconst productSkuText = getElementByTestId('product-page-sku-text');\r\n\tconst productSkuValue = getElementByTestId('product-page-sku-value');\r\n\r\n\tconst productMpnContainer = getElementByTestId('product-page-mpn-container');\r\n\tconst productMpnText = getElementByTestId('product-page-mpn-text');\r\n\tconst productMpnValue = getElementByTestId('product-page-mpn-value');\r\n\r\n\tif (!productName) {\r\n\t\tconsole.warn('Could not find the Product Name DOM element to change');\r\n\t} else if (summary != null) {\r\n\t\tproductName.forEach((element) => {\r\n\t\t\telement.textContent = summary.name;\r\n\t\t});\r\n\t}\r\n\r\n\tif (!productSkuContainer || !productSkuText || !productSkuValue) {\r\n\t\tconsole.warn('Could not find the Product SKU Container, Text, or Value DOM elements to change');\r\n\t} else {\r\n\t\tif (summary?.sku) {\r\n\t\t\tproductSkuContainer.classList.remove('roc-hidden');\r\n\t\t\tproductSkuText.textContent = `${Localizer('SKU')}:`;\r\n\t\t\tproductSkuValue.textContent = summary.sku;\r\n\t\t} else {\r\n\t\t\tproductSkuContainer.classList.add('roc-hidden');\r\n\t\t\tproductSkuText.textContent = '';\r\n\t\t\tproductSkuValue.textContent = '';\r\n\t\t}\r\n\t}\r\n\r\n\tif (!productMpnContainer || !productMpnText || !productMpnValue) {\r\n\t\tconsole.warn(\r\n\t\t\t'Could not find the Product Manufacturer Part Number Container, Text, or Value DOM elements to change',\r\n\t\t);\r\n\t} else {\r\n\t\tif (summary?.manufacturerPartNumber) {\r\n\t\t\tproductMpnContainer.classList.remove('roc-hidden');\r\n\t\t\tproductMpnText.textContent = `${Localizer('ManufacturerPartNumber')}:`;\r\n\t\t\tproductMpnValue.textContent = summary.manufacturerPartNumber;\r\n\t\t} else {\r\n\t\t\tproductMpnContainer.classList.add('roc-hidden');\r\n\t\t\tproductMpnText.textContent = '';\r\n\t\t\tproductMpnValue.textContent = '';\r\n\t\t}\r\n\t}\r\n\r\n\tlazyLoadImages();\r\n}\r\n\r\n/**\r\n * Simple helper function to get a DOM element by its data-testid attribute\r\n * @param testId\r\n */\r\nfunction getElementByTestId(testId: string): Element | null {\r\n\treturn document.querySelector(`[data-testid=\"${testId}\"]`);\r\n}\r\n\r\n/**\r\n * Simple helper function to get DOM elements by its data-testid attribute\r\n * @param testId\r\n */\r\nfunction getElementsByTestId(testId: string): NodeListOf | null {\r\n\treturn document.querySelectorAll(`[data-testid=\"${testId}\"]`);\r\n}\r\n\r\nexport default ProductDetails;\r\n","import { useEffect, useState } from 'react';\r\nimport { getUserData } from 'services/UserData';\r\nimport { PriceDisplayRule } from '../../../../../../Roc.SharedClientApp/types/commerce/display-price';\r\nimport { GetPriceForMinimumAvailableQuantity, GetPricingLine } from '../../pricing/pricing-result';\r\nimport { useProductDetailsContext } from '../ProductDetailsContext';\r\nimport { ProductTableProductDetails, ProductType } from '../types';\r\n\r\nexport interface UseTapeCaseProductDetails {\r\n\tstate: UseTapeCaseProductDetailsState;\r\n\tactor: UseTapeCaseProductDetailsActor;\r\n}\r\n\r\n/**\r\n * Use TapeCase Product Details Context State\r\n */\r\nexport interface UseTapeCaseProductDetailsState {\r\n\t/**\r\n\t * The data for product table (on product series page) that constists of simple products.\r\n\t */\r\n\tproductSeriesTableData: ProductTableProductDetailsRow[] | null;\r\n\tproductUrl: string;\r\n}\r\n\r\nexport interface ProductTableProductDetailsRow {\r\n\t/**\r\n\t * The original product details dto\r\n\t */\r\n\tdetails: ProductTableProductDetails;\r\n\t/**\r\n\t * The value for Dimensions 1 filter applicable for this product\r\n\t */\r\n\tdimension1FilterValue: string;\r\n\t/**\r\n\t * The value for Dimensions 2 filter applicable for this product\r\n\t */\r\n\tdimension2FilterValue: string;\r\n\t/**\r\n\t * The value for Color filter applicable for this product\r\n\t */\r\n\tcolorFilterValue: string;\r\n}\r\n\r\n/**\r\n * Use TapeCase Product Details Context Actor\r\n */\r\nexport interface UseTapeCaseProductDetailsActor {\r\n\t/**\r\n\t * Updates data for product table with the provided value.\r\n\t */\r\n\tsetProductSeriesTableData: (data: ProductTableProductDetailsRow[] | null) => void;\r\n\t/**\r\n\t * Evaluates if contract pricing is available -> this means there is a chance that\r\n\t * the customer will see a different pricing after successfully logging in.\r\n\t */\r\n\tisContractPricingAvailable: () => boolean | undefined;\r\n}\r\n\r\n/**\r\n * Reusable hook to access TapeCase product detail related endpoints on the server, as well as helping manage\r\n * product detail information.\r\n */\r\nexport default function useTapeCaseProductDetails(): UseTapeCaseProductDetails {\r\n\t// can't really use isUserSignedIn flag from ROC Product Details context\r\n\t// because it is either true/false and there is no way to determine\r\n\t// if loading user data is in progress (like having undefined alternative which is set as long as the data is loading),\r\n\t// this let's us hide Login link until we are certainly sure user is not logged in,\r\n\t// otherwise it would be displayed and once data is loaded then it would get hidden\r\n\t// which provides poor UX\r\n\tconst {\r\n\t\tstate: { productDetails },\r\n\t\tactor: { isLoadingAny },\r\n\t} = useProductDetailsContext();\r\n\r\n\tconst [isLoggedIn, setIsLoggedIn] = useState();\r\n\tconst [productSeriesTableData, setProductSeriesTableData] = useState(null);\r\n\r\n\tconst checkIfIsLoggedIn = async () => {\r\n\t\ttry {\r\n\t\t\tconst data = (await getUserData()).data;\r\n\t\t\tsetIsLoggedIn(data && data.summary && data.summary.isSignedIn);\r\n\t\t} catch (error) {}\r\n\t};\r\n\r\n\tconst getPricingDetail = () => {\r\n\t\tif (productDetails.displayPricing == null) {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\t\tconst selectedPricingLineId =\r\n\t\t\tproductDetails.pricingLines &&\r\n\t\t\tproductDetails.pricingLines.selected &&\r\n\t\t\tproductDetails.pricingLines.selected.id;\r\n\r\n\t\tconst displayPriceLine = GetPricingLine(\r\n\t\t\tproductDetails.displayPricing,\r\n\t\t\tproductDetails.id,\r\n\t\t\tselectedPricingLineId,\r\n\t\t);\r\n\r\n\t\treturn displayPriceLine && GetPriceForMinimumAvailableQuantity(displayPriceLine.prices);\r\n\t};\r\n\r\n\tconst isAnyProductPurchasable = (): boolean => {\r\n\t\tif (productSeriesTableData == null || Object.keys(productSeriesTableData).length == 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tlet hasValidItem = false;\r\n\t\tfor (const key in productSeriesTableData) {\r\n\t\t\tconst simpleProductDetails = productSeriesTableData[key];\r\n\t\t\tif (\r\n\t\t\t\tsimpleProductDetails.details.summary.type != ProductType.Group &&\r\n\t\t\t\tsimpleProductDetails.details.pricingLine.length > 0\r\n\t\t\t) {\r\n\t\t\t\tfor (const pricingLineId in simpleProductDetails.details.pricingLine) {\r\n\t\t\t\t\tconst pricingLine = simpleProductDetails.details.pricingLine[pricingLineId];\r\n\t\t\t\t\tfor (const qtyBreakIndex in pricingLine.prices) {\r\n\t\t\t\t\t\tif (pricingLine.prices[qtyBreakIndex].displayRule != PriceDisplayRule.Missing) {\r\n\t\t\t\t\t\t\thasValidItem = true;\r\n\t\t\t\t\t\t\tbreak;\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\r\n\t\treturn hasValidItem;\r\n\t};\r\n\r\n\tconst isContractPricingAvailable = () => {\r\n\t\tif (isLoggedIn == undefined) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tswitch (productDetails.summary.type) {\r\n\t\t\tcase ProductType.Group:\r\n\t\t\t\t// for groups, pricing can be different (contract pricing) after logging in\r\n\t\t\t\t// only when there is data for product table (this means there are simple products associated to this group)\r\n\t\t\t\t// and product series is NOT discontinued\r\n\t\t\t\t// and user is not logged in\r\n\t\t\t\treturn isAnyProductPurchasable() && !isLoggedIn;\r\n\t\t\tdefault:\r\n\t\t\t\tconst pricing = getPricingDetail();\r\n\t\t\t\t// for simples, pricing can be different when dispaly price is no longer loading\r\n\t\t\t\t// there is a pricing line (not missing one), product is NOT discontinued\r\n\t\t\t\t// and user is not logged in\r\n\t\t\t\treturn (\r\n\t\t\t\t\t!isLoadingAny['displayPrice'] &&\r\n\t\t\t\t\tpricing != undefined &&\r\n\t\t\t\t\tpricing != null &&\r\n\t\t\t\t\tpricing.displayRule != PriceDisplayRule.Missing &&\r\n\t\t\t\t\t!isLoggedIn\r\n\t\t\t\t);\r\n\t\t}\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tcheckIfIsLoggedIn();\r\n\t}, []);\r\n\r\n\treturn {\r\n\t\tstate: {\r\n\t\t\tproductSeriesTableData,\r\n\t\t\tproductUrl: productDetails.summary.productUrl,\r\n\t\t},\r\n\t\tactor: {\r\n\t\t\tsetProductSeriesTableData,\r\n\t\t\tisContractPricingAvailable,\r\n\t\t},\r\n\t};\r\n}\r\n","import React from 'react';\r\nimport TapeCaseProductDetailsContext from './TapeCaseProductDetailsContext';\r\nimport useTapeCaseProductDetails from './useTapeCaseProductDetails';\r\n\r\nconst { Provider } = TapeCaseProductDetailsContext;\r\n\r\nconst TapeCaseProductDetailsProvider = (props) => {\r\n\tconst { actor, state } = useTapeCaseProductDetails();\r\n\r\n\treturn {props.children};\r\n};\r\n\r\nexport { TapeCaseProductDetailsProvider, TapeCaseProductDetailsContext };\r\n","import React from 'react';\r\nimport { getPartialProductData } from '../data';\r\nimport ProductDetailsContext from '../ProductDetailsContext';\r\nimport { ProductPartialDataLoaderOptions, getInitialProductDetailsState } from '../types';\r\nimport useProductDetails from '../useProductDetails';\r\n\r\nconst loaderOptions: ProductPartialDataLoaderOptions = {\r\n\tinitialState: getInitialProductDetailsState,\r\n\tdataLoaderFn: getPartialProductData,\r\n};\r\n\r\n/**\r\n * Custom provider for ProductDetailsContext.\r\n */\r\nconst ProductDetailsProvider = (props) => {\r\n\tconst UseProductDetailsResult = useProductDetails({ loaderOptions });\r\n\treturn (\r\n\t\t\r\n\t\t\t{props.children}\r\n\t\t\r\n\t);\r\n};\r\n\r\nexport { ProductDetailsProvider };\r\n","import { GetPricingLine, ParseQuantityRange } from 'features/commerce/pricing/pricing-result';\r\nimport React from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport ProductPricing from 'shared/components/commerce/ProductPricing';\r\nimport { DisplayPrice, VariantPrice } from '../../../../../../Roc.SharedClientApp/types/commerce/display-price';\r\nimport { useProductDetailsContext } from '../ProductDetailsContext';\r\n\r\ninterface QuantityBreak {\r\n\tmin: number;\r\n\tmax: number;\r\n\tprice: DisplayPrice;\r\n}\r\n\r\nexport function ProductQuantityBreaks() {\r\n\tconst {\r\n\t\tstate: { productDetails },\r\n\t} = useProductDetailsContext();\r\n\r\n\tconst getAvailablePrices = () => {\r\n\t\tif (productDetails.displayPricing == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tconst selectedPricingLineId =\r\n\t\t\tproductDetails.pricingLines &&\r\n\t\t\tproductDetails.pricingLines.selected &&\r\n\t\t\tproductDetails.pricingLines.selected.id;\r\n\r\n\t\tconst displayPriceLine = GetPricingLine(\r\n\t\t\tproductDetails.displayPricing,\r\n\t\t\tproductDetails.id,\r\n\t\t\tselectedPricingLineId,\r\n\t\t);\r\n\r\n\t\tif (displayPriceLine == undefined) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\treturn displayPriceLine.prices;\r\n\t};\r\n\r\n\tconst qtyRanges = new Array();\r\n\tconst availablePricing = getAvailablePrices();\r\n\tif (availablePricing == null || Object.keys(availablePricing).length == 1) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tfor (const qtyRange in availablePricing) {\r\n\t\tconst [min, max] = ParseQuantityRange(qtyRange);\r\n\t\tconst pricing = availablePricing[qtyRange];\r\n\t\tqtyRanges.push({ min: min, max: max, price: pricing });\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\r\n\t\t\t\t{qtyRanges.map((qtyRange) => (\r\n\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\r\n\t\t\t\t))}\r\n\t\t\t\r\n\t\t
\r\n\t\t\t\t\t\t{Localizer('QuantityBreaks')}\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\t{qtyRange.max == Infinity ? (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t{qtyRange.min}\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{qtyRange.min}\r\n\t\t\t\t\t\t\t\t\t{' - '}\r\n\t\t\t\t\t\t\t\t\t{qtyRange.max}\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\r\n\t\t\t\t\t\t
\r\n\t);\r\n}\r\n","import { GetMinimumOrderQuantity, GetPriceForQuantity, GetPricingLine } from 'features/commerce/pricing/pricing-result';\r\nimport React, { useEffect, useState } from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport ProductPricing from 'shared/components/commerce/ProductPricing';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport { dispatchRocEvent } from 'shared/hooks/useRocEventHandler';\r\nimport { useProductDetailsContext } from '../ProductDetailsContext';\r\nimport { ProductType } from '../types';\r\nimport ProductAddToCart from '../ProductAddToCart';\r\nimport { ProductTable } from './ProductTable';\r\nimport { ProductBreadcrumbs, ProductMedia } from '../ProductDetails';\r\nimport { MY_ACCOUNT_LOGIN_URL } from 'features/my-account/routes.roc';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { useTapeCaseProductDetailsContext } from './TapeCaseProductDetailsContext';\r\nimport { TapeCaseProductDetailsProvider } from './TapeCaseProductDetailsContextProvider';\r\nimport { ProductDetailsProvider } from './ProductDetailsProvider';\r\nimport { ProductQuantityBreaks } from './ProductQuantityBreaks';\r\n\r\n/**\r\n * Main, project-specific component that renders the product details using react portals\r\n */\r\nfunction TapeCaseProductDetails() {\r\n\tconst [canGoBack, setCanGoBack] = useState('');\r\n\r\n\tuseEffect(() => {\r\n\t\tsetCanGoBack(sessionStorage.getItem('canGoBack') || '');\r\n\t\tsessionStorage.removeItem('canGoBack');\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\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\r\nfunction ProductDetails() {\r\n\tconst {\r\n\t\tstate: { productDetails, groupId },\r\n\t} = useProductDetailsContext();\r\n\r\n\tuseEffect(() => {\r\n\t\tdispatchRocEvent('product-viewed', {\r\n\t\t\tproductName: productDetails.summary.name,\r\n\t\t\tsku: productDetails.summary.sku,\r\n\t\t\tproductId: productDetails.id,\r\n\t\t\tproductGroupId: groupId !== '' ? groupId : null,\r\n\t\t\tselections: productDetails.selections ?? null,\r\n\t\t});\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, []);\r\n\r\n\tuseEffect(() => {\r\n\t\tconst additionalProductInfoLink = document.querySelector(\r\n\t\t\t`[data-testid=\"product-page-additional-product-info-link\"]`,\r\n\t\t);\r\n\t\tif (additionalProductInfoLink == null || !additionalProductInfoLink.classList.contains('roc-hidden')) {\r\n\t\t\t// link element not found or it's already displayed - no need for additional manipulation on the client-side\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// this is the case when Additional Product Info link is hidden\r\n\t\t// we need to check if there are any tabs loaded on the client side\r\n\t\tif (productDetails.tabs != null && productDetails.tabs.some((t) => t.model != null || t.rawHtml != null)) {\r\n\t\t\tadditionalProductInfoLink.classList.remove('roc-hidden');\r\n\t\t}\r\n\t}, [productDetails.tabs]);\r\n\r\n\treturn productDetails.summary.type == ProductType.Group ? (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\r\n\t) : (\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\n//#region React Portals\r\n\r\n/**\r\n * Product page main info header, containing the pricing (w/o rating like it is in framework)\r\n */\r\nexport function ProductHeader() {\r\n\tconst {\r\n\t\tstate: { productDetails, hasError, productQuantity },\r\n\t\tactor: { isLoadingAny },\r\n\t} = useProductDetailsContext();\r\n\r\n\tconst mainInfoHeaderDom = document.getElementById('product-details-main-info-header');\r\n\tif (!mainInfoHeaderDom) {\r\n\t\tconsole.warn('Main info header DOM element not found.');\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst getDetail = () => {\r\n\t\tif (productDetails.displayPricing == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tconst selectedPricingLineId =\r\n\t\t\tproductDetails.pricingLines &&\r\n\t\t\tproductDetails.pricingLines.selected &&\r\n\t\t\tproductDetails.pricingLines.selected.id;\r\n\r\n\t\tconst displayPriceLine = GetPricingLine(\r\n\t\t\tproductDetails.displayPricing,\r\n\t\t\tproductDetails.id,\r\n\t\t\tselectedPricingLineId,\r\n\t\t);\r\n\r\n\t\tlet moq = productQuantity;\r\n\t\tif (selectedPricingLineId && productDetails.displayPricing) {\r\n\t\t\tconst selectedPricingLine = GetPricingLine(\r\n\t\t\t\tproductDetails.displayPricing,\r\n\t\t\t\tproductDetails.id,\r\n\t\t\t\tselectedPricingLineId,\r\n\t\t\t);\r\n\t\t\tif (selectedPricingLine) {\r\n\t\t\t\tmoq = GetMinimumOrderQuantity(selectedPricingLine);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn (\r\n\t\t\tdisplayPriceLine && GetPriceForQuantity(displayPriceLine.prices, Math.max(moq ?? 1, productQuantity ?? 1))\r\n\t\t);\r\n\t};\r\n\r\n\tconst productHeaderInfo = (\r\n\t\t<>\r\n\t\t\t{!isLoadingAny(['displayPricing']) ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t{!productDetails.summary.isDiscontinued && (\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\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) : !hasError ? (\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t\r\n\t);\r\n\r\n\treturn ReactDOM.createPortal(productHeaderInfo, mainInfoHeaderDom);\r\n}\r\n\r\n/**\r\n * Add to Cart and Quantity components\r\n */\r\nexport function AddToCart() {\r\n\tconst {\r\n\t\tstate: { productDetails, productQuantity },\r\n\t\tactor: { setProductQuantity },\r\n\t} = useProductDetailsContext();\r\n\r\n\tconst productAddToCartDom = document.getElementById('product-add-to-cart');\r\n\tif (!productAddToCartDom) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst productAddToCart = (\r\n\t\t {}}\r\n\t\t\tsetSelectedProductPricingLineId={() => {}}\r\n\t\t/>\r\n\t);\r\n\r\n\treturn ReactDOM.createPortal(productAddToCart, productAddToCartDom);\r\n}\r\n\r\n/**\r\n * Login Link for Contract Pricing\r\n */\r\nexport function ContractPricingLoginLink() {\r\n\tconst {\r\n\t\tstate: { productUrl },\r\n\t\tactor: { isContractPricingAvailable },\r\n\t} = useTapeCaseProductDetailsContext();\r\n\r\n\tconst contractPricingLoginLinkDom = document.getElementById('product-contract-pricing-login-link');\r\n\tif (!contractPricingLoginLinkDom) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tif (isContractPricingAvailable()) {\r\n\t\tcontractPricingLoginLinkDom.classList.remove('roc-hidden');\r\n\t}\r\n\r\n\tconst contractPricingLoginLink = (\r\n\t\t<>\r\n\t\t\t{isContractPricingAvailable() == true ? (\r\n\t\t\t\t\r\n\t\t\t\t\t{Localizer('LoginToSeeContractPricing')}\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t\r\n\t);\r\n\r\n\treturn ReactDOM.createPortal(contractPricingLoginLink, contractPricingLoginLinkDom);\r\n}\r\n\r\nexport default TapeCaseProductDetails;\r\n","import React from 'react';\r\nimport { initReactApp } from 'shared/util/ApplicationInit';\r\nimport TapeCaseProductDetails from './TapeCaseProductDetails';\r\n\r\nconst render = initReactApp(() => , 'product-details');\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('./TapeCaseProductDetails', () => {\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 React from 'react';\r\nimport { RouteProps } from 'react-router';\r\nimport {\r\n\tMY_ACCOUNT_ADDRESS_BOOK_CREATE_URL,\r\n\tMY_ACCOUNT_ADDRESS_BOOK_EDIT_URL,\r\n\tMY_ACCOUNT_ADDRESS_BOOK_URL,\r\n\tMY_ACCOUNT_PATH_PREFIX,\r\n} from './routes.roc';\r\n\r\n//#region TapeCase\r\nimport { OrganizationUIComponents } from 'features/commerce/organization/OrganizationUIComponents';\r\nimport {\r\n\tORGANIZATION_USERS_URL,\r\n\tORGANIZATION_SHIPTOS_URL,\r\n\tORGANIZATION_ORDERS_URL,\r\n\tORGANIZATION_USERS_CREATE_URL,\r\n} from 'features/commerce/organization/routes';\r\nimport { ServerData } from 'services/ServerData';\r\n//#endregion TapeCase\r\n\r\n//#region URLs\r\nexport const MY_ACCOUNT_ORDERS_URL = `${MY_ACCOUNT_PATH_PREFIX}/orders`;\r\nexport const MY_ACCOUNT_STORE_URL = `${MY_ACCOUNT_PATH_PREFIX}/store`;\r\nexport const MY_ACCOUNT_SAVED_FOR_LATER_URL = `${MY_ACCOUNT_PATH_PREFIX}/saved-for-later`;\r\nexport const MY_ACCOUNT_SAVED_CARTS_URL = `${MY_ACCOUNT_PATH_PREFIX}/saved-carts`;\r\nexport const MY_ACCOUNT_BUY_AGAIN_URL = `${MY_ACCOUNT_PATH_PREFIX}/buy-again`;\r\nexport const MY_ACCOUNT_SHOPPING_LISTS_URL = `${MY_ACCOUNT_PATH_PREFIX}/shopping-lists`;\r\nexport const MY_ACCOUNT_ORGANIZATION_REVIEW_URL = `${MY_ACCOUNT_PATH_PREFIX}/organization-review`;\r\nexport const MY_ACCOUNT_ORGANIZATION_SELECTOR_URL = `${MY_ACCOUNT_PATH_PREFIX}/organization-selector`;\r\nexport const MY_ACCOUNT_SHOPPING_LISTS_CREATE_URL = `${MY_ACCOUNT_SHOPPING_LISTS_URL}/create`;\r\n//#endregion URLs\r\n\r\n//#region TapeCase Customization\r\nexport const MY_ACCOUNT_USER_SHIPPING_ACCOUNT_URL = `${MY_ACCOUNT_PATH_PREFIX}/shipping-accounts`;\r\nexport const MY_ACCOUNT_USER_SHIPPING_ACCOUNT_CREATE_URL = `${MY_ACCOUNT_USER_SHIPPING_ACCOUNT_URL}/create`;\r\nexport const MY_ACCOUNT_USER_SHIPPING_ACCOUNT_EDIT_URL = `${MY_ACCOUNT_USER_SHIPPING_ACCOUNT_URL}/edit`;\r\n//#endregion TapeCase\r\n\r\n//#region Components\r\nconst OrdersComponent = React.lazy(\r\n\t() => import(/* webpackChunkName: \"my-account-orders\" */ '../commerce/my-account/orders/OrderListing'),\r\n);\r\n\r\nconst OrderDetailsComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-order-details\" */ '../commerce/my-account/orders/MyAccountOrderDetails'\r\n\t\t),\r\n);\r\n\r\nconst StoreComponent = React.lazy(\r\n\t() => import(/* webpackChunkName: \"my-account-store\" */ '../commerce/my-account/store/Store'),\r\n);\r\n\r\nconst AddressBookComponent = React.lazy(\r\n\t() => import(/* webpackChunkName: \"my-account-address-book\" */ '../address-book/AddressBook'),\r\n);\r\n\r\nconst AddressBookEditComponent = React.lazy(\r\n\t() => import(/* webpackChunkName: \"my-account-address-book-edit\" */ '../address-book/AddressBookEdit'),\r\n);\r\n\r\nconst SavedForLaterComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-saved-for-later\" */ '../commerce/my-account/saved-for-later/SavedForLaterListingWrapper'\r\n\t\t),\r\n);\r\n\r\nconst SavedCartsComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-saved-carts\" */ '../commerce/my-account/saved-carts/SavedCartsListingWrapper'\r\n\t\t),\r\n);\r\n\r\nconst BuyAgainComponent = React.lazy(\r\n\t() => import(/* webpackChunkName: \"buy-again\" */ '../commerce/my-account/buy-again/BuyAgain'),\r\n);\r\n\r\nconst AccountOverviewComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-account-overview\" */ '../commerce/my-account/account-overview/AccountOverview'\r\n\t\t),\r\n);\r\n\r\nconst ShoppingListsComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-shopping-lists\" */ '../commerce/my-account/shopping-lists/ShoppingListListing'\r\n\t\t),\r\n);\r\n\r\nconst ShoppingListsCreateComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-shopping-lists-create\" */ '../commerce/my-account/shopping-lists/ShoppingListsCreate'\r\n\t\t),\r\n);\r\n\r\nconst ShoppingListDetailsComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-shopping-list-details\" */ '../commerce/my-account/shopping-lists/MyAccountShoppingListDetails'\r\n\t\t),\r\n);\r\n\r\nconst OrganizationReviewComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-organization-approval\" */ '../commerce/my-account/organization/OrganizationReview'\r\n\t\t),\r\n);\r\n\r\nconst OrganizationSelectorComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-organization-selector\" */ '../commerce/my-account/organization/OrganizationSelector'\r\n\t\t),\r\n);\r\n\r\nconst OrganizationOrderDetailsComponent = React.lazy(() => {\r\n\tconst orderDetailsComponent =\r\n\t\tServerData?.OrderDetailsUIComponent && ServerData?.OrderDetailsUIComponent in OrganizationUIComponents\r\n\t\t\t? ServerData.OrderDetailsUIComponent\r\n\t\t\t: OrganizationUIComponents.DefaultOrganizationOrderDetails;\r\n\treturn import(\r\n\t\t/* webpackChunkName: \"organization-order-details\" */ `../commerce/organization/orders/${orderDetailsComponent}`\r\n\t);\r\n});\r\n\r\nconst OrganizationShiptosComponent = React.lazy(\r\n\t() => import(/* webpackChunkName: \"ship-to\" */ '../commerce/organization/ship-to/OrganizationShipTos'),\r\n);\r\n\r\nconst OrganizationUsersComponent = React.lazy(\r\n\t() => import(/* webpackChunkName: \"org-users\" */ '../commerce/organization/users/OrganizationUsers'),\r\n);\r\n\r\nconst OrganizationOrdersComponent = React.lazy(\r\n\t() => import(/* webpackChunkName: \"org-orders\" */ '../commerce/organization/orders/OrganizationOrders'),\r\n);\r\n\r\nconst OrganizationUsersCreateComponent = React.lazy(\r\n\t() => import(/* webpackChunkName: \"org-users-create\" */ '../commerce/organization/users/OrganizationUsersCreate'),\r\n);\r\n\r\nconst UserShippingAccountsComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-address-book\" */ '../commerce/user-shipping-account/UserShippingAccounts'\r\n\t\t),\r\n);\r\n\r\nconst UserShippingAccountsEditComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-address-book-edit\" */ '../commerce/user-shipping-account/UserShippingAccountsEdit'\r\n\t\t),\r\n);\r\n//#endregion\r\n//#endregion Components\r\n\r\n//#region Routes\r\nconst ordersRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_ORDERS_URL,\r\n\tcomponent: OrdersComponent,\r\n};\r\n\r\nconst orderDetailsRoute = {\r\n\texact: true,\r\n\tpath: `${MY_ACCOUNT_ORDERS_URL}/:orderNo`,\r\n\tcomponent: OrderDetailsComponent,\r\n};\r\n\r\nconst storeRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_STORE_URL,\r\n\tcomponent: StoreComponent,\r\n};\r\n\r\nconst addressBookRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_ADDRESS_BOOK_URL,\r\n\tcomponent: AddressBookComponent,\r\n};\r\n\r\nconst addressBookCreateRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_ADDRESS_BOOK_CREATE_URL,\r\n\tcomponent: AddressBookEditComponent,\r\n};\r\n\r\nconst addressBookEditRoute = {\r\n\texact: true,\r\n\tpath: `${MY_ACCOUNT_ADDRESS_BOOK_EDIT_URL}/:addressId`,\r\n\tcomponent: AddressBookEditComponent,\r\n};\r\n\r\nconst savedForLaterRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_SAVED_FOR_LATER_URL,\r\n\tcomponent: SavedForLaterComponent,\r\n};\r\n\r\nconst savedCartsRoute = {\r\n\texect: true,\r\n\tpath: MY_ACCOUNT_SAVED_CARTS_URL,\r\n\tcomponent: SavedCartsComponent,\r\n};\r\n\r\nconst buyAgainRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_BUY_AGAIN_URL,\r\n\tcomponent: BuyAgainComponent,\r\n};\r\n\r\nconst shoppingListsRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_SHOPPING_LISTS_URL,\r\n\tcomponent: ShoppingListsComponent,\r\n};\r\n\r\nconst shoppingListsCreateRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_SHOPPING_LISTS_CREATE_URL,\r\n\tcomponent: ShoppingListsCreateComponent,\r\n};\r\n\r\nconst shoppingListDetailsRoute = {\r\n\texact: true,\r\n\tpath: `${MY_ACCOUNT_SHOPPING_LISTS_URL}/:shoppingListId`,\r\n\tcomponent: ShoppingListDetailsComponent,\r\n};\r\n\r\nconst defaultRoute = {\r\n\texact: false,\r\n\tpath: '*',\r\n\tcomponent: AccountOverviewComponent,\r\n};\r\n\r\nconst organizationReviewRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_ORGANIZATION_REVIEW_URL,\r\n\tcomponent: OrganizationReviewComponent,\r\n};\r\n\r\nconst organizationSelectorRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_ORGANIZATION_SELECTOR_URL,\r\n\tcomponent: OrganizationSelectorComponent,\r\n};\r\n//#region TapeCase\r\n\r\nconst OrganizationUsersRoute = {\r\n\texact: true,\r\n\tpath: ORGANIZATION_USERS_URL,\r\n\tcomponent: OrganizationUsersComponent,\r\n};\r\n\r\nconst OrganizationShipTosRoute = {\r\n\texact: true,\r\n\tpath: ORGANIZATION_SHIPTOS_URL,\r\n\tcomponent: OrganizationShiptosComponent,\r\n};\r\n\r\nconst OrganizationOrdersRoute = {\r\n\texact: true,\r\n\tpath: ORGANIZATION_ORDERS_URL,\r\n\tcomponent: OrganizationOrdersComponent,\r\n};\r\n\r\nconst OrganizationCreateUserRoute = {\r\n\texact: true,\r\n\tpath: ORGANIZATION_USERS_CREATE_URL,\r\n\tcomponent: OrganizationUsersCreateComponent,\r\n};\r\n\r\nconst OrganizationOrderDetailsRoute = {\r\n\texact: true,\r\n\tpath: ORGANIZATION_ORDERS_URL,\r\n\tcomponent: OrganizationOrderDetailsComponent,\r\n};\r\n//#endregion TapeCase\r\n//#endregion Routes\r\n\r\n//#region TapeCase Routes\r\nconst userShippingAccountsRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_USER_SHIPPING_ACCOUNT_URL,\r\n\tcomponent: UserShippingAccountsComponent,\r\n};\r\n\r\nconst userShippingAccountsCreateRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_USER_SHIPPING_ACCOUNT_CREATE_URL,\r\n\tcomponent: UserShippingAccountsEditComponent,\r\n};\r\n\r\nconst userShippingAccountsEditRoute = {\r\n\texact: true,\r\n\tpath: `${MY_ACCOUNT_USER_SHIPPING_ACCOUNT_EDIT_URL}/:shippingAccountId`,\r\n\tcomponent: UserShippingAccountsEditComponent,\r\n};\r\n//#endregion\r\n\r\nexport const commerceRoutes: RouteProps[] = [\r\n\tordersRoute,\r\n\torderDetailsRoute,\r\n\tstoreRoute,\r\n\taddressBookRoute,\r\n\taddressBookCreateRoute,\r\n\taddressBookEditRoute,\r\n\tsavedForLaterRoute,\r\n\tsavedCartsRoute,\r\n\tbuyAgainRoute,\r\n\tshoppingListsRoute,\r\n\tshoppingListsCreateRoute,\r\n\tshoppingListDetailsRoute,\r\n\torganizationReviewRoute,\r\n\torganizationSelectorRoute,\r\n\t//#region TapeCase\r\n\tuserShippingAccountsRoute,\r\n\tuserShippingAccountsCreateRoute,\r\n\tuserShippingAccountsEditRoute,\r\n\tOrganizationCreateUserRoute,\r\n\tOrganizationUsersRoute,\r\n\tOrganizationShipTosRoute,\r\n\tOrganizationOrdersRoute,\r\n\tOrganizationOrderDetailsRoute,\r\n\t//#endregion\r\n\tdefaultRoute,\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 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":""}