/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
/******/ (function() { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ "./admin/assets/js/components/pixelio_cart_abandon_recovery_more_admin_progress_bar.js":
/*!*********************************************************************************************!*\
  !*** ./admin/assets/js/components/pixelio_cart_abandon_recovery_more_admin_progress_bar.js ***!
  \*********************************************************************************************/
/***/ (function() {

eval("jQuery(document).ready(function ($) {\n  var steps = 1;\n  var maxSteps = parseInt($(\".pixelio-cart-abandon-recovery-more-progress-bar-container\").attr(\"max_step\"));\n  $(\".pixelio-cart-abandon-recovery-more-step-next\").hide();\n  $(\".pixelio-cart-abandon-recovery-more-step-\" + steps).show();\n  $(\".pixelio-cart-abandon-recovery-more-step-back\").hide();\n  for (var i = 2; i <= maxSteps; i++) {\n    $(\".pixelio-cart-abandon-recovery-more-step-\" + i).hide();\n  }\n  function setProgress(percent) {\n    $('.pixelio-cart-abandon-recovery-more-progress-fill').css('width', percent + '%');\n    $('.pixelio-cart-abandon-recovery-more-progress-text').text(percent + '%');\n  }\n  function nextStep() {\n    $(\".pixelio-cart-abandon-recovery-more-step-\" + steps).hide();\n    steps++;\n    if (steps > 1) {\n      $(\".pixelio-cart-abandon-recovery-more-step-back\").show();\n    }\n    if ($(\".step-\" + steps).data('step-state') == 1) {\n      $(\".pixelio-cart-abandon-recovery-more-step-next\").show();\n    } else {\n      $(\".pixelio-cart-abandon-recovery-more-step-next\").hide();\n    }\n    setProgress(parseInt(steps * (100 / (maxSteps + 1))));\n    $(\".pixelio-cart-abandon-recovery-more-step-\" + steps).show();\n  }\n  function backStep() {\n    $(\".pixelio-cart-abandon-recovery-more-step-\" + steps).hide();\n    steps--;\n    if (steps === 1) {\n      $(\".pixelio-cart-abandon-recovery-more-step-back\").hide();\n    }\n    if ($(\".pixelio-cart-abandon-recovery-more-step-\" + steps).data('step-state') == 1) {\n      $(\".pixelio-cart-abandon-recovery-more-step-next\").show();\n    } else {\n      $(\".pixelio-cart-abandon-recovery-more-step-next\").hide();\n    }\n    setProgress(parseInt(steps * (100 / (maxSteps + 1))));\n    $(\".pixelio-cart-abandon-recovery-more-step-\" + steps).show();\n  }\n  window.nextStep = nextStep;\n  window.backStep = backStep;\n  setProgress(parseInt(100 / (maxSteps + 1)));\n  $(\".pixelio-cart-abandon-recovery-more-step-back\").on('click', function (e) {\n    e.preventDefault();\n    backStep();\n  });\n  $(\".pixelio-cart-abandon-recovery-more-step-next\").on('click', function (e) {\n    e.preventDefault();\n    nextStep();\n  });\n});\n\n//# sourceURL=webpack://pixelio-cart-abandon-recovery-more/./admin/assets/js/components/pixelio_cart_abandon_recovery_more_admin_progress_bar.js?");

/***/ }),

/***/ "./admin/assets/js/components/pixelio_cart_abandon_recovery_more_loader_spinner.js":
/*!*****************************************************************************************!*\
  !*** ./admin/assets/js/components/pixelio_cart_abandon_recovery_more_loader_spinner.js ***!
  \*****************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   PixelioCartAbandonRecoveryMoreLoaderSpinner: function() { return /* binding */ PixelioCartAbandonRecoveryMoreLoaderSpinner; }\n/* harmony export */ });\nclass PixelioCartAbandonRecoveryMoreLoaderSpinner {\n  constructor() {\n    const self = this;\n  }\n  showPixelioLoader() {\n    const overlay = document.getElementById(\"pixelio-cart-abandon-recovery-more-loader-overlay\");\n    overlay.style.display = \"flex\";\n  }\n  hidePixelioLoader() {\n    const overlay = document.getElementById(\"pixelio-cart-abandon-recovery-more-loader-overlay\");\n    overlay.style.display = \"none\";\n  }\n}\n\n//# sourceURL=webpack://pixelio-cart-abandon-recovery-more/./admin/assets/js/components/pixelio_cart_abandon_recovery_more_loader_spinner.js?");

/***/ }),

