/*
 * 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/).
 */
/******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ "./includes/pdf-builder/editor/src/packages/constants.js":
/*!***************************************************************!*\
  !*** ./includes/pdf-builder/editor/src/packages/constants.js ***!
  \***************************************************************/
/***/ ((__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 */   YWPI_LICENCE: () => (/* binding */ YWPI_LICENCE),\n/* harmony export */   YWPI_LICENCE_URL: () => (/* binding */ YWPI_LICENCE_URL),\n/* harmony export */   YWPI_PREVIEW_IMAGE_URL: () => (/* binding */ YWPI_PREVIEW_IMAGE_URL),\n/* harmony export */   fontSizes: () => (/* binding */ fontSizes),\n/* harmony export */   positiveAmount: () => (/* binding */ positiveAmount),\n/* harmony export */   previewFee: () => (/* binding */ previewFee),\n/* harmony export */   previewOrder: () => (/* binding */ previewOrder),\n/* harmony export */   previewShipping: () => (/* binding */ previewShipping),\n/* harmony export */   templateURL: () => (/* binding */ templateURL),\n/* harmony export */   templates: () => (/* binding */ templates)\n/* harmony export */ });\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/hooks */ \"@wordpress/hooks\");\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__);\n\nvar __ = wp.i18n.__;\n/** global ywpi_pdf_template */\nvar YWPI_PREVIEW_IMAGE_URL = ywpi_pdf_template.preview_image_url;\nvar YWPI_LICENCE = (0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__.applyFilters)('ywpi_pdf_template_demo', ywpi_pdf_template.licence_key);\nvar YWPI_LICENCE_URL = ywpi_pdf_template.licence_url;\nvar templateURL = {\n  'baseURL': 'https://plugins.yithemes.com/resources/',\n  'folder': ywpi_pdf_template.slug + '/pdf-templates/',\n  'preview': 'preview/',\n  'content': 'content/',\n  'images': 'images/'\n};\nvar templates = ywpi_pdf_template.templates;\nvar previewOrder = ywpi_pdf_template.preview_products;\nvar previewFee = ywpi_pdf_template.preview_fee;\nvar previewShipping = ywpi_pdf_template.preview_shipping;\nvar positiveAmount = ywpi_pdf_template.credit_notes_positive_amounts;\nvar fontSizes = [{\n  name: __('Small'),\n  slug: 'small',\n  size: 13\n}, {\n  name: __('Medium'),\n  slug: 'medium',\n  size: 20\n}, {\n  name: __('Large'),\n  slug: 'large',\n  size: 36\n}, {\n  name: __('Extra Large'),\n  slug: 'extralarge',\n  size: 42\n}];\n\n//# sourceURL=webpack://yith-woocommerce-pdf-invoice-premium/./includes/pdf-builder/editor/src/packages/constants.js?");

/***/ }),

/***/ "./includes/pdf-builder/editor/src/pdf-templates/data/templates.js":
/*!*************************************************************************!*\
  !*** ./includes/pdf-builder/editor/src/pdf-templates/data/templates.js ***!
  \*************************************************************************/
