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,CACFe,SAAU,OACVyB,WAAY,MACZvB,MAAO,UACP4B,WAAY,kCACd,WAECrC,GAGP,CAEO,SAASD,EAASnB,CAAQ,KAAR,CAAEoB,KAAAA,CAAI,CAAE,CAARpB,EACvB,MACE,GAAAwD,EAAAnD,GAAA,EAACoB,EAAAA,CAAUA,CAAAA,CACTC,QAAQ,KACRd,GAAI,CAAEe,SAAU,OAAQyB,WAAY,MAAOvB,MAAO,SAAU,WAE3DT,GAGP,CAwBO,SAASsC,EAAU1D,CAAQ,KAAR,CAAEoB,KAAAA,CAAI,CAAE,CAARpB,EACxB,MACE,GAAAwD,EAAAnD,GAAA,EAACoB,EAAAA,CAAUA,CAAAA,CACTC,QAAQ,QACRd,GAAI,CAAEe,SAAU,OAAQyB,WAAY,MAAOvB,MAAO,UAAW8B,GAAI,KAAM,WAEtEvC,GAGP,4CC3EA,IAAIwC,EAAyBC,EAAQ,MAIrCC,CAAAA,EAAAA,CAAe,CAAG,KAAK,EACvB,IAAIC,EAAiBH,EAAuBC,EAAQ,QAChDG,EAAcH,EAAQ,MACtBI,EAAW,CAAC,EAAGF,EAAeG,OAAO,EAAiB,GAAGF,EAAY3D,GAAG,EAAE,OAAQ,CACpF8D,EAAG,sHACL,GAAI,cACJL,CAAAA,EAAAA,CAAe,CAAGG","sources":["webpack://_N_E/?fc26","webpack://_N_E/./lib/ValidateCertificateAPI.js","webpack://_N_E/./app/validate-certificate/page.js","webpack://_N_E/./components/Common/HeadingText.js","webpack://_N_E/./node_modules/@mui/icons-material/CheckCircle.js","webpack://_N_E/"],"sourcesContent":["import(/* webpackMode: \"eager\" */ \"/codebuild/output/src4243223962/src/EbWebsiteProd/app/validate-certificate/page.js\")","//\"use server\";\nconst API = process.env.NEXT_PUBLIC_API_URL;\nimport getHeaders from \"./APIHeaders\";\n\nexport async function validateCertificateForm(data,hostname) {\n const headers = await getHeaders(hostname);\n const res = await fetch(API + `/validate-certificate`, {\n headers,\n method: \"POST\",\n body: JSON.stringify(data),\n })\n .then((response) => response.json())\n .then((data) => {\n return data;\n });\n\n return res;\n}\n","\"use client\";\nimport React, { useState } from \"react\";\nimport { Heading2 } from \"@/components/Common/HeadingText\";\nimport Navbar from \"@/components/Navbar\";\nimport { theme } from \"@/components/theme\";\nimport {\n Box,\n Button,\n Card,\n TextField,\n ThemeProvider,\n Typography,\n} from \"@mui/material\";\nimport { useFormik } from \"formik\";\nimport * as Yup from \"yup\";\n\nimport dynamic from \"next/dynamic\";\nimport { validateCertificateForm } from \"@/lib/ValidateCertificateAPI\";\n\nimport CancelIcon from \"@mui/icons-material/Cancel\";\nimport CheckCircleIcon from \"@mui/icons-material/CheckCircle\";\n\nconst Footer = dynamic(() => import(\"@/components/Footer\"));\n\nconst ValidateCertificate = () => {\n const [validMessage, setValidMessage] = useState(null);\n const [certNum, setCertNum] = useState(null);\n const formik = useFormik({\n initialValues: {\n certificateNumber: null,\n userName: null,\n emailId: null\n },\n validationSchema: Yup.object({\n certificateNumber: Yup.string()\n .matches(/^\\S*$/, \"Certificate number cannot contain spaces\")\n .required(\"Required certificateNumber\"),\n userName: Yup.string().required(\"Required userName\"),\n emailId: Yup.string().required(\"Required emailId\"),\n }),\n onSubmit: (values, { resetForm }) => {\n handleSubmitForm(values);\n },\n });\n\n const handleSubmitForm = async (values) => {\n const response = await validateCertificateForm(\n values,\n window.location.hostname\n );\n if (response.response) {\n setValidMessage(true);\n setCertNum(values.certificateNumber);\n } else {\n setValidMessage(false);\n }\n };\n return (\n
\n \n \n \n \n \n \n {validMessage === true ? (\n \n \n The certificate {certNum + \" \"} is Valid certificate\n \n ) : validMessage === false ? (\n \n \n Invalid Certificate\n \n ) : null}\n\n {validMessage === null && (\n

\n Please Enter the certificate number and username to validate\n the certificate.\n

\n )}\n
\n \n \n
\n

\n \n \n {formik.touched.userName && formik.errors.userName ? (\n
{formik.errors.userName}
\n ) : null}\n\n\n

\n

\n \n \n {formik.touched.emailId && formik.errors.emailId ? (\n
{formik.errors.emailId}
\n ) : null}\n\n

\n

\n \n {\n const valueWithoutSpaces = e.target.value.replace(/\\s/g, \"\"); // Remove spaces\n formik.setFieldValue(\"certificateNumber\", valueWithoutSpaces); // Update Formik value\n }}\n variant=\"outlined\"\n sx={{ width: \"100%\" }}\n placeholder=\"Enter certificate number\"\n />\n

\n {formik.touched.certificateNumber &&\n formik.errors.certificateNumber ? (\n
\n {formik.errors.certificateNumber}\n
\n ) : null}\n\n \n Validate\n \n \n \n \n
\n \n
\n );\n};\n\nexport default ValidateCertificate;\n","import { Typography } from \"@mui/material\";\nimport React from \"react\";\n\nexport function HeroText1({ text }) {\n return (\n \n {text}\n \n );\n}\n\nexport function HeroText15({ text }) {\n return (\n \n {text}\n \n );\n}\n\nexport function Heading2({ text }) {\n return (\n \n {text}\n \n );\n}\n\nexport function Heading3({ text }) {\n return (\n \n {text}\n \n );\n}\n\nexport function Heading4({ text }) {\n return (\n \n {text}\n \n );\n}\n\nexport function Subtitle1({ text }) {\n return (\n \n {text}\n \n );\n}\n\nexport function Subtitle2({ text, colorCustom }) {\n return (\n \n {text}\n \n );\n}\n","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z\"\n}), 'CheckCircle');\nexports.default = _default;"],"names":["Promise","resolve","then","__webpack_require__","bind","validateCertificateForm","data","hostname","headers","getHeaders","fetch","API","method","body","JSON","stringify","response","json","Footer","dynamic","all","e","page","validMessage","setValidMessage","useState","certNum","setCertNum","formik","useFormik","initialValues","certificateNumber","userName","emailId","validationSchema","Yup","matches","required","onSubmit","values","resetForm","param","handleSubmitForm","window","location","jsx_runtime","jsx","main","jsxs","ThemeProvider","theme","Navbar","Box","sx","m","lg","xs","display","flexDirection","alignItems","Heading2","text","Card","p","mt","width","Typography","variant","fontSize","gap","color","CheckCircleIcon","CancelIcon","style","form","handleSubmit","br","label","TextField","name","value","onChange","handleChange","placeholder","touched","errors","div","valueWithoutSpaces","target","replace","setFieldValue","Button","type","fontWeight","cursor","textDecoration","HeroText15","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","textShadow","Subtitle1","my","_interopRequireDefault","require","exports","_createSvgIcon","_jsxRuntime","_default","default","d"],"sourceRoot":""}