{"3602":{"id":3602,"date":"2023-04-24T06:41:56.000Z","source":null,"paywall":{"id":3615,"date":"2023-04-24T06:41:56.000Z","url_callback":null,"redirect_active":null,"landing_page":"","widget":8801,"metered":"0","metered_hard":null,"duration":null,"type_paywall":null,"message":"\u003cdiv class=\"QiotaPaywallModalContent QiotaPaywall--adblock\"\u003e\n    \u003cdiv class=\"QiotaPaywallContent\"\u003e\n\n        \u003cdiv class=\"QiotaPaywallContent-headLine\"\u003eVous utilisez un bloqueur de publicités\u003c/div\u003eMagicmaman est en partie financé par la publicité.\u003cbr\u003e\n        Pour soutenir notre rédaction et vous offrir les meilleurs contenus, veuillez choisir une des deux options suivantes :\n\n        \u003cdiv class=\"QiotaPaywallContent-twoColumns\"\u003e\n            \u003cdiv class=\"QiotaPaywallContent-column\"\u003e\n                Je désactive mon adblock pour recharger la page\n            \u003c/div\u003e\n            \u003cdiv class=\"QiotaPaywallContent-column\"\u003e\n                Je fournis mon mail pour recevoir les newsletters de Magicmaman et je continue ma navigation avec mon adblocker activé\n\n                \u003cform id=\"qiota_newsletter\" class=\"QiotaPaywallForm\"\u003e\n \u003cdiv id=\"confirmmessage\"\u003e\u003c/div\u003e\n                    \u003cdiv class=\"QiotaPaywallForm-error error\" style=\"display:none;\"\u003e\u003c/div\u003e\n                    \u003cdiv class=\"QiotaPaywallForm-error success\" style=\"display:none;\"\u003e\u003c/div\u003e\n                    \u003cinput type=\"email\" name=\"email\" placeholder=\"Votre adresse email\" class=\"QiotaPaywallForm-emailAddressField\"\u003e\n                    \u003cinput type=\"submit\" value=\"Je m'inscris\" class=\"QiotaPaywallForm-submitButton Button\"\u003e\n                    \u003cinput type=\"hidden\" name=\"optinmarket\" value=\"0\"\u003e\u003cinput type=\"hidden\" name=\"optinconsent\" value=\"1\"\u003e\n                    \u003cinput type=\"hidden\" name=\"newsletterId\" value=\"59\"\u003e\n                \u003c/form\u003e\n            \u003c/div\u003e\n        \u003c/div\u003e\n\n    \u003c/div\u003e\n\u003c/div\u003e\n\n\u003cscript\u003e\nconsole.log('mc2m - render adblock notification');\n\n  function MC2MQiotaGetCookie(name)\n  {\n    var cookie = document.cookie.split('; ').find(function (c) {return c.startsWith(name+'=')});\n    if (cookie != null) {\n      return cookie.split('=')[1];\n    }\n  }\n\n  function MC2MQiotaSetCookie(name, value, days)\n  {\n    var expires = '';\n    if (days != null) {\n      expires = ';expires='+(new Date(Date.now() + (days * 24 * 3600000)).toUTCString())\n    }\n    document.cookie = name+'='+value+expires+';path=/;samesite=lax';\n  }\n\n  var MC2MQiotaAdBlockCookieName = 'MC2MQiotaAdBlock';\n\n\n  if (\n    typeof(MC2MQiotaGetCookie(MC2MQiotaAdBlockCookieName)) === 'undefined'\n    \u0026\u0026 typeof(MC2MQiotaPaywall) !== 'undefined'\n  )\n  {\n    MC2MQiotaPaywall.init('modal', {allowClose: false});\n  }\n  else\n  {\n    document.getElementsByClassName('qiota_onboard')[0].style.display = 'none';\n  }\n\n  (function (token)\n  {\n    var form = document.getElementById('qiota_newsletter');\n\n    function MC2MQiotaGetInputValue(name) {\n      var input = form.querySelector('input[name=\"'+name+'\"]');\n      return (input != null) ? (['checkbox','radio'].indexOf(input.type) \u003e= 0) ? input.checked : input.value : null;\n    }\n\n    if (form != null)\n    {\n      var errorElem = form.querySelector('.error');\n      var successElem = form.querySelector('.success');\n\n      form.addEventListener('submit', function (e)\n      {\n        e.preventDefault();\n\n        document.querySelector(\".AdBlockModal .Modal-container\").classList.add(\"is-loading\");\n\n        xhr = new XMLHttpRequest();\n        xhr.open('POST', 'https://www.qiota.com/api/v1/prospects', true);\n        xhr.setRequestHeader('Content-type', 'application/json');\n        xhr.setRequestHeader('Authorization', 'Token token=' + token);\n        xhr.onload = function () {\n          if (this.status === 200) {\n            var response = JSON.parse(this.response);\n            if (response.error)\n            {\n              document.querySelector(\".AdBlockModal .Modal-container\").classList.remove(\"is-loading\");\n\n              errorElem.innerHTML = response.error;\n              errorElem.style.display = 'block';\n              successElem.style.display = 'none';\n\n              // Pose du cookie\n              MC2MQiotaSetCookie(MC2MQiotaAdBlockCookieName, 1, 30);\n              // Fermeture de la modal\n              hideModal('.js-adblockModal', {forceClose: true});\n            }\n            else\n            {\n              var siteXHR = new XMLHttpRequest();\n              siteXHR.open('POST', 'https://www.magicmaman.com/direct/partners/qiota', true);\n              siteXHR.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n              siteXHR.onload = function () {\n                if (this.status === 200) {\n                  var response = JSON.parse(this.response);\n                  console.log('mc2m - response', response);\n\n                  document.querySelector(\".AdBlockModal .Modal-container\").classList.remove(\"is-loading\");\n\n                  if (response.status == \"success\")\n                  {\n                    // Pose du cookie\n                    MC2MQiotaSetCookie(MC2MQiotaAdBlockCookieName, 1, 30);\n                    // Fermeture de la modal\n                    hideModal('.js-adblockModal', {forceClose: true});\n                  }\n                }\n                return false;\n              };\n              var info = btoa(JSON.stringify({\n                newsletterId: MC2MQiotaGetInputValue('newsletterId')\n              }));\n              siteXHR.send(\"widget=newsletter\u0026info=\" + info + \"\u0026uid=\" + response.uid + \"\u0026no_redirect=1\u0026call_type=notification\u0026source=popup_adblock\u0026email=\" + response.email);\n\n              // successElem.innerHTML = 'Merci pour votre inscription à notre newsletter !';\n              // successElem.style.display = 'block';\n              // errorElem.style.display = 'none';\n              // form.style.display = 'none';\n            }\n          }\n          return false;\n        };\n\n        var data = {\n          prospect: {\n            token: token,\n            referer: q_ressource_uri, \n            id_scenario: \"3602\",\n            email: MC2MQiotaGetInputValue('email'),\n            name: MC2MQiotaGetInputValue('name'),\n            lastname: MC2MQiotaGetInputValue('lastname'),\n            optinnews: MC2MQiotaGetInputValue('optinnews'),\n            optinconsent: MC2MQiotaGetInputValue('optinconsent'),\n            optinmarket: MC2MQiotaGetInputValue('optinmarket')\n          }\n        };\n        xhr.send(JSON.stringify(data));\n\n\n       return false;\n      });\n    }\n  })(q_token);\n\u003c/script\u003e","message_hard":"","notification_free_post":"","css_class":null,"rate_display":0,"module_mode":null,"sha384":"sha384-MvXscnn9VoRBzir7ZwRIVY2MMvZD7GRaT4p5sAMIArs7ubT1CANYlL8CGM2tHhy3"},"tags":null,"urls":null,"ex_tags":null,"ex_urls":null,"devices":0,"nbview":0,"period":0,"days_week":null,"time_start":null,"time_end":null,"adblocking":true,"cookies":null,"is_logged":null,"scenario_child":null,"data_layer":null,"number_view_paywall":null,"priority":null,"filters":"null"}}