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AACD,EAAKK,EAAQ5B,EAAO,KAAMyB,EAAkB,QACxD,IAAII,EAAU,CACVD,SACAE,QAAS,CACL,yBAA0BC,KAAKC,UAC3BC,OAAOC,SAASC,iBAGxBC,YAAa,WAKjB,GAHIX,IACAI,EAAQQ,OAASZ,EAAgBY,QAEtB,QAAXT,EAAkB,CAClBC,EAAU,IACHA,EACHS,KAAMtC,EAAO+B,KAAKC,UAAUhC,GAAQ,KACpC8B,QAAS,IACFD,EAAQC,QACX,eAAgB,qBAIxB,MAAMS,EAAQN,OAAOO,aAAaC,QAAQ,4BACtCF,IACAV,EAAU,IACHA,EACHC,QAAS,IACFD,EAAQC,QACXY,yBAA0BH,IAI1C,CAGA,OADuB,WAAY,IAAII,QAAQ,IAAMV,OAAOW,MAAQA,EAAAA,IAC9CrB,EAAKM,GAASzB,KAAKyC,EAAa,EAGpDA,EAAgBxC,IAClB,GAAIA,EAASyC,QAAU,KAAOzC,EAASyC,OAAS,IAC5C,OAAOzC,EACJ,CACH,IAAI0C,EAAQ,IAAIC,MAAM3C,EAAS4C,YAE/B,MADAF,EAAM1C,SAAWA,EACX0C,CACV,E","sources":["webpack:///./Scripts/Components/Blocks/ContactBlock.js","webpack:///./Scripts/Services/Contact.service.js","webpack:///./Scripts/Services/http.js"],"sourcesContent":["import React, { useState } from 'react';\nimport { useForm, SubmitHandler } from 'react-hook-form';\nimport { translate } from '../../Services/translation';\nimport { submitContactForm } from '../../Services/Contact.service';\n\nconst ContactBlock = ({\n id,\n title,\n text,\n fineprint,\n successTitle,\n successText,\n contactBlockBackgroundColor,\n contactBlockSuccessTitleTextColor,\n contactBlockSuccessTextColor,\n contactBlockTitleColor,\n contactBlockTextColor,\n contactBlockHeaderTextColor,\n contactBlockTextInputBackgroundColor,\n contactBlockTextInputTextColor,\n contactBlockButtonBackgroundColor,\n contactBlockButtonTextColor,\n }) => {\n const [success, setSuccess] = useState(false);\n const [loading, setLoading] = useState(false);\n\n const {\n register,\n handleSubmit,\n formState: { errors },\n } = useForm();\n\n const onSubmit = (data) => {\n setLoading(true);\n submitContactForm(data).then(response => {\n setSuccess(true);\n }).catch(() => {\n alert(translate('blocks.contact.submit.error'));\n }).finally(() => {\n setLoading(false);\n });\n };\n\n useForm({\n defaultValues: {\n subject: '',\n email: '',\n name: '',\n phone: '',\n id: id,\n message: '',\n },\n });\n\n return (\n
\n
\n
\n
\n {\n success ?\n
\n \n \n \n \n \n \n \n \n \n \n \n \n

{successTitle}

\n

{successText}

\n
\n :\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n

{title}

\n

{text}

\n
\n
\n
\n
\n \n
\n {translate('blocks.contact.subject')}\n \n {errors.subject && {errors.subject.message}}\n
\n
\n {translate('blocks.contact.name')}\n \n
\n
\n {translate('blocks.contact.email')}\n {errors.email && {errors.email.message}}\n
\n
\n {translate('blocks.contact.phone')}\n \n
\n \n {translate('blocks.contact.message')}\n \n\n {errors.message && {errors.message.message}}\n\n
\n

\n
\n \n
\n
\n \n
\n }\n
\n
\n
\n \n );\n};\n\nexport default ContactBlock;","import { get, post } from './http';\nimport { format } from 'date-fns';\nimport { camelCase } from '../Reducers/Error.reducer';\nimport { error as formatError } from '../Reducers/Error.reducer';\n\nexport const submitContactForm = async (data) => {\n return await post(\n `/api/contact`, {\n email: data.email,\n message: data.message,\n subject: data.subject,\n name: data.name,\n phone: data.phone,\n id: data.id,\n }\n )\n};","import { fetch } from 'whatwg-fetch';\n\nexport const get = (url) => _fetch(url, 'GET');\n\nexport const post = (url, data, abortController = null) =>\n _fetch(url, 'POST', data, abortController);\nexport const put = (url, data, abortController = null) =>\n _fetch(url, 'PUT', data, abortController);\nexport const patch = (url, data, abortController = null) =>\n _fetch(url, 'PATCH', data, abortController);\nexport const remove = (url, data, abortController = null) =>\n _fetch(url, 'DELETE', data, abortController);\n\nconst _fetch = (url, method, data = null, abortController = null) => {\n let options = {\n method,\n headers: {\n 'litium-request-context': JSON.stringify(\n window.__litium.requestContext\n ),\n },\n credentials: 'include',\n };\n if (abortController) {\n options.signal = abortController.signal;\n }\n if (method !== 'GET') {\n options = {\n ...options,\n body: data ? JSON.stringify(data) : null,\n headers: {\n ...options.headers,\n 'content-type': 'application/json',\n },\n };\n\n const token = window.localStorage.getItem('requestVerificationToken');\n if (token) {\n options = {\n ...options,\n headers: {\n ...options.headers,\n RequestVerificationToken: token,\n },\n };\n }\n }\n // use native browser implementation if it supports aborting\n const abortableFetch = 'signal' in new Request('') ? window.fetch : fetch;\n return abortableFetch(url, options).then(_checkStatus);\n};\n\nconst _checkStatus = (response) => {\n if (response.status >= 200 && response.status < 300) {\n return response;\n } else {\n let error = new Error(response.statusText);\n error.response = response;\n throw error;\n }\n};\n"],"names":["ContactBlock","id","title","text","fineprint","successTitle","successText","contactBlockBackgroundColor","contactBlockSuccessTitleTextColor","contactBlockSuccessTextColor","contactBlockTitleColor","contactBlockTextColor","contactBlockHeaderTextColor","contactBlockTextInputBackgroundColor","contactBlockTextInputTextColor","contactBlockButtonBackgroundColor","contactBlockButtonTextColor","success","setSuccess","useState","loading","setLoading","register","handleSubmit","formState","errors","useForm","defaultValues","subject","email","name","phone","message","React","className","style","background","width","height","viewBox","fill","xmlns","clipPath","d","stroke","strokeWidth","strokeLinecap","strokeLinejoin","color","onSubmit","data","async","post","submitContactForm","then","response","catch","alert","translate","finally","_extends","defaultValue","type","required","autoComplete","pattern","value","rows","dangerouslySetInnerHTML","__html","disabled","onClick","get","url","_fetch","abortController","put","remove","method","options","headers","JSON","stringify","window","__litium","requestContext","credentials","signal","body","token","localStorage","getItem","RequestVerificationToken","Request","fetch","_checkStatus","status","error","Error","statusText"],"sourceRoot":""}