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AOC,aAAatB,QAAOhG,EAAAA,EAAA,GACpBqH,OAAOC,aAAatB,SAAW,IAC/BD,EAAQC,SAGXqB,OAAOC,aAAarB,YAAWjG,EAAAA,EAAA,GAC5BqH,OAAOC,aAAarB,aAAe,IACnCF,EAAQE,aAEY,MAAMsB,EAAiB,GAC9BA,EAAe,6DAA+D,CACtFrB,EAAGA,IAAMC,EAAQ,MACjBqB,GAAI,sCAEpBH,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAaC,eAAcvH,EAAAA,EAAA,GACPqH,OAAOC,aAAaC,gBAAkB,IACtCA,UCnF3BE,EAAOC,QAAUnO,cCAjBkO,EAAOC,QAAUC","sources":["webpack://sheikh-zayed-festival/./src/actions/get-crm-token.action.ts?4b61","webpack://sheikh-zayed-festival/./src/actions/get-existing-contact.action.ts?edd7","webpack://sheikh-zayed-festival/./src/actions/get-inquery-options.action.ts?f268","webpack://sheikh-zayed-festival/./src/actions/post-contact-us-form.action.ts?6c16","webpack://sheikh-zayed-festival/./src/actions/post-new-contact.action.ts?8117","webpack://sheikh-zayed-festival/./src/modules/szf-contact-us/szf-contact-us.tsx?b0a9","webpack://sheikh-zayed-festival/./src/modules/szf-contact-us/szf-contact-us.view.tsx?5cc2","webpack://sheikh-zayed-festival/./src/utilities/szf-modal.component.tsx?92d6","webpack://sheikh-zayed-festival/./lib/szf-contact-us/module-registration.js?faa5","webpack://sheikh-zayed-festival/external var \"React\"?0d3b","webpack://sheikh-zayed-festival/external var \"ReactDOM\"?853b"],"sourcesContent":["/*!\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 qs from 'querystring';\r\n/**\r\n * GetCrmToken Input Action\r\n */\r\n\r\n export interface IToken {\r\n token_type: string;\r\n expires_in: string;\r\n ext_expires_in: string;\r\n expires_on: string;\r\n not_before: string;\r\n resource: string;\r\n access_token: string;\r\n}\r\n\r\nexport class GetCrmTokenInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // TODO: 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 = () => `CRMTOKEN`;\r\n public getCacheObjectType = () => 'CRMTOKEN';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetCrmTokenData {\r\n token: string;\r\n}\r\n\r\n/**\r\n * TODO: 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 GetCrmTokenInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: GetCrmTokenInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: 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 const { szfCRMDomain, szfCRMClientSecret} = ctx.requestContext.app.config;\r\n const data = qs.stringify({\r\n 'resource': `${szfCRMDomain}`,\r\n 'client_id': '1d4d5b5c-c710-472d-b8ac-104788da8da1',\r\n 'client_secret': `${szfCRMClientSecret}`,\r\n 'grant_type': 'client_credentials'\r\n });\r\n const response = await Msdyn365.sendRequest(\"https://login.microsoftonline.com/c03a7c9b-0691-48f2-a884-93fe49a74786/oauth2/token\", \"post\", data, {\r\n headers: {\r\n 'Content-Type': 'application/x-www-form-urlencoded',\r\n 'Cookie': 'fpc=AopThjyphGZIqV8tMvZOskskZZdbAQAAAETfudgOAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd'\r\n }\r\n });\r\n if(response && response.status===200){\r\n return {\r\n token : response.data.access_token\r\n };\r\n }else{\r\n return {token : ''};\r\n }\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetCrmToken',\r\n input: createInput\r\n // TODO: 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 * GetExistingContact Input Action\r\n */\r\n\r\nexport class GetExistingContactInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public token: string | undefined;\r\n public email: string | undefined;\r\n public phone: string | undefined;\r\n constructor(token : string | undefined, email: string | undefined,phone:string | undefined) {\r\n this.phone = phone;\r\n this.email = email;\r\n this.token = token;\r\n }\r\n // TODO: 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 = () => `SZFEXISTINGCONTACT`;\r\n public getCacheObjectType = () => 'SZFEXISTINGCONTACT';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetExistingContactData {\r\n status: boolean;\r\n id: string | undefined;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createExistingContactInput = (args: Msdyn365.ICreateActionContext, token: string, email: string,phone: string): Msdyn365.IActionInput => {\r\n return new GetExistingContactInput(token, email,phone);\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function existingContactDataAction(input: GetExistingContactInput, ctx: Msdyn365.IActionContext): Promise {\r\n const token = input.token;\r\n const email = input.email;\r\n const phone = input.phone;\r\n const szfCRMDomain = ctx.requestContext.app.config.szfCRMDomain;\r\n const response = await Msdyn365.sendRequest(`${szfCRMDomain}/api/data/v9.2//contacts?$select=emailaddress1,firstname,lastname,mobilephone &$filter=emailaddress1 eq \\'${email}\\' or mobilephone eq \\'%2B${phone}\\'`, \"get\", {}, {\r\n headers: {\r\n 'Authorization':`Bearer ${token}`\r\n }\r\n });\r\n if(response && response.data && response.data.value && response.data.value.length > 0 && response.data.value[0].contactid){\r\n return {\r\n status: true,\r\n id: response.data.value[0].contactid\r\n };\r\n }else{\r\n return {\r\n status: false,\r\n id: undefined\r\n };\r\n }\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: 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 { text: 'Static data from action' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >existingContactDataAction,\r\n // TODO: Give your data action a unique id\r\n id: 'GetExistingContact',\r\n input: createExistingContactInput\r\n // TODO: 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 * GetInqueryOptions Input Action\r\n */\r\nexport class GetInqueryOptionsInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public token: string | undefined;\r\n constructor(token: string| undefined) {\r\n this.token = token;\r\n }\r\n\r\n // TODO: 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 = () => `SZFCONTACTUSINQUERYOPTIONS`;\r\n public getCacheObjectType = () => 'SZFCONTACTUSINQUERYOPTIONS';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetInqueryOptionsData {\r\n status: boolean,\r\n data: any[] | undefined,\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInqueryOptionInput = (args: Msdyn365.ICreateActionContext,token:string): Msdyn365.IActionInput => {\r\n return new GetInqueryOptionsInput(token);\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function getInqueryOptionsDataAction(input: GetInqueryOptionsInput, ctx: Msdyn365.IActionContext): Promise {\r\n const token = input.token;\r\n const szfCRMDomain = ctx.requestContext.app.config.szfCRMDomain;\r\n const response = await Msdyn365.sendRequest(`${szfCRMDomain}/api/data/v9.2//szf_casetypes?$select=szf_name,szf_arabic`, \"get\", {}, {\r\n headers: {\r\n 'Authorization':`Bearer ${token}`\r\n }\r\n });\r\n if(response && response.data && response.data.value && response.data.value.length > 0){\r\n return {\r\n status: true,\r\n data: response.data.value\r\n };\r\n }else{\r\n return {\r\n status: false,\r\n data: undefined\r\n };\r\n }\r\n\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: 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 { text: 'Static data from action' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getInqueryOptionsDataAction,\r\n // TODO: Give your data action a unique id\r\n id: 'GetInqueryOptions',\r\n input: createInqueryOptionInput\r\n // TODO: 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 * PostContactUsForm Input Action\r\n */\r\n\r\nimport { IPostContactUsFormInput } from './../modules/szf-contact-us/szf-contact-us.view';\r\nexport class PostContactUsFormInput implements Msdyn365.IActionInput {\r\n public Inquiry:string;\r\n public description: string;\r\n public email: string;\r\n public firstName: string;\r\n public lastName: string;\r\n public phone: string;\r\n // public termNcondition: boolean;\r\n public updateNpromotion: boolean;\r\n public fileBase64Code: string | ArrayBuffer | null | undefined;\r\n public file: File | undefined | null;\r\n public token: string | undefined;\r\n public contactID: string | undefined;\r\n constructor(\r\n data:IPostContactUsFormInput,\r\n file: File | undefined | null,\r\n fileBase64Code: string | ArrayBuffer | null | undefined,\r\n CRMtoken: string | undefined,\r\n contactID: string | undefined\r\n ) {\r\n this.Inquiry = data.Inquiry;\r\n this.description = data.description;\r\n this.email = data.email;\r\n this.firstName = data.firstName;\r\n this.lastName = data.lastName;\r\n this.phone = `+${data.countryCode}${data.phone}`;\r\n // this.termNcondition = data.termNcondition;\r\n this.updateNpromotion = data.updateNpromotion;\r\n this.file = file;\r\n this.fileBase64Code = fileBase64Code;\r\n this.token = CRMtoken;\r\n this.contactID = contactID;\r\n }\r\n // TODO: 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 = () => `CONTACTUSFORM`;\r\n public getCacheObjectType = () => 'CONTACTUSFORM';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IPostContactUsFormData {\r\n status: boolean;\r\n msg:string | undefined;\r\n id: string | undefined;\r\n}\r\n\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst contactFormInput = (args: Msdyn365.ICreateActionContext,inputData:IPostContactUsFormInput,file: File | undefined | null,fileBase64Code: string | ArrayBuffer | null | undefined , CRMtoken: string | undefined, contactID:string|undefined ): Msdyn365.IActionInput => {\r\n return new PostContactUsFormInput(inputData,file,fileBase64Code,CRMtoken,contactID);\r\n};\r\n\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function contactFormDataAction(input: PostContactUsFormInput, ctx: Msdyn365.IActionContext): Promise {\r\n try{\r\n const token = input.token;\r\n const szfCRMDomain = ctx.requestContext.app.config.szfCRMDomain;\r\n let data = {};\r\n if(input.file && input.file.name){\r\n data = {\r\n \"title\" : `Case by {${input.firstName} ${input.lastName}_${input.email}}`,\r\n \"customerid_contact@odata.bind\": `/contacts(${input.contactID})`, //Contact, to be replaced by contact created\r\n \"szf_CaseType@odata.bind\": `/szf_casetypes(${input.Inquiry})`, //Get case type first, then replace it with the ID\r\n \"caseorigincode\":3, //Website, will remain hardcoded\r\n \"prioritycode\": 2, //Normal, will remain hardcoded\r\n \"szf_description\":`${input.description}`, // Details of case\r\n \"Incident_Annotation\":[{ //File\r\n \"filename\" :`${input.file?.name}`,\r\n \"isdocument\" : true,\r\n \"subject\":`${input.file?.name}`,\r\n \"documentbody\" : `${input.fileBase64Code}`\r\n }]\r\n };\r\n }else{\r\n data = {\r\n \"title\" : `Case by {${input.firstName} ${input.lastName}_${input.email}}`,\r\n \"customerid_contact@odata.bind\": `/contacts(${input.contactID})`, //Contact, to be replaced by contact created\r\n \"szf_CaseType@odata.bind\": `/szf_casetypes(${input.Inquiry})`, //Get case type first, then replace it with the ID\r\n \"caseorigincode\":3, //Website, will remain hardcoded\r\n \"prioritycode\": 2, //Normal, will remain hardcoded\r\n \"szf_description\":`${input.description}`, // Details of case\r\n };\r\n }\r\n \r\n const response = await Msdyn365.sendRequest(`${szfCRMDomain}/api/data/v9.2//incidents`, \"post\", data, {\r\n timeout: 15000,\r\n headers: {\r\n 'Prefer': 'return=representation',\r\n 'Authorization':`Bearer ${token}`,\r\n 'Content-Type': 'application/json'\r\n }\r\n });\r\n if(response && response.data && response.data.incidentid){\r\n return {\r\n status: true,\r\n msg: 'success',\r\n id: response.data.incidentid\r\n };\r\n }else if (response && response.data && response.data.error){\r\n return {\r\n status: false,\r\n msg: response.data.error.message,\r\n id: undefined\r\n };\r\n }else{\r\n return {\r\n status: false,\r\n msg: undefined,\r\n id: undefined\r\n };\r\n }\r\n }catch(error){\r\n return {\r\n status: false,\r\n id: undefined,\r\n msg: 'Something went wrong, Please try again later.'\r\n };\r\n }\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >contactFormDataAction,\r\n // TODO: Give your data action a unique id\r\n id: 'PostContactUsForm',\r\n input: contactFormInput\r\n // TODO: 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 { INewContactCreation } from './../modules/szf-contact-us/szf-contact-us.view';\r\n/**\r\n * PostNewContact Input Action\r\n */\r\nexport class PostNewContactInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public token: string;\r\n public firstName: string;\r\n public lastName: string;\r\n public email: string;\r\n public phone: string;\r\n public countryCode: string;\r\n public updateNpromotion: boolean;\r\n constructor(token:string,data:INewContactCreation) {\r\n this.token= token;\r\n this.email= data.email;\r\n this.firstName= data.firstName;\r\n this.lastName= data.lastName;\r\n this.phone= data.phone;\r\n this.countryCode= data.countryCode;\r\n this.updateNpromotion= data.updateNpromotion;\r\n }\r\n\r\n // TODO: 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 = () => `SZFCREATECONTACT`;\r\n public getCacheObjectType = () => 'SZFCREATECONTACT';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IPostNewContactData {\r\n status: boolean;\r\n msg:string | undefined;\r\n id: string | undefined;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createNewContactInput = (args: Msdyn365.ICreateActionContext,token:string, inputData:INewContactCreation): Msdyn365.IActionInput => {\r\n return new PostNewContactInput(token, inputData);\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function createNewContactDataAction(input: PostNewContactInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n const token = input.token;\r\n const szfCRMDomain = ctx.requestContext.app.config.szfCRMDomain;\r\n const data = {\r\n \"firstname\": input.firstName,\r\n \"lastname\": input.lastName,\r\n \"emailaddress1\": input.email,\r\n \"szf_mblregion\": input.countryCode,\r\n \"szf_mbllocalnumber\": input.phone,\r\n \"donotsendmm\": !input.updateNpromotion\r\n };\r\n const response = await Msdyn365.sendRequest(`${szfCRMDomain}/api/data/v9.2//contacts`, \"post\", data, {\r\n headers: {\r\n 'Prefer': 'return=representation',\r\n 'MSCRM.SuppressDuplicateDetection': 'false',\r\n 'Authorization':`Bearer ${token}`,\r\n 'Content-Type': 'application/json'\r\n }\r\n });\r\n if(response && response.data && response.data.contactid){\r\n return {\r\n status: true,\r\n msg: 'success',\r\n id: response.data.contactid\r\n };\r\n }else if (response && response.data && response.data.error){\r\n return {\r\n status: false,\r\n msg: response.data.error.message,\r\n id: undefined\r\n };\r\n }else{\r\n return {\r\n status: false,\r\n msg: undefined,\r\n id: undefined\r\n };\r\n }\r\n // TODO: 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 { text: 'Static data from action' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >createNewContactDataAction,\r\n // TODO: Give your data action a unique id\r\n id: 'PostNewContact',\r\n input: createNewContactInput\r\n // TODO: 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 React from 'react';\r\n\r\nimport { ISzfContactUsData } from './szf-contact-us.data';\r\nimport { ISzfContactUsProps } from './szf-contact-us.props.autogenerated';\r\n\r\nexport interface ISzfContactUsViewProps extends ISzfContactUsProps {}\r\n\r\n/**\r\n *\r\n * SzfContactUs component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass SzfContactUs extends React.PureComponent> {\r\n public render(): JSX.Element | null {\r\n return this.props.renderView(this.props);\r\n }\r\n}\r\n\r\nexport default SzfContactUs;\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 React from 'react';\r\nimport * as MsDyn365 from '@msdyn365-commerce/core';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { ISzfContactUsViewProps } from './szf-contact-us';\r\nimport {\r\n Form,\r\n Input,\r\n FormGroup,\r\n Label,\r\n Button,\r\n FormFeedback,\r\n // Spinner,\r\n InputGroup,\r\n // InputGroup\r\n} from 'reactstrap';\r\nimport { MoonLoader } from 'react-spinners';\r\nimport contactFormDataAction, { PostContactUsFormInput } from './../../actions/post-contact-us-form.action';\r\n\r\nimport getInqueryOptionsDataAction, { GetInqueryOptionsInput } from './../../actions/get-inquery-options.action';\r\nimport existingContactDataAction, { GetExistingContactInput } from './../../actions/get-existing-contact.action';\r\nimport createNewContactDataAction, { PostNewContactInput } from './../../actions/post-new-contact.action';\r\nimport SZFModal from '../../utilities/szf-modal.component';\r\nimport PhoneInput from 'react-phone-input-2';\r\nimport arabicLocale from 'react-phone-input-2/lang/ar.json';\r\nexport interface IPostContactUsFormInput {\r\n Inquiry: string;\r\n InquiryInvalid: boolean;\r\n description: string;\r\n descriptionInvalid: boolean;\r\n email: string;\r\n emailInvalid: boolean;\r\n firstName: string;\r\n firstNameInvalid: boolean;\r\n lastName: string;\r\n lastNameInvalid: boolean;\r\n phone: string;\r\n countryCode: string;\r\n phoneInvalid: boolean;\r\n fileInvalid: boolean;\r\n // termNcondition: boolean;\r\n updateNpromotion: boolean;\r\n}\r\nexport interface INewContactCreation {\r\n firstName: string;\r\n lastName: string;\r\n email: string;\r\n phone: string;\r\n countryCode: string;\r\n updateNpromotion: boolean;\r\n}\r\nexport interface IcountryCodeInput {\r\n countryCode: string;\r\n dialCode: string;\r\n format: string;\r\n name: string;\r\n}\r\nexport interface IInqueryOptions {\r\n szf_casetypeid: string;\r\n szf_name: string;\r\n}\r\n\r\nexport default (props: ISzfContactUsViewProps) => {\r\n const [loading, setLoading] = React.useState(false);\r\n const [state, setState] = React.useState({\r\n firstName: '',\r\n firstNameInvalid: false,\r\n lastName: '',\r\n lastNameInvalid: false,\r\n email: '',\r\n emailInvalid: false,\r\n phone: '',\r\n countryCode: '',\r\n phoneInvalid: false,\r\n Inquiry: '',\r\n InquiryInvalid: false,\r\n description: '',\r\n descriptionInvalid: false,\r\n fileInvalid: false,\r\n // termNcondition: false,\r\n updateNpromotion: false,\r\n });\r\n const [isModalOpen, setIsModalOpen] = React.useState(false);\r\n const [contactUsError, setContactUsError] = React.useState('');\r\n const fileRef = React.useRef(null);\r\n const [inquiryOptionsData, setInquiryOptionsData] = React.useState<(IInqueryOptions | null)[]>();\r\n const [file, setFile] = React.useState();\r\n const [fileBase64Code, setFileBase64Code] = React.useState();\r\n const inquiryOptions = props.config.inquiryOptions;\r\n const locale = props.context.request.locale;\r\n // const termAndConditionCheckboxLabel = props.config.termAndConditionCheckboxLabel;\r\n const updateAndPromotionCheckboxLabel = props.config.updateAndPromotionCheckboxLabel;\r\n const successImageProps = {\r\n gridSettings: props.context.request.gridSettings ?? {},\r\n imageSettings: props.config.successModalImage?.imageSettings,\r\n };\r\n const failureImageProps = {\r\n gridSettings: props.context.request.gridSettings ?? {},\r\n imageSettings: props.config.failModalImage?.imageSettings,\r\n };\r\n const imageContainer = { className: 'ms-content-block__image' };\r\n const successImage = (\r\n \r\n \r\n \r\n );\r\n const failureImage = (\r\n \r\n \r\n \r\n );\r\n\r\n // const cuCountryCodeOptions = props.config.cuCountryCodeOptions;\r\n const {\r\n firstnameLabel,\r\n lastnameLabel,\r\n emailLabel,\r\n phoneLabel,\r\n inquirySelectLabel,\r\n descriptionLabel,\r\n fileLabel,\r\n submitButtonLabel,\r\n } = props.config;\r\n const {\r\n genericErrorMessage,\r\n invalidOrEmptyFieldError,\r\n dropdownChooseOptionMessage,\r\n maxFileSize,\r\n fileInvalidMessage,\r\n szfSuccessModalHeading,\r\n szfSuccessModalMessage,\r\n szfFailModalHeading,\r\n descriptionInvalidMessage,\r\n } = props.resources;\r\n const fileSize = props.config.fileSize || 20;\r\n const fileSizeKB = fileSize * 1024;\r\n const handleUpdateAndPromotionLabelChange = (event: MsDyn365.ContentEditableEvent) =>\r\n (props.config.updateAndPromotionCheckboxLabel = event.target.value);\r\n // const handleTermAndConditionLabelChange = (event: MsDyn365.ContentEditableEvent) => (props.config.termAndConditionCheckboxLabel = event.target.value);\r\n const updateAndPromotionLabel = updateAndPromotionCheckboxLabel && (\r\n \r\n );\r\n // const termAndConditionCheckboxText = termAndConditionCheckboxLabel && (\r\n // \r\n // );\r\n const fetchInqueryOptions = React.useCallback(async () => {\r\n try {\r\n const CRMtoken = (await props.data.crmToken)?.token || undefined;\r\n const input = new GetInqueryOptionsInput(CRMtoken);\r\n const result = await getInqueryOptionsDataAction(input, props.context.actionContext);\r\n const inquiryOptionsLowercase = inquiryOptions?.map((item) => {\r\n return item.toLowerCase();\r\n });\r\n if (result.data && result.data.length > 0) {\r\n const filteredResult: (IInqueryOptions | null)[] = result.data\r\n .map((item) => {\r\n if (locale.toLowerCase() === 'ar-ae') {\r\n if (inquiryOptionsLowercase?.includes(item.szf_arabic.toLowerCase())) {\r\n return {\r\n szf_casetypeid: item.szf_casetypeid,\r\n szf_name: item.szf_arabic,\r\n };\r\n } else {\r\n return null;\r\n }\r\n } else {\r\n if (inquiryOptionsLowercase?.includes(item.szf_name.toLowerCase())) {\r\n return {\r\n szf_casetypeid: item.szf_casetypeid,\r\n szf_name: item.szf_name,\r\n };\r\n } else {\r\n return null;\r\n }\r\n }\r\n })\r\n .filter((i) => i);\r\n setInquiryOptionsData(filteredResult);\r\n }\r\n }catch(error){\r\n console.log(error);\r\n }\r\n }, []);\r\n React.useEffect(() => {\r\n fetchInqueryOptions();\r\n }, []);\r\n const onChangeHandler = (e: React.ChangeEvent) => {\r\n const name: string = e.target.name;\r\n const value = e.target.value;\r\n\r\n if (name === 'email') {\r\n const emailPattern: RegExp = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}$/i;\r\n if (emailPattern.test(value)) {\r\n const obj = { ...state, [name]: value, emailInvalid: false };\r\n setState(obj);\r\n } else {\r\n const obj = { ...state, [name]: value, emailInvalid: true };\r\n setState(obj);\r\n }\r\n } else if (name === 'phone') {\r\n const obj = { ...state, [name]: value, phoneInvalid: false };\r\n setState(obj);\r\n } else {\r\n const obj = { ...state, [name]: value };\r\n setState(obj);\r\n }\r\n };\r\n const getbase64 = (imagefile: File) => {\r\n const reader = new FileReader();\r\n reader.readAsDataURL(imagefile);\r\n reader.onload = () => {\r\n const result = reader.result;\r\n const base64 = result?.toString().split('base64,');\r\n setFileBase64Code(base64 && base64[1]);\r\n };\r\n };\r\n const handleFileChange = (e: React.ChangeEvent) => {\r\n if (e.target.files) {\r\n if (e.target.files[0] && e.target.files[0].size / 1024 > fileSizeKB) {\r\n setState({ ...state, fileInvalid: true });\r\n } else {\r\n setState({ ...state, fileInvalid: false });\r\n const imagefile = e.target.files[0];\r\n if (imagefile) {\r\n getbase64(imagefile);\r\n setFile(imagefile);\r\n }\r\n }\r\n }\r\n };\r\n const handleCheckboxChange = (e: any) => {\r\n const name: string = e.target.name;\r\n setState({ ...state, [name]: !state.updateNpromotion });\r\n };\r\n const checkExistingContact = async (token: string, email: string, phone: string) => {\r\n const contactExistInput = new GetExistingContactInput(token, email, phone);\r\n const result = await existingContactDataAction(contactExistInput, props.context.actionContext);\r\n return result;\r\n };\r\n const resetFileField = () => {\r\n setState({\r\n ...state,\r\n fileInvalid: false,\r\n });\r\n if (fileRef.current && fileRef.current.value) {\r\n fileRef.current.value = '';\r\n }\r\n setFile(undefined);\r\n setFileBase64Code(null);\r\n };\r\n const resetForm = () => {\r\n setState({\r\n firstName: '',\r\n firstNameInvalid: false,\r\n lastName: '',\r\n lastNameInvalid: false,\r\n email: '',\r\n emailInvalid: false,\r\n phone: '',\r\n countryCode: '971',\r\n phoneInvalid: false,\r\n Inquiry: '',\r\n InquiryInvalid: false,\r\n description: '',\r\n descriptionInvalid: false,\r\n fileInvalid: false,\r\n // termNcondition: false,\r\n updateNpromotion: false,\r\n });\r\n\r\n if (fileRef.current && fileRef.current.value) {\r\n fileRef.current.value = '';\r\n }\r\n setFile(undefined);\r\n setFileBase64Code(null);\r\n setContactUsError('');\r\n };\r\n const toggleModal = () => {\r\n setIsModalOpen(!isModalOpen);\r\n };\r\n const onSubmitForm = async (e: any): Promise => {\r\n e.preventDefault();\r\n const emailPattern: RegExp = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}$/i;\r\n if (state.firstName.length <= 0) {\r\n setState({ ...state, firstNameInvalid: true });\r\n setLoading(false);\r\n document.getElementById('firstName')?.focus();\r\n return;\r\n } else if (state.lastName.length <= 0) {\r\n setState({\r\n ...state,\r\n firstNameInvalid: false,\r\n lastNameInvalid: true,\r\n });\r\n setLoading(false);\r\n document.getElementById('lastName')?.focus();\r\n return;\r\n } else if (state.email.length <= 0 || !emailPattern.test(state.email)) {\r\n setState({\r\n ...state,\r\n firstNameInvalid: false,\r\n lastNameInvalid: false,\r\n emailInvalid: true,\r\n });\r\n setLoading(false);\r\n document.getElementById('email')?.focus();\r\n return;\r\n } else if (!state.phone || state.phone.length < 4 || state.phone.length > 20) {\r\n setState({\r\n ...state,\r\n firstNameInvalid: false,\r\n lastNameInvalid: false,\r\n phoneInvalid: true,\r\n });\r\n setLoading(false);\r\n document.getElementById('phone')?.focus();\r\n return;\r\n } else if (state.Inquiry.length <= 0) {\r\n setState({\r\n ...state,\r\n firstNameInvalid: false,\r\n lastNameInvalid: false,\r\n emailInvalid: false,\r\n phoneInvalid: false,\r\n InquiryInvalid: true,\r\n });\r\n setLoading(false);\r\n document.getElementById('Inquiry')?.focus();\r\n return;\r\n } else if (state.description.length <= 0 || state.description.length >= 300) {\r\n setState({\r\n ...state,\r\n firstNameInvalid: false,\r\n lastNameInvalid: false,\r\n emailInvalid: false,\r\n phoneInvalid: false,\r\n InquiryInvalid: false,\r\n descriptionInvalid: true,\r\n });\r\n setLoading(false);\r\n document.getElementById('description')?.focus();\r\n return;\r\n } else if (file && file?.size && file.size / 1024 > fileSizeKB) {\r\n setState({\r\n ...state,\r\n firstNameInvalid: false,\r\n lastNameInvalid: false,\r\n emailInvalid: false,\r\n phoneInvalid: false,\r\n InquiryInvalid: false,\r\n descriptionInvalid: false,\r\n fileInvalid: true,\r\n });\r\n setLoading(false);\r\n fileRef?.current?.focus();\r\n return;\r\n } else {\r\n setState({\r\n ...state,\r\n firstNameInvalid: false,\r\n lastNameInvalid: false,\r\n emailInvalid: false,\r\n phoneInvalid: false,\r\n InquiryInvalid: false,\r\n descriptionInvalid: false,\r\n fileInvalid: false,\r\n });\r\n }\r\n const mergePhoneWithCountryCode = `${state.countryCode}${state.phone}`;\r\n try {\r\n const CRMtoken = (await props.data.crmToken)?.token || undefined;\r\n const isContactAlreadyExist = await checkExistingContact(CRMtoken, state.email, mergePhoneWithCountryCode);\r\n if (isContactAlreadyExist.status) {\r\n const createCaseInput = new PostContactUsFormInput(state, file, fileBase64Code, CRMtoken, isContactAlreadyExist.id);\r\n const createCaseResponse = await contactFormDataAction(createCaseInput, props.context.actionContext);\r\n if (createCaseResponse.status) {\r\n resetForm();\r\n setLoading(false);\r\n setIsModalOpen(true);\r\n } else {\r\n setContactUsError(createCaseResponse.msg || genericErrorMessage);\r\n setLoading(false);\r\n setIsModalOpen(true);\r\n }\r\n } else {\r\n const createInputData: INewContactCreation = {\r\n firstName: state.firstName,\r\n lastName: state.lastName,\r\n email: state.email,\r\n phone: `${state.phone}`,\r\n countryCode: `${state.countryCode}`,\r\n updateNpromotion: state.updateNpromotion,\r\n };\r\n const createContactInput = new PostNewContactInput(CRMtoken, createInputData);\r\n const createNewContactResponse = await createNewContactDataAction(createContactInput, props.context.actionContext);\r\n if (createNewContactResponse.status) {\r\n const createCaseInput = new PostContactUsFormInput(state, file, fileBase64Code, CRMtoken, createNewContactResponse.id);\r\n const createCaseResponse = await contactFormDataAction(createCaseInput, props.context.actionContext);\r\n if (createCaseResponse.status) {\r\n resetForm();\r\n setLoading(false);\r\n setIsModalOpen(true);\r\n } else {\r\n setLoading(false);\r\n setContactUsError(createCaseResponse?.msg || genericErrorMessage);\r\n setIsModalOpen(true);\r\n }\r\n } else {\r\n setLoading(false);\r\n setContactUsError(createNewContactResponse.msg ? createNewContactResponse.msg : genericErrorMessage);\r\n setIsModalOpen(true);\r\n }\r\n }\r\n setLoading(false);\r\n } catch (error) {\r\n setContactUsError(genericErrorMessage);\r\n setLoading(false);\r\n setIsModalOpen(true);\r\n console.log('error', error);\r\n }\r\n };\r\n const handlePhoneCountryCodeOnChange = (value: string, country: IcountryCodeInput) => {\r\n const numberWithoutCountryCode = value.toString().split(`${country.dialCode}`);\r\n setState({\r\n ...state,\r\n phone: numberWithoutCountryCode[1],\r\n countryCode: country.dialCode,\r\n });\r\n };\r\n return (\r\n <>\r\n
\r\n

