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AAS,CAAG,OAAO,SAAS,EAAI,EAAE,CACzC,GAAG,UAAU,YAAa,AAA2B,kBAA3B,SAAS,QAAQ,CAAC,IAAI,CAAuB,8BAAgC,oCACvG,IAAI,CAAC,KAAK,GACV,OAAO,YAAY,CAAC,OAAO,CAAC,qBAAsB,CAAA,EACpD,EACF","sources":["","src/public/js/books.js"],"sourcesContent":["var $2d3d7fae96724346$exports = {};\ndocument.querySelector('.shadow-bg').addEventListener('click', function(e) {\n document.querySelector('.shadow-bg').classList.remove('active');\n document.querySelector('.modal').classList.remove('active');\n});\ndocument.querySelector('.close-popup').addEventListener('click', function(e) {\n document.querySelector('.modal').classList.remove('active');\n document.querySelector('.shadow-bg').classList.remove('active');\n});\nfunction $2d3d7fae96724346$var$submitForm(e) {\n e.preventDefault();\n const api = e.target.action;\n const formData = [\n ...new FormData(e.target).entries()\n ];\n let ycid = null;\n ym(49633516, 'getClientID', (clientID)=>{\n ycid = clientID;\n });\n const dataObject = formData.reduce((acc, [key, val])=>({\n ...acc,\n [key]: val\n }), {\n urlUtm: document.location.href,\n ycid: ycid\n });\n Object.keys(dataObject).forEach((key)=>{\n dataObject[key] = dataObject[key]?.toLowerCase()?.replaceAll('>', '>').replaceAll('<', '<').replaceAll('&', '&').replaceAll('eval', 'eval');\n });\n document.querySelector('.modal').classList.add('active');\n document.querySelector('.shadow-bg').classList.add('active');\n fetch(api, {\n method: 'post',\n body: JSON.stringify(dataObject),\n headers: {\n \"Content-Type\": \"application/json\"\n }\n }).then(()=>{\n window.dataLayer = window.dataLayer || [];\n ym(49633516, 'reachGoal', document.location.host === 'uxfeedback.ru' ? 'subscription_book_form_send' : 'test_subscription_book_form_send');\n this.reset();\n window.localStorage.setItem('isSubscribedToBook', true);\n });\n}\ndocument.querySelector('.bookSubscriptionForm').addEventListener('submit', $2d3d7fae96724346$var$submitForm);\n\n\n//# sourceMappingURL=books.9bc3f7f8.js.map\n","document.querySelector('.shadow-bg').addEventListener('click', function (e) {\n document.querySelector('.shadow-bg').classList.remove('active');\n document.querySelector('.modal').classList.remove('active');\n});\n\ndocument.querySelector('.close-popup').addEventListener('click', function (e) {\n document.querySelector('.modal').classList.remove('active');\n document.querySelector('.shadow-bg').classList.remove('active');\n});\n\nfunction submitForm (e) {\n e.preventDefault();\n const api = e.target.action;\n const formData = [...(new FormData(e.target).entries())];\n let ycid = null;\n\n ym(49633516, 'getClientID', clientID => { ycid = clientID });\n\n const dataObject = formData.reduce(\n (acc, [key, val]) => ({ ...acc, [key]: val }), \n { \n urlUtm: document.location.href,\n ycid,\n }\n );\n\n Object.keys(dataObject).forEach((key) => {\n dataObject[key] = dataObject[key]?.toLowerCase()?.replaceAll('>', '>')\n .replaceAll('<', '<')\n .replaceAll('&', '&')\n .replaceAll('eval', 'eval')\n });\n\n document.querySelector('.modal').classList.add('active');\n document.querySelector('.shadow-bg').classList.add('active');\n\n fetch(api, {\n method: 'post',\n body: JSON.stringify(dataObject),\n headers: {\n \"Content-Type\": \"application/json\"\n }\n }).then(() => {\n window.dataLayer = window.dataLayer || [];\n ym(49633516, 'reachGoal', document.location.host === 'uxfeedback.ru' ? 'subscription_book_form_send' : 'test_subscription_book_form_send');\n this.reset()\n window.localStorage.setItem('isSubscribedToBook', true); \n })\n};\n\ndocument.querySelector('.bookSubscriptionForm').addEventListener('submit', submitForm);\n"],"names":["document","querySelector","addEventListener","e","classList","remove","preventDefault","api","target","action","formData","FormData","entries","ycid","ym","clientID","dataObject","reduce","acc","key","val","urlUtm","location","href","Object","keys","forEach","toLowerCase","replaceAll","add","fetch","method","body","JSON","stringify","headers","then","window","dataLayer","host","reset","localStorage","setItem"],"version":3,"file":"books.9bc3f7f8.js.map"}