{"version":3,"sources":["webpack:///src/modules/fabrikam/views/components/promocode.component.tsx?7eef","webpack:///src/modules/fabrikam/views/components/cartlineitem.component.tsx?4b07","webpack:///src/modules/social-share-item/social-share-item.tsx?e01b","webpack:///src/modules/order-template-list/components/order-template-list.tsx?f2fd","webpack:///src/modules/order-template-list/components/orderTemplateList-status-message.tsx?dbea","webpack:///src/modules/video-player/video-player.tsx?cfb9","webpack:///src/common/rnrInterface.ts?25e5","webpack:///src/modules/order-template/order-template.tsx?4281","webpack:///src/modules/ratings-histogram/component/components.tsx?2a0b","webpack:///src/modules/ratings-histogram/ratings-histogram.tsx?4c32","webpack:///src/modules/wishlist-items/components/wishlist-items-dimensions.tsx?671e","webpack:///src/modules/wishlist-items/components/wishlist-item.tsx?1fe2","webpack:///src/modules/wishlist-items/components/wishlist-items-status-message.tsx?7062","webpack:///src/modules/wishlist-items/wishlist-items.tsx?3721","webpack:///src/actions/inputs/report-review-concern-input.ts?c9d1","webpack:///src/actions/inputs/submit-helpfulness-vote-input.ts?cfb5","webpack:///src/actions/report-review-concern.ts?11eb","webpack:///src/actions/submit-helpfulness-vote.ts?be08","webpack:///src/modules/reviews-list/components/components.tsx?c96f","webpack:///src/modules/reviews-list/components/report-review-modal.tsx?22a9","webpack:///src/modules/reviews-list/components/review-card.tsx?2d16","webpack:///src/modules/reviews-list/reviews-list.tsx?b5d0","webpack:///src/modules/search-result-container/components/link.tsx?d3ce","webpack:///src/modules/search-result-container/components/product-search-result-items.tsx?1766","webpack:///src/modules/search-result-container/components/feature-search-result-item.tsx?98c1","webpack:///src/modules/search-result-container/components/title.tsx?365d","webpack:///src/modules/search-result-container/components/separator.tsx?7b76","webpack:///src/modules/search-result-container/components/utilities.ts?41e3","webpack:///src/modules/search-result-container/components/range-refine-item.tsx?6e24","webpack:///src/modules/search-result-container/components/refine-item.tsx?b232","webpack:///src/modules/search-result-container/components/choice-summary.tsx?f4a7","webpack:///src/modules/search-result-container/components/modal.tsx?afdd","webpack:///src/modules/search-result-container/components/refine-submenu.tsx?1e62","webpack:///src/modules/search-result-container/components/error-message.tsx?c0c2","webpack:///src/modules/search-result-container/search-result-container.tsx?97e0","webpack:///src/modules/carousel/carousel.view.tsx?b19a","webpack:///src/modules/cart-icon/components/flyout-cart-line-items.tsx?a0df","webpack:///src/modules/cart-icon/utils/get-products-in-mini-cart.ts?f52c","webpack:///src/modules/cart-icon/cart-icon.tsx?5b5f","webpack:///src/modules/product-collection/product-collection.tsx?b9b8","webpack:///src/modules/fabrikam/utilities/quantity/Quantity.tsx?f073","webpack:///src/modules/order-template/components/common/order-template-quantity.tsx?dfc0","webpack:///src/modules/order-template/components/order-template-lines.tsx?cdf6","webpack:///src/modules/order-template/components/order-template-lines-status-message.tsx?0022","webpack:///src/modules/order-template/components/order-template-table-heading.tsx?606c","webpack:///src/modules/order-template/components/order-template-actions.tsx?5f39","webpack:///src/modules/order-template/components/bulk-actions.tsx?f343","webpack:///src/modules/order-template/components/add-line/add-line.tsx?add3","webpack:///src/modules/order-template/components/add-line/spinner.tsx?28dd","webpack:///src/modules/order-template/components/add-line/dropdown.tsx?40af","webpack:///src/modules/order-template/components/add-line/not-found.tsx?00ed","webpack:///src/modules/order-template/components/add-line/product-configuration.tsx?ac81","webpack:///src/modules/order-template/components/add-line/product-list.tsx?5107","webpack:///src/actions/inputs/submit-user-review-input.ts?921c","webpack:///src/actions/submit-user-review.ts?d4c7","webpack:///src/common/review-modal.tsx?7ef9","webpack:///src/modules/write-review/components/components.tsx?ead4","webpack:///src/modules/write-review/write-review.tsx?dea3","webpack:///src/modules/order-template-list/components/create-order-template.tsx?81ed","webpack:///src/modules/order-template-list/order-template-list.tsx?bc4a","webpack:///src/modules/promo-banner/components/close-button.tsx?939d","webpack:///src/modules/promo-banner/components/links.tsx?3133","webpack:///src/modules/promo-banner/components/text.tsx?834e","webpack:///src/modules/promo-banner/promo-banner.tsx?958e","webpack:///src/index.ts?c6ae","webpack:///src/modules/order-template/order-template.view.tsx?f2c8","webpack:///src/modules/order-template-list/order-template-list.view.tsx?20f7"],"names":["PromoCode","props","state","super","_onInputChange","e","error","target","value","this","setState","promoCodeInputValue","canApply","_applyPromotion","cartState","cart","appliedPromo","addPromoCode","promoCode","then","result","status","substatus","duplicatePromoCodeErrorText","invalidPromoCodeErrorText","catch","failedToAddPromoCodeErrorText","_renderForm","promoPlaceholderText","promoCodeApplyButtonText","attributes","telemetryContent","payLoad","onSubmit","event","preventDefault","className","onChange","placeholder","title","onClick","disabled","_removePromotion","code","currentTarget","getAttribute","removePromoCodes","promoCodes","failedToRemovePromoCodeErrorText","_calculateDiscount","CartLines","length","discountAmount","line","DiscountLines","discountLine","DiscountCode","DiscountCost","_renderAppliedPromoCode","Coupons","promoCodTotalDiscount","reduce","count","coupon","Code","appliedPromoCodeHeadingText","data","price","CustomerContextualPrice","context","id","typeName","map","ariaLabel","removePromoAriaLabelFormat","removePromoText","key","ApplyPromoCode","isCollapseOpen","promoCodeHeadingText","CartLineItemFunctions","Product","DimensionStrings","Dimensions","productDimension","DimensionTypeValue","RecordId","colorString","DimensionValue","Value","configString","sizeString","IsGiftCard","amountString","styleString","cartLine","index","OfferId","OfferName","resources","discountStringText","isSalesLine","PeriodicDiscount","EffectiveAmount","BasePrice","undefined","Percentage","inventoryInformationLabel","inventoryCssName","inventoryLabelClassName","pickupDeliveryModeCode","request","channel","PickupDeliveryModeCode","channelDeliveryOptionConfig","cartline","hasShippingMethod","DeliveryMode","PickupDeliveryModeCodes","some","deliveryMode","shippingChargeLines","ChargeLines","filter","chargeLine","IsShipping","freightFee","chargeTotal","CalculatedAmount","priceComponent","freePriceText","shippingChargesText","otherCharges","chargeline","otherCharge","Description","productUrl","product","destructDimensionStrings","fallbackImageUrl","ItemId","actionContext","requestContext","apiSettings","productDimensions","imageSettings","cropFocalRegion","renderDisountLines","renderInventoryLabel","renderShippingLabel","renderOtherCharges","toString","prodAttribute","productName","Name","newValue","quantityOnChange","_generateErrorMessage","errorMessage","src","primaryImageUrl","fallBackSrc","altText","gridSettings","loadFailureBehavior","href","hasElements","NetAmount","Price","NetAmountWithoutTax","NetPrice","showShippingChargesForLineItems","nodes","isOutOfStock","isQuantityEditable","push","quantityDisplayString","max","maxQuantity","currentCount","currentQuantity","inputQuantityAriaLabel","decrementButtonAriaLabel","incrementButtonAriaLabel","LineId","isCartStateReady","isGiftCard","Quantity","originalPriceText","currentPriceText","DiscountAmount","DiscountAmountWithoutTax","_generateQuantityandPrice","SocialShareItem","_getSocialShareItem","bind","viewprops","moduleProps","SocialShareItemElement","renderView","config","icon","isBrowser","socialMedia","Facebook","postUrl","document","URL","Twitter","Pinterest","Linkedin","Mail","OrderTemplateActions","onRemoveOrderTemplate","handlers","itemKey","OrderTemplateRender","input","Id","orderTemplate","removeFromOrderTemplateListText","orderTemplateState","name","enableImageProductLink","onDismiss","orderTemplateImage","_renderOrderTemplateImages","orderTemplateLines","orderTemplateAriaLabel","_renderAriaLabel","orderTemplateName","url","separator","includes","_getOrderTemplatePageUrl","totalLines","color","addToCartButton","moduleTypeName","addToCartText","addToBagText","dialogStrings","removeButton","orderTemplateStatusMessage","isOpen","userMessage","statusCssString","toggle","defaultImageSettings","viewports","xs","q","w","h","lg","xl","lazyload","slice","fullProduct","ProductDetails","PrimaryImageUrl","window","location","assign","OrderTemplateListStatusMessage","errorType","text","VideoPlayer","telemetryPageName","friendlyName","telemetry","options","video","playerResources","playAriaLabel","playLabel","pauseAriaLabel","pauseLabel","playingAriaLabel","playingLabel","pausedAriaLabel","pausedLabel","muteAriaLabel","muteLabel","unMuteAriaLabel","unMuteLabel","fullScreenAriaLabel","fullScreenLabel","exitFullScreenAriaLabel","exitFullScreenLabel","seekBarLabel","videoTimeDurationLabel","closedCaptionLabel","videoMetaData","videoId","duration","playTime","thumbnail","posterframeUrl","_links","binaryReferences","videoBinaryReferences","videoPlayerData","metaData","viewProps","player","editProps","playerData","isEditor","params","TOGGLE_REVIEW_MODAL_BUTTON_ID","TOGGLE_EDIT_MODAL_BUTTON_CARD_ID","OrderTemplateLines","_onRemoveSelection","removeSelectedFailureMessage","removeSelectedSuccessMessage","lines","productSelection","productListLines","isChecked","productListLine","productListId","ProductListId","callerContext","messageGlyph","reload","warning","substr","indexOf","productList","_onAddSelectionToBag","async","addedToCartFailureMessage","addedToCartSuccessMessage","selectedLines","cartLines","productLine","ProductId","TrackingId","UnitOfMeasureSymbol","UnitOfMeasure","DefaultUnitOfMeasure","Version","trace","join","refreshCart","Promise","resolve","_getCurrentUrl","reqContext","requestUrl","_renderItemAddedToCartDialog","itemAddedToCartDialogData","_generateItemAddedToCartDialogResources","modalOpen","isItemAddedToOrderTemplateOpen","onClose","_renderPagination","fullUrl","itemsPerPage","skipCount","_getCurrentPageNumber","totalItems","previousText","flipperPrevious","nextText","flipperNext","role","paginationAriaLabel","qsp","items","startingItem","previousAriaLabel","nextAriaLabel","_toggleDetailsDisplayed","isDetailsDisplayed","detailedProductView","_onDismiss","_changeQuantity","quantity","orderTemplateLinesData","orderLineIndex","findIndex","newProductListLine","prevQuantity","list","newLine","find","updatedLines","updatedOrderTemplate","ProductListLines","update","_addItemToBag","maxQuantityLimitText","addProductToCartInput","addProductToCart","channelId","priceResult","productPrice","reject","replace","app","maxQuantityForProductListLineItem","debug","_removeItemFromOrderTemplateLines","user","isAuthenticated","token","_renameTemplate","_removeTemplate","deleteOrderTemplateFailedText","newLink","_getViewport","device","Type","innerWidth","sm","md","_viewport","_updateViewport","isConfirmAddSelectionToBagModalOpen","signInUrl","heading","addEventListener","removeEventListener","emptyOrderTemplateLinesText","errorGettingOrderTemplateLines","errorProps","statusMessage","orderTemplateResult","_isFirstPage","emptyViewProps","productsStatusMessage","tag","ProductsTable","ProductsTableRow","ProductsTableHeading","_renderProductListHeader","orderLines","_renderProductList","callbacks","updateQuantity","orderActions","_renderOrderTemplateActions","pagination","itemAddedToCartDialog","bulkOrderLineActions","_getOrderTemplateLineActions","toggleDetailsDisplayed","isMobile","updated","productNumberText","productText","productUnitPriceText","productUOMText","productQuantityText","productActionsText","headers","productNumber","productUnitPrice","productUOM","productQuantity","productActions","clickHandler","onSelectAll","orderTemplateId","onAddSelectionToBag","onRemoveSelection","isMinifiedView","viewCartButtonText","orderTemplateCloseButtonText","linesAddedToCartHeaderItemsOneText","linesAddedToCartHeaderLinesOneText","linesAddedToCartHeaderLinesFormatText","linesAddedToCartHeaderMessageText","itemAddedToCartHeaderItemOneText","itemAddedToCartHeaderItemFormatText","itemAddedToCartHeaderMessageText","addTemplateToBagButtonText","renameTemplateButtonText","deleteTemplateButtonText","closeWindowButtonText","addToCartFailureMessage","addToCartSuccessMessage","addToCartProcessMessage","orderTemplateActions","onRenameTemplate","onRemoveTemplate","renameOrderTemplateDialogStrings","_generateOrderTemplateNameDialogResources","linesAddedToCartDialogResources","_generateLinesAddedToCartDialogResources","orderTemplateHeaderLabel","renameOrderTemplateTitleText","orderTemplateTitleLabel","orderTemplateTitle","orderTemplateNameAriaLabel","orderTemplateDescription","defaultOrderTemplateName","orderTemplateButtonLabel","renameOrderTemplateButtonText","orderTemplateCancelButtonLabel","cancelBtnLabel","query","skip","priceFree","addOrderTemplateItemToBagButtonText","removeItemFromOrderTemplateButtonText","productDimensionTypeColor","productDimensionTypeSize","productDimensionTypeStyle","deleteButtonText","currentProductProps","orderTemplateLine","ProductPrice","moduleId","onAddToBag","onRemoveItem","onChangeQuantity","onSelect","removeFromOrderTemplateLinesText","addToBagButtonText","HistogramItems","ratingsSummary","totalRatingsCount","renderItem","star5Count","star4Count","star3Count","star2Count","star1Count","stars","totalCount","percentage","formattedPercent","Intl","NumberFormat","locale","style","format","barItemAriaLabel","starLabel","bar","buttonProps","AverageRatingNumber","summary","averageRating","TotalReviews","handleHeadingChange","selectFilterBy","ratingCount","completeClass","histogramItems","avgRating","averageRatingAriaLabel","readOnly","hideCount","averageNumber","totalReviews","ratingsSummaryProps","onEdit","histogramProps","filterKey","WishlistItemDimension","dimensionType","dimensionValue","WishListItemActions","onAddToCart","_renderProductImage","image","fallbackImage","_renderPrice","_renderProductDimensions","dimension","type","formattedPrice","dimensions","cultureFormatter","formatCurrency","CurrencyCode","WishlistItemsStatusMessage","_renderHeading","_addItemToCart","productAvailability","productInventoryInformation","_getProductInventory","isOrderQuantityLimitsFeatureEnabledInHq","featureState","IsEnabled","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","customerInfo","customerInformation","isOrderQuantityLimitsFeatureEnabledInSiteSettings","IsB2b","isOrderQuantityLimitsFeatureEnabled","emailDeliveryModeCode","EmailDeliveryModeCode","deliveryOptions","queryResultSettings","enableStockCheck","availableQuantity","ProductAvailableQuantity","AvailableQuantity","additionalProperties","orderQuantityLimitsFeatureIsEnabled","isAddEmailDeliveryItemToCart","DeliveryOptions","productId","curQuantity","item","maxQtyLimitReachedMessage","_getInventoryValueMessage","errorDetails","LocalizedMessage","_removeItemFromWishlist","wishlists","userToken","wishlistLineId","_getWishlistLineIdFromProductId","commerceList","castCommerceList","products","castSimpleProducts","_inventoryLabel","StockLevelLabel","_inventoryClassName","StockLevelCode","toLowerCase","_isProductInStock","productResult","IsProductAvailable","CommerceListLines","foundWishlistItem","commerceListLine","emptyWishlistText","wishlistErrorGettingWishlist","WishlistItems","productsList","Products","ProductDimensions","addToCartButtonText","outOfStockText","removeButtonText","productDimensionTypeAmount","isInStock","removeFromWishlistText","wishlistState","productAttributes","isServiceItem","ItemTypeValue","productImage","productLink","entireProductLink","productAriaLabel","inventoryInformation","productStatusMessage","WishlistItem","maxQuantityForLineItem","maxQuantityForCartLineItem","minInventory","Math","min","productInventoryCollection","ReportReviewConcernInput","reviewId","tenantId","concernCategory","authToken","serviceEndpoint","getCacheKey","getCacheObjectType","dataCacheType","SubmitHelpfulnessVoteInput","isHelpful","action","ctx","inputIsValid","Error","requestBody","requestHeader","Authorization","response","exception","ReviewCount","currentPage","reviewsCount","reviewsShownOnEachPage","pageReviewCountText","_getReviewStartNumber","_getReviewEndNumber","PageControls","Next","nextAttribute","contentAction","etext","Previous","previousAttribute","_hasPreviousPage","_getPreviousPageData","_paginationAriaLabel","pageReviewAriaLabel","previousButtonText","_hasNextPage","_getNextPageData","nextButtonText","_getPagesCount","_getReviewsShown","ceil","isNextPage","page","pageModifier","pageReviewCount","updateReviews","selectedSortByOption","selectedFilterByOption","reportConcernDropdownOptions","radioPairs","pairs","option","inputId","checked","reportedKey","onRadioChange","htmlFor","rating","review","reviewRatingNarratorText","parentId","parentType","voteHelpfulButton","isVoted","i","votedReviews","approved","isVotedFor","isDisabled","isUserReview","label","yesButtonText","noButtonText","voteCount","helpfulPositive","helpfulNegative","updateReviewHelpfulness","editButton","toggleWriteReviewModal","editReviewCardText","renderDate","date","DateTimeFormat","month","day","year","Date","reportToggle","reportConcernText","reportedReviews","reportedText","ref","reportedReviewId","returnRef","toggleReportReviewModal","innerRef","sortByDropdownOptions","mostHelpfulSortOptionText","mostRecentSortOptionText","highestRatedSortOptionText","lowestRatedSortOptionText","filterByDropdownOptions","allRatinsFilterByOptionText","fiveStarFilterByOptionText","fourStarFilterByOptionText","threeStarFilterByOptionText","twoStarFilterByOptionText","oneStarFilterByOptionText","_userReview","userReview","_reviewCard","_reviewCards","reviewList","reviewElements","isTakenDown","isPublished","cardProps","userName","submittedDateTime","reviewTitle","reviewText","ratingHelpfulLabel","wasReviewHelpfulText","like","dislike","edit","report","responseName","userResponse","responderName","responseText","responseDate","cardBodyProps","responseProps","reviewProps","controlsProps","headerProps","ReviewCard","_userReportModalToggle","reportingReviewId","_toggleReviewModal","_onReportModalOpen","updateReviewHelpfulnessVote","_userReviewModal","isReviewModalOpen","userReviewRating","userReviewTitle","userReviewText","onModalToggle","onTitleChange","_onTitleChange","onTextChange","_onTextChange","onRatingChange","_onRatingChange","onReviewComplete","_onReviewComplete","renderContextId","_userReviewModalToggle","hasError","hasReviewError","reviewsListCallbacks","updateReviewTitle","updateReviewText","updateRating","isSuccess","_reportReviewModal","SubmitReview","submitReviewAttribute","SuccessButton","successAttribute","Cancel","cancelAttribute","reportSpamText","offensiveContentText","profanityContentText","modal","applicationNode","returnFocusRef","modalHeader","modalFooter","modalBody","header","headerSubmitted","feedbackThankYouText","cancelButton","cancelReportReviewText","submitButton","reportReview","reportReviewButtonText","succesfulButton","okReportReviewText","reportMessage","reportModalMessage","reportSubmittedMessage","radioButtons","errorMessageText","ReportReviewModal","isReportModalOpen","_onReportModalClose","_onRadioChange","_reportReview","hasReportError","reported","_reportReviewCallback","getUserToken","_value","reportedReview","updateSortByDropdown","notification","selectedOption","isFilterApplied","updateFilterByDropdown","skipItems","pagingInfo","listOfReviews","_updateVoteUi","alreadyExists","concat","onReviewSubmitted","isSuccessful","submitReview","toggleModal","toggleReportModal","showSpinner","reviewsList","ratingsReviewsState","filterKeyValue","Number","dropdownItemsCount","isNaN","filterByOption","selectedIndex","reviewModal","reportReviewModal","filterByDropdown","labelText","filterByDropdownText","dropdownId","dropdownOptions","onSelectOption","controlledByParent","sortByDropdown","sortByDropdownText","reviewCount","refineReviewsProps","reviewsListProps","reviewCards","pageControls","noReviewsMessage","noReviewsWithFilterMessage","noReviewsWithSelectedFilterMessage","sortByOptions","filterByOptions","Link","ProductSearchResultItems","moduleType","allowBackNavigation","ratingAriaLabel","allowBack","FeatureSearchResultItem","productRecordId","attribute","imageUrl","img","imageProps","renderProductPlacementImage","featureSimilarLooksTitle","Title","Separator","isRangeType","dataTypeValue","findMatchingRefinementCriterion","productRefinerValue","refinementCriteria","refinementCriterion","isMatchingRefinementCriterion","RefinerRecordId","RefinerSourceValue","DataTypeValue","LeftValueBoundString","getUpdatedRefinementCriteria","itemToggleNotification","currentRefinementCriteria","updatedRefinementCriteria","toggledItemFound","forEach","selectedCriterion","isSelecting","next","rangeStart","RightValueBoundString","rangeEnd","parentProductRefinerHierarchy","RefinerTypeValue","Values","child","matchingIndex","criterion","splice","_formattedPriceReverseLookup","Map","_onRangeUpdate","_onRangeUpdateEnd","_handleRangeTooltipText","_changeMin","_changeMax","_finishChangeMin","_finishChangeMax","minInput","maxInput","selectedRefinementCriterion","initialMin","initialMax","validationErrorMin","validationErrorMax","selectedMin","selectedMax","touchedMin","touchedMax","UnitText","refineItemCommonProps","rangeType","_renderInputFields","_renderSlider","formAttrs","rangeNameFormat","KeyName","minInputClassName","maxInputClassName","formattedSelectedMin","_getFormattedSelectedValue","formattedSelectedMax","minLabel","onFocus","onBlur","maxLabel","placeholderTextMax","sliderId","ariaAttributes","minPrice","_formatPrice","maxPrice","selectedMinPrice","selectedMaxPrice","inForm","step","orientation","labels","labelId","labelString","labelPositioning","showLabels","showTooltip","sliderThumbs","minValueSliderThumbAriaLabel","currencyCode","ariaValueText","maxValueSliderThumbAriaLabel","onChangeEnd","handleTooltipText","_changeValue","inputType","selectedKey","touchedKey","_getInputWithoutFormatting","selectedMinValue","minTouched","onToggle","maxNum","validationErrorNaN","_focus","_validateRange","selectedMaxValue","maxTouched","minNum","setTimeout","current","focus","selected","touched","validationError","validationErrorRange","amount","currency","priceAmount","currencyDisplay","minimumFractionDigits","formatPrice","has","set","inputAsNum","get","sliderChangeNotification","eventType","firstThumbValue","secondThumbValue","_focusOnSliderThumb","element","getElementById","tooltip","_onClick","anchorType","children","attrs","JSON","stringify","isSingleSelect","itemTypeClassName","SourceValue","LeftValueBoundLocalizedString","_getRefinerUrl","tabIndex","Count","refinerRating","parseInt","ratingRefiner","selectedRefinerValues","selectedRating","ratingComponentClass","urlBuilder","closeButtonGlyph","stopPropagation","clearAll","selectedRefiner","_getSelectedRefinerChoice","onChoiceClicked","itemClicked","choiceClicked","nextItemToFocus","nextSibling","selectedChoices","_getKeyForRefinerValue","clearAllText","classNames","choiceAriaLabel","selectedRefinersMap","clearAllAttributes","listItemProps","choiceFormat","choiceRangeValueFormat","refinerHierarchy","overallFormat","rangeFormat","refinerValueName","refinerName","parent","hierarchy","innerText","trim","ModalToggle","modalNode","autoFocus","zIndex","modalHeaderNode","modalTitle","modalFooterNode","modalCloseButtonText","_onToggleItem","_onToggleSubmenu","isExpanded","isExpandedOnInitialLoad","expanded","productRefinerHierarchy","hideRating","timeout","_renderChildItems","_renderRange","_renderSingleMultiSelect","refinerValuesList","listItems","selectedValue","DisplayTemplateValue","_getRangeType","onUpdateRefiners","prevState","ErrorMessage","sortByOptionRelevanceDesc","sortByOptionNameAsc","sortByOptionNameDesc","sortByOptionPriceAsc","sortByOptionPriceDesc","sortByOptionRatingDesc","_pageType","urlTokens","pageType","expandrefinerCount","_getActivePrice","listPageState","activeProducts","productRecIds","prod","projectDomain","ChannelId","CatalogId","catalogId","affliations","customerInput","customer","CustomerAffiliations","affliation","aff","AffiliationId","RetailAffiliationId","CustomerId","AccountNumber","activePricesResponse","productPrices","activePrice","TradeAgreementPrice","AdjustedPrice","message","_getSearchResultModal","SearchResultModal","modalIsOpen","_modalToggleRef","_toggleModal","_getCollectionTitle","collectionTitle","category","getFriendlyName","NameTranslations","productCountNumber","productCountText","totalProductCount","numberOfProducts","oneProduct","TitleContainer","titlePrefix","searchTextPrefix","titleText","titleCount","_getCategoryHierarchy","categoryHierarchy","CategoryHierarchyContainer","categoryHierarchyList","categoryLinkAriaLabel","Url","categoryHierarchySeparator","_getSortingDropDown","activeDropdown","_getCurrentlySelectedOption","sortingState","SortingContainer","sortByDropDown","labelClassname","sortByDropdownLabel","dropdownClassname","toggleColor","_updateSortByDropdown","_sortAndFilterContainerRef","_getPagination","currentPageNumber","_getRefineMenu","tempRangeTypeTODO","inputRange","validRefiners","refiners","refiner","activeRefiners","activeFilters","_getexpandRefinerCount","expandRefinersCount","expandedRefiners","RefineMenuContainer","RefinerSectionContainer","_refineItemCommonProps","_onUpdateRefiners","_buildRefinerUrl","_getChoiceSummary","selectedRefiners","choiceSummaryLabel","_onChoiceClicked","_buildRefinerUrlForChoiceSummary","history","pushState","_getSortColumnFromSelectedOption","sortingCritera","Columns","searchConfiguration","mappedConfiguration","sortColumn","sortCriteria","activeSortColumn","activeMappedConfig","mappedSearchConfig","ColumnName","IsDescending","dropdownOption","newRefinementCriteria","dropdownElementId","dropdownElement","selectedChoice","isClearAll","refinerCount","pending","validationErrorNotNumber","validationErrorNotRange","querySorting","sorting","parse","decodeURIComponent","pageSize","Paging","Top","Skip","Sorting","itemId","includeAttributes","productResults","enableAffiliationBasedPricing","featureProduct","listPageStateFeature","nameTranslations","nameTranslation","Language","Text","searchProduct","errorText","breaCrumbType","breadcrumbType","resultCategoryNotFoundText","resultSearchNotFoundText","productsComponent","featureComponent","searchResultContainerViewProps","TitleViewProps","disableHierarchy","refineMenu","SearchResultContainer","ProductsContainer","ProductSectionContainer","CategoryNavContainer","RefineAndProductSectionContainer","choiceSummary","modalToggle","searchResultModal","FeatureSearchContainer","similarLookProduct","carouselContainer","renderModuleAttributes","closeAnimation","activeIndex","previous","pause","pauseOnHover","ride","autoplay","interval","transitionType","slots","content","hideFlipper","dismissEnabled","onIndicatorsClickHandler","handleDismissCarousel","dismissCarouselAriaText","ariaLabelForDismissButton","indicatorAriaText","ariaLabelForSlide","directionTextPrev","directionTextNext","handleOnExited","handleOnExiting","_renderStoreLocation","FulfillmentStoreId","orgUnitName","_getOrgUnitName","orgUnitLocations","fulfillmentStoreId","foundLocation","orgUnitLocation","OrgUnitNumber","OrgUnitName","_assembleCartlines","cartlines","reactNodes","_getProduct","foundProductAvailability","foundProductDeliveryOption","productAvailabilites","productDeliveryOptions","deliveryOption","foundProductDeliveryOptions","removeItemClickHandler","outOfStockThreshold","maxCartlineQuantity","isStockCheckEnabled","RemoveCartItem","removeCartItemAttribute","displayMode","remove","storeLocation","_assembleNode","getMiniCartData","miniCartData","hasInvoiceLine","Component","retailMultiplePickUpOptionEnabled","_getImageSettings","_removeItemFromCartHandler","cartlineToRemove","cartLineIds","removeCartLines","payload","CheckOut","Checkout","checkoutBySignInAttributes","GuestCheckout","checkoutByGuestAttributes","ViewShoppingBag","viewShoppingBagAttributes","enableHoverCart","guestCheckoutUrl","cartUrl","checkoutURL","_getCheckoutURL","isCartEmpty","_getCartLines","hasErrors","includeFlyout","cartSize","goToCartButtonText","goToCartButtonTitle","flyoutTitle","TotalAmount","priceString","totalPriceFormatString","feature","cartIcon","cartLabel","cartQtyLabel","FlyoutContainer","placement","hideArrow","trigger","CartlinesWrapper","miniCartWrapper","miniCartItemWrapper","checkoutAsSignInUserButton","checkoutButtonTitle","checkoutAsGuestButton","guestCheckoutButtonTitle","goToCartButton","totalPrice","isAbsoluteUrl","RegExp","test","returnURL","origin","FlyoutCartLineItems","productDimensionTypeConfiguration","quantityDisplayText","removeCartButtonText","outOfRangeOneText","outOfRangeFormatText","ProductCollection","ProductContainer","productComponent","productCollection","isCarousel","layout","headingComponent","productCollectionViewProps","SingleSlideCarouselComponentProps","flipperPrevLabel","flipperNextLabel","ProductCollectionContainer","GridComponentProps","inputRef","_validateMin","minValue","currentInput","isUpdateing","_onIncrement","_onDecrement","_handleChange","prevProps","glyphMinusClassName","decrementGlyphClass","glyphPlusClassName","incrementGlyphClass","decrementDisabled","incrementDisabled","currentValue","DecrementQuantity","decrementAttributes","IncrementQuantity","incrementAttributes","extraClassDecrement","extraClassIncrement","pattern","invokeCallback","currQuantity","updatedQuantity","inputElement","HTMLInputElement","setAttribute","defaultProps","incDisabled","extraClass","getChangeHandler","_onIncrementalChange","OrderTemplateLineActions","getAddToBag","getRemoveItem","PopUp","showMobile","setShowMobile","getActionButton","removeButtonClassName","addButtonClassName","buttonText","OrderTemplateLineView","selectLine","productInfo","renderProductInfo","productUnitOfMeasure","productQuantityView","_generateQuantity","addToBagButton","popUp","OrderTemplateMobileLineView","MAX_VALUE","OrderTemplateLinesStatusMessage","componentClassName","getOnChange","OrderTemplateActionsView","addTemplateToBag","_getOrderTemplateAddToCartDialog","renameTemplate","_getOrderTemplateRenameControl","removeTemplate","_removeOrderTemplate","isAddDisabled","isRemoveDisabled","addHandler","removeHandler","addLineModalLinkText","searchButtonAriaLabel","searchInputAriaLabel","searchModalPlaceholderText","selectProductButtonText","addItemToTemplateText","addLineProductUnitPricePrefix","backButtonText","quantitySelectLabel","addLineProductUnitOfMeasurePrefix","notFoundSearchErrorNotice","notFoundSearchErrorRedediation","searchErrorMessage","addSelectedToBagButtonText","removeSelectedToBagButtonText","searchResultsCountVerbage","searchResultsCountSubject","addToTemplateConfirmation","totalPriceLabel","progressNotificationText","addToTemplateDuplicateError","addToTemplateGenericError","dimensionMissingError","addLineProps","CONTENT","msg","Search","selectedProduct","searchTextInput","createRef","_renderSearchForm","autoComplete","_onSearchSubmit","maxLength","Loading","_getSearchResults","NotFound","ProductList","_onQuantityChangeHandler","selectedQuantity","_onSelectItem","varianteInput","productVariant","_getProductDimensions","selectedProductDimensions","ProductConfiguration","_onBackButtonClickHandler","_highlightSearchTerm","parsedName","unescape","dangerouslySetInnerHTML","__html","_resultCountText","_addItemToTemplateHandler","reloadPage","_toggleModalHandler","modalProps","showBackArrow","_renderContent","addToTemplateHandler","onQuantityChangeHandler","highlightSearchTerm","searchForm","productProps","renderResultCountText","NotFoundComponent","searchText","searchCriteriaInput","Context","IncludeAttributes","SearchCondition","MasterProductId","selectMenu","_onChanged","selectId","dropdownList","dropdownName","selectedDimensions","_getDimensionsError","dimensionName","_addToTemplateHandler","isBusy","showAddConfirmation","errors","add","missingDimensions","_onQuantityChange","_updateDimensionValue","productDimensionFull","newValueId","DimensionValues","_onDimensionChanged","remainingDimensionsErrors","selection","buttonDisabled","mappedDimensions","ExtensionProperties","variantProduct","dimensionInput","variantDimensions","availabilityInput","newAvailableQuantity","priceInput","productAvailableQuantity","unitPrice","sort","a","b","_getDropdownName","_getDimensionsNodes","_getConfirmationMessage","selectedDimensionNames","variant","Object","values","unshift","assertive","toFixed","fallBackImg","ProductSelectButton","setBusy","SubmitUserReviewInput","userReviewData","authorization","ReviewModal","submitButtonAttribute","cancelButtonAttribute","discardReviewButtonText","submitDisabled","submitReviewButtonText","ratingsInput","ratingLabel","ratingsLabel","titleInput","titleLabel","textInput","textLabel","privacyPolicyUrl","privacyPolicyLink","form","inputRow","editReviewModalTitle","writeReviewModalTitle","stripWhiteSpacesFromString","selectRatingAriaLabel","initialRating","selectRatingLabel","reviewTitleMaxLength","reviewTitleLabel","reviewTextMaxLength","rows","reviewTextLabel","policyTextBlocks","privacyPolicyTextFormat","split","isSeparatorAtStart","startsWith","isSeparatorAtEnd","endsWith","PrivacyPolicy","privacyPolicyAttribute","privacyPolicyTitle","onReviewSubmission","userEmail","emailAddress","firstName","getReviewInput","SignInMessage","SignInButton","SignIn","WriteReview","PureComponent","writeReviewCallbacks","userInfo","signInMessage","signInButton","signInLabel","signInAriaLabel","editReviewButtonText","reviewButtonLabel","_buildUserReviewModal","createOrderTemplateDialogOpen","setOrderTemplateNameDialogOpen","createOrderTemplateText","isUpdateDialog","setModalOpen","createOrderTemplateDialogResources","onCancel","onSuccess","onOrderTemplateCreated","_reloadPage","_onRemoveFromOrderTemplateList","orderTemplates","p","headerStatusMessage","emptyOrderTemplateText","createNewTemplateButtonText","orderTemplatesData","OrderTemplateList","orderTemplateListTitle","createOrderTemplateButton","templateHeaderStatusMessage","OrderTemplates","OrderTemplate","_renderOrderTemplateList","createOrderTemplateHeader","createOrderTemplateDescription","createOrderTemplateButtonText","cancelNewOrderTemplateCreationButtonText","currentTemplateProps","PromoBannerCloseButton","closeButtonAriaLabel","PromoBannerClose","PromoBannerLinks","links","editableLinks","_mapEditableLinks","linkdata","link","linkText","editableLink","linkUrl","destinationUrl","openInNewTab","PromoBannerText","animating","isVisible","handleTextChange","bannerMessages","handleLinkTextChange","linkIndex","_next","nextIndex","_isLastItem","_goToIndex","_previous","_isFirstItem","closeButtonLabel","handleLinks","handleText","promoBannerProps","PromoBannerTextProps","PromoBannerLinksProps","contentProps","CarouselProps","hideIndicator","closeButton","_renderItem","quantityLabel","toggleDetails","wrapClassName","fade","OrderTemplateListView","_renderOrderTemplate"],"mappings":"0KAsCA,MAAMA,UAAkB,YAIpB,YAAYC,EAAwBC,GAChCC,MAAMF,GAqBF,KAAAG,eAAkBC,IACtB,MAAMC,EAA2B,KAAnBD,EAAEE,OAAOC,MAAe,GAAKC,KAAKP,MAAMI,MACtDG,K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gD,EAAem9C,OAQ7DkD,EAAuB,CAACrgD,EAA8Cm9C,KAExE,MAAM,IAAElmD,EAAF,gBAAOiK,EAAP,mBAAwBZ,EAAxB,2BAA4CkB,EAA5C,aAAwED,EAAxE,kBAAsFZ,GAAsBX,EAClH,OACI,gBAAC,OAAI,eAAC/I,IAAKA,EAAKxC,UAAW0oD,EAAe1oD,WAAe0oD,GACpDx8C,EACAL,EACAY,EACAK,EACAC,IAKE","file":"static/js/6.6ec3be773729f091.chunk.js","sourcesContent":["import * as React from 'react';\n\nimport { Button, format, getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\nimport { PriceComponent } from '@msdyn365-commerce/components';\nimport { IComponentProps } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { Coupon } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nexport interface IPromoCodeProps extends IComponentProps<{}> {\n cart: ICartState | undefined;\n promoCodeHeadingText: string;\n appliedPromoCodeHeadingText: string;\n removePromoAriaLabelFormat: string;\n promoPlaceholderText: string;\n promoCodeApplyButtonText: string;\n collapseTimeOut: number;\n removePromoText: string;\n invalidPromoCodeErrorText: string;\n failedToAddPromoCodeErrorText: string;\n duplicatePromoCodeErrorText: string;\n failedToRemovePromoCodeErrorText: string;\n /** The telemetry content */\n telemetryContent?: ITelemetryContent;\n promoCodeApplyCallback?(): void;\n}\n\ninterface IPromoCodeState {\n isCollapseOpen: boolean;\n promoCodeInputValue: string;\n error: string;\n canApply: boolean;\n}\n\n/**\n *\n * The PromoCode component renders the promocode section.\n * @extends {React.PureComponent}\n */\nclass PromoCode extends React.Component {\n\n private payLoad: IPayLoad;\n\n constructor(props: IPromoCodeProps, state: IPromoCodeState) {\n super(props);\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, TelemetryConstant.ApplyPromoCode);\n this.state = {\n isCollapseOpen: false,\n promoCodeInputValue: '',\n error: '',\n canApply: false\n };\n }\n\n public render(): JSX.Element {\n return (\n
\n
{this.props.promoCodeHeadingText}
\n {this._renderForm(this.props.promoPlaceholderText, this.props.promoCodeApplyButtonText, this.props.cart)}\n

{this.state.error}

\n {this._renderAppliedPromoCode(this.props)}\n
\n );\n }\n\n private _onInputChange = (e: React.ChangeEvent) => {\n const error = e.target.value === '' ? '' : this.state.error;\n this.setState({\n promoCodeInputValue: e.target.value, error: error,\n canApply: e.target.value ? true : false\n });\n }\n\n private _applyPromotion = (cartState: ICartState | undefined) => {\n if (!cartState || !cartState.cart) {\n return;\n }\n const appliedPromo = this.state.promoCodeInputValue;\n\n cartState.addPromoCode({ promoCode: appliedPromo })\n .then(result => {\n if (result.status === 'SUCCESS') {\n // show success text\n this.setState({ promoCodeInputValue: '', error: '', canApply: false});\n } else if (result.substatus === 'ALREADYADDED') {\n this.setState({ error: this.props.duplicatePromoCodeErrorText });\n } else {\n this.setState({ error: this.props.invalidPromoCodeErrorText });\n }\n })\n .catch(error => {\n this.setState({ error: this.props.failedToAddPromoCodeErrorText });\n });\n }\n\n private _renderForm = (promoPlaceholderText: string, promoCodeApplyButtonText: string, cartState: ICartState | undefined) => {\n const _onSubmit = (event: React.FormEvent) => {event.preventDefault(); this._applyPromotion(cartState);};\n const _applyPromotion = (event: React.MouseEvent) => {this._applyPromotion(cartState);};\n const attributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n\n return (\n
\n
\n \n \n {promoCodeApplyButtonText}\n \n
\n
\n );\n }\n\n private _removePromotion = (cartState: ICartState | undefined, event: React.MouseEvent) => {\n if (!cartState) {\n return;\n }\n const code = event.currentTarget.getAttribute('data-value') || '';\n cartState.removePromoCodes({\n promoCodes: [\n code\n ]\n })\n .then(result => {\n if (result.status === 'SUCCESS') {\n this.setState({ error: ''});\n }\n })\n .catch(() => {\n this.setState({ error: this.props.failedToRemovePromoCodeErrorText});\n });\n\n }\n private _calculateDiscount = (code: string, cartState: ICartState | undefined) => {\n if (!cartState || !cartState.cart || !cartState.cart.CartLines || cartState.cart.CartLines.length === 0 || !code) {\n return;\n }\n let discountAmount = 0;\n for (const line of cartState.cart.CartLines) {\n if (line.DiscountLines) {\n for (const discountLine of line.DiscountLines) {\n if (discountLine.DiscountCode === code) {\n discountAmount += discountLine.DiscountCost!;\n }\n }\n }\n }\n return discountAmount * -1;\n }\n\n private _renderAppliedPromoCode = (props: IPromoCodeProps) => {\n if (!props.cart || !props.cart.cart || !props.cart.cart.Coupons || !(props.cart.cart.Coupons.length > 0)) {\n return;\n }\n\n const _removePromotion = (event: React.MouseEvent) => {this._removePromotion(props.cart, event);};\n\n const promoCodTotalDiscount = props.cart.cart.Coupons.reduce(\n (count: number, coupon: Coupon) => {\n return count + (this._calculateDiscount(coupon.Code || '', props.cart) || 0);\n },\n 0);\n\n return (\n <>\n
\n
{this.props.appliedPromoCodeHeadingText}
\n \n
\n {\n props.cart.cart.Coupons.map((coupon: Coupon) => {\n const ariaLabel = props.removePromoAriaLabelFormat ? format(props.removePromoAriaLabelFormat, props.removePromoText, coupon.Code) : '';\n\n return (\n
\n
\n {coupon.Code} (\n )\n
\n \n {props.removePromoText}\n \n
\n );\n })\n }\n \n );\n }\n}\n\nexport default PromoCode;","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ArrayExtensions, getFallbackImageUrl } from '@msdyn365-commerce-modules/retail-actions';\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport { PriceComponent } from '@msdyn365-commerce/components';\nimport { IComponentProps, IGridSettings, IImageSettings, Image } from '@msdyn365-commerce/core';\nimport { ChannelDeliveryOptionConfiguration, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { CartLine, SalesLine } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { Quantity } from '../../utilities/quantity';\n\n/**\n * ICartlineResourceString: Interface for specifying the\n * resource strings that the component needs\n */\nexport interface ICartlineResourceString {\n /** Display string for discount label */\n discountStringText: string;\n /** String for size key */\n sizeString: string;\n /** String for color key */\n colorString: string;\n /** String associated with the configuration product dimension */\n configString: string;\n /** String for style key */\n styleString: string;\n /** String for amount key */\n amountString?: string;\n /** Display string for quantity label */\n quantityDisplayString: string;\n /** Display string for quantity label */\n inputQuantityAriaLabel: string;\n /** Aria label for the decrement button in quantity component */\n decrementButtonAriaLabel: string;\n /** Aria label for the increment button in quantity component */\n incrementButtonAriaLabel: string;\n /** original text screenreader */\n originalPriceText: string;\n /** current text screenreader */\n currentPriceText: string;\n /** shipping Charges Text */\n shippingChargesText: string;\n}\n\ninterface ICartLineData {\n cartLine: CartLine | SalesLine;\n product: SimpleProduct;\n}\n\n/**\n * ICartLineProps: The props required to render cartLineitem\n */\nexport interface ICartLineProps extends IComponentProps {\n /** The flag to change the quantity component from interactible to static */\n disableQuantityInteractivity?: boolean;\n /** The primary image url */\n primaryImageUrl?: string;\n /** The product url */\n productUrl?: string;\n /** GridSettings for the product image in cartLine */\n gridSettings: IGridSettings;\n /** ImageSettings for the product image in cartLine */\n imageSettings: IImageSettings;\n /** Boolean flag to indicate if the item is out of stock */\n isOutOfStock?: boolean;\n /** Flag to make quantity section editable */\n isQuantityEditable?: boolean;\n /** Max quantity for line item */\n maxQuantity?: number;\n /** Current quantity for line item */\n currentQuantity?: number;\n /** Resource string for the component */\n resources: ICartlineResourceString;\n /** SalesLine flag */\n isSalesLine?: boolean;\n /** Error message to show in place of quantity */\n errorMessage?: string;\n /** Inventory information label */\n inventoryInformationLabel?: string;\n /** Inventory information class name */\n inventoryLabelClassName?: string;\n /** Flag to show/hide shipping charges for line items */\n showShippingChargesForLineItems?: boolean;\n /** Boolean flag to indicate if cart state status is ready */\n isCartStateReady?: boolean;\n /** Chanel Delivery Option configuration is from api. */\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n /** The telemetry content */\n telemetryContent?: ITelemetryContent;\n /** Quantity onChange callback */\n quantityOnChange?(cartLine: CartLine, newQuantity: number): boolean;\n}\n\ninterface IDimensionStrings {\n /** String for size key */\n sizeString: string;\n /** String for color key */\n colorString: string;\n /** String associated with the configuration product dimension */\n configString: string;\n /** String for style key */\n styleString: string;\n /** String for amount key */\n amountString?: string;\n}\n\nconst CartLineItemFunctions = {\n renderProductDimensions: (Product: SimpleProduct, DimensionStrings: IDimensionStrings) => {\n if (!Product || !Product.Dimensions) {\n return [];\n }\n\n return Product.Dimensions.map(productDimension => {\n\n if (productDimension.DimensionTypeValue === 1) {\n return (\n
\n {DimensionStrings.colorString}:\n {productDimension.DimensionValue && productDimension.DimensionValue.Value}\n
\n );\n }\n\n if (productDimension.DimensionTypeValue === 2) {\n return (\n
\n {DimensionStrings.configString}:\n {productDimension.DimensionValue && productDimension.DimensionValue.Value}\n
\n );\n }\n\n if (productDimension.DimensionTypeValue === 3) {\n return (\n
\n {DimensionStrings.sizeString}:\n {productDimension.DimensionValue && productDimension.DimensionValue.Value}\n
\n );\n }\n\n if (productDimension.DimensionTypeValue === 4) {\n return (\n
\n {Product.IsGiftCard ? DimensionStrings.amountString : DimensionStrings.styleString}:\n {productDimension.DimensionValue && productDimension.DimensionValue.Value}\n
\n );\n }\n return null;\n });\n },\n renderDiscountLines: (props: ICartLineProps) => {\n\n if (!props.data.cartLine.DiscountLines || props.data.cartLine.DiscountLines.length === 0) {\n return null;\n }\n return props.data.cartLine.DiscountLines.map((discountLine, index) => {\n return (\n
\n \n {discountLine.OfferName ? discountLine.OfferName : ''}:\n {` ${props.resources.discountStringText || 'Discount'} `}\n \n \n \n \n \n {` (${discountLine.Percentage !== undefined ? discountLine.Percentage : ''}%)`}\n \n
\n );\n });\n },\n renderInventoryLabel: (props: ICartLineProps) => {\n if (!props.inventoryInformationLabel) {\n return null;\n }\n const inventoryCssName = props.inventoryLabelClassName ? `msc-cart-line__product-inventory-label ${props.inventoryLabelClassName}` : 'msc-cart-line__product-inventory-label';\n return (\n {props.inventoryInformationLabel}\n );\n },\n renderShippingLabel: (props: ICartLineProps) => {\n const pickupDeliveryModeCode = props.context.request.channel?.PickupDeliveryModeCode;\n const channelDeliveryOptionConfig = props.channelDeliveryOptionConfig;\n const cartline = props.data.cartLine;\n let hasShippingMethod = false;\n if(channelDeliveryOptionConfig !== undefined) {\n hasShippingMethod = !!cartline.DeliveryMode && channelDeliveryOptionConfig?.PickupDeliveryModeCodes?.some(deliveryMode => deliveryMode !== cartline.DeliveryMode) ? true : false;\n } else {\n hasShippingMethod = !!cartline.DeliveryMode && cartline.DeliveryMode !== pickupDeliveryModeCode ? true : false;\n }\n if (!hasShippingMethod) {\n return undefined;\n }\n\n const shippingChargeLines = (cartline.ChargeLines || []).filter(chargeLine => chargeLine.IsShipping);\n\n if (shippingChargeLines.length === 0) {\n return undefined;\n }\n\n const freightFee = shippingChargeLines.reduce((chargeTotal, chargeLine) => {\n return chargeTotal + (chargeLine.CalculatedAmount || 0);\n }, 0);\n\n const priceComponent = (\n \n );\n return (\n <>\n \n \n {priceComponent}\n \n \n );\n },\n renderOtherCharges: (props: ICartLineProps) => {\n const cartline = props.data.cartLine;\n const otherCharges = cartline.ChargeLines?.filter((chargeline) => !chargeline.IsShipping);\n\n return otherCharges && otherCharges.map((otherCharge, key) => {\n return otherCharge && otherCharge.CalculatedAmount ? (\n
\n \n \n \n \n
\n ) : '';\n }) || undefined;\n }\n};\n\n// tslint:disable-next-line:max-func-body-length\nconst CartLine: React.FC = (props: ICartLineProps) => {\n const { isSalesLine, productUrl, resources } = props;\n const { product, cartLine } = props.data;\n\n const destructDimensionStrings = {\n sizeString: resources.sizeString,\n colorString: resources.colorString,\n styleString: resources.styleString,\n configString: resources.configString,\n amountString: resources.amountString\n };\n\n const fallbackImageUrl = product && getFallbackImageUrl(product.ItemId, props.context.actionContext.requestContext.apiSettings);\n const productDimensions = product && CartLineItemFunctions.renderProductDimensions(product, destructDimensionStrings);\n const imageSettings = props.imageSettings;\n if(imageSettings) {\n imageSettings.cropFocalRegion = true;\n }\n const renderDisountLines = CartLineItemFunctions.renderDiscountLines(props);\n const renderInventoryLabel = CartLineItemFunctions.renderInventoryLabel(props);\n const renderShippingLabel = CartLineItemFunctions.renderShippingLabel(props);\n const renderOtherCharges = CartLineItemFunctions.renderOtherCharges(props);\n const payLoad = getPayloadObject('click', props.telemetryContent!, '', product?.RecordId.toString());\n const prodAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n const productName = product?.Name || cartLine.Description;\n\n const onChange = (newValue: number): boolean => {\n if (props.quantityOnChange) {\n return props.quantityOnChange(props.data.cartLine, newValue);\n }\n return true;\n };\n\n const _generateErrorMessage = (): JSX.Element | null => {\n if (props.errorMessage) {\n return (\n
\n \n {props.errorMessage}\n
\n );\n }\n\n return null;\n };\n\n const _generateQuantityandPrice = (): JSX.Element[] | null => {\n const nodes = [];\n if (props.isOutOfStock) {\n const errorMessage = _generateErrorMessage();\n\n if (errorMessage) {\n return [errorMessage];\n }\n\n return null;\n }\n if (props.isQuantityEditable) {\n nodes.push(\n
\n
{resources.quantityDisplayString}
\n\n {_generateErrorMessage()}\n\n \n
\n );\n } else {\n nodes.push(\n
\n \n\n {_generateErrorMessage()}\n\n {props.data.cartLine.Quantity}\n
\n );\n }\n\n nodes.push(\n
\n \n {\n props.data.cartLine.DiscountAmount && props.data.cartLine.DiscountAmount > 0 &&\n <>\n {` ${props.resources.discountStringText || 'Discount'} `}\n \n ||\n null\n }\n
\n );\n\n return nodes;\n };\n\n return (\n
\n
\n \n
\n
\n
\n {productName}\n {ArrayExtensions.hasElements(productDimensions) ?\n
{productDimensions}
:\n ''\n }\n
\n \n
\n {renderDisountLines}\n {renderInventoryLabel}\n {props.showShippingChargesForLineItems &&
\n {renderShippingLabel}\n
}\n {renderOtherCharges}\n
\n {\n _generateQuantityandPrice()\n }\n
\n
\n );\n};\n\nexport default CartLine;","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\nimport { SocialMedia, SocialMediaComponent } from '@msdyn365-commerce/components';\nimport MsDyn365 from '@msdyn365-commerce/core';\nimport * as React from 'react';\nimport { ISocialShareItemConfig, ISocialShareItemProps, socialMedia } from './social-share-item.props.autogenerated';\n\nexport interface ISocialShareItemViewProps extends ISocialShareItemProps {\n SocialShareItemElement: React.ReactNode | null;\n SocialShareItem: IModuleProps;\n}\n\n/**\n *\n * SocialShareItem component\n * @extends {React.PureComponent>}\n */\nclass SocialShareItem extends React.PureComponent> {\n constructor(props: ISocialShareItemProps) {\n super(props);\n\n this._getSocialShareItem = this._getSocialShareItem.bind(this);\n }\n\n public render(): JSX.Element | null {\n const viewprops = {\n ...this.props,\n SocialShareItem: {\n moduleProps: this.props,\n className: 'ms-social-share-item'\n },\n SocialShareItemElement: this._getSocialShareItem()\n };\n\n return this.props.renderView(viewprops) as React.ReactElement;\n }\n\n private _getSocialShareItem(): React.ReactNode | null {\n const src = this.props.config.icon;\n if (MsDyn365.isBrowser) {\n switch (this.props.config.socialMedia) {\n case socialMedia.facebook:\n return ;\n case socialMedia.twitter:\n return ;\n case socialMedia.pinterest:\n return ;\n case socialMedia.linkedin:\n return ;\n case socialMedia.mail:\n return ;\n default:\n return null;\n }\n }\n return null;\n }\n}\n\nexport default SocialShareItem;\n","import { getFallbackImageUrl, getProductUrlSync, OrderTemplate, OrderTemplateLine } from '@msdyn365-commerce-modules/retail-actions';\nimport { Alert, Button, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport { AddOrderTemplateToCartComponent, ILinesAddedToCartDialogResources } from '@msdyn365-commerce/components';\nimport { getUrlSync, ICoreContext, IImageSettings, Image, ITelemetry } from '@msdyn365-commerce/core';\nimport { ProductList } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport * as React from 'react';\nimport { IOrderTemplateActionMessageState } from '../order-template-list';\n\nexport interface ISingleOrderTemplateProps extends ProductList {\n orderTemplateState: IOrderTemplateActionMessageState;\n name?: string;\n orderTemplate: OrderTemplate;\n context: ICoreContext;\n imageSettings?: IImageSettings;\n enableImageProductLink?: boolean;\n removeFromOrderTemplateListText: string;\n addToBagText: string;\n index: number;\n itemKey: string;\n telemetry: ITelemetry;\n moduleId: string;\n moduleTypeName: string;\n handlers: {\n onRemoveOrderTemplate(id: string): void | undefined;\n onDismiss(): void;\n };\n resources: {\n closeWindowButtonText: string;\n addToCartFailureMessage: string;\n addToCartSuccessMessage: string;\n addToCartProcessMessage: string;\n linesAddedToCartDialogResources: ILinesAddedToCartDialogResources;\n };\n telemetryContent?: ITelemetryContent;\n}\n\nexport interface ISingleOrderTemplateViewProps {\n key: string;\n orderTemplateImage: React.ReactNode;\n addToCartButton?: React.ReactNode;\n removeButton?: React.ReactNode;\n orderTemplateStatusMessage?: React.ReactNode;\n orderTemplateName?: React.ReactNode;\n orderTemplateAriaLabel?: string;\n orderTemplateHeaderDivider?: React.ReactNode;\n}\n\nconst _removeItemFromOrderTemplateList = (props: ISingleOrderTemplateProps): void => {\n const { onRemoveOrderTemplate } = props.handlers;\n const { itemKey } = props;\n\n onRemoveOrderTemplate && itemKey && onRemoveOrderTemplate(itemKey);\n};\n\nconst OrderTemplateActions = {\n removeOrderTemplate: _removeItemFromOrderTemplateList,\n};\n\nexport const OrderTemplateRender = (input: ISingleOrderTemplateProps): ISingleOrderTemplateViewProps | null => {\n const { Id, orderTemplate, removeFromOrderTemplateListText, orderTemplateState, handlers, name, imageSettings, context, telemetryContent, enableImageProductLink } = input;\n\n if (!Id) {\n return null;\n }\n\n const _getOrderTemplatePageUrl = (): string => {\n const url = getUrlSync('ordertemplate', context.actionContext) || '';\n const separator = url.includes('?') ? '&' : '?';\n if (Id) {\n return `${url}${separator}id=${Id}`;\n } else {\n return '';\n }\n };\n\n const removeOrderTemplateAction = (event: React.MouseEvent) => { return OrderTemplateActions.removeOrderTemplate(input); };\n const { onDismiss } = handlers;\n\n return {\n key: `${Id}-template`,\n orderTemplateImage: _renderOrderTemplateImages(context, orderTemplate.orderTemplateLines, imageSettings, enableImageProductLink),\n orderTemplateAriaLabel: _renderAriaLabel(input),\n orderTemplateName:\n (\n
\n \n
{orderTemplate.totalLines} line items
\n
\n
\n ),\n addToCartButton:\n (\n
\n \n
\n ),\n removeButton:\n (\n \n ),\n orderTemplateStatusMessage: orderTemplateState && orderTemplateState.isOpen && orderTemplateState.userMessage &&\n (\n
\n \n {orderTemplateState.userMessage}\n \n
\n )\n\n };\n\n};\n\nconst _renderOrderTemplateImages = (context: ICoreContext, orderTemplateLines?: OrderTemplateLine[],\n imageSettings?: IImageSettings, enableImageProductLink?: boolean): JSX.Element | null => {\n const defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: `w=140&h=140&m=6`, w: 0, h: 0 },\n lg: { q: `w=140&h=140&m=6`, w: 0, h: 0 },\n xl: { q: `w=140&h=140&m=6`, w: 0, h: 0 }\n },\n lazyload: true\n };\n\n if (orderTemplateLines) {\n const count = orderTemplateLines.length < 4 ? orderTemplateLines.length : 4;\n\n return (\n
\n {orderTemplateLines?.slice(0, count).map(line => {\n const productUrl = line.fullProduct ? getProductUrlSync(line.fullProduct.ProductDetails, context.actionContext, undefined) : '';\n\n return ( window.location.assign(productUrl))}\n className={enableImageProductLink ? 'product-link' : ''}\n />);\n })}\n
\n );\n } else {\n return (\n
\n );\n }\n};\n\nconst _renderAriaLabel = (props: ISingleOrderTemplateProps): string => {\n const { name } = props;\n return (`${name}`);\n};","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport classnames from 'classnames';\nimport * as React from 'react';\nimport { orderTemplateListStatus } from '../order-template-list';\n\nexport interface IOrderTemplateListStatusMessageProps {\n className?: string;\n errorType: orderTemplateListStatus;\n text?: string;\n}\n\nexport const OrderTemplateListStatusMessage: React.FC = ({className, errorType, text}) => {\n switch(errorType) {\n case 'EMPTY':\n return (\n

{ text }

\n );\n case 'FAILED':\n return (\n

{ text }

\n );\n case 'LOADING':\n default:\n return (\n

{ text }

\n );\n }\n};\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { getTelemetryObject, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport { IVideoMetadata, Player } from '@msdyn365-commerce/components';\nimport { IPlayerOptions } from '@msdyn365-commerce/components/dist/types/videoplayer/components/data/player-options';\nimport { IPlayerResources } from '@msdyn365-commerce/components/dist/types/videoplayer/components/data/player-resources';\nimport { IPlayerData } from '@msdyn365-commerce/components/dist/types/videoplayer/players/player/Player.props';\nimport * as MsDyn365 from '@msdyn365-commerce/core';\nimport * as React from 'react';\nimport { IVideoPlayerConfig, IVideoPlayerProps } from './video-player.props.autogenerated';\n\nexport interface IVideoPlayerViewProps extends IVideoPlayerProps<{}> {\n player: React.ReactNode;\n}\n\n/**\n *\n * VideoPlayer component\n * @extends {React.PureComponent>}\n */\nclass VideoPlayer extends React.PureComponent> {\n private telemetryContent: ITelemetryContent;\n constructor(props: IVideoPlayerProps) {\n super(props);\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry);\n }\n\n public render(): JSX.Element {\n const options: IPlayerOptions = this.props.config;\n const video: MsDyn365.IVideoData = this.props.config.video;\n const playerResources: IPlayerResources = {\n playAriaLabel: this.props.resources.playLabel,\n pauseAriaLabel: this.props.resources.pauseLabel,\n playingAriaLabel: this.props.resources.playingLabel,\n pausedAriaLabel: this.props.resources.pausedLabel,\n muteAriaLabel:this.props.resources.muteLabel,\n unMuteAriaLabel:this.props.resources.unMuteLabel,\n fullScreenAriaLabel:this.props.resources.fullScreenLabel,\n exitFullScreenAriaLabel:this.props.resources.exitFullScreenLabel,\n seekBarLabel:this.props.resources.seekBarLabel,\n videoTimeDurationLabel:this.props.resources.videoTimeDurationLabel,\n closedCaptionLabel:this.props.resources.closedCaptionLabel\n };\n const videoMetaData: IVideoMetadata = {};\n\n if (video) {\n videoMetaData.videoId = video.id;\n videoMetaData.title = video.title;\n videoMetaData.duration = video.playTime;\n\n if (video.thumbnail) {\n videoMetaData.posterframeUrl = video.thumbnail.src;\n }\n\n if (video._links\n && video._links.binaryReferences) {\n videoMetaData.videoBinaryReferences = video._links.binaryReferences;\n }\n }\n const videoPlayerData: IPlayerData = { options: options, metaData: videoMetaData };\n const viewProps = {\n // Context for telemetry and raw data for C1 to do customization\n // Including computed data, state data and methods\n ...this.props,\n // tslint:disable-next-line: jsx-wrap-multiline\n player: \n \n \n };\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n}\n\nexport default VideoPlayer;\n","import { OrderBy } from '../actions/inputs/get-product-reviews-input';\n\nexport interface IRnrKeyValuePair {\n key: string;\n value: string;\n}\n\nexport interface IRnrOrderByKeyValuePair {\n key: OrderBy;\n value: string;\n}\n\nexport function setFocusOnElement(id: string): void {\n const element = document.getElementById(id);\n if (!!element) {\n element.focus();\n }\n}\n\nexport const TOGGLE_REVIEW_MODAL_BUTTON_ID: string = 'reviewproductid';\nexport const TOGGLE_EDIT_MODAL_BUTTON_ID: string = 'ms-write-review__edit';\nexport const TOGGLE_EDIT_MODAL_BUTTON_CARD_ID: string = 'ms-reviews-list__edit';","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { getPriceForSelectedVariant, getProductUrlSync, OrderTemplate, OrderTemplateLine, PriceForSelectedVariantInput } from '@msdyn365-commerce-modules/retail-actions';\nimport { Alert, getTelemetryObject, Heading, IModuleProps, INodeProps, ITelemetryContent, UncontrolledPagination } from '@msdyn365-commerce-modules/utilities';\nimport { IItemAddedToCartDialogData, IItemAddedToCartDialogResources, ILinesAddedToCartDialogResources, IOrderTemplateNameDialogResources, ItemAddedToCartDialog } from '@msdyn365-commerce/components';\nimport MsDyn365, { AsyncResult, getUrlSync, IRequestContext } from '@msdyn365-commerce/core';\nimport { getCartState } from '@msdyn365-commerce/global-state';\nimport { CartLine, ProductList, ProductListLine } from '@msdyn365-commerce/retail-proxy';\nimport { addCartLinesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport {\n deleteAsync,\n removeProductListLinesAsync,\n updateProductListLinesAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductListsDataActions.g';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport classnames from 'classnames';\nimport debounce from 'lodash/debounce';\nimport { action, computed, observable } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\nimport {\n IOrderTemplateActionsProps,\n IOrderTemplateActionsViewProps,\n IOrderTemplateData,\n IOrderTemplateLineProps,\n IOrderTemplateLineViewProps,\n IOrderTemplateProps,\n IOrderTemplateResources,\n IOrderTemplateTableHeadingProps,\n OrderTemplateActionsView,\n OrderTemplateBulkActions,\n OrderTemplateLinesStatusMessage,\n OrderTemplateLineView,\n OrderTemplateMobileLineView,\n OrderTemplateTableHeading\n} from '../../';\nimport { ActiveOrderTemplateLinesInput } from './actions/get-order-template';\n\nexport interface IOrderTemplateLineActionMessageState {\n itemKey: string;\n userMessage: string;\n statusCssString: string;\n messageGlyph: string;\n isOpen: boolean;\n isItemAddedToOrderTemplateOpen: boolean;\n isConfirmAddSelectionToBagModalOpen: boolean;\n itemAddedToCartDialogData?: IItemAddedToCartDialogData;\n productSelection: IOrderTemplateLineViewModel[];\n isDetailsDisplayed: boolean;\n detailedProductView?: IOrderTemplateLineViewProps;\n}\n\nexport type orderTemplateLinesStatus = 'LOADING' | 'SUCCESS' | 'FAILED' | 'EMPTY';\ntype GridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\nexport interface IOrderTemplateViewProps extends IOrderTemplateProps {\n OrderTemplateLines: IModuleProps;\n callbacks?: IOrderTemplateLinesCallbacks;\n status?: orderTemplateLinesStatus;\n statusMessage?: React.ReactNode;\n heading?: React.ReactNode;\n OrderTemplateActions?: INodeProps;\n ProductsTable?: INodeProps;\n ProductsTableRow?: INodeProps;\n ProductsTableHeading?: React.ReactNode;\n ProductDetails?: INodeProps;\n orderLines?: IOrderTemplateLineViewProps[];\n productListLines?: ProductListLine[];\n productsStatusMessage?: React.ReactNode;\n orderActions?: IOrderTemplateActionsViewProps | null;\n resources: IOrderTemplateResources;\n pagination?: React.ReactNode;\n itemAddedToCartDialog?: React.ReactNode;\n bulkOrderLineActions?: React.ReactNode;\n isDetailsDisplayed?: boolean;\n detailedProduct?: IOrderTemplateLineProps;\n detailedProductView?: IOrderTemplateLineViewProps;\n productQuantityView?: React.ReactNode;\n addButton?: React.ReactNode;\n isMobile?: boolean;\n toggleDetailsDisplayed?(props: IOrderTemplateLineProps | undefined): void;\n}\n\nexport interface IOrderTemplateLinesCallbacks {\n updateQuantity(itemKey: string, quantity: number): void;\n}\n\nexport interface IOrderTemplateLineViewModel extends OrderTemplateLine {\n isChecked: boolean;\n productQuantityView: React.ReactNode;\n}\n\n/**\n *\n * OrderTemplateLines component\n * @extends {React.PureComponent, IOrderTemplateLineActionMessageState>}\n */\n@observer\nclass OrderTemplateLines extends React.Component, IOrderTemplateLineActionMessageState> {\n private readonly className: string;\n private telemetryContent?: ITelemetryContent;\n\n @observable\n private _viewport: GridSize;\n @computed get isMobile(): boolean {\n return (this._viewport === 'xs' || this._viewport === 'sm');\n }\n\n constructor(props: IOrderTemplateProps, state: IOrderTemplateLineActionMessageState) {\n super(props);\n this.className = 'ms-order-template';\n this._viewport = props.context.request && props.context.request.device && props.context.request.device.Type === 'Mobile' ? 'xs' : 'lg';\n this._updateViewport = this._updateViewport.bind(this);\n\n this.state = {\n itemKey: '',\n userMessage: '',\n statusCssString: 'success',\n messageGlyph: 'fas fa-check',\n isOpen: false,\n isItemAddedToOrderTemplateOpen: false,\n isConfirmAddSelectionToBagModalOpen: false,\n productSelection: [],\n isDetailsDisplayed: false\n };\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\n this._updateViewport();\n\n if (!this.props.context.request.user.isAuthenticated) {\n window.location.assign(this.props.context.request.user.signInUrl || '/');\n }\n }\n\n @action\n public async componentDidMount(): Promise {\n this.setState({});\n const orderTemplate = await this.props.data.orderTemplate;\n this.props.config.heading!.text = orderTemplate.productList.Name || '';\n this.setState({\n productSelection: orderTemplate.orderTemplateLines as IOrderTemplateLineViewModel[]\n });\n\n if (typeof window !== undefined && window.addEventListener) {\n window.addEventListener('resize', this._updateViewport);\n this._updateViewport();\n }\n }\n\n public componentWillUnmount(): void {\n if (typeof window !== undefined && window.addEventListener) {\n window.removeEventListener('resize', this._updateViewport);\n }\n }\n\n // tslint:disable-next-line:max-func-body-length\n public render(): JSX.Element | null {\n const { heading, className } = this.props.config;\n const { emptyOrderTemplateLinesText, errorGettingOrderTemplateLines } = this.props.resources;\n const { orderTemplate, cart } = this.props.data;\n\n if (cart.status === 'LOADING' || orderTemplate.status === 'LOADING') {\n const errorProps: IOrderTemplateViewProps = {\n ...(this.props as IOrderTemplateProps),\n OrderTemplateLines: {\n moduleProps: this.props,\n className: classnames(this.className, className)\n },\n status: 'LOADING',\n statusMessage: ,\n heading: heading && ,\n resources: this.props.resources\n };\n return this.props.renderView(errorProps);\n }\n\n if (cart.status === 'FAILED' || orderTemplate.status === 'FAILED') {\n const errorProps: IOrderTemplateViewProps = {\n ...(this.props as IOrderTemplateProps),\n OrderTemplateLines: {\n moduleProps: this.props,\n className: classnames(`${this.className}`, className)\n },\n status: 'FAILED',\n statusMessage: ,\n heading: heading && ,\n resources: this.props.resources\n };\n\n return this.props.renderView(errorProps);\n }\n\n const orderTemplateResult = orderTemplate && orderTemplate.result;\n const orderTemplateLines = orderTemplateResult && orderTemplateResult.orderTemplateLines;\n\n if (!orderTemplateResult || !orderTemplateLines || orderTemplateLines.length === 0) {\n if (orderTemplateResult && !this._isFirstPage()) {\n window.location.href = this._getOrderTemplatePageUrl();\n return null;\n }\n\n const emptyViewProps: IOrderTemplateViewProps = {\n ...(this.props as IOrderTemplateProps),\n OrderTemplateLines: {\n moduleProps: this.props,\n className: classnames(`${this.className}`, className)\n },\n status: 'EMPTY',\n statusMessage: ,\n heading: heading && ,\n resources: this.props.resources\n };\n\n return this.props.renderView(emptyViewProps);\n }\n\n const viewProps: IOrderTemplateViewProps = {\n ...(this.props as IOrderTemplateProps),\n OrderTemplateLines: {\n moduleProps: this.props,\n className: classnames(`${this.className}`, className)\n },\n status: 'SUCCESS',\n productsStatusMessage: this.state.isOpen && (\n
\n \n {this.state.userMessage}\n \n
\n ),\n heading: heading && ,\n OrderTemplateActions: {\n className: `${this.className}-action-bar`,\n tag: 'div'\n },\n ProductsTable: {\n className: `${this.className}__table`,\n tag: 'table'\n },\n ProductsTableRow: {\n className: `${this.className}-table-line`,\n tag: 'tr'\n },\n ProductsTableHeading: this._renderProductListHeader(this.props.resources),\n ProductDetails: {\n className: `${this.className}-table-line__link`,\n tag: 'a'\n },\n orderLines: this._renderProductList(),\n callbacks: { updateQuantity: debounce(this._changeQuantity, 2000) },\n orderActions: this._renderOrderTemplateActions(orderTemplateResult),\n pagination: this._renderPagination(),\n itemAddedToCartDialog: this._renderItemAddedToCartDialog(),\n bulkOrderLineActions: this._getOrderTemplateLineActions(orderTemplateResult.productList.Id),\n isDetailsDisplayed: this.state.isDetailsDisplayed,\n toggleDetailsDisplayed: this._toggleDetailsDisplayed,\n detailedProductView: this.state.detailedProductView,\n isMobile: this.isMobile\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n public onSelect(line: IOrderTemplateLineViewModel, isChecked: boolean): void {\n line.isChecked = isChecked;\n\n const updated = this.state.productSelection.map(product => {\n if (product.fullProduct?.ProductDetails.ItemId === line.fullProduct?.ProductDetails.ItemId) {\n line.isChecked = isChecked;\n }\n return product;\n }) || [];\n\n this.setState({\n productSelection: updated\n });\n }\n\n public onSelectAll(isChecked: boolean): void {\n const updated = this.state.productSelection.map(line => {\n line.isChecked = isChecked;\n return line;\n }) || [];\n\n this.setState({\n productSelection: updated\n });\n }\n\n private _renderProductListHeader(resources: IOrderTemplateResources): React.ReactNode {\n const { productNumberText, productText, productUnitPriceText, productUOMText, productQuantityText, productActionsText } = resources;\n const headers: IOrderTemplateTableHeadingProps = {\n productNumber: productNumberText,\n productName: productText,\n productUnitPrice: productUnitPriceText,\n productUOM: productUOMText,\n productQuantity: productQuantityText,\n productActions: productActionsText,\n lines: this.state.productSelection,\n isMobile: this.isMobile,\n clickHandler: (isChecked: boolean) => this.onSelectAll(isChecked)\n };\n\n return ;\n }\n\n private _getOrderTemplateLineActions(orderTemplateId: string): React.ReactNode {\n return (\n line.isChecked)}\n onAddSelectionToBag={this._onAddSelectionToBag}\n onRemoveSelection={this._onRemoveSelection}\n isMinifiedView={this.isMobile}\n />\n );\n }\n\n private _generateLinesAddedToCartDialogResources(): ILinesAddedToCartDialogResources {\n return {\n viewCartButtonText: this.props.resources.viewCartButtonText,\n orderTemplateCloseButtonText: this.props.resources.orderTemplateCloseButtonText,\n linesAddedToCartHeaderItemsOneText: this.props.resources.linesAddedToCartHeaderItemsOneText,\n linesAddedToCartHeaderLinesOneText: this.props.resources.linesAddedToCartHeaderLinesOneText,\n linesAddedToCartHeaderLinesFormatText: this.props.resources.linesAddedToCartHeaderLinesFormatText,\n linesAddedToCartHeaderMessageText: this.props.resources.linesAddedToCartHeaderMessageText\n };\n }\n\n private _generateItemAddedToCartDialogResources(): IItemAddedToCartDialogResources {\n return {\n viewCartButtonText: this.props.resources.viewCartButtonText,\n orderTemplateCloseButtonText: this.props.resources.orderTemplateCloseButtonText,\n itemAddedToCartHeaderItemOneText: this.props.resources.itemAddedToCartHeaderItemOneText,\n itemAddedToCartHeaderItemFormatText: this.props.resources.itemAddedToCartHeaderItemFormatText,\n itemAddedToCartHeaderMessageText: this.props.resources.itemAddedToCartHeaderMessageText,\n freePriceText: this.props.resources.freePriceText,\n originalPriceText: this.props.resources.originalPriceText,\n currentPriceText: this.props.resources.currentPriceText\n };\n }\n\n private _onRemoveSelection = (): void => {\n const { context, resources } = this.props;\n const { telemetry } = context;\n const { removeSelectedFailureMessage, removeSelectedSuccessMessage } = resources;\n const lines = this.state.productSelection;\n const productListLines = lines && lines.length && lines\n .filter(line => line.isChecked)\n .map(line => line.productListLine);\n\n if (productListLines && productListLines.length) {\n const productListId = productListLines[0].ProductListId;\n\n removeProductListLinesAsync({ callerContext: context.actionContext }, productListId!, productListLines)\n .then(() => {\n this.setState({\n userMessage: removeSelectedSuccessMessage,\n statusCssString: 'success',\n messageGlyph: 'fas fa-check',\n isOpen: true\n });\n window.location.reload();\n })\n .catch(error => {\n telemetry.warning('[order-template-lines] Unable remove items from the order template lines');\n telemetry.error(error);\n this.setState({\n userMessage: removeSelectedFailureMessage,\n statusCssString: 'success',\n messageGlyph: 'fas fa-check',\n isOpen: true\n });\n });\n }\n }\n\n private _getOrderTemplatePageUrl = (): string => {\n let url = getUrlSync('ordertemplate', this.props.context.actionContext) || '';\n url = url.includes('?') ? url.substr(0, url.indexOf('?')) : url;\n if (this.props.data.orderTemplate.result?.productList.Id) {\n return `${url}?id=${this.props.data.orderTemplate.result.productList.Id}`;\n } else {\n return '';\n }\n };\n\n private _onAddSelectionToBag = async (): Promise => {\n const { context, resources } = this.props;\n const { addedToCartFailureMessage, addedToCartSuccessMessage } = resources;\n const lines = this.state.productSelection;\n const cartState = await getCartState(context.actionContext);\n const selectedLines = lines.filter(line => line.isChecked);\n\n if (selectedLines.length) {\n const cartLines = selectedLines.map(productLine => {\n return {\n ItemId: productLine.fullProduct?.ProductDetails.ItemId,\n ProductId: productLine.productListLine.ProductId,\n Quantity: productLine.productListLine.Quantity || 1,\n TrackingId: '',\n UnitOfMeasureSymbol: productLine.productListLine.UnitOfMeasure || productLine.fullProduct?.ProductDetails.DefaultUnitOfMeasure\n } as CartLine ;\n }) || [];\n\n return addCartLinesAsync({ callerContext: context.actionContext }, cartState.cart.Id, cartLines, cartState.cart.Version!)\n .then(async res => {\n context.telemetry.trace(`Order template; selected line items (${cartLines.map(line => line.ItemId).join(',')}) added to cart: ${cartState.cart.Id}`);\n await cartState.refreshCart({});\n this.setState({\n userMessage: addedToCartSuccessMessage,\n statusCssString: 'success',\n messageGlyph: 'fas fa-check',\n isOpen: true\n });\n })\n .catch(error => {\n context.telemetry.trace('Unable to add order template to cart.');\n this.setState({\n userMessage: addedToCartFailureMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n });\n });\n }\n\n return Promise.resolve(void(0));\n };\n\n private _renderOrderTemplateActions(orderTemplate: OrderTemplate): IOrderTemplateActionsViewProps {\n const { id, typeName, context, resources } = this.props;\n const {\n addTemplateToBagButtonText,\n renameTemplateButtonText,\n deleteTemplateButtonText,\n closeWindowButtonText,\n addToCartFailureMessage,\n addToCartSuccessMessage,\n addToCartProcessMessage\n } = resources;\n\n const orderTemplateActions: IOrderTemplateActionsProps = {\n data: { orderTemplate },\n id: id,\n typeName: typeName,\n context: context,\n telemetryContent: this.telemetryContent,\n handlers: {\n onRenameTemplate: this._renameTemplate,\n onRemoveTemplate: this._removeTemplate\n },\n renameOrderTemplateDialogStrings: this._generateOrderTemplateNameDialogResources(resources),\n resources: {\n addTemplateToBagButtonText: addTemplateToBagButtonText,\n renameTemplateButtonText: renameTemplateButtonText,\n deleteTemplateButtonText: deleteTemplateButtonText,\n addToCartFailureMessage: addToCartFailureMessage,\n addToCartSuccessMessage: addToCartSuccessMessage,\n addToCartProcessMessage: addToCartProcessMessage,\n closeWindowButtonText: closeWindowButtonText,\n linesAddedToCartDialogResources: this._generateLinesAddedToCartDialogResources()\n }\n };\n\n return OrderTemplateActionsView(orderTemplateActions);\n }\n\n private _generateOrderTemplateNameDialogResources(resources: IOrderTemplateResources): IOrderTemplateNameDialogResources {\n return {\n orderTemplateHeaderLabel: resources.renameOrderTemplateTitleText,\n orderTemplateTitleLabel: resources.orderTemplateTitle,\n orderTemplateNameAriaLabel: resources.orderTemplateTitle,\n orderTemplateDescription: '',\n defaultOrderTemplateName: resources.defaultOrderTemplateName,\n orderTemplateButtonLabel: resources.renameOrderTemplateButtonText,\n orderTemplateCancelButtonLabel: resources.cancelBtnLabel\n };\n }\n\n private _getCurrentUrl = (reqContext: IRequestContext): URL=> {\n if (MsDyn365.isBrowser) {\n return new URL(window.location.href);\n }\n return new URL(reqContext.url.requestUrl.href);\n }\n\n private _renderItemAddedToCartDialog = (): React.ReactNode | null => {\n if (!this.state.itemAddedToCartDialogData) {\n return null;\n }\n\n const onClose = () => {\n this.setState({\n itemKey: this.state.itemKey,\n userMessage: this.state.userMessage,\n statusCssString: this.state.statusCssString,\n messageGlyph: this.state.messageGlyph,\n isOpen: this.state.isOpen,\n isItemAddedToOrderTemplateOpen: false\n });\n };\n\n return (\n \n );\n }\n\n private _isFirstPage(): boolean {\n return this._getCurrentPageNumber() === 0;\n }\n\n private _getCurrentPageNumber(): number {\n const itemsPerPage = this.props.config.itemsPerPage || 50;\n return this.props.context.request.query && (+this.props.context.request.query.skip / itemsPerPage) || 0;\n }\n\n private _renderPagination = (): React.ReactNode | null => {\n const { config, context, data, resources } = this.props;\n const orderTemplate = data && data.orderTemplate && data.orderTemplate.result;\n if (!orderTemplate) {\n return null;\n }\n\n const fullUrl = this._getCurrentUrl(context.request);\n const itemsPerPage = config.itemsPerPage || 50;\n const currentPageNumber = this._getCurrentPageNumber();\n const skipCount = currentPageNumber * itemsPerPage;\n const totalItems = orderTemplate && orderTemplate.totalLines;\n const previousText = resources.flipperPrevious;\n const nextText = resources.flipperNext;\n\n if (totalItems <= itemsPerPage) {\n return null;\n }\n\n return (\n
}\n nextText={
{nextText}
}\n previousAriaLabel={previousText}\n nextAriaLabel={nextText}\n />\n );\n }\n\n private _renderProductList(): IOrderTemplateLineViewProps[] {\n const {\n priceFree,\n originalPriceText,\n currentPriceText,\n addOrderTemplateItemToBagButtonText,\n removeItemFromOrderTemplateButtonText,\n productDimensionTypeColor,\n productDimensionTypeSize,\n productDimensionTypeStyle,\n inputQuantityAriaLabel,\n deleteButtonText\n } = this.props.resources;\n\n const { context, telemetry } = this.props;\n const { imageSettings } = this.props.config;\n\n return this.state.productSelection?.map((line, index) => {\n const currentProductProps: IOrderTemplateLineProps = {\n orderTemplateLine: line,\n productListLine: line.productListLine ,\n price: line.fullProduct?.ProductPrice,\n context: context,\n productUrl: line.fullProduct ? getProductUrlSync(line.fullProduct.ProductDetails, context.actionContext, undefined) : '',\n imageSettings: imageSettings,\n telemetry: telemetry,\n moduleId: this.props.id,\n moduleTypeName: this.props.typeName,\n quantity: line.productListLine.Quantity!,\n handlers: {\n onAddToBag: this._addItemToBag,\n onRemoveItem: this._removeItemFromOrderTemplateLines,\n onChangeQuantity: this._changeQuantity,\n onSelect: this.onSelect.bind(this)\n },\n resources: {\n productDimensionTypeColor: productDimensionTypeColor,\n productDimensionTypeSize: productDimensionTypeSize,\n productDimensionTypeStyle: productDimensionTypeStyle,\n freePriceText: priceFree,\n originalPriceText: originalPriceText,\n currentPriceText: currentPriceText,\n inputQuantityAriaLabel: inputQuantityAriaLabel,\n removeFromOrderTemplateLinesText: removeItemFromOrderTemplateButtonText,\n addToBagButtonText: addOrderTemplateItemToBagButtonText,\n deleteButtonText: deleteButtonText\n },\n index: index,\n isMobile: this.isMobile,\n toggleDetailsDisplayed: this._toggleDetailsDisplayed\n };\n\n return OrderTemplateLineView(currentProductProps)!;\n });\n }\n\n private _toggleDetailsDisplayed = (props: IOrderTemplateLineProps): void => {\n let state = {\n isDetailsDisplayed: !this.state.isDetailsDisplayed,\n };\n if (props) {\n state = {...state, ...{\n detailedProductView: OrderTemplateMobileLineView(props)\n }};\n }\n this.setState(state);\n }\n\n // dismiss alert when addingToCart/removeItem\n private _onDismiss = () => {\n this.setState({\n isOpen: false\n });\n };\n\n private _changeQuantity = (itemKey: string, quantity: number, props?: IOrderTemplateLineProps) => {\n const { context, data, telemetry, config } = this.props;\n const { orderTemplate } = data;\n\n if (context) {\n if (orderTemplate.result) {\n const orderTemplateLinesData = orderTemplate && orderTemplate.result && orderTemplate.result.orderTemplateLines;\n if (orderTemplateLinesData) {\n const orderLineIndex = orderTemplateLinesData.findIndex(lines => lines.productListLine.LineId === itemKey);\n const newProductListLine = { ...orderTemplateLinesData[orderLineIndex] };\n if (orderTemplateLinesData[orderLineIndex].productListLine.Quantity === quantity) {\n return;\n }\n const prevQuantity = newProductListLine.productListLine.Quantity;\n newProductListLine.productListLine.Quantity = quantity;\n const { fullProduct, ...line } = newProductListLine;\n\n // update mobile modal\n if (props) {\n props.quantity = quantity;\n this.setState({\n detailedProductView: OrderTemplateMobileLineView(props)\n });\n }\n\n updateProductListLinesAsync({ callerContext: context.actionContext }, orderTemplate.result.productList.Id, [line.productListLine])\n .then(list => {\n this.setState({\n itemKey: itemKey,\n userMessage: '',\n statusCssString: 'success',\n messageGlyph: 'fas fa-check',\n isOpen: false\n });\n if (list) {\n const newLine = list.find(lines => lines.LineId === itemKey);\n orderTemplateLinesData[orderLineIndex].productListLine = newLine!;\n const updatedLines = [...orderTemplateLinesData];\n updatedLines[orderLineIndex] = { fullProduct, productListLine: newLine! };\n const updatedOrderTemplate = { ...orderTemplate.result, ProductListLines: updatedLines };\n context.actionContext.update(new ActiveOrderTemplateLinesInput(context.actionContext.requestContext, config), updatedOrderTemplate);\n }\n })\n .catch(error => {\n telemetry.warning('[order-template-lines] Unable to update product quantity.');\n telemetry.error(error);\n const userMessage = 'Failed to update quantity value.';\n if (props) {\n props && (props.productListLine.Quantity = prevQuantity);\n this.setState({\n itemKey: itemKey,\n userMessage: userMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true,\n detailedProductView: OrderTemplateMobileLineView(props)\n });\n } else {\n newProductListLine.productListLine.Quantity = prevQuantity;\n this.setState({\n itemKey: itemKey,\n userMessage: userMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true,\n });\n }\n });\n }\n }\n }\n };\n\n private _addItemToBag = (product: SimpleProduct, quantity: number, itemKey: string): void => {\n const { context, data, resources, telemetry } = this.props;\n const { cart } = data;\n const { maxQuantityLimitText, addedToCartFailureMessage } = resources;\n\n if (context) {\n if (cart.result) {\n const addProductToCartInput = {\n product: product,\n count: quantity\n };\n\n cart.result\n .addProductToCart(addProductToCartInput)\n .then(result => {\n if (result.status === 'SUCCESS') {\n return getPriceForSelectedVariant(\n new PriceForSelectedVariantInput(\n product.RecordId,\n this.props.context.actionContext.requestContext.apiSettings.channelId,\n product),\n this.props.context.actionContext).then(priceResult => {\n if (!priceResult) {\n return AsyncResult.reject('Failed to retrieve product price');\n }\n this.setState({\n itemKey: itemKey,\n userMessage: '',\n statusCssString: 'success',\n messageGlyph: 'fas fa-check',\n isOpen: false,\n isItemAddedToOrderTemplateOpen: true,\n itemAddedToCartDialogData: {\n product: product,\n productPrice: priceResult,\n quantity: quantity\n },\n isDetailsDisplayed: false\n });\n return AsyncResult.resolve();\n });\n } else if (result.substatus === 'MAXQUANTITY') {\n this.setState({\n itemKey: itemKey,\n userMessage:\n maxQuantityLimitText\n .replace('{curQuantity}', quantity.toString())\n .replace('{maxQuantity}', context.app.config.maxQuantityForProductListLineItem.toString()) ||\n `You can only add ${context.app.config.maxQuantityForProductListLineItem} of this item to your shopping bag`,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n });\n return AsyncResult.resolve();\n } else {\n telemetry.debug('[order-template-lines] Unable to Update Cart Line from the order template lines');\n this.setState({\n itemKey: itemKey,\n userMessage: addedToCartFailureMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n });\n return AsyncResult.resolve();\n }\n })\n .catch(error => {\n telemetry.warning(error);\n telemetry.debug('[order-template-lines] Error trying to Update Cart Line from the order template lines');\n this.setState({\n itemKey: itemKey,\n userMessage: addedToCartFailureMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n });\n });\n }\n }\n };\n\n private _removeItemFromOrderTemplateLines = (line: IOrderTemplateLineViewModel): void | undefined => {\n const { context, data, telemetry } = this.props;\n const { orderTemplate } = data;\n\n if (context && context.actionContext) {\n const userToken = context.request.user.isAuthenticated && context.request.user.token;\n if (userToken && orderTemplate.result && orderTemplate.result && line) {\n removeProductListLinesAsync({ callerContext: context.actionContext }, line.productListLine.ProductListId!, [line.productListLine])\n .then(() => {\n window.location.reload(false);\n })\n .catch(error => {\n telemetry.warning('[order-template-lines] Unable remove items from the order template lines');\n telemetry.error(error);\n });\n } else {\n telemetry.warning(\n '[order-template-lines] Unable remove items from the order template lines user token or lineItemID was not found'\n );\n }\n }\n };\n\n private _renameTemplate = async (_template: ProductList): Promise => {\n window.location.reload(false);\n return Promise.resolve();\n };\n\n private _removeTemplate = () => {\n const { context, data, telemetry, resources } = this.props;\n const { orderTemplate } = data;\n\n if (context && context.actionContext) {\n const userToken = context.request.user.isAuthenticated && context.request.user.token;\n if (userToken && orderTemplate && orderTemplate.result) {\n deleteAsync({ callerContext: context.actionContext }, orderTemplate.result.productList)\n .then()\n .catch((error: string) => {\n telemetry.warning('[order-template] Unable to delete order template.');\n telemetry.error(error);\n this.setState({\n itemKey: orderTemplate.result?.productList.Id || '',\n userMessage: resources.deleteOrderTemplateFailedText,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n });\n });\n const newLink = getUrlSync('ordertemplatelist', this.props.context.actionContext);\n if (newLink) {\n window.location.assign(newLink);\n }\n } else {\n telemetry.warning('[order-template] Failed to delete order template. Order template was not found');\n }\n } else {\n telemetry.warning('[order-template] Failed to delete order template.');\n }\n };\n\n private _updateViewport(): void {\n this._viewport = this._getViewport();\n }\n\n private _getViewport = (): GridSize => {\n const { context } = this.props;\n\n // always render in mobile viewport on a mobile device\n if (context.request && context.request.device && context.request.device.Type === 'Mobile') {\n return 'xs';\n }\n\n if (typeof window !== undefined && window.innerWidth) {\n const gridSettings = context.request.gridSettings;\n if (gridSettings) {\n if (gridSettings.xs && window.innerWidth <= gridSettings.xs.w) {\n return 'xs';\n } else if (gridSettings.sm && window.innerWidth <= gridSettings.sm.w) {\n return 'sm';\n } else if (gridSettings.md && window.innerWidth <= gridSettings.md.w) {\n return 'md';\n } else if (gridSettings.lg && window.innerWidth <= gridSettings.lg.w) {\n return 'lg';\n } else {\n return 'xl';\n }\n }\n }\n\n return 'xs';\n }\n}\n\nexport default OrderTemplateLines;\n","import {\n format,\n INodeProps,\n Progress\n} from '@msdyn365-commerce-modules/utilities';\nimport { RatingsSummary } from '@msdyn365-commerce/commerce-entities';\nimport React from 'react';\n\nexport interface IHistogramItemsProps {\n ratingsSummary: RatingsSummary;\n resources: IHistogramItemsResources;\n locale: string;\n onClick(stars: number): void;\n}\n\nexport interface IHistogramItemsResources {\n barItemAriaLabel: string;\n}\n\nexport interface IHistogramItemViewProps {\n starLabel: React.ReactElement;\n bar: React.ReactElement;\n percentage: React.ReactElement;\n buttonProps: INodeProps;\n}\n\n/**\n * CartLineItems component\n */\n\nexport const HistogramItems = (props: IHistogramItemsProps): IHistogramItemViewProps[] => {\n const {ratingsSummary} = props;\n const totalRatingsCount: number = ratingsSummary.totalRatingsCount || 0;\n return [\n renderItem(props, 5, ratingsSummary.star5Count, totalRatingsCount),\n renderItem(props, 4, ratingsSummary.star4Count, totalRatingsCount),\n renderItem(props, 3, ratingsSummary.star3Count, totalRatingsCount),\n renderItem(props, 2, ratingsSummary.star2Count, totalRatingsCount),\n renderItem(props, 1, ratingsSummary.star1Count, totalRatingsCount),\n ];\n};\n\nconst renderItem = (props: IHistogramItemsProps, stars: number, count?: number, totalCount?: number): IHistogramItemViewProps => {\n count = count || 0;\n totalCount = totalCount || 0;\n const percentage = totalCount === 0 ? 0 : count / totalCount;\n const formattedPercent = new Intl.NumberFormat(props.locale, { style: 'percent' }).format(percentage);\n const ariaLabel = format(props.resources.barItemAriaLabel, stars, formattedPercent);\n\n return {\n starLabel: {stars},\n percentage: {formattedPercent},\n bar: ,\n buttonProps: {tag: 'button', className: 'ms-ratings-histogram__item', onClick: () => {props.onClick(stars);}}\n };\n};\n\nexport const AverageRatingNumber: React.FC<{summary: RatingsSummary}> = (props: {summary: RatingsSummary}) => {\n return

{props.summary.averageRating} / 5

;\n};\n\nexport const TotalReviews: React.FC<{summary: RatingsSummary}> = (props: {summary: RatingsSummary}) => {\n return

{props.summary.totalRatingsCount}

;\n};","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { format, IModuleProps, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport { RatingComponent } from '@msdyn365-commerce/components';\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport classname from 'classnames';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\nimport { createRatingsReviewsStateInput } from '../../actions/ratings-reviews-state-data-action';\nimport { AverageRatingNumber, HistogramItems, IHistogramItemViewProps, TotalReviews } from './component/components';\nimport { IRatingsHistogramData } from './ratings-histogram.data';\nimport { IRatingsHistogramProps } from './ratings-histogram.props.autogenerated';\n\nexport interface IRatingsHistogramViewProps extends IRatingsHistogramProps {\n className: string;\n histogramItems: IHistogramItemViewProps[];\n moduleProps: IModuleProps;\n heading: React.ReactNode;\n averageRating: React.ReactNode;\n averageNumber: React.ReactNode;\n totalReviews: React.ReactNode;\n histogramProps: INodeProps;\n ratingsSummaryProps: INodeProps;\n callbacks: IRatingsHistogramCallbacks;\n}\n\nexport interface IRatingsHistogramCallbacks {\n selectFilterBy(stars: number): void;\n}\n\n/**\n * RatingsHistogram component\n * @extends {React.Component>}\n */\n@observer\nclass RatingsHistogram extends React.Component> {\n\n constructor(props: IRatingsHistogramProps) {\n super(props);\n this.selectFilterBy = this.selectFilterBy.bind(this);\n }\n\n public render(): JSX.Element | null {\n const { resources } = this.props;\n const { className, heading } = this.props.config;\n const {ratingsSummary: {result: ratingsSummary}} = this.props.data;\n const ratingCount = ratingsSummary && ratingsSummary.totalRatingsCount ? `${ratingsSummary.totalRatingsCount}` : '0';\n\n const completeClass = classname('ms-ratings-histogram', className);\n const viewProps: IRatingsHistogramViewProps = {\n ...this.props,\n className: completeClass,\n callbacks: {\n selectFilterBy: this.selectFilterBy\n },\n moduleProps: {\n moduleProps: this.props,\n className: completeClass\n },\n histogramItems: ratingsSummary ? HistogramItems({ratingsSummary: ratingsSummary, resources: {...resources}, locale: this.props.context.request.locale, onClick: this.selectFilterBy}) : [],\n averageRating: ratingsSummary && (\n \n ),\n averageNumber: ratingsSummary && ,\n totalReviews: ratingsSummary && ,\n ratingsSummaryProps: {className: 'ms-ratings-histogram__summary'},\n heading: heading && (\n \n ),\n histogramProps: {className: 'ms-ratings-histogram__histogram'}\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent) => this.props.config.heading!.text = event.target.value;\n\n public selectFilterBy(stars: number): void {\n const filterKey = `${stars}`;\n this.props.context.actionContext.update(createRatingsReviewsStateInput({filterKey}), {filterKey});\n }\n}\n\nexport default RatingsHistogram;\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as React from 'react';\n\nexport interface IWishlistItemDimension {\n key: string;\n className?: string;\n dimensionType: string;\n dimensionValue: string;\n}\n\nexport const WishlistItemDimension: React.FC = ({ key, className, dimensionType, dimensionValue }) => (\n
\n {dimensionType}:\n {dimensionValue}\n
\n);","import { getFallbackImageUrl } from '@msdyn365-commerce-modules/retail-actions';\nimport { Alert, Button, getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport { PriceComponent } from '@msdyn365-commerce/components';\nimport { ICoreContext, IImageSettings, Image, ITelemetry } from '@msdyn365-commerce/core';\nimport { CommerceListLine, ProductPrice, ReleasedProductType, SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport * as React from 'react';\nimport { IWishlistItemActionMessageState } from '../wishlist-items';\nimport { WishlistItemDimension } from './wishlist-items-dimensions';\n\nexport interface IWishlistItemProps extends CommerceListLine {\n product: SimpleProduct;\n wishlistState: IWishlistItemActionMessageState;\n price?: ProductPrice;\n context: ICoreContext;\n productUrl: string;\n imageSettings?: IImageSettings;\n removeFromWishlistText: string;\n isInStock: boolean;\n addToCartText: string;\n outOfStockText: string;\n index: number;\n itemKey: string;\n telemetry: ITelemetry;\n moduleId: string;\n moduleTypeName: string;\n enableImageProductLink?: boolean;\n inventoryInformationLabel?: string;\n inventoryLabelClassName?:string;\n telemetryContent?: ITelemetryContent;\n handlers: {\n onAddToCart(product: SimpleProduct, itemKey: string): void;\n onRemoveItem(productId: number): void | undefined;\n onDismiss(): void;\n };\n resources:{\n productDimensionTypeColor: string;\n productDimensionTypeSize: string;\n productDimensionTypeStyle: string;\n originalPriceText: string;\n currentPriceText: string;\n freePriceText: string;\n };\n}\n\nexport interface IWishlistItemViewProps {\n key: string;\n productImage: React.ReactNode;\n productLink: React.ReactNode;\n productDimensions?: React.ReactNode[];\n productPrice?: React.ReactNode;\n addToCartButton?: React.ReactNode;\n removeButton?: React.ReactNode;\n productStatusMessage?: React.ReactNode;\n productName?: React.ReactNode;\n productAriaLabel?: string;\n entireProductLink?: string;\n inventoryInformation?: React.ReactNode;\n}\n\nconst _addItemToCart = (props: IWishlistItemProps): void => {\n const { product, itemKey, handlers } = props;\n const { onAddToCart } = handlers;\n\n onAddToCart && product && itemKey && onAddToCart(product, itemKey);\n};\n\nconst _removeItemFromWishlist = (props: IWishlistItemProps): void => {\n const { onRemoveItem } = props.handlers;\n const { RecordId } = props.product;\n\n onRemoveItem && RecordId && onRemoveItem(RecordId);\n};\n\nconst WishListItemActions = {\n addToCart: _addItemToCart,\n removeItem: _removeItemFromWishlist,\n};\n\n// tslint:disable-next-line:cyclomatic-complexity\nexport const WishlistItem = (input: IWishlistItemProps): IWishlistItemViewProps | null => {\n const { product, productUrl, price, context, imageSettings, isInStock, removeFromWishlistText,\n addToCartText, outOfStockText, wishlistState, itemKey, handlers, enableImageProductLink, inventoryInformationLabel, inventoryLabelClassName, telemetryContent } = input;\n\n if (!product) {\n return null;\n }\n\n const { RecordId, Name, PrimaryImageUrl, Dimensions } = product;\n\n const addItemAction = (event: React.MouseEvent) => { return WishListItemActions.addToCart(input); };\n const removeItemAction = (event: React.MouseEvent) => { return WishListItemActions.removeItem(input); };\n const { onDismiss } = handlers;\n const inventoryCssName = inventoryLabelClassName? `ms-wishlist-items__inventory-label ${inventoryLabelClassName}` : 'ms-wishlist-items__inventory-label';\n const fallbackImage = getFallbackImageUrl(product.ItemId, context.actionContext.requestContext.apiSettings);\n const payLoad = getPayloadObject('click', telemetryContent!, '', RecordId.toString());\n const productAttributes = getTelemetryAttributes(telemetryContent!, payLoad);\n\n // check if the product is service or not by product type\n const PRODUCTASSERVICE = 2 as ReleasedProductType.Service;\n const isServiceItem = product.ItemTypeValue === PRODUCTASSERVICE;\n\n return {\n key: `${RecordId}-item`,\n productImage: PrimaryImageUrl && Name && _renderProductImage(context, product.Name!, PrimaryImageUrl, fallbackImage, imageSettings),\n productLink: productUrl &&\n (\n \n {Name}\n \n ),\n productDimensions: Dimensions && _renderProductDimensions(input),\n productPrice: price && _renderPrice(input),\n entireProductLink: enableImageProductLink ? productUrl : undefined,\n productAriaLabel: enableImageProductLink ? _renderAriaLabel(input) : undefined,\n productName: enableImageProductLink &&\n (\n
{Name}
\n ),\n\n addToCartButton:\n (\n \n { (isServiceItem || isInStock) && addToCartText || outOfStockText }\n \n ),\n inventoryInformation: inventoryInformationLabel && (\n {inventoryInformationLabel}\n ),\n removeButton:\n (\n \n ),\n productStatusMessage: wishlistState && wishlistState.isOpen &&\n wishlistState.productId === RecordId && wishlistState.itemKey === itemKey &&\n (\n
\n \n {wishlistState.userMessage}\n \n
\n )\n\n };\n\n};\n\nconst _renderProductImage = (context: ICoreContext, heading: string, image?: string, fallbackImage?: string, imageSettings?: IImageSettings): JSX.Element | null => {\n const defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: `w=315&h=315&m=6`, w: 0, h: 0 },\n lg: { q: `w=315&h=315&m=6`, w: 0, h: 0 },\n xl: { q: `w=315&h=315&m=6`, w: 0, h: 0 }\n },\n lazyload: true,\n cropFocalRegion: true\n };\n\n if(imageSettings) {\n imageSettings.cropFocalRegion = true;\n }\n\n if (image) {\n return (\n \n );\n }\n return null;\n};\n\nconst _renderPrice = (props: IWishlistItemProps): JSX.Element | null => {\n const { price, context, moduleId, moduleTypeName, resources } = props;\n\n if (price) {\n return (\n \n );\n }\n return null;\n};\n\nconst _renderProductDimensions = (props: IWishlistItemProps): (React.ReactNode | undefined)[] => {\n const { product, resources } = props;\n\n if (!product || !product.Dimensions) {\n return [];\n }\n\n return product.Dimensions.map((dimension, index) => {\n if (!dimension.DimensionValue || !dimension.DimensionValue.Value) {\n return undefined;\n }\n\n let type = '';\n\n switch(dimension.DimensionTypeValue) {\n case 1: {\n type = resources.productDimensionTypeColor;\n break;\n }\n case 3: {\n type = resources.productDimensionTypeSize;\n break;\n }\n case 4: {\n type = resources.productDimensionTypeStyle;\n break;\n }\n default:\n return undefined;\n }\n\n return (\n \n );\n });\n};\n\nconst _renderAriaLabel = (props: IWishlistItemProps): string => {\n const { product, price, context, resources } = props;\n\n const { Name, Dimensions, } = product;\n const { productDimensionTypeColor, productDimensionTypeSize, productDimensionTypeStyle } = resources;\n\n let formattedPrice = 'Free';\n let dimensions = null;\n\n if (price) {\n formattedPrice = price.BasePrice === 0 ? resources.freePriceText : context.cultureFormatter.formatCurrency(price.BasePrice!, price.CurrencyCode);\n }\n\n if (Dimensions) {\n dimensions = Dimensions.map(productDimension => {\n switch(productDimension.DimensionTypeValue) {\n case 1:\n return (`${productDimensionTypeColor}${productDimension.DimensionValue && productDimension.DimensionValue.Value}`);\n case 3:\n return (`${productDimensionTypeSize}${productDimension.DimensionValue && productDimension.DimensionValue.Value}`);\n case 4:\n return (`${productDimensionTypeStyle}${productDimension.DimensionValue && productDimension.DimensionValue.Value}`);\n default:\n return '';\n }\n });\n }\n\n return (`${Name} ${formattedPrice} ${dimensions && dimensions.join('') || ''}`);\n};\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport classnames from 'classnames';\nimport * as React from 'react';\nimport { wishlistStatus } from '../wishlist-items';\n\nexport interface IWishlistItemsStatusMessageProps {\n className?: string;\n errorType: wishlistStatus;\n text?: string;\n}\n\nexport const WishlistItemsStatusMessage: React.FC = ({className, errorType, text}) => {\n switch(errorType) {\n case 'EMPTY':\n return (\n

{ text }

\n );\n case 'FAILED':\n return (\n

{ text }

\n );\n case 'LOADING':\n default:\n return (\n

{ text }

\n );\n }\n};\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { ArrayExtensions, getProductUrlSync, IProductInventoryInformation } from '@msdyn365-commerce-modules/retail-actions';\nimport { getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport { FullProduct } from '@msdyn365-commerce/commerce-entities';\nimport * as MsDyn365 from '@msdyn365-commerce/core';\nimport { AsyncResult, CommerceList, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { createGetByCustomerInput, removeLinesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CommerceListsDataActions.g';\nimport { getDeliveryOptionsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport classnames from 'classnames';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\nimport getItemsInWishlists, { ActiveWishlistInput } from './actions/get-items-in-wishlists';\nimport { IWishlistItemViewProps, WishlistItem, WishlistItemsStatusMessage } from './components/';\nimport { IWishlistItemsData } from './wishlist-items.data';\nimport { IHeadingData, IWishlistItemsProps } from './wishlist-items.props.autogenerated';\n\nexport interface IWishlistItemActionMessageState {\n productId: number;\n itemKey: string;\n userMessage: string;\n statusCssString: string;\n messageGlyph: string;\n isOpen: boolean;\n}\n\nexport type wishlistStatus = 'LOADING' | 'SUCCESS' | 'FAILED' | 'EMPTY';\n\nexport interface IWishlistItemsViewProps extends IWishlistItemsProps {\n WishlistItems: IModuleProps;\n status?: wishlistStatus;\n statusMessage?: React.ReactNode;\n heading?: React.ReactNode;\n Products?: INodeProps;\n Product?: INodeProps;\n ProductDetails?: INodeProps;\n ProductDimensions?: INodeProps;\n products?: IWishlistItemViewProps[];\n telemetryContent?: ITelemetryContent;\n}\n\n/**\n *\n * WishlistItems component\n * @extends {React.PureComponent, IWishlistItemActionMessageState>}\n */\n@observer\nclass WishlistItems extends React.Component, IWishlistItemActionMessageState> {\n\n private telemetryContent: ITelemetryContent;\n\n constructor(props: IWishlistItemsProps) {\n super(props);\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\n }\n\n public async componentDidMount(): Promise {\n this.setState({});\n }\n\n public render(): JSX.Element | null {\n const { heading, className } = this.props.config;\n const { emptyWishlistText, wishlistErrorGettingWishlist } = this.props.resources;\n const { cart, productAvailability, wishlists, products } = this.props.data;\n\n if (cart.status === 'LOADING' || productAvailability.status === 'LOADING' || wishlists.status === 'LOADING') {\n const errorProps: IWishlistItemsViewProps = {\n ...(this.props as IWishlistItemsProps),\n WishlistItems: {\n moduleProps: this.props,\n className: classnames('ms-wishlist-items', className),\n },\n status: 'LOADING',\n // statusMessage: \n statusMessage: ,\n heading: this._renderHeading(heading)\n };\n return this.props.renderView(errorProps);\n }\n\n if (cart.status === 'FAILED' || productAvailability.status === 'FAILED' || wishlists.status === 'FAILED') {\n const errorProps: IWishlistItemsViewProps = {\n ...(this.props as IWishlistItemsProps),\n WishlistItems: {\n moduleProps: this.props,\n className: classnames('ms-wishlist-items', className),\n },\n status: 'FAILED',\n statusMessage: ,\n heading: this._renderHeading(heading)\n };\n\n return this.props.renderView(errorProps);\n }\n\n const productsList = products && (products as AsyncResult).result;\n\n if (!!productsList && productsList.length === 0) {\n const emptyViewProps: IWishlistItemsViewProps = {\n ...(this.props as IWishlistItemsProps),\n WishlistItems: {\n moduleProps: this.props,\n className: classnames('ms-wishlist-items', className),\n },\n status: 'EMPTY',\n statusMessage: ,\n heading: this._renderHeading(heading)\n };\n\n return this.props.renderView(emptyViewProps);\n }\n\n const viewProps: IWishlistItemsViewProps = {\n ...(this.props as IWishlistItemsProps),\n WishlistItems: {\n moduleProps: this.props,\n className: classnames('ms-wishlist-items', className),\n },\n status: 'SUCCESS',\n heading: this._renderHeading(heading),\n Products: {\n className: 'ms-wishlist-items__products',\n tag: 'ul',\n },\n Product: {\n className: 'ms-wishlist-items__product',\n tag: 'li',\n },\n ProductDetails: {\n className: 'ms-wishlist-items__product-link',\n tag: 'a',\n },\n telemetryContent: this.telemetryContent,\n ProductDimensions: {\n className: 'ms-wishlist-items__product-dimensions',\n },\n products: productsList && this._renderProductList(productsList),\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n public handleHeadingChange = (event: MsDyn365.ContentEditableEvent) => this.props.config.heading!.text = event.target.value;\n\n private _renderProductList(products: FullProduct[]): IWishlistItemViewProps[] {\n\n const { priceFree, originalPriceText, currentPriceText, addToCartButtonText, outOfStockText, removeButtonText, productDimensionTypeColor, productDimensionTypeSize, productDimensionTypeStyle, productDimensionTypeAmount} = this.props.resources;\n const { context, telemetry } = this.props;\n const { imageSettings, enableImageProductLink } = this.props.config;\n\n return products.map((product: FullProduct, index) => {\n const currentProductProps = {\n product: product.ProductDetails,\n price: product.ProductPrice,\n context: context,\n wishlistState: this.state,\n productUrl: getProductUrlSync(product.ProductDetails, context.actionContext, undefined),\n imageSettings: imageSettings,\n removeFromWishlistText: removeButtonText,\n isInStock: this._isProductInStock(product),\n addToCartText: addToCartButtonText,\n outOfStockText: outOfStockText,\n index: index,\n itemKey: `${product.ProductDetails.RecordId}-${product.ProductDetails.ItemId}-${index}`,\n telemetry: telemetry,\n moduleId: this.props.id,\n moduleTypeName: this.props.typeName,\n enableImageProductLink: enableImageProductLink,\n inventoryInformationLabel: this._inventoryLabel(product),\n inventoryLabelClassName: this._inventoryClassName(product),\n telemetryContent: this.telemetryContent,\n handlers: {\n onAddToCart: this._addItemToCart,\n onRemoveItem: this._removeItemFromWishlist,\n onDismiss: this._onDismiss\n },\n resources: {\n productDimensionTypeColor: productDimensionTypeColor,\n productDimensionTypeSize: productDimensionTypeSize,\n productDimensionTypeStyle: product.ProductDetails.IsGiftCard ? productDimensionTypeAmount : productDimensionTypeStyle,\n freePriceText: priceFree,\n originalPriceText: originalPriceText,\n currentPriceText: currentPriceText\n }\n };\n\n return (\n WishlistItem(currentProductProps)!\n );\n });\n }\n\n // dismiss alert when addingToCart/removeItem\n private _onDismiss = () => {\n this.setState({\n isOpen: false\n });\n }\n\n private _renderHeading = (heading?: IHeadingData): JSX.Element | undefined => {\n if(!heading) {\n return undefined;\n }\n return(\n \n );\n }\n\n private _addItemToCart = async (product: SimpleProduct, itemKey: string): Promise => {\n const { context, data, resources, telemetry } = this.props;\n const { cart, productAvailability } = data;\n const { addedToCartSuccessMessage, addedToCartFailureMessage } = resources;\n\n const productInventoryInformation = this._getProductInventory({ProductDetails:product}, productAvailability.result);\n\n if (context) {\n if (cart.result) {\n const isOrderQuantityLimitsFeatureEnabledInHq = this.props.data.featureState.result\n ?.find(featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature')?.IsEnabled || false;\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\n const customerInfo = this.props.data.customerInformation.result;\n\n const isOrderQuantityLimitsFeatureEnabledInSiteSettings = defaultOrderQuantityLimitsFeatureConfig === 'all' ||\n (customerInfo &&\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b)));\n\n const isOrderQuantityLimitsFeatureEnabled = isOrderQuantityLimitsFeatureEnabledInHq && isOrderQuantityLimitsFeatureEnabledInSiteSettings;\n\n // check if the product delivery mode is electronic\n const emailDeliveryModeCode = this.props.context.actionContext.requestContext.channel?.EmailDeliveryModeCode;\n\n const deliveryOptions = await getDeliveryOptionsAsync(\n { callerContext: this.props.context.actionContext, queryResultSettings: {} },\n [product.RecordId]);\n\n const addProductToCartInput = {\n product: product,\n quantity: 1,\n enableStockCheck: context.app.config.enableStockCheck,\n availableQuantity: productInventoryInformation?productInventoryInformation.ProductAvailableQuantity.AvailableQuantity : 0,\n additionalProperties: { orderQuantityLimitsFeatureIsEnabled: isOrderQuantityLimitsFeatureEnabled },\n isAddEmailDeliveryItemToCart: ArrayExtensions.hasElements(deliveryOptions) && ArrayExtensions.hasElements(deliveryOptions[0].DeliveryOptions) && deliveryOptions[0].DeliveryOptions![0].Code === emailDeliveryModeCode\n };\n\n cart.result.addProductToCart(addProductToCartInput)\n .then(async result => {\n if (result.status === 'SUCCESS') {\n this.setState({\n productId: product.RecordId,\n itemKey: itemKey,\n userMessage: addedToCartSuccessMessage,\n statusCssString: 'success',\n messageGlyph: 'fas fa-check',\n isOpen: true\n });\n } else if (result.substatus === 'MAXQUANTITY') {\n const curQuantity = (await cart).cart?.CartLines?.find(item => item.ProductId === product.RecordId)?.Quantity || 0;\n const maxQtyLimitReachedMessage = this._getInventoryValueMessage(productInventoryInformation, curQuantity);\n\n this.setState({\n productId: product.RecordId,\n itemKey: itemKey,\n userMessage: maxQtyLimitReachedMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n });\n } else if (result.substatus === 'QUANTITYLIMITS' && isOrderQuantityLimitsFeatureEnabled) {\n const maxQtyLimitReachedMessage = result.errorDetails?.LocalizedMessage!;\n\n this.setState({\n productId: product.RecordId,\n itemKey: itemKey,\n userMessage: maxQtyLimitReachedMessage || addedToCartFailureMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n });\n } else {\n this.props.telemetry.debug('[wishlist-items] Unable to Update Cart Line from the wishlist');\n this.setState({\n productId: product.RecordId,\n itemKey: itemKey,\n userMessage: addedToCartFailureMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n });\n }\n })\n .catch(error => {\n telemetry.warning(error);\n telemetry.debug('[wishlist-items] Error trying to Update Cart Line from the wishlist');\n this.setState({\n productId: product.RecordId,\n itemKey: itemKey,\n userMessage: addedToCartFailureMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n });\n });\n }\n }\n };\n\n private _removeItemFromWishlist = (productId: number): void => {\n const { context, data, telemetry } = this.props;\n const { wishlists } = data;\n\n if (context && context.actionContext) {\n const userToken = context.request.user.isAuthenticated && context.request.user.token;\n const wishlistLineId = this._getWishlistLineIdFromProductId(productId);\n if (userToken && wishlists.result && wishlists.result[0] && wishlistLineId) {\n removeLinesAsync({ callerContext: context.actionContext }, wishlists.result[0].Id, [{ LineId: wishlistLineId }])\n .then(commerceList => {\n const castCommerceList: CommerceList | null = commerceList as (CommerceList | null);\n\n if (castCommerceList && castCommerceList.Id && context.request.user.isAuthenticated) {\n context.actionContext.update(createGetByCustomerInput({}, null), [castCommerceList]);\n getItemsInWishlists(new ActiveWishlistInput(), context.actionContext)\n .then((products) => {\n const castSimpleProducts: FullProduct[] | null = products as (FullProduct[] | null);\n if (castSimpleProducts && castSimpleProducts.length > 0) {\n context.actionContext.update(new ActiveWishlistInput(), castSimpleProducts);\n }\n })\n .catch(error => {\n telemetry.warning('[wishlist-items] Unable to hyderate the wishlist with product information');\n telemetry.error(error);\n });\n }\n })\n .catch(error => {\n telemetry.warning('[wishlist-items] Unable remove items from the wishlist');\n telemetry.error(error);\n });\n } else {\n telemetry.warning('[wishlist-items] Unable remove items from the wishlist user token or lineItemID wasn\\'t found');\n }\n }\n }\n\n private _getInventoryValueMessage(product: IProductInventoryInformation | undefined, curQuantity: number):string {\n const { context, resources } = this.props;\n const { maxQuantityLimitText } = resources;\n\n const maxQuantityForLineItem = context.app.config.maxQuantityForCartLineItem || 10;\n\n if(!product || !product.ProductAvailableQuantity.AvailableQuantity || !context.app.config.enableStockCheck) {\n return maxQuantityLimitText.replace('{maxQuantity}', maxQuantityForLineItem.toString()).replace('{curQuantity}', curQuantity.toString());\n }\n\n const minInventory = Math.min(maxQuantityForLineItem, product.ProductAvailableQuantity.AvailableQuantity);\n\n return maxQuantityLimitText.replace('{maxQuantity}', minInventory.toString()).replace('{curQuantity}', curQuantity.toString());\n }\n\n private _getProductInventory(product: FullProduct, productInventoryCollection: IProductInventoryInformation[] | undefined): IProductInventoryInformation | undefined {\n if(productInventoryCollection && productInventoryCollection.length) {\n for (const productResult of productInventoryCollection) {\n if(product.ProductDetails.RecordId === productResult.ProductAvailableQuantity.ProductId) {\n return productResult;\n }\n }\n }\n return undefined;\n }\n\n private _inventoryLabel = (product: FullProduct):string | undefined => {\n const { productAvailability } = this.props.data;\n if(productAvailability && productAvailability.result) {\n const productInventoryInformation = this._getProductInventory(product, productAvailability.result);\n if(productInventoryInformation) {\n return productInventoryInformation.StockLevelLabel;\n }\n }\n\n return undefined;\n }\n\n private _inventoryClassName = (product: FullProduct):string | undefined => {\n const { productAvailability } = this.props.data;\n if(productAvailability && productAvailability.result) {\n const productInventoryInformation = this._getProductInventory(product, productAvailability.result);\n if(productInventoryInformation && productInventoryInformation.StockLevelCode) {\n return `ms-wishlist-items__${productInventoryInformation.StockLevelCode.toLowerCase()}`;\n }\n }\n\n return undefined;\n }\n\n private _isProductInStock = (product: FullProduct): boolean => {\n const { data, context } = this.props;\n const { productAvailability } = data;\n\n if (!context.app.config.enableStockCheck) {\n return true;\n }\n\n if (!productAvailability.result || !product.ProductDetails) {\n return false;\n }\n\n for (const productResult of productAvailability.result) {\n if (productResult.ProductAvailableQuantity &&\n productResult.ProductAvailableQuantity.ProductId &&\n productResult.ProductAvailableQuantity.ProductId === product.ProductDetails.RecordId) {\n return productResult.IsProductAvailable;\n }\n }\n\n return false;\n }\n\n private _getWishlistLineIdFromProductId = (productId: number): number | null => {\n const { wishlists } = this.props.data;\n\n if (!wishlists.result || !(wishlists.result.length > 0) || !wishlists.result[0].CommerceListLines || !(wishlists.result[0].CommerceListLines.length > 0)) {\n this.props.telemetry.error('Wishlist content is empty, module wont render.');\n return null;\n }\n\n const foundWishlistItem = wishlists.result[0].CommerceListLines.filter((commerceListLine) => {\n return commerceListLine.ProductId === productId;\n });\n\n if (foundWishlistItem && foundWishlistItem[0].LineId) {\n return foundWishlistItem[0].LineId;\n } else {\n return null;\n }\n }\n}\n\nexport default WishlistItems;\n","import { CacheType, IActionInput } from '@msdyn365-commerce/core';\n\nexport const enum ReviewConcernCategory {\n OffensiveContent = '1',\n ReviewResponse = '7',\n SpamAdvertising = '8',\n Profanity = '9'\n}\n\n/**\n * ReportReviewConcern Input Action\n */\nexport class ReportReviewConcernInput implements IActionInput {\n public reviewId: string;\n\n public tenantId: string;\n\n public locale: string;\n\n public serviceEndpoint: string;\n\n public concernCategory: string;\n\n public authToken: string;\n\n constructor(\n reviewId: string,\n tenantId: string,\n locale: string,\n concernCategory: string,\n authToken: string,\n serviceEndpoint: string\n ) {\n this.reviewId = reviewId;\n this.tenantId = tenantId;\n this.locale = locale;\n this.concernCategory = concernCategory;\n this.authToken = authToken;\n this.serviceEndpoint = serviceEndpoint;\n }\n\n public getCacheKey = () => `ReportReviewConcern`;\n public getCacheObjectType = () => 'ReportReviewConcern';\n public dataCacheType = (): CacheType => 'none';\n}\n","import { CacheType, IActionInput } from '@msdyn365-commerce/core';\n\n/**\n * SubmitHelpfulnessVote Input Action\n */\nexport class SubmitHelpfulnessVoteInput implements IActionInput {\n public reviewId: string;\n\n public tenantId: string;\n\n public locale: string;\n\n public serviceEndpoint: string;\n\n public isHelpful: boolean;\n\n public authToken: string;\n\n constructor(\n reviewId: string,\n tenantId: string,\n locale: string,\n isHelpful: boolean,\n authToken: string,\n serviceEndpoint: string\n ) {\n this.reviewId = reviewId;\n this.tenantId = tenantId;\n this.locale = locale;\n this.isHelpful = isHelpful;\n this.authToken = authToken;\n this.serviceEndpoint = serviceEndpoint;\n }\n\n public getCacheKey = () => `SubmitHelpfulnessVote`;\n public getCacheObjectType = () => 'SubmitHelpfulnessVote';\n public dataCacheType = (): CacheType => 'none';\n}\n","import { createObservableDataAction, IAction, IActionContext, sendRequest } from '@msdyn365-commerce/core';\nimport { ReportReviewConcernInput } from './inputs/report-review-concern-input';\n\nasync function reportReviewConcern(input: ReportReviewConcernInput, ctx: IActionContext): Promise {\n if (!inputIsValid(input)) {\n throw new Error(\n `[SubmitHelpfulnessVote] Invalid input. ReviewId=${input.reviewId},tenantId=${input.tenantId},locale= ${\n input.locale\n },`\n );\n }\n\n const requestUrl =\n `${input.serviceEndpoint}/v2.0/concerns/review/${input.reviewId}` +\n `?tenantId=${input.tenantId}` +\n `&locale=${input.locale}`;\n\n const requestBody = {\n concernCategory: input.concernCategory\n };\n\n const requestHeader = {\n headers: {\n Authorization: `id_token ${input.authToken}`\n }\n };\n\n return sendRequest(requestUrl, 'post', requestBody, requestHeader)\n .then(response => {\n return response.status === 200 || response.status === 201;\n })\n .catch((error) => {\n ctx.trace(`[ReportReviewConcernInput] Failed to report a concern`);\n ctx.telemetry.exception(error);\n ctx.telemetry.debug(`[ReportReviewConcernInput] Failed to report a concern`);\n return false;\n });\n}\n\nfunction inputIsValid(input: ReportReviewConcernInput): boolean {\n return (\n input &&\n input.reviewId.length > 0 &&\n input.tenantId.length > 0 &&\n input.locale.length > 0 &&\n input.authToken.length > 0\n );\n}\n\nexport default createObservableDataAction({\n id: '@msdyn365-commerce-modules/ratings-reviews/report-review-concern',\n action: >reportReviewConcern\n});\n","import { createObservableDataAction, IAction, IActionContext, sendRequest } from '@msdyn365-commerce/core';\nimport { SubmitHelpfulnessVoteInput } from './inputs/submit-helpfulness-vote-input';\n\nasync function submitHelpfulnessVote(input: SubmitHelpfulnessVoteInput, ctx: IActionContext): Promise {\n if (!inputIsValid(input)) {\n throw new Error(\n `[SubmitHelpfulnessVote] Invalid input. ReviewId=${input.reviewId},tenantId=${input.tenantId}, locale= ${\n input.locale\n },`\n );\n }\n\n const requestUrl =\n `${input.serviceEndpoint}/v2.0/votes/review/${input.reviewId}` +\n `?tenantId=${input.tenantId}` +\n `&locale=${input.locale}`;\n\n const requestBody = {\n isHelpful: !!input.isHelpful\n };\n\n const requestHeader = {\n headers: {\n Authorization: `id_token ${input.authToken}`\n }\n };\n\n return sendRequest(requestUrl, 'post', requestBody, requestHeader)\n .then(response => {\n return response.status === 200 || response.status === 201;\n })\n .catch((error) => {\n ctx.trace(`[SubmitHelpfulnessVote] Failed to vote on a review`);\n ctx.telemetry.exception(error);\n ctx.telemetry.debug(`[SubmitHelpfulnessVote] Failed to vote on a review`);\n return false;\n });\n}\n\nfunction inputIsValid(input: SubmitHelpfulnessVoteInput): boolean {\n return (\n input &&\n input.reviewId.length > 0 &&\n input.tenantId.length > 0 &&\n input.locale.length > 0 &&\n input.authToken.length > 0\n );\n}\n\nexport default createObservableDataAction({\n id: '@msdyn365-commerce-modules/ratings-reviews/submit-helpfulness-vote',\n action: >submitHelpfulnessVote\n});\n","import { format, getPayloadObject, getTelemetryAttributes, ILabeledDropdownOption, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IReviewCountResources {\n pageReviewCountText: string;\n}\n\nexport interface IReviewCountProps {\n resources: IReviewCountResources;\n currentPage: number;\n reviewsCount: number;\n reviewsShownOnEachPage: number;\n}\n\nexport const ReviewCount: React.FC = (props: IReviewCountProps) => {\n const {currentPage, resources, reviewsCount, reviewsShownOnEachPage} = props;\n\n return (\n \n {format(\n resources.pageReviewCountText,\n _getReviewStartNumber(currentPage, reviewsShownOnEachPage),\n _getReviewEndNumber(currentPage, reviewsCount, reviewsShownOnEachPage),\n reviewsCount\n )}\n \n );\n};\n\nexport interface IPageControlResources {\n previousButtonText: string;\n nextButtonText: string;\n pageReviewAriaLabel: string;\n}\n\nexport interface IPageControlsProps {\n resources: IPageControlResources;\n currentPage: number;\n reviewsCount: number;\n reviewsShownOnEachPage: number;\n selectedSortByOption: ILabeledDropdownOption;\n selectedFilterByOption: ILabeledDropdownOption;\n telemetryContent?: ITelemetryContent;\n updateReviews(skipItems: number, selectedSortByOption: ILabeledDropdownOption, selectedFilterByOption: ILabeledDropdownOption, currentPage: number, isFilterApplied: boolean): Promise;\n}\n\nexport const PageControls: React.FC = (props: IPageControlsProps) => {\n const {currentPage, resources, reviewsCount, reviewsShownOnEachPage} = props;\n const previousPageClick = () => {return _getPreviousPageData(props); };\n const nextPageClick = () => {return _getNextPageData(props); };\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.Next);\n const nextAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n payLoad.contentAction.etext = TelemetryConstant.Previous;\n const previousAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n\n return (\n
\n {_hasPreviousPage(currentPage) && (\n \n {resources.previousButtonText}\n \n )}\n {_hasNextPage(currentPage, reviewsCount, reviewsShownOnEachPage) && (\n \n {resources.nextButtonText}\n \n )}\n
\n );\n};\n\nconst _hasPreviousPage = (currentPage: number): boolean => {\n return currentPage > 1;\n};\n\nconst _hasNextPage = (currentPage: number, reviewsCount: number, reviewsShownOnEachPage: number): boolean => {\n return _getPagesCount(reviewsCount, reviewsShownOnEachPage) > currentPage;\n};\n\nconst _getReviewsShown = (reviewsShownOnEachPage: number) => {\n return Math.min(25, reviewsShownOnEachPage);\n};\n\nconst _getPagesCount = (reviewsCount: number, reviewsShownOnEachPage: number): number => {\n return Math.ceil(reviewsCount / _getReviewsShown(reviewsShownOnEachPage));\n};\n\nconst _paginationAriaLabel = (pageReviewAriaLabel: string, currentPage: number, reviewsCount: number, reviewsShownOnEachPage: number, isNextPage: boolean, page?: number): string => {\n const pageModifier = isNextPage ? 1: -1;\n return format(\n pageReviewAriaLabel,\n _getReviewStartNumber(currentPage, reviewsShownOnEachPage, currentPage + pageModifier),\n _getReviewEndNumber(currentPage, reviewsCount, reviewsShownOnEachPage, currentPage + pageModifier),\n reviewsCount\n );\n};\n\nconst _getReviewStartNumber = (currentPage: number, reviewsShownOnEachPage: number, page?: number): number => {\n return ((page || currentPage) - 1) * _getReviewsShown(reviewsShownOnEachPage) + 1;\n};\n\nconst _getReviewEndNumber = (currentPage: number, reviewsCount: number, reviewsShownOnEachPage: number, page?: number): number => {\n const pageUsed = page || currentPage;\n const pageReviewCount = pageUsed * _getReviewsShown(reviewsShownOnEachPage);\n return pageReviewCount < reviewsCount ? pageReviewCount : reviewsCount;\n};\n\nconst _getPreviousPageData = async (props: IPageControlsProps) => {\n await props.updateReviews(\n _getReviewStartNumber(props.currentPage, props.reviewsShownOnEachPage) - 1 - _getReviewsShown(props.reviewsShownOnEachPage),\n props.selectedSortByOption,\n props.selectedFilterByOption,\n props.currentPage - 1,\n false\n );\n};\n\nconst _getNextPageData = async (props: IPageControlsProps) => {\n\n await props.updateReviews(\n _getReviewEndNumber(props.currentPage, props.reviewsCount, props.reviewsShownOnEachPage),\n props.selectedSortByOption,\n props.selectedFilterByOption,\n props.currentPage + 1,\n false\n );\n};","import {\n Alert,\n getPayloadObject,\n getTelemetryAttributes,\n INodeProps,\n ITelemetryContent,\n Modal,\n ModalBody,\n ModalFooter,\n ModalHeader,\n TelemetryConstant\n} from '@msdyn365-commerce-modules/utilities';\nimport { IAny, ICoreContext, IGeneric} from '@msdyn365-commerce/core';\nimport React from 'react';\nimport { ReviewConcernCategory } from '../../../actions/inputs/report-review-concern-input';\nimport { IRnrKeyValuePair } from '../../../common/rnrInterface';\n\nexport interface IReportReviewModalProps {\n resources: IReportReviewModalResources;\n context: ICoreContext>;\n isOpen: boolean;\n returnRef: React.RefObject | undefined;\n reportedKey: string;\n hasError: boolean;\n telemetryContent?: ITelemetryContent;\n onModalToggle():void;\n onRadioChange(event: React.ChangeEvent): void;\n reportReview(): void;\n}\n\nexport interface IReportReviewModalResources {\n reportConcernText: string;\n feedbackThankYouText: string;\n reportModalMessage: string;\n reportSubmittedMessage: string;\n reportSpamText: string;\n offensiveContentText: string;\n profanityContentText: string;\n okReportReviewText: string;\n cancelReportReviewText: string;\n reportReviewButtonText: string;\n errorMessageText: string;\n}\n\nexport interface IReportReviewModalViewProps {\n modal: INodeProps;\n modalHeader: INodeProps;\n modalFooter: INodeProps;\n modalBody: INodeProps;\n header: React.ReactElement;\n headerSubmitted: React.ReactElement;\n cancelButton: React.ReactElement;\n submitButton: React.ReactElement;\n succesfulButton: React.ReactElement;\n reportMessage: React.ReactElement;\n reportSubmittedMessage: React.ReactElement;\n radioButtons: React.ReactElement;\n error: React.ReactElement;\n}\n\nlet reportConcernDropdownOptions: IRnrKeyValuePair[];\n\n/**\n * CartLineItems component\n */\n\nexport const ReportReviewModal = (props: IReportReviewModalProps):IReportReviewModalViewProps => {\n\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.SubmitReview);\n const submitReviewAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n payLoad.contentAction.etext = TelemetryConstant.SuccessButton;\n const successAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n payLoad.contentAction.etext = TelemetryConstant.Cancel;\n const cancelAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n\n reportConcernDropdownOptions = [\n { key: ReviewConcernCategory.SpamAdvertising, value: props.resources.reportSpamText },\n { key: ReviewConcernCategory.OffensiveContent, value: props.resources.offensiveContentText },\n { key: ReviewConcernCategory.Profanity, value: props.resources.profanityContentText }\n ];\n\n return {\n modal: {tag: Modal, className: 'ms-report-review-modal msc-modal-input-required', toggle: props.onModalToggle, applicationNode: 'renderPage', isOpen: props.isOpen, returnFocusRef: props.returnRef},\n modalHeader: {tag: ModalHeader, toggle: props.onModalToggle, className: 'ms-report-review-modal-header'},\n modalFooter: {tag: ModalFooter, className: 'ms-report-review-modal-footer'},\n modalBody: {tag: ModalBody, className: 'ms-report-review-modal-body'},\n header:

{props.resources.reportConcernText}

,\n headerSubmitted:

{props.resources.feedbackThankYouText}

,\n cancelButton: ,\n submitButton: ,\n succesfulButton: ,\n reportMessage:

{props.resources.reportModalMessage}

,\n reportSubmittedMessage:

{props.resources.reportSubmittedMessage}

,\n radioButtons: radioPairs(props),\n error: {props.resources.errorMessageText}\n };\n};\n\nconst radioPairs = (props: IReportReviewModalProps) => {\n const pairs = [];\n for (const option of reportConcernDropdownOptions) {\n const inputId = `report-review-${option.key}`;\n const checked = option.key === props.reportedKey;\n pairs.push(\n
\n \n \n
\n );\n }\n\n return (\n
\n {pairs}\n
\n );\n};","import { Button, format, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport { Review } from '@msdyn365-commerce/commerce-entities';\nimport {RatingComponent} from '@msdyn365-commerce/components';\nimport { IAny, ICoreContext, IGeneric} from '@msdyn365-commerce/core';\nimport React from 'react';\nimport { TOGGLE_EDIT_MODAL_BUTTON_CARD_ID } from '../../../common/rnrInterface';\n\nexport interface IReviewCardResources {\n wasReviewHelpfulText: string;\n yesButtonText: string;\n noButtonText: string;\n editReviewCardText: string;\n reportedText: string;\n reportConcernText: string;\n reviewRatingNarratorText: string;\n}\n\nexport interface IReviewCardProps {\n review: Review;\n resources: IReviewCardResources;\n context: ICoreContext>;\n isUserReview?: boolean;\n parentId: string;\n parentType: string;\n reportedReviews: string[];\n returnRef: React.RefObject | undefined;\n reportedReviewId: string;\n votedReviews: {reviewId: string; approved: boolean}[];\n toggleWriteReviewModal?(): void;\n toggleReportReviewModal(reviewId: string): void;\n updateReviewHelpfulness(reviewId: string, isHelpful: boolean): void;\n}\n\nexport interface IReviewCardViewProps {\n cardProps: INodeProps;\n name: React.ReactElement;\n rating: React.ReactElement;\n date: React.ReactElement;\n reviewTitle: React.ReactElement;\n reviewText: React.ReactElement;\n ratingHelpfulLabel?: React.ReactElement;\n like?: React.ReactElement;\n dislike?: React.ReactElement;\n edit: React.ReactNode;\n report: React.ReactNode;\n responseName: React.ReactNode;\n responseDate: React.ReactNode;\n responseText: React.ReactNode;\n cardBodyProps: INodeProps;\n responseProps: INodeProps;\n reviewProps: INodeProps;\n controlsProps: INodeProps;\n headerProps: INodeProps;\n}\n\n/**\n * Review card component\n */\n\nexport const ReviewCard = (props: IReviewCardProps):IReviewCardViewProps => {\n const className = props.isUserReview ? 'ms-reviews-list__card ms-reviews-list__user-review' : 'ms-reviews-list__card';\n return {\n cardProps: { className: className, key: props.review.reviewId },\n name:

{props.review.userName}

,\n rating: rating(props),\n date:

{renderDate(props, props.review.submittedDateTime)}

,\n reviewTitle:

{props.review.title}

,\n reviewText:

{props.review.reviewText}

,\n ratingHelpfulLabel: props.isUserReview ? undefined :

{props.resources.wasReviewHelpfulText}

,\n like: props.isUserReview ? undefined : voteHelpfulButton(props, true),\n dislike: props.isUserReview ? undefined : voteHelpfulButton(props, false),\n edit: editButton(props),\n report: reportToggle(props),\n responseName: props.review.userResponse ?

{props.review.userResponse.responderName}

: undefined,\n responseText: props.review.userResponse ?

{props.review.userResponse.responseText}

: undefined,\n responseDate: props.review.userResponse ?

{renderDate(props, props.review.userResponse.submittedDateTime)}

: undefined,\n cardBodyProps: { className: 'ms-reviews-list__card-body' },\n responseProps: { className: 'ms-reviews-list__response' },\n reviewProps: { className: 'ms-reviews-list__review' },\n controlsProps: { className: 'ms-reviews-list__card-controls' },\n headerProps: { className: 'ms-reviews-list__card-header' }\n };\n};\n\nconst rating = (props: IReviewCardProps) => {\n return(\n \n );\n};\n\nconst isVotedFor = (props: IReviewCardProps, isHelpful: boolean): boolean => {\n for (let i = 0; i < props.votedReviews.length; i++) {\n if(props.votedReviews[i].reviewId === props.review.reviewId) {\n return props.votedReviews[i].approved === isHelpful;\n }\n }\n\n return false;\n};\n\nconst voteHelpfulButton = (props: IReviewCardProps, isHelpful: boolean) => {\n const isVoted = isVotedFor(props, isHelpful);\n const isDisabled = props.isUserReview || isVoted ? 'disabled' : '';\n let className = isHelpful ? 'ms-reviews-list__like' : 'ms-reviews-list__dislike';\n className = `${className} ${isDisabled}`;\n const label = isHelpful ? props.resources.yesButtonText : props.resources.noButtonText;\n let voteCount = (isHelpful ? props.review.helpfulPositive : props.review.helpfulNegative) || 0;\n voteCount = isVoted ? voteCount + 1 : voteCount;\n const title = `(${voteCount})`;\n const user = props.context.request.user;\n const onClickMethod = () => {props.updateReviewHelpfulness(props.review.reviewId!, isHelpful);};\n const onClick= isDisabled ? undefined : onClickMethod;\n\n if (user.isAuthenticated) {\n return ;\n }\n return ;\n};\n\nconst editButton = (props: IReviewCardProps) => {\n if (props.isUserReview) {\n return ;\n }\n\n return undefined;\n};\n\nconst renderDate = (props: IReviewCardProps, date?: Date): string | Date => {\n if (!date) {\n return '';\n }\n\n try {\n return new Intl.DateTimeFormat(props.context.request.locale, {month: 'long', day: 'numeric', year: 'numeric'}).format(new Date(date));\n } catch {\n return date;\n }\n};\n\nconst reportToggle = (props: IReviewCardProps) => {\n const user = props.context.request.user;\n if (props.isUserReview) {\n return undefined;\n } else if (!user.isAuthenticated) {\n return ;\n }\n\n if (props.reportedReviews.indexOf(props.review.reviewId!) > -1) {\n return

{props.resources.reportedText}

;\n }\n\n const ref = props.review.reviewId === props.reportedReviewId ? props.returnRef : undefined;\n const onClick = () => {props.toggleReportReviewModal(props.review.reviewId!);};\n return ;\n\n};","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { getRnrAuthEndpointId, getRnrEndpointId, getRnrPartnerId, getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\nimport { format, getTelemetryObject, ILabeledDropdownOnChangeNotification, ILabeledDropdownOption, IModuleProps, INodeProps, ITelemetryContent, LabeledDropdown } from '@msdyn365-commerce-modules/utilities';\nimport { Review } from '@msdyn365-commerce/commerce-entities';\nimport { RatingComponent } from '@msdyn365-commerce/components';\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport classname from 'classnames';\nimport { reaction } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\nimport { getReviewsForGivenProduct } from '../../actions/get-product-reviews';\nimport { GetProductReviewsInput } from '../../actions/inputs/get-product-reviews-input';\nimport { ReportReviewConcernInput, ReviewConcernCategory } from '../../actions/inputs/report-review-concern-input';\nimport { SubmitHelpfulnessVoteInput } from '../../actions/inputs/submit-helpfulness-vote-input';\nimport reportReviewConcern from '../../actions/report-review-concern';\nimport submitHelpfulnessVote from '../../actions/submit-helpfulness-vote';\nimport { IReviewModalViewProps, ReviewModal, submitReview } from '../../common/review-modal';\nimport { IRnrKeyValuePair, IRnrOrderByKeyValuePair } from '../../common/rnrInterface';\nimport { PageControls, ReviewCount } from './components/components';\nimport { IReportReviewModalViewProps, ReportReviewModal } from './components/report-review-modal';\nimport { IReviewCardViewProps, ReviewCard } from './components/review-card';\nimport { IReviewsListData } from './reviews-list.data';\nimport { IReviewsListProps } from './reviews-list.props.autogenerated';\n\nexport interface IReviewsListState {\n skipItems: number;\n listOfReviews: Review[];\n currentPage: number;\n reviewsCount: number;\n showSpinner: boolean;\n isFilterApplied: boolean;\n selectedSortByOption: ILabeledDropdownOption;\n selectedFilterByOption: ILabeledDropdownOption;\n userReviewRating: number;\n userReviewTitle: string;\n userReviewText: string;\n isReviewModalOpen: boolean;\n hasReviewError: boolean;\n isReportModalOpen: boolean;\n hasReportError: boolean;\n reportingReviewId: string;\n reportedKey: string;\n reported: boolean;\n reportedReviews: string[];\n votedReviews: {reviewId: string; approved: boolean}[];\n}\n\nexport interface IReviewsListCallbacks {\n toggleModal(): void;\n updateReviewTitle(title: string): void;\n updateReviewText(text: string): void;\n updateRating(rating: number): void;\n onReviewSubmitted(isSuccessful: boolean): void;\n submitReview(product: SimpleProduct, title: string, text: string, rating: number, context: Msdyn365.ICoreContext, userReview?: Review, onReviewSubmission?: (isSuccessful: boolean) => void): void;\n updateReviewHelpfulnessVote(reviewId: string, isHelpful: boolean): void;\n toggleReportModal(reviewId: string): void;\n reportReview(reviewId: string, reportedKey: string): void;\n updateSortByDropdown(notification: ILabeledDropdownOnChangeNotification): void;\n updateFilterByDropdown(notification: ILabeledDropdownOnChangeNotification): void;\n updateReviews(skipItems: number, selectedSortByOption: ILabeledDropdownOption, selectedFilterByOption: ILabeledDropdownOption, currentPage: number, isFilterApplied: boolean): void;\n}\n\nexport interface IReviewsListViewProps extends IReviewsListProps {\n state: IReviewsListState;\n className: string;\n callbacks: IReviewsListCallbacks;\n moduleProps: IModuleProps;\n reviewModal: IReviewModalViewProps;\n reportReviewModal: IReportReviewModalViewProps;\n sortByDropdown: React.ReactNode;\n filterByDropdown: React.ReactNode;\n averageRating: React.ReactNode;\n reviewCount: React.ReactElement;\n refineReviewsProps: INodeProps;\n reviewsListProps: INodeProps;\n reviewCards: IReviewCardViewProps[];\n userReview?: IReviewCardViewProps;\n pageControls: React.ReactNode;\n noReviewsMessage: React.ReactElement;\n noReviewsWithFilterMessage: React.ReactElement;\n heading: React.ReactNode;\n sortByOptions: IRnrOrderByKeyValuePair[];\n filterByOptions: IRnrOrderByKeyValuePair[];\n}\n\n/**\n *\n * ReviewsList component\n * @extends {React.Component, IReviewsListState>}\n */\n@observer\nclass ReviewsList extends React.Component, IReviewsListState> {\n public sortByDropdownOptions: IRnrOrderByKeyValuePair[] = [\n { key: 'MostHelpful', value: this.props.resources.mostHelpfulSortOptionText },\n { key: 'MostRecent', value: this.props.resources.mostRecentSortOptionText },\n { key: 'HighestRating', value: this.props.resources.highestRatedSortOptionText },\n { key: 'LowestRating', value: this.props.resources.lowestRatedSortOptionText }\n ];\n\n public filterByDropdownOptions: IRnrKeyValuePair[] = [\n { key: '1;2;3;4;5', value: this.props.resources.allRatinsFilterByOptionText },\n { key: '5', value: this.props.resources.fiveStarFilterByOptionText },\n { key: '4', value: this.props.resources.fourStarFilterByOptionText },\n { key: '3', value: this.props.resources.threeStarFilterByOptionText },\n { key: '2', value: this.props.resources.twoStarFilterByOptionText },\n { key: '1', value: this.props.resources.oneStarFilterByOptionText }\n ];\n\n private _userReviewModalToggle: React.RefObject;\n private _userReportModalToggle: React.RefObject;\n private telemetryContent?: ITelemetryContent;\n\n constructor(props: IReviewsListProps) {\n super(props);\n const {userReview: {result: userReview}} = this.props.data;\n\n this.state = {\n skipItems: 0,\n reviewsCount: 0,\n listOfReviews: [],\n currentPage: 1,\n showSpinner: false,\n isFilterApplied: false,\n selectedSortByOption: this.sortByDropdownOptions[0],\n selectedFilterByOption: this.filterByDropdownOptions[0],\n userReviewRating: userReview ? userReview.rating : 0,\n userReviewText: userReview ? userReview.reviewText : '',\n userReviewTitle: userReview ? userReview.title : '',\n isReviewModalOpen: false,\n hasReviewError: false,\n isReportModalOpen: false,\n hasReportError: false,\n reported: false,\n reportedKey: ReviewConcernCategory.SpamAdvertising,\n reportingReviewId: '',\n reportedReviews: [],\n votedReviews: []\n };\n\n this._userReviewModalToggle = React.createRef();\n this._userReportModalToggle = React.createRef();\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\n }\n\n public componentDidMount(): void {\n this.props.data.reviewsList.then((reviewsList) => {\n if (\n reviewsList &&\n reviewsList.pagingInfo &&\n reviewsList.pagingInfo.totalItems &&\n reviewsList.items &&\n reviewsList.items.length > 0\n ) {\n this.setState({\n listOfReviews: reviewsList.items,\n reviewsCount: reviewsList.pagingInfo.totalItems,\n });\n }\n });\n\n reaction(\n () => this.props.data.ratingsReviewsState.result && this.props.data.ratingsReviewsState.result.filterKey,\n async (filterKey: string | undefined) => {\n const filterKeyValue = Number(filterKey);\n const dropdownItemsCount = this.filterByDropdownOptions.length;\n if (\n !!filterKey &&\n !isNaN(filterKeyValue) &&\n filterKeyValue < dropdownItemsCount\n ) {\n const filterByOption = this.filterByDropdownOptions.find((option: IRnrKeyValuePair) => option.key === filterKey);\n if (!filterByOption) {\n this.props.telemetry.warning(`[reviews-list] cannot find filter with key ${filterKey}`);\n } else {\n await this.updateReviews(0, this.state.selectedSortByOption, filterByOption, 1, true);\n const selectedIndex = dropdownItemsCount - filterKeyValue;\n this.setState({\n selectedFilterByOption: this.filterByDropdownOptions[selectedIndex]\n });\n }\n }\n }\n );\n }\n\n public render(): JSX.Element | null {\n const {className, heading, reviewsShownOnEachPage} = this.props.config;\n const {currentPage, reviewsCount, selectedFilterByOption, selectedSortByOption } = this.state;\n const { ratingsSummary: { result: ratingsSummary } } = this.props.data;\n const resources = this.props.resources;\n const completeClass = classname('ms-reviews-list', className);\n const viewProps: IReviewsListViewProps = {\n ...this.props,\n state: this.state,\n className: completeClass,\n moduleProps: {\n moduleProps: this.props,\n className: completeClass\n },\n callbacks: this.reviewsListCallbacks,\n reviewModal: this._userReviewModal(),\n reportReviewModal: this._reportReviewModal(),\n filterByDropdown: (\n \n ),\n sortByDropdown: ,\n averageRating: ratingsSummary && (\n \n ),\n reviewCount: ,\n refineReviewsProps: {className: 'ms-reviews-list__refiners'},\n reviewsListProps: {className: 'ms-reviews-list__reviews'},\n reviewCards: this._reviewCards(this.state.listOfReviews),\n userReview: this._userReview(),\n pageControls: (\n ),\n noReviewsMessage: {resources.noReviewsMessage},\n noReviewsWithFilterMessage: {resources.noReviewsWithSelectedFilterMessage},\n heading: heading && heading.text && (\n \n ),\n sortByOptions: this.sortByDropdownOptions,\n filterByOptions: this.filterByDropdownOptions\n } as IReviewsListViewProps;\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent) => this.props.config.heading!.text = event.target.value;\n\n private _userReview = () => {\n const userReview = this.props.data.userReview.result;\n\n return userReview && this._reviewCard(userReview, true);\n }\n\n private _reviewCards = (reviewList: Review[]) => {\n const userReview = this.props.data.userReview.result;\n const reviewElements: IReviewCardViewProps[] = [];\n\n for (const review of reviewList) {\n if (!review.isTakenDown && review.isPublished && userReview ? review.reviewId !== userReview.reviewId : true) {\n reviewElements.push(this._reviewCard(review, false));\n }\n }\n return reviewElements;\n };\n\n private _reviewCard = (review: Review, userReview: boolean): IReviewCardViewProps => {\n return ReviewCard({\n review: review,\n resources: {...this.props.resources},\n context: this.props.context,\n isUserReview: userReview,\n parentId: this.props.id,\n parentType: this.props.typeName,\n reportedReviews: this.state.reportedReviews,\n returnRef: this._userReportModalToggle,\n reportedReviewId: this.state.reportingReviewId,\n toggleWriteReviewModal: this._toggleReviewModal,\n toggleReportReviewModal: this._onReportModalOpen,\n updateReviewHelpfulness: this.updateReviewHelpfulnessVote,\n votedReviews: this.state.votedReviews\n });\n }\n\n private _userReviewModal = (): IReviewModalViewProps => {\n return ReviewModal({\n userReview: this.props.data.userReview.result,\n product: this.props.data.product.result,\n resources: {...this.props.resources},\n context: this.props.context,\n parentId: this.props.id,\n parentType: this.props.typeName,\n isOpen: this.state.isReviewModalOpen,\n rating: this.state.userReviewRating,\n reviewTitle: this.state.userReviewTitle,\n reviewText: this.state.userReviewText,\n onModalToggle: this._toggleReviewModal,\n onTitleChange: this._onTitleChange,\n onTextChange: this._onTextChange,\n onRatingChange: this._onRatingChange,\n onReviewComplete: this._onReviewComplete,\n renderContextId: 'writeReview-list',\n returnRef: this._userReviewModalToggle,\n hasError: this.state.hasReviewError\n });\n }\n\n private _onTitleChange = (event: React.ChangeEvent): void => {\n this.reviewsListCallbacks.updateReviewTitle(event.target.value);\n }\n\n private _onTextChange = (event: React.ChangeEvent): void => {\n this.reviewsListCallbacks.updateReviewText(event.target.value);\n }\n\n private _onRatingChange = (value: number): void => {\n this.reviewsListCallbacks.updateRating(value);\n }\n\n private _toggleReviewModal = (): void => {\n const userReview = this.props.data.userReview.result;\n if (this.state.isReviewModalOpen) {\n this.setState({isReviewModalOpen: false, hasReviewError: false});\n\n } else {\n this.setState({\n isReviewModalOpen: true,\n userReviewText: userReview!.reviewText,\n userReviewTitle: userReview!.title,\n userReviewRating: userReview!.rating\n });\n }\n }\n\n private _onReviewComplete = (isSuccess: boolean): void => {\n if (isSuccess) {\n this.setState({isReviewModalOpen: false, hasReviewError: false});\n } else {\n this.setState({hasReviewError: true});\n }\n }\n\n private _reportReviewModal = () => {\n return ReportReviewModal({\n resources: {...this.props.resources},\n context: this.props.context,\n isOpen: this.state.isReportModalOpen,\n returnRef: this._userReportModalToggle,\n reportedKey: this.state.reportedKey,\n onModalToggle: this._onReportModalClose,\n onRadioChange: this._onRadioChange,\n reportReview: this._reportReview,\n hasError: this.state.hasReportError,\n telemetryContent: this.telemetryContent\n });\n }\n\n private _onReportModalOpen = (reviewId: string) => {\n this.setState({isReportModalOpen: true, reportingReviewId: reviewId, reported: false, reportedKey: ReviewConcernCategory.SpamAdvertising});\n }\n\n private _onReportModalClose = () => {\n this.setState({isReportModalOpen: false, hasReportError: false});\n }\n\n private _onRadioChange = (event: React.ChangeEvent) => {\n this.setState({reportedKey: event.currentTarget.getAttribute('data-key') || ''});\n }\n\n private _reportReviewCallback = (reviewId: string, reportedKey: string) => {\n reportReviewConcern(\n new ReportReviewConcernInput(\n reviewId,\n getRnrPartnerId(this.props.context.actionContext),\n this.props.context.request.locale,\n reportedKey,\n this.getUserToken(this.props.context.request),\n getRnrAuthEndpointId(this.props.context.actionContext)\n ),\n this.props.context.actionContext\n ).then(_value => {\n const reportedReview = this.state.reportedReviews;\n reportedReview.push(reviewId);\n this.setState({reported: true, reportedReviews: reportedReview, hasReportError: false});\n }).catch(_value => {\n this.setState({hasReportError: true});\n });\n }\n\n private _reportReview = () => {\n this._reportReviewCallback(this.state.reportingReviewId, this.state.reportedKey);\n }\n\n private updateSortByDropdown = async (notification: ILabeledDropdownOnChangeNotification) => {\n await this.updateReviews(0, notification.selectedOption, this.state.selectedFilterByOption, 1, this.state.isFilterApplied);\n };\n\n private updateFilterByDropdown = async (notification: ILabeledDropdownOnChangeNotification) => {\n await this.updateReviews(0, this.state.selectedSortByOption, notification.selectedOption, 1, true);\n };\n\n private updateReviews = async (\n skipItems: number | 0,\n selectedSortByOption: ILabeledDropdownOption,\n selectedFilterByOption: ILabeledDropdownOption,\n currentPage: number,\n isFilterApplied: boolean\n ) => {\n // @ts-ignore\n const productId = getSelectedProductIdFromActionInput(this.props.context.actionContext);\n if (productId === undefined) {\n return;\n }\n const result = await getReviewsForGivenProduct(\n // Task #211227597 Remove this hardcoded values.\n new GetProductReviewsInput(\n productId,\n getRnrPartnerId(this.props.context.actionContext),\n this.props.context.request.locale,\n getRnrEndpointId(this.props.context.actionContext),\n selectedSortByOption.key,\n selectedFilterByOption.key,\n skipItems < 0 ? 0 : skipItems\n ),\n this.props.context.actionContext\n );\n if (result && result.items && result.pagingInfo && result.pagingInfo.totalItems !== undefined) {\n this.setState({\n currentPage: currentPage,\n listOfReviews: result.items,\n selectedSortByOption,\n selectedFilterByOption,\n reviewsCount: result.pagingInfo.totalItems,\n isFilterApplied: isFilterApplied\n });\n }\n };\n\n private _updateVoteUi = (reviewId: string, isHelpful: boolean): void => {\n let alreadyExists = false;\n let list = this.state.votedReviews.map((review) => {\n if(review.reviewId === reviewId) {\n review.approved = isHelpful;\n alreadyExists = true;\n }\n return review;\n });\n\n if (!alreadyExists) {\n list = list.concat({reviewId: reviewId, approved: isHelpful});\n }\n\n this.setState({votedReviews: list});\n }\n\n private updateReviewHelpfulnessVote = (reviewId: string, isHelpful: boolean): void => {\n submitHelpfulnessVote(\n new SubmitHelpfulnessVoteInput(\n reviewId,\n getRnrPartnerId(this.props.context.actionContext),\n this.props.context.request.locale,\n isHelpful,\n this.getUserToken(this.props.context.request),\n getRnrAuthEndpointId(this.props.context.actionContext)\n ),\n this.props.context.actionContext\n ).then(() => {\n this._updateVoteUi(reviewId, isHelpful);\n });\n };\n\n private getUserToken = (context: Msdyn365.IRequestContext): string => {\n return context && context.user && context.user.token;\n };\n\n // tslint:disable-next-line\n private reviewsListCallbacks: IReviewsListCallbacks = {\n updateReviewTitle: (title: string): void => {\n this.setState({userReviewTitle: title});\n },\n updateReviewText: (text: string): void => {\n this.setState({userReviewText: text});\n },\n updateRating: (rating: number): void => {\n this.setState({userReviewRating: rating});\n },\n onReviewSubmitted: (isSuccessful: boolean): void => {\n if (isSuccessful) {\n this.setState({isReviewModalOpen: false, hasReviewError: false});\n } else {\n this.setState({hasReviewError: true});\n }\n },\n submitReview: submitReview,\n toggleModal: this._toggleReviewModal,\n updateReviewHelpfulnessVote: this.updateReviewHelpfulnessVote,\n toggleReportModal: (reviewId: string): void => {\n this.state.isReportModalOpen? this._onReportModalOpen(reviewId) : this._onReportModalClose();\n },\n reportReview: this._reportReviewCallback,\n updateFilterByDropdown: this.updateFilterByDropdown,\n updateSortByDropdown: this.updateSortByDropdown,\n updateReviews: this.updateReviews\n };\n}\n\nexport default ReviewsList;\n","import * as React from 'react';\ninterface ILink {\n className?: string;\n text?: string;\n href?: string;\n ariaLabel?: string;\n}\n\nexport const Link: React.FC = ({ text, className, href, ariaLabel }) => ( {text} );","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport { ProductComponent } from '@msdyn365-commerce/components';\nimport { ICoreContext, IImageSettings } from '@msdyn365-commerce/core';\nimport { ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\nimport * as React from 'react';\nimport { ISearchResultContainerResources } from '../search-result-container.props.autogenerated';\n\ninterface IProductSearchResultItems {\n products: ProductSearchResult[];\n context: ICoreContext;\n resources: ISearchResultContainerResources;\n imageSettings?: IImageSettings;\n moduleType: string;\n moduleId: string;\n allowBackNavigation?: boolean;\n telemetryContent: ITelemetryContent;\n}\n\nexport const ProductSearchResultItems: React.FC = ({\n products,\n context,\n imageSettings,\n resources,\n moduleType,\n moduleId,\n allowBackNavigation,\n telemetryContent\n}) => {\n\n return (\n\n
    \n {products.map((product: ProductSearchResult, index: number) => (\n
  • \n \n
  • \n ))}\n
\n );\n\n};","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { getFallbackImageUrl, getProductPageUrlSync } from '@msdyn365-commerce-modules/retail-actions';\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent ,onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\nimport { ICoreContext, IGridSettings, IImageData, IImageSettings, Image} from '@msdyn365-commerce/core';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport * as React from 'react';\nimport { ISearchResultContainerResources } from '../search-result-container.props.autogenerated';\n// import { IComponent, IComponentProps, ICoreContext, IGridSettings, IImageData, IImageSettings, Image, msdyn365Commerce } from '@msdyn365-commerce/core';\n\ninterface IFeatureSearchResultItem {\n product: SimpleProduct | null;\n context: ICoreContext;\n resources: ISearchResultContainerResources;\n imageSettings?: IImageSettings;\n moduleType: string;\n moduleId: string;\n telemetryContent?: ITelemetryContent;\n}\n\nexport const FeatureSearchResultItem: React.FC = ({\n product,\n context,\n imageSettings,\n resources,\n telemetryContent\n}) => {\n if(product === null) {\n return null;\n }\n\n const productName = product.Name;\n const productRecordId = product && product.RecordId ? product.RecordId: 0;\n const productUrl = getProductPageUrlSync(product.Name || '', productRecordId, context && context.actionContext, undefined);\n const fallbackImage = getFallbackImageUrl(product.ItemId, context.actionContext.requestContext.apiSettings);\n\n // Construct telemetry attribute to render\n const payLoad = getPayloadObject('click', telemetryContent!, productName!, productRecordId.toString());\n\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\n return (\n \n );\n\n};\n\nfunction renderProductPlacementImage(imageSettings?: IImageSettings, gridSettings?: IGridSettings, imageUrl?: string, altText?: string, fallbackImage?: string,): JSX.Element | null {\n if (!imageUrl || !gridSettings || !imageSettings) {\n return null;\n }\n const img: IImageData = {\n src: imageUrl,\n altText: altText ? altText : ''\n };\n const imageProps = {\n gridSettings: gridSettings,\n imageSettings: imageSettings,\n fallBackSrc: fallbackImage\n };\n return (\n \n );\n}\n\nfunction renderProductTitle(title?: string): JSX.Element | null {\nreturn

{title}

;\n}","import * as React from 'react';\ninterface ITitle {\n className: string;\n text: string;\n}\n\nexport const Title: React.FC = ({ text, className }) => ( {text} );\n","import * as React from 'react';\ninterface ISeparator {\n separator: string;\n}\n\nexport const Separator: React.FC = ({ separator }) => ( {separator} );","import { ITelemetry } from '@msdyn365-commerce/core';\nimport { AttributeDataType, ProductRefinerValue, RefinerType } from '@msdyn365-commerce/retail-proxy';\nimport { IRefineItemToggleNotification } from './refine-item-toggle-notification';\n\n/**\n * Types of product refiner values\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\nexport const enum ProductRefinerValueDataTypeValue {\n /**\n * Range slider is used for selections like price\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\n Range = 1,\n\n /**\n * Range input is a different way to specify ranges and can be expressed with input boxes\n * as well as a set of discrete single-select type values\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\n RangeInput = 4,\n\n /**\n * This is a discrete list item, either multi-select or single-select\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\n List = 5,\n\n /**\n * Boolean types allows only single-select\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\n Boolean = 6\n}\n\n/**\n * Types of product refiners\n * @deprecated This will be removed soon. Please, use `RefinerType` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { RefinerType } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\nexport const enum ProductRefinerTypeValue {\n /**\n * Refiner values are single-select\n * @deprecated This will be removed soon. Please, use `RefinerType` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { RefinerType } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\n Single = 0,\n\n /**\n * Refiner values are multi-select\n * @deprecated This will be removed soon. Please, use `RefinerType` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { RefinerType } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\n Multi = 1\n}\n\n/**\n * ProductRefinerSource enum type.\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\nexport const enum ProductRefinerSource {\n /**\n * The None member.\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\n None = 0,\n /**\n * The Attribute member.\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\n Attribute = 1,\n /**\n * The Category member.\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\n Category = 2,\n /**\n * The Price member.\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\n Price = 3,\n /**\n * The Rating member.\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\n Rating = 4\n}\n\n/**\n * Checks if the data type value corresponds to a slider.\n */\nexport function isRangeType(dataTypeValue: number | undefined): boolean {\n return dataTypeValue === AttributeDataType.Currency ||\n dataTypeValue === AttributeDataType.Decimal ||\n dataTypeValue === AttributeDataType.Integer;\n}\n\n/**\n * Find the refinement criterion associated with this product refiner value\n * @param productRefinerValue product refiner value to match\n * @param refinementCriteria selected refinement criteria\n */\nexport function findMatchingRefinementCriterion(\n productRefinerValue: ProductRefinerValue,\n refinementCriteria: ProductRefinerValue[]\n): ProductRefinerValue | undefined {\n // if the value is a range, then match only on data type value; otherwise match on item string\n return refinementCriteria.find(\n (refinementCriterion: ProductRefinerValue) => isMatchingRefinementCriterion(productRefinerValue, refinementCriterion)\n );\n}\n\n/**\n * Find the refinement criterion associated with this product refiner value\n * @param productRefinerValue product refiner value to match\n * @param refinementCriteria selected refinement criteria\n */\nexport function isMatchingRefinementCriterion(\n productRefinerValue: ProductRefinerValue,\n refinementCriterion: ProductRefinerValue\n): boolean {\n // if the value is a range, then match only on data type value; otherwise match on item string\n return refinementCriterion.RefinerRecordId === productRefinerValue.RefinerRecordId &&\n refinementCriterion.RefinerSourceValue === productRefinerValue.RefinerSourceValue &&\n refinementCriterion.DataTypeValue === productRefinerValue.DataTypeValue &&\n (isRangeType(refinementCriterion.DataTypeValue) || refinementCriterion.LeftValueBoundString === productRefinerValue.LeftValueBoundString);\n}\n\nexport function getUpdatedRefinementCriteria(\n itemToggleNotification: IRefineItemToggleNotification,\n currentRefinementCriteria: ProductRefinerValue[]): ProductRefinerValue[] {\n const updatedRefinementCriteria: ProductRefinerValue[] = [];\n let toggledItemFound = false;\n currentRefinementCriteria.forEach((selectedCriterion: ProductRefinerValue) => {\n if (isMatchingRefinementCriterion(itemToggleNotification.productRefinerValue, selectedCriterion)) {\n toggledItemFound = true;\n if (itemToggleNotification.isSelecting) {\n const next = {\n ...selectedCriterion,\n LeftValueBoundString: itemToggleNotification.rangeStart !== undefined && `${itemToggleNotification.rangeStart}` || selectedCriterion.LeftValueBoundString,\n RightValueBoundString: itemToggleNotification.rangeEnd !== undefined && `${itemToggleNotification.rangeEnd}` || selectedCriterion.RightValueBoundString,\n };\n updatedRefinementCriteria.push(next);\n\n } // else the item is being de-selected, so omit it from the refinement criteria\n } else {\n // keep existing criterion because it is not in the item toggle notification\n updatedRefinementCriteria.push(selectedCriterion);\n }\n });\n\n if (!toggledItemFound) {\n const next = {\n ...itemToggleNotification.productRefinerValue,\n LeftValueBoundString: itemToggleNotification.rangeStart !== undefined && `${itemToggleNotification.rangeStart}` || itemToggleNotification.productRefinerValue.LeftValueBoundString,\n RightValueBoundString: itemToggleNotification.rangeEnd !== undefined && `${itemToggleNotification.rangeEnd}` || itemToggleNotification.productRefinerValue.RightValueBoundString,\n };\n updatedRefinementCriteria.push(next);\n\n // If single select, then deselect any others in the parent refiner group\n if ((itemToggleNotification.productRefinerValue.DataTypeValue === AttributeDataType.Text || itemToggleNotification.productRefinerValue.DataTypeValue === AttributeDataType.TrueFalse) &&\n itemToggleNotification.parentProductRefinerHierarchy.RefinerTypeValue === RefinerType.SingleSelect) {\n itemToggleNotification.parentProductRefinerHierarchy.Values.forEach((child: ProductRefinerValue) => {\n if (child.RefinerRecordId === next.RefinerRecordId && child.LeftValueBoundString === next.LeftValueBoundString) {\n // do nothing\n } else {\n const matchingIndex = updatedRefinementCriteria.findIndex((criterion: ProductRefinerValue) => isMatchingRefinementCriterion(child, criterion));\n if (matchingIndex > -1) {\n updatedRefinementCriteria.splice(matchingIndex, 1);\n }\n }\n });\n }\n }\n\n return updatedRefinementCriteria;\n}\n\nexport function formatPrice(\n amount: string | undefined,\n currency: string | undefined,\n locale: string | undefined,\n telemetry: ITelemetry): string {\n if (!amount || !currency) {\n telemetry.trace(`[refine-menu.utilities.formatPrice] could not format price for ${amount} ${currency}`);\n return amount || '';\n }\n const priceAmount = (amount && Number(amount)) || 0;\n let result: string;\n\n try {\n result = new Intl.NumberFormat(locale, {\n style: 'currency',\n currencyDisplay: 'symbol',\n currency: currency,\n minimumFractionDigits: 0\n }).format(priceAmount);\n } catch (e) {\n result = `${priceAmount} ${currency}`;\n telemetry.warning(`[refine-menu.utilities.formatPrice] Failed to format price for ${result}: ${e}`);\n }\n\n return result;\n}","import { Slider } from '@msdyn365-commerce-modules/utilities';\nimport debounce from 'lodash/debounce';\nimport { computed } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\nimport { formatPrice } from './utilities';\n\ntype InputType = 'Min' | 'Max';\n\nimport { IRefineItemProps, IRefineItemState } from './refine-item';\n\nexport type RangeRefineItemType = 'slider' | 'input';\n\n/**\n * Range refine item properties\n */\nexport interface IRangeRefineItemProps extends IRefineItemProps {\n rangeType: RangeRefineItemType;\n minValueSliderThumbAriaLabel?: string;\n maxValueSliderThumbAriaLabel?: string;\n}\n\n/**\n * Range refine item state\n */\nexport interface IRangeRefineItemState extends IRefineItemState {\n validationErrorMin: string | undefined;\n validationErrorMax: string | undefined;\n selectedMin: string | undefined;\n selectedMax: string | undefined;\n touchedMin: boolean;\n touchedMax: boolean;\n}\n\n/**\n * RangeRefineItem component (controlled by RefineSubmenu)\n */\n@observer\nexport default class RangeRefineItem extends React.Component {\n private _formattedPriceReverseLookup: Map = new Map();\n\n private minInput: React.RefObject;\n private maxInput: React.RefObject;\n\n @computed get currencyCode(): string {\n return this.props.productRefinerValue.UnitText || '';\n }\n\n constructor(props: IRangeRefineItemProps) {\n super(props);\n this._onRangeUpdate = this._onRangeUpdate.bind(this);\n this._onRangeUpdateEnd = this._onRangeUpdateEnd.bind(this);\n this._handleRangeTooltipText = this._handleRangeTooltipText.bind(this);\n this._changeMin = this._changeMin.bind(this);\n this._changeMax = this._changeMax.bind(this);\n this._finishChangeMin = this._finishChangeMin.bind(this);\n this._finishChangeMax = this._finishChangeMax.bind(this);\n\n this.minInput = React.createRef();\n this.maxInput = React.createRef();\n\n const { selectedRefinementCriterion } = this.props;\n const initialMin = selectedRefinementCriterion && selectedRefinementCriterion.LeftValueBoundString || '0';\n const initialMax = selectedRefinementCriterion && selectedRefinementCriterion.RightValueBoundString || undefined;\n this.state = {\n isChecked: false,\n validationErrorMin: undefined,\n validationErrorMax: undefined,\n selectedMin: initialMin,\n selectedMax: initialMax,\n touchedMin: false,\n touchedMax: false\n };\n }\n\n public render(): JSX.Element | undefined {\n const { productRefinerValue, parentProductRefinerHierarchy, refineItemCommonProps } = this.props;\n\n if (!productRefinerValue || !parentProductRefinerHierarchy) {\n refineItemCommonProps.telemetry.error('Cannot render refine value range without productRefinerValue and parentProductRefinerHierarchy');\n return undefined;\n }\n\n if (this.props.rangeType === 'input') {\n return this._renderInputFields();\n }\n\n return this._renderSlider();\n }\n\n private _renderInputFields(): JSX.Element | undefined {\n const { isDisabled, parentProductRefinerHierarchy, refineItemCommonProps } = this.props;\n const { selectedMin, selectedMax, touchedMin, touchedMax, validationErrorMin, validationErrorMax } = this.state;\n\n const rangeAriaLabel = (refineItemCommonProps.rangeNameFormat || '{0}').replace('{0}', (parentProductRefinerHierarchy.KeyName || ''));\n const formAttrs = {\n 'aria-label': rangeAriaLabel,\n 'aria-disabled': isDisabled\n };\n\n // To enable price formatting of selected fields, this is the approach:\n // initial value: min=0 formatted as price, max=undefined\n // onFocus/onChange: convert to number (unformat) and mark as touched to indicate value is being edited\n // onBlur: validate and format entered value as price\n const minInputClassName = `ms-refine-submenu__input-range refine-submenu__input-range-min ${validationErrorMin ? 'refine-submenu__input-range--error' : ''}`;\n const maxInputClassName = `ms-refine-submenu__input-range refine-submenu__input-range-max ${validationErrorMax ? 'refine-submenu__input-range--error' : ''}`;\n const minLabelClassName = 'ms-refine-submenu__input-range-label refine-submenu__input-range-label-min';\n const maxLabelClassName = 'ms-refine-submenu__input-range-label refine-submenu__input-range-label-max';\n const formattedSelectedMin = this._getFormattedSelectedValue(selectedMin, touchedMin, validationErrorMin);\n const formattedSelectedMax = this._getFormattedSelectedValue(selectedMax, touchedMax, validationErrorMax);\n return (\n
\n \n \n {validationErrorMin &&\n {validationErrorMin}\n }\n {validationErrorMax && validationErrorMin !== validationErrorMax &&\n {validationErrorMax}\n }\n
\n );\n }\n\n private _renderSlider(): JSX.Element | undefined {\n const { isDisabled, productRefinerValue, parentProductRefinerHierarchy, selectedRefinementCriterion } = this.props;\n const min = productRefinerValue.LeftValueBoundString;\n const max = productRefinerValue.RightValueBoundString;\n const selectedMin = selectedRefinementCriterion && selectedRefinementCriterion.LeftValueBoundString || productRefinerValue.LeftValueBoundString || '0';\n const selectedMax = selectedRefinementCriterion && selectedRefinementCriterion.RightValueBoundString || productRefinerValue.RightValueBoundString || max;\n const sliderId = `slider_${parentProductRefinerHierarchy.RecordId}_${productRefinerValue.RefinerRecordId}`;\n const ariaAttributes = {\n 'aria-disabled': isDisabled\n };\n\n const minPrice = this._formatPrice(min);\n const maxPrice = this._formatPrice(max);\n const selectedMinPrice =this._formatPrice(selectedMin);\n const selectedMaxPrice =this._formatPrice(selectedMax);\n\n return (\n \n );\n }\n\n private _changeMin(event: React.FocusEvent): void {\n this._changeValue(event, 'Min');\n }\n\n private _changeMax(event: React.FocusEvent): void {\n this._changeValue(event, 'Max');\n }\n\n private _changeValue(event: React.FocusEvent, inputType: InputType): void {\n const selectedKey = `selected${inputType}`;\n const touchedKey = `touched${inputType}`;\n this.setState({\n [selectedKey]: this._getInputWithoutFormatting(event.currentTarget.value),\n [touchedKey]: true\n });\n }\n\n private _finishChangeMin(event: React.FocusEvent): boolean {\n const selectedMinValue = this._getInputWithoutFormatting(event.currentTarget.value);\n this.setState({\n selectedMin: selectedMinValue,\n minTouched: false\n });\n const minInput = Number(selectedMinValue);\n const { onToggle, parentProductRefinerHierarchy, productRefinerValue, refineItemCommonProps, selectedRefinementCriterion } = this.props;\n const max = selectedRefinementCriterion && selectedRefinementCriterion.RightValueBoundString || undefined;\n\n const maxNum = max ? Number(max) : undefined;\n\n if (isNaN(minInput)) {\n this.setState({validationErrorMin: refineItemCommonProps.validationErrorNaN});\n this._focus('Min');\n return false;\n }\n\n if (this._validateRange(minInput, maxNum)) {\n onToggle({\n parentProductRefinerHierarchy: parentProductRefinerHierarchy,\n productRefinerValue: productRefinerValue,\n isSelecting: true,\n rangeStart: minInput,\n rangeEnd: maxNum\n });\n return true;\n } else {\n this._focus('Min');\n }\n\n return false;\n }\n\n private _finishChangeMax(event: React.FocusEvent): boolean {\n const selectedMaxValue = this._getInputWithoutFormatting(event.currentTarget.value);\n this.setState({\n selectedMax: selectedMaxValue,\n maxTouched: false\n });\n const maxInput = Number(selectedMaxValue);\n const { onToggle, parentProductRefinerHierarchy, productRefinerValue, refineItemCommonProps, selectedRefinementCriterion } = this.props;\n const min = selectedRefinementCriterion && selectedRefinementCriterion.LeftValueBoundString || '0';\n\n const minNum = Number(min);\n\n if (isNaN(maxInput)) {\n this.setState({validationErrorMax: refineItemCommonProps.validationErrorNaN});\n this._focus('Max');\n return false;\n }\n\n if (this._validateRange(minNum, maxInput)) {\n if (productRefinerValue) {\n onToggle({\n parentProductRefinerHierarchy: parentProductRefinerHierarchy,\n productRefinerValue: productRefinerValue,\n isSelecting: true,\n rangeStart: minNum,\n rangeEnd: maxInput\n });\n } else {\n this._focus('Max');\n }\n return true;\n }\n\n return false;\n }\n\n private _focus(inputType: InputType): void {\n const ref = inputType === 'Max' ? this.maxInput : this.minInput;\n\n setTimeout(() => {\n if (ref && ref.current) {\n ref.current.focus();\n }\n }, 50);\n }\n\n private _getFormattedSelectedValue(selected: string | undefined, touched: boolean, validationError: string | undefined): string | undefined {\n if (touched || validationError || selected === undefined) {\n return selected;\n }\n return this._formatPrice(selected);\n }\n\n private _validateRange(min: number, max: number | undefined): boolean {\n const { refineItemCommonProps } = this.props;\n if (max === undefined) {\n return true;\n }\n\n if (min > max) {\n this.setState({\n validationErrorMin: refineItemCommonProps.validationErrorRange,\n validationErrorMax: refineItemCommonProps.validationErrorRange\n });\n return false;\n }\n\n return true;\n }\n\n private _formatPrice(amount: string | undefined): string {\n const locale = this.props.refineItemCommonProps.locale;\n const result = formatPrice(amount, this.currencyCode, locale, this.props.refineItemCommonProps.telemetry);\n\n if (amount !== undefined && !this._formattedPriceReverseLookup.has(result)) {\n this._formattedPriceReverseLookup.set(result, amount);\n }\n\n return result;\n }\n\n private _getInputWithoutFormatting(input: string): string {\n // First try to cast raw input to a number\n const inputAsNum = Number(input);\n if (!isNaN(inputAsNum)) {\n return input;\n }\n\n // Otherwise try a reverse lookup and fall back to the raw input if all else fails\n const reverseLookupResult = this._formattedPriceReverseLookup.get(input);\n return reverseLookupResult || input;\n }\n\n // NOTE: Fix types once Shared Components build pipeline bug fixed\n // tslint:disable-next-line:no-any\n private _onRangeUpdate(sliderChangeNotification: any): void {\n // Need to filter out mousemove events as these cause errors after the menu updates and slider re-renders\n if (sliderChangeNotification.eventType !== 'mousemove') {\n const { onToggle, parentProductRefinerHierarchy, productRefinerValue } = this.props;\n if (productRefinerValue && sliderChangeNotification) {\n onToggle({\n parentProductRefinerHierarchy: parentProductRefinerHierarchy,\n productRefinerValue: productRefinerValue,\n isSelecting: true,\n rangeStart: sliderChangeNotification.firstThumbValue,\n rangeEnd: sliderChangeNotification.secondThumbValue\n });\n\n this._focusOnSliderThumb(sliderChangeNotification);\n }\n }\n }\n\n // tslint:disable-next-line\n private _onRangeUpdateEnd(sliderChangeNotification: any): void {\n const { onToggle, parentProductRefinerHierarchy, productRefinerValue } = this.props;\n if (productRefinerValue && sliderChangeNotification) {\n onToggle({\n parentProductRefinerHierarchy: parentProductRefinerHierarchy,\n productRefinerValue: productRefinerValue,\n isSelecting: true,\n rangeStart: sliderChangeNotification.firstThumbValue,\n rangeEnd: sliderChangeNotification.secondThumbValue\n });\n\n this._focusOnSliderThumb(sliderChangeNotification);\n }\n }\n\n // tslint:disable-next-line\n private _focusOnSliderThumb(sliderChangeNotification: any): void {\n if (sliderChangeNotification.id) {\n const element = document.getElementById(`${sliderChangeNotification.id}range`);\n if (!!element) {\n setTimeout(\n () => {\n element.focus();\n }, 0);\n }\n }\n }\n\n private _handleRangeTooltipText(tooltip: number): string {\n return this._formatPrice(`${tooltip}`);\n }\n}","import { getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\nimport { RatingComponent } from '@msdyn365-commerce/components';\nimport { ICoreContext } from '@msdyn365-commerce/core';\nimport { ProductRefinerSource, ProductRefinerValue, RefinerType } from '@msdyn365-commerce/retail-proxy';\nimport * as React from 'react';\nimport { IRefineItemToggleNotification } from './refine-item-toggle-notification';\nimport { IRefineItemCommonProps } from './refine-item.props.common';\n\n/**\n * RefineItem properties\n */\nexport interface IRefineItemProps {\n\n parentProductRefinerHierarchy: IProductRefinerHierarchy;\n productRefinerValue: ProductRefinerValue;\n selectedRefinementCriterion: ProductRefinerValue | undefined;\n selectedRefinerValues?: ProductRefinerValue[];\n refineItemCommonProps: IRefineItemCommonProps;\n isDisabled: boolean;\n context: ICoreContext;\n moduleId: string;\n moduleTypeName: string;\n index?: number;\n /** The telemetry content */\n telemetryContent?: ITelemetryContent;\n onToggle(notfication: Readonly): void;\n urlBuilder(refiner: IRefineItemToggleNotification): string;\n}\n\n/**\n * Refine item state\n */\nexport interface IRefineItemState extends React.ComponentState {\n isChecked: boolean;\n renderingError?: object;\n}\n\n/**\n * Single-select and multi-select refine item component (controlled by RefineSubmenu)\n */\nexport default class RefineItem extends React.Component {\n private anchorType: React.RefObject;\n private payLoad: IPayLoad;\n\n constructor(props: IRefineItemProps) {\n super(props);\n this._onClick = this._onClick.bind(this);\n this.state = {\n isChecked: !!this.props.selectedRefinementCriterion\n };\n this.anchorType = React.createRef();\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, '');\n }\n\n // tslint:disable-next-line:max-func-body-length\n public render(): JSX.Element | undefined {\n const {\n isDisabled,\n refineItemCommonProps,\n parentProductRefinerHierarchy,\n productRefinerValue,\n selectedRefinementCriterion,\n index,\n children,\n onToggle,\n context,\n telemetryContent,\n ...attrs\n } = this.props;\n if (!productRefinerValue) {\n refineItemCommonProps.telemetry.error('[refine-item] Cannot render refineItem without productRefinerValue');\n return undefined;\n }\n if (!productRefinerValue.LeftValueBoundString) {\n refineItemCommonProps.telemetry.warning(`[refine-item] RefineItem without LeftValueBoundString: ${JSON.stringify(productRefinerValue)}`);\n }\n const isSingleSelect = parentProductRefinerHierarchy.RefinerTypeValue === RefinerType.SingleSelect;\n let itemTypeClassName = isSingleSelect ? 'single-select' : 'multi-select';\n itemTypeClassName = `ms-refine-submenu-item ${itemTypeClassName}`;\n const inputType = isSingleSelect ? 'radio' : 'checkbox';\n const isChecked = !!selectedRefinementCriterion;\n itemTypeClassName = isChecked ? `${itemTypeClassName}-checked` : itemTypeClassName;\n if (parentProductRefinerHierarchy.SourceValue === ProductRefinerSource.Rating) {\n if (productRefinerValue.LeftValueBoundString) {\n this.payLoad.contentAction.etext = productRefinerValue.LeftValueBoundLocalizedString;\n const attribute = getTelemetryAttributes(telemetryContent!, this.payLoad);\n const refinerRating = parseInt(productRefinerValue.LeftValueBoundString, 10);\n const ratingRefiner = this.props.selectedRefinerValues?.find(value => value.DataTypeValue === productRefinerValue.DataTypeValue);\n const selectedRating = parseInt(ratingRefiner?.LeftValueBoundString || '0', 10);\n let ratingComponentClass: string = 'ms-rating-component';\n if (refinerRating > selectedRating) {\n ratingComponentClass = `${ratingComponentClass}__up`;\n } else if (refinerRating < selectedRating) {\n ratingComponentClass = `${ratingComponentClass}__down`;\n } else {\n ratingComponentClass = `${ratingComponentClass}__current`;\n }\n return (\n \n \n \n {productRefinerValue.Count !== undefined && `(${productRefinerValue.Count})`}\n \n \n );\n } else {\n return undefined;\n }\n } else {\n this.payLoad.contentAction.etext = productRefinerValue.LeftValueBoundLocalizedString || productRefinerValue.LeftValueBoundString;\n const attribute = getTelemetryAttributes(telemetryContent!, this.payLoad);\n return (\n
  • \n \n \n {productRefinerValue.LeftValueBoundLocalizedString || productRefinerValue.LeftValueBoundString}\n {productRefinerValue.Count !== undefined && ` (${productRefinerValue.Count})`}\n \n \n
  • \n );\n }\n }\n\n private _getRefinerUrl(): string {\n const { urlBuilder, parentProductRefinerHierarchy, productRefinerValue, selectedRefinementCriterion } = this.props;\n\n if (productRefinerValue) {\n return urlBuilder({\n parentProductRefinerHierarchy: parentProductRefinerHierarchy,\n productRefinerValue: productRefinerValue,\n isSelecting: !selectedRefinementCriterion\n });\n }\n\n return '';\n }\n\n private _onClick = (e: React.MouseEvent): void => {\n e.preventDefault();\n\n const { parentProductRefinerHierarchy, productRefinerValue, selectedRefinementCriterion } = this.props;\n if (productRefinerValue) {\n this.props.onToggle({\n parentProductRefinerHierarchy: parentProductRefinerHierarchy,\n productRefinerValue: productRefinerValue,\n isSelecting: !selectedRefinementCriterion\n });\n\n setTimeout(\n () => {\n this.anchorType.current && this.anchorType.current.focus();\n },\n 0\n );\n }\n }\n}","import { getPayloadObject, getTelemetryAttributes, IPayLoad } from '@msdyn365-commerce-modules/utilities';\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\nimport { ProductRefinerValue } from '@msdyn365-commerce/retail-proxy';\nimport classnames from 'classnames';\nimport { get } from 'lodash';\nimport { computed } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\nimport { IChoiceSummaryProps } from './choice-summary.props';\nimport { isMatchingRefinementCriterion, isRangeType } from './utilities';\n\ninterface IRefinerMap {\n key: string;\n value: ProductRefinerValue;\n}\n\n /**\n * ChoiceSummary component\n */\n@observer\nexport default class ChoiceSummary extends React.Component {\n private closeButtonGlyph: string = 'msi-close-btn';\n private payLoad: IPayLoad;\n\n @computed get selectedRefinersMap(): IRefinerMap[] {\n const { selectedChoices } = this.props;\n return selectedChoices.map((selectedRefiner: ProductRefinerValue) => {\n return {\n key: this._getKeyForRefinerValue(selectedRefiner),\n value: selectedRefiner\n } as IRefinerMap;\n });\n }\n\n constructor(props: Readonly) {\n super(props);\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, '');\n }\n\n public render(): JSX.Element {\n const { clearAllText, label, classNames, choiceAriaLabel } = this.props;\n const items = this.selectedRefinersMap;\n this.payLoad.contentAction.etext = clearAllText;\n const clearAllAttributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n return (\n
    \n {items.length > 0 && label && {label}}\n
      \n {items.map((item: IRefinerMap, index: number) => {\n const listItemProps = {\n 'aria-posinset': index,\n 'aria-setsize': items.length\n };\n\n this.payLoad.contentAction.etext = item.key;\n const attribute = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n\n return (\n
    • \n \n {item.key}\n \n \n
    • \n );\n })}\n
    \n {items.length > 0 && clearAllText && {clearAllText}}\n
    \n );\n }\n\n private _getKeyForRefinerValue(productRefinerValue: ProductRefinerValue): string {\n const { choiceFormat, choiceRangeValueFormat, refinerHierarchy, telemetry } = this.props;\n const overallFormat = choiceFormat || '{1}';\n const rangeFormat = choiceRangeValueFormat;\n let refinerName = '';\n if (refinerHierarchy && refinerHierarchy.find) {\n const parent = refinerHierarchy.find(\n (hierarchy: IProductRefinerHierarchy) =>\n !!hierarchy.Values.find((value: ProductRefinerValue) => isMatchingRefinementCriterion(value, productRefinerValue))\n );\n\n if (!parent) {\n telemetry.warning('[choice-summary] could not find parent of selected refiner value');\n } else {\n refinerName = parent.KeyName || '';\n }\n }\n\n let refinerValueName: string;\n if (isRangeType(productRefinerValue.DataTypeValue)) {\n refinerValueName = rangeFormat\n .replace('{0}', this._formatPrice(productRefinerValue.LeftValueBoundString, productRefinerValue.UnitText))\n .replace('{1}', this._formatPrice(productRefinerValue.RightValueBoundString, productRefinerValue.UnitText));\n } else {\n refinerValueName = productRefinerValue.LeftValueBoundLocalizedString || productRefinerValue.LeftValueBoundString || '';\n }\n\n return overallFormat.replace('{0}', refinerName).replace('{1}', refinerValueName);\n }\n\n private _formatPrice(amount: string | undefined, currency: string | undefined): string {\n if (!amount || !currency) {\n this.props.telemetry.trace('[choice-summary] could not format price');\n return amount || '';\n }\n const priceAmount = (amount && Number(amount)) || 0;\n const locale = get(this.props, 'context.request.locale', 'en-US');\n let result: string;\n\n try {\n result = new Intl.NumberFormat(locale, {\n style: 'currency',\n currencyDisplay: 'symbol',\n currency: currency,\n minimumFractionDigits: 0\n }).format(priceAmount);\n } catch (e) {\n result = `${priceAmount} ${currency}`;\n this.props.telemetry.warning(`Failed to format price for ${result}: ${e}`);\n }\n\n return result;\n }\n\n private _onClick = (e: React.MouseEvent): void => {\n e.preventDefault();\n e.stopPropagation();\n\n const target = e.currentTarget as HTMLElement;\n const clearAll = target.getAttribute('class')!.indexOf('choice-summary__clear-all') > -1;\n const selectedRefiner = clearAll ? undefined : this._getSelectedRefinerChoice(target);\n\n if (this.props.onChoiceClicked) {\n this.props.onChoiceClicked({\n clearAll: clearAll,\n itemClicked: target,\n choiceClicked: selectedRefiner,\n nextItemToFocus: target.nextSibling as HTMLElement\n });\n }\n }\n\n private _getSelectedRefinerChoice(itemClicked: HTMLElement): ProductRefinerValue | undefined {\n const result = this.selectedRefinersMap.find(selected => (itemClicked.innerText && itemClicked.innerText.trim()) === selected.key);\n return (result && result.value) || undefined;\n }\n}\n","import {\n Button,\n Modal,\n ModalBody,\n ModalFooter,\n ModalHeader\n} from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nexport interface ISearchResultModalViewProps {\n modal: React.ReactElement;\n modalHeader: React.ReactElement;\n modalFooter: React.ReactElement;\n modalBody: React.ReactElement;\n}\n\ninterface IModalToggleProps {\n innerRef: React.RefObject | undefined;\n id: string;\n text: string;\n ariaLabel: string;\n onClick(): void;\n}\n\nexport interface ISearchResultModalResources {\n modalTitle: string;\n modalCloseButtonText: string;\n}\n\nexport interface ISearchResultModalProps {\n resources: ISearchResultModalResources;\n isOpen: boolean;\n returnRef: React.RefObject | undefined;\n onModalToggle():void;\n}\n\nexport const ModalToggle: React.FC = (props: IModalToggleProps) => {\n const {text, onClick, ariaLabel, innerRef, id} = props;\n return ;\n};\n\nexport const SearchResultModal = (props: ISearchResultModalProps):ISearchResultModalViewProps => {\n return {\n modal: modalNode(props),\n modalHeader: modalHeaderNode(props),\n modalFooter: modalFooterNode(props),\n modalBody: \n };\n};\n\nconst modalNode = (props: ISearchResultModalProps) => {\n return (\n \n );\n};\n\nconst modalHeaderNode = (props: ISearchResultModalProps) => {\n return (\n \n {props.resources.modalTitle}\n \n );\n};\n\nconst modalFooterNode = (props: ISearchResultModalProps) => {\n return (\n \n \n \n );\n};","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as React from 'react';\n\nimport { Button, Collapse, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\nimport {IAny, ICoreContext, IGeneric} from '@msdyn365-commerce/core';\nimport { DisplayTemplate, ProductRefinerSource, ProductRefinerValue, RefinerType } from '@msdyn365-commerce/retail-proxy';\nimport RangeRefineItem, { RangeRefineItemType } from './range-refine-item';\nimport RefineItem from './refine-item';\nimport { IRefineItemToggleNotification } from './refine-item-toggle-notification';\nimport { IRefineItemCommonProps } from './refine-item.props.common';\nimport { findMatchingRefinementCriterion, isRangeType } from './utilities';\n\n/**\n * Properties associated with the RefineSubmenu component\n */\nexport interface IRefineSubmenuProps {\n tempRangeTypeTODO: RangeRefineItemType;\n minValueSliderThumbAriaLabel?: string;\n maxValueSliderThumbAriaLabel?: string;\n productRefinerHierarchy: IProductRefinerHierarchy;\n selectedRefinerValues: ProductRefinerValue[];\n refineItemCommonProps: IRefineItemCommonProps;\n isDisabled: boolean;\n isExpandedOnInitialLoad: boolean;\n context: ICoreContext>;\n moduleId: string;\n moduleTypeName: string;\n /** The telemetry content */\n telemetryContent?: ITelemetryContent;\n onUpdateRefiners(notfication: Readonly): void;\n urlBuilder(refiner: IRefineItemToggleNotification): string;\n}\n\n/**\n * Refine submenu state\n */\nexport interface IRefineSubmenuState extends React.ComponentState {\n expanded: boolean;\n}\n\n/**\n *\n * The RefineSubmenu component renders the submenu category and child items.\n * This computed observes the stateful category hierarchy object.\n * @extends {React.PureComponent}\n */\nclass RefineSubmenu extends React.Component {\n constructor(props: IRefineSubmenuProps) {\n super(props);\n\n this._onToggleItem = this._onToggleItem.bind(this);\n this._onToggleSubmenu = this._onToggleSubmenu.bind(this);\n\n const isExpanded = this.props.isExpandedOnInitialLoad;\n // if (this.props.productRefinerHierarchy.DataTypeValue === ProductRefinerValueDataTypeValue.Range) {\n // isExpanded = true;\n // }\n\n this.state = {\n expanded: isExpanded\n };\n }\n\n public render(): JSX.Element | null {\n const { productRefinerHierarchy, refineItemCommonProps } = this.props;\n\n if (!productRefinerHierarchy) {\n refineItemCommonProps.telemetry.error('Cannot render submenu without refiner hierarchy data');\n }\n\n if((productRefinerHierarchy.SourceValue === ProductRefinerSource.Rating) && (this.props.context.app.config.hideRating)) {\n return null;\n }\n return (\n
    \n \n {productRefinerHierarchy.KeyName}\n \n \n {this._renderChildItems(productRefinerHierarchy)}\n \n
    \n );\n }\n\n private _renderChildItems(productRefinerHierarchy: IProductRefinerHierarchy): JSX.Element | null {\n if (isRangeType(productRefinerHierarchy.DataTypeValue)) {\n return this._renderRange(productRefinerHierarchy);\n }\n return this._renderSingleMultiSelect(productRefinerHierarchy);\n }\n\n private _renderSingleMultiSelect(productRefinerHierarchy: IProductRefinerHierarchy): JSX.Element | null {\n const { isDisabled, refineItemCommonProps, selectedRefinerValues, context } = this.props;\n const isSingleSelect = (productRefinerHierarchy.RefinerTypeValue === RefinerType.SingleSelect) && (productRefinerHierarchy.SourceValue === ProductRefinerSource.Rating);\n const role = isSingleSelect ? { role: 'radiogroup' } : undefined;\n const refinerValuesList = (productRefinerHierarchy.Values || []);\n const listItems = refinerValuesList.map((child: ProductRefinerValue, index: number) => {\n if (!child) {\n refineItemCommonProps.telemetry.error(\n `[refine-submenu] Could not render refine item for refiner ${productRefinerHierarchy.RecordId} (${productRefinerHierarchy.KeyName})`\n );\n return null;\n }\n\n const selectedRefinementCriterion = findMatchingRefinementCriterion(child, selectedRefinerValues);\n\n return (\n refinerValuesList.find(value => value.RefinerRecordId === selectedValue.RefinerRecordId))}\n refineItemCommonProps={refineItemCommonProps}\n onToggle={this._onToggleItem}\n urlBuilder={this.props.urlBuilder}\n isDisabled={isDisabled}\n key={index}\n index= {index}\n context = {context}\n moduleId={this.props.moduleId}\n moduleTypeName={this.props.moduleTypeName}\n telemetryContent={this.props.telemetryContent}\n />\n );\n });\n return (\n
      \n {listItems}\n
    \n );\n }\n\n private _getRangeType(productRefinerHierarchy: IProductRefinerHierarchy): 'input' | 'slider' {\n if (productRefinerHierarchy.DisplayTemplateValue === DisplayTemplate.Range ||\n productRefinerHierarchy.DisplayTemplateValue === DisplayTemplate.Slider ||\n productRefinerHierarchy.DisplayTemplateValue === DisplayTemplate.SliderWithBars) {\n return 'slider';\n }\n return 'input';\n }\n\n private _renderRange(productRefinerHierarchy: IProductRefinerHierarchy): JSX.Element | null {\n const { isDisabled, refineItemCommonProps, selectedRefinerValues, context, minValueSliderThumbAriaLabel, maxValueSliderThumbAriaLabel } = this.props;\n const submenuClassNamePrefix = 'ms-refine-submenu__item list-group-item refine-submenu__item';\n const refinerValuesList = (productRefinerHierarchy.Values || []);\n const listItems = refinerValuesList.map((child: ProductRefinerValue, index: number) => {\n if (!child) {\n refineItemCommonProps.telemetry.error(\n `Could not render refine item for refiner ${productRefinerHierarchy.RecordId} (${productRefinerHierarchy.KeyName})`\n );\n return null;\n }\n\n const selectedRefinementCriterion = findMatchingRefinementCriterion(child, selectedRefinerValues);\n\n const rangeType = this._getRangeType(productRefinerHierarchy);\n const key = selectedRefinementCriterion ? `${selectedRefinementCriterion.LeftValueBoundString}-${selectedRefinementCriterion.RightValueBoundString}` : `not-selected-${index}`;\n return (\n
  • \n \n
  • \n );\n });\n return
      {listItems}
    ;\n }\n\n private _onToggleItem(itemToggleNotification: IRefineItemToggleNotification): void {\n this.props.onUpdateRefiners(itemToggleNotification);\n }\n\n private _onToggleSubmenu(): void {\n this.setState(prevState => ({\n expanded: !prevState.expanded\n }));\n }\n}\n\nexport default RefineSubmenu;","import * as React from 'react';\ninterface IErrorMessage {\n text?: string;\n}\n\nexport const ErrorMessage: React.FC = ({ text }) => {\n return (\n \n
    {text}
    \n
    \n );\n};"," /*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport {ArrayExtensions, getCustomer, GetCustomerInput } from '@msdyn365-commerce-modules/retail-actions';\nimport { getTelemetryObject, ILabeledDropdownOnChangeNotification, ILabeledDropdownOption, IModuleProps, INodeProps, ITelemetryContent, LabeledDropdown, UncontrolledPagination } from '@msdyn365-commerce-modules/utilities';\nimport { CategoryHierarchy as CategoryHierarchyData, IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\nimport MsDyn365 from '@msdyn365-commerce/core';\nimport { format, ProductPrice,ProductRefinerValue, ProjectionDomain, SortColumn, TextValueTranslation } from '@msdyn365-commerce/retail-proxy';\nimport {\n getActivePricesAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport { AffiliationLoyaltyTier, CustomerAffiliation } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport classnames from 'classnames';\nimport { computed, observable, reaction, transaction } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\nimport { buildListPageUrl, getCollectionProducts, getCurrentUrl, GetFullProductsByCollectionInput, parseQueryParam, sortOptions } from './actions';\nimport {\n ErrorMessage, FeatureSearchResultItem, getUpdatedRefinementCriteria, IChoiceSummaryClickNotification,\n IRefineItemCommonProps, IRefineItemToggleNotification, ISearchResultModalViewProps, isMatchingRefinementCriterion,Link, ModalToggle, ProductSearchResultItems, SearchResultModal, Separator, Title\n} from './components';\nimport ChoiceSummary from './components/choice-summary';\nimport RefineSubmenu from './components/refine-submenu';\nimport { ISearchResultContainerData } from './search-result-container.data';\nimport { expandRefinersCount, ISearchResultContainerProps } from './search-result-container.props.autogenerated';\n\nexport interface ISearchResultContainerViewProps extends ISearchResultContainerProps {\n products?: React.ReactNode;\n className?: string;\n SearchResultContainer: IModuleProps;\n TitleViewProps: ITitleViewProps;\n categoryHierarchy: ICategoryHierarchyViewProps;\n pagination?: React.ReactNode;\n ProductsContainer: INodeProps;\n ProductSectionContainer: INodeProps;\n refineMenu: IRefineMenuViewProps;\n sortByOptions: ISortByViewProps;\n choiceSummary?: React.ReactNode;\n modalToggle: React.ReactNode;\n searchResultModal: ISearchResultModalViewProps;\n isMobile: boolean;\n CategoryNavContainer: INodeProps;\n RefineAndProductSectionContainer: INodeProps;\n errorMessage: React.ReactNode;\n FeatureSearchContainer: INodeProps;\n similarLookProduct?: React.ReactNode;\n productPrices?: ProductPrice[];\n}\n\nexport interface ITitleViewProps {\n TitleContainer: INodeProps;\n title:ISearchResultTitle;\n}\n\nexport interface IRefineMenuViewProps {\n RefineMenuContainer: INodeProps;\n RefinerSectionContainer: INodeProps;\n refiners?: React.ReactNode[];\n}\n\nexport interface ICategoryHierarchyViewProps {\n categoryHierarchyList?: React.ReactNode[];\n categoryHierarchySeparator?: React.ReactNode;\n CategoryHierarchyContainer: INodeProps;\n}\n\nexport interface ISortByViewProps {\n SortingContainer: INodeProps;\n sortByDropDown?:React.ReactNode;\n}\n\nexport type GridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/**\n * Title component for search result container\n */\nexport interface ISearchResultTitle {\n titlePrefix?: React.ReactNode;\n titleText?: React.ReactNode;\n titleCount?: React.ReactNode;\n}\n\nexport interface ISearchResultContainerState {\n sortingState: ISortByCollectionState;\n modalIsOpen: boolean;\n}\n\ninterface ISortByCollectionState {\n selectedSortByOption: ILabeledDropdownOption;\n pending: boolean;\n}\n\n/**\n *\n * SearchResultContainer component\n * @extends {React.PureComponent>}\n */\n@observer\nexport default class SearchResultContainer extends React.PureComponent, ISearchResultContainerState> {\n\n @computed get isMobile(): boolean {\n return (this._viewport === 'xs' || this._viewport === 'sm');\n }\n\n private sortByDropdownOptions: ILabeledDropdownOption[] = [\n { key: sortOptions.sortByOptionRelevanceDesc, value: this.props.resources.sortByOptionRelevanceDesc },\n { key: sortOptions.sortByOptionNameAsc, value: this.props.resources.sortByOptionNameAsc },\n { key: sortOptions.sortByOptionNameDesc, value: this.props.resources.sortByOptionNameDesc },\n { key: sortOptions.sortByOptionPriceAsc, value: this.props.resources.sortByOptionPriceAsc },\n { key: sortOptions.sortByOptionPriceDesc, value: this.props.resources.sortByOptionPriceDesc },\n { key: sortOptions.sortByOptionRatingDesc, value: this.props.resources.sortByOptionRatingDesc },\n ];\n private _refineItemCommonProps: IRefineItemCommonProps;\n private _pageType: string | undefined = this.props.context.request.urlTokens.pageType;\n @observable\n private _viewport: GridSize;\n\n private _modalToggleRef: React.RefObject;\n private _sortAndFilterContainerRef: React.RefObject;\n private expandrefinerCount: number | undefined = 0;\n private telemetryContent: ITelemetryContent;\n private productPrices: ProductPrice[];\n\n public static getFriendlyName(locale: string, nameTranslations?: TextValueTranslation[]): string | undefined {\n let nameTranslation: TextValueTranslation | undefined;\n if (locale && nameTranslations && nameTranslations.length > 0) {\n nameTranslation = nameTranslations.find(item => item.Language!.toLowerCase() === locale.toLowerCase());\n }\n\n return nameTranslation && nameTranslation.Text;\n }\n\n constructor(props: ISearchResultContainerProps, state: ISearchResultContainerState) {\n super(props);\n this._viewport = props.context.request && props.context.request.device && props.context.request.device.Type === 'Mobile' ? 'xs' : 'lg';\n this._modalToggleRef = React.createRef();\n this._sortAndFilterContainerRef = React.createRef();\n this._toggleModal = this._toggleModal.bind(this);\n this._updateViewport = this._updateViewport.bind(this);\n this.productPrices=[];\n this.state = {\n sortingState: {\n pending: false,\n selectedSortByOption: this.sortByDropdownOptions[0]\n },\n modalIsOpen: false\n };\n const {\n placeholderTextMax,\n minLabel,\n maxLabel,\n rangeNameFormat\n } = this.props.resources;\n\n const locale = this.props.context.request.locale;\n const telemetry = this.props.telemetry;\n const validationErrorNaN = this.props.resources.validationErrorNotNumber;\n const validationErrorRange = this.props.resources.validationErrorNotRange;\n this._refineItemCommonProps = {\n telemetry,\n locale,\n placeholderTextMax,\n minLabel,\n maxLabel,\n rangeNameFormat,\n validationErrorNaN,\n validationErrorRange\n };\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry);\n\n // Initalization of list page\n this.props.data.products.then((products) => {\n this.props.data.listPageState.then((listPageState) => {\n if (this._pageType === 'Category') {\n listPageState.pageType = 'Category';\n } else {\n listPageState.pageType = 'Search';\n }\n\n let querySorting: SortColumn[] = [];\n\n if (this.props.context.request.query && this.props.context.request.query.sorting) {\n querySorting = JSON.parse(decodeURIComponent(this.props.context.request.query.sorting)) as SortColumn[];\n }\n\n listPageState.currentPageNumber = this.props.context.request.query && (+this.props.context.request.query.skip / (this.props.config.itemsPerPage || 10)) || 0;\n listPageState.sortingCritera = { Columns: querySorting };\n listPageState.pageSize = this.props.config.itemsPerPage || 10;\n listPageState.activeProducts = products.products;\n listPageState.totalProductCount = products.count;\n // Initialize reaction based on listPageState properties\n reaction(\n () => {\n return [listPageState.activeFilters && listPageState.activeFilters.length, listPageState.currentPageNumber, listPageState.sortingCritera && listPageState.sortingCritera.Columns && listPageState.sortingCritera.Columns.length];\n },\n () => {\n const input = new GetFullProductsByCollectionInput(\n listPageState.pageType,\n this.props.context.request.apiSettings,\n { Paging: { Top: this.props.config.itemsPerPage, Skip: Math.max((listPageState.pageSize * (listPageState.currentPageNumber || 0)), 0) }, count: true, Sorting: listPageState.sortingCritera || {} },\n listPageState.activeFilters || [],\n +(this.props.context.request.urlTokens.itemId || 0),\n this.props.context.request.query && this.props.context.request.query.q ? this.props.context.request.query.q : this.props.context.request.query?.productId,\n this.props && this.props.config && this.props.config.includeAttributes !== undefined && this.props.config.includeAttributes === true ? true : false,\n this.props.context.request.locale\n );\n getCollectionProducts(input, this.props.context.actionContext).then(productResults => {\n listPageState.activeProducts = productResults.products;\n listPageState.totalProductCount = productResults.count;\n if (this.props.config.enableAffiliationBasedPricing && this.props.context.actionContext.requestContext?.user?.isAuthenticated) {\n // tslint:disable-next-line:no-floating-promises\n this._getActivePrice();\n }\n });\n }\n );\n\n });\n });\n\n if (this.props.context.request.query?.productId) {\n this.props.data.featureProduct.then((products) => {\n this.props.data.listPageState.then((listPageStateFeature) => {\n listPageStateFeature.featureProduct = products;\n\n });\n });\n }\n this._updateViewport();\n }\n\n public componentDidMount(): void {\n if (MsDyn365.isBrowser && window.addEventListener) {\n window.addEventListener('resize', this._updateViewport);\n this._updateViewport();\n }\n if (this.props.config.enableAffiliationBasedPricing &&\n this.props.context.actionContext.requestContext?.user?.isAuthenticated) {\n // tslint:disable-next-line:no-floating-promises\n this._getActivePrice();\n }\n }\n public componentWillUnmount(): void {\n if (MsDyn365.isBrowser && window.removeEventListener) {\n window.removeEventListener('resize', this._updateViewport);\n }\n }\n\n public render(): JSX.Element {\n const { imageSettings, className, allowBackNavigation } = this.props.config;\n const { resources } = this.props;\n const products = (this.props.data.listPageState.result && this.props.data.listPageState.result.activeProducts) || [];\n const searchProduct = (this.props.data.listPageState.result && this.props.data.listPageState.result.featureProduct) || null;\n let errorText = '';\n const breaCrumbType = this.props.context.app.config.breadcrumbType;\n const allowBack = allowBackNavigation && (breaCrumbType === 'back' || breaCrumbType === 'categoryAndBack');\n if(!products || products.length === 0) {\n errorText = this._pageType === 'Category'? resources.resultCategoryNotFoundText : resources.resultSearchNotFoundText;\n\n }\n const productsComponent = (\n \n );\n\n const featureComponent = (\n \n );\n\n const searchResultContainerViewProps = {\n ...this.props,\n products: productsComponent,\n TitleViewProps: this._getCollectionTitle(),\n categoryHierarchy: !this.props.config.disableHierarchy && this._getCategoryHierarchy(),\n refineMenu: this._getRefineMenu(),\n className: classnames('ms-search-result-container', className),\n SearchResultContainer: {\n moduleProps: this.props,\n className: classnames('ms-search-result-container', className)\n },\n sortByOptions: this.props.data.listPageState.result && this.props.data.listPageState.result.totalProductCount !== 0 ? this._getSortingDropDown(): null,\n pagination: this._getPagination(),\n ProductsContainer: { className: 'ms-search-result-container__Products' },\n ProductSectionContainer: {className: 'ms-search-result-container__product-section'},\n CategoryNavContainer: {className: 'ms-search-result-container__category-nav-section'},\n RefineAndProductSectionContainer: {className: 'ms-search-result-container__refine-product-section'},\n choiceSummary: this._getChoiceSummary(),\n modalToggle: this.props.data.listPageState.result && this.props.data.listPageState.result.totalProductCount !== 0 ?\n (\n \n ) : null,\n searchResultModal: this._getSearchResultModal(),\n isMobile: this.isMobile,\n errorMessage: errorText && (\n \n ),\n FeatureSearchContainer: { className: 'ms-feature-search-result' },\n similarLookProduct: this.props.data.listPageState.result && (this.props.data.listPageState.result.featureProduct !== null && this.props.data.listPageState.result.featureProduct !== undefined) ? featureComponent : null,\n productPrices: this.productPrices\n };\n return this.props.renderView(searchResultContainerViewProps) as React.ReactElement;\n }\n\n private _getActivePrice = async (): Promise => {\n let products = (this.props.data.listPageState.result && this.props.data.listPageState.result.activeProducts) || [];\n const productRecIds = ArrayExtensions.hasElements(products) ? products.map(prod => prod.RecordId) : [];\n const projectDomain: ProjectionDomain = { ChannelId: this.props.context.request.apiSettings.channelId, CatalogId: this.props.context.request.apiSettings.catalogId };\n const affliations: AffiliationLoyaltyTier[] = [];\n const customerInput = new GetCustomerInput(this.props.context.actionContext.requestContext.apiSettings);\n const customer = await getCustomer(customerInput, this.props.context.actionContext);\n\n if (customer && customer.CustomerAffiliations) {\n customer.CustomerAffiliations.forEach((affliation: CustomerAffiliation) => {\n const aff: AffiliationLoyaltyTier = { AffiliationId: affliation.RetailAffiliationId, CustomerId: customer.AccountNumber };\n affliations.push(aff);\n });\n }\n\n await getActivePricesAsync(\n { callerContext: this.props.context.actionContext, queryResultSettings: {} },\n projectDomain,\n productRecIds,\n new Date(),\n null,\n affliations,\n true\n ).then((activePricesResponse:ProductPrice[]) => {\n this.productPrices = activePricesResponse;\n products = products.map(prod => {\n const activePrice = activePricesResponse.find(price => price.ProductId === prod.RecordId);\n if (activePrice) {\n prod.Price = activePrice.CustomerContextualPrice ?? prod.Price;\n prod.BasePrice = Math.max(activePrice.BasePrice || 0, activePrice.TradeAgreementPrice || 0, activePrice.AdjustedPrice || 0);\n }\n return prod;\n });\n this.props.data.listPageState.then((listPageState) => {\n listPageState.activeProducts = products;\n });\n }).catch((error: Error) => {\n this.props.context.actionContext.trace(error.message);\n this.props.context.actionContext.telemetry.exception(error);\n this.props.context.actionContext.telemetry.debug(`[get Affiliation based price on search result container ]Error executing action`);\n throw new Error('[get Affiliation based price on search result container]Error executing action');\n });\n }\n private _getSearchResultModal = (): ISearchResultModalViewProps => {\n const {resources} = this.props;\n return SearchResultModal(\n {\n resources:{\n modalCloseButtonText: resources.modalCloseButtonText,\n modalTitle: resources.modalTitle\n },\n isOpen:this.state.modalIsOpen,\n returnRef: this._modalToggleRef,\n onModalToggle: this._toggleModal\n });\n }\n\n private _getCollectionTitle = (): ITitleViewProps => {\n const { data, context, resources } = this.props;\n\n let collectionTitle: string | undefined = '';\n if (context && context.request && context.request.query && context.request.query.q) {\n collectionTitle = `\"${context.request.query.q}\"`;\n } else {\n collectionTitle = (data.category.result && SearchResultContainer.getFriendlyName(context.request.locale, data.category.result.NameTranslations)) ||\n (data.category.result && data.category.result.Name);\n }\n let productCountText = '';\n let productCountNumber: number | undefined;\n if (data.listPageState && data.listPageState.result && data.listPageState.result.totalProductCount !== undefined) {\n productCountNumber = data.listPageState.result.totalProductCount;\n } else if (data.products && data.products.result) {\n productCountNumber = data.products.result.count;\n }\n\n if (productCountNumber && productCountNumber !== 0) {\n productCountText = productCountNumber !== 1 ? format(this.props.resources.numberOfProducts, productCountNumber) : this.props.resources.oneProduct;\n } else {\n productCountText = format(this.props.resources.numberOfProducts, 0);\n }\n const titlePrefix = ;\n const titleText = collectionTitle && <Title className='ms-search-result__collection-title-text' text={collectionTitle} />;\n const titleCount = <Title className='ms-search-result__collection-title-count' text={productCountText} />;\n\n return {\n TitleContainer: { className: 'ms-search-result-container__title' },\n title:{\n titlePrefix: titlePrefix,\n titleText: titleText,\n titleCount: titleCount\n }\n };\n\n }\n private _getCategoryHierarchy = (): ICategoryHierarchyViewProps => {\n const { data } = this.props;\n const categoryHierarchy = data.categoryHierarchy.result;\n const categoryLinks =\n categoryHierarchy && categoryHierarchy.map((value: CategoryHierarchyData, index: number) => {\n\n return (\n <Link\n key={index}\n text={value.Name}\n ariaLabel={`${this.props.resources.categoryLinkAriaLabel} ${value.Name}`}\n href={value.Url}\n />\n );\n });\n const categoryLinkSeparator = <Separator separator='/' />;\n\n return {\n CategoryHierarchyContainer: { tag: 'nav', className: 'ms-search-result-container__category-hierarchy' },\n categoryHierarchyList: categoryLinks,\n categoryHierarchySeparator: categoryLinkSeparator\n };\n\n }\n\n private _getSortingDropDown = (): ISortByViewProps => {\n const { resources } = this.props;\n const activeDropdown = this._getCurrentlySelectedOption() || this.state.sortingState.selectedSortByOption;\n const dropdown = (\n <LabeledDropdown\n labelClassname='reviews-list-sort-by'\n labelText={resources.sortByDropdownLabel}\n dropdownId='categorySortByDropdown'\n dropdownClassname='reviews-list-dropdown'\n toggleColor='link'\n dropdownOptions={this.sortByDropdownOptions}\n selectedOption={activeDropdown}\n onSelectOption={this._updateSortByDropdown}\n ref={this._sortAndFilterContainerRef}\n />);\n return {\n SortingContainer: { className: 'ms-search-result-container__Sort-by-category' },\n sortByDropDown:dropdown\n };\n }\n\n private _getPagination = (): React.ReactNode => {\n const { config, context, data, resources } = this.props;\n const listPageState = data && data.listPageState && data.listPageState.result;\n const fullUrl = getCurrentUrl(context.request);\n const itemsPerPage = config.itemsPerPage || 10;\n const skipCount = listPageState && listPageState.currentPageNumber !== null ?\n (listPageState.currentPageNumber * (this.props.config.itemsPerPage || 10)) :\n ((this.props.context.request.query && +this.props.context.request.query.skip) || 0);\n const totalItems = listPageState && listPageState.totalProductCount || 0;\n const previousText = resources.flipperPrevious;\n const nextText = resources.flipperNext;\n if (totalItems <= itemsPerPage) {\n return null;\n }\n return (\n <UncontrolledPagination\n className='ms-search-result-container__pagination'\n role='navigation'\n aria-label={resources.paginationAriaLabel}\n url={fullUrl.href}\n qsp={'skip'}\n items={totalItems}\n itemsPerPage={itemsPerPage}\n startingItem={skipCount}\n previousText={<div className='msc-pagination__prev'><span className='ms-search-result__pagination-left' aria-hidden='true'/><span className='prev-text'>{previousText}</span></div>}\n nextText={<div className='msc-pagination__next'><span className='next-text'>{nextText}</span><span className='ms-search-result__pagination-right' aria-hidden='true'/></div>}\n previousAriaLabel={previousText}\n nextAriaLabel={nextText}\n telemetryContent={this.telemetryContent}\n />);\n }\n\n private _getRefineMenu = (): IRefineMenuViewProps => {\n const { data, context, config } = this.props;\n const tempRangeTypeTODO = context.request.query && context.request.query.inputRange ? 'input' : 'slider';\n const validRefiners = data.refiners.result && data.refiners.result.filter(refiner => {\n return refiner.Values.length > 0;\n });\n\n const activeRefiners = (data.listPageState.result && data.listPageState.result.activeFilters) || [];\n\n this._getexpandRefinerCount(validRefiners && validRefiners.length, config.expandRefinersCount);\n const expandedRefiners = this.expandrefinerCount;\n const subMenus = validRefiners && validRefiners.map((productRefinerHierarchy: IProductRefinerHierarchy, index: number) => {\n return (\n <RefineSubmenu\n productRefinerHierarchy={productRefinerHierarchy}\n selectedRefinerValues={activeRefiners}\n refineItemCommonProps={this._refineItemCommonProps}\n minValueSliderThumbAriaLabel={this.props.resources.minValueSliderThumbAriaLabel}\n maxValueSliderThumbAriaLabel={this.props.resources.maxValueSliderThumbAriaLabel}\n key={index}\n onUpdateRefiners={this._onUpdateRefiners}\n urlBuilder={this._buildRefinerUrl}\n isDisabled={false}\n isExpandedOnInitialLoad={expandedRefiners && expandedRefiners > index ? true : false}\n tempRangeTypeTODO={tempRangeTypeTODO}\n context = {context}\n moduleId={this.props.id}\n moduleTypeName={this.props.typeName}\n telemetryContent={this.telemetryContent}\n />\n );\n });\n\n return {\n RefineMenuContainer:{className: 'ms-search-result-container__refine-menu' },\n RefinerSectionContainer:{className: 'ms-search-result-container__refiner-section'},\n refiners: subMenus\n };\n\n }\n\n private _getChoiceSummary = (): React.ReactNode => {\n const { resources, data, telemetry } = this.props;\n const selectedRefiners = (data.listPageState.result && data.listPageState.result.activeFilters) || [];\n return (\n <ChoiceSummary\n classNames='ms-choice-summary-by-category'\n clearAllText={resources.clearAllText}\n label={resources.choiceSummaryLabel}\n selectedChoices={selectedRefiners}\n // @ts-ignore: NOTE Type-unsafe line below, null refinersByCategoryHierarchy case not handled\n refinerHierarchy={data.refiners.result}\n choiceFormat={resources.choiceFormat}\n choiceRangeValueFormat={resources.choiceRangeValueFormat}\n telemetry={telemetry}\n onChoiceClicked={this._onChoiceClicked}\n urlBuilder={this._buildRefinerUrlForChoiceSummary}\n choiceAriaLabel={resources.choiceAriaLabel}\n telemetryContent={this.telemetryContent}\n />\n );\n\n }\n\n private _updateSortByDropdown = (notification: ILabeledDropdownOnChangeNotification): void => {\n const { context } = this.props;\n const requestContext = context && context.request;\n const actionContext = context && context.actionContext;\n\n if (!requestContext || !actionContext || !this.props.data.listPageState.result) {\n const error = `[sort-by-category] cannot sort without context: ${!requestContext ? 'requestContext ' : ''} ${!actionContext ? 'actionContext ' : ''} could not be found`;\n this.props.telemetry.warning(error);\n }\n\n window.history.pushState({}, '', buildListPageUrl(getCurrentUrl(this.props.context.request), undefined, [this._getSortColumnFromSelectedOption(notification.selectedOption)], undefined));\n transaction(() => {\n this.props.data.listPageState.result!.currentPageNumber = 0;\n this.props.data.listPageState.result!.sortingCritera = { Columns: [this._getSortColumnFromSelectedOption(notification.selectedOption)] };\n });\n }\n\n private _getSortColumnFromSelectedOption = (option: ILabeledDropdownOption): SortColumn => {\n const { data } = this.props;\n\n if (!data.searchConfiguration.result) {\n return {};\n }\n\n const mappedConfiguration = data.searchConfiguration.result.find((searchConfiguration) => { return searchConfiguration.key === option.key; });\n\n if (mappedConfiguration) {\n return mappedConfiguration.sortColumn;\n }\n\n return {};\n }\n\n private _getCurrentlySelectedOption = (): ILabeledDropdownOption | undefined => {\n const { data } = this.props;\n const sortCriteria = data.listPageState.result && data.listPageState.result.sortingCritera;\n\n const activeSortColumn =\n (sortCriteria && sortCriteria.Columns && sortCriteria.Columns[0]) ||\n (parseQueryParam<SortColumn[]>('sorting', this.props.context.request) || [])[0];\n\n if (activeSortColumn && data.searchConfiguration.result) {\n const activeMappedConfig = data.searchConfiguration.result.find((mappedSearchConfig) => {\n return (mappedSearchConfig.sortColumn.ColumnName === activeSortColumn.ColumnName) &&\n (mappedSearchConfig.sortColumn.IsDescending === activeSortColumn.IsDescending);\n });\n if (activeMappedConfig) {\n return this.sortByDropdownOptions.find((dropdownOption) => dropdownOption.key === activeMappedConfig.key);\n }\n }\n\n return;\n }\n\n private _onUpdateRefiners = (itemToggleNotification: IRefineItemToggleNotification): void => {\n const { context } = this.props;\n const requestContext = context && context.request;\n const actionContext = context && context.actionContext;\n\n if (!requestContext || !actionContext || !this.props.data.listPageState.result) {\n const error = `Refine menu cannot refine search criteria: ${!requestContext ? 'requestContext ' : ''} ${!actionContext ? 'actionContext ' : ''} could not be found`;\n this.props.telemetry.warning(error);\n }\n\n const updatedRefinementCriteria = getUpdatedRefinementCriteria(itemToggleNotification, this.props.data.listPageState.result && this.props.data.listPageState.result.activeFilters || []);\n\n window.history.pushState({}, '', buildListPageUrl(getCurrentUrl(this.props.context.request), updatedRefinementCriteria));\n transaction(() => {\n this.props.data.listPageState.result!.currentPageNumber = 0;\n this.props.data.listPageState.result!.activeFilters = updatedRefinementCriteria;\n });\n }\n\n private _buildRefinerUrl = (itemToggleNotification: IRefineItemToggleNotification): string => {\n if (this.props.data.listPageState.result) {\n const newRefinementCriteria = getUpdatedRefinementCriteria(itemToggleNotification, this.props.data.listPageState.result.activeFilters || []);\n\n return buildListPageUrl(getCurrentUrl(this.props.context.request), newRefinementCriteria);\n } else {\n this.props.telemetry.warning(`[buildRefinerQueryString]List Page State Not available, unable to build refiner URL`);\n return '';\n }\n }\n\n private _onChoiceClicked = (notification: IChoiceSummaryClickNotification): void => {\n const { data, telemetry } = this.props;\n\n if (!data.listPageState.result) {\n telemetry.warning('[choice-summary-by-category._onChoiceClicked]ListPageState unavailable, unable to update refiners.');\n return;\n }\n\n let currentRefinementCriteria = (data.listPageState.result && data.listPageState.result.activeFilters) || [];\n\n if (!notification.clearAll) {\n const selectedChoice = notification.choiceClicked;\n if (!selectedChoice) {\n telemetry.warning('[choice-summary-by-category._onChoiceClicked] Choice could not be determined');\n return;\n }\n currentRefinementCriteria = currentRefinementCriteria.filter(\n (selectedCriterion: ProductRefinerValue) => !isMatchingRefinementCriterion(selectedChoice, selectedCriterion)\n );\n } else {\n currentRefinementCriteria = [];\n\n // set focus to sort and filter\n const dropdownElementId = this._sortAndFilterContainerRef.current && this._sortAndFilterContainerRef.current.props.dropdownId;\n const dropdownElement = dropdownElementId && document.getElementById(dropdownElementId);\n setTimeout(() => {\n dropdownElement && dropdownElement.focus();\n },\n 50);\n }\n\n const fullUrl = getCurrentUrl(this.props.context.request);\n window.history.pushState({}, '', buildListPageUrl(fullUrl, currentRefinementCriteria));\n data.listPageState.result.currentPageNumber = 0;\n data.listPageState.result.activeFilters = currentRefinementCriteria;\n }\n\n private _buildRefinerUrlForChoiceSummary = (selectedRefiner: ProductRefinerValue, isClearAll: boolean): string => {\n const { data, telemetry } = this.props;\n const fullUrl = getCurrentUrl(this.props.context.request);\n\n if (!data.listPageState.result) {\n telemetry.warning('[choice-summary-by-category._buildRefinerUrl]ListPageState unavailable, unable to create refiner URL.');\n return fullUrl.href;\n }\n\n let currentRefinementCriteria = (data.listPageState.result && data.listPageState.result.activeFilters) || [];\n\n if (!isClearAll) {\n if (!selectedRefiner) {\n telemetry.warning('[choice-summary-by-category._buildRefinerUrl] URL for Choice could not be determined');\n return fullUrl.href;\n }\n currentRefinementCriteria = currentRefinementCriteria.filter(\n (selectedCriterion: ProductRefinerValue) => !isMatchingRefinementCriterion(selectedRefiner, selectedCriterion)\n );\n } else {\n currentRefinementCriteria = [];\n }\n\n return buildListPageUrl(fullUrl, currentRefinementCriteria);\n }\n\n private _getViewport(): GridSize {\n const { context } = this.props;\n\n // always render in mobile viewport on a mobile device\n if (context.request && context.request.device && context.request.device.Type === 'Mobile') {\n return 'xs';\n }\n\n if (MsDyn365.isBrowser && window.innerWidth) {\n const gridSettings = context.request.gridSettings;\n if (gridSettings) {\n if (gridSettings.xs && window.innerWidth <= gridSettings.xs.w) {\n return 'xs';\n } else if (gridSettings.sm && window.innerWidth <= gridSettings.sm.w) {\n return 'sm';\n } else if (gridSettings.md && window.innerWidth <= gridSettings.md.w) {\n return 'md';\n } else if (gridSettings.lg && window.innerWidth <= gridSettings.lg.w) {\n return 'lg';\n } else {\n return 'xl';\n }\n }\n }\n\n return 'lg';\n }\n\n private _toggleModal(): void {\n this.setState({\n modalIsOpen: !this.state.modalIsOpen\n });\n }\n\n private _updateViewport(): void {\n this._viewport = this._getViewport();\n\n if (this.state.modalIsOpen && !this.isMobile) {\n this._toggleModal();\n }\n }\n\n private _getexpandRefinerCount = (validRefiners?: number, refinerCount?: expandRefinersCount): void => {\n switch(refinerCount) {\n case expandRefinersCount.all:\n this.expandrefinerCount = validRefiners;\n break;\n case expandRefinersCount.one:\n this.expandrefinerCount = 1;\n break;\n case expandRefinersCount.two:\n this.expandrefinerCount = 2;\n break;\n case expandRefinersCount.three:\n this.expandrefinerCount = 3;\n break;\n case expandRefinersCount.four:\n this.expandrefinerCount = 4;\n break;\n default:\n this.expandrefinerCount = 0;\n }\n }\n\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Module } from '@msdyn365-commerce-modules/utilities';\nimport { Carousel } from '@msdyn365-commerce/components';\nimport classnames from 'classnames';\nimport * as React from 'react';\nimport { ICarouselViewProps } from './carousel';\n\nconst CarouselView: React.FC<ICarouselViewProps> = props => (\n <Module {...props.carouselContainer} {...props.renderModuleAttributes(props)}>\n <Carousel\n className={classnames(props.closeAnimation)}\n activeIndex={props.activeIndex}\n next={props.next}\n previous={props.previous}\n pause={props.config.pauseOnHover ? 'hover' : false}\n ride={props.config.autoplay ? 'carousel' : undefined}\n autoplay={props.config.autoplay}\n interval={props.config.interval}\n transitionType={(props.config.transitionType) ? props.config.transitionType : undefined}\n items={props.slots && props.slots.content && props.slots.content.length ? props.slots.content : []}\n hideFlipper={props.config.hideFlipper}\n dismissEnabled={props.config.dismissEnabled}\n onIndicatorsClickHandler={props.onIndicatorsClickHandler}\n handleDismissCarousel={props.handleDismissCarousel}\n dismissCarouselAriaText={props.resources && props.resources.ariaLabelForDismissButton}\n indicatorAriaText={props.resources && props.resources.ariaLabelForSlide}\n directionTextPrev={props.resources && props.resources.flipperPrevious}\n directionTextNext={props.resources && props.resources.flipperNext}\n handleOnExited={props.handleOnExited}\n handleOnExiting={props.handleOnExiting}\n telemetryContent={props.telemetryContent}\n />\n </Module>\n);\n\nexport default CarouselView;\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { getProductUrlSync, IProductInventoryInformation } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, getPayloadObject, getTelemetryAttributes, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\nimport { CartLineItemComponent, ICartlineResourceString } from '@msdyn365-commerce/components';\nimport { ICoreContext, IGridSettings, IImageSettings, ITelemetry } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { CartLine, ChannelDeliveryOptionConfiguration, OrgUnitLocation, ProductAvailableQuantity, ProductDeliveryOptions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { ReleasedProductType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport * as React from 'react';\n\nexport interface IFlyoutCartLineItemsProps {\n cartlines: CartLine[];\n cartState: ICartState | undefined;\n orgUnitLocations: OrgUnitLocation[] | undefined;\n resources: ICartlineResourceString;\n productAvailabilites: IProductInventoryInformation[] | undefined;\n products: SimpleProduct[] | undefined;\n productDeliveryOptions: ProductDeliveryOptions[] | undefined;\n pickupDeliveryModeCode?: string;\n /** GridSettings for the product image in cartline */\n gridSettings: IGridSettings;\n /** ImageSettings for the product image in cartline */\n imageSettings: IImageSettings;\n id: string;\n typeName:string;\n context: ICoreContext;\n telemetry: ITelemetry;\n removeButtonText: string;\n outOfStockText: string;\n outOfRangeOneText: string;\n outOfRangeFormatText: string;\n maxCartlineQuantity: number;\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n\n outOfStockThreshold: number;\n isStockCheckEnabled: boolean;\n telemetryContent?: ITelemetryContent;\n removeItemClickHandler(cartlineToRemove: CartLine): void;\n}\n\nexport interface IFlyoutCartLineItemViewProps {\n cartline: React.ReactNode;\n remove: React.ReactNode;\n storeLocation: React.ReactNode;\n hasError: boolean;\n\n data: {\n product: SimpleProduct;\n cartline: CartLine;\n };\n}\n\nconst _getProduct = (productId: number | undefined, products: SimpleProduct[]): SimpleProduct | undefined => {\n if (productId !== undefined && products) {\n return products.find(product => {\n return productId === product.RecordId;\n });\n }\n return undefined;\n};\n\nconst _getCartItemMaxQuantity = (outOfStockThreshold: number, maxCartlineQuantity: number, isStockCheckEnabled: boolean, productAvailability?: ProductAvailableQuantity) => {\n if(isStockCheckEnabled) {\n if(!productAvailability || !productAvailability.AvailableQuantity || productAvailability.AvailableQuantity <= 0 || productAvailability.AvailableQuantity <= outOfStockThreshold) {\n return 0;\n }\n return productAvailability.AvailableQuantity - outOfStockThreshold;\n }\n\n return maxCartlineQuantity;\n};\n\nconst _assembleNode = (\n cartline: CartLine,\n product: SimpleProduct,\n props:IFlyoutCartLineItemsProps,\n index:number,\n foundProductAvailability?:ProductAvailableQuantity,\n foundProductDeliveryOptions?:ProductDeliveryOptions,\n ):IFlyoutCartLineItemViewProps => {\n const {\n imageSettings,\n gridSettings,\n id,\n typeName,\n context,\n resources,\n removeButtonText,\n removeItemClickHandler } = props;\n\n const maxQuantity = _getCartItemMaxQuantity(props.outOfStockThreshold, props.maxCartlineQuantity, props.isStockCheckEnabled, foundProductAvailability);\n\n // check if the product is service or not by product type\n const PRODUCTASSERVICE = 2 as ReleasedProductType.Service;\n const isServiceItem = product.ItemTypeValue === PRODUCTASSERVICE;\n\n const onRemoveClickHandler = (event: React.MouseEvent<HTMLElement>) => { removeItemClickHandler(cartline); };\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.RemoveCartItem);\n const removeCartItemAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n\n return {\n data: {\n product: product,\n cartline: cartline\n },\n hasError: (!isServiceItem && props.isStockCheckEnabled) ? cartline.Quantity! > maxQuantity : false,\n cartline: (\n <CartLineItemComponent\n data={{\n cartLine: cartline,\n product: product\n }}\n currentQuantity = {cartline.Quantity!}\n maxQuantity = {maxQuantity}\n isOutOfStock = {(!isServiceItem && props.isStockCheckEnabled) ? (maxQuantity <= 0 ? true: false) : false}\n gridSettings={gridSettings}\n imageSettings={imageSettings}\n id={id}\n typeName={typeName}\n productUrl={getProductUrlSync(product, props.context.actionContext, undefined)}\n context={context}\n resources={resources}\n key={index}\n isQuantityEditable={false}\n primaryImageUrl={product.PrimaryImageUrl}\n displayMode='COMPACT'\n telemetryContent={props.telemetryContent!}\n channelDeliveryOptionConfig = {props.channelDeliveryOptionConfig}\n />),\n remove: (\n <Button\n className='msc-cart-line__remove-item'\n onClick={onRemoveClickHandler}\n title={removeButtonText}\n {...removeCartItemAttribute}\n >\n {removeButtonText}\n </Button>\n ),\n storeLocation: (\n _renderStoreLocation(cartline, props)\n )\n };\n};\n\nconst _renderStoreLocation = (cartLine: CartLine | null | undefined, props: IFlyoutCartLineItemsProps): JSX.Element | null => {\n if(cartLine && cartLine.FulfillmentStoreId) {\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, props.orgUnitLocations);\n\n if(orgUnitName) {\n return (\n <div className={`msc-cart-line__bopis-method`}>\n <span className={`pick-up`}>{orgUnitName}</span>\n </div>\n );\n }\n }\n\n return null;\n};\n\nconst _getOrgUnitName = (fulfillmentStoreId: string | undefined, orgUnitLocations: OrgUnitLocation[] | undefined) => {\n if(!orgUnitLocations || !fulfillmentStoreId || !(orgUnitLocations.length > 0)) {\n return '';\n }\n\n const foundLocation = orgUnitLocations.find(orgUnitLocation => {\n return orgUnitLocation.OrgUnitNumber === fulfillmentStoreId;\n });\n\n if(foundLocation) {\n return foundLocation.OrgUnitName;\n } else {\n return fulfillmentStoreId;\n }\n};\n\nconst _assembleCartlines = (\n cartlines: CartLine[],\n products: SimpleProduct[] | undefined,\n props: IFlyoutCartLineItemsProps):IFlyoutCartLineItemViewProps[] | null => {\n const reactNodes:IFlyoutCartLineItemViewProps[] = [];\n\n if(!products || products.length === 0) {\n props.context.telemetry.error('Cartlines content is empty, module wont render');\n return null;\n }\n\n cartlines.map((cartline, index) => {\n const product = _getProduct(cartline.ProductId, products);\n let foundProductAvailability;\n if(props.productAvailabilites && props.productAvailabilites.length > 0) {\n foundProductAvailability = props.productAvailabilites.find((productAvailability) => {\n return productAvailability.ProductAvailableQuantity?.ProductId! === cartline.ProductId;\n });\n }\n let foundProductDeliveryOption;\n if(props.productDeliveryOptions && props.productDeliveryOptions.length > 0) {\n foundProductDeliveryOption = props.productDeliveryOptions.find((deliveryOption) => {\n return deliveryOption && deliveryOption.ProductId === cartline.ProductId;\n });\n }\n if(product) {\n reactNodes.push(_assembleNode(cartline, product, props, index, foundProductAvailability?.ProductAvailableQuantity, foundProductDeliveryOption));\n }\n });\n\n return reactNodes;\n};\n\n/**\n * CartLineItems component\n */\n\nexport const FlyoutCartLineItems = (props: IFlyoutCartLineItemsProps) => {\n const { products, cartlines } = props;\n return (\n _assembleCartlines(cartlines, products, props)\n );\n};","import { ActiveCartProductsInput, getActiveCartProductsAction, getAvailabilitiesForCartLineItems, getDeliveryOptionsForCartLineItems, IProductInventoryInformation, ProductAvailabilitiesForCartLineItems, ProductDeliveryOptionsForCartLineItems } from '@msdyn365-commerce-modules/retail-actions';\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { ProductDeliveryOptions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\n\n/**\n * IMiniCartData entity interface.\n */\nexport interface IMiniCartData {\n products?: SimpleProduct[];\n productAvailabilites?: IProductInventoryInformation[];\n deliveryOptions?: ProductDeliveryOptions[];\n}\n\nexport const createInput = () => {\n return new ActiveCartProductsInput();\n};\n\n/**\n * Calls the Retail API and returns a mini cart data\n */\nexport async function getMiniCartData(ctx: IActionContext, cartState: ICartState): Promise<IMiniCartData> {\n const miniCartData: IMiniCartData = {};\n\n const cart = cartState.cart;\n\n // If there are cart lines, make call to get products\n // If there are invocie linese, then there is no products, so don't make call to get products\n if (cart && cart.CartLines && cart.CartLines.length && !cartState.hasInvoiceLine) {\n await getActiveCartProductsAction(\n new ActiveCartProductsInput(),\n ctx\n )\n .then(products => {\n if (products) {\n miniCartData.products = products;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\n });\n\n await getAvailabilitiesForCartLineItems(\n new ProductAvailabilitiesForCartLineItems(ctx.requestContext.apiSettings),\n ctx\n )\n .then(availableQuantity => {\n if (availableQuantity) {\n miniCartData.productAvailabilites = availableQuantity;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\n });\n\n await getDeliveryOptionsForCartLineItems(\n new ProductDeliveryOptionsForCartLineItems(ctx.requestContext.apiSettings),\n ctx\n )\n .then(deliveryOptions => {\n if (deliveryOptions) {\n miniCartData.deliveryOptions = deliveryOptions;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\n });\n }\n\n return miniCartData;\n}","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Button, getPayloadObject, getTelemetryAttributes, getTelemetryObject, INodeProps, ITelemetryContent, TelemetryConstant, UncontrolledTooltip } from '@msdyn365-commerce-modules/utilities';\nimport { CartIconComponent } from '@msdyn365-commerce/components';\nimport { getUrlSync, IDictionary, IImageSettings, msdyn365Commerce, TelemetryEvent } from '@msdyn365-commerce/core';\nimport { CartLine, ChannelDeliveryOptionConfiguration ,OrgUnitLocation } from '@msdyn365-commerce/retail-proxy';\nimport classnames from 'classnames';\nimport { reaction } from 'mobx';\nimport { observer } from 'mobx-react';\nimport React from 'react';\nimport { ICartIconData } from './cart-icon.data';\nimport { ICartIconProps } from './cart-icon.props.autogenerated';\nimport { FlyoutCartLineItems, IFlyoutCartLineItemViewProps } from './components/flyout-cart-line-items';\nimport { getMiniCartData, IMiniCartData } from './utils/get-products-in-mini-cart';\n\nexport interface IMiniCartState {\n miniCartData: IMiniCartData;\n orgUnitLocations?: OrgUnitLocation[];\n}\n\nexport interface ICartIconViewProps extends ICartIconProps<ICartIconData> {\n className: string;\n cartIcon: React.ReactNode;\n\n FlyoutContainer?: INodeProps;\n\n CartlinesWrapper: INodeProps;\n miniCartWrapper: INodeProps;\n miniCartItemWrapper: INodeProps;\n cartlines?: IFlyoutCartLineItemViewProps[];\n flyoutTitle: React.ReactNode;\n totalPrice: React.ReactNode;\n\n checkoutAsGuestButton?: React.ReactNode;\n checkoutAsSignInUserButton?: React.ReactNode;\n goToCartButton?: React.ReactNode;\n waitingComponent?: React.ReactNode;\n\n isCartLoading: boolean;\n\n removeItemClickHandler(cartlineToRemove: CartLine): void;\n}\n\n/**\n *\n * Cart component\n * @extends {React.PureComponent<ICartProps<ICartData>>}\n */\n@observer\nclass CartIcon extends React.Component<ICartIconProps<ICartIconData>, IMiniCartState> {\n private telemetryContent: ITelemetryContent;\n private checkoutBySignInAttributes: IDictionary<string> | undefined;\n private checkoutByGuestAttributes: IDictionary<string> | undefined;\n private viewShoppingBagAttributes: IDictionary<string> | undefined;\n private retailMultiplePickUpOptionEnabled?: boolean = false;\n private channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n constructor(props: ICartIconProps<ICartIconData>) {\n super(props);\n this.state = { miniCartData: {} };\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\n const payload = getPayloadObject(TelemetryEvent.CheckOut, this.telemetryContent, TelemetryConstant.Checkout);\n this.checkoutBySignInAttributes = getTelemetryAttributes(this.telemetryContent, payload);\n\n payload.contentAction.etext = TelemetryConstant.GuestCheckout;\n this.checkoutByGuestAttributes = getTelemetryAttributes(this.telemetryContent, payload);\n\n payload.contentAction.etext = TelemetryConstant.ViewShoppingBag;\n this.viewShoppingBagAttributes = getTelemetryAttributes(this.telemetryContent, payload);\n }\n\n public async componentDidMount(): Promise<void> {\n const context = this.props.context.actionContext;\n\n reaction(\n () => this.props.data.cart.result?.cart.CartLines,\n async () => {\n this.setState({\n miniCartData: await getMiniCartData(context, this.props.data.cart.result!)\n });\n }\n );\n\n this.setState({\n orgUnitLocations: this.props.data.orgUnitLocations.result\n });\n }\n\n // tslint:disable-next-line:cyclomatic-complexity\n public render(): JSX.Element | null {\n const {\n id,\n typeName,\n config: {\n enableHoverCart\n },\n context: {\n request: {\n user: {\n isAuthenticated,\n signInUrl\n }\n }\n },\n context,\n resources\n } = this.props;\n\n const cart = this.props.data.cart && this.props.data.cart.result || undefined;\n const guestCheckoutUrl = getUrlSync('checkout', this.props.context.actionContext) || '';\n const cartUrl = getUrlSync('cart', this.props.context.actionContext) || '';\n const checkoutURL = this._getCheckoutURL(isAuthenticated, guestCheckoutUrl, signInUrl || '');\n const isCartEmpty = cart && cart.cart.CartLines && cart.cart.CartLines.length === 0;\n const hasInvoiceLine = cart && cart.hasInvoiceLine;\n const cartLines = this._getCartLines();\n const hasErrors = cartLines ? cartLines.some(cartline => cartline.hasError) : false;\n const includeFlyout = this.props.data.cart && this.props.data.cart.status === 'SUCCESS' && enableHoverCart;\n const cartSize = cartLines ? cartLines.length : 0;\n const goToCartButtonText = resources.goToCartButtonTitle.replace('{count}', cartSize.toString());\n const flyoutTitle = resources.flyoutTitle;\n // If there are invoice lines, don't update mini cart price\n const price = cart && !cart.hasInvoiceLine && cart.cart.TotalAmount || undefined;\n const priceString = price ? resources.totalPriceFormatString.replace('{price}', context.cultureFormatter.formatCurrency(price)) : '';\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n this.channelDeliveryOptionConfig = this.props.data.channelDeliveryOptionConfig?.result;\n this.retailMultiplePickUpOptionEnabled = this.props.data.featureState?.result?.\n find(feature => feature.Name === multiplePickupStoreSwitchName)?.IsEnabled;\n\n const viewProps = {\n ...this.props,\n cartIcon: (\n <CartIconComponent\n cartLabel={resources.cartLabel}\n cartQtyLabel={resources.cartQtyLabel}\n context={context}\n id={id}\n typeName={typeName}\n data={{cart: cart}}\n telemetryContent={this.telemetryContent}\n />\n ),\n cartlines: cartLines,\n FlyoutContainer: includeFlyout ? {\n tag: UncontrolledTooltip,\n placement: 'bottom-end',\n hideArrow: true,\n className: 'ms-cart-icon__flyout-container',\n trigger: 'hover focus',\n displayMode: 'FLYOUT',\n target: id\n } : undefined,\n CartlinesWrapper: {\n className: 'ms-cart-icon__cart-lines'\n },\n miniCartWrapper: {\n className: classnames('ms-cart-icon'),\n id: this.props.id\n },\n miniCartItemWrapper: {\n className: classnames('msc-cart-lines-item')\n },\n // If there are invoice lines, don't update mini cart checkout button\n checkoutAsSignInUserButton: (!isCartEmpty && !hasInvoiceLine) ?\n (\n <Button disabled={hasErrors} className={'ms-cart-icon__btn-checkout'} href={checkoutURL} title={resources.checkoutButtonTitle}{...this.checkoutBySignInAttributes}>{resources.checkoutButtonTitle}</Button>\n ) : null,\n checkoutAsGuestButton: (!isCartEmpty && !isAuthenticated) ?\n (\n <Button disabled={hasErrors} className={'ms-cart-icon__btn-guestcheckout'} href={guestCheckoutUrl} title={resources.guestCheckoutButtonTitle}{...this.checkoutByGuestAttributes}>{resources.guestCheckoutButtonTitle}</Button>\n ) : null,\n goToCartButton:\n (\n <Button className={'ms-cart-icon__btn-gotocart'} href={cartUrl} title={goToCartButtonText} {...this.viewShoppingBagAttributes}>{goToCartButtonText}</Button>\n ),\n flyoutTitle:\n (\n <span className={`ms-cart-icon__flyout-title`}>{flyoutTitle}</span>\n ),\n totalPrice:\n (\n <div className={`ms-cart-icon__subtotal`}>{priceString}</div>\n )\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private _getCheckoutURL(isAuthenticated: boolean, guestCheckoutUrl: string, signInUrl: string): string {\n if (isAuthenticated) {\n return guestCheckoutUrl;\n }\n\n const absoluteUrlRegExp = new RegExp('^(?:[a-z]+:)?//', 'i');\n const isAbsoluteUrl = absoluteUrlRegExp.test(guestCheckoutUrl);\n let returnURL = guestCheckoutUrl;\n if (msdyn365Commerce.isBrowser && !isAbsoluteUrl) {\n returnURL = `${window.location.origin}${guestCheckoutUrl}`;\n }\n\n return `${signInUrl}${signInUrl.indexOf('?') === -1 ? '?' : '&'}ru=${returnURL}`;\n }\n\n private _getCartLines(): IFlyoutCartLineItemViewProps[] | null {\n const {\n context: {\n request: {\n channel: {\n PickupDeliveryModeCode\n } = { PickupDeliveryModeCode: undefined }\n }\n },\n config: config,\n telemetry,\n resources\n } = this.props;\n\n const imageSettings = this._getImageSettings(config.imageSettings);\n const cart = this.props.data.cart && this.props.data.cart.result;\n\n return this.state.miniCartData.products && cart && cart.cart.CartLines && cart.cart.CartLines.length > 0 ?\n (\n FlyoutCartLineItems({\n cartlines: cart.cart.CartLines,\n products: this.state.miniCartData.products,\n productAvailabilites: this.state.miniCartData.productAvailabilites,\n productDeliveryOptions: this.state.miniCartData.deliveryOptions,\n imageSettings: imageSettings,\n outOfStockThreshold: this.props.context.app.config.outOfStockThreshold || 0,\n isStockCheckEnabled: this.props.context.app.config.enableStockCheck || false,\n maxCartlineQuantity: this.props.context.app.config.maxQuantityForCartLineItem,\n gridSettings: this.props.context.request.gridSettings!,\n context: this.props.context,\n typeName: this.props.typeName,\n id: this.props.id,\n resources: {\n sizeString: resources.productDimensionTypeSize,\n colorString: resources.productDimensionTypeColor,\n configString: resources.productDimensionTypeConfiguration,\n styleString: resources.productDimensionTypeStyle,\n quantityDisplayString: resources.quantityDisplayText,\n inputQuantityAriaLabel: '', // not used\n discountStringText: '', // not used\n originalPriceText: '',\n currentPriceText: '',\n shippingChargesText: ''\n },\n telemetry: telemetry,\n removeButtonText: resources.removeCartButtonText,\n outOfStockText: '', // not used\n outOfRangeOneText: '', // not used\n outOfRangeFormatText: '', // not used\n cartState: cart,\n orgUnitLocations: this.state.orgUnitLocations,\n removeItemClickHandler: this._removeItemFromCartHandler,\n pickupDeliveryModeCode: PickupDeliveryModeCode,\n telemetryContent: this.telemetryContent,\n channelDeliveryOptionConfig : this.retailMultiplePickUpOptionEnabled ? this.channelDeliveryOptionConfig : undefined\n })\n ) : null;\n }\n\n private _getImageSettings = (imageSettings: IImageSettings | undefined): IImageSettings => {\n return imageSettings || {\n viewports: {\n xs: { q: `w=80&h=94&m=6`, w: 0, h: 0 },\n sm: { q: `w=148&h=174&m=6`, w: 0, h: 0 },\n lg: { q: `w=148&h=174&m=6`, w: 0, h: 0 }\n },\n lazyload: true\n };\n }\n\n private _removeItemFromCartHandler = (cartlineToRemove: CartLine) => {\n if (this.props.data.cart.result) {\n const input = {\n cartLineIds: [cartlineToRemove.LineId!.toString()]\n };\n this.props.data.cart.result.removeCartLines(input)\n .catch((error) => {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to Remove Cart Line');\n });\n }\n }\n}\n\nexport default CartIcon;\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { getCustomer, GetCustomerInput } from '@msdyn365-commerce-modules/retail-actions';\nimport { getTelemetryObject, IComponentNodeProps, IModuleProps, INodeProps, ISingleSlideCarouselProps, ITelemetryContent, NodeTag, SingleSlideCarousel } from '@msdyn365-commerce-modules/utilities';\nimport { ProductComponent } from '@msdyn365-commerce/components';\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { ProductPrice, ProductSearchResult, ProjectionDomain } from '@msdyn365-commerce/retail-proxy';\nimport {\n getActivePricesAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport { AffiliationLoyaltyTier, CustomerAffiliation } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport classnames from 'classnames';\nimport * as React from 'react';\nimport { IProductCollectionProps, layout } from './product-collection.props.autogenerated';\nexport interface IProductCollectionViewProps extends IProductCollectionProps<{}> {\n heading?: React.ReactNode;\n ProductCollectionContainer: IModuleProps;\n SingleSlideCarouselComponentProps: INodeProps;\n GridComponentProps: INodeProps;\n products: IProductComponentViewProps[];\n isCarousel: boolean;\n productPrices?: ProductPrice[];\n}\n\nexport interface IProductComponentViewProps {\n ProductContainer: INodeProps;\n productComponent: React.ReactNode;\n}\nexport interface IProductComponentState {\n products: ProductSearchResult[];\n}\n/**\n * ProductCollection component\n */\nclass ProductCollection extends React.PureComponent<IProductCollectionProps<{}>,IProductComponentState> {\n private telemetryContent: ITelemetryContent;\n private productPrices: ProductPrice[];\n constructor(props: IProductCollectionProps<{}>) {\n super(props);\n this.productPrices=[];\n this.state = {\n products: this.props.config.productCollection && this.props.config.productCollection.products,\n };\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry);\n }\n public componentDidMount(): void {\n if (this.props.config.enableAffiliationBasedPricing &&\n this.props.context.actionContext.requestContext?.user?.isAuthenticated) {\n // tslint:disable-next-line:no-floating-promises\n this._getActivePrice();\n }\n }\n public render(): JSX.Element | null {\n const { heading, className } = this.props.config;\n const { resources } = this.props;\n const products = this.state.products;\n const isCarousel = this.props.config.layout === layout.carousel;\n const headingComponent = heading && (\n <Msdyn365.Text\n className='ms-product-collection__heading'\n tag={heading.tag || 'h1'}\n text={heading.text}\n editProps={{onEdit:this.handleHeadingChange, requestContext:this.props.context.request}}\n />\n );\n\n const productCollectionViewProps = {\n ...this.props,\n heading: headingComponent,\n SingleSlideCarouselComponentProps: {\n tag: SingleSlideCarousel,\n className: '',\n flipperPrevLabel: resources.flipperPrevious,\n flipperNextLabel: resources.flipperNext,\n parentId: this.props.id,\n telemetryContent: this.telemetryContent\n } as IComponentNodeProps<ISingleSlideCarouselProps>,\n ProductCollectionContainer: {\n moduleProps: this.props,\n className: classnames('ms-product-collection', className)\n },\n GridComponentProps: {\n tag: 'ul' as NodeTag,\n className: 'ms-product-collection__items',\n },\n isCarousel: isCarousel,\n products: products && products.length > 0 && products.map((item: ProductSearchResult, index: number) => this._getProduct(item, index)),\n productPrices: this.productPrices,\n };\n return this.props.renderView(productCollectionViewProps) as React.ReactElement;\n }\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent) => this.props.config.heading!.text = event.target.value;\n\n private _getProduct = (product:ProductSearchResult, index: number): IProductComponentViewProps | null => {\n if(!product || !product.Name) {\n this.props.telemetry.trace('[product-collection] Product or product name is null');\n return null;\n }\n const telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry);\n const { imageSettings, allowBackNavigation } = this.props.config;\n const resources = this.props.resources;\n const breaCrumbType = this.props.context.app.config.breadcrumbType;\n const allowBack = allowBackNavigation && (breaCrumbType === 'back' || breaCrumbType === 'categoryAndBack');\n return {\n ProductContainer: {\n tag: 'li' as NodeTag,\n className: 'ms-product-collection__item',\n role: 'listitem',\n key: index,\n },\n productComponent: (\n <ProductComponent\n context={this.props.context}\n telemetryContent={telemetryContent}\n imageSettings={imageSettings}\n freePriceText={resources.priceFree}\n originalPriceText={resources.originalPriceText}\n currentPriceText={resources.currentPriceText}\n ratingAriaLabel={resources.ratingAriaLabel}\n allowBack={allowBack}\n id={this.props.id}\n typeName={this.props.typeName}\n data={{product: product}}\n />\n )\n };\n }\n private _getActivePrice = async (): Promise<void> => {\n let products = (this.state.products) || [];\n const productRecIds = (products && products.length > 0) ? products.map(prod => prod.RecordId) : [];\n const projectDomain: ProjectionDomain = { ChannelId: this.props.context.request.apiSettings.channelId, CatalogId: this.props.context.request.apiSettings.catalogId };\n const affliations: AffiliationLoyaltyTier[] = [];\n const customerInput = new GetCustomerInput(this.props.context.actionContext.requestContext.apiSettings);\n const customer = await getCustomer(customerInput, this.props.context.actionContext);\n\n if (customer && customer.CustomerAffiliations) {\n customer.CustomerAffiliations.forEach((affliation: CustomerAffiliation) => {\n const aff: AffiliationLoyaltyTier = { AffiliationId: affliation.RetailAffiliationId, CustomerId: customer.AccountNumber };\n affliations.push(aff);\n });\n }\n\n await getActivePricesAsync(\n { callerContext: this.props.context.actionContext, queryResultSettings: {} },\n projectDomain,\n productRecIds,\n new Date(),\n null,\n affliations,\n true\n ).then((activePricesResponse:ProductPrice[]) => {\n this.productPrices = activePricesResponse;\n products = products.map(prod => {\n const activePrice = activePricesResponse.find(price => price.ProductId === prod.RecordId);\n if (activePrice) {\n prod.Price = activePrice.CustomerContextualPrice ?? prod.Price;\n prod.BasePrice = Math.max(activePrice.BasePrice || 0, activePrice.TradeAgreementPrice || 0, activePrice.AdjustedPrice || 0);\n }\n return prod;\n });\n this.setState({\n products:products\n });\n })\n .catch((error: Error) => {\n this.props.context.actionContext.trace(error.message);\n this.props.context.actionContext.telemetry.exception(error);\n this.props.context.actionContext.telemetry.debug(`[get Affiliation based price on Product Collection]Error executing action`);\n throw new Error('[get Affiliation based price on Product Collection]Error executing action');\n });\n }\n}\n\nexport default ProductCollection;\n","import { getPayloadObject, getTelemetryAttributes, IPayLoad, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\nimport { debounce } from 'lodash';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\nimport { IQuantityProps } from './Quantity.props';\n\ninterface IQuantityState {\n currentInput: number;\n isUpdateing: boolean;\n}\n/**\n * Quantity Component - This component is used to add or remove quantity\n */\n@observer\nexport default class Quantity extends React.PureComponent<IQuantityProps, IQuantityState> {\n public static defaultProps: Partial<IQuantityProps> = {\n min: 1,\n decrementGlyphClass: 'fas fa-minus',\n incrementGlyphClass: 'fas fa-plus'\n };\n\n private inputRef: React.RefObject<HTMLInputElement> = React.createRef<HTMLInputElement>();\n private payLoad: IPayLoad;\n\n constructor(props: IQuantityProps) {\n super(props);\n this.state = { currentInput: props.currentCount || 1, isUpdateing: false };\n this._onIncrement = this._onIncrement.bind(this);\n this._onDecrement = this._onDecrement.bind(this);\n this._handleChange = this._handleChange.bind(this);\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, '');\n }\n\n public componentDidUpdate(prevProps: IQuantityProps): void {\n if (!this.props.disabled && this.state.currentInput !== this.props.currentCount && prevProps.currentCount !== this.props.currentCount) {\n this.setState({ currentInput: this.props.currentCount || 1});\n }\n\n if (this.props.disabled && !this.state.isUpdateing) {\n this.setState({ isUpdateing: true });\n }\n\n if (!this.props.disabled && this.state.isUpdateing) {\n this.setState({ currentInput: this.props.currentCount || 1, isUpdateing: false });\n }\n }\n\n public render(): JSX.Element {\n const {\n min,\n max,\n } = this.props;\n\n const glyphMinusClassName: string = `${this.props.decrementGlyphClass!} quantity__controls-glyph`;\n const glyphPlusClassName: string = `${this.props.incrementGlyphClass!} quantity__controls-glyph`;\n const decrementDisabled = this.state.currentInput <= (min || 1) || this.props.isGiftCard;\n const incrementDisabled = this.state.currentInput >= max || this.props.isGiftCard;\n const currentValue = this.state.currentInput;\n this.payLoad.contentAction.etext = TelemetryConstant.DecrementQuantity;\n const decrementAttributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n this.payLoad.contentAction.etext = TelemetryConstant.IncrementQuantity;\n const incrementAttributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n\n let extraClassDecrement = '';\n if(decrementDisabled) {\n // The quantity has reached its boundaries (max or min)\n extraClassDecrement ='disabled';\n\n } else if(this.props.disabled) {\n // this.props.disabled shows if the state is not succeded yet\n extraClassDecrement = 'transition';\n }\n let extraClassIncrement = '';\n if(incrementDisabled) {\n // The quantity has reached its boundaries (max or min)\n extraClassIncrement ='disabled';\n } else if(this.props.disabled) {\n // this.props.disabled shows if the state is not succeded yet\n extraClassIncrement = 'transition';\n }\n\n return (\n <>\n <div className='quantity' id={this.props.id}>\n <button\n disabled={this.props.disabled || decrementDisabled}\n title= {decrementDisabled ? '' : this.props.decrementButtonAriaLabel}\n className={`decrement quantity__controls ${extraClassDecrement}`}\n onClick={this._onDecrement}\n aria-hidden={true}\n aria-label={`${this.props.decrementButtonAriaLabel}`}\n tabIndex={-1}\n color={'secondary'}\n {...decrementAttributes}\n >\n <span className={glyphMinusClassName} />\n </button>\n <input\n type='number'\n className='quantity-input'\n pattern='[0-9]*'\n value={this.state.currentInput}\n onChange={this._handleChange}\n onBlur={this._validateMin}\n aria-live='polite'\n aria-label={`${this.props.inputQuantityAriaLabel}`}\n role='spinbutton'\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={currentValue}\n ref={this.inputRef}\n disabled={this.props.disabled}\n />\n <button\n disabled={this.props.disabled || incrementDisabled}\n title={incrementDisabled ? '' : this.props.incrementButtonAriaLabel}\n className={`increment quantity__controls ${extraClassIncrement}`}\n onClick={this._onIncrement}\n aria-hidden={true}\n aria-label={`${this.props.incrementButtonAriaLabel}`}\n tabIndex={-1}\n color={'secondary'}\n {...incrementAttributes}\n >\n <span className={glyphPlusClassName} />\n </button>\n </div>\n </>\n );\n }\n\n private _onIncrement(): void {\n let invokeCallback = false;\n const currQuantity = this.state.currentInput;\n let updatedQuantity: number;\n\n if (currQuantity < this.props.max) {\n invokeCallback = true;\n updatedQuantity = currQuantity + 1 ;\n } else {\n invokeCallback = false;\n updatedQuantity = this.props.max;\n }\n\n if(invokeCallback && this.props.onChange) {\n if(this.props.onChange(updatedQuantity)) {\n this.setState({ currentInput: updatedQuantity });\n }\n }\n }\n\n private _onDecrement(): void {\n let invokeCallback = false;\n const currQuantity = this.state.currentInput;\n let updatedQuantity: number;\n\n if (currQuantity > 1) {\n invokeCallback = true;\n updatedQuantity = currQuantity - 1;\n } else {\n invokeCallback = false;\n updatedQuantity = 1;\n }\n\n if(invokeCallback && this.props.onChange) {\n if(this.props.onChange(updatedQuantity)) {\n this.setState({ currentInput: updatedQuantity });\n }\n }\n }\n\n private _handleChange(e: React.ChangeEvent<HTMLInputElement>): void {\n const currentValue = parseInt((e.target.value), 10);\n const minValue = this.props.min === undefined ? 1 : this.props.min;\n const inputElement = this.inputRef && this.inputRef.current && this.inputRef.current instanceof HTMLInputElement && this.inputRef.current;\n\n if (currentValue > this.props.max) {\n this.setState(\n { currentInput: this.props.max },\n () => {\n debounce(\n () => {\n // due of usage debouncer, we may ignore onChange return value\n this.props.onChange && this.props.onChange(this.state.currentInput);\n },\n 200)();\n }\n );\n } else {\n this.setState(\n { currentInput: currentValue },\n () => {\n debounce(\n () => {\n if(!isNaN(this.state.currentInput) && !(this.state.currentInput < minValue)) {\n // due of usage debouncer, we may ignore onChange return value\n this.props.onChange && this.props.onChange(this.state.currentInput);\n\n if (inputElement) {\n inputElement.setAttribute('aria-valuenow', currentValue.toString());\n inputElement.setAttribute('value', currentValue.toString());\n }\n }\n },\n 200)();\n }\n );\n }\n }\n\n private _validateMin = (): void => {\n const minValue = this.props.min === undefined ? 1 : this.props.min;\n if(isNaN(this.state.currentInput) || (this.state.currentInput < minValue)) {\n this.setState({ currentInput: minValue }, () => { this.props.onChange && this.props.onChange(this.state.currentInput); });\n } else {\n this.props.onChange && this.props.onChange(this.state.currentInput);\n }\n }\n}","import { debounce } from 'lodash';\nimport { reaction } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\ninterface IQuantityProps {\n min?: number;\n max: number;\n currentCount?: number;\n disabled?: boolean;\n incrementGlyphClass?:string;\n decrementGlyphClass?:string;\n decrementButtonAriaLabel?: string;\n incrementButtonAriaLabel?: string;\n inputQuantityAriaLabel?: string;\n id?: string;\n onChange?(newValue: number):void;\n}\n\ninterface IQuantityState {\n currentInput: number;\n}\n/**\n * Quantity Component - This component is used to add or remove quantity\n */\n@observer\nexport default class OrderTemplateQuantity extends React.PureComponent<IQuantityProps, IQuantityState> {\n public static defaultProps: Partial<IQuantityProps> = {\n min: 1,\n decrementGlyphClass: 'fas fa-minus',\n incrementGlyphClass: 'fas fa-plus'\n };\n\n private inputRef: React.RefObject<HTMLInputElement> = React.createRef<HTMLInputElement>();\n\n constructor(props: IQuantityProps) {\n super(props);\n this.state = { currentInput: props.currentCount || 1 };\n this._handleChange = this._handleChange.bind(this);\n\n reaction(\n () => this.props.currentCount,\n () => {\n this.setState({ currentInput: this.props.currentCount || 1 });\n }\n );\n }\n\n public render(): JSX.Element {\n const glyphMinusClassName: string = `${this.props.decrementGlyphClass!} quantity__controls-glyph`;\n const glyphPlusClassName: string = `${this.props.incrementGlyphClass!} quantity__controls-glyph`;\n const disabled = this.props.currentCount === this.props.min;\n const incDisabled = this.props.currentCount === this.props.max;\n const currentValue = this.state.currentInput;\n let extraClass = '';\n if(disabled) {\n // The quantity has reached its boundaries (max or min)\n extraClass ='disabled';\n\n } else if(this.props.disabled) {\n // this.props.disabled shows if the state is not succeded yet\n extraClass = 'transition';\n }\n const getChangeHandler = (amount: number) => () => this._onIncrementalChange(amount);\n\n return (\n <div className='quantity'/* id={this.props.id}*/>\n <button\n disabled={this.props.disabled || disabled}\n title= {disabled ? '' : this.props.decrementButtonAriaLabel}\n className={`decrement quantity__controls ${extraClass}`}\n onClick={getChangeHandler(-1)}\n aria-hidden={true}\n aria-label={`${this.props.decrementButtonAriaLabel}`}\n tabIndex={-1}\n color={'secondary'}\n >\n <span className={glyphMinusClassName} />\n </button>\n <input\n type='number'\n className='quantity-input'\n pattern='[0-9]*'\n value={currentValue}\n onChange={this._handleChange}\n onBlur={this._validateMin}\n aria-live='polite'\n aria-label={`${this.props.inputQuantityAriaLabel}`}\n role='spinbutton'\n aria-valuemin={1}\n aria-valuemax={this.props.max}\n aria-valuenow={currentValue}\n ref={this.inputRef}\n disabled={this.props.disabled}\n />\n <button\n disabled={this.props.disabled || incDisabled}\n title={incDisabled ? '' : this.props.incrementButtonAriaLabel}\n className={`increment quantity__controls ${incDisabled ? 'disabled' : ''}`}\n onClick={getChangeHandler(1)}\n aria-hidden={true}\n aria-label={`${this.props.incrementButtonAriaLabel}`}\n tabIndex={-1}\n color={'secondary'}\n >\n <span className={glyphPlusClassName} />\n </button>\n </div>\n );\n }\n\n private _onIncrementalChange(amount: number): void {\n const updatedQuantity = this.state.currentInput + amount;\n\n if (updatedQuantity >= 1 && updatedQuantity <= this.props.max) {\n this.props.onChange && this.props.onChange(updatedQuantity);\n }\n }\n\n private _handleChange(e: React.ChangeEvent<HTMLInputElement>): void {\n const currentValue = parseInt((e.target.value), 10);\n const minValue = this.props.min === undefined ? 1 : this.props.min;\n const inputElement = this.inputRef && this.inputRef.current && this.inputRef.current instanceof HTMLInputElement && this.inputRef.current;\n\n if (currentValue > this.props.max) {\n this.setState(\n { currentInput: this.props.max },\n () => {\n debounce(\n () => {\n this.props.onChange && this.props.onChange(this.state.currentInput);\n },\n 200)();\n }\n );\n } else {\n this.setState(\n { currentInput: currentValue },\n () => {\n debounce(\n () => {\n if(!isNaN(this.state.currentInput) && !(this.state.currentInput < minValue)) {\n this.props.onChange && this.props.onChange(this.state.currentInput);\n\n if (inputElement) {\n inputElement.setAttribute('aria-valuenow', currentValue.toString());\n inputElement.setAttribute('value', currentValue.toString());\n }\n }\n },\n 200)();\n }\n );\n }\n }\n\n private _validateMin = (): void => {\n const minValue = this.props.min === undefined ? 1 : this.props.min;\n\n if (isNaN(this.state.currentInput) || (this.state.currentInput < minValue)) {\n this.props.onChange && this.props.onChange(minValue);\n } else {\n this.props.onChange && this.props.onChange(this.state.currentInput);\n }\n }\n}","import { getFallbackImageUrl } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport { PriceComponent } from '@msdyn365-commerce/components';\nimport { ICoreContext, IImageSettings, Image, ITelemetry } from '@msdyn365-commerce/core';\nimport { ProductListLine } from '@msdyn365-commerce/retail-proxy';\nimport { ProductPrice, SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport React, { useState } from 'react';\nimport { IOrderTemplateLineViewModel } from '../order-template';\nimport OrderTemplateQuantity from './common/order-template-quantity';\n\nexport interface IOrderTemplateLineProps extends ProductListLine {\n orderTemplateLine: IOrderTemplateLineViewModel;\n productListLine: ProductListLine;\n price?: ProductPrice;\n context: ICoreContext;\n productUrl: string;\n imageSettings?: IImageSettings;\n telemetry: ITelemetry;\n moduleId: string;\n moduleTypeName: string;\n quantity: number;\n handlers: {\n onAddToBag(product: SimpleProduct, quantity: number, itemKey: string): void;\n onRemoveItem(line: IOrderTemplateLineViewModel): void | undefined;\n onChangeQuantity(orderTemplateLineId: string, quantity: number, props?: IOrderTemplateLineProps): void;\n onSelect(line: IOrderTemplateLineViewModel, isChecked: boolean): void;\n };\n resources: {\n productDimensionTypeColor: string;\n productDimensionTypeSize: string;\n productDimensionTypeStyle: string;\n originalPriceText: string;\n currentPriceText: string;\n freePriceText: string;\n inputQuantityAriaLabel: string;\n removeFromOrderTemplateLinesText: string;\n addToBagButtonText: string;\n deleteButtonText: string;\n };\n index: number;\n isMobile: boolean;\n productQuantityView?: React.ReactNode;\n addToBagButton?: React.ReactNode;\n removeButton?: React.ReactNode;\n toggleDetailsDisplayed(props: IOrderTemplateLineProps): void;\n}\n\nexport interface IOrderTemplateLineViewProps {\n key?: string;\n productImage: React.ReactNode;\n productPrice?: React.ReactNode;\n addToBagButton?: React.ReactNode;\n removeButton?: React.ReactNode;\n productName?: string;\n productNumber?: React.ReactNode;\n productInfo?: React.ReactNode;\n productLabel?: React.ReactNode;\n productUnitOfMeasure?: React.ReactNode;\n productQuantity?: number;\n productQuantityView?: React.ReactNode;\n productListId?: string;\n selectLine?: React.ReactNode;\n popUp?: JSX.Element;\n isMobile?: boolean;\n}\n\ninterface IEventHandlerFactory {\n getAddToBag(): (event: React.MouseEvent<HTMLElement>) => void;\n getRemoveItem(): (event: React.MouseEvent<HTMLElement>) => void;\n}\n\nconst OrderTemplateLineActions = (props: IOrderTemplateLineProps): IEventHandlerFactory => {\n const { orderTemplateLine, productListLine, quantity, handlers } = props;\n const { LineId } = productListLine;\n const { onAddToBag, onRemoveItem } = handlers;\n\n return {\n getAddToBag: () => (event: React.MouseEvent<HTMLElement>) => LineId && orderTemplateLine.fullProduct && onAddToBag(orderTemplateLine.fullProduct.ProductDetails, quantity, LineId),\n getRemoveItem: () => (event: React.MouseEvent<HTMLElement>) => LineId && onRemoveItem(props.orderTemplateLine)\n };\n};\n\ninterface IPopupProps extends IOrderTemplateLineProps {\n addButtonClassName: string;\n removeButtonClassName: string;\n}\n\nconst PopUp = (props: IPopupProps): JSX.Element | null => {\n const { addToBagButtonText, removeFromOrderTemplateLinesText } = props.resources;\n const [ showMobile, setShowMobile ] = useState(false);\n const componentClassName = 'ms-table';\n\n const getViewHandler = () => (event: React.MouseEvent<HTMLElement>) => {\n props.toggleDetailsDisplayed(props);\n };\n\n const toggle = (event: React.MouseEvent) => {\n setShowMobile(!showMobile);\n };\n const viewTitle = 'View product details';\n\n return (\n <div className={`${componentClassName}__row-links-minified`}>\n {<Button className={`${componentClassName}__row-links-toggle`} data-type={props.index} onClick={toggle}/>}\n {showMobile &&\n <div className={`${componentClassName}__row-links`}>\n <Button\n className='ms-table__row-links-view'\n onClick={getViewHandler()}\n title={viewTitle}\n >View\n </Button>\n {getActionButton(true, props.removeButtonClassName, props.isMobile ? removeFromOrderTemplateLinesText : '', OrderTemplateLineActions(props).getRemoveItem())}\n {getActionButton(true, props.addButtonClassName, props.isMobile ? addToBagButtonText : '', OrderTemplateLineActions(props).getAddToBag())}\n </div>}\n </div>\n );\n};\n\nconst getActionButton = (isMobile: boolean, className: string, buttonText: string, clickHandler: (event: React.MouseEvent<HTMLElement>) => void): React.ReactNode => (\n <Button\n className={className}\n onClick={clickHandler}\n title={buttonText}\n >{buttonText}\n </Button>\n);\n\nexport const OrderTemplateLineView = (input: IOrderTemplateLineProps): IOrderTemplateLineViewProps | null => {\n const { orderTemplateLine, productListLine, price, context, imageSettings, quantity, resources, isMobile } = input;\n const product = orderTemplateLine.fullProduct;\n const { LineId, UnitOfMeasure } = productListLine;\n const { removeFromOrderTemplateLinesText, addToBagButtonText } = resources;\n if (!product) {\n return null;\n }\n\n const onSelectLine = (event: React.ChangeEvent<HTMLInputElement>) => {\n orderTemplateLine.isChecked = !orderTemplateLine.isChecked;\n\n input.handlers.onSelect(orderTemplateLine, event.target.checked);\n };\n const { ItemId, Name, PrimaryImageUrl } = product.ProductDetails;\n const fallbackImage = getFallbackImageUrl(ItemId, context.actionContext.requestContext.apiSettings);\n const addButtonClassName = input.isMobile ? 'ms-table__row-links-add' : 'ms-order-template-table-line__product-add-button';\n const removeButtonClassName = input.isMobile ? 'ms-table__row-links-delete' : 'ms-order-template-table-line__product-remove-button';\n\n return {\n isMobile: isMobile,\n selectLine: (\n <label className='checkbox-container'>\n <input type='checkbox' checked={orderTemplateLine.isChecked} aria-checked={orderTemplateLine.isChecked} onChange={onSelectLine}/>\n <span className='checkmark'/>\n </label>\n ),\n key: LineId!,\n productImage: PrimaryImageUrl && Name && (\n _renderProductImage('ms-order-template-table-line__product-image', context, product. ProductDetails.Name!, PrimaryImageUrl, fallbackImage, imageSettings)\n ),\n productInfo: renderProductInfo(input),\n productPrice: price && _renderPrice(input),\n productNumber: product && <div className='ms-order-template-table-line__product-number'>{ItemId}</div>,\n productUnitOfMeasure: price ? (\n <div className='ms-order-template-table-line__product-unit-of-measure'>{UnitOfMeasure || price.UnitOfMeasure}</div>\n ) : (\n undefined\n ),\n productListId: LineId!,\n removeButton: getActionButton(true, removeButtonClassName, input.isMobile ? removeFromOrderTemplateLinesText : '', OrderTemplateLineActions(input).getRemoveItem()),\n productQuantityView: <div>{_generateQuantity(input, LineId!)}</div>,\n productQuantity: quantity,\n addToBagButton: getActionButton(true, addButtonClassName, input.isMobile ? addToBagButtonText : '', OrderTemplateLineActions(input).getAddToBag()),\n popUp: (\n <PopUp\n {...input}\n addButtonClassName={addButtonClassName}\n removeButtonClassName={removeButtonClassName}\n />\n )\n };\n};\n\nexport const OrderTemplateMobileLineView = (input: IOrderTemplateLineProps): IOrderTemplateLineViewProps | undefined => {\n const { orderTemplateLine, productListLine, price, context, imageSettings } = input;\n const product = orderTemplateLine.fullProduct;\n const { LineId, UnitOfMeasure } = productListLine;\n if (!product) {\n return;\n }\n const { ItemId, Name, PrimaryImageUrl } = product.ProductDetails;\n const fallbackImage = getFallbackImageUrl(ItemId, context.actionContext.requestContext.apiSettings);\n\n return {\n productImage: PrimaryImageUrl && Name && (\n _renderProductImage('thumbnail', context, product. ProductDetails.Name!, PrimaryImageUrl, fallbackImage, imageSettings)\n ),\n productInfo: renderProductInfo(input),\n productPrice: price && _renderPrice(input),\n productNumber: ItemId,\n productUnitOfMeasure: UnitOfMeasure || price?.UnitOfMeasure,\n productQuantityView: _generateQuantity(input, LineId!)\n };\n};\n\nexport interface IOrderTemplateProductQuantityViewProps {\n ContainerProps: INodeProps;\n input: React.ReactNode;\n}\n\nconst _generateQuantity = (props: IOrderTemplateLineProps, itemKey: string): React.ReactNode => {\n const { handlers, resources, quantity } = props;\n const { onChangeQuantity } = handlers;\n const onChange = (newValue: number) => {\n if (onChangeQuantity) {\n onChangeQuantity(itemKey, newValue, props);\n }\n };\n return (\n <OrderTemplateQuantity\n currentCount={quantity}\n onChange={onChange}\n max={Number.MAX_VALUE}\n inputQuantityAriaLabel={resources.inputQuantityAriaLabel}\n />\n );\n};\n\nexport const _renderProductImage = (\n className: string,\n context: ICoreContext,\n heading: string,\n image?: string,\n fallbackImage?: string,\n imageSettings?: IImageSettings\n): JSX.Element | null => {\n const defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: `w=64&h=64&m=6`, w: 0, h: 0 },\n lg: { q: `w=64&h=64&m=6`, w: 0, h: 0 },\n xl: { q: `w=64&h=64&m=6`, w: 0, h: 0 }\n },\n lazyload: true\n };\n\n if (image) {\n return (\n <Image\n className={className}\n altText={heading}\n title={heading}\n src={image}\n fallBackSrc={fallbackImage}\n gridSettings={context.request.gridSettings!}\n imageSettings={imageSettings || defaultImageSettings}\n loadFailureBehavior='empty'\n />\n );\n }\n return null;\n};\n\nconst _renderPrice = (props: IOrderTemplateLineProps): JSX.Element | null => {\n const { price, context, moduleId, moduleTypeName, resources } = props;\n\n if (price) {\n return (\n <PriceComponent\n id={moduleId}\n typeName={moduleTypeName}\n data={{ price: price }}\n className='ms-order-template-table-line__product-price'\n freePriceText={resources.freePriceText}\n originalPriceText={resources.originalPriceText}\n currentPriceText={resources.currentPriceText}\n context={context}\n />\n );\n }\n return null;\n};\n\nconst _renderProductDimensions = (props: IOrderTemplateLineProps): (string | undefined)[] => {\n const { orderTemplateLine } = props;\n\n if (!orderTemplateLine.fullProduct || !orderTemplateLine.fullProduct.ProductDetails.Dimensions) {\n return [];\n }\n\n return orderTemplateLine.fullProduct.ProductDetails.Dimensions.map((dimension) => {\n if (!dimension.DimensionValue || !dimension.DimensionValue.Value) {\n return undefined;\n }\n\n return dimension.DimensionValue.Value;\n });\n};\n\nexport const renderProductInfo = (props: IOrderTemplateLineProps): React.ReactNode | undefined => {\n const { orderTemplateLine, productUrl } = props;\n const name = orderTemplateLine.fullProduct?.ProductDetails.Name;\n\n const dimensions = _renderProductDimensions(props);\n if (!orderTemplateLine.fullProduct || !orderTemplateLine.fullProduct.ProductDetails.Dimensions) {\n return [];\n }\n\n const productName = productUrl ? (\n <a className='ms-order-template-table-line__product-info-name' href={productUrl}>\n {name}\n </a>\n ) : (\n <div className='ms-order-template-table-line__product-info-name'>{name}</div>\n );\n\n return (\n <div className='ms-order-template-table-line__product-info'>\n <div className='ms-order-template-table-line__product-info-name'>{productName}</div>\n <div className='ms-order-template-table-line__product-info-dimension'>\n {dimensions.length && dimensions.join(', ')}\n </div>\n </div>\n );\n};\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport classnames from 'classnames';\nimport * as React from 'react';\nimport { orderTemplateLinesStatus } from '../order-template';\n\nexport interface IOrderTemplateLinesStatusMessageProps {\n className?: string;\n errorType: orderTemplateLinesStatus;\n text?: string;\n}\n\nexport const OrderTemplateLinesStatusMessage: React.FC<IOrderTemplateLinesStatusMessageProps> = ({className, errorType, text}) => {\n switch(errorType) {\n case 'EMPTY':\n return (\n <p className={classnames('ms-order-template-lines__message-empty', className)}>{ text }</p>\n );\n case 'FAILED':\n return (\n <p className={classnames('ms-order-template-lines__message-failed', className)}>{ text }</p>\n );\n case 'LOADING':\n default:\n return (\n <p className='ms-order-template-lines__message-waiting'>{ text }</p>\n );\n }\n};\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as React from 'react';\nimport { IOrderTemplateLineViewModel } from '../order-template';\n\nexport interface IOrderTemplateTableHeadingProps {\n productNumber: string;\n productName: string;\n productUnitPrice: string;\n productUOM: string;\n productQuantity: string;\n productActions: string;\n lines: IOrderTemplateLineViewModel[];\n isMobile: boolean;\n clickHandler(isChecked: boolean): void;\n}\n\nexport interface IOrderTemplateTableShortHeading {\n productNumber: string;\n productActions: string;\n}\n\n/**\n * Order Template's table heading\n */\nexport class OrderTemplateTableHeading extends React.PureComponent<IOrderTemplateTableHeadingProps> {\n public state: {\n isChecked: boolean;\n } = {\n isChecked: false\n };\n\n private componentClassName: string = 'ms-table';\n\n public componentDidUpdate(prevProps: IOrderTemplateTableHeadingProps): void {\n this.setState({\n isChecked: !this.props.lines.filter(line => !line.isChecked).length\n });\n }\n\n public getOnChange = () => (event: React.ChangeEvent<HTMLInputElement>) => {\n this.setState({\n isChecked: !this.state.isChecked\n }, () => {// tslint:disable-line:align\n this.props.clickHandler(this.state.isChecked);\n });\n };\n\n public render(): JSX.Element {\n return (\n <thead>\n <tr className={`${this.componentClassName}__heading-row`}>\n <th>\n <label className='checkbox-container'>\n <input type='checkbox' aria-checked={this.state.isChecked} checked={this.state.isChecked} onChange={this.getOnChange()}/>\n <span className='checkmark'/>\n </label>\n </th>\n <th/>\n <th>{this.props.productNumber}</th>\n {!this.props.isMobile ? <th>{this.props.productName}</th> : null}\n {!this.props.isMobile ? <th>{this.props.productUnitPrice}</th> : null}\n {!this.props.isMobile ? <th>{this.props.productUOM}</th> : null}\n {!this.props.isMobile ? <th>{this.props.productQuantity}</th> : null}\n {!this.props.isMobile ? <th>{this.props.productActions}</th> : <td/>}\n </tr>\n </thead>\n );\n }\n}","\nimport { OrderTemplate } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport { AddOrderTemplateToCartComponent, ILinesAddedToCartDialogResources, IOrderTemplateNameDialogResources, RenameOrderTemplateComponent } from '@msdyn365-commerce/components';\nimport { IComponentProps, ICoreContext } from '@msdyn365-commerce/core';\nimport { ProductList } from '@msdyn365-commerce/retail-proxy';\nimport * as React from 'react';\n\nexport interface IOrderTemplateActionsData {\n orderTemplate: OrderTemplate;\n}\n\nexport interface IOrderTemplateActionsProps extends IComponentProps<IOrderTemplateActionsData> {\n context: ICoreContext;\n telemetryContent?: ITelemetryContent;\n handlers: {\n onRemoveTemplate(orderTemplateId: string): void;\n onRenameTemplate(orderTemplate: ProductList): Promise<void>;\n };\n renameOrderTemplateDialogStrings: IOrderTemplateNameDialogResources;\n resources: {\n addTemplateToBagButtonText: string;\n renameTemplateButtonText: string;\n deleteTemplateButtonText: string;\n closeWindowButtonText: string;\n addToCartFailureMessage: string;\n addToCartSuccessMessage: string;\n addToCartProcessMessage: string;\n linesAddedToCartDialogResources: ILinesAddedToCartDialogResources;\n };\n}\n\nexport interface IOrderTemplateActionsViewProps {\n addTemplateToBag: React.ReactNode;\n renameTemplate?: React.ReactNode;\n removeTemplate?: React.ReactNode;\n}\n\nexport const OrderTemplateActionsView = (props: IOrderTemplateActionsProps): IOrderTemplateActionsViewProps => {\n const { resources } = props;\n const { deleteTemplateButtonText } = resources;\n\n const removeOrderAction = (event: React.MouseEvent<HTMLElement>) => {\n return _removeOrderTemplate(props);\n };\n\n return {\n addTemplateToBag: _getOrderTemplateAddToCartDialog(props),\n renameTemplate: _getOrderTemplateRenameControl(props),\n removeTemplate: (\n <Button className='ms-order-template-action-bar__delete-template-button' onClick={removeOrderAction}>\n {deleteTemplateButtonText}\n </Button>\n )\n };\n};\n\nconst _removeOrderTemplate = (props: IOrderTemplateActionsProps): void => {\n const { data: { orderTemplate }, handlers } = props;\n const { onRemoveTemplate } = handlers;\n\n if (onRemoveTemplate) {\n onRemoveTemplate(orderTemplate.productList.Id);\n }\n};\n\nconst _getOrderTemplateAddToCartDialog = (props: IOrderTemplateActionsProps): React.ReactNode => {\n const { data: { orderTemplate }, typeName, id, context, telemetryContent, resources } = props;\n const {\n addTemplateToBagButtonText,\n closeWindowButtonText,\n addToCartFailureMessage,\n addToCartSuccessMessage,\n addToCartProcessMessage,\n linesAddedToCartDialogResources\n } = resources;\n\n const dialogStrings = {\n closeWindowButtonText: closeWindowButtonText,\n addToCartFailureMessage: addToCartFailureMessage,\n addToCartSuccessMessage: addToCartSuccessMessage,\n addToCartProcessMessage: addToCartProcessMessage,\n linesAddedToCartDialogResources: linesAddedToCartDialogResources\n };\n\n return (\n <AddOrderTemplateToCartComponent\n context={context}\n id={id}\n typeName={typeName}\n data={{orderTemplate}}\n className=''\n addToCartText={addTemplateToBagButtonText}\n dialogStrings={dialogStrings}\n telemetryContent={telemetryContent}\n />\n );\n};\n\nconst _getOrderTemplateRenameControl = (props: IOrderTemplateActionsProps): React.ReactNode => {\n const { renameOrderTemplateDialogStrings, resources, context, handlers } = props;\n return (\n <RenameOrderTemplateComponent\n onRenameTemplate={handlers.onRenameTemplate}\n className={'msc-order-template-name-dialog'}\n context={context}\n id={props.id}\n data={{orderTemplate: props.data.orderTemplate.productList}}\n typeName={props.typeName}\n renameOrderTemplateDialogStrings={renameOrderTemplateDialogStrings}\n renameOrderTemplateButtonText={resources.renameTemplateButtonText}\n />\n );\n};","import { Button } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\nimport { AddLineToTemplate } from '.';\nimport { IOrderTemplateLineViewModel } from '../order-template';\nimport { IOrderTemplateData } from '../order-template.data';\nimport { IOrderTemplateProps } from '../order-template.props.autogenerated';\n\ninterface IOrderTemplateBulkActionsProps extends IOrderTemplateProps<IOrderTemplateData> {\n orderTemplateId: string;\n selectedLines: IOrderTemplateLineViewModel[];\n isMinifiedView: boolean;\n onAddSelectionToBag(): void;\n onRemoveSelection(): void;\n}\n\ninterface IOrderTemplateBulkActionsState {\n isAddDisabled: boolean;\n isRemoveDisabled: boolean;\n}\n\n/**\n * Bulk Order Template line actions\n */\nexport class OrderTemplateBulkActions extends React.PureComponent<IOrderTemplateBulkActionsProps, IOrderTemplateBulkActionsState> {\n\n public state: IOrderTemplateBulkActionsState = {\n isAddDisabled: true,\n isRemoveDisabled: true\n };\n\n public componentDidUpdate(prevProps: IOrderTemplateBulkActionsProps): void {\n if (prevProps.selectedLines.length !== this.props.selectedLines.length) {\n this.setState({\n isAddDisabled: !this.props.selectedLines.length,\n isRemoveDisabled: !this.props.selectedLines.length\n });\n }\n }\n\n public render(): JSX.Element {\n const { addLineModalLinkText,\n searchButtonAriaLabel,\n searchInputAriaLabel,\n searchModalPlaceholderText,\n selectProductButtonText,\n addItemToTemplateText,\n addLineProductUnitPricePrefix,\n backButtonText,\n decrementButtonAriaLabel,\n incrementButtonAriaLabel,\n quantitySelectLabel,\n addLineProductUnitOfMeasurePrefix,\n notFoundSearchErrorNotice,\n notFoundSearchErrorRedediation,\n searchErrorMessage,\n productDimensionTypeColor,\n productDimensionTypeConfiguration,\n productDimensionTypeSize,\n productDimensionTypeStyle,\n addSelectedToBagButtonText,\n removeSelectedToBagButtonText,\n searchResultsCountVerbage,\n searchResultsCountSubject,\n addToTemplateConfirmation,\n totalPriceLabel,\n progressNotificationText,\n addToTemplateDuplicateError,\n addToTemplateGenericError,\n dimensionMissingError,\n } = this.props.resources;\n const addLineProps = {\n context: this.props.context,\n resources: {\n addLineModalLinkText,\n searchButtonAriaLabel,\n searchInputAriaLabel,\n searchModalPlaceholderText,\n selectProductButtonText,\n addItemToTemplateText,\n addLineProductUnitPricePrefix,\n backButtonText,\n decrementButtonAriaLabel,\n incrementButtonAriaLabel,\n quantitySelectLabel,\n addLineProductUnitOfMeasurePrefix,\n notFoundSearchErrorNotice,\n notFoundSearchErrorRedediation,\n searchErrorMessage,\n productDimensionTypeColor,\n productDimensionTypeConfiguration,\n productDimensionTypeSize,\n productDimensionTypeStyle,\n searchResultsCountVerbage,\n searchResultsCountSubject,\n addToTemplateConfirmation,\n totalPriceLabel,\n progressNotificationText,\n addToTemplateDuplicateError,\n addToTemplateGenericError,\n dimensionMissingError\n },\n imageSettings: this.props.config.imageSettings,\n orderTemplateId: this.props.orderTemplateId\n };\n\n return (\n <>\n <AddLineToTemplate {...addLineProps}/>\n <Button\n onClick={this.addHandler}\n disabled={this.state.isAddDisabled}\n className='add-selected-to-bag'\n aria-label={addSelectedToBagButtonText}\n >\n <span/>{!this.props.isMinifiedView && addSelectedToBagButtonText}\n </Button>\n <Button\n onClick={this.removeHandler}\n disabled={this.state.isRemoveDisabled}\n className='remove-selected'\n aria-label={removeSelectedToBagButtonText}\n >\n <span/>{!this.props.isMinifiedView && removeSelectedToBagButtonText}\n </Button>\n </>\n );\n }\n\n private addHandler = (event: React.MouseEvent<HTMLElement>) => {\n this.setState({\n isAddDisabled: true\n });\n\n this.props.onAddSelectionToBag();\n\n this.setState({\n isAddDisabled: false\n });\n };\n\n private removeHandler = (event: React.MouseEvent<HTMLElement>) => {\n this.setState({\n isRemoveDisabled: true\n });\n\n this.props.onRemoveSelection();\n };\n}","import {\n addItemToOrderTemplate,\n AddItemToOrderTemplateInput,\n getDimensionsForSelectedVariant,\n GetDimensionsForSelectedVariantInput,\n getSelectedVariant,\n SelectedVariantInput\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, Modal, ModalBody, ModalHeader } from '@msdyn365-commerce-modules/utilities';\nimport { ProductDimensionFull } from '@msdyn365-commerce/commerce-entities';\nimport { ICoreContext, IImageSettings } from '@msdyn365-commerce/core';\nimport { ProductListLine, ProductSearchCriteria, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\nimport { searchByCriteriaAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { get } from 'lodash';\nimport { computed } from 'mobx';\nimport React from 'react';\nimport { IProductConfigurationState, NotFoundComponent, ProductConfiguration, ProductList } from './';\n\nimport Spinner from './spinner';\n\nexport interface IAddLineToTemplateProps {\n context: ICoreContext;\n resources: IAddLineToTemplateResources;\n orderTemplateId: string;\n imageSettings?: IImageSettings;\n}\n\nexport interface IAddLineToTemplateResources {\n addLineModalLinkText: string;\n searchButtonAriaLabel: string;\n searchInputAriaLabel: string;\n searchModalPlaceholderText: string;\n selectProductButtonText: string;\n addItemToTemplateText: string;\n addLineProductUnitPricePrefix: string;\n backButtonText: string;\n decrementButtonAriaLabel: string;\n incrementButtonAriaLabel: string;\n quantitySelectLabel: string;\n addLineProductUnitOfMeasurePrefix: string;\n notFoundSearchErrorNotice: string;\n notFoundSearchErrorRedediation: string;\n searchErrorMessage: string;\n productDimensionTypeColor: string;\n productDimensionTypeConfiguration: string;\n productDimensionTypeSize: string;\n productDimensionTypeStyle: string;\n searchResultsCountVerbage: string;\n searchResultsCountSubject: string;\n addToTemplateConfirmation: string;\n totalPriceLabel: string;\n progressNotificationText: string;\n addToTemplateDuplicateError: string;\n addToTemplateGenericError: string;\n dimensionMissingError: string;\n}\n\nenum CONTENT {\n Search,\n ProductList,\n ProductConfiguration,\n NotFound,\n Error,\n Loading\n}\n\ninterface IAddLineToTemplateState {\n isOpen: boolean;\n query: string;\n products: ProductSearchResult[];\n content: number;\n selectedProduct: SimpleProduct | null;\n selectedProductDimensions?: ProductDimensionFull[];\n selectedQuantity?: number;\n reloadPage?: boolean;\n}\n\n/**\n * Add Lines to order template\n */\nexport class AddLineToTemplate extends React.Component<IAddLineToTemplateProps, IAddLineToTemplateState> {\n public state: IAddLineToTemplateState = {\n isOpen: false,\n query: '',\n products: [],\n content: CONTENT.Search,\n selectedProduct: null,\n };\n public defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: `w=64&h=64&m=6`, w: 0, h: 0 },\n lg: { q: `w=64&h=64&m=6`, w: 0, h: 0 },\n xl: { q: `w=64&h=64&m=6`, w: 0, h: 0 }\n },\n lazyload: true\n };\n public searchTextInput: React.RefObject<HTMLInputElement> = React.createRef();// @TODO public/private\n\n constructor(props: IAddLineToTemplateProps) {\n super(props);\n }\n\n public onComponentDidMount(): void {\n this.searchTextInput.current?.focus();\n }\n\n public onComponentDidUpdate(): void {\n this.searchTextInput.current?.focus();\n }\n\n // @ts-ignore\n @computed get showBackArrow(): boolean {\n return this.state.content === CONTENT.ProductConfiguration;\n }\n\n public render(): JSX.Element {\n const {\n resources: { addLineModalLinkText }\n } = this.props;\n\n const modalProps = {\n ...this.props,\n className: 'msc-add-line-to-template',\n toggle: this._toggleModalHandler,\n isOpen: this.state.isOpen\n };\n\n return (\n <>\n <Modal {...modalProps}>\n <ModalHeader toggle={this._toggleModalHandler}>\n {this.showBackArrow && <button\n type='button'\n className='msc-modal__back-button'\n aria-label='Back to search results'\n onClick={this._onBackButtonClickHandler}\n />}{addLineModalLinkText}\n </ModalHeader>\n {this._renderContent()}\n </Modal>\n <Button className={'msc-add-line-to-template__button'} aria-label={addLineModalLinkText} onClick={this._toggleModalHandler}><span/>{addLineModalLinkText}</Button>\n </>\n );\n }\n\n private _renderSearchForm = () => {\n const {\n resources: { searchButtonAriaLabel, searchInputAriaLabel, searchModalPlaceholderText }\n } = this.props;\n\n return (\n <form\n className='msc-add-line-to-template__search-form'\n aria-label={searchButtonAriaLabel}\n name='add-line-to-template-search-form'\n role='form'\n autoComplete='off'\n onSubmit={this._onSearchSubmit}\n >\n <input\n type='text'\n autoFocus\n aria-label={searchInputAriaLabel}\n className={'msc-form-control msc-add-line-to-template__search-input'}\n placeholder={searchModalPlaceholderText}\n value={this.state.query}\n onChange={this._onInputChange}\n ref={this.searchTextInput}\n maxLength={200}\n />\n <button\n className={'msc-add-line-to-template__search-button'}\n aria-label={'Add To Template Search Button'}\n color={'primary'}\n />\n </form>\n );\n };\n\n private _onSearchSubmit = (event: React.FormEvent): void => {\n event.preventDefault();\n\n const query = get(this, 'searchTextInput.current.value', null);\n\n if (!query) {\n return;\n }\n\n this.setState({\n content: CONTENT.Loading\n });\n\n this._getSearchResults(query)\n .then(result => {\n if (result.length === 0) {\n this.setState({\n products: result,\n content: CONTENT.NotFound,\n });\n } else {\n this.setState({\n products: result,\n content: CONTENT.ProductList,\n });\n }\n })\n .catch(error => {\n this.setState({\n content: CONTENT.Error,\n });\n });\n };\n\n private _onQuantityChangeHandler = (event: React.ChangeEvent<HTMLInputElement>) => {\n this.setState({\n selectedQuantity: +event.target.value\n });\n }\n\n private _onSelectItem = async (product: ProductSearchResult): Promise<ProductDimensionFull[]> => {\n const {\n actionContext,\n request: {\n apiSettings: { channelId }\n }\n } = this.props.context;\n const varianteInput = new SelectedVariantInput(product.RecordId, channelId, []);\n const productVariant = await getSelectedVariant(varianteInput, actionContext);\n\n if (!productVariant) {\n this.props.context.telemetry.error('Error retrieving product variant');\n return Promise.resolve([]);\n }\n\n const dimensions = await this._getProductDimensions(product as SimpleProduct);\n\n this.setState({\n selectedProductDimensions: dimensions,\n content: CONTENT.ProductConfiguration,\n selectedProduct: productVariant\n });\n\n return dimensions;\n };\n\n private _onInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n this.setState({\n query: event.target.value\n });\n };\n\n private _onBackButtonClickHandler = (): void => {\n this.setState({\n content: CONTENT.ProductList\n });\n }\n\n private _highlightSearchTerm = (name: string) => {\n const parsedName = name && unescape(name.replace(new RegExp(this.state.query, 'i'), '<span>$&</span>'));\n // tslint:disable-next-line:react-no-dangerous-html\n return <div className='msc-add-line-to-template__product__name' dangerouslySetInnerHTML={{__html: parsedName || ''}}/>;\n };\n\n private _resultCountText = (): string => {\n return this.props.resources.searchResultsCountVerbage\n .replace('{count}', this.state.products.length.toString())\n .replace('{subject}', `${this.props.resources.searchResultsCountSubject}${(this.state.products.length > 1 ? 's' : '')}`);\n }\n\n private _renderContent(): React.ReactNode | null {\n switch (this.state.content) {\n case CONTENT.ProductConfiguration:\n const { selectedProduct, selectedProductDimensions } = this.state;\n const viewProps = {\n ...this.props,\n imageSettings: this.props.imageSettings || this.defaultImageSettings,\n product: selectedProduct!,\n dimensions: selectedProductDimensions!,\n addToTemplateHandler: this._addItemToTemplateHandler,\n onQuantityChangeHandler: this._onQuantityChangeHandler,\n highlightSearchTerm: this._highlightSearchTerm,\n searchForm: this._renderSearchForm()\n };\n\n return <ProductConfiguration {...viewProps}/>;\n\n case CONTENT.ProductList:\n const productProps = {\n ...this.props,\n imageSettings: this.props.imageSettings || this.defaultImageSettings,\n clickHandler: this._onSelectItem,\n products: this.state.products,\n highlightSearchTerm: this._highlightSearchTerm,\n searchForm: this._renderSearchForm(),\n renderResultCountText: this._resultCountText\n };\n\n return (\n <ModalBody>\n <ProductList {...productProps}/>\n </ModalBody>\n );\n\n case CONTENT.Loading:\n return (\n <ModalBody>\n {this._renderSearchForm()}\n <Spinner className='msc-add-line-to-template' msg={this.props.resources.progressNotificationText}/>\n </ModalBody>\n );\n\n case CONTENT.NotFound:\n const { notFoundSearchErrorNotice, notFoundSearchErrorRedediation } = this.props.resources;\n\n return (\n <ModalBody>\n <p className='msc-add-line-to-template__search-result-count'>{this._resultCountText()}</p>\n {this._renderSearchForm()}\n <NotFoundComponent error={notFoundSearchErrorNotice} msg={notFoundSearchErrorRedediation}/>\n </ModalBody>\n );\n\n case CONTENT.Error:\n return (\n <ModalBody>\n {this._renderSearchForm()}\n <div className='msc-alert-danger'>{this.props.resources.searchErrorMessage}</div>\n </ModalBody>\n );\n\n default:\n return (\n <ModalBody>\n {this._renderSearchForm()}\n </ModalBody>\n );\n }\n }\n\n private _addItemToTemplateHandler = async (config: IProductConfigurationState): Promise<ProductListLine> => {\n const { orderTemplateId, context: { actionContext } } = this.props;\n const input = new AddItemToOrderTemplateInput(\n orderTemplateId,\n config.product.RecordId,\n config.quantity,\n config.product.DefaultUnitOfMeasure || 'ea'\n );\n\n const result = await addItemToOrderTemplate(input, actionContext);\n\n this.setState({\n reloadPage: true\n });\n\n return result;\n }\n\n private _getSearchResults(searchText: string): Promise<ProductSearchResult[]> {\n const {\n context: {\n actionContext,\n request: {\n apiSettings: { channelId, catalogId }\n }\n }\n } = this.props;\n const searchCriteriaInput: ProductSearchCriteria = {};\n\n searchCriteriaInput.Context = {\n ChannelId: channelId,\n CatalogId: catalogId\n };\n searchCriteriaInput.IncludeAttributes = true;\n searchCriteriaInput.SearchCondition = searchText;\n\n return searchByCriteriaAsync({ callerContext: actionContext }, searchCriteriaInput);\n }\n\n private async _getProductDimensions(product: SimpleProduct): Promise<ProductDimensionFull[]> {\n const {\n context: {\n actionContext,\n request: {\n apiSettings: { channelId }\n }\n }\n } = this.props;\n const id = product.MasterProductId ? product.MasterProductId : product.RecordId;\n\n return getDimensionsForSelectedVariant(\n new GetDimensionsForSelectedVariantInput(id, channelId, []),\n actionContext\n );\n }\n\n private _toggleModalHandler = () => {\n this.setState({\n isOpen: !this.state.isOpen,\n content: CONTENT.Search\n });\n\n if (this.state.reloadPage) {\n window.location.reload();\n this.setState({\n reloadPage: false\n });\n }\n\n };\n}\n","import * as React from 'react';\n\nexport default (props: { className: string; msg?: string }) => (\n <>\n <div className={`${props.className}__loading__icon`}/>\n {props?.msg && <div className={`${props.className}__loading__msg`}>{props?.msg}</div>}\n </>\n);\n","/**\n * Copyright (c) 2018 Microsoft Corporation\n */\nimport { ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\ntype IDropdownState = {\n /**\n * @friendlyName selectedIndex\n * @description selected index\n */\n selectedIndex: string;\n};\n\nexport interface IDropdownProps {\n dropdownId: number;\n dropdownName: string;\n dropdownList: IDropdownItemProps[];\n telemetryContent?: ITelemetryContent;\n onChange?(selection: IDropdownOnSelection): void;\n}\n\nexport interface IDropdownItemProps {\n value: string;\n id: number;\n}\n\nexport interface IDropdownOnSelection {\n dropdownId: number;\n selectId: string;\n selectedValue: string;\n}\n\n/**\n *\n * DropDown component\n * @extends {React.PureComponent<IDropdownProps, IDropdownState>}\n */\nexport class Dropdown extends React.PureComponent<IDropdownProps, IDropdownState> {\n private selectMenu: React.RefObject<HTMLSelectElement> = React.createRef<HTMLSelectElement>();\n\n constructor(props: IDropdownProps, state: IDropdownState) {\n super(props);\n this.state = {\n selectedIndex: ''\n };\n }\n\n public componentDidMount(): void {\n if (this.selectMenu.current) {\n this.selectMenu.current.selectedIndex = 0;\n }\n }\n\n public render(): JSX.Element {\n const {dropdownId, dropdownList, dropdownName } = this.props;\n\n return (\n <select\n id={`msc-dropdown__entry-${dropdownId}`}\n ref={this.selectMenu}\n aria-label={dropdownName}\n className='msc-dropdown__select'\n onChange={this._onChanged}\n >\n {dropdownList.map((item: IDropdownItemProps) => (item &&\n <option\n value={item.id}\n key={item.id}\n selected={+this.state.selectedIndex === +item.id}\n aria-selected={+this.state.selectedIndex === +item.id}\n >\n {item.value}\n </option>\n ))}\n </select>\n );\n }\n\n private _onChanged = (event: React.ChangeEvent<HTMLSelectElement>): void => {\n this.setState({selectedIndex: event.target.value});\n\n if (this.props.onChange) {\n this.props.onChange({\n dropdownId: this.props.dropdownId,\n selectId: event.target.value,\n selectedValue: event.target.innerText\n });\n }\n };\n}","import * as React from 'react';\n\nexport const NotFoundComponent = (props: {error: string; msg: string}) => (\n <>\n <div className='msc-add-line-to-template__not-found__icon'/>\n <div className='msc-add-line-to-template__not-found__msg'>{props.error}</div>\n <div className='msc-add-line-to-template__not-found__remediation-instructions'>{props.msg}</div>\n </>\n);\n","import {\n getDimensionsForSelectedVariant,\n GetDimensionsForSelectedVariantInput,\n getFallbackImageUrl,\n getPriceForSelectedVariant,\n getProductAvailabilitiesForSelectedVariant,\n getSelectedVariant,\n IProductInventoryInformation,\n PriceForSelectedVariantInput,\n ProductAvailabilitiesForSelectedVariantInput,\n SelectedVariantInput\n } from '@msdyn365-commerce-modules/retail-actions';\nimport { Alert, Button, ITelemetryContent, ModalBody, ModalFooter } from '@msdyn365-commerce-modules/utilities';\nimport { ProductDimensionFull } from '@msdyn365-commerce/commerce-entities';\nimport { IImageSettings, Image } from '@msdyn365-commerce/core';\nimport { ProductDimensionValue, ProductListLine } from '@msdyn365-commerce/retail-proxy';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport classnames from 'classnames';\nimport React from 'react';\nimport { Dropdown, IAddLineToTemplateProps, IAddLineToTemplateResources, IDropdownItemProps, IDropdownOnSelection } from '.';\nimport OrderTemplateQuantity from '../common/order-template-quantity';\n\nexport interface IProductCnnfigurationProps extends IAddLineToTemplateProps {\n product: SimpleProduct;\n dimensions: ProductDimensionFull[];\n imageSettings: IImageSettings;\n telemetryContent?: ITelemetryContent;\n searchForm: React.ReactNode;\n addToTemplateHandler(params: IProductConfigurationState): Promise<ProductListLine>;\n highlightSearchTerm(name: string): React.ReactNode;\n}\n\nexport interface IProductConfigurationState {\n quantity: number;\n unitPrice: number;\n totalPrice: number;\n product: SimpleProduct;\n dimensions: ProductDimensionFull[];\n selectedDimensions: {};\n productAvailableQuantity?: IProductInventoryInformation;\n buttonDisabled: boolean;\n showAddConfirmation: boolean;\n errorMessage?: string;\n isBusy: boolean;\n errors: {dimension?: string[]; add?: string};\n}\n\n/**\n * Configure selected product for addition to order template\n */\nexport class ProductConfiguration extends React.Component<IProductCnnfigurationProps, IProductConfigurationState> {\n private selectedDimensions: {} = {};\n\n constructor(props: IProductCnnfigurationProps) {\n super(props);\n\n this.state = {\n quantity: 1,\n unitPrice: props.product.Price,\n totalPrice: props.product.Price,\n product: props.product,\n dimensions: props.dimensions.sort((a, b) => a.DimensionTypeValue - b.DimensionTypeValue),\n selectedDimensions: {},\n buttonDisabled: false,\n showAddConfirmation: false,\n } as IProductConfigurationState;\n }\n\n public render(): JSX.Element {\n const {\n context: {\n actionContext: {\n requestContext: { apiSettings }\n },\n request: { gridSettings }\n },\n resources: {\n addItemToTemplateText,\n addLineProductUnitPricePrefix,\n decrementButtonAriaLabel,\n incrementButtonAriaLabel,\n quantitySelectLabel,\n addLineProductUnitOfMeasurePrefix,\n totalPriceLabel\n },\n imageSettings,\n highlightSearchTerm\n } = this.props;\n const { buttonDisabled, product, quantity, unitPrice, totalPrice, showAddConfirmation, errors } = this.state;\n\n return (\n <>\n <ModalBody>\n {this.props.searchForm}\n <div className='msc-add-line-to-template__product-config'>\n <div className='msc-add-line-to-template__product__positioning-container-2'>\n <div className='msc-add-line-to-template__product__positioning-container-1'>\n <Image\n src={product?.PrimaryImageUrl || ''}\n fallBackSrc={\n getFallbackImageUrl(product?.ItemId, apiSettings) || ''\n }\n className={'thumbnail'}\n imageSettings={imageSettings}\n gridSettings={gridSettings!}\n loadFailureBehavior='empty'\n />\n <div className='msc-add-line-to-template__product__attributes'>\n <div className='msc-add-line-to-template__product__id'>{product?.ItemId}</div>\n {highlightSearchTerm(product?.Name || '')}\n <div className='msc-add-line-to-template__product__unit-price'>{addLineProductUnitPricePrefix} {this._formatPrice(unitPrice)}</div>\n <div className='msc-add-line-to-template__product__uom'>{addLineProductUnitOfMeasurePrefix} {product?.DefaultUnitOfMeasure}</div>\n </div>\n </div>\n <div className='msc-add-line-to-template__product-config__dimensions'>\n {this._getDimensionsNodes()}\n </div>\n </div>\n <div className='quantity-container'>\n <div>{quantitySelectLabel}</div>\n <OrderTemplateQuantity\n id={'msc-add-line-to-template__product-config__quantity'}\n currentCount={quantity}\n onChange={this._onQuantityChange}\n inputQuantityAriaLabel='Press to increment quantity by 1'\n max={10000000}\n decrementButtonAriaLabel={decrementButtonAriaLabel}\n incrementButtonAriaLabel={incrementButtonAriaLabel}\n />\n </div>\n </div>\n <div className='msc-add-line-to-template__product__total-price'>{totalPriceLabel} {this._formatPrice(totalPrice)}</div>\n </ModalBody>\n <ModalFooter>\n {showAddConfirmation && <div className='msc-add-line-to-template__add-success msc-alert-success msc-alert'><span aria-hidden='true'/>{this._getConfirmationMessage()}</div>}\n {errors?.add && <div className='msc-add-line-to-template__add-error msc-alert-danger msc-alert'><span className='msi-exclamation-triangle' aria-hidden='true'/>{errors?.add}</div>}\n <Button\n className={classnames('msc-add-line-to-template__add-configured-product-button', { 'is-busy': this.state.isBusy })}\n aria-label={addItemToTemplateText}\n onClick={this._addToTemplateHandler}\n disabled={buttonDisabled}\n >\n {addItemToTemplateText}\n </Button>\n </ModalFooter>\n </>\n );\n }\n\n private _getConfirmationMessage(): string {\n const selectedDimensionNames = this.state.dimensions.map(dimension => {\n let variant = dimension.DimensionValues?.find(value => value.RecordId === this.selectedDimensions[dimension.DimensionTypeValue])?.Value;\n if (dimension.DimensionTypeValue === 3) {\n variant = `size ${variant}`;\n }\n return variant;\n }).filter(value => value);\n\n return this.props.resources.addToTemplateConfirmation\n .replace('{count}', this.state.quantity.toString())\n .replace('{productAndDimensions}', `${this.state.product.Name}, ${Object.values(selectedDimensionNames).join(', ')}`);\n\n }\n\n private _getDimensionsNodes(): React.ReactElement[] {\n const { dimensions } = this.state;\n const { resources } = this.props;\n\n return dimensions?.map((dimension: ProductDimensionFull) => {\n const { DimensionValues, DimensionTypeValue } = dimension;\n const mapDimensions = (value: ProductDimensionValue): IDropdownItemProps => ({\n id: value.RecordId,\n value: value.Value || ''\n });\n const dimensionName = this._getDropdownName(DimensionTypeValue, resources);\n const dropdownList: IDropdownItemProps[] = DimensionValues ? DimensionValues.map<IDropdownItemProps>(mapDimensions) : [];\n dropdownList.unshift({id:0, value:`Choose a ${dimensionName}`});\n\n return (\n <div key={DimensionTypeValue}>\n <div>{dimensionName}</div>\n {this.state.errors?.dimension?.includes(DimensionTypeValue.toString()) && (\n <Alert color='danger' assertive={true} aria-label={'aria label'}>\n <div className='msc-alert__header' aria-hidden='true'>\n <span className='msi-exclamation-triangle' />\n <span>{this._getDimensionsError(dimensionName)}</span>\n </div>\n </Alert>\n )}\n <Dropdown\n dropdownId={DimensionTypeValue}\n dropdownName={this._getDropdownName(DimensionTypeValue, resources)}\n dropdownList={dropdownList}\n onChange={this._onDimensionChanged}\n />\n </div>\n );\n });\n }\n\n private _getDimensionsError = (dimensionName: string) => this.props.resources.dimensionMissingError.replace(/\\{dimensionName\\}/g, dimensionName);\n\n private _addToTemplateHandler = async (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n // hide confirmation of previous addition when adding multiple items\n this.setState({\n isBusy: true,\n showAddConfirmation: false,\n errors: {...this.state.errors, add: undefined}\n });\n\n const missingDimensions = this.state.dimensions.map(dimension => dimension.DimensionTypeValue.toString()).filter(type => !this.selectedDimensions[type]);\n\n this.setState({\n errors: {dimension: missingDimensions}\n });\n if (missingDimensions.length) {\n this.setState({\n isBusy: false\n });\n return;\n }\n\n this.props.addToTemplateHandler({...this.state})\n .then(status => {\n // validate against the existance of a ProductListId\n if (status.ProductListId) {\n this.setState({\n isBusy: false,\n showAddConfirmation: true\n });\n }\n })\n .catch(error => {\n const { addToTemplateDuplicateError, addToTemplateGenericError } = this.props.resources;\n let errorMessage;\n\n if (error.error.name === 'Microsoft_Dynamics_Commerce_Runtime_DuplicateObject') {\n errorMessage = addToTemplateDuplicateError;\n } else {\n errorMessage = addToTemplateGenericError;\n }\n\n this.setState({\n isBusy: false,\n errors: {...this.state.errors, add: errorMessage}\n });\n this.props.context.telemetry.error('Error adding item to order template');\n });\n };\n\n private _onQuantityChange = (newValue: number) => {\n this.setState({\n quantity: newValue,\n totalPrice: newValue * this.props.product.Price\n });\n }\n\n private _updateDimensionValue = (productDimensionFull: ProductDimensionFull, newValueId: string | undefined): ProductDimensionValue | undefined => {\n if (newValueId && productDimensionFull.DimensionValues) {\n return productDimensionFull.DimensionValues.find(dimension => dimension.RecordId === +newValueId);\n }\n\n return undefined;\n };\n\n // rehydrate the selected variants price, available dimensions & sizes\n private _onDimensionChanged = async (selection: IDropdownOnSelection): Promise<void> => {\n const { product, dimensions, context } = this.props;\n const {\n actionContext,\n request: { apiSettings: { channelId } }\n } = context;\n\n // remaining error notifications for missing dimensions\n const remainingDimensionsErrors = this.state.errors?.dimension?.filter(id => id !== selection.dropdownId.toString());\n\n this.setState({\n isBusy: false,\n showAddConfirmation: false,\n buttonDisabled: true,\n errors: {add: undefined, dimension: remainingDimensionsErrors}\n });\n\n // update currenlty selected dimensions\n this.selectedDimensions[selection.dropdownId] = +selection.selectId;\n\n const mappedDimensions = dimensions?.map(dimension => {\n return {\n DimensionTypeValue: dimension.DimensionTypeValue,\n DimensionValue: this._updateDimensionValue(dimension, this.selectedDimensions[dimension.DimensionTypeValue]) || dimension.DimensionValue,\n ExtensionProperties: dimension.ExtensionProperties\n };\n }).filter(dimension => {\n return dimension && dimension.DimensionValue;\n });\n\n const variantProduct = (await getSelectedVariant(\n new SelectedVariantInput(\n product.MasterProductId ? product.MasterProductId : product.RecordId,\n channelId,\n mappedDimensions\n ),\n actionContext\n ));\n\n if (!variantProduct) {\n this.props.context.telemetry.error(`Error retrieving variant product for product ${product.MasterProductId ? product.MasterProductId : product.RecordId}`);\n return;\n }\n\n const dimensionInput = new GetDimensionsForSelectedVariantInput(\n variantProduct.RecordId,\n channelId,\n mappedDimensions\n );\n const variantDimensions = await getDimensionsForSelectedVariant(dimensionInput, actionContext);\n\n if (!variantDimensions) {\n this.props.context.telemetry.error('Error retrieving dimensions for reconfigured product variant');\n this.setState({\n buttonDisabled: false\n });\n return;\n }\n\n const availabilityInput = new ProductAvailabilitiesForSelectedVariantInput(\n product.MasterProductId ? product.MasterProductId : product.RecordId,\n channelId\n );\n // @TODO sync UX quantity w/ actual availibility\n const newAvailableQuantity = await getProductAvailabilitiesForSelectedVariant(availabilityInput, actionContext);\n const priceInput = new PriceForSelectedVariantInput(product.RecordId, channelId);\n const productPrice = await getPriceForSelectedVariant(priceInput, actionContext);\n\n if (!productPrice) {\n this.props.context.telemetry.error('Error retrieving price for reconfigured product variant');\n this.setState({\n buttonDisabled: false\n });\n return;\n }\n\n this.setState({\n buttonDisabled: false,\n productAvailableQuantity: newAvailableQuantity && newAvailableQuantity[0] || undefined,\n unitPrice: +(productPrice.BasePrice || product.Price),\n dimensions: variantDimensions.sort((a, b) => a.DimensionTypeValue - b.DimensionTypeValue),\n product: variantProduct\n });\n }\n\n private _getDropdownName = (dimensionType: number, resources: IAddLineToTemplateResources): string => {\n switch (dimensionType) {\n case 1: // Color\n return resources.productDimensionTypeColor;\n case 2: // Configuration\n return resources.productDimensionTypeConfiguration;\n case 3: // Size\n return resources.productDimensionTypeSize;\n case 4: // Style\n return resources.productDimensionTypeStyle;\n default:\n return '';\n }\n };\n\n private _formatPrice(price: number): string {\n const {\n context: {\n cultureFormatter: {\n formatCurrency,\n // @ts-ignore\n currencyCode\n }\n }\n } = this.props;\n\n return formatCurrency(price.toFixed(2), currencyCode);\n }\n}","import { getFallbackImageUrl } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button } from '@msdyn365-commerce-modules/utilities';\nimport { ProductDimensionFull } from '@msdyn365-commerce/commerce-entities';\nimport { IImageSettings, Image } from '@msdyn365-commerce/core';\nimport { ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\nimport classnames from 'classnames';\nimport React, { useState } from 'react';\nimport { IAddLineToTemplateProps } from '.';\n\nexport interface IProductListProps extends IAddLineToTemplateProps {\n products: ProductSearchResult[];\n imageSettings: IImageSettings;\n searchForm: React.ReactNode;\n clickHandler(product: ProductSearchResult): Promise<ProductDimensionFull[]>;\n highlightSearchTerm(name: string): React.ReactNode;\n renderResultCountText(): string;\n}\n\nexport const ProductList = (props: IProductListProps) => {\n const {\n products,\n context: {\n actionContext: {\n requestContext: { apiSettings }\n },\n request: {\n gridSettings\n },\n cultureFormatter: {\n formatCurrency,\n // @ts-ignore\n currencyCode\n }\n },\n clickHandler,\n highlightSearchTerm,\n renderResultCountText,\n resources: { selectProductButtonText },\n imageSettings\n } = props;\n\n return (\n <>\n <p className='msc-add-line-to-template__search-result-count'>{renderResultCountText()}</p>\n {props.searchForm}\n <div className='msc-add-line-to-template__product-list'>\n {products.map((product: ProductSearchResult, index: number) => {\n const { Price, ItemId, Name, PrimaryImageUrl } = product;\n const price = formatCurrency(Price.toFixed(2), currencyCode);\n const fallBackImg = getFallbackImageUrl(ItemId, apiSettings) || '';\n\n return (\n <div key={`product-${index}`} className='msc-add-line-to-template__product'>\n <div className='msc-add-line-to-template__product__positioning-container-1'>\n <Image\n src={PrimaryImageUrl || ''}\n fallBackSrc={fallBackImg}\n className={'thumbnail'}\n gridSettings={gridSettings!}\n imageSettings={imageSettings}\n loadFailureBehavior='empty'\n />\n <div className='msc-add-line-to-template__product__attributes'>\n <div className='msc-add-line-to-template__product__id'>{ItemId}</div>\n {highlightSearchTerm(Name || '')}\n </div>\n </div>\n <div className='msc-add-line-to-template__product__price-container'>\n <span>{price}</span>\n <ProductSelectButton product={product} buttonText={selectProductButtonText} clickHandler={clickHandler}/>\n </div>\n </div>\n );\n })}\n </div>\n </>\n );\n};\n\ninterface IProductSelectButton {\n product: ProductSearchResult;\n buttonText: string;\n clickHandler(product: ProductSearchResult): Promise<ProductDimensionFull[]>;\n}\n\nconst ProductSelectButton = (props: IProductSelectButton) => {\n const [isBusy, setBusy] = useState(false);\n const { product, buttonText, clickHandler } = props;\n const getClickHandler = async () => {\n setBusy(!isBusy);\n await clickHandler(product);\n setBusy(!isBusy);\n };\n\n return (\n <Button\n className={classnames('msc-add-line-to-template__product__select-button', { 'is-busy': isBusy })}\n aria-label={buttonText}\n onClick={getClickHandler}\n >\n {buttonText}\n </Button>\n );\n};","import { CacheType, IActionInput } from '@msdyn365-commerce/core';\nimport { IUserReviewData } from './submit-user-review-input-data';\n\n/**\n * SubmitUserReview Input Action\n */\nexport class SubmitUserReviewInput implements IActionInput {\n /**\n * The Id representing the product to get the ratings for.\n */\n public productId?: string;\n\n /**\n * The ID representing the tenant.\n */\n public tenantId: string;\n\n /**\n * The calling organization's channel id.\n */\n public channelId: string;\n\n /**\n * The locale for which to get the ratings from.\n */\n public locale: string;\n\n /**\n * The user's review data\n */\n public userReviewData: IUserReviewData;\n\n /**\n * The user's authorization token\n */\n public authorization: string;\n\n /**\n * The ratings and reviews service endpoint\n */\n public serviceEndpoint: string;\n\n constructor(\n productId: string | undefined,\n tenantId: string,\n channelId: string,\n locale: string,\n userReviewData: IUserReviewData,\n authorization: string,\n serviceEndpoint: string\n ) {\n this.productId = productId;\n this.tenantId = tenantId;\n this.channelId = channelId;\n this.locale = locale;\n this.userReviewData = userReviewData;\n this.authorization = authorization;\n this.serviceEndpoint = serviceEndpoint;\n }\n\n public getCacheKey = () => 'SubmitUserReview';\n public getCacheObjectType = () => 'SubmitUserReview';\n public dataCacheType = (): CacheType => 'none';\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { createObservableDataAction, IAction, IActionContext, sendRequest } from '@msdyn365-commerce/core';\nimport { SubmitUserReviewInput } from './inputs/submit-user-review-input';\n\n/**\n * This data action allows submitting review to the reviews service\n * @param input This user review submission text\n * @param ctx The data action context\n */\nasync function submitReview(input:SubmitUserReviewInput, ctx: IActionContext):Promise<string> {\n if (!inputIsValid(input)) {\n ctx.trace(`[SubmitUserReview] Failed to submit reviews for product due to bad input ${input}`);\n return '';\n }\n\n const requestUrl = `${input.serviceEndpoint}/v2.0/reviews/product/${input.productId}/user?` +\n `tenantId=${input.tenantId}&` +\n `channelId=${input.channelId}&` +\n `locale=${input.locale}`;\n\n return sendRequest<string>(requestUrl, 'post', input.userReviewData, {headers: {Authorization: `id_token ${input.authorization}`}}).then((response) => {\n if (response.status !== 200 && response.status !== 201) {\n ctx.trace(`[SubmitUserReview] Failed to submit reviews for product`);\n ctx.trace(response.data);\n return '';\n }\n return response.data;\n }).catch((error) => {\n ctx.trace(`[SubmitUserReview] Failed to submit reviews for product`);\n ctx.telemetry.exception(error);\n ctx.telemetry.debug(`[SubmitUserReview] Failed to submit reviews for product`);\n ctx.trace(error);\n return '';\n });\n}\n\nfunction inputIsValid(input: SubmitUserReviewInput): Boolean {\n return input && !!input.productId && !!input.tenantId;\n}\n\nexport const submitReviewDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/ratings-reviews/submit-user-review',\n action: <IAction<string>>submitReview\n});\n\nexport default submitReviewDataAction;\n","import React from 'react';\n\nimport { getRnrAuthEndpointId, getRnrPartnerId } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Alert, Button, getPayloadObject, getTelemetryAttributes, INodeProps, ITelemetryContent, Modal, ModalBody, ModalFooter, ModalHeader, TelemetryConstant\n} from '@msdyn365-commerce-modules/utilities';\nimport { Review } from '@msdyn365-commerce/commerce-entities';\nimport { RatingComponent } from '@msdyn365-commerce/components';\nimport { getUrlSync, IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\n\nimport { GetUserReviewInput } from '../actions/inputs/get-user-review-input';\nimport { SubmitUserReviewInput } from '../actions/inputs/submit-user-review-input';\nimport submitUserReview from '../actions/submit-user-review';\n\nexport interface IReviewModalProps {\n userReview?: Review;\n product?: SimpleProduct;\n renderContextId: string;\n resources: IReviewModalResources;\n context: ICoreContext<IGeneric<IAny>>;\n parentId: string;\n parentType: string;\n isOpen: boolean;\n rating: number;\n reviewTitle: string;\n reviewText: string;\n returnRef: React.RefObject<HTMLButtonElement> | undefined;\n hasError: boolean;\n telemetryContent?: ITelemetryContent;\n onModalToggle():void;\n onTitleChange(event: React.ChangeEvent<HTMLInputElement>):void;\n onTextChange(event: React.ChangeEvent<HTMLTextAreaElement>):void;\n onRatingChange(value: number):void;\n onReviewComplete?(isSuccess: boolean):void;\n}\n\nexport interface IReviewModalResources {\n selectRatingAriaLabel: string;\n selectRatingLabel: string;\n reviewTitleLabel: string;\n reviewTextLabel: string;\n privacyPolicyTitle: string;\n privacyPolicyTextFormat: string;\n writeReviewModalTitle: string;\n editReviewModalTitle: string;\n submitReviewButtonText: string;\n discardReviewButtonText: string;\n errorMessageText: string;\n}\n\nexport interface IReviewModalViewProps {\n modal: INodeProps;\n modalHeader: React.ReactElement;\n modalFooter: INodeProps;\n modalBody: INodeProps;\n cancelButton: React.ReactElement;\n submitButton: React.ReactElement;\n rating: React.ReactElement;\n ratingLabel: React.ReactElement;\n titleInput: React.ReactElement;\n titleLabel: React.ReactElement;\n textInput: React.ReactElement;\n textLabel: React.ReactElement;\n privacyPolicyUrl: React.ReactElement;\n form: INodeProps;\n inputRow: INodeProps;\n error: React.ReactElement;\n}\n\n/**\n * CartLineItems component\n */\n\nexport const ReviewModal = (props: IReviewModalProps):IReviewModalViewProps => {\n const onClickSubmit = () => {return onSubmit(props);};\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.SubmitReview);\n const submitButtonAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n payLoad.contentAction.etext = TelemetryConstant.Cancel;\n const cancelButtonAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n return {\n modal: {tag: Modal, className: 'ms-review-modal msc-modal-input-required', toggle: props.onModalToggle, applicationNode: 'renderPage', isOpen: props.isOpen, returnFocusRef: props.returnRef},\n modalHeader: modalHeaderNode(props),\n modalFooter: {tag: ModalFooter, className: 'ms-review-modal-footer'},\n modalBody: {tag: ModalBody, className: 'ms-review-modal-body'},\n cancelButton: <Button className='ms-review-modal-cancel' onClick={props.onModalToggle} {...submitButtonAttribute} >{props.resources.discardReviewButtonText}</Button>,\n submitButton: <Button className='ms-review-modal-submit' onClick={onClickSubmit} {...cancelButtonAttribute} disabled={submitDisabled(props)}>{props.resources.submitReviewButtonText}</Button>,\n rating: ratingsInput(props),\n ratingLabel: ratingsLabel(props),\n titleInput: titleInput(props),\n titleLabel: titleLabel(props),\n textInput: textInput(props),\n textLabel: textLabel(props),\n privacyPolicyUrl: privacyPolicyLink(props),\n form: {tag: 'form', className: 'ms-review-modal-form', autoComplete: 'off'},\n inputRow: {tag: 'div', className: 'ms-review-modal-row', autoComplete: 'off'},\n error: <Alert className='ms-review-modal-error' isOpen={props.hasError} color='danger'>{props.resources.errorMessageText}</Alert>\n };\n};\n\nconst modalHeaderNode = (props: IReviewModalProps) => {\n return (\n <ModalHeader toggle={props.onModalToggle} className='ms-review-modal-header'>\n { props.userReview && props.userReview.reviewId ? props.resources.editReviewModalTitle : props.resources.writeReviewModalTitle }\n </ModalHeader>\n );\n};\n\nconst submitDisabled = (props: IReviewModalProps) => {\n return !props.rating || !stripWhiteSpacesFromString(props.reviewText) || !stripWhiteSpacesFromString(props.reviewTitle);\n};\n\nconst ratingsInput = (props: IReviewModalProps) => {\n return (\n <RatingComponent\n readOnly={false}\n avgRating={0}\n ariaLabel={props.resources.selectRatingAriaLabel}\n initialRating={props.rating}\n context={props.context}\n id={props.parentId}\n typeName={props.parentType}\n data={{}}\n key='ratings'\n onChange={props.onRatingChange}\n />\n );\n};\n\nconst ratingsLabel = (props: IReviewModalProps) => {\n return <label className='ms-review-modal-rating-label' key='ratingsLabel'>{props.resources.selectRatingLabel}*</label>;\n};\n\nconst titleInput = (props: IReviewModalProps) => {\n const maxLength = props.context.app.config.reviewTitleMaxLength;\n\n return (\n <input\n maxLength={maxLength}\n id={`reviewTitle-${props.renderContextId}`}\n onChange={props.onTitleChange}\n value={props.reviewTitle}\n aria-required='true'\n className='ms-review-modal-title'\n />\n );\n};\n\nconst titleLabel = (props: IReviewModalProps) => {\n return <label className='ms-review-modal-title-label' htmlFor={`reviewTitle-${props.renderContextId}`}>{props.resources.reviewTitleLabel}</label>;\n};\n\nconst reviewTextWidth: number = 50;\n\nconst textInput = (props: IReviewModalProps) => {\n const maxLength = props.context.app.config.reviewTextMaxLength;\n return (\n <textarea\n maxLength={maxLength}\n className='ms-review-modal-text'\n id={`reviewTextArea-${props.renderContextId}`}\n onChange={props.onTextChange}\n rows={maxLength / reviewTextWidth}\n value={props.reviewText}\n aria-required='true'\n />\n );\n};\n\nconst textLabel = (props: IReviewModalProps) => {\n return <label htmlFor={`reviewTextArea-${props.renderContextId}`} className='ms-review-modal-text-label'>{props.resources.reviewTextLabel}</label>;\n};\n\nconst privacyPolicyLink = (props: IReviewModalProps) => {\n const policyTextBlocks = props.resources.privacyPolicyTextFormat.split('{0}');\n const isSeparatorAtStart = props.resources.privacyPolicyTextFormat.startsWith('{0}');\n const isSeparatorAtEnd = props.resources.privacyPolicyTextFormat.endsWith('{0}');\n const privacyPolicyUrl = getUrlSync('rnrPrivacyPolicy', props.context.actionContext);\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.PrivacyPolicy);\n const privacyPolicyAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n\n return (\n <p className='ms-review-modal-policy'>\n {isSeparatorAtStart ? '' : policyTextBlocks[0]}\n <a href={privacyPolicyUrl} target='_blank' className='msc-link' {...privacyPolicyAttribute}>{props.resources.privacyPolicyTitle}</a>\n {isSeparatorAtEnd ? '' : isSeparatorAtStart ? policyTextBlocks[0] : policyTextBlocks[1] }\n </p>\n );\n};\n\nconst onSubmit = (props: IReviewModalProps): void => {\n if (props.product) {\n submitReview(props.product, props.reviewTitle, props.reviewText, props.rating, props.context, props.userReview, props.onReviewComplete);\n }\n};\n\n/**\n * This method strips content of extra white spaces\n * @param text The text to be stripped of extra white spaces\n */\nconst stripWhiteSpacesFromString = (text: string): string => {\n return text\n .replace(new RegExp('\\\\r?\\\\n|\\\\r+', 'g'), ' ')\n .replace(new RegExp('\\\\s+', 'g'), ' ')\n .trim();\n};\n\nexport const submitReview = (product: SimpleProduct, title: string, text: string, rating: number, context: ICoreContext, userReview?: Review, onReviewSubmission?: (isSuccessful: boolean) => void) => {\n const { request } = context;\n const { user } = request;\n if (user && request) {\n const input = new SubmitUserReviewInput(\n product.RecordId.toString(),\n getRnrPartnerId(context.actionContext),\n request.apiSettings.channelId.toString(),\n request.locale,\n {\n productName: product && product.Name,\n rating: rating,\n reviewText: stripWhiteSpacesFromString(text),\n title: stripWhiteSpacesFromString(title),\n userEmail: user.emailAddress,\n userName: user.name\n },\n request.user.token,\n getRnrAuthEndpointId(context.actionContext)\n );\n\n submitUserReview(input, context.actionContext).then(reviewId => {\n const review = !!reviewId ? {\n rating: rating,\n title: stripWhiteSpacesFromString(title),\n reviewText: stripWhiteSpacesFromString(text),\n submittedDateTime: new Date(),\n helpfulPositive: userReview ? userReview.helpfulPositive : 0,\n helpfulNegative: userReview ? userReview.helpfulNegative : 0,\n reviewId: reviewId,\n userName: request.user.firstName || request.user.name\n } : userReview;\n\n const getReviewInput = new GetUserReviewInput(input.productId!, input.tenantId, input.authorization, input.serviceEndpoint);\n context.actionContext.update(getReviewInput, review);\n\n if (onReviewSubmission) {\n onReviewSubmission(!!reviewId);\n }\n }).catch(() => {\n const productId = product.RecordId;\n context.telemetry.error(`Failed to submit review for product with recordId: ${productId}`);\n context.telemetry.debug(`Failed to submit review for product with recordId: ${productId}`);\n if (onReviewSubmission) {\n onReviewSubmission(false);\n }\n });\n }\n};","import { getPayloadObject, getTelemetryAttributes, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nexport const SignInMessage: React.FC<{text: string}> = (props: {text: string}) => {\n return <p className='ms-write-review__sign-in'>{props.text}</p>;\n};\n\nexport const SignInButton: React.FC<{text: string; href: string; ariaLabel: string; telemetryContent?: ITelemetryContent}> = (props: {text: string; href: string; ariaLabel: string; telemetryContent?: ITelemetryContent}) => {\n const {text, href, ariaLabel, telemetryContent} = props;\n const payLoad = getPayloadObject('click', telemetryContent!, TelemetryConstant.SignIn);\n const attributes = getTelemetryAttributes(telemetryContent!, payLoad);\n return <a href={href} className='ms-write-review__sign-in-btn msc-btn' aria-label={ariaLabel} {...attributes}>{text}</a>;\n};\n\ninterface IModalToggleProps {\n innerRef: React.RefObject<HTMLButtonElement> | undefined;\n id: string;\n text: string;\n ariaLabel: string;\n telemetryContent?: ITelemetryContent;\n onClick(): void;\n}\n\nexport const ModalToggle: React.FC<IModalToggleProps> = (props: IModalToggleProps) => {\n const {text, onClick, ariaLabel, innerRef, telemetryContent, id} = props;\n const payLoad = getPayloadObject('click', telemetryContent!, TelemetryConstant.WriteReview);\n const attributes = getTelemetryAttributes(telemetryContent!, payLoad);\n return <button id={id} className='ms-write-review__toggle msc-btn' aria-label={ariaLabel} onClick={onClick} ref={innerRef} {...attributes}>{text}</button>;\n};","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { getTelemetryObject, IModuleProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport { Review } from '@msdyn365-commerce/commerce-entities';\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport classnames from 'classnames';\nimport React from 'react';\nimport { IReviewModalViewProps, ReviewModal, submitReview } from '../../common/review-modal';\nimport { TOGGLE_REVIEW_MODAL_BUTTON_ID } from '../../common/rnrInterface';\nimport { ModalToggle, SignInButton, SignInMessage } from './components/components';\nimport { IWriteReviewData } from './write-review.data';\nimport { IWriteReviewProps } from './write-review.props.autogenerated';\n\nexport interface IWriteReviewCallbacks {\n toggleModal(): void;\n updateReviewTitle(title: string): void;\n updateReviewText(text: string): void;\n updateRating(rating: number): void;\n onReviewSubmitted(isSuccessful: boolean): void;\n submitReview(product: SimpleProduct, title: string, text: string, rating: number, context: Msdyn365.ICoreContext, userReview?: Review, onReviewSubmission?: (isSuccessful: boolean) => void): void;\n}\n\nexport interface IWriteReviewState {\n rating: number;\n reviewTitle: string;\n reviewText: string;\n isReviewModalOpen: boolean;\n hasReviewError: boolean;\n}\n\nexport interface IWriteReviewViewProps extends IWriteReviewProps<IWriteReviewData> {\n state: IWriteReviewState;\n className: string;\n callbacks: IWriteReviewCallbacks;\n signInMessage: React.ReactNode;\n signInButton: React.ReactNode;\n modalToggle: React.ReactNode;\n reviewModal: IReviewModalViewProps;\n moduleProps: IModuleProps;\n heading: React.ReactNode;\n}\n\n/**\n * This module is enables user's to leave ratings and reviews on a specific product\n * WriteReview module\n * @extends {React.PureComponent<IWriteReviewProps<IWriteReviewData>>}\n */\nclass WriteReview extends React.PureComponent<IWriteReviewProps<IWriteReviewData>, IWriteReviewState> {\n private _modalToggleRef: React.RefObject<HTMLButtonElement> | undefined;\n private telemetryContent: ITelemetryContent;\n\n public constructor(props: IWriteReviewProps<IWriteReviewData>) {\n super(props);\n const {userReview: {result: userReview}} = this.props.data;\n this._toggleReviewModal = this._toggleReviewModal.bind(this);\n this._modalToggleRef = React.createRef<HTMLButtonElement>();\n const rating = userReview ? userReview.rating : 0;\n const reviewTitle = userReview ? userReview.title : '';\n const reviewText = userReview ? userReview.reviewText : '';\n\n this.state = {\n isReviewModalOpen: false,\n rating: rating,\n reviewTitle: reviewTitle,\n reviewText: reviewText,\n hasReviewError: false\n };\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\n }\n\n public render(): JSX.Element {\n const { resources } = this.props;\n const { className, heading } = this.props.config;\n const {product: {result: product}, userReview: {result: userReview}} = this.props.data;\n\n const userInfo = this.props.context && this.props.context.request && this.props.context.request.user;\n const completeClass = classnames('ms-write-review', 'msc-modal-input-required', className);\n const viewProps = {\n ...this.props,\n state: this.state,\n className: completeClass,\n moduleProps: {\n moduleProps: this.props,\n className: completeClass,\n id: null\n },\n callbacks: this.writeReviewCallbacks,\n signInMessage: <SignInMessage text={resources.signInMessage}/>,\n signInButton: <SignInButton text={resources.signInLabel} ariaLabel={resources.signInAriaLabel} href={userInfo.signInUrl!} telemetryContent={this.telemetryContent}/>,\n modalToggle: product && (\n <ModalToggle\n text={userReview? resources.editReviewButtonText : resources.reviewButtonLabel}\n ariaLabel={resources.reviewButtonLabel}\n innerRef={this._modalToggleRef}\n onClick={this._toggleReviewModal}\n id={TOGGLE_REVIEW_MODAL_BUTTON_ID}\n telemetryContent={this.telemetryContent}\n />\n ),\n reviewModal: this._buildUserReviewModal(),\n heading: heading && heading.text && (\n <Msdyn365.Text\n className='ms-write-review__heading'\n tag={heading.tag || 'h2'}\n text={heading.text}\n editProps={{onEdit:this.handleHeadingChange, requestContext: this.props.context.request}}\n />\n )\n } as IWriteReviewViewProps;\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent) => this.props.config.heading!.text = event.target.value;\n\n private _onTitleChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n this.writeReviewCallbacks.updateReviewTitle(event.target.value);\n }\n\n private _onTextChange = (event: React.ChangeEvent<HTMLTextAreaElement>): void => {\n this.writeReviewCallbacks.updateReviewText(event.target.value);\n }\n\n private _onRatingChange = (value: number): void => {\n this.writeReviewCallbacks.updateRating(value);\n }\n\n private _toggleReviewModal = (): void => {\n const userReview = this.props.data.userReview.result;\n if (this.state.isReviewModalOpen) {\n this.setState({isReviewModalOpen: false, hasReviewError: false});\n } else {\n if(userReview) {\n this.setState({\n isReviewModalOpen: true,\n reviewText: userReview.reviewText,\n reviewTitle: userReview.title,\n rating: userReview.rating\n });\n } else {\n this.setState({\n isReviewModalOpen: true,\n reviewText: '',\n reviewTitle: '',\n rating: 0\n });\n }\n }\n }\n\n /**\n * This method builds the user review modal\n * @param config The module config\n */\n private _buildUserReviewModal(): IReviewModalViewProps {\n return ReviewModal({\n userReview: this.props.data.userReview.result,\n product: this.props.data.product.result,\n resources: {...this.props.resources},\n context: this.props.context,\n parentId: this.props.id,\n parentType: this.props.typeName,\n isOpen: this.state.isReviewModalOpen,\n rating: this.state.rating,\n reviewTitle: this.state.reviewTitle,\n reviewText: this.state.reviewText,\n onModalToggle: this._toggleReviewModal,\n onTitleChange: this._onTitleChange,\n onTextChange: this._onTextChange,\n onRatingChange: this._onRatingChange,\n onReviewComplete: this.writeReviewCallbacks.onReviewSubmitted,\n renderContextId: 'writeReview',\n returnRef: this._modalToggleRef,\n hasError: this.state.hasReviewError,\n telemetryContent: this.telemetryContent\n });\n }\n\n // tslint:disable-next-line\n private writeReviewCallbacks: IWriteReviewCallbacks = {\n toggleModal: this._toggleReviewModal,\n updateReviewTitle: (title: string): void => {\n this.setState({reviewTitle: title});\n },\n updateReviewText: (text: string): void => {\n this.setState({reviewText: text});\n },\n updateRating: (rating: number): void => {\n this.setState({rating: rating});\n },\n onReviewSubmitted: (isSuccessful: boolean): void => {\n if (isSuccessful) {\n this.setState({isReviewModalOpen: false, hasReviewError: false});\n } else {\n this.setState({hasReviewError: true});\n }\n },\n submitReview: submitReview\n };\n}\n\nexport default WriteReview;\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Button } from '@msdyn365-commerce-modules/utilities';\nimport { IOrderTemplateNameDialogResources, OrderTemplateNameDialog } from '@msdyn365-commerce/components';\nimport { IComponentProps } from '@msdyn365-commerce/core';\nimport React, { useState } from 'react';\n\nexport interface ICreateOrderTemplateButtonProps extends IComponentProps {\n createOrderTemplateText: string;\n createOrderTemplateDialogResources: IOrderTemplateNameDialogResources;\n onOrderTemplateCreated(): Promise<void>;\n}\n\nconst CreateOrderTemplateButton: React.FC<ICreateOrderTemplateButtonProps> = (props) => {\n const onCancel = () => {\n return;\n };\n const [createOrderTemplateDialogOpen, setOrderTemplateNameDialogOpen] = useState(false);\n const onCreateButtonClick = () => {\n setOrderTemplateNameDialogOpen(true);\n };\n\n return (\n <>\n <Button\n className='ms-order-template__add-template-button'\n color='primary'\n onClick={onCreateButtonClick}\n >\n {props.createOrderTemplateText}\n </Button>\n <OrderTemplateNameDialog\n className={'msc-order-template-name-dialog'}\n modalOpen={createOrderTemplateDialogOpen}\n isUpdateDialog={false}\n setModalOpen={setOrderTemplateNameDialogOpen}\n context={props.context}\n id={props.id}\n data={{}}\n typeName={props.typeName}\n dialogStrings={props.createOrderTemplateDialogResources}\n onCancel={onCancel}\n onSuccess={props.onOrderTemplateCreated}\n />\n </>\n );\n};\n\nexport default CreateOrderTemplateButton;","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { OrderTemplate } from '@msdyn365-commerce-modules/retail-actions';\nimport { Alert, Heading, IModuleProps, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport { IOrderTemplateNameDialogResources } from '@msdyn365-commerce/components';\nimport { deleteAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductListsDataActions.g';\nimport classnames from 'classnames';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\nimport { ISingleOrderTemplateProps, ISingleOrderTemplateViewProps, OrderTemplateListStatusMessage, OrderTemplateRender } from './components/';\nimport CreateNewTemplateButtonComponent from './components/create-order-template';\nimport { IOrderTemplateListData } from './order-template-list.data';\nimport { IOrderTemplateListProps, IOrderTemplateListResources } from './order-template-list.props.autogenerated';\n\nexport interface IOrderTemplateActionMessageState {\n itemKey: string;\n userMessage: string;\n statusCssString: string;\n messageGlyph: string;\n isOpen: boolean;\n headerStatusMessage: string;\n}\n\nexport type orderTemplateListStatus = 'LOADING' | 'SUCCESS' | 'FAILED' | 'EMPTY';\n\nexport interface IOrderTemplateListViewProps extends IOrderTemplateListProps<IOrderTemplateListData> {\n OrderTemplateList: IModuleProps;\n status?: orderTemplateListStatus;\n statusMessage?: React.ReactNode;\n heading?: React.ReactNode;\n OrderTemplates?: INodeProps;\n OrderTemplate?: INodeProps;\n orderTemplates?: ISingleOrderTemplateViewProps[];\n createOrderTemplateButton?: React.ReactNode;\n templateHeaderStatusMessage?: React.ReactNode;\n}\n\n/**\n *\n * OrderTemplateList component\n * @extends {React.PureComponent<IOrderTemplateListProps<IOrderTemplateListData>, IOrderTemplateListActionMessageState>}\n */\n@observer\nclass OrderTemplateList extends React.Component<IOrderTemplateListProps<IOrderTemplateListData>, IOrderTemplateActionMessageState> {\n\n constructor(props: IOrderTemplateListProps<IOrderTemplateListData>) {\n super(props);\n this.state = {\n itemKey: '',\n userMessage: '',\n headerStatusMessage: '',\n statusCssString: 'success',\n messageGlyph: 'fas fa-check',\n isOpen: false,\n };\n }\n\n public async componentDidMount(): Promise<void> {\n this.setState({});\n }\n\n public render(): JSX.Element | null {\n const { className } = this.props.config;\n const { emptyOrderTemplateText, createNewTemplateButtonText } = this.props.resources;\n const { orderTemplates } = this.props.data;\n const orderTemplatesData = orderTemplates && (orderTemplates).result;\n\n if (orderTemplates.status === 'LOADING') {\n const errorProps: IOrderTemplateListViewProps = {\n ...(this.props as IOrderTemplateListProps<IOrderTemplateListData>),\n OrderTemplateList: {\n moduleProps: this.props,\n className: classnames('ms-order-template', className),\n },\n status: 'LOADING',\n statusMessage: <OrderTemplateListStatusMessage errorType='LOADING' text='Loading...'/>,\n heading: (\n <Heading\n className='ms-order-template__heading'\n text={this.props.resources.orderTemplateListTitle}\n />\n ),\n };\n return this.props.renderView(errorProps);\n }\n\n if (!!orderTemplatesData && orderTemplatesData.length === 0) {\n // when no order templates are found for customer\n const emptyViewProps: IOrderTemplateListViewProps = {\n ...(this.props as IOrderTemplateListProps<IOrderTemplateListData>),\n OrderTemplateList: {\n moduleProps: this.props,\n className: classnames('ms-order-template', className),\n },\n status: 'EMPTY',\n statusMessage: <OrderTemplateListStatusMessage errorType='EMPTY' text={ emptyOrderTemplateText }/>,\n heading: (\n <Heading\n className='ms-order-template__heading'\n text={this.props.resources.orderTemplateListTitle}\n />\n ),\n };\n\n return this.props.renderView(emptyViewProps);\n }\n\n const viewProps: IOrderTemplateListViewProps = {\n ...(this.props as IOrderTemplateListProps<IOrderTemplateListData>),\n OrderTemplateList: {\n moduleProps: this.props,\n className: classnames('ms-order-template', className),\n },\n status: 'SUCCESS',\n heading: (\n <Heading\n className='ms-order-template__heading'\n text={this.props.resources.orderTemplateListTitle}\n />\n ),\n createOrderTemplateButton: (\n <CreateNewTemplateButtonComponent\n context={this.props.context}\n id={this.props.id}\n typeName={this.props.typeName}\n data={{}}\n createOrderTemplateText={createNewTemplateButtonText}\n onOrderTemplateCreated={this._reloadPage}\n createOrderTemplateDialogResources={this._generateOrderTemplateNameDialogResources(this.props.resources)}\n />\n ),\n templateHeaderStatusMessage: this.state.isOpen && this.state.headerStatusMessage && (\n <div className='ms-order-template__products-status'>\n <Alert color={this.state.statusCssString} isOpen={this.state.isOpen} toggle={this._onDismiss}>\n <span>{this.state.headerStatusMessage}</span>\n </Alert>\n </div>\n ),\n OrderTemplates: {\n className: 'ms-order-template__list-item',\n tag: 'ul',\n },\n OrderTemplate: {\n className: 'ms-order-template__tile',\n tag: 'li',\n },\n orderTemplates: orderTemplatesData && this._renderOrderTemplateList(orderTemplatesData)\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private _generateOrderTemplateNameDialogResources(resources: IOrderTemplateListResources): IOrderTemplateNameDialogResources {\n return {\n orderTemplateHeaderLabel: resources.createOrderTemplateHeader,\n orderTemplateTitleLabel: resources.orderTemplateTitle,\n orderTemplateNameAriaLabel: resources.orderTemplateNameAriaLabel,\n orderTemplateDescription: resources.createOrderTemplateDescription,\n\n defaultOrderTemplateName: resources.defaultOrderTemplateName,\n\n orderTemplateButtonLabel: resources.createOrderTemplateButtonText,\n orderTemplateCancelButtonLabel: resources.cancelNewOrderTemplateCreationButtonText\n };\n }\n\n private _renderOrderTemplateList(orderTemplates: OrderTemplate[]): ISingleOrderTemplateViewProps[] {\n const { context, telemetry } = this.props;\n const { imageSettings, enableImageProductLink } = this.props.config;\n return orderTemplates.map((orderTemplate: OrderTemplate, index) => {\n const currentTemplateProps: ISingleOrderTemplateProps = {\n orderTemplateState: this.state,\n Id: orderTemplate.productList.Id,\n name: orderTemplate.productList.Name,\n orderTemplate: orderTemplate,\n context: context,\n imageSettings: imageSettings,\n enableImageProductLink: enableImageProductLink,\n removeFromOrderTemplateListText: 'remove',\n addToBagText: this.props.resources.addToBagButtonText,\n index: index,\n itemKey: orderTemplate.productList.Id,\n telemetry: telemetry,\n moduleId: this.props.id,\n moduleTypeName: this.props.typeName,\n handlers: {\n onRemoveOrderTemplate: this._onRemoveFromOrderTemplateList,\n onDismiss: this._onDismiss,\n },\n resources: {\n closeWindowButtonText: this.props.resources.closeWindowButtonText,\n addToCartFailureMessage: this.props.resources.addToCartFailureMessage,\n addToCartSuccessMessage: this.props.resources.addToCartSuccessMessage,\n addToCartProcessMessage: this.props.resources.addToCartProcessMessage,\n linesAddedToCartDialogResources: {\n viewCartButtonText: this.props.resources.viewCartButtonText,\n orderTemplateCloseButtonText: this.props.resources.orderTemplateCloseButtonText,\n linesAddedToCartHeaderItemsOneText: this.props.resources.linesAddedToCartHeaderItemsOneText,\n linesAddedToCartHeaderLinesOneText: this.props.resources.linesAddedToCartHeaderLinesOneText,\n linesAddedToCartHeaderLinesFormatText: this.props.resources.linesAddedToCartHeaderLinesFormatText,\n linesAddedToCartHeaderMessageText: this.props.resources.linesAddedToCartHeaderMessageText\n }\n }\n };\n\n return (\n OrderTemplateRender(currentTemplateProps)!\n );\n });\n }\n\n private _onDismiss = () => {\n this.setState({\n isOpen: false\n });\n }\n\n private _reloadPage = async () => {\n window.location.reload();\n }\n\n private _onRemoveFromOrderTemplateList = (productListId: string): void | undefined => {\n const { context, data, telemetry, resources } = this.props;\n const { orderTemplates } = data;\n\n if (context && context.actionContext) {\n const userToken = context.request.user.isAuthenticated && context.request.user.token;\n if (userToken && orderTemplates.result && orderTemplates.result[0] && productListId) {\n const orderTemplate = orderTemplates.result.find(p => p.productList.Id === productListId);\n if (orderTemplate) {\n deleteAsync({ callerContext: context.actionContext }, orderTemplate.productList)\n .then()\n .catch((error: string) => {\n telemetry.warning('[order-template-list] Unable to delete order template.');\n telemetry.error(error);\n this.setState({\n itemKey: productListId,\n headerStatusMessage: resources.deleteOrderTemplateFailedText,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n });\n }).then(this._reloadPage);\n } else {\n telemetry.warning('[order-template-list] Failed to delete order template. Order template was not found');\n }\n } else {\n telemetry.warning('[order-template-list] Failed to delete order template.');\n }\n }\n }\n\n}\n\nexport default OrderTemplateList;\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IPromoBannerCloseButton {\n closeButtonAriaLabel?: string;\n label?: string;\n telemetryContent?: ITelemetryContent;\n onClose(): void;\n\n}\n\nexport const PromoBannerCloseButton: React.FC<IPromoBannerCloseButton> = ({ closeButtonAriaLabel, label, telemetryContent, onClose }) => {\n const payLoad = getPayloadObject('click', telemetryContent!, TelemetryConstant.PromoBannerClose);\n const attributes = getTelemetryAttributes(telemetryContent!, payLoad);\n return (\n <button className='ms-promo-banner__close-button' aria-label={closeButtonAriaLabel} onClick={onClose} {...attributes}>\n <span className='ms-promo-banner__close-button__label' aria-hidden={true}>{label}</span>\n </button>\n );\n};","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport * as React from 'react';\nimport { ILinksData } from '../promo-banner.props.autogenerated';\n\nexport interface IPromoBannerLinks {\n links: ILinksData[];\n requestContext: Msdyn365.IRequestContext;\n telemetryContent: ITelemetryContent;\n onTextChange?(index: number): (event: Msdyn365.ContentEditableEvent) => void;\n}\n\nexport const PromoBannerLinks: React.FC<IPromoBannerLinks> = ({ links, requestContext, onTextChange, telemetryContent }) => {\n const editableLinks = _mapEditableLinks(links, telemetryContent);\n return(\n <span className='ms-promo-banner__links'>\n {editableLinks && editableLinks.length ?\n <Msdyn365.Links\n links= {editableLinks}\n editProps={{onTextChange: onTextChange, requestContext: requestContext}}\n />\n : null\n }\n </span>\n );\n};\n\nconst _mapEditableLinks = (linkdata: ILinksData[], telemetryContent: ITelemetryContent): Msdyn365.ILinksData[] | null => {\n if(!linkdata || linkdata.length === 0) {\n return null;\n }\n const editableLinks: Msdyn365.ILinksData[] = [];\n linkdata.forEach((link,index) => {\n // Construct telemetry attribute to render\n const payLoad = getPayloadObject('click', telemetryContent, '', '');\n const linkText = link.linkText ? link.linkText : '';\n payLoad.contentAction.etext = linkText;\n const attributes = getTelemetryAttributes(telemetryContent, payLoad);\n const editableLink: Msdyn365.ILinksData = {\n ariaLabel: link.ariaLabel,\n className: 'ms-promo-banner__link',\n linkText: link.linkText,\n linkUrl: link.linkUrl.destinationUrl,\n openInNewTab: link.openInNewTab,\n role: 'button',\n additionalProperties: attributes,\n onClick: onTelemetryClick(telemetryContent, payLoad, linkText)\n };\n editableLinks.push(editableLink);\n });\n\n return editableLinks;\n};\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport * as React from 'react';\n\nexport interface IPromoBannerText {\n text: string;\n requestContext: Msdyn365.IRequestContext;\n onTextChange(event: Msdyn365.ContentEditableEvent): void;\n}\n\nexport const PromoBannerText: React.FC<IPromoBannerText> = ({ text, onTextChange, requestContext }) => {\n return(\n <Msdyn365.Text\n className='ms-promo-banner__text'\n tag={'span'}\n text={text}\n editProps = {{onEdit: onTextChange, requestContext: requestContext}}\n />\n );\n};","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport { Carousel } from '@msdyn365-commerce/components';\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport classnames from 'classnames';\nimport * as React from 'react';\nimport { PromoBannerCloseButton, PromoBannerLinks, PromoBannerText } from './components';\nimport { IBannerMessagesData, IPromoBannerProps } from './promo-banner.props.autogenerated';\n\nexport interface IPromoBannerState {\n animating: boolean;\n isVisible: boolean;\n activeIndex: number;\n}\n\nexport interface IPromoBannerViewProps extends IPromoBannerProps<{}>, IPromoBannerState {\n promoBannerProps: IModuleProps;\n contentProps: INodeProps ;\n bannerMessages: IBannerMessagesData[];\n PromoBannerTextProps: INodeProps;\n PromoBannerLinksProps: INodeProps;\n CarouselProps: INodeProps;\n closeButton?: React.ReactNode;\n className: string;\n onDismiss(): void;\n handleText(): void;\n handleLinks(): void;\n}\n\n/**\n *\n * PromoBannerModule component\n * @extends {React.PureComponent<IPromoBannerProps<IPromoBannerState>>}\n */\nclass PromoBanner extends React.PureComponent<IPromoBannerProps<{}>, IPromoBannerState> {\n public state: IPromoBannerState = {\n animating: false,\n isVisible: true,\n activeIndex: 0\n };\n\n private telemetryContent: ITelemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry);\n\n public render(): JSX.Element | null {\n const { bannerMessages, dismissEnabled, interval, hideFlipper, autoplay, className= '' } = this.props.config;\n const { closeButtonAriaLabel, closeButtonLabel } = this.props.resources;\n const { isVisible, activeIndex } = this.state;\n\n if (!isVisible) {\n this.props.context.telemetry.error('Promo banner content is empty, module wont render.');\n return null;\n }\n\n const viewProps = {\n // Context for telemetry and raw data for C1 to do customization\n // Including computed data, state data and methods\n ...this.props,\n className: classnames('ms-promo-banner', className),\n isVisible, // state data\n onDismiss: this._onDismiss, // methods\n handleLinks: this.handleLinkTextChange,\n handleText: this.handleTextChange,\n\n promoBannerProps: { className: classnames('ms-promo-banner', className), moduleProps: this.props, role: 'banner' },\n PromoBannerTextProps: {\n tag: PromoBannerText\n },\n PromoBannerLinksProps: {\n tag: PromoBannerLinks,\n telemetryContent: this.telemetryContent\n },\n contentProps: { className: 'ms-promo-banner__content' },\n bannerMessages: bannerMessages,\n activeIndex: activeIndex,\n CarouselProps: {\n tag: Carousel,\n className: 'ms-promo-banner__carousel',\n activeIndex: activeIndex,\n next: this._next,\n previous: this._previous,\n onIndicatorsClickHandler: this._goToIndex,\n hideIndicator: hideFlipper,\n interval: interval,\n hideFlipper: hideFlipper,\n autoplay: autoplay\n },\n closeButton: dismissEnabled && <PromoBannerCloseButton {...{ onClose: this._onDismiss, label: closeButtonLabel, closeButtonAriaLabel, telemetryContent: this.telemetryContent }} />\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n public handleTextChange = (event: Msdyn365.ContentEditableEvent) => {\n if(this.props.config.bannerMessages && this.props.config.bannerMessages[0]) {\n this.props.config.bannerMessages[0].text = event.target.value;\n }\n }\n public handleLinkTextChange = (linkIndex: number) => (event: Msdyn365.ContentEditableEvent) => {\n if(this.props.config.bannerMessages && this.props.config.bannerMessages[1]) {\n const links = this.props.config.bannerMessages[1].links;\n if(links) {\n links[linkIndex].linkText = event.target.value;\n }\n }\n };\n\n private _next = (): void => {\n const nextIndex = this._isLastItem() ? 0 : this.state.activeIndex + 1;\n this._goToIndex(nextIndex);\n };\n\n private _previous = (): void => {\n const nextIndex = this._isFirstItem() ? (this.props.config.bannerMessages ? this.props.config.bannerMessages.length - 1 : 0) : this.state.activeIndex - 1;\n this._goToIndex(nextIndex);\n };\n\n private _goToIndex = (index: number): void => {\n if (this.state.animating) {\n return;\n }\n this.setState({ activeIndex: index });\n };\n\n private _isFirstItem = () => this.state.activeIndex === 0;\n\n private _isLastItem = () => this.props.config.bannerMessages && this.state.activeIndex === this.props.config.bannerMessages.length - 1;\n\n private _onDismiss = (): void => {\n this.setState({ isVisible: false });\n };\n}\n\nexport default PromoBanner;\n","import OrderTemplateLines from './modules/order-template/order-template';\nimport OrderTemplateLinesView from './modules/order-template/order-template.view';\n\nexport * from './modules/order-template/order-template';\nexport * from './modules/order-template/order-template.view';\nexport * from './modules/order-template/order-template.data';\nexport * from './modules/order-template/components';\n// export * from './modules/order-template/actions';\nexport * from './modules/order-template/order-template.props.autogenerated';\nexport * from './modules/order-template-list/order-template-list';\nexport * from './modules/order-template-list/order-template-list.view';\nexport * from './modules/order-template-list/order-template-list.data';\nexport * from './modules/order-template-list/components';\n\nexport {\n OrderTemplateLines,\n OrderTemplateLinesView\n};","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Button, INodeProps, Modal, ModalBody, ModalFooter, ModalHeader, Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\nimport { IOrderTemplateLineViewProps } from './components';\nimport { IOrderTemplateViewProps } from './order-template';\n\nconst OrderTemplateLinesView: React.FC<IOrderTemplateViewProps> = (props: IOrderTemplateViewProps) => {\n const {\n OrderTemplateLines,\n status,\n statusMessage,\n heading,\n ProductsTable,\n ProductsTableHeading,\n orderLines,\n ProductsTableRow,\n productsStatusMessage,\n OrderTemplateActions,\n orderActions,\n pagination,\n itemAddedToCartDialog,\n bulkOrderLineActions,\n isDetailsDisplayed,\n detailedProductView,\n toggleDetailsDisplayed,\n resources: {\n cancelBtnLabel,\n productNumberText,\n productText,\n productUnitPriceText,\n productUOMText,\n productQuantityText\n }\n } = props;\n\n const toggleDetails = () => {\n toggleDetailsDisplayed && toggleDetailsDisplayed(undefined);\n };\n\n return (\n <Module {...OrderTemplateLines}>\n {heading}\n {OrderTemplateActions && (\n <Node {...OrderTemplateActions}>\n {orderActions?.addTemplateToBag}\n {orderActions?.renameTemplate}\n {orderActions?.removeTemplate}\n {!isDetailsDisplayed && productsStatusMessage}\n </Node>\n )}\n {bulkOrderLineActions}\n {status !== 'SUCCESS' && statusMessage}\n {ProductsTable && orderLines && orderLines.length > 0 && (\n <Node className='ms-order-template__content'>\n <Node {...ProductsTable}>\n {ProductsTableHeading}\n <tbody>\n {orderLines &&\n orderLines.map(product => {\n return _renderItem(product, productQuantityText, ProductsTableRow);\n })}\n </tbody>\n </Node>\n {pagination}\n </Node>\n )}\n {itemAddedToCartDialog}\n <Modal\n wrapClassName={'ms-order-template-mobile-view-modal'}\n autoFocus={true}\n fade={false}\n applicationNode={'renderPage'}\n isOpen={isDetailsDisplayed}\n toggle ={toggleDetails}\n >\n <ModalHeader toggle={toggleDetails}>\n Product Details\n </ModalHeader>\n <ModalBody>\n <ul>\n <li>{detailedProductView?.productImage}</li>\n <li className='product-info'><span>{productText}:</span>{detailedProductView?.productInfo}</li>\n <li><span>{productNumberText}:</span>{detailedProductView?.productNumber}</li>\n <li><span>{productUnitPriceText}:</span> {detailedProductView?.productPrice}</li>\n <li><span>{productUOMText}:</span> {detailedProductView?.productUnitOfMeasure}</li>\n <li><span>{productQuantityText}:</span>{detailedProductView?.productQuantityView}</li>\n {productsStatusMessage && <li>{productsStatusMessage}</li>}\n </ul>\n </ModalBody>\n <ModalFooter>\n <Button onClick={toggleDetails}>{cancelBtnLabel}</Button>\n </ModalFooter>\n </Modal>\n </Module>\n );\n};\n\nconst _renderItem = (\n product: IOrderTemplateLineViewProps,\n quantityLabel: string,\n ProductsTableRow?: INodeProps\n): JSX.Element | null => {\n if (!product) {\n return null;\n }\n\n const {\n key,\n selectLine,\n productImage,\n productPrice,\n productNumber,\n addToBagButton,\n removeButton,\n productInfo,\n productUnitOfMeasure,\n productQuantityView,\n productQuantity,\n popUp,\n isMobile\n } = product;\n\n return (\n <Node key={key} className={ProductsTableRow!.className} {...ProductsTableRow}>\n <td>{selectLine}</td>\n <td>{productImage}</td>\n {isMobile ? <td><div>{productNumber}</div><div>{quantityLabel}: {productQuantity}</div></td> : <td>{productNumber}</td>}\n {!isMobile && <td>{productInfo}</td>}\n {!isMobile && <td>{productPrice}</td>}\n {!isMobile && <td>{productUnitOfMeasure}</td>}\n {!isMobile && <td>{productQuantityView}</td>}\n {isMobile && <td>{popUp}</td> }\n {!isMobile &&\n <td>\n {addToBagButton}\n {removeButton}\n </td>}\n </Node>\n );\n};\n\nexport default OrderTemplateLinesView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nimport {INodeProps, Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport { ISingleOrderTemplateViewProps } from './components';\nimport { IOrderTemplateListViewProps } from './order-template-list';\n\nexport const OrderTemplateListView: React.FC<IOrderTemplateListViewProps> = props => {\n const { OrderTemplateList, status, statusMessage, heading, OrderTemplates, orderTemplates, OrderTemplate, createOrderTemplateButton, templateHeaderStatusMessage } = props;\n\n return (\n <Module {...OrderTemplateList}>\n {heading}\n {status !== 'SUCCESS' && statusMessage}\n <Node className=''>\n {createOrderTemplateButton}\n {templateHeaderStatusMessage}\n </Node>\n { OrderTemplates && orderTemplates && orderTemplates.length > 0 &&\n <Node {...OrderTemplates}>\n {orderTemplates && orderTemplates.map((orderTemplate) => {\n return _renderOrderTemplate(orderTemplate, OrderTemplate);\n })}\n </Node>\n }\n </Module>\n );\n};\n\nconst _renderOrderTemplate = (orderTemplate: ISingleOrderTemplateViewProps, OrderTemplate?: INodeProps): JSX.Element | null => {\n\n const { key, addToCartButton, orderTemplateImage, orderTemplateStatusMessage, removeButton, orderTemplateName } = orderTemplate;\n return (\n <Node key={key} className={OrderTemplate!.className} {...OrderTemplate}>\n {orderTemplateName}\n {orderTemplateImage}\n {addToCartButton}\n {removeButton}\n {orderTemplateStatusMessage}\n </Node>\n );\n};\n\nexport default OrderTemplateListView;"],"sourceRoot":""}