/***/ "./admin/assets/js/components/pixelio_cart_abandon_recovery_more_update_popup.js":
/*!***************************************************************************************!*\
  !*** ./admin/assets/js/components/pixelio_cart_abandon_recovery_more_update_popup.js ***!
  \***************************************************************************************/
/***/ (function() {

eval("(function ($) {\n  const STORAGE_KEY = 'pixelio_update_popup_hidden_until';\n  $(document).on('click', '.pixelio-cart-abandon-recovery-more-close-update-popup', function (e) {\n    e.preventDefault();\n    localStorage.setItem(STORAGE_KEY, Date.now() + 60 * 60 * 1000 // 1 heure\n    );\n    $('#pixelio-cart-abandon-recovery-more-update-popup-container').fadeOut(200);\n  });\n  $(function () {\n    const hiddenUntil = parseInt(localStorage.getItem(STORAGE_KEY) || '0', 10);\n    if (hiddenUntil > Date.now()) {\n      $('#pixelio-cart-abandon-recovery-more-update-popup-container').hide();\n    }\n  });\n})(jQuery);\n\n//# sourceURL=webpack://pixelio-cart-abandon-recovery-more/./admin/assets/js/components/pixelio_cart_abandon_recovery_more_update_popup.js?");

/***/ }),

/***/ "./admin/assets/js/pages/pixelio_cart_abandon_recovery_more_admin_first.js":
/*!*********************************************************************************!*\
  !*** ./admin/assets/js/pages/pixelio_cart_abandon_recovery_more_admin_first.js ***!
  \*********************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _components_pixelio_cart_abandon_recovery_more_loader_spinner__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/pixelio_cart_abandon_recovery_more_loader_spinner */ \"./admin/assets/js/components/pixelio_cart_abandon_recovery_more_loader_spinner.js\");\n/* harmony import */ var _components_pixelio_cart_abandon_recovery_more_admin_progress_bar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/pixelio_cart_abandon_recovery_more_admin_progress_bar */ \"./admin/assets/js/components/pixelio_cart_abandon_recovery_more_admin_progress_bar.js\");\n/* harmony import */ var _components_pixelio_cart_abandon_recovery_more_admin_progress_bar__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_components_pixelio_cart_abandon_recovery_more_admin_progress_bar__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _components_pixelio_cart_abandon_recovery_more_update_popup__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/pixelio_cart_abandon_recovery_more_update_popup */ \"./admin/assets/js/components/pixelio_cart_abandon_recovery_more_update_popup.js\");\n/* harmony import */ var _components_pixelio_cart_abandon_recovery_more_update_popup__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_components_pixelio_cart_abandon_recovery_more_update_popup__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\njQuery(function ($) {\n  var spinner = new _components_pixelio_cart_abandon_recovery_more_loader_spinner__WEBPACK_IMPORTED_MODULE_0__.PixelioCartAbandonRecoveryMoreLoaderSpinner();\n  if (pixelioData.has_api_key) {\n    if (typeof window.nextStep === 'function') {\n      window.nextStep();\n    }\n  }\n  $('.pixelio-cart-abandon-recovery-more-email-choice-tags .pixelio-cart-abandon-recovery-more-tag').on('click', function (e) {\n    e.preventDefault();\n    var $tag = $(this);\n    $('.pixelio-cart-abandon-recovery-more-email-choice-tags .pixelio-cart-abandon-recovery-more-tag').removeClass('pixelio-cart-abandon-recovery-more-selected');\n    $tag.addClass('pixelio-cart-abandon-recovery-more-selected');\n    window.nextStep();\n  });\n  var $cards = $('.pixelio-cart-abandon-recovery-more-card-without-next-button');\n  $cards.on('click', function (e) {\n    e.preventDefault();\n    var $card = $(this);\n    $cards.removeClass('pixelio-cart-abandon-recovery-more-selected');\n    $card.addClass('pixelio-cart-abandon-recovery-more-selected');\n    window.nextStep();\n    var level = $(\".pixelio-cart-abandon-recovery-more-step-2 .pixelio-cart-abandon-recovery-more-selected\").data(\"value\");\n  });\n  $('.pixelio-cart-abandon-recovery-more-email-choice-tags span').hover(function () {\n    var mode = $(this).data('mode');\n    $('.pixelio-cart-abandon-recovery-more-' + mode + '-description').removeClass('pixelio-cart-abandon-recovery-more-hide-it');\n  }, function () {\n    var mode = $(this).data('mode');\n    $('.pixelio-cart-abandon-recovery-more-' + mode + '-description').addClass('pixelio-cart-abandon-recovery-more-hide-it');\n  });\n  function reactivateFinalizeButton() {\n    $(this).prop('disabled', false);\n  }\n  $('#pixelio-cart-abandon-recovery-more-finish-config').on('click', function (e) {\n    e.preventDefault();\n    $(this).prop('disabled', true);\n    var allSelected = true;\n    $('.steps').each(function () {\n      if ($(this).find('.pixelio-cart-abandon-recovery-more-tag.pixelio-cart-abandon-recovery-more-selected, .pixelio-cart-abandon-recovery-more-card.pixelio-cart-abandon-recovery-more-selected').length === 0) {\n        allSelected = false;\n        $(this).addClass('step-error');\n      } else {\n        $(this).removeClass('step-error');\n      }\n    });\n    var shopType = $(\"#pixelio-cart-abandon-recovery-more-pixelio-shop-type\").val();\n    if (!shopType) {\n      alert(pixelioData.selectShopType);\n      $(this).prop('disabled', false);\n      return;\n    }\n    if (!allSelected) {\n      alert(pixelioData.selectOptionEachStep);\n      $(this).prop('disabled', false);\n      return;\n    }\n    const checkbox = document.getElementById('pixelio-cart-abandon-recovery-more-term-of-use');\n    if (checkbox && !checkbox.checked) {\n      alert(pixelioData.acceptTermOfUse);\n      $(this).prop('disabled', false);\n      return;\n    }\n    var apiKey = pixelioData.apiKey;\n    var configData = {\n      typeOfUse: $(\".pixelio-cart-abandon-recovery-more-step-3 .pixelio-cart-abandon-recovery-more-selected\").data(\"mode\"),\n      level: $(\".pixelio-cart-abandon-recovery-more-step-2 .pixelio-cart-abandon-recovery-more-selected\").data(\"value\"),\n      isUe: $('#pixelio-cart-abandon-recovery-more-ue').is(':checked') ? '1' : '0',\n      pixelioTermOfUse: $('#pixelio-cart-abandon-recovery-more-term-of-use').is(':checked') ? '1' : '0',\n      pixelioTermOfUseConsentDescription: $('#pixelio-cart-abandon-recovery-more-term-of-use').parent().find('label').html(),\n      analyseConsentDescription: \"NOT USED\",\n      shopType: shopType,\n      language: pixelioData.language\n    };\n    spinner.showPixelioLoader();\n    var button = this;\n    // Appel AJAX à l'API externe\n    $.ajax({\n      url: pixelioData.apiUrl + 'first-config',\n      method: 'POST',\n      contentType: 'application/json',\n      headers: {\n        'x-api-key': apiKey\n      },\n      data: JSON.stringify(configData),\n      success: function (response) {\n        if (response.configuration && response.level_json) {\n          var settings = response.level_json;\n          $.ajax({\n            url: ajaxurl,\n            method: 'POST',\n            dataType: 'json',\n            data: {\n              value: JSON.stringify(settings),\n              config: 'done',\n              shopType: shopType,\n              is_ia: $(\".pixelio-cart-abandon-recovery-more-step-3 .pixelio-cart-abandon-recovery-more-selected\").data(\"mode\"),\n              action: 'pixelio_save_json_options',\n              _ajax_nonce: pixelioData.nonce\n            },\n            success: function () {\n              reactivateFinalizeButton.call(button);\n              spinner.hidePixelioLoader();\n              window.location.href = 'admin.php?page=rivio-ai-cart-recovery-marketing-email-automation';\n            },\n            error: function (err) {\n              alert(pixelioData.wpServerError);\n              $(this).prop('disabled', false);\n              spinner.hidePixelioLoader();\n            }\n          });\n        } else {\n          spinner.hidePixelioLoader();\n          alert(pixelioData.invalidConfig);\n          reactivateFinalizeButton.call(button);\n        }\n      },\n      error: function (err) {\n        spinner.hidePixelioLoader();\n        alert(pixelioData.wpServerError);\n        reactivateFinalizeButton.call(button);\n      }\n    });\n  });\n\n  // Vérification du domaine\n  $('#pixelio-cart-abandon-recovery-more-verify-domain').on('click', function (e) {\n    e.preventDefault();\n    var domain = $('#pixelio-cart-abandon-recovery-more-domain').val().trim();\n    var email = $('#pixelio-cart-abandon-recovery-more-email').val().trim();\n    var $resultDiv = $('#pixelio-cart-abandon-recovery-more-verification-result');\n    $resultDiv.html('<span style=\"color:blue;\">' + pixelioData.verifyingDomain + '</span>');\n    if (!domain) {\n      $resultDiv.html('<span style=\"color:red;\">' + pixelioData.enterDomain + '</span>');\n      return;\n    }\n    $.ajax({\n      url: ajaxurl,\n      type: 'POST',\n      dataType: 'json',\n      data: {\n        action: 'pixelio_verify_domain',\n        domain: domain,\n        email: email,\n        _ajax_nonce: pixelioData.nonce\n      },\n      success: function (response) {\n        if (response.success) {\n          $resultDiv.html('<span style=\"color:green;\">' + response.data.message + '</span>');\n          $(\"#pixelio-cart-abandon-recovery-more-domain\").prop('disabled', true);\n          $(\".pixelio-cart-abandon-recovery-more-step-1\").data('step-state', 1);\n          $(\"#pixelio-cart-abandon-recovery-more-verify-domain\").prop('disabled', true);\n          window.location.reload();\n        } else {\n          $resultDiv.html('<span style=\"color:red;\">' + response.data + '</span>');\n          if (response.data.solution) {\n            $resultDiv.append('<br><small>Solution: ' + response.data.solution + '</small>');\n          }\n        }\n      },\n      error: function () {\n        $resultDiv.html('<span style=\"color:red;\">' + pixelioData.unexpectedError + '</span>');\n      }\n    });\n  });\n});\n\n//# sourceURL=webpack://pixelio-cart-abandon-recovery-more/./admin/assets/js/pages/pixelio_cart_abandon_recovery_more_admin_first.js?");

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	!function() {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = function(exports) {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	}();
/******/ 	
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module can't be inlined because the eval devtool is used.
/******/ 	var __webpack_exports__ = __webpack_require__("./admin/assets/js/pages/pixelio_cart_abandon_recovery_more_admin_first.js");
/******/ 	
/******/ })()
;