/***/ ((__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 */   defaultTemplate: () => (/* binding */ defaultTemplate)\n/* harmony export */ });\nvar defaultTemplate = {\n  'id': 'default',\n  'preview': 'template_default.png',\n  'background': '',\n  'logo': '',\n  'content': '<!-- wp:columns {\"style\":{\"spacing\":{\"padding\":{\"top\":\"0px\",\"right\":\"0px\",\"bottom\":\"0px\",\"left\":\"0px\"}}}} -->\\n' + '<div class=\"wp-block-columns\" style=\"padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px\"><!-- wp:column -->\\n' + '<div class=\"wp-block-column\"><!-- wp:image {\"id\":439,\"width\":\"300px\",\"height\":\"98px\",\"sizeSlug\":\"medium\",\"linkDestination\":\"none\"} -->\\n' + '<figure class=\"wp-block-image size-medium is-resized\"><img src=\"https://plugins.yithemes.com/resources/yith-woocommerce-pdf-invoice/pdf-templates/images/default/logo.jpg\" alt=\"logo\" class=\"wp-image-439\" style=\"width:300px;height:98px\"/></figure>\\n' + '<!-- /wp:image --></div>\\n' + '<!-- /wp:column -->\\n' + '\\n' + '<!-- wp:column -->\\n' + '<div class=\"wp-block-column\"><!-- wp:paragraph {\"align\":\"right\",\"fontSize\":\"small\"} -->\\n' + '<p class=\"has-text-align-right has-small-font-size\"></p>\\n' + '<!-- /wp:paragraph --></div>\\n' + '<!-- /wp:column --></div>\\n' + '<!-- /wp:columns -->\\n' + '\\n' + '<!-- wp:columns -->\\n' + '<div class=\"wp-block-columns\"><!-- wp:column {\"width\":\"43%\"} -->\\n' + \"<div class=\\\"wp-block-column\\\" style=\\\"flex-basis:43%\\\"><!-- wp:yith/ywpi-customer-info {\\\"title\\\":\\\"<strong>Customer info:</strong><br><br>{{billing_first_name}} {{billing_last_name}}<br>{{billing_company}}<br>{{billing_address_1}}<br>{{billing_address_2}}<br>{{billing_city}}  {{billing_state}} {{billing_postcode}}<br>{{billing_country}}\\\",\\\"textAlign\\\":\\\"left\\\",\\\"className\\\":\\\"has-small-font-size\\\"} -->\\n\" + '<p class=\"wp-block-yith-ywpi-customer-info has-text-align-left has-small-font-size\"><strong>Customer info:</strong><br><br>{{billing_first_name}} {{billing_last_name}}<br>{{billing_company}}<br>{{billing_address_1}}<br>{{billing_address_2}}<br>{{billing_city}}  {{billing_state}} {{billing_postcode}}<br>{{billing_country}}</p>\\n' + '<!-- /wp:yith/ywpi-customer-info --></div>\\n' + '<!-- /wp:column -->\\n' + '\\n' + '<!-- wp:column {\"style\":{\"color\":{\"background\":\"#e5f3fa\"},\"spacing\":{\"padding\":{\"right\":\"20px\",\"left\":\"20px\"}}}} -->\\n' + \"<div class=\\\"wp-block-column has-background\\\" style=\\\"background-color:#e5f3fa;padding-right:20px;padding-left:20px\\\"><!-- wp:yith/ywpi-document-number {\\\"title\\\":\\\"<strong>Invoice #{{document_number}}</strong>\\\",\\\"textAlign\\\":\\\"center\\\"} -->\\n\" + '<p class=\"wp-block-yith-ywpi-document-number has-text-align-center\"><strong>Invoice #{{document_number}}</strong></p>\\n' + '<!-- /wp:yith/ywpi-document-number -->\\n' + '\\n' + '<!-- wp:columns -->\\n' + '<div class=\"wp-block-columns\"><!-- wp:column -->\\n' + '<div class=\"wp-block-column\"><!-- wp:paragraph {\"fontSize\":\"small\",\"margin\":{\"top\":\"0px\",\"left\":\"0px\",\"right\":\"0px\",\"bottom\":\"10px\"},\"paddingBlock\":{\"top\":\"0px\",\"left\":\"20px\",\"right\":\"0px\",\"bottom\":\"0px\"}} -->\\n' + '<p class=\"has-small-font-size\">Order number</p>\\n' + '<!-- /wp:paragraph --></div>\\n' + '<!-- /wp:column -->\\n' + '\\n' + '<!-- wp:column -->\\n' + '<div class=\"wp-block-column\"><!-- wp:yith/ywpi-order-number {\"title\":\"{{order_number}}\",\"textAlign\":\"right\",\"fontSize\":\"small\"} -->\\n' + '<p class=\"wp-block-yith-ywpi-order-number has-text-align-right has-small-font-size\">{{order_number}}</p>\\n' + '<!-- /wp:yith/ywpi-order-number --></div>\\n' + '<!-- /wp:column --></div>\\n' + '<!-- /wp:columns -->\\n' + '\\n' + '<!-- wp:columns -->\\n' + '<div class=\"wp-block-columns\"><!-- wp:column -->\\n' + '<div class=\"wp-block-column\"><!-- wp:paragraph {\"fontSize\":\"small\",\"margin\":{\"top\":\"0px\",\"left\":\"20px\",\"right\":\"0px\",\"bottom\":\"10px\"}} -->\\n' + '<p class=\"has-small-font-size\">Date</p>\\n' + '<!-- /wp:paragraph --></div>\\n' + '<!-- /wp:column -->\\n' + '\\n' + '<!-- wp:column -->\\n' + '<div class=\"wp-block-column\"><!-- wp:yith/ywpi-date {\"labelCurrentDate\":\"\",\"textAlign\":\"right\",\"className\":\"has-small-font-size\",\"style\":{\"color\":{\"text\":\"#000\"},\"spacing\":{\"padding\":{\"right\":\"0px\",\"left\":\"0px\",\"top\":\"0px\",\"bottom\":\"0px\"}}}} -->\\n' + '<div class=\"wp-block-yith-ywpi-date has-text-align-right has-small-font-size has-text-color\" style=\"color:#000;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px\"><span class=\"pdf_order_date_item\"></span> {{current_date}} </div>\\n' + '<!-- /wp:yith/ywpi-date --></div>\\n' + '<!-- /wp:column --></div>\\n' + '<!-- /wp:columns -->\\n' + '\\n' + '<!-- wp:columns -->\\n' + '<div class=\"wp-block-columns\"><!-- wp:column -->\\n' + '<div class=\"wp-block-column\"><!-- wp:paragraph {\"fontSize\":\"small\",\"margin\":{\"top\":\"0px\",\"left\":\"20px\",\"right\":\"0px\",\"bottom\":\"10px\"}} -->\\n' + '<p class=\"has-small-font-size\">Amount</p>\\n' + '<!-- /wp:paragraph --></div>\\n' + '<!-- /wp:column -->\\n' + '\\n' + '<!-- wp:column -->\\n' + '<div class=\"wp-block-column\"><!-- wp:yith/ywpi-order-amount {\"titleInvoice\":\"{{order_amount}}\",\"textAlign\":\"right\",\"fontSize\":\"small\"} -->\\n' + '<p class=\"wp-block-yith-ywpi-order-amount has-text-align-right has-small-font-size\">{{order_amount}}</p>\\n' + '<!-- /wp:yith/ywpi-order-amount --></div>\\n' + '<!-- /wp:column --></div>\\n' + '<!-- /wp:columns --></div>\\n' + '<!-- /wp:column --></div>\\n' + '<!-- /wp:columns -->\\n' + '\\n' + '<!-- wp:columns -->\\n' + '<div class=\"wp-block-columns\"><!-- wp:column -->\\n' + '<div class=\"wp-block-column\"><!-- wp:yith/ywpi-products-table {\"productWeight\":true,\"productDimensions\":true,\"regularPrice\":true,\"productSubtotalLabel\":\"Totale\",\"titlesFontSize\":14,\"itemsFontSize\":11} -->\\n' + '<div class=\"wp-block-yith-ywpi-products-table ywpi_template\"><table class=\"wp-block-yith-ywpi-products-table ywpi_template has-text-align-left has-small-font-size\" style=\"&amp; td{ color: #000000;border-bottom-color: #ffffff;font-size:11px;text-transform: none}\"><thead><tr><th class=\"wp-block-yith-ywpi-products-table\" colspan=\"2\" style=\"color:#2e2e2e;border-color:#cccccc;font-size:14px;text-transform:none\">Product</th><th class=\"wp-block-yith-ywpi-products-table\" style=\"color:#2e2e2e;border-color:#cccccc;font-size:14px;text-transform:none;text-align:right\">Qty</th><th class=\"wp-block-yith-ywpi-products-table\" style=\"color:#2e2e2e;border-color:#cccccc;font-size:14px;text-transform:none;text-align:right\">Regular price</th><th class=\"wp-block-yith-ywpi-products-table\" style=\"color:#2e2e2e;border-color:#cccccc;font-size:14px;text-transform:none;text-align:right\">Sale price</th><th class=\"wp-block-yith-ywpi-products-table\" style=\"color:#2e2e2e;border-color:#cccccc;font-size:14px;text-transform:none;text-align:right\">Price</th><th class=\"wp-block-yith-ywpi-products-table\" style=\"color:#2e2e2e;border-color:#cccccc;font-size:14px;text-transform:none;text-align:right\">Tax</th><th class=\"wp-block-yith-ywpi-products-table\" style=\"color:#2e2e2e;border-color:#cccccc;font-size:14px;text-transform:none;text-align:right\">Totale</th><th class=\"wp-block-yith-ywpi-products-table\" style=\"color:#2e2e2e;border-color:#cccccc;font-size:14px;text-transform:none;text-align:right\">Total (inc.tax)</th></tr></thead><tbody>##table_content</tbody></table></div>\\n' + '<!-- /wp:yith/ywpi-products-table --></div>\\n' + '<!-- /wp:column --></div>\\n' + '<!-- /wp:columns -->\\n' + '\\n' + '<!-- wp:columns -->\\n' + '<div class=\"wp-block-columns\"><!-- wp:column -->\\n' + '<div class=\"wp-block-column\"><!-- wp:spacer -->\\n' + '<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"></div>\\n' + '<!-- /wp:spacer --></div>\\n' + '<!-- /wp:column -->\\n' + '\\n' + '<!-- wp:column -->\\n' + '<div class=\"wp-block-column\"><!-- wp:yith/ywpi-products-totals {\"fontSize\":\"11px\",\"subtotalLabelFontSize\":\"13px\",\"totalFontSize\":\"15px\"} -->\\n' + '<div class=\"wp-block-yith-ywpi-products-totals order-totals-wrapper\" style=\"&amp; .order-totals td{ font-size:11px } &amp; .order-totals td.subtotal-label{ color: #000000; font-size:13px;} &amp; .order-totals .total-row td{ color: #000000; font-size:15px; font-weight:bold }\"><table class=\"order-totals\" autosize=\"1\" style=\"page-break-inside:avoid\"><tbody>##table_totals</tbody></table></div>\\n' + '<!-- /wp:yith/ywpi-products-totals --></div>\\n' + '<!-- /wp:column --></div>\\n' + '<!-- /wp:columns -->\\n' + '\\n' + '<!-- wp:paragraph -->\\n' + '<p></p>\\n' + '<!-- /wp:paragraph -->'\n};\n\n//# sourceURL=webpack://yith-woocommerce-pdf-invoice-premium/./includes/pdf-builder/editor/src/pdf-templates/data/templates.js?");

