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YC,GAAYE,SAChCL,EAAQE,YAAYC,GAAYE,QAAQC,WACxCN,EAAQE,YAAYC,GAAYE,QAAQC,UAAUR,GAClDE,EAAQE,YAAYF,EAAQE,YAAYC,GAAYE,QAAQC,UAAUR,IAAME,EAAQE,YAAYC,GAEhGI,OAAOC,KAAKR,EAAQE,YAAYC,IAAe,IAAIM,SAAQC,IACnDV,EAAQE,YAAYC,GAAYO,IAChCV,EAAQE,YAAYC,GAAYO,GAAYJ,WAC5CN,EAAQE,YAAYC,GAAYO,GAAYJ,UAAUK,SACtDX,EAAQE,YAAYF,EAAQE,YAAYC,GAAYO,GAAYJ,UAAUR,IAAME,EAAQE,YAAYC,GAAYO,QA8BxHE,CAAiBT,GAIzBU,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAab,QAAOc,EAAAA,EAAA,GACpBF,OAAOC,aAAab,SAAW,IAC/BD,EAAQC,SAGXY,OAAOC,aAAaE,mBAAqB,GACzCH,OAAOC,aAAaE,mBAA8B,UAACD,EAAA,GAC5Cf,EAAQE,iCCvDvBe,EAAOC,QAAUC,2BCAjBF,EAAOC,QAAUE","sources":["webpack://Msdyn365.Commerce.Online/./src/actions/validate-address.action.ts?7d5f","webpack://Msdyn365.Commerce.Online/./lib/__local__/module-registration.js?8a42","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\n\n/**\n * ValidateAddress Input Action\n */\nexport class ValidateAddressInput implements Msdyn365.IActionInput {\n public readonly addressLine1: string;\n public readonly addressLine2: string;\n public readonly city: string;\n public readonly state: string;\n public readonly zipcode: string;\n public readonly country: string;\n public readonly captcha: string;\n\n constructor(\n addressLine1: string,\n addressLine2: string,\n city: string,\n state: string,\n zipcode: string,\n country: string,\n captcha: string\n ) {\n this.addressLine1 = addressLine1;\n this.addressLine2 = addressLine2;\n this.city = city;\n this.state = state;\n this.zipcode = zipcode;\n this.country = country;\n this.captcha = captcha;\n }\n\n public getCacheKey = () => `${this.addressLine1}-${this.addressLine2}-${this.city}-${this.state}-${this.zipcode}-${this.country}`;\n public getCacheObjectType = () => 'VerifyAddress';\n public dataCacheType = (): Msdyn365.CacheType => 'application';\n}\n\nexport interface IValidateAddressData {\n verifiedAddresses: IAddress[];\n}\n\nexport interface IAddress {\n addressLine1: string;\n addressLine2: string;\n city: string;\n state: string;\n zipcode: string;\n country: string;\n}\n\nconst createInput = (inputData: Msdyn365.ICreateActionContext & ValidateAddressInput): Msdyn365.IActionInput => {\n const { addressLine1, addressLine2, city, state, zipcode, country, captcha } = inputData;\n return new ValidateAddressInput(addressLine1, addressLine2, city, state, zipcode, country, captcha);\n};\n\nasync function action(input: ValidateAddressInput, context: Msdyn365.IActionContext): Promise {\n const sstApiUrl = context.requestContext.app.config.sstApiUrl;\n\n const result = await Msdyn365.sendRequest(\n `${sstApiUrl}/address/verify`,\n 'post',\n JSON.stringify({\n address: {\n addressLine1: input.addressLine1,\n addressLine2: input.addressLine2,\n city: input.city,\n state: input.state,\n zipcode: input.zipcode,\n country: input.country\n },\n captcha: input.captcha\n }),\n { headers: { 'Content-Type': 'application/json' } }\n ).then((response: Msdyn365.IHTTPResponse) => {\n return response.data;\n });\n return { verifiedAddresses: result };\n}\n\nexport default Msdyn365.createObservableDataAction({\n action: >action,\n id: 'ValidateAddress',\n input: createInput\n});\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/validate-address.action';\n binding.dataActions[actionPath] = require('partner/actions/validate-address.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":["ValidateAddressInput","constructor","addressLine1","addressLine2","city","state","zipcode","country","captcha","getCacheKey","this","getCacheObjectType","dataCacheType","Msdyn365","action","async","input","context","sstApiUrl","requestContext","app","config","verifiedAddresses","JSON","stringify","address","headers","then","response","data","id","inputData","binding","modules","dataActions","actionPath","require","default","prototype","Object","keys","forEach","exportName","Action","registerActionId","window","__bindings__","_objectSpread","packageDataActions","module","exports","React","ReactDOM"],"sourceRoot":""}