{props.resources.contactUsParagraph}

\r\n \r\n

{contactUsError ? szfFailModalHeading : szfSuccessModalHeading}

\r\n \r\n \r\n }\r\n modalBody={\r\n isModalOpen ? (\r\n
\r\n {contactUsError ? failureImage : successImage}\r\n

{contactUsError ? contactUsError : szfSuccessModalMessage}

\r\n
\r\n ) : null\r\n }\r\n />\r\n
\r\n \r\n ) => {\r\n onChangeHandler(event);\r\n }}\r\n className='form-control'\r\n invalid={state.firstNameInvalid}\r\n required\r\n />\r\n \r\n {invalidOrEmptyFieldError && invalidOrEmptyFieldError}\r\n \r\n \r\n ) => {\r\n onChangeHandler(event);\r\n }}\r\n className='form-control'\r\n invalid={state.lastNameInvalid}\r\n required\r\n />\r\n \r\n {invalidOrEmptyFieldError && invalidOrEmptyFieldError}\r\n \r\n \r\n ) => {\r\n onChangeHandler(event);\r\n }}\r\n className='form-control'\r\n required\r\n invalid={state.emailInvalid}\r\n />\r\n \r\n {invalidOrEmptyFieldError && invalidOrEmptyFieldError}\r\n \r\n
\r\n {' '}\r\n \r\n {locale.toLowerCase() === 'ar-ae' ? (\r\n \r\n ) : (\r\n \r\n )}\r\n {state.phoneInvalid && (\r\n
\r\n {state.phoneInvalid && invalidOrEmptyFieldError && invalidOrEmptyFieldError}\r\n
\r\n )}\r\n
\r\n \r\n ) => {\r\n onChangeHandler(event);\r\n }}\r\n className='form-control'\r\n invalid={state.InquiryInvalid}\r\n required\r\n >\r\n {inquiryOptions && inquiryOptions.length > 0 && (\r\n \r\n )}\r\n {inquiryOptionsData &&\r\n inquiryOptionsData?.map((optionItem, i) => {\r\n return (\r\n <>\r\n \r\n \r\n );\r\n })}\r\n \r\n \r\n {invalidOrEmptyFieldError && invalidOrEmptyFieldError}\r\n \r\n \r\n ) => {\r\n onChangeHandler(event);\r\n }}\r\n invalid={state.descriptionInvalid}\r\n className='form-control'\r\n required\r\n />\r\n \r\n {descriptionInvalidMessage && descriptionInvalidMessage}\r\n \r\n \r\n \r\n ) => {\r\n handleFileChange(event);\r\n }}\r\n invalid={state.fileInvalid}\r\n className='form-control contact-us-file'\r\n />\r\n {\r\n resetFileField();\r\n }}\r\n >\r\n x\r\n \r\n \r\n {maxFileSize && (\r\n
\r\n
\r\n \r\n
\r\n

{maxFileSize}

\r\n
\r\n )}\r\n {fileInvalidMessage && fileInvalidMessage}\r\n
\r\n
\r\n \r\n \r\n \r\n {\r\n setLoading(true);\r\n onSubmitForm(e);\r\n }}\r\n disabled={loading}\r\n >\r\n {loading && (\r\n <>\r\n \r\n \r\n )}\r\n {submitButtonLabel && submitButtonLabel}\r\n \r\n \r\n
\r\n \r\n );\r\n};\r\n","import React from 'react';\r\nimport { Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\n\r\ninterface ISZFModalProps {\r\n isOpen: boolean;\r\n onModalToggle?: (e?: React.MouseEvent) => void;\r\n className: string;\r\n modalTitle?: React.ReactNode;\r\n modalBody?: React.ReactNode;\r\n modalFooter?: React.ReactNode;\r\n}\r\n\r\nexport default function SZFModal(props: ISZFModalProps) {\r\n const { isOpen, onModalToggle, className, modalTitle, modalBody, modalFooter } = props;\r\n\r\n return (\r\n \r\n {modalTitle && {modalTitle}}\r\n {modalBody && {modalBody}}\r\n {modalFooter && {modalFooter}}\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 (binding.modules['szf-contact-us'] = {\n c: () => require('partner/modules/szf-contact-us/szf-contact-us.tsx'),\n $type: 'contentModule',\n da: [{name:'crmToken', path:'actions/get-crm-token.action', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'szf-contact-us',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/szf-contact-us'\n });\n \n\n {\n const sanitizedActionPath = 'actions/get-crm-token.action';\n let dataAction = require('partner/actions/get-crm-token.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|szf-contact-us|szf-contact-us'] = {\n c: () => require('partner/modules/szf-contact-us/szf-contact-us.view.tsx'),\n cn: '__local__-__local__-szf-contact-us'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["GetCrmTokenInput","constructor","getCacheKey","getCacheObjectType","dataCacheType","Msdyn365","action","async","input","ctx","szfCRMDomain","szfCRMClientSecret","requestContext","app","config","data","qs","response","headers","status","token","access_token","id","args","GetExistingContactInput","email","phone","this","value","length","contactid","undefined","createExistingContactInput","GetInqueryOptionsInput","createInqueryOptionInput","PostContactUsFormInput","file","fileBase64Code","CRMtoken","contactID","Inquiry","description","firstName","lastName","countryCode","updateNpromotion","_input$file","_input$file2","name","timeout","incidentid","msg","error","message","contactFormInput","inputData","PostNewContactInput","createNewContactInput","SzfContactUs","React","render","props","renderView","_props$context$reques","_props$config$success","_props$context$reques2","_props$config$failMod","_props$config$success2","_props$config$failMod2","loading","setLoading","state","setState","firstNameInvalid","lastNameInvalid","emailInvalid","phoneInvalid","InquiryInvalid","descriptionInvalid","fileInvalid","isModalOpen","setIsModalOpen","contactUsError","setContactUsError","fileRef","inquiryOptionsData","setInquiryOptionsData","setFile","setFileBase64Code","inquiryOptions","locale","context","request","updateAndPromotionCheckboxLabel","successImageProps","gridSettings","imageSettings","successModalImage","failureImageProps","failModalImage","imageContainer","className","successImage","Node","Object","assign","MsDyn365","preserveImageSpace","editProps","key","moduleType","typeName","imagePropertyName","moduleId","shouldSkipToMainImage","failureImage","firstnameLabel","lastnameLabel","emailLabel","phoneLabel","inquirySelectLabel","descriptionLabel","fileLabel","submitButtonLabel","genericErrorMessage","invalidOrEmptyFieldError","dropdownChooseOptionMessage","maxFileSize","fileInvalidMessage","szfSuccessModalHeading","szfSuccessModalMessage","szfFailModalHeading","descriptionInvalidMessage","resources","fileSizeKB","fileSize","updateAndPromotionLabel","text","onEdit","event","target","fetchInqueryOptions","_await$props$data$crm","crmToken","result","getInqueryOptionsDataAction","actionContext","inquiryOptionsLowercase","map","item","toLowerCase","filteredResult","includes","szf_arabic","szf_casetypeid","szf_name","filter","i","console","log","onChangeHandler","e","test","obj","_objectSpread","handleFileChange","files","size","imagefile","reader","FileReader","readAsDataURL","onload","base64","toString","split","getbase64","resetForm","current","toggleModal","onSubmitForm","preventDefault","_document$getElementB","_document$getElementB2","_document$getElementB3","_document$getElementB4","_document$getElementB5","_document$getElementB6","_fileRef$current","document","getElementById","focus","mergePhoneWithCountryCode","_await$props$data$crm2","isContactAlreadyExist","contactExistInput","existingContactDataAction","checkExistingContact","createCaseInput","createCaseResponse","contactFormDataAction","createInputData","createContactInput","createNewContactResponse","createNewContactDataAction","handlePhoneCountryCodeOnChange","country","numberWithoutCountryCode","dialCode","contactUsParagraph","SZFModal","isOpen","onModalToggle","modalTitle","onClick","src","alt","modalBody","Form","onSubmit","FormGroup","floating","Input","type","placeholder","onChange","invalid","required","Label","for","FormFeedback","PhoneInput","inputProps","enableAreaCodes","localization","arabicLocale","inputClass","autoFormat","enableSearch","optionItem","InputGroup","innerRef","Button","check","defaultChecked","checked","handleCheckboxChange","disabled","MoonLoader","color","modalFooter","Modal","zIndex","applicationNode","autoFocus","toggle","ModalHeader","ModalBody","ModalFooter","binding","modules","dataActions","c","require","$type","da","path","runOn","iNM","ns","n","p","pdp","md","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","window","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}