/***/ }),

/***/ "./includes/pdf-builder/editor/src/pdf-templates/index.js":
/*!****************************************************************!*\
  !*** ./includes/pdf-builder/editor/src/pdf-templates/index.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _template_list__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./template-list */ \"./includes/pdf-builder/editor/src/pdf-templates/template-list/index.js\");\n\n\n\nwp.domReady(react_dom__WEBPACK_IMPORTED_MODULE_1___default().render( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_template_list__WEBPACK_IMPORTED_MODULE_2__[\"default\"], null), document.getElementById(\"yith_ywpi_pdf_templates\")));\n\n//# sourceURL=webpack://yith-woocommerce-pdf-invoice-premium/./includes/pdf-builder/editor/src/pdf-templates/index.js?");

/***/ }),

/***/ "./includes/pdf-builder/editor/src/pdf-templates/template-list/index.js":
/*!******************************************************************************!*\
  !*** ./includes/pdf-builder/editor/src/pdf-templates/template-list/index.js ***!
  \******************************************************************************/
/***/ ((__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 */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _data_templates_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../data/templates.js */ \"./includes/pdf-builder/editor/src/pdf-templates/data/templates.js\");\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ \"@wordpress/i18n\");\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _packages_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../packages/constants */ \"./includes/pdf-builder/editor/src/packages/constants.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\n\n\n\n\nfunction TemplateList() {\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState2 = _slicedToArray(_useState, 2),\n    remoteTemplates = _useState2[0],\n    setRemoteTemplates = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''),\n    _useState4 = _slicedToArray(_useState3, 2),\n    templateSelected = _useState4[0],\n    setTemplateSelected = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''),\n    _useState6 = _slicedToArray(_useState5, 2),\n    savedTemplateSelected = _useState6[0],\n    setSavedTemplateSelected = _useState6[1];\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),\n    _useState8 = _slicedToArray(_useState7, 2),\n    loading = _useState8[0],\n    setLoading = _useState8[1];\n  var imageLoaded = function imageLoaded(index, total) {\n    if (loading && index === total - 1) {\n      setLoading(false);\n    }\n  };\n  var getRemoteTemplates = function getRemoteTemplates() {\n    fetch(ywpi_pdf_template.ajaxurl, {\n      method: 'POST',\n      headers: {\n        'content-type': 'application/x-www-form-urlencoded'\n      },\n      body: formatRequestBody([{\n        name: 'action',\n        value: 'ywpi_get_pdf_templates'\n      }, {\n        name: 'security',\n        value: ywpi_pdf_template.get_templates_security\n      }])\n    }).then(function (response) {\n      return response.json();\n    }).then(function (templates) {\n      if (typeof templates.templates !== 'undefined') {\n        setRemoteTemplates(templates.templates);\n      }\n    })[\"catch\"](function (error) {\n      console.error(error);\n    });\n  };\n  function getTemplateSelected() {\n    var currentPost = wp.data.select('core/editor').getCurrentPost();\n    if (currentPost) {\n      if (templateSelected === '' && currentPost.status === 'auto-draft' && currentPost.content === '') {\n        setSavedTemplateSelected('default');\n        reloadEditor(_data_templates_js__WEBPACK_IMPORTED_MODULE_1__.defaultTemplate);\n      } else if (currentPost.content !== '' && typeof currentPost.meta !== 'undefined') {\n        setSavedTemplateSelected(currentPost.meta['_template_parent']);\n      }\n    } else {\n      setSavedTemplateSelected('default');\n      reloadEditor(_data_templates_js__WEBPACK_IMPORTED_MODULE_1__.defaultTemplate);\n    }\n  }\n\n  // Format the request body.\n  function formatRequestBody(body) {\n    var formatted = [];\n    jQuery.each(body, function (index, item) {\n      formatted.push(item.name + '=' + item.value);\n    });\n    return formatted.join('&');\n  }\n  var title = document.getElementById('yith_ywpi_pdf_template_title');\n  title.addEventListener('change', function () {\n    wp.data.dispatch('core/editor').editPost({\n      title: title.value\n    });\n  });\n  var _wp$data = wp.data,\n    select = _wp$data.select,\n    subscribe = _wp$data.subscribe;\n  var closeListener = subscribe(function () {\n    var isReady = select('core/editor').getCurrentPost();\n    if (!isReady || typeof isReady.status === 'undefined') {\n      // Editor not ready.\n      return;\n    }\n    // Close the listener as soon as we know we are ready to avoid an infinite loop.\n    closeListener();\n    // Your code is placed after this comment, once the editor is ready.\n    getTemplateSelected();\n  });\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    remoteTemplates.length === 0 && getRemoteTemplates();\n  }, []);\n  function handleOnClick(template) {\n    var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1;\n    setTemplateSelected(template);\n    if (template.content) {\n      reloadEditor(template);\n    } else {\n      var currentRemoteTemplate = remoteTemplates[index];\n      fetch(ywpi_pdf_template.ajaxurl, {\n        method: 'POST',\n        headers: {\n          'content-type': 'application/x-www-form-urlencoded'\n        },\n        body: formatRequestBody([{\n          name: 'action',\n          value: 'ywpi_get_template_pdf_content'\n        }, {\n          name: 'template_id',\n          value: template.id\n        }, {\n          name: 'security',\n          value: ywpi_pdf_template.get_template_content_security\n        }])\n      }).then(function (res) {\n        return res.json();\n      }).then(function (text) {\n        if (typeof text.content !== \"undefined\") {\n          currentRemoteTemplate.content = text.content;\n          remoteTemplates[index] = currentRemoteTemplate;\n          setRemoteTemplates(remoteTemplates);\n          reloadEditor(currentRemoteTemplate);\n        }\n      })[\"catch\"](function (error) {\n        console.error(error);\n      });\n    }\n  }\n  function reloadEditor(template) {\n    var meta = wp.data.select('core/editor').getEditedPostAttribute('meta');\n    wp.data.dispatch('core/editor').editPost({\n      content: template.content,\n      meta: _objectSpread(_objectSpread({}, meta), {}, {\n        _template_parent: template.id\n      })\n    });\n    wp.data.dispatch('core/block-editor').resetBlocks(wp.blocks.parse(template.content));\n  }\n  var imgPreviewUrl = _packages_constants__WEBPACK_IMPORTED_MODULE_3__.templateURL['baseURL'] + _packages_constants__WEBPACK_IMPORTED_MODULE_3__.templateURL['folder'] + _packages_constants__WEBPACK_IMPORTED_MODULE_3__.templateURL['preview'];\n  var t = '' === templateSelected ? savedTemplateSelected : templateSelected.id;\n  addBG();\n  function addBG() {\n    var template = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n    if (!templateSelected && !template && !savedTemplateSelected) {\n      return;\n    }\n    if (templateSelected) {\n      template = templateSelected;\n    } else if (savedTemplateSelected) {\n      remoteTemplates.map(function (t) {\n        if (t.id === savedTemplateSelected) {\n          template = t;\n        }\n      });\n    }\n    var bg = false;\n    if (typeof template.background !== 'undefined ') {\n      bg = _packages_constants__WEBPACK_IMPORTED_MODULE_3__.templateURL['baseURL'] + _packages_constants__WEBPACK_IMPORTED_MODULE_3__.templateURL['folder'] + _packages_constants__WEBPACK_IMPORTED_MODULE_3__.templateURL['images'] + template.background;\n    }\n    var elements = document.querySelectorAll('.editor-styles-wrapper');\n    for (var i = 0; i < elements.length; i++) {\n      if (bg) {\n        elements[i].style.background = 'url(' + bg + ') no-repeat 0 0';\n      }\n      var newClasses = [];\n      var classNames = elements[i].className.split(' ');\n      for (var _i = 0; _i < classNames.length; _i++) {\n        if (!classNames[_i].includes('ywpi-template-')) {\n          newClasses = [].concat(_toConsumableArray(newClasses), [classNames[_i]]);\n        }\n      }\n      newClasses = [].concat(_toConsumableArray(newClasses), ['ywpi-template-' + template.id]);\n      elements[i].className = newClasses.join(' ');\n    }\n  }\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n    className: 'default-templates-wrapper visible'\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n    className: \"template-item \".concat(t === _data_templates_js__WEBPACK_IMPORTED_MODULE_1__.defaultTemplate.id ? 'selected' : ''),\n    onClick: function onClick() {\n      return handleOnClick(_data_templates_js__WEBPACK_IMPORTED_MODULE_1__.defaultTemplate);\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"img\", {\n    className: 'template-preview',\n    src: _packages_constants__WEBPACK_IMPORTED_MODULE_3__.YWPI_PREVIEW_IMAGE_URL + '/' + _data_templates_js__WEBPACK_IMPORTED_MODULE_1__.defaultTemplate.preview\n  }))), !_packages_constants__WEBPACK_IMPORTED_MODULE_3__.YWPI_LICENCE && remoteTemplates.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n    className: \"remote-templates-wrapper no-licence \".concat(loading ? '' : 'visible')\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"a\", {\n    href: _packages_constants__WEBPACK_IMPORTED_MODULE_3__.YWPI_LICENCE_URL\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n    className: 'no-licence-message'\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n    className: \" yith-icon yith-icon-lock\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n    className: 'no-licence-message__action'\n  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Enter your licence key', 'yith-woocommerce-pdf-invoice')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n    className: 'no-licence-message__text'\n  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('to unlock 8 PDF templates with different designs and styles', 'yith-woocommerce-pdf-invoice'))), remoteTemplates.map(function (template, index) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"template-item  \".concat(t === template.id ? 'selected' : ''),\n      key: template.id\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"img\", {\n      className: 'template-preview',\n      src: imgPreviewUrl + template.preview,\n      onLoad: imageLoaded(index, remoteTemplates.length)\n    }));\n  }))), _packages_constants__WEBPACK_IMPORTED_MODULE_3__.YWPI_LICENCE && remoteTemplates.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n    className: \"remote-templates-wrapper with-licence \".concat(loading ? '' : 'visible')\n  }, remoteTemplates.map(function (template, index) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"template-item \".concat(t === template.id ? 'selected' : '', \" \"),\n      key: template.id,\n      onClick: function onClick() {\n        return handleOnClick(template, index);\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"img\", {\n      className: 'template-preview',\n      src: imgPreviewUrl + template.preview,\n      onLoad: imageLoaded(index, remoteTemplates.length)\n    }));\n  })));\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TemplateList);\n\n//# sourceURL=webpack://yith-woocommerce-pdf-invoice-premium/./includes/pdf-builder/editor/src/pdf-templates/template-list/index.js?");

/***/ }),

