/*
 * 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
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ "./src/Admin/ShopCentralAdmin.jsx"
/*!****************************************!*\
  !*** ./src/Admin/ShopCentralAdmin.jsx ***!
  \****************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\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_client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom/client */ \"./node_modules/react-dom/client.js\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/chakra-provider.mjs\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router/dist/development/chunk-EPOLDU6W.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var _Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Pages/StoreManager/Layouts/StoreManagerLayout */ \"./src/Pages/StoreManager/Layouts/StoreManagerLayout.jsx\");\n/* harmony import */ var _Pages_StoreManager_StoreList__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Pages/StoreManager/StoreList */ \"./src/Pages/StoreManager/StoreList.jsx\");\n/* harmony import */ var _Pages_StoreManager_Stores_Stores__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Pages/StoreManager/Stores/Stores */ \"./src/Pages/StoreManager/Stores/Stores.jsx\");\n/* harmony import */ var _Pages_StoreManager_Products_AllProduct__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Pages/StoreManager/Products/AllProduct */ \"./src/Pages/StoreManager/Products/AllProduct.jsx\");\n/* harmony import */ var _Pages_StoreManager_Orders_OrderList__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../Pages/StoreManager/Orders/OrderList */ \"./src/Pages/StoreManager/Orders/OrderList.jsx\");\n/* harmony import */ var _Pages_StoreManager_Customers_CustomerList__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../Pages/StoreManager/Customers/CustomerList */ \"./src/Pages/StoreManager/Customers/CustomerList.jsx\");\n/* harmony import */ var _Pages_StoreManager_Customers_CustomerIntelligence__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../Pages/StoreManager/Customers/CustomerIntelligence */ \"./src/Pages/StoreManager/Customers/CustomerIntelligence.jsx\");\n/* harmony import */ var _Pages_StoreManager_Coupons_CouponList__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../Pages/StoreManager/Coupons/CouponList */ \"./src/Pages/StoreManager/Coupons/CouponList.jsx\");\n/* harmony import */ var _Pages_StoreManager_Coupons_CreateCoupon__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../Pages/StoreManager/Coupons/CreateCoupon */ \"./src/Pages/StoreManager/Coupons/CreateCoupon.jsx\");\n/* harmony import */ var _Pages_StoreManager_Orders_ViewOrder__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../Pages/StoreManager/Orders/ViewOrder */ \"./src/Pages/StoreManager/Orders/ViewOrder.jsx\");\n/* harmony import */ var _Pages_StoreManager_Customers_ViewCustomer__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../Pages/StoreManager/Customers/ViewCustomer */ \"./src/Pages/StoreManager/Customers/ViewCustomer.jsx\");\n/* harmony import */ var _Pages_StoreManager_Coupons_ViewCoupon__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../Pages/StoreManager/Coupons/ViewCoupon */ \"./src/Pages/StoreManager/Coupons/ViewCoupon.jsx\");\n/* harmony import */ var _Pages_StoreManager_Marketing_GlobalCoupon__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../Pages/StoreManager/Marketing/GlobalCoupon */ \"./src/Pages/StoreManager/Marketing/GlobalCoupon.jsx\");\n/* harmony import */ var _Pages_StoreManager_Products_ViewProduct__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../Pages/StoreManager/Products/ViewProduct */ \"./src/Pages/StoreManager/Products/ViewProduct.jsx\");\n/* harmony import */ var _Pages_StoreManager_Analytics_ProductAnalytics__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../Pages/StoreManager/Analytics/ProductAnalytics */ \"./src/Pages/StoreManager/Analytics/ProductAnalytics.jsx\");\n/* harmony import */ var _Pages_StoreManager_Analytics_AdvancedAnalytics__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../Pages/StoreManager/Analytics/AdvancedAnalytics */ \"./src/Pages/StoreManager/Analytics/AdvancedAnalytics.jsx\");\n/* harmony import */ var _Pages_StoreManager_Automation_AutomationRules__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../Pages/StoreManager/Automation/AutomationRules */ \"./src/Pages/StoreManager/Automation/AutomationRules.jsx\");\n/* harmony import */ var _Pages_StoreManager_Tools_ExportTools__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../Pages/StoreManager/Tools/ExportTools */ \"./src/Pages/StoreManager/Tools/ExportTools.jsx\");\n/* harmony import */ var _Pages_StoreManager_Logs_LogsPage__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../Pages/StoreManager/Logs/LogsPage */ \"./src/Pages/StoreManager/Logs/LogsPage.jsx\");\n/* harmony import */ var _Pages_StoreManager_Customers_CustomerOrderHistory__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../Pages/StoreManager/Customers/CustomerOrderHistory */ \"./src/Pages/StoreManager/Customers/CustomerOrderHistory.jsx\");\n/* harmony import */ var _Pages_StoreManager_ProductEditor_ProductEditor__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../Pages/StoreManager/ProductEditor/ProductEditor */ \"./src/Pages/StoreManager/ProductEditor/ProductEditor.jsx\");\n/* harmony import */ var _Pages_StoreManager_SmartProductCreator_SmartProductCreatorPage__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../Pages/StoreManager/SmartProductCreator/SmartProductCreatorPage */ \"./src/Pages/StoreManager/SmartProductCreator/SmartProductCreatorPage.jsx\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// Configure Axios\nif (window.shopCentralData) {\n  axios__WEBPACK_IMPORTED_MODULE_4__[\"default\"].defaults.baseURL = window.shopCentralData.apiUrl;\n  axios__WEBPACK_IMPORTED_MODULE_4__[\"default\"].defaults.headers.common['X-WP-Nonce'] = window.shopCentralData.nonce;\n}\n\n// Redirect utility to map WordPress admin submenu query parameter \"?route=/...\" to HashRouter\nvar RouteQueryRedirect = function RouteQueryRedirect() {\n  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.useNavigate)();\n  var location = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.useLocation)();\n  react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(function () {\n    var params = new URLSearchParams(window.location.search);\n    var routeParam = params.get('route');\n    if (routeParam && location.pathname === '/') {\n      navigate(routeParam, {\n        replace: true\n      });\n    }\n  }, [navigate, location]);\n  return null;\n};\nvar App = function App() {\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.ChakraProvider, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.HashRouter, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(RouteQueryRedirect, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Routes, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {\n    path: \"/\",\n    element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_StoreList__WEBPACK_IMPORTED_MODULE_6__[\"default\"], null))\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {\n    path: \"/store-manager\",\n    element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_StoreList__WEBPACK_IMPORTED_MODULE_6__[\"default\"], null))\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {\n    path: \"/store-manager/stores\",\n    element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Stores_Stores__WEBPACK_IMPORTED_MODULE_7__[\"default\"], null))\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {\n    path: \"/store-manager/products\",\n    element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Products_AllProduct__WEBPACK_IMPORTED_MODULE_8__[\"default\"], null))\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {\n    path: \"/store-manager/products/:id\",\n    element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Products_ViewProduct__WEBPACK_IMPORTED_MODULE_18__[\"default\"], null))\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {\n    path: \"/store-manager/orders\",\n    element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Orders_OrderList__WEBPACK_IMPORTED_MODULE_9__[\"default\"], null))\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {\n    path: \"/store-manager/orders/:id\",\n    element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Orders_ViewOrder__WEBPACK_IMPORTED_MODULE_14__[\"default\"], null))\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {\n    path: \"/store-manager/customers\",\n    element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Customers_CustomerList__WEBPACK_IMPORTED_MODULE_10__[\"default\"], null))\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {\n    path: \"/store-manager/customer-intelligence\",\n    element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Customers_CustomerIntelligence__WEBPACK_IMPORTED_MODULE_11__[\"default\"], null))\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {\n    path: \"/store-manager/customers/:id\",\n    element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Customers_ViewCustomer__WEBPACK_IMPORTED_MODULE_15__[\"default\"], null))\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {\n    path: \"/store-manager/coupons\",\n    element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Coupons_CouponList__WEBPACK_IMPORTED_MODULE_12__[\"default\"], null))\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {\n    path: \"/store-manager/coupons/new\",\n    element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Coupons_CreateCoupon__WEBPACK_IMPORTED_MODULE_13__[\"default\"], null))\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {\n    path: \"/store-manager/coupons/:id\",\n    element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Coupons_ViewCoupon__WEBPACK_IMPORTED_MODULE_16__[\"default\"], null))\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {\n    path: \"/store-manager/marketing/global-coupon\",\n    element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Marketing_GlobalCoupon__WEBPACK_IMPORTED_MODULE_17__[\"default\"], null))\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {\n    path: \"/store-manager/analytics/products\",\n    element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Analytics_ProductAnalytics__WEBPACK_IMPORTED_MODULE_19__[\"default\"], null))\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {\n    path: \"/store-manager/analytics/advanced\",\n    element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Analytics_AdvancedAnalytics__WEBPACK_IMPORTED_MODULE_20__[\"default\"], null))\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {\n    path: \"/store-manager/automation\",\n    element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Automation_AutomationRules__WEBPACK_IMPORTED_MODULE_21__[\"default\"], null))\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {\n    path: \"/store-manager/export\",\n    element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Tools_ExportTools__WEBPACK_IMPORTED_MODULE_22__[\"default\"], null))\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {\n    path: \"/store-manager/product-editor\",\n    element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_ProductEditor_ProductEditor__WEBPACK_IMPORTED_MODULE_25__[\"default\"], null))\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {\n    path: \"/store-manager/smart-creator\",\n    element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_SmartProductCreator_SmartProductCreatorPage__WEBPACK_IMPORTED_MODULE_26__[\"default\"], null))\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {\n    path: \"/store-manager/logs\",\n    element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Logs_LogsPage__WEBPACK_IMPORTED_MODULE_23__[\"default\"], null))\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {\n    path: \"/store-manager/customers/orders/:email\",\n    element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Layouts_StoreManagerLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Pages_StoreManager_Customers_CustomerOrderHistory__WEBPACK_IMPORTED_MODULE_24__[\"default\"], null))\n  }))));\n};\nvar container = document.getElementById('shopcentral-root');\nif (container) {\n  try {\n    var root = (0,react_dom_client__WEBPACK_IMPORTED_MODULE_1__.createRoot)(container);\n    root.render(/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(App, null));\n    console.log('ShopCentral App rendered successfully');\n  } catch (e) {\n    console.error('Error rendering ShopCentral App:', e);\n  }\n} else {\n  console.error('ShopCentral root container not found!');\n}\n\n//# sourceURL=webpack://shopcentral/./src/Admin/ShopCentralAdmin.jsx?\n}");

/***/ },

/***/ "./src/Components/ProductPicker.jsx"
/*!******************************************!*\
  !*** ./src/Components/ProductPicker.jsx ***!
  \******************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/checkbox/checkbox.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/image/image.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/menu/menu.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/menu/menu-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/menu/menu-item.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/menu/menu-list.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-footer.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-header.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-overlay.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/select/select.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/skeleton/skeleton.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tbody.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/td.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/th.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/thead.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tr.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/toast/use-toast.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.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 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 _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\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 asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\nvar PER_PAGE = 10;\nvar ProductPicker = function ProductPicker(_ref) {\n  var isOpen = _ref.isOpen,\n    onClose = _ref.onClose,\n    onConfirm = _ref.onConfirm,\n    _ref$initialSelectedI = _ref.initialSelectedIds,\n    initialSelectedIds = _ref$initialSelectedI === void 0 ? [] : _ref$initialSelectedI,\n    _ref$title = _ref.title,\n    title = _ref$title === void 0 ? \"Select products\" : _ref$title,\n    _ref$multiple = _ref.multiple,\n    multiple = _ref$multiple === void 0 ? true : _ref$multiple,\n    _ref$isAllowOnlySingl = _ref.isAllowOnlySingleSelection,\n    isAllowOnlySingleSelection = _ref$isAllowOnlySingl === void 0 ? false : _ref$isAllowOnlySingl;\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState2 = _slicedToArray(_useState, 2),\n    products = _useState2[0],\n    setProducts = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState4 = _slicedToArray(_useState3, 2),\n    loading = _useState4[0],\n    setLoading = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1),\n    _useState6 = _slicedToArray(_useState5, 2),\n    page = _useState6[0],\n    setPage = _useState6[1];\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"\"),\n    _useState8 = _slicedToArray(_useState7, 2),\n    search = _useState8[0],\n    setSearch = _useState8[1];\n  var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(new Set()),\n    _useState0 = _slicedToArray(_useState9, 2),\n    selectedVariantIds = _useState0[0],\n    setSelectedVariantIds = _useState0[1];\n\n  // Filters\n  var _useState1 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState10 = _slicedToArray(_useState1, 2),\n    activeFilters = _useState10[0],\n    setActiveFilters = _useState10[1];\n  var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"All\"),\n    _useState12 = _slicedToArray(_useState11, 2),\n    filterType = _useState12[0],\n    setFilterType = _useState12[1];\n  var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState14 = _slicedToArray(_useState13, 2),\n    categories = _useState14[0],\n    setCategories = _useState14[1];\n  var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState16 = _slicedToArray(_useState15, 2),\n    tags = _useState16[0],\n    setTags = _useState16[1];\n  var _useState17 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState18 = _slicedToArray(_useState17, 2),\n    selectedCategories = _useState18[0],\n    setSelectedCategories = _useState18[1];\n  var _useState19 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState20 = _slicedToArray(_useState19, 2),\n    selectedTags = _useState20[0],\n    setSelectedTags = _useState20[1];\n\n  // Variation handling - auto-expand all variable products\n  var _useState21 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(new Set()),\n    _useState22 = _slicedToArray(_useState21, 2),\n    expandedProducts = _useState22[0],\n    setExpandedProducts = _useState22[1];\n  var _useState23 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({}),\n    _useState24 = _slicedToArray(_useState23, 2),\n    productVariations = _useState24[0],\n    setProductVariations = _useState24[1];\n  var _useState25 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(new Set()),\n    _useState26 = _slicedToArray(_useState25, 2),\n    loadingVariations = _useState26[0],\n    setLoadingVariations = _useState26[1];\n  var toast = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.useToast)();\n  var _useState27 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),\n    _useState28 = _slicedToArray(_useState27, 2),\n    hasMore = _useState28[0],\n    setHasMore = _useState28[1];\n  var _useState29 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"\"),\n    _useState30 = _slicedToArray(_useState29, 2),\n    debouncedSearch = _useState30[0],\n    setDebouncedSearch = _useState30[1];\n\n  // Debounce search\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    var timer = setTimeout(function () {\n      setDebouncedSearch(search);\n    }, 500);\n    return function () {\n      return clearTimeout(timer);\n    };\n  }, [search]);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    if (isOpen) {\n      var initialIds = new Set(Array.isArray(initialSelectedIds) ? initialSelectedIds : []);\n      setSelectedVariantIds(initialIds);\n      setPage(1);\n      setSearch(\"\");\n      setDebouncedSearch(\"\");\n      setActiveFilters([]);\n      setSelectedCategories([]);\n      setSelectedTags([]);\n      setProducts([]);\n      setHasMore(true);\n      fetchCategories();\n      fetchTags();\n      // fetchProducts will be triggered by debouncedSearch/page/filters effects\n    }\n  }, [isOpen]);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    if (isOpen) {\n      // Reset products when search or filters change\n      setPage(1);\n      setProducts([]);\n      setHasMore(true);\n    }\n  }, [debouncedSearch, selectedCategories, selectedTags]);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    if (isOpen) fetchProducts();\n  }, [page, debouncedSearch, selectedCategories, selectedTags]);\n  var fetchProducts = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n      var _res$data, res, fetchedProducts, variableProductIds, _t;\n      return _regenerator().w(function (_context) {\n        while (1) switch (_context.p = _context.n) {\n          case 0:\n            _context.p = 0;\n            setLoading(true);\n            _context.n = 1;\n            return axios__WEBPACK_IMPORTED_MODULE_31__[\"default\"].get(\"/api/all-products\", {\n              params: {\n                page: page,\n                per_page: PER_PAGE,\n                search: debouncedSearch || undefined,\n                category: selectedCategories.join(',') || undefined,\n                tag: selectedTags.join(',') || undefined,\n                status: 'publish',\n                search_fields: ['name', 'sku']\n              }\n            });\n          case 1:\n            res = _context.v;\n            fetchedProducts = (res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 || (_res$data = _res$data.data) === null || _res$data === void 0 ? void 0 : _res$data.allProducts) || [];\n            if (page === 1) {\n              setProducts(fetchedProducts);\n            } else {\n              setProducts(function (prev) {\n                return [].concat(_toConsumableArray(prev), _toConsumableArray(fetchedProducts));\n              });\n            }\n            setHasMore(fetchedProducts.length === PER_PAGE);\n\n            // Auto-expand all variable products\n            variableProductIds = fetchedProducts.filter(function (p) {\n              return p.type === \"variable\";\n            }).map(function (p) {\n              return p.id;\n            });\n            setExpandedProducts(function (prev) {\n              return new Set([].concat(_toConsumableArray(Array.from(prev)), _toConsumableArray(variableProductIds)));\n            });\n\n            // Fetch variations for all variable products\n            variableProductIds.forEach(function (id) {\n              return fetchVariations(id);\n            });\n            _context.n = 3;\n            break;\n          case 2:\n            _context.p = 2;\n            _t = _context.v;\n            toast({\n              title: \"Failed to load products\",\n              status: \"error\"\n            });\n          case 3:\n            _context.p = 3;\n            setLoading(false);\n            return _context.f(3);\n          case 4:\n            return _context.a(2);\n        }\n      }, _callee, null, [[0, 2, 3, 4]]);\n    }));\n    return function fetchProducts() {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  var fetchCategories = /*#__PURE__*/function () {\n    var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {\n      var _res$data2, res, _t2;\n      return _regenerator().w(function (_context2) {\n        while (1) switch (_context2.p = _context2.n) {\n          case 0:\n            _context2.p = 0;\n            _context2.n = 1;\n            return axios__WEBPACK_IMPORTED_MODULE_31__[\"default\"].get(\"/api/product-categories\");\n          case 1:\n            res = _context2.v;\n            setCategories((res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.categories) || []);\n            _context2.n = 3;\n            break;\n          case 2:\n            _context2.p = 2;\n            _t2 = _context2.v;\n            console.error(\"Failed to load categories\");\n          case 3:\n            return _context2.a(2);\n        }\n      }, _callee2, null, [[0, 2]]);\n    }));\n    return function fetchCategories() {\n      return _ref3.apply(this, arguments);\n    };\n  }();\n  var fetchTags = /*#__PURE__*/function () {\n    var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {\n      var _res$data3, res, _t3;\n      return _regenerator().w(function (_context3) {\n        while (1) switch (_context3.p = _context3.n) {\n          case 0:\n            _context3.p = 0;\n            _context3.n = 1;\n            return axios__WEBPACK_IMPORTED_MODULE_31__[\"default\"].get(\"/api/product-tags\");\n          case 1:\n            res = _context3.v;\n            setTags((res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.tags) || []);\n            _context3.n = 3;\n            break;\n          case 2:\n            _context3.p = 2;\n            _t3 = _context3.v;\n            console.error(\"Failed to load tags\");\n          case 3:\n            return _context3.a(2);\n        }\n      }, _callee3, null, [[0, 2]]);\n    }));\n    return function fetchTags() {\n      return _ref4.apply(this, arguments);\n    };\n  }();\n  var fetchVariations = /*#__PURE__*/function () {\n    var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(productId) {\n      var res, _t4;\n      return _regenerator().w(function (_context4) {\n        while (1) switch (_context4.p = _context4.n) {\n          case 0:\n            if (!productVariations[productId]) {\n              _context4.n = 1;\n              break;\n            }\n            return _context4.a(2);\n          case 1:\n            setLoadingVariations(function (prev) {\n              return new Set(prev).add(productId);\n            });\n            _context4.p = 2;\n            _context4.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_31__[\"default\"].get(\"/api/products/\".concat(productId, \"/variations\"));\n          case 3:\n            res = _context4.v;\n            setProductVariations(function (prev) {\n              return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, productId, res.data.variations || []));\n            });\n            _context4.n = 5;\n            break;\n          case 4:\n            _context4.p = 4;\n            _t4 = _context4.v;\n            console.error(\"Failed to load variations for product:\", productId);\n          case 5:\n            _context4.p = 5;\n            setLoadingVariations(function (prev) {\n              var next = new Set(prev);\n              next[\"delete\"](productId);\n              return next;\n            });\n            return _context4.f(5);\n          case 6:\n            return _context4.a(2);\n        }\n      }, _callee4, null, [[2, 4, 5, 6]]);\n    }));\n    return function fetchVariations(_x) {\n      return _ref5.apply(this, arguments);\n    };\n  }();\n  var handleSearch = function handleSearch() {\n    setPage(1);\n    fetchProducts();\n  };\n  var toggleExpand = function toggleExpand(productId) {\n    var newExpanded = new Set(expandedProducts);\n    if (newExpanded.has(productId)) {\n      newExpanded[\"delete\"](productId);\n    } else {\n      newExpanded.add(productId);\n      var product = products.find(function (p) {\n        return p.id === productId;\n      });\n      if ((product === null || product === void 0 ? void 0 : product.type) === \"variable\") {\n        fetchVariations(productId);\n      }\n    }\n    setExpandedProducts(newExpanded);\n  };\n  var isItemDisabled = function isItemDisabled(item) {\n    var stockQty = item.stock_quantity;\n    var isOutOfStock = stockQty === 0 || stockQty === \"0\" || item.stock_status === \"outofstock\";\n    var isDraft = item.status === \"draft\";\n    return isOutOfStock || isDraft;\n  };\n  var handleProductCheckbox = function handleProductCheckbox(product) {\n    if (isItemDisabled(product) && product.type !== \"variable\") return;\n    var isSingle = isAllowOnlySingleSelection || !multiple;\n    var variations = productVariations[product.id] || [];\n    // Only consider variations that are not disabled\n    var variationsToSelect = variations.filter(function (v) {\n      return !isItemDisabled(v);\n    });\n    var variationIds = variationsToSelect.map(function (v) {\n      return v.id;\n    });\n    if (product.type === \"variable\" && variations.length > 0) {\n      if (variationIds.length === 0) {\n        toast({\n          title: \"Action Restricted\",\n          description: \"All variations for this product are out of stock or draft.\",\n          status: \"warning\",\n          duration: 2000\n        });\n        return;\n      }\n      var allSelected = variationIds.every(function (id) {\n        return selectedVariantIds.has(id);\n      });\n      var newSelected = isSingle ? new Set() : new Set(selectedVariantIds);\n      if (allSelected && !isSingle) {\n        variationIds.forEach(function (id) {\n          return newSelected[\"delete\"](id);\n        });\n      } else {\n        if (isSingle) {\n          if (variationIds.length > 1) {\n            toast({\n              title: \"Single Selection\",\n              description: \"Removing multi-selection from variable product as only one is allowed.\",\n              status: \"info\"\n            });\n            newSelected.add(variationIds[0]);\n          } else {\n            newSelected.add(variationIds[0]);\n          }\n        } else {\n          variationIds.forEach(function (id) {\n            return newSelected.add(id);\n          });\n        }\n      }\n      setSelectedVariantIds(newSelected);\n    } else {\n      var _newSelected = isSingle ? new Set() : new Set(selectedVariantIds);\n      if (_newSelected.has(product.id) && !isSingle) {\n        _newSelected[\"delete\"](product.id);\n      } else {\n        _newSelected.add(product.id);\n      }\n      setSelectedVariantIds(_newSelected);\n    }\n  };\n  var handleVariantCheckbox = function handleVariantCheckbox(variantId, variant) {\n    if (isItemDisabled(variant)) return;\n    var isSingle = isAllowOnlySingleSelection || !multiple;\n    var newSelected = isSingle ? new Set() : new Set(selectedVariantIds);\n    if (newSelected.has(variantId) && !isSingle) {\n      newSelected[\"delete\"](variantId);\n    } else {\n      if (isSingle && selectedVariantIds.size > 0 && !selectedVariantIds.has(variantId)) {\n        toast({\n          title: \"Single Selection\",\n          description: \"Only one product can be selected. Your previous selection was replaced.\",\n          status: \"info\",\n          duration: 2000,\n          isClosable: true\n        });\n      }\n      newSelected.add(variantId);\n    }\n    setSelectedVariantIds(newSelected);\n  };\n  var isProductChecked = function isProductChecked(product) {\n    if (product.type === \"variable\") {\n      var variations = productVariations[product.id] || [];\n      var selectableVariations = variations.filter(function (v) {\n        return !isItemDisabled(v);\n      });\n      if (selectableVariations.length === 0) return false;\n      return selectableVariations.every(function (v) {\n        return selectedVariantIds.has(v.id);\n      });\n    }\n    return selectedVariantIds.has(product.id);\n  };\n  var isProductIndeterminate = function isProductIndeterminate(product) {\n    if (product.type === \"variable\") {\n      var variations = productVariations[product.id] || [];\n      var selectableVariations = variations.filter(function (v) {\n        return !isItemDisabled(v);\n      });\n      if (selectableVariations.length === 0) return false;\n      var selectedCount = selectableVariations.filter(function (v) {\n        return selectedVariantIds.has(v.id);\n      }).length;\n      return selectedCount > 0 && selectedCount < selectableVariations.length;\n    }\n    return false;\n  };\n  var addFilter = function addFilter(type) {\n    if (type === \"category\") {\n      setActiveFilters([].concat(_toConsumableArray(activeFilters), [{\n        type: \"category\",\n        value: \"\"\n      }]));\n    } else if (type === \"tag\") {\n      setActiveFilters([].concat(_toConsumableArray(activeFilters), [{\n        type: \"tag\",\n        value: \"\"\n      }]));\n    }\n  };\n  var updateFilter = function updateFilter(index, value) {\n    var newFilters = _toConsumableArray(activeFilters);\n    newFilters[index].value = value;\n    setActiveFilters(newFilters);\n\n    // Derive categories and tags from active filters\n    var cats = newFilters.filter(function (f) {\n      return f.type === 'category' && f.value;\n    }).map(function (f) {\n      return f.value;\n    });\n    var tgs = newFilters.filter(function (f) {\n      return f.type === 'tag' && f.value;\n    }).map(function (f) {\n      return f.value;\n    });\n    setSelectedCategories(cats);\n    setSelectedTags(tgs);\n    setPage(1);\n  };\n  var removeFilter = function removeFilter(index) {\n    var newFilters = activeFilters.filter(function (_, i) {\n      return i !== index;\n    });\n    setActiveFilters(newFilters);\n    var cats = newFilters.filter(function (f) {\n      return f.type === 'category' && f.value;\n    }).map(function (f) {\n      return f.value;\n    });\n    var tgs = newFilters.filter(function (f) {\n      return f.type === 'tag' && f.value;\n    }).map(function (f) {\n      return f.value;\n    });\n    setSelectedCategories(cats);\n    setSelectedTags(tgs);\n    setPage(1);\n  };\n  var handleConfirm = function handleConfirm() {\n    var isSingle = isAllowOnlySingleSelection || !multiple;\n    var selectedIds = Array.from(selectedVariantIds);\n    var selectedObjects = selectedIds.map(function (id) {\n      // Check simple products\n      var product = products.find(function (p) {\n        return p.id === id;\n      });\n      if (product) return product;\n\n      // Check variations\n      var _loop = function _loop(productId) {\n          var variant = productVariations[productId].find(function (v) {\n            return v.id === id;\n          });\n          if (variant) {\n            var parent = products.find(function (p) {\n              return p.id === parseInt(productId);\n            });\n            return {\n              v: _objectSpread(_objectSpread({}, variant), {}, {\n                product_name: parent ? \"\".concat(parent.name, \" - \").concat(getVariantLabel(variant)) : getVariantLabel(variant),\n                name: parent ? \"\".concat(parent.name, \" - \").concat(getVariantLabel(variant)) : getVariantLabel(variant),\n                parent: parent\n              })\n            };\n          }\n        },\n        _ret;\n      for (var productId in productVariations) {\n        _ret = _loop(productId);\n        if (_ret) return _ret.v;\n      }\n\n      // Fallback for already selected items that might not be in current view\n      var existing = Array.isArray(initialSelectedIds) ? initialSelectedIds.find(function (idOrObj) {\n        return (idOrObj.id || idOrObj) === id;\n      }) : null;\n      return _typeof(existing) === 'object' ? existing : {\n        id: id\n      };\n    });\n    if (!isSingle) {\n      onConfirm(selectedObjects);\n    } else {\n      onConfirm(selectedObjects[0] || null);\n    }\n    onClose();\n  };\n  var getStockDisplay = function getStockDisplay(item) {\n    var stockQty = item.stock_quantity;\n    var isOutOfStock = stockQty === 0 || stockQty === \"0\" || item.stock_status === \"outofstock\";\n    if (isOutOfStock) {\n      return {\n        display: \"0\",\n        color: \"red.500\",\n        showWarning: true\n      };\n    }\n    if (stockQty != null && stockQty !== \"\") {\n      return {\n        display: stockQty.toString(),\n        color: stockQty < 10 ? \"orange.500\" : \"gray.700\",\n        showWarning: stockQty < 10\n      };\n    }\n    return {\n      display: \"∞\",\n      color: \"gray.500\",\n      showWarning: false\n    };\n  };\n  var getPriceDisplay = function getPriceDisplay(item) {\n    if (item.price_html) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Box, {\n        dangerouslySetInnerHTML: {\n          __html: item.price_html\n        },\n        fontSize: \"sm\"\n      });\n    }\n    if (item.price) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n        fontSize: \"sm\"\n      }, \"$\", item.price);\n    }\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n      fontSize: \"sm\",\n      color: \"gray.400\"\n    }, \"-\");\n  };\n  var getVariantLabel = function getVariantLabel(variation) {\n    if (variation.attributes && variation.attributes.length > 0) {\n      return variation.attributes.map(function (attr) {\n        return attr.option;\n      }).join(\" / \");\n    }\n    return variation.name || \"Variant\";\n  };\n  var totalSelected = selectedVariantIds.size;\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Modal, {\n    isOpen: isOpen,\n    onClose: onClose,\n    size: \"2xl\",\n    preserveScrollBarGap: false,\n    blockScrollOnMount: false,\n    isCentered: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.ModalOverlay, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.ModalContent, {\n    maxH: \"70vh\",\n    display: \"flex\",\n    flexDirection: \"column\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.ModalHeader, {\n    borderBottom: \"1px\",\n    borderColor: \"gray.200\",\n    pb: 4\n  }, title), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.ModalCloseButton, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.ModalBody, {\n    p: 0,\n    flex: \"1\",\n    overflow: \"hidden\",\n    display: \"flex\",\n    flexDirection: \"column\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Box, {\n    p: 4,\n    borderBottom: \"1px\",\n    borderColor: \"gray.200\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.HStack, {\n    spacing: 3,\n    mb: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Box, {\n    position: \"relative\",\n    flex: \"1\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiSearch,\n    position: \"absolute\",\n    left: \"12px\",\n    top: \"50%\",\n    transform: \"translateY(-50%)\",\n    color: \"gray.400\",\n    zIndex: 1\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Input, {\n    placeholder: \"Search products\",\n    value: search,\n    onChange: function onChange(e) {\n      return setSearch(e.target.value);\n    },\n    pl: \"40px\",\n    bg: \"white\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Select, {\n    value: filterType,\n    onChange: function onChange(e) {\n      return setFilterType(e.target.value);\n    },\n    w: \"200px\",\n    bg: \"white\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"All\"\n  }, \"Search by All\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"Name\"\n  }, \"Product Name\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"SKU\"\n  }, \"SKU\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.HStack, {\n    spacing: 2,\n    flexWrap: \"wrap\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Menu, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.MenuButton, {\n    as: _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Button,\n    size: \"sm\",\n    variant: \"outline\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiPlus, null),\n    fontSize: \"sm\"\n  }, \"Add filter\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.MenuList, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.MenuItem, {\n    onClick: function onClick() {\n      return addFilter(\"category\");\n    }\n  }, \"Category\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.MenuItem, {\n    onClick: function onClick() {\n      return addFilter(\"tag\");\n    }\n  }, \"Tag\"))), activeFilters.map(function (filter, index) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.HStack, {\n      key: index,\n      spacing: 2\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Select, {\n      size: \"sm\",\n      placeholder: \"Select \".concat(filter.type),\n      value: filter.value,\n      onChange: function onChange(e) {\n        return updateFilter(index, e.target.value);\n      },\n      minW: \"150px\"\n    }, filter.type === \"category\" && categories.map(function (cat) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n        key: cat.id,\n        value: cat.id\n      }, cat.name);\n    }), filter.type === \"tag\" && tags.map(function (tag) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n        key: tag.id,\n        value: tag.id\n      }, tag.name);\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Button, {\n      size: \"sm\",\n      variant: \"ghost\",\n      onClick: function onClick() {\n        return removeFilter(index);\n      },\n      fontSize: \"xs\"\n    }, \"\\u2715\"));\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Box, {\n    flex: \"1\",\n    overflowY: \"auto\",\n    overflowX: \"hidden\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Table, {\n    variant: \"simple\",\n    size: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Thead, {\n    position: \"sticky\",\n    top: 0,\n    bg: \"gray.50\",\n    zIndex: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Th, {\n    w: \"50px\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Th, null, \"Product\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Th, {\n    w: \"120px\",\n    textAlign: \"center\"\n  }, \"Available\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Th, {\n    w: \"150px\",\n    textAlign: \"right\"\n  }, \"Price\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Tbody, null, loading ? _toConsumableArray(Array(6)).map(function (_, i) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Tr, {\n      key: i\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Td, {\n      colSpan: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Skeleton, {\n      h: \"60px\"\n    })));\n  }) : products.length === 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Td, {\n    colSpan: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Box, {\n    textAlign: \"center\",\n    color: \"gray.500\",\n    py: 10\n  }, \"No products found\"))) : products.map(function (product) {\n    var _product$images, _product$images2, _product$image;\n    var isExpanded = expandedProducts.has(product.id);\n    var isVariable = product.type === \"variable\";\n    var variations = productVariations[product.id] || [];\n    var isLoadingVars = loadingVariations.has(product.id);\n    var stock = getStockDisplay(product);\n    var img = ((_product$images = product.images) === null || _product$images === void 0 || (_product$images = _product$images[0]) === null || _product$images === void 0 ? void 0 : _product$images.thumbnail) || ((_product$images2 = product.images) === null || _product$images2 === void 0 || (_product$images2 = _product$images2[0]) === null || _product$images2 === void 0 ? void 0 : _product$images2.src) || ((_product$image = product.image) === null || _product$image === void 0 ? void 0 : _product$image.src);\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), {\n      key: product.id\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Tr, {\n      _hover: !isItemDisabled(product) || isVariable ? {\n        bg: \"gray.50\"\n      } : {},\n      bg: isProductChecked(product) ? \"blue.50\" : \"white\",\n      opacity: isItemDisabled(product) && !isVariable ? 0.6 : 1\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.HStack, {\n      spacing: 2\n    }, isVariable && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Icon, {\n      as: isExpanded ? react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiChevronDown : react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiChevronRight,\n      cursor: \"pointer\",\n      onClick: function onClick() {\n        return toggleExpand(product.id);\n      },\n      color: \"gray.500\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Checkbox, {\n      isChecked: isProductChecked(product),\n      isIndeterminate: isProductIndeterminate(product),\n      onChange: function onChange() {\n        return handleProductCheckbox(product);\n      },\n      isDisabled: isItemDisabled(product) && !isVariable\n    }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.HStack, {\n      spacing: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Image, {\n      src: img,\n      alt: product.name,\n      boxSize: \"40px\",\n      objectFit: \"cover\",\n      borderRadius: \"md\",\n      bg: \"gray.100\",\n      fallbackSrc: \"https://via.placeholder.com/40\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n      fontSize: \"sm\",\n      fontWeight: \"medium\"\n    }, product.name || product.title)))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Td, {\n      textAlign: \"center\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.HStack, {\n      spacing: 1,\n      justify: \"center\"\n    }, stock.showWarning && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiAlertTriangle,\n      color: stock.color,\n      boxSize: 3\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n      fontSize: \"sm\",\n      color: stock.color,\n      fontWeight: \"medium\"\n    }, stock.display))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Td, {\n      textAlign: \"right\"\n    }, getPriceDisplay(product))), isVariable && isExpanded && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, isLoadingVars ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Td, {\n      colSpan: 4,\n      pl: 16\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.HStack, {\n      spacing: 2\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Skeleton, {\n      h: \"40px\",\n      w: \"100%\"\n    })))) : variations.length > 0 ? variations.map(function (variation) {\n      var varStock = getStockDisplay(variation);\n      var isChecked = selectedVariantIds.has(variation.id);\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Tr, {\n        key: variation.id,\n        bg: isChecked ? \"blue.50\" : \"white\",\n        _hover: !isItemDisabled(variation) ? {\n          bg: \"gray.50\"\n        } : {},\n        opacity: isItemDisabled(variation) ? 0.6 : 1\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Td, {\n        pl: 12\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Checkbox, {\n        isChecked: isChecked,\n        onChange: function onChange() {\n          return handleVariantCheckbox(variation.id, variation);\n        },\n        isDisabled: isItemDisabled(variation)\n      })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n        fontSize: \"sm\",\n        pl: 6,\n        color: \"gray.600\"\n      }, getVariantLabel(variation))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Td, {\n        textAlign: \"center\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.HStack, {\n        spacing: 1,\n        justify: \"center\"\n      }, varStock.showWarning && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Icon, {\n        as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiAlertTriangle,\n        color: varStock.color,\n        boxSize: 3\n      }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n        fontSize: \"sm\",\n        color: varStock.color,\n        fontWeight: \"medium\"\n      }, varStock.display))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Td, {\n        textAlign: \"right\"\n      }, getPriceDisplay(variation)));\n    }) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Td, {\n      colSpan: 4,\n      pl: 16\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n      fontSize: \"sm\",\n      color: \"gray.500\"\n    }, \"No variations found\")))));\n  }))), hasMore && products.length > 0 && !loading && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Flex, {\n    justify: \"center\",\n    py: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Button, {\n    size: \"sm\",\n    variant: \"outline\",\n    onClick: function onClick() {\n      return setPage(function (p) {\n        return p + 1;\n      });\n    },\n    isLoading: loading\n  }, \"Load more products\")), loading && products.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Flex, {\n    justify: \"center\",\n    py: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Skeleton, {\n    h: \"40px\",\n    w: \"150px\"\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.ModalFooter, {\n    borderTop: \"1px\",\n    borderColor: \"gray.200\",\n    justifyContent: \"space-between\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.500\"\n  }, totalSelected, \" variants selected\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.HStack, {\n    spacing: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Button, {\n    variant: \"ghost\",\n    onClick: onClose\n  }, \"Cancel\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Button, {\n    colorScheme: \"blue\",\n    onClick: handleConfirm\n  }, \"Add\")))));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductPicker);\n\n//# sourceURL=webpack://shopcentral/./src/Components/ProductPicker.jsx?\n}");

/***/ },

/***/ "./src/Components/shared/AutoSyncConfirmDialog.jsx"
/*!*********************************************************!*\
  !*** ./src/Components/shared/AutoSyncConfirmDialog.jsx ***!
  \*********************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/list/list.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-footer.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-header.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-overlay.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n\n\n\nvar AutoSyncConfirmDialog = function AutoSyncConfirmDialog(_ref) {\n  var isOpen = _ref.isOpen,\n    onClose = _ref.onClose,\n    onConfirm = _ref.onConfirm,\n    loading = _ref.loading;\n  var checklistItems = [\"Is WooCommerce active?\", \"Are REST API keys active in Settings > Advanced > REST API?\", 'Is the permalink format \"Post name\" selected in Settings > Permalinks?', \"Is the child store using any security plugin like Wordfence or iThemes Security?\", \"Does the child store URL contain a slash (/)? Check ShopCentral > Stores > Child store URL.\"];\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Modal, {\n    isOpen: isOpen,\n    onClose: onClose,\n    isCentered: true,\n    size: {\n      base: \"full\",\n      md: \"lg\"\n    },\n    motionPreset: \"slideInBottom\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.ModalOverlay, {\n    bg: \"blackAlpha.300\",\n    backdropFilter: \"blur(5px)\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.ModalContent, {\n    borderRadius: {\n      base: \"none\",\n      md: \"2xl\"\n    },\n    h: {\n      base: \"100vh\",\n      md: \"auto\"\n    },\n    overflow: \"hidden\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.ModalHeader, {\n    pb: 2,\n    borderBottom: {\n      base: \"1px\",\n      md: \"none\"\n    },\n    borderColor: {\n      base: \"gray.100\",\n      md: \"transparent\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.HStack, {\n    spacing: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_15__.FiShield,\n    color: \"blue.500\",\n    boxSize: {\n      base: 5,\n      md: 6\n    }\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Text, {\n    m: 0,\n    fontSize: {\n      base: \"md\",\n      md: \"lg\"\n    },\n    fontWeight: \"800\"\n  }, \"Enable Auto Sync?\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.ModalCloseButton, {\n    isDisabled: loading,\n    top: {\n      base: 3,\n      md: 4\n    }\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.ModalBody, {\n    pb: 4,\n    pt: {\n      base: 4,\n      md: \"auto\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.HStack, {\n    align: \"start\",\n    spacing: 3,\n    p: 3,\n    bg: \"orange.50\",\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"orange.100\",\n    mb: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_15__.FiAlertCircle,\n    color: \"orange.500\",\n    boxSize: 5,\n    mt: 1,\n    flexShrink: 0\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Text, {\n    m: 0,\n    fontSize: {\n      base: \"xs\",\n      md: \"sm\"\n    },\n    color: \"orange.700\",\n    fontWeight: \"600\"\n  }, \"Please verify the following requirements for your child store(s) before enabling auto-sync:\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.List, {\n    spacing: {\n      base: 2,\n      md: 3\n    },\n    pl: 1\n  }, checklistItems.map(function (item, index) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.ListItem, {\n      key: index,\n      fontSize: {\n        base: \"xs\",\n        md: \"sm\"\n      },\n      color: \"gray.700\",\n      display: \"flex\",\n      alignItems: \"start\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.ListIcon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_15__.FiCheckCircle,\n      color: \"blue.500\",\n      mt: 1,\n      boxSize: {\n        base: 3,\n        md: 4\n      }\n    }), item);\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.ModalFooter, {\n    pt: 2,\n    borderTop: {\n      base: \"1px\",\n      md: \"none\"\n    },\n    borderColor: {\n      base: \"gray.100\",\n      md: \"transparent\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Flex, {\n    direction: {\n      base: \"column\",\n      sm: \"row\"\n    },\n    w: \"full\",\n    gap: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Button, {\n    w: {\n      base: \"full\",\n      sm: \"auto\"\n    },\n    mr: {\n      base: 0,\n      sm: 3\n    },\n    onClick: onClose,\n    isDisabled: loading,\n    borderRadius: \"xl\",\n    size: {\n      base: \"md\",\n      md: \"md\"\n    }\n  }, \"Cancel\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Button, {\n    w: {\n      base: \"full\",\n      sm: \"auto\"\n    },\n    colorScheme: \"blue\",\n    onClick: onConfirm,\n    isLoading: loading,\n    borderRadius: \"xl\",\n    size: {\n      base: \"md\",\n      md: \"md\"\n    }\n  }, \"Yes, Enable Auto Sync\")))));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AutoSyncConfirmDialog);\n\n//# sourceURL=webpack://shopcentral/./src/Components/shared/AutoSyncConfirmDialog.jsx?\n}");

/***/ },

/***/ "./src/Components/shared/ConfirmDialog.jsx"
/*!*************************************************!*\
  !*** ./src/Components/shared/ConfirmDialog.jsx ***!
  \*************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 _chakra_ui_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-footer.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-header.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-overlay.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_9__);\n\n\nvar ConfirmDialog = function ConfirmDialog(_ref) {\n  var isOpen = _ref.isOpen,\n    onClose = _ref.onClose,\n    _ref$title = _ref.title,\n    title = _ref$title === void 0 ? 'Confirm' : _ref$title,\n    description = _ref.description,\n    _ref$confirmLabel = _ref.confirmLabel,\n    confirmLabel = _ref$confirmLabel === void 0 ? 'Confirm' : _ref$confirmLabel,\n    _ref$cancelLabel = _ref.cancelLabel,\n    cancelLabel = _ref$cancelLabel === void 0 ? 'Cancel' : _ref$cancelLabel,\n    onConfirm = _ref.onConfirm,\n    _ref$loading = _ref.loading,\n    loading = _ref$loading === void 0 ? false : _ref$loading;\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Modal, {\n    isOpen: isOpen,\n    onClose: onClose,\n    isCentered: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.ModalOverlay, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.ModalContent, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.ModalHeader, null, title), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.ModalCloseButton, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.ModalBody, null, typeof description === 'string' ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Text, null, description) : description), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.ModalFooter, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_0__.Button, {\n    mr: 3,\n    onClick: onClose\n  }, cancelLabel), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_0__.Button, {\n    colorScheme: \"red\",\n    onClick: onConfirm,\n    isLoading: loading\n  }, confirmLabel))));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ConfirmDialog);\n\n//# sourceURL=webpack://shopcentral/./src/Components/shared/ConfirmDialog.jsx?\n}");

/***/ },

/***/ "./src/Components/shared/DatePicker.jsx"
/*!**********************************************!*\
  !*** ./src/Components/shared/DatePicker.jsx ***!
  \**********************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */   getAllTimeRange: () => (/* binding */ getAllTimeRange)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_date_range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-date-range */ \"./node_modules/react-date-range/dist/index.js\");\n/* harmony import */ var react_date_range_dist_styles_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-date-range/dist/styles.css */ \"./node_modules/react-date-range/dist/styles.css\");\n/* harmony import */ var react_date_range_dist_theme_default_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-date-range/dist/theme/default.css */ \"./node_modules/react-date-range/dist/theme/default.css\");\n/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! date-fns */ \"./node_modules/date-fns/addMonths.js\");\n/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! date-fns */ \"./node_modules/date-fns/endOfDay.js\");\n/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! date-fns */ \"./node_modules/date-fns/endOfMonth.js\");\n/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! date-fns */ \"./node_modules/date-fns/endOfWeek.js\");\n/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! date-fns */ \"./node_modules/date-fns/startOfDay.js\");\n/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! date-fns */ \"./node_modules/date-fns/startOfMonth.js\");\n/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! date-fns */ \"./node_modules/date-fns/startOfWeek.js\");\n/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! date-fns */ \"./node_modules/date-fns/subDays.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 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\n\nvar allTimeRangeDefinition = {\n  startDate: new Date(2015, 0, 1),\n  endDate: new Date(),\n  key: \"selection\"\n};\nvar allTimeRange = [{\n  label: \"All Time\",\n  range: function range() {\n    return allTimeRangeDefinition;\n  },\n  hasCustomRendering: false\n}];\nvar customStaticRanges = [{\n  label: \"Today\",\n  range: function range() {\n    return {\n      startDate: (0,date_fns__WEBPACK_IMPORTED_MODULE_8__.startOfDay)(new Date()),\n      endDate: (0,date_fns__WEBPACK_IMPORTED_MODULE_5__.endOfDay)(new Date())\n    };\n  },\n  hasCustomRendering: false\n}, {\n  label: \"Yesterday\",\n  range: function range() {\n    return {\n      startDate: (0,date_fns__WEBPACK_IMPORTED_MODULE_8__.startOfDay)((0,date_fns__WEBPACK_IMPORTED_MODULE_11__.subDays)(new Date(), 1)),\n      endDate: (0,date_fns__WEBPACK_IMPORTED_MODULE_5__.endOfDay)((0,date_fns__WEBPACK_IMPORTED_MODULE_11__.subDays)(new Date(), 1))\n    };\n  },\n  hasCustomRendering: false\n}, {\n  label: \"Last 7 Days\",\n  range: function range() {\n    return {\n      startDate: (0,date_fns__WEBPACK_IMPORTED_MODULE_8__.startOfDay)((0,date_fns__WEBPACK_IMPORTED_MODULE_11__.subDays)(new Date(), 6)),\n      endDate: (0,date_fns__WEBPACK_IMPORTED_MODULE_5__.endOfDay)(new Date())\n    };\n  },\n  hasCustomRendering: false\n}, {\n  label: \"Last Week\",\n  range: function range() {\n    return {\n      startDate: (0,date_fns__WEBPACK_IMPORTED_MODULE_10__.startOfWeek)((0,date_fns__WEBPACK_IMPORTED_MODULE_11__.subDays)(new Date(), 7)),\n      endDate: (0,date_fns__WEBPACK_IMPORTED_MODULE_7__.endOfWeek)((0,date_fns__WEBPACK_IMPORTED_MODULE_11__.subDays)(new Date(), 7))\n    };\n  },\n  hasCustomRendering: false\n}, {\n  label: \"This Month\",\n  range: function range() {\n    return {\n      startDate: (0,date_fns__WEBPACK_IMPORTED_MODULE_9__.startOfMonth)(new Date()),\n      endDate: (0,date_fns__WEBPACK_IMPORTED_MODULE_5__.endOfDay)(new Date())\n    };\n  },\n  hasCustomRendering: false\n}, {\n  label: \"Last Month\",\n  range: function range() {\n    return {\n      startDate: (0,date_fns__WEBPACK_IMPORTED_MODULE_9__.startOfMonth)((0,date_fns__WEBPACK_IMPORTED_MODULE_4__.addMonths)(new Date(), -1)),\n      endDate: (0,date_fns__WEBPACK_IMPORTED_MODULE_6__.endOfMonth)((0,date_fns__WEBPACK_IMPORTED_MODULE_4__.addMonths)(new Date(), -1))\n    };\n  },\n  hasCustomRendering: false\n}];\nvar DatePicker = function DatePicker(_ref) {\n  var initialRange = _ref.initialRange,\n    onChange = _ref.onChange;\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(initialRange || {\n      startDate: new Date(),\n      endDate: new Date(),\n      key: \"selection\"\n    }),\n    _useState2 = _slicedToArray(_useState, 2),\n    range = _useState2[0],\n    setRange = _useState2[1];\n  var handleSelect = function handleSelect(ranges) {\n    var selection = ranges.selection;\n    var startDate = (0,date_fns__WEBPACK_IMPORTED_MODULE_8__.startOfDay)(new Date(selection.startDate));\n    var endDate = (0,date_fns__WEBPACK_IMPORTED_MODULE_5__.endOfDay)(new Date(selection.endDate));\n\n    // Try to find matching label\n    var label = null;\n    [].concat(customStaticRanges, allTimeRange).forEach(function (sr) {\n      var r = sr.range();\n      if ((0,date_fns__WEBPACK_IMPORTED_MODULE_8__.startOfDay)(r.startDate).getTime() === startDate.getTime() && (0,date_fns__WEBPACK_IMPORTED_MODULE_5__.endOfDay)(r.endDate).getTime() === endDate.getTime()) {\n        label = sr.label;\n      }\n    });\n    var newRange = {\n      startDate: startDate,\n      endDate: endDate,\n      key: \"selection\",\n      label: label\n    };\n    setRange(newRange);\n    if (onChange) {\n      onChange(newRange);\n    }\n  };\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_date_range__WEBPACK_IMPORTED_MODULE_1__.DateRangePicker, {\n    ranges: [range],\n    onChange: handleSelect,\n    maxDate: new Date(),\n    inputRanges: [],\n    staticRanges: (0,react_date_range__WEBPACK_IMPORTED_MODULE_1__.createStaticRanges)([].concat(customStaticRanges, allTimeRange)),\n    direction: \"horizontal\"\n  }));\n};\nvar getAllTimeRange = function getAllTimeRange() {\n  return _objectSpread(_objectSpread({}, allTimeRangeDefinition), {}, {\n    label: \"All Time\"\n  });\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DatePicker);\n\n//# sourceURL=webpack://shopcentral/./src/Components/shared/DatePicker.jsx?\n}");

/***/ },

/***/ "./src/Components/shared/ProFeatureModal.jsx"
/*!***************************************************!*\
  !*** ./src/Components/shared/ProFeatureModal.jsx ***!
  \***************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-header.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-overlay.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/heading.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n\n\n\nvar ProFeatureModal = function ProFeatureModal(_ref) {\n  var isOpen = _ref.isOpen,\n    onClose = _ref.onClose,\n    _ref$title = _ref.title,\n    title = _ref$title === void 0 ? \"Pro Feature\" : _ref$title,\n    description = _ref.description,\n    what = _ref.what,\n    how = _ref.how,\n    why = _ref.why;\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Modal, {\n    isOpen: isOpen,\n    onClose: onClose,\n    isCentered: true,\n    size: \"md\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.ModalOverlay, {\n    bg: \"blackAlpha.300\",\n    backdropFilter: \"blur(5px)\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.ModalContent, {\n    borderRadius: \"2xl\",\n    p: 4,\n    maxW: \"520px\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.ModalHeader, {\n    textAlign: \"center\",\n    pb: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.VStack, {\n    spacing: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Box, {\n    p: 3.5,\n    bg: \"orange.50\",\n    borderRadius: \"2xl\",\n    color: \"orange.500\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_13__.FiLock,\n    w: 8,\n    h: 8\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Heading, {\n    m: 0,\n    size: \"md\",\n    fontWeight: \"800\",\n    color: \"gray.800\"\n  }, title))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.ModalCloseButton, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.ModalBody, {\n    textAlign: \"left\",\n    py: 3\n  }, what || how || why ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.VStack, {\n    spacing: 3,\n    align: \"stretch\",\n    mb: 5\n  }, what && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Box, {\n    bg: \"gray.50\",\n    p: 3.5,\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"gray.200\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Text, {\n    m: 0,\n    fontWeight: \"700\",\n    fontSize: \"xs\",\n    color: \"purple.600\",\n    textTransform: \"uppercase\",\n    mb: 1.5,\n    display: \"flex\",\n    alignItems: \"center\",\n    gap: 1.5\n  }, \"\\uD83C\\uDFAF What is it?\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Text, {\n    m: 0,\n    fontSize: \"sm\",\n    color: \"gray.700\",\n    lineHeight: \"1.5\"\n  }, what)), how && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Box, {\n    bg: \"blue.50\",\n    p: 3.5,\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"blue.100\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Text, {\n    m: 0,\n    fontWeight: \"700\",\n    fontSize: \"xs\",\n    color: \"blue.600\",\n    textTransform: \"uppercase\",\n    mb: 1.5,\n    display: \"flex\",\n    alignItems: \"center\",\n    gap: 1.5\n  }, \"\\u2699\\uFE0F How it works\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Text, {\n    m: 0,\n    fontSize: \"sm\",\n    color: \"gray.700\",\n    lineHeight: \"1.5\"\n  }, how)), why && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Box, {\n    bg: \"green.50\",\n    p: 3.5,\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"green.100\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Text, {\n    m: 0,\n    fontWeight: \"700\",\n    fontSize: \"xs\",\n    color: \"green.600\",\n    textTransform: \"uppercase\",\n    mb: 1.5,\n    display: \"flex\",\n    alignItems: \"center\",\n    gap: 1.5\n  }, \"\\uD83D\\uDE80 Why you need it\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Text, {\n    m: 0,\n    fontSize: \"sm\",\n    color: \"gray.700\",\n    lineHeight: \"1.5\"\n  }, why))) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Text, {\n    color: \"gray.600\",\n    fontSize: \"md\",\n    mb: 6,\n    textAlign: \"center\"\n  }, description || \"This is a premium feature. Upgrade to ShopCentral Pro to unlock this and many other advanced capabilities.\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.VStack, {\n    spacing: 2.5\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Button, {\n    w: \"full\",\n    size: \"md\",\n    colorScheme: \"orange\",\n    borderRadius: \"xl\",\n    rightIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_13__.FiExternalLink, null),\n    py: 6,\n    fontSize: \"md\",\n    fontWeight: \"bold\",\n    shadow: \"md\",\n    _hover: {\n      shadow: \"lg\",\n      bg: \"orange.600\"\n    },\n    onClick: function onClick() {\n      var _window$shopCentralDa;\n      return window.open(\"http://dominopress.com/plugin/shopcentral?shop_url=\".concat((_window$shopCentralDa = window.shopCentralData) === null || _window$shopCentralDa === void 0 ? void 0 : _window$shopCentralDa.rootUrl), '_blank');\n    }\n  }, \"Upgrade to Pro\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Button, {\n    w: \"full\",\n    size: \"md\",\n    variant: \"ghost\",\n    color: \"gray.500\",\n    onClick: onClose,\n    borderRadius: \"xl\",\n    fontWeight: \"normal\"\n  }, \"Maybe Later\")))));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProFeatureModal);\n\n//# sourceURL=webpack://shopcentral/./src/Components/shared/ProFeatureModal.jsx?\n}");

/***/ },

/***/ "./src/Components/shared/UsageTrackingNotice.jsx"
/*!*******************************************************!*\
  !*** ./src/Components/shared/UsageTrackingNotice.jsx ***!
  \*******************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/icon-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/color-mode/color-mode-context.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/transition/collapse.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\nvar UsageTrackingNotice = function UsageTrackingNotice() {\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState2 = _slicedToArray(_useState, 2),\n    isVisible = _useState2[0],\n    setIsVisible = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)('pending'),\n    _useState4 = _slicedToArray(_useState3, 2),\n    status = _useState4[0],\n    setStatus = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState6 = _slicedToArray(_useState5, 2),\n    loading = _useState6[0],\n    setLoading = _useState6[1];\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    var fetchSettings = /*#__PURE__*/function () {\n      var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n        var response, trackingStatus, _t;\n        return _regenerator().w(function (_context) {\n          while (1) switch (_context.p = _context.n) {\n            case 0:\n              _context.p = 0;\n              _context.n = 1;\n              return axios__WEBPACK_IMPORTED_MODULE_11__[\"default\"].get('/settings');\n            case 1:\n              response = _context.v;\n              if (response.data.success) {\n                trackingStatus = response.data.data.usage_tracking;\n                setStatus(trackingStatus);\n                if (trackingStatus === 'pending') {\n                  setIsVisible(true);\n                }\n              }\n              _context.n = 3;\n              break;\n            case 2:\n              _context.p = 2;\n              _t = _context.v;\n              console.error('Failed to fetch settings', _t);\n            case 3:\n              return _context.a(2);\n          }\n        }, _callee, null, [[0, 2]]);\n      }));\n      return function fetchSettings() {\n        return _ref.apply(this, arguments);\n      };\n    }();\n    fetchSettings();\n  }, []);\n  var handleAction = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(value) {\n      var response, _t2;\n      return _regenerator().w(function (_context2) {\n        while (1) switch (_context2.p = _context2.n) {\n          case 0:\n            setLoading(true);\n            _context2.p = 1;\n            _context2.n = 2;\n            return axios__WEBPACK_IMPORTED_MODULE_11__[\"default\"].post('/settings', {\n              usage_tracking: value\n            });\n          case 2:\n            response = _context2.v;\n            if (response.data.success) {\n              setIsVisible(false);\n              setStatus(value);\n            }\n            _context2.n = 4;\n            break;\n          case 3:\n            _context2.p = 3;\n            _t2 = _context2.v;\n            console.error('Failed to update tracking setting', _t2);\n          case 4:\n            _context2.p = 4;\n            setLoading(false);\n            return _context2.f(4);\n          case 5:\n            return _context2.a(2);\n        }\n      }, _callee2, null, [[1, 3, 4, 5]]);\n    }));\n    return function handleAction(_x) {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  if (!isVisible) return null;\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Collapse, {\n    \"in\": isVisible,\n    animateOpacity: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Box, {\n    bg: (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.useColorModeValue)('blue.600', 'blue.500'),\n    color: \"white\",\n    px: 6,\n    py: 4,\n    borderRadius: \"2xl\",\n    mb: 6,\n    boxShadow: \"0 10px 15px -3px rgba(49, 130, 206, 0.2), 0 4px 6px -2px rgba(49, 130, 206, 0.1)\",\n    position: \"relative\",\n    overflow: \"hidden\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.IconButton, {\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_10__.FiX, null),\n    position: \"absolute\",\n    top: 4,\n    right: 4,\n    variant: \"ghost\",\n    color: \"whiteAlpha.800\",\n    _hover: {\n      bg: 'whiteAlpha.200',\n      color: 'white'\n    },\n    onClick: function onClick() {\n      return handleAction('no');\n    },\n    \"aria-label\": \"Close\",\n    size: \"sm\",\n    zIndex: 2\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Box, {\n    position: \"absolute\",\n    top: \"-10px\",\n    right: \"-10px\",\n    opacity: \"0.1\",\n    transform: \"rotate(15deg)\",\n    pointerEvents: \"none\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_10__.FiActivity,\n    fontSize: \"160px\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Flex, {\n    direction: \"row\",\n    align: \"start\",\n    justify: \"start\",\n    gap: 6,\n    position: \"relative\",\n    zIndex: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Box, {\n    bg: \"whiteAlpha.300\",\n    p: 4,\n    borderRadius: \"2xl\",\n    display: {\n      base: 'none',\n      md: 'flex'\n    },\n    alignItems: \"center\",\n    justifyContent: \"center\",\n    boxShadow: \"inner\",\n    flexShrink: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_10__.FiActivity,\n    fontSize: \"32px\",\n    color: \"white\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.VStack, {\n    align: \"start\",\n    spacing: 6,\n    flex: \"1\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Text, {\n    mt: 0,\n    fontWeight: \"800\",\n    fontSize: \"2xl\",\n    letterSpacing: \"-0.5px\",\n    mb: 1\n  }, \"Help us improve ShopCentral!\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Text, {\n    fontSize: \"md\",\n    opacity: 0.9,\n    fontWeight: \"500\",\n    maxW: \"3xl\",\n    lineHeight: \"tall\",\n    m: 0\n  }, \"Join our community-driven development! By sharing anonymous usage data, you help us identify performance bottlenecks and prioritize the features you use most. No personal data or store information is ever collected.\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Button, {\n    size: \"lg\",\n    variant: \"solid\",\n    bg: \"white\",\n    color: \"blue.600\",\n    _hover: {\n      bg: 'blue.50',\n      transform: 'translateY(-2px)',\n      shadow: 'xl'\n    },\n    _active: {\n      bg: 'blue.100',\n      transform: 'translateY(0)'\n    },\n    fontWeight: \"800\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_10__.FiCheck, null),\n    onClick: function onClick() {\n      return handleAction('yes');\n    },\n    isLoading: loading,\n    px: 10,\n    height: \"50px\",\n    borderRadius: \"2xl\",\n    fontSize: \"lg\"\n  }, \"Allow & Continue\")))));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (UsageTrackingNotice);\n\n//# sourceURL=webpack://shopcentral/./src/Components/shared/UsageTrackingNotice.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Analytics/AdvancedAnalytics.jsx"
/*!****************************************************************!*\
  !*** ./src/Pages/StoreManager/Analytics/AdvancedAnalytics.jsx ***!
  \****************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/grid.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/grid-item.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/simple-grid.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-arrow.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-trigger.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/skeleton/skeleton.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table-container.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tbody.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/td.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/th.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/thead.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tr.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/toast/use-toast.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/tooltip/tooltip.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_apexcharts__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! react-apexcharts */ \"./node_modules/react-apexcharts/dist/react-apexcharts.esm.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var react_icons_fa__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! react-icons/fa */ \"./node_modules/react-icons/fa/index.mjs\");\n/* harmony import */ var _Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../../../Components/shared/DatePicker */ \"./src/Components/shared/DatePicker.jsx\");\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\n\n\n\nvar StatCard = function StatCard(_ref) {\n  var title = _ref.title,\n    value = _ref.value,\n    icon = _ref.icon,\n    loading = _ref.loading,\n    prefixHtml = _ref.prefixHtml;\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Card, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.HStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    p: 3,\n    bg: \"blue.100\",\n    color: \"blue.600\",\n    borderRadius: \"lg\"\n  }, icon), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.VStack, {\n    align: \"start\",\n    spacing: 0,\n    flex: \"1\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    mb: 0,\n    color: \"gray.500\",\n    fontSize: \"sm\",\n    fontWeight: \"medium\"\n  }, title), loading ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Skeleton, {\n    h: \"30px\",\n    w: \"100px\",\n    mt: 1\n  }) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    mt: 0,\n    fontSize: \"2xl\",\n    fontWeight: \"bold\"\n  }, prefixHtml && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n    dangerouslySetInnerHTML: {\n      __html: prefixHtml\n    }\n  }), value)))));\n};\nvar AdvancedAnalytics = function AdvancedAnalytics() {\n  var _data$leaderboard$, _data$leaderboard$2, _data$leaderboard$3;\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_34__.getAllTimeRange)()),\n    _useState2 = _slicedToArray(_useState, 2),\n    dateRange = _useState2[0],\n    setDateRange = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),\n    _useState4 = _slicedToArray(_useState3, 2),\n    loading = _useState4[0],\n    setLoading = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({\n      leaderboard: [],\n      chart_series: [],\n      chart_categories: [],\n      country_labels: [],\n      country_series: [],\n      top_products: [],\n      network_total: 0\n    }),\n    _useState6 = _slicedToArray(_useState5, 2),\n    data = _useState6[0],\n    setData = _useState6[1];\n  var toast = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.useToast)();\n  var fetchAnalytics = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n      var _res$data, params, res, _t;\n      return _regenerator().w(function (_context) {\n        while (1) switch (_context.p = _context.n) {\n          case 0:\n            _context.p = 0;\n            setLoading(true);\n            params = {\n              after: dateRange !== null && dateRange !== void 0 && dateRange.startDate ? dateRange.startDate.toISOString().split('.')[0] + 'Z' : undefined,\n              before: dateRange !== null && dateRange !== void 0 && dateRange.endDate ? dateRange.endDate.toISOString().split('.')[0] + 'Z' : undefined\n            };\n            _context.n = 1;\n            return axios__WEBPACK_IMPORTED_MODULE_31__[\"default\"].get('/api/store-manager/advanced-analytics', {\n              params: params\n            });\n          case 1:\n            res = _context.v;\n            if ((_res$data = res.data) !== null && _res$data !== void 0 && _res$data.data) {\n              setData(res.data.data);\n            }\n            _context.n = 3;\n            break;\n          case 2:\n            _context.p = 2;\n            _t = _context.v;\n            toast({\n              title: 'Failed to fetch advanced analytics',\n              status: 'error'\n            });\n          case 3:\n            _context.p = 3;\n            setLoading(false);\n            return _context.f(3);\n          case 4:\n            return _context.a(2);\n        }\n      }, _callee, null, [[0, 2, 3, 4]]);\n    }));\n    return function fetchAnalytics() {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    fetchAnalytics();\n  }, [dateRange]);\n  var chartOptions = {\n    chart: {\n      type: 'bar',\n      stacked: true,\n      toolbar: {\n        show: false\n      },\n      zoom: {\n        enabled: false\n      }\n    },\n    colors: ['#3182CE', '#E53E3E', '#38A169', '#D69E2E', '#805AD5', '#DD6B20', '#319795', '#D53F8C', '#00B5D8', '#4A5568'],\n    xaxis: {\n      categories: data.chart_categories\n    },\n    yaxis: {\n      labels: {\n        formatter: function formatter(val) {\n          return \"$\".concat(val.toFixed(0));\n        }\n      }\n    },\n    legend: {\n      position: 'top'\n    },\n    fill: {\n      opacity: 1\n    },\n    dataLabels: {\n      enabled: false\n    }\n  };\n  var countryChartOptions = {\n    chart: {\n      type: 'pie'\n    },\n    labels: data.country_labels || [],\n    legend: {\n      position: 'bottom'\n    },\n    stroke: {\n      colors: ['#fff']\n    },\n    fill: {\n      opacity: 1\n    },\n    dataLabels: {\n      enabled: false\n    },\n    tooltip: {\n      y: {\n        formatter: function formatter(val) {\n          return \"$\" + Number(val).toFixed(2);\n        }\n      }\n    }\n  };\n  var taxChartOptions = {\n    chart: {\n      type: 'bar',\n      toolbar: {\n        show: false\n      }\n    },\n    xaxis: {\n      categories: data.leaderboard.map(function (s) {\n        return s.store_name;\n      })\n    },\n    yaxis: {\n      labels: {\n        formatter: function formatter(val) {\n          return \"$\".concat(val.toFixed(0));\n        }\n      }\n    },\n    colors: ['#E53E3E'],\n    dataLabels: {\n      enabled: false\n    }\n  };\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Flex, {\n    justify: \"space-between\",\n    align: \"center\",\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.VStack, {\n    align: \"start\",\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    mb: 0,\n    fontSize: \"2xl\",\n    fontWeight: \"bold\"\n  }, \"All Store Performance\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    mt: \"0\",\n    color: \"gray.500\",\n    fontSize: \"sm\"\n  }, \"Compare stores and track network performance\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.HStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Popover, {\n    placement: \"bottom-end\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.PopoverTrigger, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Icon, {\n      as: react_icons_fa__WEBPACK_IMPORTED_MODULE_33__.FaCalendar\n    }),\n    variant: \"outline\",\n    bg: \"white\",\n    size: \"md\",\n    fontWeight: \"600\"\n  }, dateRange.label ? dateRange.label : dateRange.startDate ? \"\".concat(dateRange.startDate.toLocaleDateString(), \" - \").concat(dateRange.endDate.toLocaleDateString()) : \"Select Dates\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.PopoverContent, {\n    w: \"auto\",\n    borderRadius: \"xl\",\n    shadow: \"2xl\",\n    border: \"none\",\n    zIndex: 10\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.PopoverArrow, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.PopoverCloseButton, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.PopoverBody, {\n    p: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_34__[\"default\"], {\n    initialRange: dateRange,\n    onChange: function onChange(range) {\n      return setDateRange(range);\n    }\n  })))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.SimpleGrid, {\n    columns: {\n      base: 1,\n      md: 2,\n      lg: 4\n    },\n    spacing: 6,\n    mb: 8\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(StatCard, {\n    title: \"Total Revenue\",\n    value: data.network_total.toFixed(2),\n    prefixHtml: ((_data$leaderboard$ = data.leaderboard[0]) === null || _data$leaderboard$ === void 0 ? void 0 : _data$leaderboard$.currency) || '$',\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_32__.FiDollarSign, {\n      size: 24\n    }),\n    loading: loading\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(StatCard, {\n    title: \"Total Orders\",\n    value: data.leaderboard.reduce(function (acc, s) {\n      return acc + s.orders;\n    }, 0),\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_32__.FiShoppingCart, {\n      size: 24\n    }),\n    loading: loading\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(StatCard, {\n    title: \"Average AOV\",\n    value: (data.leaderboard.reduce(function (acc, s) {\n      return acc + s.aov;\n    }, 0) / (data.leaderboard.length || 1)).toFixed(2),\n    prefixHtml: ((_data$leaderboard$2 = data.leaderboard[0]) === null || _data$leaderboard$2 === void 0 ? void 0 : _data$leaderboard$2.currency) || '$',\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_32__.FiTrendingUp, {\n      size: 24\n    }),\n    loading: loading\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(StatCard, {\n    title: \"Avg Returning Rate\",\n    value: \"\".concat((data.leaderboard.reduce(function (acc, s) {\n      return acc + s.returning_pct;\n    }, 0) / (data.leaderboard.length || 1)).toFixed(1), \"%\"),\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_32__.FiRefreshCcw, {\n      size: 24\n    }),\n    loading: loading\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Grid, {\n    templateColumns: {\n      base: \"1fr\",\n      xl: \"repeat(5, 1fr)\"\n    },\n    gap: 8,\n    mb: 8\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.GridItem, {\n    colSpan: {\n      base: 1,\n      xl: 2\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Card, {\n    h: \"full\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    fontSize: \"lg\",\n    fontWeight: \"bold\",\n    mb: 4\n  }, \"Revenue Comparison\"), loading ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Skeleton, {\n    height: \"350px\"\n  }) : data.chart_series.length > 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_apexcharts__WEBPACK_IMPORTED_MODULE_30__[\"default\"], {\n    options: chartOptions,\n    series: data.chart_series,\n    type: \"bar\",\n    height: 380\n  }) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Flex, {\n    h: \"350px\",\n    align: \"center\",\n    justify: \"center\",\n    color: \"gray.500\"\n  }, \"No chart data available for this period.\")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.GridItem, {\n    colSpan: {\n      base: 1,\n      xl: 3\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Card, {\n    h: \"full\",\n    overflow: \"hidden\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    p: 4,\n    borderBottom: \"1px\",\n    borderColor: \"gray.100\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    fontSize: \"lg\",\n    fontWeight: \"bold\"\n  }, \"Top Performing Products (All Stores)\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.TableContainer, {\n    overflowY: \"auto\",\n    className: \"shopcentral-scrollbar\",\n    maxH: \"445px\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Table, {\n    variant: \"simple\",\n    size: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Thead, {\n    bg: \"gray.50\",\n    position: \"sticky\",\n    top: 0,\n    zIndex: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Th, null, \"Product\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Th, null, \"Store\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Th, {\n    isNumeric: true\n  }, \"Orders\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Th, {\n    isNumeric: true\n  }, \"Sold\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Th, {\n    isNumeric: true\n  }, \"Revenue\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Tbody, null, loading ? [1, 2, 3, 4, 5].map(function (i) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Tr, {\n      key: i\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Td, {\n      colSpan: 5\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Skeleton, {\n      h: \"40px\"\n    })));\n  }) : data.top_products.length > 0 ? data.top_products.map(function (p, i) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Tr, {\n      key: i\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.HStack, {\n      spacing: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n      boxSize: \"32px\",\n      borderRadius: \"md\",\n      overflow: \"hidden\",\n      flexShrink: 0,\n      border: \"1px\",\n      borderColor: \"gray.100\",\n      bg: \"gray.50\"\n    }, p.image ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"img\", {\n      src: p.image,\n      alt: p.name,\n      style: {\n        width: '100%',\n        height: '100%',\n        objectFit: 'cover'\n      },\n      onError: function onError(e) {\n        e.target.style.display = 'none';\n      }\n    }) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Flex, {\n      align: \"center\",\n      justify: \"center\",\n      h: \"100%\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_32__.FiShoppingCart, {\n      color: \"gray.400\",\n      size: 12\n    }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n      fontSize: \"xs\",\n      fontWeight: \"bold\",\n      noOfLines: 1,\n      title: p.name,\n      maxW: \"200px\"\n    }, p.name))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Badge, {\n      colorScheme: \"gray\",\n      variant: \"outline\",\n      fontSize: \"2xs\"\n    }, p.store_name)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Td, {\n      isNumeric: true,\n      fontSize: \"xs\"\n    }, p.orders), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Td, {\n      isNumeric: true\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Badge, {\n      colorScheme: \"blue\",\n      variant: \"subtle\",\n      borderRadius: \"full\",\n      px: 2,\n      fontSize: \"2xs\"\n    }, p.quantity)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Td, {\n      isNumeric: true,\n      fontWeight: \"bold\",\n      color: \"green.600\",\n      fontSize: \"xs\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      dangerouslySetInnerHTML: {\n        __html: p.currency\n      }\n    }), p.revenue.toFixed(2)));\n  }) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Td, {\n    colSpan: 5,\n    textAlign: \"center\",\n    py: 10,\n    color: \"gray.500\"\n  }, \"No products sold recently.\")))))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.SimpleGrid, {\n    columns: {\n      base: 1,\n      lg: 2\n    },\n    spacing: 8,\n    mb: 8\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Card, {\n    h: \"full\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Flex, {\n    justify: \"space-between\",\n    align: \"center\",\n    mb: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    fontSize: \"lg\",\n    fontWeight: \"bold\"\n  }, \"Revenue by Country\"), !loading && data.network_total > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Badge, {\n    colorScheme: \"green\",\n    fontSize: \"sm\",\n    px: 2,\n    py: 1,\n    borderRadius: \"md\"\n  }, \"Total: \", ((_data$leaderboard$3 = data.leaderboard[0]) === null || _data$leaderboard$3 === void 0 ? void 0 : _data$leaderboard$3.currency) || '$', data.network_total.toFixed(2))), loading ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Skeleton, {\n    height: \"300px\"\n  }) : data.country_series && data.country_series.length > 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Flex, {\n    justify: \"center\",\n    align: \"center\",\n    h: \"350px\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_apexcharts__WEBPACK_IMPORTED_MODULE_30__[\"default\"], {\n    options: countryChartOptions,\n    series: data.country_series,\n    type: \"pie\",\n    width: \"100%\"\n  })) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Flex, {\n    h: \"300px\",\n    align: \"center\",\n    justify: \"center\",\n    color: \"gray.500\"\n  }, \"No country data available for this period.\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Card, {\n    h: \"full\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    fontSize: \"lg\",\n    fontWeight: \"bold\",\n    mb: 4\n  }, \"Tax Collected per Store\"), loading ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Skeleton, {\n    height: \"300px\"\n  }) : data.leaderboard.length > 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_apexcharts__WEBPACK_IMPORTED_MODULE_30__[\"default\"], {\n    options: taxChartOptions,\n    series: [{\n      name: 'Tax',\n      data: data.leaderboard.map(function (s) {\n        return s.taxes;\n      })\n    }],\n    type: \"bar\",\n    height: 350\n  }) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Flex, {\n    h: \"300px\",\n    align: \"center\",\n    justify: \"center\",\n    color: \"gray.500\"\n  }, \"No tax data available.\")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Card, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    p: 5,\n    borderBottom: \"1px\",\n    borderColor: \"gray.100\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    my: \"0\",\n    fontSize: \"lg\",\n    fontWeight: \"bold\"\n  }, \"Store Performance Leaderboard\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.TableContainer, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Table, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Thead, {\n    bg: \"gray.50\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Th, null, \"Store\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Th, {\n    isNumeric: true\n  }, \"Revenue\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Th, {\n    isNumeric: true\n  }, \"Taxes\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Th, {\n    isNumeric: true\n  }, \"Orders\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Th, {\n    isNumeric: true\n  }, \"AOV\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Th, {\n    isNumeric: true\n  }, \"Conv. Rate\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Th, {\n    isNumeric: true\n  }, \"Refunds\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Th, {\n    isNumeric: true\n  }, \"Retention\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Tbody, null, loading ? [1, 2, 3].map(function (i) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Tr, {\n      key: i\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Td, {\n      colSpan: 8\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Skeleton, {\n      h: \"30px\"\n    })));\n  }) : data.leaderboard.length === 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Td, {\n    colSpan: 8,\n    textAlign: \"center\",\n    py: 10\n  }, \"No active stores\")) : data.leaderboard.map(function (store, idx) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Tr, {\n      key: store.store_id,\n      bg: idx === 0 ? \"yellow.50\" : \"transparent\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.HStack, null, idx === 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Badge, {\n      colorScheme: \"yellow\",\n      mr: 2\n    }, \"#1\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n      fontWeight: \"bold\"\n    }, store.store_name))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Td, {\n      isNumeric: true,\n      fontWeight: \"bold\",\n      color: \"blue.600\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      dangerouslySetInnerHTML: {\n        __html: store.currency\n      }\n    }), store.revenue.toFixed(2)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Td, {\n      isNumeric: true,\n      fontWeight: \"bold\",\n      color: \"red.500\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      dangerouslySetInnerHTML: {\n        __html: store.currency\n      }\n    }), store.taxes.toFixed(2)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Td, {\n      isNumeric: true\n    }, store.orders), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Td, {\n      isNumeric: true\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      dangerouslySetInnerHTML: {\n        __html: store.currency\n      }\n    }), store.aov.toFixed(2)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Td, {\n      isNumeric: true\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Tooltip, {\n      label: \"Requires Jetpack or WC Admin Stats to track true visits\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Badge, {\n      colorScheme: \"gray\"\n    }, \"N/A\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Td, {\n      isNumeric: true\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Badge, {\n      colorScheme: store.refund_rate > 5 ? 'red' : 'green'\n    }, store.refund_rate.toFixed(1), \"%\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Td, {\n      isNumeric: true\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n      color: \"purple.600\",\n      fontWeight: \"medium\"\n    }, store.returning_pct.toFixed(1), \"%\")));\n  }))))));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AdvancedAnalytics);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Analytics/AdvancedAnalytics.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Analytics/ProductAnalytics.jsx"
/*!***************************************************************!*\
  !*** ./src/Pages/StoreManager/Analytics/ProductAnalytics.jsx ***!
  \***************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/simple-grid.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/image/image.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-arrow.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-trigger.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/skeleton/skeleton.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stat/stat.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stat/stat-help-text.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stat/stat-label.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stat/stat-number.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tbody.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/td.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/th.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/thead.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tr.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/heading.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var _Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../../../Components/shared/DatePicker */ \"./src/Components/shared/DatePicker.jsx\");\n/* harmony import */ var react_icons_fa__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! react-icons/fa */ \"./node_modules/react-icons/fa/index.mjs\");\n/* harmony import */ var react_apexcharts__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! react-apexcharts */ \"./node_modules/react-apexcharts/dist/react-apexcharts.esm.js\");\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\n\n\n\nvar MetricCard = function MetricCard(_ref) {\n  var label = _ref.label,\n    value = _ref.value,\n    icon = _ref.icon,\n    color = _ref.color,\n    helpText = _ref.helpText;\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Card, {\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.CardBody, {\n    p: 5\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Stat, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Flex, {\n    align: \"center\",\n    justify: \"space-between\",\n    mb: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.StatLabel, {\n    fontSize: \"sm\",\n    color: \"gray.500\",\n    fontWeight: \"bold\",\n    textTransform: \"uppercase\",\n    letterSpacing: \"wide\"\n  }, label), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.StatNumber, {\n    fontSize: \"3xl\",\n    fontWeight: \"800\",\n    mt: 1\n  }, value)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Flex, {\n    align: \"center\",\n    justify: \"center\",\n    w: 12,\n    h: 12,\n    borderRadius: \"xl\",\n    bg: \"\".concat(color, \".50\"),\n    color: \"\".concat(color, \".500\")\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Icon, {\n    as: icon,\n    size: 24\n  }))), helpText && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.StatHelpText, {\n    mb: 0,\n    fontSize: \"sm\",\n    color: \"gray.500\"\n  }, helpText))));\n};\nvar ProductTable = function ProductTable(_ref2) {\n  var title = _ref2.title,\n    products = _ref2.products,\n    _ref2$showRevenue = _ref2.showRevenue,\n    showRevenue = _ref2$showRevenue === void 0 ? false : _ref2$showRevenue,\n    _ref2$emptyText = _ref2.emptyText,\n    emptyText = _ref2$emptyText === void 0 ? \"No products found\" : _ref2$emptyText,\n    formatCurrency = _ref2.formatCurrency;\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Card, {\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\",\n    h: \"full\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.CardBody, {\n    p: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    p: 5,\n    borderBottom: \"1px\",\n    borderColor: \"gray.100\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Heading, {\n    size: \"md\",\n    fontWeight: \"700\"\n  }, title)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    overflowX: \"auto\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Table, {\n    variant: \"simple\",\n    size: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Thead, {\n    bg: \"gray.50\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Th, {\n    py: 3\n  }, \"Product\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Th, {\n    py: 3,\n    isNumeric: true\n  }, showRevenue ? 'Revenue' : 'Sold'), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Th, {\n    py: 3,\n    isNumeric: true\n  }, \"Stock\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Tbody, null, (products === null || products === void 0 ? void 0 : products.length) > 0 ? products.map(function (product) {\n    var _product$images;\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Tr, {\n      key: product.id,\n      _hover: {\n        bg: \"gray.50\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n      py: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.HStack, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Image, {\n      src: ((_product$images = product.images) === null || _product$images === void 0 || (_product$images = _product$images[0]) === null || _product$images === void 0 ? void 0 : _product$images.src) || 'https://via.placeholder.com/40',\n      boxSize: \"40px\",\n      objectFit: \"cover\",\n      borderRadius: \"md\",\n      fallbackSrc: \"https://via.placeholder.com/40?text=No+img\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.VStack, {\n      align: \"start\",\n      spacing: 0,\n      maxW: \"200px\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Text, {\n      m: 0,\n      fontWeight: \"600\",\n      fontSize: \"sm\",\n      noOfLines: 1\n    }, product.name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Text, {\n      m: 0,\n      fontSize: \"xs\",\n      color: \"gray.500\"\n    }, \"ID: \", product.id)))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n      isNumeric: true,\n      fontWeight: \"bold\",\n      color: \"blue.600\"\n    }, showRevenue ? formatCurrency ? formatCurrency(product.revenue || product.price * product.total_sales) : (product.revenue || product.price * product.total_sales).toFixed(2) : product.total_sales), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n      isNumeric: true\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Badge, {\n      colorScheme: product.stock_status === 'instock' ? 'green' : 'red',\n      variant: \"subtle\"\n    }, product.stock_status === 'instock' ? 'In Stock' : 'Out')));\n  }) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n    colSpan: 3,\n    textAlign: \"center\",\n    py: 8,\n    color: \"gray.500\"\n  }, emptyText)))))));\n};\n\nvar SalesTrendChart = function SalesTrendChart(_ref3) {\n  var trends = _ref3.trends,\n    currencyCode = _ref3.currencyCode;\n  var validTrends = (trends === null || trends === void 0 ? void 0 : trends.filter(function (t) {\n    return t.date;\n  })) || [];\n  var series = [{\n    name: 'Revenue',\n    data: validTrends.map(function (t) {\n      return t.revenue;\n    }) || []\n  }, {\n    name: 'Orders',\n    data: validTrends.map(function (t) {\n      return t.orders;\n    }) || []\n  }];\n  var options = {\n    chart: {\n      type: 'area',\n      height: 350,\n      toolbar: {\n        show: false\n      },\n      zoom: {\n        enabled: false\n      }\n    },\n    dataLabels: {\n      enabled: false\n    },\n    stroke: {\n      curve: 'smooth',\n      width: 2\n    },\n    colors: ['#805AD5', '#3182CE'],\n    // Purple for Revenue, Blue for Orders\n    fill: {\n      type: 'gradient',\n      gradient: {\n        shadeIntensity: 1,\n        opacityFrom: 0.45,\n        opacityTo: 0.05,\n        stops: [20, 100]\n      }\n    },\n    xaxis: {\n      categories: (trends === null || trends === void 0 ? void 0 : trends.filter(function (t) {\n        return t.date;\n      }).map(function (t) {\n        var iso = String(t.date).replace(' ', 'T').split('T')[0];\n        var d = new Date(iso + 'T00:00:00');\n        return isNaN(d.getTime()) ? t.date : d.toLocaleDateString(undefined, {\n          month: 'short',\n          day: 'numeric'\n        });\n      })) || [],\n      axisBorder: {\n        show: false\n      },\n      axisTicks: {\n        show: false\n      }\n    },\n    yaxis: [{\n      title: {\n        text: 'Revenue'\n      },\n      labels: {\n        formatter: function formatter(value) {\n          return new Intl.NumberFormat('en-US', {\n            style: 'currency',\n            currency: currencyCode || 'USD',\n            maximumFractionDigits: 0\n          }).format(value);\n        }\n      }\n    }, {\n      opposite: true,\n      title: {\n        text: 'Orders'\n      },\n      labels: {\n        formatter: function formatter(value) {\n          return value.toFixed(0);\n        }\n      }\n    }],\n    grid: {\n      borderColor: '#f1f1f1',\n      padding: {\n        top: 0,\n        right: 0,\n        bottom: 0,\n        left: 10\n      }\n    },\n    tooltip: {\n      x: {\n        format: 'dd MMM yyyy'\n      },\n      y: {\n        formatter: function formatter(val, _ref4) {\n          var seriesIndex = _ref4.seriesIndex;\n          if (seriesIndex === 0) {\n            return new Intl.NumberFormat('en-US', {\n              style: 'currency',\n              currency: currencyCode || 'USD'\n            }).format(val);\n          }\n          return val;\n        }\n      }\n    }\n  };\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Card, {\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.CardBody, {\n    p: 5\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Heading, {\n    size: \"md\",\n    mb: 6,\n    fontWeight: \"700\"\n  }, \"\\uD83D\\uDCC8 Sales Trends\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_apexcharts__WEBPACK_IMPORTED_MODULE_35__[\"default\"], {\n    options: options,\n    series: series,\n    type: \"area\",\n    height: 300\n  })));\n};\nvar ProductAnalytics = function ProductAnalytics() {\n  var _data$stats3;\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState2 = _slicedToArray(_useState, 2),\n    data = _useState2[0],\n    setData = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),\n    _useState4 = _slicedToArray(_useState3, 2),\n    loading = _useState4[0],\n    setLoading = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_33__.getAllTimeRange)()),\n    _useState6 = _slicedToArray(_useState5, 2),\n    dateRange = _useState6[0],\n    setDateRange = _useState6[1];\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    var fetchAnalytics = /*#__PURE__*/function () {\n      var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n        var params, _yield$axios$get, _data, _t;\n        return _regenerator().w(function (_context) {\n          while (1) switch (_context.p = _context.n) {\n            case 0:\n              setLoading(true);\n              _context.p = 1;\n              params = {\n                after: dateRange !== null && dateRange !== void 0 && dateRange.startDate ? dateRange.startDate.toISOString().split('.')[0] + 'Z' : undefined,\n                before: dateRange !== null && dateRange !== void 0 && dateRange.endDate ? dateRange.endDate.toISOString().split('.')[0] + 'Z' : undefined\n              };\n              _context.n = 2;\n              return axios__WEBPACK_IMPORTED_MODULE_32__[\"default\"].get('/api/store-manager/analytics/products', {\n                params: params\n              });\n            case 2:\n              _yield$axios$get = _context.v;\n              _data = _yield$axios$get.data;\n              setData(_data);\n              _context.n = 4;\n              break;\n            case 3:\n              _context.p = 3;\n              _t = _context.v;\n              console.error(\"Failed to fetch product analytics\", _t);\n            case 4:\n              _context.p = 4;\n              setLoading(false);\n              return _context.f(4);\n            case 5:\n              return _context.a(2);\n          }\n        }, _callee, null, [[1, 3, 4, 5]]);\n      }));\n      return function fetchAnalytics() {\n        return _ref5.apply(this, arguments);\n      };\n    }();\n    fetchAnalytics();\n  }, [dateRange]);\n  var formatCurrency = function formatCurrency(amount) {\n    try {\n      var _data$stats;\n      return new Intl.NumberFormat('en-US', {\n        style: 'currency',\n        currency: (data === null || data === void 0 || (_data$stats = data.stats) === null || _data$stats === void 0 ? void 0 : _data$stats.currency_code) || 'USD'\n      }).format(amount);\n    } catch (e) {\n      var _data$stats2;\n      return \"\".concat((data === null || data === void 0 || (_data$stats2 = data.stats) === null || _data$stats2 === void 0 ? void 0 : _data$stats2.currency_symbol) || '$').concat(amount);\n    }\n  };\n  if (loading) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n      mb: 8\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Skeleton, {\n      height: \"30px\",\n      width: \"200px\",\n      mb: 2\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Skeleton, {\n      height: \"20px\",\n      width: \"400px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.SimpleGrid, {\n      columns: {\n        base: 1,\n        md: 2,\n        lg: 4\n      },\n      spacing: 6,\n      mb: 8\n    }, [1, 2, 3, 4].map(function (i) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Card, {\n        key: i,\n        borderRadius: \"xl\",\n        border: \"1px\",\n        borderColor: \"gray.100\",\n        shadow: \"sm\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.CardBody, {\n        p: 5\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Flex, {\n        align: \"center\",\n        justify: \"space-between\",\n        mb: 2\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Skeleton, {\n        height: \"15px\",\n        width: \"100px\",\n        mb: 2\n      }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Skeleton, {\n        height: \"30px\",\n        width: \"80px\"\n      })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Skeleton, {\n        height: \"48px\",\n        width: \"48px\",\n        borderRadius: \"xl\"\n      })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Skeleton, {\n        height: \"15px\",\n        width: \"150px\"\n      })));\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.SimpleGrid, {\n      columns: {\n        base: 1,\n        lg: 2\n      },\n      spacing: 6,\n      mb: 8\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Skeleton, {\n      height: \"300px\",\n      borderRadius: \"xl\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Skeleton, {\n      height: \"300px\",\n      borderRadius: \"xl\"\n    })));\n  }\n  if (!data) return null;\n  var stats = data.stats,\n    top_selling = data.top_selling,\n    no_sales = data.no_sales,\n    top_revenue_products = data.top_revenue_products,\n    trends = data.trends;\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    animation: \"fadeIn 0.5s ease-out\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Flex, {\n    direction: {\n      base: \"column\",\n      md: \"row\"\n    },\n    justify: \"space-between\",\n    align: {\n      base: \"start\",\n      md: \"center\"\n    },\n    mb: 8,\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Heading, {\n    size: \"lg\",\n    fontWeight: \"800\",\n    mb: 2\n  }, \"Product Analytics\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Text, {\n    mt: 0,\n    color: \"gray.500\"\n  }, \"Insights into your inventory performance and sales trends.\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Popover, {\n    placement: \"bottom-end\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.PopoverTrigger, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fa__WEBPACK_IMPORTED_MODULE_34__.FaCalendar, null),\n    variant: \"outline\",\n    bg: \"white\"\n  }, dateRange.label ? dateRange.label : dateRange.startDate ? \"\".concat(dateRange.startDate.toLocaleDateString(), \" - \").concat(dateRange.endDate.toLocaleDateString()) : \"Select Dates\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.PopoverContent, {\n    w: \"auto\",\n    maxW: \"unset\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.PopoverArrow, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.PopoverCloseButton, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.PopoverBody, {\n    p: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_33__[\"default\"], {\n    initialRange: dateRange,\n    onChange: function onChange(range) {\n      return setDateRange(range);\n    }\n  }))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.SimpleGrid, {\n    columns: {\n      base: 1,\n      md: 2,\n      lg: 4\n    },\n    spacing: 6,\n    mb: 8\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(MetricCard, {\n    label: \"Total Products\",\n    value: stats.total_products,\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_31__.FiBox,\n    color: \"blue\",\n    helpText: \"Active catalog size\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(MetricCard, {\n    label: \"Out of Stock\",\n    value: stats.out_of_stock,\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_31__.FiAlertTriangle,\n    color: \"red\",\n    helpText: \"Immediate attention needed\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(MetricCard, {\n    label: \"Total Orders\",\n    value: stats.total_orders,\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_31__.FiShoppingBag,\n    color: \"green\",\n    helpText: \"Lifetime order volume\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(MetricCard, {\n    label: \"Total Revenue\",\n    value: formatCurrency(stats.total_revenue),\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_31__.FiDollarSign,\n    color: \"purple\",\n    helpText: \"Lifetime gross sales\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.SimpleGrid, {\n    columns: {\n      base: 1,\n      lg: 2\n    },\n    spacing: 6,\n    mb: 8\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ProductTable, {\n    title: \"\\uD83C\\uDFC6 Top Selling Products\",\n    products: top_selling,\n    formatCurrency: formatCurrency\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(SalesTrendChart, {\n    trends: trends,\n    currencyCode: data === null || data === void 0 || (_data$stats3 = data.stats) === null || _data$stats3 === void 0 ? void 0 : _data$stats3.currency_code\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.SimpleGrid, {\n    columns: {\n      base: 1,\n      lg: 2\n    },\n    spacing: 6,\n    mb: 8\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ProductTable, {\n    title: \"\\uD83D\\uDEAB Zero Sales Products\",\n    products: no_sales,\n    emptyText: \"Great job! All products have sales.\",\n    formatCurrency: formatCurrency\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ProductTable, {\n    title: \"\\uD83D\\uDCB0 Top Revenue Products\",\n    products: top_revenue_products,\n    showRevenue: true,\n    formatCurrency: formatCurrency\n  })));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductAnalytics);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Analytics/ProductAnalytics.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Automation/AutomationRules.jsx"
/*!***************************************************************!*\
  !*** ./src/Pages/StoreManager/Automation/AutomationRules.jsx ***!
  \***************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/hooks/dist/esm/use-disclosure.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/icon-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/checkbox/checkbox.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-control.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-error.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-label.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/grid.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-footer.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-overlay.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/select/select.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/switch/switch.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table-container.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tbody.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/td.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/th.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/thead.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tr.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/tooltip/tooltip.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/heading.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! react-hot-toast */ \"./node_modules/react-hot-toast/dist/index.mjs\");\n/* harmony import */ var _Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ../../../Components/shared/ConfirmDialog */ \"./src/Components/shared/ConfirmDialog.jsx\");\n/* harmony import */ var _Components_ProductPicker__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ../../../Components/ProductPicker */ \"./src/Components/ProductPicker.jsx\");\n/* harmony import */ var _Components_shared_ProFeatureModal__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ../../../Components/shared/ProFeatureModal */ \"./src/Components/shared/ProFeatureModal.jsx\");\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 _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\n\n\n\n\nvar AutomationRules = function AutomationRules() {\n  var _window$shopCentralDa, _currentRule$target_i;\n  var _useDisclosure = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.useDisclosure)(),\n    isOpen = _useDisclosure.isOpen,\n    onOpen = _useDisclosure.onOpen,\n    onClose = _useDisclosure.onClose;\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState2 = _slicedToArray(_useState, 2),\n    rules = _useState2[0],\n    setRules = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState4 = _slicedToArray(_useState3, 2),\n    logs = _useState4[0],\n    setLogs = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState6 = _slicedToArray(_useState5, 2),\n    isLoading = _useState6[0],\n    setIsLoading = _useState6[1];\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState8 = _slicedToArray(_useState7, 2),\n    isSaving = _useState8[0],\n    setIsSaving = _useState8[1];\n  var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({}),\n    _useState0 = _slicedToArray(_useState9, 2),\n    formErrors = _useState0[0],\n    setFormErrors = _useState0[1];\n  var _useDisclosure2 = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.useDisclosure)(),\n    isConfirmOpen = _useDisclosure2.isOpen,\n    onConfirmOpen = _useDisclosure2.onOpen,\n    onConfirmClose = _useDisclosure2.onClose;\n  var _useState1 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState10 = _slicedToArray(_useState1, 2),\n    ruleToDelete = _useState10[0],\n    setRuleToDelete = _useState10[1];\n  var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState12 = _slicedToArray(_useState11, 2),\n    isDeleting = _useState12[0],\n    setIsDeleting = _useState12[1];\n  var _useDisclosure3 = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.useDisclosure)(),\n    isProModalOpen = _useDisclosure3.isOpen,\n    onProModalOpen = _useDisclosure3.onOpen,\n    onProModalClose = _useDisclosure3.onClose;\n  var isPro = (_window$shopCentralDa = window.shopCentralData) === null || _window$shopCentralDa === void 0 ? void 0 : _window$shopCentralDa.isPro;\n  var _useDisclosure4 = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.useDisclosure)(),\n    isPickerOpen = _useDisclosure4.isOpen,\n    onPickerOpen = _useDisclosure4.onOpen,\n    onPickerClose = _useDisclosure4.onClose;\n  var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState14 = _slicedToArray(_useState13, 2),\n    categories = _useState14[0],\n    setCategories = _useState14[1];\n  var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({\n      id: \"\",\n      name: \"\",\n      trigger: \"stock_below\",\n      condition_value: \"\",\n      time_value: \"\",\n      action: \"send_email\",\n      action_type: \"percentage\",\n      action_value: \"\",\n      threshold_step: \"\",\n      target_type: \"global\",\n      target_items: [],\n      apply_once: false,\n      priority: 10,\n      max_discount_cap: \"\",\n      is_active: true\n    }),\n    _useState16 = _slicedToArray(_useState15, 2),\n    currentRule = _useState16[0],\n    setCurrentRule = _useState16[1];\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    fetchData();\n  }, []);\n  var fetchData = /*#__PURE__*/function () {\n    var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n      var _yield$Promise$all, _yield$Promise$all2, rulesRes, logsRes, catsRes, _t;\n      return _regenerator().w(function (_context) {\n        while (1) switch (_context.p = _context.n) {\n          case 0:\n            setIsLoading(true);\n            _context.p = 1;\n            _context.n = 2;\n            return Promise.all([axios__WEBPACK_IMPORTED_MODULE_37__[\"default\"].get(\"/api/store-manager/automation/rules\"), axios__WEBPACK_IMPORTED_MODULE_37__[\"default\"].get(\"/api/store-manager/automation/logs\"), axios__WEBPACK_IMPORTED_MODULE_37__[\"default\"].get(\"/api/product-categories\")]);\n          case 2:\n            _yield$Promise$all = _context.v;\n            _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 3);\n            rulesRes = _yield$Promise$all2[0];\n            logsRes = _yield$Promise$all2[1];\n            catsRes = _yield$Promise$all2[2];\n            setRules(rulesRes.data.rules || []);\n            setLogs(logsRes.data.logs || []);\n            setCategories(catsRes.data.categories || []);\n            _context.n = 4;\n            break;\n          case 3:\n            _context.p = 3;\n            _t = _context.v;\n            console.error(_t);\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_38__[\"default\"].error(\"Failed to load automation data\");\n          case 4:\n            _context.p = 4;\n            setIsLoading(false);\n            return _context.f(4);\n          case 5:\n            return _context.a(2);\n        }\n      }, _callee, null, [[1, 3, 4, 5]]);\n    }));\n    return function fetchData() {\n      return _ref.apply(this, arguments);\n    };\n  }();\n  var handleSaveRule = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {\n      var _currentRule$name;\n      var errors, ruleToSave, updatedRules, _t2;\n      return _regenerator().w(function (_context2) {\n        while (1) switch (_context2.p = _context2.n) {\n          case 0:\n            // ── Validation ────────────────────────────────────────────────────\n            errors = {};\n            if (!((_currentRule$name = currentRule.name) !== null && _currentRule$name !== void 0 && _currentRule$name.trim())) errors.name = \"Rule name is required\";\n            if (!currentRule.trigger) errors.trigger = \"Please select a trigger event\";\n\n            // Condition value is required unless trigger doesn't use one\n            if (!['new_product', 'stock_tiers'].includes(currentRule.trigger) && !String(currentRule.condition_value).trim()) errors.condition_value = \"Please enter a threshold value for this trigger\";\n\n            // Days without sale required for hybrid trigger\n            if (currentRule.trigger === 'stock_time_hybrid' && !String(currentRule.time_value).trim()) errors.time_value = \"Please enter the number of days without a sale\";\n            if (!currentRule.action) errors.action = \"Please select an action to perform\";\n\n            // Action value required for price adjustments and email\n            if (['adjust_price', 'adjust_price_flat', 'send_email'].includes(currentRule.action) && !String(currentRule.action_value).trim()) errors.action_value = currentRule.action === 'send_email' ? \"Please enter a recipient email address\" : \"Please enter the discount amount\";\n\n            // Email format check\n            if (currentRule.action === 'send_email' && currentRule.action_value && !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(currentRule.action_value)) errors.action_value = \"Please enter a valid email address\";\n\n            // Target: specific product/category must have a selection\n            if (currentRule.target_type === 'product' && currentRule.target_items.length === 0) errors.target_items = \"Please select at least one product\";\n            if (currentRule.target_type === 'category' && currentRule.target_items.length === 0) errors.target_items = \"Please select a category\";\n            if (!(Object.keys(errors).length > 0)) {\n              _context2.n = 1;\n              break;\n            }\n            setFormErrors(errors);\n            // Show the first error as a toast\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_38__[\"default\"].error(Object.values(errors)[0]);\n            return _context2.a(2);\n          case 1:\n            setFormErrors({});\n            // ─────────────────────────────────────────────────────────────────\n\n            setIsSaving(true);\n            _context2.p = 2;\n            ruleToSave = _objectSpread(_objectSpread({}, currentRule), {}, {\n              id: currentRule.id || Date.now().toString()\n            });\n            updatedRules = [];\n            if (currentRule.id) {\n              updatedRules = rules.map(function (r) {\n                return r.id === currentRule.id ? ruleToSave : r;\n              });\n            } else {\n              updatedRules = [].concat(_toConsumableArray(rules), [ruleToSave]);\n            }\n            _context2.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_37__[\"default\"].post(\"/api/store-manager/automation/rules\", {\n              rules: updatedRules\n            });\n          case 3:\n            setRules(updatedRules);\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_38__[\"default\"].success(\"Rule saved successfully\");\n            onClose();\n            resetForm();\n            _context2.n = 5;\n            break;\n          case 4:\n            _context2.p = 4;\n            _t2 = _context2.v;\n            console.error(_t2);\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_38__[\"default\"].error(\"Failed to save rule\");\n          case 5:\n            _context2.p = 5;\n            setIsSaving(false);\n            return _context2.f(5);\n          case 6:\n            return _context2.a(2);\n        }\n      }, _callee2, null, [[2, 4, 5, 6]]);\n    }));\n    return function handleSaveRule() {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  var promptDeleteRule = function promptDeleteRule(id) {\n    setRuleToDelete(id);\n    onConfirmOpen();\n  };\n  var confirmDeleteRule = /*#__PURE__*/function () {\n    var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {\n      var updatedRules, _t3;\n      return _regenerator().w(function (_context3) {\n        while (1) switch (_context3.p = _context3.n) {\n          case 0:\n            if (ruleToDelete) {\n              _context3.n = 1;\n              break;\n            }\n            return _context3.a(2);\n          case 1:\n            setIsDeleting(true);\n            _context3.p = 2;\n            updatedRules = rules.filter(function (r) {\n              return r.id !== ruleToDelete;\n            });\n            _context3.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_37__[\"default\"].post(\"/api/store-manager/automation/rules\", {\n              rules: updatedRules\n            });\n          case 3:\n            setRules(updatedRules);\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_38__[\"default\"].success(\"Rule deleted\");\n            onConfirmClose();\n            _context3.n = 5;\n            break;\n          case 4:\n            _context3.p = 4;\n            _t3 = _context3.v;\n            console.error(_t3);\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_38__[\"default\"].error(\"Failed to delete rule\");\n          case 5:\n            _context3.p = 5;\n            setIsDeleting(false);\n            setRuleToDelete(null);\n            return _context3.f(5);\n          case 6:\n            return _context3.a(2);\n        }\n      }, _callee3, null, [[2, 4, 5, 6]]);\n    }));\n    return function confirmDeleteRule() {\n      return _ref3.apply(this, arguments);\n    };\n  }();\n  var resetForm = function resetForm() {\n    setCurrentRule({\n      id: \"\",\n      name: \"\",\n      trigger: \"stock_below\",\n      condition_value: \"\",\n      time_value: \"\",\n      action: \"send_email\",\n      action_type: \"percentage\",\n      action_value: \"\",\n      threshold_step: \"\",\n      target_type: \"global\",\n      target_items: [],\n      apply_once: false,\n      priority: 10,\n      max_discount_cap: \"\",\n      is_active: true\n    });\n    setFormErrors({});\n  };\n  var openNewModal = function openNewModal() {\n    resetForm();\n    onOpen();\n  };\n  var openEditModal = function openEditModal(rule) {\n    setCurrentRule(_objectSpread({}, rule));\n    onOpen();\n  };\n  var toggleRuleActive = /*#__PURE__*/function () {\n    var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(rule) {\n      var updated, updatedRules, _t4;\n      return _regenerator().w(function (_context4) {\n        while (1) switch (_context4.p = _context4.n) {\n          case 0:\n            updated = _objectSpread(_objectSpread({}, rule), {}, {\n              is_active: !rule.is_active\n            });\n            updatedRules = rules.map(function (r) {\n              return r.id === rule.id ? updated : r;\n            });\n            _context4.p = 1;\n            _context4.n = 2;\n            return axios__WEBPACK_IMPORTED_MODULE_37__[\"default\"].post(\"/api/store-manager/automation/rules\", {\n              rules: updatedRules\n            });\n          case 2:\n            setRules(updatedRules);\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_38__[\"default\"].success(updated.is_active ? \"\\\"\".concat(rule.name, \"\\\" enabled\") : \"\\\"\".concat(rule.name, \"\\\" paused\"));\n            _context4.n = 4;\n            break;\n          case 3:\n            _context4.p = 3;\n            _t4 = _context4.v;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_38__[\"default\"].error(\"Failed to update rule status\");\n          case 4:\n            return _context4.a(2);\n        }\n      }, _callee4, null, [[1, 3]]);\n    }));\n    return function toggleRuleActive(_x) {\n      return _ref4.apply(this, arguments);\n    };\n  }();\n  var getTriggerName = function getTriggerName(val) {\n    var triggers = {\n      'stock_below': 'Low Stock',\n      'revenue_drop': 'Revenue Drop',\n      'new_product': 'New Product Added',\n      'stock_time_hybrid': 'Stock + Time Hybrid',\n      'stock_tiers': 'Tier Based Stock Rules'\n    };\n    return triggers[val] || val;\n  };\n  var getActionName = function getActionName(val) {\n    var actions = {\n      'send_email': 'Send Email Alert',\n      'notify': 'Log Notification',\n      'adjust_price': 'Apply % Discount',\n      'adjust_price_flat': 'Apply Flat Amount Discount',\n      'sync_product': 'Auto-Sync Store Product',\n      'apply_tiered_discount': 'Apply Tiered Discounts'\n    };\n    return actions[val] || val;\n  };\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.VStack, {\n    align: \"stretch\",\n    spacing: 6,\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Flex, {\n    direction: {\n      base: \"column\",\n      lg: \"row\"\n    },\n    justify: \"space-between\",\n    align: {\n      base: \"stretch\",\n      lg: \"center\"\n    },\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.VStack, {\n    align: \"start\",\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Heading, {\n    m: 0,\n    size: \"lg\"\n  }, \"Automation Rules Engine\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n    m: 0,\n    color: \"gray.500\",\n    fontSize: \"sm\"\n  }, \"Automate your inventory pricing, alerts, and store syncing based on real-time triggers.\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiPlus, null),\n    colorScheme: \"blue\",\n    size: \"md\",\n    onClick: openNewModal,\n    shadow: \"sm\",\n    _hover: {\n      shadow: 'md'\n    },\n    alignSelf: {\n      base: \"flex-start\",\n      lg: \"center\"\n    }\n  }, \"Create Rule\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Grid, {\n    templateColumns: {\n      base: \"1fr\",\n      xl: \"2fr 1fr\"\n    },\n    gap: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.VStack, {\n    spacing: 6,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Card, {\n    variant: \"outline\",\n    borderRadius: \"xl\",\n    shadow: \"sm\",\n    overflow: \"hidden\",\n    bg: \"white\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    p: 4,\n    borderBottom: \"1px\",\n    borderColor: \"gray.100\",\n    bg: \"gray.50\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Heading, {\n    size: \"sm\",\n    display: \"flex\",\n    alignItems: \"center\",\n    color: \"gray.700\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiSettings,\n    mr: 2,\n    color: \"blue.500\"\n  }), \" Active Automation Rules\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.CardBody, {\n    p: 0\n  }, rules.length === 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    py: 20,\n    textAlign: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.VStack, {\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiZap,\n    boxSize: 10,\n    color: \"gray.200\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n    fontWeight: \"bold\",\n    color: \"gray.400\"\n  }, \"No automation rules created yet.\"))) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.TableContainer, {\n    className: \"shopcentral-scrollbar\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Table, {\n    variant: \"simple\",\n    size: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Thead, {\n    bg: \"gray.50\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Th, {\n    py: 4\n  }, \"Rule Name\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Th, {\n    py: 4,\n    display: {\n      base: \"none\",\n      md: \"table-cell\"\n    }\n  }, \"Trigger (If)\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Th, {\n    py: 4,\n    display: {\n      base: \"none\",\n      lg: \"table-cell\"\n    }\n  }, \"Action (Then)\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Th, {\n    py: 4,\n    textAlign: \"right\"\n  }, \"Manage\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Tbody, null, rules.map(function (rule) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Tr, {\n      key: rule.id,\n      _hover: {\n        bg: \"gray.50\"\n      },\n      transition: \"background 0.2s\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Td, {\n      py: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.VStack, {\n      align: \"start\",\n      spacing: 1\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.HStack, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n      colorScheme: rule.is_active ? \"green\" : \"gray\",\n      variant: \"solid\",\n      fontSize: \"3xs\",\n      borderRadius: \"full\",\n      px: 2\n    }, rule.is_active ? \"ACTIVE\" : \"PAUSED\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n      fontWeight: \"800\",\n      fontSize: \"sm\",\n      color: \"gray.700\"\n    }, rule.name)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n      display: {\n        base: \"block\",\n        md: \"none\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n      fontSize: \"2xs\",\n      color: \"blue.600\",\n      fontWeight: \"bold\"\n    }, getTriggerName(rule.trigger), \" \\u2192 \", getActionName(rule.action))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Td, {\n      py: 3,\n      display: {\n        base: \"none\",\n        md: \"table-cell\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.VStack, {\n      align: \"start\",\n      spacing: 0\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n      m: 0,\n      fontSize: \"xs\",\n      fontWeight: \"bold\",\n      color: \"gray.600\"\n    }, getTriggerName(rule.trigger)), rule.condition_value && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n      m: 0,\n      fontSize: \"3xs\",\n      color: \"gray.400\"\n    }, \"Threshold: \", rule.condition_value))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Td, {\n      py: 3,\n      display: {\n        base: \"none\",\n        lg: \"table-cell\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n      variant: \"subtle\",\n      colorScheme: \"blue\",\n      fontSize: \"2xs\",\n      borderRadius: \"md\",\n      px: 2\n    }, getActionName(rule.action))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Td, {\n      py: 3,\n      textAlign: \"right\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.HStack, {\n      spacing: 1,\n      justify: \"flex-end\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tooltip, {\n      label: rule.is_active ? 'Pause Rule' : 'Enable Rule',\n      fontSize: \"xs\",\n      hasArrow: true\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.IconButton, {\n      icon: rule.is_active ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiPause, null) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiPlay, null),\n      colorScheme: rule.is_active ? \"orange\" : \"green\",\n      variant: \"ghost\",\n      size: \"sm\",\n      borderRadius: \"full\",\n      onClick: function onClick() {\n        return toggleRuleActive(rule);\n      },\n      \"aria-label\": rule.is_active ? 'Pause rule' : 'Enable rule'\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tooltip, {\n      label: \"Edit Rule\",\n      fontSize: \"xs\",\n      hasArrow: true\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.IconButton, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiEdit2, null),\n      colorScheme: \"blue\",\n      variant: \"ghost\",\n      size: \"sm\",\n      borderRadius: \"full\",\n      onClick: function onClick() {\n        return openEditModal(rule);\n      },\n      \"aria-label\": \"Edit rule\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tooltip, {\n      label: \"Delete Rule\",\n      fontSize: \"xs\",\n      hasArrow: true\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.IconButton, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiTrash2, null),\n      colorScheme: \"red\",\n      variant: \"ghost\",\n      size: \"sm\",\n      borderRadius: \"full\",\n      onClick: function onClick() {\n        return promptDeleteRule(rule.id);\n      },\n      \"aria-label\": \"Delete rule\"\n    })))));\n  }))))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.VStack, {\n    spacing: 6,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Card, {\n    variant: \"outline\",\n    borderRadius: \"xl\",\n    shadow: \"sm\",\n    overflow: \"hidden\",\n    bg: \"white\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    p: 4,\n    borderBottom: \"1px\",\n    borderColor: \"gray.100\",\n    bg: \"gray.50\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Heading, {\n    size: \"sm\",\n    display: \"flex\",\n    alignItems: \"center\",\n    color: \"gray.700\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiActivity,\n    mr: 2,\n    color: \"purple.500\"\n  }), \" Recent Execution Logs\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.CardBody, {\n    p: 0\n  }, (logs === null || logs === void 0 ? void 0 : logs.length) === 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    py: 10,\n    textAlign: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n    color: \"gray.500\",\n    fontSize: \"sm\"\n  }, \"No logs available.\")) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.VStack, {\n    align: \"stretch\",\n    spacing: 0,\n    maxH: \"500px\",\n    overflowY: \"auto\",\n    className: \"shopcentral-scrollbar\"\n  }, logs === null || logs === void 0 ? void 0 : logs.map(function (log, i) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n      key: i,\n      p: 4,\n      borderBottom: \"1px\",\n      borderColor: \"gray.50\",\n      _hover: {\n        bg: \"gray.50\"\n      },\n      transition: \"background 0.2s\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Flex, {\n      justify: \"space-between\",\n      align: \"center\",\n      mb: 1\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n      fontSize: \"xs\",\n      fontWeight: \"900\",\n      color: \"blue.600\"\n    }, log.rule), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n      m: 0,\n      fontSize: \"3xs\",\n      color: \"gray.400\",\n      fontWeight: \"bold\"\n    }, new Date(log.time).toLocaleTimeString([], {\n      hour: '2-digit',\n      minute: '2-digit'\n    }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n      m: 0,\n      fontSize: \"xs\",\n      color: \"gray.600\",\n      lineHeight: \"tall\"\n    }, log.message));\n  }))))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Modal, {\n    isOpen: isOpen,\n    onClose: onClose,\n    size: \"xl\",\n    isCentered: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.ModalOverlay, {\n    backdropFilter: \"blur(4px)\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.ModalContent, {\n    borderRadius: \"2xl\",\n    overflow: \"hidden\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    bgGradient: \"linear(135deg, #667eea 0%, #764ba2 100%)\",\n    px: 6,\n    pt: 5,\n    pb: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Flex, {\n    justify: \"space-between\",\n    align: \"flex-start\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.VStack, {\n    align: \"start\",\n    spacing: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.HStack, {\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiSliders,\n    color: \"whiteAlpha.800\",\n    boxSize: 4\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n    fontSize: \"xs\",\n    fontWeight: \"700\",\n    color: \"whiteAlpha.700\",\n    textTransform: \"uppercase\",\n    letterSpacing: \"wider\"\n  }, \"Automation Rule\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Heading, {\n    size: \"md\",\n    color: \"white\",\n    fontWeight: \"800\",\n    mt: 1\n  }, currentRule.id ? 'Edit Rule' : 'Create New Rule')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.ModalCloseButton, {\n    position: \"static\",\n    color: \"whiteAlpha.800\",\n    _hover: {\n      color: 'white',\n      bg: 'whiteAlpha.200'\n    },\n    borderRadius: \"lg\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Input, {\n    mt: 4,\n    value: currentRule.name,\n    onChange: function onChange(e) {\n      setCurrentRule(_objectSpread(_objectSpread({}, currentRule), {}, {\n        name: e.target.value\n      }));\n      if (e.target.value.trim()) setFormErrors(function (p) {\n        return _objectSpread(_objectSpread({}, p), {}, {\n          name: undefined\n        });\n      });\n    },\n    placeholder: \"Name your rule, e.g. 'Winter Clearance Sale'...\",\n    bg: formErrors.name ? \"red.100\" : \"whiteAlpha.200\",\n    color: \"white\",\n    border: \"1px solid\",\n    borderColor: formErrors.name ? \"red.300\" : \"whiteAlpha.300\",\n    _placeholder: {\n      color: 'whiteAlpha.600'\n    },\n    _focus: {\n      bg: 'whiteAlpha.300',\n      borderColor: 'white',\n      boxShadow: 'none'\n    },\n    fontWeight: \"600\",\n    fontSize: \"sm\",\n    borderRadius: \"xl\"\n  }), formErrors.name && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n    fontSize: \"xs\",\n    color: \"red.200\",\n    mt: 1\n  }, \"\\u26A0\\uFE0F \", formErrors.name)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.ModalBody, {\n    p: 0,\n    maxH: \"62vh\",\n    overflowY: \"auto\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.VStack, {\n    spacing: 0,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    p: 5,\n    borderBottom: \"1px\",\n    borderColor: \"gray.100\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.HStack, {\n    spacing: 2,\n    mb: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Flex, {\n    w: 6,\n    h: 6,\n    borderRadius: \"md\",\n    bg: \"purple.500\",\n    align: \"center\",\n    justify: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiTarget,\n    color: \"white\",\n    boxSize: 3\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n    fontWeight: \"800\",\n    fontSize: \"sm\",\n    color: \"purple.700\"\n  }, \"Where does this apply?\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n    colorScheme: \"purple\",\n    variant: \"subtle\",\n    fontSize: \"2xs\",\n    borderRadius: \"full\",\n    px: 2\n  }, \"TARGET\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Grid, {\n    templateColumns: \"1fr 1fr\",\n    gap: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormLabel, {\n    fontSize: \"xs\",\n    fontWeight: \"700\",\n    color: \"gray.500\",\n    textTransform: \"uppercase\",\n    mb: 1,\n    display: \"flex\",\n    alignItems: \"center\"\n  }, \"Scope\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tooltip, {\n    label: \"Choose if this rule applies to all products, a specific category, or individual items.\",\n    fontSize: \"sm\",\n    hasArrow: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiHelpCircle,\n    ml: 1,\n    color: \"gray.400\",\n    boxSize: 3\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Select, {\n    size: \"sm\",\n    borderRadius: \"lg\",\n    value: currentRule.target_type,\n    onChange: function onChange(e) {\n      return setCurrentRule(_objectSpread(_objectSpread({}, currentRule), {}, {\n        target_type: e.target.value,\n        target_items: []\n      }));\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"global\"\n  }, \"\\uD83C\\uDF0D Global (All Products)\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"category\"\n  }, \"\\uD83D\\uDCC2 Specific Category\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"product\"\n  }, \"\\uD83D\\uDCE6 Specific Products\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormLabel, {\n    fontSize: \"xs\",\n    fontWeight: \"700\",\n    color: \"gray.500\",\n    textTransform: \"uppercase\",\n    mb: 1,\n    display: \"flex\",\n    alignItems: \"center\"\n  }, \"Priority\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tooltip, {\n    label: \"Higher number = runs first when multiple rules conflict.\",\n    fontSize: \"sm\",\n    hasArrow: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiHelpCircle,\n    ml: 1,\n    color: \"gray.400\",\n    boxSize: 3\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Input, {\n    size: \"sm\",\n    borderRadius: \"lg\",\n    type: \"number\",\n    value: currentRule.priority,\n    onChange: function onChange(e) {\n      return setCurrentRule(_objectSpread(_objectSpread({}, currentRule), {}, {\n        priority: parseInt(e.target.value) || 0\n      }));\n    }\n  }))), currentRule.target_type === 'product' && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    mt: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    size: \"xs\",\n    onClick: onPickerOpen,\n    variant: \"outline\",\n    colorScheme: formErrors.target_items ? \"red\" : \"purple\",\n    borderRadius: \"lg\",\n    w: \"full\",\n    mb: currentRule.target_items.length > 0 ? 2 : 0,\n    borderWidth: formErrors.target_items ? 2 : 1\n  }, \"+ Select Specific Products (\", currentRule.target_items.length, \" chosen)\"), formErrors.target_items && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n    fontSize: \"xs\",\n    color: \"red.500\",\n    mt: 1\n  }, \"\\u26A0\\uFE0F \", formErrors.target_items), currentRule.target_items.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.VStack, {\n    align: \"stretch\",\n    maxH: \"150px\",\n    overflowY: \"auto\",\n    spacing: 1,\n    p: 2,\n    bg: \"purple.50\",\n    borderRadius: \"lg\",\n    borderWidth: \"1px\",\n    borderColor: \"purple.100\"\n  }, currentRule.target_items.map(function (item) {\n    var _item$images, _item$images2, _item$image, _item$images3, _item$images4, _item$image2;\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Flex, {\n      key: item.id,\n      align: \"center\",\n      justify: \"space-between\",\n      bg: \"white\",\n      px: 2,\n      py: 1,\n      borderRadius: \"md\",\n      shadow: \"xs\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.HStack, {\n      spacing: 2\n    }, (_item$images = item.images) !== null && _item$images !== void 0 && (_item$images = _item$images[0]) !== null && _item$images !== void 0 && _item$images.src || (_item$images2 = item.images) !== null && _item$images2 !== void 0 && (_item$images2 = _item$images2[0]) !== null && _item$images2 !== void 0 && _item$images2.thumbnail || (_item$image = item.image) !== null && _item$image !== void 0 && _item$image.src ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"img\", {\n      src: ((_item$images3 = item.images) === null || _item$images3 === void 0 || (_item$images3 = _item$images3[0]) === null || _item$images3 === void 0 ? void 0 : _item$images3.src) || ((_item$images4 = item.images) === null || _item$images4 === void 0 || (_item$images4 = _item$images4[0]) === null || _item$images4 === void 0 ? void 0 : _item$images4.thumbnail) || ((_item$image2 = item.image) === null || _item$image2 === void 0 ? void 0 : _item$image2.src),\n      alt: item.name,\n      style: {\n        width: '26px',\n        height: '26px',\n        objectFit: 'cover',\n        borderRadius: '6px'\n      }\n    }) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n      w: \"26px\",\n      h: \"26px\",\n      bg: \"gray.100\",\n      borderRadius: \"6px\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n      fontSize: \"xs\",\n      fontWeight: \"600\",\n      noOfLines: 1\n    }, item.name)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.IconButton, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiTrash2, null),\n      size: \"xs\",\n      colorScheme: \"red\",\n      variant: \"ghost\",\n      onClick: function onClick() {\n        return setCurrentRule(_objectSpread(_objectSpread({}, currentRule), {}, {\n          target_items: currentRule.target_items.filter(function (i) {\n            return i.id !== item.id;\n          })\n        }));\n      }\n    }));\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_ProductPicker__WEBPACK_IMPORTED_MODULE_40__[\"default\"], {\n    isOpen: isPickerOpen,\n    onClose: onPickerClose,\n    onConfirm: function onConfirm(items) {\n      return setCurrentRule(_objectSpread(_objectSpread({}, currentRule), {}, {\n        target_items: items\n      }));\n    },\n    initialSelectedIds: currentRule.target_items.map(function (i) {\n      return i.id;\n    })\n  })), currentRule.target_type === 'category' && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.FormControl, {\n    mt: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormLabel, {\n    fontSize: \"xs\",\n    fontWeight: \"700\",\n    color: \"gray.500\",\n    textTransform: \"uppercase\",\n    mb: 1\n  }, \"Category\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Select, {\n    size: \"sm\",\n    borderRadius: \"lg\",\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null),\n    value: ((_currentRule$target_i = currentRule.target_items[0]) === null || _currentRule$target_i === void 0 ? void 0 : _currentRule$target_i.id) || '',\n    onChange: function onChange(e) {\n      var cat = categories.find(function (c) {\n        return c.id == e.target.value;\n      });\n      setCurrentRule(_objectSpread(_objectSpread({}, currentRule), {}, {\n        target_items: cat ? [cat] : []\n      }));\n      if (e.target.value) setFormErrors(function (p) {\n        return _objectSpread(_objectSpread({}, p), {}, {\n          target_items: undefined\n        });\n      });\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"\"\n  }, \"Choose a Category...\"), categories.map(function (c) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      key: c.id,\n      value: c.id\n    }, c.name);\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.FormErrorMessage, {\n    fontSize: \"xs\"\n  }, formErrors.target_items))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    p: 5,\n    bg: \"blue.50\",\n    borderBottom: \"1px\",\n    borderColor: \"blue.100\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.HStack, {\n    spacing: 2,\n    mb: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Flex, {\n    w: 6,\n    h: 6,\n    borderRadius: \"md\",\n    bg: \"blue.500\",\n    align: \"center\",\n    justify: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiZap,\n    color: \"white\",\n    boxSize: 3\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n    fontWeight: \"800\",\n    fontSize: \"sm\",\n    color: \"blue.700\"\n  }, \"IF this happens...\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n    colorScheme: \"blue\",\n    variant: \"subtle\",\n    fontSize: \"2xs\",\n    borderRadius: \"full\",\n    px: 2\n  }, \"TRIGGER\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Grid, {\n    templateColumns: \"1fr 1fr\",\n    gap: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.FormControl, {\n    isRequired: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormLabel, {\n    fontSize: \"xs\",\n    fontWeight: \"700\",\n    color: \"gray.600\",\n    textTransform: \"uppercase\",\n    mb: 1,\n    display: \"flex\",\n    alignItems: \"center\"\n  }, \"Event\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tooltip, {\n    label: \"The condition that starts this automation.\",\n    fontSize: \"sm\",\n    hasArrow: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiHelpCircle,\n    ml: 1,\n    color: \"gray.400\",\n    boxSize: 3\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Select, {\n    size: \"sm\",\n    borderRadius: \"lg\",\n    bg: \"white\",\n    value: currentRule.trigger,\n    onChange: function onChange(e) {\n      return setCurrentRule(_objectSpread(_objectSpread({}, currentRule), {}, {\n        trigger: e.target.value\n      }));\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"stock_below\"\n  }, \"\\uD83D\\uDCC9 Stock Drops Below\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"stock_time_hybrid\"\n  }, \"\\u23F3 Product Stops Selling\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"stock_tiers\"\n  }, \"\\uD83C\\uDFAF Dynamic Tiered Scaling\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"revenue_drop\"\n  }, \"\\uD83D\\uDCCA Revenue Drops By %\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"new_product\"\n  }, \"\\uD83C\\uDD95 New Product Published\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.FormControl, {\n    isInvalid: !!formErrors.condition_value\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormLabel, {\n    fontSize: \"xs\",\n    fontWeight: \"700\",\n    color: \"gray.600\",\n    textTransform: \"uppercase\",\n    mb: 1,\n    display: \"flex\",\n    alignItems: \"center\"\n  }, currentRule.trigger === 'revenue_drop' ? 'Drop %' : 'Stock Level', /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tooltip, {\n    label: \"The threshold number to watch. Leave blank if not applicable.\",\n    fontSize: \"sm\",\n    hasArrow: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiHelpCircle,\n    ml: 1,\n    color: \"gray.400\",\n    boxSize: 3\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Input, {\n    size: \"sm\",\n    borderRadius: \"lg\",\n    bg: \"white\",\n    value: currentRule.condition_value,\n    onChange: function onChange(e) {\n      setCurrentRule(_objectSpread(_objectSpread({}, currentRule), {}, {\n        condition_value: e.target.value\n      }));\n      if (e.target.value.trim()) setFormErrors(function (p) {\n        return _objectSpread(_objectSpread({}, p), {}, {\n          condition_value: undefined\n        });\n      });\n    },\n    placeholder: ['stock_below', 'stock_time_hybrid'].includes(currentRule.trigger) ? 'e.g. 10' : currentRule.trigger === 'revenue_drop' ? 'e.g. 20' : 'N/A',\n    isDisabled: ['new_product', 'stock_tiers'].includes(currentRule.trigger),\n    type: \"number\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.FormErrorMessage, {\n    fontSize: \"xs\"\n  }, formErrors.condition_value))), currentRule.trigger === 'stock_time_hybrid' && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.FormControl, {\n    mt: 3,\n    isInvalid: !!formErrors.time_value\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormLabel, {\n    fontSize: \"xs\",\n    fontWeight: \"700\",\n    color: \"gray.600\",\n    textTransform: \"uppercase\",\n    mb: 1,\n    display: \"flex\",\n    alignItems: \"center\"\n  }, \"Days Without a Sale\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tooltip, {\n    label: \"How many consecutive days with no sales before this fires.\",\n    fontSize: \"sm\",\n    hasArrow: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiHelpCircle,\n    ml: 1,\n    color: \"gray.400\",\n    boxSize: 3\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Input, {\n    size: \"sm\",\n    borderRadius: \"lg\",\n    bg: \"white\",\n    type: \"number\",\n    value: currentRule.time_value,\n    onChange: function onChange(e) {\n      setCurrentRule(_objectSpread(_objectSpread({}, currentRule), {}, {\n        time_value: e.target.value\n      }));\n      if (e.target.value.trim()) setFormErrors(function (p) {\n        return _objectSpread(_objectSpread({}, p), {}, {\n          time_value: undefined\n        });\n      });\n    },\n    placeholder: \"e.g. 7\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.FormErrorMessage, {\n    fontSize: \"xs\"\n  }, formErrors.time_value))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    p: 5,\n    borderBottom: \"1px\",\n    borderColor: \"gray.100\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.HStack, {\n    spacing: 2,\n    mb: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Flex, {\n    w: 6,\n    h: 6,\n    borderRadius: \"md\",\n    bg: \"green.500\",\n    align: \"center\",\n    justify: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiTool,\n    color: \"white\",\n    boxSize: 3\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n    fontWeight: \"800\",\n    fontSize: \"sm\",\n    color: \"green.700\"\n  }, \"THEN do this...\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n    colorScheme: \"green\",\n    variant: \"subtle\",\n    fontSize: \"2xs\",\n    borderRadius: \"full\",\n    px: 2\n  }, \"ACTION\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Grid, {\n    templateColumns: \"1fr 1fr\",\n    gap: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.FormControl, {\n    isRequired: true,\n    isInvalid: !!formErrors.action\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormLabel, {\n    fontSize: \"xs\",\n    fontWeight: \"700\",\n    color: \"gray.600\",\n    textTransform: \"uppercase\",\n    mb: 1,\n    display: \"flex\",\n    alignItems: \"center\"\n  }, \"Task\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tooltip, {\n    label: \"What the system should do when triggered.\",\n    fontSize: \"sm\",\n    hasArrow: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiHelpCircle,\n    ml: 1,\n    color: \"gray.400\",\n    boxSize: 3\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Select, {\n    size: \"sm\",\n    borderRadius: \"lg\",\n    value: currentRule.action,\n    onChange: function onChange(e) {\n      setCurrentRule(_objectSpread(_objectSpread({}, currentRule), {}, {\n        action: e.target.value\n      }));\n      setFormErrors(function (p) {\n        return _objectSpread(_objectSpread({}, p), {}, {\n          action: undefined,\n          action_value: undefined\n        });\n      });\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"apply_tiered_discount\"\n  }, \"\\uD83C\\uDFAF Run Tiered Discount\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"adjust_price\"\n  }, \"\\uD83D\\uDCB8 Apply % Discount\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"adjust_price_flat\"\n  }, \"\\uD83D\\uDCB5 Apply Flat $ Discount\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"send_email\"\n  }, \"\\uD83D\\uDCE7 Send Email Alert\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"notify\"\n  }, \"\\uD83D\\uDCCB Save to Log\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"sync_product\"\n  }, \"\\uD83D\\uDD04 Auto-Sync Product\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.FormErrorMessage, {\n    fontSize: \"xs\"\n  }, formErrors.action)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.FormControl, {\n    isInvalid: !!formErrors.action_value\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormLabel, {\n    fontSize: \"xs\",\n    fontWeight: \"700\",\n    color: \"gray.600\",\n    textTransform: \"uppercase\",\n    mb: 1,\n    display: \"flex\",\n    alignItems: \"center\"\n  }, currentRule.action === 'adjust_price' ? 'Discount %' : currentRule.action === 'adjust_price_flat' ? 'Flat Amount $' : currentRule.action === 'send_email' ? 'Email Address' : 'Value', /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tooltip, {\n    label: \"Enter the amount or email address for this action.\",\n    fontSize: \"sm\",\n    hasArrow: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiHelpCircle,\n    ml: 1,\n    color: \"gray.400\",\n    boxSize: 3\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Input, {\n    size: \"sm\",\n    borderRadius: \"lg\",\n    value: currentRule.action_value,\n    onChange: function onChange(e) {\n      setCurrentRule(_objectSpread(_objectSpread({}, currentRule), {}, {\n        action_value: e.target.value\n      }));\n      if (e.target.value.trim()) setFormErrors(function (p) {\n        return _objectSpread(_objectSpread({}, p), {}, {\n          action_value: undefined\n        });\n      });\n    },\n    placeholder: currentRule.action === 'send_email' ? 'admin@example.com' : currentRule.action === 'adjust_price' ? 'e.g. 10' : currentRule.action === 'adjust_price_flat' ? 'e.g. 5' : '—',\n    isDisabled: ['notify', 'sync_product', 'apply_tiered_discount'].includes(currentRule.action),\n    type: ['adjust_price', 'adjust_price_flat'].includes(currentRule.action) ? 'number' : 'text'\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.FormErrorMessage, {\n    fontSize: \"xs\"\n  }, formErrors.action_value))), currentRule.trigger === 'stock_below' && ['adjust_price', 'adjust_price_flat'].includes(currentRule.action) && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.FormControl, {\n    mt: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormLabel, {\n    fontSize: \"xs\",\n    fontWeight: \"700\",\n    color: \"gray.600\",\n    textTransform: \"uppercase\",\n    mb: 1,\n    display: \"flex\",\n    alignItems: \"center\"\n  }, \"Quantity Step (Threshold)\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tooltip, {\n    label: \"Applies the discount again every time stock drops by this many more units. Leave blank to apply once only.\",\n    fontSize: \"sm\",\n    hasArrow: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiHelpCircle,\n    ml: 1,\n    color: \"gray.400\",\n    boxSize: 3\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Input, {\n    size: \"sm\",\n    borderRadius: \"lg\",\n    type: \"number\",\n    value: currentRule.threshold_step,\n    onChange: function onChange(e) {\n      return setCurrentRule(_objectSpread(_objectSpread({}, currentRule), {}, {\n        threshold_step: e.target.value\n      }));\n    },\n    placeholder: \"e.g. 5 \\u2014 re-applies every 5 units sold\"\n  })), ['adjust_price', 'adjust_price_flat', 'apply_tiered_discount'].includes(currentRule.action) && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Grid, {\n    templateColumns: \"1fr 1fr\",\n    gap: 3,\n    mt: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormLabel, {\n    fontSize: \"xs\",\n    fontWeight: \"700\",\n    color: \"gray.600\",\n    textTransform: \"uppercase\",\n    mb: 1,\n    display: \"flex\",\n    alignItems: \"center\"\n  }, \"Max Discount Cap ($)\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tooltip, {\n    label: \"Stops the discount from going beyond this dollar amount, no matter what.\",\n    fontSize: \"sm\",\n    hasArrow: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiHelpCircle,\n    ml: 1,\n    color: \"gray.400\",\n    boxSize: 3\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Input, {\n    size: \"sm\",\n    borderRadius: \"lg\",\n    type: \"number\",\n    value: currentRule.max_discount_cap,\n    onChange: function onChange(e) {\n      return setCurrentRule(_objectSpread(_objectSpread({}, currentRule), {}, {\n        max_discount_cap: e.target.value\n      }));\n    },\n    placeholder: \"Blank = no limit\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.FormControl, {\n    display: \"flex\",\n    alignItems: \"flex-end\",\n    pb: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Checkbox, {\n    isChecked: currentRule.apply_once,\n    onChange: function onChange(e) {\n      return setCurrentRule(_objectSpread(_objectSpread({}, currentRule), {}, {\n        apply_once: e.target.checked\n      }));\n    },\n    colorScheme: \"purple\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n    my: 0,\n    fontSize: \"sm\",\n    fontWeight: \"600\"\n  }, \"Apply Once Only\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tooltip, {\n    label: \"Prevents this rule from applying the same discount twice to the same product.\",\n    fontSize: \"sm\",\n    hasArrow: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiHelpCircle,\n    ml: 2,\n    color: \"gray.400\",\n    boxSize: 3\n  })))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Flex, {\n    px: 5,\n    py: 4,\n    justify: \"space-between\",\n    align: \"center\",\n    bg: currentRule.is_active ? \"green.50\" : \"gray.50\",\n    borderBottom: \"1px\",\n    borderColor: currentRule.is_active ? \"green.100\" : \"gray.100\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.HStack, {\n    spacing: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    w: 2.5,\n    h: 2.5,\n    borderRadius: \"full\",\n    bg: currentRule.is_active ? \"green.400\" : \"gray.300\",\n    boxShadow: currentRule.is_active ? \"0 0 0 3px #C6F6D5\" : \"none\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n    fontSize: \"sm\",\n    fontWeight: \"700\",\n    color: currentRule.is_active ? \"green.800\" : \"gray.600\"\n  }, currentRule.is_active ? \"Rule is ACTIVE\" : \"Rule is PAUSED\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n    fontSize: \"xs\",\n    color: currentRule.is_active ? \"green.500\" : \"gray.400\"\n  }, currentRule.is_active ? \"This rule will fire when conditions are met.\" : \"This rule will not run until activated.\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Switch, {\n    colorScheme: \"green\",\n    size: \"lg\",\n    isChecked: currentRule.is_active,\n    onChange: function onChange(e) {\n      return setCurrentRule(_objectSpread(_objectSpread({}, currentRule), {}, {\n        is_active: e.target.checked\n      }));\n    }\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.ModalFooter, {\n    borderTop: \"1px\",\n    borderColor: \"gray.100\",\n    px: 5,\n    py: 3,\n    bg: \"gray.50\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    variant: \"ghost\",\n    size: \"sm\",\n    mr: 2,\n    onClick: onClose,\n    borderRadius: \"lg\"\n  }, \"Cancel\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    bgGradient: \"linear(135deg, #667eea, #764ba2)\",\n    color: \"white\",\n    size: \"sm\",\n    borderRadius: \"lg\",\n    _hover: {\n      bgGradient: \"linear(135deg, #5a6fd6, #6a4291)\",\n      shadow: \"md\"\n    },\n    onClick: isPro ? handleSaveRule : onProModalOpen,\n    isLoading: isSaving,\n    loadingText: \"Saving...\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n      as: isPro ? react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiSliders : react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiLock\n    }),\n    cursor: \"pointer\"\n  }, isPro ? \"Save Rule\" : \"Pro Feature\")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_39__[\"default\"], {\n    isOpen: isConfirmOpen,\n    onClose: function onClose() {\n      onConfirmClose();\n      setRuleToDelete(null);\n    },\n    onConfirm: confirmDeleteRule,\n    title: \"Delete Automation Rule\",\n    description: \"Are you sure you want to delete this rule? This action cannot be undone.\",\n    confirmLabel: \"Delete Rule\",\n    loading: isDeleting\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ProFeatureModal__WEBPACK_IMPORTED_MODULE_41__[\"default\"], {\n    isOpen: isProModalOpen,\n    onClose: onProModalClose,\n    title: \"Multi-Store Automation Engine (Pro)\",\n    what: \"A powerful automated workflow and rule engine built specifically for multi-store WooCommerce environments.\",\n    how: \"Define background triggers (such as stock dropping below a threshold or new orders being completed) to automatically execute responsive actions on connected stores.\",\n    why: \"Puts day-to-day operations on autopilot by eliminating manual monitoring, automating inventory replenishment alerts, and synchronizing catalog state in real time.\"\n  }));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AutomationRules);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Automation/AutomationRules.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Components/OrderMetrics.jsx"
/*!************************************************************!*\
  !*** ./src/Pages/StoreManager/Components/OrderMetrics.jsx ***!
  \************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/simple-grid.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/skeleton/skeleton.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stat/stat.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stat/stat-arrow.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stat/stat-help-text.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stat/stat-label.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stat/stat-number.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react_apexcharts__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! react-apexcharts */ \"./node_modules/react-apexcharts/dist/react-apexcharts.esm.js\");\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\n\nvar MetricCard = function MetricCard(_ref) {\n  var label = _ref.label,\n    value = _ref.value,\n    icon = _ref.icon,\n    color = _ref.color,\n    helpText = _ref.helpText,\n    trend = _ref.trend;\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Card, {\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    boxShadow: \"sm\",\n    _hover: {\n      shadow: 'md',\n      transform: 'translateY(-2px)'\n    },\n    transition: \"all 0.2s\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.CardBody, {\n    p: 5\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Stat, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Flex, {\n    align: \"flex-start\",\n    justify: \"space-between\",\n    mb: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.StatLabel, {\n    fontSize: \"sm\",\n    color: \"gray.500\",\n    fontWeight: \"medium\"\n  }, label), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.StatNumber, {\n    fontSize: \"2xl\",\n    fontWeight: \"bold\",\n    mt: 1\n  }, value)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Flex, {\n    align: \"center\",\n    justify: \"center\",\n    w: 10,\n    h: 10,\n    borderRadius: \"lg\",\n    bg: \"\".concat(color, \".50\"),\n    color: \"\".concat(color, \".500\")\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Icon, {\n    as: icon,\n    size: 20\n  }))), helpText && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.StatHelpText, {\n    mb: 0,\n    fontSize: \"xs\"\n  }, trend && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.StatArrow, {\n    type: trend.type\n  }), helpText))));\n};\nvar OrderMetrics = function OrderMetrics(_ref2) {\n  var dateRange = _ref2.dateRange;\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState2 = _slicedToArray(_useState, 2),\n    metrics = _useState2[0],\n    setMetrics = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),\n    _useState4 = _slicedToArray(_useState3, 2),\n    loading = _useState4[0],\n    setLoading = _useState4[1];\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    var fetchMetrics = /*#__PURE__*/function () {\n      var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n        var params, _yield$axios$get, data, _t;\n        return _regenerator().w(function (_context) {\n          while (1) switch (_context.p = _context.n) {\n            case 0:\n              _context.p = 0;\n              params = {\n                after: dateRange !== null && dateRange !== void 0 && dateRange.startDate ? dateRange.startDate.toISOString().split('.')[0] + 'Z' : undefined,\n                before: dateRange !== null && dateRange !== void 0 && dateRange.endDate ? dateRange.endDate.toISOString().split('.')[0] + 'Z' : undefined\n              };\n              _context.n = 1;\n              return axios__WEBPACK_IMPORTED_MODULE_16__[\"default\"].get('/api/store-manager/order-metrics', {\n                params: params\n              });\n            case 1:\n              _yield$axios$get = _context.v;\n              data = _yield$axios$get.data;\n              setMetrics(data);\n              _context.n = 3;\n              break;\n            case 2:\n              _context.p = 2;\n              _t = _context.v;\n              console.error(\"Failed to fetch order metrics\", _t);\n            case 3:\n              _context.p = 3;\n              setLoading(false);\n              return _context.f(3);\n            case 4:\n              return _context.a(2);\n          }\n        }, _callee, null, [[0, 2, 3, 4]]);\n      }));\n      return function fetchMetrics() {\n        return _ref3.apply(this, arguments);\n      };\n    }();\n    fetchMetrics();\n  }, [dateRange]);\n  if (loading) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.SimpleGrid, {\n      columns: {\n        base: 1,\n        md: 2,\n        lg: 4\n      },\n      spacing: 5,\n      mb: 8,\n      mt: 4\n    }, [1, 2, 3, 4].map(function (i) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Card, {\n        key: i,\n        borderRadius: \"xl\",\n        border: \"1px\",\n        borderColor: \"gray.200\",\n        boxShadow: \"sm\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.CardBody, {\n        p: 5\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Skeleton, {\n        height: \"20px\",\n        width: \"60%\",\n        mb: 4\n      }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Skeleton, {\n        height: \"40px\",\n        width: \"40%\"\n      })));\n    }));\n  }\n  if (!metrics) return null;\n  var formatCurrency = function formatCurrency(amount) {\n    var currencyCode = metrics.currency_code || 'USD';\n    var locale = currencyCode === 'BDT' ? 'en-BD' : 'en-US';\n    try {\n      return new Intl.NumberFormat(locale, {\n        style: 'currency',\n        currency: currencyCode,\n        minimumFractionDigits: 2\n      }).format(amount);\n    } catch (error) {\n      // Fallback for invalid currency codes\n      return \"\".concat(metrics.currency_symbol || '$').concat(amount);\n    }\n  };\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Box, {\n    mb: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.HStack, {\n    mb: 5,\n    mt: 4,\n    spacing: 3,\n    align: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_15__.FiActivity,\n    color: \"blue.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Text, {\n    mt: 0,\n    mb: 0,\n    fontSize: \"lg\",\n    fontWeight: \"700\"\n  }, \"Order Metrics\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.SimpleGrid, {\n    columns: {\n      base: 1,\n      md: 2,\n      lg: 4\n    },\n    spacing: 5,\n    mb: 5\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(MetricCard, {\n    label: \"Total Revenue\",\n    value: formatCurrency(metrics.total_revenue),\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_15__.FiActivity,\n    color: \"green\",\n    helpText: \"Lifetime Gross Sales\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(MetricCard, {\n    label: \"Total Orders\",\n    value: metrics.total_orders,\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_15__.FiShoppingBag,\n    color: \"blue\",\n    helpText: \"\".concat(metrics.completed, \" completed\")\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(MetricCard, {\n    label: \"Items Sold\",\n    value: metrics.total_items,\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_15__.FiPackage,\n    color: \"purple\",\n    helpText: \"Across all orders\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(MetricCard, {\n    label: \"Average Order Value\",\n    value: formatCurrency(metrics.aov),\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_15__.FiTrendingUp,\n    color: \"orange\",\n    helpText: \"Revenue / Orders\"\n  })));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OrderMetrics);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Components/OrderMetrics.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Coupons/CouponList.jsx"
/*!*******************************************************!*\
  !*** ./src/Pages/StoreManager/Coupons/CouponList.jsx ***!
  \*******************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _utils_exportUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../utils/exportUtils */ \"./src/utils/exportUtils.js\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/hooks/dist/esm/use-disclosure.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/icon-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/checkbox/checkbox.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/color-mode/color-mode-context.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-arrow.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-trigger.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/skeleton/skeleton.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table-container.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tbody.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/td.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/th.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/thead.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tr.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/heading.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router/dist/development/chunk-EPOLDU6W.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! lodash.debounce */ \"./node_modules/lodash.debounce/index.js\");\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_33___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_33__);\n/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! react-hot-toast */ \"./node_modules/react-hot-toast/dist/index.mjs\");\n/* harmony import */ var react_icons_fa__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! react-icons/fa */ \"./node_modules/react-icons/fa/index.mjs\");\n/* harmony import */ var _Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../../../Components/shared/DatePicker */ \"./src/Components/shared/DatePicker.jsx\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var _Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../../../Components/shared/ConfirmDialog */ \"./src/Components/shared/ConfirmDialog.jsx\");\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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 _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\n\n\n\n\n\n\n\nvar CouponList = function CouponList() {\n  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_31__.useNavigate)();\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState2 = _slicedToArray(_useState, 2),\n    coupons = _useState2[0],\n    setCoupons = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),\n    _useState4 = _slicedToArray(_useState3, 2),\n    loading = _useState4[0],\n    setLoading = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0),\n    _useState6 = _slicedToArray(_useState5, 2),\n    totalRows = _useState6[0],\n    setTotalRows = _useState6[1];\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(10),\n    _useState8 = _slicedToArray(_useState7, 2),\n    perPage = _useState8[0],\n    setPerPage = _useState8[1];\n  var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1),\n    _useState0 = _slicedToArray(_useState9, 2),\n    currentPage = _useState0[0],\n    setCurrentPage = _useState0[1];\n  var _useState1 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"\"),\n    _useState10 = _slicedToArray(_useState1, 2),\n    searchTerm = _useState10[0],\n    setSearchTerm = _useState10[1];\n  var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState12 = _slicedToArray(_useState11, 2),\n    currentStore = _useState12[0],\n    setCurrentStore = _useState12[1];\n  var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState14 = _slicedToArray(_useState13, 2),\n    selectedRows = _useState14[0],\n    setSelectedRows = _useState14[1];\n  var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_36__.getAllTimeRange)()),\n    _useState16 = _slicedToArray(_useState15, 2),\n    dateRange = _useState16[0],\n    setDateRange = _useState16[1];\n  var _useDisclosure = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.useDisclosure)(),\n    isBulkConfirmOpen = _useDisclosure.isOpen,\n    onBulkConfirmOpen = _useDisclosure.onOpen,\n    onBulkConfirmClose = _useDisclosure.onClose;\n  var _useDisclosure2 = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.useDisclosure)(),\n    isRowConfirmOpen = _useDisclosure2.isOpen,\n    onRowConfirmOpen = _useDisclosure2.onOpen,\n    onRowConfirmClose = _useDisclosure2.onClose;\n  var _useState17 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState18 = _slicedToArray(_useState17, 2),\n    couponToDelete = _useState18[0],\n    setCouponToDelete = _useState18[1];\n  var _useState19 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState20 = _slicedToArray(_useState19, 2),\n    isDeleting = _useState20[0],\n    setIsDeleting = _useState20[1];\n  var toggleSelectRow = function toggleSelectRow(id) {\n    setSelectedRows(function (prev) {\n      return prev.includes(id) ? prev.filter(function (rowId) {\n        return rowId !== id;\n      }) : [].concat(_toConsumableArray(prev), [id]);\n    });\n  };\n  var toggleSelectAll = function toggleSelectAll() {\n    if (selectedRows.length === coupons.length && coupons.length > 0) {\n      setSelectedRows([]);\n    } else {\n      setSelectedRows(coupons.map(function (c) {\n        return c.id;\n      }));\n    }\n  };\n  var handleBulkDelete = /*#__PURE__*/function () {\n    var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n      return _regenerator().w(function (_context) {\n        while (1) switch (_context.n) {\n          case 0:\n            onBulkConfirmOpen();\n          case 1:\n            return _context.a(2);\n        }\n      }, _callee);\n    }));\n    return function handleBulkDelete() {\n      return _ref.apply(this, arguments);\n    };\n  }();\n  var confirmBulkDelete = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {\n      var _iterator, _step, id, _t, _t2;\n      return _regenerator().w(function (_context2) {\n        while (1) switch (_context2.p = _context2.n) {\n          case 0:\n            setIsDeleting(true);\n            _context2.p = 1;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_34__[\"default\"].loading(\"Deleting \".concat(selectedRows.length, \" coupons...\"), {\n              id: 'bulk-delete'\n            });\n            _iterator = _createForOfIteratorHelper(selectedRows);\n            _context2.p = 2;\n            _iterator.s();\n          case 3:\n            if ((_step = _iterator.n()).done) {\n              _context2.n = 5;\n              break;\n            }\n            id = _step.value;\n            _context2.n = 4;\n            return axios__WEBPACK_IMPORTED_MODULE_32__[\"default\"][\"delete\"](\"/api/store-manager/coupons/\".concat(id), {\n              params: {\n                force: true\n              }\n            });\n          case 4:\n            _context2.n = 3;\n            break;\n          case 5:\n            _context2.n = 7;\n            break;\n          case 6:\n            _context2.p = 6;\n            _t = _context2.v;\n            _iterator.e(_t);\n          case 7:\n            _context2.p = 7;\n            _iterator.f();\n            return _context2.f(7);\n          case 8:\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_34__[\"default\"].success(\"Coupons deleted successfully\", {\n              id: 'bulk-delete'\n            });\n            setSelectedRows([]);\n            fetchCoupons(currentPage, perPage, searchTerm);\n            _context2.n = 10;\n            break;\n          case 9:\n            _context2.p = 9;\n            _t2 = _context2.v;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_34__[\"default\"].error(\"Failed to delete some coupons\", {\n              id: 'bulk-delete'\n            });\n          case 10:\n            _context2.p = 10;\n            setIsDeleting(false);\n            onBulkConfirmClose();\n            return _context2.f(10);\n          case 11:\n            return _context2.a(2);\n        }\n      }, _callee2, null, [[2, 6, 7, 8], [1, 9, 10, 11]]);\n    }));\n    return function confirmBulkDelete() {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  var promptDeleteCoupon = function promptDeleteCoupon(coupon) {\n    setCouponToDelete(coupon);\n    onRowConfirmOpen();\n  };\n  var confirmDeleteCoupon = /*#__PURE__*/function () {\n    var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {\n      var _err$response, _t3;\n      return _regenerator().w(function (_context3) {\n        while (1) switch (_context3.p = _context3.n) {\n          case 0:\n            if (couponToDelete) {\n              _context3.n = 1;\n              break;\n            }\n            return _context3.a(2);\n          case 1:\n            setIsDeleting(true);\n            _context3.p = 2;\n            _context3.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_32__[\"default\"][\"delete\"](\"/api/store-manager/coupons/\".concat(couponToDelete.id), {\n              params: {\n                force: true\n              }\n            });\n          case 3:\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_34__[\"default\"].success(\"Coupon deleted successfully\");\n            fetchCoupons(currentPage, perPage, searchTerm);\n            _context3.n = 5;\n            break;\n          case 4:\n            _context3.p = 4;\n            _t3 = _context3.v;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_34__[\"default\"].error(((_err$response = _t3.response) === null || _err$response === void 0 || (_err$response = _err$response.data) === null || _err$response === void 0 ? void 0 : _err$response.message) || \"Failed to delete coupon\");\n          case 5:\n            _context3.p = 5;\n            setIsDeleting(false);\n            setCouponToDelete(null);\n            onRowConfirmClose();\n            return _context3.f(5);\n          case 6:\n            return _context3.a(2);\n        }\n      }, _callee3, null, [[2, 4, 5, 6]]);\n    }));\n    return function confirmDeleteCoupon() {\n      return _ref3.apply(this, arguments);\n    };\n  }();\n  var fetchCurrentStore = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {\n    var _response$data, response, _t4;\n    return _regenerator().w(function (_context4) {\n      while (1) switch (_context4.p = _context4.n) {\n        case 0:\n          _context4.p = 0;\n          _context4.n = 1;\n          return axios__WEBPACK_IMPORTED_MODULE_32__[\"default\"].get('/api/stores');\n        case 1:\n          response = _context4.v;\n          setCurrentStore((_response$data = response.data) === null || _response$data === void 0 || (_response$data = _response$data.stores) === null || _response$data === void 0 ? void 0 : _response$data.find(function (s) {\n            return s.is_current == 1;\n          }));\n          _context4.n = 3;\n          break;\n        case 2:\n          _context4.p = 2;\n          _t4 = _context4.v;\n        case 3:\n          return _context4.a(2);\n      }\n    }, _callee4, null, [[0, 2]]);\n  })), []);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    fetchCurrentStore();\n  }, [fetchCurrentStore]);\n  var bgCard = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.useColorModeValue)(\"white\", \"gray.800\");\n  var borderColor = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.useColorModeValue)(\"gray.200\", \"gray.700\");\n  var fetchCoupons = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {\n    var page,\n      perPageSize,\n      search,\n      _data$meta,\n      params,\n      response,\n      data,\n      couponsList,\n      _args5 = arguments,\n      _t5;\n    return _regenerator().w(function (_context5) {\n      while (1) switch (_context5.p = _context5.n) {\n        case 0:\n          page = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : 1;\n          perPageSize = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : 10;\n          search = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : \"\";\n          _context5.p = 1;\n          setLoading(true);\n          params = {\n            page: page,\n            per_page: perPageSize,\n            search: search,\n            after: dateRange !== null && dateRange !== void 0 && dateRange.startDate ? dateRange.startDate.toISOString().split('.')[0] + 'Z' : undefined,\n            before: dateRange !== null && dateRange !== void 0 && dateRange.endDate ? dateRange.endDate.toISOString().split('.')[0] + 'Z' : undefined\n          };\n          _context5.n = 2;\n          return axios__WEBPACK_IMPORTED_MODULE_32__[\"default\"].get(\"/api/store-manager/coupons\", {\n            params: params\n          });\n        case 2:\n          response = _context5.v;\n          data = response === null || response === void 0 ? void 0 : response.data;\n          couponsList = Array.isArray(data === null || data === void 0 ? void 0 : data.data) ? data.data : [];\n          setCoupons(couponsList);\n          setTotalRows((data === null || data === void 0 || (_data$meta = data.meta) === null || _data$meta === void 0 ? void 0 : _data$meta.total) || couponsList.length);\n          setCurrentPage(page);\n          setPerPage(perPageSize);\n          _context5.n = 4;\n          break;\n        case 3:\n          _context5.p = 3;\n          _t5 = _context5.v;\n          console.error(\"Failed to fetch coupons\", _t5);\n        case 4:\n          _context5.p = 4;\n          setLoading(false);\n          return _context5.f(4);\n        case 5:\n          return _context5.a(2);\n      }\n    }, _callee5, null, [[1, 3, 4, 5]]);\n  })), []);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    fetchCoupons(1, perPage, searchTerm);\n  }, [fetchCoupons, perPage, dateRange]);\n  var debouncedFetch = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(lodash_debounce__WEBPACK_IMPORTED_MODULE_33___default()(function (value) {\n    fetchCoupons(1, perPage, value);\n  }, 500), [perPage, fetchCoupons]);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    debouncedFetch(searchTerm);\n    return function () {\n      return debouncedFetch.cancel();\n    };\n  }, [searchTerm, debouncedFetch]);\n  var getDiscountTypeLabel = function getDiscountTypeLabel(type) {\n    switch (type) {\n      case \"percent\":\n        return \"Percentage\";\n      case \"fixed_cart\":\n        return \"Fixed Cart\";\n      case \"fixed_product\":\n        return \"Fixed Product\";\n      default:\n        return type;\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(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.VStack, {\n    align: \"stretch\",\n    spacing: 6,\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    direction: {\n      base: \"column\",\n      lg: \"row\"\n    },\n    justify: \"space-between\",\n    align: {\n      base: \"stretch\",\n      lg: \"center\"\n    },\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.VStack, {\n    align: \"start\",\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Heading, {\n    m: 0,\n    size: \"lg\"\n  }, \"Discount Coupons\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Text, {\n    m: 0,\n    color: \"gray.500\",\n    fontSize: \"sm\"\n  }, \"Create and manage discount codes for your customers across your stores.\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.HStack, {\n    spacing: 3,\n    alignSelf: {\n      base: \"flex-start\",\n      lg: \"center\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"md\",\n    colorScheme: \"blue\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiPlus, null),\n    onClick: function onClick() {\n      return navigate(\"/store-manager/coupons/new\");\n    },\n    shadow: \"sm\",\n    _hover: {\n      shadow: 'md'\n    }\n  }, \"Create Coupon\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"md\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiDownload, null),\n    variant: \"outline\",\n    bg: \"white\",\n    onClick: function onClick() {\n      return (0,_utils_exportUtils__WEBPACK_IMPORTED_MODULE_1__.exportToCSV)(coupons, \"coupons-\".concat(new Date().toISOString().split('T')[0], \".csv\"));\n    },\n    isDisabled: coupons.length === 0\n  }, \"Export\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Card, {\n    variant: \"outline\",\n    p: 4,\n    borderRadius: \"xl\",\n    bg: \"gray.50\",\n    borderStyle: \"dashed\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    direction: {\n      base: \"column\",\n      md: \"row\"\n    },\n    gap: 4,\n    align: {\n      base: \"stretch\",\n      md: \"center\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    flex: \"1\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Input, {\n    placeholder: \"Search by coupon code...\",\n    value: searchTerm,\n    onChange: function onChange(e) {\n      return setSearchTerm(e.target.value);\n    },\n    bg: \"white\",\n    size: \"md\",\n    borderRadius: \"lg\",\n    leftElement: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiSearch, {\n      color: \"gray.300\"\n    })\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.HStack, {\n    spacing: 2,\n    overflowX: \"auto\",\n    pb: {\n      base: 2,\n      md: 0\n    },\n    className: \"shopcentral-scrollbar\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Popover, {\n    placement: \"bottom-end\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.PopoverTrigger, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"md\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fa__WEBPACK_IMPORTED_MODULE_35__.FaCalendar, null),\n    variant: \"outline\",\n    bg: \"white\",\n    borderRadius: \"lg\",\n    minW: \"160px\"\n  }, dateRange.label ? dateRange.label : dateRange.startDate ? \"\".concat(dateRange.startDate.toLocaleDateString(), \" - \").concat(dateRange.endDate.toLocaleDateString()) : \"Select Dates\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.PopoverContent, {\n    w: \"auto\",\n    maxW: \"unset\",\n    shadow: \"xl\",\n    borderRadius: \"xl\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.PopoverArrow, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.PopoverCloseButton, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.PopoverBody, {\n    p: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_36__[\"default\"], {\n    initialRange: dateRange,\n    onChange: function onChange(range) {\n      return setDateRange(range);\n    }\n  }))))))), selectedRows.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    bg: \"red.50\",\n    p: 3,\n    borderRadius: \"lg\",\n    borderWidth: \"1px\",\n    borderColor: \"red.100\",\n    justify: \"space-between\",\n    align: \"center\",\n    animation: \"slideInDown 0.2s ease-out\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.HStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Text, {\n    m: 0,\n    fontSize: \"sm\",\n    fontWeight: \"bold\",\n    color: \"red.700\"\n  }, selectedRows.length, \" items selected\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"xs\",\n    colorScheme: \"red\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiTrash2, null),\n    onClick: handleBulkDelete\n  }, \"Delete Selected\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"xs\",\n    variant: \"ghost\",\n    colorScheme: \"red\",\n    onClick: function onClick() {\n      return setSelectedRows([]);\n    }\n  }, \"Deselect all\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    display: \"flex\",\n    flexDirection: \"column\",\n    h: \"calc(100vh - 180px)\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Card, {\n    variant: \"outline\",\n    borderRadius: \"xl\",\n    shadow: \"sm\",\n    overflow: \"hidden\",\n    display: \"flex\",\n    flexDirection: \"column\",\n    flex: \"1\",\n    bg: \"white\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.TableContainer, {\n    flex: \"1\",\n    overflowY: \"auto\",\n    className: \"shopcentral-scrollbar\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Table, {\n    variant: \"simple\",\n    size: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Thead, {\n    bg: \"gray.50\",\n    position: \"sticky\",\n    top: 0,\n    zIndex: 5\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Th, {\n    width: \"40px\",\n    py: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Checkbox, {\n    isChecked: selectedRows.length === coupons.length && coupons.length > 0,\n    isIndeterminate: selectedRows.length > 0 && selectedRows.length < coupons.length,\n    onChange: toggleSelectAll,\n    colorScheme: \"blue\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Th, {\n    py: 4\n  }, \"Coupon Details\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Th, {\n    py: 4,\n    display: {\n      base: \"none\",\n      md: \"table-cell\"\n    }\n  }, \"Type\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Th, {\n    py: 4\n  }, \"Amount\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Th, {\n    py: 4,\n    display: {\n      base: \"none\",\n      md: \"table-cell\"\n    }\n  }, \"Usage\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Th, {\n    py: 4,\n    display: {\n      base: \"none\",\n      lg: \"table-cell\"\n    }\n  }, \"Expiry\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Th, {\n    py: 4,\n    width: \"50px\"\n  }, \"Action\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Tbody, null, loading ? [1, 2, 3, 4, 5, 6, 7, 8].map(function (i) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Tr, {\n      key: i\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n      py: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Skeleton, {\n      h: \"16px\",\n      w: \"16px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n      py: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Skeleton, {\n      h: \"32px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n      py: 4,\n      display: {\n        base: \"none\",\n        md: \"table-cell\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Skeleton, {\n      h: \"20px\",\n      w: \"60px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n      py: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Skeleton, {\n      h: \"20px\",\n      w: \"50px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n      py: 4,\n      display: {\n        base: \"none\",\n        md: \"table-cell\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Skeleton, {\n      h: \"20px\",\n      w: \"60px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n      py: 4,\n      display: {\n        base: \"none\",\n        lg: \"table-cell\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Skeleton, {\n      h: \"20px\",\n      w: \"80px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n      py: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Skeleton, {\n      h: \"24px\",\n      w: \"24px\"\n    })));\n  }) : coupons.length === 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n    colSpan: 7,\n    textAlign: \"center\",\n    py: 20\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.VStack, {\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiTag,\n    boxSize: 10,\n    color: \"gray.200\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Text, {\n    m: 0,\n    fontWeight: \"bold\",\n    color: \"gray.400\"\n  }, \"No coupons found matching your criteria\")))) : coupons.map(function (coupon) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Tr, {\n      key: coupon.id,\n      _hover: {\n        bg: \"gray.50\"\n      },\n      transition: \"background 0.2s\",\n      cursor: \"default\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n      py: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Checkbox, {\n      isChecked: selectedRows.includes(coupon.id),\n      onChange: function onChange() {\n        return toggleSelectRow(coupon.id);\n      },\n      colorScheme: \"blue\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n      py: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.VStack, {\n      align: \"start\",\n      spacing: 1\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.HStack, {\n      spacing: 2\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiTag,\n      boxSize: 3,\n      color: \"blue.500\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Text, {\n      m: 0,\n      fontWeight: \"800\",\n      fontSize: \"sm\",\n      color: \"blue.600\"\n    }, coupon.code)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n      display: {\n        base: \"block\",\n        md: \"none\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Badge, {\n      variant: \"subtle\",\n      colorScheme: \"purple\",\n      fontSize: \"3xs\",\n      px: 1\n    }, getDiscountTypeLabel(coupon.discount_type))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n      py: 3,\n      display: {\n        base: \"none\",\n        md: \"table-cell\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Badge, {\n      variant: \"subtle\",\n      colorScheme: \"purple\",\n      fontSize: \"2xs\",\n      borderRadius: \"md\",\n      px: 2\n    }, getDiscountTypeLabel(coupon.discount_type))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n      py: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.VStack, {\n      align: \"start\",\n      spacing: 0\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Text, {\n      m: 0,\n      fontWeight: \"900\",\n      fontSize: \"sm\",\n      color: \"gray.800\"\n    }, coupon.discount_type === 'percent' ? \"\".concat(coupon.amount, \"%\") : \"$\".concat(coupon.amount)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Text, {\n      m: 0,\n      fontSize: \"3xs\",\n      color: \"gray.400\",\n      display: {\n        base: \"block\",\n        lg: \"none\"\n      }\n    }, coupon.date_expires ? new Date(coupon.date_expires).toLocaleDateString() : 'Never'))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n      py: 3,\n      display: {\n        base: \"none\",\n        md: \"table-cell\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.VStack, {\n      align: \"start\",\n      spacing: 0\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Text, {\n      m: 0,\n      fontSize: \"xs\",\n      fontWeight: \"bold\",\n      color: \"gray.700\"\n    }, coupon.usage_count, \" / \", coupon.usage_limit || '∞'), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Text, {\n      m: 0,\n      fontSize: \"3xs\",\n      color: \"gray.400\"\n    }, \"Uses Left\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n      py: 3,\n      fontSize: \"xs\",\n      color: \"gray.600\",\n      display: {\n        base: \"none\",\n        lg: \"table-cell\"\n      }\n    }, coupon.date_expires ? new Date(coupon.date_expires).toLocaleDateString() : 'Never'), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n      py: 3,\n      textAlign: \"right\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.IconButton, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiTrash2, null),\n      \"aria-label\": \"Delete Coupon\",\n      variant: \"ghost\",\n      size: \"sm\",\n      colorScheme: \"red\",\n      borderRadius: \"full\",\n      _hover: {\n        bg: \"red.50\"\n      },\n      onClick: function onClick() {\n        return promptDeleteCoupon(coupon);\n      }\n    })));\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    p: 4,\n    justify: \"space-between\",\n    align: \"center\",\n    bg: \"gray.50\",\n    borderTop: \"1px\",\n    borderColor: \"gray.200\",\n    flexShrink: 0,\n    direction: {\n      base: \"column\",\n      sm: \"row\"\n    },\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    fontWeight: \"bold\",\n    color: \"gray.500\"\n  }, \"Showing \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    as: \"span\",\n    color: \"blue.600\"\n  }, (currentPage - 1) * perPage + 1), \" to \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    as: \"span\",\n    color: \"blue.600\"\n  }, Math.min(currentPage * perPage, totalRows)), \" of \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    as: \"span\",\n    color: \"gray.800\"\n  }, totalRows), \" coupons\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.HStack, {\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"sm\",\n    variant: \"ghost\",\n    isDisabled: currentPage === 1,\n    onClick: function onClick() {\n      return fetchCoupons(currentPage - 1, perPage, searchTerm);\n    },\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiChevronLeft, null),\n    borderRadius: \"lg\",\n    fontWeight: \"bold\",\n    fontSize: \"xs\"\n  }, \"Previous\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    px: 3,\n    py: 1,\n    bg: \"white\",\n    borderRadius: \"md\",\n    border: \"1px\",\n    borderColor: \"gray.200\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    fontWeight: \"800\",\n    color: \"blue.600\"\n  }, currentPage)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"sm\",\n    variant: \"ghost\",\n    isDisabled: currentPage * perPage >= totalRows,\n    onClick: function onClick() {\n      return fetchCoupons(currentPage + 1, perPage, searchTerm);\n    },\n    rightIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiChevronRight, null),\n    borderRadius: \"lg\",\n    fontWeight: \"bold\",\n    fontSize: \"xs\"\n  }, \"Next\")))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_38__[\"default\"], {\n    isOpen: isBulkConfirmOpen,\n    onClose: onBulkConfirmClose,\n    onConfirm: confirmBulkDelete,\n    title: \"Delete Coupons\",\n    description: \"Are you sure you want to permanently delete \".concat(selectedRows.length, \" coupon\").concat(selectedRows.length > 1 ? 's' : '', \"? This cannot be undone.\"),\n    confirmLabel: \"Delete\",\n    loading: isDeleting\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_38__[\"default\"], {\n    isOpen: isRowConfirmOpen,\n    onClose: function onClose() {\n      onRowConfirmClose();\n      setCouponToDelete(null);\n    },\n    onConfirm: confirmDeleteCoupon,\n    title: \"Delete Coupon\",\n    description: couponToDelete ? \"Are you sure you want to permanently delete coupon \\\"\".concat(couponToDelete.code, \"\\\"? This cannot be undone.\") : '',\n    confirmLabel: \"Delete\",\n    loading: isDeleting\n  }));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CouponList);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Coupons/CouponList.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Coupons/CreateCoupon.jsx"
/*!*********************************************************!*\
  !*** ./src/Pages/StoreManager/Coupons/CreateCoupon.jsx ***!
  \*********************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/container/container.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/divider/divider.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-control.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-label.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/grid.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input-group.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input-element.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/select/select.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/switch/switch.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/textarea/textarea.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/heading.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router/dist/development/chunk-EPOLDU6W.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! react-hot-toast */ \"./node_modules/react-hot-toast/dist/index.mjs\");\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 _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\n\n\nvar CreateCoupon = function CreateCoupon() {\n  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_22__.useNavigate)();\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState2 = _slicedToArray(_useState, 2),\n    isLoading = _useState2[0],\n    setIsLoading = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({\n      code: \"\",\n      description: \"\",\n      discount_type: \"fixed_cart\",\n      amount: \"\",\n      date_expires: \"\",\n      minimum_amount: \"\",\n      maximum_amount: \"\",\n      usage_limit: \"\",\n      usage_limit_per_user: \"\",\n      individual_use: false,\n      free_shipping: false,\n      exclude_sale_items: false\n    }),\n    _useState4 = _slicedToArray(_useState3, 2),\n    formData = _useState4[0],\n    setFormData = _useState4[1];\n  var handleChange = function handleChange(e) {\n    var _e$target = e.target,\n      name = _e$target.name,\n      value = _e$target.value,\n      type = _e$target.type,\n      checked = _e$target.checked;\n    setFormData(function (prev) {\n      return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, name, type === 'checkbox' ? checked : value));\n    });\n  };\n  var handleSubmit = /*#__PURE__*/function () {\n    var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n      var _error$response, _t;\n      return _regenerator().w(function (_context) {\n        while (1) switch (_context.p = _context.n) {\n          case 0:\n            if (formData.code) {\n              _context.n = 1;\n              break;\n            }\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_24__[\"default\"].error(\"Coupon code is required\");\n            return _context.a(2);\n          case 1:\n            setIsLoading(true);\n            _context.p = 2;\n            _context.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_23__[\"default\"].post(\"/api/store-manager/coupons\", formData);\n          case 3:\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_24__[\"default\"].success(\"Coupon created successfully\");\n            navigate(\"/store-manager/coupons\");\n            _context.n = 5;\n            break;\n          case 4:\n            _context.p = 4;\n            _t = _context.v;\n            console.error(_t);\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_24__[\"default\"].error(((_error$response = _t.response) === null || _error$response === void 0 || (_error$response = _error$response.data) === null || _error$response === void 0 ? void 0 : _error$response.message) || \"Failed to create coupon\");\n          case 5:\n            _context.p = 5;\n            setIsLoading(false);\n            return _context.f(5);\n          case 6:\n            return _context.a(2);\n        }\n      }, _callee, null, [[2, 4, 5, 6]]);\n    }));\n    return function handleSubmit() {\n      return _ref.apply(this, arguments);\n    };\n  }();\n  var handleGenerateCode = function handleGenerateCode() {\n    var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n    var result = '';\n    for (var i = 0; i < 10; i++) {\n      result += characters.charAt(Math.floor(Math.random() * characters.length));\n    }\n    setFormData(function (prev) {\n      return _objectSpread(_objectSpread({}, prev), {}, {\n        code: result\n      });\n    });\n    react_hot_toast__WEBPACK_IMPORTED_MODULE_24__[\"default\"].success(\"Coupon code generated!\");\n  };\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Container, {\n    maxW: \"container.xl\",\n    py: 8\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"form\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n    direction: {\n      base: \"column\",\n      md: \"row\"\n    },\n    justify: \"space-between\",\n    align: {\n      base: \"start\",\n      md: \"center\"\n    },\n    mb: 6,\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.HStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_21__.FiChevronLeft, null),\n    variant: \"ghost\",\n    onClick: function onClick() {\n      return navigate(\"/store-manager/coupons\");\n    }\n  }, \"Back\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Heading, {\n    size: \"lg\"\n  }, \"Create New Coupon\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_21__.FiSave, null),\n    colorScheme: \"blue\",\n    isLoading: isLoading,\n    onClick: handleSubmit,\n    w: {\n      base: \"full\",\n      md: \"auto\"\n    }\n  }, \"Publish Coupon\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Grid, {\n    templateColumns: {\n      base: \"1fr\",\n      lg: \"2fr 1fr\"\n    },\n    gap: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    spacing: 6,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Card, {\n    variant: \"outline\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, {\n    isRequired: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, null, \"Coupon Code\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.InputGroup, {\n    size: \"lg\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Input, {\n    name: \"code\",\n    value: formData.code,\n    onChange: handleChange,\n    placeholder: \"e.g. SUMMER2024\",\n    fontWeight: \"bold\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.InputRightElement, {\n    width: \"auto\",\n    pr: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Button, {\n    size: \"sm\",\n    onClick: handleGenerateCode,\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_21__.FiRefreshCw, null)\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Box, {\n    as: \"span\",\n    display: {\n      base: \"none\",\n      sm: \"inline\"\n    }\n  }, \"Generate\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, null, \"Description\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Textarea, {\n    name: \"description\",\n    value: formData.description,\n    onChange: handleChange,\n    placeholder: \"Description for internal use...\"\n  }))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Card, {\n    variant: \"outline\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Heading, {\n    size: \"md\",\n    mb: 4\n  }, \"Coupon Data\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Grid, {\n    templateColumns: {\n      base: \"1fr\",\n      md: \"1fr 1fr\"\n    },\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, null, \"Discount Type\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Select, {\n    name: \"discount_type\",\n    value: formData.discount_type,\n    onChange: handleChange\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"percent\"\n  }, \"Percentage discount\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"fixed_cart\"\n  }, \"Fixed cart discount\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"fixed_product\"\n  }, \"Fixed product discount\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, null, \"Coupon Amount\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Input, {\n    name: \"amount\",\n    type: \"number\",\n    value: formData.amount,\n    onChange: handleChange,\n    placeholder: \"0\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, null, \"Expiry Date\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Input, {\n    name: \"date_expires\",\n    type: \"date\",\n    value: formData.date_expires,\n    onChange: handleChange\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Divider, {\n    my: 6\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    align: \"stretch\",\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n    justify: \"space-between\",\n    align: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    fontWeight: \"600\"\n  }, \"Free Shipping\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.500\"\n  }, \"Allow free shipping if this coupon is used\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Switch, {\n    name: \"free_shipping\",\n    isChecked: formData.free_shipping,\n    onChange: handleChange\n  }))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Card, {\n    variant: \"outline\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Heading, {\n    size: \"md\",\n    mb: 4\n  }, \"Usage Restrictions\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Grid, {\n    templateColumns: {\n      base: \"1fr\",\n      md: \"1fr 1fr\"\n    },\n    gap: 4,\n    mb: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, null, \"Minimum Spend\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Input, {\n    name: \"minimum_amount\",\n    type: \"number\",\n    value: formData.minimum_amount,\n    onChange: handleChange,\n    placeholder: \"No minimum\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, null, \"Maximum Spend\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Input, {\n    name: \"maximum_amount\",\n    type: \"number\",\n    value: formData.maximum_amount,\n    onChange: handleChange,\n    placeholder: \"No maximum\"\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    align: \"stretch\",\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n    justify: \"space-between\",\n    align: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    fontWeight: \"600\"\n  }, \"Individual Use Only\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.500\"\n  }, \"Check this box if the coupon cannot be used in conjunction with other coupons\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Switch, {\n    name: \"individual_use\",\n    isChecked: formData.individual_use,\n    onChange: handleChange\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n    justify: \"space-between\",\n    align: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    fontWeight: \"600\"\n  }, \"Exclude Sale Items\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.500\"\n  }, \"Check this box if the coupon should not apply to items on sale\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Switch, {\n    name: \"exclude_sale_items\",\n    isChecked: formData.exclude_sale_items,\n    onChange: handleChange\n  })))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    spacing: 6,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Card, {\n    variant: \"outline\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Heading, {\n    size: \"md\",\n    mb: 4\n  }, \"Usage Limits\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, null, \"Usage limit per coupon\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Input, {\n    name: \"usage_limit\",\n    type: \"number\",\n    value: formData.usage_limit,\n    onChange: handleChange,\n    placeholder: \"Unlimited\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, null, \"Usage limit per user\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Input, {\n    name: \"usage_limit_per_user\",\n    type: \"number\",\n    value: formData.usage_limit_per_user,\n    onChange: handleChange,\n    placeholder: \"Unlimited\"\n  })))))))));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CreateCoupon);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Coupons/CreateCoupon.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Coupons/ViewCoupon.jsx"
/*!*******************************************************!*\
  !*** ./src/Pages/StoreManager/Coupons/ViewCoupon.jsx ***!
  \*******************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/hooks/dist/esm/use-disclosure.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/breadcrumb/breadcrumb.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/breadcrumb/breadcrumb-item.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/breadcrumb/breadcrumb-link.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/divider/divider.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/simple-grid.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/spinner/spinner.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/heading.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router/dist/development/chunk-EPOLDU6W.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! react-hot-toast */ \"./node_modules/react-hot-toast/dist/index.mjs\");\n/* harmony import */ var _utils_FormatDate__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../../utils/FormatDate */ \"./src/utils/FormatDate.js\");\n/* harmony import */ var _Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../../Components/shared/ConfirmDialog */ \"./src/Components/shared/ConfirmDialog.jsx\");\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\n\n\n\n\nvar ViewCoupon = function ViewCoupon() {\n  var _coupon$email_restric;\n  var _useParams = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_20__.useParams)(),\n    id = _useParams.id;\n  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_20__.useNavigate)();\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState2 = _slicedToArray(_useState, 2),\n    coupon = _useState2[0],\n    setCoupon = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),\n    _useState4 = _slicedToArray(_useState3, 2),\n    loading = _useState4[0],\n    setLoading = _useState4[1];\n  var _useDisclosure = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.useDisclosure)(),\n    isDeleteOpen = _useDisclosure.isOpen,\n    onDeleteOpen = _useDisclosure.onOpen,\n    onDeleteClose = _useDisclosure.onClose;\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState6 = _slicedToArray(_useState5, 2),\n    isDeleting = _useState6[0],\n    setIsDeleting = _useState6[1];\n  var fetchCoupon = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n    var _response$data, response, couponData, _t;\n    return _regenerator().w(function (_context) {\n      while (1) switch (_context.p = _context.n) {\n        case 0:\n          _context.p = 0;\n          setLoading(true);\n          _context.n = 1;\n          return axios__WEBPACK_IMPORTED_MODULE_21__[\"default\"].get(\"/api/store-manager/coupons/\".concat(id));\n        case 1:\n          response = _context.v;\n          couponData = ((_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.data) || response.data;\n          setCoupon(couponData);\n          _context.n = 3;\n          break;\n        case 2:\n          _context.p = 2;\n          _t = _context.v;\n          react_hot_toast__WEBPACK_IMPORTED_MODULE_22__[\"default\"].error(\"Failed to load coupon details\");\n          navigate(\"/store-manager/coupons\");\n        case 3:\n          _context.p = 3;\n          setLoading(false);\n          return _context.f(3);\n        case 4:\n          return _context.a(2);\n      }\n    }, _callee, null, [[0, 2, 3, 4]]);\n  })), [id, navigate]);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    fetchCoupon();\n  }, [fetchCoupon]);\n  var handleDelete = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {\n      return _regenerator().w(function (_context2) {\n        while (1) switch (_context2.n) {\n          case 0:\n            onDeleteOpen();\n          case 1:\n            return _context2.a(2);\n        }\n      }, _callee2);\n    }));\n    return function handleDelete() {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  var confirmDelete = /*#__PURE__*/function () {\n    var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {\n      var _t2;\n      return _regenerator().w(function (_context3) {\n        while (1) switch (_context3.p = _context3.n) {\n          case 0:\n            setIsDeleting(true);\n            _context3.p = 1;\n            _context3.n = 2;\n            return axios__WEBPACK_IMPORTED_MODULE_21__[\"default\"][\"delete\"](\"/api/store-manager/coupons/\".concat(id));\n          case 2:\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_22__[\"default\"].success(\"Coupon deleted successfully\");\n            navigate(\"/store-manager/coupons\");\n            _context3.n = 4;\n            break;\n          case 3:\n            _context3.p = 3;\n            _t2 = _context3.v;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_22__[\"default\"].error(\"Failed to delete coupon\");\n          case 4:\n            _context3.p = 4;\n            setIsDeleting(false);\n            onDeleteClose();\n            return _context3.f(4);\n          case 5:\n            return _context3.a(2);\n        }\n      }, _callee3, null, [[1, 3, 4, 5]]);\n    }));\n    return function confirmDelete() {\n      return _ref3.apply(this, arguments);\n    };\n  }();\n  if (loading) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n      justify: \"center\",\n      align: \"center\",\n      h: \"60vh\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Spinner, {\n      size: \"xl\",\n      color: \"blue.500\",\n      thickness: \"4px\"\n    }));\n  }\n  if (!coupon) return null;\n  var getDiscountTypeLabel = function getDiscountTypeLabel(type) {\n    var types = {\n      fixed_cart: \"Fixed Cart Discount\",\n      percent: \"Percentage Discount\",\n      fixed_product: \"Fixed Product Discount\"\n    };\n    return types[type] || type;\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(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    animation: \"fadeIn 0.4s ease-out\",\n    pb: 10\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    justify: \"space-between\",\n    align: \"center\",\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    align: \"start\",\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Breadcrumb, {\n    fontSize: \"sm\",\n    color: \"gray.500\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.BreadcrumbItem, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.BreadcrumbLink, {\n    onClick: function onClick() {\n      return navigate(\"/store-manager/coupons\");\n    }\n  }, \"Discounts\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.BreadcrumbItem, {\n    isCurrentPage: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.BreadcrumbLink, null, coupon.code))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Heading, {\n    size: \"lg\",\n    fontWeight: \"800\"\n  }, \"Coupon: \", coupon.code)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.HStack, {\n    spacing: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiArrowLeft, null),\n    variant: \"ghost\",\n    onClick: function onClick() {\n      return navigate(\"/store-manager/coupons\");\n    },\n    borderRadius: \"xl\"\n  }, \"Back\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiTrash2, null),\n    colorScheme: \"red\",\n    variant: \"subtle\",\n    onClick: handleDelete,\n    borderRadius: \"xl\"\n  }, \"Delete\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.SimpleGrid, {\n    columns: {\n      base: 1,\n      md: 3\n    },\n    spacing: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    gridColumn: {\n      md: \"span 2\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Card, {\n    variant: \"outline\",\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\",\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.CardBody, {\n    p: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    justify: \"space-between\",\n    align: \"center\",\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    align: \"start\",\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    color: \"gray.400\",\n    fontWeight: \"700\",\n    fontSize: \"xs\",\n    textTransform: \"uppercase\",\n    letterSpacing: \"wider\"\n  }, \"Code\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.HStack, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiTag,\n    color: \"blue.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontWeight: \"900\",\n    fontSize: \"2xl\",\n    color: \"blue.600\"\n  }, coupon.code))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    align: \"end\",\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    color: \"gray.400\",\n    fontWeight: \"700\",\n    fontSize: \"xs\",\n    textTransform: \"uppercase\",\n    letterSpacing: \"wider\"\n  }, \"Expiry\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontWeight: \"800\",\n    fontSize: \"sm\"\n  }, coupon.date_expires ? (0,_utils_FormatDate__WEBPACK_IMPORTED_MODULE_23__.FormatDate)(coupon.date_expires) : 'NEVER'))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Divider, {\n    mb: 6\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.SimpleGrid, {\n    columns: 2,\n    spacing: 8,\n    mb: 8\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    align: \"start\",\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    color: \"gray.500\",\n    fontSize: \"xs\",\n    fontWeight: \"700\",\n    textTransform: \"uppercase\"\n  }, \"Discount Type\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontWeight: \"800\"\n  }, getDiscountTypeLabel(coupon.discount_type))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    align: \"start\",\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    color: \"gray.500\",\n    fontSize: \"xs\",\n    fontWeight: \"700\",\n    textTransform: \"uppercase\"\n  }, \"Amount\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontWeight: \"900\",\n    fontSize: \"xl\",\n    color: \"green.600\"\n  }, coupon.discount_type === 'percent' ? \"\".concat(coupon.amount, \"%\") : \"$\".concat(coupon.amount)))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Heading, {\n    size: \"xs\",\n    mb: 4,\n    textTransform: \"uppercase\",\n    color: \"gray.400\",\n    letterSpacing: \"widest\"\n  }, \"Usage Limits\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.SimpleGrid, {\n    columns: 3,\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    bg: \"gray.50\",\n    p: 4,\n    borderRadius: \"xl\",\n    textAlign: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontSize: \"2xl\",\n    fontWeight: \"900\",\n    color: \"blue.600\"\n  }, coupon.usage_count), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontSize: \"xs\",\n    fontWeight: \"700\",\n    color: \"gray.500\"\n  }, \"USED\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    bg: \"gray.50\",\n    p: 4,\n    borderRadius: \"xl\",\n    textAlign: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontSize: \"2xl\",\n    fontWeight: \"900\",\n    color: \"gray.600\"\n  }, coupon.usage_limit || '∞'), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontSize: \"xs\",\n    fontWeight: \"700\",\n    color: \"gray.500\"\n  }, \"LIMIT\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    bg: \"gray.50\",\n    p: 4,\n    borderRadius: \"xl\",\n    textAlign: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontSize: \"2xl\",\n    fontWeight: \"900\",\n    color: \"gray.600\"\n  }, coupon.usage_limit_per_user || '∞'), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontSize: \"xs\",\n    fontWeight: \"700\",\n    color: \"gray.500\"\n  }, \"PER USER\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Card, {\n    variant: \"outline\",\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.CardBody, {\n    p: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Heading, {\n    size: \"sm\",\n    mb: 6,\n    fontWeight: \"800\"\n  }, \"Usage Restrictions\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    align: \"stretch\",\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    justify: \"space-between\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.500\",\n    fontWeight: \"600\"\n  }, \"Minimum Spend\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontSize: \"sm\",\n    fontWeight: \"700\"\n  }, \"$\", coupon.minimum_amount || '0.00')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    justify: \"space-between\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.500\",\n    fontWeight: \"600\"\n  }, \"Maximum Spend\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontSize: \"sm\",\n    fontWeight: \"700\"\n  }, \"$\", coupon.maximum_amount || 'No Limit')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    justify: \"space-between\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.500\",\n    fontWeight: \"600\"\n  }, \"Individual Use Only\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n    colorScheme: coupon.individual_use ? \"green\" : \"gray\"\n  }, coupon.individual_use ? \"Yes\" : \"No\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    justify: \"space-between\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.500\",\n    fontWeight: \"600\"\n  }, \"Exclude Sale Items\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n    colorScheme: coupon.exclude_sale_items ? \"green\" : \"gray\"\n  }, coupon.exclude_sale_items ? \"Yes\" : \"No\")))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Card, {\n    variant: \"outline\",\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\",\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.CardBody, {\n    p: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Heading, {\n    size: \"sm\",\n    mb: 4,\n    fontWeight: \"800\"\n  }, \"Coupon Settings\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    align: \"stretch\",\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.400\",\n    fontWeight: \"700\",\n    textTransform: \"uppercase\",\n    mb: 2\n  }, \"Description\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.600\",\n    bg: \"gray.50\",\n    p: 3,\n    borderRadius: \"lg\"\n  }, coupon.description || 'No description provided.')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.400\",\n    fontWeight: \"700\",\n    textTransform: \"uppercase\",\n    mb: 2\n  }, \"Allowed Emails\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.600\"\n  }, ((_coupon$email_restric = coupon.email_restrictions) === null || _coupon$email_restric === void 0 ? void 0 : _coupon$email_restric.length) > 0 ? coupon.email_restrictions.join(', ') : 'Any email address')))))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_24__[\"default\"], {\n    isOpen: isDeleteOpen,\n    onClose: onDeleteClose,\n    onConfirm: confirmDelete,\n    title: \"Delete Coupon\",\n    description: \"Are you sure you want to permanently delete this coupon? This cannot be undone.\",\n    confirmLabel: \"Delete\",\n    loading: isDeleting\n  }));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ViewCoupon);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Coupons/ViewCoupon.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Customers/CreateCustomer.jsx"
/*!*************************************************************!*\
  !*** ./src/Pages/StoreManager/Customers/CreateCustomer.jsx ***!
  \*************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-control.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-label.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-footer.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-header.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-overlay.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! react-hot-toast */ \"./node_modules/react-hot-toast/dist/index.mjs\");\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 _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\nvar CreateCustomer = function CreateCustomer(_ref) {\n  var isOpen = _ref.isOpen,\n    onClose = _ref.onClose,\n    onSuccess = _ref.onSuccess;\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState2 = _slicedToArray(_useState, 2),\n    isLoading = _useState2[0],\n    setIsLoading = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({\n      first_name: \"\",\n      last_name: \"\",\n      email: \"\",\n      username: \"\",\n      password: \"\"\n    }),\n    _useState4 = _slicedToArray(_useState3, 2),\n    formData = _useState4[0],\n    setFormData = _useState4[1];\n  var handleChange = function handleChange(e) {\n    setFormData(_objectSpread(_objectSpread({}, formData), {}, _defineProperty({}, e.target.name, e.target.value)));\n  };\n  var handleSubmit = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n      var _error$response, _t;\n      return _regenerator().w(function (_context) {\n        while (1) switch (_context.p = _context.n) {\n          case 0:\n            if (!(!formData.email || !formData.username)) {\n              _context.n = 1;\n              break;\n            }\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_15__[\"default\"].error(\"Email and Username are required\");\n            return _context.a(2);\n          case 1:\n            setIsLoading(true);\n            _context.p = 2;\n            _context.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_14__[\"default\"].post(\"/api/store-manager/customers\", formData);\n          case 3:\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_15__[\"default\"].success(\"Customer created successfully\");\n            onSuccess();\n            onClose();\n            setFormData({\n              first_name: \"\",\n              last_name: \"\",\n              email: \"\",\n              username: \"\",\n              password: \"\"\n            });\n            _context.n = 5;\n            break;\n          case 4:\n            _context.p = 4;\n            _t = _context.v;\n            console.error(_t);\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_15__[\"default\"].error(((_error$response = _t.response) === null || _error$response === void 0 || (_error$response = _error$response.data) === null || _error$response === void 0 ? void 0 : _error$response.message) || \"Failed to create customer\");\n          case 5:\n            _context.p = 5;\n            setIsLoading(false);\n            return _context.f(5);\n          case 6:\n            return _context.a(2);\n        }\n      }, _callee, null, [[2, 4, 5, 6]]);\n    }));\n    return function handleSubmit() {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Modal, {\n    isOpen: isOpen,\n    onClose: onClose,\n    size: \"lg\",\n    isCentered: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.ModalOverlay, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.ModalContent, {\n    borderRadius: \"xl\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.ModalHeader, null, \"Add New Customer\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.ModalCloseButton, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.ModalBody, {\n    pb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.VStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.HStack, {\n    w: \"full\",\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.FormControl, {\n    isRequired: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.FormLabel, null, \"First Name\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Input, {\n    name: \"first_name\",\n    value: formData.first_name,\n    onChange: handleChange,\n    placeholder: \"John\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.FormControl, {\n    isRequired: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.FormLabel, null, \"Last Name\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Input, {\n    name: \"last_name\",\n    value: formData.last_name,\n    onChange: handleChange,\n    placeholder: \"Doe\"\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.FormControl, {\n    isRequired: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.FormLabel, null, \"Email Address\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Input, {\n    name: \"email\",\n    type: \"email\",\n    value: formData.email,\n    onChange: handleChange,\n    placeholder: \"john@example.com\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.FormControl, {\n    isRequired: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.FormLabel, null, \"Username\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Input, {\n    name: \"username\",\n    value: formData.username,\n    onChange: handleChange,\n    placeholder: \"johndoe\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.FormLabel, null, \"Password (Optional)\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Input, {\n    name: \"password\",\n    type: \"password\",\n    value: formData.password,\n    onChange: handleChange,\n    placeholder: \"Leave blank to auto-generate\"\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.ModalFooter, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Button, {\n    variant: \"ghost\",\n    mr: 3,\n    onClick: onClose\n  }, \"Cancel\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Button, {\n    colorScheme: \"blue\",\n    onClick: handleSubmit,\n    isLoading: isLoading,\n    bg: \"blue.500\",\n    _hover: {\n      bg: \"blue.600\"\n    }\n  }, \"Create Customer\"))));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CreateCustomer);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Customers/CreateCustomer.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Customers/CustomerIntelligence.jsx"
/*!*******************************************************************!*\
  !*** ./src/Pages/StoreManager/Customers/CustomerIntelligence.jsx ***!
  \*******************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/avatar/avatar.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/simple-grid.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input-group.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input-element.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-arrow.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-trigger.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/skeleton/skeleton.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table-container.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tbody.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/td.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/th.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/thead.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tr.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/toast/use-toast.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/tooltip/tooltip.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var react_icons_fa__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! react-icons/fa */ \"./node_modules/react-icons/fa/index.mjs\");\n/* harmony import */ var _utils_exportUtils__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../../../utils/exportUtils */ \"./src/utils/exportUtils.js\");\n/* harmony import */ var _Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../../../Components/shared/DatePicker */ \"./src/Components/shared/DatePicker.jsx\");\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\n\n\n\nvar CustomerIntelligence = function CustomerIntelligence() {\n  var _customers$;\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState2 = _slicedToArray(_useState, 2),\n    customers = _useState2[0],\n    setCustomers = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),\n    _useState4 = _slicedToArray(_useState3, 2),\n    loading = _useState4[0],\n    setLoading = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"\"),\n    _useState6 = _slicedToArray(_useState5, 2),\n    searchTerm = _useState6[0],\n    setSearchTerm = _useState6[1];\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState8 = _slicedToArray(_useState7, 2),\n    actionLoading = _useState8[0],\n    setActionLoading = _useState8[1];\n  var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_36__.getAllTimeRange)()),\n    _useState0 = _slicedToArray(_useState9, 2),\n    dateRange = _useState0[0],\n    setDateRange = _useState0[1];\n  var toast = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.useToast)();\n  var fetchIntelligence = /*#__PURE__*/function () {\n    var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n      var _res$data, params, res, _t;\n      return _regenerator().w(function (_context) {\n        while (1) switch (_context.p = _context.n) {\n          case 0:\n            _context.p = 0;\n            setLoading(true);\n            params = {\n              after: dateRange !== null && dateRange !== void 0 && dateRange.startDate ? dateRange.startDate.toISOString().split('.')[0] + 'Z' : undefined,\n              before: dateRange !== null && dateRange !== void 0 && dateRange.endDate ? dateRange.endDate.toISOString().split('.')[0] + 'Z' : undefined\n            };\n            _context.n = 1;\n            return axios__WEBPACK_IMPORTED_MODULE_32__[\"default\"].get(\"/api/store-manager/customer-intelligence\", {\n              params: params\n            });\n          case 1:\n            res = _context.v;\n            setCustomers(((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.data) || []);\n            _context.n = 3;\n            break;\n          case 2:\n            _context.p = 2;\n            _t = _context.v;\n            toast({\n              title: \"Failed to load intelligence data\",\n              status: \"error\",\n              duration: 3000\n            });\n          case 3:\n            _context.p = 3;\n            setLoading(false);\n            return _context.f(3);\n          case 4:\n            return _context.a(2);\n        }\n      }, _callee, null, [[0, 2, 3, 4]]);\n    }));\n    return function fetchIntelligence() {\n      return _ref.apply(this, arguments);\n    };\n  }();\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    fetchIntelligence();\n  }, [dateRange]);\n  var handleBlacklistToggle = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(email, isBlacklisted) {\n      var action, _t2;\n      return _regenerator().w(function (_context2) {\n        while (1) switch (_context2.p = _context2.n) {\n          case 0:\n            _context2.p = 0;\n            setActionLoading(email);\n            action = isBlacklisted ? 'remove' : 'add';\n            _context2.n = 1;\n            return axios__WEBPACK_IMPORTED_MODULE_32__[\"default\"].post(\"/api/store-manager/customer-blacklist\", {\n              email: email,\n              action: action\n            });\n          case 1:\n            toast({\n              title: isBlacklisted ? \"Removed from blacklist\" : \"Customer Blacklisted & Removed\",\n              status: \"success\",\n              duration: 3000\n            });\n            fetchIntelligence();\n            _context2.n = 3;\n            break;\n          case 2:\n            _context2.p = 2;\n            _t2 = _context2.v;\n            toast({\n              title: \"Failed to update blacklist status\",\n              status: \"error\",\n              duration: 3000\n            });\n          case 3:\n            _context2.p = 3;\n            setActionLoading(null);\n            return _context2.f(3);\n          case 4:\n            return _context2.a(2);\n        }\n      }, _callee2, null, [[0, 2, 3, 4]]);\n    }));\n    return function handleBlacklistToggle(_x, _x2) {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  var displayData = react__WEBPACK_IMPORTED_MODULE_0___default().useMemo(function () {\n    if (!searchTerm) return customers;\n    var lowerVal = searchTerm.toLowerCase();\n    return customers.filter(function (c) {\n      return c.email.includes(lowerVal) || (c.first_name || '').toLowerCase().includes(lowerVal) || (c.last_name || '').toLowerCase().includes(lowerVal);\n    });\n  }, [customers, searchTerm]);\n  var globalLTV = customers.reduce(function (acc, c) {\n    return acc + c.total_spent;\n  }, 0);\n  var mainCurrencyCode = ((_customers$ = customers[0]) === null || _customers$ === void 0 ? void 0 : _customers$.currency_code) || 'USD';\n  var formatCurrency = function formatCurrency(amount) {\n    var currencyCode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'USD';\n    var isBDT = currencyCode === 'BDT' || currencyCode === '৳';\n    try {\n      return new Intl.NumberFormat(isBDT ? 'en-BD' : 'en-US', {\n        style: 'currency',\n        currency: isBDT ? 'BDT' : currencyCode || 'USD',\n        currencyDisplay: 'symbol'\n      }).format(amount).replace('BDT', '৳');\n    } catch (e) {\n      return \"\".concat(isBDT ? '৳' : '$').concat(amount.toFixed(2));\n    }\n  };\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n    justify: \"space-between\",\n    align: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.VStack, {\n    align: \"start\",\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Text, {\n    mb: 0,\n    fontSize: \"2xl\",\n    fontWeight: \"bold\"\n  }, \"Customer Insight\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Text, {\n    color: \"gray.500\",\n    fontSize: \"sm\"\n  }, \"Track cross-store Lifetime Values, repeat purchases, and central blacklists.\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    variant: \"outline\",\n    onClick: function onClick() {\n      return (0,_utils_exportUtils__WEBPACK_IMPORTED_MODULE_35__.exportToCSV)(displayData, 'intelligence.csv');\n    }\n  }, \"Export CSV\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.SimpleGrid, {\n    columns: {\n      base: 1,\n      md: 3\n    },\n    spacing: 6,\n    mb: 8\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Card, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.HStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    p: 3,\n    bg: \"blue.100\",\n    color: \"blue.600\",\n    borderRadius: \"lg\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiStar,\n    boxSize: 6\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.VStack, {\n    align: \"start\",\n    spacing: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Text, {\n    mb: 0,\n    color: \"gray.500\",\n    fontSize: \"sm\",\n    fontWeight: \"medium\"\n  }, \"Total Top Customers\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Text, {\n    mt: 0,\n    fontSize: \"2xl\",\n    fontWeight: \"bold\"\n  }, customers.length))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Card, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.HStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    p: 3,\n    bg: \"green.100\",\n    color: \"green.600\",\n    borderRadius: \"lg\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiDollarSign,\n    boxSize: 6\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.VStack, {\n    align: \"start\",\n    spacing: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Text, {\n    mb: 0,\n    color: \"gray.500\",\n    fontSize: \"sm\",\n    fontWeight: \"medium\"\n  }, \"Global Audience LTV\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Text, {\n    mt: 0,\n    fontSize: \"2xl\",\n    fontWeight: \"bold\"\n  }, formatCurrency(globalLTV, mainCurrencyCode)))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Card, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.HStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    p: 3,\n    bg: \"purple.100\",\n    color: \"purple.600\",\n    borderRadius: \"lg\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiRepeat,\n    boxSize: 6\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.VStack, {\n    align: \"start\",\n    spacing: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Text, {\n    mb: 0,\n    color: \"gray.500\",\n    fontSize: \"sm\",\n    fontWeight: \"medium\"\n  }, \"Multi-Store Customers\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Text, {\n    mt: 0,\n    fontSize: \"2xl\",\n    fontWeight: \"bold\"\n  }, customers.filter(function (c) {\n    return c.multi_store;\n  }).length)))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Card, {\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"gray.200\",\n    boxShadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    p: 4,\n    borderBottom: \"1px\",\n    borderColor: \"gray.100\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.HStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.InputGroup, {\n    maxW: \"300px\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.InputLeftElement, {\n    pointerEvents: \"none\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiSearch, {\n    color: \"gray.300\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Input, {\n    placeholder: \"Search email or name...\",\n    value: searchTerm,\n    onChange: function onChange(e) {\n      return setSearchTerm(e.target.value);\n    }\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Popover, {\n    placement: \"bottom-start\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.PopoverTrigger, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n      as: react_icons_fa__WEBPACK_IMPORTED_MODULE_34__.FaCalendar\n    }),\n    variant: \"outline\",\n    bg: \"white\",\n    size: \"md\",\n    fontWeight: \"600\"\n  }, dateRange.label ? dateRange.label : dateRange.startDate ? \"\".concat(dateRange.startDate.toLocaleDateString(), \" - \").concat(dateRange.endDate.toLocaleDateString()) : \"Select Dates\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.PopoverContent, {\n    w: \"auto\",\n    borderRadius: \"xl\",\n    shadow: \"2xl\",\n    border: \"none\",\n    zIndex: 10\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.PopoverArrow, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.PopoverCloseButton, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.PopoverBody, {\n    p: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_36__[\"default\"], {\n    initialRange: dateRange,\n    onChange: function onChange(range) {\n      return setDateRange(range);\n    }\n  })))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.TableContainer, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Table, {\n    variant: \"simple\",\n    size: \"md\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Thead, {\n    bg: \"gray.50\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Th, null, \"Customer\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Th, null, \"Cross-Store Presence\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Th, {\n    isNumeric: true\n  }, \"Total Spent (LTV)\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Th, {\n    isNumeric: true\n  }, \"Repeat Orders\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Th, null, \"Intelligence\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Th, {\n    textAlign: \"right\"\n  }, \"Actions\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Tbody, null, loading ? [1, 2, 3, 4, 5].map(function (i) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Tr, {\n      key: i\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n      colSpan: 6\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Skeleton, {\n      h: \"30px\"\n    })));\n  }) : displayData.length === 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n    colSpan: 6,\n    textAlign: \"center\",\n    py: 8\n  }, \"No matching customers found\")) : displayData.map(function (c, idx) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Tr, {\n      key: c.email,\n      bg: c.is_blacklisted ? \"red.50\" : \"transparent\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.HStack, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Avatar, {\n      size: \"sm\",\n      src: c.avatar_url || '',\n      name: \"\".concat(c.first_name, \" \").concat(c.last_name)\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.VStack, {\n      align: \"start\",\n      spacing: 0\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Text, {\n      mb: 0,\n      fontWeight: \"bold\",\n      fontSize: \"sm\"\n    }, c.first_name, \" \", c.last_name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Text, {\n      mt: 0,\n      fontSize: \"xs\",\n      color: \"gray.500\"\n    }, c.email)))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.HStack, null, c.stores_present.slice(0, 3).map(function (store) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n        key: store.store_id,\n        colorScheme: \"blue\",\n        variant: \"subtle\",\n        fontSize: \"xs\"\n      }, store.store_name);\n    }), c.stores_present.length > 3 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Text, {\n      fontSize: \"xs\",\n      color: \"gray.500\"\n    }, \"+\", c.stores_present.length - 3, \" more\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n      isNumeric: true,\n      fontWeight: \"bold\",\n      color: \"green.600\"\n    }, formatCurrency(c.total_spent, c.currency_code)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n      isNumeric: true\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n      colorScheme: c.orders_count > 1 ? 'purple' : 'gray'\n    }, c.orders_count, \" Orders\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.HStack, null, c.multi_store && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Tooltip, {\n      label: \"Buys from multiple connected stores\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n      colorScheme: \"purple\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiRepeat, {\n      style: {\n        display: 'inline',\n        marginRight: '4px'\n      }\n    }), \" Multi-Store\")), idx < Math.ceil(customers.length * 0.1) && c.total_spent > 0 && !c.is_blacklisted && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Tooltip, {\n      label: \"Top 10% Spender\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n      colorScheme: \"yellow\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiStar, {\n      style: {\n        display: 'inline',\n        marginRight: '4px'\n      }\n    }), \" VIP\")), c.is_blacklisted && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n      colorScheme: \"red\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiShield, {\n      style: {\n        display: 'inline',\n        marginRight: '4px'\n      }\n    }), \" Blacklisted\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Td, {\n      textAlign: \"right\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n      size: \"xs\",\n      colorScheme: c.is_blacklisted ? \"gray\" : \"red\",\n      variant: \"outline\",\n      leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiXOctagon, null),\n      isLoading: actionLoading === c.email,\n      onClick: function onClick() {\n        return handleBlacklistToggle(c.email, c.is_blacklisted);\n      }\n    }, c.is_blacklisted ? \"Unblacklist\" : \"Global Blacklist\")));\n  }))))));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CustomerIntelligence);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Customers/CustomerIntelligence.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Customers/CustomerList.jsx"
/*!***********************************************************!*\
  !*** ./src/Pages/StoreManager/Customers/CustomerList.jsx ***!
  \***********************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _utils_exportUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../utils/exportUtils */ \"./src/utils/exportUtils.js\");\n/* harmony import */ var _CreateCustomer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./CreateCustomer */ \"./src/Pages/StoreManager/Customers/CreateCustomer.jsx\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/hooks/dist/esm/use-disclosure.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/avatar/avatar.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/icon-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/checkbox/checkbox.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/color-mode/color-mode-context.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input-group.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input-element.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/menu/menu.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/menu/menu-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/menu/menu-item.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/menu/menu-list.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-arrow.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-trigger.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/skeleton/skeleton.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table-container.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tbody.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/td.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/th.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/thead.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tr.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/heading.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router/dist/development/chunk-EPOLDU6W.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! lodash.debounce */ \"./node_modules/lodash.debounce/index.js\");\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_41___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_41__);\n/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! react-hot-toast */ \"./node_modules/react-hot-toast/dist/index.mjs\");\n/* harmony import */ var react_icons_fa__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! react-icons/fa */ \"./node_modules/react-icons/fa/index.mjs\");\n/* harmony import */ var _Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ../../../Components/shared/DatePicker */ \"./src/Components/shared/DatePicker.jsx\");\n/* harmony import */ var _Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ../../../Components/shared/ConfirmDialog */ \"./src/Components/shared/ConfirmDialog.jsx\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var _Components_shared_ProFeatureModal__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ../../../Components/shared/ProFeatureModal */ \"./src/Components/shared/ProFeatureModal.jsx\");\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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 _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\n\n\n\n\n\n\n\n\n\nvar CustomerList = function CustomerList() {\n  var _window$shopCentralDa;\n  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_39__.useNavigate)();\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState2 = _slicedToArray(_useState, 2),\n    customers = _useState2[0],\n    setCustomers = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),\n    _useState4 = _slicedToArray(_useState3, 2),\n    loading = _useState4[0],\n    setLoading = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0),\n    _useState6 = _slicedToArray(_useState5, 2),\n    totalRows = _useState6[0],\n    setTotalRows = _useState6[1];\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(10),\n    _useState8 = _slicedToArray(_useState7, 2),\n    perPage = _useState8[0],\n    setPerPage = _useState8[1];\n  var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1),\n    _useState0 = _slicedToArray(_useState9, 2),\n    currentPage = _useState0[0],\n    setCurrentPage = _useState0[1];\n  var _useState1 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"\"),\n    _useState10 = _slicedToArray(_useState1, 2),\n    searchTerm = _useState10[0],\n    setSearchTerm = _useState10[1];\n  var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState12 = _slicedToArray(_useState11, 2),\n    currentStore = _useState12[0],\n    setCurrentStore = _useState12[1];\n  var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState14 = _slicedToArray(_useState13, 2),\n    selectedRows = _useState14[0],\n    setSelectedRows = _useState14[1];\n  var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_44__.getAllTimeRange)()),\n    _useState16 = _slicedToArray(_useState15, 2),\n    dateRange = _useState16[0],\n    setDateRange = _useState16[1];\n  var _useDisclosure = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.useDisclosure)(),\n    isCreateOpen = _useDisclosure.isOpen,\n    onCreateOpen = _useDisclosure.onOpen,\n    onCreateClose = _useDisclosure.onClose;\n  var _useDisclosure2 = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.useDisclosure)(),\n    isBulkConfirmOpen = _useDisclosure2.isOpen,\n    onBulkConfirmOpen = _useDisclosure2.onOpen,\n    onBulkConfirmClose = _useDisclosure2.onClose;\n  var _useDisclosure3 = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.useDisclosure)(),\n    isRowConfirmOpen = _useDisclosure3.isOpen,\n    onRowConfirmOpen = _useDisclosure3.onOpen,\n    onRowConfirmClose = _useDisclosure3.onClose;\n  var _useState17 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState18 = _slicedToArray(_useState17, 2),\n    customerToDelete = _useState18[0],\n    setCustomerToDelete = _useState18[1];\n  var _useState19 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState20 = _slicedToArray(_useState19, 2),\n    isDeleting = _useState20[0],\n    setIsDeleting = _useState20[1];\n  var _useDisclosure4 = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.useDisclosure)(),\n    isProModalOpen = _useDisclosure4.isOpen,\n    onProModalOpen = _useDisclosure4.onOpen,\n    onProModalClose = _useDisclosure4.onClose;\n  var isPro = (_window$shopCentralDa = window.shopCentralData) === null || _window$shopCentralDa === void 0 ? void 0 : _window$shopCentralDa.isPro;\n  var toggleSelectRow = function toggleSelectRow(id) {\n    setSelectedRows(function (prev) {\n      return prev.includes(id) ? prev.filter(function (rowId) {\n        return rowId !== id;\n      }) : [].concat(_toConsumableArray(prev), [id]);\n    });\n  };\n  var toggleSelectAll = function toggleSelectAll() {\n    if (selectedRows.length === customers.length && customers.length > 0) {\n      setSelectedRows([]);\n    } else {\n      setSelectedRows(customers.map(function (c) {\n        return c.id;\n      }));\n    }\n  };\n  var handleBulkDelete = /*#__PURE__*/function () {\n    var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n      return _regenerator().w(function (_context) {\n        while (1) switch (_context.n) {\n          case 0:\n            onBulkConfirmOpen();\n          case 1:\n            return _context.a(2);\n        }\n      }, _callee);\n    }));\n    return function handleBulkDelete() {\n      return _ref.apply(this, arguments);\n    };\n  }();\n  var confirmBulkDelete = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {\n      var _iterator, _step, id, _t, _t2;\n      return _regenerator().w(function (_context2) {\n        while (1) switch (_context2.p = _context2.n) {\n          case 0:\n            setIsDeleting(true);\n            _context2.p = 1;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_42__[\"default\"].loading(\"Deleting \".concat(selectedRows.length, \" customers...\"), {\n              id: 'bulk-delete'\n            });\n            _iterator = _createForOfIteratorHelper(selectedRows);\n            _context2.p = 2;\n            _iterator.s();\n          case 3:\n            if ((_step = _iterator.n()).done) {\n              _context2.n = 5;\n              break;\n            }\n            id = _step.value;\n            _context2.n = 4;\n            return axios__WEBPACK_IMPORTED_MODULE_40__[\"default\"][\"delete\"](\"/api/store-manager/customers/\".concat(id), {\n              params: {\n                force: true,\n                reassign: 0\n              }\n            });\n          case 4:\n            _context2.n = 3;\n            break;\n          case 5:\n            _context2.n = 7;\n            break;\n          case 6:\n            _context2.p = 6;\n            _t = _context2.v;\n            _iterator.e(_t);\n          case 7:\n            _context2.p = 7;\n            _iterator.f();\n            return _context2.f(7);\n          case 8:\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_42__[\"default\"].success(\"Customers deleted successfully\", {\n              id: 'bulk-delete'\n            });\n            setSelectedRows([]);\n            fetchCustomers(currentPage, perPage, searchTerm);\n            _context2.n = 10;\n            break;\n          case 9:\n            _context2.p = 9;\n            _t2 = _context2.v;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_42__[\"default\"].error(\"Failed to delete some customers\", {\n              id: 'bulk-delete'\n            });\n          case 10:\n            _context2.p = 10;\n            setIsDeleting(false);\n            onBulkConfirmClose();\n            return _context2.f(10);\n          case 11:\n            return _context2.a(2);\n        }\n      }, _callee2, null, [[2, 6, 7, 8], [1, 9, 10, 11]]);\n    }));\n    return function confirmBulkDelete() {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  var promptDeleteCustomer = function promptDeleteCustomer(customer) {\n    setCustomerToDelete(customer);\n    onRowConfirmOpen();\n  };\n  var confirmDeleteCustomer = /*#__PURE__*/function () {\n    var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {\n      var _err$response, _t3;\n      return _regenerator().w(function (_context3) {\n        while (1) switch (_context3.p = _context3.n) {\n          case 0:\n            if (customerToDelete) {\n              _context3.n = 1;\n              break;\n            }\n            return _context3.a(2);\n          case 1:\n            setIsDeleting(true);\n            _context3.p = 2;\n            _context3.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_40__[\"default\"][\"delete\"](\"/api/store-manager/customers/\".concat(customerToDelete.id), {\n              params: {\n                force: true,\n                reassign: 0\n              }\n            });\n          case 3:\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_42__[\"default\"].success(\"Customer deleted successfully\");\n            fetchCustomers(currentPage, perPage, searchTerm);\n            _context3.n = 5;\n            break;\n          case 4:\n            _context3.p = 4;\n            _t3 = _context3.v;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_42__[\"default\"].error(((_err$response = _t3.response) === null || _err$response === void 0 || (_err$response = _err$response.data) === null || _err$response === void 0 ? void 0 : _err$response.message) || \"Failed to delete customer\");\n          case 5:\n            _context3.p = 5;\n            setIsDeleting(false);\n            setCustomerToDelete(null);\n            onRowConfirmClose();\n            return _context3.f(5);\n          case 6:\n            return _context3.a(2);\n        }\n      }, _callee3, null, [[2, 4, 5, 6]]);\n    }));\n    return function confirmDeleteCustomer() {\n      return _ref3.apply(this, arguments);\n    };\n  }();\n  var fetchCurrentStore = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {\n    var _response$data, response, current, _t4;\n    return _regenerator().w(function (_context4) {\n      while (1) switch (_context4.p = _context4.n) {\n        case 0:\n          _context4.p = 0;\n          _context4.n = 1;\n          return axios__WEBPACK_IMPORTED_MODULE_40__[\"default\"].get('/api/stores');\n        case 1:\n          response = _context4.v;\n          current = (_response$data = response.data) === null || _response$data === void 0 || (_response$data = _response$data.stores) === null || _response$data === void 0 ? void 0 : _response$data.find(function (s) {\n            return s.is_current == 1;\n          });\n          setCurrentStore(current);\n          _context4.n = 3;\n          break;\n        case 2:\n          _context4.p = 2;\n          _t4 = _context4.v;\n          console.error(\"Failed to fetch store info\", _t4);\n        case 3:\n          return _context4.a(2);\n      }\n    }, _callee4, null, [[0, 2]]);\n  })), []);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    fetchCurrentStore();\n  }, [fetchCurrentStore]);\n  var bgCard = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.useColorModeValue)(\"white\", \"gray.800\");\n  var borderColor = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.useColorModeValue)(\"gray.200\", \"gray.700\");\n  var fetchCustomers = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {\n    var page,\n      perPageSize,\n      search,\n      _data$meta,\n      _data$data,\n      params,\n      response,\n      data,\n      _args5 = arguments,\n      _t5;\n    return _regenerator().w(function (_context5) {\n      while (1) switch (_context5.p = _context5.n) {\n        case 0:\n          page = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : 1;\n          perPageSize = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : 10;\n          search = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : \"\";\n          _context5.p = 1;\n          setLoading(true);\n          params = {\n            page: page,\n            per_page: perPageSize,\n            search: search,\n            after: dateRange !== null && dateRange !== void 0 && dateRange.startDate ? dateRange.startDate.toISOString().split('.')[0] + 'Z' : undefined,\n            before: dateRange !== null && dateRange !== void 0 && dateRange.endDate ? dateRange.endDate.toISOString().split('.')[0] + 'Z' : undefined\n          };\n          _context5.n = 2;\n          return axios__WEBPACK_IMPORTED_MODULE_40__[\"default\"].get(\"/api/store-manager/customers\", {\n            params: params\n          });\n        case 2:\n          response = _context5.v;\n          data = response === null || response === void 0 ? void 0 : response.data;\n          setCustomers(Array.isArray(data === null || data === void 0 ? void 0 : data.data) ? data.data : []);\n          setTotalRows((data === null || data === void 0 || (_data$meta = data.meta) === null || _data$meta === void 0 ? void 0 : _data$meta.total) || (data === null || data === void 0 || (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.length) || 0);\n          setCurrentPage(page);\n          setPerPage(perPageSize);\n          _context5.n = 4;\n          break;\n        case 3:\n          _context5.p = 3;\n          _t5 = _context5.v;\n          console.error(\"Failed to fetch customers\", _t5);\n        case 4:\n          _context5.p = 4;\n          setLoading(false);\n          return _context5.f(4);\n        case 5:\n          return _context5.a(2);\n      }\n    }, _callee5, null, [[1, 3, 4, 5]]);\n  })), []);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    fetchCustomers(1, perPage, searchTerm);\n  }, [fetchCustomers, perPage, dateRange]);\n  var debouncedFetch = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(lodash_debounce__WEBPACK_IMPORTED_MODULE_41___default()(function (value) {\n    fetchCustomers(1, perPage, value);\n  }, 500), [perPage, fetchCustomers]);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    debouncedFetch(searchTerm);\n    return function () {\n      return debouncedFetch.cancel();\n    };\n  }, [searchTerm, debouncedFetch]);\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(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.VStack, {\n    align: \"stretch\",\n    spacing: 6,\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Flex, {\n    direction: {\n      base: \"column\",\n      lg: \"row\"\n    },\n    justify: \"space-between\",\n    align: {\n      base: \"stretch\",\n      lg: \"center\"\n    },\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.VStack, {\n    align: \"start\",\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_37__.Heading, {\n    m: 0,\n    size: \"lg\"\n  }, \"Customer Network\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.Text, {\n    m: 0,\n    color: \"gray.500\",\n    fontSize: \"sm\"\n  }, \"Track customer spending, order history, and profiles across all connected stores.\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.HStack, {\n    spacing: 3,\n    alignSelf: {\n      base: \"flex-start\",\n      lg: \"center\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Button, {\n    size: \"md\",\n    colorScheme: \"blue\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_46__.FiPlus, null),\n    onClick: onCreateOpen,\n    shadow: \"sm\",\n    _hover: {\n      shadow: 'md'\n    }\n  }, \"Add Customer\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Button, {\n    size: \"md\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_46__.FiDownload, null),\n    variant: \"outline\",\n    bg: \"white\",\n    onClick: function onClick() {\n      return (0,_utils_exportUtils__WEBPACK_IMPORTED_MODULE_1__.exportToCSV)(customers, \"customers-\".concat(new Date().toISOString().split('T')[0], \".csv\"));\n    },\n    isDisabled: customers.length === 0\n  }, \"Export\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Card, {\n    variant: \"outline\",\n    p: 4,\n    borderRadius: \"xl\",\n    bg: \"gray.50\",\n    borderStyle: \"dashed\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Flex, {\n    direction: {\n      base: \"column\",\n      md: \"row\"\n    },\n    gap: 4,\n    align: {\n      base: \"stretch\",\n      md: \"center\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, {\n    flex: \"1\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.InputGroup, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.InputLeftElement, {\n    pointerEvents: \"none\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_46__.FiSearch, {\n    color: \"gray\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Input, {\n    placeholder: \"Search by name, email or username...\",\n    value: searchTerm,\n    onChange: function onChange(e) {\n      return setSearchTerm(e.target.value);\n    },\n    bg: \"white\",\n    size: \"md\",\n    borderRadius: \"lg\"\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.HStack, {\n    spacing: 2,\n    overflowX: \"auto\",\n    pb: {\n      base: 2,\n      md: 0\n    },\n    className: \"shopcentral-scrollbar\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.Popover, {\n    placement: \"bottom-end\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.PopoverTrigger, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Button, {\n    size: \"md\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fa__WEBPACK_IMPORTED_MODULE_43__.FaCalendar, null),\n    variant: \"outline\",\n    bg: \"white\",\n    borderRadius: \"lg\",\n    minW: \"160px\"\n  }, dateRange.label ? dateRange.label : dateRange.startDate ? \"\".concat(dateRange.startDate.toLocaleDateString(), \" - \").concat(dateRange.endDate.toLocaleDateString()) : \"Select Dates\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.PopoverContent, {\n    w: \"auto\",\n    maxW: \"unset\",\n    shadow: \"xl\",\n    borderRadius: \"xl\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.PopoverArrow, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.PopoverCloseButton, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.PopoverBody, {\n    p: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_44__[\"default\"], {\n    initialRange: dateRange,\n    onChange: function onChange(range) {\n      return setDateRange(range);\n    }\n  }))))))), selectedRows.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Flex, {\n    bg: \"red.50\",\n    p: 3,\n    borderRadius: \"lg\",\n    borderWidth: \"1px\",\n    borderColor: \"red.100\",\n    justify: \"space-between\",\n    align: \"center\",\n    animation: \"slideInDown 0.2s ease-out\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.HStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.Text, {\n    m: 0,\n    fontSize: \"sm\",\n    fontWeight: \"bold\",\n    color: \"red.700\"\n  }, selectedRows.length, \" items selected\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Button, {\n    size: \"xs\",\n    colorScheme: \"red\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_46__.FiTrash2, null),\n    onClick: handleBulkDelete\n  }, \"Delete Selected\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Button, {\n    size: \"xs\",\n    variant: \"ghost\",\n    colorScheme: \"red\",\n    onClick: function onClick() {\n      return setSelectedRows([]);\n    }\n  }, \"Deselect all\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_CreateCustomer__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n    isOpen: isCreateOpen,\n    onClose: onCreateClose,\n    onSuccess: function onSuccess() {\n      return fetchCustomers(currentPage, perPage, searchTerm);\n    }\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, {\n    display: \"flex\",\n    flexDirection: \"column\",\n    h: \"calc(100vh - 180px)\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Card, {\n    variant: \"outline\",\n    borderRadius: \"xl\",\n    shadow: \"sm\",\n    overflow: \"hidden\",\n    display: \"flex\",\n    flexDirection: \"column\",\n    flex: \"1\",\n    bg: \"white\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.TableContainer, {\n    flex: \"1\",\n    overflowY: \"auto\",\n    className: \"shopcentral-scrollbar\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Table, {\n    variant: \"simple\",\n    size: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Thead, {\n    bg: \"gray.50\",\n    position: \"sticky\",\n    top: 0,\n    zIndex: 5\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Th, {\n    width: \"40px\",\n    py: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Checkbox, {\n    isChecked: selectedRows.length === customers.length && customers.length > 0,\n    isIndeterminate: selectedRows.length > 0 && selectedRows.length < customers.length,\n    onChange: toggleSelectAll,\n    colorScheme: \"blue\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Th, {\n    py: 4\n  }, \"Customer Info\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Th, {\n    py: 4,\n    display: {\n      base: \"none\",\n      md: \"table-cell\"\n    }\n  }, \"Contact\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Th, {\n    py: 4,\n    display: {\n      base: \"none\",\n      lg: \"table-cell\"\n    }\n  }, \"Country\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Th, {\n    py: 4\n  }, \"Stats\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Th, {\n    py: 4\n  }, \"Spent\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Th, {\n    py: 4,\n    display: {\n      base: \"none\",\n      xl: \"table-cell\"\n    }\n  }, \"AOV\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Th, {\n    py: 4,\n    width: \"50px\"\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Tbody, null, loading ? [1, 2, 3, 4, 5, 6, 7, 8].map(function (i) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Tr, {\n      key: i\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Td, {\n      py: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Skeleton, {\n      h: \"16px\",\n      w: \"16px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Td, {\n      py: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Skeleton, {\n      h: \"40px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Td, {\n      py: 4,\n      display: {\n        base: \"none\",\n        md: \"table-cell\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Skeleton, {\n      h: \"20px\",\n      w: \"120px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Td, {\n      py: 4,\n      display: {\n        base: \"none\",\n        lg: \"table-cell\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Skeleton, {\n      h: \"20px\",\n      w: \"60px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Td, {\n      py: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Skeleton, {\n      h: \"20px\",\n      w: \"40px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Td, {\n      py: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Skeleton, {\n      h: \"20px\",\n      w: \"60px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Td, {\n      py: 4,\n      display: {\n        base: \"none\",\n        xl: \"table-cell\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Skeleton, {\n      h: \"20px\",\n      w: \"60px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Td, {\n      py: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Skeleton, {\n      h: \"24px\",\n      w: \"24px\"\n    }), \"Action\"));\n  }) : customers.length === 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Td, {\n    colSpan: 8,\n    textAlign: \"center\",\n    py: 20\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.VStack, {\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_46__.FiSearch,\n    boxSize: 10,\n    color: \"gray.200\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.Text, {\n    m: 0,\n    fontWeight: \"bold\",\n    color: \"gray.400\"\n  }, \"No customers found matching your criteria\")))) : customers.map(function (customer, index) {\n    var _customer$billing;\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Tr, {\n      key: customer.id || \"guest-\".concat(index),\n      _hover: {\n        bg: \"gray.50\"\n      },\n      transition: \"background 0.2s\",\n      cursor: \"default\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Td, {\n      py: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Checkbox, {\n      isChecked: selectedRows.includes(customer.id),\n      onChange: function onChange() {\n        return toggleSelectRow(customer.id);\n      },\n      colorScheme: \"blue\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Td, {\n      py: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.HStack, {\n      spacing: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Avatar, {\n      size: \"sm\",\n      name: customer.first_name || customer.username,\n      src: customer.avatar_url\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.VStack, {\n      align: \"start\",\n      spacing: 0\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.Text, {\n      m: 0,\n      fontWeight: \"800\",\n      fontSize: \"sm\",\n      color: \"gray.700\",\n      isTruncated: true,\n      maxW: {\n        base: \"120px\",\n        md: \"200px\"\n      }\n    }, customer.first_name, \" \", customer.last_name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.Text, {\n      m: 0,\n      fontSize: \"sm\",\n      color: \"gray.400\",\n      fontWeight: \"medium\"\n    }, \"@\", customer.username), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, {\n      display: {\n        base: \"block\",\n        md: \"none\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.Text, {\n      m: 0,\n      fontSize: \"sm\",\n      color: \"blue.500\",\n      isTruncated: true,\n      maxW: \"120px\"\n    }, customer.email))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Td, {\n      py: 3,\n      display: {\n        base: \"none\",\n        md: \"table-cell\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.VStack, {\n      align: \"start\",\n      spacing: 0\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.Text, {\n      m: 0,\n      fontSize: \"sm\",\n      fontWeight: \"bold\",\n      color: \"gray.700\"\n    }, customer.email), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.Text, {\n      m: 0,\n      fontSize: \"sm\",\n      color: \"gray.400\"\n    }, ((_customer$billing = customer.billing) === null || _customer$billing === void 0 ? void 0 : _customer$billing.phone) || 'No phone'))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Td, {\n      py: 3,\n      display: {\n        base: \"none\",\n        lg: \"table-cell\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Badge, {\n      variant: \"outline\",\n      fontSize: \"sm\",\n      px: 2,\n      borderRadius: \"md\",\n      colorScheme: \"gray\"\n    }, customer.country || 'Unknown')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Td, {\n      py: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.VStack, {\n      align: \"start\",\n      spacing: 0\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.Text, {\n      m: 0,\n      fontSize: \"sm\",\n      fontWeight: \"bold\",\n      color: \"gray.700\"\n    }, customer.orders_count || 0, \" Orders\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Td, {\n      py: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.VStack, {\n      align: \"start\",\n      spacing: 0\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.Text, {\n      m: 0,\n      fontSize: \"sm\",\n      fontWeight: \"900\",\n      color: \"green.600\"\n    }, function () {\n      var spent = parseFloat(customer.total_spent || 0).toLocaleString(undefined, {\n        minimumFractionDigits: 2,\n        maximumFractionDigits: 2\n      });\n      var symbol = customer.currency_symbol || '$';\n      if (customer.currency_pos === 'right') return \"\".concat(spent).concat(symbol);\n      if (customer.currency_pos === 'right_space') return \"\".concat(spent, \" \").concat(symbol);\n      if (customer.currency_pos === 'left_space') return \"\".concat(symbol, \" \").concat(spent);\n      return \"\".concat(symbol).concat(spent);\n    }()), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.Text, {\n      m: 0,\n      fontSize: \"sm\",\n      color: \"gray.400\",\n      display: {\n        base: \"block\",\n        xl: \"none\"\n      }\n    }, \"AOV: \", function () {\n      var aov = parseFloat(customer.aov || 0).toLocaleString(undefined, {\n        minimumFractionDigits: 2,\n        maximumFractionDigits: 2\n      });\n      var symbol = customer.currency_symbol || '$';\n      if (customer.currency_pos === 'right') return \"\".concat(aov).concat(symbol);\n      if (customer.currency_pos === 'right_space') return \"\".concat(aov, \" \").concat(symbol);\n      if (customer.currency_pos === 'left_space') return \"\".concat(symbol, \" \").concat(aov);\n      return \"\".concat(symbol).concat(aov);\n    }()))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Td, {\n      py: 3,\n      display: {\n        base: \"none\",\n        xl: \"table-cell\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.Text, {\n      m: 0,\n      fontSize: \"sm\",\n      fontWeight: \"bold\",\n      color: \"gray.600\"\n    }, function () {\n      var aov = parseFloat(customer.aov || 0).toLocaleString(undefined, {\n        minimumFractionDigits: 2,\n        maximumFractionDigits: 2\n      });\n      var symbol = customer.currency_symbol || '$';\n      if (customer.currency_pos === 'right') return \"\".concat(aov).concat(symbol);\n      if (customer.currency_pos === 'right_space') return \"\".concat(aov, \" \").concat(symbol);\n      if (customer.currency_pos === 'left_space') return \"\".concat(symbol, \" \").concat(aov);\n      return \"\".concat(symbol).concat(aov);\n    }())), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Td, {\n      py: 3,\n      textAlign: \"right\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Menu, {\n      isLazy: true\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.MenuButton, {\n      as: _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.IconButton,\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_46__.FiMoreVertical, null),\n      variant: \"ghost\",\n      size: \"sm\",\n      borderRadius: \"full\",\n      _hover: {\n        bg: \"gray.200\"\n      }\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.MenuList, {\n      shadow: \"xl\",\n      borderRadius: \"lg\",\n      py: 2\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.MenuItem, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_46__.FiEye, {\n        color: \"var(--chakra-colors-blue-500)\"\n      }),\n      fontSize: \"sm\",\n      fontWeight: \"medium\",\n      onClick: function onClick() {\n        return navigate(\"/store-manager/customers/\".concat(customer.id));\n      }\n    }, \"View Profile\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.MenuItem, {\n      icon: isPro ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_46__.FiLock, {\n        color: \"var(--chakra-colors-orange-500)\"\n      }) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_46__.FiLock, {\n        color: \"var(--chakra-colors-gray-400)\"\n      }),\n      fontSize: \"sm\",\n      fontWeight: \"medium\",\n      onClick: function onClick() {\n        return isPro ? navigate(\"/store-manager/customers/orders/\".concat(encodeURIComponent(customer.email))) : onProModalOpen();\n      }\n    }, \"Order History \", !isPro && \"(Pro)\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.MenuItem, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_46__.FiTrash2, {\n        color: \"var(--chakra-colors-red-500)\"\n      }),\n      fontSize: \"sm\",\n      fontWeight: \"medium\",\n      onClick: function onClick() {\n        return promptDeleteCustomer(customer);\n      }\n    }, \"Delete Permanent\")))));\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Flex, {\n    p: 4,\n    justify: \"space-between\",\n    align: \"center\",\n    bg: \"gray.50\",\n    borderTop: \"1px\",\n    borderColor: \"gray.200\",\n    flexShrink: 0,\n    direction: {\n      base: \"column\",\n      sm: \"row\"\n    },\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    fontWeight: \"bold\",\n    color: \"gray.500\"\n  }, \"Showing \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, {\n    as: \"span\",\n    color: \"blue.600\"\n  }, (currentPage - 1) * perPage + 1), \" to \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, {\n    as: \"span\",\n    color: \"blue.600\"\n  }, Math.min(currentPage * perPage, totalRows)), \" of \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, {\n    as: \"span\",\n    color: \"gray.800\"\n  }, totalRows), \" customers\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.HStack, {\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Button, {\n    size: \"sm\",\n    variant: \"ghost\",\n    isDisabled: currentPage === 1,\n    onClick: function onClick() {\n      return fetchCustomers(currentPage - 1, perPage, searchTerm);\n    },\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_46__.FiChevronLeft, null),\n    borderRadius: \"lg\",\n    fontWeight: \"bold\",\n    fontSize: \"xs\"\n  }, \"Previous\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, {\n    px: 3,\n    py: 1,\n    bg: \"white\",\n    borderRadius: \"md\",\n    border: \"1px\",\n    borderColor: \"gray.200\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    fontWeight: \"800\",\n    color: \"blue.600\"\n  }, currentPage)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Button, {\n    size: \"sm\",\n    variant: \"ghost\",\n    isDisabled: currentPage * perPage >= totalRows,\n    onClick: function onClick() {\n      return fetchCustomers(currentPage + 1, perPage, searchTerm);\n    },\n    rightIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_46__.FiChevronRight, null),\n    borderRadius: \"lg\",\n    fontWeight: \"bold\",\n    fontSize: \"xs\"\n  }, \"Next\")))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_45__[\"default\"], {\n    isOpen: isBulkConfirmOpen,\n    onClose: onBulkConfirmClose,\n    onConfirm: confirmBulkDelete,\n    title: \"Delete Customers\",\n    description: \"Are you sure you want to permanently delete \".concat(selectedRows.length, \" customer\").concat(selectedRows.length > 1 ? 's' : '', \"? This cannot be undone.\"),\n    confirmLabel: \"Delete\",\n    loading: isDeleting\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_45__[\"default\"], {\n    isOpen: isRowConfirmOpen,\n    onClose: function onClose() {\n      onRowConfirmClose();\n      setCustomerToDelete(null);\n    },\n    onConfirm: confirmDeleteCustomer,\n    title: \"Delete Customer\",\n    description: customerToDelete ? \"Are you sure you want to permanently delete customer \\\"\".concat(customerToDelete.first_name, \" \").concat(customerToDelete.last_name, \"\\\"? This cannot be undone.\") : '',\n    confirmLabel: \"Delete\",\n    loading: isDeleting\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ProFeatureModal__WEBPACK_IMPORTED_MODULE_47__[\"default\"], {\n    isOpen: isProModalOpen,\n    onClose: onProModalClose,\n    title: \"Multi-Store Customer Insights (Pro)\",\n    what: \"A centralized customer analytics and cross-store order tracking suite that consolidates customer profiles across your entire e-commerce network.\",\n    how: \"Automatically links customer accounts by email address across all connected WooCommerce stores to show unified purchase histories and lifetime value.\",\n    why: \"Identify top repeat purchasers and brand loyalists across multiple storefronts so you can deliver better customer service and targeted VIP marketing campaigns.\"\n  }));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CustomerList);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Customers/CustomerList.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Customers/CustomerOrderHistory.jsx"
/*!*******************************************************************!*\
  !*** ./src/Pages/StoreManager/Customers/CustomerOrderHistory.jsx ***!
  \*******************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/breadcrumb/breadcrumb.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/breadcrumb/breadcrumb-item.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/breadcrumb/breadcrumb-link.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/icon-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/divider/divider.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/simple-grid.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/skeleton/skeleton.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table-container.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tbody.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/td.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/th.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/thead.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tr.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/heading.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router/dist/development/chunk-EPOLDU6W.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! react-hot-toast */ \"./node_modules/react-hot-toast/dist/index.mjs\");\n/* harmony import */ var _utils_FormatDate__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../../../utils/FormatDate */ \"./src/utils/FormatDate.js\");\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\n\n\n\nvar STATUS_COLORS = {\n  completed: \"green\",\n  processing: \"blue\",\n  pending: \"yellow\",\n  \"on-hold\": \"orange\",\n  cancelled: \"red\",\n  refunded: \"purple\",\n  failed: \"red\"\n};\nvar OrderRow = function OrderRow(_ref) {\n  var order = _ref.order;\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState2 = _slicedToArray(_useState, 2),\n    expanded = _useState2[0],\n    setExpanded = _useState2[1];\n  var sym = order.currency_symbol || \"$\";\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(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Tr, {\n    _hover: {\n      bg: \"gray.50\"\n    },\n    cursor: \"pointer\",\n    onClick: function onClick() {\n      return setExpanded(function (v) {\n        return !v;\n      });\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Td, {\n    fontWeight: \"700\",\n    color: \"blue.600\"\n  }, \"#\", order.id), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Badge, {\n    colorScheme: STATUS_COLORS[order.status] || \"gray\",\n    px: 2,\n    py: 0.5,\n    borderRadius: \"full\",\n    textTransform: \"capitalize\",\n    fontSize: \"xs\"\n  }, order.status)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    align: \"center\",\n    gap: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_25__.FiCalendar,\n    color: \"gray.400\",\n    boxSize: \"13px\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Text, {\n    fontSize: \"sm\"\n  }, (0,_utils_FormatDate__WEBPACK_IMPORTED_MODULE_29__.FormatDate)(order.date_created)))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Td, {\n    isNumeric: true,\n    fontWeight: \"700\"\n  }, sym, parseFloat(order.total).toFixed(2)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.500\"\n  }, order.payment_method || \"—\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    align: \"center\",\n    justify: \"space-between\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Badge, {\n    colorScheme: \"gray\",\n    fontSize: \"xs\",\n    borderRadius: \"full\",\n    px: 2\n  }, order.items_count, \" item\", order.items_count !== 1 ? \"s\" : \"\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.IconButton, {\n    icon: expanded ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_25__.FiChevronUp, null) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_25__.FiChevronDown, null),\n    size: \"xs\",\n    variant: \"ghost\",\n    \"aria-label\": \"Toggle items\",\n    onClick: function onClick(e) {\n      e.stopPropagation();\n      setExpanded(function (v) {\n        return !v;\n      });\n    }\n  })))), expanded && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Td, {\n    colSpan: 6,\n    p: 0,\n    bg: \"gray.50\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    px: 6,\n    py: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Text, {\n    fontSize: \"xs\",\n    fontWeight: \"700\",\n    textTransform: \"uppercase\",\n    color: \"gray.500\",\n    mb: 2\n  }, \"Ordered Products\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.VStack, {\n    align: \"stretch\",\n    spacing: 1\n  }, order.items.map(function (item, idx) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n      key: idx,\n      justify: \"space-between\",\n      align: \"center\",\n      py: 1,\n      px: 2,\n      bg: \"white\",\n      borderRadius: \"md\",\n      shadow: \"xs\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.HStack, {\n      spacing: 2\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_25__.FiShoppingBag,\n      color: \"blue.300\",\n      boxSize: \"14px\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Text, {\n      fontSize: \"sm\",\n      fontWeight: \"600\"\n    }, item.name)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.HStack, {\n      spacing: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Text, {\n      fontSize: \"sm\",\n      color: \"gray.500\"\n    }, \"\\xD7 \", item.quantity), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Text, {\n      fontSize: \"sm\",\n      fontWeight: \"700\"\n    }, sym, parseFloat(item.subtotal).toFixed(2))));\n  }))))));\n};\nvar CustomerOrderHistory = function CustomerOrderHistory() {\n  var _orders$, _meta$total;\n  var _useParams = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_26__.useParams)(),\n    rawEmail = _useParams.email;\n  var email = decodeURIComponent(rawEmail || \"\");\n  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_26__.useNavigate)();\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState4 = _slicedToArray(_useState3, 2),\n    orders = _useState4[0],\n    setOrders = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),\n    _useState6 = _slicedToArray(_useState5, 2),\n    loading = _useState6[0],\n    setLoading = _useState6[1];\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({\n      total: 0\n    }),\n    _useState8 = _slicedToArray(_useState7, 2),\n    meta = _useState8[0],\n    setMeta = _useState8[1];\n  var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1),\n    _useState0 = _slicedToArray(_useState9, 2),\n    page = _useState0[0],\n    setPage = _useState0[1];\n  var perPage = 20;\n  var fetchOrders = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n    var p,\n      _res$data,\n      _res$data2,\n      res,\n      _err$response,\n      _args = arguments,\n      _t;\n    return _regenerator().w(function (_context) {\n      while (1) switch (_context.p = _context.n) {\n        case 0:\n          p = _args.length > 0 && _args[0] !== undefined ? _args[0] : 1;\n          _context.p = 1;\n          setLoading(true);\n          _context.n = 2;\n          return axios__WEBPACK_IMPORTED_MODULE_27__[\"default\"].get(\"/api/store-manager/customer-order-history\", {\n            params: {\n              email: email,\n              per_page: perPage,\n              page: p\n            }\n          });\n        case 2:\n          res = _context.v;\n          setOrders(((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.data) || []);\n          setMeta(((_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.meta) || {\n            total: 0\n          });\n          _context.n = 4;\n          break;\n        case 3:\n          _context.p = 3;\n          _t = _context.v;\n          react_hot_toast__WEBPACK_IMPORTED_MODULE_28__[\"default\"].error(((_err$response = _t.response) === null || _err$response === void 0 || (_err$response = _err$response.data) === null || _err$response === void 0 ? void 0 : _err$response.message) || \"Failed to load order history\");\n        case 4:\n          _context.p = 4;\n          setLoading(false);\n          return _context.f(4);\n        case 5:\n          return _context.a(2);\n      }\n    }, _callee, null, [[1, 3, 4, 5]]);\n  })), [email]);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    if (!email) {\n      react_hot_toast__WEBPACK_IMPORTED_MODULE_28__[\"default\"].error(\"No customer email provided\");\n      navigate(\"/store-manager/customers\");\n      return;\n    }\n    fetchOrders(page);\n  }, [email, page, fetchOrders, navigate]);\n  var totalSpent = orders.reduce(function (sum, o) {\n    return sum + parseFloat(o.total || 0);\n  }, 0);\n  var sym = ((_orders$ = orders[0]) === null || _orders$ === void 0 ? void 0 : _orders$.currency_symbol) || \"$\";\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    pb: 10\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    justify: \"space-between\",\n    align: \"center\",\n    mb: 6,\n    flexWrap: \"wrap\",\n    gap: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.VStack, {\n    align: \"start\",\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Breadcrumb, {\n    fontSize: \"sm\",\n    color: \"gray.500\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.BreadcrumbItem, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.BreadcrumbLink, {\n    onClick: function onClick() {\n      return navigate(\"/store-manager/customers\");\n    }\n  }, \"Customers\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.BreadcrumbItem, {\n    isCurrentPage: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.BreadcrumbLink, null, \"Order History\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Heading, {\n    mb: 0,\n    size: \"lg\",\n    fontWeight: \"800\"\n  }, \"Order History\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Text, {\n    mb: 0,\n    color: \"gray.500\",\n    fontSize: \"sm\"\n  }, email)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_25__.FiArrowLeft, null),\n    variant: \"ghost\",\n    borderRadius: \"xl\",\n    onClick: function onClick() {\n      return navigate(-1);\n    }\n  }, \"Back\")), !loading && orders.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.SimpleGrid, {\n    columns: {\n      base: 2,\n      md: 3\n    },\n    spacing: 4,\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Card, {\n    variant: \"outline\",\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.CardBody, {\n    p: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Text, {\n    mb: 0,\n    fontSize: \"xs\",\n    color: \"gray.400\",\n    fontWeight: \"700\",\n    textTransform: \"uppercase\"\n  }, \"Total Orders\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Text, {\n    mt: 0,\n    fontSize: \"2xl\",\n    fontWeight: \"900\",\n    color: \"blue.600\"\n  }, (_meta$total = meta.total) !== null && _meta$total !== void 0 ? _meta$total : orders.length))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Card, {\n    variant: \"outline\",\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.CardBody, {\n    p: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Text, {\n    mb: 0,\n    fontSize: \"xs\",\n    color: \"gray.400\",\n    fontWeight: \"700\",\n    textTransform: \"uppercase\"\n  }, \"Total Spent\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Text, {\n    mt: 0,\n    fontSize: \"2xl\",\n    fontWeight: \"900\",\n    color: \"green.600\"\n  }, sym, totalSpent.toFixed(2)))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Card, {\n    variant: \"outline\",\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.CardBody, {\n    p: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Text, {\n    mb: 0,\n    fontSize: \"xs\",\n    color: \"gray.400\",\n    fontWeight: \"700\",\n    textTransform: \"uppercase\"\n  }, \"Avg. Order Value\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Text, {\n    mt: 0,\n    fontSize: \"2xl\",\n    fontWeight: \"900\",\n    color: \"purple.600\"\n  }, orders.length > 0 ? \"\".concat(sym).concat((totalSpent / orders.length).toFixed(2)) : \"—\")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Card, {\n    variant: \"outline\",\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.CardBody, {\n    p: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.TableContainer, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Table, {\n    variant: \"simple\",\n    size: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.Thead, {\n    bg: \"gray.50\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Th, null, \"Order #\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Th, null, \"Status\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Th, null, \"Date\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Th, {\n    isNumeric: true\n  }, \"Total\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Th, null, \"Payment\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Th, null, \"Items\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Tbody, null, loading ? [1, 2, 3, 4, 5].map(function (i) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Tr, {\n      key: i\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Td, {\n      colSpan: 6\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Skeleton, {\n      h: \"32px\"\n    })));\n  }) : orders.length === 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Td, {\n    colSpan: 6,\n    textAlign: \"center\",\n    py: 12\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.VStack, {\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_25__.FiShoppingBag,\n    boxSize: \"32px\",\n    color: \"gray.300\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Text, {\n    color: \"gray.400\",\n    fontStyle: \"italic\"\n  }, \"No orders found for this customer.\")))) : orders.map(function (order) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(OrderRow, {\n      key: order.id,\n      order: order\n    });\n  })))), !loading && meta.total > perPage && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Divider, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    justify: \"space-between\",\n    align: \"center\",\n    px: 4,\n    py: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.500\"\n  }, \"Showing \", Math.min(orders.length, perPage), \" of \", meta.total, \" orders\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.HStack, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Button, {\n    size: \"sm\",\n    variant: \"outline\",\n    isDisabled: page <= 1,\n    onClick: function onClick() {\n      return setPage(function (p) {\n        return p - 1;\n      });\n    }\n  }, \"Previous\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Button, {\n    size: \"sm\",\n    variant: \"outline\",\n    isDisabled: page >= (meta.pages || 1),\n    onClick: function onClick() {\n      return setPage(function (p) {\n        return p + 1;\n      });\n    }\n  }, \"Next\")))))));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CustomerOrderHistory);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Customers/CustomerOrderHistory.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Customers/ViewCustomer.jsx"
/*!***********************************************************!*\
  !*** ./src/Pages/StoreManager/Customers/ViewCustomer.jsx ***!
  \***********************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/hooks/dist/esm/use-disclosure.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/avatar/avatar.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/breadcrumb/breadcrumb.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/breadcrumb/breadcrumb-item.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/breadcrumb/breadcrumb-link.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/simple-grid.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/skeleton/skeleton.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/skeleton/skeleton-text.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/skeleton/skeleton-circle.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/heading.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router/dist/development/chunk-EPOLDU6W.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! react-hot-toast */ \"./node_modules/react-hot-toast/dist/index.mjs\");\n/* harmony import */ var _utils_FormatDate__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../../utils/FormatDate */ \"./src/utils/FormatDate.js\");\n/* harmony import */ var _Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../../Components/shared/ConfirmDialog */ \"./src/Components/shared/ConfirmDialog.jsx\");\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\n\n\n\n\nvar ViewCustomer = function ViewCustomer() {\n  var _customer$billing, _customer$date_create, _customer$billing2, _customer$billing3, _customer$billing4, _customer$billing5, _customer$billing6, _customer$billing7, _customer$billing8, _customer$billing9, _customer$billing0, _customer$shipping, _customer$shipping2, _customer$shipping3, _customer$shipping4, _customer$shipping5, _customer$shipping6, _customer$shipping7, _customer$shipping8, _customer$shipping9;\n  var _useParams = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_22__.useParams)(),\n    id = _useParams.id;\n  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_22__.useNavigate)();\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState2 = _slicedToArray(_useState, 2),\n    customer = _useState2[0],\n    setCustomer = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),\n    _useState4 = _slicedToArray(_useState3, 2),\n    loading = _useState4[0],\n    setLoading = _useState4[1];\n  var _useDisclosure = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.useDisclosure)(),\n    isDeleteOpen = _useDisclosure.isOpen,\n    onDeleteOpen = _useDisclosure.onOpen,\n    onDeleteClose = _useDisclosure.onClose;\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState6 = _slicedToArray(_useState5, 2),\n    isDeleting = _useState6[0],\n    setIsDeleting = _useState6[1];\n  var fetchCustomer = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n    var _response$data, response, customerData, _t;\n    return _regenerator().w(function (_context) {\n      while (1) switch (_context.p = _context.n) {\n        case 0:\n          _context.p = 0;\n          setLoading(true);\n          _context.n = 1;\n          return axios__WEBPACK_IMPORTED_MODULE_23__[\"default\"].get(\"/api/store-manager/customers/\".concat(id));\n        case 1:\n          response = _context.v;\n          customerData = ((_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.data) || response.data;\n          if (Array.isArray(customerData) && customerData.length > 0) {\n            customerData = customerData[0];\n          }\n          setCustomer(customerData);\n          _context.n = 3;\n          break;\n        case 2:\n          _context.p = 2;\n          _t = _context.v;\n          react_hot_toast__WEBPACK_IMPORTED_MODULE_24__[\"default\"].error(\"Failed to load customer details\");\n          navigate(\"/store-manager/customers\");\n        case 3:\n          _context.p = 3;\n          setLoading(false);\n          return _context.f(3);\n        case 4:\n          return _context.a(2);\n      }\n    }, _callee, null, [[0, 2, 3, 4]]);\n  })), [id, navigate]);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    fetchCustomer();\n  }, [fetchCustomer]);\n  var handleDelete = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {\n      return _regenerator().w(function (_context2) {\n        while (1) switch (_context2.n) {\n          case 0:\n            onDeleteOpen();\n          case 1:\n            return _context2.a(2);\n        }\n      }, _callee2);\n    }));\n    return function handleDelete() {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  var confirmDelete = /*#__PURE__*/function () {\n    var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {\n      var _t2;\n      return _regenerator().w(function (_context3) {\n        while (1) switch (_context3.p = _context3.n) {\n          case 0:\n            setIsDeleting(true);\n            _context3.p = 1;\n            _context3.n = 2;\n            return axios__WEBPACK_IMPORTED_MODULE_23__[\"default\"][\"delete\"](\"/api/store-manager/customers/\".concat(id), {\n              params: {\n                force: true,\n                reassign: 0\n              }\n            });\n          case 2:\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_24__[\"default\"].success(\"Customer deleted successfully\");\n            navigate(\"/store-manager/customers\");\n            _context3.n = 4;\n            break;\n          case 3:\n            _context3.p = 3;\n            _t2 = _context3.v;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_24__[\"default\"].error(\"Failed to delete customer\");\n          case 4:\n            _context3.p = 4;\n            setIsDeleting(false);\n            onDeleteClose();\n            return _context3.f(4);\n          case 5:\n            return _context3.a(2);\n        }\n      }, _callee3, null, [[1, 3, 4, 5]]);\n    }));\n    return function confirmDelete() {\n      return _ref3.apply(this, arguments);\n    };\n  }();\n  if (loading) {\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(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n      animation: \"fadeIn 0.4s ease-out\",\n      pb: 10\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n      justify: \"space-between\",\n      align: \"center\",\n      mb: 6\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.VStack, {\n      align: \"start\",\n      spacing: 2,\n      w: \"30%\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Skeleton, {\n      height: \"15px\",\n      width: \"100px\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Skeleton, {\n      height: \"30px\",\n      width: \"200px\"\n    }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.SimpleGrid, {\n      columns: {\n        base: 1,\n        md: 3\n      },\n      spacing: 6\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Card, {\n      variant: \"outline\",\n      borderRadius: \"2xl\",\n      border: \"1px\",\n      borderColor: \"gray.100\",\n      shadow: \"sm\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.CardBody, {\n      p: 6,\n      textAlign: \"center\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.SkeletonCircle, {\n      size: \"120px\",\n      mx: \"auto\",\n      mb: 4\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Skeleton, {\n      height: \"20px\",\n      width: \"150px\",\n      mx: \"auto\",\n      mb: 2\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Skeleton, {\n      height: \"15px\",\n      width: \"100px\",\n      mx: \"auto\",\n      mb: 6\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.VStack, {\n      mt: 8,\n      spacing: 4,\n      align: \"stretch\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Skeleton, {\n      height: \"20px\",\n      width: \"full\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Skeleton, {\n      height: \"20px\",\n      width: \"full\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Skeleton, {\n      height: \"20px\",\n      width: \"full\"\n    }))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n      gridColumn: {\n        md: \"span 2\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.SimpleGrid, {\n      columns: {\n        base: 1,\n        lg: 2\n      },\n      spacing: 6\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Card, {\n      variant: \"outline\",\n      borderRadius: \"2xl\",\n      p: 6\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.SkeletonText, {\n      mt: \"4\",\n      noOfLines: 4,\n      spacing: \"4\",\n      skeletonHeight: \"4\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Card, {\n      variant: \"outline\",\n      borderRadius: \"2xl\",\n      p: 6\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.SkeletonText, {\n      mt: \"4\",\n      noOfLines: 4,\n      spacing: \"4\",\n      skeletonHeight: \"4\"\n    }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Card, {\n      variant: \"outline\",\n      borderRadius: \"2xl\",\n      p: 6,\n      mt: 6\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.SkeletonText, {\n      mt: \"4\",\n      noOfLines: 2,\n      spacing: \"4\",\n      skeletonHeight: \"4\"\n    }))))));\n  }\n  if (!customer) return null;\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(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    animation: \"fadeIn 0.4s ease-out\",\n    pb: 10\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    justify: \"space-between\",\n    align: \"center\",\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.VStack, {\n    align: \"start\",\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Breadcrumb, {\n    fontSize: \"sm\",\n    color: \"gray.500\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.BreadcrumbItem, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.BreadcrumbLink, {\n    onClick: function onClick() {\n      return navigate(\"/store-manager/customers\");\n    }\n  }, \"Customers\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.BreadcrumbItem, {\n    isCurrentPage: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.BreadcrumbLink, null, customer.first_name, \" \", customer.last_name))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Heading, {\n    size: \"lg\",\n    fontWeight: \"800\"\n  }, \"Customer Profile\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.HStack, {\n    spacing: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_21__.FiArrowLeft, null),\n    variant: \"ghost\",\n    onClick: function onClick() {\n      return navigate(\"/store-manager/customers\");\n    },\n    borderRadius: \"xl\"\n  }, \"Back\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_21__.FiTrash2, null),\n    colorScheme: \"red\",\n    variant: \"subtle\",\n    onClick: handleDelete,\n    borderRadius: \"xl\"\n  }, \"Delete\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.SimpleGrid, {\n    columns: {\n      base: 1,\n      md: 3\n    },\n    spacing: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Card, {\n    variant: \"outline\",\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\",\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.CardBody, {\n    p: 6,\n    textAlign: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Avatar, {\n    size: \"2xl\",\n    name: \"\".concat(customer.first_name || customer.username, \" \").concat(customer.last_name || ''),\n    src: customer.avatar_url,\n    mb: 4,\n    border: \"4px\",\n    borderColor: \"blue.50\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Heading, {\n    size: \"md\",\n    fontWeight: \"800\",\n    mb: 1\n  }, customer.first_name || customer.username, \" \", customer.last_name || ''), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    color: \"gray.500\",\n    fontWeight: \"600\",\n    fontSize: \"sm\",\n    mb: 4\n  }, \"@\", customer.username), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.HStack, {\n    justify: \"center\",\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Badge, {\n    colorScheme: \"blue\",\n    px: 3,\n    py: 1,\n    borderRadius: \"full\",\n    textTransform: \"uppercase\",\n    fontSize: \"2xs\"\n  }, customer.role || 'Customer'), customer.is_paying_customer && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Badge, {\n    colorScheme: \"green\",\n    px: 3,\n    py: 1,\n    borderRadius: \"full\",\n    textTransform: \"uppercase\",\n    fontSize: \"2xs\"\n  }, \"Paying Customer\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.VStack, {\n    align: \"stretch\",\n    spacing: 4,\n    mt: 8,\n    gap: 0,\n    textAlign: \"left\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    align: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_21__.FiMail,\n    color: \"gray.400\",\n    mr: 3\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    mb: 0,\n    fontSize: \"xs\",\n    color: \"gray.400\",\n    fontWeight: \"700\",\n    textTransform: \"uppercase\"\n  }, \"Email\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    mt: 1,\n    fontSize: \"sm\",\n    fontWeight: \"700\"\n  }, customer.email))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    align: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_21__.FiPhone,\n    color: \"gray.400\",\n    mr: 3\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    mb: 0,\n    fontSize: \"xs\",\n    color: \"gray.400\",\n    fontWeight: \"700\",\n    textTransform: \"uppercase\"\n  }, \"Phone\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    mt: 1,\n    fontSize: \"sm\",\n    fontWeight: \"700\"\n  }, ((_customer$billing = customer.billing) === null || _customer$billing === void 0 ? void 0 : _customer$billing.phone) || 'N/A'))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    align: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_21__.FiCalendar,\n    color: \"gray.400\",\n    mr: 3\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    mb: 0,\n    fontSize: \"xs\",\n    color: \"gray.400\",\n    fontWeight: \"700\",\n    textTransform: \"uppercase\"\n  }, \"Registered\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    mt: 1,\n    fontSize: \"sm\",\n    fontWeight: \"700\"\n  }, (0,_utils_FormatDate__WEBPACK_IMPORTED_MODULE_25__.FormatDate)(((_customer$date_create = customer.date_created) === null || _customer$date_create === void 0 ? void 0 : _customer$date_create.date) || customer.date_created)))), customer.country && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    align: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_21__.FiMapPin,\n    color: \"gray.400\",\n    mr: 3\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    mb: 0,\n    fontSize: \"xs\",\n    color: \"gray.400\",\n    fontWeight: \"700\",\n    textTransform: \"uppercase\"\n  }, \"Country\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    mt: 1,\n    fontSize: \"sm\",\n    fontWeight: \"700\"\n  }, customer.country))))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    gridColumn: {\n      md: \"span 2\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.SimpleGrid, {\n    columns: {\n      base: 1,\n      lg: 2\n    },\n    spacing: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Card, {\n    variant: \"outline\",\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.CardBody, {\n    p: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.HStack, {\n    mb: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_21__.FiMapPin,\n    color: \"blue.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Heading, {\n    size: \"sm\",\n    fontWeight: \"800\"\n  }, \"Billing Address\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    bg: \"gray.50\",\n    p: 4,\n    borderRadius: \"xl\",\n    minH: \"120px\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.600\",\n    lineHeight: \"tall\"\n  }, (_customer$billing2 = customer.billing) === null || _customer$billing2 === void 0 ? void 0 : _customer$billing2.first_name, \" \", (_customer$billing3 = customer.billing) === null || _customer$billing3 === void 0 ? void 0 : _customer$billing3.last_name, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"br\", null), ((_customer$billing4 = customer.billing) === null || _customer$billing4 === void 0 ? void 0 : _customer$billing4.company) && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, customer.billing.company, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"br\", null)), (_customer$billing5 = customer.billing) === null || _customer$billing5 === void 0 ? void 0 : _customer$billing5.address_1, \" \", (_customer$billing6 = customer.billing) !== null && _customer$billing6 !== void 0 && _customer$billing6.address_2 ? \"\".concat(customer.billing.address_2, \", \") : '', /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"br\", null), (_customer$billing7 = customer.billing) === null || _customer$billing7 === void 0 ? void 0 : _customer$billing7.city, \", \", (_customer$billing8 = customer.billing) === null || _customer$billing8 === void 0 ? void 0 : _customer$billing8.state, \" \", (_customer$billing9 = customer.billing) === null || _customer$billing9 === void 0 ? void 0 : _customer$billing9.postcode, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"br\", null), (_customer$billing0 = customer.billing) === null || _customer$billing0 === void 0 ? void 0 : _customer$billing0.country)))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Card, {\n    variant: \"outline\",\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.CardBody, {\n    p: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.HStack, {\n    mb: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_21__.FiTruck,\n    color: \"blue.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Heading, {\n    size: \"sm\",\n    fontWeight: \"800\"\n  }, \"Shipping Address\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    bg: \"gray.50\",\n    p: 4,\n    borderRadius: \"xl\",\n    minH: \"120px\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.600\",\n    lineHeight: \"tall\"\n  }, (_customer$shipping = customer.shipping) === null || _customer$shipping === void 0 ? void 0 : _customer$shipping.first_name, \" \", (_customer$shipping2 = customer.shipping) === null || _customer$shipping2 === void 0 ? void 0 : _customer$shipping2.last_name, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"br\", null), ((_customer$shipping3 = customer.shipping) === null || _customer$shipping3 === void 0 ? void 0 : _customer$shipping3.company) && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, customer.shipping.company, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"br\", null)), (_customer$shipping4 = customer.shipping) === null || _customer$shipping4 === void 0 ? void 0 : _customer$shipping4.address_1, \" \", (_customer$shipping5 = customer.shipping) !== null && _customer$shipping5 !== void 0 && _customer$shipping5.address_2 ? \"\".concat(customer.shipping.address_2, \", \") : '', /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"br\", null), (_customer$shipping6 = customer.shipping) === null || _customer$shipping6 === void 0 ? void 0 : _customer$shipping6.city, \", \", (_customer$shipping7 = customer.shipping) === null || _customer$shipping7 === void 0 ? void 0 : _customer$shipping7.state, \" \", (_customer$shipping8 = customer.shipping) === null || _customer$shipping8 === void 0 ? void 0 : _customer$shipping8.postcode, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"br\", null), (_customer$shipping9 = customer.shipping) === null || _customer$shipping9 === void 0 ? void 0 : _customer$shipping9.country))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Card, {\n    mt: 4,\n    variant: \"outline\",\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.CardBody, {\n    p: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.VStack, {\n    spacing: 4,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.400\",\n    fontWeight: \"700\",\n    textTransform: \"uppercase\",\n    mb: 2\n  }, \"Stats\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.HStack, {\n    spacing: 4,\n    flexWrap: \"wrap\",\n    w: \"100%\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.VStack, {\n    align: \"start\",\n    bg: \"blue.50\",\n    p: 3,\n    borderRadius: \"xl\",\n    flex: \"1\",\n    minW: \"100px\",\n    spacing: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_21__.FiShoppingCart,\n    color: \"blue.500\",\n    mb: 1\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    mb: 0,\n    fontSize: \"lg\",\n    fontWeight: \"900\",\n    color: \"blue.700\"\n  }, customer.orders_count || '0'), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    mt: 1,\n    fontSize: \"2xs\",\n    fontWeight: \"700\",\n    color: \"blue.400\"\n  }, \"ORDERS\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.VStack, {\n    align: \"start\",\n    bg: \"green.50\",\n    p: 3,\n    borderRadius: \"xl\",\n    flex: \"1\",\n    minW: \"100px\",\n    spacing: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    mb: 0,\n    fontSize: \"lg\",\n    fontWeight: \"900\",\n    color: \"green.700\"\n  }, customer.currency_pos === 'right' ? '' : customer.currency_symbol || '$', customer.total_spent || '0.00', customer.currency_pos === 'right' ? customer.currency_symbol || '' : ''), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    mt: 1,\n    fontSize: \"2xs\",\n    fontWeight: \"700\",\n    color: \"green.400\"\n  }, \"SPENT\"))), customer.aov && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.VStack, {\n    align: \"start\",\n    bg: \"purple.50\",\n    p: 3,\n    borderRadius: \"xl\",\n    mt: 4,\n    spacing: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    mb: 0,\n    fontSize: \"lg\",\n    fontWeight: \"900\",\n    color: \"purple.700\"\n  }, customer.currency_pos === 'right' ? '' : customer.currency_symbol || '$', customer.aov, customer.currency_pos === 'right' ? customer.currency_symbol || '' : ''), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Text, {\n    mt: 1,\n    fontSize: \"2xs\",\n    fontWeight: \"700\",\n    color: \"purple.400\"\n  }, \"AVERAGE ORDER VALUE\"))))))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_26__[\"default\"], {\n    isOpen: isDeleteOpen,\n    onClose: onDeleteClose,\n    onConfirm: confirmDelete,\n    title: \"Delete Customer\",\n    description: \"Are you sure you want to permanently delete this customer? This cannot be undone.\",\n    confirmLabel: \"Delete\",\n    loading: isDeleting\n  }));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ViewCustomer);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Customers/ViewCustomer.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Layouts/StoreManagerContext.js"
/*!***************************************************************!*\
  !*** ./src/Pages/StoreManager/Layouts/StoreManagerContext.js ***!
  \***************************************************************/
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   StoreManagerContext: () => (/* binding */ StoreManagerContext),\n/* harmony export */   useStoreManager: () => (/* binding */ useStoreManager)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n\nvar StoreManagerContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({\n  onStoreModalOpen: function onStoreModalOpen() {}\n});\nvar useStoreManager = function useStoreManager() {\n  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(StoreManagerContext);\n};\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Layouts/StoreManagerContext.js?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Layouts/StoreManagerLayout.jsx"
/*!***************************************************************!*\
  !*** ./src/Pages/StoreManager/Layouts/StoreManagerLayout.jsx ***!
  \***************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ StoreManagerLayout)\n/* harmony export */ });\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/hooks/dist/esm/use-disclosure.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/avatar/avatar.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/alert-dialog.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-footer.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-header.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-overlay.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_14__);\n/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! react-hot-toast */ \"./node_modules/react-hot-toast/dist/index.mjs\");\n/* harmony import */ var _StoreManagerContext__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./StoreManagerContext */ \"./src/Pages/StoreManager/Layouts/StoreManagerContext.js\");\n/* harmony import */ var _Components_shared_UsageTrackingNotice__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../Components/shared/UsageTrackingNotice */ \"./src/Components/shared/UsageTrackingNotice.jsx\");\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\n\n\n\n\n\n// Modern Sidebar Navigation Item\nfunction StoreManagerLayout(_ref) {\n  var header = _ref.header,\n    children = _ref.children;\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_14__.useState)([]),\n    _useState2 = _slicedToArray(_useState, 2),\n    stores = _useState2[0],\n    setStores = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_14__.useState)(null),\n    _useState4 = _slicedToArray(_useState3, 2),\n    pendingStore = _useState4[0],\n    setPendingStore = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_14__.useState)(false),\n    _useState6 = _slicedToArray(_useState5, 2),\n    switching = _useState6[0],\n    setSwitching = _useState6[1];\n  var _useDisclosure = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_0__.useDisclosure)(),\n    isStoreModalOpen = _useDisclosure.isOpen,\n    onStoreModalOpen = _useDisclosure.onOpen,\n    onStoreModalClose = _useDisclosure.onClose;\n  var cancelRef = (0,react__WEBPACK_IMPORTED_MODULE_14__.useRef)();\n  var fetchStores = (0,react__WEBPACK_IMPORTED_MODULE_14__.useCallback)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n    var _response$data, response, storesList, current, _t;\n    return _regenerator().w(function (_context) {\n      while (1) switch (_context.p = _context.n) {\n        case 0:\n          _context.p = 0;\n          _context.n = 1;\n          return axios__WEBPACK_IMPORTED_MODULE_13__[\"default\"].get('/api/stores');\n        case 1:\n          response = _context.v;\n          storesList = ((_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.stores) || [];\n          setStores(storesList);\n          current = storesList.find(function (s) {\n            return s.is_current === \"1\" || s.is_current === 1 || s.is_current === true;\n          });\n          setPendingStore(current);\n          _context.n = 3;\n          break;\n        case 2:\n          _context.p = 2;\n          _t = _context.v;\n          console.error('Failed to fetch stores', _t);\n        case 3:\n          return _context.a(2);\n      }\n    }, _callee, null, [[0, 2]]);\n  })), []);\n  (0,react__WEBPACK_IMPORTED_MODULE_14__.useEffect)(function () {\n    fetchStores();\n  }, [fetchStores]);\n  var handleStoreSwitch = /*#__PURE__*/function () {\n    var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {\n      var _t2;\n      return _regenerator().w(function (_context2) {\n        while (1) switch (_context2.p = _context2.n) {\n          case 0:\n            if (pendingStore) {\n              _context2.n = 1;\n              break;\n            }\n            return _context2.a(2);\n          case 1:\n            setSwitching(true);\n            _context2.p = 2;\n            _context2.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_13__[\"default\"].post('/api/stores/switch', {\n              store_id: pendingStore.id\n            });\n          case 3:\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_15__[\"default\"].success('Store switched successfully');\n            onStoreModalClose();\n            window.location.reload(); // Reload to refresh all components with new store data\n            _context2.n = 5;\n            break;\n          case 4:\n            _context2.p = 4;\n            _t2 = _context2.v;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_15__[\"default\"].error('Failed to switch store');\n          case 5:\n            _context2.p = 5;\n            setSwitching(false);\n            return _context2.f(5);\n          case 6:\n            return _context2.a(2);\n        }\n      }, _callee2, null, [[2, 4, 5, 6]]);\n    }));\n    return function handleStoreSwitch() {\n      return _ref3.apply(this, arguments);\n    };\n  }();\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    minH: \"100vh\",\n    bg: \"gray.50\",\n    display: \"flex\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    flex: \"1\",\n    display: \"flex\",\n    flexDirection: \"column\",\n    minW: \"0\"\n  }, header && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    h: \"20\",\n    bg: \"white\",\n    borderBottom: \"1px\",\n    borderColor: \"gray.100\",\n    px: {\n      base: 4,\n      md: 8\n    },\n    display: \"flex\",\n    alignItems: \"center\",\n    justifyContent: \"space-between\",\n    flexShrink: 0,\n    zIndex: \"20\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Text, {\n    mb: 0,\n    fontSize: \"xl\",\n    fontWeight: \"800\",\n    color: \"gray.800\",\n    letterSpacing: \"-0.5px\"\n  }, header)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    p: {\n      base: 4,\n      md: 6\n    },\n    flex: \"1\",\n    className: \"shopcentral-scrollbar\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_Components_shared_UsageTrackingNotice__WEBPACK_IMPORTED_MODULE_17__[\"default\"], null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_StoreManagerContext__WEBPACK_IMPORTED_MODULE_16__.StoreManagerContext.Provider, {\n    value: {\n      onStoreModalOpen: onStoreModalOpen\n    }\n  }, children))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.AlertDialog, {\n    isOpen: isStoreModalOpen,\n    leastDestructiveRef: cancelRef,\n    onClose: onStoreModalClose,\n    size: \"xl\",\n    isCentered: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.ModalOverlay, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.AlertDialogContent, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.ModalHeader, null, \"Select a Store\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.ModalBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.VStack, {\n    align: \"stretch\",\n    spacing: \"2\"\n  }, stores.map(function (store) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n      key: store.id,\n      p: \"4\",\n      borderRadius: \"md\",\n      borderWidth: \"1px\",\n      borderColor: (pendingStore === null || pendingStore === void 0 ? void 0 : pendingStore.id) === store.id ? \"blue.500\" : \"gray.200\",\n      bg: (pendingStore === null || pendingStore === void 0 ? void 0 : pendingStore.id) === store.id ? \"blue.50\" : \"white\",\n      cursor: \"pointer\",\n      onClick: function onClick() {\n        return setPendingStore(store);\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.HStack, {\n      spacing: \"3\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Avatar, {\n      size: \"sm\",\n      name: store.name\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.VStack, {\n      align: \"start\",\n      spacing: \"0\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Text, {\n      m: 0,\n      fontWeight: \"bold\"\n    }, store.name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Text, {\n      m: 0,\n      fontSize: \"xs\",\n      color: \"gray.500\"\n    }, store.url)), store.is_current == 1 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n      colorScheme: \"green\",\n      ml: \"auto\"\n    }, \"Current\")));\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.ModalFooter, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    ref: cancelRef,\n    onClick: onStoreModalClose\n  }, \"Cancel\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    colorScheme: \"blue\",\n    ml: \"3\",\n    isLoading: switching,\n    onClick: handleStoreSwitch\n  }, \"Switch Store\")))));\n}\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Layouts/StoreManagerLayout.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Logs/LogsPage.jsx"
/*!**************************************************!*\
  !*** ./src/Pages/StoreManager/Logs/LogsPage.jsx ***!
  \**************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/hooks/dist/esm/use-disclosure.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/icon-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/divider/divider.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-footer.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-header.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-overlay.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-arrow.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-trigger.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/select/select.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table-container.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tbody.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/td.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/th.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/thead.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tr.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/toast/use-toast.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/tooltip/tooltip.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var react_icons_fa__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! react-icons/fa */ \"./node_modules/react-icons/fa/index.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! react-hot-toast */ \"./node_modules/react-hot-toast/dist/index.mjs\");\n/* harmony import */ var _Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ../../../Components/shared/DatePicker */ \"./src/Components/shared/DatePicker.jsx\");\n/* harmony import */ var _Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ../../../Components/shared/ConfirmDialog */ \"./src/Components/shared/ConfirmDialog.jsx\");\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 _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\n\n\n\n\nvar LEVEL_CONFIG = {\n  info: {\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiInfo,\n    color: \"blue\",\n    bg: \"blue.50\"\n  },\n  success: {\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiCheckCircle,\n    color: \"green\",\n    bg: \"green.50\"\n  },\n  warning: {\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiAlertTriangle,\n    color: \"orange\",\n    bg: \"orange.50\"\n  },\n  error: {\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiXCircle,\n    color: \"red\",\n    bg: \"red.50\"\n  }\n};\nvar FEATURE_ICONS = {\n  order_sync: \"🔄\",\n  product_sync: \"📦\",\n  customer_sync: \"👤\",\n  inventory: \"📊\",\n  connection: \"🔗\",\n  \"import\": \"📥\",\n  \"export\": \"📤\",\n  general: \"⚙️\"\n};\nvar VStack = function VStack(_ref) {\n  var children = _ref.children,\n    spacing = _ref.spacing,\n    align = _ref.align;\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Flex, {\n    direction: \"column\",\n    gap: spacing,\n    align: align\n  }, children);\n};\nvar LogDetailModal = function LogDetailModal(_ref2) {\n  var log = _ref2.log,\n    isOpen = _ref2.isOpen,\n    onClose = _ref2.onClose,\n    featureLabels = _ref2.featureLabels;\n  if (!log) return null;\n  var levelConf = LEVEL_CONFIG[log.level] || LEVEL_CONFIG.info;\n  var handleCopyContext = function handleCopyContext() {\n    var text = \"[\".concat(log.created_at, \"] [\").concat(log.level.toUpperCase(), \"] [\").concat(log.feature, \"] \").concat(log.message).concat(log.context ? \"\\n\\nContext:\\n\" + log.context : \"\");\n    navigator.clipboard.writeText(text).then(function () {\n      react_hot_toast__WEBPACK_IMPORTED_MODULE_40__[\"default\"].success(\"Log copied to clipboard\");\n    })[\"catch\"](function () {\n      react_hot_toast__WEBPACK_IMPORTED_MODULE_40__[\"default\"].error(\"Failed to copy\");\n    });\n  };\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Modal, {\n    isOpen: isOpen,\n    onClose: onClose,\n    size: {\n      base: \"full\",\n      md: \"lg\"\n    },\n    isCentered: true,\n    scrollBehavior: \"inside\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.ModalOverlay, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.ModalContent, {\n    mx: {\n      base: 2,\n      md: 0\n    },\n    maxH: {\n      base: \"90vh\",\n      md: \"80vh\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.ModalHeader, {\n    pb: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Flex, {\n    align: \"center\",\n    gap: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Icon, {\n    as: levelConf.icon,\n    color: levelConf.color + \".500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Text, {\n    fontSize: {\n      base: \"md\",\n      md: \"lg\"\n    }\n  }, \"Log Details\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.ModalCloseButton, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.ModalBody, {\n    pb: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(VStack, {\n    spacing: 4,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Flex, {\n    gap: 2,\n    flexWrap: \"wrap\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n    colorScheme: levelConf.color,\n    px: 2,\n    py: 0.5,\n    borderRadius: \"md\",\n    fontSize: \"xs\"\n  }, log.level.toUpperCase()), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n    colorScheme: \"gray\",\n    px: 2,\n    py: 0.5,\n    borderRadius: \"md\",\n    fontSize: \"xs\"\n  }, featureLabels[log.feature] || log.feature), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n    variant: \"outline\",\n    px: 2,\n    py: 0.5,\n    borderRadius: \"md\",\n    fontSize: \"xs\"\n  }, FEATURE_ICONS[log.feature] || \"📋\", \" \", log.created_at)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Divider, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.500\",\n    fontWeight: \"600\",\n    mb: 1\n  }, \"MESSAGE\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Text, {\n    fontSize: \"sm\",\n    fontWeight: \"500\"\n  }, log.message)), log.context && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Flex, {\n    justify: \"space-between\",\n    align: \"center\",\n    mb: 1,\n    direction: {\n      base: \"column\",\n      sm: \"row\"\n    },\n    gap: {\n      base: 1,\n      sm: 0\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.500\",\n    fontWeight: \"600\"\n  }, \"CONTEXT / ERROR DETAILS\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    size: \"xs\",\n    variant: \"ghost\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiCopy, null),\n    onClick: handleCopyContext\n  }, \"Copy\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    bg: levelConf.bg,\n    borderRadius: \"md\",\n    p: 3,\n    border: \"1px\",\n    borderColor: levelConf.color + \".200\",\n    maxH: {\n      base: \"200px\",\n      md: \"300px\"\n    },\n    overflowY: \"auto\",\n    className: \"shopcentral-scrollbar\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Text, {\n    fontSize: \"xs\",\n    fontFamily: \"monospace\",\n    color: \"gray.700\",\n    whiteSpace: \"pre-wrap\",\n    wordBreak: \"break-all\"\n  }, log.context))), log.store_id && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.500\",\n    fontWeight: \"600\",\n    mb: 1\n  }, \"STORE ID\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Text, {\n    fontSize: \"sm\"\n  }, log.store_id)))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.ModalFooter, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    variant: \"ghost\",\n    mr: 3,\n    onClick: onClose\n  }, \"Close\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    colorScheme: \"blue\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiCopy, null),\n    onClick: handleCopyContext\n  }, \"Copy Full Log\"))));\n};\nvar LogsPage = function LogsPage() {\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState2 = _slicedToArray(_useState, 2),\n    logs = _useState2[0],\n    setLogs = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),\n    _useState4 = _slicedToArray(_useState3, 2),\n    loading = _useState4[0],\n    setLoading = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0),\n    _useState6 = _slicedToArray(_useState5, 2),\n    totalRows = _useState6[0],\n    setTotalRows = _useState6[1];\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0),\n    _useState8 = _slicedToArray(_useState7, 2),\n    totalPages = _useState8[0],\n    setTotalPages = _useState8[1];\n  var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1),\n    _useState0 = _slicedToArray(_useState9, 2),\n    page = _useState0[0],\n    setPage = _useState0[1];\n  var _useState1 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(50),\n    _useState10 = _slicedToArray(_useState1, 2),\n    perPage = _useState10[0],\n    setPerPage = _useState10[1];\n  var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({}),\n    _useState12 = _slicedToArray(_useState11, 2),\n    features = _useState12[0],\n    setFeatures = _useState12[1];\n  var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({}),\n    _useState14 = _slicedToArray(_useState13, 2),\n    levels = _useState14[0],\n    setLevels = _useState14[1];\n  var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"\"),\n    _useState16 = _slicedToArray(_useState15, 2),\n    selectedFeature = _useState16[0],\n    setSelectedFeature = _useState16[1];\n  var _useState17 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"\"),\n    _useState18 = _slicedToArray(_useState17, 2),\n    selectedLevel = _useState18[0],\n    setSelectedLevel = _useState18[1];\n  var _useState19 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"\"),\n    _useState20 = _slicedToArray(_useState19, 2),\n    searchTerm = _useState20[0],\n    setSearchTerm = _useState20[1];\n  var _useState21 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_41__.getAllTimeRange)()),\n    _useState22 = _slicedToArray(_useState21, 2),\n    dateRange = _useState22[0],\n    setDateRange = _useState22[1];\n  var _useState23 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState24 = _slicedToArray(_useState23, 2),\n    selectedRows = _useState24[0],\n    setSelectedRows = _useState24[1];\n  var _useState25 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState26 = _slicedToArray(_useState25, 2),\n    isDeleting = _useState26[0],\n    setIsDeleting = _useState26[1];\n  var _useState27 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState28 = _slicedToArray(_useState27, 2),\n    selectedLog = _useState28[0],\n    setSelectedLog = _useState28[1];\n  var _useDisclosure = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.useDisclosure)(),\n    isDetailOpen = _useDisclosure.isOpen,\n    onDetailOpen = _useDisclosure.onOpen,\n    onDetailClose = _useDisclosure.onClose;\n  var _useDisclosure2 = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.useDisclosure)(),\n    isClearOpen = _useDisclosure2.isOpen,\n    onClearOpen = _useDisclosure2.onOpen,\n    onClearClose = _useDisclosure2.onClose;\n  var toast = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.useToast)();\n  var fetchLogs = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n    var params, _yield$axios$get, data, _t;\n    return _regenerator().w(function (_context) {\n      while (1) switch (_context.p = _context.n) {\n        case 0:\n          setLoading(true);\n          _context.p = 1;\n          params = {\n            page: page,\n            per_page: perPage,\n            feature: selectedFeature,\n            level: selectedLevel,\n            search: searchTerm,\n            after: dateRange !== null && dateRange !== void 0 && dateRange.startDate ? dateRange.startDate.toISOString().split(\".\")[0] + \"Z\" : undefined,\n            before: dateRange !== null && dateRange !== void 0 && dateRange.endDate ? dateRange.endDate.toISOString().split(\".\")[0] + \"Z\" : undefined\n          };\n          _context.n = 2;\n          return axios__WEBPACK_IMPORTED_MODULE_39__[\"default\"].get(\"/api/store-manager/logs\", {\n            params: params\n          });\n        case 2:\n          _yield$axios$get = _context.v;\n          data = _yield$axios$get.data;\n          setLogs((data === null || data === void 0 ? void 0 : data.data) || []);\n          setTotalRows((data === null || data === void 0 ? void 0 : data.total) || 0);\n          setTotalPages((data === null || data === void 0 ? void 0 : data.pages) || 0);\n          if (data !== null && data !== void 0 && data.features) setFeatures(data.features);\n          if (data !== null && data !== void 0 && data.levels) setLevels(data.levels);\n          _context.n = 4;\n          break;\n        case 3:\n          _context.p = 3;\n          _t = _context.v;\n          toast({\n            title: \"Failed to fetch logs\",\n            status: \"error\",\n            duration: 3000\n          });\n        case 4:\n          _context.p = 4;\n          setLoading(false);\n          return _context.f(4);\n        case 5:\n          return _context.a(2);\n      }\n    }, _callee, null, [[1, 3, 4, 5]]);\n  })), [page, perPage, selectedFeature, selectedLevel, searchTerm, dateRange, toast]);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    fetchLogs();\n  }, [fetchLogs]);\n  var handleBulkDelete = /*#__PURE__*/function () {\n    var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {\n      var _t2;\n      return _regenerator().w(function (_context2) {\n        while (1) switch (_context2.p = _context2.n) {\n          case 0:\n            if (!(selectedRows.length === 0)) {\n              _context2.n = 1;\n              break;\n            }\n            return _context2.a(2);\n          case 1:\n            setIsDeleting(true);\n            _context2.p = 2;\n            _context2.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_39__[\"default\"].post(\"/api/store-manager/logs/delete\", {\n              ids: selectedRows\n            });\n          case 3:\n            toast({\n              title: \"\".concat(selectedRows.length, \" log(s) deleted\"),\n              status: \"success\",\n              duration: 3000\n            });\n            setSelectedRows([]);\n            fetchLogs();\n            _context2.n = 5;\n            break;\n          case 4:\n            _context2.p = 4;\n            _t2 = _context2.v;\n            toast({\n              title: \"Failed to delete logs\",\n              status: \"error\",\n              duration: 3000\n            });\n          case 5:\n            _context2.p = 5;\n            setIsDeleting(false);\n            return _context2.f(5);\n          case 6:\n            return _context2.a(2);\n        }\n      }, _callee2, null, [[2, 4, 5, 6]]);\n    }));\n    return function handleBulkDelete() {\n      return _ref4.apply(this, arguments);\n    };\n  }();\n  var handleClearAll = /*#__PURE__*/function () {\n    var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {\n      var _t3;\n      return _regenerator().w(function (_context3) {\n        while (1) switch (_context3.p = _context3.n) {\n          case 0:\n            _context3.p = 0;\n            _context3.n = 1;\n            return axios__WEBPACK_IMPORTED_MODULE_39__[\"default\"].post(\"/api/store-manager/logs/clear\");\n          case 1:\n            toast({\n              title: \"All logs cleared\",\n              status: \"success\",\n              duration: 3000\n            });\n            onClearClose();\n            fetchLogs();\n            _context3.n = 3;\n            break;\n          case 2:\n            _context3.p = 2;\n            _t3 = _context3.v;\n            toast({\n              title: \"Failed to clear logs\",\n              status: \"error\",\n              duration: 3000\n            });\n          case 3:\n            return _context3.a(2);\n        }\n      }, _callee3, null, [[0, 2]]);\n    }));\n    return function handleClearAll() {\n      return _ref5.apply(this, arguments);\n    };\n  }();\n  var handleCopyLog = function handleCopyLog(log) {\n    var text = \"[\".concat(log.created_at, \"] [\").concat(log.level.toUpperCase(), \"] [\").concat(log.feature, \"] \").concat(log.message).concat(log.context ? \"\\nContext: \" + log.context : \"\");\n    navigator.clipboard.writeText(text).then(function () {\n      toast({\n        title: \"Log copied to clipboard\",\n        status: \"success\",\n        duration: 2000\n      });\n    })[\"catch\"](function () {\n      toast({\n        title: \"Failed to copy\",\n        status: \"error\",\n        duration: 2000\n      });\n    });\n  };\n  var handleViewLog = function handleViewLog(log) {\n    setSelectedLog(log);\n    onDetailOpen();\n  };\n  var toggleSelectRow = function toggleSelectRow(id) {\n    setSelectedRows(function (prev) {\n      return prev.includes(id) ? prev.filter(function (r) {\n        return r !== id;\n      }) : [].concat(_toConsumableArray(prev), [id]);\n    });\n  };\n  var toggleSelectAll = function toggleSelectAll() {\n    if (selectedRows.length === logs.length && logs.length > 0) {\n      setSelectedRows([]);\n    } else {\n      setSelectedRows(logs.map(function (l) {\n        return l.id;\n      }));\n    }\n  };\n  var formatDate = function formatDate(dateString) {\n    if (!dateString) return \"-\";\n    var d = new Date(dateString);\n    return d.toLocaleDateString() + \" \" + d.toLocaleTimeString();\n  };\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    animation: \"fadeIn 0.5s ease-out\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Flex, {\n    direction: {\n      base: \"column\",\n      md: \"row\"\n    },\n    justify: \"space-between\",\n    align: {\n      base: \"start\",\n      md: \"center\"\n    },\n    mb: 6,\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Heading, {\n    size: \"lg\",\n    fontWeight: \"800\",\n    mb: 1\n  }, \"ShopCentral Logs\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Text, {\n    color: \"gray.500\",\n    fontWeight: \"500\"\n  }, \"Activity history for all ShopCentral features\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Card, {\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"gray.200\",\n    shadow: \"sm\",\n    mb: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.CardBody, {\n    p: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Flex, {\n    direction: {\n      base: \"column\",\n      md: \"row\"\n    },\n    gap: 3,\n    align: {\n      base: \"stretch\",\n      md: \"center\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Input, {\n    placeholder: \"Search logs...\",\n    value: searchTerm,\n    onChange: function onChange(e) {\n      setSearchTerm(e.target.value);\n      setPage(1);\n    },\n    maxW: {\n      base: \"full\",\n      md: \"250px\"\n    },\n    size: \"sm\",\n    borderRadius: \"lg\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Select, {\n    placeholder: \"All Features\",\n    value: selectedFeature,\n    onChange: function onChange(e) {\n      setSelectedFeature(e.target.value);\n      setPage(1);\n    },\n    maxW: {\n      base: \"full\",\n      md: \"180px\"\n    },\n    size: \"sm\",\n    borderRadius: \"lg\"\n  }, Object.entries(features).map(function (_ref6) {\n    var _ref7 = _slicedToArray(_ref6, 2),\n      key = _ref7[0],\n      label = _ref7[1];\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      key: key,\n      value: key\n    }, label);\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Select, {\n    placeholder: \"All Levels\",\n    value: selectedLevel,\n    onChange: function onChange(e) {\n      setSelectedLevel(e.target.value);\n      setPage(1);\n    },\n    maxW: {\n      base: \"full\",\n      md: \"150px\"\n    },\n    size: \"sm\",\n    borderRadius: \"lg\"\n  }, Object.entries(levels).map(function (_ref8) {\n    var _ref9 = _slicedToArray(_ref8, 2),\n      key = _ref9[0],\n      label = _ref9[1];\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      key: key,\n      value: key\n    }, label);\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Popover, {\n    placement: \"bottom-start\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.PopoverTrigger, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Icon, {\n      as: react_icons_fa__WEBPACK_IMPORTED_MODULE_38__.FaCalendar\n    }),\n    variant: \"outline\",\n    size: \"sm\",\n    borderRadius: \"lg\",\n    flexShrink: 0\n  }, dateRange.label ? dateRange.label : dateRange.startDate ? \"\".concat(dateRange.startDate.toLocaleDateString(), \" - \").concat(dateRange.endDate.toLocaleDateString()) : \"Select Dates\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.PopoverContent, {\n    w: \"auto\",\n    borderRadius: \"xl\",\n    shadow: \"2xl\",\n    border: \"none\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.PopoverArrow, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.PopoverCloseButton, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.PopoverBody, {\n    p: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_41__[\"default\"], {\n    initialRange: dateRange,\n    onChange: function onChange(range) {\n      setDateRange(range);\n      setPage(1);\n    }\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.HStack, {\n    ml: {\n      base: \"0\",\n      md: \"auto\"\n    },\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Tooltip, {\n    label: \"Refresh\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.IconButton, {\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiRefreshCw, null),\n    onClick: function onClick() {\n      return fetchLogs();\n    },\n    isLoading: loading,\n    variant: \"outline\",\n    size: \"sm\",\n    borderRadius: \"lg\",\n    \"aria-label\": \"Refresh\"\n  })), selectedRows.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiTrash2, null),\n    colorScheme: \"red\",\n    variant: \"outline\",\n    size: \"sm\",\n    borderRadius: \"lg\",\n    onClick: handleBulkDelete,\n    isLoading: isDeleting\n  }, \"Delete (\", selectedRows.length, \")\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiX, null),\n    colorScheme: \"gray\",\n    variant: \"outline\",\n    size: \"sm\",\n    borderRadius: \"lg\",\n    onClick: onClearOpen\n  }, \"Clear All\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Card, {\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"gray.200\",\n    shadow: \"sm\",\n    overflow: \"hidden\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.TableContainer, {\n    flex: \"1\",\n    overflowY: \"auto\",\n    className: \"shopcentral-scrollbar\",\n    maxH: \"65vh\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Table, {\n    variant: \"simple\",\n    size: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Thead, {\n    bg: \"gray.50\",\n    position: \"sticky\",\n    top: 0,\n    zIndex: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, {\n    width: \"40px\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"input\", {\n    type: \"checkbox\",\n    checked: selectedRows.length === logs.length && logs.length > 0,\n    ref: function ref(el) {\n      if (el) el.indeterminate = selectedRows.length > 0 && selectedRows.length < logs.length;\n    },\n    onChange: toggleSelectAll\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, {\n    width: \"50px\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, {\n    width: \"140px\"\n  }, \"Date/Time\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, {\n    width: \"120px\"\n  }, \"Feature\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, {\n    width: \"80px\"\n  }, \"Level\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, null, \"Message\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, {\n    width: \"100px\"\n  }, \"Actions\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Tbody, null, loading ? [1, 2, 3, 4, 5].map(function (i) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tr, {\n      key: i\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      colSpan: 7\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n      h: \"32px\",\n      bg: \"gray.50\",\n      borderRadius: \"md\"\n    })));\n  }) : logs.length === 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n    colSpan: 7,\n    textAlign: \"center\",\n    py: 10\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Flex, {\n    direction: \"column\",\n    align: \"center\",\n    gap: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiLayers,\n    w: 8,\n    h: 8,\n    color: \"gray.300\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Text, {\n    color: \"gray.400\",\n    fontWeight: \"500\"\n  }, \"No logs found\")))) : logs.map(function (log) {\n    var levelConf = LEVEL_CONFIG[log.level] || LEVEL_CONFIG.info;\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tr, {\n      key: log.id,\n      _hover: {\n        bg: \"gray.50\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"input\", {\n      type: \"checkbox\",\n      checked: selectedRows.includes(log.id),\n      onChange: function onChange() {\n        return toggleSelectRow(log.id);\n      }\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      textAlign: \"center\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Text, {\n      fontSize: \"sm\"\n    }, FEATURE_ICONS[log.feature] || \"📋\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      fontSize: \"xs\",\n      color: \"gray.600\",\n      whiteSpace: \"nowrap\"\n    }, formatDate(log.created_at)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n      fontSize: \"2xs\",\n      colorScheme: \"gray\",\n      borderRadius: \"full\",\n      px: 2\n    }, features[log.feature] || log.feature)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n      fontSize: \"2xs\",\n      colorScheme: levelConf.color,\n      variant: \"subtle\",\n      borderRadius: \"full\",\n      px: 2\n    }, log.level)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      fontSize: \"xs\",\n      maxW: \"400px\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Text, {\n      noOfLines: 2\n    }, log.message)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.HStack, {\n      spacing: 1\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Tooltip, {\n      label: \"View log details\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.IconButton, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiEye, null),\n      size: \"xs\",\n      variant: \"ghost\",\n      borderRadius: \"md\",\n      onClick: function onClick() {\n        return handleViewLog(log);\n      },\n      \"aria-label\": \"View\",\n      colorScheme: \"blue\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Tooltip, {\n      label: \"Copy log\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.IconButton, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiCopy, null),\n      size: \"xs\",\n      variant: \"ghost\",\n      borderRadius: \"md\",\n      onClick: function onClick() {\n        return handleCopyLog(log);\n      },\n      \"aria-label\": \"Copy\"\n    })))));\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Flex, {\n    p: 3,\n    justify: \"space-between\",\n    align: \"center\",\n    bg: \"white\",\n    borderTop: \"1px\",\n    borderColor: \"gray.100\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.500\"\n  }, \"Showing \", logs.length > 0 ? (page - 1) * perPage + 1 : 0, \"\\u2013\", Math.min(page * perPage, totalRows), \" of \", totalRows), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.HStack, {\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    size: \"xs\",\n    isDisabled: page === 1,\n    onClick: function onClick() {\n      return setPage(function (p) {\n        return p - 1;\n      });\n    },\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiChevronLeft, null)\n  }, \"Prev\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.500\"\n  }, page, \" / \", totalPages || 1), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    size: \"xs\",\n    isDisabled: page >= totalPages,\n    onClick: function onClick() {\n      return setPage(function (p) {\n        return p + 1;\n      });\n    },\n    rightIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_37__.FiChevronRight, null)\n  }, \"Next\")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(LogDetailModal, {\n    log: selectedLog,\n    isOpen: isDetailOpen,\n    onClose: onDetailClose,\n    featureLabels: features\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_42__[\"default\"], {\n    isOpen: isClearOpen,\n    onClose: onClearClose,\n    onConfirm: handleClearAll,\n    title: \"Clear All Logs\",\n    description: \"Are you sure you want to permanently delete all logs? This cannot be undone.\",\n    confirmLabel: \"Clear All\",\n    loading: isDeleting\n  }));\n};\nvar Heading = function Heading(_ref0) {\n  var children = _ref0.children,\n    size = _ref0.size,\n    fontWeight = _ref0.fontWeight,\n    mb = _ref0.mb;\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Text, {\n    as: \"h1\",\n    fontSize: size,\n    fontWeight: fontWeight,\n    mb: mb,\n    lineHeight: \"tight\"\n  }, children);\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LogsPage);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Logs/LogsPage.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Marketing/GlobalCoupon.jsx"
/*!***********************************************************!*\
  !*** ./src/Pages/StoreManager/Marketing/GlobalCoupon.jsx ***!
  \***********************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/hooks/dist/esm/use-disclosure.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/alert/alert.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/alert/alert-icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/container/container.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/divider/divider.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-control.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-error.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-label.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/grid.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input-group.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input-element.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/select/select.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/switch/switch.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tbody.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/td.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/th.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/thead.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tr.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/textarea/textarea.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/heading.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router/dist/development/chunk-EPOLDU6W.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! react-hot-toast */ \"./node_modules/react-hot-toast/dist/index.mjs\");\n/* harmony import */ var _Components_shared_ProFeatureModal__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../../../Components/shared/ProFeatureModal */ \"./src/Components/shared/ProFeatureModal.jsx\");\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 _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\n\n\n\nvar GlobalCoupon = function GlobalCoupon() {\n  var _window$shopCentralDa;\n  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_34__.useNavigate)();\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState2 = _slicedToArray(_useState, 2),\n    isLoading = _useState2[0],\n    setIsLoading = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState4 = _slicedToArray(_useState3, 2),\n    results = _useState4[0],\n    setResults = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState6 = _slicedToArray(_useState5, 2),\n    isSubmitted = _useState6[0],\n    setIsSubmitted = _useState6[1];\n  var _useDisclosure = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.useDisclosure)(),\n    isProModalOpen = _useDisclosure.isOpen,\n    onProModalOpen = _useDisclosure.onOpen,\n    onProModalClose = _useDisclosure.onClose;\n  var isPro = (_window$shopCentralDa = window.shopCentralData) === null || _window$shopCentralDa === void 0 ? void 0 : _window$shopCentralDa.isPro;\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({\n      code: \"\",\n      description: \"\",\n      discount_type: \"fixed_cart\",\n      amount: \"\",\n      date_expires: \"\",\n      minimum_amount: \"\",\n      maximum_amount: \"\",\n      usage_limit: \"\",\n      usage_limit_per_user: \"\",\n      individual_use: false,\n      free_shipping: false,\n      exclude_sale_items: false\n    }),\n    _useState8 = _slicedToArray(_useState7, 2),\n    formData = _useState8[0],\n    setFormData = _useState8[1];\n  var handleChange = function handleChange(e) {\n    var _e$target = e.target,\n      name = _e$target.name,\n      value = _e$target.value,\n      type = _e$target.type,\n      checked = _e$target.checked;\n    setFormData(function (prev) {\n      return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, name, type === 'checkbox' ? checked : value));\n    });\n  };\n  var handleGenerateCode = function handleGenerateCode() {\n    var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n    var result = '';\n    for (var i = 0; i < 10; i++) {\n      result += characters.charAt(Math.floor(Math.random() * characters.length));\n    }\n    setFormData(function (prev) {\n      return _objectSpread(_objectSpread({}, prev), {}, {\n        code: result\n      });\n    });\n    react_hot_toast__WEBPACK_IMPORTED_MODULE_36__[\"default\"].success(\"Random code generated!\");\n  };\n  var handleSubmit = /*#__PURE__*/function () {\n    var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n      var _res$data, res, _error$response, _t;\n      return _regenerator().w(function (_context) {\n        while (1) switch (_context.p = _context.n) {\n          case 0:\n            setIsSubmitted(true);\n            if (formData.code) {\n              _context.n = 1;\n              break;\n            }\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_36__[\"default\"].error(\"Coupon code is required\");\n            return _context.a(2);\n          case 1:\n            if (!(!formData.amount || parseFloat(formData.amount) <= 0)) {\n              _context.n = 2;\n              break;\n            }\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_36__[\"default\"].error(\"A valid discount amount is required\");\n            return _context.a(2);\n          case 2:\n            setIsLoading(true);\n            setResults([]);\n            _context.p = 3;\n            _context.n = 4;\n            return axios__WEBPACK_IMPORTED_MODULE_35__[\"default\"].post(\"/api/store-manager/marketing/global-coupon\", formData);\n          case 4:\n            res = _context.v;\n            if ((_res$data = res.data) !== null && _res$data !== void 0 && _res$data.results) {\n              setResults(res.data.results);\n              react_hot_toast__WEBPACK_IMPORTED_MODULE_36__[\"default\"].success(\"Push completed!\");\n            }\n            _context.n = 6;\n            break;\n          case 5:\n            _context.p = 5;\n            _t = _context.v;\n            console.error(_t);\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_36__[\"default\"].error(((_error$response = _t.response) === null || _error$response === void 0 || (_error$response = _error$response.data) === null || _error$response === void 0 ? void 0 : _error$response.message) || \"Failed to trigger global global coupon generator\");\n          case 6:\n            _context.p = 6;\n            setIsLoading(false);\n            return _context.f(6);\n          case 7:\n            return _context.a(2);\n        }\n      }, _callee, null, [[3, 5, 6, 7]]);\n    }));\n    return function handleSubmit() {\n      return _ref.apply(this, arguments);\n    };\n  }();\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Container, {\n    maxW: \"container.xl\",\n    py: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    direction: {\n      base: \"column\",\n      md: \"row\"\n    },\n    justify: \"space-between\",\n    align: {\n      base: \"start\",\n      md: \"center\"\n    },\n    mb: 6,\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.HStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Heading, {\n    size: \"lg\"\n  }, \"Global Coupon\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Button, {\n    leftIcon: isPro ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiSend, null) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiLock, null),\n    colorScheme: \"purple\",\n    variant: \"solid\",\n    size: \"lg\",\n    isLoading: isLoading,\n    onClick: isPro ? handleSubmit : onProModalOpen,\n    loadingText: \"Synchronizing...\",\n    cursor: \"pointer\"\n  }, \"Create coupon for All Stores\")), results.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Card, {\n    bg: \"white\",\n    shadow: \"sm\",\n    mb: 6,\n    border: \"1px solid\",\n    borderColor: \"green.200\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Heading, {\n    size: \"md\",\n    mb: 4\n  }, \"Broadcast Results\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Table, {\n    variant: \"simple\",\n    size: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Thead, {\n    bg: \"gray.50\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Th, null, \"Network Store\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Th, null, \"Status\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Th, null, \"Message\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Tbody, null, results.map(function (r, idx) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Tr, {\n      key: idx\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Td, {\n      fontWeight: \"bold\"\n    }, r.store_name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Td, null, r.status === 'success' ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Badge, {\n      colorScheme: \"green\",\n      display: \"flex\",\n      alignItems: \"center\",\n      w: \"fit-content\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiCheckCircle,\n      mr: 1\n    }), \" Success\") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Badge, {\n      colorScheme: \"red\",\n      display: \"flex\",\n      alignItems: \"center\",\n      w: \"fit-content\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiXCircle,\n      mr: 1\n    }), \" Error\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Td, null, r.message));\n  }))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Grid, {\n    templateColumns: {\n      base: \"1fr\",\n      lg: \"2fr 1fr\"\n    },\n    gap: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.VStack, {\n    spacing: 6,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Alert, {\n    status: \"info\",\n    borderRadius: \"md\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.AlertIcon, null), \"This will instantly generate and activate a coupon code across all stores connected to your ShopCentral simultaneously.\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Card, {\n    variant: \"outline\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.VStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormControl, {\n    isRequired: true,\n    isInvalid: isSubmitted && !formData.code\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.FormLabel, null, \"Global Coupon Code\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.InputGroup, {\n    size: \"lg\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Input, {\n    name: \"code\",\n    value: formData.code,\n    onChange: handleChange,\n    placeholder: \"e.g. BLACKFRIDAY10\",\n    fontWeight: \"bold\",\n    textTransform: \"uppercase\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.InputRightElement, {\n    width: \"auto\",\n    pr: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Button, {\n    size: \"sm\",\n    onClick: handleGenerateCode,\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiRefreshCw, null)\n  }, \"Generate\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.FormErrorMessage, null, \"Coupon code is required.\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.FormLabel, null, \"Description (Internal)\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Textarea, {\n    name: \"description\",\n    value: formData.description,\n    onChange: handleChange,\n    placeholder: \"Description for internal tracking...\"\n  }))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Card, {\n    variant: \"outline\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Heading, {\n    size: \"md\",\n    mb: 4\n  }, \"Coupon Value Setup\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Grid, {\n    templateColumns: {\n      base: \"1fr\",\n      md: \"1fr 1fr\"\n    },\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormControl, {\n    isRequired: true,\n    isInvalid: isSubmitted && !formData.discount_type\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.FormLabel, null, \"Discount Type\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Select, {\n    name: \"discount_type\",\n    value: formData.discount_type,\n    onChange: handleChange\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"percent\"\n  }, \"Percentage discount\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"fixed_cart\"\n  }, \"Fixed cart discount\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"fixed_product\"\n  }, \"Fixed product discount\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormControl, {\n    isRequired: true,\n    isInvalid: isSubmitted && (!formData.amount || parseFloat(formData.amount) <= 0)\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.FormLabel, null, \"Global Discount Amount\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Input, {\n    name: \"amount\",\n    type: \"number\",\n    value: formData.amount,\n    onChange: handleChange,\n    placeholder: \"e.g. 10\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.FormErrorMessage, null, \"Valid discount amount is required.\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.FormLabel, null, \"Expiry Date\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Input, {\n    name: \"date_expires\",\n    type: \"date\",\n    value: formData.date_expires,\n    onChange: handleChange\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Divider, {\n    my: 6\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.VStack, {\n    align: \"stretch\",\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    justify: \"space-between\",\n    align: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Text, {\n    fontWeight: \"600\"\n  }, \"Free Shipping\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.500\"\n  }, \"Allow free shipping across all network boundaries if this coupon is used\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Switch, {\n    name: \"free_shipping\",\n    isChecked: formData.free_shipping,\n    onChange: handleChange\n  })))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.VStack, {\n    spacing: 6,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Card, {\n    variant: \"outline\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Heading, {\n    size: \"md\",\n    mb: 4\n  }, \"Cart Requirements\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.VStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.FormLabel, null, \"Minimum Spend Limits\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Input, {\n    name: \"minimum_amount\",\n    type: \"number\",\n    value: formData.minimum_amount,\n    onChange: handleChange,\n    placeholder: \"No minimum\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.FormLabel, null, \"Maximum Spend\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Input, {\n    name: \"maximum_amount\",\n    type: \"number\",\n    value: formData.maximum_amount,\n    onChange: handleChange,\n    placeholder: \"No maximum\"\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Divider, {\n    my: 4\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.VStack, {\n    spacing: 4,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    justify: \"space-between\",\n    align: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Text, {\n    fontWeight: \"600\"\n  }, \"Individual Use\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.500\"\n  }, \"Block combination w/ other coupons\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Switch, {\n    size: \"sm\",\n    name: \"individual_use\",\n    isChecked: formData.individual_use,\n    onChange: handleChange\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    justify: \"space-between\",\n    align: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Text, {\n    fontWeight: \"600\"\n  }, \"Exclude Sale Items\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.500\"\n  }, \"Do not apply to products already discounted\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Switch, {\n    size: \"sm\",\n    name: \"exclude_sale_items\",\n    isChecked: formData.exclude_sale_items,\n    onChange: handleChange\n  }))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Card, {\n    variant: \"outline\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Heading, {\n    size: \"md\",\n    mb: 4\n  }, \"Usage Throttling\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.VStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.FormLabel, null, \"Limit Per Coupon\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Input, {\n    name: \"usage_limit\",\n    type: \"number\",\n    value: formData.usage_limit,\n    onChange: handleChange,\n    placeholder: \"Unlimited globally\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.FormLabel, null, \"Limit Per User\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Input, {\n    name: \"usage_limit_per_user\",\n    type: \"number\",\n    value: formData.usage_limit_per_user,\n    onChange: handleChange,\n    placeholder: \"Unlimited\"\n  }))))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ProFeatureModal__WEBPACK_IMPORTED_MODULE_37__[\"default\"], {\n    isOpen: isProModalOpen,\n    onClose: onProModalClose,\n    title: \"Global Coupon Broadcasting (Pro)\",\n    what: \"A network-wide coupon generator and marketing distributor that enables you to create and manage WooCommerce discount codes across multiple stores at once.\",\n    how: \"Configure your coupon rules (percentage discount, fixed cart discount, usage limits, and expiration dates) and push them instantly to all selected child stores.\",\n    why: \"Launch multi-store holiday sales, influencer campaigns, and cross-promotions without manually recreating identical discount codes on each individual website.\"\n  }));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (GlobalCoupon);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Marketing/GlobalCoupon.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Orders/OrderList.jsx"
/*!*****************************************************!*\
  !*** ./src/Pages/StoreManager/Orders/OrderList.jsx ***!
  \*****************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _utils_exportUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../utils/exportUtils */ \"./src/utils/exportUtils.js\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/hooks/dist/esm/use-disclosure.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/icon-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/checkbox/checkbox.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/checkbox/checkbox-group.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-control.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-label.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/simple-grid.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input-group.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input-element.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/menu/menu.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/menu/menu-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/menu/menu-item.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/menu/menu-list.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-footer.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-header.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-overlay.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-arrow.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-trigger.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/progress/progress.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/select/select.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/skeleton/skeleton.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table-container.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tbody.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/td.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/th.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/thead.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tr.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/toast/use-toast.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/heading.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router/dist/development/chunk-EPOLDU6W.mjs\");\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! lodash.debounce */ \"./node_modules/lodash.debounce/index.js\");\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_52___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_52__);\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var react_icons_fa__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! react-icons/fa */ \"./node_modules/react-icons/fa/index.mjs\");\n/* harmony import */ var _Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ../../../Components/shared/DatePicker */ \"./src/Components/shared/DatePicker.jsx\");\n/* harmony import */ var _Components_shared_ProFeatureModal__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ../../../Components/shared/ProFeatureModal */ \"./src/Components/shared/ProFeatureModal.jsx\");\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 _regeneratorValues(e) { if (null != e) { var t = e[\"function\" == typeof Symbol && Symbol.iterator || \"@@iterator\"], r = 0; if (t) return t.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + \" is not iterable\"); }\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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 _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\n\n\n\n\n\n\nvar SYNC_LIMIT_OPTIONS = [50, 100, 500, 1000, 5000];\nvar OrderList = function OrderList() {\n  var _window$shopCentralDa, _stores$find, _syncResult$errors;\n  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_51__.useNavigate)();\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState2 = _slicedToArray(_useState, 2),\n    orders = _useState2[0],\n    setOrders = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),\n    _useState4 = _slicedToArray(_useState3, 2),\n    loading = _useState4[0],\n    setLoading = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState6 = _slicedToArray(_useState5, 2),\n    stores = _useState6[0],\n    setStores = _useState6[1];\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"all\"),\n    _useState8 = _slicedToArray(_useState7, 2),\n    selectedStore = _useState8[0],\n    setSelectedStore = _useState8[1];\n  var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0),\n    _useState0 = _slicedToArray(_useState9, 2),\n    totalRows = _useState0[0],\n    setTotalRows = _useState0[1];\n  var _useState1 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"\"),\n    _useState10 = _slicedToArray(_useState1, 2),\n    searchTerm = _useState10[0],\n    setSearchTerm = _useState10[1];\n  var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"any\"),\n    _useState12 = _slicedToArray(_useState11, 2),\n    status = _useState12[0],\n    setStatus = _useState12[1];\n  var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState14 = _slicedToArray(_useState13, 2),\n    selectedRows = _useState14[0],\n    setSelectedRows = _useState14[1];\n  var toast = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_47__.useToast)();\n  var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_55__.getAllTimeRange)()),\n    _useState16 = _slicedToArray(_useState15, 2),\n    dateRange = _useState16[0],\n    setDateRange = _useState16[1];\n  var _useState17 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1),\n    _useState18 = _slicedToArray(_useState17, 2),\n    currentPage = _useState18[0],\n    setCurrentPage = _useState18[1];\n  var _useState19 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(10),\n    _useState20 = _slicedToArray(_useState19, 2),\n    perPage = _useState20[0],\n    setPerPage = _useState20[1];\n  var _useState21 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1),\n    _useState22 = _slicedToArray(_useState21, 2),\n    totalPages = _useState22[0],\n    setTotalPages = _useState22[1];\n  var _useState23 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState24 = _slicedToArray(_useState23, 2),\n    isSyncing = _useState24[0],\n    setIsSyncing = _useState24[1];\n  var _useState25 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState26 = _slicedToArray(_useState25, 2),\n    syncResult = _useState26[0],\n    setSyncResult = _useState26[1];\n  var _useState27 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({\n      current: 0,\n      total: 0\n    }),\n    _useState28 = _slicedToArray(_useState27, 2),\n    syncProgress = _useState28[0],\n    setSyncProgress = _useState28[1];\n  var _useState29 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(100),\n    _useState30 = _slicedToArray(_useState29, 2),\n    syncLimit = _useState30[0],\n    setSyncLimit = _useState30[1];\n  var _useState31 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState32 = _slicedToArray(_useState31, 2),\n    importStores = _useState32[0],\n    setImportStores = _useState32[1];\n  var _useState33 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState34 = _slicedToArray(_useState33, 2),\n    selectAllStores = _useState34[0],\n    setSelectAllStores = _useState34[1];\n  var _useState35 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState36 = _slicedToArray(_useState35, 2),\n    currentSyncingStore = _useState36[0],\n    setCurrentSyncingStore = _useState36[1];\n  var _useState37 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState38 = _slicedToArray(_useState37, 2),\n    storeResults = _useState38[0],\n    setStoreResults = _useState38[1];\n  var _useDisclosure = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.useDisclosure)(),\n    isModalOpen = _useDisclosure.isOpen,\n    openModal = _useDisclosure.onOpen,\n    closeModal = _useDisclosure.onClose;\n  var _useDisclosure2 = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.useDisclosure)(),\n    isProModalOpen = _useDisclosure2.isOpen,\n    onProModalOpen = _useDisclosure2.onOpen,\n    onProModalClose = _useDisclosure2.onClose;\n  var isPro = (_window$shopCentralDa = window.shopCentralData) === null || _window$shopCentralDa === void 0 ? void 0 : _window$shopCentralDa.isPro;\n  var toggleSelectRow = function toggleSelectRow(order) {\n    setSelectedRows(function (prev) {\n      var exists = prev.find(function (r) {\n        return r.id === order.id && r.source_store_id === order.source_store_id;\n      });\n      if (exists) {\n        return prev.filter(function (r) {\n          return !(r.id === order.id && r.source_store_id === order.source_store_id);\n        });\n      } else {\n        return [].concat(_toConsumableArray(prev), [{\n          id: order.id,\n          source_store_id: order.source_store_id\n        }]);\n      }\n    });\n  };\n  var toggleSelectAll = function toggleSelectAll() {\n    if (selectedRows.length === displayOrders.length && displayOrders.length > 0) {\n      setSelectedRows([]);\n    } else {\n      setSelectedRows(displayOrders.map(function (o) {\n        return {\n          id: o.id,\n          source_store_id: o.source_store_id\n        };\n      }));\n    }\n  };\n  var handleBulkStatusChange = /*#__PURE__*/function () {\n    var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(newStatus) {\n      var updates, _t;\n      return _regenerator().w(function (_context) {\n        while (1) switch (_context.p = _context.n) {\n          case 0:\n            if (!(selectedRows.length === 0)) {\n              _context.n = 1;\n              break;\n            }\n            return _context.a(2);\n          case 1:\n            updates = selectedRows.map(function (row) {\n              return {\n                store_id: row.source_store_id,\n                order_id: row.id,\n                status: newStatus\n              };\n            });\n            _context.p = 2;\n            toast({\n              title: \"Updating \".concat(updates.length, \" orders...\"),\n              status: \"info\",\n              duration: 2000\n            });\n            _context.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_50__[\"default\"].post(\"/api/store-manager/bulk-order-status\", {\n              updates: updates\n            });\n          case 3:\n            toast({\n              title: \"Orders updated successfully\",\n              status: \"success\",\n              duration: 3000\n            });\n            setSelectedRows([]);\n            fetchTimelineOrders();\n            _context.n = 5;\n            break;\n          case 4:\n            _context.p = 4;\n            _t = _context.v;\n            toast({\n              title: \"Failed to update orders\",\n              status: \"error\",\n              duration: 3000\n            });\n          case 5:\n            return _context.a(2);\n        }\n      }, _callee, null, [[2, 4]]);\n    }));\n    return function handleBulkStatusChange(_x) {\n      return _ref.apply(this, arguments);\n    };\n  }();\n  var handleClickSyncButton = function handleClickSyncButton() {\n    var childStores = stores.filter(function (s) {\n      return s.is_current != 1;\n    });\n    if (childStores.length === 0) {\n      toast({\n        title: \"No connected child stores found\",\n        description: \"Add a child store first from the Stores page.\",\n        status: \"info\",\n        duration: 4000\n      });\n      return;\n    }\n    setImportStores([]);\n    setSelectAllStores(false);\n    setCurrentSyncingStore(null);\n    setStoreResults([]);\n    setSyncLimit(100);\n    setSyncResult(null);\n    setSyncProgress({\n      current: 0,\n      total: 0\n    });\n    openModal();\n  };\n  var handleSelectAllStores = function handleSelectAllStores() {\n    if (selectAllStores) {\n      setImportStores([]);\n      setSelectAllStores(false);\n    } else {\n      var childStores = stores.filter(function (s) {\n        return s.is_current != 1;\n      });\n      setImportStores(childStores.map(function (s) {\n        return s.id.toString();\n      }));\n      setSelectAllStores(true);\n    }\n  };\n  var handleStoreSelect = function handleStoreSelect(values) {\n    setImportStores(values);\n    var childStores = stores.filter(function (s) {\n      return s.is_current != 1;\n    });\n    setSelectAllStores(values.length === childStores.length);\n  };\n  var handleConfirmSync = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {\n      var totalSynced, totalSkipped, totalFailed, allErrors, _loop, i;\n      return _regenerator().w(function (_context3) {\n        while (1) switch (_context3.n) {\n          case 0:\n            if (!(importStores.length === 0)) {\n              _context3.n = 1;\n              break;\n            }\n            toast({\n              title: \"Please select at least one store\",\n              status: \"warning\",\n              duration: 3000\n            });\n            return _context3.a(2);\n          case 1:\n            setIsSyncing(true);\n            setSyncResult(null);\n            setStoreResults([]);\n            setSyncProgress({\n              current: 0,\n              total: syncLimit\n            });\n            totalSynced = 0;\n            totalSkipped = 0;\n            totalFailed = 0;\n            allErrors = []; // Sequential import: one store at a time\n            _loop = /*#__PURE__*/_regenerator().m(function _loop() {\n              var storeId, storeData, payload, result, _error$response, msg, _t2;\n              return _regenerator().w(function (_context2) {\n                while (1) switch (_context2.p = _context2.n) {\n                  case 0:\n                    storeId = parseInt(importStores[i], 10);\n                    storeData = stores.find(function (s) {\n                      return parseInt(s.id, 10) === storeId;\n                    });\n                    setCurrentSyncingStore(storeData);\n                    _context2.p = 1;\n                    payload = {\n                      store_id: storeId,\n                      after: dateRange !== null && dateRange !== void 0 && dateRange.startDate ? dateRange.startDate.toISOString().split('.')[0] + 'Z' : undefined,\n                      before: dateRange !== null && dateRange !== void 0 && dateRange.endDate ? dateRange.endDate.toISOString().split('.')[0] + 'Z' : undefined,\n                      status: status,\n                      limit: syncLimit\n                    };\n                    _context2.n = 2;\n                    return axios__WEBPACK_IMPORTED_MODULE_50__[\"default\"].post(\"/api/store-manager/sync-orders\", payload);\n                  case 2:\n                    startProgressPolling(storeId, storeData, i + 1, importStores.length);\n\n                    // Wait for this store's sync to complete before moving to next\n                    _context2.n = 3;\n                    return waitForSyncComplete(storeId);\n                  case 3:\n                    result = _context2.v;\n                    if (result) {\n                      totalSynced += result.synced || 0;\n                      totalSkipped += result.skipped_exists || 0;\n                      totalFailed += result.failed || 0;\n                      if (result.errors) allErrors = [].concat(_toConsumableArray(allErrors), _toConsumableArray(result.errors));\n                    }\n                    setStoreResults(function (prev) {\n                      return [].concat(_toConsumableArray(prev), [{\n                        store: storeData.name,\n                        status: 'completed'\n                      }]);\n                    });\n                    _context2.n = 5;\n                    break;\n                  case 4:\n                    _context2.p = 4;\n                    _t2 = _context2.v;\n                    msg = ((_error$response = _t2.response) === null || _error$response === void 0 || (_error$response = _error$response.data) === null || _error$response === void 0 ? void 0 : _error$response.message) || \"Failed to sync orders\";\n                    setStoreResults(function (prev) {\n                      return [].concat(_toConsumableArray(prev), [{\n                        store: storeData.name,\n                        status: 'failed',\n                        message: msg\n                      }]);\n                    });\n                    totalFailed += syncLimit; // Assume limit failed if request crashed\n                  case 5:\n                    return _context2.a(2);\n                }\n              }, _loop, null, [[1, 4]]);\n            });\n            i = 0;\n          case 2:\n            if (!(i < importStores.length)) {\n              _context3.n = 4;\n              break;\n            }\n            return _context3.d(_regeneratorValues(_loop()), 3);\n          case 3:\n            i++;\n            _context3.n = 2;\n            break;\n          case 4:\n            setIsSyncing(false);\n            setCurrentSyncingStore(null);\n            setSyncResult({\n              status: 'completed',\n              synced: totalSynced,\n              skipped_exists: totalSkipped,\n              failed: totalFailed,\n              errors: allErrors,\n              message: \"Successfully processed orders from \".concat(importStores.length, \" stores.\")\n            });\n            fetchTimelineOrders();\n            toast({\n              title: \"Import completed from \".concat(importStores.length, \" store\").concat(importStores.length > 1 ? 's' : ''),\n              status: \"success\",\n              duration: 4000\n            });\n          case 5:\n            return _context3.a(2);\n        }\n      }, _callee2);\n    }));\n    return function handleConfirmSync() {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  var waitForSyncComplete = function waitForSyncComplete(storeId) {\n    return new Promise(function (resolve) {\n      var _poll = /*#__PURE__*/function () {\n        var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {\n          var _yield$axios$get, data, _t3;\n          return _regenerator().w(function (_context4) {\n            while (1) switch (_context4.p = _context4.n) {\n              case 0:\n                _context4.p = 0;\n                _context4.n = 1;\n                return axios__WEBPACK_IMPORTED_MODULE_50__[\"default\"].get(\"/api/store-manager/sync-orders/progress/\".concat(storeId));\n              case 1:\n                _yield$axios$get = _context4.v;\n                data = _yield$axios$get.data;\n                if (!(data && (data.status === 'completed' || data.status === 'cancelled' || data.status === 'error'))) {\n                  _context4.n = 2;\n                  break;\n                }\n                resolve(data);\n                return _context4.a(2);\n              case 2:\n                _context4.n = 4;\n                break;\n              case 3:\n                _context4.p = 3;\n                _t3 = _context4.v;\n              case 4:\n                setTimeout(_poll, 2000);\n              case 5:\n                return _context4.a(2);\n            }\n          }, _callee3, null, [[0, 3]]);\n        }));\n        return function poll() {\n          return _ref3.apply(this, arguments);\n        };\n      }();\n      setTimeout(_poll, 1000);\n    });\n  };\n  var startProgressPolling = function startProgressPolling(storeId, storeData, currentIdx, totalStores) {\n    var _poll2 = /*#__PURE__*/function () {\n      var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {\n        var _yield$axios$get2, data, _data$processed, _data$total, _t4;\n        return _regenerator().w(function (_context5) {\n          while (1) switch (_context5.p = _context5.n) {\n            case 0:\n              _context5.p = 0;\n              _context5.n = 1;\n              return axios__WEBPACK_IMPORTED_MODULE_50__[\"default\"].get(\"/api/store-manager/sync-orders/progress/\".concat(storeId));\n            case 1:\n              _yield$axios$get2 = _context5.v;\n              data = _yield$axios$get2.data;\n              if (!data) {\n                _context5.n = 2;\n                break;\n              }\n              setSyncProgress({\n                current: (_data$processed = data.processed) !== null && _data$processed !== void 0 ? _data$processed : 0,\n                total: (_data$total = data.total) !== null && _data$total !== void 0 ? _data$total : syncLimit\n              });\n              if (!(data.status === 'completed' || data.status === 'cancelled' || data.status === 'error')) {\n                _context5.n = 2;\n                break;\n              }\n              return _context5.a(2);\n            case 2:\n              _context5.n = 4;\n              break;\n            case 3:\n              _context5.p = 3;\n              _t4 = _context5.v;\n            case 4:\n              setTimeout(_poll2, 2000);\n            case 5:\n              return _context5.a(2);\n          }\n        }, _callee4, null, [[0, 3]]);\n      }));\n      return function poll() {\n        return _ref4.apply(this, arguments);\n      };\n    }();\n    setTimeout(_poll2, 1000);\n  };\n  var handleCancelSync = /*#__PURE__*/function () {\n    var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {\n      var _t5;\n      return _regenerator().w(function (_context6) {\n        while (1) switch (_context6.p = _context6.n) {\n          case 0:\n            if (currentSyncingStore) {\n              _context6.n = 1;\n              break;\n            }\n            return _context6.a(2);\n          case 1:\n            _context6.p = 1;\n            _context6.n = 2;\n            return axios__WEBPACK_IMPORTED_MODULE_50__[\"default\"].post(\"/api/store-manager/sync-orders/cancel\", {\n              store_id: parseInt(currentSyncingStore.id)\n            });\n          case 2:\n            toast({\n              title: \"Cancelling...\",\n              description: \"Sync will stop after the current batch.\",\n              status: \"info\",\n              duration: 3000\n            });\n            _context6.n = 4;\n            break;\n          case 3:\n            _context6.p = 3;\n            _t5 = _context6.v;\n            toast({\n              title: \"Failed to cancel\",\n              status: \"error\",\n              duration: 3000\n            });\n          case 4:\n            return _context6.a(2);\n        }\n      }, _callee5, null, [[1, 3]]);\n    }));\n    return function handleCancelSync() {\n      return _ref5.apply(this, arguments);\n    };\n  }();\n  var handleCloseModal = function handleCloseModal() {\n    if (syncResult && (syncResult.status === 'completed' || syncResult.status === 'cancelled' || syncResult.status === 'error')) {\n      closeModal();\n      fetchTimelineOrders();\n    } else if (!isSyncing) {\n      closeModal();\n    }\n    setImportStores([]);\n    setSelectAllStores(false);\n    setCurrentSyncingStore(null);\n    setStoreResults([]);\n  };\n  var fetchStores = /*#__PURE__*/function () {\n    var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {\n      var _res$data, res, _t6;\n      return _regenerator().w(function (_context7) {\n        while (1) switch (_context7.p = _context7.n) {\n          case 0:\n            _context7.p = 0;\n            _context7.n = 1;\n            return axios__WEBPACK_IMPORTED_MODULE_50__[\"default\"].get(\"/api/stores\");\n          case 1:\n            res = _context7.v;\n            setStores(((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.stores) || []);\n            _context7.n = 3;\n            break;\n          case 2:\n            _context7.p = 2;\n            _t6 = _context7.v;\n            console.error(\"Failed to load stores\");\n          case 3:\n            return _context7.a(2);\n        }\n      }, _callee6, null, [[0, 2]]);\n    }));\n    return function fetchStores() {\n      return _ref6.apply(this, arguments);\n    };\n  }();\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    fetchStores();\n  }, []);\n  var fetchTimelineOrders = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {\n    var params, response, data, _t7;\n    return _regenerator().w(function (_context8) {\n      while (1) switch (_context8.p = _context8.n) {\n        case 0:\n          _context8.p = 0;\n          setLoading(true);\n          params = {\n            store_id: selectedStore,\n            status: status,\n            after: dateRange !== null && dateRange !== void 0 && dateRange.startDate ? dateRange.startDate.toISOString().split('.')[0] + 'Z' : undefined,\n            before: dateRange !== null && dateRange !== void 0 && dateRange.endDate ? dateRange.endDate.toISOString().split('.')[0] + 'Z' : undefined,\n            page: currentPage,\n            per_page: perPage\n          };\n          _context8.n = 1;\n          return axios__WEBPACK_IMPORTED_MODULE_50__[\"default\"].get(\"/api/store-manager/all-orders\", {\n            params: params\n          });\n        case 1:\n          response = _context8.v;\n          data = response === null || response === void 0 ? void 0 : response.data;\n          setOrders(Array.isArray(data === null || data === void 0 ? void 0 : data.data) ? data.data : []);\n          setTotalRows((data === null || data === void 0 ? void 0 : data.total) || 0);\n          setTotalPages((data === null || data === void 0 ? void 0 : data.total_pages) || 1);\n          _context8.n = 3;\n          break;\n        case 2:\n          _context8.p = 2;\n          _t7 = _context8.v;\n          console.error(\"Failed to fetch timeline orders\", _t7);\n        case 3:\n          _context8.p = 3;\n          setLoading(false);\n          return _context8.f(3);\n        case 4:\n          return _context8.a(2);\n      }\n    }, _callee7, null, [[0, 2, 3, 4]]);\n  })), [dateRange, selectedStore, status, currentPage, perPage]);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    setCurrentPage(1);\n  }, [selectedStore, status, dateRange, perPage]);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    fetchTimelineOrders();\n  }, [fetchTimelineOrders]);\n  var isRowSelected = function isRowSelected(order) {\n    return selectedRows.some(function (r) {\n      return r.id === order.id && r.source_store_id === order.source_store_id;\n    });\n  };\n  var displayOrders = react__WEBPACK_IMPORTED_MODULE_0___default().useMemo(function () {\n    if (!searchTerm) return orders;\n    var lowerVal = searchTerm.toLowerCase();\n    return orders.filter(function (o) {\n      var _o$id, _o$billing, _o$billing2, _o$billing3;\n      return ((_o$id = o.id) === null || _o$id === void 0 ? void 0 : _o$id.toString().includes(lowerVal)) || (((_o$billing = o.billing) === null || _o$billing === void 0 ? void 0 : _o$billing.first_name) || '').toLowerCase().includes(lowerVal) || (((_o$billing2 = o.billing) === null || _o$billing2 === void 0 ? void 0 : _o$billing2.last_name) || '').toLowerCase().includes(lowerVal) || (((_o$billing3 = o.billing) === null || _o$billing3 === void 0 ? void 0 : _o$billing3.email) || '').toLowerCase().includes(lowerVal);\n    });\n  }, [orders, searchTerm]);\n  var getStatusColor = function getStatusColor(status) {\n    var statusColors = {\n      completed: \"green\",\n      processing: \"blue\",\n      \"on-hold\": \"yellow\",\n      pending: \"orange\",\n      cancelled: \"red\",\n      refunded: \"gray\",\n      failed: \"red\"\n    };\n    return statusColors[status] || \"gray\";\n  };\n  var formatDate = function formatDate(dateString) {\n    if (!dateString) return \"-\";\n    var date = new Date(dateString);\n    return date.toLocaleDateString();\n  };\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__.VStack, {\n    align: \"stretch\",\n    spacing: 6,\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    direction: {\n      base: \"column\",\n      lg: \"row\"\n    },\n    justify: \"space-between\",\n    align: {\n      base: \"stretch\",\n      lg: \"center\"\n    },\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__.VStack, {\n    align: \"start\",\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_48__.Heading, {\n    m: 0,\n    size: \"lg\"\n  }, \"Universal Order Log\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    m: 0,\n    color: \"gray.500\",\n    fontSize: \"sm\"\n  }, \"Track and manage orders from all your connected stores in one place.\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.HStack, {\n    spacing: 3,\n    alignSelf: {\n      base: \"flex-start\",\n      lg: \"center\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"md\",\n    leftIcon: isPro ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_53__.FiRefreshCw, null) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_53__.FiLock, null),\n    colorScheme: \"green\",\n    onClick: function onClick() {\n      if (!isPro) {\n        onProModalOpen();\n        return;\n      }\n      handleClickSyncButton();\n    },\n    shadow: \"sm\",\n    _hover: {\n      shadow: 'md'\n    }\n  }, isPro ? \"Order Import\" : \"Order Import (Pro)\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"md\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_53__.FiDownload, null),\n    variant: \"outline\",\n    bg: \"white\",\n    onClick: function onClick() {\n      var exportData = displayOrders.map(function (o) {\n        var _o$billing4, _o$billing5, _o$billing6;\n        return {\n          \"Order ID\": o.id,\n          \"Store\": o.source_store_name,\n          \"Status\": o.status,\n          \"Total\": \"\".concat(o.currency_symbol || '').concat(o.total || ''),\n          \"First Name\": ((_o$billing4 = o.billing) === null || _o$billing4 === void 0 ? void 0 : _o$billing4.first_name) || '',\n          \"Last Name\": ((_o$billing5 = o.billing) === null || _o$billing5 === void 0 ? void 0 : _o$billing5.last_name) || '',\n          \"Email\": ((_o$billing6 = o.billing) === null || _o$billing6 === void 0 ? void 0 : _o$billing6.email) || '',\n          \"Date\": o.date_created ? new Date(o.date_created).toLocaleString() : ''\n        };\n      });\n      (0,_utils_exportUtils__WEBPACK_IMPORTED_MODULE_1__.exportToCSV)(exportData, \"timeline-orders-\".concat(new Date().toISOString().split('T')[0], \".csv\"));\n    },\n    isDisabled: displayOrders.length === 0\n  }, \"Export\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Card, {\n    variant: \"outline\",\n    p: 4,\n    borderRadius: \"xl\",\n    bg: \"gray.50\",\n    borderStyle: \"dashed\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    direction: {\n      base: \"column\",\n      md: \"row\"\n    },\n    gap: 4,\n    align: {\n      base: \"stretch\",\n      md: \"center\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    flex: \"1\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.HStack, {\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.InputGroup, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.InputLeftElement, {\n    pointerEvents: \"none\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_53__.FiSearch, {\n    color: \"gray\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Input, {\n    placeholder: \"Search by ID, name or email...\",\n    value: searchTerm,\n    onChange: function onChange(e) {\n      return setSearchTerm(e.target.value);\n    },\n    bg: \"white\",\n    size: \"md\",\n    borderRadius: \"lg\"\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.HStack, {\n    spacing: 2,\n    overflowX: \"auto\",\n    pb: {\n      base: 2,\n      md: 0\n    },\n    className: \"shopcentral-scrollbar\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Menu, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.MenuButton, {\n    as: _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button,\n    size: \"md\",\n    variant: \"outline\",\n    bg: \"white\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fa__WEBPACK_IMPORTED_MODULE_54__.FaStore, null),\n    rightIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_53__.FiChevronDown, null),\n    borderRadius: \"lg\",\n    minW: \"140px\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    m: 0,\n    isTruncated: true,\n    maxW: \"120px\"\n  }, selectedStore === \"all\" ? \"All Stores\" : ((_stores$find = stores.find(function (s) {\n    return s.id == selectedStore;\n  })) === null || _stores$find === void 0 ? void 0 : _stores$find.name) || \"Store\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.MenuList, {\n    zIndex: 10\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.MenuItem, {\n    onClick: function onClick() {\n      setSelectedStore(\"all\");\n    }\n  }, \"All Stores\"), stores.map(function (s) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.MenuItem, {\n      key: s.id,\n      onClick: function onClick() {\n        setSelectedStore(s.id);\n      }\n    }, s.name);\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Menu, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.MenuButton, {\n    as: _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button,\n    size: \"md\",\n    variant: \"outline\",\n    bg: \"white\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_53__.FiFilter, null),\n    rightIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_53__.FiChevronDown, null),\n    borderRadius: \"lg\",\n    minW: \"140px\"\n  }, status === \"any\" ? \"All Status\" : status.charAt(0).toUpperCase() + status.slice(1)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.MenuList, {\n    zIndex: 10\n  }, [\"any\", \"pending\", \"processing\", \"on-hold\", \"completed\", \"cancelled\", \"refunded\", \"failed\"].map(function (s) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.MenuItem, {\n      key: s,\n      onClick: function onClick() {\n        setStatus(s);\n      }\n    }, s === \"any\" ? \"All Status\" : s.charAt(0).toUpperCase() + s.slice(1));\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Popover, {\n    placement: \"bottom-end\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.PopoverTrigger, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"md\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fa__WEBPACK_IMPORTED_MODULE_54__.FaCalendar, null),\n    variant: \"outline\",\n    bg: \"white\",\n    borderRadius: \"lg\",\n    minW: \"160px\"\n  }, dateRange.label ? dateRange.label : dateRange.startDate ? \"\".concat(dateRange.startDate.toLocaleDateString(), \" - \").concat(dateRange.endDate.toLocaleDateString()) : \"Select Dates\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.PopoverContent, {\n    w: \"auto\",\n    maxW: \"unset\",\n    shadow: \"xl\",\n    borderRadius: \"xl\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.PopoverArrow, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.PopoverCloseButton, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.PopoverBody, {\n    p: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_55__[\"default\"], {\n    initialRange: dateRange,\n    onChange: function onChange(range) {\n      return setDateRange(range);\n    }\n  }))))))), selectedRows.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    bg: \"blue.50\",\n    p: 3,\n    borderRadius: \"lg\",\n    borderWidth: \"1px\",\n    borderColor: \"blue.100\",\n    justify: \"space-between\",\n    align: \"center\",\n    animation: \"slideInDown 0.2s ease-out\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.HStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    m: 0,\n    fontSize: \"sm\",\n    fontWeight: \"bold\",\n    color: \"blue.700\"\n  }, selectedRows.length, \" items selected\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.HStack, {\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"xs\",\n    colorScheme: \"blue\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_53__.FiPackage, null),\n    onClick: function onClick() {\n      return handleBulkStatusChange('processing');\n    }\n  }, \"Processing\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"xs\",\n    colorScheme: \"green\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_53__.FiCheckCircle, null),\n    onClick: function onClick() {\n      return handleBulkStatusChange('completed');\n    }\n  }, \"Completed\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"xs\",\n    variant: \"ghost\",\n    colorScheme: \"blue\",\n    onClick: function onClick() {\n      return setSelectedRows([]);\n    }\n  }, \"Deselect all\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Modal, {\n    isOpen: isModalOpen,\n    onClose: handleCloseModal,\n    isCentered: true,\n    size: \"md\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.ModalOverlay, {\n    backdropFilter: \"blur(4px)\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.ModalContent, {\n    borderRadius: \"2xl\",\n    shadow: \"2xl\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.ModalHeader, {\n    borderBottomWidth: \"1px\",\n    py: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.HStack, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_53__.FiDownload,\n    color: \"green.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    m: 0,\n    fontSize: \"lg\",\n    fontWeight: \"800\"\n  }, \"Import Orders\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.ModalCloseButton, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.ModalBody, {\n    py: 6\n  }, !syncResult ? isSyncing ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__.VStack, {\n    spacing: 6,\n    align: \"stretch\"\n  }, currentSyncingStore && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__.VStack, {\n    align: \"center\",\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    m: 0,\n    fontSize: \"md\",\n    fontWeight: \"bold\",\n    color: \"blue.600\"\n  }, \"Importing from \", currentSyncingStore.name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    m: 0,\n    fontSize: \"sm\",\n    color: \"gray.500\"\n  }, \"Store \", storeResults.length + 1, \" of \", importStores.length)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    position: \"relative\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Progress, {\n    value: syncProgress.total > 0 ? syncProgress.current / syncProgress.total * 100 : 0,\n    size: \"lg\",\n    colorScheme: \"green\",\n    borderRadius: \"full\",\n    isAnimated: true,\n    hasStripe: true\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    position: \"absolute\",\n    top: \"50%\",\n    left: \"50%\",\n    transform: \"translate(-50%, -50%)\",\n    fontSize: \"xs\",\n    fontWeight: \"bold\",\n    color: syncProgress.current > syncProgress.total / 2 ? \"white\" : \"gray.600\"\n  }, syncProgress.current, \" / \", syncProgress.total)), storeResults.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    mt: 2,\n    bg: \"gray.50\",\n    p: 3,\n    borderRadius: \"lg\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    fontWeight: \"bold\",\n    color: \"gray.600\",\n    mb: 2\n  }, \"Import Status:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__.VStack, {\n    spacing: 2,\n    align: \"stretch\"\n  }, storeResults.map(function (r, i) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.HStack, {\n      key: i,\n      justify: \"space-between\",\n      fontSize: \"xs\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n      m: 0,\n      fontWeight: \"medium\"\n    }, r.store), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Badge, {\n      px: 2,\n      borderRadius: \"full\",\n      colorScheme: r.status === 'completed' ? 'green' : 'red'\n    }, r.status));\n  })))), !currentSyncingStore && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__.VStack, {\n    py: 10\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_37__.Skeleton, {\n    h: \"20px\",\n    w: \"200px\",\n    mb: 4\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Progress, {\n    isIndeterminate: true,\n    w: \"full\",\n    colorScheme: \"blue\",\n    size: \"xs\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    mt: 4,\n    fontSize: \"sm\",\n    color: \"gray.500\"\n  }, \"Initializing import process...\"))) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__.VStack, {\n    spacing: 6,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormLabel, {\n    fontWeight: \"bold\",\n    fontSize: \"sm\",\n    mb: 3\n  }, \"Target Stores\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__.VStack, {\n    align: \"stretch\",\n    spacing: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"sm\",\n    variant: \"outline\",\n    colorScheme: selectAllStores ? \"blue\" : \"gray\",\n    onClick: handleSelectAllStores,\n    borderRadius: \"lg\",\n    justifyContent: \"flex-start\",\n    px: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Checkbox, {\n    isChecked: selectAllStores,\n    isIndeterminate: importStores.length > 0 && !selectAllStores,\n    mr: 3,\n    pointerEvents: \"none\"\n  }), selectAllStores ? \"Deselect All Stores\" : \"Select All Connected Stores\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    maxH: \"200px\",\n    overflowY: \"auto\",\n    p: 3,\n    bg: \"white\",\n    borderRadius: \"lg\",\n    border: \"1px solid\",\n    borderColor: \"gray.200\",\n    className: \"shopcentral-scrollbar\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.CheckboxGroup, {\n    colorScheme: \"blue\",\n    value: importStores,\n    onChange: handleStoreSelect\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__.VStack, {\n    align: \"stretch\",\n    spacing: 2\n  }, stores.filter(function (s) {\n    return s.is_current != 1;\n  }).map(function (store) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Checkbox, {\n      key: store.id,\n      value: store.id.toString(),\n      size: \"md\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n      m: 0,\n      fontSize: \"sm\",\n      fontWeight: \"medium\"\n    }, store.name));\n  }), stores.filter(function (s) {\n    return s.is_current != 1;\n  }).length === 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    direction: \"column\",\n    align: \"center\",\n    py: 6,\n    color: \"gray.400\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_53__.FiGlobe,\n    boxSize: 6,\n    mb: 2\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    m: 0,\n    fontSize: \"sm\"\n  }, \"No child stores connected\"))))))), importStores.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__.VStack, {\n    align: \"stretch\",\n    spacing: 4,\n    animation: \"fadeIn 0.3s ease-out\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormLabel, {\n    fontWeight: \"bold\",\n    fontSize: \"sm\"\n  }, \"Import Limit per Store\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.SimpleGrid, {\n    columns: 5,\n    spacing: 2\n  }, SYNC_LIMIT_OPTIONS.map(function (opt) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n      key: opt,\n      size: \"xs\",\n      variant: syncLimit === opt ? \"solid\" : \"outline\",\n      colorScheme: syncLimit === opt ? \"blue\" : \"gray\",\n      onClick: function onClick() {\n        return setSyncLimit(opt);\n      },\n      borderRadius: \"md\",\n      h: \"32px\"\n    }, opt >= 1000 ? \"\".concat(opt / 1000, \"k\") : opt);\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    mt: 2,\n    fontSize: \"2xs\",\n    color: \"gray.500\"\n  }, \"Tip: Larger batches may take longer but are more efficient.\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    p: 3,\n    bg: \"blue.50\",\n    borderRadius: \"lg\",\n    borderLeft: \"4px solid\",\n    borderLeftColor: \"blue.400\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    color: \"blue.700\"\n  }, \"You are about to import orders from \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"strong\", null, importStores.length), \" store(s).\", status !== \"any\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, \" Only \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"strong\", null, status), \" orders will be fetched.\"))))) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__.VStack, {\n    spacing: 6,\n    align: \"stretch\",\n    py: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    align: \"center\",\n    gap: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: syncResult.status === 'cancelled' ? react_icons_fi__WEBPACK_IMPORTED_MODULE_53__.FiRefreshCw : syncResult.status === 'error' ? react_icons_fi__WEBPACK_IMPORTED_MODULE_53__.FiTrash2 : react_icons_fi__WEBPACK_IMPORTED_MODULE_53__.FiCheckCircle,\n    color: syncResult.status === 'cancelled' ? 'orange.500' : syncResult.status === 'error' ? 'red.500' : 'green.500',\n    boxSize: 6\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_48__.Heading, {\n    size: \"md\"\n  }, syncResult.status === 'cancelled' ? 'Import Cancelled' : syncResult.status === 'error' ? 'Import Failed' : 'Import Successful')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.SimpleGrid, {\n    columns: 3,\n    spacing: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__.VStack, {\n    bg: \"green.50\",\n    p: 3,\n    borderRadius: \"lg\",\n    border: \"1px\",\n    borderColor: \"green.100\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    m: 0,\n    fontSize: \"2xs\",\n    fontWeight: \"bold\",\n    color: \"green.600\",\n    textTransform: \"uppercase\"\n  }, \"New\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    m: 0,\n    fontSize: \"xl\",\n    fontWeight: \"800\",\n    color: \"green.700\"\n  }, syncResult.synced)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__.VStack, {\n    bg: \"gray.50\",\n    p: 3,\n    borderRadius: \"lg\",\n    border: \"1px\",\n    borderColor: \"gray.100\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    m: 0,\n    fontSize: \"2xs\",\n    fontWeight: \"bold\",\n    color: \"gray.600\",\n    textTransform: \"uppercase\"\n  }, \"Skipped\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    m: 0,\n    fontSize: \"xl\",\n    fontWeight: \"800\",\n    color: \"gray.700\"\n  }, syncResult.skipped_exists)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__.VStack, {\n    bg: \"red.50\",\n    p: 3,\n    borderRadius: \"lg\",\n    border: \"1px\",\n    borderColor: \"red.100\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    m: 0,\n    fontSize: \"2xs\",\n    fontWeight: \"bold\",\n    color: \"red.600\",\n    textTransform: \"uppercase\"\n  }, \"Failed\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    m: 0,\n    fontSize: \"xl\",\n    fontWeight: \"800\",\n    color: \"red.700\"\n  }, syncResult.failed))), ((_syncResult$errors = syncResult.errors) === null || _syncResult$errors === void 0 ? void 0 : _syncResult$errors.length) > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    p: 3,\n    bg: \"red.50\",\n    borderRadius: \"lg\",\n    maxH: \"120px\",\n    overflowY: \"auto\",\n    className: \"shopcentral-scrollbar\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    color: \"red.700\",\n    fontWeight: \"bold\",\n    mb: 1\n  }, \"Error Log:\"), syncResult.errors.map(function (err, i) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n      m: 0,\n      key: i,\n      fontSize: \"2xs\",\n      color: \"red.600\",\n      py: 0.5\n    }, \"\\u2022 \", err);\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    color: \"gray.500\",\n    fontStyle: \"italic\",\n    textAlign: \"center\"\n  }, syncResult.message))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.ModalFooter, {\n    borderTopWidth: \"1px\",\n    py: 4,\n    bg: \"gray.50\",\n    borderBottomRadius: \"2xl\"\n  }, !syncResult ? isSyncing ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    variant: \"solid\",\n    colorScheme: \"red\",\n    size: \"md\",\n    onClick: handleCancelSync,\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_53__.FiTrash2, null),\n    borderRadius: \"xl\"\n  }, \"Stop Process\") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.HStack, {\n    spacing: 3,\n    w: \"full\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    variant: \"ghost\",\n    onClick: handleCloseModal,\n    flex: 1,\n    borderRadius: \"xl\"\n  }, \"Cancel\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    colorScheme: \"green\",\n    onClick: handleConfirmSync,\n    isLoading: isSyncing,\n    loadingText: \"Importing...\",\n    isDisabled: importStores.length === 0,\n    flex: 2,\n    borderRadius: \"xl\",\n    shadow: \"md\",\n    _hover: {\n      shadow: 'lg'\n    }\n  }, \"Start Import\")) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    colorScheme: \"blue\",\n    onClick: handleCloseModal,\n    w: \"full\",\n    borderRadius: \"xl\"\n  }, \"Close & Refresh\")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    display: \"flex\",\n    flexDirection: \"column\",\n    h: \"calc(100vh - 180px)\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Card, {\n    variant: \"outline\",\n    borderRadius: \"xl\",\n    shadow: \"sm\",\n    overflow: \"hidden\",\n    display: \"flex\",\n    flexDirection: \"column\",\n    flex: \"1\",\n    bg: \"white\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_41__.TableContainer, {\n    flex: \"1\",\n    overflowY: \"auto\",\n    className: \"shopcentral-scrollbar\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_40__.Table, {\n    variant: \"simple\",\n    size: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_45__.Thead, {\n    bg: \"gray.50\",\n    position: \"sticky\",\n    top: 0,\n    zIndex: 5\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_46__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_44__.Th, {\n    width: \"40px\",\n    py: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Checkbox, {\n    isChecked: selectedRows.length === displayOrders.length && displayOrders.length > 0,\n    isIndeterminate: selectedRows.length > 0 && selectedRows.length < displayOrders.length,\n    onChange: toggleSelectAll,\n    colorScheme: \"blue\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_44__.Th, {\n    py: 4\n  }, \"Order Details\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_44__.Th, {\n    py: 4,\n    display: {\n      base: \"none\",\n      md: \"table-cell\"\n    }\n  }, \"Customer\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_44__.Th, {\n    py: 4\n  }, \"Status\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_44__.Th, {\n    py: 4\n  }, \"Total\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_44__.Th, {\n    py: 4,\n    display: {\n      base: \"none\",\n      lg: \"table-cell\"\n    }\n  }, \"Date\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_44__.Th, {\n    py: 4,\n    width: \"50px\"\n  }, \"Action\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Tbody, null, loading ? [1, 2, 3, 4, 5, 6, 7, 8].map(function (i) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_46__.Tr, {\n      key: i\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_43__.Td, {\n      py: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_37__.Skeleton, {\n      h: \"16px\",\n      w: \"16px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_43__.Td, {\n      py: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_37__.Skeleton, {\n      h: \"32px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_43__.Td, {\n      py: 4,\n      display: {\n        base: \"none\",\n        md: \"table-cell\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_37__.Skeleton, {\n      h: \"32px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_43__.Td, {\n      py: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_37__.Skeleton, {\n      h: \"20px\",\n      w: \"60px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_43__.Td, {\n      py: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_37__.Skeleton, {\n      h: \"20px\",\n      w: \"50px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_43__.Td, {\n      py: 4,\n      display: {\n        base: \"none\",\n        lg: \"table-cell\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_37__.Skeleton, {\n      h: \"20px\",\n      w: \"80px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_43__.Td, {\n      py: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_37__.Skeleton, {\n      h: \"24px\",\n      w: \"24px\"\n    })));\n  }) : displayOrders.length === 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_46__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_43__.Td, {\n    colSpan: 7,\n    textAlign: \"center\",\n    py: 20\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__.VStack, {\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: FiShoppingCart,\n    boxSize: 10,\n    color: \"gray.200\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    m: 0,\n    fontWeight: \"bold\",\n    color: \"gray.400\"\n  }, \"No orders found matching your criteria\")))) : displayOrders.map(function (order) {\n    var _order$billing, _order$billing2, _order$billing3, _order$billing4, _order$billing5;\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_46__.Tr, {\n      key: \"\".concat(order.source_store_id, \"-\").concat(order.id),\n      _hover: {\n        bg: \"gray.50\"\n      },\n      transition: \"background 0.2s\",\n      cursor: \"default\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_43__.Td, {\n      py: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Checkbox, {\n      isChecked: isRowSelected(order),\n      onChange: function onChange() {\n        return toggleSelectRow(order);\n      },\n      colorScheme: \"blue\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_43__.Td, {\n      py: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__.VStack, {\n      align: \"start\",\n      spacing: 1\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.HStack, {\n      spacing: 2\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n      m: 0,\n      fontWeight: \"800\",\n      fontSize: \"sm\",\n      color: \"blue.600\"\n    }, \"#\", order.id), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Badge, {\n      display: {\n        base: \"inline-flex\",\n        md: \"none\"\n      },\n      colorScheme: getStatusColor(order.status),\n      variant: \"subtle\",\n      fontSize: \"3xs\",\n      px: 1\n    }, order.status)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.HStack, {\n      spacing: 1\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_53__.FiGlobe,\n      boxSize: 2.5,\n      color: \"gray.400\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n      m: 0,\n      fontSize: \"2xs\",\n      color: \"gray.500\",\n      fontWeight: \"medium\"\n    }, order.source_store_name)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n      display: {\n        base: \"block\",\n        md: \"none\"\n      },\n      mt: 1\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n      m: 0,\n      fontSize: \"xs\",\n      fontWeight: \"bold\"\n    }, (_order$billing = order.billing) === null || _order$billing === void 0 ? void 0 : _order$billing.first_name, \" \", (_order$billing2 = order.billing) === null || _order$billing2 === void 0 ? void 0 : _order$billing2.last_name)))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_43__.Td, {\n      py: 3,\n      display: {\n        base: \"none\",\n        md: \"table-cell\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__.VStack, {\n      align: \"start\",\n      spacing: 0\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n      m: 0,\n      fontWeight: \"bold\",\n      fontSize: \"sm\",\n      color: \"gray.700\"\n    }, (_order$billing3 = order.billing) === null || _order$billing3 === void 0 ? void 0 : _order$billing3.first_name, \" \", (_order$billing4 = order.billing) === null || _order$billing4 === void 0 ? void 0 : _order$billing4.last_name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n      m: 0,\n      fontSize: \"xs\",\n      color: \"gray.500\"\n    }, (_order$billing5 = order.billing) === null || _order$billing5 === void 0 ? void 0 : _order$billing5.email))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_43__.Td, {\n      py: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Badge, {\n      colorScheme: getStatusColor(order.status),\n      variant: \"subtle\",\n      fontSize: \"2xs\",\n      px: 2,\n      py: 0.5,\n      borderRadius: \"full\",\n      textTransform: \"capitalize\"\n    }, order.status)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_43__.Td, {\n      py: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__.VStack, {\n      align: \"start\",\n      spacing: 0\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n      m: 0,\n      fontWeight: \"900\",\n      fontSize: \"sm\",\n      color: \"gray.800\"\n    }, order === null || order === void 0 ? void 0 : order.currency_symbol, order.total), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n      m: 0,\n      fontSize: \"3xs\",\n      color: \"gray.400\",\n      display: {\n        base: \"block\",\n        lg: \"none\"\n      }\n    }, formatDate(order.date_created)))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_43__.Td, {\n      py: 3,\n      fontSize: \"xs\",\n      color: \"gray.600\",\n      display: {\n        base: \"none\",\n        lg: \"table-cell\"\n      }\n    }, formatDate(order.date_created)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_43__.Td, {\n      py: 3,\n      textAlign: \"right\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Menu, {\n      isLazy: true\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.MenuButton, {\n      as: _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.IconButton,\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_53__.FiMoreVertical, null),\n      variant: \"ghost\",\n      size: \"sm\",\n      borderRadius: \"full\",\n      _hover: {\n        bg: \"gray.200\"\n      }\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.MenuList, {\n      shadow: \"xl\",\n      borderRadius: \"lg\",\n      py: 2\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.MenuItem, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_53__.FiCheckCircle, {\n        color: \"var(--chakra-colors-green-500)\"\n      }),\n      fontSize: \"sm\",\n      fontWeight: \"medium\",\n      onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {\n        return _regenerator().w(function (_context9) {\n          while (1) switch (_context9.n) {\n            case 0:\n              setSelectedRows([{\n                id: order.id,\n                source_store_id: order.source_store_id\n              }]);\n              _context9.n = 1;\n              return handleBulkStatusChange('completed');\n            case 1:\n              return _context9.a(2);\n          }\n        }, _callee8);\n      }))\n    }, \"Mark as Completed\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.MenuItem, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_53__.FiPackage, {\n        color: \"var(--chakra-colors-blue-500)\"\n      }),\n      fontSize: \"sm\",\n      fontWeight: \"medium\",\n      onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {\n        return _regenerator().w(function (_context0) {\n          while (1) switch (_context0.n) {\n            case 0:\n              setSelectedRows([{\n                id: order.id,\n                source_store_id: order.source_store_id\n              }]);\n              _context0.n = 1;\n              return handleBulkStatusChange('processing');\n            case 1:\n              return _context0.a(2);\n          }\n        }, _callee9);\n      }))\n    }, \"Mark as Processing\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.MenuItem, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_53__.FiEye, {\n        color: \"var(--chakra-colors-purple-500)\"\n      }),\n      fontSize: \"sm\",\n      fontWeight: \"medium\"\n    }, \"View Details\")))));\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    p: 4,\n    justify: \"space-between\",\n    align: \"center\",\n    bg: \"gray.50\",\n    borderTop: \"1px\",\n    borderColor: \"gray.200\",\n    flexShrink: 0,\n    direction: {\n      base: \"column\",\n      sm: \"row\"\n    },\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.HStack, {\n    spacing: 4,\n    w: {\n      base: \"full\",\n      sm: \"auto\"\n    },\n    justify: {\n      base: \"space-between\",\n      sm: \"flex-start\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.HStack, {\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    fontSize: \"xs\",\n    fontWeight: \"bold\",\n    color: \"gray.500\"\n  }, \"Show:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Select, {\n    size: \"xs\",\n    w: \"70px\",\n    value: perPage,\n    onChange: function onChange(e) {\n      return setPerPage(Number(e.target.value));\n    },\n    borderRadius: \"md\",\n    bg: \"white\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: 10\n  }, \"10\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: 25\n  }, \"25\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: 50\n  }, \"50\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: 100\n  }, \"100\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    fontSize: \"xs\",\n    fontWeight: \"medium\",\n    color: \"gray.500\"\n  }, totalRows > 0 ? \"\".concat((currentPage - 1) * perPage + 1, \"-\").concat(Math.min(currentPage * perPage, totalRows)) : 0, \" of \", totalRows)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.HStack, {\n    spacing: 1,\n    w: {\n      base: \"full\",\n      sm: \"auto\"\n    },\n    justify: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.IconButton, {\n    size: \"sm\",\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_53__.FiChevronLeft, null),\n    variant: \"ghost\",\n    onClick: function onClick() {\n      return setCurrentPage(1);\n    },\n    isDisabled: currentPage === 1,\n    \"aria-label\": \"First page\",\n    borderRadius: \"full\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"sm\",\n    variant: \"ghost\",\n    onClick: function onClick() {\n      return setCurrentPage(function (p) {\n        return Math.max(1, p - 1);\n      });\n    },\n    isDisabled: currentPage === 1,\n    borderRadius: \"lg\",\n    fontWeight: \"bold\",\n    fontSize: \"xs\"\n  }, \"Previous\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    px: 3,\n    py: 1,\n    bg: \"white\",\n    borderRadius: \"md\",\n    border: \"1px\",\n    borderColor: \"gray.200\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_49__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    fontWeight: \"800\",\n    color: \"blue.600\"\n  }, currentPage, \" \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    as: \"span\",\n    color: \"gray.400\",\n    fontWeight: \"normal\"\n  }, \"/ \", totalPages))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"sm\",\n    variant: \"ghost\",\n    onClick: function onClick() {\n      return setCurrentPage(function (p) {\n        return Math.min(totalPages, p + 1);\n      });\n    },\n    isDisabled: currentPage === totalPages,\n    borderRadius: \"lg\",\n    fontWeight: \"bold\",\n    fontSize: \"xs\"\n  }, \"Next\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.IconButton, {\n    size: \"sm\",\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_53__.FiChevronRight, null),\n    variant: \"ghost\",\n    onClick: function onClick() {\n      return setCurrentPage(totalPages);\n    },\n    isDisabled: currentPage === totalPages,\n    \"aria-label\": \"Last page\",\n    borderRadius: \"full\"\n  }))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ProFeatureModal__WEBPACK_IMPORTED_MODULE_56__[\"default\"], {\n    isOpen: isProModalOpen,\n    onClose: onProModalClose,\n    title: \"Cross-Store Order Import (Pro)\",\n    what: \"An automated order ingestion tool that syncs customer transactions from remote child stores into this central master site as real WooCommerce orders.\",\n    how: \"Continuously queries connected child store APIs for new transactions and copies complete order metadata\\u2014including line items, billing details, and totals\\u2014into your hub database.\",\n    why: \"Centralize order fulfillment, invoicing, accounting workflows, and inventory tracking without logging into separate WooCommerce admin panels.\"\n  }));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OrderList);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Orders/OrderList.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Orders/ViewOrder.jsx"
/*!*****************************************************!*\
  !*** ./src/Pages/StoreManager/Orders/ViewOrder.jsx ***!
  \*****************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/hooks/dist/esm/use-disclosure.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/breadcrumb/breadcrumb.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/breadcrumb/breadcrumb-item.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/breadcrumb/breadcrumb-link.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/divider/divider.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/simple-grid.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/spinner/spinner.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tbody.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/td.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tr.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/heading.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router/dist/development/chunk-EPOLDU6W.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! react-hot-toast */ \"./node_modules/react-hot-toast/dist/index.mjs\");\n/* harmony import */ var _utils_FormatDate__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../../utils/FormatDate */ \"./src/utils/FormatDate.js\");\n/* harmony import */ var _Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../../../Components/shared/ConfirmDialog */ \"./src/Components/shared/ConfirmDialog.jsx\");\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\n\n\n\n\nvar ViewOrder = function ViewOrder() {\n  var _order$status, _order$line_items, _order$billing, _order$billing2, _order$shipping, _order$shipping2, _order$shipping3, _order$shipping4, _order$shipping5, _order$shipping6, _order$shipping7, _order$shipping8, _order$billing3, _order$billing4, _order$billing5, _order$billing6, _order$billing7, _order$billing8, _order$billing9, _order$billing0;\n  var _useParams = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_24__.useParams)(),\n    id = _useParams.id;\n  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_24__.useNavigate)();\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState2 = _slicedToArray(_useState, 2),\n    order = _useState2[0],\n    setOrder = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),\n    _useState4 = _slicedToArray(_useState3, 2),\n    loading = _useState4[0],\n    setLoading = _useState4[1];\n  var _useDisclosure = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.useDisclosure)(),\n    isDeleteOpen = _useDisclosure.isOpen,\n    onDeleteOpen = _useDisclosure.onOpen,\n    onDeleteClose = _useDisclosure.onClose;\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState6 = _slicedToArray(_useState5, 2),\n    isDeleting = _useState6[0],\n    setIsDeleting = _useState6[1];\n  var fetchOrder = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n    var _response$data, response, orderData, _t;\n    return _regenerator().w(function (_context) {\n      while (1) switch (_context.p = _context.n) {\n        case 0:\n          _context.p = 0;\n          setLoading(true);\n          _context.n = 1;\n          return axios__WEBPACK_IMPORTED_MODULE_25__[\"default\"].get(\"/api/store-manager/orders/\".concat(id));\n        case 1:\n          response = _context.v;\n          // Check if response has data.data (the proxy sometimes nests)\n          orderData = ((_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.data) || response.data;\n          setOrder(orderData);\n          _context.n = 3;\n          break;\n        case 2:\n          _context.p = 2;\n          _t = _context.v;\n          react_hot_toast__WEBPACK_IMPORTED_MODULE_26__[\"default\"].error(\"Failed to load order details\");\n          navigate(\"/store-manager/orders\");\n        case 3:\n          _context.p = 3;\n          setLoading(false);\n          return _context.f(3);\n        case 4:\n          return _context.a(2);\n      }\n    }, _callee, null, [[0, 2, 3, 4]]);\n  })), [id, navigate]);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    fetchOrder();\n  }, [fetchOrder]);\n  var handleDelete = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {\n      return _regenerator().w(function (_context2) {\n        while (1) switch (_context2.n) {\n          case 0:\n            onDeleteOpen();\n          case 1:\n            return _context2.a(2);\n        }\n      }, _callee2);\n    }));\n    return function handleDelete() {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  var confirmDelete = /*#__PURE__*/function () {\n    var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {\n      var _t2;\n      return _regenerator().w(function (_context3) {\n        while (1) switch (_context3.p = _context3.n) {\n          case 0:\n            setIsDeleting(true);\n            _context3.p = 1;\n            _context3.n = 2;\n            return axios__WEBPACK_IMPORTED_MODULE_25__[\"default\"][\"delete\"](\"/api/store-manager/orders/\".concat(id));\n          case 2:\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_26__[\"default\"].success(\"Order deleted successfully\");\n            navigate(\"/store-manager/orders\");\n            _context3.n = 4;\n            break;\n          case 3:\n            _context3.p = 3;\n            _t2 = _context3.v;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_26__[\"default\"].error(\"Failed to delete order\");\n          case 4:\n            _context3.p = 4;\n            setIsDeleting(false);\n            onDeleteClose();\n            return _context3.f(4);\n          case 5:\n            return _context3.a(2);\n        }\n      }, _callee3, null, [[1, 3, 4, 5]]);\n    }));\n    return function confirmDelete() {\n      return _ref3.apply(this, arguments);\n    };\n  }();\n  if (loading) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n      justify: \"center\",\n      align: \"center\",\n      h: \"60vh\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Spinner, {\n      size: \"xl\",\n      color: \"blue.500\",\n      thickness: \"4px\"\n    }));\n  }\n  if (!order) return null;\n  var getStatusColor = function getStatusColor(status) {\n    var colors = {\n      completed: \"green\",\n      processing: \"blue\",\n      \"on-hold\": \"orange\",\n      pending: \"yellow\",\n      cancelled: \"red\",\n      refunded: \"gray\",\n      failed: \"red\"\n    };\n    return colors[status] || \"gray\";\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(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    animation: \"fadeIn 0.4s ease-out\",\n    pb: 10\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    justify: \"space-between\",\n    align: \"center\",\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    align: \"start\",\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Breadcrumb, {\n    fontSize: \"sm\",\n    color: \"gray.500\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.BreadcrumbItem, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.BreadcrumbLink, {\n    onClick: function onClick() {\n      return navigate(\"/store-manager/orders\");\n    }\n  }, \"Orders\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.BreadcrumbItem, {\n    isCurrentPage: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.BreadcrumbLink, null, \"Order #\", order.id))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.Heading, {\n    size: \"lg\",\n    fontWeight: \"800\"\n  }, \"Order #\", order.id)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.HStack, {\n    spacing: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_23__.FiArrowLeft, null),\n    variant: \"ghost\",\n    onClick: function onClick() {\n      return navigate(\"/store-manager/orders\");\n    },\n    borderRadius: \"xl\"\n  }, \"Back\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_23__.FiTrash2, null),\n    colorScheme: \"red\",\n    variant: \"subtle\",\n    onClick: handleDelete,\n    borderRadius: \"xl\"\n  }, \"Delete\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_23__.FiDownload, null),\n    colorScheme: \"blue\",\n    borderRadius: \"xl\",\n    shadow: \"sm\"\n  }, \"Invoice\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.SimpleGrid, {\n    columns: {\n      base: 1,\n      md: 3\n    },\n    spacing: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    gridColumn: {\n      md: \"span 2\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Card, {\n    variant: \"outline\",\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\",\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.CardBody, {\n    p: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    justify: \"space-between\",\n    align: \"center\",\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    align: \"start\",\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    color: \"gray.400\",\n    fontWeight: \"700\",\n    fontSize: \"xs\",\n    textTransform: \"uppercase\",\n    letterSpacing: \"wider\"\n  }, \"Status\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n    colorScheme: getStatusColor(order.status),\n    px: 3,\n    py: 1,\n    borderRadius: \"lg\",\n    fontSize: \"xs\"\n  }, (_order$status = order.status) === null || _order$status === void 0 ? void 0 : _order$status.toUpperCase())), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    align: \"end\",\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    color: \"gray.400\",\n    fontWeight: \"700\",\n    fontSize: \"xs\",\n    textTransform: \"uppercase\",\n    letterSpacing: \"wider\"\n  }, \"Placed On\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontWeight: \"800\",\n    fontSize: \"sm\"\n  }, (0,_utils_FormatDate__WEBPACK_IMPORTED_MODULE_27__.FormatDate)(order.date_created)))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Divider, {\n    mb: 6\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.Heading, {\n    size: \"sm\",\n    mb: 4,\n    fontWeight: \"800\"\n  }, \"Order Items\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Table, {\n    variant: \"simple\",\n    size: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Tbody, null, (_order$line_items = order.line_items) === null || _order$line_items === void 0 ? void 0 : _order$line_items.map(function (item) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Tr, {\n      key: item.id\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Td, {\n      py: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n      align: \"start\",\n      spacing: 0\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n      fontWeight: \"700\",\n      fontSize: \"sm\"\n    }, item.name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n      fontSize: \"xs\",\n      color: \"gray.500\"\n    }, \"SKU: \", item.sku || 'N/A'))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Td, {\n      py: 4,\n      textAlign: \"center\",\n      fontWeight: \"700\",\n      color: \"gray.600\"\n    }, \"x\", item.quantity), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Td, {\n      py: 4,\n      textAlign: \"right\",\n      fontWeight: \"800\",\n      color: \"blue.600\"\n    }, order.currency_symbol, item.total));\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    mt: 8,\n    ml: \"auto\",\n    maxW: \"350px\",\n    p: 5,\n    bg: \"gray.50\",\n    borderRadius: \"2xl\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    align: \"stretch\",\n    spacing: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    justify: \"space-between\",\n    fontSize: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    color: \"gray.500\",\n    fontWeight: \"600\"\n  }, \"Subtotal\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontWeight: \"700\"\n  }, order.currency_symbol, order.total_tax ? (parseFloat(order.total) - parseFloat(order.total_tax)).toFixed(2) : order.total)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    justify: \"space-between\",\n    fontSize: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    color: \"gray.500\",\n    fontWeight: \"600\"\n  }, \"Shipping\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontWeight: \"700\"\n  }, order.currency_symbol, order.shipping_total || '0.00')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    justify: \"space-between\",\n    fontSize: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    color: \"gray.500\",\n    fontWeight: \"600\"\n  }, \"Tax\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontWeight: \"700\"\n  }, order.currency_symbol, order.total_tax || '0.00')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Divider, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    justify: \"space-between\",\n    fontSize: \"lg\",\n    fontWeight: \"900\",\n    pt: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, null, \"Total\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    color: \"blue.600\"\n  }, order.currency_symbol, order.total)))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Card, {\n    variant: \"outline\",\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.CardBody, {\n    p: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.HStack, {\n    mb: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_23__.FiCreditCard,\n    boxSize: 4,\n    color: \"blue.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.Heading, {\n    size: \"sm\",\n    fontWeight: \"800\"\n  }, \"Payment Method\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontSize: \"sm\",\n    fontWeight: \"600\",\n    color: \"gray.600\"\n  }, order.payment_method_title || 'N/A'), order.transaction_id && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.400\",\n    mt: 1\n  }, \"Trans ID: \", order.transaction_id)))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Card, {\n    variant: \"outline\",\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\",\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.CardBody, {\n    p: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.HStack, {\n    mb: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_23__.FiUser,\n    boxSize: 4,\n    color: \"blue.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.Heading, {\n    size: \"sm\",\n    fontWeight: \"800\"\n  }, \"Customer\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    align: \"start\",\n    spacing: 4,\n    w: \"full\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    w: \"full\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.400\",\n    fontWeight: \"700\",\n    textTransform: \"uppercase\",\n    mb: 1\n  }, \"Email\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontWeight: \"700\",\n    fontSize: \"sm\"\n  }, (_order$billing = order.billing) === null || _order$billing === void 0 ? void 0 : _order$billing.email)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    w: \"full\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.400\",\n    fontWeight: \"700\",\n    textTransform: \"uppercase\",\n    mb: 1\n  }, \"Phone\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontWeight: \"700\",\n    fontSize: \"sm\"\n  }, ((_order$billing2 = order.billing) === null || _order$billing2 === void 0 ? void 0 : _order$billing2.phone) || 'N/A')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Divider, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    w: \"full\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.HStack, {\n    mb: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_23__.FiTruck,\n    boxSize: 3,\n    color: \"gray.400\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.400\",\n    fontWeight: \"700\",\n    textTransform: \"uppercase\"\n  }, \"Shipping Address\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.600\",\n    lineHeight: \"tall\"\n  }, (_order$shipping = order.shipping) === null || _order$shipping === void 0 ? void 0 : _order$shipping.first_name, \" \", (_order$shipping2 = order.shipping) === null || _order$shipping2 === void 0 ? void 0 : _order$shipping2.last_name, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"br\", null), (_order$shipping3 = order.shipping) === null || _order$shipping3 === void 0 ? void 0 : _order$shipping3.address_1, \" \", (_order$shipping4 = order.shipping) !== null && _order$shipping4 !== void 0 && _order$shipping4.address_2 ? \"\".concat(order.shipping.address_2, \", \") : '', /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"br\", null), (_order$shipping5 = order.shipping) === null || _order$shipping5 === void 0 ? void 0 : _order$shipping5.city, \", \", (_order$shipping6 = order.shipping) === null || _order$shipping6 === void 0 ? void 0 : _order$shipping6.state, \" \", (_order$shipping7 = order.shipping) === null || _order$shipping7 === void 0 ? void 0 : _order$shipping7.postcode, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"br\", null), (_order$shipping8 = order.shipping) === null || _order$shipping8 === void 0 ? void 0 : _order$shipping8.country)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    w: \"full\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.HStack, {\n    mb: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_23__.FiCreditCard,\n    boxSize: 3,\n    color: \"gray.400\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.400\",\n    fontWeight: \"700\",\n    textTransform: \"uppercase\"\n  }, \"Billing Address\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.600\",\n    lineHeight: \"tall\"\n  }, (_order$billing3 = order.billing) === null || _order$billing3 === void 0 ? void 0 : _order$billing3.first_name, \" \", (_order$billing4 = order.billing) === null || _order$billing4 === void 0 ? void 0 : _order$billing4.last_name, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"br\", null), (_order$billing5 = order.billing) === null || _order$billing5 === void 0 ? void 0 : _order$billing5.address_1, \" \", (_order$billing6 = order.billing) !== null && _order$billing6 !== void 0 && _order$billing6.address_2 ? \"\".concat(order.billing.address_2, \", \") : '', /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"br\", null), (_order$billing7 = order.billing) === null || _order$billing7 === void 0 ? void 0 : _order$billing7.city, \", \", (_order$billing8 = order.billing) === null || _order$billing8 === void 0 ? void 0 : _order$billing8.state, \" \", (_order$billing9 = order.billing) === null || _order$billing9 === void 0 ? void 0 : _order$billing9.postcode, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"br\", null), (_order$billing0 = order.billing) === null || _order$billing0 === void 0 ? void 0 : _order$billing0.country))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Card, {\n    variant: \"outline\",\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.CardBody, {\n    p: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.Heading, {\n    size: \"sm\",\n    mb: 4,\n    fontWeight: \"800\"\n  }, \"Order Actions\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    align: \"stretch\",\n    spacing: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Button, {\n    size: \"sm\",\n    variant: \"outline\",\n    borderRadius: \"xl\",\n    fontWeight: \"700\"\n  }, \"Resend Receipt\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Button, {\n    size: \"sm\",\n    variant: \"outline\",\n    borderRadius: \"xl\",\n    fontWeight: \"700\"\n  }, \"Refund Order\"))))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_28__[\"default\"], {\n    isOpen: isDeleteOpen,\n    onClose: onDeleteClose,\n    onConfirm: confirmDelete,\n    title: \"Delete Order\",\n    description: \"Are you sure you want to permanently delete this order? This cannot be undone.\",\n    confirmLabel: \"Delete\",\n    loading: isDeleting\n  }));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ViewOrder);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Orders/ViewOrder.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/ProductEditor/ProductEditor.jsx"
/*!****************************************************************!*\
  !*** ./src/Pages/StoreManager/ProductEditor/ProductEditor.jsx ***!
  \****************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/hooks/dist/esm/use-disclosure.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/icon-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/checkbox/checkbox.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/select/select.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/tabs/tab.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/tabs/tab-list.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/tabs/tab-panel.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/tabs/tab-panels.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/tabs/tabs.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/toast/use-toast.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var _components_ProductTable__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./components/ProductTable */ \"./src/Pages/StoreManager/ProductEditor/components/ProductTable.jsx\");\n/* harmony import */ var _components_ProductEditModal__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./components/ProductEditModal */ \"./src/Pages/StoreManager/ProductEditor/components/ProductEditModal.jsx\");\n/* harmony import */ var _components_CompareView__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./components/CompareView */ \"./src/Pages/StoreManager/ProductEditor/components/CompareView.jsx\");\n/* harmony import */ var _components_BulkEditor__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./components/BulkEditor */ \"./src/Pages/StoreManager/ProductEditor/components/BulkEditor.jsx\");\n/* harmony import */ var _SmartProductCreator_SmartProductCreator__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../SmartProductCreator/SmartProductCreator */ \"./src/Pages/StoreManager/SmartProductCreator/SmartProductCreator.jsx\");\n/* harmony import */ var _Components_shared_ProFeatureModal__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../../../Components/shared/ProFeatureModal */ \"./src/Components/shared/ProFeatureModal.jsx\");\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 _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\n\n\n\n\n\n\nvar ProductEditor = function ProductEditor() {\n  var _window$shopCentralDa;\n  var toast = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.useToast)();\n  var isPro = (_window$shopCentralDa = window.shopCentralData) === null || _window$shopCentralDa === void 0 ? void 0 : _window$shopCentralDa.isPro;\n  var _useDisclosure = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.useDisclosure)(),\n    isProModalOpen = _useDisclosure.isOpen,\n    _onProModalOpen = _useDisclosure.onOpen,\n    onProModalClose = _useDisclosure.onClose;\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"smart_creator\"),\n    _useState2 = _slicedToArray(_useState, 2),\n    proFeatureType = _useState2[0],\n    setProFeatureType = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0),\n    _useState4 = _slicedToArray(_useState3, 2),\n    activeTab = _useState4[0],\n    setActiveTab = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState6 = _slicedToArray(_useState5, 2),\n    stores = _useState6[0],\n    setStores = _useState6[1];\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"\"),\n    _useState8 = _slicedToArray(_useState7, 2),\n    selectedStore = _useState8[0],\n    setSelectedStore = _useState8[1];\n  var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState0 = _slicedToArray(_useState9, 2),\n    products = _useState0[0],\n    setProducts = _useState0[1];\n  var _useState1 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState10 = _slicedToArray(_useState1, 2),\n    loading = _useState10[0],\n    setLoading = _useState10[1];\n  var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0),\n    _useState12 = _slicedToArray(_useState11, 2),\n    totalProducts = _useState12[0],\n    setTotalProducts = _useState12[1];\n  var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1),\n    _useState14 = _slicedToArray(_useState13, 2),\n    page = _useState14[0],\n    setPage = _useState14[1];\n  var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"\"),\n    _useState16 = _slicedToArray(_useState15, 2),\n    searchTerm = _useState16[0],\n    setSearchTerm = _useState16[1];\n  var _useState17 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"simple\"),\n    _useState18 = _slicedToArray(_useState17, 2),\n    productType = _useState18[0],\n    setProductType = _useState18[1];\n  var _useState19 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState20 = _slicedToArray(_useState19, 2),\n    selectedProducts = _useState20[0],\n    setSelectedProducts = _useState20[1];\n  var _useState21 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState22 = _slicedToArray(_useState21, 2),\n    editingProduct = _useState22[0],\n    setEditingProduct = _useState22[1];\n  var _useState23 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState24 = _slicedToArray(_useState23, 2),\n    compareProducts = _useState24[0],\n    setCompareProducts = _useState24[1];\n  var _useState25 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState26 = _slicedToArray(_useState25, 2),\n    showSmartCreator = _useState26[0],\n    setShowSmartCreator = _useState26[1];\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    fetchStores();\n  }, []);\n  var fetchStores = /*#__PURE__*/function () {\n    var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n      var _res$data, res, storesList, mainStore, _t;\n      return _regenerator().w(function (_context) {\n        while (1) switch (_context.p = _context.n) {\n          case 0:\n            _context.p = 0;\n            _context.n = 1;\n            return axios__WEBPACK_IMPORTED_MODULE_23__[\"default\"].get(\"/api/stores\");\n          case 1:\n            res = _context.v;\n            storesList = ((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.stores) || [];\n            setStores(storesList);\n\n            // Auto-select main store (is_current = 1)\n            mainStore = storesList.find(function (s) {\n              return s.is_current === 1 || s.is_current === true;\n            });\n            if (mainStore) {\n              setSelectedStore(mainStore.id.toString());\n            } else if (storesList.length > 0) {\n              setSelectedStore(storesList[0].id.toString());\n            }\n            _context.n = 3;\n            break;\n          case 2:\n            _context.p = 2;\n            _t = _context.v;\n            toast({\n              title: \"Failed to load stores\",\n              status: \"error\",\n              duration: 3000\n            });\n          case 3:\n            return _context.a(2);\n        }\n      }, _callee, null, [[0, 2]]);\n    }));\n    return function fetchStores() {\n      return _ref.apply(this, arguments);\n    };\n  }();\n  var fetchProducts = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {\n    var _res$data2, _res$data3, params, res, _t2;\n    return _regenerator().w(function (_context2) {\n      while (1) switch (_context2.p = _context2.n) {\n        case 0:\n          if (selectedStore) {\n            _context2.n = 1;\n            break;\n          }\n          return _context2.a(2);\n        case 1:\n          setLoading(true);\n          _context2.p = 2;\n          params = {\n            store_id: selectedStore,\n            page: page,\n            per_page: 20,\n            search: searchTerm,\n            type: productType\n          };\n          _context2.n = 3;\n          return axios__WEBPACK_IMPORTED_MODULE_23__[\"default\"].get(\"/product-editor/products\", {\n            params: params\n          });\n        case 3:\n          res = _context2.v;\n          setProducts(((_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.data) || []);\n          setTotalProducts(((_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.total) || 0);\n          _context2.n = 5;\n          break;\n        case 4:\n          _context2.p = 4;\n          _t2 = _context2.v;\n          toast({\n            title: \"Failed to load products\",\n            status: \"error\",\n            duration: 3000\n          });\n        case 5:\n          _context2.p = 5;\n          setLoading(false);\n          return _context2.f(5);\n        case 6:\n          return _context2.a(2);\n      }\n    }, _callee2, null, [[2, 4, 5, 6]]);\n  })), [selectedStore, page, searchTerm, productType, toast]);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    fetchProducts();\n  }, [fetchProducts]);\n  var handleEditProduct = function handleEditProduct(product) {\n    setEditingProduct(product);\n  };\n  var handleCompare = function handleCompare(product) {\n    setCompareProducts([].concat(_toConsumableArray(compareProducts), [product]));\n    setActiveTab(2);\n  };\n  var handleSelectProduct = function handleSelectProduct(id) {\n    setSelectedProducts(function (prev) {\n      return prev.includes(id) ? prev.filter(function (i) {\n        return i !== id;\n      }) : [].concat(_toConsumableArray(prev), [id]);\n    });\n  };\n  var handleSelectAll = function handleSelectAll() {\n    if (selectedProducts.length === products.length) {\n      setSelectedProducts([]);\n    } else {\n      setSelectedProducts(products.map(function (p) {\n        return p.id;\n      }));\n    }\n  };\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    animation: \"fadeIn 0.5s ease-out\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Flex, {\n    direction: {\n      base: \"column\",\n      md: \"row\"\n    },\n    justify: \"space-between\",\n    align: {\n      base: \"start\",\n      md: \"center\"\n    },\n    mb: 6,\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.Text, {\n    as: \"h1\",\n    fontSize: \"2xl\",\n    fontWeight: \"800\",\n    mb: 1\n  }, \"Global Product Editor\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.Text, {\n    color: \"gray.500\",\n    fontWeight: \"500\"\n  }, \"Edit and deploy products across all stores\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Tabs, {\n    index: activeTab,\n    onChange: setActiveTab,\n    variant: \"enclosed\",\n    colorScheme: \"blue\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.TabList, {\n    mb: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Tab, {\n    fontWeight: \"600\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_22__.FiPackage,\n    mr: 2\n  }), \"Products\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Tab, {\n    fontWeight: \"600\",\n    isDisabled: selectedProducts.length === 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_22__.FiLayers,\n    mr: 2\n  }), \"Bulk Editor\", selectedProducts.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n    ml: 2,\n    colorScheme: \"blue\",\n    fontSize: \"xs\"\n  }, selectedProducts.length)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Tab, {\n    fontWeight: \"600\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_22__.FiColumns,\n    mr: 2\n  }), \"Compare\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.TabPanels, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.TabPanel, {\n    p: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.VStack, {\n    spacing: 4,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Card, {\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"gray.200\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.CardBody, {\n    p: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Flex, {\n    direction: {\n      base: \"column\",\n      md: \"row\"\n    },\n    gap: 3,\n    align: {\n      base: \"stretch\",\n      md: \"center\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Select, {\n    placeholder: \"Select Store\",\n    value: selectedStore,\n    onChange: function onChange(e) {\n      setSelectedStore(e.target.value);\n      setPage(1);\n    },\n    maxW: {\n      base: \"full\",\n      md: \"200px\"\n    },\n    size: \"sm\",\n    borderRadius: \"lg\"\n  }, stores.map(function (s) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      key: s.id,\n      value: s.id\n    }, s.name);\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Input, {\n    placeholder: \"Search products...\",\n    value: searchTerm,\n    onChange: function onChange(e) {\n      setSearchTerm(e.target.value);\n      setPage(1);\n    },\n    maxW: {\n      base: \"full\",\n      md: \"250px\"\n    },\n    size: \"sm\",\n    borderRadius: \"lg\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Select, {\n    value: productType,\n    onChange: function onChange(e) {\n      setProductType(e.target.value);\n      setPage(1);\n    },\n    maxW: {\n      base: \"full\",\n      md: \"150px\"\n    },\n    size: \"sm\",\n    borderRadius: \"lg\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"simple\"\n  }, \"Simple\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"variable\"\n  }, \"Variable\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"grouped\"\n  }, \"Grouped\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"external\"\n  }, \"External\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"downloadable\"\n  }, \"Downloadable\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"virtual\"\n  }, \"Virtual\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.HStack, {\n    ml: {\n      base: \"0\",\n      md: \"auto\"\n    },\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    size: \"sm\",\n    colorScheme: \"purple\",\n    variant: \"solid\",\n    leftIcon: isPro ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_22__.FiBox\n    }) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_22__.FiLock, null),\n    onClick: isPro ? function () {\n      return setShowSmartCreator(true);\n    } : function () {\n      setProFeatureType(\"smart_creator\");\n      _onProModalOpen();\n    }\n  }, isPro ? \"Smart Product Creator\" : \"Smart Creator (Pro)\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.IconButton, {\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_22__.FiRefreshCw, null),\n    size: \"sm\",\n    variant: \"outline\",\n    onClick: fetchProducts,\n    isLoading: loading,\n    \"aria-label\": \"Refresh\"\n  }))))), selectedProducts.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Flex, {\n    gap: 3,\n    align: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Checkbox, {\n    isChecked: selectedProducts.length === products.length && products.length > 0,\n    onChange: handleSelectAll\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.Text, {\n    fontSize: \"sm\"\n  }, selectedProducts.length, \" selected\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    size: \"xs\",\n    colorScheme: \"blue\",\n    variant: \"outline\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_22__.FiEdit2, null),\n    onClick: function onClick() {\n      // Open bulk editor for selected products\n      setActiveTab(1);\n    }\n  }, \"Bulk Edit\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_ProductTable__WEBPACK_IMPORTED_MODULE_24__[\"default\"], {\n    products: products,\n    loading: loading,\n    selectedProducts: selectedProducts,\n    onSelectProduct: handleSelectProduct,\n    onEdit: handleEditProduct,\n    onCompare: handleCompare,\n    isPro: isPro,\n    onProModalOpen: function onProModalOpen() {\n      setProFeatureType(\"editor\");\n      _onProModalOpen();\n    }\n  }), totalProducts > 20 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Flex, {\n    justify: \"space-between\",\n    align: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.500\"\n  }, \"Showing \", products.length > 0 ? (page - 1) * 20 + 1 : 0, \"\\u2013\", Math.min(page * 20, totalProducts), \" of \", totalProducts), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.HStack, {\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    size: \"xs\",\n    isDisabled: page === 1,\n    onClick: function onClick() {\n      return setPage(function (p) {\n        return p - 1;\n      });\n    }\n  }, \"Prev\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    size: \"xs\",\n    isDisabled: page * 20 >= totalProducts,\n    onClick: function onClick() {\n      return setPage(function (p) {\n        return p + 1;\n      });\n    }\n  }, \"Next\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.TabPanel, {\n    p: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_BulkEditor__WEBPACK_IMPORTED_MODULE_27__[\"default\"], {\n    selectedProducts: selectedProducts,\n    stores: stores\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.TabPanel, {\n    p: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_CompareView__WEBPACK_IMPORTED_MODULE_26__[\"default\"], {\n    stores: stores,\n    compareProducts: compareProducts,\n    setCompareProducts: setCompareProducts\n  })))), editingProduct && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_ProductEditModal__WEBPACK_IMPORTED_MODULE_25__[\"default\"], {\n    product: editingProduct,\n    storeId: selectedStore,\n    stores: stores,\n    isOpen: !!editingProduct,\n    onClose: function onClose() {\n      return setEditingProduct(null);\n    }\n  }), isPro && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_SmartProductCreator_SmartProductCreator__WEBPACK_IMPORTED_MODULE_28__[\"default\"], {\n    isOpen: showSmartCreator,\n    onClose: function onClose() {\n      return setShowSmartCreator(false);\n    }\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ProFeatureModal__WEBPACK_IMPORTED_MODULE_29__[\"default\"], {\n    isOpen: isProModalOpen,\n    onClose: onProModalClose,\n    title: proFeatureType === \"smart_creator\" ? \"Smart Product Creator (Pro)\" : \"Multi-Store Product Editor (Pro)\",\n    what: proFeatureType === \"smart_creator\" ? \"A centralized product builder that allows you to create simple and variable products across multiple WooCommerce stores simultaneously.\" : \"A live, spreadsheet-style editor and single-page product manager that lets you inspect and edit product details across any connected store directly from your hub.\",\n    how: proFeatureType === \"smart_creator\" ? \"Follow a fast 3-step wizard (Select Stores → Product Details → Variations & Pricing) to deploy products instantly across your network with per-store price adjustments.\" : \"Click any product across your entire network to modify pricing, inventory levels, sale dates, descriptions, and variations without switching WordPress dashboards.\",\n    why: proFeatureType === \"smart_creator\" ? \"Eliminates repetitive data entry and saves hours by avoiding logging in and out of individual store dashboards to manually create products.\" : \"Provides a single pane of glass for rapid catalog management, allowing you to identify price discrepancies and out-of-stock items in seconds.\"\n  }));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductEditor);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/ProductEditor/ProductEditor.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/ProductEditor/components/BulkEditor.jsx"
/*!************************************************************************!*\
  !*** ./src/Pages/StoreManager/ProductEditor/components/BulkEditor.jsx ***!
  \************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/alert/alert.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/alert/alert-description.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/alert/alert-icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/divider/divider.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-control.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-label.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-header.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-overlay.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/progress/progress.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/select/select.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/spinner/spinner.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/switch/switch.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/toast/use-toast.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.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 _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\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 asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\nvar MAX_PRODUCTS = 50;\nvar BulkEditor = function BulkEditor(_ref) {\n  var _bulkActions$find;\n  var _ref$selectedProducts = _ref.selectedProducts,\n    selectedProducts = _ref$selectedProducts === void 0 ? [] : _ref$selectedProducts,\n    _ref$stores = _ref.stores,\n    stores = _ref$stores === void 0 ? [] : _ref$stores;\n  var toast = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.useToast)();\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"\"),\n    _useState2 = _slicedToArray(_useState, 2),\n    action = _useState2[0],\n    setAction = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"\"),\n    _useState4 = _slicedToArray(_useState3, 2),\n    value = _useState4[0],\n    setValue = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState6 = _slicedToArray(_useState5, 2),\n    targetStores = _useState6[0],\n    setTargetStores = _useState6[1];\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState8 = _slicedToArray(_useState7, 2),\n    loading = _useState8[0],\n    setLoading = _useState8[1];\n  var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({\n      enabled: false,\n      roundTo: \"99\",\n      roundNearest: \"1\"\n    }),\n    _useState0 = _slicedToArray(_useState9, 2),\n    smartPricing = _useState0[0],\n    setSmartPricing = _useState0[1];\n\n  // Progress Modal State\n  var _useState1 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState10 = _slicedToArray(_useState1, 2),\n    showProgress = _useState10[0],\n    setShowProgress = _useState10[1];\n  var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({\n      status: \"idle\",\n      // idle, processing, completed, error\n      current: 0,\n      total: 0,\n      message: \"\",\n      results: null\n    }),\n    _useState12 = _slicedToArray(_useState11, 2),\n    progress = _useState12[0],\n    setProgress = _useState12[1];\n  var bulkActions = [{\n    value: \"price_increase\",\n    label: \"Price Increase (Fixed)\",\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiDollarSign\n  }, {\n    value: \"price_decrease\",\n    label: \"Price Decrease (Fixed)\",\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiDollarSign\n  }, {\n    value: \"percentage_increase\",\n    label: \"Price Increase (%)\",\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiDollarSign\n  }, {\n    value: \"percentage_decrease\",\n    label: \"Price Decrease (%)\",\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiDollarSign\n  }, {\n    value: \"fixed_increase\",\n    label: \"Fixed Amount Increase\",\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiDollarSign\n  }, {\n    value: \"fixed_decrease\",\n    label: \"Fixed Amount Decrease\",\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiDollarSign\n  }, {\n    value: \"set_regular_price\",\n    label: \"Set Regular Price\",\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiDollarSign\n  }, {\n    value: \"set_sale_price\",\n    label: \"Set Sale Price\",\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiDollarSign\n  }, {\n    value: \"stock_increase\",\n    label: \"Stock Increase\",\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiPackage\n  }, {\n    value: \"stock_decrease\",\n    label: \"Stock Decrease\",\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiPackage\n  }, {\n    value: \"change_category\",\n    label: \"Change Category\",\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiTag\n  }, {\n    value: \"change_tag\",\n    label: \"Change Tag\",\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiTag\n  }, {\n    value: \"change_status\",\n    label: \"Change Status\",\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiLayers\n  }, {\n    value: \"enable_featured\",\n    label: \"Enable Featured\",\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiZap\n  }, {\n    value: \"disable_featured\",\n    label: \"Disable Featured\",\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiZap\n  }, {\n    value: \"assign_shipping_class\",\n    label: \"Assign Shipping Class\",\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiTruck\n  }];\n  var handleApply = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n      var changes, res, data, _error$response, message, _t;\n      return _regenerator().w(function (_context) {\n        while (1) switch (_context.p = _context.n) {\n          case 0:\n            if (action) {\n              _context.n = 1;\n              break;\n            }\n            toast({\n              title: \"Select an action\",\n              status: \"warning\",\n              duration: 3000\n            });\n            return _context.a(2);\n          case 1:\n            if (!(selectedProducts.length === 0)) {\n              _context.n = 2;\n              break;\n            }\n            toast({\n              title: \"No products selected\",\n              status: \"warning\",\n              duration: 3000\n            });\n            return _context.a(2);\n          case 2:\n            if (!(selectedProducts.length > MAX_PRODUCTS)) {\n              _context.n = 3;\n              break;\n            }\n            toast({\n              title: \"Too many products\",\n              description: \"Maximum \".concat(MAX_PRODUCTS, \" products allowed. You selected \").concat(selectedProducts.length, \".\"),\n              status: \"error\",\n              duration: 5000\n            });\n            return _context.a(2);\n          case 3:\n            if (!(targetStores.length === 0)) {\n              _context.n = 4;\n              break;\n            }\n            toast({\n              title: \"Select target stores\",\n              status: \"warning\",\n              duration: 3000\n            });\n            return _context.a(2);\n          case 4:\n            // Show progress modal\n            setShowProgress(true);\n            setProgress({\n              status: \"processing\",\n              current: 0,\n              total: selectedProducts.length * targetStores.length,\n              message: \"Starting bulk update...\",\n              results: null\n            });\n            setLoading(true);\n            _context.p = 5;\n            changes = {\n              action: action,\n              value: value,\n              smart_pricing: smartPricing.enabled ? smartPricing : null\n            };\n            setProgress(function (prev) {\n              return _objectSpread(_objectSpread({}, prev), {}, {\n                message: \"Processing \".concat(selectedProducts.length, \" products to \").concat(targetStores.length, \" store(s)...\")\n              });\n            });\n            _context.n = 6;\n            return axios__WEBPACK_IMPORTED_MODULE_28__[\"default\"].post(\"/product-editor/bulk-update\", {\n              product_ids: selectedProducts,\n              target_store_ids: targetStores,\n              changes: changes\n            });\n          case 6:\n            res = _context.v;\n            data = res.data;\n            setProgress({\n              status: \"completed\",\n              current: data.summary.processed + data.summary.failed + data.summary.skipped,\n              total: data.summary.total_products * data.summary.total_stores,\n              message: \"Bulk update completed!\",\n              results: data\n            });\n\n            // Reset form\n            setAction(\"\");\n            setValue(\"\");\n            setTargetStores([]);\n            _context.n = 8;\n            break;\n          case 7:\n            _context.p = 7;\n            _t = _context.v;\n            message = ((_error$response = _t.response) === null || _error$response === void 0 || (_error$response = _error$response.data) === null || _error$response === void 0 ? void 0 : _error$response.message) || _t.message;\n            setProgress({\n              status: \"error\",\n              current: 0,\n              total: 0,\n              message: message,\n              results: null\n            });\n          case 8:\n            _context.p = 8;\n            setLoading(false);\n            return _context.f(8);\n          case 9:\n            return _context.a(2);\n        }\n      }, _callee, null, [[5, 7, 8, 9]]);\n    }));\n    return function handleApply() {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  var closeProgressModal = function closeProgressModal() {\n    setShowProgress(false);\n    if (progress.status === \"completed\" || progress.status === \"error\") {\n      setProgress({\n        status: \"idle\",\n        current: 0,\n        total: 0,\n        message: \"\",\n        results: null\n      });\n    }\n  };\n  var needsValue = function needsValue() {\n    return ![\"enable_featured\", \"disable_featured\"].includes(action);\n  };\n  var isOverLimit = selectedProducts.length > MAX_PRODUCTS;\n  if (selectedProducts.length === 0) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Alert, {\n      status: \"info\",\n      borderRadius: \"md\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.AlertIcon, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.AlertDescription, null, \"Go to Products tab and select products to bulk edit.\"));\n  }\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.VStack, {\n    spacing: 4,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Box, {\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"gray.200\",\n    shadow: \"sm\",\n    p: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.VStack, {\n    spacing: 3,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.HStack, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiLayers,\n    color: \"blue.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Text, {\n    fontSize: \"lg\",\n    fontWeight: \"600\"\n  }, \"Bulk Editor\"), selectedProducts.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Badge, {\n    colorScheme: isOverLimit ? \"red\" : \"blue\",\n    fontSize: \"sm\"\n  }, selectedProducts.length, \" / \", MAX_PRODUCTS, \" products\")), isOverLimit && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Alert, {\n    status: \"error\",\n    borderRadius: \"md\",\n    size: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.AlertIcon, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.AlertDescription, {\n    fontSize: \"sm\"\n  }, \"Maximum \", MAX_PRODUCTS, \" products allowed. Please deselect \", selectedProducts.length - MAX_PRODUCTS, \" products.\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Divider, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.FormLabel, {\n    fontSize: \"sm\",\n    fontWeight: \"600\"\n  }, \"Bulk Action\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Select, {\n    size: \"sm\",\n    placeholder: \"Select action...\",\n    value: action,\n    onChange: function onChange(e) {\n      return setAction(e.target.value);\n    }\n  }, bulkActions.map(function (a) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      key: a.value,\n      value: a.value\n    }, a.label);\n  }))), needsValue() && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.FormLabel, {\n    fontSize: \"sm\",\n    fontWeight: \"600\"\n  }, \"Value\"), action === \"change_status\" ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Select, {\n    size: \"sm\",\n    value: value,\n    onChange: function onChange(e) {\n      return setValue(e.target.value);\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"publish\"\n  }, \"Published\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"draft\"\n  }, \"Draft\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"pending\"\n  }, \"Pending\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"private\"\n  }, \"Private\")) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Input, {\n    size: \"sm\",\n    type: action !== null && action !== void 0 && action.includes(\"percentage\") ? \"number\" : \"text\",\n    value: value,\n    onChange: function onChange(e) {\n      return setValue(e.target.value);\n    },\n    placeholder: action !== null && action !== void 0 && action.includes(\"percentage\") ? \"e.g., 10\" : \"Enter value...\"\n  })), ((action === null || action === void 0 ? void 0 : action.includes(\"price\")) || (action === null || action === void 0 ? void 0 : action.includes(\"increase\")) || (action === null || action === void 0 ? void 0 : action.includes(\"decrease\"))) && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Box, {\n    bg: \"blue.50\",\n    borderRadius: \"md\",\n    p: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormControl, {\n    display: \"flex\",\n    alignItems: \"center\",\n    mb: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.FormLabel, {\n    fontSize: \"sm\",\n    fontWeight: \"600\",\n    mb: 0\n  }, \"Smart Pricing\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Switch, {\n    size: \"sm\",\n    isChecked: smartPricing.enabled,\n    onChange: function onChange(e) {\n      return setSmartPricing(_objectSpread(_objectSpread({}, smartPricing), {}, {\n        enabled: e.target.checked\n      }));\n    }\n  })), smartPricing.enabled && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.HStack, {\n    spacing: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.FormLabel, {\n    fontSize: \"xs\"\n  }, \"Round Price To\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Select, {\n    size: \"xs\",\n    value: smartPricing.roundTo,\n    onChange: function onChange(e) {\n      return setSmartPricing(_objectSpread(_objectSpread({}, smartPricing), {}, {\n        roundTo: e.target.value\n      }));\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"99\"\n  }, \".99\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"95\"\n  }, \".95\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"90\"\n  }, \".90\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"00\"\n  }, \".00\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.FormLabel, {\n    fontSize: \"xs\"\n  }, \"Round Nearest\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Select, {\n    size: \"xs\",\n    value: smartPricing.roundNearest,\n    onChange: function onChange(e) {\n      return setSmartPricing(_objectSpread(_objectSpread({}, smartPricing), {}, {\n        roundNearest: e.target.value\n      }));\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"1\"\n  }, \"1\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"5\"\n  }, \"5\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"10\"\n  }, \"10\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"50\"\n  }, \"50\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"100\"\n  }, \"100\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Divider, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.FormLabel, {\n    fontSize: \"sm\",\n    fontWeight: \"600\"\n  }, \"Target Stores\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Flex, {\n    flexWrap: \"wrap\",\n    gap: 2\n  }, stores.map(function (store) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Button, {\n      key: store.id,\n      size: \"xs\",\n      variant: targetStores.includes(store.id) ? \"solid\" : \"outline\",\n      colorScheme: targetStores.includes(store.id) ? \"green\" : \"gray\",\n      onClick: function onClick() {\n        if (targetStores.includes(store.id)) {\n          setTargetStores(targetStores.filter(function (id) {\n            return id !== store.id;\n          }));\n        } else {\n          setTargetStores([].concat(_toConsumableArray(targetStores), [store.id]));\n        }\n      }\n    }, store.name);\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Button, {\n    size: \"sm\",\n    colorScheme: \"blue\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiZap, null),\n    onClick: handleApply,\n    isLoading: loading,\n    isDisabled: !action || selectedProducts.length === 0 || targetStores.length === 0 || isOverLimit\n  }, \"Apply to \", selectedProducts.length, \" Product(s) \\u2192 \", targetStores.length, \" Store(s)\"))), action && selectedProducts.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Box, {\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"gray.200\",\n    shadow: \"sm\",\n    p: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Text, {\n    fontSize: \"sm\",\n    fontWeight: \"600\",\n    mb: 2\n  }, \"Preview\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.600\"\n  }, \"Action: \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Badge, {\n    fontSize: \"xs\"\n  }, (_bulkActions$find = bulkActions.find(function (a) {\n    return a.value === action;\n  })) === null || _bulkActions$find === void 0 ? void 0 : _bulkActions$find.label)), value && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.600\"\n  }, \"Value: \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Badge, {\n    colorScheme: \"blue\",\n    fontSize: \"xs\"\n  }, value)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.600\"\n  }, \"Products: \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Badge, {\n    colorScheme: \"purple\",\n    fontSize: \"xs\"\n  }, selectedProducts.length, \" items\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.600\"\n  }, \"Target: \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Badge, {\n    colorScheme: \"green\",\n    fontSize: \"xs\"\n  }, targetStores.length, \" stores\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Modal, {\n    isOpen: showProgress,\n    onClose: closeProgressModal,\n    closeOnOverlayClick: progress.status !== \"processing\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.ModalOverlay, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.ModalContent, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.ModalHeader, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.HStack, null, progress.status === \"processing\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.Spinner, {\n    size: \"sm\",\n    color: \"blue.500\"\n  }), progress.status === \"completed\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiCheckCircle,\n    color: \"green.500\",\n    boxSize: 5\n  }), progress.status === \"error\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiXCircle,\n    color: \"red.500\",\n    boxSize: 5\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Text, null, \"Bulk Update Progress\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.ModalCloseButton, {\n    isDisabled: progress.status === \"processing\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.ModalBody, {\n    pb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.VStack, {\n    spacing: 4,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Text, {\n    fontWeight: \"500\"\n  }, progress.message), progress.status === \"processing\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Progress, {\n    value: progress.total > 0 ? progress.current / progress.total * 100 : 0,\n    size: \"sm\",\n    colorScheme: \"blue\",\n    borderRadius: \"full\",\n    isIndeterminate: progress.total === 0\n  }), progress.status === \"completed\" && progress.results && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.VStack, {\n    spacing: 3,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.HStack, {\n    justify: \"space-between\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.600\"\n  }, \"Total Products:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Badge, {\n    colorScheme: \"blue\"\n  }, progress.results.summary.total_products)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.HStack, {\n    justify: \"space-between\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.600\"\n  }, \"Target Stores:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Badge, {\n    colorScheme: \"green\"\n  }, progress.results.summary.total_stores)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Divider, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.HStack, {\n    justify: \"space-between\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.HStack, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiCheckCircle,\n    color: \"green.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Text, {\n    fontSize: \"sm\"\n  }, \"Updated:\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Badge, {\n    colorScheme: \"green\"\n  }, progress.results.summary.processed)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.HStack, {\n    justify: \"space-between\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.HStack, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiXCircle,\n    color: \"red.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Text, {\n    fontSize: \"sm\"\n  }, \"Failed:\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Badge, {\n    colorScheme: \"red\"\n  }, progress.results.summary.failed)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.HStack, {\n    justify: \"space-between\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.HStack, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_27__.FiAlertCircle,\n    color: \"orange.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Text, {\n    fontSize: \"sm\"\n  }, \"Skipped:\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Badge, {\n    colorScheme: \"orange\"\n  }, progress.results.summary.skipped)), progress.results.results && progress.results.results.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Divider, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Text, {\n    fontSize: \"sm\",\n    fontWeight: \"600\"\n  }, \"Store Details:\"), progress.results.results.map(function (result, idx) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Box, {\n      key: idx,\n      bg: \"gray.50\",\n      borderRadius: \"md\",\n      p: 2\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.HStack, {\n      justify: \"space-between\",\n      mb: 1\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Text, {\n      fontSize: \"xs\",\n      fontWeight: \"600\"\n    }, result.store_name || \"Store #\".concat(result.store_id)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Badge, {\n      fontSize: \"xs\",\n      colorScheme: result.status === \"success\" ? \"green\" : result.status === \"error\" ? \"red\" : \"orange\"\n    }, result.status)), result.updated !== undefined && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Text, {\n      fontSize: \"xs\",\n      color: \"gray.600\"\n    }, \"Updated: \", result.updated, \" | Failed: \", result.failed, \" | Skipped: \", result.skipped), result.message && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Text, {\n      fontSize: \"xs\",\n      color: \"gray.500\"\n    }, result.message));\n  }))), progress.status === \"error\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Alert, {\n    status: \"error\",\n    borderRadius: \"md\",\n    size: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.AlertIcon, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Text, {\n    fontSize: \"sm\"\n  }, progress.message)), progress.status !== \"processing\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Button, {\n    size: \"sm\",\n    onClick: closeProgressModal,\n    colorScheme: \"blue\"\n  }, \"Close\"))))));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BulkEditor);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/ProductEditor/components/BulkEditor.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/ProductEditor/components/CompareView.jsx"
/*!*************************************************************************!*\
  !*** ./src/Pages/StoreManager/ProductEditor/components/CompareView.jsx ***!
  \*************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/divider/divider.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/spinner/spinner.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tbody.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/td.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/th.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/thead.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tr.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/toast/use-toast.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\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 _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\nvar CompareView = function CompareView(_ref) {\n  var _ref$stores = _ref.stores,\n    stores = _ref$stores === void 0 ? [] : _ref$stores,\n    _ref$compareProducts = _ref.compareProducts,\n    compareProducts = _ref$compareProducts === void 0 ? [] : _ref$compareProducts,\n    setCompareProducts = _ref.setCompareProducts;\n  var toast = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.useToast)();\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState2 = _slicedToArray(_useState, 2),\n    selectedStoreIds = _useState2[0],\n    setSelectedStoreIds = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''),\n    _useState4 = _slicedToArray(_useState3, 2),\n    searchSku = _useState4[0],\n    setSearchSku = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''),\n    _useState6 = _slicedToArray(_useState5, 2),\n    searchProductId = _useState6[0],\n    setSearchProductId = _useState6[1];\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState8 = _slicedToArray(_useState7, 2),\n    loading = _useState8[0],\n    setLoading = _useState8[1];\n  var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState0 = _slicedToArray(_useState9, 2),\n    compareData = _useState0[0],\n    setCompareData = _useState0[1];\n  var handleCompare = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n      var _res$data, res, _error$response, _t;\n      return _regenerator().w(function (_context) {\n        while (1) switch (_context.p = _context.n) {\n          case 0:\n            if (!(selectedStoreIds.length < 2)) {\n              _context.n = 1;\n              break;\n            }\n            toast({\n              title: 'Select at least 2 stores',\n              status: 'warning',\n              duration: 3000\n            });\n            return _context.a(2);\n          case 1:\n            if (!(!searchSku && !searchProductId)) {\n              _context.n = 2;\n              break;\n            }\n            toast({\n              title: 'Enter SKU or Product ID',\n              status: 'warning',\n              duration: 3000\n            });\n            return _context.a(2);\n          case 2:\n            setLoading(true);\n            _context.p = 3;\n            _context.n = 4;\n            return axios__WEBPACK_IMPORTED_MODULE_20__[\"default\"].post('/product-editor/compare', {\n              sku: searchSku || null,\n              product_id: searchProductId ? parseInt(searchProductId) : null,\n              store_ids: selectedStoreIds\n            });\n          case 4:\n            res = _context.v;\n            setCompareData(((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.data) || []);\n            _context.n = 6;\n            break;\n          case 5:\n            _context.p = 5;\n            _t = _context.v;\n            toast({\n              title: 'Compare failed',\n              description: ((_error$response = _t.response) === null || _error$response === void 0 || (_error$response = _error$response.data) === null || _error$response === void 0 ? void 0 : _error$response.message) || _t.message,\n              status: 'error',\n              duration: 5000\n            });\n          case 6:\n            _context.p = 6;\n            setLoading(false);\n            return _context.f(6);\n          case 7:\n            return _context.a(2);\n        }\n      }, _callee, null, [[3, 5, 6, 7]]);\n    }));\n    return function handleCompare() {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  var removeStore = function removeStore(storeId) {\n    setSelectedStoreIds(selectedStoreIds.filter(function (id) {\n      return id !== storeId;\n    }));\n  };\n  var getDifferenceFields = function getDifferenceFields() {\n    if (compareData.length < 2) return [];\n    var fields = ['regular_price', 'sale_price', 'stock_quantity', 'stock_status', 'status'];\n    var diffFields = [];\n    fields.forEach(function (field) {\n      var values = compareData.map(function (d) {\n        var _d$product;\n        return (_d$product = d.product) === null || _d$product === void 0 ? void 0 : _d$product[field];\n      });\n      var uniqueValues = _toConsumableArray(new Set(values));\n      if (uniqueValues.length > 1) {\n        diffFields.push(field);\n      }\n    });\n    return diffFields;\n  };\n  var diffFields = getDifferenceFields();\n  var renderCompareTable = function renderCompareTable() {\n    if (compareData.length === 0) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n        textAlign: \"center\",\n        py: 10,\n        color: \"gray.500\"\n      }, \"Select stores and search for a product to compare across stores.\");\n    }\n    var fields = [{\n      key: 'name',\n      label: 'Name'\n    }, {\n      key: 'sku',\n      label: 'SKU'\n    }, {\n      key: 'regular_price',\n      label: 'Regular Price'\n    }, {\n      key: 'sale_price',\n      label: 'Sale Price'\n    }, {\n      key: 'stock_quantity',\n      label: 'Stock Qty'\n    }, {\n      key: 'stock_status',\n      label: 'Stock Status'\n    }, {\n      key: 'status',\n      label: 'Status'\n    }, {\n      key: 'weight',\n      label: 'Weight'\n    }];\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n      overflowX: \"auto\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Table, {\n      size: \"sm\",\n      variant: \"simple\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Thead, {\n      bg: \"gray.50\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Th, null, \"Field\"), compareData.map(function (d) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Th, {\n        key: d.store_id\n      }, d.store_name);\n    }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Tbody, null, fields.map(function (field) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Tr, {\n        key: field.key,\n        bg: diffFields.includes(field.key) ? 'yellow.50' : 'white'\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Td, {\n        fontWeight: \"600\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.HStack, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, null, field.label), diffFields.includes(field.key) && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Icon, {\n        as: react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiAlertCircle,\n        color: \"orange.500\",\n        boxSize: 3\n      }))), compareData.map(function (d) {\n        var _d$product2, _d$product3, _d$product4, _d$product5;\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Td, {\n          key: d.store_id,\n          fontWeight: diffFields.includes(field.key) ? '700' : 'normal',\n          color: diffFields.includes(field.key) ? 'orange.600' : 'inherit'\n        }, field.key === 'status' || field.key === 'stock_status' ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Badge, {\n          colorScheme: ((_d$product2 = d.product) === null || _d$product2 === void 0 ? void 0 : _d$product2[field.key]) === 'instock' || ((_d$product3 = d.product) === null || _d$product3 === void 0 ? void 0 : _d$product3[field.key]) === 'publish' ? 'green' : 'red',\n          fontSize: \"xs\"\n        }, ((_d$product4 = d.product) === null || _d$product4 === void 0 ? void 0 : _d$product4[field.key]) || '—') : ((_d$product5 = d.product) === null || _d$product5 === void 0 ? void 0 : _d$product5[field.key]) || '—');\n      }));\n    }))));\n  };\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.VStack, {\n    spacing: 4,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"gray.200\",\n    shadow: \"sm\",\n    p: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.VStack, {\n    spacing: 3,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontSize: \"sm\",\n    fontWeight: \"600\"\n  }, \"Compare Products Across Stores\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.HStack, {\n    spacing: 3,\n    flexWrap: \"wrap\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Input, {\n    placeholder: \"Search by SKU\",\n    value: searchSku,\n    onChange: function onChange(e) {\n      return setSearchSku(e.target.value);\n    },\n    maxW: \"200px\",\n    size: \"sm\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.500\"\n  }, \"OR\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Input, {\n    placeholder: \"Product ID\",\n    value: searchProductId,\n    onChange: function onChange(e) {\n      return setSearchProductId(e.target.value);\n    },\n    maxW: \"150px\",\n    size: \"sm\",\n    type: \"number\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Divider, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.500\",\n    mb: 2\n  }, \"Select Stores to Compare (min 2)\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Flex, {\n    flexWrap: \"wrap\",\n    gap: 2\n  }, stores.map(function (store) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Button, {\n      key: store.id,\n      size: \"xs\",\n      variant: selectedStoreIds.includes(store.id) ? 'solid' : 'outline',\n      colorScheme: selectedStoreIds.includes(store.id) ? 'blue' : 'gray',\n      onClick: function onClick() {\n        if (selectedStoreIds.includes(store.id)) {\n          removeStore(store.id);\n        } else {\n          setSelectedStoreIds([].concat(_toConsumableArray(selectedStoreIds), [store.id]));\n        }\n      }\n    }, store.name, selectedStoreIds.includes(store.id) && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiX,\n      ml: 1\n    }));\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Button, {\n    size: \"sm\",\n    colorScheme: \"purple\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiColumns, null),\n    onClick: handleCompare,\n    isLoading: loading,\n    isDisabled: selectedStoreIds.length < 2 || !searchSku && !searchProductId\n  }, \"Compare\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"gray.200\",\n    shadow: \"sm\",\n    p: 4\n  }, loading ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Flex, {\n    justify: \"center\",\n    py: 10\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Spinner, {\n    size: \"lg\",\n    color: \"purple.500\"\n  })) : renderCompareTable()), diffFields.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"orange.200\",\n    bg: \"orange.50\",\n    p: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.HStack, {\n    mb: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiAlertCircle,\n    color: \"orange.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontSize: \"sm\",\n    fontWeight: \"600\",\n    color: \"orange.700\"\n  }, \"Differences Detected\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Text, {\n    fontSize: \"xs\",\n    color: \"orange.600\"\n  }, \"The following fields have different values across stores: \", diffFields.join(', '))));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CompareView);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/ProductEditor/components/CompareView.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/ProductEditor/components/ProductEditModal.jsx"
/*!******************************************************************************!*\
  !*** ./src/Pages/StoreManager/ProductEditor/components/ProductEditModal.jsx ***!
  \******************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/checkbox/checkbox.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/close-button/close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/divider/divider.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-control.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-label.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/simple-grid.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/image/image.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-footer.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-header.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-overlay.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/number-input/number-input.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/progress/progress.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/select/select.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/spinner/spinner.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/switch/switch.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tbody.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/td.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/th.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/thead.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tr.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/tabs/tab.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/tabs/tab-list.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/tabs/tab-panel.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/tabs/tab-panels.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/tabs/tabs.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/textarea/textarea.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/toast/use-toast.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.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 _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\nvar ProductEditModal = function ProductEditModal(_ref) {\n  var product = _ref.product,\n    storeId = _ref.storeId,\n    stores = _ref.stores,\n    isOpen = _ref.isOpen,\n    onClose = _ref.onClose;\n  var toast = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_40__.useToast)();\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState2 = _slicedToArray(_useState, 2),\n    loading = _useState2[0],\n    setLoading = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState4 = _slicedToArray(_useState3, 2),\n    saving = _useState4[0],\n    setSaving = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({}),\n    _useState6 = _slicedToArray(_useState5, 2),\n    formData = _useState6[0],\n    setFormData = _useState6[1];\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState8 = _slicedToArray(_useState7, 2),\n    targetStores = _useState8[0],\n    setTargetStores = _useState8[1];\n  var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState0 = _slicedToArray(_useState9, 2),\n    activeStores = _useState0[0],\n    setActiveStores = _useState0[1];\n  var _useState1 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState10 = _slicedToArray(_useState1, 2),\n    variations = _useState10[0],\n    setVariations = _useState10[1];\n  var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState12 = _slicedToArray(_useState11, 2),\n    loadingVariations = _useState12[0],\n    setLoadingVariations = _useState12[1];\n  var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState14 = _slicedToArray(_useState13, 2),\n    featuredImage = _useState14[0],\n    setFeaturedImage = _useState14[1];\n  var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState16 = _slicedToArray(_useState15, 2),\n    featuredImagePreview = _useState16[0],\n    setFeaturedImagePreview = _useState16[1];\n  var _useState17 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState18 = _slicedToArray(_useState17, 2),\n    galleryImages = _useState18[0],\n    setGalleryImages = _useState18[1];\n  var _useState19 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState20 = _slicedToArray(_useState19, 2),\n    galleryPreviews = _useState20[0],\n    setGalleryPreviews = _useState20[1];\n  var _useState21 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState22 = _slicedToArray(_useState21, 2),\n    uploadingImages = _useState22[0],\n    setUploadingImages = _useState22[1];\n  var featuredInputRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n  var galleryInputRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    if (product) {\n      setFormData({\n        name: product.name || \"\",\n        slug: product.slug || \"\",\n        sku: product.sku || \"\",\n        status: product.status || \"publish\",\n        catalog_visibility: product.catalog_visibility || \"visible\",\n        featured: product.featured || false,\n        menu_order: product.menu_order || 0,\n        regular_price: product.regular_price || \"\",\n        sale_price: product.sale_price || \"\",\n        sale_price_date_from: product.date_on_sale_from || \"\",\n        sale_price_date_to: product.date_on_sale_to || \"\",\n        manage_stock: product.manage_stock || false,\n        stock_quantity: product.stock_quantity || 0,\n        stock_status: product.stock_status || \"instock\",\n        backorders: product.backorders || \"no\",\n        low_stock_threshold: product.low_stock_amount || 0,\n        weight: product.weight || \"\",\n        length: product.length || \"\",\n        width: product.width || \"\",\n        height: product.height || \"\",\n        shipping_class: product.shipping_class || \"\",\n        short_description: product.short_description || \"\",\n        description: product.description || \"\",\n        purchase_note: product.purchase_note || \"\",\n        reviews_enabled: product.reviews_enabled !== false,\n        categories: product.categories || [],\n        tags: product.tags || [],\n        upsell_ids: product.upsell_ids || [],\n        cross_sell_ids: product.cross_sell_ids || []\n      });\n      setTargetStores([]);\n      setVariations([]);\n\n      // Fetch variations if product is variable\n      if (product.type === 'variable') {\n        fetchVariations();\n      }\n    }\n  }, [product]);\n  var fetchVariations = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n      var _res$data, res, _error$response, _t;\n      return _regenerator().w(function (_context) {\n        while (1) switch (_context.p = _context.n) {\n          case 0:\n            setLoadingVariations(true);\n            _context.p = 1;\n            _context.n = 2;\n            return axios__WEBPACK_IMPORTED_MODULE_43__[\"default\"].get(\"/product-editor/product/\".concat(product.id, \"/variations\"), {\n              params: {\n                store_id: storeId\n              }\n            });\n          case 2:\n            res = _context.v;\n            setVariations(((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.data) || []);\n            _context.n = 4;\n            break;\n          case 3:\n            _context.p = 3;\n            _t = _context.v;\n            toast({\n              title: \"Failed to load variations\",\n              description: ((_error$response = _t.response) === null || _error$response === void 0 || (_error$response = _error$response.data) === null || _error$response === void 0 ? void 0 : _error$response.message) || _t.message,\n              status: \"error\",\n              duration: 3000\n            });\n          case 4:\n            _context.p = 4;\n            setLoadingVariations(false);\n            return _context.f(4);\n          case 5:\n            return _context.a(2);\n        }\n      }, _callee, null, [[1, 3, 4, 5]]);\n    }));\n    return function fetchVariations() {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  var handleVariationChange = function handleVariationChange(variationId, field, value) {\n    setVariations(function (prev) {\n      return prev.map(function (v) {\n        return v.id === variationId ? _objectSpread(_objectSpread({}, v), {}, _defineProperty({}, field, value)) : v;\n      });\n    });\n  };\n  var handleChange = function handleChange(field, value) {\n    setFormData(function (prev) {\n      return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, field, value));\n    });\n  };\n\n  // Image upload handlers\n  var handleFeaturedImageSelect = function handleFeaturedImageSelect(e) {\n    var _e$target$files;\n    var file = (_e$target$files = e.target.files) === null || _e$target$files === void 0 ? void 0 : _e$target$files[0];\n    if (!file) return;\n    if (!file.type.startsWith('image/')) {\n      toast({\n        title: \"Please select an image file\",\n        status: \"error\",\n        duration: 3000\n      });\n      return;\n    }\n    setFeaturedImage(file);\n    setFeaturedImagePreview(URL.createObjectURL(file));\n  };\n  var handleGalleryImagesSelect = function handleGalleryImagesSelect(e) {\n    var files = Array.from(e.target.files || []);\n    if (files.length === 0) return;\n    var validFiles = files.filter(function (f) {\n      return f.type.startsWith('image/');\n    });\n    if (validFiles.length === 0) {\n      toast({\n        title: \"Please select image files\",\n        status: \"error\",\n        duration: 3000\n      });\n      return;\n    }\n    setGalleryImages(function (prev) {\n      return [].concat(_toConsumableArray(prev), _toConsumableArray(validFiles));\n    });\n    setGalleryPreviews(function (prev) {\n      return [].concat(_toConsumableArray(prev), _toConsumableArray(validFiles.map(function (f) {\n        return URL.createObjectURL(f);\n      })));\n    });\n  };\n  var removeFeaturedImage = function removeFeaturedImage() {\n    setFeaturedImage(null);\n    setFeaturedImagePreview(null);\n    if (featuredInputRef.current) featuredInputRef.current.value = '';\n  };\n  var removeGalleryImage = function removeGalleryImage(index) {\n    setGalleryImages(function (prev) {\n      return prev.filter(function (_, i) {\n        return i !== index;\n      });\n    });\n    setGalleryPreviews(function (prev) {\n      return prev.filter(function (_, i) {\n        return i !== index;\n      });\n    });\n  };\n  var uploadImages = /*#__PURE__*/function () {\n    var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {\n      var _formData, _error$response2, _t2;\n      return _regenerator().w(function (_context2) {\n        while (1) switch (_context2.p = _context2.n) {\n          case 0:\n            if (!(!featuredImage && galleryImages.length === 0)) {\n              _context2.n = 1;\n              break;\n            }\n            toast({\n              title: \"No images to upload\",\n              status: \"warning\",\n              duration: 3000\n            });\n            return _context2.a(2);\n          case 1:\n            setUploadingImages(true);\n            _context2.p = 2;\n            _formData = new FormData();\n            _formData.append('product_id', product.id);\n            _formData.append('store_id', storeId);\n            if (featuredImage) {\n              _formData.append('featured_image', featuredImage);\n            }\n            galleryImages.forEach(function (img, idx) {\n              _formData.append(\"gallery_images[\".concat(idx, \"]\"), img);\n            });\n            _context2.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_43__[\"default\"].post('/product-editor/product/upload-images', _formData, {\n              headers: {\n                'Content-Type': 'multipart/form-data'\n              }\n            });\n          case 3:\n            toast({\n              title: \"Images uploaded successfully\",\n              status: \"success\",\n              duration: 3000\n            });\n\n            // Reset after upload\n            setFeaturedImage(null);\n            setFeaturedImagePreview(null);\n            setGalleryImages([]);\n            setGalleryPreviews([]);\n            if (featuredInputRef.current) featuredInputRef.current.value = '';\n            if (galleryInputRef.current) galleryInputRef.current.value = '';\n            _context2.n = 5;\n            break;\n          case 4:\n            _context2.p = 4;\n            _t2 = _context2.v;\n            toast({\n              title: \"Failed to upload images\",\n              description: ((_error$response2 = _t2.response) === null || _error$response2 === void 0 || (_error$response2 = _error$response2.data) === null || _error$response2 === void 0 ? void 0 : _error$response2.message) || _t2.message,\n              status: \"error\",\n              duration: 3000\n            });\n          case 5:\n            _context2.p = 5;\n            setUploadingImages(false);\n            return _context2.f(5);\n          case 6:\n            return _context2.a(2);\n        }\n      }, _callee2, null, [[2, 4, 5, 6]]);\n    }));\n    return function uploadImages() {\n      return _ref3.apply(this, arguments);\n    };\n  }();\n  var handleSave = /*#__PURE__*/function () {\n    var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {\n      var deploy,\n        _res$data2,\n        saveData,\n        endpoint,\n        payload,\n        res,\n        results,\n        successResults,\n        errorResults,\n        errorMessages,\n        _errorMessages,\n        _error$response3,\n        _args3 = arguments,\n        _t3;\n      return _regenerator().w(function (_context3) {\n        while (1) switch (_context3.p = _context3.n) {\n          case 0:\n            deploy = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : false;\n            if (formData.name) {\n              _context3.n = 1;\n              break;\n            }\n            toast({\n              title: \"Product name is required\",\n              status: \"error\",\n              duration: 3000\n            });\n            return _context3.a(2);\n          case 1:\n            setSaving(true);\n            _context3.p = 2;\n            // Include variations data if product is variable\n            saveData = _objectSpread({}, formData);\n            if ((product === null || product === void 0 ? void 0 : product.type) === 'variable' && variations.length > 0) {\n              saveData.variations = variations;\n            }\n            endpoint = deploy && targetStores.length > 0 ? \"/product-editor/deploy\" : \"/product-editor/products/update\";\n            payload = deploy && targetStores.length > 0 ? {\n              product_id: product.id,\n              source_store_id: storeId,\n              target_store_ids: targetStores,\n              changes: saveData\n            } : {\n              product_id: product.id,\n              source_store_id: storeId,\n              target_store_ids: [storeId],\n              changes: saveData\n            };\n            _context3.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_43__[\"default\"].post(endpoint, payload);\n          case 3:\n            res = _context3.v;\n            results = ((_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.results) || []; // Check results for success/error\n            successResults = results.filter(function (r) {\n              return r.status === 'success';\n            });\n            errorResults = results.filter(function (r) {\n              return r.status === 'error';\n            });\n            if (errorResults.length === 0) {\n              // All successful\n              toast({\n                title: \"Success\",\n                description: deploy ? \"Product deployed to \".concat(successResults.length, \" store(s)\") : \"Product updated successfully\",\n                status: \"success\",\n                duration: 3000\n              });\n            } else if (successResults.length === 0) {\n              // All failed - show detailed error\n              errorMessages = errorResults.map(function (r) {\n                return \"\".concat(r.store_name || 'Store', \": \").concat(r.message);\n              }).join('\\n');\n              toast({\n                title: \"Failed\",\n                description: errorMessages,\n                status: \"error\",\n                duration: 5000\n              });\n            } else {\n              // Partial success\n              _errorMessages = errorResults.map(function (r) {\n                return \"\".concat(r.store_name || 'Store', \": \").concat(r.message);\n              }).join('; ');\n              toast({\n                title: \"Partially Successful\",\n                description: \"\".concat(successResults.length, \" succeeded, \").concat(errorResults.length, \" failed. Errors: \").concat(_errorMessages),\n                status: \"warning\",\n                duration: 7000\n              });\n            }\n\n            // Close only if all successful\n            if (errorResults.length === 0) {\n              onClose();\n            }\n            _context3.n = 5;\n            break;\n          case 4:\n            _context3.p = 4;\n            _t3 = _context3.v;\n            toast({\n              title: \"Failed to save\",\n              description: ((_error$response3 = _t3.response) === null || _error$response3 === void 0 || (_error$response3 = _error$response3.data) === null || _error$response3 === void 0 ? void 0 : _error$response3.message) || _t3.message,\n              status: \"error\",\n              duration: 5000\n            });\n          case 5:\n            _context3.p = 5;\n            setSaving(false);\n            return _context3.f(5);\n          case 6:\n            return _context3.a(2);\n        }\n      }, _callee3, null, [[2, 4, 5, 6]]);\n    }));\n    return function handleSave() {\n      return _ref4.apply(this, arguments);\n    };\n  }();\n  var renderTabContent = function renderTabContent() {\n    var _product$images, _product$images2, _product$images3;\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_37__.TabPanels, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.TabPanel, {\n      px: 0\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.VStack, {\n      spacing: 4,\n      align: \"stretch\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n      fontSize: \"sm\",\n      fontWeight: \"600\"\n    }, \"Product Name\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Input, {\n      size: \"sm\",\n      value: formData.name,\n      onChange: function onChange(e) {\n        return handleChange(\"name\", e.target.value);\n      }\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.HStack, {\n      spacing: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n      fontSize: \"sm\",\n      fontWeight: \"600\"\n    }, \"Slug\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Input, {\n      size: \"sm\",\n      value: formData.slug,\n      onChange: function onChange(e) {\n        return handleChange(\"slug\", e.target.value);\n      }\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n      fontSize: \"sm\",\n      fontWeight: \"600\"\n    }, \"SKU\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Input, {\n      size: \"sm\",\n      value: formData.sku,\n      onChange: function onChange(e) {\n        return handleChange(\"sku\", e.target.value);\n      }\n    }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.HStack, {\n      spacing: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n      fontSize: \"sm\",\n      fontWeight: \"600\"\n    }, \"Status\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Select, {\n      size: \"sm\",\n      value: formData.status,\n      onChange: function onChange(e) {\n        return handleChange(\"status\", e.target.value);\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      value: \"publish\"\n    }, \"Published\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      value: \"draft\"\n    }, \"Draft\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      value: \"pending\"\n    }, \"Pending Review\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      value: \"private\"\n    }, \"Private\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n      fontSize: \"sm\",\n      fontWeight: \"600\"\n    }, \"Catalog Visibility\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Select, {\n      size: \"sm\",\n      value: formData.catalog_visibility,\n      onChange: function onChange(e) {\n        return handleChange(\"catalog_visibility\", e.target.value);\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      value: \"visible\"\n    }, \"Shop & Search\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      value: \"catalog\"\n    }, \"Catalog Only\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      value: \"search\"\n    }, \"Search Only\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      value: \"hidden\"\n    }, \"Hidden\")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.HStack, {\n      spacing: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, {\n      display: \"flex\",\n      alignItems: \"center\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n      fontSize: \"sm\",\n      fontWeight: \"600\",\n      mb: 0\n    }, \"Featured\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Switch, {\n      size: \"sm\",\n      isChecked: formData.featured,\n      onChange: function onChange(e) {\n        return handleChange(\"featured\", e.target.checked);\n      }\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n      fontSize: \"sm\",\n      fontWeight: \"600\"\n    }, \"Menu Order\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.NumberInput, {\n      size: \"sm\",\n      value: formData.menu_order,\n      onChange: function onChange(v) {\n        return handleChange(\"menu_order\", v);\n      },\n      min: 0\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.NumberInputField, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.NumberInputStepper, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.NumberIncrementStepper, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.NumberDecrementStepper, null))))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.TabPanel, {\n      px: 0\n    }, (product === null || product === void 0 ? void 0 : product.type) === 'variable' ?\n    /*#__PURE__*/\n    /* Variable Product - Variations Table */\n    react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.VStack, {\n      spacing: 4,\n      align: \"stretch\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_41__.Text, {\n      fontSize: \"sm\",\n      fontWeight: \"600\"\n    }, \"Variations\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_41__.Text, {\n      fontSize: \"xs\",\n      color: \"gray.500\"\n    }, \"Edit prices for each variation individually.\"), loadingVariations ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n      justify: \"center\",\n      py: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Spinner, {\n      size: \"sm\",\n      color: \"blue.500\"\n    })) : variations.length === 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_41__.Text, {\n      fontSize: \"sm\",\n      color: \"gray.500\",\n      textAlign: \"center\",\n      py: 4\n    }, \"No variations found.\") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n      overflowX: \"auto\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Table, {\n      size: \"sm\",\n      variant: \"simple\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Thead, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, null, \"Variation\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, null, \"Attributes\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, null, \"SKU\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, {\n      isNumeric: true\n    }, \"Regular Price\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, {\n      isNumeric: true\n    }, \"Sale Price\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, null, \"Stock\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Tbody, null, variations.map(function (variation) {\n      var _variation$attributes;\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tr, {\n        key: variation.id\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_41__.Text, {\n        fontSize: \"xs\",\n        fontWeight: \"500\"\n      }, \"#\", variation.id)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n        flexWrap: \"wrap\",\n        gap: 1\n      }, (_variation$attributes = variation.attributes) === null || _variation$attributes === void 0 ? void 0 : _variation$attributes.map(function (attr, idx) {\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Badge, {\n          key: idx,\n          fontSize: \"2xs\",\n          colorScheme: \"purple\"\n        }, attr.option);\n      }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Input, {\n        size: \"xs\",\n        value: variation.sku || \"\",\n        onChange: function onChange(e) {\n          return handleVariationChange(variation.id, \"sku\", e.target.value);\n        },\n        placeholder: \"SKU\"\n      })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Input, {\n        size: \"xs\",\n        type: \"number\",\n        value: variation.regular_price || \"\",\n        onChange: function onChange(e) {\n          return handleVariationChange(variation.id, \"regular_price\", e.target.value);\n        },\n        placeholder: \"0.00\"\n      })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Input, {\n        size: \"xs\",\n        type: \"number\",\n        value: variation.sale_price || \"\",\n        onChange: function onChange(e) {\n          return handleVariationChange(variation.id, \"sale_price\", e.target.value);\n        },\n        placeholder: \"0.00\"\n      })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Input, {\n        size: \"xs\",\n        type: \"number\",\n        value: variation.stock_quantity || 0,\n        onChange: function onChange(e) {\n          return handleVariationChange(variation.id, \"stock_quantity\", e.target.value);\n        }\n      })));\n    }))))) :\n    /*#__PURE__*/\n    /* Simple Product - Regular Price Fields */\n    react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.VStack, {\n      spacing: 4,\n      align: \"stretch\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.HStack, {\n      spacing: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n      fontSize: \"sm\",\n      fontWeight: \"600\"\n    }, \"Regular Price\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Input, {\n      size: \"sm\",\n      type: \"number\",\n      value: formData.regular_price,\n      onChange: function onChange(e) {\n        return handleChange(\"regular_price\", e.target.value);\n      }\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n      fontSize: \"sm\",\n      fontWeight: \"600\"\n    }, \"Sale Price\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Input, {\n      size: \"sm\",\n      type: \"number\",\n      value: formData.sale_price,\n      onChange: function onChange(e) {\n        return handleChange(\"sale_price\", e.target.value);\n      }\n    }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.HStack, {\n      spacing: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n      fontSize: \"sm\",\n      fontWeight: \"600\"\n    }, \"Sale From\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Input, {\n      size: \"sm\",\n      type: \"date\",\n      value: formData.sale_price_date_from,\n      onChange: function onChange(e) {\n        return handleChange(\"sale_price_date_from\", e.target.value);\n      }\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n      fontSize: \"sm\",\n      fontWeight: \"600\"\n    }, \"Sale To\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Input, {\n      size: \"sm\",\n      type: \"date\",\n      value: formData.sale_price_date_to,\n      onChange: function onChange(e) {\n        return handleChange(\"sale_price_date_to\", e.target.value);\n      }\n    }))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.TabPanel, {\n      px: 0\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.VStack, {\n      spacing: 4,\n      align: \"stretch\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, {\n      display: \"flex\",\n      alignItems: \"center\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n      fontSize: \"sm\",\n      fontWeight: \"600\",\n      mb: 0\n    }, \"Manage Stock\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Switch, {\n      size: \"sm\",\n      isChecked: formData.manage_stock,\n      onChange: function onChange(e) {\n        return handleChange(\"manage_stock\", e.target.checked);\n      }\n    })), formData.manage_stock && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.HStack, {\n      spacing: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n      fontSize: \"sm\",\n      fontWeight: \"600\"\n    }, \"Stock Quantity\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.NumberInput, {\n      size: \"sm\",\n      value: formData.stock_quantity,\n      onChange: function onChange(v) {\n        return handleChange(\"stock_quantity\", v);\n      },\n      min: 0\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.NumberInputField, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.NumberInputStepper, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.NumberIncrementStepper, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.NumberDecrementStepper, null)))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n      fontSize: \"sm\",\n      fontWeight: \"600\"\n    }, \"Low Stock Threshold\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.NumberInput, {\n      size: \"sm\",\n      value: formData.low_stock_threshold,\n      onChange: function onChange(v) {\n        return handleChange(\"low_stock_threshold\", v);\n      },\n      min: 0\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.NumberInputField, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.NumberInputStepper, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.NumberIncrementStepper, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.NumberDecrementStepper, null))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.HStack, {\n      spacing: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n      fontSize: \"sm\",\n      fontWeight: \"600\"\n    }, \"Stock Status\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Select, {\n      size: \"sm\",\n      value: formData.stock_status,\n      onChange: function onChange(e) {\n        return handleChange(\"stock_status\", e.target.value);\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      value: \"instock\"\n    }, \"In Stock\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      value: \"outofstock\"\n    }, \"Out of Stock\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      value: \"onbackorder\"\n    }, \"On Backorder\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n      fontSize: \"sm\",\n      fontWeight: \"600\"\n    }, \"Backorders\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Select, {\n      size: \"sm\",\n      value: formData.backorders,\n      onChange: function onChange(e) {\n        return handleChange(\"backorders\", e.target.value);\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      value: \"no\"\n    }, \"Do not allow\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      value: \"notify\"\n    }, \"Allow, but notify\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      value: \"yes\"\n    }, \"Allow\")))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.TabPanel, {\n      px: 0\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.VStack, {\n      spacing: 4,\n      align: \"stretch\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n      fontSize: \"sm\",\n      fontWeight: \"600\"\n    }, \"Short Description\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__.Textarea, {\n      size: \"sm\",\n      rows: 3,\n      value: formData.short_description,\n      onChange: function onChange(e) {\n        return handleChange(\"short_description\", e.target.value);\n      }\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n      fontSize: \"sm\",\n      fontWeight: \"600\"\n    }, \"Full Description\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__.Textarea, {\n      size: \"sm\",\n      rows: 6,\n      value: formData.description,\n      onChange: function onChange(e) {\n        return handleChange(\"description\", e.target.value);\n      }\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n      fontSize: \"sm\",\n      fontWeight: \"600\"\n    }, \"Purchase Note\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Input, {\n      size: \"sm\",\n      value: formData.purchase_note,\n      onChange: function onChange(e) {\n        return handleChange(\"purchase_note\", e.target.value);\n      }\n    })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.TabPanel, {\n      px: 0\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.VStack, {\n      spacing: 5,\n      align: \"stretch\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_41__.Text, {\n      fontSize: \"sm\",\n      fontWeight: \"600\",\n      mb: 2\n    }, \"Featured Image\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.HStack, {\n      spacing: 3,\n      align: \"start\"\n    }, featuredImagePreview ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n      position: \"relative\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Image, {\n      src: featuredImagePreview,\n      alt: \"Featured preview\",\n      boxSize: \"100px\",\n      objectFit: \"cover\",\n      borderRadius: \"md\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.CloseButton, {\n      size: \"sm\",\n      position: \"absolute\",\n      top: \"-8px\",\n      right: \"-8px\",\n      bg: \"red.500\",\n      color: \"white\",\n      _hover: {\n        bg: \"red.600\"\n      },\n      onClick: removeFeaturedImage\n    })) : product !== null && product !== void 0 && (_product$images = product.images) !== null && _product$images !== void 0 && _product$images[0] ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Image, {\n      src: product.images[0].src,\n      alt: product.name,\n      boxSize: \"100px\",\n      objectFit: \"cover\",\n      borderRadius: \"md\"\n    }) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n      boxSize: \"100px\",\n      bg: \"gray.100\",\n      borderRadius: \"md\",\n      display: \"flex\",\n      alignItems: \"center\",\n      justifyContent: \"center\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_42__.FiImage,\n      color: \"gray.400\",\n      boxSize: 6\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.VStack, {\n      align: \"start\",\n      spacing: 1\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"input\", {\n      type: \"file\",\n      ref: featuredInputRef,\n      accept: \"image/*\",\n      onChange: handleFeaturedImageSelect,\n      style: {\n        display: 'none'\n      }\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Button, {\n      size: \"xs\",\n      leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Icon, {\n        as: react_icons_fi__WEBPACK_IMPORTED_MODULE_42__.FiUpload\n      }),\n      onClick: function onClick() {\n        var _featuredInputRef$cur;\n        return (_featuredInputRef$cur = featuredInputRef.current) === null || _featuredInputRef$cur === void 0 ? void 0 : _featuredInputRef$cur.click();\n      }\n    }, product !== null && product !== void 0 && (_product$images2 = product.images) !== null && _product$images2 !== void 0 && _product$images2[0] ? 'Change' : 'Upload'), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_41__.Text, {\n      fontSize: \"2xs\",\n      color: \"gray.500\"\n    }, \"Recommended: 800x800px\")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Divider, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_41__.Text, {\n      fontSize: \"sm\",\n      fontWeight: \"600\",\n      mb: 2\n    }, \"Gallery Images\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.SimpleGrid, {\n      columns: 4,\n      spacing: 2,\n      mb: 3\n    }, product === null || product === void 0 || (_product$images3 = product.images) === null || _product$images3 === void 0 ? void 0 : _product$images3.slice(1).map(function (img, idx) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Image, {\n        key: \"existing-\".concat(idx),\n        src: img.src,\n        alt: img.alt || \"Gallery \".concat(idx + 1),\n        boxSize: \"70px\",\n        objectFit: \"cover\",\n        borderRadius: \"md\"\n      });\n    }), galleryPreviews.map(function (src, idx) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n        key: \"new-\".concat(idx),\n        position: \"relative\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Image, {\n        src: src,\n        alt: \"New gallery \".concat(idx + 1),\n        boxSize: \"70px\",\n        objectFit: \"cover\",\n        borderRadius: \"md\"\n      }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.CloseButton, {\n        size: \"sm\",\n        position: \"absolute\",\n        top: \"-6px\",\n        right: \"-6px\",\n        bg: \"red.500\",\n        color: \"white\",\n        _hover: {\n          bg: \"red.600\"\n        },\n        onClick: function onClick() {\n          return removeGalleryImage(idx);\n        }\n      }));\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"input\", {\n      type: \"file\",\n      ref: galleryInputRef,\n      accept: \"image/*\",\n      multiple: true,\n      onChange: handleGalleryImagesSelect,\n      style: {\n        display: 'none'\n      }\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Button, {\n      size: \"xs\",\n      leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Icon, {\n        as: react_icons_fi__WEBPACK_IMPORTED_MODULE_42__.FiUpload\n      }),\n      variant: \"outline\",\n      onClick: function onClick() {\n        var _galleryInputRef$curr;\n        return (_galleryInputRef$curr = galleryInputRef.current) === null || _galleryInputRef$curr === void 0 ? void 0 : _galleryInputRef$curr.click();\n      }\n    }, \"Add Gallery Images\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Divider, null), (featuredImage || galleryImages.length > 0) && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, null, uploadingImages && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Progress, {\n      size: \"xs\",\n      isIndeterminate: true,\n      mb: 2\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Button, {\n      size: \"sm\",\n      colorScheme: \"blue\",\n      leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Icon, {\n        as: react_icons_fi__WEBPACK_IMPORTED_MODULE_42__.FiUpload\n      }),\n      isLoading: uploadingImages,\n      loadingText: \"Uploading...\",\n      onClick: uploadImages,\n      w: \"full\"\n    }, \"Upload Images\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_41__.Text, {\n      fontSize: \"2xs\",\n      color: \"gray.500\",\n      mt: 1\n    }, featuredImage && 'Featured image', featuredImage && galleryImages.length > 0 && ' + ', galleryImages.length > 0 && \"\".concat(galleryImages.length, \" gallery image(s)\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.TabPanel, {\n      px: 0\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.VStack, {\n      spacing: 4,\n      align: \"stretch\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormControl, {\n      display: \"flex\",\n      alignItems: \"center\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n      fontSize: \"sm\",\n      fontWeight: \"600\",\n      mb: 0\n    }, \"Enable Reviews\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Switch, {\n      size: \"sm\",\n      isChecked: formData.reviews_enabled,\n      onChange: function onChange(e) {\n        return handleChange(\"reviews_enabled\", e.target.checked);\n      }\n    })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.TabPanel, {\n      px: 0\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.VStack, {\n      spacing: 4,\n      align: \"stretch\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_41__.Text, {\n      m: 0,\n      fontSize: \"sm\",\n      fontWeight: \"600\"\n    }, \"Select Target Stores for Push\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_41__.Text, {\n      m: 0,\n      fontSize: \"xs\",\n      color: \"gray.500\"\n    }, \"Choose which stores to push these changes to.\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n      p: 2,\n      bg: \"orange.50\",\n      borderRadius: \"md\",\n      borderLeft: \"3px\",\n      borderColor: \"orange.400\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_41__.Text, {\n      m: 0,\n      fontSize: \"xs\",\n      color: \"orange.700\",\n      fontWeight: \"500\"\n    }, \"\\u26A0\\uFE0F Warning: The product must exist in the target store with the same SKU for push to work.\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.VStack, {\n      align: \"stretch\",\n      spacing: 2,\n      maxH: \"200px\",\n      overflowY: \"auto\"\n    }, stores.map(function (store) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Checkbox, {\n        key: store.id,\n        isChecked: targetStores.includes(store.id),\n        onChange: function onChange(e) {\n          if (e.target.checked) {\n            setTargetStores([].concat(_toConsumableArray(targetStores), [store.id]));\n          } else {\n            setTargetStores(targetStores.filter(function (id) {\n              return id !== store.id;\n            }));\n          }\n        }\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_41__.Text, {\n        m: 0,\n        fontSize: \"sm\"\n      }, store.name));\n    })), targetStores.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Badge, {\n      colorScheme: \"green\",\n      fontSize: \"sm\"\n    }, targetStores.length, \" store(s) selected\"))));\n  };\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Modal, {\n    isOpen: isOpen,\n    onClose: onClose,\n    size: \"4xl\",\n    scrollBehavior: \"inside\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.ModalOverlay, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.ModalContent, {\n    maxW: \"900px\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.ModalHeader, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.HStack, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_42__.FiPackage\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_41__.Text, null, \"Edit: \", product === null || product === void 0 ? void 0 : product.name))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.ModalCloseButton, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.ModalBody, {\n    pb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.Tabs, {\n    variant: \"enclosed\",\n    colorScheme: \"blue\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.TabList, {\n    flexWrap: \"wrap\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Tab, {\n    fontSize: \"xs\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_42__.FiPackage,\n    mr: 1\n  }), \"Basic\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Tab, {\n    fontSize: \"xs\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_42__.FiDollarSign,\n    mr: 1\n  }), \"Pricing\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Tab, {\n    fontSize: \"xs\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_42__.FiPackage,\n    mr: 1\n  }), \"Inventory\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Tab, {\n    fontSize: \"xs\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_42__.FiSettings,\n    mr: 1\n  }), \"Content\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Tab, {\n    fontSize: \"xs\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_42__.FiImage,\n    mr: 1\n  }), \"Media\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Tab, {\n    fontSize: \"xs\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_42__.FiSettings,\n    mr: 1\n  }), \"Advanced\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Tab, {\n    fontSize: \"xs\",\n    color: \"green.500\"\n  }, \"Push\")), renderTabContent())), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.ModalFooter, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.HStack, {\n    spacing: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Button, {\n    size: \"sm\",\n    variant: \"outline\",\n    onClick: onClose\n  }, \"Cancel\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Button, {\n    size: \"sm\",\n    colorScheme: \"blue\",\n    isLoading: saving,\n    onClick: function onClick() {\n      return handleSave(false);\n    }\n  }, \"Save to Source Store\"), targetStores.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Button, {\n    size: \"sm\",\n    colorScheme: \"green\",\n    isLoading: saving,\n    onClick: function onClick() {\n      return handleSave(true);\n    }\n  }, \"Deploy to \", targetStores.length, \" Store(s)\")))));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductEditModal);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/ProductEditor/components/ProductEditModal.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/ProductEditor/components/ProductTable.jsx"
/*!**************************************************************************!*\
  !*** ./src/Pages/StoreManager/ProductEditor/components/ProductTable.jsx ***!
  \**************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/icon-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/checkbox/checkbox.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/image/image.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/skeleton/skeleton.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tbody.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/td.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/th.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/thead.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tr.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/tooltip/tooltip.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\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 _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 _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 _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; }\n\n\n\nvar ProductTable = function ProductTable(_ref) {\n  var _ref$products = _ref.products,\n    products = _ref$products === void 0 ? [] : _ref$products,\n    _ref$loading = _ref.loading,\n    loading = _ref$loading === void 0 ? false : _ref$loading,\n    _ref$selectedProducts = _ref.selectedProducts,\n    selectedProducts = _ref$selectedProducts === void 0 ? [] : _ref$selectedProducts,\n    onSelectProduct = _ref.onSelectProduct,\n    onEdit = _ref.onEdit,\n    onCompare = _ref.onCompare,\n    onView = _ref.onView,\n    _ref$isPro = _ref.isPro,\n    isPro = _ref$isPro === void 0 ? false : _ref$isPro,\n    onProModalOpen = _ref.onProModalOpen;\n  // Ensure products is always an array\n  var safeProducts = Array.isArray(products) ? products : [];\n  var getStatusColor = function getStatusColor(status) {\n    switch (status) {\n      case \"publish\":\n        return \"green\";\n      case \"draft\":\n        return \"yellow\";\n      case \"pending\":\n        return \"orange\";\n      case \"private\":\n        return \"gray\";\n      default:\n        return \"gray\";\n    }\n  };\n  var getStockColor = function getStockColor(stockStatus) {\n    switch (stockStatus) {\n      case \"instock\":\n        return \"green\";\n      case \"outofstock\":\n        return \"red\";\n      case \"onbackorder\":\n        return \"orange\";\n      default:\n        return \"gray\";\n    }\n  };\n  if (loading) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Table, {\n      size: \"sm\",\n      variant: \"simple\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Thead, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Th, {\n      px: 2\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Skeleton, {\n      height: \"20px\",\n      width: \"20px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Th, null, \"Image\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Th, null, \"Product\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Th, null, \"SKU\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Th, null, \"Price\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Th, null, \"Stock\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Th, null, \"Status\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Th, null, \"Actions\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Tbody, null, _toConsumableArray(Array(5)).map(function (_, i) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Tr, {\n        key: i\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Td, {\n        px: 2\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Skeleton, {\n        height: \"20px\"\n      })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Skeleton, {\n        height: \"40px\",\n        width: \"40px\"\n      })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Skeleton, {\n        height: \"20px\",\n        width: \"150px\"\n      })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Skeleton, {\n        height: \"20px\",\n        width: \"80px\"\n      })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Skeleton, {\n        height: \"20px\",\n        width: \"60px\"\n      })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Skeleton, {\n        height: \"20px\",\n        width: \"50px\"\n      })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Skeleton, {\n        height: \"20px\",\n        width: \"70px\"\n      })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Skeleton, {\n        height: \"20px\",\n        width: \"80px\"\n      })));\n    })));\n  }\n  if (safeProducts.length === 0) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Text, {\n      textAlign: \"center\",\n      py: 10,\n      color: \"gray.500\"\n    }, \"No products found. Select a store to load products.\");\n  }\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Table, {\n    size: \"sm\",\n    variant: \"simple\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Thead, {\n    bg: \"gray.50\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Th, {\n    px: 2,\n    w: \"40px\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Checkbox, {\n    isChecked: selectedProducts.length === safeProducts.length && safeProducts.length > 0,\n    isIndeterminate: selectedProducts.length > 0 && selectedProducts.length < safeProducts.length,\n    onChange: function onChange() {\n      if (selectedProducts.length === safeProducts.length) {\n        selectedProducts.forEach(function (id) {\n          return onSelectProduct(id);\n        });\n      } else {\n        safeProducts.forEach(function (p) {\n          if (!selectedProducts.includes(p.id)) {\n            onSelectProduct(p.id);\n          }\n        });\n      }\n    }\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Th, null, \"Image\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Th, null, \"Product\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Th, null, \"SKU\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Th, null, \"Price\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Th, null, \"Stock\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Th, null, \"Status\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Th, null, \"Actions\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Tbody, null, safeProducts.map(function (product) {\n    var _product$images, _product$categories;\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Tr, {\n      key: product.id,\n      bg: selectedProducts.includes(product.id) ? \"blue.50\" : \"white\",\n      _hover: {\n        bg: \"gray.50\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Td, {\n      px: 2\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Checkbox, {\n      isChecked: selectedProducts.includes(product.id),\n      onChange: function onChange() {\n        return onSelectProduct(product.id);\n      }\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Image, {\n      src: ((_product$images = product.images) === null || _product$images === void 0 || (_product$images = _product$images[0]) === null || _product$images === void 0 ? void 0 : _product$images.src) || \"/wp-content/uploads/woocommerce-placeholder.png\",\n      alt: product.name,\n      boxSize: \"40px\",\n      objectFit: \"cover\",\n      borderRadius: \"md\",\n      fallbackSrc: \"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Crect width='40' height='40' fill='%23f0f0f0'/%3E%3Ctext x='50%25' y='50%25' text-anchor='middle' dy='.3em' fill='%23999' font-size='10'%3EIMG%3C/text%3E%3C/svg%3E\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Text, {\n      fontWeight: \"600\",\n      fontSize: \"sm\",\n      noOfLines: 1\n    }, product.name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Text, {\n      fontSize: \"xs\",\n      color: \"gray.500\"\n    }, product.type, \" \\u2022 \", ((_product$categories = product.categories) === null || _product$categories === void 0 ? void 0 : _product$categories.map(function (c) {\n      return c.name;\n    }).join(\", \")) || \"Uncategorized\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Text, {\n      fontSize: \"xs\",\n      fontFamily: \"mono\"\n    }, product.sku || \"—\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Text, {\n      fontWeight: \"600\",\n      fontSize: \"sm\"\n    }, product.sale_price ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Text, {\n      as: \"span\",\n      textDecoration: \"line-through\",\n      color: \"gray.400\",\n      mr: 1\n    }, product.regular_price), product.sale_price) : product.regular_price || \"—\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Badge, {\n      colorScheme: getStockColor(product.stock_status),\n      fontSize: \"xs\"\n    }, product.manage_stock ? product.stock_quantity : product.stock_status)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Badge, {\n      colorScheme: getStatusColor(product.status),\n      fontSize: \"xs\",\n      textTransform: \"capitalize\"\n    }, product.status)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.HStack, {\n      spacing: 1\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Tooltip, {\n      label: isPro ? \"Edit Product\" : \"Edit (Pro Feature)\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.IconButton, {\n      icon: isPro ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_15__.FiEdit2, null) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_15__.FiLock, null),\n      size: \"xs\",\n      variant: \"ghost\",\n      colorScheme: isPro ? \"blue\" : \"gray\",\n      onClick: isPro ? function () {\n        return onEdit(product);\n      } : onProModalOpen,\n      \"aria-label\": isPro ? \"Edit\" : \"Pro Feature\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.IconButton, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_15__.FiColumns, null),\n      size: \"xs\",\n      variant: \"ghost\",\n      colorScheme: \"purple\",\n      onClick: function onClick() {\n        return onCompare(product);\n      },\n      \"aria-label\": \"Compare\"\n    }), onView && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.IconButton, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_15__.FiEye, null),\n      size: \"xs\",\n      variant: \"ghost\",\n      onClick: function onClick() {\n        return onView(product);\n      },\n      \"aria-label\": \"View\"\n    }))));\n  })));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductTable);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/ProductEditor/components/ProductTable.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Products/AllProduct.jsx"
/*!********************************************************!*\
  !*** ./src/Pages/StoreManager/Products/AllProduct.jsx ***!
  \********************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _utils_exportUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../utils/exportUtils */ \"./src/utils/exportUtils.js\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/hooks/dist/esm/use-disclosure.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/icon-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/checkbox/checkbox.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/color-mode/color-mode-context.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/image/image.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/menu/menu.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/menu/menu-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/menu/menu-item.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/menu/menu-list.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-arrow.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-trigger.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/skeleton/skeleton.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table-container.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tbody.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/td.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/th.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/thead.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tr.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/heading.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router/dist/development/chunk-EPOLDU6W.mjs\");\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! lodash.debounce */ \"./node_modules/lodash.debounce/index.js\");\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_38___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_38__);\n/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! react-hot-toast */ \"./node_modules/react-hot-toast/dist/index.mjs\");\n/* harmony import */ var react_icons_fa__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! react-icons/fa */ \"./node_modules/react-icons/fa/index.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var _Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ../../../Components/shared/ConfirmDialog */ \"./src/Components/shared/ConfirmDialog.jsx\");\n/* harmony import */ var _Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ../../../Components/shared/DatePicker */ \"./src/Components/shared/DatePicker.jsx\");\n/* harmony import */ var _utils_FormatDate__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ../../../utils/FormatDate */ \"./src/utils/FormatDate.js\");\n/* harmony import */ var _SyncProductsModal__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./SyncProductsModal */ \"./src/Pages/StoreManager/Products/SyncProductsModal.jsx\");\n/* harmony import */ var _GlobalPriceModal__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./GlobalPriceModal */ \"./src/Pages/StoreManager/Products/GlobalPriceModal.jsx\");\n/* harmony import */ var _Components_shared_ProFeatureModal__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ../../../Components/shared/ProFeatureModal */ \"./src/Components/shared/ProFeatureModal.jsx\");\n/* harmony import */ var _SmartProductCreator_SmartProductCreator__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ../SmartProductCreator/SmartProductCreator */ \"./src/Pages/StoreManager/SmartProductCreator/SmartProductCreator.jsx\");\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 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 _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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 _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\n\n\n\n\n\n\n\n\n\n\n\n\nvar AllProduct = function AllProduct() {\n  var _window$shopCentralDa;\n  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_37__.useNavigate)();\n  var _useDisclosure = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.useDisclosure)(),\n    isSyncOpen = _useDisclosure.isOpen,\n    onSyncOpen = _useDisclosure.onOpen,\n    onSyncClose = _useDisclosure.onClose;\n  var _useDisclosure2 = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.useDisclosure)(),\n    isPriceOpen = _useDisclosure2.isOpen,\n    onPriceOpen = _useDisclosure2.onOpen,\n    onPriceClose = _useDisclosure2.onClose;\n  var _useDisclosure3 = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.useDisclosure)(),\n    isBulkConfirmOpen = _useDisclosure3.isOpen,\n    onBulkConfirmOpen = _useDisclosure3.onOpen,\n    onBulkConfirmClose = _useDisclosure3.onClose;\n  var _useDisclosure4 = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.useDisclosure)(),\n    isRowConfirmOpen = _useDisclosure4.isOpen,\n    onRowConfirmOpen = _useDisclosure4.onOpen,\n    onRowConfirmClose = _useDisclosure4.onClose;\n  var _useDisclosure5 = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.useDisclosure)(),\n    isProModalOpen = _useDisclosure5.isOpen,\n    onProModalOpen = _useDisclosure5.onOpen,\n    onProModalClose = _useDisclosure5.onClose;\n  var isPro = (_window$shopCentralDa = window.shopCentralData) === null || _window$shopCentralDa === void 0 ? void 0 : _window$shopCentralDa.isPro;\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState2 = _slicedToArray(_useState, 2),\n    showSmartCreator = _useState2[0],\n    setShowSmartCreator = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"smart_creator\"),\n    _useState4 = _slicedToArray(_useState3, 2),\n    proFeatureType = _useState4[0],\n    setProFeatureType = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState6 = _slicedToArray(_useState5, 2),\n    productToDelete = _useState6[0],\n    setProductToDelete = _useState6[1];\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState8 = _slicedToArray(_useState7, 2),\n    isDeleting = _useState8[0],\n    setIsDeleting = _useState8[1];\n  var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState0 = _slicedToArray(_useState9, 2),\n    products = _useState0[0],\n    setProducts = _useState0[1];\n  var _useState1 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState10 = _slicedToArray(_useState1, 2),\n    productStats = _useState10[0],\n    setProductStats = _useState10[1];\n  var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),\n    _useState12 = _slicedToArray(_useState11, 2),\n    loading = _useState12[0],\n    setLoading = _useState12[1];\n  var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0),\n    _useState14 = _slicedToArray(_useState13, 2),\n    totalRows = _useState14[0],\n    setTotalRows = _useState14[1];\n  var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(10),\n    _useState16 = _slicedToArray(_useState15, 2),\n    perPage = _useState16[0],\n    setPerPage = _useState16[1];\n  var _useState17 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1),\n    _useState18 = _slicedToArray(_useState17, 2),\n    currentPage = _useState18[0],\n    setCurrentPage = _useState18[1];\n  var _useState19 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"\"),\n    _useState20 = _slicedToArray(_useState19, 2),\n    searchTerm = _useState20[0],\n    setSearchTerm = _useState20[1];\n  var _useState21 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({\n      status: \"any\",\n      type: \"\",\n      stockStatus: \"\"\n    }),\n    _useState22 = _slicedToArray(_useState21, 2),\n    filters = _useState22[0],\n    setFilters = _useState22[1];\n  var _useState23 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState24 = _slicedToArray(_useState23, 2),\n    selectedRows = _useState24[0],\n    setSelectedRows = _useState24[1];\n  var _useState25 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_43__.getAllTimeRange)()),\n    _useState26 = _slicedToArray(_useState25, 2),\n    dateRange = _useState26[0],\n    setDateRange = _useState26[1];\n  var _useState27 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({\n      key: null,\n      direction: \"asc\"\n    }),\n    _useState28 = _slicedToArray(_useState27, 2),\n    sortConfig = _useState28[0],\n    setSortConfig = _useState28[1];\n  var toggleSelectRow = function toggleSelectRow(id) {\n    setSelectedRows(function (prev) {\n      return prev.includes(id) ? prev.filter(function (rowId) {\n        return rowId !== id;\n      }) : [].concat(_toConsumableArray(prev), [id]);\n    });\n  };\n  var toggleSelectAll = function toggleSelectAll() {\n    if (selectedRows.length === products.length && products.length > 0) {\n      setSelectedRows([]);\n    } else {\n      setSelectedRows(products.map(function (p) {\n        return p.id;\n      }));\n    }\n  };\n  var handleBulkDelete = /*#__PURE__*/function () {\n    var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n      return _regenerator().w(function (_context) {\n        while (1) switch (_context.n) {\n          case 0:\n            onBulkConfirmOpen();\n          case 1:\n            return _context.a(2);\n        }\n      }, _callee);\n    }));\n    return function handleBulkDelete() {\n      return _ref.apply(this, arguments);\n    };\n  }();\n  var confirmBulkDelete = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {\n      var _iterator, _step, id, _t, _t2;\n      return _regenerator().w(function (_context2) {\n        while (1) switch (_context2.p = _context2.n) {\n          case 0:\n            setIsDeleting(true);\n            _context2.p = 1;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].loading(\"Deleting \".concat(selectedRows.length, \" products...\"), {\n              id: 'bulk-delete'\n            });\n            _iterator = _createForOfIteratorHelper(selectedRows);\n            _context2.p = 2;\n            _iterator.s();\n          case 3:\n            if ((_step = _iterator.n()).done) {\n              _context2.n = 5;\n              break;\n            }\n            id = _step.value;\n            _context2.n = 4;\n            return axios__WEBPACK_IMPORTED_MODULE_36__[\"default\"][\"delete\"](\"/api/store-manager/products/\".concat(id), {\n              params: {\n                force: true\n              }\n            });\n          case 4:\n            _context2.n = 3;\n            break;\n          case 5:\n            _context2.n = 7;\n            break;\n          case 6:\n            _context2.p = 6;\n            _t = _context2.v;\n            _iterator.e(_t);\n          case 7:\n            _context2.p = 7;\n            _iterator.f();\n            return _context2.f(7);\n          case 8:\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].success(\"Products deleted successfully\", {\n              id: 'bulk-delete'\n            });\n            setSelectedRows([]);\n            fetchProducts(currentPage, perPage, searchTerm, filters.status, filters.type, filters.stockStatus);\n            _context2.n = 10;\n            break;\n          case 9:\n            _context2.p = 9;\n            _t2 = _context2.v;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].error(\"Failed to delete some products\", {\n              id: 'bulk-delete'\n            });\n          case 10:\n            _context2.p = 10;\n            setIsDeleting(false);\n            onBulkConfirmClose();\n            return _context2.f(10);\n          case 11:\n            return _context2.a(2);\n        }\n      }, _callee2, null, [[2, 6, 7, 8], [1, 9, 10, 11]]);\n    }));\n    return function confirmBulkDelete() {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  var promptDeleteProduct = function promptDeleteProduct(product) {\n    setProductToDelete(product);\n    onRowConfirmOpen();\n  };\n  var confirmDeleteProduct = /*#__PURE__*/function () {\n    var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {\n      var _err$response, _t3;\n      return _regenerator().w(function (_context3) {\n        while (1) switch (_context3.p = _context3.n) {\n          case 0:\n            if (productToDelete) {\n              _context3.n = 1;\n              break;\n            }\n            return _context3.a(2);\n          case 1:\n            setIsDeleting(true);\n            _context3.p = 2;\n            _context3.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_36__[\"default\"][\"delete\"](\"/api/store-manager/products/\".concat(productToDelete.id), {\n              params: {\n                force: true\n              }\n            });\n          case 3:\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].success(\"Product deleted successfully\");\n            fetchProducts(currentPage, perPage, searchTerm, filters.status, filters.type, filters.stockStatus);\n            _context3.n = 5;\n            break;\n          case 4:\n            _context3.p = 4;\n            _t3 = _context3.v;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].error(((_err$response = _t3.response) === null || _err$response === void 0 || (_err$response = _err$response.data) === null || _err$response === void 0 ? void 0 : _err$response.message) || \"Failed to delete product\");\n          case 5:\n            _context3.p = 5;\n            setIsDeleting(false);\n            setProductToDelete(null);\n            onRowConfirmClose();\n            return _context3.f(5);\n          case 6:\n            return _context3.a(2);\n        }\n      }, _callee3, null, [[2, 4, 5, 6]]);\n    }));\n    return function confirmDeleteProduct() {\n      return _ref3.apply(this, arguments);\n    };\n  }();\n  var bgCard = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.useColorModeValue)(\"white\", \"gray.800\");\n  var borderColor = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.useColorModeValue)(\"gray.200\", \"gray.700\");\n  var fetchProducts = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {\n    var page,\n      perPage,\n      search,\n      status,\n      type,\n      stockStatus,\n      _response$data,\n      _response$data2,\n      params,\n      response,\n      productsData,\n      _args4 = arguments,\n      _t4;\n    return _regenerator().w(function (_context4) {\n      while (1) switch (_context4.p = _context4.n) {\n        case 0:\n          page = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : 1;\n          perPage = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : 10;\n          search = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : \"\";\n          status = _args4.length > 3 && _args4[3] !== undefined ? _args4[3] : \"any\";\n          type = _args4.length > 4 && _args4[4] !== undefined ? _args4[4] : \"\";\n          stockStatus = _args4.length > 5 && _args4[5] !== undefined ? _args4[5] : \"\";\n          _context4.p = 1;\n          setLoading(true);\n          params = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({\n            page: page,\n            per_page: perPage,\n            search: search,\n            status: status,\n            type: type,\n            stock_status: stockStatus\n          }, \"status\", status), \"type\", type), \"stock_status\", stockStatus), \"after\", dateRange !== null && dateRange !== void 0 && dateRange.startDate ? dateRange.startDate.toISOString().split('.')[0] + 'Z' : undefined), \"before\", dateRange !== null && dateRange !== void 0 && dateRange.endDate ? dateRange.endDate.toISOString().split('.')[0] + 'Z' : undefined); // Proxy URL for store manager\n          _context4.n = 2;\n          return axios__WEBPACK_IMPORTED_MODULE_36__[\"default\"].get(\"/api/store-manager/products\", {\n            params: params\n          });\n        case 2:\n          response = _context4.v;\n          productsData = response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.data;\n          setProducts(Array.isArray(productsData === null || productsData === void 0 ? void 0 : productsData.allProducts) ? productsData.allProducts : []);\n          setProductStats(Array.isArray(productsData === null || productsData === void 0 ? void 0 : productsData.totalProducts) ? productsData.totalProducts : []);\n          setTotalRows((response === null || response === void 0 || (_response$data2 = response.data) === null || _response$data2 === void 0 || (_response$data2 = _response$data2.meta) === null || _response$data2 === void 0 ? void 0 : _response$data2.total) || 0);\n          setCurrentPage(page);\n          setPerPage(perPage);\n          _context4.n = 4;\n          break;\n        case 3:\n          _context4.p = 3;\n          _t4 = _context4.v;\n          console.error(\"Error fetching products:\", _t4);\n          react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].error(\"Failed to fetch products\");\n        case 4:\n          _context4.p = 4;\n          setLoading(false);\n          return _context4.f(4);\n        case 5:\n          return _context4.a(2);\n      }\n    }, _callee4, null, [[1, 3, 4, 5]]);\n  })), [dateRange]);\n  var debouncedFetch = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(lodash_debounce__WEBPACK_IMPORTED_MODULE_38___default()(function (searchValue) {\n    fetchProducts(1, perPage, searchValue, filters.status, filters.type, filters.stockStatus);\n  }, 500), [perPage, filters, fetchProducts]);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    debouncedFetch(searchTerm);\n    return function () {\n      return debouncedFetch.cancel();\n    };\n  }, [searchTerm, debouncedFetch]);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    fetchProducts(1, perPage, \"\", filters.status, filters.type, filters.stockStatus, dateRange);\n  }, [fetchProducts, dateRange]);\n  var getStockBadge = function getStockBadge(status) {\n    switch (status) {\n      case 'instock':\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Badge, {\n          colorScheme: \"green\"\n        }, \"In Stock\");\n      case 'outofstock':\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Badge, {\n          colorScheme: \"red\"\n        }, \"Out of Stock\");\n      case 'onbackorder':\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Badge, {\n          colorScheme: \"orange\"\n        }, \"Backorder\");\n      default:\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Badge, null, status);\n    }\n  };\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.VStack, {\n    align: \"stretch\",\n    spacing: 6,\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    direction: {\n      base: \"column\",\n      lg: \"row\"\n    },\n    justify: \"space-between\",\n    align: {\n      base: \"stretch\",\n      lg: \"center\"\n    },\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.VStack, {\n    align: \"start\",\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Heading, {\n    m: 0,\n    size: \"lg\"\n  }, \"Master Product Catalog\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n    m: 0,\n    color: \"gray.500\",\n    fontSize: \"sm\"\n  }, \"Manage products, pricing, and synchronization across your entire network.\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.HStack, {\n    spacing: 3,\n    alignSelf: {\n      base: \"flex-start\",\n      lg: \"center\"\n    },\n    flexWrap: \"wrap\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    leftIcon: isPro ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_41__.FiBox, null) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_41__.FiLock, null),\n    colorScheme: \"purple\",\n    variant: \"solid\",\n    size: \"md\",\n    onClick: isPro ? function () {\n      return setShowSmartCreator(true);\n    } : function () {\n      setProFeatureType(\"smart_creator\");\n      onProModalOpen();\n    },\n    shadow: \"sm\",\n    _hover: {\n      shadow: 'md'\n    }\n  }, isPro ? \"Smart Creator\" : \"Smart Creator (Pro)\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    leftIcon: isPro ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_41__.FiRefreshCw, null) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_41__.FiLock, null),\n    colorScheme: \"green\",\n    variant: \"solid\",\n    size: \"md\",\n    onClick: isPro ? onSyncOpen : function () {\n      setProFeatureType(\"push_products\");\n      onProModalOpen();\n    },\n    shadow: \"sm\",\n    _hover: {\n      shadow: 'md'\n    },\n    isDisabled: isPro && selectedRows.length === 0\n  }, isPro ? \"Push Products\" : \"Push Products (Pro)\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    leftIcon: isPro ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_41__.FiTrendingUp, null) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_41__.FiLock, null),\n    colorScheme: \"blue\",\n    onClick: onPriceOpen,\n    variant: \"solid\",\n    size: \"md\",\n    shadow: \"sm\",\n    _hover: {\n      shadow: 'md'\n    }\n  }, \"Global Pricing\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Card, {\n    variant: \"outline\",\n    p: 4,\n    borderRadius: \"xl\",\n    bg: \"gray.50\",\n    borderStyle: \"dashed\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    direction: {\n      base: \"column\",\n      md: \"row\"\n    },\n    gap: 4,\n    align: {\n      base: \"stretch\",\n      md: \"center\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    flex: \"1\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Input, {\n    placeholder: \"Search by name, SKU or ID...\",\n    value: searchTerm,\n    onChange: function onChange(e) {\n      return setSearchTerm(e.target.value);\n    },\n    bg: \"white\",\n    size: \"md\",\n    borderRadius: \"lg\",\n    leftElement: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_41__.FiSearch, {\n      color: \"gray.300\"\n    })\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.HStack, {\n    spacing: 2,\n    overflowX: \"auto\",\n    pb: {\n      base: 2,\n      md: 0\n    },\n    className: \"shopcentral-scrollbar\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Menu, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.MenuButton, {\n    as: _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button,\n    size: \"md\",\n    variant: \"outline\",\n    bg: \"white\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_41__.FiFilter, null),\n    rightIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_41__.FiChevronDown, null),\n    borderRadius: \"lg\",\n    minW: \"140px\"\n  }, filters.status === \"any\" ? \"All Status\" : filters.status.charAt(0).toUpperCase() + filters.status.slice(1)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.MenuList, {\n    zIndex: 10\n  }, [\"any\", \"publish\", \"draft\", \"pending\", \"private\"].map(function (s) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.MenuItem, {\n      key: s,\n      onClick: function onClick() {\n        setFilters(function (prev) {\n          return _objectSpread(_objectSpread({}, prev), {}, {\n            status: s\n          });\n        });\n        fetchProducts(1, perPage, searchTerm, s, filters.type, filters.stockStatus, dateRange);\n      }\n    }, s === \"any\" ? \"All Status\" : s.charAt(0).toUpperCase() + s.slice(1));\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Menu, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.MenuButton, {\n    as: _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button,\n    size: \"md\",\n    variant: \"outline\",\n    bg: \"white\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_41__.FiLayers, null),\n    rightIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_41__.FiChevronDown, null),\n    borderRadius: \"lg\",\n    minW: \"140px\"\n  }, filters.type === \"\" ? \"All Types\" : filters.type.charAt(0).toUpperCase() + filters.type.slice(1)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.MenuList, {\n    zIndex: 10\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.MenuItem, {\n    onClick: function onClick() {\n      setFilters(function (prev) {\n        return _objectSpread(_objectSpread({}, prev), {}, {\n          type: \"\"\n        });\n      });\n      fetchProducts(1, perPage, searchTerm, filters.status, \"\", filters.stockStatus, dateRange);\n    }\n  }, \"All Types\"), [\"simple\", \"variable\", \"grouped\", \"external\"].map(function (t) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.MenuItem, {\n      key: t,\n      onClick: function onClick() {\n        setFilters(function (prev) {\n          return _objectSpread(_objectSpread({}, prev), {}, {\n            type: t\n          });\n        });\n        fetchProducts(1, perPage, searchTerm, filters.status, t, filters.stockStatus, dateRange);\n      }\n    }, t.charAt(0).toUpperCase() + t.slice(1));\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Popover, {\n    placement: \"bottom-end\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.PopoverTrigger, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"md\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fa__WEBPACK_IMPORTED_MODULE_40__.FaCalendar, null),\n    variant: \"outline\",\n    bg: \"white\",\n    borderRadius: \"lg\",\n    minW: \"160px\"\n  }, dateRange.label ? dateRange.label : dateRange.startDate ? \"\".concat(dateRange.startDate.toLocaleDateString(), \" - \").concat(dateRange.endDate.toLocaleDateString()) : \"Select Dates\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.PopoverContent, {\n    w: \"auto\",\n    maxW: \"unset\",\n    shadow: \"xl\",\n    borderRadius: \"xl\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.PopoverArrow, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.PopoverCloseButton, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.PopoverBody, {\n    p: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_43__[\"default\"], {\n    initialRange: dateRange,\n    onChange: function onChange(range) {\n      return setDateRange(range);\n    }\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"md\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_41__.FiDownload, null),\n    variant: \"outline\",\n    bg: \"white\",\n    borderRadius: \"lg\",\n    onClick: function onClick() {\n      return (0,_utils_exportUtils__WEBPACK_IMPORTED_MODULE_1__.exportToCSV)(products, \"products-\".concat(new Date().toISOString().split('T')[0], \".csv\"));\n    },\n    isDisabled: products.length === 0\n  }, \"Export\")))), selectedRows.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    bg: \"red.50\",\n    p: 3,\n    borderRadius: \"lg\",\n    borderWidth: \"1px\",\n    borderColor: \"red.100\",\n    justify: \"space-between\",\n    align: \"center\",\n    animation: \"slideInDown 0.2s ease-out\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.HStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n    m: 0,\n    fontSize: \"sm\",\n    fontWeight: \"bold\",\n    color: \"red.700\"\n  }, selectedRows.length, \" items selected\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"xs\",\n    colorScheme: \"red\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_41__.FiTrash2, null),\n    onClick: handleBulkDelete\n  }, \"Delete Selected\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"xs\",\n    variant: \"ghost\",\n    colorScheme: \"red\",\n    onClick: function onClick() {\n      return setSelectedRows([]);\n    }\n  }, \"Deselect all\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    display: \"flex\",\n    flexDirection: \"column\",\n    h: \"calc(100vh - 180px)\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Card, {\n    variant: \"outline\",\n    borderRadius: \"xl\",\n    shadow: \"sm\",\n    overflow: \"hidden\",\n    display: \"flex\",\n    flexDirection: \"column\",\n    flex: \"1\",\n    bg: \"white\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.TableContainer, {\n    flex: \"1\",\n    overflowY: \"auto\",\n    className: \"shopcentral-scrollbar\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Table, {\n    variant: \"simple\",\n    size: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Thead, {\n    bg: \"gray.50\",\n    position: \"sticky\",\n    top: 0,\n    zIndex: 5\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, {\n    width: \"40px\",\n    py: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Checkbox, {\n    isChecked: selectedRows.length === products.length && products.length > 0,\n    isIndeterminate: selectedRows.length > 0 && selectedRows.length < products.length,\n    onChange: toggleSelectAll,\n    colorScheme: \"blue\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, {\n    py: 4\n  }, \"Product Info\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, {\n    py: 4,\n    display: {\n      base: \"none\",\n      md: \"table-cell\"\n    }\n  }, \"Type\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, {\n    py: 4\n  }, \"Price\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, {\n    py: 4\n  }, \"Stock\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, {\n    py: 4,\n    display: {\n      base: \"none\",\n      lg: \"table-cell\"\n    }\n  }, \"Status\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, {\n    py: 4,\n    display: {\n      base: \"none\",\n      xl: \"table-cell\"\n    }\n  }, \"Date\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, {\n    py: 4,\n    width: \"50px\"\n  }, \"Action\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Tbody, null, loading ? [1, 2, 3, 4, 5, 6, 7, 8].map(function (i) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tr, {\n      key: i\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      py: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Skeleton, {\n      h: \"16px\",\n      w: \"16px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      py: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Skeleton, {\n      h: \"40px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      py: 4,\n      display: {\n        base: \"none\",\n        md: \"table-cell\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Skeleton, {\n      h: \"20px\",\n      w: \"60px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      py: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Skeleton, {\n      h: \"20px\",\n      w: \"50px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      py: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Skeleton, {\n      h: \"20px\",\n      w: \"70px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      py: 4,\n      display: {\n        base: \"none\",\n        lg: \"table-cell\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Skeleton, {\n      h: \"20px\",\n      w: \"60px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      py: 4,\n      display: {\n        base: \"none\",\n        xl: \"table-cell\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Skeleton, {\n      h: \"20px\",\n      w: \"80px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      py: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Skeleton, {\n      h: \"24px\",\n      w: \"24px\"\n    })));\n  }) : (products === null || products === void 0 ? void 0 : products.length) === 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n    colSpan: 8,\n    textAlign: \"center\",\n    py: 20\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.VStack, {\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_41__.FiInbox,\n    boxSize: 10,\n    color: \"gray.200\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n    m: 0,\n    fontWeight: \"bold\",\n    color: \"gray.400\"\n  }, \"No products found matching your criteria\")))) : products === null || products === void 0 ? void 0 : products.map(function (product) {\n    var _product$images;\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tr, {\n      key: product.id,\n      _hover: {\n        bg: \"gray.50\"\n      },\n      transition: \"background 0.2s\",\n      cursor: \"default\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      py: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Checkbox, {\n      isChecked: selectedRows.includes(product.id),\n      onChange: function onChange() {\n        return toggleSelectRow(product.id);\n      },\n      colorScheme: \"blue\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      py: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.HStack, {\n      spacing: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n      position: \"relative\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Image, {\n      src: ((_product$images = product.images) === null || _product$images === void 0 || (_product$images = _product$images[0]) === null || _product$images === void 0 ? void 0 : _product$images.src) || 'https://via.placeholder.com/40',\n      boxSize: \"40px\",\n      borderRadius: \"lg\",\n      fallbackSrc: \"https://via.placeholder.com/40\",\n      shadow: \"sm\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Badge, {\n      position: \"absolute\",\n      top: \"-6px\",\n      right: \"-6px\",\n      display: {\n        base: \"inline-flex\",\n        md: \"none\"\n      },\n      colorScheme: product.status === 'publish' ? 'green' : 'gray',\n      variant: \"solid\",\n      fontSize: \"3xs\",\n      borderRadius: \"full\",\n      px: 1\n    }, product.status.charAt(0).toUpperCase())), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.VStack, {\n      align: \"start\",\n      spacing: 0\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n      m: 0,\n      fontWeight: \"bold\",\n      isTruncated: true,\n      maxW: {\n        base: \"120px\",\n        md: \"250px\"\n      },\n      fontSize: \"sm\",\n      color: \"gray.700\"\n    }, product.name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.HStack, {\n      spacing: 1\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n      m: 0,\n      fontSize: \"2xs\",\n      color: \"gray.400\",\n      fontWeight: \"medium\"\n    }, \"ID: \", product.id), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Badge, {\n      display: {\n        base: \"inline-flex\",\n        md: \"none\"\n      },\n      variant: \"outline\",\n      fontSize: \"3xs\",\n      px: 1\n    }, product.type))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      py: 3,\n      display: {\n        base: \"none\",\n        md: \"table-cell\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Badge, {\n      variant: \"subtle\",\n      colorScheme: \"blue\",\n      fontSize: \"2xs\",\n      borderRadius: \"md\",\n      px: 2\n    }, product.type)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      py: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.VStack, {\n      align: \"start\",\n      spacing: 0\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n      fontSize: \"sm\",\n      fontWeight: \"800\",\n      color: \"gray.800\",\n      dangerouslySetInnerHTML: {\n        __html: product.price_html\n      }\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n      m: 0,\n      fontSize: \"3xs\",\n      color: \"gray.400\",\n      display: {\n        base: \"block\",\n        xl: \"none\"\n      }\n    }, (0,_utils_FormatDate__WEBPACK_IMPORTED_MODULE_44__.FormatDate)(product.date_created)))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      py: 3\n    }, getStockBadge(product.stock_status)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      py: 3,\n      display: {\n        base: \"none\",\n        lg: \"table-cell\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Badge, {\n      fontSize: \"2xs\",\n      colorScheme: product.status === 'publish' ? 'green' : 'gray',\n      variant: \"subtle\",\n      px: 2,\n      borderRadius: \"full\"\n    }, product.status)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      py: 3,\n      fontSize: \"xs\",\n      color: \"gray.600\",\n      display: {\n        base: \"none\",\n        xl: \"table-cell\"\n      }\n    }, (0,_utils_FormatDate__WEBPACK_IMPORTED_MODULE_44__.FormatDate)(product.date_created)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      py: 3,\n      textAlign: \"right\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Menu, {\n      isLazy: true\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.MenuButton, {\n      as: _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.IconButton,\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_41__.FiMoreVertical, null),\n      variant: \"ghost\",\n      size: \"sm\",\n      borderRadius: \"full\",\n      _hover: {\n        bg: \"gray.200\"\n      }\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.MenuList, {\n      shadow: \"xl\",\n      borderRadius: \"lg\",\n      py: 2\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.MenuItem, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_41__.FiEye, {\n        color: \"var(--chakra-colors-blue-500)\"\n      }),\n      fontSize: \"sm\",\n      fontWeight: \"medium\",\n      onClick: function onClick() {\n        return navigate(\"/store-manager/products/\".concat(product.id));\n      }\n    }, \"Edit Product\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.MenuItem, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_41__.FiCopy, {\n        color: \"var(--chakra-colors-purple-500)\"\n      }),\n      fontSize: \"sm\",\n      fontWeight: \"medium\"\n    }, \"Duplicate\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.MenuItem, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_41__.FiTrash2, {\n        color: \"var(--chakra-colors-red-500)\"\n      }),\n      fontSize: \"sm\",\n      fontWeight: \"medium\",\n      onClick: function onClick() {\n        return promptDeleteProduct(product);\n      }\n    }, \"Delete Permanent\")))));\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    p: 4,\n    justify: \"space-between\",\n    align: \"center\",\n    bg: \"gray.50\",\n    borderTop: \"1px\",\n    borderColor: \"gray.200\",\n    flexShrink: 0,\n    direction: {\n      base: \"column\",\n      sm: \"row\"\n    },\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    fontWeight: \"bold\",\n    color: \"gray.500\"\n  }, \"Showing \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    as: \"span\",\n    color: \"blue.600\"\n  }, (currentPage - 1) * perPage + 1), \" to \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    as: \"span\",\n    color: \"blue.600\"\n  }, Math.min(currentPage * perPage, totalRows)), \" of \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    as: \"span\",\n    color: \"gray.800\"\n  }, totalRows), \" products\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.HStack, {\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"sm\",\n    variant: \"ghost\",\n    isDisabled: currentPage === 1,\n    onClick: function onClick() {\n      return fetchProducts(currentPage - 1, perPage, searchTerm);\n    },\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_41__.FiChevronLeft, null),\n    borderRadius: \"lg\",\n    fontWeight: \"bold\",\n    fontSize: \"xs\"\n  }, \"Previous\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    px: 3,\n    py: 1,\n    bg: \"white\",\n    borderRadius: \"md\",\n    border: \"1px\",\n    borderColor: \"gray.200\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    fontWeight: \"800\",\n    color: \"blue.600\"\n  }, currentPage)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"sm\",\n    variant: \"ghost\",\n    isDisabled: currentPage * perPage >= totalRows,\n    onClick: function onClick() {\n      return fetchProducts(currentPage + 1, perPage, searchTerm);\n    },\n    rightIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_41__.FiChevronRight, null),\n    borderRadius: \"lg\",\n    fontWeight: \"bold\",\n    fontSize: \"xs\"\n  }, \"Next\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_SyncProductsModal__WEBPACK_IMPORTED_MODULE_45__[\"default\"], {\n    isOpen: isSyncOpen,\n    onClose: function onClose() {\n      onSyncClose();\n      setSelectedRows([]);\n      fetchProducts(1, perPage, searchTerm, filters.status, filters.type, filters.stockStatus, dateRange);\n    },\n    selectedProductIds: selectedRows\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_GlobalPriceModal__WEBPACK_IMPORTED_MODULE_46__[\"default\"], {\n    isOpen: isPriceOpen,\n    onClose: function onClose() {\n      onPriceClose();\n      fetchProducts(1, perPage, searchTerm, filters.status, filters.type, filters.stockStatus, dateRange);\n    }\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_42__[\"default\"], {\n    isOpen: isBulkConfirmOpen,\n    onClose: onBulkConfirmClose,\n    onConfirm: confirmBulkDelete,\n    title: \"Delete Products\",\n    description: \"Are you sure you want to permanently delete \".concat(selectedRows.length, \" product\").concat(selectedRows.length > 1 ? 's' : '', \"? This cannot be undone.\"),\n    confirmLabel: \"Delete\",\n    loading: isDeleting\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_42__[\"default\"], {\n    isOpen: isRowConfirmOpen,\n    onClose: function onClose() {\n      onRowConfirmClose();\n      setProductToDelete(null);\n    },\n    onConfirm: confirmDeleteProduct,\n    title: \"Delete Product\",\n    description: productToDelete ? \"Are you sure you want to permanently delete product \\\"\".concat(productToDelete.name, \"\\\"? This cannot be undone.\") : '',\n    confirmLabel: \"Delete\",\n    loading: isDeleting\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ProFeatureModal__WEBPACK_IMPORTED_MODULE_47__[\"default\"], {\n    isOpen: isProModalOpen,\n    onClose: onProModalClose,\n    title: proFeatureType === \"smart_creator\" ? \"Smart Product Creator (Pro)\" : \"Push Products to Child Stores (Pro)\",\n    what: proFeatureType === \"smart_creator\" ? \"A centralized product builder that allows you to create simple and variable products across multiple WooCommerce stores simultaneously.\" : \"A powerful product synchronization engine that pushes and clones existing products from your main store directly to any connected child store.\",\n    how: proFeatureType === \"smart_creator\" ? \"Follow a fast 3-step wizard (Select Stores → Product Details → Variations & Pricing) to deploy products instantly across your network with per-store price adjustments.\" : \"Select your desired products, choose target child stores, and toggle which fields to push (prices, stock levels, images, categories, tags, or custom ACF meta fields).\",\n    why: proFeatureType === \"smart_creator\" ? \"Eliminates repetitive data entry and saves hours by avoiding logging in and out of individual store WordPress dashboards to manually create products.\" : \"Ensures catalog accuracy, network-wide price consistency, and real-time inventory synchronization across all your stores with a single click.\"\n  }), isPro && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_SmartProductCreator_SmartProductCreator__WEBPACK_IMPORTED_MODULE_48__[\"default\"], {\n    isOpen: showSmartCreator,\n    onClose: function onClose() {\n      return setShowSmartCreator(false);\n    }\n  }));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AllProduct);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Products/AllProduct.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Products/GlobalPriceModal.jsx"
/*!**************************************************************!*\
  !*** ./src/Pages/StoreManager/Products/GlobalPriceModal.jsx ***!
  \**************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/hooks/dist/esm/use-disclosure.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/alert/alert.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/alert/alert-description.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/alert/alert-icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/alert/alert-title.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/checkbox/checkbox.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/checkbox/checkbox-group.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-control.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-label.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input-addon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input-group.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/list/list.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-footer.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-header.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-overlay.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/select/select.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/spinner/spinner.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/toast/use-toast.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var _Components_shared_ProFeatureModal__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../../../Components/shared/ProFeatureModal */ \"./src/Components/shared/ProFeatureModal.jsx\");\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\n\nvar GlobalPriceModal = function GlobalPriceModal(_ref) {\n  var _window$shopCentralDa, _categories$find;\n  var isOpen = _ref.isOpen,\n    onClose = _ref.onClose;\n  var toast = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.useToast)();\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState2 = _slicedToArray(_useState, 2),\n    stores = _useState2[0],\n    setStores = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState4 = _slicedToArray(_useState3, 2),\n    selectedStores = _useState4[0],\n    setSelectedStores = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),\n    _useState6 = _slicedToArray(_useState5, 2),\n    selectAll = _useState6[0],\n    setSelectAll = _useState6[1];\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"\"),\n    _useState8 = _slicedToArray(_useState7, 2),\n    amount = _useState8[0],\n    setAmount = _useState8[1];\n  var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"percentage\"),\n    _useState0 = _slicedToArray(_useState9, 2),\n    type = _useState0[0],\n    setType = _useState0[1];\n  var _useState1 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"increase\"),\n    _useState10 = _slicedToArray(_useState1, 2),\n    direction = _useState10[0],\n    setDirection = _useState10[1];\n  var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"\"),\n    _useState12 = _slicedToArray(_useState11, 2),\n    categoryId = _useState12[0],\n    setCategoryId = _useState12[1];\n  var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState14 = _slicedToArray(_useState13, 2),\n    categories = _useState14[0],\n    setCategories = _useState14[1];\n  var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState16 = _slicedToArray(_useState15, 2),\n    isUpdating = _useState16[0],\n    setIsUpdating = _useState16[1];\n  var _useState17 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),\n    _useState18 = _slicedToArray(_useState17, 2),\n    isLoadingStores = _useState18[0],\n    setIsLoadingStores = _useState18[1];\n  var isPro = (_window$shopCentralDa = window.shopCentralData) === null || _window$shopCentralDa === void 0 ? void 0 : _window$shopCentralDa.isPro;\n  var _useDisclosure = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.useDisclosure)(),\n    isProOpen = _useDisclosure.isOpen,\n    onProOpen = _useDisclosure.onOpen,\n    onProClose = _useDisclosure.onClose;\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    if (isOpen) {\n      setIsLoadingStores(true);\n      fetchStores();\n      fetchCategories();\n      setSelectedStores([]);\n      setSelectAll(true);\n      setAmount(\"\");\n    }\n  }, [isOpen]);\n  var fetchStores = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n      var _res$data, res, _t;\n      return _regenerator().w(function (_context) {\n        while (1) switch (_context.p = _context.n) {\n          case 0:\n            setIsLoadingStores(true);\n            _context.p = 1;\n            _context.n = 2;\n            return axios__WEBPACK_IMPORTED_MODULE_34__[\"default\"].get(\"/api/stores\");\n          case 2:\n            res = _context.v;\n            setStores(((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.stores) || []);\n            _context.n = 4;\n            break;\n          case 3:\n            _context.p = 3;\n            _t = _context.v;\n            toast({\n              title: \"Failed to load stores\",\n              status: \"error\",\n              duration: 3000\n            });\n          case 4:\n            _context.p = 4;\n            setIsLoadingStores(false);\n            return _context.f(4);\n          case 5:\n            return _context.a(2);\n        }\n      }, _callee, null, [[1, 3, 4, 5]]);\n    }));\n    return function fetchStores() {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  var fetchCategories = /*#__PURE__*/function () {\n    var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {\n      var _res$data2, res, _t2;\n      return _regenerator().w(function (_context2) {\n        while (1) switch (_context2.p = _context2.n) {\n          case 0:\n            _context2.p = 0;\n            _context2.n = 1;\n            return axios__WEBPACK_IMPORTED_MODULE_34__[\"default\"].get(\"/api/product-categories\");\n          case 1:\n            res = _context2.v;\n            setCategories(((_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.categories) || []);\n            _context2.n = 3;\n            break;\n          case 2:\n            _context2.p = 2;\n            _t2 = _context2.v;\n            console.error(\"Failed to load categories\", _t2);\n          case 3:\n            return _context2.a(2);\n        }\n      }, _callee2, null, [[0, 2]]);\n    }));\n    return function fetchCategories() {\n      return _ref3.apply(this, arguments);\n    };\n  }();\n  var handleSelectAll = function handleSelectAll() {\n    if (selectAll) {\n      setSelectedStores([]);\n      setSelectAll(false);\n    } else {\n      setSelectedStores(stores.map(function (s) {\n        return s.id.toString();\n      }));\n      setSelectAll(true);\n    }\n  };\n  var handleStoreSelect = function handleStoreSelect(values) {\n    setSelectedStores(values);\n    setSelectAll(values.length === stores.length);\n  };\n  var handleUpdate = /*#__PURE__*/function () {\n    var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {\n      var _data$results, _data$results2, payload, response, data, totalUpdated, totalFailed, _data$results3, _error$response, _t3;\n      return _regenerator().w(function (_context3) {\n        while (1) switch (_context3.p = _context3.n) {\n          case 0:\n            if (!(!amount || amount <= 0)) {\n              _context3.n = 1;\n              break;\n            }\n            toast({\n              title: \"Enter a valid amount\",\n              status: \"warning\",\n              duration: 3000\n            });\n            return _context3.a(2);\n          case 1:\n            if (!(selectedStores.length === 0 && !selectAll)) {\n              _context3.n = 2;\n              break;\n            }\n            toast({\n              title: \"Select at least one store\",\n              status: \"warning\",\n              duration: 3000\n            });\n            return _context3.a(2);\n          case 2:\n            setIsUpdating(true);\n            _context3.p = 3;\n            payload = {\n              store_ids: selectAll ? [\"all\"] : selectedStores,\n              amount: parseFloat(amount),\n              type: type,\n              direction: direction,\n              category_id: categoryId || null\n            };\n            _context3.n = 4;\n            return axios__WEBPACK_IMPORTED_MODULE_34__[\"default\"].post(\"/api/store-manager/global-price-update\", payload);\n          case 4:\n            response = _context3.v;\n            data = response.data;\n            totalUpdated = (data === null || data === void 0 || (_data$results = data.results) === null || _data$results === void 0 ? void 0 : _data$results.reduce(function (sum, r) {\n              return sum + (r.updated || 0);\n            }, 0)) || 0;\n            totalFailed = (data === null || data === void 0 || (_data$results2 = data.results) === null || _data$results2 === void 0 ? void 0 : _data$results2.reduce(function (sum, r) {\n              return sum + (r.failed || 0);\n            }, 0)) || 0;\n            if (totalFailed === 0 && totalUpdated > 0) {\n              toast({\n                title: \"Updated \".concat(totalUpdated, \" products across \").concat((data === null || data === void 0 || (_data$results3 = data.results) === null || _data$results3 === void 0 ? void 0 : _data$results3.length) || 0, \" stores\"),\n                status: \"success\",\n                duration: 4000\n              });\n            } else if (totalUpdated > 0 && totalFailed > 0) {\n              toast({\n                title: \"Updated \".concat(totalUpdated, \", \").concat(totalFailed, \" failed\"),\n                status: \"warning\",\n                duration: 5000\n              });\n            } else if (totalFailed > 0) {\n              toast({\n                title: \"Update failed for \".concat(totalFailed, \" products\"),\n                status: \"error\",\n                duration: 5000\n              });\n            }\n            onClose();\n            _context3.n = 6;\n            break;\n          case 5:\n            _context3.p = 5;\n            _t3 = _context3.v;\n            toast({\n              title: ((_error$response = _t3.response) === null || _error$response === void 0 || (_error$response = _error$response.data) === null || _error$response === void 0 ? void 0 : _error$response.message) || \"Price update failed\",\n              status: \"error\",\n              duration: 3000\n            });\n          case 6:\n            _context3.p = 6;\n            setIsUpdating(false);\n            return _context3.f(6);\n          case 7:\n            return _context3.a(2);\n        }\n      }, _callee3, null, [[3, 5, 6, 7]]);\n    }));\n    return function handleUpdate() {\n      return _ref4.apply(this, arguments);\n    };\n  }();\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Modal, {\n    isOpen: isOpen,\n    onClose: onClose,\n    size: {\n      base: \"full\",\n      md: \"lg\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.ModalOverlay, {\n    bg: \"blackAlpha.300\",\n    backdropFilter: \"blur(5px)\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.ModalContent, {\n    borderRadius: {\n      base: \"none\",\n      md: \"2xl\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.ModalHeader, {\n    pb: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    align: \"center\",\n    gap: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiGlobe,\n    color: \"blue.500\",\n    boxSize: 5\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Text, null, \"Global Price Update\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.500\",\n    fontWeight: \"normal\",\n    mt: 1\n  }, \"Update prices across multiple stores\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.ModalCloseButton, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.ModalBody, {\n    overflowY: \"auto\",\n    maxH: {\n      base: \"calc(100vh - 140px)\",\n      md: \"70vh\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.VStack, {\n    spacing: 4,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.FormLabel, {\n    fontWeight: \"600\",\n    fontSize: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    align: \"center\",\n    gap: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiPackage,\n    boxSize: 4,\n    color: \"blue.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Text, {\n    m: 0\n  }, \"Select Stores\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Badge, {\n    colorScheme: \"blue\",\n    fontSize: \"2xs\",\n    borderRadius: \"md\"\n  }, isLoadingStores ? \"Loading...\" : \"\".concat(selectAll ? stores.length : selectedStores.length, \"/\").concat(stores.length)))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.HStack, {\n    spacing: 2,\n    mb: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Button, {\n    size: \"sm\",\n    variant: selectAll ? \"solid\" : \"outline\",\n    colorScheme: \"blue\",\n    onClick: handleSelectAll,\n    flex: 1,\n    borderRadius: \"lg\",\n    isDisabled: isLoadingStores || stores.length === 0\n  }, selectAll ? \"All Stores Selected\" : \"Select All Stores\"), stores.length > 0 && !selectAll && selectedStores.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Button, {\n    size: \"sm\",\n    variant: \"ghost\",\n    onClick: function onClick() {\n      setSelectedStores([]);\n    }\n  }, \"Clear\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Box, {\n    maxH: \"120px\",\n    minH: \"60px\",\n    overflowY: \"auto\",\n    p: 2,\n    bg: \"gray.50\",\n    borderRadius: \"lg\",\n    border: \"1px\",\n    borderColor: \"gray.200\"\n  }, isLoadingStores ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    align: \"center\",\n    justify: \"center\",\n    direction: \"column\",\n    py: 4,\n    gap: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Spinner, {\n    size: \"sm\",\n    color: \"blue.500\",\n    thickness: \"2px\",\n    speed: \"0.65s\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    color: \"gray.500\",\n    fontWeight: \"medium\"\n  }, \"Loading connected stores...\")) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.CheckboxGroup, {\n    colorScheme: \"blue\",\n    value: selectedStores,\n    onChange: handleStoreSelect\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Stack, {\n    spacing: 1.5\n  }, stores.map(function (store) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Checkbox, {\n      key: store.id,\n      value: store.id.toString(),\n      size: \"sm\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Text, {\n      m: 0,\n      fontSize: \"sm\"\n    }, store.name, store.is_current === \"1\" || store.is_current === 1 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Badge, {\n      ml: 1,\n      colorScheme: \"green\",\n      fontSize: \"2xs\"\n    }, \"Current\")));\n  }), stores.length === 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Text, {\n    color: \"gray.500\",\n    fontSize: \"sm\",\n    py: 2,\n    textAlign: \"center\",\n    m: 0\n  }, \"No stores available\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.FormLabel, {\n    fontWeight: \"600\",\n    fontSize: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    align: \"center\",\n    gap: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: direction === \"increase\" ? react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiTrendingUp : react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiTrendingDown,\n    boxSize: 4,\n    color: direction === \"increase\" ? \"green.500\" : \"red.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Text, null, \"Price Action\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.HStack, {\n    spacing: 2,\n    mb: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Button, {\n    flex: 1,\n    size: \"md\",\n    variant: direction === \"increase\" ? \"solid\" : \"outline\",\n    colorScheme: \"green\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiTrendingUp, null),\n    onClick: function onClick() {\n      return setDirection(\"increase\");\n    },\n    borderRadius: \"lg\"\n  }, \"Increase\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Button, {\n    flex: 1,\n    size: \"md\",\n    variant: direction === \"decrease\" ? \"solid\" : \"outline\",\n    colorScheme: \"red\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiTrendingDown, null),\n    onClick: function onClick() {\n      return setDirection(\"decrease\");\n    },\n    borderRadius: \"lg\"\n  }, \"Decrease\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.HStack, {\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Select, {\n    value: type,\n    onChange: function onChange(e) {\n      return setType(e.target.value);\n    },\n    size: \"md\",\n    borderRadius: \"lg\",\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiChevronDown,\n      boxSize: 4\n    })\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"percentage\"\n  }, \"Percentage (%)\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"fixed\"\n  }, \"Fixed Amount\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.InputGroup, {\n    size: \"md\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.InputLeftAddon, {\n    bg: \"gray.50\",\n    borderRadius: \"lg\"\n  }, type === \"percentage\" ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiPercent, null) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiDollarSign, null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Input, {\n    type: \"number\",\n    placeholder: type === \"percentage\" ? \"e.g. 10\" : \"e.g. 5.99\",\n    value: amount,\n    onChange: function onChange(e) {\n      return setAmount(e.target.value);\n    },\n    borderRadius: \"lg\",\n    min: 0,\n    max: type === \"percentage\" ? 100 : undefined\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.FormLabel, {\n    fontWeight: \"600\",\n    fontSize: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    align: \"center\",\n    gap: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiPackage,\n    boxSize: 4,\n    color: \"purple.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Text, null, \"Category Filter (Optional)\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Select, {\n    placeholder: \"All Categories\",\n    value: categoryId,\n    onChange: function onChange(e) {\n      return setCategoryId(e.target.value);\n    },\n    size: \"md\",\n    borderRadius: \"lg\",\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiChevronDown,\n      boxSize: 4\n    })\n  }, categories.map(function (cat) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      key: cat.id,\n      value: cat.id\n    }, cat.name);\n  })), categoryId && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Badge, {\n    mt: 2,\n    colorScheme: \"purple\",\n    fontSize: \"xs\"\n  }, \"Filtering by: \", (_categories$find = categories.find(function (c) {\n    return c.id == categoryId;\n  })) === null || _categories$find === void 0 ? void 0 : _categories$find.name)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Alert, {\n    status: \"warning\",\n    borderRadius: \"xl\",\n    flexDirection: \"column\",\n    alignItems: \"start\",\n    gap: 2,\n    p: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    align: \"center\",\n    gap: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.AlertIcon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiAlertTriangle,\n    boxSize: \"5\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.AlertTitle, {\n    fontSize: \"sm\",\n    fontWeight: \"700\"\n  }, \"Important: Read before updating prices\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.AlertDescription, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.UnorderedList, {\n    spacing: 1,\n    fontSize: \"xs\",\n    styleType: \"none\",\n    ml: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.ListItem, null, \"\\u26A0\\uFE0F This action will update prices for \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"strong\", null, \"all products\"), \" in the selected stores.\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.ListItem, null, \"\\u26A0\\uFE0F Price changes \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"strong\", null, \"cannot be undone\"), \" automatically.\")))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.ModalFooter, {\n    pt: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Button, {\n    variant: \"ghost\",\n    mr: 3,\n    onClick: onClose,\n    isDisabled: isUpdating,\n    borderRadius: \"xl\"\n  }, \"Cancel\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Button, {\n    colorScheme: isPro ? \"blue\" : \"orange\",\n    onClick: isPro ? handleUpdate : onProOpen,\n    isLoading: isUpdating,\n    isDisabled: isPro && (!amount || amount <= 0) || isLoadingStores,\n    leftIcon: !isPro ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiLock, null) : null,\n    borderRadius: \"xl\",\n    px: 6\n  }, isPro ? \"Apply Global Update\" : \"Upgrade to Pro\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ProFeatureModal__WEBPACK_IMPORTED_MODULE_35__[\"default\"], {\n    isOpen: isProOpen,\n    onClose: onProClose,\n    title: \"Global Price Update (Pro)\",\n    what: \"A bulk price manipulation tool that lets you raise or lower regular and sale prices across multiple connected stores simultaneously.\",\n    how: \"Select your target stores, choose a price action (increase or decrease by percentage or fixed dollar amount), filter by product category, and apply changes in real time.\",\n    why: \"Essential for network-wide holiday promotions, flash sales, inflation adjustments, or bulk catalog repricing without manual per-product editing.\"\n  })));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (GlobalPriceModal);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Products/GlobalPriceModal.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Products/SyncProductsModal.jsx"
/*!***************************************************************!*\
  !*** ./src/Pages/StoreManager/Products/SyncProductsModal.jsx ***!
  \***************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/alert/alert.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/alert/alert-description.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/alert/alert-title.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/checkbox/checkbox.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/checkbox/checkbox-group.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/divider/divider.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-label.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/grid.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/grid-item.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/list/list.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-footer.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-header.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-overlay.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/spinner/spinner.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/toast/use-toast.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\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); }\nvar _excluded = [\"children\"],\n  _excluded2 = [\"children\"];\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nfunction _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }\nfunction _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }\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 _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\nvar SyncProductsModal = function SyncProductsModal(_ref) {\n  var isOpen = _ref.isOpen,\n    onClose = _ref.onClose,\n    selectedProductIds = _ref.selectedProductIds;\n  var toast = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.useToast)();\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState2 = _slicedToArray(_useState, 2),\n    stores = _useState2[0],\n    setStores = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState4 = _slicedToArray(_useState3, 2),\n    selectedStores = _useState4[0],\n    setSelectedStores = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({\n      price: true,\n      stock: true,\n      description: true,\n      image: true,\n      categories: true,\n      tags: true,\n      meta: false\n    }),\n    _useState6 = _slicedToArray(_useState5, 2),\n    options = _useState6[0],\n    setOptions = _useState6[1];\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState8 = _slicedToArray(_useState7, 2),\n    isSyncing = _useState8[0],\n    setIsSyncing = _useState8[1];\n  var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),\n    _useState0 = _slicedToArray(_useState9, 2),\n    isLoadingStores = _useState0[0],\n    setIsLoadingStores = _useState0[1];\n  var _useState1 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState10 = _slicedToArray(_useState1, 2),\n    syncResults = _useState10[0],\n    setSyncResults = _useState10[1];\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    if (isOpen) {\n      setIsLoadingStores(true);\n      fetchStores();\n      setSyncResults(null);\n      setSelectedStores([]);\n    }\n  }, [isOpen]);\n  var fetchStores = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n      var _res$data, res, allStores, _t;\n      return _regenerator().w(function (_context) {\n        while (1) switch (_context.p = _context.n) {\n          case 0:\n            setIsLoadingStores(true);\n            _context.p = 1;\n            _context.n = 2;\n            return axios__WEBPACK_IMPORTED_MODULE_29__[\"default\"].get(\"/api/stores\");\n          case 2:\n            res = _context.v;\n            allStores = ((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.stores) || [];\n            setStores(allStores.filter(function (s) {\n              return s.is_current === \"0\" || s.is_current === 0;\n            }));\n            _context.n = 4;\n            break;\n          case 3:\n            _context.p = 3;\n            _t = _context.v;\n            toast({\n              title: \"Failed to load stores\",\n              status: \"error\",\n              duration: 3000\n            });\n          case 4:\n            _context.p = 4;\n            setIsLoadingStores(false);\n            return _context.f(4);\n          case 5:\n            return _context.a(2);\n        }\n      }, _callee, null, [[1, 3, 4, 5]]);\n    }));\n    return function fetchStores() {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  var handleSelectAllStores = function handleSelectAllStores() {\n    if (selectedStores.length === stores.length) {\n      setSelectedStores([]);\n    } else {\n      setSelectedStores(stores.map(function (s) {\n        return s.id.toString();\n      }));\n    }\n  };\n  var handleSync = /*#__PURE__*/function () {\n    var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {\n      var _resStores$data, _data$results, _data$results2, resStores, currentStore, payload, response, data, _totalSuccess, _totalFailed, _error$response, _t2;\n      return _regenerator().w(function (_context2) {\n        while (1) switch (_context2.p = _context2.n) {\n          case 0:\n            if (!(selectedStores.length === 0)) {\n              _context2.n = 1;\n              break;\n            }\n            toast({\n              title: \"Select at least one store\",\n              status: \"warning\",\n              duration: 3000\n            });\n            return _context2.a(2);\n          case 1:\n            setIsSyncing(true);\n            setSyncResults(null);\n            _context2.p = 2;\n            _context2.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_29__[\"default\"].get(\"/api/stores\");\n          case 3:\n            resStores = _context2.v;\n            currentStore = (_resStores$data = resStores.data) === null || _resStores$data === void 0 || (_resStores$data = _resStores$data.stores) === null || _resStores$data === void 0 ? void 0 : _resStores$data.find(function (s) {\n              return s.is_current === \"1\" || s.is_current === 1;\n            });\n            payload = {\n              source_store_id: currentStore === null || currentStore === void 0 ? void 0 : currentStore.id,\n              target_store_ids: selectedStores,\n              product_ids: selectedProductIds,\n              options: options\n            };\n            _context2.n = 4;\n            return axios__WEBPACK_IMPORTED_MODULE_29__[\"default\"].post(\"/api/store-manager/sync-products\", payload);\n          case 4:\n            response = _context2.v;\n            data = response.data;\n            setSyncResults((data === null || data === void 0 ? void 0 : data.results) || []);\n            _totalSuccess = (data === null || data === void 0 || (_data$results = data.results) === null || _data$results === void 0 ? void 0 : _data$results.reduce(function (sum, r) {\n              return sum + (r.success || 0);\n            }, 0)) || 0;\n            _totalFailed = (data === null || data === void 0 || (_data$results2 = data.results) === null || _data$results2 === void 0 ? void 0 : _data$results2.reduce(function (sum, r) {\n              return sum + (r.failed || 0);\n            }, 0)) || 0;\n            if (_totalFailed === 0 && _totalSuccess > 0) {\n              toast({\n                title: \"All \".concat(_totalSuccess, \" product(s) synced successfully!\"),\n                status: \"success\",\n                duration: 4000\n              });\n            } else if (_totalSuccess > 0 && _totalFailed > 0) {\n              toast({\n                title: \"\".concat(_totalSuccess, \" synced, \").concat(_totalFailed, \" failed\"),\n                status: \"warning\",\n                duration: 5000\n              });\n            } else if (_totalFailed > 0) {\n              toast({\n                title: \"All \".concat(_totalFailed, \" product(s) failed to sync\"),\n                status: \"error\",\n                duration: 5000\n              });\n            }\n            _context2.n = 6;\n            break;\n          case 5:\n            _context2.p = 5;\n            _t2 = _context2.v;\n            toast({\n              title: ((_error$response = _t2.response) === null || _error$response === void 0 || (_error$response = _error$response.data) === null || _error$response === void 0 ? void 0 : _error$response.message) || \"Sync failed\",\n              status: \"error\",\n              duration: 3000\n            });\n          case 6:\n            _context2.p = 6;\n            setIsSyncing(false);\n            return _context2.f(6);\n          case 7:\n            return _context2.a(2);\n        }\n      }, _callee2, null, [[2, 5, 6, 7]]);\n    }));\n    return function handleSync() {\n      return _ref3.apply(this, arguments);\n    };\n  }();\n  var handleClose = function handleClose() {\n    setSyncResults(null);\n    onClose();\n  };\n  var totalSuccess = (syncResults === null || syncResults === void 0 ? void 0 : syncResults.reduce(function (sum, r) {\n    return sum + (r.success || 0);\n  }, 0)) || 0;\n  var totalFailed = (syncResults === null || syncResults === void 0 ? void 0 : syncResults.reduce(function (sum, r) {\n    return sum + (r.failed || 0);\n  }, 0)) || 0;\n  var checklistItems = [\"Is WooCommerce active?\", \"Are REST API keys active in Settings > Advanced > REST API?\", 'Is the permalink format \"Post name\" selected in Settings > Permalinks?', \"Is the child store using any security plugin like Wordfence or iThemes Security?\", \"Does the child store URL contain a slash (/)? Check ShopCentral > Stores > Child store URL.\"];\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.Modal, {\n    isOpen: isOpen,\n    onClose: handleClose,\n    size: {\n      base: \"full\",\n      md: \"2xl\"\n    },\n    closeOnOverlayClick: !isSyncing,\n    isCentered: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.ModalOverlay, {\n    bg: \"blackAlpha.300\",\n    backdropFilter: \"blur(5px)\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.ModalContent, {\n    borderRadius: {\n      base: \"none\",\n      md: \"2xl\"\n    },\n    h: {\n      base: \"100vh\",\n      md: \"auto\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.ModalHeader, {\n    pb: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    align: \"center\",\n    gap: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiShield,\n    color: \"blue.500\",\n    boxSize: 5\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Text, {\n    m: 0\n  }, \"Push Products to Child Stores\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Text, {\n    my: 0,\n    fontSize: \"sm\",\n    color: \"gray.500\",\n    fontWeight: \"normal\",\n    mt: 1\n  }, selectedProductIds.length, \" product\", selectedProductIds.length > 1 ? 's' : '', \" selected\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.ModalCloseButton, {\n    isDisabled: isSyncing\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.ModalBody, {\n    overflowY: \"auto\",\n    maxH: {\n      base: \"calc(100vh - 140px)\",\n      md: \"70vh\"\n    }\n  }, !syncResults ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.VStack, {\n    spacing: 4,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Alert, {\n    status: \"warning\",\n    borderRadius: \"lg\",\n    p: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Box, {\n    flex: \"1\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.AlertTitle, {\n    fontSize: \"xs\",\n    fontWeight: \"700\"\n  }, \"Check the child store before pushing products:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.AlertDescription, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.UnorderedList, {\n    spacing: 1,\n    fontSize: \"xs\",\n    ml: 4\n  }, checklistItems.map(function (item, idx) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.ListItem, {\n      key: idx\n    }, item);\n  }))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Grid, {\n    templateColumns: {\n      base: \"1fr\",\n      md: \"1fr 1fr\"\n    },\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.GridItem, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Card, {\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"gray.200\",\n    h: \"full\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CardBody, {\n    p: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.HStack, {\n    justify: \"space-between\",\n    mb: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.FormLabel, {\n    fontWeight: \"600\",\n    fontSize: \"sm\",\n    m: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    align: \"center\",\n    gap: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiInfo,\n    boxSize: 3,\n    color: \"blue.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Text, {\n    m: 0\n  }, \"Target Stores\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Badge, {\n    colorScheme: \"blue\",\n    fontSize: \"2xs\",\n    borderRadius: \"md\"\n  }, isLoadingStores ? \"Loading...\" : \"\".concat(selectedStores.length, \"/\").concat(stores.length)))), stores.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Button, {\n    size: \"xs\",\n    variant: \"ghost\",\n    onClick: handleSelectAllStores,\n    colorScheme: \"blue\",\n    isDisabled: isLoadingStores\n  }, selectedStores.length === stores.length ? \"Deselect All\" : \"Select All\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Box, {\n    maxH: \"200px\",\n    minH: \"80px\",\n    overflowY: \"auto\",\n    pr: 1\n  }, isLoadingStores ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    align: \"center\",\n    justify: \"center\",\n    direction: \"column\",\n    py: 6,\n    gap: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Spinner, {\n    size: \"sm\",\n    color: \"blue.500\",\n    thickness: \"2px\",\n    speed: \"0.65s\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    color: \"gray.500\",\n    fontWeight: \"medium\"\n  }, \"Loading child stores...\")) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.CheckboxGroup, {\n    colorScheme: \"blue\",\n    value: selectedStores,\n    onChange: setSelectedStores\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Stack, {\n    spacing: 1.5\n  }, stores.map(function (store) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Checkbox, {\n      key: store.id,\n      value: store.id.toString(),\n      isDisabled: isSyncing,\n      size: \"sm\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Text, {\n      m: 0,\n      fontSize: \"sm\"\n    }, store.name));\n  }), stores.length === 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Text, {\n    m: 0,\n    color: \"gray.500\",\n    fontSize: \"sm\",\n    py: 2,\n    textAlign: \"center\"\n  }, \"No target stores available. Please add them first.\"))))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.GridItem, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Card, {\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"gray.200\",\n    h: \"full\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CardBody, {\n    p: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.FormLabel, {\n    fontWeight: \"600\",\n    fontSize: \"sm\",\n    mb: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    align: \"center\",\n    gap: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiSettings,\n    boxSize: 3,\n    color: \"purple.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Text, {\n    m: 0\n  }, \"What to Push?\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Stack, {\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Checkbox, {\n    isChecked: options.price,\n    onChange: function onChange(e) {\n      return setOptions(_objectSpread(_objectSpread({}, options), {}, {\n        price: e.target.checked\n      }));\n    },\n    isDisabled: isSyncing,\n    size: \"sm\",\n    colorScheme: \"green\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Text, {\n    m: 0,\n    fontSize: \"sm\"\n  }, \"\\uD83D\\uDCB0 Price (Regular & Sale)\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Checkbox, {\n    isChecked: options.stock,\n    onChange: function onChange(e) {\n      return setOptions(_objectSpread(_objectSpread({}, options), {}, {\n        stock: e.target.checked\n      }));\n    },\n    isDisabled: isSyncing,\n    size: \"sm\",\n    colorScheme: \"green\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Text, {\n    m: 0,\n    fontSize: \"sm\"\n  }, \"\\uD83D\\uDCE6 Stock Status & Quantity\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Checkbox, {\n    isChecked: options.description,\n    onChange: function onChange(e) {\n      return setOptions(_objectSpread(_objectSpread({}, options), {}, {\n        description: e.target.checked\n      }));\n    },\n    isDisabled: isSyncing,\n    size: \"sm\",\n    colorScheme: \"green\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Text, {\n    m: 0,\n    fontSize: \"sm\"\n  }, \"\\uD83D\\uDCDD Description & Short Description\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Checkbox, {\n    isChecked: options.image,\n    onChange: function onChange(e) {\n      return setOptions(_objectSpread(_objectSpread({}, options), {}, {\n        image: e.target.checked\n      }));\n    },\n    isDisabled: isSyncing,\n    size: \"sm\",\n    colorScheme: \"green\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Text, {\n    m: 0,\n    fontSize: \"sm\"\n  }, \"\\uD83D\\uDDBC\\uFE0F Images (Featured & Gallery)\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Divider, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Checkbox, {\n    isChecked: options.categories,\n    onChange: function onChange(e) {\n      return setOptions(_objectSpread(_objectSpread({}, options), {}, {\n        categories: e.target.checked\n      }));\n    },\n    isDisabled: isSyncing,\n    size: \"sm\",\n    colorScheme: \"purple\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Text, {\n    m: 0,\n    fontSize: \"sm\"\n  }, \"\\uD83C\\uDFF7\\uFE0F Categories\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Checkbox, {\n    isChecked: options.tags,\n    onChange: function onChange(e) {\n      return setOptions(_objectSpread(_objectSpread({}, options), {}, {\n        tags: e.target.checked\n      }));\n    },\n    isDisabled: isSyncing,\n    size: \"sm\",\n    colorScheme: \"purple\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Text, {\n    m: 0,\n    fontSize: \"sm\"\n  }, \"\\uD83D\\uDD16 Tags\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Divider, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Checkbox, {\n    isChecked: options.meta,\n    onChange: function onChange(e) {\n      return setOptions(_objectSpread(_objectSpread({}, options), {}, {\n        meta: e.target.checked\n      }));\n    },\n    isDisabled: isSyncing,\n    size: \"sm\",\n    colorScheme: \"orange\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Text, {\n    m: 0,\n    fontSize: \"sm\"\n  }, \"\\u2699\\uFE0F Custom Meta / ACF Fields\")))))))) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.VStack, {\n    spacing: 4,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    gap: 3,\n    justify: \"center\",\n    flexWrap: \"wrap\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Badge, {\n    colorScheme: \"green\",\n    px: 4,\n    py: 2,\n    borderRadius: \"xl\",\n    fontSize: \"md\",\n    display: \"flex\",\n    alignItems: \"center\",\n    gap: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiCheckCircle\n  }), \" \", totalSuccess, \" Success\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Badge, {\n    colorScheme: totalFailed > 0 ? \"red\" : \"gray\",\n    px: 4,\n    py: 2,\n    borderRadius: \"xl\",\n    fontSize: \"md\",\n    display: \"flex\",\n    alignItems: \"center\",\n    gap: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiXCircle\n  }), \" \", totalFailed, \" Failed\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Divider, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Grid, {\n    templateColumns: {\n      base: \"1fr\",\n      md: \"1fr 1fr\"\n    },\n    gap: 3,\n    maxH: \"300px\",\n    overflowY: \"auto\"\n  }, syncResults.map(function (storeResult, idx) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Box, {\n      key: storeResult.store_name + idx,\n      borderWidth: \"1px\",\n      borderRadius: \"xl\",\n      overflow: \"hidden\",\n      shadow: \"sm\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Box, {\n      bg: \"gray.50\",\n      px: 3,\n      py: 2,\n      fontWeight: \"semibold\",\n      fontSize: \"sm\",\n      display: \"flex\",\n      alignItems: \"center\",\n      justifyContent: \"space-between\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Text, {\n      m: 0,\n      isTruncated: true\n    }, storeResult.store_name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n      gap: 1\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Badge, {\n      colorScheme: \"green\",\n      size: \"sm\"\n    }, storeResult.success), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Badge, {\n      colorScheme: \"red\",\n      size: \"sm\"\n    }, storeResult.failed))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Box, {\n      maxH: \"150px\",\n      overflowY: \"auto\"\n    }, (storeResult.details || []).map(function (detail, dIdx) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n        key: dIdx,\n        px: 3,\n        py: 1.5,\n        fontSize: \"2xs\",\n        borderTop: \"1px\",\n        borderColor: \"gray.100\",\n        align: \"start\",\n        gap: 2\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n        as: detail.status === 'success' ? react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiCheckCircle : react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiXCircle,\n        color: detail.status === 'success' ? 'green.500' : 'red.500',\n        mt: \"2px\",\n        flexShrink: 0,\n        boxSize: 3\n      }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Box, {\n        flex: \"1\",\n        minW: \"0\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Text, {\n        m: 0,\n        fontWeight: \"medium\",\n        color: detail.status === 'failed' ? 'red.700' : 'gray.800',\n        isTruncated: true\n      }, detail.product, detail.sku && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Text, {\n        as: \"span\",\n        color: \"gray.500\",\n        ml: 1\n      }, \"(\", detail.sku, \")\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Text, {\n        m: 0,\n        color: detail.status === 'failed' ? 'red.600' : 'gray.500',\n        mt: 0.5,\n        noOfLines: 1\n      }, detail.message)));\n    })));\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Box, {\n    bg: \"blue.50\",\n    borderRadius: \"xl\",\n    p: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    align: \"center\",\n    gap: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiInfo,\n    color: \"blue.500\",\n    boxSize: 4\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    color: \"blue.700\"\n  }, \"Detailed logs are also saved in \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"strong\", null, \"ShopCentral Logs\"), \" for future reference.\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.ModalFooter, {\n    pt: 2\n  }, !syncResults ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Button, {\n    variant: \"ghost\",\n    mr: 3,\n    onClick: handleClose,\n    isDisabled: isSyncing,\n    borderRadius: \"xl\"\n  }, \"Cancel\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Button, {\n    colorScheme: \"blue\",\n    onClick: handleSync,\n    isLoading: isSyncing,\n    isDisabled: selectedStores.length === 0 || isLoadingStores,\n    borderRadius: \"xl\",\n    px: 6\n  }, \"Start Sync\")) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Button, {\n    colorScheme: \"blue\",\n    onClick: handleClose,\n    borderRadius: \"xl\",\n    px: 6\n  }, \"Done\"))));\n};\n\n// Simple Card component for consistent styling\nvar Card = function Card(_ref4) {\n  var children = _ref4.children,\n    props = _objectWithoutProperties(_ref4, _excluded);\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Box, _extends({\n    bg: \"white\"\n  }, props), children);\n};\nvar CardBody = function CardBody(_ref5) {\n  var children = _ref5.children,\n    props = _objectWithoutProperties(_ref5, _excluded2);\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Box, props, children);\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SyncProductsModal);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Products/SyncProductsModal.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Products/ViewProduct.jsx"
/*!*********************************************************!*\
  !*** ./src/Pages/StoreManager/Products/ViewProduct.jsx ***!
  \*********************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/hooks/dist/esm/use-disclosure.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/breadcrumb/breadcrumb.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/breadcrumb/breadcrumb-item.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/breadcrumb/breadcrumb-link.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/divider/divider.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/simple-grid.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/image/image.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/spinner/spinner.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tbody.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/td.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tr.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/heading.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router/dist/development/chunk-EPOLDU6W.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! react-hot-toast */ \"./node_modules/react-hot-toast/dist/index.mjs\");\n/* harmony import */ var _utils_FormatDate__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../../utils/FormatDate */ \"./src/utils/FormatDate.js\");\n/* harmony import */ var _Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../../../Components/shared/ConfirmDialog */ \"./src/Components/shared/ConfirmDialog.jsx\");\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\n\n\n\n\nvar ViewProduct = function ViewProduct() {\n  var _product$images, _product$status, _product$variations, _product$categories, _product$tags, _product$backorders;\n  var _useParams = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_24__.useParams)(),\n    id = _useParams.id;\n  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_24__.useNavigate)();\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState2 = _slicedToArray(_useState, 2),\n    product = _useState2[0],\n    setProduct = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),\n    _useState4 = _slicedToArray(_useState3, 2),\n    loading = _useState4[0],\n    setLoading = _useState4[1];\n  var _useDisclosure = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.useDisclosure)(),\n    isDeleteOpen = _useDisclosure.isOpen,\n    onDeleteOpen = _useDisclosure.onOpen,\n    onDeleteClose = _useDisclosure.onClose;\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState6 = _slicedToArray(_useState5, 2),\n    isDeleting = _useState6[0],\n    setIsDeleting = _useState6[1];\n  var fetchProduct = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n    var _response$data, response, productData, _t;\n    return _regenerator().w(function (_context) {\n      while (1) switch (_context.p = _context.n) {\n        case 0:\n          _context.p = 0;\n          setLoading(true);\n          _context.n = 1;\n          return axios__WEBPACK_IMPORTED_MODULE_25__[\"default\"].get(\"/api/store-manager/products/\".concat(id));\n        case 1:\n          response = _context.v;\n          productData = ((_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.data) || response.data;\n          setProduct(productData);\n          _context.n = 3;\n          break;\n        case 2:\n          _context.p = 2;\n          _t = _context.v;\n          react_hot_toast__WEBPACK_IMPORTED_MODULE_26__[\"default\"].error(\"Failed to load product details\");\n          navigate(\"/store-manager/products\");\n        case 3:\n          _context.p = 3;\n          setLoading(false);\n          return _context.f(3);\n        case 4:\n          return _context.a(2);\n      }\n    }, _callee, null, [[0, 2, 3, 4]]);\n  })), [id, navigate]);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    fetchProduct();\n  }, [fetchProduct]);\n  var handleDelete = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {\n      return _regenerator().w(function (_context2) {\n        while (1) switch (_context2.n) {\n          case 0:\n            onDeleteOpen();\n          case 1:\n            return _context2.a(2);\n        }\n      }, _callee2);\n    }));\n    return function handleDelete() {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  var confirmDelete = /*#__PURE__*/function () {\n    var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {\n      var _t2;\n      return _regenerator().w(function (_context3) {\n        while (1) switch (_context3.p = _context3.n) {\n          case 0:\n            setIsDeleting(true);\n            _context3.p = 1;\n            _context3.n = 2;\n            return axios__WEBPACK_IMPORTED_MODULE_25__[\"default\"][\"delete\"](\"/api/store-manager/products/\".concat(id), {\n              params: {\n                force: true\n              }\n            });\n          case 2:\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_26__[\"default\"].success(\"Product deleted successfully\");\n            navigate(\"/store-manager/products\");\n            _context3.n = 4;\n            break;\n          case 3:\n            _context3.p = 3;\n            _t2 = _context3.v;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_26__[\"default\"].error(\"Failed to delete product\");\n          case 4:\n            _context3.p = 4;\n            setIsDeleting(false);\n            onDeleteClose();\n            return _context3.f(4);\n          case 5:\n            return _context3.a(2);\n        }\n      }, _callee3, null, [[1, 3, 4, 5]]);\n    }));\n    return function confirmDelete() {\n      return _ref3.apply(this, arguments);\n    };\n  }();\n  if (loading) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n      justify: \"center\",\n      align: \"center\",\n      h: \"60vh\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Spinner, {\n      size: \"xl\",\n      color: \"blue.500\",\n      thickness: \"4px\"\n    }));\n  }\n  if (!product) return null;\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(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    animation: \"fadeIn 0.4s ease-out\",\n    pb: 10\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    justify: \"space-between\",\n    align: \"center\",\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    align: \"start\",\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Breadcrumb, {\n    fontSize: \"sm\",\n    color: \"gray.500\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.BreadcrumbItem, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.BreadcrumbLink, {\n    onClick: function onClick() {\n      return navigate(\"/store-manager/products\");\n    }\n  }, \"Products\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.BreadcrumbItem, {\n    isCurrentPage: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.BreadcrumbLink, null, product.name))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.Heading, {\n    size: \"lg\",\n    fontWeight: \"800\"\n  }, \"Product Details\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.HStack, {\n    spacing: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_23__.FiArrowLeft, null),\n    variant: \"ghost\",\n    onClick: function onClick() {\n      return navigate(\"/store-manager/products\");\n    },\n    borderRadius: \"xl\"\n  }, \"Back\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_23__.FiEye, null),\n    variant: \"outline\",\n    onClick: function onClick() {\n      return window.open(product.permalink, '_blank');\n    },\n    borderRadius: \"xl\"\n  }, \"View on Site\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_23__.FiTrash2, null),\n    colorScheme: \"red\",\n    variant: \"subtle\",\n    onClick: handleDelete,\n    borderRadius: \"xl\"\n  }, \"Delete\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.SimpleGrid, {\n    columns: {\n      base: 1,\n      md: 3\n    },\n    spacing: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    gridColumn: {\n      md: \"span 2\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Card, {\n    variant: \"outline\",\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\",\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.CardBody, {\n    p: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    direction: {\n      base: \"column\",\n      sm: \"row\"\n    },\n    gap: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Image, {\n    src: ((_product$images = product.images) === null || _product$images === void 0 || (_product$images = _product$images[0]) === null || _product$images === void 0 ? void 0 : _product$images.src) || 'https://via.placeholder.com/300',\n    boxSize: \"200px\",\n    objectFit: \"cover\",\n    borderRadius: \"2xl\",\n    fallbackSrc: \"https://via.placeholder.com/200\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    align: \"start\",\n    spacing: 4,\n    flex: \"1\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    align: \"start\",\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n    colorScheme: product.status === 'publish' ? 'green' : 'gray',\n    px: 2,\n    borderRadius: \"md\",\n    fontSize: \"2xs\"\n  }, (_product$status = product.status) === null || _product$status === void 0 ? void 0 : _product$status.toUpperCase()), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.Heading, {\n    size: \"md\",\n    fontWeight: \"800\"\n  }, product.name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    my: 0,\n    fontSize: \"sm\",\n    color: \"gray.500\"\n  }, \"ID: \", product.id, \" \\u2022 SKU: \", product.sku || 'N/A')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.HStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    align: \"start\",\n    spacing: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    my: 0,\n    fontSize: \"xs\",\n    color: \"gray.400\",\n    fontWeight: \"700\"\n  }, \"PRICE\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    mt: 1,\n    fontWeight: \"900\",\n    fontSize: \"xl\",\n    color: \"blue.600\",\n    dangerouslySetInnerHTML: {\n      __html: product.price_html\n    }\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    align: \"start\",\n    spacing: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.400\",\n    fontWeight: \"700\"\n  }, \"STOCK\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n    colorScheme: product.stock_status === 'instock' ? 'green' : 'red',\n    variant: \"subtle\"\n  }, product.stock_status === 'instock' ? 'In Stock' : 'Out of Stock'))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Divider, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.400\",\n    fontWeight: \"700\",\n    mb: 2\n  }, \"SHORT DESCRIPTION\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    fontSize: \"sm\",\n    color: \"gray.600\",\n    dangerouslySetInnerHTML: {\n      __html: product.short_description\n    }\n  })))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Card, {\n    variant: \"outline\",\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.CardBody, {\n    p: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.Heading, {\n    size: \"sm\",\n    mb: 4,\n    fontWeight: \"800\"\n  }, \"Product Variations\"), ((_product$variations = product.variations) === null || _product$variations === void 0 ? void 0 : _product$variations.length) > 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Table, {\n    variant: \"simple\",\n    size: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Tbody, null, product.variations.map(function (v_id) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Tr, {\n      key: v_id\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Td, {\n      fontWeight: \"600\"\n    }, \"Variation #\", v_id), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Td, {\n      textAlign: \"right\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Button, {\n      size: \"xs\",\n      variant: \"ghost\",\n      colorScheme: \"blue\"\n    }, \"Manage\")));\n  }))) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.400\",\n    fontStyle: \"italic\"\n  }, \"This is a simple product with no variations.\")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Card, {\n    variant: \"outline\",\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\",\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.CardBody, {\n    p: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    align: \"stretch\",\n    spacing: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.Heading, {\n    size: \"xs\",\n    mb: 3,\n    textTransform: \"uppercase\",\n    color: \"gray.400\",\n    letterSpacing: \"widest\"\n  }, \"Categories\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    flexWrap: \"wrap\",\n    gap: 2\n  }, (_product$categories = product.categories) === null || _product$categories === void 0 ? void 0 : _product$categories.map(function (cat) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n      key: cat.id,\n      colorScheme: \"blue\",\n      variant: \"outline\",\n      borderRadius: \"md\",\n      px: 2\n    }, cat.name);\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.Heading, {\n    size: \"xs\",\n    mb: 3,\n    textTransform: \"uppercase\",\n    color: \"gray.400\",\n    letterSpacing: \"widest\"\n  }, \"Tags\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    flexWrap: \"wrap\",\n    gap: 2\n  }, ((_product$tags = product.tags) === null || _product$tags === void 0 ? void 0 : _product$tags.length) > 0 ? product.tags.map(function (tag) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n      key: tag.id,\n      colorScheme: \"gray\",\n      variant: \"subtle\",\n      borderRadius: \"md\",\n      px: 2,\n      fontSize: \"2xs\"\n    }, tag.name);\n  }) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.400\"\n  }, \"No tags\")))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Card, {\n    variant: \"outline\",\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.CardBody, {\n    p: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.Heading, {\n    size: \"sm\",\n    mb: 4,\n    fontWeight: \"800\"\n  }, \"Inventory\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.VStack, {\n    align: \"stretch\",\n    spacing: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    justify: \"space-between\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.500\",\n    fontWeight: \"700\"\n  }, \"MANAGED STOCK\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n    colorScheme: product.manage_stock ? \"green\" : \"gray\"\n  }, product.manage_stock ? \"Yes\" : \"No\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    justify: \"space-between\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.500\",\n    fontWeight: \"700\"\n  }, \"QUANTITY\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontWeight: \"800\"\n  }, product.stock_quantity || '0')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    justify: \"space-between\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.500\",\n    fontWeight: \"700\"\n  }, \"BACKORDERS\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Text, {\n    fontSize: \"xs\",\n    fontWeight: \"700\"\n  }, (_product$backorders = product.backorders) === null || _product$backorders === void 0 ? void 0 : _product$backorders.toUpperCase())))))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_28__[\"default\"], {\n    isOpen: isDeleteOpen,\n    onClose: onDeleteClose,\n    onConfirm: confirmDelete,\n    title: \"Delete Product\",\n    description: \"Are you sure you want to permanently delete this product? This cannot be undone.\",\n    confirmLabel: \"Delete\",\n    loading: isDeleting\n  }));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ViewProduct);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Products/ViewProduct.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/SmartProductCreator/SmartProductCreator.jsx"
/*!****************************************************************************!*\
  !*** ./src/Pages/StoreManager/SmartProductCreator/SmartProductCreator.jsx ***!
  \****************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/alert/alert.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/alert/alert-description.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/alert/alert-icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/alert/alert-title.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/icon-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/close-button/close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/divider/divider.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-control.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-label.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/grid.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/grid-item.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/image/image.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/media-query/use-breakpoint-value.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-footer.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-header.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-overlay.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/number-input/number-input.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/select/select.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/spinner/spinner.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tbody.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/td.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/th.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/thead.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tr.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/textarea/textarea.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/toast/use-toast.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.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 _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\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 _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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 _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\nvar SmartProductCreator = function SmartProductCreator(_ref) {\n  var isOpen = _ref.isOpen,\n    onClose = _ref.onClose;\n  var toast = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_41__.useToast)();\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0),\n    _useState2 = _slicedToArray(_useState, 2),\n    activeStep = _useState2[0],\n    setActiveStep = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState4 = _slicedToArray(_useState3, 2),\n    loading = _useState4[0],\n    setLoading = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState6 = _slicedToArray(_useState5, 2),\n    creating = _useState6[0],\n    setCreating = _useState6[1];\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState8 = _slicedToArray(_useState7, 2),\n    created = _useState8[0],\n    setCreated = _useState8[1];\n\n  // Responsive sizes\n  var modalSize = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.useBreakpointValue)({\n    base: \"full\",\n    md: \"3xl\",\n    xl: \"5xl\"\n  });\n  var isMobile = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.useBreakpointValue)({\n    base: true,\n    md: false\n  });\n\n  // Product Type\n  var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"simple\"),\n    _useState0 = _slicedToArray(_useState9, 2),\n    productType = _useState0[0],\n    setProductType = _useState0[1];\n\n  // Step 1: Store Selection\n  var _useState1 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState10 = _slicedToArray(_useState1, 2),\n    stores = _useState10[0],\n    setStores = _useState10[1];\n  var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState12 = _slicedToArray(_useState11, 2),\n    selectedStores = _useState12[0],\n    setSelectedStores = _useState12[1];\n  var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({}),\n    _useState14 = _slicedToArray(_useState13, 2),\n    priceAdjustments = _useState14[0],\n    setPriceAdjustments = _useState14[1];\n\n  // Step 2: Product Details\n  var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({\n      name: \"\",\n      description: \"\",\n      short_description: \"\",\n      sku: \"\",\n      status: \"publish\"\n    }),\n    _useState16 = _slicedToArray(_useState15, 2),\n    productData = _useState16[0],\n    setProductData = _useState16[1];\n  var _useState17 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState18 = _slicedToArray(_useState17, 2),\n    featuredImage = _useState18[0],\n    setFeaturedImage = _useState18[1];\n  var _useState19 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState20 = _slicedToArray(_useState19, 2),\n    featuredImagePreview = _useState20[0],\n    setFeaturedImagePreview = _useState20[1];\n  var _useState21 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState22 = _slicedToArray(_useState21, 2),\n    featuredImageUrl = _useState22[0],\n    setFeaturedImageUrl = _useState22[1];\n  var _useState23 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState24 = _slicedToArray(_useState23, 2),\n    uploadingImage = _useState24[0],\n    setUploadingImage = _useState24[1];\n\n  // Simple Product Fields\n  var _useState25 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({\n      regular_price: \"\",\n      sale_price: \"\",\n      stock_quantity: 0,\n      manage_stock: true\n    }),\n    _useState26 = _slicedToArray(_useState25, 2),\n    simpleProduct = _useState26[0],\n    setSimpleProduct = _useState26[1];\n\n  // Categories & Tags\n  var _useState27 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState28 = _slicedToArray(_useState27, 2),\n    categories = _useState28[0],\n    setCategories = _useState28[1];\n  var _useState29 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState30 = _slicedToArray(_useState29, 2),\n    tags = _useState30[0],\n    setTags = _useState30[1];\n  var _useState31 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"\"),\n    _useState32 = _slicedToArray(_useState31, 2),\n    newCategory = _useState32[0],\n    setNewCategory = _useState32[1];\n  var _useState33 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"\"),\n    _useState34 = _slicedToArray(_useState33, 2),\n    newTag = _useState34[0],\n    setNewTag = _useState34[1];\n\n  // Step 3: Attributes & Variations\n  var _useState35 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState36 = _slicedToArray(_useState35, 2),\n    attributes = _useState36[0],\n    setAttributes = _useState36[1];\n  var _useState37 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState38 = _slicedToArray(_useState37, 2),\n    variations = _useState38[0],\n    setVariations = _useState38[1];\n  var _useState39 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"\"),\n    _useState40 = _slicedToArray(_useState39, 2),\n    newAttrName = _useState40[0],\n    setNewAttrName = _useState40[1];\n  var _useState41 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"\"),\n    _useState42 = _slicedToArray(_useState41, 2),\n    newAttrOptions = _useState42[0],\n    setNewAttrOptions = _useState42[1];\n\n  // Results\n  var _useState43 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState44 = _slicedToArray(_useState43, 2),\n    results = _useState44[0],\n    setResults = _useState44[1];\n  var _useState45 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState46 = _slicedToArray(_useState45, 2),\n    showResults = _useState46[0],\n    setShowResults = _useState46[1];\n  var steps = [{\n    title: \"Stores\",\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_43__.FiLayers,\n    description: \"Select target stores\"\n  }, {\n    title: \"Details\",\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_43__.FiSettings,\n    description: \"Basic information\"\n  }].concat(_toConsumableArray(productType === \"variable\" ? [{\n    title: \"Variations\",\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_43__.FiBox,\n    description: \"Attributes & pricing\"\n  }] : []));\n\n  // Reset all form state\n  var resetForm = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {\n    setActiveStep(0);\n    setProductType(\"simple\");\n    setSelectedStores([]);\n    setPriceAdjustments({});\n    setProductData({\n      name: \"\",\n      description: \"\",\n      short_description: \"\",\n      sku: \"\",\n      status: \"publish\"\n    });\n    setFeaturedImage(null);\n    setFeaturedImagePreview(null);\n    setFeaturedImageUrl(null);\n    setSimpleProduct({\n      regular_price: \"\",\n      sale_price: \"\",\n      stock_quantity: 0,\n      manage_stock: true\n    });\n    setCategories([]);\n    setTags([]);\n    setNewCategory(\"\");\n    setNewTag(\"\");\n    setAttributes([]);\n    setVariations([]);\n    setNewAttrName(\"\");\n    setNewAttrOptions(\"\");\n    setResults([]);\n    setShowResults(false);\n    setCreated(false);\n  }, []);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    if (isOpen) {\n      fetchStores();\n    }\n  }, [isOpen]);\n  var fetchStores = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n      var _res$data, res, _t;\n      return _regenerator().w(function (_context) {\n        while (1) switch (_context.p = _context.n) {\n          case 0:\n            setLoading(true);\n            _context.p = 1;\n            _context.n = 2;\n            return axios__WEBPACK_IMPORTED_MODULE_44__[\"default\"].get(\"/smart-creator/stores\");\n          case 2:\n            res = _context.v;\n            setStores(((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.stores) || []);\n            _context.n = 4;\n            break;\n          case 3:\n            _context.p = 3;\n            _t = _context.v;\n            toast({\n              title: \"Failed to load stores\",\n              status: \"error\",\n              duration: 3000\n            });\n          case 4:\n            _context.p = 4;\n            setLoading(false);\n            return _context.f(4);\n          case 5:\n            return _context.a(2);\n        }\n      }, _callee, null, [[1, 3, 4, 5]]);\n    }));\n    return function fetchStores() {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  var toggleStore = function toggleStore(storeId) {\n    setSelectedStores(function (prev) {\n      return prev.includes(storeId) ? prev.filter(function (id) {\n        return id !== storeId;\n      }) : [].concat(_toConsumableArray(prev), [storeId]);\n    });\n  };\n  var handleImageUpload = /*#__PURE__*/function () {\n    var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(e) {\n      var _e$target$files;\n      var file, _res$data2, formData, res, _t2;\n      return _regenerator().w(function (_context2) {\n        while (1) switch (_context2.p = _context2.n) {\n          case 0:\n            file = (_e$target$files = e.target.files) === null || _e$target$files === void 0 ? void 0 : _e$target$files[0];\n            if (file) {\n              _context2.n = 1;\n              break;\n            }\n            return _context2.a(2);\n          case 1:\n            if (file.type.startsWith('image/')) {\n              _context2.n = 2;\n              break;\n            }\n            toast({\n              title: \"Please select an image file\",\n              status: \"error\",\n              duration: 3000\n            });\n            return _context2.a(2);\n          case 2:\n            setFeaturedImage(file);\n            setFeaturedImagePreview(URL.createObjectURL(file));\n            setUploadingImage(true);\n            _context2.p = 3;\n            formData = new FormData();\n            formData.append('image', file);\n            _context2.n = 4;\n            return axios__WEBPACK_IMPORTED_MODULE_44__[\"default\"].post('/smart-creator/upload-image', formData, {\n              headers: {\n                'Content-Type': 'multipart/form-data'\n              }\n            });\n          case 4:\n            res = _context2.v;\n            setFeaturedImageUrl(((_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.url) || null);\n            toast({\n              title: \"Image uploaded\",\n              status: \"success\",\n              duration: 2000\n            });\n            _context2.n = 6;\n            break;\n          case 5:\n            _context2.p = 5;\n            _t2 = _context2.v;\n            toast({\n              title: \"Image upload failed\",\n              status: \"error\",\n              duration: 3000\n            });\n          case 6:\n            _context2.p = 6;\n            setUploadingImage(false);\n            return _context2.f(6);\n          case 7:\n            return _context2.a(2);\n        }\n      }, _callee2, null, [[3, 5, 6, 7]]);\n    }));\n    return function handleImageUpload(_x) {\n      return _ref3.apply(this, arguments);\n    };\n  }();\n  var addAttribute = function addAttribute() {\n    if (!newAttrName.trim() || !newAttrOptions.trim()) {\n      toast({\n        title: \"Enter attribute name and options\",\n        status: \"warning\",\n        duration: 2000\n      });\n      return;\n    }\n    var options = newAttrOptions.split(',').map(function (o) {\n      return o.trim();\n    }).filter(Boolean);\n    if (options.length === 0) return;\n    var attrName = newAttrName.trim();\n    setAttributes(function (prev) {\n      var existingIndex = prev.findIndex(function (a) {\n        return a.name.toLowerCase() === attrName.toLowerCase();\n      });\n      if (existingIndex >= 0) {\n        var existing = prev[existingIndex];\n        var mergedOptions = _toConsumableArray(existing.options);\n        options.forEach(function (opt) {\n          if (!mergedOptions.some(function (o) {\n            return o.toLowerCase() === opt.toLowerCase();\n          })) {\n            mergedOptions.push(opt);\n          }\n        });\n        var updated = _toConsumableArray(prev);\n        updated[existingIndex] = _objectSpread(_objectSpread({}, existing), {}, {\n          options: mergedOptions\n        });\n        return updated;\n      } else {\n        return [].concat(_toConsumableArray(prev), [{\n          name: attrName,\n          options: options\n        }]);\n      }\n    });\n    setNewAttrName(\"\");\n    setNewAttrOptions(\"\");\n  };\n\n  // Category handlers\n  var addCategory = function addCategory() {\n    if (!newCategory.trim()) return;\n    var catName = newCategory.trim();\n    if (!categories.some(function (c) {\n      return c.toLowerCase() === catName.toLowerCase();\n    })) {\n      setCategories(function (prev) {\n        return [].concat(_toConsumableArray(prev), [catName]);\n      });\n    }\n    setNewCategory(\"\");\n  };\n  var removeCategory = function removeCategory(index) {\n    setCategories(function (prev) {\n      return prev.filter(function (_, i) {\n        return i !== index;\n      });\n    });\n  };\n\n  // Tag handlers\n  var addTag = function addTag() {\n    if (!newTag.trim()) return;\n    var tagName = newTag.trim();\n    if (!tags.some(function (t) {\n      return t.toLowerCase() === tagName.toLowerCase();\n    })) {\n      setTags(function (prev) {\n        return [].concat(_toConsumableArray(prev), [tagName]);\n      });\n    }\n    setNewTag(\"\");\n  };\n  var removeTag = function removeTag(index) {\n    setTags(function (prev) {\n      return prev.filter(function (_, i) {\n        return i !== index;\n      });\n    });\n  };\n  var removeAttribute = function removeAttribute(index) {\n    setAttributes(function (prev) {\n      return prev.filter(function (_, i) {\n        return i !== index;\n      });\n    });\n    var newAttrs = attributes.filter(function (_, i) {\n      return i !== index;\n    });\n    if (newAttrs.length > 0) {\n      generateVariations(newAttrs);\n    } else {\n      setVariations([]);\n    }\n  };\n  var generateVariations = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (attrs) {\n    if (attrs.length === 0) {\n      setVariations([]);\n      return;\n    }\n    var combinations = [{}];\n    var _iterator = _createForOfIteratorHelper(attrs),\n      _step;\n    try {\n      for (_iterator.s(); !(_step = _iterator.n()).done;) {\n        var attr = _step.value;\n        var temp = [];\n        var _iterator2 = _createForOfIteratorHelper(combinations),\n          _step2;\n        try {\n          for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n            var combo = _step2.value;\n            var _iterator3 = _createForOfIteratorHelper(attr.options),\n              _step3;\n            try {\n              for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n                var option = _step3.value;\n                temp.push(_objectSpread(_objectSpread({}, combo), {}, _defineProperty({}, attr.name, option)));\n              }\n            } catch (err) {\n              _iterator3.e(err);\n            } finally {\n              _iterator3.f();\n            }\n          }\n        } catch (err) {\n          _iterator2.e(err);\n        } finally {\n          _iterator2.f();\n        }\n        combinations = temp;\n      }\n    } catch (err) {\n      _iterator.e(err);\n    } finally {\n      _iterator.f();\n    }\n    var newVariations = combinations.map(function (combo, idx) {\n      return {\n        id: idx,\n        attributes: combo,\n        sku: \"\",\n        regular_price: \"\",\n        sale_price: \"\",\n        stock_quantity: 0\n      };\n    });\n    setVariations(newVariations);\n  }, []);\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    if (attributes.length > 0) {\n      generateVariations(attributes);\n    }\n  }, [attributes, generateVariations]);\n  var updateVariation = function updateVariation(index, field, value) {\n    setVariations(function (prev) {\n      return prev.map(function (v, i) {\n        return i === index ? _objectSpread(_objectSpread({}, v), {}, _defineProperty({}, field, value)) : v;\n      });\n    });\n  };\n  var handleCreateProduct = /*#__PURE__*/function () {\n    var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {\n      var invalidVariations, _res$data3, _res$data4, _res$data5, payload, res, successCount, errorCount, _error$response, _t3;\n      return _regenerator().w(function (_context3) {\n        while (1) switch (_context3.p = _context3.n) {\n          case 0:\n            if (!(selectedStores.length === 0)) {\n              _context3.n = 1;\n              break;\n            }\n            toast({\n              title: \"Select at least one store\",\n              status: \"warning\",\n              duration: 3000\n            });\n            return _context3.a(2);\n          case 1:\n            if (productData.name.trim()) {\n              _context3.n = 2;\n              break;\n            }\n            toast({\n              title: \"Product name is required\",\n              status: \"warning\",\n              duration: 3000\n            });\n            return _context3.a(2);\n          case 2:\n            if (!(productType === \"simple\")) {\n              _context3.n = 4;\n              break;\n            }\n            if (!(!simpleProduct.regular_price || parseFloat(simpleProduct.regular_price) <= 0)) {\n              _context3.n = 3;\n              break;\n            }\n            toast({\n              title: \"Regular price is required\",\n              status: \"warning\",\n              duration: 3000\n            });\n            return _context3.a(2);\n          case 3:\n            _context3.n = 6;\n            break;\n          case 4:\n            if (!(variations.length === 0)) {\n              _context3.n = 5;\n              break;\n            }\n            toast({\n              title: \"Add at least one variation\",\n              status: \"warning\",\n              duration: 3000\n            });\n            return _context3.a(2);\n          case 5:\n            invalidVariations = variations.filter(function (v) {\n              return !v.regular_price || parseFloat(v.regular_price) <= 0;\n            });\n            if (!(invalidVariations.length > 0)) {\n              _context3.n = 6;\n              break;\n            }\n            toast({\n              title: \"All variations need a valid regular price\",\n              status: \"warning\",\n              duration: 3000\n            });\n            return _context3.a(2);\n          case 6:\n            setCreating(true);\n            _context3.p = 7;\n            payload = _objectSpread(_objectSpread(_objectSpread({\n              store_ids: selectedStores,\n              product_type: productType,\n              product_data: _objectSpread(_objectSpread({}, productData), {}, {\n                featured_image_url: featuredImageUrl,\n                categories: categories,\n                tags: tags\n              }, productType === \"variable\" && {\n                attributes: attributes.map(function (a) {\n                  return {\n                    name: a.name,\n                    options: a.options\n                  };\n                })\n              })\n            }, productType === \"simple\" && {\n              regular_price: simpleProduct.regular_price,\n              sale_price: simpleProduct.sale_price,\n              stock_quantity: simpleProduct.stock_quantity,\n              manage_stock: simpleProduct.manage_stock\n            }), productType === \"variable\" && {\n              variations: variations.map(function (v) {\n                return {\n                  attributes: v.attributes,\n                  sku: v.sku,\n                  regular_price: v.regular_price,\n                  sale_price: v.sale_price,\n                  stock_quantity: v.stock_quantity\n                };\n              })\n            }), {}, {\n              price_adjustments: priceAdjustments\n            });\n            _context3.n = 8;\n            return axios__WEBPACK_IMPORTED_MODULE_44__[\"default\"].post(\"/smart-creator/create\", payload);\n          case 8:\n            res = _context3.v;\n            setResults(((_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.results) || []);\n            setShowResults(true);\n            setCreated(true);\n            successCount = ((_res$data4 = res.data) === null || _res$data4 === void 0 || (_res$data4 = _res$data4.results) === null || _res$data4 === void 0 ? void 0 : _res$data4.filter(function (r) {\n              return r.status === 'success';\n            }).length) || 0;\n            errorCount = ((_res$data5 = res.data) === null || _res$data5 === void 0 || (_res$data5 = _res$data5.results) === null || _res$data5 === void 0 ? void 0 : _res$data5.filter(function (r) {\n              return r.status === 'error';\n            }).length) || 0;\n            if (errorCount === 0) {\n              toast({\n                title: \"Success!\",\n                description: \"Product created in \".concat(successCount, \" store(s)\"),\n                status: \"success\",\n                duration: 5000\n              });\n              // Auto-reset after 2 seconds\n              setTimeout(function () {\n                resetForm();\n              }, 2000);\n            } else {\n              toast({\n                title: \"Partially Successful\",\n                description: \"\".concat(successCount, \" succeeded, \").concat(errorCount, \" failed\"),\n                status: \"warning\",\n                duration: 5000\n              });\n            }\n            _context3.n = 10;\n            break;\n          case 9:\n            _context3.p = 9;\n            _t3 = _context3.v;\n            toast({\n              title: \"Failed to create product\",\n              description: ((_error$response = _t3.response) === null || _error$response === void 0 || (_error$response = _error$response.data) === null || _error$response === void 0 ? void 0 : _error$response.message) || _t3.message,\n              status: \"error\",\n              duration: 5000\n            });\n          case 10:\n            _context3.p = 10;\n            setCreating(false);\n            return _context3.f(10);\n          case 11:\n            return _context3.a(2);\n        }\n      }, _callee3, null, [[7, 9, 10, 11]]);\n    }));\n    return function handleCreateProduct() {\n      return _ref4.apply(this, arguments);\n    };\n  }();\n  var handleClose = function handleClose() {\n    resetForm();\n    onClose();\n  };\n  var totalSteps = productType === \"variable\" ? 3 : 2;\n  var nextStep = function nextStep() {\n    if (activeStep === 0 && selectedStores.length === 0) {\n      toast({\n        title: \"Select at least one store\",\n        status: \"warning\",\n        duration: 2000\n      });\n      return;\n    }\n    if (activeStep === 1 && !productData.name.trim()) {\n      toast({\n        title: \"Product name is required\",\n        status: \"warning\",\n        duration: 2000\n      });\n      return;\n    }\n    if (activeStep === 1 && productType === \"simple\" && (!simpleProduct.regular_price || parseFloat(simpleProduct.regular_price) <= 0)) {\n      toast({\n        title: \"Regular price is required\",\n        status: \"warning\",\n        duration: 2000\n      });\n      return;\n    }\n    if (activeStep === 2 && variations.length === 0) {\n      toast({\n        title: \"Add attributes to generate variations\",\n        status: \"warning\",\n        duration: 2000\n      });\n      return;\n    }\n    setActiveStep(function (prev) {\n      return Math.min(prev + 1, totalSteps - 1);\n    });\n  };\n  var prevStep = function prevStep() {\n    return setActiveStep(function (prev) {\n      return Math.max(prev - 1, 0);\n    });\n  };\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Modal, {\n    isOpen: isOpen,\n    onClose: handleClose,\n    size: modalSize,\n    motionPreset: \"slideInBottom\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.ModalOverlay, {\n    bg: \"blackAlpha.600\",\n    backdropFilter: \"blur(4px)\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.ModalContent, {\n    borderRadius: {\n      base: \"none\",\n      md: \"xl\"\n    },\n    maxH: \"90vh\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.ModalHeader, {\n    bg: \"gradient\",\n    borderTopRadius: {\n      base: \"none\",\n      md: \"xl\"\n    },\n    pb: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.HStack, {\n    justify: \"space-between\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.HStack, {\n    spacing: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, {\n    p: 2,\n    bg: \"purple.500\",\n    borderRadius: \"lg\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_43__.FiBox,\n    boxSize: 5,\n    color: \"white\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n    m: 0,\n    fontWeight: \"bold\",\n    fontSize: {\n      base: \"md\",\n      md: \"lg\"\n    }\n  }, \"Smart Product Creator\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    color: \"gray.500\"\n  }, \"Create products across multiple stores\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.ModalCloseButton, {\n    position: \"static\"\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.ModalBody, {\n    pb: 4,\n    overflowY: \"auto\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.HStack, {\n    justify: \"center\",\n    mb: 6,\n    spacing: {\n      base: 1,\n      md: 4\n    }\n  }, steps.map(function (step, index) {\n    // Determine if step is accessible\n    var isAccessible = index === 0 || index === 1 && selectedStores.length > 0 || index === 2 && selectedStores.length > 0 && productData.name.trim() !== \"\";\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), {\n      key: index\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.VStack, {\n      spacing: 1,\n      cursor: isAccessible ? \"pointer\" : \"not-allowed\",\n      onClick: function onClick() {\n        return isAccessible && setActiveStep(index);\n      },\n      opacity: activeStep >= index ? 1 : isAccessible ? 0.7 : 0.3,\n      title: !isAccessible ? \"Complete previous step first\" : \"\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, {\n      p: 2,\n      borderRadius: \"full\",\n      bg: activeStep === index ? \"purple.500\" : activeStep > index ? \"green.500\" : \"gray.200\",\n      color: \"white\",\n      transition: \"all 0.2s\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Icon, {\n      as: step.icon,\n      boxSize: 4\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n      m: 0,\n      fontSize: {\n        base: \"2xs\",\n        md: \"xs\"\n      },\n      fontWeight: \"600\",\n      textAlign: \"center\"\n    }, step.title)), index < steps.length - 1 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, {\n      h: \"2px\",\n      w: {\n        base: \"10px\",\n        md: \"40px\"\n      },\n      bg: activeStep > index ? \"green.500\" : \"gray.200\",\n      borderRadius: \"full\"\n    }));\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Alert, {\n    status: \"info\",\n    borderRadius: \"lg\",\n    py: 2,\n    px: 3,\n    mb: 5,\n    bg: \"blue.50\",\n    borderLeft: \"3px\",\n    borderColor: \"blue.400\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.AlertIcon, {\n    boxSize: 4,\n    color: \"blue.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n    m: 0,\n    fontSize: \"2xs\",\n    color: \"blue.700\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n    as: \"span\",\n    fontWeight: \"600\"\n  }, \"Note:\"), \" Supports \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n    as: \"span\",\n    fontWeight: \"600\"\n  }, \"Simple\"), \" and \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n    as: \"span\",\n    fontWeight: \"600\"\n  }, \"Variable\"), \" product types only.\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, {\n    minH: {\n      base: \"250px\",\n      md: \"320px\"\n    }\n  }, activeStep === 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(StoreSelectionStep, {\n    stores: stores,\n    selectedStores: selectedStores,\n    toggleStore: toggleStore,\n    priceAdjustments: priceAdjustments,\n    setPriceAdjustments: setPriceAdjustments,\n    loading: loading\n  }), activeStep === 1 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ProductDetailsStep, {\n    productData: productData,\n    setProductData: setProductData,\n    featuredImagePreview: featuredImagePreview,\n    handleImageUpload: handleImageUpload,\n    uploadingImage: uploadingImage,\n    productType: productType,\n    setProductType: setProductType,\n    simpleProduct: simpleProduct,\n    setSimpleProduct: setSimpleProduct,\n    categories: categories,\n    setCategories: setCategories,\n    tags: tags,\n    setTags: setTags,\n    newCategory: newCategory,\n    setNewCategory: setNewCategory,\n    newTag: newTag,\n    setNewTag: setNewTag,\n    addCategory: addCategory,\n    removeCategory: removeCategory,\n    addTag: addTag,\n    removeTag: removeTag,\n    isMobile: isMobile\n  }), activeStep === 2 && productType === \"variable\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(VariationsStep, {\n    attributes: attributes,\n    newAttrName: newAttrName,\n    newAttrOptions: newAttrOptions,\n    setNewAttrName: setNewAttrName,\n    setNewAttrOptions: setNewAttrOptions,\n    addAttribute: addAttribute,\n    removeAttribute: removeAttribute,\n    variations: variations,\n    updateVariation: updateVariation,\n    isMobile: isMobile\n  })), showResults && results.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, {\n    mt: 5\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Divider, {\n    mb: 4\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n    m: 0,\n    fontWeight: \"600\",\n    mb: 3,\n    fontSize: \"sm\"\n  }, \"Results\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.VStack, {\n    spacing: 2,\n    align: \"stretch\"\n  }, results.map(function (result, idx) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Alert, {\n      key: idx,\n      status: result.status === 'success' ? 'success' : 'error',\n      borderRadius: \"lg\",\n      py: 2,\n      borderLeft: \"3px\",\n      borderColor: result.status === 'success' ? \"green.400\" : \"red.400\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.AlertIcon, {\n      boxSize: 4\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, {\n      flex: \"1\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.AlertTitle, {\n      fontSize: \"sm\"\n    }, result.store_name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.AlertDescription, {\n      fontSize: \"2xs\"\n    }, result.message)));\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.ModalFooter, {\n    borderTop: \"1px\",\n    borderColor: \"gray.100\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.HStack, {\n    justify: \"space-between\",\n    w: \"full\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Button, {\n    size: \"sm\",\n    variant: \"ghost\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_43__.FiChevronLeft\n    }),\n    onClick: prevStep,\n    isDisabled: activeStep === 0\n  }, isMobile ? \"\" : \"Back\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.HStack, {\n    spacing: 3\n  }, activeStep < totalSteps - 1 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Button, {\n    size: \"sm\",\n    colorScheme: \"purple\",\n    rightIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_43__.FiChevronRight\n    }),\n    onClick: nextStep\n  }, \"Next\") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Button, {\n    size: \"sm\",\n    bg: \"green.500\",\n    color: \"white\",\n    _hover: {\n      bg: \"green.600\"\n    },\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_43__.FiCheck\n    }),\n    isLoading: creating,\n    loadingText: \"Creating...\",\n    onClick: handleCreateProduct\n  }, \"Create Product\"))))));\n};\n\n// Step 1: Store Selection\nvar StoreSelectionStep = function StoreSelectionStep(_ref5) {\n  var stores = _ref5.stores,\n    selectedStores = _ref5.selectedStores,\n    toggleStore = _ref5.toggleStore,\n    priceAdjustments = _ref5.priceAdjustments,\n    setPriceAdjustments = _ref5.setPriceAdjustments,\n    loading = _ref5.loading;\n  if (loading) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.VStack, {\n      justify: \"center\",\n      py: 10,\n      spacing: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Spinner, {\n      size: \"lg\",\n      color: \"purple.500\",\n      thickness: \"3px\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n      color: \"gray.500\",\n      fontSize: \"sm\"\n    }, \"Loading stores...\"));\n  }\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.VStack, {\n    spacing: 4,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n    m: 0,\n    fontSize: \"sm\",\n    fontWeight: \"600\",\n    color: \"gray.700\"\n  }, \"Select Target Stores\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Grid, {\n    templateColumns: {\n      base: \"1fr\",\n      md: \"repeat(2, 1fr)\"\n    },\n    gap: 3,\n    maxH: \"220px\",\n    overflowY: \"auto\",\n    pr: 2\n  }, stores.map(function (store) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Card, {\n      key: store.id,\n      size: \"sm\",\n      cursor: \"pointer\",\n      variant: \"outline\",\n      borderColor: selectedStores.includes(store.id) ? \"purple.400\" : \"gray.200\",\n      bg: selectedStores.includes(store.id) ? \"purple.50\" : \"white\",\n      onClick: function onClick() {\n        return toggleStore(store.id);\n      },\n      transition: \"all 0.2s\",\n      _hover: {\n        borderColor: \"purple.300\",\n        shadow: \"sm\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.CardBody, {\n      p: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.HStack, {\n      justify: \"space-between\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.HStack, {\n      spacing: 2\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, {\n      boxSize: 3,\n      borderRadius: \"full\",\n      bg: selectedStores.includes(store.id) ? \"purple.500\" : \"gray.300\",\n      display: \"flex\",\n      alignItems: \"center\",\n      justifyContent: \"center\"\n    }, selectedStores.includes(store.id) && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_43__.FiCheck,\n      boxSize: 2,\n      color: \"white\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n      m: 0,\n      fontSize: \"sm\",\n      fontWeight: \"500\"\n    }, store.name)), store.is_current === 1 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Badge, {\n      fontSize: \"2xs\",\n      colorScheme: \"green\",\n      borderRadius: \"full\"\n    }, \"Main\")), selectedStores.includes(store.id) && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.HStack, {\n      mt: 2,\n      spacing: 2,\n      justify: \"flex-end\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n      m: 0,\n      fontSize: \"2xs\",\n      color: \"gray.500\"\n    }, \"Price Adjust %:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.NumberInput, {\n      size: \"xs\",\n      maxW: \"70px\",\n      defaultValue: 0,\n      step: 1,\n      value: priceAdjustments[store.id] || 0,\n      onChange: function onChange(val) {\n        return setPriceAdjustments(function (prev) {\n          return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, store.id, parseFloat(val) || 0));\n        });\n      },\n      onClick: function onClick(e) {\n        return e.stopPropagation();\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.NumberInputField, {\n      size: \"xs\",\n      borderRadius: \"md\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.NumberInputStepper, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.NumberIncrementStepper, {\n      h: \"10px\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.NumberDecrementStepper, {\n      h: \"10px\"\n    }))))));\n  })), selectedStores.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Badge, {\n    colorScheme: \"purple\",\n    alignSelf: \"flex-start\",\n    borderRadius: \"full\",\n    px: 2\n  }, selectedStores.length, \" store(s) selected\"));\n};\n\n// Step 2: Product Details\nvar ProductDetailsStep = function ProductDetailsStep(_ref6) {\n  var productData = _ref6.productData,\n    setProductData = _ref6.setProductData,\n    featuredImagePreview = _ref6.featuredImagePreview,\n    handleImageUpload = _ref6.handleImageUpload,\n    uploadingImage = _ref6.uploadingImage,\n    productType = _ref6.productType,\n    setProductType = _ref6.setProductType,\n    simpleProduct = _ref6.simpleProduct,\n    setSimpleProduct = _ref6.setSimpleProduct,\n    categories = _ref6.categories,\n    setCategories = _ref6.setCategories,\n    tags = _ref6.tags,\n    setTags = _ref6.setTags,\n    newCategory = _ref6.newCategory,\n    setNewCategory = _ref6.setNewCategory,\n    newTag = _ref6.newTag,\n    setNewTag = _ref6.setNewTag,\n    addCategory = _ref6.addCategory,\n    removeCategory = _ref6.removeCategory,\n    addTag = _ref6.addTag,\n    removeTag = _ref6.removeTag,\n    isMobile = _ref6.isMobile;\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.VStack, {\n    spacing: 4,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.HStack, {\n    justify: \"space-between\",\n    align: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n    m: 0,\n    fontSize: \"sm\",\n    fontWeight: \"600\",\n    color: \"gray.700\"\n  }, \"Product Information\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.HStack, {\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    color: \"gray.500\"\n  }, \"Type:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Select, {\n    size: \"xs\",\n    value: productType,\n    onChange: function onChange(e) {\n      return setProductType(e.target.value);\n    },\n    w: \"130px\",\n    borderRadius: \"md\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"simple\"\n  }, \"Simple\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"variable\"\n  }, \"Variable\")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Grid, {\n    templateColumns: {\n      base: \"1fr\",\n      md: \"1fr 1fr\"\n    },\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.GridItem, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.FormControl, {\n    isRequired: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.FormLabel, {\n    fontSize: \"xs\",\n    color: \"gray.600\"\n  }, \"Product Name\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Input, {\n    size: \"sm\",\n    value: productData.name,\n    onChange: function onChange(e) {\n      return setProductData(function (prev) {\n        return _objectSpread(_objectSpread({}, prev), {}, {\n          name: e.target.value\n        });\n      });\n    },\n    placeholder: \"e.g., Premium Cotton Hoodie\",\n    borderRadius: \"md\"\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.GridItem, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.FormLabel, {\n    fontSize: \"xs\",\n    color: \"gray.600\"\n  }, \"SKU \", productType === \"variable\" ? \"(Parent - optional)\" : \"\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Input, {\n    size: \"sm\",\n    value: productData.sku,\n    onChange: function onChange(e) {\n      return setProductData(function (prev) {\n        return _objectSpread(_objectSpread({}, prev), {}, {\n          sku: e.target.value\n        });\n      });\n    },\n    placeholder: productType === \"variable\" ? \"e.g., HOODIE\" : \"e.g., TSHIRT-BLK\",\n    borderRadius: \"md\"\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.FormLabel, {\n    fontSize: \"xs\",\n    color: \"gray.600\"\n  }, \"Short Description\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_40__.Textarea, {\n    size: \"sm\",\n    value: productData.short_description,\n    onChange: function onChange(e) {\n      return setProductData(function (prev) {\n        return _objectSpread(_objectSpread({}, prev), {}, {\n          short_description: e.target.value\n        });\n      });\n    },\n    placeholder: \"Brief product summary...\",\n    rows: 2,\n    borderRadius: \"md\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.FormLabel, {\n    fontSize: \"xs\",\n    color: \"gray.600\"\n  }, \"Full Description\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_40__.Textarea, {\n    size: \"md\",\n    value: productData.description,\n    onChange: function onChange(e) {\n      return setProductData(function (prev) {\n        return _objectSpread(_objectSpread({}, prev), {}, {\n          description: e.target.value\n        });\n      });\n    },\n    placeholder: \"Detailed product description...\",\n    rows: 3,\n    borderRadius: \"md\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Grid, {\n    templateColumns: {\n      base: \"1fr\",\n      md: \"1fr 1fr\"\n    },\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.GridItem, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.FormLabel, {\n    fontSize: \"xs\",\n    color: \"gray.600\"\n  }, \"Status\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Select, {\n    size: \"sm\",\n    value: productData.status,\n    onChange: function onChange(e) {\n      return setProductData(function (prev) {\n        return _objectSpread(_objectSpread({}, prev), {}, {\n          status: e.target.value\n        });\n      });\n    },\n    borderRadius: \"md\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"publish\"\n  }, \"Published\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"draft\"\n  }, \"Draft\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"pending\"\n  }, \"Pending Review\")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.GridItem, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.FormLabel, {\n    fontSize: \"xs\",\n    color: \"gray.600\"\n  }, \"Featured Image\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.HStack, {\n    spacing: 2,\n    mt: 1\n  }, featuredImagePreview ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, {\n    position: \"relative\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Image, {\n    src: featuredImagePreview,\n    alt: \"Preview\",\n    boxSize: \"50px\",\n    objectFit: \"cover\",\n    borderRadius: \"md\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.CloseButton, {\n    size: \"sm\",\n    position: \"absolute\",\n    top: \"-6px\",\n    right: \"-6px\",\n    bg: \"red.500\",\n    color: \"white\",\n    onClick: function onClick() {\n      setFeaturedImage(null);\n      setFeaturedImagePreview(null);\n    }\n  })) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, {\n    boxSize: \"50px\",\n    bg: \"gray.100\",\n    borderRadius: \"md\",\n    display: \"flex\",\n    alignItems: \"center\",\n    justifyContent: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_43__.FiImage,\n    color: \"gray.400\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"input\", {\n    type: \"file\",\n    accept: \"image/*\",\n    onChange: handleImageUpload,\n    style: {\n      display: 'none'\n    },\n    id: \"spc-featured-image\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"label\", {\n    htmlFor: \"spc-featured-image\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Button, {\n    as: \"span\",\n    size: \"xs\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_43__.FiUpload\n    }),\n    isLoading: uploadingImage,\n    cursor: \"pointer\",\n    variant: \"outline\"\n  }, \"Upload\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Card, {\n    size: \"sm\",\n    bg: \"gray.50\",\n    variant: \"outline\",\n    borderColor: \"gray.200\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.CardBody, {\n    p: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Grid, {\n    templateColumns: {\n      base: \"1fr\",\n      md: \"1fr 1fr\"\n    },\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.HStack, {\n    mb: 2,\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_43__.FiPackage,\n    boxSize: 3,\n    color: \"blue.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    fontWeight: \"600\",\n    color: \"gray.700\"\n  }, \"Categories\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.HStack, {\n    spacing: 1,\n    mb: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Input, {\n    size: \"xs\",\n    placeholder: \"Add category...\",\n    value: newCategory,\n    onChange: function onChange(e) {\n      return setNewCategory(e.target.value);\n    },\n    onKeyDown: function onKeyDown(e) {\n      return e.key === \"Enter\" && addCategory();\n    },\n    borderRadius: \"md\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.IconButton, {\n    size: \"xs\",\n    colorScheme: \"blue\",\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_43__.FiPlus\n    }),\n    onClick: addCategory,\n    borderRadius: \"md\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Flex, {\n    flexWrap: \"wrap\",\n    gap: 1\n  }, categories.map(function (cat, idx) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Badge, {\n      key: idx,\n      colorScheme: \"blue\",\n      variant: \"subtle\",\n      px: 2,\n      py: 0.5,\n      borderRadius: \"md\",\n      fontSize: \"2xs\"\n    }, cat, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.CloseButton, {\n      size: \"sm\",\n      onClick: function onClick() {\n        return removeCategory(idx);\n      }\n    }));\n  }), categories.length === 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n    m: 0,\n    fontSize: \"2xs\",\n    color: \"gray.400\"\n  }, \"No categories added\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.HStack, {\n    mb: 2,\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_43__.FiTag,\n    boxSize: 3,\n    color: \"green.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    fontWeight: \"600\",\n    color: \"gray.700\"\n  }, \"Tags\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.HStack, {\n    spacing: 1,\n    mb: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Input, {\n    size: \"xs\",\n    placeholder: \"Add tag...\",\n    value: newTag,\n    onChange: function onChange(e) {\n      return setNewTag(e.target.value);\n    },\n    onKeyDown: function onKeyDown(e) {\n      return e.key === \"Enter\" && addTag();\n    },\n    borderRadius: \"md\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.IconButton, {\n    size: \"xs\",\n    colorScheme: \"green\",\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_43__.FiPlus\n    }),\n    onClick: addTag,\n    borderRadius: \"md\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Flex, {\n    flexWrap: \"wrap\",\n    gap: 1\n  }, tags.map(function (tag, idx) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Badge, {\n      key: idx,\n      colorScheme: \"green\",\n      variant: \"subtle\",\n      px: 2,\n      py: 0.5,\n      borderRadius: \"md\",\n      fontSize: \"2xs\"\n    }, tag, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.CloseButton, {\n      size: \"sm\",\n      onClick: function onClick() {\n        return removeTag(idx);\n      }\n    }));\n  }), tags.length === 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n    m: 0,\n    fontSize: \"2xs\",\n    color: \"gray.400\"\n  }, \"No tags added\")))))), productType === \"simple\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Card, {\n    size: \"sm\",\n    bg: \"blue.50\",\n    variant: \"outline\",\n    borderColor: \"blue.200\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.CardBody, {\n    p: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.HStack, {\n    mb: 2,\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_43__.FiDollarSign,\n    boxSize: 3,\n    color: \"blue.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    fontWeight: \"600\",\n    color: \"blue.700\"\n  }, \"Pricing & Stock\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Grid, {\n    templateColumns: {\n      base: \"1fr\",\n      md: \"repeat(3, 1fr)\"\n    },\n    gap: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.FormControl, {\n    isRequired: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.FormLabel, {\n    fontSize: \"2xs\",\n    color: \"gray.600\"\n  }, \"Regular Price\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.NumberInput, {\n    size: \"xs\",\n    min: 0,\n    step: 0.01,\n    value: simpleProduct.regular_price,\n    onChange: function onChange(val) {\n      return setSimpleProduct(function (prev) {\n        return _objectSpread(_objectSpread({}, prev), {}, {\n          regular_price: val\n        });\n      });\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.NumberInputField, {\n    borderRadius: \"md\"\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.FormLabel, {\n    fontSize: \"2xs\",\n    color: \"gray.600\"\n  }, \"Sale Price\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.NumberInput, {\n    size: \"xs\",\n    min: 0,\n    step: 0.01,\n    value: simpleProduct.sale_price,\n    onChange: function onChange(val) {\n      return setSimpleProduct(function (prev) {\n        return _objectSpread(_objectSpread({}, prev), {}, {\n          sale_price: val\n        });\n      });\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.NumberInputField, {\n    borderRadius: \"md\"\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.FormLabel, {\n    fontSize: \"2xs\",\n    color: \"gray.600\"\n  }, \"Stock Qty\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.NumberInput, {\n    size: \"xs\",\n    min: 0,\n    value: simpleProduct.stock_quantity,\n    onChange: function onChange(val) {\n      return setSimpleProduct(function (prev) {\n        return _objectSpread(_objectSpread({}, prev), {}, {\n          stock_quantity: parseInt(val) || 0\n        });\n      });\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.NumberInputField, {\n    borderRadius: \"md\"\n  })))))));\n};\n\n// Step 3: Variations\nvar VariationsStep = function VariationsStep(_ref7) {\n  var attributes = _ref7.attributes,\n    newAttrName = _ref7.newAttrName,\n    newAttrOptions = _ref7.newAttrOptions,\n    setNewAttrName = _ref7.setNewAttrName,\n    setNewAttrOptions = _ref7.setNewAttrOptions,\n    addAttribute = _ref7.addAttribute,\n    removeAttribute = _ref7.removeAttribute,\n    variations = _ref7.variations,\n    updateVariation = _ref7.updateVariation,\n    isMobile = _ref7.isMobile;\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.VStack, {\n    spacing: 4,\n    align: \"stretch\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n    m: 0,\n    fontSize: \"sm\",\n    fontWeight: \"600\",\n    color: \"gray.700\"\n  }, \"Attributes & Variations\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Card, {\n    size: \"sm\",\n    bg: \"gray.50\",\n    variant: \"outline\",\n    borderColor: \"gray.200\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.CardBody, {\n    p: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    fontWeight: \"500\",\n    mb: 2,\n    color: \"gray.600\"\n  }, \"Add Attribute\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.HStack, {\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Input, {\n    size: \"xs\",\n    placeholder: \"Name (e.g., Size)\",\n    value: newAttrName,\n    onChange: function onChange(e) {\n      return setNewAttrName(e.target.value);\n    },\n    borderRadius: \"md\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Input, {\n    size: \"xs\",\n    placeholder: \"Options (e.g., S, M, L)\",\n    value: newAttrOptions,\n    onChange: function onChange(e) {\n      return setNewAttrOptions(e.target.value);\n    },\n    borderRadius: \"md\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.IconButton, {\n    size: \"xs\",\n    colorScheme: \"purple\",\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_43__.FiPlus\n    }),\n    onClick: addAttribute,\n    borderRadius: \"md\"\n  })))), attributes.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    fontWeight: \"500\",\n    mb: 2,\n    color: \"gray.600\"\n  }, \"Attributes\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Flex, {\n    flexWrap: \"wrap\",\n    gap: 2\n  }, attributes.map(function (attr, idx) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Badge, {\n      key: idx,\n      colorScheme: \"purple\",\n      variant: \"subtle\",\n      px: 2,\n      py: 1,\n      borderRadius: \"md\",\n      fontSize: \"2xs\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n      m: 0,\n      fontWeight: \"600\"\n    }, attr.name, \":\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n      my: 0,\n      ml: 1\n    }, attr.options.join(', ')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.CloseButton, {\n      size: \"sm\",\n      onClick: function onClick() {\n        return removeAttribute(idx);\n      }\n    }));\n  }))), variations.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.HStack, {\n    justify: \"space-between\",\n    mb: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    fontWeight: \"500\",\n    color: \"gray.600\"\n  }, \"Variations Grid\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Badge, {\n    colorScheme: \"green\",\n    borderRadius: \"full\",\n    fontSize: \"2xs\"\n  }, variations.length, \" combinations\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Box, {\n    overflowX: \"auto\",\n    maxH: \"220px\",\n    overflowY: \"auto\",\n    border: \"1px\",\n    borderColor: \"gray.200\",\n    borderRadius: \"lg\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Table, {\n    size: \"xs\",\n    variant: \"simple\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_38__.Thead, {\n    position: \"sticky\",\n    top: 0,\n    bg: \"gray.50\",\n    zIndex: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_37__.Th, {\n    fontSize: \"2xs\",\n    py: 2\n  }, \"Attributes\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_37__.Th, {\n    fontSize: \"2xs\",\n    py: 2\n  }, \"SKU\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_37__.Th, {\n    fontSize: \"2xs\",\n    py: 2\n  }, \"Regular Price\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_37__.Th, {\n    fontSize: \"2xs\",\n    py: 2\n  }, \"Sale Price\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_37__.Th, {\n    fontSize: \"2xs\",\n    py: 2\n  }, \"Stock\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Tbody, null, variations.map(function (variation, idx) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_39__.Tr, {\n      key: idx,\n      _hover: {\n        bg: \"gray.50\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Td, {\n      py: 1\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Flex, {\n      flexWrap: \"wrap\",\n      gap: 1\n    }, Object.entries(variation.attributes).map(function (_ref8) {\n      var _ref9 = _slicedToArray(_ref8, 2),\n        name = _ref9[0],\n        option = _ref9[1];\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Badge, {\n        key: name,\n        fontSize: \"2xs\",\n        colorScheme: \"purple\",\n        variant: \"subtle\",\n        borderRadius: \"sm\"\n      }, option);\n    }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Td, {\n      py: 1\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Input, {\n      size: \"xs\",\n      placeholder: \"SKU\",\n      value: variation.sku,\n      onChange: function onChange(e) {\n        return updateVariation(idx, 'sku', e.target.value);\n      },\n      borderRadius: \"md\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Td, {\n      py: 1\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.NumberInput, {\n      size: \"xs\",\n      min: 0,\n      step: 0.01,\n      value: variation.regular_price,\n      onChange: function onChange(val) {\n        return updateVariation(idx, 'regular_price', val);\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.NumberInputField, {\n      borderRadius: \"md\"\n    }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Td, {\n      py: 1\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.NumberInput, {\n      size: \"xs\",\n      min: 0,\n      step: 0.01,\n      value: variation.sale_price,\n      onChange: function onChange(val) {\n        return updateVariation(idx, 'sale_price', val);\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.NumberInputField, {\n      borderRadius: \"md\"\n    }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.Td, {\n      py: 1\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.NumberInput, {\n      size: \"xs\",\n      min: 0,\n      value: variation.stock_quantity,\n      onChange: function onChange(val) {\n        return updateVariation(idx, 'stock_quantity', parseInt(val) || 0);\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.NumberInputField, {\n      borderRadius: \"md\"\n    }))));\n  }))))), attributes.length === 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Alert, {\n    status: \"info\",\n    borderRadius: \"lg\",\n    py: 2,\n    bg: \"gray.50\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.AlertIcon, {\n    boxSize: 4,\n    color: \"gray.400\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_42__.Text, {\n    m: 0,\n    fontSize: \"2xs\",\n    color: \"gray.600\"\n  }, \"Add attributes above to generate variation combinations automatically.\")));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SmartProductCreator);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/SmartProductCreator/SmartProductCreator.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/SmartProductCreator/SmartProductCreatorPage.jsx"
/*!********************************************************************************!*\
  !*** ./src/Pages/StoreManager/SmartProductCreator/SmartProductCreatorPage.jsx ***!
  \********************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/hooks/dist/esm/use-disclosure.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/alert/alert.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/alert/alert-description.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/alert/alert-icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/alert/alert-title.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card-header.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/container/container.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/simple-grid.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stat/stat.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stat/stat-help-text.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stat/stat-label.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stat/stat-number.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tbody.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/td.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/th.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/thead.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tr.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/toast/use-toast.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var _SmartProductCreator__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./SmartProductCreator */ \"./src/Pages/StoreManager/SmartProductCreator/SmartProductCreator.jsx\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\n\nvar SmartProductCreatorPage = function SmartProductCreatorPage() {\n  var toast = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.useToast)();\n  var _useDisclosure = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.useDisclosure)(),\n    isOpen = _useDisclosure.isOpen,\n    onOpen = _useDisclosure.onOpen,\n    _onClose = _useDisclosure.onClose;\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState2 = _slicedToArray(_useState, 2),\n    failedJobs = _useState2[0],\n    setFailedJobs = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState4 = _slicedToArray(_useState3, 2),\n    loadingJobs = _useState4[0],\n    setLoadingJobs = _useState4[1];\n  var fetchFailedJobs = /*#__PURE__*/function () {\n    var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n      var _res$data, res, _t;\n      return _regenerator().w(function (_context) {\n        while (1) switch (_context.p = _context.n) {\n          case 0:\n            setLoadingJobs(true);\n            _context.p = 1;\n            _context.n = 2;\n            return axios__WEBPACK_IMPORTED_MODULE_32__[\"default\"].get(\"/smart-creator/failed-jobs\");\n          case 2:\n            res = _context.v;\n            setFailedJobs(((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.jobs) || []);\n            _context.n = 4;\n            break;\n          case 3:\n            _context.p = 3;\n            _t = _context.v;\n            toast({\n              title: \"Failed to load jobs\",\n              status: \"error\",\n              duration: 3000\n            });\n          case 4:\n            _context.p = 4;\n            setLoadingJobs(false);\n            return _context.f(4);\n          case 5:\n            return _context.a(2);\n        }\n      }, _callee, null, [[1, 3, 4, 5]]);\n    }));\n    return function fetchFailedJobs() {\n      return _ref.apply(this, arguments);\n    };\n  }();\n  var handleRetry = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(jobId) {\n      var _error$response, _t2;\n      return _regenerator().w(function (_context2) {\n        while (1) switch (_context2.p = _context2.n) {\n          case 0:\n            _context2.p = 0;\n            _context2.n = 1;\n            return axios__WEBPACK_IMPORTED_MODULE_32__[\"default\"].post(\"/smart-creator/retry/\".concat(jobId));\n          case 1:\n            toast({\n              title: \"Retry initiated\",\n              status: \"success\",\n              duration: 3000\n            });\n            fetchFailedJobs();\n            _context2.n = 3;\n            break;\n          case 2:\n            _context2.p = 2;\n            _t2 = _context2.v;\n            toast({\n              title: \"Retry failed\",\n              description: ((_error$response = _t2.response) === null || _error$response === void 0 || (_error$response = _error$response.data) === null || _error$response === void 0 ? void 0 : _error$response.message) || _t2.message,\n              status: \"error\",\n              duration: 3000\n            });\n          case 3:\n            return _context2.a(2);\n        }\n      }, _callee2, null, [[0, 2]]);\n    }));\n    return function handleRetry(_x) {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(function () {\n    fetchFailedJobs();\n  }, []);\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Container, {\n    maxW: \"container.xl\",\n    py: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Flex, {\n    justify: \"space-between\",\n    align: \"center\",\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.HStack, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiBox,\n    boxSize: 8,\n    color: \"purple.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    fontSize: \"2xl\",\n    fontWeight: \"bold\"\n  }, \"Smart Product Creator\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.500\"\n  }, \"Create simple and variable products across multiple stores\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.HStack, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiRefreshCw\n    }),\n    variant: \"outline\",\n    onClick: fetchFailedJobs,\n    isLoading: loadingJobs,\n    size: \"sm\"\n  }, \"Refresh\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiPlus\n    }),\n    colorScheme: \"purple\",\n    onClick: onOpen,\n    size: \"sm\"\n  }, \"Create New Product\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Alert, {\n    status: \"info\",\n    borderRadius: \"lg\",\n    mb: 6,\n    bg: \"purple.50\",\n    borderLeft: \"4px\",\n    borderColor: \"purple.400\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.AlertIcon, {\n    boxSize: 5,\n    color: \"purple.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.AlertTitle, {\n    fontSize: \"sm\",\n    color: \"purple.700\"\n  }, \"Supported Product Types\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.AlertDescription, {\n    fontSize: \"xs\",\n    color: \"purple.600\"\n  }, \"Smart Product Creator currently supports \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"strong\", null, \"Simple\"), \" and \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"strong\", null, \"Variable\"), \" product types. Use this tool to quickly create products with variations across all your connected stores.\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.SimpleGrid, {\n    columns: {\n      base: 1,\n      md: 3\n    },\n    spacing: 4,\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Card, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Stat, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.StatLabel, null, \"Failed Jobs\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.StatNumber, {\n    color: failedJobs.length > 0 ? \"red.500\" : \"green.500\"\n  }, failedJobs.length), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.StatHelpText, null, \"Need retry\")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Card, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Stat, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.StatLabel, null, \"Product Types\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.StatNumber, null, \"2\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.StatHelpText, null, \"Simple & Variable\")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Card, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Stat, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.StatLabel, null, \"Features\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.StatNumber, null, \"\\u221E\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.StatHelpText, null, \"Variations via Batch API\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Card, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.CardHeader, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.HStack, {\n    justify: \"space-between\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.HStack, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiAlertCircle,\n    color: \"red.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    fontWeight: \"600\"\n  }, \"Failed Jobs\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Badge, {\n    colorScheme: failedJobs.length > 0 ? \"red\" : \"green\"\n  }, failedJobs.length, \" pending\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.CardBody, null, failedJobs.length === 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.VStack, {\n    py: 8,\n    spacing: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiCheck,\n    boxSize: 10,\n    color: \"green.400\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    color: \"gray.500\"\n  }, \"No failed jobs!\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.400\"\n  }, \"All products were created successfully.\")) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Box, {\n    overflowX: \"auto\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.Table, {\n    size: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Thead, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Th, null, \"Store\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Th, null, \"Error\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Th, null, \"Date\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Th, null, \"Action\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Tbody, null, failedJobs.map(function (job) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Tr, {\n      key: job.id\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Td, {\n      fontWeight: \"500\"\n    }, job.store_name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.HStack, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiAlertCircle,\n      boxSize: 3,\n      color: \"red.500\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n      fontSize: \"xs\",\n      color: \"red.600\",\n      maxW: \"300px\",\n      isTruncated: true\n    }, job.error))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Td, {\n      fontSize: \"xs\",\n      color: \"gray.500\"\n    }, new Date(job.created_at).toLocaleDateString()), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Button, {\n      size: \"xs\",\n      colorScheme: \"blue\",\n      leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Icon, {\n        as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiRefreshCw\n      }),\n      onClick: function onClick() {\n        return handleRetry(job.id);\n      }\n    }, \"Retry\")));\n  })))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Card, {\n    mt: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.CardHeader, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.HStack, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiBox,\n    color: \"purple.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    fontWeight: \"600\"\n  }, \"Features\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.SimpleGrid, {\n    columns: {\n      base: 1,\n      md: 2\n    },\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.HStack, {\n    align: \"start\",\n    p: 3,\n    bg: \"gray.50\",\n    borderRadius: \"md\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiCheck,\n    color: \"green.500\",\n    mt: 1\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    fontSize: \"sm\",\n    fontWeight: \"500\"\n  }, \"Simple Products\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.500\"\n  }, \"Create simple products with price and stock\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.HStack, {\n    align: \"start\",\n    p: 3,\n    bg: \"gray.50\",\n    borderRadius: \"md\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiCheck,\n    color: \"green.500\",\n    mt: 1\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    fontSize: \"sm\",\n    fontWeight: \"500\"\n  }, \"Variable Products\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.500\"\n  }, \"Create products with attributes and variations\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.HStack, {\n    align: \"start\",\n    p: 3,\n    bg: \"gray.50\",\n    borderRadius: \"md\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiCheck,\n    color: \"green.500\",\n    mt: 1\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    fontSize: \"sm\",\n    fontWeight: \"500\"\n  }, \"Price Adjustments\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.500\"\n  }, \"Set per-store price adjustments (%)\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.HStack, {\n    align: \"start\",\n    p: 3,\n    bg: \"gray.50\",\n    borderRadius: \"md\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiCheck,\n    color: \"green.500\",\n    mt: 1\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    fontSize: \"sm\",\n    fontWeight: \"500\"\n  }, \"Batch API\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.500\"\n  }, \"Efficient variation creation via Batch API\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.HStack, {\n    align: \"start\",\n    p: 3,\n    bg: \"gray.50\",\n    borderRadius: \"md\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiCheck,\n    color: \"green.500\",\n    mt: 1\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    fontSize: \"sm\",\n    fontWeight: \"500\"\n  }, \"Auto Variation Grid\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.500\"\n  }, \"Cartesian product generation for variations\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.HStack, {\n    align: \"start\",\n    p: 3,\n    bg: \"gray.50\",\n    borderRadius: \"md\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_30__.FiCheck,\n    color: \"green.500\",\n    mt: 1\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    fontSize: \"sm\",\n    fontWeight: \"500\"\n  }, \"Retry Failed Jobs\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.500\"\n  }, \"Retry failed store deployments\")))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_SmartProductCreator__WEBPACK_IMPORTED_MODULE_31__[\"default\"], {\n    isOpen: isOpen,\n    onClose: function onClose() {\n      _onClose();\n      fetchFailedJobs();\n    }\n  }));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SmartProductCreatorPage);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/SmartProductCreator/SmartProductCreatorPage.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/StoreList.jsx"
/*!**********************************************!*\
  !*** ./src/Pages/StoreManager/StoreList.jsx ***!
  \**********************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/icon-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/simple-grid.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/link/link.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/menu/menu.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/menu/menu-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/menu/menu-item.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/menu/menu-list.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/skeleton/skeleton.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/spinner/spinner.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stat/stat.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stat/stat-help-text.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stat/stat-label.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stat/stat-number.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/tooltip/tooltip.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/heading.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! react-hot-toast */ \"./node_modules/react-hot-toast/dist/index.mjs\");\n/* harmony import */ var react_icons_fa__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! react-icons/fa */ \"./node_modules/react-icons/fa/index.mjs\");\n/* harmony import */ var _Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../../Components/shared/DatePicker */ \"./src/Components/shared/DatePicker.jsx\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-arrow.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/popover/popover-trigger.mjs\");\n/* harmony import */ var react_apexcharts__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! react-apexcharts */ \"./node_modules/react-apexcharts/dist/react-apexcharts.esm.js\");\n/* harmony import */ var _Components_OrderMetrics__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./Components/OrderMetrics */ \"./src/Pages/StoreManager/Components/OrderMetrics.jsx\");\n/* harmony import */ var _Layouts_StoreManagerContext__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./Layouts/StoreManagerContext */ \"./src/Pages/StoreManager/Layouts/StoreManagerContext.js\");\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\n\n\n\n\n\n\n\nvar StoreList = function StoreList() {\n  var _stats$products, _stats$products2, _stats$products3, _stats$orders, _stats$customers, _stats$coupons, _stats$categories, _stats$refunds, _reportTotals$orders, _reportTotals$custome, _reportTotals$product, _reportTotals$coupons;\n  var _useStoreManager = (0,_Layouts_StoreManagerContext__WEBPACK_IMPORTED_MODULE_39__.useStoreManager)(),\n    onStoreModalOpen = _useStoreManager.onStoreModalOpen;\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState2 = _slicedToArray(_useState, 2),\n    stores = _useState2[0],\n    setStores = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),\n    _useState4 = _slicedToArray(_useState3, 2),\n    loading = _useState4[0],\n    setLoading = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState6 = _slicedToArray(_useState5, 2),\n    stats = _useState6[0],\n    setStats = _useState6[1];\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState8 = _slicedToArray(_useState7, 2),\n    statsLoading = _useState8[0],\n    setStatsLoading = _useState8[1];\n  var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState0 = _slicedToArray(_useState9, 2),\n    isRefreshing = _useState0[0],\n    setIsRefreshing = _useState0[1];\n  var _useState1 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState10 = _slicedToArray(_useState1, 2),\n    reportTotals = _useState10[0],\n    setReportTotals = _useState10[1];\n  var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState12 = _slicedToArray(_useState11, 2),\n    reportTotalsLoading = _useState12[0],\n    setReportTotalsLoading = _useState12[1];\n  var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState14 = _slicedToArray(_useState13, 2),\n    salesReport = _useState14[0],\n    setSalesReport = _useState14[1];\n  var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState16 = _slicedToArray(_useState15, 2),\n    salesReportLoading = _useState16[0],\n    setSalesReportLoading = _useState16[1];\n\n  // Notifications State\n  var _useState17 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState18 = _slicedToArray(_useState17, 2),\n    notifications = _useState18[0],\n    setNotifications = _useState18[1];\n  var _useState19 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState20 = _slicedToArray(_useState19, 2),\n    notifLoading = _useState20[0],\n    setNotifLoading = _useState20[1];\n  var _useState21 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_30__.getAllTimeRange)()),\n    _useState22 = _slicedToArray(_useState21, 2),\n    dateRange = _useState22[0],\n    setDateRange = _useState22[1];\n  var fetchNotifications = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n    var force,\n      url,\n      _yield$axios$get,\n      data,\n      _args = arguments,\n      _t;\n    return _regenerator().w(function (_context) {\n      while (1) switch (_context.p = _context.n) {\n        case 0:\n          force = _args.length > 0 && _args[0] !== undefined ? _args[0] : false;\n          setNotifLoading(true);\n          _context.p = 1;\n          url = force ? '/api/store-manager/notifications?force=1' : '/api/store-manager/notifications';\n          _context.n = 2;\n          return axios__WEBPACK_IMPORTED_MODULE_27__[\"default\"].get(url);\n        case 2:\n          _yield$axios$get = _context.v;\n          data = _yield$axios$get.data;\n          setNotifications(data.notifications || []);\n          _context.n = 4;\n          break;\n        case 3:\n          _context.p = 3;\n          _t = _context.v;\n          console.error('Failed to fetch notifications', _t);\n        case 4:\n          _context.p = 4;\n          setNotifLoading(false);\n          return _context.f(4);\n        case 5:\n          return _context.a(2);\n      }\n    }, _callee, null, [[1, 3, 4, 5]]);\n  })), []);\n  var markNotificationRead = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(id, e) {\n      var _t2;\n      return _regenerator().w(function (_context2) {\n        while (1) switch (_context2.p = _context2.n) {\n          case 0:\n            if (e) e.stopPropagation();\n            _context2.p = 1;\n            _context2.n = 2;\n            return axios__WEBPACK_IMPORTED_MODULE_27__[\"default\"].post('/api/store-manager/notifications/mark-read', {\n              id: id\n            });\n          case 2:\n            setNotifications(function (prev) {\n              return prev.filter(function (n) {\n                return n.id !== id;\n              });\n            });\n            _context2.n = 4;\n            break;\n          case 3:\n            _context2.p = 3;\n            _t2 = _context2.v;\n            console.error(_t2);\n          case 4:\n            return _context2.a(2);\n        }\n      }, _callee2, null, [[1, 3]]);\n    }));\n    return function markNotificationRead(_x, _x2) {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  var markAllNotificationsRead = /*#__PURE__*/function () {\n    var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {\n      var _t3;\n      return _regenerator().w(function (_context3) {\n        while (1) switch (_context3.p = _context3.n) {\n          case 0:\n            _context3.p = 0;\n            _context3.n = 1;\n            return axios__WEBPACK_IMPORTED_MODULE_27__[\"default\"].post('/api/store-manager/notifications/mark-read', {\n              all: true\n            });\n          case 1:\n            setNotifications([]);\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_28__[\"default\"].success(\"All notifications dismissed\");\n            _context3.n = 3;\n            break;\n          case 2:\n            _context3.p = 2;\n            _t3 = _context3.v;\n            console.error(_t3);\n          case 3:\n            return _context3.a(2);\n        }\n      }, _callee3, null, [[0, 2]]);\n    }));\n    return function markAllNotificationsRead() {\n      return _ref3.apply(this, arguments);\n    };\n  }();\n  var fetchReportTotals = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {\n    var _yield$axios$get2, data, _t4;\n    return _regenerator().w(function (_context4) {\n      while (1) switch (_context4.p = _context4.n) {\n        case 0:\n          setReportTotalsLoading(true);\n          _context4.p = 1;\n          _context4.n = 2;\n          return axios__WEBPACK_IMPORTED_MODULE_27__[\"default\"].get('/api/store-manager/report-totals');\n        case 2:\n          _yield$axios$get2 = _context4.v;\n          data = _yield$axios$get2.data;\n          setReportTotals(data);\n          _context4.n = 4;\n          break;\n        case 3:\n          _context4.p = 3;\n          _t4 = _context4.v;\n          console.error('Failed to fetch report totals', _t4);\n        case 4:\n          _context4.p = 4;\n          setReportTotalsLoading(false);\n          return _context4.f(4);\n        case 5:\n          return _context4.a(2);\n      }\n    }, _callee4, null, [[1, 3, 4, 5]]);\n  })), []);\n  var fetchSalesReport = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {\n    var params, _yield$axios$get3, data, _t5;\n    return _regenerator().w(function (_context5) {\n      while (1) switch (_context5.p = _context5.n) {\n        case 0:\n          setSalesReportLoading(true);\n          _context5.p = 1;\n          params = {\n            after: dateRange !== null && dateRange !== void 0 && dateRange.startDate ? dateRange.startDate.toISOString().split('.')[0] + 'Z' : undefined,\n            before: dateRange !== null && dateRange !== void 0 && dateRange.endDate ? dateRange.endDate.toISOString().split('.')[0] + 'Z' : undefined\n          };\n          _context5.n = 2;\n          return axios__WEBPACK_IMPORTED_MODULE_27__[\"default\"].get('/api/store-manager/sales-report', {\n            params: params\n          });\n        case 2:\n          _yield$axios$get3 = _context5.v;\n          data = _yield$axios$get3.data;\n          setSalesReport(data);\n          _context5.n = 4;\n          break;\n        case 3:\n          _context5.p = 3;\n          _t5 = _context5.v;\n          console.error('Failed to fetch sales report', _t5);\n        case 4:\n          _context5.p = 4;\n          setSalesReportLoading(false);\n          return _context5.f(4);\n        case 5:\n          return _context5.a(2);\n      }\n    }, _callee5, null, [[1, 3, 4, 5]]);\n  })), [dateRange]);\n  var fetchStats = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {\n    var params, _yield$axios$get4, data, _t6;\n    return _regenerator().w(function (_context6) {\n      while (1) switch (_context6.p = _context6.n) {\n        case 0:\n          setStatsLoading(true);\n          _context6.p = 1;\n          params = {\n            after: dateRange !== null && dateRange !== void 0 && dateRange.startDate ? dateRange.startDate.toISOString().split('.')[0] + 'Z' : undefined,\n            before: dateRange !== null && dateRange !== void 0 && dateRange.endDate ? dateRange.endDate.toISOString().split('.')[0] + 'Z' : undefined\n          };\n          _context6.n = 2;\n          return axios__WEBPACK_IMPORTED_MODULE_27__[\"default\"].get('/api/store-manager/stats', {\n            params: params\n          });\n        case 2:\n          _yield$axios$get4 = _context6.v;\n          data = _yield$axios$get4.data;\n          setStats(data);\n          _context6.n = 4;\n          break;\n        case 3:\n          _context6.p = 3;\n          _t6 = _context6.v;\n          console.error('Failed to fetch stats', _t6);\n        case 4:\n          _context6.p = 4;\n          setStatsLoading(false);\n          return _context6.f(4);\n        case 5:\n          return _context6.a(2);\n      }\n    }, _callee6, null, [[1, 3, 4, 5]]);\n  })), [dateRange]);\n  var fetchStores = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {\n    var _response$data, response, _t7;\n    return _regenerator().w(function (_context7) {\n      while (1) switch (_context7.p = _context7.n) {\n        case 0:\n          setLoading(true);\n          _context7.p = 1;\n          _context7.n = 2;\n          return axios__WEBPACK_IMPORTED_MODULE_27__[\"default\"].get('/api/stores');\n        case 2:\n          response = _context7.v;\n          setStores(((_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.stores) || []);\n          _context7.n = 4;\n          break;\n        case 3:\n          _context7.p = 3;\n          _t7 = _context7.v;\n          react_hot_toast__WEBPACK_IMPORTED_MODULE_28__[\"default\"].error('Failed to fetch stores');\n        case 4:\n          _context7.p = 4;\n          setLoading(false);\n          return _context7.f(4);\n        case 5:\n          return _context7.a(2);\n      }\n    }, _callee7, null, [[1, 3, 4, 5]]);\n  })), []);\n  var handleRefresh = /*#__PURE__*/function () {\n    var _ref8 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {\n      return _regenerator().w(function (_context8) {\n        while (1) switch (_context8.n) {\n          case 0:\n            setIsRefreshing(true);\n            _context8.n = 1;\n            return Promise.all([fetchStores(), fetchStats(), fetchNotifications(true), fetchReportTotals(), fetchSalesReport()]);\n          case 1:\n            setIsRefreshing(false);\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_28__[\"default\"].success(\"Data refreshed\");\n          case 2:\n            return _context8.a(2);\n        }\n      }, _callee8);\n    }));\n    return function handleRefresh() {\n      return _ref8.apply(this, arguments);\n    };\n  }();\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    fetchStores();\n    fetchStats();\n    fetchNotifications();\n    fetchReportTotals();\n    fetchSalesReport();\n  }, [fetchStores, fetchStats, fetchNotifications, fetchReportTotals, fetchSalesReport]);\n  var currentStore = stores === null || stores === void 0 ? void 0 : stores.find(function (s) {\n    return s.is_current == 1;\n  });\n  if (loading) return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    animation: \"fadeIn 0.5s ease-out\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n    justify: \"space-between\",\n    align: \"center\",\n    mb: 10\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n    height: \"30px\",\n    width: \"200px\",\n    mb: 2\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n    height: \"20px\",\n    width: \"350px\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.HStack, {\n    spacing: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n    height: \"40px\",\n    width: \"40px\",\n    borderRadius: \"md\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n    height: \"40px\",\n    width: \"120px\",\n    borderRadius: \"xl\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n    height: \"40px\",\n    width: \"40px\",\n    borderRadius: \"xl\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n    height: \"40px\",\n    width: \"150px\",\n    borderRadius: \"xl\"\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.SimpleGrid, {\n    columns: {\n      base: 1,\n      md: 3\n    },\n    spacing: 6,\n    mb: 10\n  }, [1, 2, 3, 4, 5, 6].map(function (i) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Card, {\n      key: i,\n      borderRadius: \"2xl\",\n      border: \"1px\",\n      borderColor: \"gray.100\",\n      shadow: \"sm\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n      align: \"center\",\n      justify: \"space-between\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n      w: \"full\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n      height: \"15px\",\n      width: \"100px\",\n      mb: 3\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n      height: \"35px\",\n      width: \"120px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n      height: \"48px\",\n      width: \"48px\",\n      borderRadius: \"xl\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n      height: \"15px\",\n      width: \"150px\",\n      mt: 4\n    })));\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    mb: 8\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n    height: \"25px\",\n    width: \"150px\",\n    mb: 5\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.SimpleGrid, {\n    columns: {\n      base: 1,\n      md: 2,\n      lg: 4\n    },\n    spacing: 5,\n    mb: 5\n  }, [1, 2, 3, 4].map(function (i) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Card, {\n      key: i,\n      borderRadius: \"xl\",\n      border: \"1px\",\n      borderColor: \"gray.100\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.CardBody, {\n      p: 5\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n      justify: \"space-between\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n      w: \"full\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n      height: \"15px\",\n      width: \"80px\",\n      mb: 3\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n      height: \"30px\",\n      width: \"100px\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n      height: \"40px\",\n      width: \"40px\",\n      borderRadius: \"lg\"\n    }))));\n  }))));\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    animation: \"fadeIn 0.5s ease-out\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n    direction: {\n      base: \"column\",\n      md: \"row\"\n    },\n    justify: \"space-between\",\n    align: {\n      base: \"start\",\n      md: \"center\"\n    },\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Heading, {\n    mb: 2,\n    size: \"lg\",\n    fontWeight: \"800\",\n    letterSpacing: \"-0.5px\"\n  }, \"Dashboard\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Text, {\n    color: \"gray.500\",\n    fontWeight: \"500\"\n  }, \"Overview of your connected store performance.\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.HStack, {\n    spacing: 3,\n    w: {\n      base: \"full\",\n      md: \"auto\"\n    },\n    overflowX: \"auto\",\n    pb: {\n      base: 2,\n      md: 0\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Popover, {\n    placement: \"bottom-end\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_36__.PopoverTrigger, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n      as: react_icons_fa__WEBPACK_IMPORTED_MODULE_29__.FaCalendar\n    }),\n    variant: \"outline\",\n    size: \"sm\",\n    borderRadius: \"xl\",\n    px: 4,\n    fontWeight: \"600\",\n    color: \"gray.600\",\n    _hover: {\n      bg: \"gray.50\"\n    }\n  }, dateRange.label ? dateRange.label : dateRange.startDate ? \"\".concat(dateRange.startDate.toLocaleDateString(), \" - \").concat(dateRange.endDate.toLocaleDateString()) : \"Select Dates\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.PopoverContent, {\n    w: \"auto\",\n    borderRadius: \"xl\",\n    shadow: \"2xl\",\n    border: \"none\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.PopoverArrow, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.PopoverCloseButton, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.PopoverBody, {\n    p: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_30__[\"default\"], {\n    initialRange: dateRange,\n    onChange: function onChange(range) {\n      return setDateRange(range);\n    }\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Menu, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.MenuButton, {\n    as: _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Button,\n    variant: \"outline\",\n    p: 0,\n    minW: \"40px\",\n    h: \"40px\",\n    position: \"relative\",\n    \"aria-label\": \"Notifications\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiBell,\n    w: 5,\n    h: 5\n  }), notifications.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    position: \"absolute\",\n    top: \"5px\",\n    right: \"4px\",\n    transform: \"translate(30%, -30%)\",\n    bg: \"red.500\",\n    color: \"white\",\n    borderRadius: \"full\",\n    w: \"18px\",\n    h: \"18px\",\n    fontSize: \"10px\",\n    fontWeight: \"bold\",\n    display: \"flex\",\n    alignItems: \"center\",\n    justifyContent: \"center\",\n    border: \"2px solid white\",\n    boxShadow: \"0 0 0 1px rgba(255,255,255,0.8)\",\n    zIndex: 10,\n    lineHeight: \"1\"\n  }, notifications.length)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.MenuList, {\n    maxH: \"400px\",\n    overflowY: \"auto\",\n    w: \"350px\",\n    p: 0,\n    shadow: \"xl\",\n    borderRadius: \"lg\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n    justify: \"space-between\",\n    align: \"center\",\n    p: 3,\n    bg: \"gray.50\",\n    borderBottomWidth: \"1px\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Text, {\n    fontWeight: \"bold\"\n  }, \"Notifications\"), notifications.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Button, {\n    size: \"xs\",\n    variant: \"ghost\",\n    colorScheme: \"blue\",\n    onClick: markAllNotificationsRead\n  }, \"Mark all read\")), notifLoading ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n    p: 4,\n    justify: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Spinner, {\n    size: \"sm\"\n  })) : notifications.length === 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n    p: 6,\n    justify: \"center\",\n    align: \"center\",\n    direction: \"column\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiBell,\n    color: \"gray.300\",\n    w: 8,\n    h: 8,\n    mb: 2\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Text, {\n    color: \"gray.500\",\n    fontSize: \"sm\"\n  }, \"You're all caught up!\")) : notifications.map(function (n) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.MenuItem, {\n      key: n.id,\n      onClick: function onClick() {},\n      p: 3,\n      borderBottomWidth: \"1px\",\n      _last: {\n        borderBottomWidth: 0\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.HStack, {\n      align: \"start\",\n      spacing: 3,\n      w: \"full\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n      pt: 1\n    }, n.type === 'error' && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n      as: n.title === 'Store Down Alert' ? react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiAlertTriangle : react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiXCircle,\n      color: \"red.500\",\n      w: 5,\n      h: 5\n    }), n.type === 'warning' && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiAlertTriangle,\n      color: \"orange.500\",\n      w: 5,\n      h: 5\n    }), n.type === 'info' && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiInfo,\n      color: \"blue.500\",\n      w: 5,\n      h: 5\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.VStack, {\n      align: \"start\",\n      spacing: 0,\n      flex: 1\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Text, {\n      mb: 0,\n      fontWeight: \"bold\",\n      fontSize: \"sm\"\n    }, n.title, \" - \", n.store), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Text, {\n      mt: 0,\n      fontSize: \"xs\",\n      color: \"gray.600\",\n      whiteSpace: \"normal\"\n    }, n.message)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.IconButton, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiXCircle, null),\n      size: \"xs\",\n      variant: \"ghost\",\n      colorScheme: \"gray\",\n      onClick: function onClick(e) {\n        return markNotificationRead(n.id, e);\n      },\n      \"aria-label\": \"Dismiss\"\n    })));\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Tooltip, {\n    label: \"Visit Store\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiGlobe, null),\n    variant: \"outline\",\n    size: \"sm\",\n    fontWeight: \"600\",\n    onClick: function onClick() {\n      if (currentStore !== null && currentStore !== void 0 && currentStore.url) {\n        window.open(currentStore.url, '_blank');\n      } else {\n        react_hot_toast__WEBPACK_IMPORTED_MODULE_28__[\"default\"].error('Store URL not found');\n      }\n    }\n  }, \"Visit store\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Tooltip, {\n    label: \"Refresh Data\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.IconButton, {\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiRefreshCw, null),\n    onClick: handleRefresh,\n    isLoading: isRefreshing,\n    variant: \"outline\",\n    colorScheme: \"blue\",\n    borderRadius: \"xl\",\n    \"aria-label\": \"Refresh Data\"\n  })), stores.length > 1 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiLayers, null),\n    variant: \"outline\",\n    colorScheme: \"purple\",\n    borderRadius: \"xl\",\n    onClick: onStoreModalOpen\n  }, \"Change Store\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Link, {\n    href: \"#/store-manager/stores\",\n    _hover: {\n      textDecoration: 'none'\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiPlus, null),\n    colorScheme: \"blue\",\n    borderRadius: \"xl\",\n    px: 6,\n    shadow: \"md\",\n    _hover: {\n      shadow: \"lg\",\n      transform: \"translateY(-2px)\"\n    }\n  }, \"Manage Stores\")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.SimpleGrid, {\n    columns: {\n      base: 1,\n      md: 3\n    },\n    spacing: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Card, {\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Stat, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n    align: \"center\",\n    justify: \"space-between\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.StatLabel, {\n    color: \"gray.500\",\n    fontWeight: \"700\"\n  }, \"TOTAL PRODUCTS\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.StatNumber, {\n    fontSize: \"3xl\",\n    fontWeight: \"900\"\n  }, statsLoading ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Spinner, {\n    size: \"sm\"\n  }) : (stats === null || stats === void 0 || (_stats$products = stats.products) === null || _stats$products === void 0 ? void 0 : _stats$products.total) || 0)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    p: 3,\n    bg: \"blue.50\",\n    borderRadius: \"xl\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiBox,\n    color: \"blue.500\",\n    w: 6,\n    h: 6\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.StatHelpText, {\n    mb: 0,\n    mt: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Badge, {\n    colorScheme: \"green\",\n    mr: 2\n  }, (stats === null || stats === void 0 || (_stats$products2 = stats.products) === null || _stats$products2 === void 0 ? void 0 : _stats$products2.publish) || 0, \" Published\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Badge, {\n    colorScheme: \"gray\"\n  }, (stats === null || stats === void 0 || (_stats$products3 = stats.products) === null || _stats$products3 === void 0 ? void 0 : _stats$products3.draft) || 0, \" Drafts\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Card, {\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Stat, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n    align: \"center\",\n    justify: \"space-between\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.StatLabel, {\n    color: \"gray.500\",\n    fontWeight: \"700\"\n  }, \"TOTAL ORDERS\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.StatNumber, {\n    fontSize: \"3xl\",\n    fontWeight: \"900\"\n  }, statsLoading ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Spinner, {\n    size: \"sm\"\n  }) : (stats === null || stats === void 0 || (_stats$orders = stats.orders) === null || _stats$orders === void 0 ? void 0 : _stats$orders.total) || 0)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    p: 3,\n    bg: \"orange.50\",\n    borderRadius: \"xl\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiShoppingCart,\n    color: \"orange.500\",\n    w: 6,\n    h: 6\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.StatHelpText, {\n    mb: 0,\n    mt: 2,\n    display: \"flex\",\n    alignItems: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiTrendingUp,\n    color: \"green.500\",\n    mr: 1\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Text, {\n    as: \"span\",\n    fontWeight: \"700\",\n    color: \"green.500\"\n  }, \"Growth tracked\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Card, {\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Stat, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n    align: \"center\",\n    justify: \"space-between\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.StatLabel, {\n    color: \"gray.500\",\n    fontWeight: \"700\"\n  }, \"TOTAL CUSTOMERS\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.StatNumber, {\n    fontSize: \"3xl\",\n    fontWeight: \"900\"\n  }, statsLoading ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Spinner, {\n    size: \"sm\"\n  }) : (stats === null || stats === void 0 || (_stats$customers = stats.customers) === null || _stats$customers === void 0 ? void 0 : _stats$customers.total) || 0)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    p: 3,\n    bg: \"purple.50\",\n    borderRadius: \"xl\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiUsers,\n    color: \"purple.500\",\n    w: 6,\n    h: 6\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.StatHelpText, {\n    mb: 0,\n    mt: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Text, {\n    as: \"span\",\n    fontWeight: \"600\",\n    color: \"gray.500\"\n  }, \"For this store\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Card, {\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Stat, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n    align: \"center\",\n    justify: \"space-between\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.StatLabel, {\n    color: \"gray.500\",\n    fontWeight: \"700\"\n  }, \"TOTAL COUPONS\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.StatNumber, {\n    fontSize: \"3xl\",\n    fontWeight: \"900\"\n  }, statsLoading ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Spinner, {\n    size: \"sm\"\n  }) : (stats === null || stats === void 0 || (_stats$coupons = stats.coupons) === null || _stats$coupons === void 0 ? void 0 : _stats$coupons.total) || 0)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    p: 3,\n    bg: \"red.50\",\n    borderRadius: \"xl\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiPercent,\n    color: \"red.500\",\n    w: 6,\n    h: 6\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.StatHelpText, {\n    mb: 0,\n    mt: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Text, {\n    as: \"span\",\n    fontWeight: \"600\",\n    color: \"gray.500\"\n  }, \"Active Campaign\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Card, {\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Stat, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n    align: \"center\",\n    justify: \"space-between\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.StatLabel, {\n    color: \"gray.500\",\n    fontWeight: \"700\"\n  }, \"TOTAL CATEGORIES\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.StatNumber, {\n    fontSize: \"3xl\",\n    fontWeight: \"900\"\n  }, statsLoading ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Spinner, {\n    size: \"sm\"\n  }) : (stats === null || stats === void 0 || (_stats$categories = stats.categories) === null || _stats$categories === void 0 ? void 0 : _stats$categories.total) || 0)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    p: 3,\n    bg: \"green.50\",\n    borderRadius: \"xl\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiLayers,\n    color: \"green.500\",\n    w: 6,\n    h: 6\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.StatHelpText, {\n    mb: 0,\n    mt: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Text, {\n    as: \"span\",\n    fontWeight: \"600\",\n    color: \"gray.500\"\n  }, \"Inventory Segments\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Card, {\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.Stat, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n    align: \"center\",\n    justify: \"space-between\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.StatLabel, {\n    color: \"gray.500\",\n    fontWeight: \"700\"\n  }, \"TOTAL REFUNDS\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.StatNumber, {\n    fontSize: \"3xl\",\n    fontWeight: \"900\"\n  }, statsLoading ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Spinner, {\n    size: \"sm\"\n  }) : (stats === null || stats === void 0 || (_stats$refunds = stats.refunds) === null || _stats$refunds === void 0 ? void 0 : _stats$refunds.total) || 0)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    p: 3,\n    bg: \"pink.50\",\n    borderRadius: \"xl\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiRotateCcw,\n    color: \"pink.500\",\n    w: 6,\n    h: 6\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.StatHelpText, {\n    mb: 0,\n    mt: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Text, {\n    as: \"span\",\n    fontWeight: \"600\",\n    color: \"gray.500\"\n  }, \"Returned Orders\")))))), currentStore && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_OrderMetrics__WEBPACK_IMPORTED_MODULE_38__[\"default\"], {\n    dateRange: dateRange\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n    align: \"center\",\n    justify: \"space-between\",\n    mb: 5\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Heading, {\n    mb: 0,\n    size: \"md\",\n    fontWeight: \"700\"\n  }, \"\\uD83D\\uDCC8 Sales Trend\")), salesReportLoading && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.Spinner, {\n    size: \"sm\",\n    color: \"blue.400\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Card, {\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.CardBody, {\n    p: 5\n  }, salesReportLoading ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n    height: \"300px\",\n    borderRadius: \"xl\"\n  }) : function () {\n    var activeTrends = ((salesReport === null || salesReport === void 0 ? void 0 : salesReport.trends) || []).filter(function (t) {\n      return (t.sales || 0) > 0 || (t.orders || 0) > 0;\n    });\n    if (activeTrends.length === 0) return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n      direction: \"column\",\n      align: \"center\",\n      justify: \"center\",\n      py: 16,\n      gap: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiBarChart2,\n      w: 10,\n      h: 10,\n      color: \"gray.200\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Text, {\n      color: \"gray.400\",\n      fontWeight: \"500\"\n    }, \"No sales data for the selected period\"));\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_apexcharts__WEBPACK_IMPORTED_MODULE_37__[\"default\"], {\n      type: \"area\",\n      height: 320,\n      series: [{\n        name: 'Revenue',\n        data: activeTrends.map(function (t) {\n          return parseFloat((t.sales || 0).toFixed(2));\n        })\n      }, {\n        name: 'Orders',\n        data: activeTrends.map(function (t) {\n          return t.orders || 0;\n        })\n      }],\n      options: {\n        chart: {\n          toolbar: {\n            show: false\n          },\n          zoom: {\n            enabled: false\n          },\n          animations: {\n            enabled: true,\n            easing: 'easeinout',\n            speed: 600\n          }\n        },\n        dataLabels: {\n          enabled: false\n        },\n        stroke: {\n          curve: 'smooth',\n          width: [2.5, 2]\n        },\n        colors: ['#6366f1', '#f59e0b'],\n        fill: {\n          type: 'gradient',\n          gradient: {\n            shadeIntensity: 1,\n            opacityFrom: 0.35,\n            opacityTo: 0.02,\n            stops: [0, 100]\n          }\n        },\n        xaxis: {\n          categories: activeTrends.map(function (t) {\n            var parts = (t.date || '').split('-');\n            if (parts.length === 3) {\n              var d = new Date(parseInt(parts[0]), parseInt(parts[1]) - 1, parseInt(parts[2]));\n              return d.toLocaleDateString(undefined, {\n                month: 'short',\n                day: 'numeric'\n              });\n            }\n            return t.date;\n          }),\n          axisBorder: {\n            show: false\n          },\n          axisTicks: {\n            show: false\n          },\n          labels: {\n            rotate: -30,\n            style: {\n              fontSize: '11px',\n              colors: '#94a3b8'\n            },\n            maxHeight: 50\n          },\n          tickAmount: Math.min(activeTrends.length, 12)\n        },\n        yaxis: [{\n          title: {\n            text: 'Revenue',\n            style: {\n              color: '#6366f1'\n            }\n          },\n          labels: {\n            formatter: function formatter(v) {\n              return \"$\".concat(v.toFixed(0));\n            },\n            style: {\n              colors: ['#6366f1']\n            }\n          }\n        }, {\n          opposite: true,\n          title: {\n            text: 'Orders',\n            style: {\n              color: '#f59e0b'\n            }\n          },\n          labels: {\n            formatter: function formatter(v) {\n              return v.toFixed(0);\n            },\n            style: {\n              colors: ['#f59e0b']\n            }\n          }\n        }],\n        grid: {\n          borderColor: '#f1f5f9',\n          padding: {\n            left: 10,\n            right: 10\n          }\n        },\n        legend: {\n          position: 'top',\n          horizontalAlign: 'right',\n          fontSize: '12px'\n        },\n        tooltip: {\n          shared: true,\n          y: [{\n            formatter: function formatter(v) {\n              return \"$\".concat(v.toFixed(2));\n            }\n          }, {\n            formatter: function formatter(v) {\n              return \"\".concat(v, \" orders\");\n            }\n          }]\n        }\n      }\n    });\n  }()))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    mt: 10\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Heading, {\n    size: \"md\",\n    fontWeight: \"700\",\n    mb: 5\n  }, \"\\uD83D\\uDCCA Store Report Totals\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.SimpleGrid, {\n    columns: {\n      base: 1,\n      md: 2,\n      lg: 4\n    },\n    spacing: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Card, {\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n    align: \"center\",\n    justify: \"space-between\",\n    mb: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Heading, {\n    size: \"sm\",\n    fontWeight: \"700\",\n    color: \"orange.600\"\n  }, \"\\uD83D\\uDCE6 Orders\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    p: 2,\n    bg: \"orange.50\",\n    borderRadius: \"lg\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiShoppingCart,\n    color: \"orange.500\",\n    w: 5,\n    h: 5\n  }))), reportTotalsLoading ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.VStack, {\n    align: \"start\",\n    spacing: 2\n  }, [1, 2, 3, 4].map(function (i) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n      key: i,\n      height: \"20px\",\n      width: \"full\"\n    });\n  })) : (reportTotals === null || reportTotals === void 0 || (_reportTotals$orders = reportTotals.orders) === null || _reportTotals$orders === void 0 ? void 0 : _reportTotals$orders.length) > 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.VStack, {\n    align: \"stretch\",\n    spacing: 1,\n    maxH: \"200px\",\n    overflowY: \"auto\"\n  }, reportTotals.orders.filter(function (item) {\n    return item.total > 0 || ['pending', 'processing', 'completed', 'on-hold'].includes(item.slug);\n  }).map(function (item) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n      key: item.slug,\n      justify: \"space-between\",\n      align: \"center\",\n      py: 1,\n      borderBottom: \"1px\",\n      borderColor: \"gray.50\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Text, {\n      fontSize: \"xs\",\n      color: \"gray.600\",\n      fontWeight: \"500\",\n      flex: \"1\",\n      mr: 2,\n      noOfLines: 1\n    }, item.name || item.slug), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Badge, {\n      flexShrink: 0,\n      colorScheme: item.slug === 'completed' ? 'green' : item.slug === 'processing' ? 'blue' : item.slug === 'on-hold' ? 'yellow' : item.slug === 'cancelled' ? 'red' : item.slug === 'refunded' ? 'pink' : 'gray',\n      fontSize: \"xs\",\n      px: 2\n    }, item.total));\n  })) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.400\"\n  }, \"No data\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Card, {\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n    align: \"center\",\n    justify: \"space-between\",\n    mb: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Heading, {\n    size: \"sm\",\n    fontWeight: \"700\",\n    color: \"purple.600\"\n  }, \"\\uD83D\\uDC64 Customers\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    p: 2,\n    bg: \"purple.50\",\n    borderRadius: \"lg\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiUsers,\n    color: \"purple.500\",\n    w: 5,\n    h: 5\n  }))), reportTotalsLoading ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.VStack, {\n    align: \"start\",\n    spacing: 2\n  }, [1, 2].map(function (i) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n      key: i,\n      height: \"20px\",\n      width: \"full\"\n    });\n  })) : (reportTotals === null || reportTotals === void 0 || (_reportTotals$custome = reportTotals.customers) === null || _reportTotals$custome === void 0 ? void 0 : _reportTotals$custome.length) > 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.VStack, {\n    align: \"stretch\",\n    spacing: 1\n  }, reportTotals.customers.map(function (item) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n      key: item.slug,\n      justify: \"space-between\",\n      align: \"center\",\n      py: 1,\n      borderBottom: \"1px\",\n      borderColor: \"gray.50\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Text, {\n      fontSize: \"xs\",\n      color: \"gray.600\",\n      fontWeight: \"500\",\n      flex: \"1\",\n      mr: 2,\n      noOfLines: 1\n    }, item.name || item.slug), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Badge, {\n      flexShrink: 0,\n      colorScheme: \"purple\",\n      fontSize: \"xs\",\n      px: 2\n    }, item.total));\n  })) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.400\"\n  }, \"No data\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Card, {\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n    align: \"center\",\n    justify: \"space-between\",\n    mb: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Heading, {\n    size: \"sm\",\n    fontWeight: \"700\",\n    color: \"blue.600\"\n  }, \"\\uD83D\\uDECD\\uFE0F Products\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    p: 2,\n    bg: \"blue.50\",\n    borderRadius: \"lg\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiBox,\n    color: \"blue.500\",\n    w: 5,\n    h: 5\n  }))), reportTotalsLoading ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.VStack, {\n    align: \"start\",\n    spacing: 2\n  }, [1, 2, 3].map(function (i) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n      key: i,\n      height: \"20px\",\n      width: \"full\"\n    });\n  })) : (reportTotals === null || reportTotals === void 0 || (_reportTotals$product = reportTotals.products) === null || _reportTotals$product === void 0 ? void 0 : _reportTotals$product.length) > 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.VStack, {\n    align: \"stretch\",\n    spacing: 1\n  }, reportTotals.products.map(function (item) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n      key: item.slug,\n      justify: \"space-between\",\n      align: \"center\",\n      py: 1,\n      borderBottom: \"1px\",\n      borderColor: \"gray.50\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Text, {\n      fontSize: \"xs\",\n      color: \"gray.600\",\n      fontWeight: \"500\",\n      flex: \"1\",\n      mr: 2,\n      noOfLines: 1\n    }, item.name || item.slug), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Badge, {\n      flexShrink: 0,\n      colorScheme: item.slug === 'publish' ? 'green' : item.slug === 'draft' ? 'gray' : 'yellow',\n      fontSize: \"xs\",\n      px: 2\n    }, item.total));\n  })) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.400\"\n  }, \"No data\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Card, {\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n    align: \"center\",\n    justify: \"space-between\",\n    mb: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Heading, {\n    size: \"sm\",\n    fontWeight: \"700\",\n    color: \"green.600\"\n  }, \"\\uD83C\\uDFF7\\uFE0F Coupons\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    p: 2,\n    bg: \"green.50\",\n    borderRadius: \"lg\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_26__.FiPercent,\n    color: \"green.500\",\n    w: 5,\n    h: 5\n  }))), reportTotalsLoading ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.VStack, {\n    align: \"start\",\n    spacing: 2\n  }, [1, 2].map(function (i) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n      key: i,\n      height: \"20px\",\n      width: \"full\"\n    });\n  })) : (reportTotals === null || reportTotals === void 0 || (_reportTotals$coupons = reportTotals.coupons) === null || _reportTotals$coupons === void 0 ? void 0 : _reportTotals$coupons.length) > 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.VStack, {\n    align: \"stretch\",\n    spacing: 1\n  }, reportTotals.coupons.map(function (item) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n      key: item.slug,\n      justify: \"space-between\",\n      align: \"center\",\n      py: 1,\n      borderBottom: \"1px\",\n      borderColor: \"gray.50\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Text, {\n      fontSize: \"xs\",\n      color: \"gray.600\",\n      fontWeight: \"500\",\n      flex: \"1\",\n      mr: 2,\n      noOfLines: 1\n    }, item.name || item.slug), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Badge, {\n      flexShrink: 0,\n      colorScheme: \"green\",\n      fontSize: \"xs\",\n      px: 2\n    }, item.total));\n  })) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.400\"\n  }, \"No data\"))))));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (StoreList);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/StoreList.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Stores/Stores.jsx"
/*!**************************************************!*\
  !*** ./src/Pages/StoreManager/Stores/Stores.jsx ***!
  \**************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/hooks/dist/esm/use-disclosure.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/icon-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-control.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-error.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/form-control/form-label.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input-group.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/input/input-element.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-close-button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-header.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-overlay.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/modal/modal-content.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/skeleton/skeleton.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/spinner/spinner.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/switch/switch.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/table-container.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tbody.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/td.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/th.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/thead.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/table/tr.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/tooltip/tooltip.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/heading.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var framer_motion__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! framer-motion */ \"./node_modules/framer-motion/dist/es/render/dom/motion.mjs\");\n/* harmony import */ var framer_motion__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! framer-motion */ \"./node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! react-hot-toast */ \"./node_modules/react-hot-toast/dist/index.mjs\");\n/* harmony import */ var _Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ../../../Components/shared/ConfirmDialog */ \"./src/Components/shared/ConfirmDialog.jsx\");\n/* harmony import */ var _Components_shared_AutoSyncConfirmDialog__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ../../../Components/shared/AutoSyncConfirmDialog */ \"./src/Components/shared/AutoSyncConfirmDialog.jsx\");\n/* harmony import */ var _Components_shared_ProFeatureModal__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ../../../Components/shared/ProFeatureModal */ \"./src/Components/shared/ProFeatureModal.jsx\");\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 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 _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\n\n\n\n\n\nvar Stores = function Stores() {\n  var _window$shopCentralDa;\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState2 = _slicedToArray(_useState, 2),\n    stores = _useState2[0],\n    setStores = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),\n    _useState4 = _slicedToArray(_useState3, 2),\n    loading = _useState4[0],\n    setLoading = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState6 = _slicedToArray(_useState5, 2),\n    loadingStoreId = _useState6[0],\n    setLoadingStoreId = _useState6[1];\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''),\n    _useState8 = _slicedToArray(_useState7, 2),\n    searchQuery = _useState8[0],\n    setSearchQuery = _useState8[1];\n  var _useDisclosure = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.useDisclosure)(),\n    isOpen = _useDisclosure.isOpen,\n    onOpen = _useDisclosure.onOpen,\n    onClose = _useDisclosure.onClose;\n\n  // Add Store States\n  var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({\n      name: '',\n      url: '',\n      consumer_key: '',\n      consumer_secret: ''\n    }),\n    _useState0 = _slicedToArray(_useState9, 2),\n    newStore = _useState0[0],\n    setNewStore = _useState0[1];\n  var _useState1 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState10 = _slicedToArray(_useState1, 2),\n    isSaving = _useState10[0],\n    setIsSaving = _useState10[1];\n\n  // Removal States\n  var _useDisclosure2 = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.useDisclosure)(),\n    isConfirmOpen = _useDisclosure2.isOpen,\n    onConfirmOpen = _useDisclosure2.onOpen,\n    onConfirmClose = _useDisclosure2.onClose;\n  var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState12 = _slicedToArray(_useState11, 2),\n    storeToDelete = _useState12[0],\n    setStoreToDelete = _useState12[1];\n  var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState14 = _slicedToArray(_useState13, 2),\n    isDeleting = _useState14[0],\n    setIsDeleting = _useState14[1];\n\n  // Sync States\n  var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState16 = _slicedToArray(_useState15, 2),\n    autoSync = _useState16[0],\n    setAutoSync = _useState16[1];\n  var _useState17 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState18 = _slicedToArray(_useState17, 2),\n    isSyncLoading = _useState18[0],\n    setIsSyncLoading = _useState18[1];\n  var _useDisclosure3 = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.useDisclosure)(),\n    isAutoSyncConfirmOpen = _useDisclosure3.isOpen,\n    onAutoSyncConfirmOpen = _useDisclosure3.onOpen,\n    onAutoSyncConfirmClose = _useDisclosure3.onClose;\n\n  // Order Import per-store toggle states\n  var _useState19 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({}),\n    _useState20 = _slicedToArray(_useState19, 2),\n    orderImportStates = _useState20[0],\n    setOrderImportStates = _useState20[1];\n  var _useState21 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({}),\n    _useState22 = _slicedToArray(_useState21, 2),\n    orderImportLoading = _useState22[0],\n    setOrderImportLoading = _useState22[1];\n\n  // Customer Sync per-store toggle states\n  var _useState23 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({}),\n    _useState24 = _slicedToArray(_useState23, 2),\n    customerSyncStates = _useState24[0],\n    setCustomerSyncStates = _useState24[1];\n  var _useState25 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({}),\n    _useState26 = _slicedToArray(_useState25, 2),\n    customerSyncLoading = _useState26[0],\n    setCustomerSyncLoading = _useState26[1];\n\n  // Licensing\n  var isPro = (_window$shopCentralDa = window.shopCentralData) === null || _window$shopCentralDa === void 0 ? void 0 : _window$shopCentralDa.isPro;\n  var canAddStore = isPro || stores.length < 1;\n  var _useDisclosure4 = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.useDisclosure)(),\n    isProModalOpen = _useDisclosure4.isOpen,\n    onProModalOpen = _useDisclosure4.onOpen,\n    onProModalClose = _useDisclosure4.onClose;\n  var fetchStores = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n    var _response$data, response, fetchedStores, oiStates, csStates, _t;\n    return _regenerator().w(function (_context) {\n      while (1) switch (_context.p = _context.n) {\n        case 0:\n          setLoading(true);\n          _context.p = 1;\n          _context.n = 2;\n          return axios__WEBPACK_IMPORTED_MODULE_38__[\"default\"].get('/api/stores');\n        case 2:\n          response = _context.v;\n          fetchedStores = ((_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.stores) || [];\n          setStores(fetchedStores);\n          oiStates = {};\n          csStates = {};\n          fetchedStores.forEach(function (s) {\n            oiStates[s.id] = s.order_import_enabled == 1 || s.order_import_enabled === true || s.order_import_enabled === '1';\n            csStates[s.id] = s.customer_sync_enabled !== 0 && s.customer_sync_enabled !== false && s.customer_sync_enabled !== '0';\n          });\n          setOrderImportStates(oiStates);\n          setCustomerSyncStates(csStates);\n          _context.n = 4;\n          break;\n        case 3:\n          _context.p = 3;\n          _t = _context.v;\n          react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].error('Failed to fetch stores');\n        case 4:\n          _context.p = 4;\n          setLoading(false);\n          return _context.f(4);\n        case 5:\n          return _context.a(2);\n      }\n    }, _callee, null, [[1, 3, 4, 5]]);\n  })), []);\n  var fetchSettings = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {\n    var _response$data2, response, _t2;\n    return _regenerator().w(function (_context2) {\n      while (1) switch (_context2.p = _context2.n) {\n        case 0:\n          _context2.p = 0;\n          _context2.n = 1;\n          return axios__WEBPACK_IMPORTED_MODULE_38__[\"default\"].get('/settings');\n        case 1:\n          response = _context2.v;\n          if ((_response$data2 = response.data) !== null && _response$data2 !== void 0 && _response$data2.success) {\n            setAutoSync(response.data.data.auto_sync || false);\n          }\n          _context2.n = 3;\n          break;\n        case 2:\n          _context2.p = 2;\n          _t2 = _context2.v;\n          console.error('Failed to fetch settings', _t2);\n        case 3:\n          return _context2.a(2);\n      }\n    }, _callee2, null, [[0, 2]]);\n  })), []);\n  var handleToggleOrderImport = /*#__PURE__*/function () {\n    var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(store, enabled) {\n      var _response$data3, response, _error$response, _t3;\n      return _regenerator().w(function (_context3) {\n        while (1) switch (_context3.p = _context3.n) {\n          case 0:\n            if (!(store.is_current == 1)) {\n              _context3.n = 1;\n              break;\n            }\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].error('Order import cannot be toggled for the hub (local) site');\n            return _context3.a(2);\n          case 1:\n            setOrderImportLoading(function (prev) {\n              return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, store.id, true));\n            });\n            _context3.p = 2;\n            _context3.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_38__[\"default\"].post(\"/api/stores/\".concat(store.id, \"/order-import\"), {\n              enabled: enabled\n            });\n          case 3:\n            response = _context3.v;\n            if ((_response$data3 = response.data) !== null && _response$data3 !== void 0 && _response$data3.message) {\n              react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].success(response.data.message);\n              setOrderImportStates(function (prev) {\n                return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, store.id, enabled));\n              });\n            }\n            _context3.n = 5;\n            break;\n          case 4:\n            _context3.p = 4;\n            _t3 = _context3.v;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].error(((_error$response = _t3.response) === null || _error$response === void 0 || (_error$response = _error$response.data) === null || _error$response === void 0 ? void 0 : _error$response.message) || 'Failed to update order import');\n          case 5:\n            _context3.p = 5;\n            setOrderImportLoading(function (prev) {\n              return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, store.id, false));\n            });\n            return _context3.f(5);\n          case 6:\n            return _context3.a(2);\n        }\n      }, _callee3, null, [[2, 4, 5, 6]]);\n    }));\n    return function handleToggleOrderImport(_x, _x2) {\n      return _ref3.apply(this, arguments);\n    };\n  }();\n  var handleToggleCustomerSync = /*#__PURE__*/function () {\n    var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(store, enabled) {\n      var _response$data4, response, _error$response2, _t4;\n      return _regenerator().w(function (_context4) {\n        while (1) switch (_context4.p = _context4.n) {\n          case 0:\n            if (!(store.is_current == 1)) {\n              _context4.n = 1;\n              break;\n            }\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].error('Customer sync cannot be toggled for the hub (local) site');\n            return _context4.a(2);\n          case 1:\n            setCustomerSyncLoading(function (prev) {\n              return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, store.id, true));\n            });\n            _context4.p = 2;\n            _context4.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_38__[\"default\"].post(\"/api/stores/\".concat(store.id, \"/customer-sync\"), {\n              enabled: enabled\n            });\n          case 3:\n            response = _context4.v;\n            if ((_response$data4 = response.data) !== null && _response$data4 !== void 0 && _response$data4.message) {\n              react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].success(response.data.message);\n              setCustomerSyncStates(function (prev) {\n                return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, store.id, enabled));\n              });\n            }\n            _context4.n = 5;\n            break;\n          case 4:\n            _context4.p = 4;\n            _t4 = _context4.v;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].error(((_error$response2 = _t4.response) === null || _error$response2 === void 0 || (_error$response2 = _error$response2.data) === null || _error$response2 === void 0 ? void 0 : _error$response2.message) || 'Failed to update customer sync');\n          case 5:\n            _context4.p = 5;\n            setCustomerSyncLoading(function (prev) {\n              return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, store.id, false));\n            });\n            return _context4.f(5);\n          case 6:\n            return _context4.a(2);\n        }\n      }, _callee4, null, [[2, 4, 5, 6]]);\n    }));\n    return function handleToggleCustomerSync(_x3, _x4) {\n      return _ref4.apply(this, arguments);\n    };\n  }();\n  var _useState27 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState28 = _slicedToArray(_useState27, 2),\n    isRerendering = _useState28[0],\n    setIsRerendering = _useState28[1];\n  var handleRerenderWebhooks = /*#__PURE__*/function () {\n    var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {\n      var _response$data5, response, _error$response3, _t5;\n      return _regenerator().w(function (_context5) {\n        while (1) switch (_context5.p = _context5.n) {\n          case 0:\n            setIsRerendering(true);\n            _context5.p = 1;\n            _context5.n = 2;\n            return axios__WEBPACK_IMPORTED_MODULE_38__[\"default\"].post('/api/stores/rerender-webhooks');\n          case 2:\n            response = _context5.v;\n            if ((_response$data5 = response.data) !== null && _response$data5 !== void 0 && _response$data5.message) {\n              react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].success(response.data.message);\n            } else {\n              react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].success('Webhooks re-registered successfully');\n            }\n            _context5.n = 4;\n            break;\n          case 3:\n            _context5.p = 3;\n            _t5 = _context5.v;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].error(((_error$response3 = _t5.response) === null || _error$response3 === void 0 || (_error$response3 = _error$response3.data) === null || _error$response3 === void 0 ? void 0 : _error$response3.message) || 'Failed to re-register webhooks');\n          case 4:\n            _context5.p = 4;\n            setIsRerendering(false);\n            return _context5.f(4);\n          case 5:\n            return _context5.a(2);\n        }\n      }, _callee5, null, [[1, 3, 4, 5]]);\n    }));\n    return function handleRerenderWebhooks() {\n      return _ref5.apply(this, arguments);\n    };\n  }();\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    fetchStores();\n    fetchSettings();\n  }, [fetchStores, fetchSettings]);\n  var handleStoreSelect = /*#__PURE__*/function () {\n    var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(store) {\n      var _t6;\n      return _regenerator().w(function (_context6) {\n        while (1) switch (_context6.p = _context6.n) {\n          case 0:\n            if (!loadingStoreId) {\n              _context6.n = 1;\n              break;\n            }\n            return _context6.a(2);\n          case 1:\n            setLoadingStoreId(store.id);\n            _context6.p = 2;\n            _context6.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_38__[\"default\"].post('/api/stores/switch', {\n              store_id: store.id\n            });\n          case 3:\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].success('Switched to ' + store.name);\n            window.location.reload();\n            _context6.n = 5;\n            break;\n          case 4:\n            _context6.p = 4;\n            _t6 = _context6.v;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].error('Failed to switch store');\n          case 5:\n            _context6.p = 5;\n            setLoadingStoreId(null);\n            return _context6.f(5);\n          case 6:\n            return _context6.a(2);\n        }\n      }, _callee6, null, [[2, 4, 5, 6]]);\n    }));\n    return function handleStoreSelect(_x5) {\n      return _ref6.apply(this, arguments);\n    };\n  }();\n  var handleAddStore = /*#__PURE__*/function () {\n    var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {\n      var _t7;\n      return _regenerator().w(function (_context7) {\n        while (1) switch (_context7.p = _context7.n) {\n          case 0:\n            if (!(!newStore.url || !newStore.consumer_key || !newStore.consumer_secret)) {\n              _context7.n = 1;\n              break;\n            }\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].error('Please fill in all required fields');\n            return _context7.a(2);\n          case 1:\n            setIsSaving(true);\n            _context7.p = 2;\n            _context7.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_38__[\"default\"].post('/api/stores', newStore);\n          case 3:\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].success('Store added successfully');\n            onClose();\n            setNewStore({\n              name: '',\n              url: '',\n              consumer_key: '',\n              consumer_secret: ''\n            });\n            fetchStores();\n            _context7.n = 5;\n            break;\n          case 4:\n            _context7.p = 4;\n            _t7 = _context7.v;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].error('Failed to add store');\n          case 5:\n            _context7.p = 5;\n            setIsSaving(false);\n            return _context7.f(5);\n          case 6:\n            return _context7.a(2);\n        }\n      }, _callee7, null, [[2, 4, 5, 6]]);\n    }));\n    return function handleAddStore() {\n      return _ref7.apply(this, arguments);\n    };\n  }();\n  var handleDeleteClick = function handleDeleteClick(store) {\n    setStoreToDelete(store);\n    onConfirmOpen();\n  };\n  var handleConfirmDelete = /*#__PURE__*/function () {\n    var _ref8 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {\n      var _t8;\n      return _regenerator().w(function (_context8) {\n        while (1) switch (_context8.p = _context8.n) {\n          case 0:\n            if (storeToDelete) {\n              _context8.n = 1;\n              break;\n            }\n            return _context8.a(2);\n          case 1:\n            setIsDeleting(true);\n            _context8.p = 2;\n            _context8.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_38__[\"default\"][\"delete\"](\"/api/stores/\".concat(storeToDelete.id));\n          case 3:\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].success('Store removed');\n            fetchStores();\n            _context8.n = 5;\n            break;\n          case 4:\n            _context8.p = 4;\n            _t8 = _context8.v;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].error('Failed to remove store');\n          case 5:\n            _context8.p = 5;\n            setIsDeleting(false);\n            setStoreToDelete(null);\n            onConfirmClose();\n            return _context8.f(5);\n          case 6:\n            return _context8.a(2);\n        }\n      }, _callee8, null, [[2, 4, 5, 6]]);\n    }));\n    return function handleConfirmDelete() {\n      return _ref8.apply(this, arguments);\n    };\n  }();\n  var handleToggleSync = function handleToggleSync(e) {\n    var newValue = e.target.checked;\n    if (newValue) {\n      onAutoSyncConfirmOpen();\n    } else {\n      confirmToggleSync(newValue);\n    }\n  };\n  var confirmToggleSync = /*#__PURE__*/function () {\n    var _ref9 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(newValue) {\n      var _response$data6, response, _t9;\n      return _regenerator().w(function (_context9) {\n        while (1) switch (_context9.p = _context9.n) {\n          case 0:\n            setIsSyncLoading(true);\n            _context9.p = 1;\n            _context9.n = 2;\n            return axios__WEBPACK_IMPORTED_MODULE_38__[\"default\"].post('/settings', {\n              auto_sync: newValue\n            });\n          case 2:\n            response = _context9.v;\n            if ((_response$data6 = response.data) !== null && _response$data6 !== void 0 && _response$data6.success) {\n              setAutoSync(newValue);\n              react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].success(\"Auto-sync \".concat(newValue ? 'enabled' : 'disabled'));\n            }\n            _context9.n = 4;\n            break;\n          case 3:\n            _context9.p = 3;\n            _t9 = _context9.v;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_39__[\"default\"].error('Failed to update sync settings');\n          case 4:\n            _context9.p = 4;\n            setIsSyncLoading(false);\n            onAutoSyncConfirmClose();\n            return _context9.f(4);\n          case 5:\n            return _context9.a(2);\n        }\n      }, _callee9, null, [[1, 3, 4, 5]]);\n    }));\n    return function confirmToggleSync(_x6) {\n      return _ref9.apply(this, arguments);\n    };\n  }();\n  var filteredStores = stores.filter(function (store) {\n    var _store$name, _store$url;\n    return (store === null || store === void 0 || (_store$name = store.name) === null || _store$name === void 0 ? void 0 : _store$name.toLowerCase().includes(searchQuery.toLowerCase())) || (store === null || store === void 0 || (_store$url = store.url) === null || _store$url === void 0 ? void 0 : _store$url.toLowerCase().includes(searchQuery.toLowerCase()));\n  });\n  if (loading) return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    animation: \"fadeIn 0.5s ease-out\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Flex, {\n    justify: \"space-between\",\n    align: \"center\",\n    mb: 10\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Skeleton, {\n    height: \"30px\",\n    width: \"250px\",\n    mb: 2\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Skeleton, {\n    height: \"20px\",\n    width: \"400px\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Skeleton, {\n    height: \"48px\",\n    width: \"150px\",\n    borderRadius: \"xl\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    bg: \"white\",\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\",\n    overflow: \"hidden\",\n    p: 5\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Flex, {\n    justify: \"space-between\",\n    align: \"center\",\n    mb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Skeleton, {\n    height: \"24px\",\n    width: \"150px\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Skeleton, {\n    height: \"32px\",\n    width: \"300px\",\n    borderRadius: \"xl\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.VStack, {\n    spacing: 4,\n    align: \"stretch\"\n  }, [1, 2, 3, 4, 5].map(function (i) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Flex, {\n      key: i,\n      justify: \"space-between\",\n      align: \"center\",\n      py: 4,\n      borderBottom: \"1px\",\n      borderColor: \"gray.50\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.HStack, {\n      spacing: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Skeleton, {\n      height: \"32px\",\n      width: \"32px\",\n      borderRadius: \"lg\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.VStack, {\n      align: \"start\",\n      spacing: 1\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Skeleton, {\n      height: \"20px\",\n      width: \"200px\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Skeleton, {\n      height: \"16px\",\n      width: \"150px\"\n    }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Skeleton, {\n      height: \"24px\",\n      width: \"80px\",\n      borderRadius: \"full\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Skeleton, {\n      height: \"32px\",\n      width: \"80px\",\n      borderRadius: \"lg\"\n    }));\n  }))));\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    animation: \"fadeIn 0.5s ease-out\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Flex, {\n    direction: {\n      base: \"column\",\n      md: \"row\"\n    },\n    justify: \"space-between\",\n    align: {\n      base: \"start\",\n      md: \"center\"\n    },\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Heading, {\n    m: 0,\n    size: \"lg\",\n    fontWeight: \"800\",\n    letterSpacing: \"-0.5px\"\n  }, \"Connected Stores\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Text, {\n    mt: 0,\n    color: \"gray.500\",\n    fontWeight: \"500\"\n  }, \"Manage all your connected WooCommerce stores.\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.HStack, {\n    spacing: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Tooltip, {\n    label: \"Re-register webhooks for all stores\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.IconButton, {\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_35__.FiRefreshCw, null),\n    size: \"sm\",\n    variant: \"outline\",\n    colorScheme: \"blue\",\n    borderRadius: \"xl\",\n    \"aria-label\": \"Re-sync Webhooks\",\n    isLoading: isRerendering,\n    onClick: handleRerenderWebhooks\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    leftIcon: canAddStore ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_35__.FiPlus, null) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_35__.FiLock, null),\n    colorScheme: canAddStore ? \"blue\" : \"orange\",\n    onClick: canAddStore ? onOpen : onProModalOpen,\n    borderRadius: \"xl\",\n    px: 6,\n    shadow: \"md\",\n    _hover: {\n      shadow: \"lg\",\n      transform: \"translateY(-2px)\"\n    },\n    w: {\n      base: \"full\",\n      md: \"auto\"\n    }\n  }, canAddStore ? 'Add Store' : 'Upgrade to Add Store'))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    bg: \"white\",\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\",\n    overflow: \"hidden\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    p: 5,\n    borderBottom: \"1px\",\n    borderColor: \"gray.50\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Flex, {\n    justify: \"space-between\",\n    align: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Heading, {\n    m: 0,\n    size: \"md\",\n    fontWeight: \"800\"\n  }, \"All Stores\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.InputGroup, {\n    maxW: \"300px\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.InputLeftElement, {\n    pointerEvents: \"none\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_35__.FiSearch, {\n    color: \"gray.400\"\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Input, {\n    placeholder: \"Search stores...\",\n    value: searchQuery,\n    onChange: function onChange(e) {\n      return setSearchQuery(e.target.value);\n    },\n    borderRadius: \"xl\",\n    size: \"sm\"\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.TableContainer, {\n    overflowX: \"auto\",\n    w: \"100%\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Table, {\n    variant: \"simple\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Thead, {\n    bg: \"gray.50\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Th, {\n    color: \"gray.500\",\n    fontWeight: \"800\"\n  }, \"Store\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Th, {\n    color: \"gray.500\",\n    fontWeight: \"800\"\n  }, \"URL\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Th, {\n    color: \"gray.500\",\n    fontWeight: \"800\",\n    textAlign: \"center\"\n  }, \"Order Import\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Th, {\n    color: \"gray.500\",\n    fontWeight: \"800\",\n    textAlign: \"center\"\n  }, \"Customer Sync\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Th, {\n    color: \"gray.500\",\n    fontWeight: \"800\"\n  }, \"Status\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Th, {\n    color: \"gray.500\",\n    fontWeight: \"800\",\n    textAlign: \"right\"\n  }, \"Actions\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Tbody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(framer_motion__WEBPACK_IMPORTED_MODULE_37__.AnimatePresence, {\n    mode: \"popLayout\"\n  }, filteredStores.map(function (store) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Tr, {\n      key: store.id,\n      as: framer_motion__WEBPACK_IMPORTED_MODULE_36__.motion.tr,\n      layout: true,\n      initial: {\n        opacity: 0\n      },\n      animate: {\n        opacity: 1\n      },\n      exit: {\n        opacity: 0\n      },\n      _hover: {\n        bg: \"gray.50\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.HStack, {\n      spacing: 3\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n      w: 8,\n      h: 8,\n      borderRadius: \"lg\",\n      bg: store.is_current == 1 ? \"blue.500\" : \"gray.100\",\n      color: store.is_current == 1 ? \"white\" : \"gray.600\",\n      display: \"flex\",\n      alignItems: \"center\",\n      justifyContent: \"center\",\n      fontWeight: \"bold\",\n      fontSize: \"xs\"\n    }, store.name.charAt(0).toUpperCase()), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Text, {\n      mt: 0,\n      fontWeight: \"700\",\n      color: \"gray.800\",\n      mb: 0\n    }, store.name))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Text, {\n      mt: 0,\n      fontSize: \"sm\",\n      color: \"gray.500\",\n      mb: 0\n    }, store.url)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Td, {\n      textAlign: \"center\"\n    }, store.is_current == 1 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Tooltip, {\n      label: \"No import for the local hub site\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Text, {\n      fontSize: \"xs\",\n      color: \"gray.400\"\n    }, \"\\u2014\")) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Tooltip, {\n      label: orderImportStates[store.id] ? 'Orders are imported from this store' : 'Order import disabled for this store'\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Flex, {\n      justify: \"center\",\n      align: \"center\",\n      gap: 2\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Switch, {\n      colorScheme: \"green\",\n      size: \"sm\",\n      isChecked: !!orderImportStates[store.id],\n      isDisabled: orderImportLoading[store.id] || store.maintenance_mode == 1,\n      onChange: function onChange(e) {\n        e.stopPropagation();\n        handleToggleOrderImport(store, e.target.checked);\n      },\n      onClick: function onClick(e) {\n        return e.stopPropagation();\n      }\n    }), orderImportLoading[store.id] && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.Spinner, {\n      size: \"xs\"\n    })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Td, {\n      textAlign: \"center\"\n    }, store.is_current == 1 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Tooltip, {\n      label: \"No customer sync for the local hub site\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Text, {\n      fontSize: \"xs\",\n      color: \"gray.400\"\n    }, \"\\u2014\")) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Tooltip, {\n      label: customerSyncStates[store.id] ? 'Customers are synced from this store' : 'Customer sync disabled for this store'\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Flex, {\n      justify: \"center\",\n      align: \"center\",\n      gap: 2\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Switch, {\n      colorScheme: \"purple\",\n      size: \"sm\",\n      isChecked: !!customerSyncStates[store.id],\n      isDisabled: customerSyncLoading[store.id] || store.maintenance_mode == 1,\n      onChange: function onChange(e) {\n        e.stopPropagation();\n        handleToggleCustomerSync(store, e.target.checked);\n      },\n      onClick: function onClick(e) {\n        return e.stopPropagation();\n      }\n    }), customerSyncLoading[store.id] && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.Spinner, {\n      size: \"xs\"\n    })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Td, null, store.is_current == 1 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n      colorScheme: \"blue\",\n      borderRadius: \"full\",\n      px: 3\n    }, \"Active\") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n      colorScheme: \"gray\",\n      borderRadius: \"full\",\n      px: 3\n    }, \"Connected\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Td, {\n      textAlign: \"right\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.HStack, {\n      justify: \"flex-end\",\n      spacing: 2\n    }, loadingStoreId === store.id ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Skeleton, {\n      height: \"32px\",\n      width: \"70px\",\n      borderRadius: \"lg\"\n    }) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, store.is_current == 1 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n      size: \"sm\",\n      colorScheme: \"gray\",\n      variant: \"outline\",\n      borderRadius: \"lg\",\n      isDisabled: true,\n      _disabled: {\n        opacity: 0.8,\n        cursor: \"not-allowed\",\n        bg: \"gray.50\"\n      }\n    }, \"Current\") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n      size: \"sm\",\n      colorScheme: \"blue\",\n      variant: \"solid\",\n      borderRadius: \"lg\",\n      onClick: function onClick(e) {\n        e.stopPropagation();\n        handleStoreSelect(store);\n      }\n    }, \"Switch\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Tooltip, {\n      label: store.is_current == 1 ? \"Cannot remove current store\" : \"Remove store\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.IconButton, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_35__.FiTrash2, null),\n      size: \"sm\",\n      variant: \"ghost\",\n      colorScheme: \"red\",\n      borderRadius: \"lg\",\n      isDisabled: store.is_current == 1,\n      onClick: function onClick(e) {\n        e.stopPropagation();\n        handleDeleteClick(store);\n      }\n    }))))));\n  }))))), filteredStores.length === 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Flex, {\n    direction: \"column\",\n    align: \"center\",\n    justify: \"center\",\n    p: 20\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_35__.FiSearch,\n    w: 10,\n    h: 10,\n    color: \"gray.200\",\n    mb: 4\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Text, {\n    mt: 0,\n    color: \"gray.400\",\n    fontWeight: \"600\"\n  }, \"No stores found matching your search.\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    mt: 10,\n    p: 6,\n    bg: \"white\",\n    borderRadius: \"2xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    shadow: \"sm\",\n    position: \"relative\",\n    overflow: \"hidden\"\n  }, !isPro && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    position: \"absolute\",\n    top: 0,\n    left: 0,\n    right: 0,\n    bottom: 0,\n    bg: \"whiteAlpha.700\",\n    backdropFilter: \"blur(2px)\",\n    zIndex: 10,\n    display: \"flex\",\n    alignItems: \"center\",\n    justifyContent: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.VStack, {\n    spacing: 4,\n    bg: \"white\",\n    p: 8,\n    borderRadius: \"2xl\",\n    shadow: \"xl\",\n    border: \"1px\",\n    borderColor: \"blue.100\",\n    textAlign: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_35__.FiArrowLeft,\n    boxSize: 8,\n    color: \"blue.500\",\n    transform: \"rotate(90deg)\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Heading, {\n    size: \"sm\",\n    mb: 2\n  }, \"Product & Inventory Auto Sync\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    color: \"gray.500\",\n    maxW: \"250px\"\n  }, \"Upgrade to ShopCentral Pro to enable automatic real-time product and inventory synchronization across all your store.\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    colorScheme: \"blue\",\n    size: \"sm\",\n    borderRadius: \"xl\",\n    onClick: function onClick() {\n      return window.open('https://dominopress.com/plugin/shopcentral', '_blank');\n    }\n  }, \"Upgrade to Pro\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Flex, {\n    direction: {\n      base: \"column\",\n      md: \"row\"\n    },\n    justify: \"space-between\",\n    align: {\n      base: \"start\",\n      md: \"center\"\n    },\n    gap: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    opacity: isPro ? 1 : 0.4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.HStack, {\n    spacing: 2,\n    mb: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Heading, {\n    m: 0,\n    size: \"md\",\n    fontWeight: \"800\"\n  }, \"Product & Inventory Sync\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n    colorScheme: \"blue\",\n    variant: \"subtle\",\n    borderRadius: \"full\",\n    px: 2\n  }, \"Network Auto-Sync\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Text, {\n    m: 0,\n    color: \"gray.500\",\n    fontWeight: \"500\",\n    maxW: \"lg\"\n  }, \"Automatically synchronize product details (price, description, images) and stock levels across all your connected stores whenever you update them in your main store.\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    bg: \"gray.50\",\n    p: 4,\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"gray.100\",\n    minW: \"200px\",\n    opacity: isPro ? 1 : 0.4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Flex, {\n    justify: \"space-between\",\n    align: \"center\",\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.VStack, {\n    align: \"start\",\n    spacing: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Text, {\n    m: 0,\n    fontWeight: \"700\",\n    fontSize: \"sm\"\n  }, \"Auto-Sync\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    color: autoSync ? \"green.500\" : \"gray.400\"\n  }, autoSync ? 'Enabled' : 'Disabled')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Switch, {\n    colorScheme: \"blue\",\n    size: \"lg\",\n    isChecked: autoSync,\n    onChange: handleToggleSync,\n    isDisabled: isSyncLoading || !isPro\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    mt: 6,\n    p: 4,\n    bg: \"blue.50\",\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"blue.100\",\n    opacity: isPro ? 1 : 0.4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.HStack, {\n    align: \"start\",\n    spacing: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_35__.FiExternalLink,\n    mt: 1,\n    color: \"blue.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.VStack, {\n    align: \"start\",\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Text, {\n    m: 0,\n    fontSize: \"sm\",\n    fontWeight: \"700\",\n    color: \"blue.700\"\n  }, \"How it works:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    color: \"blue.600\"\n  }, \"1. \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"b\", null, \"Matching:\"), \" Stores are matched via \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"b\", null, \"SKU\"), \". Ensure identical products have the same SKU across all sites.\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"br\", null), \"2. \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"b\", null, \"Real-time:\"), \" When a product is sold or updated on \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"b\", null, \"this\"), \" site, secondary sites are updated instantly via REST API.\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"br\", null), \"3. \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"b\", null, \"Centralized:\"), \" This site acts as the \\\"Central Hub\\\" for all outgoing sync requests.\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Modal, {\n    isOpen: isOpen,\n    onClose: onClose,\n    size: \"lg\",\n    motionPreset: \"slideInBottom\",\n    isCentered: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.ModalOverlay, {\n    bg: \"blackAlpha.300\",\n    backdropFilter: \"blur(5px)\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.ModalContent, {\n    borderRadius: \"2xl\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.ModalHeader, {\n    fontSize: \"2xl\",\n    fontWeight: \"800\"\n  }, \"Add Another Store\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.ModalCloseButton, {\n    top: 4,\n    right: 4\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.ModalBody, {\n    pb: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.VStack, {\n    spacing: 5\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.FormControl, {\n    isRequired: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n    fontWeight: \"700\"\n  }, \"Store Name\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Input, {\n    placeholder: \"e.g. My Premium Boutique\",\n    value: newStore.name,\n    borderRadius: \"xl\",\n    onChange: function onChange(e) {\n      return setNewStore(_objectSpread(_objectSpread({}, newStore), {}, {\n        name: e.target.value\n      }));\n    }\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.FormControl, {\n    isRequired: true,\n    isInvalid: newStore.url && !newStore.url.startsWith('https://')\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n    fontWeight: \"700\"\n  }, \"Store URL\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Input, {\n    placeholder: \"https://mystore.com\",\n    value: newStore.url,\n    borderRadius: \"xl\",\n    onChange: function onChange(e) {\n      return setNewStore(_objectSpread(_objectSpread({}, newStore), {}, {\n        url: e.target.value\n      }));\n    }\n  }), newStore.url && !newStore.url.startsWith('https://') ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.FormErrorMessage, null, \"Store URL must start with https://\") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Text, {\n    fontSize: \"xs\",\n    color: \"red.500\",\n    mt: 2,\n    fontWeight: \"500\"\n  }, \"Must include https:// & without slash (/)\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.HStack, {\n    w: \"full\",\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.FormControl, {\n    isRequired: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n    fontWeight: \"700\"\n  }, \"Consumer Key\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Input, {\n    placeholder: \"ck_...\",\n    value: newStore.consumer_key,\n    borderRadius: \"xl\",\n    onChange: function onChange(e) {\n      return setNewStore(_objectSpread(_objectSpread({}, newStore), {}, {\n        consumer_key: e.target.value\n      }));\n    }\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.FormControl, {\n    isRequired: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.FormLabel, {\n    fontWeight: \"700\"\n  }, \"Consumer Secret\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Input, {\n    type: \"password\",\n    placeholder: \"cs_...\",\n    value: newStore.consumer_secret,\n    borderRadius: \"xl\",\n    onChange: function onChange(e) {\n      return setNewStore(_objectSpread(_objectSpread({}, newStore), {}, {\n        consumer_secret: e.target.value\n      }));\n    }\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    w: \"full\",\n    p: 4,\n    bg: \"blue.50\",\n    borderRadius: \"xl\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Text, {\n    my: 0,\n    fontSize: \"xs\",\n    color: \"blue.600\",\n    fontWeight: \"600\"\n  }, 'Tip: Go to the site you want to connect and generate these keys in WooCommerce > Settings > Advanced > REST API. Ensure they have Read/Write permissions.')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    w: \"full\",\n    colorScheme: \"blue\",\n    size: \"lg\",\n    borderRadius: \"xl\",\n    onClick: handleAddStore,\n    isLoading: isSaving,\n    shadow: \"lg\",\n    isDisabled: !newStore.name || !newStore.url.startsWith('https://') || !newStore.consumer_key || !newStore.consumer_secret\n  }, \"Connect Store\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_40__[\"default\"], {\n    isOpen: isConfirmOpen,\n    onClose: onConfirmClose,\n    onConfirm: handleConfirmDelete,\n    title: \"Remove Store\",\n    description: \"Are you sure you want to remove \".concat(storeToDelete === null || storeToDelete === void 0 ? void 0 : storeToDelete.name, \"? This cannot be undone.\"),\n    confirmLabel: \"Remove\",\n    loading: isDeleting\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_AutoSyncConfirmDialog__WEBPACK_IMPORTED_MODULE_41__[\"default\"], {\n    isOpen: isAutoSyncConfirmOpen,\n    onClose: onAutoSyncConfirmClose,\n    onConfirm: function onConfirm() {\n      return confirmToggleSync(true);\n    },\n    loading: isSyncLoading\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ProFeatureModal__WEBPACK_IMPORTED_MODULE_42__[\"default\"], {\n    isOpen: isProModalOpen,\n    onClose: onProModalClose,\n    title: \"Unlimited Store Connections (Pro)\",\n    what: \"An enterprise connection tier that removes store limits and enables real-time synchronization across an unlimited number of WooCommerce websites.\",\n    how: \"Connects remote WooCommerce stores via encrypted REST API keys to securely share product catalogs, orders, stock levels, and store analytics.\",\n    why: \"Scale your multi-store retail brand without constraints while retaining central visibility and administration from one unified master hub.\"\n  }));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Stores);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Stores/Stores.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Tools/ExportTools.jsx"
/*!******************************************************!*\
  !*** ./src/Pages/StoreManager/Tools/ExportTools.jsx ***!
  \******************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

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 */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/hooks/dist/esm/use-disclosure.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/box/box.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/button/button.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/card/card-body.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/grid/simple-grid.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/select/select.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/h-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/stack/v-stack.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/toast/use-toast.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/heading.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var _Components_shared_ProFeatureModal__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../Components/shared/ProFeatureModal */ \"./src/Components/shared/ProFeatureModal.jsx\");\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\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\n\nvar ExportTools = function ExportTools() {\n  var _window$shopCentralDa;\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)('all'),\n    _useState2 = _slicedToArray(_useState, 2),\n    period = _useState2[0],\n    setPeriod = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState4 = _slicedToArray(_useState3, 2),\n    isExporting = _useState4[0],\n    setIsExporting = _useState4[1];\n  var toast = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.useToast)();\n  var _useDisclosure = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.useDisclosure)(),\n    isProModalOpen = _useDisclosure.isOpen,\n    onProModalOpen = _useDisclosure.onOpen,\n    onProModalClose = _useDisclosure.onClose;\n  var isPro = (_window$shopCentralDa = window.shopCentralData) === null || _window$shopCentralDa === void 0 ? void 0 : _window$shopCentralDa.isPro;\n  var downloadCSV = function downloadCSV(data, filename) {\n    if (!data || data.length === 0) {\n      toast({\n        title: \"No data available to export\",\n        status: \"warning\"\n      });\n      return;\n    }\n    var headers = Object.keys(data[0]);\n    var csvRows = [headers.join(',')];\n    data.forEach(function (row) {\n      var values = headers.map(function (header) {\n        var val = row[header] === null || row[header] === undefined ? '' : String(row[header]);\n        var escape = val.replace(/\"/g, '\"\"');\n        return \"\\\"\".concat(escape, \"\\\"\");\n      });\n      csvRows.push(values.join(','));\n    });\n    var blob = new Blob([csvRows.join('\\n')], {\n      type: 'text/csv;charset=utf-8;'\n    });\n    var url = window.URL.createObjectURL(blob);\n    var a = document.createElement('a');\n    a.href = url;\n    a.download = filename;\n    a.click();\n    window.URL.revokeObjectURL(url);\n  };\n  var handleExportCSV = /*#__PURE__*/function () {\n    var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(type) {\n      var _yield$axios$get, data, _t;\n      return _regenerator().w(function (_context) {\n        while (1) switch (_context.p = _context.n) {\n          case 0:\n            setIsExporting(type);\n            _context.p = 1;\n            _context.n = 2;\n            return axios__WEBPACK_IMPORTED_MODULE_17__[\"default\"].get(\"/api/store-manager/export?type=\".concat(type, \"&period=\").concat(period));\n          case 2:\n            _yield$axios$get = _context.v;\n            data = _yield$axios$get.data;\n            if (data !== null && data !== void 0 && data.data) {\n              downloadCSV(data.data, \"ShopCentral_\".concat(type, \"_Export_\").concat(new Date().toISOString().split('T')[0], \".csv\"));\n              toast({\n                title: \"\".concat(getExportLabel(type), \" exported successfully.\"),\n                status: \"success\"\n              });\n            }\n            _context.n = 4;\n            break;\n          case 3:\n            _context.p = 3;\n            _t = _context.v;\n            console.error(_t);\n            toast({\n              title: \"Failed to export \".concat(getExportLabel(type)),\n              status: \"error\"\n            });\n          case 4:\n            _context.p = 4;\n            setIsExporting(null);\n            return _context.f(4);\n          case 5:\n            return _context.a(2);\n        }\n      }, _callee, null, [[1, 3, 4, 5]]);\n    }));\n    return function handleExportCSV(_x) {\n      return _ref.apply(this, arguments);\n    };\n  }();\n  var getExportLabel = function getExportLabel(type) {\n    var labels = {\n      products: 'Products',\n      orders: 'Orders',\n      reviews: 'Reviews',\n      categories: 'Categories',\n      tags: 'Tags',\n      customers: 'Customers',\n      coupons: 'Coupons'\n    };\n    return labels[type] || type;\n  };\n  var handleGeneratePDF = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {\n      var _yield$axios$get2, data, report, printWindow, htmlContent, _t2;\n      return _regenerator().w(function (_context2) {\n        while (1) switch (_context2.p = _context2.n) {\n          case 0:\n            setIsExporting('pdf');\n            _context2.p = 1;\n            _context2.n = 2;\n            return axios__WEBPACK_IMPORTED_MODULE_17__[\"default\"].get(\"/api/store-manager/export?type=report&period=\".concat(period));\n          case 2:\n            _yield$axios$get2 = _context2.v;\n            data = _yield$axios$get2.data;\n            report = data === null || data === void 0 ? void 0 : data.data;\n            if (report) {\n              printWindow = window.open('', '_blank');\n              htmlContent = \"\\n                    <html>\\n                    <head>\\n                        <title>ShopCentral Performance PDF</title>\\n                        <style>\\n                            body { font-family: 'Inter', -apple-system, sans-serif; color: #1a202c; padding: 40px; }\\n                            h1 { border-bottom: 2px solid #e2e8f0; padding-bottom: 10px; margin-bottom: 30px; }\\n                            .summary { display: flex; gap: 40px; margin-bottom: 40px; background: #f7fafc; padding: 20px; border-radius: 8px; }\\n                            .stat-box h3 { font-size: 14px; text-transform: uppercase; color: #718096; margin: 0 0 5px 0; }\\n                            .stat-box p { font-size: 24px; font-weight: bold; margin: 0; }\\n                            table { width: 100%; border-collapse: collapse; margin-top: 20px; }\\n                            th, td { padding: 12px 15px; border-bottom: 1px solid #e2e8f0; text-align: left; }\\n                            th { background-color: #f7fafc; color: #4a5568; font-weight: bold; text-transform: uppercase; font-size: 12px; }\\n                            tr:last-child td { border-bottom: none; }\\n                            .footer { margin-top: 50px; text-align: center; color: #a0aec0; font-size: 12px; }\\n                        </style>\\n                    </head>\\n                    <body>\\n                        <h1>Stores Performance Report</h1>\\n\\n                        <div class=\\\"summary\\\">\\n                            <div class=\\\"stat-box\\\">\\n                                <h3>Period</h3>\\n                                <p>\".concat(report.period.toUpperCase(), \"</p>\\n                            </div>\\n                            <div class=\\\"stat-box\\\">\\n                                <h3>Total Stores Revenue</h3>\\n                                <p>\").concat(report.network_currency_symbol).concat(parseFloat(report.network_total_revenue).toLocaleString(undefined, {\n                minimumFractionDigits: 2\n              }), \"</p>\\n                            </div>\\n                            <div class=\\\"stat-box\\\">\\n                                <h3>Total Stores Orders</h3>\\n                                <p>\").concat(report.network_total_orders, \"</p>\\n                            </div>\\n                        </div>\\n\\n                        <h2>Store Breakdown</h2>\\n                        <table>\\n                            <thead>\\n                                <tr>\\n                                    <th>Store Name</th>\\n                                    <th>Total Revenue</th>\\n                                    <th>Total Orders</th>\\n                                    <th>Avg Order Value (AOV)</th>\\n                                </tr>\\n                            </thead>\\n                            <tbody>\\n                                \").concat(report.store_breakdown.map(function (store) {\n                return \"\\n                                    <tr>\\n                                        <td><strong>\".concat(store.store_name, \"</strong><br><span style=\\\"color:#718096; font-size:12px\\\">\").concat(store.url, \"</span></td>\\n                                        <td>\").concat(store.currency_symbol).concat(parseFloat(store.revenue).toLocaleString(undefined, {\n                  minimumFractionDigits: 2\n                }), \"</td>\\n                                        <td>\").concat(store.orders, \"</td>\\n                                        <td>\").concat(store.currency_symbol).concat(parseFloat(store.aov).toLocaleString(undefined, {\n                  minimumFractionDigits: 2\n                }), \"</td>\\n                                    </tr>\\n                                \");\n              }).join(''), \"\\n                            </tbody>\\n                        </table>\\n\\n                        <div class=\\\"footer\\\">\\n                            Generated by ShopCentral Plugin on \").concat(new Date(report.generated_at).toLocaleString(), \"\\n                        </div>\\n                    </body>\\n                    </html>\\n                \");\n              printWindow.document.write(htmlContent);\n              printWindow.document.close();\n              printWindow.focus();\n              setTimeout(function () {\n                printWindow.print();\n                toast({\n                  title: \"PDF Report ready.\",\n                  status: \"success\"\n                });\n              }, 500);\n            }\n            _context2.n = 4;\n            break;\n          case 3:\n            _context2.p = 3;\n            _t2 = _context2.v;\n            console.error(_t2);\n            toast({\n              title: \"Failed to generate report\",\n              status: \"error\"\n            });\n          case 4:\n            _context2.p = 4;\n            setIsExporting(null);\n            return _context2.f(4);\n          case 5:\n            return _context2.a(2);\n        }\n      }, _callee2, null, [[1, 3, 4, 5]]);\n    }));\n    return function handleGeneratePDF() {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  var exportItems = [{\n    type: 'products',\n    title: 'Product Export',\n    description: 'Backups up every single product ID, price, stock quantity, and remote origin into a unified CSV file.',\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_16__.FiPackage,\n    colorScheme: 'blue',\n    badge: 'All Stores'\n  }, {\n    type: 'orders',\n    title: 'Order Export',\n    description: 'Aggregates multi-store financial transaction data based on your selected date period.',\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_16__.FiShoppingCart,\n    colorScheme: 'green',\n    badge: period === 'all' ? 'All Time' : period === 'month' ? 'This Month' : 'This Year'\n  }, {\n    type: 'reviews',\n    title: 'Product Reviews Export',\n    description: 'Export all product reviews including rating, reviewer name, email, and review content.',\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_16__.FiStar,\n    colorScheme: 'yellow',\n    badge: 'All Stores'\n  }, {\n    type: 'categories',\n    title: 'Product Categories Export',\n    description: 'Export all product categories with name, slug, description, and parent category.',\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_16__.FiGrid,\n    colorScheme: 'cyan',\n    badge: 'All Stores'\n  }, {\n    type: 'tags',\n    title: 'Product Tags Export',\n    description: 'Export all product tags with name, slug, and description.',\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_16__.FiTag,\n    colorScheme: 'teal',\n    badge: 'All Stores'\n  }, {\n    type: 'customers',\n    title: 'Customers Export',\n    description: 'Export all customers with name, email, orders count, and total spend.',\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_16__.FiUsers,\n    colorScheme: 'purple',\n    badge: 'All Stores'\n  }, {\n    type: 'coupons',\n    title: 'Coupons Export',\n    description: 'Export all coupons with code, discount type, amount, and usage count.',\n    icon: react_icons_fi__WEBPACK_IMPORTED_MODULE_16__.FiPercent,\n    colorScheme: 'orange',\n    badge: 'All Stores'\n  }];\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    animation: \"fadeIn 0.5s ease-out\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Flex, {\n    direction: {\n      base: \"column\",\n      md: \"row\"\n    },\n    justify: \"space-between\",\n    align: {\n      base: \"start\",\n      md: \"center\"\n    },\n    mb: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.VStack, {\n    align: \"start\",\n    spacing: 1\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Heading, {\n    mb: 0,\n    size: \"lg\"\n  }, \"Backup & Data Exports\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Text, {\n    color: \"gray.500\"\n  }, \"Extract raw system data and PDF reports for accounting.\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.HStack, {\n    mt: {\n      base: 4,\n      md: 0\n    },\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Text, {\n    fontWeight: \"bold\",\n    color: \"gray.600\"\n  }, \"Period:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Select, {\n    bg: \"white\",\n    w: \"150px\",\n    value: period,\n    onChange: function onChange(e) {\n      return setPeriod(e.target.value);\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"month\"\n  }, \"This Month\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"year\"\n  }, \"This Year\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"all\"\n  }, \"All Time\")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.SimpleGrid, {\n    columns: {\n      base: 1,\n      md: 2,\n      lg: 4\n    },\n    spacing: 6\n  }, exportItems.map(function (item) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Card, {\n      key: item.type,\n      variant: \"outline\",\n      borderRadius: \"xl\",\n      _hover: {\n        shadow: 'md',\n        borderColor: \"\".concat(item.colorScheme, \".300\")\n      },\n      transition: \"all 0.2s\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.CardBody, {\n      display: \"flex\",\n      flexDirection: \"column\",\n      alignItems: \"center\",\n      textAlign: \"center\",\n      py: 8\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n      p: 4,\n      bg: \"\".concat(item.colorScheme, \".50\"),\n      color: \"\".concat(item.colorScheme, \".500\"),\n      borderRadius: \"full\",\n      mb: 4\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n      as: item.icon,\n      w: 8,\n      h: 8\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Heading, {\n      size: \"md\",\n      mb: 2\n    }, item.title), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Text, {\n      color: \"gray.500\",\n      fontSize: \"sm\",\n      mb: 4\n    }, item.description), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n      colorScheme: item.colorScheme,\n      mb: 4,\n      px: 2,\n      borderRadius: \"full\"\n    }, item.badge), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n      w: \"full\",\n      colorScheme: isPro ? item.colorScheme : \"orange\",\n      leftIcon: isPro ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_16__.FiDownload, null) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_16__.FiLock, null),\n      isLoading: isExporting === item.type,\n      loadingText: \"Extracting...\",\n      onClick: function onClick() {\n        return isPro ? handleExportCSV(item.type) : onProModalOpen();\n      }\n    }, isPro ? \"Export \".concat(getExportLabel(item.type), \" (.csv)\") : 'Upgrade to Export')));\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Card, {\n    variant: \"outline\",\n    borderRadius: \"xl\",\n    _hover: {\n      shadow: 'md',\n      borderColor: 'purple.300'\n    },\n    transition: \"all 0.2s\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.CardBody, {\n    display: \"flex\",\n    flexDirection: \"column\",\n    alignItems: \"center\",\n    textAlign: \"center\",\n    py: 8\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    p: 4,\n    bg: \"purple.50\",\n    color: \"purple.500\",\n    borderRadius: \"full\",\n    mb: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_16__.FiFileText,\n    w: 8,\n    h: 8\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Heading, {\n    size: \"md\",\n    mb: 2\n  }, \"Centralized Report\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Text, {\n    color: \"gray.500\",\n    fontSize: \"sm\",\n    mb: 4\n  }, \"Generates an invoice-style clean PDF summarizing cross-border revenue and gross volume metrics.\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n    colorScheme: \"purple\",\n    mb: 4,\n    px: 2,\n    borderRadius: \"full\"\n  }, \"PDF Document\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    w: \"full\",\n    colorScheme: \"purple\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_16__.FiFileText, null),\n    isLoading: isExporting === 'pdf',\n    loadingText: \"Generating...\",\n    onClick: handleGeneratePDF\n  }, \"Generate Report (.pdf)\")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ProFeatureModal__WEBPACK_IMPORTED_MODULE_18__[\"default\"], {\n    isOpen: isProModalOpen,\n    onClose: onProModalClose,\n    title: \"Network-Wide Data Export (Pro)\",\n    what: \"A consolidated reporting and data extraction tool that compiles multi-store WooCommerce data into standard CSV and Excel formats.\",\n    how: \"Extracts unified order histories, product catalogs, customer rosters, and stock inventories across all your connected websites into clean downloadable spreadsheets.\",\n    why: \"Essential for accounting reconciliations, tax preparation, inventory auditing, ERP integration, and cross-store financial performance analysis.\"\n  }));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ExportTools);\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Tools/ExportTools.jsx?\n}");

/***/ },

/***/ "./src/utils/FormatDate.js"
/*!*********************************!*\
  !*** ./src/utils/FormatDate.js ***!
  \*********************************/
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   FormatDate: () => (/* binding */ FormatDate)\n/* harmony export */ });\nvar FormatDate = function FormatDate(dateInput) {\n  if (!dateInput) return 'N/A';\n  var date = new Date(dateInput);\n  var options = {\n    day: \"numeric\",\n    month: \"long\",\n    year: \"numeric\"\n  };\n  return date.toLocaleDateString('en-GB', options);\n};\n\n//# sourceURL=webpack://shopcentral/./src/utils/FormatDate.js?\n}");

/***/ },

/***/ "./src/utils/exportUtils.js"
/*!**********************************!*\
  !*** ./src/utils/exportUtils.js ***!
  \**********************************/
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   exportToCSV: () => (/* binding */ exportToCSV)\n/* harmony export */ });\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 _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 _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 _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; }\nvar exportToCSV = function exportToCSV(data) {\n  var filename = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'export.csv';\n  if (!data || !data.length) {\n    return;\n  }\n\n  // Get headers from the first object\n  var headers = Object.keys(data[0]);\n\n  // Create CSV content\n  var csvContent = [headers.join(',')].concat(_toConsumableArray(data.map(function (row) {\n    return headers.map(function (header) {\n      var cell = row[header] === null || row[header] === undefined ? '' : row[header];\n      // Handle strings with commas or quotes\n      if (typeof cell === 'string') {\n        cell = \"\\\"\".concat(cell.replace(/\"/g, '\"\"'), \"\\\"\");\n      }\n      // Handle objects/arrays roughly\n      if (_typeof(cell) === 'object') {\n        cell = \"\\\"\".concat(JSON.stringify(cell).replace(/\"/g, '\"\"'), \"\\\"\");\n      }\n      return cell;\n    }).join(',');\n  }))).join('\\n');\n\n  // Create blob and download link\n  var blob = new Blob([csvContent], {\n    type: 'text/csv;charset=utf-8;'\n  });\n  var link = document.createElement('a');\n  if (link.download !== undefined) {\n    var url = URL.createObjectURL(blob);\n    link.setAttribute('href', url);\n    link.setAttribute('download', filename);\n    link.style.visibility = 'hidden';\n    document.body.appendChild(link);\n    link.click();\n    document.body.removeChild(link);\n  }\n};\n\n//# sourceURL=webpack://shopcentral/./src/utils/exportUtils.js?\n}");

/***/ },

/***/ "data:image/svg+xml;utf8,<svg width=%279px%27 height=%276px%27 viewBox=%270 0 9 6%27 version=%271.1%27 xmlns=%27http://www.w3.org/2000/svg%27 xmlns:xlink=%27http://www.w3.org/1999/xlink%27><g id=%27Artboard%27 stroke=%27none%27 stroke-width=%271%27 fill=%27none%27 fill-rule=%27evenodd%27 transform=%27translate%28-636.000000, -171.000000%29%27 fill-opacity=%270.368716033%27><g id=%27input%27 transform=%27translate%28172.000000, 37.000000%29%27 fill=%27%230E242F%27 fill-rule=%27nonzero%27><g id=%27Group-9%27 transform=%27translate%28323.000000, 127.000000%29%27><path d=%27M142.280245,7.23952813 C141.987305,6.92353472 141.512432,6.92361662 141.219585,7.23971106 C140.926739,7.5558055 140.926815,8.06821394 141.219755,8.38420735 L145.498801,13 L149.780245,8.38162071 C150.073185,8.0656273 150.073261,7.55321886 149.780415,7.23712442 C149.487568,6.92102998 149.012695,6.92094808 148.719755,7.23694149 L145.498801,10.7113732 L142.280245,7.23952813 Z%27 id=%27arrow%27></path></g></g></g></svg>"
/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** data:image/svg+xml;utf8,<svg width=%279px%27 height=%276px%27 viewBox=%270 0 9 6%27 version=%271.1%27 xmlns=%27http://www.w3.org/2000/svg%27 xmlns:xlink=%27http://www.w3.org/1999/xlink%27><g id=%27Artboard%27 stroke=%27none%27 stroke-width=%271%27 fill=%27none%27 fill-rule=%27evenodd%27 transform=%27translate%28-636.000000, -171.000000%29%27 fill-opacity=%270.368716033%27><g id=%27input%27 transform=%27translate%28172.000000, 37.000000%29%27 fill=%27%230E242F%27 fill-rule=%27nonzero%27><g id=%27Group-9%27 transform=%27translate%28323.000000, 127.000000%29%27><path d=%27M142.280245,7.23952813 C141.987305,6.92353472 141.512432,6.92361662 141.219585,7.23971106 C140.926739,7.5558055 140.926815,8.06821394 141.219755,8.38420735 L145.498801,13 L149.780245,8.38162071 C150.073185,8.0656273 150.073261,7.55321886 149.780415,7.23712442 C149.487568,6.92102998 149.012695,6.92094808 148.719755,7.23694149 L145.498801,10.7113732 L142.280245,7.23952813 Z%27 id=%27arrow%27></path></g></g></g></svg> ***!
  \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
(module) {

eval("{module.exports = \"data:image/svg+xml;utf8,<svg width=%279px%27 height=%276px%27 viewBox=%270 0 9 6%27 version=%271.1%27 xmlns=%27http://www.w3.org/2000/svg%27 xmlns:xlink=%27http://www.w3.org/1999/xlink%27><g id=%27Artboard%27 stroke=%27none%27 stroke-width=%271%27 fill=%27none%27 fill-rule=%27evenodd%27 transform=%27translate%28-636.000000, -171.000000%29%27 fill-opacity=%270.368716033%27><g id=%27input%27 transform=%27translate%28172.000000, 37.000000%29%27 fill=%27%230E242F%27 fill-rule=%27nonzero%27><g id=%27Group-9%27 transform=%27translate%28323.000000, 127.000000%29%27><path d=%27M142.280245,7.23952813 C141.987305,6.92353472 141.512432,6.92361662 141.219585,7.23971106 C140.926739,7.5558055 140.926815,8.06821394 141.219755,8.38420735 L145.498801,13 L149.780245,8.38162071 C150.073185,8.0656273 150.073261,7.55321886 149.780415,7.23712442 C149.487568,6.92102998 149.012695,6.92094808 148.719755,7.23694149 L145.498801,10.7113732 L142.280245,7.23952813 Z%27 id=%27arrow%27></path></g></g></g></svg>\";\n\n//# sourceURL=webpack://shopcentral/data:image/svg+xml;utf8,%3Csvg_width=%25279px%2527_height=%25276px%2527_viewBox=%25270_0_9_6%2527_version=%25271.1%2527_xmlns=%2527http://www.w3.org/2000/svg%2527_xmlns:xlink=%2527http://www.w3.org/1999/xlink%2527%3E%3Cg_id=%2527Artboard%2527_stroke=%2527none%2527_stroke-width=%25271%2527_fill=%2527none%2527_fill-rule=%2527evenodd%2527_transform=%2527translate%2528-636.000000,_-171.000000%2529%2527_fill-opacity=%25270.368716033%2527%3E%3Cg_id=%2527input%2527_transform=%2527translate%2528172.000000,_37.000000%2529%2527_fill=%2527%25230E242F%2527_fill-rule=%2527nonzero%2527%3E%3Cg_id=%2527Group-9%2527_transform=%2527translate%2528323.000000,_127.000000%2529%2527%3E%3Cpath_d=%2527M142.280245,7.23952813_C141.987305,6.92353472_141.512432,6.92361662_141.219585,7.23971106_C140.926739,7.5558055_140.926815,8.06821394_141.219755,8.38420735_L145.498801,13_L149.780245,8.38162071_C150.073185,8.0656273_150.073261,7.55321886_149.780415,7.23712442_C149.487568,6.92102998_149.012695,6.92094808_148.719755,7.23694149_L145.498801,10.7113732_L142.280245,7.23952813_Z%2527_id=%2527arrow%2527%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E?\n}");

/***/ }

/******/ 	});
/************************************************************************/
/******/ 	// 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;
/******/ 		}
/******/ 		// Check if module exists (development only)
/******/ 		if (__webpack_modules__[moduleId] === undefined) {
/******/ 			var e = new Error("Cannot find module '" + moduleId + "'");
/******/ 			e.code = 'MODULE_NOT_FOUND';
/******/ 			throw e;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			id: moduleId,
/******/ 			loaded: false,
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = __webpack_modules__;
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/chunk loaded */
/******/ 	(() => {
/******/ 		var deferred = [];
/******/ 		__webpack_require__.O = (result, chunkIds, fn, priority) => {
/******/ 			if(chunkIds) {
/******/ 				priority = priority || 0;
/******/ 				for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
/******/ 				deferred[i] = [chunkIds, fn, priority];
/******/ 				return;
/******/ 			}
/******/ 			var notFulfilled = Infinity;
/******/ 			for (var i = 0; i < deferred.length; i++) {
/******/ 				var [chunkIds, fn, priority] = deferred[i];
/******/ 				var fulfilled = true;
/******/ 				for (var j = 0; j < chunkIds.length; j++) {
/******/ 					if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
/******/ 						chunkIds.splice(j--, 1);
/******/ 					} else {
/******/ 						fulfilled = false;
/******/ 						if(priority < notFulfilled) notFulfilled = priority;
/******/ 					}
/******/ 				}
/******/ 				if(fulfilled) {
/******/ 					deferred.splice(i--, 1)
/******/ 					var r = fn();
/******/ 					if (r !== undefined) result = r;
/******/ 				}
/******/ 			}
/******/ 			return result;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* 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/create fake namespace object */
/******/ 	(() => {
/******/ 		var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
/******/ 		var leafPrototypes;
/******/ 		// create a fake namespace object
/******/ 		// mode & 1: value is a module id, require it
/******/ 		// mode & 2: merge all properties of value into the ns
/******/ 		// mode & 4: return value when already ns object
/******/ 		// mode & 16: return value when it's Promise-like
/******/ 		// mode & 8|1: behave like require
/******/ 		__webpack_require__.t = function(value, mode) {
/******/ 			if(mode & 1) value = this(value);
/******/ 			if(mode & 8) return value;
/******/ 			if(typeof value === 'object' && value) {
/******/ 				if((mode & 4) && value.__esModule) return value;
/******/ 				if((mode & 16) && typeof value.then === 'function') return value;
/******/ 			}
/******/ 			var ns = Object.create(null);
/******/ 			__webpack_require__.r(ns);
/******/ 			var def = {};
/******/ 			leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
/******/ 			for(var current = mode & 2 && value; (typeof current == 'object' || typeof current == 'function') && !~leafPrototypes.indexOf(current); current = getProto(current)) {
/******/ 				Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
/******/ 			}
/******/ 			def['default'] = () => (value);
/******/ 			__webpack_require__.d(ns, def);
/******/ 			return ns;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* 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/global */
/******/ 	(() => {
/******/ 		__webpack_require__.g = (function() {
/******/ 			if (typeof globalThis === 'object') return globalThis;
/******/ 			try {
/******/ 				return this || new Function('return this')();
/******/ 			} catch (e) {
/******/ 				if (typeof window === 'object') return window;
/******/ 			}
/******/ 		})();
/******/ 	})();
/******/ 	
/******/ 	/* 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 });
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/node module decorator */
/******/ 	(() => {
/******/ 		__webpack_require__.nmd = (module) => {
/******/ 			module.paths = [];
/******/ 			if (!module.children) module.children = [];
/******/ 			return module;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/jsonp chunk loading */
/******/ 	(() => {
/******/ 		__webpack_require__.b = (typeof document !== 'undefined' && document.baseURI) || self.location.href;
/******/ 		
/******/ 		// object to store loaded and loading chunks
/******/ 		// undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ 		// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ 		var installedChunks = {
/******/ 			"admin": 0
/******/ 		};
/******/ 		
/******/ 		// no chunk on demand loading
/******/ 		
/******/ 		// no prefetching
/******/ 		
/******/ 		// no preloaded
/******/ 		
/******/ 		// no HMR
/******/ 		
/******/ 		// no HMR manifest
/******/ 		
/******/ 		__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
/******/ 		
/******/ 		// install a JSONP callback for chunk loading
/******/ 		var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
/******/ 			var [chunkIds, moreModules, runtime] = data;
/******/ 			// add "moreModules" to the modules object,
/******/ 			// then flag all "chunkIds" as loaded and fire callback
/******/ 			var moduleId, chunkId, i = 0;
/******/ 			if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
/******/ 				for(moduleId in moreModules) {
/******/ 					if(__webpack_require__.o(moreModules, moduleId)) {
/******/ 						__webpack_require__.m[moduleId] = moreModules[moduleId];
/******/ 					}
/******/ 				}
/******/ 				if(runtime) var result = runtime(__webpack_require__);
/******/ 			}
/******/ 			if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
/******/ 			for(;i < chunkIds.length; i++) {
/******/ 				chunkId = chunkIds[i];
/******/ 				if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ 					installedChunks[chunkId][0]();
/******/ 				}
/******/ 				installedChunks[chunkId] = 0;
/******/ 			}
/******/ 			return __webpack_require__.O(result);
/******/ 		}
/******/ 		
/******/ 		var chunkLoadingGlobal = self["webpackChunkshopcentral"] = self["webpackChunkshopcentral"] || [];
/******/ 		chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
/******/ 		chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/nonce */
/******/ 	(() => {
/******/ 		__webpack_require__.nc = undefined;
/******/ 	})();
/******/ 	
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module depends on other loaded chunks and execution need to be delayed
/******/ 	var __webpack_exports__ = __webpack_require__.O(undefined, ["vendors"], () => (__webpack_require__("./src/Admin/ShopCentralAdmin.jsx")))
/******/ 	__webpack_exports__ = __webpack_require__.O(__webpack_exports__);
/******/ 	
/******/ })()
;