1- ( ( ) => { "use strict" ; var e = { n :t => { var n = t && t . __esModule ?( ) => t . default :( ) => t ; return e . d ( n , { a :n } ) , n } , d :( t , n ) => { for ( var a in n ) e . o ( n , a ) && ! e . o ( t , a ) && Object . defineProperty ( t , a , { enumerable :! 0 , get :n [ a ] } ) } , o :( e , t ) => Object . prototype . hasOwnProperty . call ( e , t ) } ; const t = wp . apiFetch ; var n = e . n ( t ) ; document . addEventListener ( "DOMContentLoaded" , function ( ) { const e = document . querySelector ( "#simpliBlocksCacheReset" ) ; e && e . addEventListener ( "click" , async t => { t . preventDefault ( ) , e . disabled = ! 0 , e . textContent = "Resetting..." ; try { await async function ( ) { return n ( ) ( { path :`/${ ZIORWPBlocks . restUrl } /cache/reset` , method :"DELETE" } ) } ( ) ; e . textContent = "Cache Reset" } catch ( t ) { e . textContent = "Reset Failed" } finally { setTimeout ( ( ) => { e . disabled = ! 1 , e . textContent = "Reset Cache" } , 2e3 ) } } ) } ) } ) ( ) ;
1+ /*
2+ * ATTENTION: An "eval-source-map" devtool has been used.
3+ * This devtool is neither made for production nor for readable output files.
4+ * It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
5+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
6+ * or disable the default devtool with "devtool: false".
7+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
8+ */
9+ /******/ ( ( ) => { // webpackBootstrap
10+ /******/ "use strict" ;
11+ /******/ var __webpack_modules__ = ( {
12+
13+ /***/ "./resources/admin.ts"
14+ /*!****************************!*\
15+ !*** ./resources/admin.ts ***!
16+ \****************************/
17+ ( __unused_webpack_module , __webpack_exports__ , __webpack_require__ ) {
18+
19+ eval ( "{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ resetCache: () => (/* binding */ resetCache)\n/* harmony export */ });\n/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/api-fetch */ \"@wordpress/api-fetch\");\n/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__);\n\nasync function resetCache() {\n return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()({\n path: `/${ZIORWPBlocks.restUrl}/cache/reset`,\n method: 'DELETE'\n });\n}\n\n/**\n * Attach click handler\n */\nfunction initCacheResetButton() {\n const button = document.querySelector('#simpliBlocksCacheReset');\n if (!button) return;\n button.addEventListener('click', async event => {\n event.preventDefault();\n button.disabled = true;\n button.textContent = 'Resetting...';\n try {\n const result = await resetCache();\n console.log('Cache reset success:', result);\n button.textContent = 'Cache Reset';\n } catch (error) {\n console.error('Cache reset failed:', error);\n button.textContent = 'Reset Failed';\n } finally {\n setTimeout(() => {\n button.disabled = false;\n button.textContent = 'Reset Cache';\n }, 2000);\n }\n });\n}\n\n/**\n * Ensure DOM is ready\n */\ndocument.addEventListener('DOMContentLoaded', initCacheResetButton);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9yZXNvdXJjZXMvYWRtaW4udHMiLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUE7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBRUE7QUFDQTtBQUVBO0FBQ0E7QUFFQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93b3JkcHJlc3MtYmxvY2tzLy4vcmVzb3VyY2VzL2FkbWluLnRzPzlkYzEi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ZXh0Q29udGVudCA9ICdSZXNldCBGYWlsZWQnO1xuXHRcdH0gZmluYWxseSB7XG5cdFx0XHRzZXRUaW1lb3V0KCgpID0+IHtcblx0XHRcdFx0YnV0dG9uLmRpc2FibGVkID0gZmFsc2U7XG5cdFx0XHRcdGJ1dHRvbi50ZXh0Q29udGVudCA9ICdSZXNldCBDYWNoZSc7XG5cdFx0XHR9LCAyMDAwKTtcblx0XHR9XG5cdH0pO1xufVxuXG4vKipcbiAqIEVuc3VyZSBET00gaXMgcmVhZHlcbiAqL1xuZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignRE9NQ29udGVudExvYWRlZCcsIGluaXRDYWNoZVJlc2V0QnV0dG9uKTsiXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./resources/admin.ts\n\n}" ) ;
20+
21+ /***/ } ,
22+
23+ /***/ "@wordpress/api-fetch"
24+ /*!**********************************!*\
25+ !*** external ["wp","apiFetch"] ***!
26+ \**********************************/
27+ ( module ) {
28+
29+ module . exports = wp . apiFetch ;
30+
31+ /***/ }
32+
33+ /******/ } ) ;
34+ /************************************************************************/
35+ /******/ // The module cache
36+ /******/ var __webpack_module_cache__ = { } ;
37+ /******/
38+ /******/ // The require function
39+ /******/ function __webpack_require__ ( moduleId ) {
40+ /******/ // Check if module is in cache
41+ /******/ var cachedModule = __webpack_module_cache__ [ moduleId ] ;
42+ /******/ if ( cachedModule !== undefined ) {
43+ /******/ return cachedModule . exports ;
44+ /******/ }
45+ /******/ // Check if module exists (development only)
46+ /******/ if ( __webpack_modules__ [ moduleId ] === undefined ) {
47+ /******/ var e = new Error ( "Cannot find module '" + moduleId + "'" ) ;
48+ /******/ e . code = 'MODULE_NOT_FOUND' ;
49+ /******/ throw e ;
50+ /******/ }
51+ /******/ // Create a new module (and put it into the cache)
52+ /******/ var module = __webpack_module_cache__ [ moduleId ] = {
53+ /******/ // no module.id needed
54+ /******/ // no module.loaded needed
55+ /******/ exports : { }
56+ /******/ } ;
57+ /******/
58+ /******/ // Execute the module function
59+ /******/ __webpack_modules__ [ moduleId ] ( module , module . exports , __webpack_require__ ) ;
60+ /******/
61+ /******/ // Return the exports of the module
62+ /******/ return module . exports ;
63+ /******/ }
64+ /******/
65+ /************************************************************************/
66+ /******/ /* webpack/runtime/compat get default export */
67+ /******/ ( ( ) => {
68+ /******/ // getDefaultExport function for compatibility with non-harmony modules
69+ /******/ __webpack_require__ . n = ( module ) => {
70+ /******/ var getter = module && module . __esModule ?
71+ /******/ ( ) => ( module [ 'default' ] ) :
72+ /******/ ( ) => ( module ) ;
73+ /******/ __webpack_require__ . d ( getter , { a : getter } ) ;
74+ /******/ return getter ;
75+ /******/ } ;
76+ /******/ } ) ( ) ;
77+ /******/
78+ /******/ /* webpack/runtime/define property getters */
79+ /******/ ( ( ) => {
80+ /******/ // define getter functions for harmony exports
81+ /******/ __webpack_require__ . d = ( exports , definition ) => {
82+ /******/ for ( var key in definition ) {
83+ /******/ if ( __webpack_require__ . o ( definition , key ) && ! __webpack_require__ . o ( exports , key ) ) {
84+ /******/ Object . defineProperty ( exports , key , { enumerable : true , get : definition [ key ] } ) ;
85+ /******/ }
86+ /******/ }
87+ /******/ } ;
88+ /******/ } ) ( ) ;
89+ /******/
90+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
91+ /******/ ( ( ) => {
92+ /******/ __webpack_require__ . o = ( obj , prop ) => ( Object . prototype . hasOwnProperty . call ( obj , prop ) )
93+ /******/ } ) ( ) ;
94+ /******/
95+ /******/ /* webpack/runtime/make namespace object */
96+ /******/ ( ( ) => {
97+ /******/ // define __esModule on exports
98+ /******/ __webpack_require__ . r = ( exports ) => {
99+ /******/ if ( typeof Symbol !== 'undefined' && Symbol . toStringTag ) {
100+ /******/ Object . defineProperty ( exports , Symbol . toStringTag , { value : 'Module' } ) ;
101+ /******/ }
102+ /******/ Object . defineProperty ( exports , '__esModule' , { value : true } ) ;
103+ /******/ } ;
104+ /******/ } ) ( ) ;
105+ /******/
106+ /************************************************************************/
107+ /******/
108+ /******/ // startup
109+ /******/ // Load entry module and return exports
110+ /******/ // This entry module can't be inlined because the eval-source-map devtool is used.
111+ /******/ var __webpack_exports__ = __webpack_require__ ( "./resources/admin.ts" ) ;
112+ /******/
113+ /******/ } ) ( )
114+ ;
0 commit comments