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rB,CACI,MAAMA,EAAa,iDACnBJ,EAAQE,YAAYE,GAAcI,EAAQ,KAC1CL,EAAiBC,GAGrB,CACI,MAAMA,EAAa,wCACnBJ,EAAQE,YAAYE,GAAcI,EAAQ,KAC1CL,EAAiBC,GAGrB,CACI,MAAMA,EAAa,6CACnBJ,EAAQE,YAAYE,GAAcI,EAAQ,KAC1CL,EAAiBC,GAGrB,CACI,MAAMA,EAAa,0CACnBJ,EAAQE,YAAYE,GAAcI,EAAQ,KAC1CL,EAAiBC,GAGrB,CACI,MAAMA,EAAa,uEACnBJ,EAAQE,YAAYE,GAAcI,EAAQ,KAC1CL,EAAiBC,GAGrB,CACI,MAAMA,EAAa,uEACnBJ,EAAQE,YAAYE,GAAcI,EAAQ,KAC1CL,EAAiBC,GAGrB,CACI,MAAMA,EAAa,gEACnBJ,EAAQE,YAAYE,GAAcI,EAAQ,KAC1CL,EAAiBC,GAGrB,CACI,MAAMA,EAAa,qEACnBJ,EAAQE,YAAYE,GAAcI,EAAQ,KAC1CL,EAAiBC,GAGrB,CACI,MAAMA,EAAa,yEACnBJ,EAAQE,YAAYE,GAAcI,EAAQ,KAC1CL,EAAiBC,GAIzB3a,OAAOgb,aAAehb,OAAOgb,cAAgB,GAC7Chb,OAAOgb,aAAaR,QAApB,OACOxa,OAAOgb,aAAaR,SAAW,IAC/BD,EAAQC,SAGXxa,OAAOgb,aAAaC,mBAAqB,GACzCjb,OAAOgb,aAAaC,mBAApB,eACOV,EAAQE,iCC7evBS,EAAOC,QAAUC,2BCAjBF,EAAOC,QAAUE","sources":["webpack://mattressfirm/./src/Utilities/cart-utils.ts?6ba1","webpack://mattressfirm/./src/Utilities/plp-url-utils.ts?728b","webpack://mattressfirm/./src/Utilities/select-financing-offer.tsx?5f53","webpack://mattressfirm/./src/actions/BonusItemDataServiceEntities.g.ts?cf80","webpack://mattressfirm/./src/actions/BonusItemDataActionExtension.g.ts?22ff","webpack://mattressfirm/./src/actions/bonus-coupon-details.action.ts?7fb2","webpack://mattressfirm/./src/actions/bonus-item-product.action.ts?0b53","webpack://mattressfirm/./src/actions/checkout-billing-validity.action.ts?484f","webpack://mattressfirm/./src/actions/checkout-disabled-button-state.action.ts?ab08","webpack://mattressfirm/./src/actions/complete-your-bed-pillow.action.ts?db7f","webpack://mattressfirm/./src/actions/complete-your-bed-protector.action.ts?82b2","webpack://mattressfirm/./src/actions/express-edit-state.action.ts?e40f","webpack://mattressfirm/./src/actions/express-order-submit-state.action.ts?3687","webpack://mattressfirm/./src/actions/fetch-choose-your-foundation-database.action.ts?867b","webpack://mattressfirm/./src/actions/fetch-complete-your-bed.action.ts?ea35","webpack://mattressfirm/./src/actions/fetch-core-delivery-list.action.ts?41e3","webpack://mattressfirm/./src/actions/get-delivery-fee-update.action.ts?8fde","webpack://mattressfirm/./src/actions/get-mattress-foundations-to-add.action.ts?7e5d","webpack://mattressfirm/./src/actions/get-mfrm-products-category-paths.action.ts?dc81","webpack://mattressfirm/./src/actions/get-recycle-fee-checkout.action.ts?9366","webpack://mattressfirm/./src/actions/get-sm-inventory-status.action.ts?cb72","webpack://mattressfirm/./src/actions/get-soci-data.action.ts?ce73","webpack://mattressfirm/./src/actions/TryInStoreDataServiceEntities.g.ts?ea57","webpack://mattressfirm/./src/actions/TryInStoreDataActionExtension.g.ts?c8db","webpack://mattressfirm/./src/actions/get-try-in-store-info.action.ts?dff9","webpack://mattressfirm/./src/actions/get-unbxd-product-recommendations.action.ts?bae6","webpack://mattressfirm/./src/actions/payment-redirect-to-order-confirmation.action.ts?c6dc","webpack://mattressfirm/./src/actions/paypal-express-edit-state.action.ts?34db","webpack://mattressfirm/./src/actions/paypalexpress-tryagain-trigger.action.ts?df08","webpack://mattressfirm/./src/actions/paypalsuccesstrigger.action.ts?ccb0","webpack://mattressfirm/./src/actions/select-your-foundation.action.ts?e743","webpack://mattressfirm/./src/actions/social-icons-state.action.ts?1e1b","webpack://mattressfirm/./src/actions/srp-breadcrumb-page.action.ts?4397","webpack://mattressfirm/./src/actions/trigger-special-synchrony-financing.action.ts?1948","webpack://mattressfirm/./src/actions/update-monthly-payment.action.ts?0e43","webpack://mattressfirm/./src/actions/user-defined-promocode.action.ts?c234","webpack://mattressfirm/./src/actions/wmap-address-state.action.ts?f45e","webpack://mattressfirm/./src/actions/zip-code-state.action.ts?958a","webpack://mattressfirm/./src/actions/zip-code-validation.action.ts?0973","webpack://mattressfirm/./src/data-actions/atp-slots-information-state.action.ts?6f2e","webpack://mattressfirm/./src/data-actions/bonuscoupons-action.action.ts?e535","webpack://mattressfirm/./src/data-actions/brightspot-content-action.action.ts?2792","webpack://mattressfirm/./src/data-actions/financing-offer-state.action.ts?9faa","webpack://mattressfirm/./src/data-actions/get-address-from-zipcode.action.ts?d9c9","webpack://mattressfirm/./src/data-actions/get-card-payment-accept-point.override.action.ts?a2c5","webpack://mattressfirm/./src/data-actions/get-comfort-type.action.ts?e535","webpack://mattressfirm/./src/data-actions/get-dimensions-for-selected-variant.override.action.ts?2573","webpack://mattressfirm/./src/data-actions/get-franchise-data.action.ts?7044","webpack://mattressfirm/./src/data-actions/get-product-benefit-enhanced-content.action.ts?85e9","webpack://mattressfirm/./src/data-actions/get-product-benefits-data.action.ts?1d43","webpack://mattressfirm/./src/data-actions/get-promocode-value.action.ts?e12d","webpack://mattressfirm/./src/data-actions/get-resons-to-buy-data.action.ts?34a7","webpack://mattressfirm/./src/data-actions/get-sales-order-details-action.action.ts?5a8b","webpack://mattressfirm/./src/data-actions/get-seo-data.action.ts?b8ff","webpack://mattressfirm/./src/data-actions/get-sleep-disruptor-icons.action.ts?0ec7","webpack://mattressfirm/./src/data-actions/get-store-location-information.override.action.ts?f6e2","webpack://mattressfirm/./src/data-actions/mfi-atp-inventory.action.ts?2cbf","webpack://mattressfirm/./src/data-actions/mfrm-mfi-bonusitem.action.ts?15d0","webpack://mattressfirm/./src/data-actions/mfrm-notification.action.ts?70c5","webpack://mattressfirm/./src/data-actions/payment-cc-card-types.action.ts?37d5","webpack://mattressfirm/./src/data-actions/payment-error-state.action.ts?5f0f","webpack://mattressfirm/./src/data-actions/products-by-category.override.action.ts?6afc","webpack://mattressfirm/./src/data-actions/products-by-recommendation.override.action.ts?9a45","webpack://mattressfirm/./src/data-actions/products-by-relationship-id.override.action.ts?f0f3","webpack://mattressfirm/./src/data-actions/products-get-by-id.action.ts?0a83","webpack://mattressfirm/./src/data-actions/progressive-leasing-modal-state.action.ts?5447","webpack://mattressfirm/./src/data-actions/promocode-applied-in-progress.action.ts?91e5","webpack://mattressfirm/./src/data-actions/redirect-to-wmap-submit-payment.action.ts?70c9","webpack://mattressfirm/./src/data-actions/search-org-unit-locations.action.ts?6dc5","webpack://mattressfirm/./src/data-actions/toggle-submit-order-button.action.ts?9a11","webpack://mattressfirm/./src/data-actions/update-email-call.action.ts?bac8","webpack://mattressfirm/./src/data-actions/wmap-get-order-details.action.ts?108d","webpack://mattressfirm/./src/data-actions/wmap-submit-payment.action.ts?1746","webpack://mattressfirm/./src/modules/mfrm-autosuggest/actions/get-unbxd-search-autosuggest.action.ts?8fd0","webpack://mattressfirm/./src/modules/mfrm-category-page-summary/mfrm-category-page-summary.action.ts?d22e","webpack://mattressfirm/./src/modules/mfrm-product-page-summary/get-product-recordId.action.ts?a795","webpack://mattressfirm/./src/modules/mfrm-products-compare/get-unbxd-collection-compare-data.action.ts?e1f9","webpack://mattressfirm/./lib/__local__/module-registration.js?8a42","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["import MsDyn365 from '@msdyn365-commerce/core';\r\nimport {IProductDetails,IProductBonusItems, IProductBonusWithBrandName } from '../modules/mfrm-cart/mfrm-cart';\r\nimport {IMFIBonusItemsResponse, IMFIGetBonusCouponsDetailsResponse} from '../actions/BonusItemDataServiceEntities.g';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\nexport interface IMFRMDateGroupedProducts {\r\n dateStr: string;\r\n days?: string;\r\n productVariantRecordIds: number[];\r\n productItemIds: string[];\r\n productsType: string;\r\n}\r\n\r\nexport interface IExpressFlow {\r\n paymentEdit: boolean\r\n}\r\n\r\nconst getSetLocalStorage = (key: string, getSet: string, valueToSet?: any, returnType?: any) => {\r\n if (MsDyn365.isBrowser) {\r\n switch (getSet) {\r\n case 'set':\r\n return localStorage.setItem(key, JSON.stringify(valueToSet || returnType));\r\n case 'get':\r\n return JSON.parse(localStorage.getItem(key) || '[]');\r\n default:\r\n return returnType;\r\n }\r\n } else {\r\n return returnType;\r\n }\r\n};\r\n\r\nexport const getSetProductData = (getSet: string, products?: IProductDetails[]) => {\r\n return getSetLocalStorage('product_details', getSet, products, []);\r\n};\r\n\r\nexport const getSetProductSpec = (getSet: string, products?: IProductDetails[]) => {\r\n return getSetLocalStorage('product_specification', getSet, products, []);\r\n};\r\n\r\nexport const getSetPromoCodeApplyList = (getSet: string) => {\r\n return getSetLocalStorage('promo_code_apply_list', getSet, [], []);\r\n};\r\n\r\nexport const getSetPromoCode = (getSet: string) => {\r\n return getSetLocalStorage('promoCode', getSet, [], []);\r\n};\r\n\r\nexport const getSetGrandTotal = (getSet: string, total?: string) => {\r\n return getSetLocalStorage('grand_total', getSet, total, 0);\r\n};\r\n\r\nexport const getSetBonusItemProd = (getSet: string, globalBonusItems?: IMFIBonusItemsResponse[])=>{\r\n return getSetLocalStorage('BonusItemProduct', getSet, globalBonusItems, []);\r\n};\r\n\r\nexport const getSetSelectedBonasItem = (getSet: string, bonusItemArray?: IProductBonusItems[]) => {\r\n return getSetLocalStorage('selectedBonasItems', getSet, bonusItemArray, []);\r\n};\r\n\r\nexport const getSetBonusCouponDetail = (getSet: string, getCoupons?: IMFIGetBonusCouponsDetailsResponse[])=>{\r\n return getSetLocalStorage('bonusCouponsDetail', getSet, getCoupons, []);\r\n};\r\n\r\nexport const getSetPrevBonasModalState = (getSet: string, previousBonasModal?: IProductBonusItems[]) => {\r\n return getSetLocalStorage('previousBonasModalState', getSet, previousBonasModal, []);\r\n};\r\n\r\nexport const getSetBonusItemBrandName = (getSet: string, bonusItemsBrandName?: IProductBonusWithBrandName[]) => {\r\n return getSetLocalStorage('bonusItmesWithBrand', getSet, bonusItemsBrandName, []);\r\n};\r\n\r\nexport const getSetDateGroupedProducts = (getSet: string, products?: IMFRMDateGroupedProducts[]) => {\r\n return getSetLocalStorage('date_grouped_products', getSet, products, []);\r\n};\r\n\r\nexport const getSetExpressFlow = (getSet: string, express?: IExpressFlow) => {\r\n return getSetLocalStorage('express_flow', getSet, express, []);\r\n};\r\nexport const getSetWmapCartLines = (getSet: string, products?: { product: SimpleProduct, count: number }[]) => {\r\n return getSetLocalStorage('wmapCartLines', getSet, products, []);\r\n};","import { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { IRequestContext } from '@msdyn365-commerce/core';\r\nimport { ProductRefinerValue } from '@msdyn365-commerce/retail-proxy';\r\nexport interface IVirtualRefinersConfig {\r\n order: number;\r\n refinerName: string;\r\n enableForMattresses: boolean;\r\n enableForOtherCategories: boolean;\r\n allowDuplicate: boolean;\r\n}\r\n\r\n/**\r\n * This will create the canonicalURL as per 7924 requirement\r\n * @param requestContext\r\n * @returns string of canonical URL\r\n */\r\nexport const canonicalURL = (requestContext: IRequestContext): string => {\r\n const requestUrl = requestContext.url.requestUrl;\r\n const origin = requestUrl.origin;\r\n const path = requestUrl.pathname.toLowerCase();\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('/').splice(1);\r\n\r\n // remove double values containing pipe sign\r\n if (path.match(/%7c/)) {\r\n urlParts = removePipeSignValue(urlParts);\r\n }\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n const filteredPath = urlParts?.join('/');\r\n\r\n return `${origin}/${filteredPath}`;\r\n};\r\n\r\nexport const filteredURL = (requestContext: IRequestContext): string => {\r\n const requestUrl = requestContext.url.requestUrl;\r\n const path = requestUrl.pathname.toLowerCase();\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('/').splice(1);\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n const filteredPath = urlParts?.join('/');\r\n\r\n return `/${filteredPath}`;\r\n};\r\n\r\n/**\r\n * This will create the canonicalURL as per 7924 requirement\r\n * @param requestContext\r\n * @returns string of canonical URL\r\n */\r\nexport const canonicalURLWithoutBaseUrl = (requestContext: IRequestContext): string => {\r\n const requestUrl = requestContext.url.requestUrl;\r\n const path = requestUrl.pathname.toLowerCase();\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('\\/').splice(1);\r\n\r\n // remove double values containing pipe sign\r\n if (path.match(/%7c/)) {\r\n urlParts = removePipeSignValue(urlParts);\r\n }\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n return urlParts?.join('\\/');\r\n};\r\n\r\n/**\r\n * This will remove the Pipe sign value set from urlParts\r\n * @param urlParts\r\n * @returns\r\n */\r\nexport const removePipeSignValue = (urlParts: string[]) => {\r\n // urlParts.forEach((part, index) => {\r\n // const indexOfValue = urlParts.indexOf('%7c');\r\n // if (indexOfValue !== -1) {\r\n // urlParts.splice(indexOfValue, 1);\r\n // }\r\n // });\r\n\r\n if (urlParts !== undefined && urlParts.length > 0) {\r\n urlParts = urlParts.filter(urlPart => urlPart.indexOf('%7c') === -1);\r\n }\r\n\r\n return urlParts;\r\n};\r\n\r\n/**\r\n * This will remove the keywords from urlParts array which were received from\r\n * the app.settings.json/CMS Extensions\r\n * @param urlParts\r\n * @param requestContext\r\n * @returns urlParts array filtered\r\n */\r\nexport const removeKeywords = (urlParts: string[], requestContext: IRequestContext): string[] => {\r\n const removeKeywordFromUrl = requestContext.app.config.removeKeywordFromUrl;\r\n\r\n if (urlParts.length > 0 && removeKeywordFromUrl && removeKeywordFromUrl.length > 0) {\r\n const removeKeywordFromUrlArray: string[] = removeKeywordFromUrl?.trim().split(',');\r\n removeKeywordFromUrlArray?.length > 0 &&\r\n urlParts.forEach(_part => {\r\n removeKeywordFromUrlArray.forEach(removeKeyword => {\r\n const trimmedKeyword = removeKeyword.trim().toLowerCase();\r\n const indexOfValue = urlParts.indexOf(trimmedKeyword);\r\n if (trimmedKeyword.length > 0 && indexOfValue !== -1) {\r\n urlParts.splice(indexOfValue, 1);\r\n }\r\n });\r\n });\r\n }\r\n\r\n return urlParts;\r\n};\r\n\r\n/**\r\n * This will sort the Virtual refiner config based on order and return\r\n * only active virtual refiner configs based on isMattress category will\r\n * be returned\r\n * @param requestContext\r\n * @param isMattressesCategory boolean | undefined\r\n * @returns IVirtualRefinersConfig[] | undefined\r\n */\r\nexport const getSortedVirtualRefinerConfig = (\r\n requestContext: IRequestContext,\r\n isMattressesCategory: boolean | undefined\r\n): IVirtualRefinersConfig[] | undefined => {\r\n let appConfigSorted = getVirtualRefinerConfig(requestContext);\r\n\r\n // sort the config by provided config\r\n if (appConfigSorted) {\r\n if (isMattressesCategory === true) {\r\n appConfigSorted = appConfigSorted.filter(appConfig => {\r\n return appConfig.enableForMattresses;\r\n });\r\n } else if (isMattressesCategory === false) {\r\n appConfigSorted = appConfigSorted.filter(appConfig => {\r\n return appConfig.enableForOtherCategories;\r\n });\r\n }\r\n appConfigSorted.sort((a: IVirtualRefinersConfig, b: IVirtualRefinersConfig) => {\r\n return a.order - b.order;\r\n });\r\n }\r\n\r\n return appConfigSorted;\r\n};\r\n\r\n/**\r\n * Virtual refiner names from the app.settings.json will be returned which can be used\r\n * to filter out refiners data based upon active virtual refiners\r\n * @param requestContext\r\n * @param isMattressesCategory boolean | undefined\r\n * @returns string[]\r\n */\r\nexport const getVirtualRefinerNames = (requestContext: IRequestContext, isMattressesCategory: boolean | undefined): string[] => {\r\n const sortedVirtualRefinerConfig = getSortedVirtualRefinerConfig(requestContext, isMattressesCategory);\r\n\r\n const appConfigRefinerNames: string[] = [];\r\n\r\n sortedVirtualRefinerConfig &&\r\n sortedVirtualRefinerConfig.forEach(sortedConfig => {\r\n appConfigRefinerNames.push(sortedConfig.refinerName.trim().toLowerCase());\r\n });\r\n\r\n return appConfigRefinerNames;\r\n};\r\n\r\n/**\r\n * This will return the value of virtual refiner configuration\r\n * @param requestContext\r\n * @returns IVirtualRefinersConfig[] | undefined\r\n */\r\nexport const getVirtualRefinerConfig = (requestContext: IRequestContext): IVirtualRefinersConfig[] => {\r\n return requestContext.app.config.urlModifications;\r\n};\r\n\r\nexport async function getVirtualRefinerValues(\r\n requestContext: IRequestContext,\r\n virtualRefiners: IProductRefinerHierarchy[]\r\n): Promise {\r\n const virtualRefinerValues: ProductRefinerValue[] = [];\r\n if (virtualRefiners.length === 0) {\r\n return virtualRefinerValues;\r\n }\r\n const requestUrl = requestContext.url.requestUrl;\r\n // const origin = requestUrl.origin;\r\n const path = requestUrl.pathname;\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('/').splice(1);\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n // remove category id {categoryid}.c\r\n const categoryIdToken = requestContext.urlTokens.recordId;\r\n const categoryId = categoryIdToken ? `${categoryIdToken}.c` : undefined;\r\n\r\n if (categoryId) {\r\n urlParts.splice(-1);\r\n }\r\n\r\n // run loop for each url part and get values from refiners for further usage\r\n const finalizedUrlParts: string[] = [];\r\n urlParts.forEach(plainUrlPart => {\r\n const urlPart = decodeURIComponent(plainUrlPart);\r\n if (urlPart.indexOf('|') !== -1) {\r\n const splitOnPipeSign = urlPart?.split('|');\r\n const filteredParts = splitOnPipeSign.filter(part => part.length > 0);\r\n filteredParts.forEach(filteredPart => {\r\n finalizedUrlParts.push(filteredPart.toLowerCase().trim());\r\n });\r\n }\r\n finalizedUrlParts.push(urlPart);\r\n });\r\n finalizedUrlParts.forEach((urlPart) => {\r\n virtualRefiners.forEach((mainRefiner) => {\r\n mainRefiner.Values.forEach((refinerValue) => {\r\n const refinerValueKeyName = refinerValue.LeftValueBoundString?.toLowerCase().trim().split(' ')?.join('-').replace(/\\&/g, 'and').replace(regExSpecialChars(requestContext.app.config.canonicalUrlspecialCharIncludeList), '-');\r\n if (refinerValueKeyName && refinerValueKeyName === urlPart) {\r\n virtualRefinerValues.push(refinerValue);\r\n }\r\n });\r\n });\r\n });\r\n\r\n return virtualRefinerValues;\r\n}\r\n\r\n/**\r\n * For navigation menu links, it will remove keywords configured in global configurations from the navigation link\r\n * and clp link and return url path string\r\n * @param link\r\n * @param requestContext\r\n * @returns string\r\n */\r\nexport const navLinkKeywordRemoval = (link: string, requestContext: IRequestContext): string => {\r\n // Using the rest operator in case there is a weirdly formatted URL with multiple question marks.\r\n const [linkBase, ...linkParams] = link?.split('?');\r\n\r\n // Only apply to category links and product links, which end in .c or .p. Check that a keyword is configured.\r\n if (!linkBase.endsWith('.c') && !linkBase.endsWith('.p') || !requestContext.app.config) {\r\n return link;\r\n }\r\n\r\n // Separate out url parts split on forward /\r\n let urlParts = linkBase?.split('\\/');\r\n\r\n // Remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n // Glue the URL params back together\r\n const linkParam = linkParams.map(param => `?${param}`)?.join('');\r\n\r\n // Rebuild URL by joining with forward slash and appending any URL parameters\r\n const filteredLink = `${urlParts?.join('/')}${linkParam}`;\r\n return `${filteredLink}`;\r\n};\r\nexport const regExSpecialChars = (includeConfigList: string): RegExp => {\r\n let includeConfig = '';\r\n if (includeConfigList !== undefined && includeConfigList !== '') {\r\n includeConfig = includeConfigList?.trim().split(',')?.join('\\\\\\\\');\r\n includeConfig = includeConfig && includeConfig !== '' ? `\\\\\\\\${includeConfig}` : '';\r\n const pattern = `[^\\\\w\\\\&\\\\|${includeConfig}]`;\r\n // eslint-disable-next-line security/detect-non-literal-regexp\r\n return new RegExp(pattern, 'gi');\r\n } else {\r\n\r\n const pattern = `[^\\\\w\\\\&\\\\|]`;\r\n // eslint-disable-next-line security/detect-non-literal-regexp\r\n return new RegExp(pattern, 'gi');\r\n }\r\n};\r\n","import { RichText } from '@msdyn365-commerce/core';\r\n\r\nimport dayjs from 'dayjs';\r\nimport tz from 'dayjs/plugin/timezone';\r\nimport utc from 'dayjs/plugin/utc';\r\nimport isBetween from 'dayjs/plugin/isBetween';\r\ndayjs.extend(tz);\r\ndayjs.extend(utc);\r\ndayjs.extend(isBetween);\r\nconst format = 'M/D/YYYY';\r\n\r\nexport interface IFinancingOffer {\r\n offerName?: string;\r\n noInterestFor: number;\r\n minPurchase: number;\r\n everydayFinancingOfferMessage:string,\r\n limitedFinancingOfferMessage:string,\r\n monthlyOfferDetails?: RichText;\r\n financingOfferDescription: RichText;\r\n disclaimer: RichText;\r\n offerValidStartDate?: string;\r\n offerValidEndDate?: string;\r\n specialCampaignOffer?: IFinancingOfferCampaign;\r\n checkoutDisplay?: {heading: string; details: string}\r\n}\r\n\r\nexport interface IFinancingOfferFormatted {\r\n numOfMonths: number;\r\n costPerMonth: number;\r\n startDate?: string;\r\n endDate?: string;\r\n isLTO: boolean;\r\n monthlyOfferDetails?: RichText;\r\n minPurchase: number;\r\n everydayFinancingOfferMessage:string;\r\n limitedFinancingOfferMessage:string;\r\n financingOfferDescription: RichText;\r\n disclaimer: RichText;\r\n specialCampaign?: IFinancingOfferCampaign;\r\n offerName?: string;\r\n checkoutDisplay?: {heading: string; details: string}\r\n}\r\n\r\nexport interface IFinancingOfferCampaign {\r\n initialMonthlyAmount: number;\r\n numOfDiscountedMonths: number;\r\n campaignValidStartDate: string;\r\n campaignValidEndDate: string;\r\n enableCampaign: boolean;\r\n showEverydayFlag: boolean;\r\n}\r\n\r\nexport interface ISelectFinancingOfferData {\r\n limitedTimeFinancingOffers: IFinancingOffer[];\r\n everydayFinancingOffers: IFinancingOffer[];\r\n totalPrice: number | undefined;\r\n specialFinancingOffer?: IFinancingOffer[];\r\n synchronySpecialFinancingCondition?: boolean;\r\n specialFinancingEnable?: boolean;\r\n}\r\n\r\nexport interface ICampaignRemainingCost {\r\n cost: number;\r\n months: number;\r\n}\r\n\r\nexport const getValidSpecialCampaign = (financingOffer: IFinancingOfferFormatted): IFinancingOfferCampaign | undefined => {\r\n if (\r\n financingOffer.specialCampaign &&\r\n financingOffer.specialCampaign.enableCampaign &&\r\n financingOffer.specialCampaign.initialMonthlyAmount &&\r\n financingOffer.specialCampaign.numOfDiscountedMonths &&\r\n isCampaignScheduled(financingOffer)\r\n ) {\r\n return financingOffer.specialCampaign;\r\n }\r\n\r\n return undefined;\r\n};\r\n\r\nexport const getCampaignRemainingCost = (\r\n campaign: IFinancingOfferCampaign,\r\n financingOffer: IFinancingOfferFormatted,\r\n totalPrice: number | undefined\r\n): ICampaignRemainingCost | undefined => {\r\n if (!totalPrice) {\r\n return undefined;\r\n }\r\n\r\n const initialCost = campaign.initialMonthlyAmount * campaign.numOfDiscountedMonths;\r\n const remainingCost = totalPrice - initialCost;\r\n const remainingMonths = financingOffer.numOfMonths - campaign.numOfDiscountedMonths;\r\n const monthlyCost = remainingCost / remainingMonths;\r\n\r\n return {\r\n cost: monthlyCost,\r\n months: remainingMonths\r\n };\r\n};\r\nexport const isValidLimitedTimeOffer = (offer: IFinancingOffer): boolean => {\r\n const startDate = dayjs(offer.offerValidStartDate, format);\r\n const endDate = dayjs(offer.offerValidEndDate, format).add(1, 'd');\r\n\r\n const startDateCentralTime = startDate.isValid() && dayjs(startDate.format(format), format).tz('America/Chicago').local();\r\n const endDateCentralTime = endDate.isValid() && dayjs(endDate.format(format), format).tz('America/Chicago').local();\r\n\r\n const now = dayjs();\r\n return startDateCentralTime && endDateCentralTime && now.isBetween(startDateCentralTime, endDateCentralTime);\r\n};\r\n\r\nexport const isCampaignScheduled = (offer: IFinancingOfferFormatted): boolean => {\r\n const tempOffer = Object.create(offer);\r\n if (tempOffer.specialCampaign?.campaignValidStartDate && tempOffer.specialCampaign?.campaignValidEndDate) {\r\n tempOffer.startDate = tempOffer.specialCampaign?.campaignValidStartDate;\r\n tempOffer.endDate = tempOffer.specialCampaign?.campaignValidEndDate;\r\n\r\n return isScheduled(tempOffer);\r\n }\r\n\r\n return false;\r\n};\r\n\r\nexport const isScheduled = (offer: IFinancingOfferFormatted): boolean => {\r\n const startDate = dayjs(offer.startDate, format);\r\n const endDate = dayjs(offer.endDate, format).add(1, 'd');\r\n\r\n const startDateCentralTime = startDate.isValid() && dayjs(startDate.format(format), format).tz('America/Chicago').local();\r\n const endDateCentralTime = endDate.isValid() && dayjs(endDate.format(format), format).tz('America/Chicago').local();\r\n\r\n const now = dayjs();\r\n\r\n return startDateCentralTime && endDateCentralTime && now.isBetween(startDateCentralTime, endDateCentralTime);\r\n};\r\n\r\nexport const selectFinancingOffer = ({ limitedTimeFinancingOffers = [], everydayFinancingOffers = [], totalPrice = 0, specialFinancingOffer = [], synchronySpecialFinancingCondition = false, specialFinancingEnable = false }: ISelectFinancingOfferData, returnCustomOfferArray?: boolean): IFinancingOfferFormatted | undefined => {\r\n let highestMinimumPurchase: number = 0;\r\n let bestOffer: IFinancingOfferFormatted = {\r\n numOfMonths: 0,\r\n costPerMonth: 0,\r\n isLTO: false,\r\n minPurchase: 0,\r\n everydayFinancingOfferMessage:'',\r\n limitedFinancingOfferMessage:'',\r\n monthlyOfferDetails: '',\r\n financingOfferDescription: '',\r\n disclaimer: ''\r\n };\r\n let offerFound = false;\r\n\r\n let campaignFound: IFinancingOfferFormatted | undefined;\r\n\r\n const everydayOffers: IFinancingOfferFormatted[] | undefined = [];\r\n const specialOffer: IFinancingOfferFormatted[] | undefined = [];\r\n\r\n const validLimitedTimeFinancingOffers = limitedTimeFinancingOffers.filter((offer)=>{\r\n return isValidLimitedTimeOffer(offer) && offer;\r\n });\r\n\r\n if (synchronySpecialFinancingCondition && specialFinancingEnable) {\r\n if (!offerFound || (!isScheduled(bestOffer) && specialFinancingOffer.length)) {\r\n // try default offer\r\n offerFound = false;\r\n highestMinimumPurchase = 0;\r\n specialFinancingOffer.forEach((offer: IFinancingOffer) => {\r\n const minPurchase = offer.minPurchase ? offer.minPurchase : 0;\r\n let currentOfferAccepted = false;\r\n if (totalPrice >= minPurchase && minPurchase >= highestMinimumPurchase) {\r\n bestOffer = {\r\n numOfMonths: offer.noInterestFor,\r\n costPerMonth: Math.ceil(totalPrice / offer.noInterestFor),\r\n startDate: offer.offerValidStartDate,\r\n endDate: offer.offerValidEndDate,\r\n isLTO: false,\r\n minPurchase: offer.minPurchase || 0,\r\n everydayFinancingOfferMessage:offer.everydayFinancingOfferMessage,\r\n limitedFinancingOfferMessage:offer.limitedFinancingOfferMessage,\r\n offerName: offer.offerName,\r\n financingOfferDescription: offer.financingOfferDescription,\r\n disclaimer: offer.disclaimer\r\n };\r\n highestMinimumPurchase = offer.minPurchase;\r\n offerFound = true;\r\n currentOfferAccepted = true;\r\n }\r\n if (returnCustomOfferArray && (totalPrice >= minPurchase)) {\r\n specialOffer?.push({\r\n numOfMonths: offer.noInterestFor,\r\n costPerMonth: Math.ceil(totalPrice / offer.noInterestFor),\r\n startDate: offer.offerValidStartDate,\r\n endDate: offer.offerValidEndDate,\r\n isLTO: false,\r\n minPurchase: offer.minPurchase || 0,\r\n everydayFinancingOfferMessage:offer.everydayFinancingOfferMessage,\r\n limitedFinancingOfferMessage:offer.limitedFinancingOfferMessage,\r\n financingOfferDescription: offer.financingOfferDescription,\r\n disclaimer: offer.disclaimer,\r\n offerName: offer.offerName\r\n });\r\n highestMinimumPurchase = offer.minPurchase;\r\n offerFound = true;\r\n currentOfferAccepted = true;\r\n // @ts-ignore\r\n bestOffer = specialOffer;\r\n }\r\n // Do not use default if end date is defined and has expired\r\n if (currentOfferAccepted && offer.offerValidEndDate) {\r\n const endDate = dayjs(offer.offerValidEndDate, format);\r\n const now = dayjs();\r\n if (endDate.isValid() && now.isAfter(endDate)) {\r\n offerFound = false;\r\n }\r\n }\r\n });\r\n }\r\n } else {\r\n validLimitedTimeFinancingOffers.forEach((offer: IFinancingOffer) => {\r\n const minPurchase = offer.minPurchase ? offer.minPurchase : 0;\r\n\r\n if (totalPrice >= minPurchase && minPurchase > highestMinimumPurchase) {\r\n const currentOffer: IFinancingOfferFormatted = {\r\n numOfMonths: offer.noInterestFor,\r\n costPerMonth: Math.ceil(totalPrice / offer.noInterestFor),\r\n startDate: offer.offerValidStartDate,\r\n endDate: offer.offerValidEndDate,\r\n isLTO: true,\r\n minPurchase: offer.minPurchase,\r\n everydayFinancingOfferMessage:offer.everydayFinancingOfferMessage,\r\n limitedFinancingOfferMessage:offer.limitedFinancingOfferMessage,\r\n monthlyOfferDetails: offer.monthlyOfferDetails,\r\n financingOfferDescription: offer.financingOfferDescription,\r\n disclaimer: offer.disclaimer,\r\n specialCampaign: offer.specialCampaignOffer,\r\n checkoutDisplay: offer.checkoutDisplay,\r\n offerName: offer.offerName\r\n };\r\n bestOffer = currentOffer;\r\n highestMinimumPurchase = offer.minPurchase;\r\n offerFound = true;\r\n\r\n // check if campaign schedule is scheduled, otherwise fall back to parent offer\r\n const validCampaign = getValidSpecialCampaign(currentOffer);\r\n if (validCampaign) {\r\n currentOffer.startDate = validCampaign.campaignValidStartDate;\r\n currentOffer.endDate = validCampaign.campaignValidEndDate;\r\n campaignFound = currentOffer;\r\n }\r\n else {\r\n campaignFound = undefined;\r\n }\r\n }\r\n });\r\n\r\n if (!offerFound || (!isScheduled(bestOffer) && everydayFinancingOffers.length)) {\r\n // try default offer\r\n offerFound = false;\r\n highestMinimumPurchase = 0;\r\n\r\n everydayFinancingOffers.forEach((offer: IFinancingOffer) => {\r\n const minPurchase = offer.minPurchase ? offer.minPurchase : 0;\r\n let currentOfferAccepted = false;\r\n if (totalPrice >= minPurchase && minPurchase >= highestMinimumPurchase) {\r\n bestOffer = {\r\n numOfMonths: offer.noInterestFor,\r\n costPerMonth: Math.ceil(totalPrice / offer.noInterestFor),\r\n isLTO: false,\r\n minPurchase: offer.minPurchase || 0,\r\n everydayFinancingOfferMessage: offer.everydayFinancingOfferMessage,\r\n limitedFinancingOfferMessage:offer.limitedFinancingOfferMessage,\r\n offerName: offer.offerName,\r\n monthlyOfferDetails: offer.monthlyOfferDetails,\r\n financingOfferDescription: offer.financingOfferDescription,\r\n disclaimer: offer.disclaimer\r\n };\r\n highestMinimumPurchase = offer.minPurchase;\r\n offerFound = true;\r\n currentOfferAccepted = true;\r\n }\r\n\r\n if (returnCustomOfferArray && (totalPrice >= minPurchase)) {\r\n everydayOffers?.push({\r\n numOfMonths: offer.noInterestFor,\r\n costPerMonth: Math.ceil(totalPrice / offer.noInterestFor),\r\n isLTO: false,\r\n minPurchase: offer.minPurchase || 0,\r\n everydayFinancingOfferMessage:offer.everydayFinancingOfferMessage,\r\n limitedFinancingOfferMessage:offer.limitedFinancingOfferMessage,\r\n monthlyOfferDetails: offer.monthlyOfferDetails,\r\n financingOfferDescription: offer.financingOfferDescription,\r\n disclaimer: offer.disclaimer,\r\n offerName: offer.offerName\r\n });\r\n highestMinimumPurchase = offer.minPurchase;\r\n offerFound = true;\r\n currentOfferAccepted = true;\r\n // @ts-ignore\r\n bestOffer = everydayOffers;\r\n }\r\n\r\n // Do not use default if end date is defined and has expired\r\n if (currentOfferAccepted && offer.offerValidEndDate) {\r\n const endDate = dayjs(offer.offerValidEndDate, format);\r\n const now = dayjs();\r\n if (endDate.isValid() && now.isAfter(endDate)) {\r\n offerFound = false;\r\n }\r\n }\r\n });\r\n }\r\n}\r\n\r\n if (!offerFound) {\r\n return undefined;\r\n }\r\n if (campaignFound) {\r\n return campaignFound;\r\n }\r\n return bestOffer;\r\n};\r\n","// tslint:disable\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as Entities from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n/**\r\n * MFIGetBonusItemsParameters entity interface.\r\n */\r\nexport interface IMFIGetBonusItemsParameters {\r\n CartId?: string;\r\n Coupons?: string[];\r\n // Id: number;\r\n ExtensionProperties?: Entities.CommerceProperty[];\r\n}\r\n\r\n/**\r\n * MFIBonusItemsDetailsEntity entity interface.\r\n */\r\nexport interface IMFIBonusItemsDetailsEntity {\r\n Coupon?: string;\r\n IsBonusCoupon?: string;\r\n CouponMessage?: string;\r\n Items?: IMFIQualifyingItemDetails[];\r\n Id: number;\r\n ExtensionProperties?: Entities.CommerceProperty[];\r\n}\r\n\r\n/**\r\n * MFIQualifyingItemDetails entity interface.\r\n */\r\nexport interface IMFIQualifyingItemDetails {\r\n QualifyingItemId?: string;\r\n QualifyingProductId?: string;\r\n BonusProductQty: number;\r\n BonusItems?: IMFIBonusItemDetails[];\r\n }\r\n\r\n /**\r\n * MFIBonusItemDetails entity interface.\r\n */\r\n export interface IMFIBonusItemDetails {\r\n QualifyingProductId?: string;\r\n QualifyingItemId?: string;\r\n BonusItemId?: string;\r\n BonusProductId?: string;\r\n Name?: string;\r\n AdditionToCart?: string;\r\n AdjustedPrice: number;\r\n BasePrice: number;\r\n CustomerContextualPrice: number;\r\n DiscountAmount: number;\r\n DiscountTypeValue: number;\r\n DiscountType?: string;\r\n PrimaryImageUrl: string;\r\n ProductTypeValue: number;\r\n DealPriceOrDiscountPercentage: number;\r\n BonusCalculatedDiscountPrice: number;\r\n Coupon?: string;\r\n }\r\n\r\n /**\r\n * MFIGetBonusCouponsDetailsResponse entity interface.\r\n */\r\n export interface IMFIGetBonusCouponsDetailsResponse {\r\n BonusCoupons?: IMFIBonusCouponsDetail[];\r\n}\r\n\r\n/**\r\n * MFIBonusItemsResponse entity interface.\r\n */\r\nexport interface IMFIBonusItemsResponse {\r\n BonusItemsDetails?: IMFIBonusItemsDetailsEntity[];\r\n Message?: string;\r\n}\r\n\r\n/**\r\n * MFIBonusCouponsDetail entity interface.\r\n */\r\nexport interface IMFIBonusCouponsDetail {\r\n BonusCoupon?: string;\r\n BonusCouponMessage?: string;\r\n ChildCoupons?: string[];\r\n}\r\n\r\n/**\r\n * MFIGetBonusItemsParameters entity class.\r\n */\r\nexport class MFIGetBonusItemsParametersExtensionClass implements IMFIGetBonusItemsParameters {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public CartId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Coupons: string[];\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Id: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ExtensionProperties: Entities.CommerceProperty[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.CartId = odataObject.CartId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Coupons = undefined;\r\n if (odataObject.Coupons) {\r\n this.Coupons = [];\r\n for (let i = 0; i < odataObject.Coupons.length; i++) {\r\n if (odataObject.Coupons[i]) {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Coupons[i] = odataObject.Coupons[i];\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Coupons[i] = undefined;\r\n }\r\n }\r\n }\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Id = odataObject.Id;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties = undefined;\r\n if (odataObject.ExtensionProperties) {\r\n this.ExtensionProperties = [];\r\n for (let i = 0; i < odataObject.ExtensionProperties.length; i++) {\r\n if (odataObject.ExtensionProperties[i]) {\r\n if (odataObject.ExtensionProperties[i]['@odata.type']) {\r\n let className: string = odataObject.ExtensionProperties[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.ExtensionProperties[i] = new EntityClasses[className](odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n this.ExtensionProperties[i] = new EntityClasses.CommercePropertyClass(odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFIBonusItemsDetailsEntity entity class.\r\n */\r\nexport class MFIBonusItemsDetailsEntityExtensionClass implements IMFIBonusItemsDetailsEntity {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Coupon: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public IsBonusCoupon: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public CouponMessage: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Items: IMFIQualifyingItemDetails[];\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Id: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ExtensionProperties: Entities.CommerceProperty[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Coupon = odataObject.Coupon;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.IsBonusCoupon = odataObject.IsBonusCoupon;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.CouponMessage = odataObject.CouponMessage;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Items = undefined;\r\n if (odataObject.Items) {\r\n this.Items = [];\r\n for (let i = 0; i < odataObject.Items.length; i++) {\r\n if (odataObject.Items[i]) {\r\n if (odataObject.Items[i]['@odata.type']) {\r\n let className: string = odataObject.Items[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.Items[i] = new EntityClasses[className](odataObject.Items[i]);\r\n }\r\n } else {\r\n this.Items[i] = new MFIQualifyingItemDetailsExtensionClass(odataObject.Items[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Items[i] = undefined;\r\n }\r\n }\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Id = odataObject.Id;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties = undefined;\r\n if (odataObject.ExtensionProperties) {\r\n this.ExtensionProperties = [];\r\n for (let i = 0; i < odataObject.ExtensionProperties.length; i++) {\r\n if (odataObject.ExtensionProperties[i]) {\r\n if (odataObject.ExtensionProperties[i]['@odata.type']) {\r\n let className: string = odataObject.ExtensionProperties[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.ExtensionProperties[i] = new EntityClasses[className](odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n this.ExtensionProperties[i] = new EntityClasses.CommercePropertyClass(odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFIQualifyingItemDetails entity class.\r\n */\r\nexport class MFIQualifyingItemDetailsExtensionClass implements IMFIQualifyingItemDetails {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public QualifyingItemId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public QualifyingProductId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusProductQty: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusItems: IMFIBonusItemDetails[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.QualifyingItemId = odataObject.QualifyingItemId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.QualifyingProductId = odataObject.QualifyingProductId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusProductQty = odataObject.BonusProductQty ? parseFloat(odataObject.BonusProductQty) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusItems = undefined;\r\n if (odataObject.BonusItems) {\r\n this.BonusItems = [];\r\n for (let i = 0; i < odataObject.BonusItems.length; i++) {\r\n if (odataObject.BonusItems[i]) {\r\n if (odataObject.BonusItems[i]['@odata.type']) {\r\n let className: string = odataObject.BonusItems[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.BonusItems[i] = new EntityClasses[className](odataObject.BonusItems[i]);\r\n }\r\n } else {\r\n this.BonusItems[i] = new MFIBonusItemDetailsExtensionClass(odataObject.BonusItems[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusItems[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFIBonusItemDetails entity class.\r\n */\r\nexport class MFIBonusItemDetailsExtensionClass implements IMFIBonusItemDetails {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusItemId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusProductId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Name: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public AdditionToCart: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public AdjustedPrice: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BasePrice: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public CustomerContextualPrice: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DiscountAmount: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DiscountTypeValue: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DiscountType: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DealPriceOrDiscountPercentage: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusCalculatedDiscountPrice: number;\r\n\r\n public PrimaryImageUrl: string;\r\n\r\n public ProductTypeValue: number;\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusItemId = odataObject.BonusItemId;\r\n\r\n this.PrimaryImageUrl = odataObject.PrimaryImageUrl;\r\n\r\n this.ProductTypeValue = odataObject.ProductTypeValue;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusProductId = odataObject.BonusProductId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Name = odataObject.Name;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.AdditionToCart = odataObject.AdditionToCart;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.AdjustedPrice = odataObject.AdjustedPrice ? parseFloat(odataObject.AdjustedPrice) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BasePrice = odataObject.BasePrice ? parseFloat(odataObject.BasePrice) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.CustomerContextualPrice = odataObject.CustomerContextualPrice ? parseFloat(odataObject.CustomerContextualPrice) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DiscountAmount = odataObject.DiscountAmount ? parseFloat(odataObject.DiscountAmount) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DiscountTypeValue = odataObject.DiscountTypeValue;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DiscountType = odataObject.DiscountType;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DealPriceOrDiscountPercentage = odataObject.DealPriceOrDiscountPercentage\r\n ? parseFloat(odataObject.DealPriceOrDiscountPercentage)\r\n : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusCalculatedDiscountPrice = odataObject.BonusCalculatedDiscountPrice\r\n ? parseFloat(odataObject.BonusCalculatedDiscountPrice)\r\n : 0;\r\n }\r\n}\r\n\r\n/**\r\n * MFIGetBonusCouponsDetailsResponse entity class.\r\n */\r\nexport class MFIGetBonusCouponsDetailsResponseExtensionClass implements IMFIGetBonusCouponsDetailsResponse {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusCoupons: IMFIBonusCouponsDetail[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusCoupons = undefined;\r\n if (odataObject.BonusCoupons) {\r\n this.BonusCoupons = [];\r\n for (let i = 0; i < odataObject.BonusCoupons.length; i++) {\r\n if (odataObject.BonusCoupons[i]) {\r\n if (odataObject.BonusCoupons[i]['@odata.type']) {\r\n let className: string = odataObject.BonusCoupons[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.BonusCoupons[i] = new EntityClasses[className](odataObject.BonusCoupons[i]);\r\n }\r\n } else {\r\n this.BonusCoupons[i] = new MFIBonusCouponsDetailExtensionClass(odataObject.BonusCoupons[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusCoupons[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFIBonusItemsResponse entity class.\r\n */\r\nexport class MFIBonusItemsResponseExtensionClass implements IMFIBonusItemsResponse {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusItemsDetails: IMFIBonusItemsDetailsEntity[];\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Message: string;\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusItemsDetails = undefined;\r\n if (odataObject.BonusItemsDetails) {\r\n this.BonusItemsDetails = [];\r\n for (let i = 0; i < odataObject.BonusItemsDetails.length; i++) {\r\n if (odataObject.BonusItemsDetails[i]) {\r\n if (odataObject.BonusItemsDetails[i]['@odata.type']) {\r\n let className: string = odataObject.BonusItemsDetails[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.BonusItemsDetails[i] = new EntityClasses[className](odataObject.BonusItemsDetails[i]);\r\n }\r\n } else {\r\n this.BonusItemsDetails[i] = new MFIBonusItemsDetailsEntityExtensionClass(odataObject.BonusItemsDetails[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusItemsDetails[i] = undefined;\r\n }\r\n }\r\n }\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Message = odataObject.Message;\r\n }\r\n}\r\n\r\n/**\r\n * MFIBonusCouponsDetail entity class.\r\n */\r\nexport class MFIBonusCouponsDetailExtensionClass implements IMFIBonusCouponsDetail {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusCoupon: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusCouponMessage: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ChildCoupons: string[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusCoupon = odataObject.BonusCoupon;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusCouponMessage = odataObject.BonusCouponMessage;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ChildCoupons = undefined;\r\n if (odataObject.ChildCoupons) {\r\n this.ChildCoupons = [];\r\n for (let i = 0; i < odataObject.ChildCoupons.length; i++) {\r\n if (odataObject.ChildCoupons[i]) {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ChildCoupons[i] = odataObject.ChildCoupons[i];\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ChildCoupons[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n * THIS FILE IS AN AUTOGENERATED TYPESCRIPT PROXY EXTENSION.\r\n * TO USE THIS FILE, IT MUST BE ADDED TO A D365COMMERCE APPLICATION\r\n */\r\n// tslint:disable\r\nimport { AsyncResult, callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest } from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from '../actions/BonusItemDataServiceEntities.g';\r\n\r\n// @ts-ignore\r\nfunction bonusItemsQuery(id?: number): DataServiceQuery {\r\n const key = id ? { Id: id } : null;\r\n return new DataServiceQuery(\r\n 'BonusItems',\r\n 'MFIGetBonusItemsParameters',\r\n DataServiceEntities.MFIGetBonusItemsParametersExtensionClass,\r\n key\r\n );\r\n}\r\n\r\nexport function createMFIGetBonusCouponsDetailsInput(bonusCoupons: string): IDataServiceRequest {\r\n const query = bonusItemsQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'MFIGetBonusCouponsDetails',\r\n true,\r\n DataServiceEntities.MFIGetBonusCouponsDetailsResponseExtensionClass,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IMFIGetBonusCouponsDetailsResponse' },\r\n { bonusCoupons: bonusCoupons }\r\n );\r\n}\r\n\r\nexport function mFIGetBonusCouponsDetailsAsync(\r\n context: IContext,\r\n bonusCoupons: string\r\n): AsyncResult {\r\n const request = createMFIGetBonusCouponsDetailsInput(bonusCoupons);\r\n return callActionOrExecute(request, context.callerContext);\r\n}\r\n\r\nexport function createMFIGetBonusItemsDetailInput(bonusItemParams: DataServiceEntities.IMFIGetBonusItemsParameters): IDataServiceRequest {\r\n const query = bonusItemsQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'MFIGetBonusItemsDetail',\r\n true,\r\n DataServiceEntities.MFIBonusItemsResponseExtensionClass,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IMFIBonusItemsResponse' },\r\n { bonusItemParams: bonusItemParams }\r\n );\r\n}\r\n\r\nexport function mFIGetBonusItemsDetailAsync(\r\n context: IContext,\r\n bonusItemParams: DataServiceEntities.IMFIGetBonusItemsParameters\r\n): AsyncResult {\r\n const request = createMFIGetBonusItemsDetailInput(bonusItemParams);\r\n return callActionOrExecute(request, context.callerContext);\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * BonusCouponDetails Input Action\r\n */\r\nexport class BonusCouponDetailsInput implements Msdyn365.IActionInput {\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `bonusCouponDetail`;\r\n public getCacheObjectType = () => 'bonusCouponDetail';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IBonusCouponDetailsData {\r\n bonusCouponDetail: string;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new BonusCouponDetailsInput();\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: BonusCouponDetailsInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { bonusCouponDetail: '' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'BonusCouponDetails',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * BonusItemProduct Input Action\r\n */\r\nexport class BonusItemProductInput implements Msdyn365.IActionInput {\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `TODO`;\r\n public getCacheObjectType = () => 'TODO';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IBonusItemProductData {\r\n bonusItemProduct: string;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new BonusItemProductInput();\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: BonusItemProductInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { bonusItemProduct: '' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'BonusItemProduct',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","// sample-state.ts\r\nimport { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\nexport interface IBillingState {\r\n isBillingFormValid: boolean;\r\n}\r\n\r\n/**\r\n * BillingState - action input\r\n */\r\nexport class BillingStateInput implements IActionInput {\r\n public getCacheKey = () => `BillingState`;\r\n public getCacheObjectType = () => 'BillingState';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * BillingState - action\r\n */\r\nexport async function BillingStateAction(input: BillingStateInput, ctx: IActionContext): Promise {\r\n return { isBillingFormValid: false};\r\n}\r\n\r\n/**\r\n * BillingState - create new input for create action\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new BillingStateInput();\r\n};\r\n\r\n/**\r\n * BillingState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >BillingStateAction,\r\n input: createInput\r\n});","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * CheckoutDisabledButtonState Input Action\r\n */\r\nexport class CheckoutDisabledButtonStateInput implements Msdyn365.IActionInput {\r\n // CheckoutDisabledButtonState: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // CheckoutDisabledButtonState: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `CheckoutDisabledButtonState`;\r\n public getCacheObjectType = () => 'CheckoutDisabledButtonState';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// CheckoutDisabledButtonState: Create a data model here or import one to capture the response of the action\r\nexport interface ICheckoutDisabledButtonStateData {\r\n disabled: boolean;\r\n}\r\n\r\n/**\r\n * CheckoutDisabledButtonState: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new CheckoutDisabledButtonStateInput();\r\n};\r\n\r\n/**\r\n * CheckoutDisabledButtonState: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: CheckoutDisabledButtonStateInput, ctx: Msdyn365.IActionContext): Promise {\r\n return { disabled: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // CheckoutDisabledButtonState: Give your data action a unique id\r\n id: 'CheckoutDisabledButtonState',\r\n input: createInput\r\n // CheckoutDisabledButtonState: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * CompleteyourBedPillow Input Action\r\n */\r\nexport class CompleteYourBedPillowInput implements Msdyn365.IActionInput {\r\n public pillow: SimpleProduct | undefined | null;\r\n // Construct the input needed to run the action\r\n constructor(pillow: SimpleProduct | undefined | null) {\r\n this.pillow = pillow;\r\n }\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `CompleteyourBedPillow`;\r\n public getCacheObjectType = () => 'CompleteyourBedPillow';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface ICompleteYourBedPillowData {\r\n pillow: SimpleProduct | undefined | null;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new CompleteYourBedPillowInput(args?.config?.pillow);\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: CompleteYourBedPillowInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { pillow: input.pillow };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'CompleteyourBedPillow',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * CompleteyourBedProtector Input Action\r\n */\r\nexport class CompleteyourBedProtectorInput implements Msdyn365.IActionInput {\r\n public protector: SimpleProduct | undefined | null;\r\n // Construct the input needed to run the action\r\n constructor(protector: SimpleProduct | undefined | null) {\r\n this.protector = protector;\r\n }\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `CompleteyourBedProtector`;\r\n public getCacheObjectType = () => 'CompleteyourBedProtector';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface ICompleteYourBedProtectorData {\r\n protector: SimpleProduct | undefined | null;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new CompleteyourBedProtectorInput(args?.config?.protector);\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: CompleteyourBedProtectorInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { protector: input.protector };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'CompleteyourBedProtector',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * ExpressEditState Input Action\r\n */\r\nexport class ExpressEditStateInput implements Msdyn365.IActionInput {\r\n // ExpressEditStateInput: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // ExpressEditState: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `ExpressEditState`;\r\n public getCacheObjectType = () => 'ExpressEditState';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// IExpressEditStateData: Create a data model here or import one to capture the response of the action\r\nexport interface IExpressEditStateData {\r\n shippingEdit: boolean;\r\n deliveryEdit: boolean;\r\n}\r\n\r\n/**\r\n * createInput: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new ExpressEditStateInput();\r\n};\r\n\r\n/**\r\n * action: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: ExpressEditStateInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { shippingEdit: false, deliveryEdit: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // id: Give your data action a unique id\r\n id: 'ExpressEditState',\r\n input: createInput\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * ExpressOrderSubmitStateAction Input Action\r\n */\r\nexport class ExpressOrderSubmitStateActionInput implements Msdyn365.IActionInput {\r\n // ExpressOrderSubmitState: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // ExpressOrderSubmitState: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `ExpressOrderSubmitState`;\r\n public getCacheObjectType = () => 'ExpressOrderSubmitState';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// ExpressOrderSubmitState: Create a data model here or import one to capture the response of the action\r\nexport interface IExpressOrderSubmitStateActionData {\r\n expressSubmit: boolean;\r\n slotTime: string;\r\n slotDate: string;\r\n selectedService: string;\r\n}\r\n\r\n/**\r\n * ExpressOrderSubmitState - create new input for create action\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new ExpressOrderSubmitStateActionInput();\r\n};\r\n\r\n/**\r\n * ExpressOrderSubmitState - create action\r\n */\r\nasync function action(input: ExpressOrderSubmitStateActionInput, ctx: Msdyn365.IActionContext): Promise {\r\n\r\n return { expressSubmit: true , slotTime: '', slotDate: '', selectedService: ''};\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // ExpressOrderSubmitState: Give your data action a unique id\r\n id: 'ExpressOrderSubmitStateAction',\r\n input: createInput\r\n // ExpressOrderSubmitState: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { AsyncResult } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * FetchChooseYourFoundationDatabase Input Action\r\n */\r\nexport class FetchChooseYourFoundationDatabaseInput implements Msdyn365.IActionInput {\r\n public jsonSrc: string;\r\n // Construct the input needed to run the action\r\n constructor(jsonSrc: string) {\r\n this.jsonSrc = jsonSrc;\r\n }\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `ChooseYourFoundationDatabase`;\r\n public getCacheObjectType = () => 'ChooseYourFoundationDatabase';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IFetchChooseYourFoundationDatabaseData {\r\n text: string;\r\n jsonSrc: string;\r\n}\r\n\r\nexport interface IDatabaseRow {\r\n mattressVariantReqId: string;\r\n baseVariantReqIdList: string[];\r\n recommendedBaseVariantReqId: string;\r\n}\r\n\r\nexport interface foo {\r\n database: AsyncResult;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new FetchChooseYourFoundationDatabaseInput(args?.requestContext.app.config.jsonSrc!);\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: FetchChooseYourFoundationDatabaseInput, ctx: Msdyn365.IActionContext): Promise {\r\n const res = await Msdyn365.sendRequest(input.jsonSrc, 'get');\r\n const database = res.data;\r\n return database;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'FetchChooseYourFoundationDatabase',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { AsyncResult } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * FetchcompleteYourBedData Input Action\r\n */\r\nexport class FetchCompleteYourBedDataInput implements Msdyn365.IActionInput {\r\n public jsonData: string;\r\n // Construct the input needed to run the action\r\n constructor(jsonData: string) {\r\n this.jsonData = jsonData;\r\n }\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `completeYourBedData`;\r\n public getCacheObjectType = () => 'completeYourBedDataObject';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IFetchcompleteYourBedData {\r\n text: string;\r\n jsonData: string;\r\n}\r\n\r\nexport interface IDataRow {\r\n mattressVariantReqId: string;\r\n buyAllVariantRecIds:any;\r\n}\r\n\r\nexport interface foo {\r\n data: AsyncResult;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new FetchCompleteYourBedDataInput(args?.config?.jsonData!);\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: FetchCompleteYourBedDataInput, ctx: Msdyn365.IActionContext): Promise {\r\n\r\n const res = await Msdyn365.sendRequest(input.jsonData, 'get');\r\n const data = res.data;\r\n return data;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'FetchcompleteYourBedData',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getZipCode } from '../Utilities/get-zipcode';\r\nimport dayjs from 'dayjs';\r\nimport { mFIATPInventoryPLPAsync } from './BatchCoreProductDataActionExtension.g';\r\nimport { IMFIATPInventoryPLPResponse, IMFICartLine, IMFIDeliveryScheduleParameters } from './BatchCoreProductDataServiceEntities.g';\r\n\r\n/**\r\n * FetchCoreDeliveryList Input Action\r\n */\r\nexport class FetchCoreDeliveryListInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n public cartLines: IMFICartLine[];\r\n public zipCode?: string;\r\n constructor(cartLines: IMFICartLine[], zipCode?: string) {\r\n this.cartLines = cartLines;\r\n this.zipCode = zipCode;\r\n }\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => {\r\n return this.cartLines?.sort((a, b) => a?.VariantRecordId && b?.VariantRecordId && a?.VariantRecordId > b?.VariantRecordId ? 1 : -1).map(item => `FetchCoreDeliveryList-${item.VariantRecordId}-${this.zipCode}-${item.VariantRecordId?.length}`).toString();\r\n };\r\n public getCacheObjectType = () => 'FetchCoreDeliveryList';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IFetchCoreDeliveryListData {\r\n text: string;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\n// const createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n// return new FetchCoreDeliveryListInput();\r\n// };\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function fetchCoreDeliveryAction(input: FetchCoreDeliveryListInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n const atpInput: IMFIDeliveryScheduleParameters = {\r\n Weeks: 6,\r\n InventoryType: 'Delivery',\r\n StoreId: '',\r\n RequestedDate: dayjs(Date.now()).format('MM/DD/YYYY'),\r\n ZipCode: input.zipCode ?? getZipCode(ctx),\r\n ItemLines: input.cartLines,\r\n CustomerRequestTime: dayjs(Date.now()).format('MM/DD/YYYY HH:mm:ss'),\r\n Id: 0,\r\n NoOfPriorityDC: 0\r\n };\r\n const response = await mFIATPInventoryPLPAsync({ callerContext: ctx }, atpInput);\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return response;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >fetchCoreDeliveryAction,\r\n // Give your data action a unique id\r\n id: 'FetchCoreDeliveryList'\r\n // input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport interface IGetDeliveryFeeUpdateInput {\r\n deliveryAmount: number;\r\n}\r\n/**\r\n * GetDeliveryFeeUpdate Input Action\r\n */\r\nexport class GetDeliveryFeeUpdateInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `CheckoutUpdateDeliveryFee`;\r\n public getCacheObjectType = () => 'CheckoutUpdateDeliveryFee';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IGetDeliveryFeeUpdateData {\r\n text: string;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetDeliveryFeeUpdateInput();\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: GetDeliveryFeeUpdateInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return {deliveryAmount: 0};\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'GetDeliveryFeeUpdate',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * GetMattressFoundationsToAdd Input Action\r\n */\r\nexport class GetMattressFoundationsToAddInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `TODO`;\r\n public getCacheObjectType = () => 'TODO';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IGetMattressFoundationsToAddData {\r\n text: string;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetMattressFoundationsToAddInput();\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: GetMattressFoundationsToAddInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n console.log('input/context',{input, ctx});\r\n return { text: 'Static data from action' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'GetMattressFoundationsToAdd',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","import {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICommerceApiSettings,\r\n ICreateActionContext,\r\n IGeneric,\r\n IRequestContext\r\n} from '@msdyn365-commerce/core';\r\n// import { ICategoryPath, ICategoryUrl } from '@msdyn365-commerce/core-internal/dist/types/interfaces/ICategoryPathInterfaces';\r\nimport { getCategoryPathsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { CategoryPathLookup, CategoryPathResult } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { hasArray } from '../Utilities/emtpyChecker';\r\n\r\n/**\r\n * Category path input\r\n */\r\nexport class GetCategoryPathsInput implements IActionInput {\r\n public readonly ChannelId: number;\r\n public CatalogId?: number;\r\n public productIds?: number[];\r\n // public readonly categoryPathLooksups: CategoryPathLookup[];\r\n public readonly apiSettings: ICommerceApiSettings;\r\n // @ts-ignore\r\n private constructedCacheKey: string | undefined;\r\n\r\n constructor(context: IRequestContext, catalogId?: number, productIds?: number[]) {\r\n this.ChannelId = context.apiSettings.channelId;\r\n this.CatalogId = catalogId; // context.apiSettings.catalogId || 0;\r\n this.productIds = productIds;\r\n // this.categoryPathLooksups = categoryPathLooksups;\r\n this.apiSettings = context.apiSettings;\r\n this.constructedCacheKey = '';\r\n // categoryPathLooksups.forEach(categoryPath=> {\r\n // this.constructedCacheKey+=`${categoryPath.ProductId && categoryPath.ProductId.toString()}|`;\r\n // });\r\n this.constructedCacheKey = this.productIds?.map(ids => ids).join('-').toString();\r\n this.constructedCacheKey += `${this.ChannelId?.toString()}|`;\r\n this.constructedCacheKey += `${this.CatalogId?.toString()}|`;\r\n }\r\n\r\n public getCacheKey = () => `MFRMProductCategoryPath-${this.constructedCacheKey}`;\r\n public getCacheObjectType = () => 'MFRMProductCategoryPath';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\n/**\r\n * Creates the input required to make the getCategoryPath retail api call\r\n */\r\nexport const createGetCategoryPathsInput = (\r\n inputData: GetCategoryPathsInput,\r\n context: ICreateActionContext>\r\n): IActionInput => {\r\n const productId = inputData.productIds;\r\n if (productId) {\r\n return new GetCategoryPathsInput(context.requestContext, inputData.CatalogId, inputData.productIds);\r\n } else {\r\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\r\n }\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns the category path for a product\r\n */\r\nexport async function getProductsCategoryPathsAction(input: GetCategoryPathsInput, ctx: IActionContext): Promise {\r\n const catPaths: CategoryPathLookup[] = [];\r\n if (!hasArray(input.productIds)) {\r\n return [];\r\n }\r\n for (let productsIter = 0; productsIter < input.productIds!.length; productsIter++) {\r\n catPaths.push({ ProductId: input.productIds![productsIter] });\r\n }\r\n try {\r\n return await getCategoryPathsAsync({ callerContext: ctx, queryResultSettings: { Paging: { Top: input.productIds!.length }, Sorting: {} } }, input.ChannelId, input.CatalogId!, catPaths);\r\n } catch (err) {\r\n console.log(err);\r\n return [];\r\n }\r\n}\r\n\r\nexport const getCategoryPathsActionDataAction = createObservableDataAction({\r\n id: 'GetMFRMProductsCategoryPaths',\r\n action: >getProductsCategoryPathsAction,\r\n input: createGetCategoryPathsInput\r\n});\r\n\r\nexport default getCategoryPathsActionDataAction;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport interface ICheckoutRecycleFeeTaxUpdate {\r\n recycleFee: number | null;\r\n tax: number | null;\r\n}\r\n/**\r\n * GetRecycleFeeCheckout Input Action\r\n */\r\nexport class GetRecycleFeeCheckoutInput implements Msdyn365.IActionInput {\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `CheckoutUpdateRecycleFee`;\r\n public getCacheObjectType = () => 'CheckoutUpdateRecycleFee';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetRecycleFeeCheckoutInput();\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: GetRecycleFeeCheckoutInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // Uncomment the below line to get the value from a service\r\n return {recycleFee: null , tax: null};\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'GetRecycleFeeCheckout',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { mFIATPInventoryStatusAsync } from './CoreProductDataActionExtension.g';\r\nimport { IMFIATPInventoryStatusResponse, IMFICLDeliveryScheduleParameters } from './CoreProductDataServiceEntities.g';\r\n\r\n/**\r\n * GetDeliveryMessage Input Action\r\n */\r\n\r\nexport class GetATPInventoryStatusInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n public input: IMFICLDeliveryScheduleParameters;\r\n public isCached?: boolean;\r\n constructor(input: IMFICLDeliveryScheduleParameters, isCached: boolean = true) {\r\n this.input = input;\r\n this.isCached = isCached;\r\n }\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => {\r\n const key = Array.prototype.map.call(this.input.ItemLines, (item) => { return item.VariantRecordId; }).sort().join(\",\");\r\n return `Get-Inventory-Status${this.input.ZipCode}-${this.input.ItemLines![0].ItemId}-${key}-${\r\n this.input?.Weeks\r\n }-${this.input?.RequestedDate}`;\r\n };\r\n // public getCacheKey = () => 'do';\r\n public getCacheObjectType = () => 'GetATPInventoryStatusResult';\r\n public dataCacheType = (): Msdyn365.CacheType => (this.isCached ? 'request' : 'none');\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\n// const createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n// return new GetDeliveryMessageInput();\r\n// };\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function getATPInventoryStatusAction(\r\n request: GetATPInventoryStatusInput,\r\n ctx: Msdyn365.IActionContext\r\n): Promise {\r\n if (request.input) {\r\n try {\r\n const result = await mFIATPInventoryStatusAsync({ callerContext: ctx }, request.input);\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return null;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getATPInventoryStatusAction,\r\n // Give your data action a unique id\r\n id: 'GetATPInventoryStatus'\r\n // input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","import { IGeneric, IAny } from '@msdyn365-commerce/core';\r\n/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport axios from 'axios';\r\nimport { getZipCode } from '../Utilities/get-zipcode';\r\n\r\n/**\r\n * GetSociData Input Action\r\n */\r\nexport class GetSociDataInput implements Msdyn365.IActionInput {\r\n public searchradius?: number | undefined;\r\n public searchLimit?: number | undefined;\r\n public zipCode?: string | undefined;\r\n constructor(searchradius?: number | undefined, searchLimit?: number | undefined, zipCode?: string | undefined) {\r\n this.searchradius = searchradius;\r\n this.searchLimit = searchLimit;\r\n this.zipCode = zipCode;\r\n }\r\n\r\n public getCacheKey = () => `SociLocations-${this.zipCode}`;\r\n public getCacheObjectType = () => 'SociLocations';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n return new GetSociDataInput(args?.config?.lookupRadius, args?.config?.maxNoOfFranchise ?? 4);\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function getSociData(input: GetSociDataInput, ctx: Msdyn365.IActionContext): Promise {\r\n try {\r\n const zipCode = input?.zipCode ? input.zipCode : getZipCode(ctx);\r\n if (!zipCode) {\r\n return null;\r\n }\r\n let geoLoc = [];\r\n if(/^[0-9]+$/.test(zipCode)){\r\n geoLoc = [\r\n {\r\n \"postalcode\": zipCode\r\n }\r\n ];\r\n } else{\r\n geoLoc = [\r\n {\r\n \"state\": zipCode,\r\n \"city\": zipCode\r\n }\r\n ];\r\n }\r\n const response = await axios.post(`https://api.slippymap.com/rest/locatorsearch`, {\r\n \"request\": {\r\n \"appkey\": \"F147ADC0-8099-11EC-AC1B-273DC403F339\",\r\n \"formdata\": {\r\n \"dataview\": \"store_default\",\r\n \"limit\": input.searchLimit ?? 4,\r\n \"geolocs\": {\r\n \"geoloc\": geoLoc\r\n },\r\n \"searchradius\": input.searchradius?.toString() ?? \"50\"\r\n }\r\n }\r\n }\r\n , {\r\n headers: {\r\n 'Content-Type': 'application/json'\r\n }\r\n });\r\n if (response.data) {\r\n return response.data;\r\n }\r\n else { return null; }\r\n } catch (e) {\r\n // will be removed after unit test and deployment on lower environment\r\n console.log('error for soci api', e);\r\n return null;\r\n }\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getSociData,\r\n id: 'GetSociData',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","// tslint:disable\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as Entities from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n/**\r\n * MFITryInStore entity interface.\r\n */\r\nexport interface IMFITryInStore {\r\n ZipCode?: string;\r\n StoreId: string;\r\n Products?: string;\r\n Limit: number;\r\n Radius: number;\r\n ExtensionProperties?: Entities.CommerceProperty[];\r\n}\r\n\r\n/**\r\n * MFITryInStoreInfoResponse entity interface.\r\n */\r\nexport interface IMFITryInStoreInfoResponse {\r\n Status?: string;\r\n Message?: string;\r\n StoreId?: string;\r\n Inventory?: string[];\r\n}\r\n\r\n/**\r\n * MFITryInStore entity class.\r\n */\r\nexport class MFITryInStoreExtensionClass implements IMFITryInStore {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ZipCode: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public StoreId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Products: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Limit: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Radius: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ExtensionProperties: Entities.CommerceProperty[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ZipCode = odataObject.ZipCode;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.StoreId = odataObject.StoreId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Products = odataObject.Products;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Limit = odataObject.Limit;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Radius = odataObject.Radius;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties = undefined;\r\n if (odataObject.ExtensionProperties) {\r\n this.ExtensionProperties = [];\r\n for (let i = 0; i < odataObject.ExtensionProperties.length; i++) {\r\n if (odataObject.ExtensionProperties[i]) {\r\n if (odataObject.ExtensionProperties[i]['@odata.type']) {\r\n let className: string = odataObject.ExtensionProperties[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.ExtensionProperties[i] = new EntityClasses[className](odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n this.ExtensionProperties[i] = new EntityClasses.CommercePropertyClass(odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFITryInStoreInfoResponse entity class.\r\n */\r\nexport class MFITryInStoreInfoResponseExtensionClass implements IMFITryInStoreInfoResponse {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Status: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Message: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public StoreId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Inventory: string[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Status = odataObject.Status;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Message = odataObject.Message;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.StoreId = odataObject.StoreId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Inventory = undefined;\r\n if (odataObject.Inventory) {\r\n this.Inventory = [];\r\n for (let i = 0; i < odataObject.Inventory.length; i++) {\r\n if (odataObject.Inventory[i]) {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Inventory[i] = odataObject.Inventory[i];\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Inventory[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n * THIS FILE IS AN AUTOGENERATED TYPESCRIPT PROXY EXTENSION.\r\n * TO USE THIS FILE, IT MUST BE ADDED TO A D365COMMERCE APPLICATION\r\n */\r\n// tslint:disable\r\nimport { AsyncResult, callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest } from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './TryInStoreDataServiceEntities.g';\r\n\r\n// @ts-ignore\r\nfunction tryInStoresQuery(storeId?: string): DataServiceQuery {\r\n const key = storeId ? { StoreId: storeId } : null;\r\n return new DataServiceQuery('TryInStores', 'MFITryInStore', DataServiceEntities.MFITryInStoreExtensionClass, key);\r\n}\r\n\r\nexport function createMFIGetTryInStoreInfoInput(tryInStoreProductIDs: DataServiceEntities.IMFITryInStore): IDataServiceRequest {\r\n const query = tryInStoresQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'MFIGetTryInStoreInfo',\r\n true,\r\n DataServiceEntities.MFITryInStoreInfoResponseExtensionClass,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IMFITryInStoreInfoResponse' },\r\n { tryInStoreProductIDs: tryInStoreProductIDs }\r\n );\r\n}\r\n\r\nexport function mFIGetTryInStoreInfoAsync(\r\n context: IContext,\r\n tryInStoreProductIDs: DataServiceEntities.IMFITryInStore\r\n): AsyncResult {\r\n const request = createMFIGetTryInStoreInfoInput(tryInStoreProductIDs);\r\n return callActionOrExecute(request, context.callerContext);\r\n}\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { mFIGetTryInStoreInfoAsync } from './TryInStoreDataActionExtension.g';\r\nimport { IMFITryInStore, IMFITryInStoreInfoResponse } from './TryInStoreDataServiceEntities.g';\r\n\r\n/**\r\n * GetTryInStoreInfo Input Action\r\n */\r\n\r\nexport class GetTryInStoreInfoInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n public input: IMFITryInStore;\r\n constructor(input: IMFITryInStore) {\r\n this.input = input;\r\n }\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () =>\r\n `Try-In-Store${this.input.StoreId}-${this.input.ZipCode}-${this.input.Radius}-${this.input.Limit}-${this.input.Products}`;\r\n public getCacheObjectType = () => 'GetTryInStoreInfo';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\n// const createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n// return new GetTryInStoreInfoInput();\r\n// };\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function getTryInStoreAction(\r\n request: GetTryInStoreInfoInput,\r\n ctx: Msdyn365.IActionContext\r\n): Promise {\r\n if (request.input) {\r\n try {\r\n const result = await mFIGetTryInStoreInfoAsync({ callerContext: ctx }, request.input);\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return {};\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getTryInStoreAction,\r\n // Give your data action a unique id\r\n id: 'GetTryInStoreInfo'\r\n // input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport Cookies from 'universal-cookie';\r\n\r\nexport interface ICategoryLevelNamesData {\r\n categoryLevelName?: string;\r\n}\r\nexport class GetUnbxdRecommendationsDataInput implements Msdyn365.IActionInput {\r\n public pageType?: string | undefined;\r\n public widgetNumber?: string | undefined;\r\n public productID?: string | undefined;\r\n public catLevels?: ICategoryLevelNamesData[] | undefined;\r\n public cartItemIDs?: (string | undefined)[] | undefined;\r\n\r\n constructor(pageType?: string | undefined, widgetNumber?: string | undefined, productID?: string | undefined, catLevels?: ICategoryLevelNamesData[] | undefined, cartItemIDs?: (string | undefined)[] | undefined) {\r\n this.pageType = pageType;\r\n this.widgetNumber = widgetNumber;\r\n this.productID = productID;\r\n this.catLevels = catLevels;\r\n this.cartItemIDs = cartItemIDs;\r\n }\r\n\r\n public getCacheKey = () => `Unbxd-recommendation-data-${this.pageType}-${this.widgetNumber}`;\r\n public getCacheObjectType = () => 'Unbxd-recommendation-data';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function getUnbxdRecommendationData(input: GetUnbxdRecommendationsDataInput, ctx: Msdyn365.IActionContext): Promise {\r\n const cookies = new Cookies();\r\n const unbxdUid = cookies.get('unbxd.userId');\r\n const pageType = input?.pageType ? input.pageType.toUpperCase() : \"\";\r\n const productID = input?.productID ? input.productID : \"\";\r\n const catLevels = input?.catLevels ? input.catLevels : [];\r\n const cartItemIDs = input?.cartItemIDs ? input.cartItemIDs : [];\r\n const unbxdApiKey = ctx.requestContext.app.config.unbxdApiKey;\r\n const unbxdSiteKey = ctx.requestContext.app.config.unbxdSiteKey;\r\n\r\n if (!pageType) {\r\n return null;\r\n }\r\n try {\r\n let unbxdUrl = \"\";\r\n switch (pageType) {\r\n case \"HOME\":\r\n unbxdUrl = `https://recommendations.unbxd.io/v2.0/${unbxdApiKey}/${unbxdSiteKey}/items?pageType=${pageType}&uid=${unbxdUid}`;\r\n break;\r\n case \"CATEGORY\":\r\n const catnames = catLevels.map((catName, index) => {\r\n return `&catlevel${index + 1}Name=${catName ? catName.categoryLevelName : ''}`;\r\n }).join('');\r\n\r\n unbxdUrl = `https://recommendations.unbxd.io/v2.0/${unbxdApiKey}/${unbxdSiteKey}/items?pageType=${pageType}${catnames}&uid=${unbxdUid}`;\r\n break;\r\n case \"PRODUCT\":\r\n unbxdUrl = `https://recommendations.unbxd.io/v2.0/${unbxdApiKey}/${unbxdSiteKey}/items?pageType=${pageType}&id=${productID}&uid=${unbxdUid}`;\r\n break;\r\n case \"CART\":\r\n const productitemIds = cartItemIDs.map((itemId) => {\r\n return `&id=${itemId}`;\r\n }).join('');\r\n\r\n unbxdUrl = `https://recommendations.unbxd.io/v2.0/${unbxdApiKey}/${unbxdSiteKey}/items?pageType=${pageType}${productitemIds}&uid=${unbxdUid}`;\r\n break;\r\n default:\r\n unbxdUrl = '';\r\n }\r\n const response = await Msdyn365.sendRequest(unbxdUrl, 'get');\r\n if (response.data && response.headers) {\r\n const recsData={\r\n \"unbxdRequestId\":response.headers[\"x-request-id\"]? response.headers[\"x-request-id\"]:'',\r\n \"unbxdRecs\":response.data[input.widgetNumber!.toLowerCase()]\r\n };\r\n return recsData;\r\n }\r\n else { return null; }\r\n } catch (e) {\r\n return null;\r\n }\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getUnbxdRecommendationData,\r\n id: 'getUnbxdRecommendationData'\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * PaymentRedirectToOrderConfirmation Input Action\r\n */\r\nexport class PaymentRedirectToOrderConfirmationInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `PaymentRedirectToOrderConfirmation`;\r\n public getCacheObjectType = () => 'PaymentRedirectToOrderConfirmation';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IPaymentRedirectToOrderConfirmationData {\r\n redirectToOrderConfirmation: boolean;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new PaymentRedirectToOrderConfirmationInput();\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function paymentRedirectAction(input: PaymentRedirectToOrderConfirmationInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { redirectToOrderConfirmation: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >paymentRedirectAction,\r\n // Give your data action a unique id\r\n id: 'PaymentRedirectToOrderConfirmation',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * PaypalExpressEditState Input Action\r\n */\r\nexport class PaypalExpressEditStateInput implements Msdyn365.IActionInput {\r\n // PaypalExpressEditStat: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // PaypalExpressEditStat: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `PaypalExpressEditStat`;\r\n public getCacheObjectType = () => 'PaypalExpressEditStat';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// PaypalExpressEditStat: Create a data model here or import one to capture the response of the action\r\nexport interface IPaypalExpressEditStateData {\r\n isDisabled : boolean\r\n}\r\n\r\n/**\r\n * PaypalExpressEditStat: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new PaypalExpressEditStateInput();\r\n};\r\n\r\n/**\r\n * PaypalExpressEditStat: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: PaypalExpressEditStateInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // PaypalExpressEditStat: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { isDisabled : true };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // PaypalExpressEditStat: Give your data action a unique id\r\n id: 'PaypalExpressEditState',\r\n input: createInput\r\n // PaypalExpressEditStat: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * PaypalexpressTryagainTrigger Input Action\r\n */\r\nexport class PaypalexpressTryagainTriggerInput implements Msdyn365.IActionInput {\r\n // PaypalexpressTryagainTrigger: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // PaypalexpressTryagainTrigger: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `PaypalexpressTryagainTrigger`;\r\n public getCacheObjectType = () => 'PaypalexpressTryagainTrigger';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// PaypalexpressTryagainTrigger: Create a data model here or import one to capture the response of the action\r\nexport interface IPaypalexpressTryagainTriggerData {\r\n buttonClicked: boolean;\r\n orderSubmitClick: boolean;\r\n}\r\n\r\n/**\r\n * PaypalexpressTryagainTrigger: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new PaypalexpressTryagainTriggerInput();\r\n};\r\n\r\n/**\r\n * PaypalexpressTryagainTrigger: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: PaypalexpressTryagainTriggerInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // PaypalexpressTryagainTrigger: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { buttonClicked: false, orderSubmitClick: false};\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // PaypalexpressTryagainTrigger: Give your data action a unique id\r\n id: 'PaypalexpressTryagainTrigger',\r\n input: createInput\r\n // PaypalexpressTryagainTrigger: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * Paypalsuccesstrigger Input Action\r\n */\r\nexport class PaypalsuccesstriggerInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `PayPalSuccessFlag`;\r\n public getCacheObjectType = () => 'PayPalSuccessFlag';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IPaypalsuccesstriggerData {\r\n isPaymentSuccess: boolean;\r\n paymentSuccessEmail: string;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new PaypalsuccesstriggerInput();\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: PaypalsuccesstriggerInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { isPaymentSuccess: false, paymentSuccessEmail: '' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'Paypalsuccesstrigger',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * SelectYourFoundation Input Action\r\n */\r\nexport class SelectYourFoundationInput implements Msdyn365.IActionInput {\r\n public foundation: SimpleProduct | undefined | null;\r\n // Construct the input needed to run the action\r\n constructor(foundation: SimpleProduct | undefined | null) {\r\n this.foundation = foundation;\r\n }\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `SelectYourFoundation`;\r\n public getCacheObjectType = () => 'SelectYourFoundation';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface ISelectYourFoundationData {\r\n foundation: SimpleProduct | undefined | null;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new SelectYourFoundationInput(args?.config?.foundation);\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: SelectYourFoundationInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { foundation: input.foundation };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'SelectYourFoundation',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\nexport interface ISocialIconState {\r\n copyLinkClick: boolean;\r\n}\r\n\r\n/**\r\n * SocialIconsState Input Action\r\n */\r\nexport class SocialIconsStateInput implements IActionInput {\r\n public getCacheKey = () => `SocialIconsState`;\r\n public getCacheObjectType = () => 'SocialIconsState';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport async function socialIconStateAction(input: SocialIconsStateInput, ctx: IActionContext): Promise {\r\n return { copyLinkClick: false };\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new SocialIconsStateInput();\r\n};\r\n\r\nexport default createObservableDataAction({\r\n action: >socialIconStateAction,\r\n // Give your data action a unique id\r\n id: 'SocialIconsState',\r\n input: createInput\r\n});\r\n","import * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport interface ISRPBreadcrumbState {\r\n breadcrumbCheck: boolean;\r\n}\r\n\r\n/**\r\n * SrpBreadcrumbPage Input Action\r\n */\r\nexport class SrpBreadcrumbPageInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `BreadcrumbSrp`;\r\n public getCacheObjectType = () => 'BreadcrumbSrp';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface ISrpBreadcrumbPageData {\r\n text: string;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new SrpBreadcrumbPageInput();\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: SrpBreadcrumbPageInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { breadcrumbCheck: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'SrpBreadcrumbPage',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * TriggerSpecialSynchronyFinancing Input Action\r\n */\r\nexport class TriggerSpecialSynchronyFinancingInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `TriggerSpecialSynchronyFinancing`;\r\n public getCacheObjectType = () => 'TriggerSpecialSynchronyFinancing';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface ITriggerSpecialSynchronyFinancingData {\r\n triggerSpecialFinancing: boolean;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new TriggerSpecialSynchronyFinancingInput();\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: TriggerSpecialSynchronyFinancingInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { triggerSpecialFinancing: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'TriggerSpecialSynchronyFinancing',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n/**\r\n * UpdateMonthlyPayment Input Action\r\n */\r\nexport class UpdateMonthlyPaymentInput implements Msdyn365.IActionInput {\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `updateMonthlyPayment`;\r\n public getCacheObjectType = () => 'updateMonthlyPayment';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IUpdateMonthlyPaymentData {\r\n updateTotal: string | undefined;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new UpdateMonthlyPaymentInput();\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function updateMonthlyPayment(input: UpdateMonthlyPaymentInput, ctx: Msdyn365.IActionContext): Promise {\r\n return { updateTotal: '0' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >updateMonthlyPayment,\r\n input: createInput\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * UserDefinedPromocode Input Action\r\n */\r\nexport class UserDefinedPromocodeInput implements Msdyn365.IActionInput {\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `userDefinedPromoCodes`;\r\n public getCacheObjectType = () => 'userDefinedPromoCodes';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IUserDefinedPromocodeData {\r\n userDefinedPromos: string[];\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new UserDefinedPromocodeInput();\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: UserDefinedPromocodeInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { userDefinedPromos: [] };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'UserDefinedPromocode',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","// WmapAddress-state.ts\r\nimport { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\nexport interface IWmapAddressState {\r\n preFilledAddress: any;\r\n isAddressUpdate: boolean;\r\n}\r\n\r\n/**\r\n * WmapAddressState - action input\r\n */\r\nexport class WmapAddressStateInput implements IActionInput {\r\n constructor() {}\r\n public getCacheKey = () => `WmapAddressState`;\r\n public getCacheObjectType = () => 'WmapAddressState';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\n/**\r\n * WmapAddressState - action\r\n */\r\nasync function action(input: WmapAddressStateInput, ctx: IActionContext): Promise {\r\n return { preFilledAddress: {}, isAddressUpdate: false };\r\n}\r\n\r\n/**\r\n * WmapAddressState - create new input for create action\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new WmapAddressStateInput();\r\n};\r\n\r\n/**\r\n * WmapAddressState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >action,\r\n input: createInput\r\n});","// sample-state.ts\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nexport interface IZipCodeState {\r\n isStateValid: boolean;\r\n}\r\n\r\n/**\r\n * ZipCodeState - action input\r\n */\r\nexport class ZipCodeStateInput implements IActionInput {\r\n public getCacheKey = () => `ZipCodeState`;\r\n public getCacheObjectType = () => 'ZipCodeState';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * ZipCodeState - action\r\n */\r\nexport async function ZipCodeStateAction(input: ZipCodeStateInput, ctx: IActionContext): Promise {\r\n return {isStateValid: false };\r\n}\r\n\r\n/**\r\n * ZipCodeState - create new input for create action\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new ZipCodeStateInput();\r\n};\r\n\r\n/**\r\n * ZipCodeState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >ZipCodeStateAction,\r\n input: createInput\r\n});\r\n","// sample-state.ts\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nexport interface IZipcodeValidation {\r\n isZipcodeValid: boolean;\r\n}\r\n\r\n/**\r\n * ZipCodeState - action input\r\n */\r\nexport class ZipCodeValidationInput implements IActionInput {\r\n public getCacheKey = () => `ZipCodeValidation`;\r\n public getCacheObjectType = () => 'ZipCodeValidation';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * ZipCodeState - action\r\n */\r\nexport async function ZipcodeValidationAction(input: ZipCodeValidationInput, ctx: IActionContext): Promise {\r\n return { isZipcodeValid: false };\r\n}\r\n\r\n/**\r\n * ZipCodeState - create new input for create action\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new ZipCodeValidationInput();\r\n};\r\n\r\n/**\r\n * ZipCodeState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >ZipcodeValidationAction,\r\n input: createInput\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * AtpSlotsInformationState Input Action\r\n */\r\nexport class AtpSlotsInformationStateInput implements Msdyn365.IActionInput {\r\n // AtpSlotsInformationState: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // AtpSlotsInformationState: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `AtpSlotsInformationState`;\r\n public getCacheObjectType = () => 'AtpSlotsInformationState';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// AtpSlotsInformationState: Create a data model here or import one to capture the response of the action\r\nexport interface IAtpSlotsInformationStateData {\r\n checkAvailable?: boolean;\r\n buttonDisabled?: boolean;\r\n isbackOrdered?: boolean;\r\n willCall?: boolean;\r\n isSynchorniCall?: boolean;\r\n}\r\n\r\n/**\r\n * AtpSlotsInformationState: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new AtpSlotsInformationStateInput();\r\n};\r\n\r\n/**\r\n * AtpSlotsInformationState: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: AtpSlotsInformationStateInput, ctx: Msdyn365.IActionContext): Promise {\r\n return { checkAvailable: false , buttonDisabled: false , isbackOrdered: false , willCall: true , isSynchorniCall: false};\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // AtpSlotsInformationState: Give your data action a unique id\r\n id: 'AtpSlotsInformationState',\r\n input: createInput\r\n // AtpSlotsInformationState: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport { mFIGetBonusCouponsDetailsAsync } from '../actions/BonusItemDataActionExtension.g';\r\nimport { IMFIGetBonusCouponsDetailsResponse } from '../actions/BonusItemDataServiceEntities.g';\r\n\r\n// tslint:disable-next-line: completed-docs\r\nexport class BonusCouponsInfoInput implements IActionInput {\r\n public bonusCoupon: string;\r\n constructor(bonusCoupon: string) {\r\n this.bonusCoupon = bonusCoupon;\r\n }\r\n public getCacheKey = () => `MFRMBonusCouponsInfoInput-${this.bonusCoupon}`;\r\n public getCacheObjectType = () => 'MFRMBonusCouponsInfoInput';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\nexport interface IMFRMBonusCouponsDetailData {\r\n couponsDetails: IMFIGetBonusCouponsDetailsResponse;\r\n}\r\n\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new BonusCouponsInfoInput('');\r\n};\r\n\r\nexport async function getAllBonusCouponsDetails(\r\n input: BonusCouponsInfoInput,\r\n ctx: IActionContext\r\n): Promise {\r\n try {\r\n const result = await mFIGetBonusCouponsDetailsAsync({ callerContext: ctx }, input.bonusCoupon);\r\n if (result) {\r\n return {couponsDetails: result};\r\n }\r\n } catch (error) {\r\n ctx.telemetry.warning(JSON.stringify(error));\r\n ctx.telemetry.debug('Unable to get Bonus Coupons Details when get all coupons');\r\n }\r\n return {couponsDetails: {}};\r\n}\r\n\r\nexport default createObservableDataAction({\r\n action: >getAllBonusCouponsDetails,\r\n input: createInput\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n/**\r\n * GetAuthTokenInput Input Action\r\n */\r\nexport class BrightSpotContentInput extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n private brightspotUrl: string = '';\r\n constructor(brightspotUrl: string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'bspagecache', cacheKey: 'bspagecache' });\r\n this.brightspotUrl = brightspotUrl;\r\n }\r\n\r\n public getBrightspotUrl = () => this.brightspotUrl;\r\n public getCacheKey = () => `bspagecache`;\r\n public getCacheObjectType = () => 'bspagecache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.brightspotPageUrl) {\r\n return new BrightSpotContentInput(inputData.config.brightspotPageUrl);\r\n }\r\n return new BrightSpotContentInput('');\r\n};\r\n\r\nasync function action(input: BrightSpotContentInput, ctx: Msdyn365.IActionContext): Promise {\r\n const res = await Msdyn365.sendRequest(\r\n input.getBrightspotUrl(),\r\n 'get',\r\n null,\r\n { headers: {'Accept-Encoding': 'gzip'} }\r\n );\r\n\r\n return res.data;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n input: createInput\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nimport { IFinancingOfferFormatted } from '../Utilities/select-financing-offer';\r\n\r\n/**\r\n * FinancingOfferState Input Action\r\n */\r\n\r\nexport class FinancingOfferStateInput implements Msdyn365.IActionInput {\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `FinancingOfferState`;\r\n public getCacheObjectType = () => 'FinancingOfferState';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IFinancingOfferStateData {\r\n isOpen: boolean;\r\n totalPrice?: number;\r\n financingOffer?: IFinancingOfferFormatted;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new FinancingOfferStateInput();\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: FinancingOfferStateInput, ctx: Msdyn365.IActionContext): Promise {\r\n return { isOpen: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n id: 'FinancingOfferState',\r\n input: createInput\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n// tslint:disable-next-line: no-duplicate-imports\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { CacheType, ZipCodeInfo } from '@msdyn365-commerce/retail-proxy';\r\nimport { getAddressFromZipCodeAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\r\n\r\n/**\r\n * GetEyebrowMessage Input Action\r\n */\r\n\r\nexport class GetAddressByZipcodeInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n public country: string;\r\n public zipcode: string;\r\n\r\n constructor(country: string, zipcode: string) {\r\n this.country = country;\r\n this.zipcode = zipcode;\r\n }\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `Get-Address-By-Zipcode-${this.zipcode}`;\r\n public getCacheObjectType = () => 'GetAddressByZipCode';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function getAddressByZipcodeAction(input: GetAddressByZipcodeInput, ctx: IActionContext): Promise {\r\n return getAddressFromZipCodeAsync({ callerContext: ctx, queryResultSettings: { Paging: { Top: 1 } } }, input.country, input.zipcode);\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getAddressByZipcodeAction,\r\n // Give your data action a unique id\r\n id: 'GetAddressByZipcode'\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { buildCacheKey } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n CacheType, createObservableDataAction, IAction, IActionContext, IActionInput,\r\n ICommerceApiSettings, ICreateActionContext, isEmptyOrNullObject\r\n} from '@msdyn365-commerce/core';\r\nimport { getCheckoutState, ICheckoutState } from '@msdyn365-commerce/global-state';\r\nimport {\r\n getCardPaymentAcceptPointAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\r\nimport {\r\n CardPaymentAcceptPoint, CommerceProperty\r\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport get from 'lodash/get';\r\nimport Cookies from 'universal-cookie';\r\nimport { selectFinancingOffer } from '../Utilities/select-financing-offer';\r\nimport { getSetGrandTotal } from '../Utilities/cart-utils';\r\nimport { hasArray } from '../Utilities/emtpyChecker';\r\nexport interface IGetCardPaymentAcceptPointInput {\r\n showBillingAddress?: boolean;\r\n paymenTenderType?: string;\r\n apiSettings: ICommerceApiSettings;\r\n selectedOfferName?: string;\r\n isReload?: boolean;\r\n amountDue?: number;\r\n synchronySpecialFinancingCondition?: boolean;\r\n}\r\n\r\n/**\r\n * GetCardPaymentAcceptPointInput - Input for create GetCardPaymentAcceptPoint\r\n */\r\nexport class GetCardPaymentAcceptPointInput implements IActionInput {\r\n public showBillingAddress?: boolean;\r\n public paymenTenderType?: string;\r\n public selectedOfferName?: string;\r\n public amountDue?: number;\r\n public synchronySpecialFinancingCondition?: boolean;\r\n private apiSettings: ICommerceApiSettings;\r\n public isReload?: boolean;\r\n\r\n constructor(input: IGetCardPaymentAcceptPointInput) {\r\n this.showBillingAddress = input.showBillingAddress;\r\n this.paymenTenderType = input.paymenTenderType;\r\n this.apiSettings = input.apiSettings;\r\n this.selectedOfferName = input.selectedOfferName;\r\n this.isReload = input.isReload;\r\n this.amountDue = input.amountDue;\r\n this.synchronySpecialFinancingCondition = input.synchronySpecialFinancingCondition;\r\n }\r\n\r\n public getCacheKey = () => buildCacheKey(`CardPaymentAcceptPoint${this.paymenTenderType ? `-${this.paymenTenderType}` : ''}`, this.apiSettings);\r\n public getCacheObjectType = () => `CardPaymentAcceptPoint`;\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\nexport const createCheckoutPaymentInstrumentInput = (inputData: ICreateActionContext) => {\r\n // @ts-ignore\r\n const { showBillingAddress, paymenTenderType, amountDue, synchronySpecialFinancingCondition } = inputData.config;\r\n const getCardPaymentAcceptPointInput = {\r\n showBillingAddres: showBillingAddress,\r\n paymenTenderType: paymenTenderType,\r\n apiSettings: inputData.requestContext.apiSettings,\r\n amountDue,\r\n synchronySpecialFinancingCondition\r\n };\r\n\r\n return new GetCardPaymentAcceptPointInput(getCardPaymentAcceptPointInput);\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns a cart object based on the passed GetCartInput\r\n */\r\nexport async function getCardPaymentAcceptPointAction(\r\n input: GetCardPaymentAcceptPointInput,\r\n ctx: IActionContext\r\n): Promise {\r\n // If no cart ID is provided in input, we need to create a cart object\r\n if (!input) {\r\n ctx.telemetry.exception(new Error('[getCardPaymentAcceptPointAction] No valid Input was provided, failing'));\r\n throw new Error('[getCardPaymentAcceptPointAction] No valid Input was provided, failing');\r\n }\r\n\r\n const { showBillingAddress, paymenTenderType, amountDue = 0, synchronySpecialFinancingCondition } = input;\r\n const checkoutState: ICheckoutState = await getCheckoutState(ctx).catch((error: Error) => {\r\n ctx.telemetry.exception(error);\r\n throw error;\r\n });\r\n\r\n if (\r\n isEmptyOrNullObject(checkoutState) ||\r\n isEmptyOrNullObject(checkoutState.checkoutCart) ||\r\n isEmptyOrNullObject(checkoutState.checkoutCart.cart)\r\n ) {\r\n ctx.telemetry.exception(new Error('[getCardPaymentAcceptPointAction] Unable to get cart'));\r\n throw new Error('[getCardPaymentAcceptPointAction] Unable to get cart');\r\n }\r\n\r\n if (!checkoutState.checkoutCart.cart.CartLines || !checkoutState.checkoutCart.cart.CartLines.length) {\r\n ctx.telemetry.exception(new Error('[getCardPaymentAcceptPointAction] Cart is empty'));\r\n throw new Error('[getCardPaymentAcceptPointAction] Cart is empty');\r\n }\r\n\r\n const requestUrl =\r\n typeof ctx.requestContext.url.requestUrl === 'string'\r\n ? new URL(ctx.requestContext.url.requestUrl)\r\n : ctx.requestContext.url.requestUrl;\r\n const origin = get(window, 'location.origin') || requestUrl.origin;\r\n const zeroAmount = 0;\r\n\r\n const cardPaymentAcceptSettings = {\r\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CardPaymentAcceptSettings',\r\n HostPageOrigin: origin,\r\n AdaptorPath: `${origin}/Connectors/` || origin,\r\n CardPaymentEnabled: false,\r\n CardTokenizationEnabled: true,\r\n ...(!showBillingAddress && { HideBillingAddress: true }),\r\n ...(paymenTenderType && { TenderTypeId: paymenTenderType }),\r\n PaymentAmount: amountDue || zeroAmount\r\n };\r\n\r\n const { everydayFinancingOffers, addPaymentMethodName, extensionKeyPlanId, limitedTimeFinancingOffers, specialFinancingOffer, specialFinancingEnable } = ctx.requestContext.app.config;\r\n const getOffer = selectFinancingOffer({\r\n limitedTimeFinancingOffers,\r\n everydayFinancingOffers,\r\n totalPrice: getSetGrandTotal('get'),\r\n specialFinancingOffer,\r\n synchronySpecialFinancingCondition,\r\n specialFinancingEnable\r\n });\r\n const allOffers = [...(hasArray(limitedTimeFinancingOffers) || []), ...(hasArray(everydayFinancingOffers) || []), ...(hasArray(specialFinancingOffer) || [])];\r\n const offerName = synchronySpecialFinancingCondition && specialFinancingEnable? getOffer?.offerName : getOffer?.isLTO ? getOffer?.offerName : (input.selectedOfferName || getOffer?.offerName);\r\n const isReload = input.isReload;\r\n const defaultVal =\r\n allOffers?.find((item: { offerName: string }) => item.offerName?.toLowerCase() === offerName?.toLowerCase());\r\n const isSynchrony = paymenTenderType?.toLowerCase() === addPaymentMethodName?.toLowerCase();\r\n if(isSynchrony){\r\n (new Cookies()).set('Ecom_FinanceOption', defaultVal?.offerName);\r\n (new Cookies()).set('Ecom_FinancePlanId', defaultVal?.planID);\r\n }\r\n const ep: CommerceProperty[] = isSynchrony ? [{Key: extensionKeyPlanId, Value: { StringValue: defaultVal?.planID}}] : [];\r\n if (isReload) {\r\n return getCardPaymentAcceptPointAsync(\r\n { callerContext: ctx, bypassCache: 'get' },\r\n checkoutState.checkoutCart.cart.Id,\r\n cardPaymentAcceptSettings,\r\n ep\r\n ).then(cardPaymentAcceptPoint => {\r\n if (!cardPaymentAcceptPoint.AcceptPageUrl && !cardPaymentAcceptPoint.AcceptPageContent) {\r\n throw new Error(\r\n '[getCardPaymentAcceptPointAction] Payment Accept Page has neither return AcceptPageUrl nor AcceptPageContent in updatePaymentAcceptPageData'\r\n );\r\n }\r\n return cardPaymentAcceptPoint;\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n ctx.telemetry.debug('Unable to get Card Payment Accept Point');\r\n throw error;\r\n });\r\n }\r\n return {};\r\n}\r\n\r\nexport const getCardPaymentAcceptPointActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce/checkout-payment-instrument/get-card-payment-accept-point',\r\n action: >getCardPaymentAcceptPointAction,\r\n input: createCheckoutPaymentInstrumentInput\r\n});\r\n\r\nexport default getCardPaymentAcceptPointActionDataAction;","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nexport class GetComfortTypesData extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n private comfortTypesDataUrl: string = '';\r\n constructor(comfortTypesDataUrl: string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'comfortTypesDataCache', cacheKey: 'comfortTypesDataCache' });\r\n this.comfortTypesDataUrl = comfortTypesDataUrl;\r\n }\r\n public getComfortTypesDataUrl = () => this.comfortTypesDataUrl;\r\n public getCacheKey = () => `comfortTypesDataCache`;\r\n public getCacheObjectType = () => 'comfortTypesDataCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.comfortTypesDataUrl) {\r\n return new GetComfortTypesData(inputData.config.comfortTypesDataUrl);\r\n }\r\n return new GetComfortTypesData('');\r\n};\r\nasync function action(input: GetComfortTypesData, ctx: Msdyn365.IActionContext): Promise {\r\n const comfortTypesDataJsonUrl = ctx.requestContext.app.config.comfortTypesDataJsonUrl;\r\n const jsonUrl = comfortTypesDataJsonUrl || '';\r\n const res = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n const comfortTypesData = res.data && res.data;\r\n return comfortTypesData;\r\n}\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n input: createInput\r\n});","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { IProductDimensionsWithAvailabilitiesFull, ProductDimensionFull } from '@msdyn365-commerce/commerce-entities';\r\nimport MsDyn365, {\r\n CacheType, createObservableDataAction, IAction, IActionContext, IActionInput,\r\n IAny, ICreateActionContext, IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport {\r\n ProductDimension, ProductDimensionAvailabilitySearchCriteria,\r\n ProductDimensionValue, ProductDimensionValueInventoryAvailability, ProductsDataActions\r\n} from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { createInventoryAvailabilitySearchCriteria, getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getDimensionValuesFromQuery, getQueryParamsFromQueryByName } from './utilities/utils';\r\nimport { variantQueryStringName } from '../Utilities/constants';\r\n\r\n/**\r\n * Defines the dimension value type for get dimensions for selected variant data action.\r\n * Includes old API format for backward compatibility and new API info for availabilities for new logic.\r\n */\r\nexport interface IDimensionValueForSelectedVariant extends ProductDimensionValueInventoryAvailability, ProductDimensionValue {}\r\n\r\n/**\r\n * Defines the returned type for get dimensions for selected variant data action.\r\n * Includes old API format for backward compatibility and new API info for availabilities for new logic.\r\n */\r\nexport interface IDimensionForSelectedVariant extends ProductDimensionFull, IProductDimensionsWithAvailabilitiesFull {}\r\n\r\n/**\r\n * Input class for the getDimensionsForSelectedVariant data action.\r\n */\r\nexport class GetDimensionsForSelectedVariantInput implements IActionInput {\r\n public productId: number;\r\n\r\n public channelId: number;\r\n\r\n public matchingDimensionValues: ProductDimension[];\r\n\r\n public constructor(productId: number, channelId: number, matchingDimensionValues?: ProductDimension[]) {\r\n this.productId = productId;\r\n this.channelId = channelId;\r\n this.matchingDimensionValues = matchingDimensionValues || [];\r\n }\r\n\r\n /**\r\n * Cache key.\r\n * @returns String.\r\n */\r\n public getCacheKey: () => string = () => `DimensionsForSelectedVariantInput-${this.productId}-${this.channelId}`;\r\n\r\n /**\r\n * Cache object type.\r\n * @returns String.\r\n */\r\n public getCacheObjectType: () => string = () => 'DimensionsForSelectedVariantInput';\r\n\r\n /**\r\n * Cache type.\r\n * @returns String.\r\n */\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\n/**\r\n * Create input method for the getDimensionsForSelectedVariant data action.\r\n * @param inputData - The input data passed to the createInput method.\r\n * @returns - The input for the data action.\r\n */\r\nconst createDimensionsForSelectedVariantInput = (inputData: ICreateActionContext>): GetDimensionsForSelectedVariantInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n if (productId) {\r\n return new GetDimensionsForSelectedVariantInput(\r\n +productId,\r\n +inputData.requestContext.apiSettings.channelId,\r\n getDimensionValuesFromQuery(inputData.requestContext.url.requestUrl));\r\n }\r\n throw new Error('Unable to create DimensionsForSelectedVariantInput, no productId found on module config or query');\r\n};\r\n\r\n/**\r\n * Converts new API type with availabilities to old API type to preserve backward compatibility.\r\n * @param dimensions - Dimensions to convert.\r\n * @returns Dimensions in old API format.\r\n */\r\nconst prepareDimensionsDataResult = (dimensions: IProductDimensionsWithAvailabilitiesFull[]): IDimensionForSelectedVariant[] => {\r\n return dimensions.map(newDimension => {\r\n const oldDimension: IDimensionForSelectedVariant = { ...newDimension };\r\n oldDimension.DimensionValues = ArrayExtensions.validValues(newDimension.dimensionValuesWithInventory?.map(value => value.DimensionValue));\r\n return oldDimension;\r\n });\r\n};\r\n\r\n/**\r\n * Action Method for the getDimensionsForSelectedVariant Data Action.\r\n * @param input - Input for the data action.\r\n * @param context - Action context.\r\n * @returns Product dimensions with availability.\r\n */\r\nexport async function getDimensionsForSelectedVariantAction(\r\n input: GetDimensionsForSelectedVariantInput,\r\n context: IActionContext\r\n): Promise {\r\n const variantId = context.requestContext.app.config.queryBasedVariantSelection ? getQueryParamsFromQueryByName(MsDyn365.isBrowser ? new URL(window.location.href.toString()) : context.requestContext.url.requestUrl, variantQueryStringName) : undefined;\r\n let activeProduct = await ProductsDataActions.getByIdAsync({ callerContext: context }, variantId && !Number.isNaN(Number(variantId)) ? Number(variantId) : input.productId, input.channelId);\r\n if (!activeProduct && variantId) {\r\n activeProduct = await ProductsDataActions.getByIdAsync({ callerContext: context }, Number(input.productId), input.channelId);\r\n }\r\n if (!ArrayExtensions.hasElements(activeProduct.Dimensions)) {\r\n return [];\r\n }\r\n\r\n const promises = activeProduct.Dimensions.map(dimension => {\r\n const shippingInventoryConfiguration = createInventoryAvailabilitySearchCriteria(context, [], true, undefined, undefined);\r\n\r\n const searchCriteria: ProductDimensionAvailabilitySearchCriteria =\r\n {\r\n RequestedDimensionTypeValue: dimension.DimensionTypeValue,\r\n MatchingDimensionValues: input.matchingDimensionValues.filter(item => item.DimensionTypeValue !== dimension.DimensionTypeValue),\r\n DefaultWarehouseOnly: shippingInventoryConfiguration.DefaultWarehouseOnly,\r\n FilterByChannelFulfillmentGroup: shippingInventoryConfiguration.FilterByChannelFulfillmentGroup,\r\n DeliveryModeTypeFilterValue: shippingInventoryConfiguration.DeliveryModeTypeFilterValue\r\n };\r\n\r\n const dimensionValuesPromise = ProductsDataActions.getDimensionValuesWithEstimatedAvailabilitiesAsync(\r\n { callerContext: context, queryResultSettings: {} },\r\n activeProduct.MasterProductId ? activeProduct.MasterProductId : activeProduct.RecordId,\r\n searchCriteria\r\n );\r\n const fullDimensionPromise = dimensionValuesPromise.then(dimensionValues => {\r\n const fullDimension: IProductDimensionsWithAvailabilitiesFull = {\r\n ...dimension,\r\n dimensionValuesWithInventory: dimensionValues\r\n };\r\n return fullDimension;\r\n });\r\n\r\n return fullDimensionPromise;\r\n });\r\n\r\n const dimensionValuesResults = await Promise.all(promises);\r\n\r\n return prepareDimensionsDataResult(dimensionValuesResults);\r\n}\r\n\r\n/**\r\n * The GetDimensionsForSelectedVariantDataAction\r\n * Get the currently selected Variant via the getSelectedVariant data action, and the gets the\r\n * available product dimensions for the variant via the getDimensionValues RetailServer API.\r\n */\r\nexport const getDimensionsForSelectedVariantActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-dimensions/for-selected-variant',\r\n action: getDimensionsForSelectedVariantAction as IAction,\r\n input: createDimensionsForSelectedVariantInput\r\n});\r\n\r\nexport default getDimensionsForSelectedVariantActionDataAction;","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nexport class GetFranchiseData extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n public Latitude?: number;\r\n public Longitude?: number;\r\n public Radius?: number;\r\n\r\n constructor(_Latitude?: number, _Longitude?: number, _Radius?: number) {\r\n super({\r\n shouldCacheOutput: true,\r\n cacheObjectType: 'FranchiseDataCache',\r\n cacheKey: 'FranchiseDataCache'\r\n });\r\n this.Latitude = _Latitude;\r\n this.Longitude = _Longitude;\r\n this.Radius = _Radius;\r\n }\r\n public getCacheKey = () => `FranchiseDataCache`;\r\n public getCacheObjectType = () => 'FranchiseDataCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\nexport interface IFranchise {\r\n \"id\": string;\r\n \"name\": string;\r\n \"address_line_1\": string;\r\n \"address_line_2\": string;\r\n \"city\": string;\r\n \"state_province\": string;\r\n \"postal_code\": string;\r\n \"country\": string;\r\n \"lat\": string;\r\n \"long\": string;\r\n \"distance\": number;\r\n \"website_url\": string;\r\n \"miles\"?: number;\r\n}\r\n\r\nconst _calculateDistance = (latitude1: any, longitude1: any, latitude2: any, longitude2: any) => {\r\n\r\n // The math module contains a function\r\n // named toRadians which converts from\r\n // degrees to radians.\r\n const long1 = longitude1 * Math.PI / 180;\r\n const long2 = longitude2 * Math.PI / 180;\r\n const lat1 = latitude1 * Math.PI / 180;\r\n const lat2 = latitude2 * Math.PI / 180;\r\n\r\n // Haversine formula\r\n const dlon = long2 - long1;\r\n const dlat = lat2 - lat1;\r\n const a = Math.pow(Math.sin(dlat / 2), 2)\r\n + Math.cos(lat1) * Math.cos(lat2)\r\n * Math.pow(Math.sin(dlon / 2), 2);\r\n const c = 2 * Math.asin(Math.sqrt(a));\r\n\r\n // Radius of earth\r\n // for kilometers=6371\r\n // for miles = 3956\r\n const r = 3956;\r\n\r\n // calculate the result\r\n return (c * r);\r\n};\r\n\r\nexport const getFranchiseInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n return new GetFranchiseData();\r\n};\r\n\r\n\r\nexport async function getFranchise(input: GetFranchiseData, ctx: Msdyn365.IActionContext): Promise {\r\n const jsonUrl = ctx.requestContext.app.config.sociFranchiseDataUrl || 'https://files-us-prod.cms.commerce.dynamics.com/cms/api/fknscsckgq/binary/MAcq1X!!';\r\n const franchiseDataJson = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n const franchiseStores: IFranchise[] = [];\r\n franchiseDataJson.data.map((franchise: IFranchise) => {\r\n const miles = _calculateDistance(input.Latitude, input.Longitude, franchise.lat, franchise.long);\r\n if (miles <= (input.Radius || 50)) {\r\n franchise.miles = miles;\r\n franchiseStores.push(franchise);\r\n }\r\n });\r\n\r\n return franchiseStores;\r\n}\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getFranchise,\r\n input: getFranchiseInput\r\n});","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport class GetProductBenefitsEnhancedContentInput extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n public masterProductID: string = '';\r\n constructor( masterProductID:string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'productBenefitsEnhancedContentCache', cacheKey: 'productBenefitsEnhancedContentCache' });\r\n this.masterProductID = masterProductID;\r\n }\r\n public getCacheKey = () => `productBenefitsEnhancedContentCache`;\r\n public getCacheObjectType = () => 'productBenefitsEnhancedContentCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n// tslint:disable: no-any\r\nasync function getEnhancedContentAction(input: GetProductBenefitsEnhancedContentInput, ctx: Msdyn365.IActionContext): Promise {\r\n const jsonUrlFromGlobals = ctx.requestContext.app.config.productBenefitsEnhancedContentUrl;\r\n const masterProductid = input.masterProductID;\r\n const jsonUrl = jsonUrlFromGlobals || '';\r\n try {\r\n const res = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n if (res && masterProductid) {\r\n const productBenefitData = res.data && res.data[masterProductid];\r\n return productBenefitData;\r\n }\r\n }\r\n catch (error) {\r\n console.log('error', error);\r\n }\r\n return null;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getEnhancedContentAction\r\n});","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nexport class GetProductBenefitsData extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n private productBenefitsDataUrl: string = '';\r\n constructor(productBenefitsDataUrl: string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'productBenefitsDataCache', cacheKey: 'productBenefitsDataCache' });\r\n this.productBenefitsDataUrl = productBenefitsDataUrl;\r\n }\r\n public getProductBenefitsDataUrl = () => this.productBenefitsDataUrl;\r\n public getCacheKey = () => `productBenefitsDataCache`;\r\n public getCacheObjectType = () => 'productBenefitsDataCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.productBenefitsDataUrl) {\r\n return new GetProductBenefitsData(inputData.config.productBenefitsDataUrl);\r\n }\r\n return new GetProductBenefitsData('');\r\n};\r\nasync function action(input: GetProductBenefitsData, ctx: Msdyn365.IActionContext): Promise {\r\n const productBenefitsDataJsonUrl = ctx.requestContext.app.config.productBenefitsDataUrl;\r\n const jsonUrl = productBenefitsDataJsonUrl || '';\r\n const res = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n const productBenefitsData = res.data && res.data;\r\n return productBenefitsData;\r\n}\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n input: createInput\r\n});","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * GetPromocodeValue Input Action\r\n */\r\n\r\nexport class GetPromocodeValueInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `getPromoCode`;\r\n public getCacheObjectType = () => 'getPromoCode';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IGetPromocodeValueData {\r\n promocodeValue: [IPromoCode];\r\n}\r\nexport interface IPromoCode {\r\n promoCodeApplied: string;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetPromocodeValueInput();\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: GetPromocodeValueInput, ctx: Msdyn365.IActionContext): Promise {\r\n // tslint:disable-next-line: no-unnecessary-local-variable\r\n const promocodeValue: IPromoCode[] = [];\r\n return promocodeValue;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'GetPromocodeValue',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport class GetReasonsToBuyDataInput extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n public categoryName:string ='';\r\n constructor( categoryName:string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'rtbDataCache', cacheKey: 'rtbDataCache' });\r\n this.categoryName = categoryName;\r\n }\r\n public getCacheKey = () => `rtbDataCache`;\r\n public getCacheObjectType = () => 'rtbDataCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n\r\n}\r\n// tslint:disable: no-any\r\nasync function action(input: GetReasonsToBuyDataInput, ctx: Msdyn365.IActionContext): Promise {\r\n const jsonUrlFromGlobals = ctx.requestContext.app.config.reasonsToBuyJsonUrl;\r\n const categoryName =input.categoryName;\r\n const jsonUrl =jsonUrlFromGlobals || undefined;\r\n if(jsonUrl){\r\n const res = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n const reasonsToBuyData = res.data && res.data[categoryName];\r\n return reasonsToBuyData;\r\n }\r\n return undefined;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action\r\n});\r\n","import { buildCacheKey, getSimpleProducts, ProductInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, ICommerceApiSettings, ICreateActionContext } from '@msdyn365-commerce/core';\r\nimport { ProductDeliveryOptions, SalesOrder, SimpleProduct, TransactionType } from '@msdyn365-commerce/retail-proxy';\r\nimport { getDeliveryOptionsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { getSalesOrderDetailsBySalesIdAsync, getSalesOrderDetailsByTransactionIdAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/SalesOrdersDataActions.g';\r\n\r\ninterface ISalesOrderWithHydrations {\r\n salesOrder: SalesOrder;\r\n products: SimpleProduct[];\r\n productDeliveryOptions?: ProductDeliveryOptions[];\r\n}\r\n\r\n/**\r\n * orderTypes Types of orders\r\n */\r\nexport const enum orderTypes {\r\n salesOrder = 'salesOrder',\r\n transaction = 'transaction'\r\n}\r\n\r\n/**\r\n * Calls the Retail API and returns the sales order\r\n */\r\nconst getSalesOrder = (orderType: string = '', orderId: string = '') => async (ctx: IActionContext): Promise => {\r\n return orderType === orderTypes.salesOrder\r\n ? getSalesOrderDetailsBySalesIdAsync({ callerContext: ctx }, orderId)\r\n : // Local (1) searches the retail server database, and remote (2) searches\r\n // on the headquarters side. All (3) and none (0) are not supported.\r\n getSalesOrderDetailsByTransactionIdAsync({ callerContext: ctx }, orderId, 1);\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns the products\r\n */\r\nconst getProducts = (productIds: number[] = [], channelId?: number) => async (ctx: IActionContext): Promise => {\r\n const productInputs = productIds.map(productId => new ProductInput(productId, ctx.requestContext.apiSettings, channelId));\r\n return getSimpleProducts(productInputs, ctx);\r\n};\r\n\r\n/**\r\n * Action input\r\n */\r\nexport class GetSalesOrderWithHydrationsInput implements IActionInput {\r\n public orderType: string;\r\n public orderId: string;\r\n private apiSettings: ICommerceApiSettings;\r\n\r\n constructor(orderType: string , orderId: string, apiSettings: ICommerceApiSettings) {\r\n this.orderType = orderType;\r\n this.orderId = orderId;\r\n this.apiSettings = apiSettings;\r\n }\r\n\r\n public getCacheKey = () => buildCacheKey(`SalesOrderWithHydrations`, this.apiSettings);\r\n public getCacheObjectType = () => `SalesOrderWithHydrations-${this.orderType}-${this.orderId}`;\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * Creates the input required to make the retail api call\r\n */\r\nconst createSalesOrderWithHydrationsInput = (inputData: ICreateActionContext) => {\r\n const { salesId = '', transactionId = '' } = (inputData.requestContext.query && inputData.requestContext.query) || {};\r\n if (salesId) {\r\n return new GetSalesOrderWithHydrationsInput(orderTypes.salesOrder, salesId, inputData.requestContext.apiSettings);\r\n } else if (transactionId) {\r\n return new GetSalesOrderWithHydrationsInput(orderTypes.transaction, transactionId, inputData.requestContext.apiSettings);\r\n }\r\n throw new Error(`createSalesOrderWithHydrationsInput - No salesId or transactionId provided.`);\r\n};\r\n\r\n/**\r\n * Get sales order with hydrations action\r\n */\r\nexport async function getSalesOrderWithHydrationsAction(\r\n input: GetSalesOrderWithHydrationsInput,\r\n ctx: IActionContext\r\n): Promise {\r\n if (!ctx) {\r\n throw new Error(`getSalesOrderWithHydrationsAction - Action context cannot be null/undefined`);\r\n }\r\n\r\n const { orderType, orderId } = input;\r\n\r\n if (!orderType || !orderId) {\r\n ctx.trace(`[getSalesOrderWithHydrationsAction] No orderType or orderId provided.`);\r\n return {};\r\n }\r\n\r\n const salesOrder = await getSalesOrder(orderType, orderId)(ctx);\r\n\r\n if (!salesOrder) {\r\n ctx.trace(`[getSalesOrderWithHydrationsAction] No salesOrder found.`);\r\n return {};\r\n }\r\n\r\n // If it is salesInvoice, return salesOrder and empty products\r\n // tslint:disable-next-line:prefer-type-cast\r\n if (salesOrder.TransactionTypeValue === 15 as TransactionType.SalesInvoice) {\r\n return {\r\n salesOrder,\r\n products: []\r\n };\r\n }\r\n\r\n if (!salesOrder.SalesLines || !salesOrder.SalesLines.length) {\r\n ctx.trace(`[getSalesOrderWithHydrationsAction] No salesLine found.`);\r\n return {};\r\n }\r\n\r\n const productIds: number[] = salesOrder.SalesLines.map(salesLine => salesLine.ProductId || 0).filter(productId => productId);\r\n\r\n if (!productIds || !productIds.length) {\r\n ctx.trace(`[getSalesOrderWithHydrationsAction] No productId in saleLines found.`);\r\n return {};\r\n }\r\n\r\n const products = await getProducts(productIds, salesOrder.ChannelId)(ctx);\r\n if (!products || !products.length) {\r\n ctx.trace(`[getSalesOrderWithHydrationsAction] No product found.`);\r\n return {};\r\n }\r\n\r\n const deliveryOptions = await getDeliveryOptionsAsync({ callerContext: ctx, queryResultSettings: {} }, products.map(x => x.RecordId), {}, 4)\r\n .then(result => {\r\n return result;\r\n }).catch((error: Error) => {\r\n ctx.trace(error.message);\r\n ctx.telemetry.exception(error);\r\n ctx.telemetry.debug(`[getDeliveryOptionsForCartLineItems]Error executing action`);\r\n throw new Error('[getDeliveryOptionsForCartLineItems]Error executing action');\r\n });\r\n\r\n return {\r\n salesOrder,\r\n products,\r\n deliveryOptions\r\n };\r\n}\r\n\r\nexport const getSalesOrderWithHydrationsActionDataAction = createObservableDataAction({\r\n id: 'mfrm-get-sales-order-with-hydrations',\r\n action: >getSalesOrderWithHydrationsAction,\r\n input: createSalesOrderWithHydrationsInput\r\n});\r\n\r\nexport default getSalesOrderWithHydrationsActionDataAction;","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { filteredURL } from '../Utilities/plp-url-utils';\r\n\r\nexport class GetSeoDataInput extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n\r\n private seoDataUrl: string = '';\r\n constructor(seoDataUrl: string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'SeoDataCache', cacheKey: 'SeoDataCache' });\r\n this.seoDataUrl = seoDataUrl;\r\n }\r\n\r\n public getSeoDataUrl = () => this.seoDataUrl;\r\n public getCacheKey = () => `SeoDataCache`;\r\n public getCacheObjectType = () => 'SeoDataCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n\r\n}\r\n\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.seoDataUrl) {\r\n return new GetSeoDataInput(inputData.config.seoDataUrl);\r\n }\r\n return new GetSeoDataInput('');\r\n};\r\n\r\n// tslint:disable: no-any\r\nasync function action(input: GetSeoDataInput, ctx: Msdyn365.IActionContext): Promise {\r\n\r\n const jsonUrlFromGlobals = ctx.requestContext.app.config.seoDataUrl;\r\n // TODO: Just remove the fallback\r\n const jsonUrl = jsonUrlFromGlobals || 'https://files-us-prod.cms.commerce.dynamics.com/cms/api/fknscsckgq/binary/MA5cA7';\r\n const res = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n const filteredUrlPath = filteredURL(ctx.requestContext);\r\n const seoData = filteredUrlPath && res.data && res.data[filteredUrlPath];\r\n return seoData && seoData[0];\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n input: createInput\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nexport class GetSleepDisruptorIcons extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n private sleepDisuptorIconsDataUrl: string = '';\r\n constructor(sleepDisuptorIconsDataUrl: string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'sleepDisuptorIconsDataCache', cacheKey: 'sleepDisuptorIconsDataCache' });\r\n this.sleepDisuptorIconsDataUrl = sleepDisuptorIconsDataUrl;\r\n }\r\n public getSleepDisuptorIconsDataUrl = () => this.sleepDisuptorIconsDataUrl;\r\n public getCacheKey = () => `sleepDisuptorIconsDataCache`;\r\n public getCacheObjectType = () => 'sleepDisuptorIconsDataCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.sleepDisuptorIconsDataUrl) {\r\n return new GetSleepDisruptorIcons(inputData.config.sleepDisuptorIconsDataUrl);\r\n }\r\n return new GetSleepDisruptorIcons('');\r\n};\r\nasync function action(input: GetSleepDisruptorIcons, ctx: Msdyn365.IActionContext): Promise {\r\n const sleepDisuptorIconsDataJsonUrl = ctx.requestContext.app.config.sleepDisruptorIconDataUrl;\r\n const jsonUrl = sleepDisuptorIconsDataJsonUrl || '';\r\n const res = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n const sleepDisuptorIconsData = res.data && res.data;\r\n return sleepDisuptorIconsData;\r\n}\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n input: createInput\r\n});","import { IFullOrgUnitAvailability } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport { ChannelDeliveryOption, OrgUnitAvailability, OrgUnitLocation, SearchArea, StoreHours } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n /*getChannelDeliveryOptionsAsync,*/ getOrgUnitLocationsByAreaAsync,\r\n getStoreHoursAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/OrgUnitsDataActions.g';\r\n// import {FeatureStateInput, getFeatureStateAction} from './get-feature-state';\r\n\r\n/**\r\n * Get selected variant action input class\r\n */\r\nexport class GetOrgUnitLocationsByAreaInput implements IActionInput {\r\n public Latitude?: number;\r\n public Longitude?: number;\r\n public Radius?: number;\r\n public DistanceUnitValue?: number;\r\n public IgnoreLocation?: boolean;\r\n\r\n constructor(_Latitude?: number, _Longitude?: number, _Radius?: number, _DistanceUnitValue?: number, _IgnoreLocation?: boolean) {\r\n this.Latitude = _Latitude;\r\n this.Longitude = _Longitude;\r\n this.Radius = _Radius;\r\n this.DistanceUnitValue = _DistanceUnitValue;\r\n this.IgnoreLocation = _IgnoreLocation;\r\n }\r\n\r\n public getCacheKey = () => `GetOrgUnitLocationsByAreaInput`;\r\n public getCacheObjectType = () => 'GetOrgUnitLocationsByAreaInput';\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\n/**\r\n * CreateInput method for the getSelectedVariant data action\r\n * @param inputData The input data passed to the createInput method\r\n */\r\nexport const createGetOrgUnitLocationsByAreaInput = (inputData: ICreateActionContext>): GetOrgUnitLocationsByAreaInput => {\r\n return new GetOrgUnitLocationsByAreaInput();\r\n};\r\n\r\n/**\r\n * Calls the Retail Feature State API and returns a list of feature with isEnabled flag.\r\n */\r\n// export async function getFeatureState(context: IActionContext): Promise {\r\n// return getFeatureStateAction(new FeatureStateInput(), context);\r\n// }\r\n\r\n/**\r\n * Action method for the getSelectedVariant data action\r\n * @param input The action input class\r\n * @param ctx The action context\r\n */\r\nexport async function getOrgUnitLocationsByArea(\r\n input: GetOrgUnitLocationsByAreaInput,\r\n ctx: IActionContext\r\n): Promise {\r\n if ((input.Radius === undefined || !input.Latitude || !input.Longitude) && !input.IgnoreLocation) {\r\n // No valid location we want to return empty array so module can show no locations message\r\n return [];\r\n }\r\n\r\n const searchArea: SearchArea = {\r\n Latitude: input.Latitude,\r\n Longitude: input.Longitude,\r\n Radius: input.Radius,\r\n DistanceUnitValue: input.DistanceUnitValue || 0 // 0 is miles\r\n };\r\n\r\n // const featureState = await getFeatureState(ctx);\r\n // const retailMulitplePickupMFeatureState = featureState?.find(item => item.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature')?.IsEnabled;\r\n\r\n return getOrgUnitLocationsByAreaAsync({ callerContext: ctx, queryResultSettings: { Paging: { Top: 4 } } }, searchArea)\r\n .then(async (stores: OrgUnitLocation[]) => {\r\n const locationDeliveryOptions: ChannelDeliveryOption[] | undefined = [];\r\n // if mulitple pickup mode is enable then call getchanneldeliveryoption\r\n // if(retailMulitplePickupMFeatureState) {\r\n // const orgUnitChannel = stores.map(store => store.ChannelId);\r\n // locationDeliveryOptions = await _getLocationPickUpDeliveryModes(orgUnitChannel, ctx);\r\n // }\r\n const locationPromiseList = stores.map(store => {\r\n const locationDeliveryOption = locationDeliveryOptions?.find(\r\n _channeldeliveryoption => _channeldeliveryoption.ChannelId === store.ChannelId\r\n );\r\n return _getLocationWithHours(store, locationDeliveryOption, ctx);\r\n });\r\n return Promise.all(locationPromiseList);\r\n })\r\n .catch((error: Error) => {\r\n ctx.trace('[GetOrgUnitLocationsByArea] error getting Locations');\r\n ctx.trace(error.message);\r\n ctx.telemetry.error(error.message);\r\n ctx.telemetry.debug(`[GetOrgUnitLocationsByArea] error getting Locations`);\r\n return [];\r\n });\r\n}\r\n\r\n/**\r\n * Action method that obtains the store information\r\n * @param orgUnitLocation The org unit location\r\n * @param storeMap a map that contains store information group by the inventory location id\r\n * @param ctx The action context\r\n */\r\nasync function _getLocationWithHours(\r\n orgUnitLocation: OrgUnitLocation,\r\n channelDeleiveryOptions: ChannelDeliveryOption | undefined,\r\n ctx: IActionContext\r\n): Promise {\r\n if (!orgUnitLocation || !orgUnitLocation.OrgUnitNumber) {\r\n return { OrgUnitAvailability: undefined };\r\n }\r\n\r\n return getStoreHoursAsync({ callerContext: ctx }, orgUnitLocation.OrgUnitNumber)\r\n .then((hours: StoreHours) => {\r\n const availability: OrgUnitAvailability = {\r\n OrgUnitLocation: orgUnitLocation\r\n };\r\n\r\n if (hours && !(hours instanceof Error)) {\r\n return { OrgUnitAvailability: availability, StoreHours: hours, OrgUnitPickUpDeliveryModes: channelDeleiveryOptions };\r\n }\r\n\r\n return { OrgUnitAvailability: availability, OrgUnitPickUpDeliveryModes: channelDeleiveryOptions };\r\n })\r\n .catch((error: Error) => {\r\n ctx.trace('[GetFullAvailableInventoryNearby] error getting availability with hours');\r\n ctx.trace(error.message);\r\n ctx.telemetry.exception(error);\r\n ctx.telemetry.debug(`[GetFullAvailableInventoryNearby] error getting availability with hours`);\r\n return { OrgUnitAvailability: {} };\r\n });\r\n}\r\n\r\n/**\r\n * Action method that obtains the store information\r\n * @param channelCollection The org unit channel Id list\r\n * @param ctx The action context\r\n */\r\n// VSI Customization Start\r\n// Need to comment this function because we removed featuresState data-action import.\r\n// async function _getLocationPickUpDeliveryModes(\r\n// channelCollection: (number| undefined)[],\r\n// ctx: IActionContext): Promise {\r\n// if (channelCollection?.length === 0 || channelCollection === undefined) {\r\n// return undefined;\r\n// }\r\n\r\n// const channelIdList: number[] = [];\r\n// channelCollection?.map(id => {\r\n// if(id !== undefined) {\r\n// return channelIdList.push(id);\r\n// }\r\n// return null;\r\n// });\r\n\r\n// // to get all channel pickup delivery mode filterOption should be 4\r\n// return getChannelDeliveryOptionsAsync({ callerContext: ctx }, channelIdList, 4)\r\n// .then((channelDeliveryOptions: ChannelDeliveryOption[]) => {\r\n\r\n// if (channelDeliveryOptions && !(channelDeliveryOptions instanceof Error)) {\r\n// return channelDeliveryOptions;\r\n// }\r\n\r\n// return undefined;\r\n// })\r\n// .catch((error: Error) => {\r\n// ctx.trace('[GetFullAvailableInventoryNearby][getChannelDeliveryOptionsAsync] error getting availability with channel delivery options');\r\n// ctx.trace(error.message);\r\n// ctx.telemetry.exception(error);\r\n// ctx.telemetry.debug(`[GetFullAvailableInventoryNearby] [getChannelDeliveryOptionsAsync] error getting availability with channel delivery options`);\r\n// return [];\r\n// });\r\n// }\r\n\r\n/**\r\n * The complete getOrgUnitLocationsByArea data action\r\n */\r\nexport const getOrgUnitLocationsByAreaDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-store-location-information',\r\n action: >getOrgUnitLocationsByArea,\r\n input: createGetOrgUnitLocationsByAreaInput\r\n});\r\n\r\nexport default getOrgUnitLocationsByAreaDataAction;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { mFIATPInventoryDynamicAsync } from '../actions/CoreProductDataActionExtension.g';\r\nimport {\r\n IMFIATPInventoryDynamicResponse, IMFICartLine, IMFICLDeliveryScheduleParameters\r\n} from '../actions/CoreProductDataServiceEntities.g';\r\n\r\n/**\r\n * MfiAtpInventory Input Action\r\n */\r\nexport class MfiAtpInventoryInput implements Msdyn365.IActionInput {\r\n // MfiAtpInventory: Construct the input needed to run the action\r\n public inventoryType: string;\r\n public weeks: number;\r\n public storeId: string;\r\n public page: string;\r\n public requestedDate: string;\r\n public zipCode: string;\r\n public itemLines: IMFICartLine[];\r\n\r\n constructor(inventoryType: string, weeks: number, storeId: string, page: string, requestedDate: string, zipCode: string, itemLines: IMFICartLine[]) {\r\n this.inventoryType = inventoryType;\r\n this.weeks = weeks;\r\n this.storeId = storeId;\r\n this.page = page;\r\n this.requestedDate = requestedDate;\r\n this.zipCode = zipCode;\r\n this.itemLines = itemLines;\r\n }\r\n\r\n // MfiAtpInventory: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `MfiAtpInventory`;\r\n public getCacheObjectType = () => 'MfiAtpInventory';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// MfiAtpInventory: Create a data model here or import one to capture the response of the action\r\nexport interface IMfiAtpInventoryData {\r\n text: string;\r\n}\r\n\r\n\r\n/**\r\n * MfiAtpInventory: Use this function to call your action and process the results as needed\r\n */\r\nexport async function mfiAtpInventoryAction(input: MfiAtpInventoryInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n const requestBody: IMFICLDeliveryScheduleParameters = {\r\n InventoryType: input.inventoryType,\r\n Weeks: input.weeks,\r\n StoreId: input.storeId,\r\n Page: input.page,\r\n RequestedDate: input.requestedDate,\r\n ZipCode: input.zipCode,\r\n ItemLines: input.itemLines\r\n };\r\n\r\n const response = await mFIATPInventoryDynamicAsync({ callerContext: ctx }, requestBody);\r\n return response;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >mfiAtpInventoryAction,\r\n // MfiAtpInventory: Give your data action a unique id\r\n id: 'MfiAtpInventory'\r\n // input: createInput\r\n // MfiAtpInventory: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { IMFIBonusItemsDetailsEntity } from '../actions/BonusItemDataServiceEntities.g';\r\n\r\n/**\r\n * MfrmNotification Input Action\r\n */\r\n\r\nexport class MFIbonusitemsInput implements Msdyn365.IActionInput {\r\n public getCacheKey = () => `mfibonusitems`;\r\n public getCacheObjectType = () => 'mfibonusitems';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\nexport interface IMFIBonusItems {\r\n bonusItems: IMFIBonusItemsDetailsEntity[] | undefined;\r\n}\r\n\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new MFIbonusitemsInput();\r\n};\r\n\r\nasync function action(input: MFIbonusitemsInput, ctx: Msdyn365.IActionContext): Promise {\r\n // tslint:disable-next-line: no-unnecessary-local-variable\r\n const bonusItems: IMFIBonusItemsDetailsEntity[] | undefined = [];\r\n return bonusItems;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n id: 'MFIbonusitems',\r\n input: createInput\r\n});\r\n\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * MfrmNotification Input Action\r\n */\r\n\r\nexport class MfrmNotificationInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `promoCode`;\r\n public getCacheObjectType = () => 'promoCode';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IMfrmNotificationState {\r\n notifications: [INotification];\r\n}\r\n\r\nexport interface INotification {\r\n id?: number | string | undefined;\r\n type?: string;\r\n value?: string | undefined;\r\n status?: string | undefined;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new MfrmNotificationInput();\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: MfrmNotificationInput, ctx: Msdyn365.IActionContext): Promise {\r\n // tslint:disable-next-line: no-unnecessary-local-variable\r\n const notifications: INotification[] = [];\r\n return notifications;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'MfrmNotification',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * PaymentCcCardTypes Input Action\r\n */\r\nexport class PaymentCcCardTypesInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `payment-cc-card-types`;\r\n public getCacheObjectType = () => 'payment-cc-card-types';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IPaymentCcCardTypesData {\r\n cardType: string;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new PaymentCcCardTypesInput();\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: PaymentCcCardTypesInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { cardType: '' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'PaymentCcCardTypes',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * PaymentErrorState Input Action\r\n */\r\nexport class PaymentErrorStateInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n constructor() { }\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `PaymentErrorState`;\r\n public getCacheObjectType = () => 'PaymentErrorState';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IPaymentErrorState {\r\n errorTitle: string;\r\n errorMessage: string;\r\n progressiveLinkText: string;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new PaymentErrorStateInput();\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: PaymentErrorStateInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { errorTitle: \"\", errorMessage: \"\", progressiveLinkText: \"\" };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'PaymentErrorState',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { createObservableDataAction } from '@msdyn365-commerce/action-internal';\r\nimport { IAction, IActionContext } from '@msdyn365-commerce/core-internal';\r\nimport { searchByCriteriaAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { ProductSearchCriteria, ProductSearchResult } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n// @ts-ignore\r\nimport { CATEGORY_PAGE_NAME } from '@msdyn365-commerce/runtime-internal/dist/lib/consts';\r\n// @ts-ignore\r\nimport { getProductImageUrls } from '@msdyn365-commerce/runtime-internal/dist/lib/utils/product-list-utils';\r\nimport { ProductListInput } from '@msdyn365-commerce/runtime-internal/dist/types/hydrators/hydrator-action-inputs';\r\n\r\nexport const getProductsByCategoryList = async (input: ProductListInput, context: IActionContext): Promise => {\r\n let categoryId: number;\r\n const urlTokens = context.requestContext.urlTokens;\r\n\r\n // If the category ID has been provided from the list metadata use it, otherwise grab the category ID from context\r\n if (input.listMetadata.categoryIds && input.listMetadata.categoryIds.length > 0) {\r\n categoryId = input.listMetadata.categoryIds[0];\r\n } else if (urlTokens && urlTokens.pageType && urlTokens.pageType.toLowerCase() === CATEGORY_PAGE_NAME && urlTokens.recordId) {\r\n categoryId = +urlTokens.recordId;\r\n } else if (urlTokens && urlTokens.categories && urlTokens.categories.length > 0) {\r\n categoryId = +urlTokens.categories[0];\r\n } else {\r\n // Unable to determine category from list meta data or context\r\n throw new Error('CategoryId Missing for ProductsByCategory List');\r\n }\r\n context.telemetry.debug(`Category Id input to ProductsByCategory action : ${categoryId}`);\r\n const productSearchCriteria: ProductSearchCriteria = {\r\n Context: {\r\n ChannelId: +input.channelId,\r\n CatalogId: +input.catalogId\r\n },\r\n CategoryIds: [categoryId],\r\n IncludeAttributes: true\r\n };\r\n\r\n return searchByCriteriaAsync(\r\n { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } },\r\n productSearchCriteria\r\n )\r\n .then((products: ProductSearchResult[]) => {\r\n context.telemetry.debug('Products returned by ProductByCategory action', products);\r\n return getProductImageUrls(products, context.requestContext.apiSettings);\r\n })\r\n .catch(error => {\r\n context.telemetry.error(`Error running ProductByCategory action: ${error}`);\r\n throw new Error(error);\r\n });\r\n};\r\n\r\nexport const getProductsByCategoryListAction = createObservableDataAction({\r\n action: >getProductsByCategoryList,\r\n id: '@msdyn365-commerce/products-by-category'\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { createObservableDataAction } from '@msdyn365-commerce/action-internal';\r\nimport { IAction, IActionContext } from '@msdyn365-commerce/core-internal';\r\nimport { IContext } from '@msdyn365-commerce/retail-proxy';\r\nimport { readAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\r\nimport { getProductRatingsAsync, searchByCriteriaAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { getElementsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/RecommendationsDataActions.g';\r\nimport {\r\n Cart,\r\n ProductSearchCriteria,\r\n ProductSearchResult,\r\n RecommendationCriteria,\r\n RecommendedElement\r\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n// @ts-ignore\r\nimport { CATEGORY_PAGE_NAME, PDP_PAGE_NAME, PICKS_FOR_YOU_LIST } from '@msdyn365-commerce/runtime-internal/dist/lib/consts';\r\n// @ts-ignore\r\nimport * as getSimpleProducts from '@msdyn365-commerce/runtime-internal/dist/lib/hydrators/get-simple-products';\r\n// @ts-ignore\r\n// tslint:disable-next-line:no-duplicate-imports\r\nimport { ProductInput } from '@msdyn365-commerce/runtime-internal/dist/lib/hydrators/get-simple-products';\r\n// @ts-ignore\r\nimport { getProductImageUrls, orderProductSearchResults } from '@msdyn365-commerce/runtime-internal/dist/lib/utils/product-list-utils';\r\nimport { ProductListInput } from '@msdyn365-commerce/runtime-internal/dist/types/hydrators/hydrator-action-inputs';\r\nimport * as semver from 'semver';\r\n\r\nconst actionInputError = (missingType: string) => {\r\n throw new Error(`Input ${missingType} is missing and required to run GetProductsByRecommendationId action`);\r\n};\r\n\r\nconst enum CartTokenPrefix {\r\n Auth = 't',\r\n Anon = 'p'\r\n}\r\n\r\nconst MIN_RETAIL_PROXY_VERSION_FOR_PRODUCT_SEARCH_RESULTS = '9.16.8';\r\n\r\n/**\r\n * Constructs the category context for a recommendation call. If page context is selected the category dervided from page context\r\n * (current page) will be used. If instead a spefic category is chosen as context that category will be used instead.\r\n *\r\n * @param recommendationCriteria The criteria that will be used for the recommendation API call\r\n * @param input The ProductListInput provided to the action\r\n * @param context The current action context\r\n */\r\nconst getCategoryIdForReco = (recommendationCriteria: RecommendationCriteria, input: ProductListInput, context: IActionContext) => {\r\n let categoryIds: number[] = [];\r\n\r\n if (input.listMetadata.includePageContext || !input.listMetadata.categoryIds || input.listMetadata.categoryIds.length === 0) {\r\n const urlTokens = context.requestContext.urlTokens;\r\n\r\n if (urlTokens && urlTokens.pageType && urlTokens.pageType.toLowerCase() === CATEGORY_PAGE_NAME) {\r\n if (urlTokens.recordId) {\r\n categoryIds = [+urlTokens.recordId];\r\n }\r\n }\r\n } else {\r\n // Use category from a specific context if provided\r\n if (input.listMetadata.categoryIds && input.listMetadata.categoryIds.length > 0) {\r\n categoryIds = input.listMetadata.categoryIds;\r\n }\r\n }\r\n\r\n recommendationCriteria.CategoryIds = categoryIds;\r\n};\r\n\r\n/**\r\n * Fetches the current active cart to be used when cart context\r\n * is selected for a reco list\r\n *\r\n * @param ctx The current action context\r\n */\r\nconst getCart = async (ctx: IActionContext): Promise => {\r\n let cart;\r\n if (ctx.requestContext && ctx.requestContext.cookies) {\r\n const cookies = ctx.requestContext && ctx.requestContext.cookies;\r\n const cartCookie = cookies.getCartCookie();\r\n const cartCookieParts = cartCookie.split(':');\r\n if (cartCookieParts && cartCookieParts.length === 2) {\r\n if (\r\n (ctx.requestContext.user.isAuthenticated && cartCookieParts[0] === CartTokenPrefix.Auth) ||\r\n (!ctx.requestContext.user.isAuthenticated && cartCookieParts[0] === CartTokenPrefix.Anon)\r\n ) {\r\n const readCart = await readAsync({ callerContext: ctx }, cartCookieParts[1]);\r\n if (readCart && readCart.Id) {\r\n cart = readCart;\r\n }\r\n }\r\n }\r\n }\r\n return cart;\r\n};\r\n\r\n/**\r\n * Constructs the product context for a recommendation call. If cart context is selected, products currently in the active cart will\r\n * be used as the product ids for the recommendation call. Otherwise, if page context is selected the product derived from page context will be used.\r\n * Finally, if specific context is selected, a product id will be given to us from the ProductListInput which will be used to seed the product id for the reco call.\r\n *\r\n * @param recommendationCriteria The criteria that will be used for the recommendation API call\r\n * @param input The ProductListInput provided to the action\r\n * @param context The current action context\r\n */\r\nconst getProductIdForReco = async (recommendationCriteria: RecommendationCriteria, input: ProductListInput, context: IActionContext) => {\r\n let productIds: number[] = [];\r\n // If include cart is set true, fetch the product ids in the cart to append to the product ID list for the recommendation call\r\n if (input.listMetadata.includeCart) {\r\n const cart = await getCart(context);\r\n if (cart && cart.CartLines) {\r\n const validCartLines = cart.CartLines.filter(element => element.ProductId !== undefined);\r\n const cartProductIds = validCartLines.map(product => product.ProductId);\r\n context.telemetry.debug(`Products in cart: ${cartProductIds}`);\r\n // If the cart isn't empty, assign the products in the cart to the productIds for seeding\r\n if (cartProductIds && cartProductIds.length > 0) {\r\n // @ts-ignore compiler alerts that cartProductIds is of type (number | undefined)[]\r\n // however, we filter on undefined product ids first before mapping on product ids so each element must be defined\r\n productIds = cartProductIds;\r\n }\r\n }\r\n } else if (input.listMetadata.includePageContext || !input.listMetadata.productIds || input.listMetadata.productIds.length === 0) {\r\n const urlTokens = context.requestContext.urlTokens;\r\n\r\n if (urlTokens && urlTokens.recordId && urlTokens.pageType && urlTokens.pageType.toLowerCase() === PDP_PAGE_NAME) {\r\n productIds = [+urlTokens.recordId];\r\n }\r\n } else {\r\n // Use the product from specfic context\r\n if (input.listMetadata.productIds && input.listMetadata.productIds.length > 0) {\r\n productIds = [input.listMetadata.productIds[0]];\r\n }\r\n }\r\n\r\n recommendationCriteria.ProductIds = productIds;\r\n};\r\n\r\n// tslint:disable-next-line: max-func-body-length\r\nexport const getProductsByRecommendationList = async (input: ProductListInput, context: IActionContext): Promise => {\r\n // If the recommendation list is picks for you and the user is not signed do not make the reco API call and return empty list of products\r\n const customerAccountNumber =\r\n context.requestContext && context.requestContext.user && context.requestContext.user.customerAccountNumber;\r\n if (input.listMetadata.recommendationListId === PICKS_FOR_YOU_LIST && !customerAccountNumber) {\r\n return [];\r\n }\r\n\r\n const recommendationCriteria: RecommendationCriteria = {};\r\n const proxyContext: IContext = { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } };\r\n recommendationCriteria.CatalogId = input.catalogId;\r\n\r\n let reccomendationListId = '';\r\n if (input.listMetadata.recommendationListId) {\r\n reccomendationListId = input.listMetadata.recommendationListId;\r\n } else {\r\n actionInputError(`recommendationListId (from listmetadata)`);\r\n }\r\n\r\n getCategoryIdForReco(recommendationCriteria, input, context);\r\n await getProductIdForReco(recommendationCriteria, input, context);\r\n\r\n if ((input.listMetadata.personalization || reccomendationListId === PICKS_FOR_YOU_LIST) && customerAccountNumber) {\r\n recommendationCriteria.CustomerAccountNumber = customerAccountNumber;\r\n proxyContext.bypassCache = 'get';\r\n }\r\n\r\n context.telemetry.debug(`Recommendation Criteria: ${JSON.stringify(recommendationCriteria)}`);\r\n\r\n // @ts-ignore\r\n return (\r\n getElementsAsync(proxyContext, reccomendationListId, recommendationCriteria)\r\n .then(async (recommendedElements: RecommendedElement[]) => {\r\n if (recommendedElements) {\r\n const productInputs: ProductInput[] = [];\r\n const productTypeId: string[] = [];\r\n // Grab all the elements that are products and store the product ids\r\n for (let i = 0; i < recommendedElements.length; i++) {\r\n const element = recommendedElements[i];\r\n // Element type value of 1 indicates product type\r\n if (element.ElementId && element.ElementTypeValue === 1) {\r\n productInputs[i] = new ProductInput(+element.ElementId, context.requestContext.apiSettings);\r\n productTypeId[i] = element.ElementId;\r\n }\r\n }\r\n context.telemetry.debug(`Running recommendation action for list ${input.listMetadata.recommendationListId}`);\r\n context.telemetry.debug(`Number of products returned: ${productTypeId.length}`);\r\n context.telemetry.debug('Product ids returned', productTypeId);\r\n\r\n if (productInputs.length) {\r\n // Check to see if retail proxy version is greater than min version required for new API\r\n if (\r\n semver.gte(\r\n semver.coerce(context.requestContext.apiSettings.retailServerProxyVersion) || '',\r\n MIN_RETAIL_PROXY_VERSION_FOR_PRODUCT_SEARCH_RESULTS\r\n )\r\n ) {\r\n const itemIds: number[] = productInputs.map(value => value.productId);\r\n const productSearchCriteria: ProductSearchCriteria = {\r\n Ids: itemIds,\r\n Context: {\r\n ChannelId: +context.requestContext.apiSettings.channelId,\r\n CatalogId: +context.requestContext.apiSettings.catalogId\r\n },\r\n IncludeAttributes: true,\r\n SearchCondition: '*'\r\n };\r\n try {\r\n let productSearchResults = await searchByCriteriaAsync(\r\n { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } },\r\n productSearchCriteria\r\n );\r\n // If the ProductSearchResult API finds the products then populate the product image urls and return\r\n // otherwise if the API does not exist or does not return products proceed to the legacy flows for legacy/backward compatibility reasons\r\n context.telemetry.debug('Product search results returned', JSON.stringify(productSearchResults));\r\n if (productSearchResults.length > 0) {\r\n getProductImageUrls(productSearchResults, context.requestContext.apiSettings);\r\n productSearchResults = orderProductSearchResults(itemIds, productSearchResults);\r\n return productSearchResults;\r\n }\r\n } catch (e) {\r\n // In case of an error fall back to legacy flow\r\n context.telemetry.error(`Error while getting productSearchResult: ${e}`);\r\n }\r\n }\r\n\r\n // Get Product Ratings Block (If needed)\r\n const productRatingsPromise = getProductRatingsAsync(\r\n { callerContext: context },\r\n productInputs.map(productInput => productInput.productId)\r\n );\r\n\r\n return getSimpleProducts(productInputs, context).then((products: ProductSearchResult[]) => {\r\n getProductImageUrls(products, context.requestContext.apiSettings);\r\n products = orderProductSearchResults(\r\n productInputs.map(value => value.productId),\r\n products\r\n );\r\n return productRatingsPromise.then(productRatings => {\r\n productRatings.forEach(productRating => {\r\n const unratedProduct: ProductSearchResult = (\r\n products.find(mappedProduct => mappedProduct.RecordId === productRating.ProductId)\r\n );\r\n if (unratedProduct) {\r\n unratedProduct.TotalRatings = productRating.TotalRatings;\r\n unratedProduct.AverageRating = productRating.AverageRating;\r\n }\r\n });\r\n\r\n return products;\r\n });\r\n });\r\n }\r\n }\r\n return [];\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((error: any) => {\r\n context.telemetry.error(`Error running productByRecommendation action: ${error}`);\r\n throw new Error(error);\r\n })\r\n );\r\n};\r\n\r\nexport const getProductsByRecommendationListAction = createObservableDataAction({\r\n action: >getProductsByRecommendationList,\r\n id: '@msdyn365-commerce/products-by-recommendation'\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n// @ts-ignore\r\nimport * as semver from 'semver';\r\n\r\nimport { createObservableDataAction } from '@msdyn365-commerce/action-internal';\r\nimport { IAction, IActionContext } from '@msdyn365-commerce/core-internal';\r\nimport {\r\n getByIdAsync,\r\n getRelatedProductsAsync,\r\n searchByCriteriaAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { ProductSearchCriteria, ProductSearchResult, SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n// @ts-ignore\r\nimport { getProductImageUrls, orderProductSearchResults } from '@msdyn365-commerce/runtime-internal/dist/lib/utils/product-list-utils';\r\nimport { ProductListInput } from '@msdyn365-commerce/runtime-internal/dist/types';\r\n\r\nconst MIN_RETAIL_PROXY_VERSION_FOR_PRODUCT_SEARCH_RESULTS = '9.16.8';\r\n\r\nconst actionInputError = (missingType: string) => {\r\n throw new Error(`Input ${missingType} is missing and required to run GetProductsByRelationship action`);\r\n};\r\n\r\n// tslint:disable-next-line: max-func-body-length\r\nexport const getProductsByRelationshipIdList = async (input: ProductListInput, context: IActionContext): Promise => {\r\n let productId;\r\n let relationshipId;\r\n // Grab the product ID from the list meta data or context\r\n if (input.listMetadata.productIds && input.listMetadata.productIds.length > 0) {\r\n const productResponse: SimpleProduct | SimpleProduct[] = await getByIdAsync(\r\n { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } },\r\n input.listMetadata.productIds[0],\r\n input.channelId\r\n );\r\n const baseProduct: SimpleProduct = Array.isArray(productResponse) ? productResponse[0] : productResponse;\r\n productId = input.listMetadata.productIds[0];\r\n if (baseProduct.hasOwnProperty('MasterProductId') && baseProduct.MasterProductId && baseProduct.MasterProductId > 0) {\r\n productId = baseProduct.MasterProductId;\r\n }\r\n } else if (context.requestContext.urlTokens && context.requestContext.urlTokens.itemId) {\r\n const productResponse = await getByIdAsync(\r\n { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } },\r\n +context.requestContext.urlTokens.itemId,\r\n input.channelId\r\n );\r\n const baseProduct = Array.isArray(productResponse) ? productResponse[0] : productResponse;\r\n productId = +context.requestContext.urlTokens.itemId;\r\n if (baseProduct.hasOwnProperty('MasterProductId') && baseProduct.MasterProductId > 0) {\r\n productId = baseProduct.MasterProductId;\r\n }\r\n } else {\r\n actionInputError('productId');\r\n }\r\n // The relationship ID must be provided with the list meta data\r\n if (input.listMetadata.relationshipId) {\r\n relationshipId = +input.listMetadata.relationshipId;\r\n } else {\r\n actionInputError('relationshipId');\r\n }\r\n context.telemetry.debug(`Product Id input to productByRelationship action: ${productId}`);\r\n context.telemetry.debug(`Relationship Id input to productByRelationship action: ${relationshipId}`);\r\n\r\n return getRelatedProductsAsync(\r\n { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } },\r\n // @ts-ignore\r\n productId,\r\n input.channelId,\r\n input.catalogId,\r\n // @ts-ignore\r\n relationshipId\r\n ).then(\r\n /*VSI Customization - START\r\n This data-action is customized as per Microsoft's guidance to use searchByCriteriaAsync call to get\r\n product attributes for related to products product-collection list\r\n */\r\n async (products: ProductSearchResult[]) => {\r\n context.telemetry.debug('Products returned by getRelatedProducts action', products);\r\n if (products.length) {\r\n if (\r\n semver.gte(\r\n semver.coerce(context.requestContext.apiSettings.retailServerProxyVersion) || '',\r\n MIN_RETAIL_PROXY_VERSION_FOR_PRODUCT_SEARCH_RESULTS\r\n )\r\n ) {\r\n const itemIds: number[] = products.map(value => value.RecordId);\r\n const productSearchCriteria: ProductSearchCriteria = {\r\n Ids: itemIds,\r\n Context: {\r\n ChannelId: +context.requestContext.apiSettings.channelId,\r\n CatalogId: +context.requestContext.apiSettings.catalogId\r\n },\r\n IncludeAttributes: true,\r\n SearchCondition: '*'\r\n };\r\n try {\r\n let productSearchResults = await searchByCriteriaAsync(\r\n { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } },\r\n productSearchCriteria\r\n );\r\n // If the ProductSearchResult API finds the products then populate the product image urls and return\r\n // otherwise if the API does not exist or does not return products proceed to the legacy flows for legacy/backward compatibility reasons\r\n context.telemetry.debug('Product search results returned', JSON.stringify(productSearchResults));\r\n if (productSearchResults.length > 0) {\r\n getProductImageUrls(productSearchResults, context.requestContext.apiSettings);\r\n productSearchResults = orderProductSearchResults(itemIds, productSearchResults);\r\n return productSearchResults;\r\n }\r\n } catch (e) {\r\n // In case of an error fall back to legacy flow\r\n context.telemetry.error(`Error while getting productSearchResult: ${e}`);\r\n }\r\n }\r\n return getProductImageUrls(products, context.requestContext.apiSettings);\r\n }\r\n }\r\n )\r\n // @ts-ignore\r\n .catch(error => {\r\n context.telemetry.error(`Error running productByRecommendation action: ${error}`);\r\n throw new Error(error);\r\n });\r\n /*VSI Customization - END*/\r\n};\r\n\r\nexport const getProductsByRelationshipIdListAction = createObservableDataAction({\r\n action: >getProductsByRelationshipIdList,\r\n id: '@msdyn365-commerce/products-by-relationship-id'\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n// tslint:disable-next-line: no-duplicate-imports\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { CacheType, QueryResultSettings, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { getByIdsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n\r\n/**\r\n * GetProductById Input Action\r\n */\r\n\r\nexport class GetProductsByIdInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n public productIdsArr: number[];\r\n\r\n public channelId: number;\r\n public queryResultSettings: QueryResultSettings;\r\n constructor(productIdsArr: number[], channelId: number, queryResultSettings: QueryResultSettings) {\r\n this.productIdsArr = productIdsArr;\r\n this.channelId = channelId;\r\n this.queryResultSettings = queryResultSettings;\r\n }\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n\r\n public getCacheKey = () =>\r\n `Get-Products-By-Id-${this.productIdsArr && this.productIdsArr.length >= 1 ? this.productIdsArr.join('-') : ''}`;\r\n public getCacheObjectType = () => 'GetProductsById';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function getProductsByIdAction(input: GetProductsByIdInput, ctx: IActionContext): Promise {\r\n if (input.productIdsArr && input.productIdsArr.length >= 1) {\r\n const ctxObject = { callerContext: ctx, queryResultSettings: input.queryResultSettings, bypass: 'none' };\r\n let result;\r\n try {\r\n result = await getByIdsAsync(ctxObject, input.channelId, input.productIdsArr);\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('error', error);\r\n }\r\n }\r\n return null;\r\n}\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getProductsByIdAction,\r\n // Give your data action a unique id\r\n id: 'GetProductsById'\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * ProgressiveLeasingModalState Input Action\r\n */\r\nexport class ProgressiveLeasingModalStateInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n constructor() { }\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `ProgressiveLeasingModalState`;\r\n public getCacheObjectType = () => 'ProgressiveLeasingModalState';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IProgressiveLeasingModalStateData {\r\n isOpen: boolean;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new ProgressiveLeasingModalStateInput();\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: ProgressiveLeasingModalStateInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { isOpen: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'ProgressiveLeasingModalState',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","import { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\nexport interface IPromoCodeAppliedOnCartState {\r\n isInProcess?: boolean;\r\n}\r\n\r\n/**\r\n * SampleState - action input\r\n */\r\nexport class PromoCodeAppliedOnCartInput implements IActionInput {\r\n public getCacheKey = () => `PromoCodeAppliedOnCartInput`;\r\n public getCacheObjectType = () => 'PromoCodeAppliedOnCartInput';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * SampleState - action\r\n */\r\nexport async function updatePromoCodeAppliedOnCartProgressAction(input: PromoCodeAppliedOnCartInput, ctx: IActionContext): Promise {\r\n return { isInProcess: undefined };\r\n}\r\n\r\n/**\r\n * SampleState - create new input for create action\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new PromoCodeAppliedOnCartInput();\r\n};\r\n\r\n/**\r\n * SampleState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >updatePromoCodeAppliedOnCartProgressAction,\r\n input: createInput\r\n});","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * RedirectToWmapSubmitPayment Input Action\r\n */\r\nexport class RedirectToWmapSubmitPaymentInput implements Msdyn365.IActionInput {\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `RedirectToWmapSubmitPayment`;\r\n public getCacheObjectType = () => 'RedirectToWmapSubmitPayment';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\nexport interface IRedirectToWmapSubmitPaymentData {\r\n redirectToWmapSubmitPayment: boolean;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new RedirectToWmapSubmitPaymentInput();\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: RedirectToWmapSubmitPaymentInput, ctx: Msdyn365.IActionContext): Promise {\r\n return { redirectToWmapSubmitPayment: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n id: 'RedirectToWmapSubmitPayment',\r\n input: createInput\r\n});\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { createObservableDataAction, IAction, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport { IDataServiceRequest, retailAction } from '@msdyn365-commerce/retail-proxy/dist';\r\nimport { createSearchOrgUnitLocationsInput } from '@msdyn365-commerce/retail-proxy/dist/DataActions/OrgUnitsDataActions.g';\r\nimport { ProductSearchResult, QueryResultSettings } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n\r\nexport const buildQueryResultSettings = (inputData: ICreateActionContext, IGeneric>): QueryResultSettings => {\r\n try {\r\n // not using this data-action for now, so overriding Top value to 4.\r\n // incase original functionality is required please remove this file.\r\n return { Paging: { Top: 4, Skip: 0 } };\r\n } catch {\r\n return {};\r\n }\r\n};\r\n\r\n\r\n/**\r\n * Search Org Unit Locations action createInput method.\r\n * @param inputData\r\n */\r\nexport function createSearchOrgUnitLocationsInputFunc(inputData: ICreateActionContext, IGeneric>): IDataServiceRequest {\r\n return createSearchOrgUnitLocationsInput(buildQueryResultSettings(inputData), {});\r\n}\r\n\r\nexport const retailActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/search-org-unit-locations',\r\n action: >retailAction,\r\n input: createSearchOrgUnitLocationsInputFunc\r\n});\r\n\r\nexport default retailActionDataAction;\r\n\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * ToggleSynchronySubmitOrderButton Input Action\r\n */\r\nexport class ToggleSubmitOrderButtonInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `toggle-submit-order-button`;\r\n public getCacheObjectType = () => 'toggle-submit-order-button';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IToggleSubmitOrderButtonData {\r\n isSynchronySelected: boolean;\r\n isPaypalSelected: boolean;\r\n isCreditcardSelected: boolean;\r\n isCcFieldsNotPopulated: boolean;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new ToggleSubmitOrderButtonInput();\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: ToggleSubmitOrderButtonInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { isSynchronySelected: false, isPaypalSelected: false, isCreditcardSelected: false, isCcFieldsNotPopulated: true };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'ToggleSubmitOrderButton',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","import { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\nexport interface IUpdateEmailCart {\r\n checkEmail: boolean | null;\r\n}\r\n\r\n/**\r\n * SampleState - action input\r\n */\r\nexport class UpdateEmailCartInput implements IActionInput {\r\n public getCacheKey = () => `UpdateEmailCartInput`;\r\n public getCacheObjectType = () => 'UpdateEmailCartInput';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * SampleState - action\r\n */\r\nexport async function updateEmailCartAction(input: UpdateEmailCartInput, ctx: IActionContext): Promise {\r\n return { checkEmail: null };\r\n}\r\n\r\n/**\r\n * SampleState - create new input for create action\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new UpdateEmailCartInput();\r\n};\r\n\r\n/**\r\n * SampleState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >updateEmailCartAction,\r\n input: createInput\r\n});","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport axios from 'axios';\r\n/**\r\n * WmapGetOrderDetails Input Action\r\n */\r\nexport class WmapGetOrderDetailsInput extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n private orderDetailsAPIurl: string = '';\r\n private orderId: string = '';\r\n constructor(orderDetailsAPIurl: string, orderId: string) {\r\n super({ shouldCacheOutput: false, cacheObjectType: 'WmapGetOrderDetails', cacheKey: 'WmapGetOrderDetails' });\r\n this.orderDetailsAPIurl = orderDetailsAPIurl;\r\n this.orderId = orderId;\r\n }\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getOrderDetailsAPIurl = () => this.orderDetailsAPIurl;\r\n public getOrderId = () => this.orderId;\r\n public getCacheKey = () => `WmapGetOrderDetails`;\r\n public getCacheObjectType = () => 'WmapGetOrderDetails';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IWmapGetOrderDetailsData {\r\n text: string;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n\r\n if (inputData.config && inputData.config.orderDetailsAPIurl) {\r\n if (inputData.requestContext && inputData.requestContext.query && inputData.requestContext.query.orderId) {\r\n // console.log(\"input data: \" + inputData.requestContext.query.orderId);\r\n return new WmapGetOrderDetailsInput(inputData.config.orderDetailsAPIurl, inputData.requestContext.query.orderId);\r\n } else {\r\n return new WmapGetOrderDetailsInput(inputData.config.orderDetailsAPIurl, '');\r\n }\r\n }\r\n return new WmapGetOrderDetailsInput('', '');\r\n};\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\n// tslint:disable: no-any\r\nasync function action(input: WmapGetOrderDetailsInput, ctx: Msdyn365.IActionContext): Promise {\r\n const apiResponseUrl = ctx.requestContext.apiSettings.baseUrl;\r\n const orderDetailsApiUrl = input.getOrderDetailsAPIurl();\r\n const salesOrderId = input.getOrderId();\r\n const orderIdOun = ctx.requestContext.apiSettings.oun;\r\n const makeaPaymentLink = ctx.requestContext.app.config.wmapPageUrlSuffix?.toLowerCase();\r\n const pathName = ctx.requestContext && ctx.requestContext.url.requestUrl.pathname?.toLowerCase().replace(`/`, '');\r\n try {\r\n if (makeaPaymentLink === pathName) {\r\n const response = await axios.post(`${apiResponseUrl}/${orderDetailsApiUrl}`, {\r\n SalesId: salesOrderId\r\n }, {\r\n headers: {\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n 'oun': orderIdOun,\r\n 'Content-Type': 'application/json'\r\n }\r\n });\r\n return response.data;\r\n } else {\r\n console.log('Make a Payment URL is not Configured or URL is not valid');\r\n }\r\n\r\n } catch (e) {\r\n // will be removed after unit test and deployment on lower environment\r\n console.log('error for getting Sales Order Balance', e);\r\n }\r\n}\r\n\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'WmapGetOrderDetails',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { CartTenderLine } from '@msdyn365-commerce/retail-proxy';\r\nimport axios from 'axios';\r\n/**\r\n * GetAuthTokenInput Input Action\r\n */\r\nexport interface ISubmitPaymentPayload {\r\n cartId: string,\r\n receiptEmail: string | undefined,\r\n cartTenderLines: CartTenderLine[] | undefined,\r\n cartVersion: number | undefined\r\n}\r\n\r\nexport class WmapSubmitPaymentInput extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n\r\n public submitPaymentAPIurl: string | undefined;\r\n public submitPaymentPayload: ISubmitPaymentPayload | {};\r\n constructor(submitPaymentAPIurl: string | undefined, submitPaymentPayload: ISubmitPaymentPayload | {}) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'wmapauthorizepayment', cacheKey: 'wmapcapturepayment' });\r\n this.submitPaymentAPIurl = submitPaymentAPIurl;\r\n this.submitPaymentPayload = submitPaymentPayload;\r\n }\r\n\r\n public getCacheKey = () => `wmapcapturepayment`;\r\n public getCacheObjectType = () => 'wmapcapturepayment';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n\r\n}\r\n\r\nconst createGetCardPaymentAcceptPointInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.submitPaymentAPIurl) {\r\n return new WmapSubmitPaymentInput(inputData.config.submitPaymentAPIurl, {});\r\n }\r\n return new WmapSubmitPaymentInput('', {});\r\n};\r\n\r\n// tslint:disable: no-any\r\nexport async function WmapSubmitPaymentAction(input: WmapSubmitPaymentInput, ctx: Msdyn365.IActionContext): Promise {\r\n const apiResponseUrl = ctx.requestContext.apiSettings.baseUrl;\r\n const orderIdOun = ctx.requestContext.apiSettings.oun;\r\n try {\r\n const requestOptions: Msdyn365.IHTTPRequestOptions = {\r\n headers: {\r\n 'oun': orderIdOun,\r\n 'Content-Type': 'application/json'\r\n }\r\n };\r\n if (requestOptions.headers && ctx.requestContext.user.token) {\r\n requestOptions.headers.Authorization = `id_token ${ctx.requestContext.user.token}`;\r\n }\r\n const response = await axios.post(`${apiResponseUrl}${input.submitPaymentAPIurl}`,\r\n input.submitPaymentPayload,\r\n requestOptions);\r\n return response.data;\r\n } catch (e) {\r\n ctx.telemetry.error('Error for Submit Payment', e);\r\n }\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >WmapSubmitPaymentAction,\r\n input: createGetCardPaymentAcceptPointInput\r\n});","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport Cookies from 'universal-cookie';\r\nexport class GetUnbxdSearchAutoSuggestDataInput implements Msdyn365.IActionInput {\r\n public queryText?: string | undefined;\r\n public popularProducts?: number | undefined;\r\n public inFields?: number | undefined;\r\n public topQueries?: number | undefined;\r\n public keywordSuggestions?: number | undefined;\r\n public promotedSuggestion?: number | undefined;\r\n\r\n public getCacheKey = () => `Unbxd-autoSuggest-data-${this.queryText}`;\r\n public getCacheObjectType = () => 'Unbxd-autoSuggest-data';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n\r\n constructor(queryText?: string | undefined, popularProducts?: number | undefined, inFields?: number | undefined, topQueries?: number | undefined, keywordSuggestions?: number | undefined, promotedSuggestion?: number\r\n | undefined) {\r\n this.queryText = queryText;\r\n this.popularProducts = popularProducts;\r\n this.inFields = inFields;\r\n this.topQueries = topQueries;\r\n this.keywordSuggestions = keywordSuggestions;\r\n this.promotedSuggestion = promotedSuggestion;\r\n }\r\n}\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function getUnbxdSearchAutoSuggestData(input: GetUnbxdSearchAutoSuggestDataInput, ctx: Msdyn365.IActionContext): Promise {\r\n const cookies = new Cookies();\r\n const unbxdUid = cookies.get('unbxd.userId');\r\n const queryText = input?.queryText ? input.queryText : \"\";\r\n const popularProductsCount = input?.popularProducts ? input.popularProducts : 0;\r\n const inFieldsCount = input?.inFields ? input.inFields : 0;\r\n const topQueriesCount = input?.topQueries ? input.topQueries : 0;\r\n const keywordSuggestionsCount = input?.keywordSuggestions ? input.keywordSuggestions : 0;\r\n const promotedSuggestionCount = input?.promotedSuggestion ? input.promotedSuggestion : 0;\r\n const unbxdApiKey = ctx.requestContext.app.config.unbxdApiKey;\r\n const unbxdSiteKey = ctx.requestContext.app.config.unbxdSiteKey;\r\n try {\r\n const unbxdUrl = `https://search.unbxd.io/${unbxdApiKey}/${unbxdSiteKey}/autosuggest?q=${queryText}&popularProducts.count=${popularProductsCount}&inFields.count=${inFieldsCount}&topQueries.count=${topQueriesCount}&keywordSuggestions.count=${keywordSuggestionsCount}&promotedSuggestion.count=${promotedSuggestionCount}&uid=${unbxdUid}`;\r\n const response = await Msdyn365.sendRequest(unbxdUrl, 'get');\r\n if (response) {\r\n return response.data;\r\n }\r\n else { return null; }\r\n } catch (e) {\r\n return null;\r\n }\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getUnbxdSearchAutoSuggestData,\r\n id: 'getUnbxdSearchAutoSuggestData'\r\n});\r\n","/* tslint:disable: no-duplicate-imports */\r\nimport { IPageSummaryData } from '@msdyn365-commerce-modules/page-summary';\r\nimport { buildCacheKeyWithUrlTokens, CurrentCategoryInput, getCategoryUrl, getCurrentCategory } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { CategoryHierarchy, IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n getFriendlyName,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n ICreateActionContext,\r\n IRequestContext\r\n} from '@msdyn365-commerce/core';\r\nimport flatten from 'lodash/flatten';\r\n// VSI customization: 7924 Start\r\nimport getHtmlParserValue from '../../Utilities/get-html-parser-value';\r\nimport { canonicalURL, getSortedVirtualRefinerConfig, getVirtualRefinerNames, regExSpecialChars, removeKeywords } from '../../Utilities/plp-url-utils';\r\nimport getSEOData, { GetSeoDataInput } from '../../data-actions/get-seo-data.action';\r\nimport { getProductSearchRefinersAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { ProductRefiner } from '@msdyn365-commerce/retail-proxy';\r\nimport { IMfrmCategoryPageSummaryConfig } from './mfrm-category-page-summary.props.autogenerated';\r\n// VSI customization: 7924 End\r\n\r\n/** Category Page Summary Input */\r\nexport class MFRMCategoryPageSummaryInput implements IActionInput {\r\n public requestContext: IRequestContext;\r\n public config: IMfrmCategoryPageSummaryConfig;\r\n constructor(config: IMfrmCategoryPageSummaryConfig, requestContext: IRequestContext) {\r\n this.config = config || {};\r\n this.requestContext = requestContext;\r\n }\r\n\r\n public getCacheObjectType = (): string => 'MFRMCategoryPageSummary';\r\n public getCacheKey = (): string => `${buildCacheKeyWithUrlTokens('MFRMCategoryPageSummary', this.requestContext)}-${this.requestContext?.url?.requestUrl?.pathname?.toLowerCase()}`;\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\nconst createGetCurrentCategoryInput = (inputData: IActionContext): CurrentCategoryInput => {\r\n if (inputData && inputData.requestContext) {\r\n return new CurrentCategoryInput(inputData.requestContext);\r\n }\r\n\r\n throw new Error('Please specify categoryId query string in request.');\r\n};\r\n\r\nconst _getSEOMetaTagValue = (currentCategory: CategoryHierarchy, keyValue: string) => {\r\n return currentCategory?.ExtensionProperties?.find((attr) => attr.Key === keyValue)?.Value?.StringValue;\r\n};\r\n\r\nconst _getActiveRefiners = (refiners: IProductRefinerHierarchy[], requestContext: IRequestContext, CategoryHierarchy: any): string[] | undefined => {\r\n // get refiners from URL\r\n const configVirtualRefinerNames = getVirtualRefinerNames(requestContext, false);\r\n const filteredRefiners = refiners && refiners.filter((refiner) => {\r\n return refiner.KeyName && configVirtualRefinerNames.indexOf(refiner.KeyName.toLowerCase()) !== -1;\r\n });\r\n // get category slug\r\n let slug = (CategoryHierarchy && CategoryHierarchy.Slug) || '';\r\n let slugArray: string[];\r\n let pathArray: string[];\r\n const sortedConfigValues = getSortedVirtualRefinerConfig(requestContext, false);\r\n if (sortedConfigValues && slug) {\r\n slugArray = slug.split('/').splice(1);\r\n // remove keywords form slugArray\r\n slugArray = removeKeywords(slugArray, requestContext);\r\n // FIX reset slug to without keywords\r\n slug = slugArray.join('/');\r\n // path of URL\r\n let path = requestContext.url.requestUrl.pathname.toLowerCase();\r\n // remove category id {categoryid}.c\r\n const categoryIdToken = requestContext.urlTokens.recordId;\r\n const categoryId = categoryIdToken ? `${categoryIdToken}.c` : undefined;\r\n\r\n if (categoryId) {\r\n path = path.replace(`/${categoryId}`, '');\r\n }\r\n // remove category slug\r\n pathArray = removeKeywords(path.split('\\/').splice(1), requestContext);\r\n path = pathArray.join('\\/');\r\n const removedCategorySlug = path.split(slug).splice(1)[0];\r\n let refinerParts: string[] = [];\r\n if (removedCategorySlug !== '') {\r\n refinerParts = decodeURIComponent(removedCategorySlug).split('/');\r\n }\r\n if (refinerParts && refinerParts.length > 0 && slugArray && slugArray.length > 0) {\r\n // remove duplicates if any from the first url part\r\n slugArray.forEach(_slug => {\r\n refinerParts.forEach(refinerPart => {\r\n const index = slugArray.indexOf(refinerPart);\r\n if (index !== -1) {\r\n slugArray.splice(index, 1);\r\n }\r\n });\r\n });\r\n }\r\n const finalRefinerParts: string[] = [];\r\n refinerParts.forEach(refinerPart => {\r\n refinerPart.split('|').map(item => finalRefinerParts.push(item.includes('-') ? item : item.split('-').join(' ')));\r\n });\r\n refinerParts = finalRefinerParts && flatten(finalRefinerParts);\r\n // setup object with refiner values\r\n const sortedValues: { [key: string]: string[] } = {};\r\n filteredRefiners?.forEach(refinerSet => {\r\n let refinerName = refinerSet.KeyName;\r\n if (refinerName) {\r\n refinerName = refinerName.toLowerCase();\r\n sortedValues[refinerName] = []; // size, brand, price\r\n }\r\n refinerSet.Values.forEach((refiner) => {\r\n refinerParts.forEach((refinerPart) => {\r\n if (refinerName && refiner.LeftValueBoundString &&\r\n (refiner.LeftValueBoundString.toLowerCase().replace(/\\&/g, 'and').replace(regExSpecialChars(requestContext.app.config.canonicalUrlspecialCharIncludeList), '-') === refinerPart.toLocaleLowerCase().split('-').join(' ')\r\n || refiner.LeftValueBoundString.toLowerCase().replace(/\\&/g, 'and').replace(regExSpecialChars(requestContext.app.config.canonicalUrlspecialCharIncludeList), '-') === refinerPart.toLocaleLowerCase())) {\r\n sortedValues[refinerName].push(refiner.LeftValueBoundString);\r\n } else if (refinerName && refiner.LeftValueBoundString &&\r\n refiner.LeftValueBoundString.toLowerCase() === refinerPart.toLowerCase().split('-').join(' ')) {\r\n sortedValues[refinerName].push(refinerPart);\r\n }\r\n });\r\n });\r\n });\r\n // alpha sort\r\n // @ts-ignore\r\n for (const sortedValue of Object.keys(sortedValues)) {\r\n sortedValues[sortedValue].length > 0 &&\r\n sortedValues[sortedValue].sort((a: string, b: string) => {\r\n if (a < b) {\r\n return -1;\r\n }\r\n if (a > b) {\r\n return 1;\r\n }\r\n return 0;\r\n });\r\n }\r\n // @ts-ignore\r\n const finalRefiners: string[] = [];\r\n sortedConfigValues.forEach(sortedConfigValue => {\r\n const sortedRefinerName = sortedConfigValue.refinerName.toLowerCase();\r\n if (sortedValues[sortedRefinerName] !== undefined && sortedValues[sortedRefinerName].length > 0) {\r\n // @ts-ignore\r\n finalRefiners.push(sortedValues[sortedRefinerName].join(' '));\r\n }\r\n });\r\n return finalRefiners;\r\n }\r\n return undefined;\r\n};\r\n\r\nasync function getAllRefinersAction(ctx: IActionContext): Promise {\r\n const searchCriteria = {\r\n SearchCondition: '*',\r\n Context: {\r\n ChannelId: ctx.requestContext.apiSettings.channelId,\r\n CatalogId: ctx.requestContext.apiSettings.catalogId\r\n }\r\n };\r\n return getProductSearchRefinersAsync({ callerContext: ctx }, searchCriteria).then(\r\n (productRefiners: ProductRefiner[]) => {\r\n if (!productRefiners) {\r\n ctx.telemetry.error('[getRefinersByCriteriaAction] returned no refiners');\r\n return [];\r\n }\r\n\r\n const result = (productRefiners || []).map((productRefiner: ProductRefiner) => productRefiner);\r\n\r\n if (result.length === 0) {\r\n ctx.telemetry.error('[getRefinersByCriteriaAction] returned no IProductRefinerHierarchy objects');\r\n return [];\r\n }\r\n\r\n return result;\r\n }\r\n ).catch((err) => {\r\n console.log('[getRefinersByCriteriaAction Category-page-summary] returned no IProductRefinerHierarchy objects', err);\r\n ctx.telemetry.error(`[getRefinersByCriteriaAction Category-page-summary] returned no IProductRefinerHierarchy objects ${err}`);\r\n return [];\r\n });\r\n}\r\n\r\nasync function getFallbackTitle(context: IActionContext, requestContext: IRequestContext, currentCategory: any): Promise {\r\n let activeRefinerList: string[] | undefined = [];\r\n return getAllRefinersAction(context).then(refiners => {\r\n activeRefinerList = _getActiveRefiners(refiners, requestContext, currentCategory);\r\n const concateTitle = `${activeRefinerList && activeRefinerList?.length > 0 ? activeRefinerList.length === 1 ? ` ${activeRefinerList[0]} ` : ` ${activeRefinerList?.join(' ')} ` : ''}`;\r\n const fallbackTitle = concateTitle && `Shop for${concateTitle}Products | Mattress Firm`;\r\n return fallbackTitle;\r\n }).catch((err) => {\r\n console.log('[getFallbackTitle Category-page-summary] has some errors', err);\r\n context.telemetry.error(`[getFallbackTitle Category-page-summary] has some errors- ${err}`);\r\n return \"\";\r\n });\r\n}\r\n\r\nconst action = async (input: MFRMCategoryPageSummaryInput, context: IActionContext): Promise => {\r\n const { config } = input;\r\n const seoInput = new GetSeoDataInput(context.requestContext.app.config.seoDataUrl || 'https://files-us-prod.cms.commerce.dynamics.com/cms/api/fknscsckgq/binary/MA5cA7');\r\n const seoData = await getSEOData(seoInput, context);\r\n const seoPageTitle = seoData && seoData['SEO State'] === 'Active' && seoData['Title Tag'];\r\n const seoPageMetaData = seoData && seoData['SEO State'] === 'Active' && seoData['Meta Description'];\r\n let currentCategory: any;\r\n try {\r\n currentCategory = await getCurrentCategory(createGetCurrentCategoryInput(context), context);\r\n } catch (e) {\r\n // Do nothing, if the action fails fallback to values defined in data\r\n }\r\n if (currentCategory) {\r\n let categoryUrl: string | undefined;\r\n let fallbackTitle;\r\n if (!seoPageTitle) {\r\n fallbackTitle = await getFallbackTitle(context, input.requestContext, currentCategory);\r\n }\r\n const pageTitle = seoPageTitle || fallbackTitle || _getSEOMetaTagValue(currentCategory, 'CategoryPageTitle');\r\n const pageTitleParser = getHtmlParserValue(pageTitle);\r\n\r\n const fallBackMeta = 'Find comfortable mattresses, high quality beds, and accessories from top brands all at great low prices at Mattress Firm';\r\n const categoryPageMetaData = seoPageMetaData || fallBackMeta || _getSEOMetaTagValue(currentCategory, 'CategoryPageMetaData');\r\n const categoryPageMetaDataParser = getHtmlParserValue(categoryPageMetaData);\r\n try {\r\n // reset category's name neutralizedName\r\n const localName = getFriendlyName(context.requestContext.locale, currentCategory.NameTranslations);\r\n const neutralizedName = currentCategory.NeutralizedName || currentCategory.Name;\r\n currentCategory.Name = localName;\r\n currentCategory.NeutralizedName = neutralizedName;\r\n categoryUrl = getCategoryUrl(currentCategory);\r\n // @ts-ignore - TODO: property exits in new version of SDK. Remove once released.\r\n const canonicalDomain = context.requestContext.canonicalDomain;\r\n if (categoryUrl && canonicalDomain) {\r\n categoryUrl = canonicalURL(context.requestContext).toLocaleLowerCase();\r\n } else {\r\n categoryUrl = undefined;\r\n }\r\n } catch (e) {\r\n categoryUrl = undefined;\r\n }\r\n return {\r\n title: pageTitleParser || currentCategory.Name,\r\n description: categoryPageMetaDataParser || '',\r\n sharingImageUrl: currentCategory.OfflineImage,\r\n canonicalUrl: categoryUrl,\r\n faviconUrl: config && config.faviconUrl\r\n };\r\n // If the action fails fallback to values defined from data\r\n } else if (config) {\r\n return {\r\n title: config.title,\r\n sharingImageUrl: config.sharingImage && config.sharingImage.src,\r\n faviconUrl: config && config.faviconUrl\r\n };\r\n } else {\r\n return {};\r\n }\r\n};\r\n\r\nexport default createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/page-summary/category-page-summary',\r\n action: >action,\r\n input: (args: ICreateActionContext) => {\r\n return new MFRMCategoryPageSummaryInput(args.config, args.requestContext);\r\n }\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n getByIdAsync,\r\n getVariantsByDimensionValuesAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport {\r\n ProductDimension,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n\r\nexport class GetProductRecordidInput implements Msdyn365.IActionInput {\r\n public productId: number;\r\n public channelId: number;\r\n public matchingDimensionValues: ProductDimension[];\r\n\r\n constructor(productId: number, channelId: number, matchingDimensionValues?: ProductDimension[]) {\r\n this.productId = productId;\r\n this.channelId = channelId;\r\n this.matchingDimensionValues = matchingDimensionValues || [];\r\n }\r\n\r\n public getCacheKey = () => `GetProductRecord`;\r\n public getCacheObjectType = () => 'SimpleProduct';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IGetProductRecordidData {\r\n text: string;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext): GetProductRecordidInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n if (productId) {\r\n return new GetProductRecordidInput(+productId, +inputData.requestContext.apiSettings.channelId, []);\r\n } else {\r\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\r\n }\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: GetProductRecordidInput, ctx: Msdyn365.IActionContext): Promise {\r\n let baseProduct: SimpleProduct | null = null;\r\n if (!ctx.requestContext.app.config.queryBasedVariantSelection) {\r\n const response = await getByIdAsync({ callerContext: ctx }, input.productId, input.channelId);\r\n baseProduct = Array.isArray(response) ? response[0] : response;\r\n }\r\n const matchingDimensionValues = input.matchingDimensionValues ?? [];\r\n const data = await getVariantsByDimensionValuesAsync(\r\n { callerContext: ctx, queryResultSettings: {} },\r\n baseProduct && baseProduct?.MasterProductId ? baseProduct.MasterProductId : input.productId,\r\n input.channelId,\r\n matchingDimensionValues\r\n );\r\n\r\n return data;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'GetProductRecordId',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365All from '@msdyn365-commerce/core';\r\nimport Msdyn365 from '@msdyn365-commerce/core';\r\nimport fetchChooseYourFoundationDatabaseDataAction, { FetchChooseYourFoundationDatabaseInput } from '../../actions/fetch-choose-your-foundation-database.action';\r\nimport { getQueryParamsFromQueryByName, getSelectedProductIdFromActionInput } from '../../data-actions/utilities/utils';\r\nimport { getDefaultVariantId } from '../../data-actions/get-selected-variant.override.action';\r\nimport { variantQueryStringName } from '../../Utilities/constants';\r\n\r\n/**\r\n * GetUnbxdCollectionCompareData Input Action\r\n */\r\nexport class GetUnbxdCollectionCompareDataInput implements Msdyn365All.IActionInput {\r\n // Construct the input needed to run the action\r\n public configs?: any;\r\n public recordId?: string;\r\n constructor(configs?: any, recordId?: string) {\r\n this.configs = configs;\r\n this.recordId = recordId;\r\n }\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `VariantIDs-${this.recordId}`;\r\n public getCacheObjectType = () => 'VariantIDs';\r\n public dataCacheType = (): Msdyn365All.CacheType => 'request';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IGetUnbxdCollectionCompareDataData {\r\n collectionData: any | null;\r\n productId: number | undefined | null;\r\n variantIds: string[] | undefined;\r\n collectionDescription: string | undefined;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365All.ICreateActionContext): Msdyn365All.IActionInput => {\r\n const variantId = args.requestContext.app.config.queryBasedVariantSelection\r\n ? getQueryParamsFromQueryByName(\r\n Msdyn365.isBrowser\r\n ? new URL(window.location.href.toString())\r\n : args.requestContext.url.requestUrl,\r\n variantQueryStringName)\r\n : undefined;\r\n return new GetUnbxdCollectionCompareDataInput(args, variantId);\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function getUnbxdCollectionCompare(input: GetUnbxdCollectionCompareDataInput, ctx: Msdyn365All.IActionContext): Promise {\r\n let variantIdNumber: number | null | undefined;\r\n const actionInput = new FetchChooseYourFoundationDatabaseInput(ctx.requestContext.app.config.jsonSrc);\r\n const unbxdApiKey = ctx.requestContext.app.config.unbxdApiKey;\r\n const unbxdSiteKey = ctx.requestContext.app.config.unbxdSiteKey;\r\n const collectionJson: any = await fetchChooseYourFoundationDatabaseDataAction(actionInput, ctx);\r\n let collectionData: any | null = {};\r\n let variantIds: string[] | undefined = [];\r\n let collectionDescription: string | undefined;\r\n let response: any = {};\r\n if (collectionJson) {\r\n const baseURL = 'https://search.unbxd.io';\r\n variantIdNumber = input.recordId && !Number.isNaN(Number(input.recordId))\r\n ? Number(input.recordId)\r\n : await getDefaultVariantId(Number(getSelectedProductIdFromActionInput(ctx)), ctx);\r\n if (collectionJson.length > 0 && variantIdNumber) {\r\n variantIds = collectionJson?.find((item: any) => Number(item.mattressVariantReqId) === variantIdNumber)?.mattressComparisonReqIdList?.map((value: any) => value);\r\n collectionDescription = collectionJson?.find((item: any) => Number(item.mattressVariantReqId) === variantIdNumber)?.collectionDescription;\r\n variantIds && variantIds?.length >= 1 && variantIds?.unshift(`${variantIdNumber}`);\r\n let collectionCompareIds = '';\r\n if (variantIds && variantIds?.length >= 2) {\r\n for (let index = 0; index < variantIds?.length; index++) {\r\n // eslint-disable-next-line security/detect-object-injection\r\n collectionCompareIds += index === 0 ? `variantId:${variantIds[index]}` : ` OR variantId:${variantIds[index]}`;\r\n }\r\n } else {\r\n return { collectionData: null, productId: null, variantIds: undefined, collectionDescription };\r\n }\r\n if (collectionCompareIds.length) {\r\n const unbxdUrl = `${baseURL}/${unbxdApiKey}/${unbxdSiteKey}/search?q=*&variants=true&variants.count=*&filter= ${collectionCompareIds}`;\r\n response = await Msdyn365All.sendRequest(unbxdUrl, 'get');\r\n } else {\r\n return { collectionData: null, productId: null, variantIds: undefined, collectionDescription };\r\n }\r\n\r\n collectionData = response?.data?.response;\r\n return { collectionData, productId: variantIdNumber, variantIds: variantIds, collectionDescription };\r\n }\r\n }\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { collectionData: null, productId: null, variantIds: undefined, collectionDescription };\r\n}\r\n\r\nexport default Msdyn365All.createObservableDataAction({\r\n action: >getUnbxdCollectionCompare,\r\n // Give your data action a unique id\r\n id: 'GetUnbxdCollectionCompareData',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n\r\n\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n { \n const actionPath = 'actions/bonus-coupon-details.action';\n binding.dataActions[actionPath] = require('partner/actions/bonus-coupon-details.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/bonus-item-product.action';\n binding.dataActions[actionPath] = require('partner/actions/bonus-item-product.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/checkout-billing-validity.action';\n binding.dataActions[actionPath] = require('partner/actions/checkout-billing-validity.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/checkout-disabled-button-state.action';\n binding.dataActions[actionPath] = require('partner/actions/checkout-disabled-button-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/complete-your-bed-pillow.action';\n binding.dataActions[actionPath] = require('partner/actions/complete-your-bed-pillow.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/complete-your-bed-protector.action';\n binding.dataActions[actionPath] = require('partner/actions/complete-your-bed-protector.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/express-edit-state.action';\n binding.dataActions[actionPath] = require('partner/actions/express-edit-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/express-order-submit-state.action';\n binding.dataActions[actionPath] = require('partner/actions/express-order-submit-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/fetch-choose-your-foundation-database.action';\n binding.dataActions[actionPath] = require('partner/actions/fetch-choose-your-foundation-database.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/fetch-complete-your-bed.action';\n binding.dataActions[actionPath] = require('partner/actions/fetch-complete-your-bed.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/fetch-core-delivery-list.action';\n binding.dataActions[actionPath] = require('partner/actions/fetch-core-delivery-list.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-delivery-fee-update.action';\n binding.dataActions[actionPath] = require('partner/actions/get-delivery-fee-update.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-delivery-message.action';\n binding.dataActions[actionPath] = require('partner/actions/get-delivery-message.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-eyebrow-message.action';\n binding.dataActions[actionPath] = require('partner/actions/get-eyebrow-message.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-mattress-foundations-to-add.action';\n binding.dataActions[actionPath] = require('partner/actions/get-mattress-foundations-to-add.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-mfrm-products-category-paths.action';\n binding.dataActions[actionPath] = require('partner/actions/get-mfrm-products-category-paths.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-recycle-fee-checkout.action';\n binding.dataActions[actionPath] = require('partner/actions/get-recycle-fee-checkout.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-sm-inventory-status.action';\n binding.dataActions[actionPath] = require('partner/actions/get-sm-inventory-status.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-soci-data.action';\n binding.dataActions[actionPath] = require('partner/actions/get-soci-data.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-try-in-store-info.action';\n binding.dataActions[actionPath] = require('partner/actions/get-try-in-store-info.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-unbxd-product-recommendations.action';\n binding.dataActions[actionPath] = require('partner/actions/get-unbxd-product-recommendations.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/payment-redirect-to-order-confirmation.action';\n binding.dataActions[actionPath] = require('partner/actions/payment-redirect-to-order-confirmation.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/paypal-express-edit-state.action';\n binding.dataActions[actionPath] = require('partner/actions/paypal-express-edit-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/paypalexpress-tryagain-trigger.action';\n binding.dataActions[actionPath] = require('partner/actions/paypalexpress-tryagain-trigger.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/paypalsuccesstrigger.action';\n binding.dataActions[actionPath] = require('partner/actions/paypalsuccesstrigger.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/select-your-foundation.action';\n binding.dataActions[actionPath] = require('partner/actions/select-your-foundation.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/social-icons-state.action';\n binding.dataActions[actionPath] = require('partner/actions/social-icons-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/srp-breadcrumb-page.action';\n binding.dataActions[actionPath] = require('partner/actions/srp-breadcrumb-page.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/trigger-special-synchrony-financing.action';\n binding.dataActions[actionPath] = require('partner/actions/trigger-special-synchrony-financing.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/update-monthly-payment.action';\n binding.dataActions[actionPath] = require('partner/actions/update-monthly-payment.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/user-defined-promocode.action';\n binding.dataActions[actionPath] = require('partner/actions/user-defined-promocode.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/wmap-address-state.action';\n binding.dataActions[actionPath] = require('partner/actions/wmap-address-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/zip-code-state.action';\n binding.dataActions[actionPath] = require('partner/actions/zip-code-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/zip-code-validation.action';\n binding.dataActions[actionPath] = require('partner/actions/zip-code-validation.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/atp-slots-information-state.action';\n binding.dataActions[actionPath] = require('partner/data-actions/atp-slots-information-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/bonuscoupons-action.action';\n binding.dataActions[actionPath] = require('partner/data-actions/bonuscoupons-action.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/brightspot-content-action.action';\n binding.dataActions[actionPath] = require('partner/data-actions/brightspot-content-action.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/financing-offer-state.action';\n binding.dataActions[actionPath] = require('partner/data-actions/financing-offer-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-address-from-zipcode.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-address-from-zipcode.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-card-payment-accept-point.override.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-card-payment-accept-point.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-comfort-type.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-comfort-type.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-dimensions-for-selected-variant.override.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-dimensions-for-selected-variant.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-franchise-data.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-franchise-data.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-product-benefit-enhanced-content.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-product-benefit-enhanced-content.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-product-benefits-data.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-product-benefits-data.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-promocode-value.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-promocode-value.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-resons-to-buy-data.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-resons-to-buy-data.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-sales-order-details-action.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-sales-order-details-action.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-selected-variant.override.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-selected-variant.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-seo-data.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-seo-data.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-sleep-disruptor-icons.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-sleep-disruptor-icons.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-store-location-information.override.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-store-location-information.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/mfi-atp-inventory.action';\n binding.dataActions[actionPath] = require('partner/data-actions/mfi-atp-inventory.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/mfrm-mfi-bonusitem.action';\n binding.dataActions[actionPath] = require('partner/data-actions/mfrm-mfi-bonusitem.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/mfrm-notification.action';\n binding.dataActions[actionPath] = require('partner/data-actions/mfrm-notification.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/payment-cc-card-types.action';\n binding.dataActions[actionPath] = require('partner/data-actions/payment-cc-card-types.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/payment-error-state.action';\n binding.dataActions[actionPath] = require('partner/data-actions/payment-error-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/products-by-category.override.action';\n binding.dataActions[actionPath] = require('partner/data-actions/products-by-category.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/products-by-recommendation.override.action';\n binding.dataActions[actionPath] = require('partner/data-actions/products-by-recommendation.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/products-by-relationship-id.override.action';\n binding.dataActions[actionPath] = require('partner/data-actions/products-by-relationship-id.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/products-get-by-id.action';\n binding.dataActions[actionPath] = require('partner/data-actions/products-get-by-id.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/progressive-leasing-modal-state.action';\n binding.dataActions[actionPath] = require('partner/data-actions/progressive-leasing-modal-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/promocode-applied-in-progress.action';\n binding.dataActions[actionPath] = require('partner/data-actions/promocode-applied-in-progress.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/redirect-to-wmap-submit-payment.action';\n binding.dataActions[actionPath] = require('partner/data-actions/redirect-to-wmap-submit-payment.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/search-org-unit-locations.action';\n binding.dataActions[actionPath] = require('partner/data-actions/search-org-unit-locations.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/toggle-submit-order-button.action';\n binding.dataActions[actionPath] = require('partner/data-actions/toggle-submit-order-button.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/update-email-call.action';\n binding.dataActions[actionPath] = require('partner/data-actions/update-email-call.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/wmap-get-order-details.action';\n binding.dataActions[actionPath] = require('partner/data-actions/wmap-get-order-details.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/wmap-submit-payment.action';\n binding.dataActions[actionPath] = require('partner/data-actions/wmap-submit-payment.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'modules/mfrm-autosuggest/actions/get-unbxd-search-autosuggest.action';\n binding.dataActions[actionPath] = require('partner/modules/mfrm-autosuggest/actions/get-unbxd-search-autosuggest.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'modules/mfrm-category-page-summary/mfrm-category-page-summary.action';\n binding.dataActions[actionPath] = require('partner/modules/mfrm-category-page-summary/mfrm-category-page-summary.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'modules/mfrm-product-page-summary/get-product-recordId.action';\n binding.dataActions[actionPath] = require('partner/modules/mfrm-product-page-summary/get-product-recordId.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'modules/mfrm-product-page-summary/mfrm-product-page-summary.action';\n binding.dataActions[actionPath] = require('partner/modules/mfrm-product-page-summary/mfrm-product-page-summary.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'modules/mfrm-products-compare/get-unbxd-collection-compare-data.action';\n binding.dataActions[actionPath] = require('partner/modules/mfrm-products-compare/get-unbxd-collection-compare-data.action');\n registerActionId(actionPath);\n }\n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.packageDataActions = {};\n window.__bindings__.packageDataActions['__local__'] = {\n ...binding.dataActions\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["getSetLocalStorage","key","getSet","valueToSet","returnType","MsDyn365","localStorage","setItem","JSON","stringify","parse","getItem","getSetProductData","products","getSetProductSpec","getSetPromoCodeApplyList","getSetPromoCode","getSetGrandTotal","total","getSetBonusItemProd","globalBonusItems","getSetSelectedBonasItem","bonusItemArray","getSetBonusCouponDetail","getCoupons","getSetPrevBonasModalState","previousBonasModal","getSetBonusItemBrandName","bonusItemsBrandName","getSetDateGroupedProducts","getSetExpressFlow","express","getSetWmapCartLines","canonicalURL","requestContext","requestUrl","url","origin","path","pathname","toLowerCase","urlParts","split","splice","match","removePipeSignValue","removeKeywords","filteredPath","join","filteredURL","undefined","length","filter","urlPart","indexOf","removeKeywordFromUrl","app","config","removeKeywordFromUrlArray","trim","forEach","_part","removeKeyword","trimmedKeyword","indexOfValue","getSortedVirtualRefinerConfig","isMattressesCategory","appConfigSorted","getVirtualRefinerConfig","appConfig","enableForMattresses","enableForOtherCategories","sort","a","b","order","getVirtualRefinerNames","sortedVirtualRefinerConfig","appConfigRefinerNames","sortedConfig","push","refinerName","urlModifications","async","getVirtualRefinerValues","virtualRefiners","virtualRefinerValues","categoryIdToken","urlTokens","recordId","finalizedUrlParts","plainUrlPart","decodeURIComponent","part","filteredPart","mainRefiner","Values","refinerValue","refinerValueKeyName","LeftValueBoundString","replace","regExSpecialChars","canonicalUrlspecialCharIncludeList","navLinkKeywordRemoval","link","linkBase","linkParams","endsWith","linkParam","map","param","filteredLink","includeConfigList","includeConfig","pattern","RegExp","dayjs","tz","utc","isBetween","format","getValidSpecialCampaign","financingOffer","specialCampaign","enableCampaign","initialMonthlyAmount","numOfDiscountedMonths","isCampaignScheduled","getCampaignRemainingCost","campaign","totalPrice","remainingCost","remainingMonths","numOfMonths","cost","months","offer","tempOffer","Object","create","campaignValidStartDate","campaignValidEndDate","startDate","endDate","isScheduled","add","startDateCentralTime","isValid","local","endDateCentralTime","now","selectFinancingOffer","returnCustomOfferArray","campaignFound","limitedTimeFinancingOffers","everydayFinancingOffers","specialFinancingOffer","synchronySpecialFinancingCondition","specialFinancingEnable","highestMinimumPurchase","bestOffer","costPerMonth","isLTO","minPurchase","everydayFinancingOfferMessage","limitedFinancingOfferMessage","monthlyOfferDetails","financingOfferDescription","disclaimer","offerFound","everydayOffers","specialOffer","validLimitedTimeFinancingOffers","offerValidStartDate","offerValidEndDate","isValidLimitedTimeOffer","currentOfferAccepted","noInterestFor","Math","ceil","offerName","isAfter","currentOffer","specialCampaignOffer","checkoutDisplay","validCampaign","MFIGetBonusItemsParametersExtensionClass","constructor","odataObject","this","CartId","Coupons","i","Id","ExtensionProperties","className","substr","lastIndexOf","concat","EntityClasses","MFIBonusItemsDetailsEntityExtensionClass","Coupon","IsBonusCoupon","CouponMessage","Items","MFIQualifyingItemDetailsExtensionClass","QualifyingItemId","QualifyingProductId","BonusProductQty","parseFloat","BonusItems","MFIBonusItemDetailsExtensionClass","BonusItemId","PrimaryImageUrl","ProductTypeValue","BonusProductId","Name","AdditionToCart","AdjustedPrice","BasePrice","CustomerContextualPrice","DiscountAmount","DiscountTypeValue","DiscountType","DealPriceOrDiscountPercentage","BonusCalculatedDiscountPrice","MFIGetBonusCouponsDetailsResponseExtensionClass","BonusCoupons","MFIBonusCouponsDetailExtensionClass","MFIBonusItemsResponseExtensionClass","BonusItemsDetails","Message","BonusCoupon","BonusCouponMessage","ChildCoupons","bonusItemsQuery","id","DataServiceQuery","DataServiceEntities","mFIGetBonusCouponsDetailsAsync","context","bonusCoupons","request","createDataServiceRequestForOperation","bypassCache","returnEntity","createMFIGetBonusCouponsDetailsInput","callActionOrExecute","callerContext","mFIGetBonusItemsDetailAsync","bonusItemParams","createMFIGetBonusItemsDetailInput","BonusCouponDetailsInput","getCacheKey","getCacheObjectType","dataCacheType","Msdyn365","action","input","ctx","bonusCouponDetail","args","BonusItemProductInput","bonusItemProduct","BillingStateInput","BillingStateAction","isBillingFormValid","createObservableDataAction","inputData","CheckoutDisabledButtonStateInput","disabled","CompleteYourBedPillowInput","pillow","CompleteyourBedProtectorInput","protector","ExpressEditStateInput","shippingEdit","deliveryEdit","ExpressOrderSubmitStateActionInput","expressSubmit","slotTime","slotDate","selectedService","FetchChooseYourFoundationDatabaseInput","jsonSrc","data","FetchCompleteYourBedDataInput","jsonData","FetchCoreDeliveryListInput","cartLines","zipCode","VariantRecordId","item","toString","atpInput","Weeks","InventoryType","StoreId","RequestedDate","Date","ZipCode","getZipCode","ItemLines","CustomerRequestTime","NoOfPriorityDC","mFIATPInventoryPLPAsync","GetDeliveryFeeUpdateInput","deliveryAmount","GetMattressFoundationsToAddInput","console","log","text","GetCategoryPathsInput","catalogId","productIds","constructedCacheKey","ChannelId","apiSettings","channelId","CatalogId","ids","createGetCategoryPathsInput","Error","getProductsCategoryPathsAction","catPaths","hasArray","productsIter","ProductId","getCategoryPathsAsync","queryResultSettings","Paging","Top","Sorting","err","getCategoryPathsActionDataAction","GetRecycleFeeCheckoutInput","recycleFee","tax","GetATPInventoryStatusInput","isCached","Array","prototype","call","ItemId","result","mFIATPInventoryStatusAsync","error","GetSociDataInput","searchradius","searchLimit","geoLoc","test","response","axios","headers","e","lookupRadius","maxNoOfFranchise","MFITryInStoreExtensionClass","Products","Limit","Radius","MFITryInStoreInfoResponseExtensionClass","Status","Inventory","createMFIGetTryInStoreInfoInput","tryInStoreProductIDs","storeId","tryInStoresQuery","GetTryInStoreInfoInput","mFIGetTryInStoreInfoAsync","GetUnbxdRecommendationsDataInput","pageType","widgetNumber","productID","catLevels","cartItemIDs","unbxdUid","Cookies","get","toUpperCase","unbxdApiKey","unbxdSiteKey","unbxdUrl","catnames","catName","index","categoryLevelName","productitemIds","itemId","PaymentRedirectToOrderConfirmationInput","redirectToOrderConfirmation","PaypalExpressEditStateInput","isDisabled","PaypalexpressTryagainTriggerInput","buttonClicked","orderSubmitClick","PaypalsuccesstriggerInput","isPaymentSuccess","paymentSuccessEmail","SelectYourFoundationInput","foundation","SocialIconsStateInput","socialIconStateAction","copyLinkClick","SrpBreadcrumbPageInput","breadcrumbCheck","TriggerSpecialSynchronyFinancingInput","triggerSpecialFinancing","UpdateMonthlyPaymentInput","updateTotal","UserDefinedPromocodeInput","userDefinedPromos","WmapAddressStateInput","preFilledAddress","isAddressUpdate","ZipCodeStateInput","ZipCodeStateAction","isStateValid","ZipCodeValidationInput","ZipcodeValidationAction","isZipcodeValid","AtpSlotsInformationStateInput","checkAvailable","buttonDisabled","isbackOrdered","willCall","isSynchorniCall","BonusCouponsInfoInput","bonusCoupon","getAllBonusCouponsDetails","couponsDetails","telemetry","warning","debug","BrightSpotContentInput","brightspotUrl","super","shouldCacheOutput","cacheObjectType","cacheKey","getBrightspotUrl","brightspotPageUrl","FinancingOfferStateInput","isOpen","GetAddressByZipcodeInput","country","zipcode","getAddressFromZipCodeAsync","GetCardPaymentAcceptPointInput","buildCacheKey","paymenTenderType","showBillingAddress","selectedOfferName","isReload","amountDue","createCheckoutPaymentInstrumentInput","getCardPaymentAcceptPointInput","showBillingAddres","getCardPaymentAcceptPointAction","exception","checkoutState","getCheckoutState","catch","isEmptyOrNullObject","checkoutCart","cart","CartLines","URL","window","cardPaymentAcceptSettings","HostPageOrigin","AdaptorPath","CardPaymentEnabled","CardTokenizationEnabled","HideBillingAddress","TenderTypeId","PaymentAmount","addPaymentMethodName","extensionKeyPlanId","getOffer","allOffers","defaultVal","find","isSynchrony","set","planID","ep","Key","Value","StringValue","getCardPaymentAcceptPointAsync","then","cardPaymentAcceptPoint","AcceptPageUrl","AcceptPageContent","getCardPaymentAcceptPointActionDataAction","GetComfortTypesData","comfortTypesDataUrl","getComfortTypesDataUrl","jsonUrl","comfortTypesDataJsonUrl","res","GetDimensionsForSelectedVariantInput","productId","matchingDimensionValues","getDimensionsForSelectedVariantAction","variantId","queryBasedVariantSelection","getQueryParamsFromQueryByName","location","href","variantQueryStringName","activeProduct","ProductsDataActions","Number","isNaN","ArrayExtensions","Dimensions","promises","dimension","shippingInventoryConfiguration","createInventoryAvailabilitySearchCriteria","searchCriteria","RequestedDimensionTypeValue","DimensionTypeValue","MatchingDimensionValues","DefaultWarehouseOnly","FilterByChannelFulfillmentGroup","DeliveryModeTypeFilterValue","MasterProductId","RecordId","dimensionValues","dimensionValuesWithInventory","dimensionValuesResults","Promise","all","newDimension","oldDimension","DimensionValues","value","DimensionValue","getDimensionsForSelectedVariantActionDataAction","getSelectedProductIdFromActionInput","getDimensionValuesFromQuery","GetFranchiseData","_Latitude","_Longitude","_Radius","Latitude","Longitude","getFranchiseInput","getFranchise","sociFranchiseDataUrl","franchiseDataJson","franchiseStores","franchise","miles","latitude1","longitude1","latitude2","longitude2","long1","PI","long2","lat1","lat2","dlon","dlat","pow","sin","cos","asin","sqrt","_calculateDistance","lat","long","GetProductBenefitsEnhancedContentInput","masterProductID","jsonUrlFromGlobals","productBenefitsEnhancedContentUrl","masterProductid","GetProductBenefitsData","productBenefitsDataUrl","getProductBenefitsDataUrl","GetPromocodeValueInput","GetReasonsToBuyDataInput","categoryName","reasonsToBuyJsonUrl","orderTypes","GetSalesOrderWithHydrationsInput","orderType","orderId","getSalesOrderWithHydrationsAction","trace","salesOrder","getSalesOrderDetailsBySalesIdAsync","getSalesOrderDetailsByTransactionIdAsync","getSalesOrder","TransactionTypeValue","SalesLines","salesLine","productInputs","ProductInput","getSimpleProducts","getProducts","deliveryOptions","getDeliveryOptionsAsync","x","message","getSalesOrderWithHydrationsActionDataAction","salesId","transactionId","query","transaction","GetSeoDataInput","seoDataUrl","getSeoDataUrl","filteredUrlPath","seoData","GetSleepDisruptorIcons","sleepDisuptorIconsDataUrl","getSleepDisuptorIconsDataUrl","sleepDisruptorIconDataUrl","GetOrgUnitLocationsByAreaInput","_DistanceUnitValue","_IgnoreLocation","DistanceUnitValue","IgnoreLocation","createGetOrgUnitLocationsByAreaInput","getOrgUnitLocationsByArea","searchArea","getOrgUnitLocationsByAreaAsync","locationDeliveryOptions","locationPromiseList","stores","store","locationDeliveryOption","_channeldeliveryoption","orgUnitLocation","channelDeleiveryOptions","OrgUnitNumber","OrgUnitAvailability","getStoreHoursAsync","hours","availability","OrgUnitLocation","OrgUnitPickUpDeliveryModes","StoreHours","_getLocationWithHours","getOrgUnitLocationsByAreaDataAction","MfiAtpInventoryInput","inventoryType","weeks","page","requestedDate","itemLines","mfiAtpInventoryAction","requestBody","Page","mFIATPInventoryDynamicAsync","MFIbonusitemsInput","MfrmNotificationInput","PaymentCcCardTypesInput","cardType","PaymentErrorStateInput","errorTitle","errorMessage","progressiveLinkText","getProductsByCategoryList","categoryId","listMetadata","categoryIds","CATEGORY_PAGE_NAME","categories","productSearchCriteria","Context","CategoryIds","IncludeAttributes","searchByCriteriaAsync","pageSize","getProductImageUrls","getProductsByCategoryListAction","CartTokenPrefix","getProductIdForReco","recommendationCriteria","includeCart","cookies","cartCookieParts","getCartCookie","user","isAuthenticated","Auth","Anon","readCart","readAsync","getCart","cartProductIds","element","product","includePageContext","PDP_PAGE_NAME","ProductIds","getProductsByRecommendationList","customerAccountNumber","recommendationListId","PICKS_FOR_YOU_LIST","proxyContext","reccomendationListId","missingType","actionInputError","getCategoryIdForReco","personalization","CustomerAccountNumber","getElementsAsync","recommendedElements","productTypeId","ElementId","ElementTypeValue","semver","retailServerProxyVersion","itemIds","Ids","SearchCondition","productSearchResults","orderProductSearchResults","productRatingsPromise","getProductRatingsAsync","productInput","productRatings","productRating","unratedProduct","mappedProduct","TotalRatings","AverageRating","getProductsByRecommendationListAction","getProductsByRelationshipIdList","relationshipId","productResponse","getByIdAsync","baseProduct","isArray","hasOwnProperty","getRelatedProductsAsync","getProductsByRelationshipIdListAction","GetProductsByIdInput","productIdsArr","ctxObject","bypass","getByIdsAsync","ProgressiveLeasingModalStateInput","PromoCodeAppliedOnCartInput","updatePromoCodeAppliedOnCartProgressAction","isInProcess","RedirectToWmapSubmitPaymentInput","redirectToWmapSubmitPayment","buildQueryResultSettings","Skip","createSearchOrgUnitLocationsInputFunc","createSearchOrgUnitLocationsInput","retailActionDataAction","retailAction","ToggleSubmitOrderButtonInput","isSynchronySelected","isPaypalSelected","isCreditcardSelected","isCcFieldsNotPopulated","UpdateEmailCartInput","updateEmailCartAction","checkEmail","WmapGetOrderDetailsInput","orderDetailsAPIurl","getOrderDetailsAPIurl","getOrderId","apiResponseUrl","baseUrl","orderDetailsApiUrl","salesOrderId","orderIdOun","oun","makeaPaymentLink","wmapPageUrlSuffix","pathName","SalesId","WmapSubmitPaymentInput","submitPaymentAPIurl","submitPaymentPayload","WmapSubmitPaymentAction","requestOptions","token","Authorization","GetUnbxdSearchAutoSuggestDataInput","queryText","popularProducts","inFields","topQueries","keywordSuggestions","promotedSuggestion","popularProductsCount","inFieldsCount","topQueriesCount","keywordSuggestionsCount","promotedSuggestionCount","MFRMCategoryPageSummaryInput","buildCacheKeyWithUrlTokens","_getSEOMetaTagValue","currentCategory","keyValue","attr","getFallbackTitle","activeRefinerList","getProductSearchRefinersAsync","productRefiners","productRefiner","getAllRefinersAction","refiners","CategoryHierarchy","configVirtualRefinerNames","filteredRefiners","refiner","KeyName","slugArray","pathArray","slug","Slug","sortedConfigValues","removedCategorySlug","refinerParts","_slug","refinerPart","finalRefinerParts","includes","flatten","sortedValues","refinerSet","toLocaleLowerCase","sortedValue","keys","finalRefiners","sortedConfigValue","sortedRefinerName","_getActiveRefiners","concateTitle","seoInput","getSEOData","seoPageTitle","seoPageMetaData","getCurrentCategory","CurrentCategoryInput","createGetCurrentCategoryInput","categoryUrl","fallbackTitle","pageTitle","pageTitleParser","getHtmlParserValue","fallBackMeta","categoryPageMetaData","categoryPageMetaDataParser","localName","getFriendlyName","locale","NameTranslations","neutralizedName","NeutralizedName","getCategoryUrl","canonicalDomain","title","description","sharingImageUrl","OfflineImage","canonicalUrl","faviconUrl","sharingImage","src","GetProductRecordidInput","getVariantsByDimensionValuesAsync","GetUnbxdCollectionCompareDataInput","configs","Msdyn365All","variantIdNumber","actionInput","collectionJson","fetchChooseYourFoundationDatabaseDataAction","collectionDescription","collectionData","variantIds","baseURL","getDefaultVariantId","mattressVariantReqId","mattressComparisonReqIdList","unshift","collectionCompareIds","binding","modules","dataActions","registerActionId","actionPath","default","exportName","Action","require","__bindings__","packageDataActions","module","exports","React","ReactDOM"],"sourceRoot":""}