/***/ "react":
/*!************************!*\
  !*** external "React" ***!
  \************************/
/***/ ((module) => {

module.exports = (function() { return this["React"]; }());

/***/ }),

/***/ "react-dom":
/*!***************************!*\
  !*** external "ReactDOM" ***!
  \***************************/
/***/ ((module) => {

module.exports = (function() { return this["ReactDOM"]; }());

/***/ }),

/***/ "@wordpress/hooks":
/*!****************************************!*\
  !*** external {"this":["wp","hooks"]} ***!
  \****************************************/
/***/ ((module) => {

module.exports = (function() { return this["wp"]["hooks"]; }());

/***/ }),

/***/ "@wordpress/i18n":
/*!***************************************!*\
  !*** external {"this":["wp","i18n"]} ***!
  \***************************************/
/***/ ((module) => {

module.exports = (function() { return this["wp"]["i18n"]; }());

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// 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 */
/******/ 	(() => {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = (module) => {
/******/ 			var getter = module && module.__esModule ?
/******/ 				() => (module['default']) :
/******/ 				() => (module);
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (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 */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (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__("./includes/pdf-builder/editor/src/pdf-templates/index.js");
/******/ 	var __webpack_export_target__ = this;
/******/ 	for(var i in __webpack_exports__) __webpack_export_target__[i] = __webpack_exports__[i];
/******/ 	if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true });
/******/ 	
/******/ })()
;