https://www.youroverseashome.com/wp-content/plugins/yoh-core/build…/view.js?ver=128b7891df541f73bd87
1import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity"; 2/******/ var __webpack_modules__ = ({ 3 4/***/ "@wordpress/interactivity": 5/*!*******************************************!*\ 6 !*** external "@wordpress/interactivity" ***! 7 \*******************************************/ 8/***/ ((module) => { 9 10module.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__; 11 12/***/ }) 13 14/******/ }); 15/************************************************************************/ 16/******/ // The module cache 17/******/ var __webpack_module_cache__ = {}; 18/******/ 19/******/ // The require function 20/******/ function __webpack_require__(moduleId) { 21/******/ // Check if module is in cache 22/******/ var cachedModule = __webpack_module_cache__[moduleId]; 23/******/ if (cachedModule !== undefined) { 24/******/ return cachedModule.exports; 25/******/ } 26/******/ // Create a new module (and put it into the cache) 27/******/ var module = __webpack_module_cache__[moduleId] = { 28/******/ // no module.id needed 29/******/ // no module.loaded needed 30/******/ exports: {} 31/******/ }; 32/******/ 33/******/ // Execute the module function 34/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 35/******/ 36/******/ // Return the exports of the module 37/******/ return module.exports; 38/******/ } 39/******/ 40/************************************************************************/ 41/******/ /* webpack/runtime/make namespace object */ 42/******/ (() => { 43/******/ // define __esModule on exports 44/******/ __webpack_require__.r = (exports) => { 45/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 46/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 47/******/ } 48/******/ Object.defineProperty(exports, '__esModule', { value: true }); 49/******/ }; 50/******/ })(); 51/******/ 52/************************************************************************/ 53var __webpack_exports__ = {}; 54// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. 55(() => { 56/*!*******************************************************!*\ 57 !*** ./src/mailpoet-subscription-form-block/view.tsx ***! 58 \*******************************************************/ 59__webpack_require__.r(__webpack_exports__); 60/* harmony import */ var _wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/interactivity */ "@wordpress/interactivity"); 61/** 62 * WordPress dependencies 63 */ 64 65 66// view.js 67 68const { 69 state 70} = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.store)("ncmfse/mailpoet-subscription-form", { 71 state: {}, 72 actions: { 73 onSubmitForm: e => { 74 const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)(); 75 e.preventDefault(); 76 if (context.loading) { 77 return; 78 } 79 context.loading = true; 80 context.showError = false; 81 context.showSuccessMessage = false; 82 try { 83 // Send the data to the server 84 const formData = new FormData(); 85 formData.append("action", "add_subscriber_to_mailpoet_list"); 86 formData.append("_ajax_nonce", state.mailpoetFormNonce); 87 formData.append("mailpoet_list_id", context.mailpoetListId); 88 const target = e.target; 89 const email = target.email.value; // typechecks! 90 const name = target.name.value; // typechecks! 91 92 formData.append("name", name); 93 formData.append("email", email); 94 fetch(state.ajaxUrl, { 95 method: "POST", 96 body: formData 97 }).then(response => response.json()).then(({ 98 data, 99 success 100 }) => { 101 if (!success) { 102 context.showError = true; 103 if (typeof data === "string") context.errorMesssage = data; 104 } else { 105 context.showSuccessMessage = true; 106 } 107 }).finally(() => { 108 context.loading = false; 109 }); 110 } catch (e) { 111 console.log("Error Server data!", e); 112 context.loading = false; 113 context.showError = true; 114 context.errorMesssage = "Error Server data!"; 115 } 116 } 117 }, 118 callbacks: {} 119}); 120})(); 121 122 123//# sourceMappingURL=view.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.