/*
 * 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__ = ({

/***/ "./node_modules/css-loader/dist/cjs.js!./src/Pages/StoreManager/Layouts/sidebar.css"
/*!******************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js!./src/Pages/StoreManager/Layouts/sidebar.css ***!
  \******************************************************************************************/
(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 _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.shopcentral-scrollbar::-webkit-scrollbar {\r\n  width: 4px;\r\n}\r\n.shopcentral-scrollbar::-webkit-scrollbar-track {\r\n  background: transparent;\r\n}\r\n.shopcentral-scrollbar::-webkit-scrollbar-thumb {\r\n  background: #E2E8F0;\r\n  border-radius: 10px;\r\n}\r\n.shopcentral-scrollbar::-webkit-scrollbar-thumb:hover {\r\n  background: #CBD5E0;\r\n}\r\n`, \"\"]);\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Layouts/sidebar.css?./node_modules/css-loader/dist/cjs.js\n}");

/***/ },

/***/ "./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_Customers_CustomerOrderHistory__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../Pages/StoreManager/Customers/CustomerOrderHistory */ \"./src/Pages/StoreManager/Customers/CustomerOrderHistory.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// 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}\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(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/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_23__[\"default\"], null))\n  }))));\n};\nconsole.log('ShopCentral Admin script loaded');\nvar container = document.getElementById('shopcentral-root');\nconsole.log('Mounting container:', container);\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 handleProductCheckbox = function handleProductCheckbox(product) {\n    var isSingle = isAllowOnlySingleSelection || !multiple;\n    var variations = productVariations[product.id] || [];\n    var variationIds = variations.map(function (v) {\n      return v.id;\n    });\n    if (product.type === \"variable\" && variationIds.length > 0) {\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 && selectedVariantIds.size > 0 && !allSelected) {\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        variationIds.forEach(function (id) {\n          return newSelected.add(id);\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        if (isSingle && selectedVariantIds.size > 0 && !selectedVariantIds.has(product.id)) {\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(product.id);\n      }\n      setSelectedVariantIds(_newSelected);\n    }\n  };\n  var handleVariantCheckbox = function handleVariantCheckbox(variantId) {\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 variant 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      if (variations.length === 0) return false;\n      return variations.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      if (variations.length === 0) return false;\n      var selectedCount = variations.filter(function (v) {\n        return selectedVariantIds.has(v.id);\n      }).length;\n      return selectedCount > 0 && selectedCount < variations.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: {\n        bg: \"gray.50\"\n      },\n      bg: isProductChecked(product) ? \"blue.50\" : \"white\"\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    }))), /*#__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: {\n          bg: \"gray.50\"\n        }\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);\n        }\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/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 _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 allTimeRange = [{\n  label: \"All Time\",\n  range: function range() {\n    return {\n      startDate: new Date(2010, 0, 1),\n      endDate: new Date()\n    };\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    // Ensure we're working with date objects\n    var startDate = new Date(selection.startDate);\n    var endDate = new Date(selection.endDate);\n    setRange({\n      startDate: startDate,\n      endDate: endDate,\n      key: \"selection\"\n    });\n    if (onChange) {\n      onChange({\n        startDate: startDate,\n        endDate: endDate,\n        key: \"selection\"\n      });\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 {\n    startDate: new Date(2015, 0, 1),\n    endDate: new Date(),\n    key: \"selection\"\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  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  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.ModalHeader, {\n    textAlign: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.VStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Box, {\n    p: 4,\n    bg: \"orange.50\",\n    borderRadius: \"2xl\",\n    color: \"orange.500\"\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: 10,\n    h: 10\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Heading, {\n    size: \"lg\",\n    fontWeight: \"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: \"center\",\n    pb: 6\n  }, /*#__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  }, 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: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Button, {\n    w: \"full\",\n    size: \"lg\",\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    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    variant: \"ghost\",\n    onClick: onClose,\n    borderRadius: \"xl\"\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;\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    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: 'donut'\n    },\n    labels: data.country_labels || [],\n    legend: {\n      position: 'bottom'\n    },\n    plotOptions: {\n      pie: {\n        donut: {\n          labels: {\n            show: true,\n            name: {\n              show: true\n            },\n            value: {\n              show: true,\n              formatter: function formatter(val) {\n                return \"$\".concat(Number(val).toFixed(2));\n              }\n            },\n            total: {\n              show: true,\n              label: 'Total',\n              formatter: function formatter(w) {\n                var total = w.globals.seriesTotals.reduce(function (a, b) {\n                  return a + b;\n                }, 0);\n                return \"$\".concat(total.toFixed(2));\n              }\n            }\n          }\n        }\n      }\n    },\n    dataLabels: {\n      enabled: false\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    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.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_29__.Text, {\n    fontSize: \"lg\",\n    fontWeight: \"bold\",\n    mb: 4\n  }, \"Revenue by Country\"), 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: \"donut\",\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    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  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    as: \"span\",\n    display: {\n      base: \"none\",\n      md: \"inline\"\n    }\n  }, dateRange.startDate ? \"\".concat(dateRange.startDate.toLocaleDateString(), \" - \").concat(dateRange.endDate.toLocaleDateString()) : \"Select Date Range\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Box, {\n    as: \"span\",\n    display: {\n      base: \"inline\",\n      md: \"none\"\n    }\n  }, dateRange.startDate ? \"Select Date\" : \"Date\"))), /*#__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/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/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-error.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/grid/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/input/input.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-body.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-close-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/modal/modal-footer.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/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/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/v-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/switch/switch.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/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\");\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\nvar AutomationRules = function AutomationRules() {\n  var _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    isPickerOpen = _useDisclosure3.isOpen,\n    onPickerOpen = _useDisclosure3.onOpen,\n    onPickerClose = _useDisclosure3.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_9__.Container, {\n    maxW: \"container.xl\",\n    py: 4\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    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_24__.HStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Heading, {\n    size: \"lg\"\n  }, \"Automation Rules Engine\")), /*#__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    onClick: openNewModal\n  }, \"Create Rule\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.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_25__.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  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Heading, {\n    size: \"md\",\n    mb: 4,\n    display: \"flex\",\n    alignItems: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiSettings, {\n    style: {\n      marginRight: '8px'\n    }\n  }), \" Active Rules\"), rules.length === 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n    color: \"gray.500\",\n    py: 4\n  }, \"No automation rules created yet.\") : /*#__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_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, null, \"Rule Name\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Th, null, \"Trigger (If)\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Th, null, \"Action (Then)\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Th, {\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    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Td, {\n      fontWeight: \"bold\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.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    }, rule.is_active ? \"ON\" : \"OFF\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, null, rule.name))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n      fontSize: \"sm\",\n      color: \"gray.600\"\n    }, getTriggerName(rule.trigger), \" \", rule.condition_value && \"(\".concat(rule.condition_value, \")\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n      fontSize: \"sm\",\n      color: \"blue.600\"\n    }, getActionName(rule.action))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Td, {\n      textAlign: \"right\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.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      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      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      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_25__.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  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Heading, {\n    size: \"md\",\n    mb: 4,\n    display: \"flex\",\n    alignItems: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_36__.FiActivity, {\n    style: {\n      marginRight: '8px'\n    }\n  }), \" Recent Execution Logs\"), (logs === null || logs === void 0 ? void 0 : logs.length) === 0 ? /*#__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_25__.VStack, {\n    align: \"stretch\",\n    spacing: 3,\n    maxH: \"500px\",\n    overflowY: \"auto\"\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: 3,\n      bg: \"gray.50\",\n      borderRadius: \"md\",\n      borderLeft: \"3px solid\",\n      borderLeftColor: \"blue.400\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n      justify: \"space-between\",\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: \"bold\"\n    }, log.rule), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n      mt: 0,\n      fontSize: \"xs\",\n      color: \"gray.500\"\n    }, new Date(log.time).toLocaleTimeString())), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_35__.Text, {\n      mt: 0,\n      fontSize: \"sm\"\n    }, log.message));\n  })))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.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_20__.ModalOverlay, {\n    backdropFilter: \"blur(4px)\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.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_10__.Flex, {\n    justify: \"space-between\",\n    align: \"flex-start\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.VStack, {\n    align: \"start\",\n    spacing: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.HStack, {\n    spacing: 2\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_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_18__.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_16__.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_17__.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_25__.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_24__.HStack, {\n    spacing: 2,\n    mb: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.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_15__.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_14__.Grid, {\n    templateColumns: \"1fr 1fr\",\n    gap: 3\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_13__.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_15__.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_23__.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_11__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.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_15__.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_16__.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_25__.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_10__.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_24__.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_11__.FormControl, {\n    mt: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.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_23__.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_12__.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_24__.HStack, {\n    spacing: 2,\n    mb: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.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_15__.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_14__.Grid, {\n    templateColumns: \"1fr 1fr\",\n    gap: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.FormControl, {\n    isRequired: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.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_15__.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_23__.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_11__.FormControl, {\n    isInvalid: !!formErrors.condition_value\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.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_15__.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_16__.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_12__.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_11__.FormControl, {\n    mt: 3,\n    isInvalid: !!formErrors.time_value\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.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_15__.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_16__.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_12__.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_24__.HStack, {\n    spacing: 2,\n    mb: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.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_15__.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_14__.Grid, {\n    templateColumns: \"1fr 1fr\",\n    gap: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.FormControl, {\n    isRequired: true,\n    isInvalid: !!formErrors.action\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.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_15__.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_23__.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_12__.FormErrorMessage, {\n    fontSize: \"xs\"\n  }, formErrors.action)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.FormControl, {\n    isInvalid: !!formErrors.action_value\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.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_15__.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_16__.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_12__.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_11__.FormControl, {\n    mt: 3\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.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_15__.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_16__.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_14__.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_11__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.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_15__.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_16__.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_11__.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_15__.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_10__.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_24__.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_26__.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_19__.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: handleSaveRule,\n    isLoading: isSaving,\n    loadingText: \"Saving...\",\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_36__.FiSliders\n    })\n  }, \"Save Rule\")))), /*#__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  }));\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/menu/menu.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-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/menu/menu-item.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-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/popover/popover.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-arrow.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-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/popover/popover-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/popover/popover-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/popover/popover-trigger.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__ = __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_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/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/typography/text.mjs\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router/dist/development/chunk-EPOLDU6W.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! lodash.debounce */ \"./node_modules/lodash.debounce/index.js\");\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_35___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_35__);\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 react_icons_fa__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! react-icons/fa */ \"./node_modules/react-icons/fa/index.mjs\");\n/* harmony import */ var _Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../../../Components/shared/DatePicker */ \"./src/Components/shared/DatePicker.jsx\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var _Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_40__ = __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_33__.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_38__.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_36__[\"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_34__[\"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_36__[\"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_36__[\"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_34__[\"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_36__[\"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_36__[\"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_34__[\"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_34__[\"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_35___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_10__.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_4__.Box, {\n    w: {\n      base: \"full\",\n      md: \"auto\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.HStack, {\n    w: \"full\",\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Input, {\n    placeholder: \"Search coupons...\",\n    value: searchTerm,\n    onChange: function onChange(e) {\n      return setSearchTerm(e.target.value);\n    },\n    maxW: {\n      base: \"full\",\n      md: \"300px\"\n    },\n    bg: \"white\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.Popover, {\n    placement: \"bottom-start\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.PopoverTrigger, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Icon, {\n      as: react_icons_fa__WEBPACK_IMPORTED_MODULE_37__.FaCalendar\n    }),\n    variant: \"outline\",\n    bg: \"white\",\n    size: \"md\",\n    fontWeight: \"600\",\n    flexShrink: 0,\n    whiteSpace: \"nowrap\"\n  }, 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_21__.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_18__.PopoverArrow, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.PopoverCloseButton, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.PopoverBody, {\n    p: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_38__[\"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_24__.HStack, {\n    w: {\n      base: \"full\",\n      md: \"auto\"\n    },\n    justify: {\n      base: \"flex-start\",\n      md: \"flex-end\"\n    },\n    overflowX: \"auto\",\n    pb: {\n      base: 2,\n      md: 0\n    }\n  }, selectedRows.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Menu, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.MenuButton, {\n    as: _chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button,\n    colorScheme: \"red\",\n    variant: \"subtle\",\n    rightIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_39__.FiChevronDown, null),\n    flexShrink: 0\n  }, \"Bulk (\", selectedRows.length, \")\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.MenuList, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.MenuItem, {\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_39__.FiTrash2, null),\n    color: \"red.500\",\n    onClick: handleBulkDelete\n  }, \"Delete Permanently\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_39__.FiDownload, null),\n    variant: \"outline\",\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    flexShrink: 0\n  }, \"Export CSV\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    colorScheme: \"blue\",\n    onClick: function onClick() {\n      return navigate(\"/store-manager/coupons/new\");\n    },\n    flexShrink: 0\n  }, \"Create Coupon\"))), /*#__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    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"gray.200\",\n    boxShadow: \"sm\",\n    overflow: \"hidden\",\n    display: \"flex\",\n    flexDirection: \"column\",\n    flex: \"1\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.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_25__.Table, {\n    variant: \"simple\",\n    size: \"sm\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.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_31__.Tr, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Th, {\n    width: \"50px\"\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  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Th, null, \"Code\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Th, null, \"Type\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Th, null, \"Amount\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Th, null, \"Usage\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Th, null, \"Expiry\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Th, null))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.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_31__.Tr, {\n      key: i\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Td, {\n      colSpan: 7\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Skeleton, {\n      h: \"32px\"\n    })));\n  }) : coupons.length === 0 ? /*#__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_28__.Td, {\n    colSpan: 7,\n    textAlign: \"center\",\n    py: 10\n  }, \"No coupons found\")) : coupons.map(function (coupon) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Tr, {\n      key: coupon.id\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_8__.Checkbox, {\n      isChecked: selectedRows.includes(coupon.id),\n      onChange: function onChange() {\n        return toggleSelectRow(coupon.id);\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_24__.HStack, {\n      spacing: 2\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_39__.FiTag, {\n      size: 12\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Text, {\n      fontWeight: \"bold\",\n      color: \"blue.600\",\n      fontSize: \"sm\"\n    }, coupon.code))), /*#__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_3__.Badge, {\n      variant: \"subtle\",\n      fontSize: \"2xs\"\n    }, getDiscountTypeLabel(coupon.discount_type))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Td, {\n      fontWeight: \"bold\",\n      fontSize: \"sm\"\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_28__.Td, {\n      fontSize: \"sm\"\n    }, coupon.usage_count, \" / \", coupon.usage_limit || '∞'), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.Td, {\n      fontSize: \"xs\"\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_28__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Menu, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.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_39__.FiMoreVertical, null),\n      variant: \"ghost\",\n      size: \"xs\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.MenuList, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.MenuItem, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_39__.FiEye, null),\n      fontSize: \"sm\",\n      onClick: function onClick() {\n        return navigate(\"/store-manager/coupons/\".concat(coupon.id));\n      }\n    }, \"Edit\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.MenuItem, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_39__.FiTrash2, null),\n      color: \"red.500\",\n      fontSize: \"sm\",\n      onClick: function onClick() {\n        return promptDeleteCoupon(coupon);\n      }\n    }, \"Delete\")))));\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    p: 3,\n    justify: \"space-between\",\n    align: \"center\",\n    bg: \"white\",\n    borderTop: \"1px\",\n    borderColor: \"gray.100\",\n    flexShrink: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.Text, {\n    fontSize: \"sm\",\n    color: \"gray.600\"\n  }, \"Showing \", (currentPage - 1) * perPage + 1, \" to \", Math.min(currentPage * perPage, totalRows), \" of \", totalRows), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.HStack, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"sm\",\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_39__.FiChevronLeft, null)\n  }, \"Previous\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"sm\",\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_39__.FiChevronRight, null)\n  }, \"Next\")))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_40__[\"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_40__[\"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 Intelligence\"), /*#__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.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/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/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/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/color-mode/color-mode-context.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/icon/icon.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/text.mjs\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router/dist/development/chunk-EPOLDU6W.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! lodash.debounce */ \"./node_modules/lodash.debounce/index.js\");\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_37___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_37__);\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 react_icons_fa__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! react-icons/fa */ \"./node_modules/react-icons/fa/index.mjs\");\n/* harmony import */ var _Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ../../../Components/shared/DatePicker */ \"./src/Components/shared/DatePicker.jsx\");\n/* harmony import */ var _Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ../../../Components/shared/ConfirmDialog */ \"./src/Components/shared/ConfirmDialog.jsx\");\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 _Components_shared_ProFeatureModal__WEBPACK_IMPORTED_MODULE_43__ = __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_35__.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_40__.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_38__[\"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_36__[\"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_38__[\"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_38__[\"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_36__[\"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_38__[\"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_38__[\"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_36__[\"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_10__.useColorModeValue)(\"white\", \"gray.800\");\n  var borderColor = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.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_36__[\"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_37___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_5__.Box, null, /*#__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_5__.Box, {\n    w: {\n      base: \"full\",\n      md: \"auto\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.HStack, {\n    w: \"full\",\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Input, {\n    placeholder: \"Search customers...\",\n    value: searchTerm,\n    onChange: function onChange(e) {\n      return setSearchTerm(e.target.value);\n    },\n    maxW: {\n      base: \"full\",\n      md: \"300px\"\n    },\n    bg: \"white\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Popover, {\n    placement: \"bottom-start\"\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_6__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Icon, {\n      as: react_icons_fa__WEBPACK_IMPORTED_MODULE_39__.FaCalendar\n    }),\n    variant: \"outline\",\n    bg: \"white\",\n    size: \"md\",\n    fontWeight: \"600\",\n    flexShrink: 0,\n    whiteSpace: \"nowrap\"\n  }, 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    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_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_40__[\"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_25__.HStack, {\n    w: {\n      base: \"full\",\n      md: \"auto\"\n    },\n    justify: {\n      base: \"flex-start\",\n      md: \"flex-end\"\n    },\n    overflowX: \"auto\",\n    pb: {\n      base: 2,\n      md: 0\n    }\n  }, selectedRows.length > 0 && /*#__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_6__.Button,\n    colorScheme: \"red\",\n    variant: \"subtle\",\n    rightIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_42__.FiChevronDown, null),\n    flexShrink: 0\n  }, \"Bulk (\", selectedRows.length, \")\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.MenuList, null, /*#__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_42__.FiTrash2, null),\n    color: \"red.500\",\n    onClick: handleBulkDelete\n  }, \"Delete Permanently\"))), /*#__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_42__.FiDownload, null),\n    variant: \"outline\",\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    flexShrink: 0\n  }, \"Export CSV\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Button, {\n    colorScheme: \"blue\",\n    onClick: onCreateOpen,\n    flexShrink: 0\n  }, \"Add Customer\"))), /*#__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_5__.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_8__.Card, {\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"gray.200\",\n    boxShadow: \"sm\",\n    overflow: \"hidden\",\n    display: \"flex\",\n    flexDirection: \"column\",\n    flex: \"1\"\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: 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: \"50px\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Checkbox, {\n    isChecked: selectedRows.length === customers.length && customers.length > 0,\n    isIndeterminate: selectedRows.length > 0 && selectedRows.length < customers.length,\n    onChange: toggleSelectAll\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, null, \"Customer\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, null, \"Contact\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, null, \"Country\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, null, \"Orders\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, null, \"Spent\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, null, \"AOV\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, null, \"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      colSpan: 8\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Skeleton, {\n      h: \"32px\"\n    })));\n  }) : customers.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  }, \"No customers found\")) : customers.map(function (customer) {\n    var _customer$billing;\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_33__.Tr, {\n      key: customer.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_9__.Checkbox, {\n      isChecked: selectedRows.includes(customer.id),\n      onChange: function onChange() {\n        return toggleSelectRow(customer.id);\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(_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__.Avatar, {\n      size: \"xs\",\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_26__.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      mb: 0,\n      fontWeight: \"bold\",\n      fontSize: \"sm\"\n    }, customer.first_name, \" \", customer.last_name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Text, {\n      mt: 0,\n      fontSize: \"2xs\",\n      color: \"gray.500\"\n    }, \"@\", customer.username)))), /*#__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__.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      mb: 0,\n      fontSize: \"xs\"\n    }, customer.email), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Text, {\n      mt: 0,\n      fontSize: \"2xs\",\n      color: \"gray.500\"\n    }, (_customer$billing = customer.billing) === null || _customer$billing === void 0 ? void 0 : _customer$billing.phone))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      fontSize: \"sm\"\n    }, customer.country || '-'), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      fontSize: \"sm\",\n      fontWeight: \"medium\"\n    }, customer.orders_count || 0), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      fontSize: \"sm\",\n      fontWeight: \"bold\"\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_30__.Td, {\n      fontSize: \"sm\",\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_30__.Td, null, /*#__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_7__.IconButton,\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_42__.FiMoreVertical, null),\n      variant: \"ghost\",\n      size: \"xs\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.MenuList, null, /*#__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_42__.FiEye, null),\n      fontSize: \"sm\",\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_16__.MenuItem, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_42__.FiTrash2, null),\n      color: \"red.500\",\n      fontSize: \"sm\",\n      onClick: function onClick() {\n        return promptDeleteCustomer(customer);\n      }\n    }, \"Delete\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Button, {\n      size: \"xs\",\n      colorScheme: isPro ? \"blue\" : \"orange\",\n      variant: \"outline\",\n      borderRadius: \"lg\",\n      leftIcon: !isPro ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_42__.FiLock, {\n        size: 10\n      }) : undefined,\n      onClick: function onClick() {\n        return isPro ? navigate(\"/store-manager/customers/orders/\".concat(encodeURIComponent(customer.email))) : onProModalOpen();\n      }\n    }, \"Order History\")));\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Flex, {\n    p: 3,\n    justify: \"space-between\",\n    align: \"center\",\n    bg: \"white\",\n    borderTop: \"1px\",\n    borderColor: \"gray.100\",\n    flexShrink: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Text, {\n    mb: 0,\n    fontSize: \"sm\",\n    color: \"gray.600\"\n  }, \"Showing \", (currentPage - 1) * perPage + 1, \" to \", Math.min(currentPage * perPage, totalRows), \" of \", totalRows), /*#__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_6__.Button, {\n    size: \"sm\",\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_42__.FiChevronLeft, null)\n  }, \"Previous\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Button, {\n    size: \"sm\",\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_42__.FiChevronRight, null)\n  }, \"Next\")))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_41__[\"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_41__[\"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_43__[\"default\"], {\n    isOpen: isProModalOpen,\n    onClose: onProModalClose,\n    description: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null, \"Cross-store customer order history is a premium feature. Upgrade to \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"b\", null, \"ShopCentral Pro\"), \" to track customer spending habits and unified order logs across all your connected stores.\")\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/react/dist/esm/index.mjs\");\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/avatar/avatar.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/breadcrumb/breadcrumb.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-item.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__ = __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_9__ = __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_10__ = __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_11__ = __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_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/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/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/skeleton/skeleton-text.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-circle.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/typography/heading.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 react_router_dom__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router/dist/development/chunk-EPOLDU6W.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! react-hot-toast */ \"./node_modules/react-hot-toast/dist/index.mjs\");\n/* harmony import */ var _utils_FormatDate__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../../utils/FormatDate */ \"./src/utils/FormatDate.js\");\n/* harmony import */ var _Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_27__ = __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_23__.useParams)(),\n    id = _useParams.id;\n  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_23__.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_2__.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_24__[\"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_25__[\"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_24__[\"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_25__[\"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_25__[\"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_5__.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_12__.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: 2,\n      w: \"30%\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n      height: \"15px\",\n      width: \"100px\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n      height: \"30px\",\n      width: \"200px\"\n    }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.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__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.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_11__.CardBody, {\n      p: 6,\n      textAlign: \"center\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.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_15__.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_15__.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_19__.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_15__.Skeleton, {\n      height: \"20px\",\n      width: \"full\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n      height: \"20px\",\n      width: \"full\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Skeleton, {\n      height: \"20px\",\n      width: \"full\"\n    }))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Box, {\n      gridColumn: {\n        md: \"span 2\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.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_10__.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_16__.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_10__.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_16__.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_10__.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_16__.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_5__.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_12__.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_6__.Breadcrumb, {\n    fontSize: \"sm\",\n    color: \"gray.500\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.BreadcrumbItem, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.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_7__.BreadcrumbItem, {\n    isCurrentPage: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.BreadcrumbLink, null, customer.first_name, \" \", customer.last_name))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Heading, {\n    size: \"lg\",\n    fontWeight: \"800\"\n  }, \"Customer Profile\")), /*#__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_9__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_22__.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_9__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_22__.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_13__.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__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.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_11__.CardBody, {\n    p: 6,\n    textAlign: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.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_20__.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_21__.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_18__.HStack, {\n    justify: \"center\",\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.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_4__.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_19__.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_12__.Flex, {\n    align: \"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_22__.FiMail,\n    color: \"gray.400\",\n    mr: 3\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_21__.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_21__.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_12__.Flex, {\n    align: \"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_22__.FiPhone,\n    color: \"gray.400\",\n    mr: 3\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_21__.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_21__.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_12__.Flex, {\n    align: \"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_22__.FiCalendar,\n    color: \"gray.400\",\n    mr: 3\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_21__.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_21__.Text, {\n    mt: 1,\n    fontSize: \"sm\",\n    fontWeight: \"700\"\n  }, (0,_utils_FormatDate__WEBPACK_IMPORTED_MODULE_26__.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_12__.Flex, {\n    align: \"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_22__.FiMapPin,\n    color: \"gray.400\",\n    mr: 3\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_21__.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_21__.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_5__.Box, {\n    gridColumn: {\n      md: \"span 2\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.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_10__.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_11__.CardBody, {\n    p: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.HStack, {\n    mb: 4\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_22__.FiMapPin,\n    color: \"blue.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Heading, {\n    size: \"sm\",\n    fontWeight: \"800\"\n  }, \"Billing Address\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.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_21__.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_10__.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_11__.CardBody, {\n    p: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.HStack, {\n    mb: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Icon, {\n    as: _chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.FiTruck,\n    color: \"blue.500\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Heading, {\n    size: \"sm\",\n    fontWeight: \"800\"\n  }, \"Shipping Address\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.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_21__.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_10__.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_11__.CardBody, {\n    p: 6\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.VStack, {\n    spacing: 4,\n    align: \"stretch\"\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_21__.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_18__.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_19__.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_14__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_22__.FiShoppingCart,\n    color: \"blue.500\",\n    mb: 1\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.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_21__.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_19__.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_21__.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_21__.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_19__.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_21__.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_21__.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_27__[\"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/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/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/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/modal/alert-dialog.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-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/modal/modal-footer.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-header.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-overlay.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 _chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__ = __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_15__ = __webpack_require__(/*! @chakra-ui/react */ \"./node_modules/@chakra-ui/react/dist/esm/typography/text.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_17__);\n/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! react-hot-toast */ \"./node_modules/react-hot-toast/dist/index.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 _sidebar_css__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./sidebar.css */ \"./src/Pages/StoreManager/Layouts/sidebar.css\");\n/* harmony import */ var _Components_shared_ProFeatureModal__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../../Components/shared/ProFeatureModal */ \"./src/Components/shared/ProFeatureModal.jsx\");\n/* harmony import */ var _Components_shared_UsageTrackingNotice__WEBPACK_IMPORTED_MODULE_23__ = __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\n\n// Modern Sidebar Navigation Item\nvar NavItem = function NavItem(_ref) {\n  var to = _ref.to,\n    icon = _ref.icon,\n    children = _ref.children,\n    isActive = _ref.isActive,\n    badge = _ref.badge,\n    hasSubmenu = _ref.hasSubmenu,\n    _ref$isCollapsed = _ref.isCollapsed,\n    isCollapsed = _ref$isCollapsed === void 0 ? false : _ref$isCollapsed,\n    _ref$isProOnly = _ref.isProOnly,\n    isProOnly = _ref$isProOnly === void 0 ? false : _ref$isProOnly,\n    _ref$isPro = _ref.isPro,\n    isPro = _ref$isPro === void 0 ? true : _ref$isPro,\n    onProModalOpen = _ref.onProModalOpen;\n  var handleClick = function handleClick(e) {\n    if (isProOnly && !isPro) {\n      e.preventDefault();\n      onProModalOpen();\n    }\n  };\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Tooltip, {\n    label: isCollapsed ? isProOnly && !isPro ? \"\".concat(children, \" (PRO)\") : children : \"\",\n    placement: \"right\",\n    hasArrow: true,\n    isDisabled: !isCollapsed\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    as: isProOnly && !isPro ? \"div\" : react_router_dom__WEBPACK_IMPORTED_MODULE_20__.Link,\n    to: isProOnly && !isPro ? undefined : to,\n    onClick: handleClick,\n    cursor: \"pointer\",\n    w: \"full\",\n    position: \"relative\",\n    textDecoration: \"none\",\n    _hover: {\n      textDecoration: \"none\"\n    },\n    _focus: {\n      boxShadow: \"none\",\n      outline: \"none\"\n    }\n  }, isActive && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    position: \"absolute\",\n    left: \"-4\",\n    top: \"50%\",\n    transform: \"translateY(-50%)\",\n    width: \"4px\",\n    height: \"24px\",\n    bg: \"blue.500\",\n    borderRadius: \"full\",\n    zIndex: \"1\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.HStack, {\n    spacing: 3,\n    px: 2,\n    py: 1,\n    borderRadius: \"xl\",\n    transition: \"all 0.2s\",\n    bg: isActive ? \"blue.50\" : \"transparent\",\n    color: isActive ? \"blue.700\" : \"gray.600\",\n    _hover: {\n      bg: isActive ? \"blue.100\" : \"gray.50\",\n      color: \"blue.700\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    fontSize: \"20px\",\n    color: isActive ? \"blue.600\" : \"gray.500\",\n    transition: \"color 0.2s\",\n    w: \"24px\",\n    display: \"flex\",\n    alignItems: \"center\",\n    justifyContent: \"center\",\n    mt: \"15px\"\n  }, icon), !isCollapsed && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement((react__WEBPACK_IMPORTED_MODULE_17___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Text, {\n    flex: \"1\",\n    mb: 0,\n    fontSize: \"15px\",\n    fontWeight: isActive ? \"700\" : \"600\",\n    letterSpacing: \"-0.2px\",\n    mt: \"15px\"\n  }, children), isProOnly && !isPro && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Icon, {\n    as: react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiLock,\n    color: \"orange.400\",\n    mt: \"15px\"\n  }), badge && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n    colorScheme: \"blue\",\n    variant: \"subtle\",\n    borderRadius: \"full\",\n    px: 2,\n    py: 0.5,\n    fontSize: \"xs\"\n  }, badge), hasSubmenu && !isCollapsed && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiChevronRight, {\n    size: 14,\n    opacity: 0.5\n  })))));\n};\nfunction StoreManagerLayout(_ref2) {\n  var _window$shopCentralDa;\n  var header = _ref2.header,\n    children = _ref2.children;\n  var location = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_20__.useLocation)();\n  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_20__.useNavigate)();\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_17__.useState)(false),\n    _useState2 = _slicedToArray(_useState, 2),\n    sidebarOpen = _useState2[0],\n    setSidebarOpen = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_17__.useState)(false),\n    _useState4 = _slicedToArray(_useState3, 2),\n    sidebarCollapsed = _useState4[0],\n    setSidebarCollapsed = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_17__.useState)([]),\n    _useState6 = _slicedToArray(_useState5, 2),\n    stores = _useState6[0],\n    setStores = _useState6[1];\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_17__.useState)(null),\n    _useState8 = _slicedToArray(_useState7, 2),\n    currentStore = _useState8[0],\n    setCurrentStore = _useState8[1];\n  var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_17__.useState)(false),\n    _useState0 = _slicedToArray(_useState9, 2),\n    switching = _useState0[0],\n    setSwitching = _useState0[1];\n  var _useState1 = (0,react__WEBPACK_IMPORTED_MODULE_17__.useState)(\"\"),\n    _useState10 = _slicedToArray(_useState1, 2),\n    searchQuery = _useState10[0],\n    setSearchQuery = _useState10[1];\n  var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_17__.useState)(null),\n    _useState12 = _slicedToArray(_useState11, 2),\n    pendingStore = _useState12[0],\n    setPendingStore = _useState12[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 _useDisclosure2 = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_0__.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 cancelRef = (0,react__WEBPACK_IMPORTED_MODULE_17__.useRef)();\n  var fetchStores = (0,react__WEBPACK_IMPORTED_MODULE_17__.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_16__[\"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          setCurrentStore(current);\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_17__.useEffect)(function () {\n    fetchStores();\n  }, [fetchStores]);\n  var handleStoreSwitch = /*#__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 (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_16__[\"default\"].post('/api/stores/switch', {\n              store_id: pendingStore.id\n            });\n          case 3:\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_18__[\"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_18__[\"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 _ref4.apply(this, arguments);\n    };\n  }();\n  var cleanDomain = function cleanDomain(url) {\n    if (!url) return \"\";\n    var cleaned = url.replace(/^https?:\\/\\//, \"\");\n    cleaned = cleaned.replace(/^www\\./, \"\");\n    cleaned = cleaned.split(\"/\")[0];\n    return cleaned;\n  };\n  var isActive = function isActive(path) {\n    if (path === '/store-manager' && location.pathname !== '/store-manager') return false;\n    return location.pathname.startsWith(path);\n  };\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    minH: \"100vh\",\n    bg: \"gray.50\",\n    display: \"flex\"\n  }, sidebarOpen && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    position: \"fixed\",\n    inset: \"0\",\n    bg: \"blackAlpha.600\",\n    zIndex: \"30\",\n    display: {\n      base: \"block\",\n      md: \"none\"\n    },\n    onClick: function onClick() {\n      return setSidebarOpen(false);\n    }\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    as: \"aside\",\n    w: {\n      base: \"64\",\n      md: sidebarCollapsed ? \"20\" : \"64\"\n    },\n    bg: \"white\",\n    borderRight: \"1px\",\n    borderColor: \"gray.200\",\n    display: \"flex\",\n    flexDirection: \"column\",\n    transition: \"width 0.3s\",\n    position: {\n      base: \"fixed\",\n      md: \"sticky\"\n    },\n    top: \"0\",\n    pt: {\n      base: \"14\",\n      md: \"0\"\n    },\n    h: \"100vh\",\n    zIndex: \"40\",\n    transform: {\n      base: sidebarOpen ? \"translateX(0)\" : \"translateX(-100%)\",\n      md: \"none\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    h: \"20\",\n    display: \"flex\",\n    alignItems: \"center\",\n    justifyContent: \"space-between\",\n    px: \"6\",\n    mb: \"4\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Text, {\n    my: 0,\n    fontWeight: \"800\",\n    fontSize: \"22px\",\n    color: \"blue.600\",\n    letterSpacing: \"-0.5px\",\n    display: {\n      base: \"block\",\n      md: sidebarCollapsed ? \"none\" : \"block\"\n    }\n  }, \"ShopCentral\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.IconButton, {\n    icon: sidebarCollapsed ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiChevronRight, null) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiChevronLeft, null),\n    onClick: function onClick() {\n      return setSidebarCollapsed(!sidebarCollapsed);\n    },\n    variant: \"ghost\",\n    size: \"sm\",\n    borderRadius: \"lg\",\n    display: {\n      base: \"none\",\n      md: \"flex\"\n    },\n    _hover: {\n      bg: \"blue.50\",\n      color: \"blue.600\"\n    }\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.IconButton, {\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiChevronLeft, null),\n    onClick: function onClick() {\n      return setSidebarOpen(false);\n    },\n    variant: \"ghost\",\n    size: \"sm\",\n    borderRadius: \"lg\",\n    display: {\n      base: \"flex\",\n      md: \"none\"\n    },\n    _hover: {\n      bg: \"blue.50\",\n      color: \"blue.600\"\n    }\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.VStack, {\n    px: \"4\",\n    spacing: \"1\",\n    align: \"stretch\",\n    flex: \"1\",\n    overflowY: \"auto\",\n    className: \"shopcentral-scrollbar\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(NavItem, {\n    to: \"/store-manager\",\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiHome, null),\n    isActive: isActive(\"/store-manager\"),\n    isCollapsed: sidebarCollapsed\n  }, \"Dashboard\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(NavItem, {\n    to: \"/store-manager/stores\",\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiGlobe, null),\n    isActive: isActive(\"/store-manager/stores\"),\n    isCollapsed: sidebarCollapsed\n  }, \"Stores\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(NavItem, {\n    to: \"/store-manager/products\",\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiBox, null),\n    isActive: isActive(\"/store-manager/products\"),\n    isCollapsed: sidebarCollapsed\n  }, \"Products\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(NavItem, {\n    to: \"/store-manager/orders\",\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiShoppingCart, null),\n    isActive: isActive(\"/store-manager/orders\"),\n    isCollapsed: sidebarCollapsed\n  }, \"Orders\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(NavItem, {\n    to: \"/store-manager/coupons\",\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiTag, null),\n    isActive: isActive(\"/store-manager/coupons\"),\n    isCollapsed: sidebarCollapsed\n  }, \"Discounts\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(NavItem, {\n    to: \"/store-manager/customers\",\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiUsers, null),\n    isActive: isActive(\"/store-manager/customers\"),\n    isCollapsed: sidebarCollapsed\n  }, \"Customers\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(NavItem, {\n    to: \"/store-manager/marketing/global-coupon\",\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiSend, null),\n    isActive: isActive(\"/store-manager/marketing/global-coupon\"),\n    isCollapsed: sidebarCollapsed,\n    isProOnly: true,\n    isPro: isPro,\n    onProModalOpen: onProModalOpen\n  }, \"Marketing\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(NavItem, {\n    to: \"/store-manager/customer-intelligence\",\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiShield, null),\n    isActive: isActive(\"/store-manager/customer-intelligence\"),\n    isCollapsed: sidebarCollapsed,\n    isProOnly: true,\n    isPro: isPro,\n    onProModalOpen: onProModalOpen\n  }, \"Intelligence\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(NavItem, {\n    to: \"/store-manager/automation\",\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiCpu, null),\n    isActive: isActive(\"/store-manager/automation\"),\n    isCollapsed: sidebarCollapsed,\n    isProOnly: true,\n    isPro: isPro,\n    onProModalOpen: onProModalOpen\n  }, \"Automation\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(NavItem, {\n    to: \"/store-manager/analytics/advanced\",\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiTrendingUp, null),\n    isActive: isActive(\"/store-manager/analytics/advanced\"),\n    isCollapsed: sidebarCollapsed,\n    isProOnly: true,\n    isPro: isPro,\n    onProModalOpen: onProModalOpen\n  }, \"Store Analytics\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(NavItem, {\n    to: \"/store-manager/analytics/products\",\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiTrendingUp, null),\n    isActive: isActive(\"/store-manager/analytics/products\"),\n    isCollapsed: sidebarCollapsed\n  }, \"Product Analytics\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(NavItem, {\n    to: \"/store-manager/export\",\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiDownloadCloud, null),\n    isActive: isActive(\"/store-manager/export\"),\n    isCollapsed: sidebarCollapsed\n  }, \"Export Tools\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    p: \"4\",\n    pb: \"12\",\n    borderTop: \"1px\",\n    borderColor: \"gray.100\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    w: \"full\",\n    variant: \"unstyled\",\n    onClick: onStoreModalOpen,\n    isDisabled: stores.length <= 1,\n    p: \"3\",\n    h: \"auto\",\n    borderRadius: \"2xl\",\n    bg: \"blue.50\",\n    transition: \"all 0.2s\",\n    _hover: stores.length > 1 ? {\n      bg: \"blue.100\",\n      transform: \"translateY(-2px)\",\n      shadow: \"sm\"\n    } : {},\n    _disabled: {\n      opacity: 1,\n      cursor: \"default\"\n    },\n    display: \"flex\",\n    alignItems: \"center\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.HStack, {\n    spacing: \"3\",\n    w: \"full\",\n    px: \"1\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Avatar, {\n    size: \"sm\",\n    name: currentStore === null || currentStore === void 0 ? void 0 : currentStore.name,\n    src: \"\",\n    shadow: \"sm\",\n    border: \"2px solid white\"\n  }), !sidebarCollapsed && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    flex: \"1\",\n    textAlign: \"left\",\n    overflow: \"hidden\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Text, {\n    m: 0,\n    fontSize: \"sm\",\n    fontWeight: \"800\",\n    color: \"gray.800\",\n    isTruncated: true,\n    w: \"full\"\n  }, (currentStore === null || currentStore === void 0 ? void 0 : currentStore.name) || \"Current Store\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Text, {\n    m: 0,\n    fontSize: \"xs\",\n    color: \"blue.600\",\n    fontWeight: \"500\",\n    isTruncated: true,\n    w: \"full\"\n  }, cleanDomain(currentStore === null || currentStore === void 0 ? void 0 : currentStore.url))), !sidebarCollapsed && stores.length > 1 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiChevronDown, {\n    size: 14,\n    color: \"gray.400\"\n  }))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    flex: \"1\",\n    display: \"flex\",\n    flexDirection: \"column\",\n    minW: \"0\",\n    h: \"100vh\",\n    overflow: \"hidden\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___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_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.HStack, {\n    spacing: \"4\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.IconButton, {\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_19__.FiMenu, null),\n    onClick: function onClick() {\n      return setSidebarOpen(true);\n    },\n    display: {\n      base: \"flex\",\n      md: \"none\"\n    },\n    variant: \"ghost\",\n    size: \"md\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.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_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    p: {\n      base: 4,\n      md: 6\n    },\n    flex: \"1\",\n    overflowY: \"auto\",\n    className: \"shopcentral-scrollbar\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_Components_shared_UsageTrackingNotice__WEBPACK_IMPORTED_MODULE_23__[\"default\"], null), children)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.AlertDialog, {\n    isOpen: isStoreModalOpen,\n    leastDestructiveRef: cancelRef,\n    onClose: onStoreModalClose,\n    size: \"xl\",\n    isCentered: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.ModalOverlay, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.AlertDialogContent, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.ModalHeader, null, \"Select a Store\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.ModalBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.VStack, {\n    align: \"stretch\",\n    spacing: \"2\"\n  }, stores.map(function (store) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___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_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.HStack, {\n      spacing: \"3\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Avatar, {\n      size: \"sm\",\n      name: store.name\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.VStack, {\n      align: \"start\",\n      spacing: \"0\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Text, {\n      m: 0,\n      fontWeight: \"bold\"\n    }, store.name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.Text, {\n      m: 0,\n      fontSize: \"xs\",\n      color: \"gray.500\"\n    }, store.url)), store.is_current == 1 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n      colorScheme: \"green\",\n      ml: \"auto\"\n    }, \"Current\")));\n  }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.ModalFooter, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    ref: cancelRef,\n    onClick: onStoreModalClose\n  }, \"Cancel\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___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\")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(_Components_shared_ProFeatureModal__WEBPACK_IMPORTED_MODULE_22__[\"default\"], {\n    isOpen: isProModalOpen,\n    onClose: onProModalClose,\n    description: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(\"span\", null, \"This advanced feature is only available in \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default().createElement(\"b\", null, \"ShopCentral Pro\"), \". Upgrade today to unlock powerful automation, deep customer intelligence, and more network-wide tools.\")\n  }));\n}\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Layouts/StoreManagerLayout.jsx?\n}");

/***/ },

/***/ "./src/Pages/StoreManager/Layouts/sidebar.css"
/*!****************************************************!*\
  !*** ./src/Pages/StoreManager/Layouts/sidebar.css ***!
  \****************************************************/
(__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 _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ \"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ \"./node_modules/style-loader/dist/runtime/styleDomAPI.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ \"./node_modules/style-loader/dist/runtime/insertBySelector.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ \"./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ \"./node_modules/style-loader/dist/runtime/insertStyleElement.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ \"./node_modules/style-loader/dist/runtime/styleTagTransform.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _node_modules_css_loader_dist_cjs_js_sidebar_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js!./sidebar.css */ \"./node_modules/css-loader/dist/cjs.js!./src/Pages/StoreManager/Layouts/sidebar.css\");\n\n      \n      \n      \n      \n      \n      \n      \n      \n      \n\nvar options = {};\n\noptions.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());\noptions.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());\noptions.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, \"head\");\noptions.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());\noptions.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());\n\nvar update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_sidebar_css__WEBPACK_IMPORTED_MODULE_6__[\"default\"], options);\n\n\n\n\n       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_sidebar_css__WEBPACK_IMPORTED_MODULE_6__[\"default\"] && _node_modules_css_loader_dist_cjs_js_sidebar_css__WEBPACK_IMPORTED_MODULE_6__[\"default\"].locals ? _node_modules_css_loader_dist_cjs_js_sidebar_css__WEBPACK_IMPORTED_MODULE_6__[\"default\"].locals : undefined);\n\n\n//# sourceURL=webpack://shopcentral/./src/Pages/StoreManager/Layouts/sidebar.css?\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/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-icon.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/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/container/container.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-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/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/select/select.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/h-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/stack/v-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/switch/switch.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/textarea/textarea.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 react_router_dom__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router/dist/development/chunk-EPOLDU6W.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_34__ = __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 GlobalCoupon = function GlobalCoupon() {\n  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_32__.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)({\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    _useState6 = _slicedToArray(_useState5, 2),\n    formData = _useState6[0],\n    setFormData = _useState6[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_34__[\"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            if (formData.code) {\n              _context.n = 1;\n              break;\n            }\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_34__[\"default\"].error(\"Coupon code is required\");\n            return _context.a(2);\n          case 1:\n            if (formData.amount) {\n              _context.n = 2;\n              break;\n            }\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_34__[\"default\"].error(\"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_33__[\"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_34__[\"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_34__[\"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_8__.Container, {\n    maxW: \"container.xl\",\n    py: 4\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    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_19__.HStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Heading, {\n    size: \"lg\"\n  }, \"Marketing Control Center: Global Coupon\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_31__.FiSend, null),\n    colorScheme: \"purple\",\n    size: \"lg\",\n    isLoading: isLoading,\n    onClick: handleSubmit,\n    loadingText: \"Synchronizing...\"\n  }, \"Push to All Stores\")), results.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.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_7__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Heading, {\n    size: \"md\",\n    mb: 4\n  }, \"Broadcast Results\"), /*#__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    bg: \"gray.50\"\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, null, \"Network Store\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Th, null, \"Status\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.Th, null, \"Message\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Tbody, null, results.map(function (r, idx) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Tr, {\n      key: idx\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Td, {\n      fontWeight: \"bold\"\n    }, r.store_name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Td, null, r.status === 'success' ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.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_14__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_31__.FiCheckCircle,\n      mr: 1\n    }), \" Success\") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.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_14__.Icon, {\n      as: react_icons_fi__WEBPACK_IMPORTED_MODULE_31__.FiXCircle,\n      mr: 1\n    }), \" Error\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Td, null, r.message));\n  }))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.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_20__.VStack, {\n    spacing: 6,\n    align: \"stretch\"\n  }, /*#__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_2__.AlertIcon, null), \"This will instantly generate and activate a coupon code across all stores connected to your ShopCentral network simultaneously.\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.Card, {\n    variant: \"outline\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.VStack, {\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.FormControl, {\n    isRequired: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormLabel, null, \"Global Coupon Code\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.InputGroup, {\n    size: \"lg\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.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_17__.InputRightElement, {\n    width: \"auto\",\n    pr: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"sm\",\n    onClick: handleGenerateCode,\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_31__.FiRefreshCw, null)\n  }, \"Generate\")))), /*#__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, null, \"Description (Internal)\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_28__.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_6__.Card, {\n    variant: \"outline\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.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_13__.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_11__.FormControl, {\n    isRequired: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormLabel, null, \"Discount Type\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.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_11__.FormControl, {\n    isRequired: true\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormLabel, null, \"Global Discount Amount\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.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_11__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormLabel, null, \"Expiry Date\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.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_9__.Divider, {\n    my: 6\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.VStack, {\n    align: \"stretch\",\n    spacing: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    justify: \"space-between\",\n    align: \"center\"\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_30__.Text, {\n    fontWeight: \"600\"\n  }, \"Free Shipping\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.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_21__.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_20__.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  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Heading, {\n    size: \"md\",\n    mb: 4\n  }, \"Cart Requirements\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.VStack, {\n    spacing: 4\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, null, \"Minimum Spend Limits\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.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_11__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormLabel, null, \"Maximum Spend\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.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_9__.Divider, {\n    my: 4\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.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    justify: \"space-between\",\n    align: \"center\"\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_30__.Text, {\n    fontWeight: \"600\"\n  }, \"Individual Use\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.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_21__.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_10__.Flex, {\n    justify: \"space-between\",\n    align: \"center\"\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_30__.Text, {\n    fontWeight: \"600\"\n  }, \"Exclude Sale Items\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.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_21__.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_6__.Card, {\n    variant: \"outline\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.CardBody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Heading, {\n    size: \"md\",\n    mb: 4\n  }, \"Usage Throttling\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.VStack, {\n    spacing: 4\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, null, \"Limit Per Coupon\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.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_11__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.FormLabel, null, \"Limit Per User\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.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__ = (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/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/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/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/input/input.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.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-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/menu/menu-item.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-list.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.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-arrow.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-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/popover/popover-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/popover/popover-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-trigger.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/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/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/table-container.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/toast/use-toast.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_router_dom__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router/dist/development/chunk-EPOLDU6W.mjs\");\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! lodash.debounce */ \"./node_modules/lodash.debounce/index.js\");\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_34___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_34__);\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 react_icons_fa__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! react-icons/fa */ \"./node_modules/react-icons/fa/index.mjs\");\n/* harmony import */ var _Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_37__ = __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 _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\nvar OrderList = function OrderList() {\n  var _stores$find;\n  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_33__.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_30__.useToast)();\n  var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_37__.getAllTimeRange)()),\n    _useState16 = _slicedToArray(_useState15, 2),\n    dateRange = _useState16[0],\n    setDateRange = _useState16[1];\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_32__[\"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 fetchStores = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {\n      var _res$data, 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_32__[\"default\"].get(\"/api/stores\");\n          case 1:\n            res = _context2.v;\n            setStores(((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.stores) || []);\n            _context2.n = 3;\n            break;\n          case 2:\n            _context2.p = 2;\n            _t2 = _context2.v;\n            console.error(\"Failed to load stores\");\n          case 3:\n            return _context2.a(2);\n        }\n      }, _callee2, null, [[0, 2]]);\n    }));\n    return function fetchStores() {\n      return _ref2.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 _callee3() {\n    var _data$data, params, response, data, _t3;\n    return _regenerator().w(function (_context3) {\n      while (1) switch (_context3.p = _context3.n) {\n        case 0:\n          _context3.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          };\n          _context3.n = 1;\n          return axios__WEBPACK_IMPORTED_MODULE_32__[\"default\"].get(\"/api/store-manager/all-orders\", {\n            params: params\n          });\n        case 1:\n          response = _context3.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 || (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.length) || 0);\n          _context3.n = 3;\n          break;\n        case 2:\n          _context3.p = 2;\n          _t3 = _context3.v;\n          console.error(\"Failed to fetch timeline orders\", _t3);\n        case 3:\n          _context3.p = 3;\n          setLoading(false);\n          return _context3.f(3);\n        case 4:\n          return _context3.a(2);\n      }\n    }, _callee3, null, [[0, 2, 3, 4]]);\n  })), [dateRange, selectedStore, status]);\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_3__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Flex, {\n    direction: {\n      base: \"column\",\n      xl: \"row\"\n    },\n    justify: \"space-between\",\n    align: {\n      base: \"start\",\n      xl: \"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, {\n    w: {\n      base: \"full\",\n      xl: \"auto\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.HStack, {\n    spacing: 4,\n    w: \"full\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.Input, {\n    placeholder: \"Search orders...\",\n    value: searchTerm,\n    onChange: function onChange(e) {\n      return setSearchTerm(e.target.value);\n    },\n    maxW: {\n      base: \"full\",\n      md: \"300px\"\n    },\n    bg: \"white\"\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Menu, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.MenuButton, {\n    as: _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button,\n    size: \"md\",\n    variant: \"outline\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fa__WEBPACK_IMPORTED_MODULE_36__.FaStore, null),\n    flexShrink: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    as: \"span\",\n    display: {\n      base: \"none\",\n      md: \"inline\"\n    }\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_3__.Box, {\n    as: \"span\",\n    display: {\n      base: \"inline\",\n      md: \"none\"\n    }\n  }, \"Store\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.MenuList, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.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_12__.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_10__.Menu, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.MenuButton, {\n    as: _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button,\n    size: \"md\",\n    variant: \"outline\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_35__.FiFilter, null),\n    flexShrink: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    as: \"span\",\n    display: {\n      base: \"none\",\n      md: \"inline\"\n    }\n  }, status === \"any\" ? \"All Orders\" : status.charAt(0).toUpperCase() + status.slice(1)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    as: \"span\",\n    display: {\n      base: \"inline\",\n      md: \"none\"\n    }\n  }, \"Status\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.MenuList, null, [\"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_12__.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_21__.HStack, {\n    w: {\n      base: \"full\",\n      xl: \"auto\"\n    },\n    justify: {\n      base: \"flex-start\",\n      xl: \"flex-end\"\n    },\n    overflowX: \"auto\",\n    pb: {\n      base: 2,\n      xl: 0\n    }\n  }, selectedRows.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Menu, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.MenuButton, {\n    as: _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button,\n    colorScheme: \"blue\",\n    variant: \"outline\",\n    rightIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_35__.FiChevronDown, null)\n  }, \"Bulk (\", selectedRows.length, \")\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.MenuList, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.MenuItem, {\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_35__.FiPackage, null),\n    onClick: function onClick() {\n      return handleBulkStatusChange('processing');\n    }\n  }, \"Mark as Processing\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.MenuItem, {\n    icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_35__.FiCheckCircle, null),\n    onClick: function onClick() {\n      return handleBulkStatusChange('completed');\n    }\n  }, \"Mark as Completed\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_14__.Popover, {\n    placement: \"bottom-start\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_19__.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(react_icons_fa__WEBPACK_IMPORTED_MODULE_36__.FaCalendar, null),\n    variant: \"outline\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    as: \"span\",\n    display: {\n      base: \"none\",\n      md: \"inline\"\n    }\n  }, dateRange.startDate ? \"\".concat(dateRange.startDate.toLocaleDateString(), \" - \").concat(dateRange.endDate.toLocaleDateString()) : \"Select Date Range\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    as: \"span\",\n    display: {\n      base: \"inline\",\n      md: \"none\"\n    }\n  }, dateRange.startDate ? \"Select Date\" : \"Date\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.PopoverContent, {\n    w: \"auto\",\n    maxW: \"unset\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.PopoverArrow, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.PopoverCloseButton, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_16__.PopoverBody, {\n    p: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_37__[\"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_4__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_35__.FiDownload, null),\n    variant: \"outline\",\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 CSV\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.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_6__.Card, {\n    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"gray.200\",\n    boxShadow: \"sm\",\n    overflow: \"hidden\",\n    display: \"flex\",\n    flexDirection: \"column\",\n    flex: \"1\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.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_23__.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    position: \"sticky\",\n    top: 0,\n    zIndex: 1\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, {\n    width: \"50px\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Checkbox, {\n    isChecked: selectedRows.length === displayOrders.length && displayOrders.length > 0,\n    isIndeterminate: selectedRows.length > 0 && selectedRows.length < displayOrders.length,\n    onChange: toggleSelectAll\n  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Th, null, \"Order\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Th, null, \"Customer\"), /*#__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, \"Total\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Th, null, \"Date\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Th, null))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.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_29__.Tr, {\n      key: i\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Td, {\n      colSpan: 7\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_20__.Skeleton, {\n      h: \"32px\"\n    })));\n  }) : displayOrders.length === 0 ? /*#__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_26__.Td, {\n    colSpan: 7,\n    textAlign: \"center\",\n    py: 10\n  }, \"No orders found\")) : displayOrders.map(function (order) {\n    var _order$billing, _order$billing2, _order$billing3;\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_29__.Tr, {\n      key: \"\".concat(order.source_store_id, \"-\").concat(order.id)\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.Checkbox, {\n      isChecked: isRowSelected(order),\n      onChange: function onChange() {\n        return toggleSelectRow(order);\n      }\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.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    }, \"#\", order.id), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n      mt: 1,\n      colorScheme: \"purple\",\n      variant: \"subtle\",\n      fontSize: \"2xs\"\n    }, order.source_store_name))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.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: \"medium\",\n      fontSize: \"sm\"\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_31__.Text, {\n      mt: 0,\n      fontSize: \"2xs\",\n      color: \"gray.500\"\n    }, (_order$billing3 = order.billing) === null || _order$billing3 === void 0 ? void 0 : _order$billing3.email))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n      colorScheme: getStatusColor(order.status),\n      variant: \"subtle\",\n      fontSize: \"2xs\"\n    }, order.status)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Td, {\n      fontWeight: \"bold\",\n      fontSize: \"sm\"\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_26__.Td, {\n      fontSize: \"xs\"\n    }, formatDate(order.date_created)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Menu, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.MenuButton, {\n      as: _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__.FiMoreVertical, null),\n      variant: \"ghost\",\n      size: \"xs\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.MenuList, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.MenuItem, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_35__.FiCheckCircle, null),\n      fontSize: \"sm\",\n      onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {\n        var prevSel;\n        return _regenerator().w(function (_context4) {\n          while (1) switch (_context4.n) {\n            case 0:\n              prevSel = _toConsumableArray(selectedRows);\n              setSelectedRows([{\n                id: order.id,\n                source_store_id: order.source_store_id\n              }]);\n              _context4.n = 1;\n              return handleBulkStatusChange('completed');\n            case 1:\n              return _context4.a(2);\n          }\n        }, _callee4);\n      }))\n    }, \"Mark Completed\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.MenuItem, {\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_35__.FiPackage, null),\n      fontSize: \"sm\",\n      onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {\n        var prevSel;\n        return _regenerator().w(function (_context5) {\n          while (1) switch (_context5.n) {\n            case 0:\n              prevSel = _toConsumableArray(selectedRows);\n              setSelectedRows([{\n                id: order.id,\n                source_store_id: order.source_store_id\n              }]);\n              _context5.n = 1;\n              return handleBulkStatusChange('processing');\n            case 1:\n              return _context5.a(2);\n          }\n        }, _callee5);\n      }))\n    }, \"Mark Processing\")))));\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.Flex, {\n    p: 3,\n    justify: \"space-between\",\n    align: \"center\",\n    bg: \"white\",\n    borderTop: \"1px\",\n    borderColor: \"gray.100\",\n    flexShrink: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Text, {\n    mb: 0,\n    fontSize: \"sm\",\n    color: \"gray.600\"\n  }, \"Showing \", totalRows, \" orders\")))));\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/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/text.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router/dist/development/chunk-EPOLDU6W.mjs\");\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! lodash.debounce */ \"./node_modules/lodash.debounce/index.js\");\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_37___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_37__);\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 react_icons_fa__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! react-icons/fa */ \"./node_modules/react-icons/fa/index.mjs\");\n/* harmony import */ var react_icons_fi__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! react-icons/fi */ \"./node_modules/react-icons/fi/index.mjs\");\n/* harmony import */ var _Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ../../../Components/shared/ConfirmDialog */ \"./src/Components/shared/ConfirmDialog.jsx\");\n/* harmony import */ var _Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ../../../Components/shared/DatePicker */ \"./src/Components/shared/DatePicker.jsx\");\n/* harmony import */ var _utils_FormatDate__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ../../../utils/FormatDate */ \"./src/utils/FormatDate.js\");\n/* harmony import */ var _SyncProductsModal__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./SyncProductsModal */ \"./src/Pages/StoreManager/Products/SyncProductsModal.jsx\");\n/* harmony import */ var _GlobalPriceModal__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./GlobalPriceModal */ \"./src/Pages/StoreManager/Products/GlobalPriceModal.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\nvar AllProduct = function AllProduct() {\n  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_36__.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 _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),\n    _useState2 = _slicedToArray(_useState, 2),\n    productToDelete = _useState2[0],\n    setProductToDelete = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState4 = _slicedToArray(_useState3, 2),\n    isDeleting = _useState4[0],\n    setIsDeleting = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState6 = _slicedToArray(_useState5, 2),\n    products = _useState6[0],\n    setProducts = _useState6[1];\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState8 = _slicedToArray(_useState7, 2),\n    productStats = _useState8[0],\n    setProductStats = _useState8[1];\n  var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),\n    _useState0 = _slicedToArray(_useState9, 2),\n    loading = _useState0[0],\n    setLoading = _useState0[1];\n  var _useState1 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0),\n    _useState10 = _slicedToArray(_useState1, 2),\n    totalRows = _useState10[0],\n    setTotalRows = _useState10[1];\n  var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(10),\n    _useState12 = _slicedToArray(_useState11, 2),\n    perPage = _useState12[0],\n    setPerPage = _useState12[1];\n  var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1),\n    _useState14 = _slicedToArray(_useState13, 2),\n    currentPage = _useState14[0],\n    setCurrentPage = _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)({\n      status: \"any\",\n      type: \"\",\n      stockStatus: \"\"\n    }),\n    _useState18 = _slicedToArray(_useState17, 2),\n    filters = _useState18[0],\n    setFilters = _useState18[1];\n  var _useState19 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState20 = _slicedToArray(_useState19, 2),\n    selectedRows = _useState20[0],\n    setSelectedRows = _useState20[1];\n  var _useState21 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_Components_shared_DatePicker__WEBPACK_IMPORTED_MODULE_42__.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      key: null,\n      direction: \"asc\"\n    }),\n    _useState24 = _slicedToArray(_useState23, 2),\n    sortConfig = _useState24[0],\n    setSortConfig = _useState24[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_38__[\"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_35__[\"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_38__[\"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_38__[\"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_35__[\"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_38__[\"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_38__[\"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_35__[\"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_38__[\"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_37___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((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_10__.Flex, {\n    direction: {\n      base: \"column\",\n      xl: \"row\"\n    },\n    justify: \"space-between\",\n    align: {\n      base: \"start\",\n      xl: \"center\"\n    },\n    mb: 6,\n    gap: 4\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    w: {\n      base: \"full\",\n      xl: \"auto\"\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.HStack, {\n    spacing: 4,\n    w: \"full\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Input, {\n    placeholder: \"Search products...\",\n    value: searchTerm,\n    onChange: function onChange(e) {\n      return setSearchTerm(e.target.value);\n    },\n    maxW: {\n      base: \"full\",\n      md: \"300px\"\n    },\n    bg: \"white\"\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    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_40__.FiFilter, null),\n    flexShrink: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    as: \"span\",\n    display: {\n      base: \"none\",\n      md: \"inline\"\n    }\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_4__.Box, {\n    as: \"span\",\n    display: {\n      base: \"inline\",\n      md: \"none\"\n    }\n  }, \"Status\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.MenuList, null, [\"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_25__.HStack, {\n    w: {\n      base: \"full\",\n      xl: \"auto\"\n    },\n    justify: {\n      base: \"flex-start\",\n      xl: \"flex-end\"\n    },\n    overflowX: \"auto\",\n    pb: {\n      base: 2,\n      xl: 0\n    }\n  }, selectedRows.length > 0 && /*#__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    colorScheme: \"blue\",\n    variant: \"outline\",\n    rightIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_40__.FiChevronDown, null)\n  }, \"Bulk (\", selectedRows.length, \")\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.MenuList, null, /*#__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_40__.FiRefreshCw, null),\n    onClick: onSyncOpen\n  }, \"Sync/Push Products\"), /*#__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_40__.FiTrash2, null),\n    color: \"red.500\",\n    onClick: handleBulkDelete\n  }, \"Delete Permanently\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_40__.FiTrendingUp, null),\n    colorScheme: \"purple\",\n    variant: \"solid\",\n    onClick: onPriceOpen\n  }, \"Global Price Update\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_18__.Popover, {\n    placement: \"bottom-start\"\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    variant: \"outline\",\n    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Icon, {\n      as: react_icons_fa__WEBPACK_IMPORTED_MODULE_39__.FaCalendar\n    })\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    as: \"span\",\n    display: {\n      base: \"none\",\n      md: \"inline\"\n    }\n  }, dateRange.startDate ? \"\".concat(dateRange.startDate.toLocaleDateString(), \" - \").concat(dateRange.endDate.toLocaleDateString()) : \"Select Date Range\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Box, {\n    as: \"span\",\n    display: {\n      base: \"inline\",\n      md: \"none\"\n    }\n  }, dateRange.startDate ? \"Select Date\" : \"Date\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_22__.PopoverContent, {\n    w: \"auto\",\n    maxW: \"unset\"\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_42__[\"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    leftIcon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_40__.FiDownload, null),\n    variant: \"outline\",\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\"))), /*#__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    borderRadius: \"xl\",\n    border: \"1px\",\n    borderColor: \"gray.200\",\n    boxShadow: \"sm\",\n    overflow: \"hidden\",\n    display: \"flex\",\n    flexDirection: \"column\",\n    flex: \"1\"\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: 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: \"50px\"\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  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, null, \"Product\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, null, \"Type\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, null, \"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_31__.Th, null, \"Status\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, null, \"Date\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_31__.Th, null))), /*#__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      colSpan: 8\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_24__.Skeleton, {\n      h: \"32px\"\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: 10\n  }, \"No products found\")) : 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    }, /*#__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_8__.Checkbox, {\n      isChecked: selectedRows.includes(product.id),\n      onChange: function onChange() {\n        return toggleSelectRow(product.id);\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(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_25__.HStack, null, /*#__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: \"32px\",\n      borderRadius: \"md\",\n      fallbackSrc: \"https://via.placeholder.com/40\"\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_34__.Text, {\n      mb: 0,\n      fontWeight: \"medium\",\n      isTruncated: true,\n      maxW: \"200px\",\n      fontSize: \"sm\"\n    }, product.name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Text, {\n      mb: 0,\n      fontSize: \"2xs\",\n      color: \"gray.500\"\n    }, \"ID: \", product.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_3__.Badge, {\n      variant: \"outline\",\n      fontSize: \"2xs\"\n    }, product.type)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      fontSize: \"sm\",\n      dangerouslySetInnerHTML: {\n        __html: product.price_html\n      }\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, null, getStockBadge(product.stock_status)), /*#__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_3__.Badge, {\n      fontSize: \"2xs\",\n      colorScheme: product.status === 'publish' ? 'green' : 'gray'\n    }, product.status)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_30__.Td, {\n      fontSize: \"xs\"\n    }, (0,_utils_FormatDate__WEBPACK_IMPORTED_MODULE_43__.FormatDate)(product.date_created)), /*#__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_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_6__.IconButton,\n      icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_40__.FiMoreVertical, null),\n      variant: \"ghost\",\n      size: \"xs\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_17__.MenuList, null, /*#__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_40__.FiEye, null),\n      fontSize: \"sm\",\n      onClick: function onClick() {\n        return navigate(\"/store-manager/products/\".concat(product.id));\n      }\n    }, \"View\"), /*#__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_40__.FiTrash2, null),\n      color: \"red.500\",\n      fontSize: \"sm\",\n      onClick: function onClick() {\n        return promptDeleteProduct(product);\n      }\n    }, \"Delete\")))));\n  })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.Flex, {\n    p: 3,\n    justify: \"space-between\",\n    align: \"center\",\n    bg: \"white\",\n    borderTop: \"1px\",\n    borderColor: \"gray.100\",\n    flexShrink: 0\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_34__.Text, {\n    mb: 0,\n    fontSize: \"sm\",\n    color: \"gray.600\"\n  }, \"Showing \", (currentPage - 1) * perPage + 1, \" to \", Math.min(currentPage * perPage, totalRows), \" of \", totalRows), /*#__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_5__.Button, {\n    size: \"sm\",\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_40__.FiChevronLeft, null)\n  }, \"Previous\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.Button, {\n    size: \"sm\",\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_40__.FiChevronRight, null)\n  }, \"Next\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_SyncProductsModal__WEBPACK_IMPORTED_MODULE_44__[\"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_45__[\"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_41__[\"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_41__[\"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  })));\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/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/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/toast/use-toast.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_16__ = __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\nvar GlobalPriceModal = function GlobalPriceModal(_ref) {\n  var isOpen = _ref.isOpen,\n    onClose = _ref.onClose;\n  var toast = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_15__.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)([\"all\"]),\n    _useState4 = _slicedToArray(_useState3, 2),\n    selectedStores = _useState4[0],\n    setSelectedStores = _useState4[1];\n  var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"\"),\n    _useState6 = _slicedToArray(_useState5, 2),\n    amount = _useState6[0],\n    setAmount = _useState6[1];\n  var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"percentage\"),\n    _useState8 = _slicedToArray(_useState7, 2),\n    type = _useState8[0],\n    setType = _useState8[1];\n  var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"increase\"),\n    _useState0 = _slicedToArray(_useState9, 2),\n    direction = _useState0[0],\n    setDirection = _useState0[1];\n  var _useState1 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(\"\"),\n    _useState10 = _slicedToArray(_useState1, 2),\n    categoryId = _useState10[0],\n    setCategoryId = _useState10[1];\n  var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),\n    _useState12 = _slicedToArray(_useState11, 2),\n    categories = _useState12[0],\n    setCategories = _useState12[1];\n  var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),\n    _useState14 = _slicedToArray(_useState13, 2),\n    isUpdating = _useState14[0],\n    setIsUpdating = _useState14[1];\n  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    if (isOpen) {\n      fetchStores();\n      fetchCategories();\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            _context.p = 0;\n            _context.n = 1;\n            return axios__WEBPACK_IMPORTED_MODULE_16__[\"default\"].get(\"/api/stores\");\n          case 1:\n            res = _context.v;\n            setStores(((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.stores) || []);\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 _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_16__[\"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 handleUpdate = /*#__PURE__*/function () {\n    var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {\n      var payload, _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            setIsUpdating(true);\n            _context3.p = 2;\n            payload = {\n              store_ids: selectedStores.includes(\"all\") ? [\"all\"] : selectedStores,\n              amount: parseFloat(amount),\n              type: type,\n              direction: direction,\n              category_id: categoryId || null\n            };\n            _context3.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_16__[\"default\"].post(\"/api/store-manager/global-price-update\", payload);\n          case 3:\n            toast({\n              title: \"Prices updated globally\",\n              status: \"success\",\n              duration: 3000\n            });\n            onClose();\n            _context3.n = 5;\n            break;\n          case 4:\n            _context3.p = 4;\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 5:\n            _context3.p = 5;\n            setIsUpdating(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 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_10__.Modal, {\n    isOpen: isOpen,\n    onClose: onClose,\n    size: \"md\"\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, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.ModalHeader, null, \"Global Price Update\"), /*#__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, null, /*#__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_2__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.FormLabel, null, \"Select Stores\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Select, {\n    value: selectedStores.includes(\"all\") ? \"all\" : selectedStores[0],\n    onChange: function onChange(e) {\n      return setSelectedStores([e.target.value]);\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"all\"\n  }, \"All Stores\"), stores.map(function (store) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      key: store.id,\n      value: store.id.toString()\n    }, store.name, \" \", store.is_current === \"1\" || store.is_current === 1 ? \"(Current)\" : \"\");\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, \"Action\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.HStack, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Select, {\n    value: direction,\n    onChange: function onChange(e) {\n      return setDirection(e.target.value);\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"increase\"\n  }, \"Increase Price\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n    value: \"decrease\"\n  }, \"Decrease Price\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Select, {\n    value: type,\n    onChange: function onChange(e) {\n      return setType(e.target.value);\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_2__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.FormLabel, null, \"Value\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Input, {\n    type: \"number\",\n    placeholder: \"Enter \".concat(type === 'percentage' ? '%' : 'amount', \" to \").concat(direction),\n    value: amount,\n    onChange: function onChange(e) {\n      return setAmount(e.target.value);\n    }\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, \"Specific Category (Optional)\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.Select, {\n    placeholder: \"All Categories\",\n    value: categoryId,\n    onChange: function onChange(e) {\n      return setCategoryId(e.target.value);\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  }))))), /*#__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    isDisabled: isUpdating\n  }, \"Cancel\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Button, {\n    colorScheme: \"blue\",\n    onClick: handleUpdate,\n    isLoading: isUpdating,\n    isDisabled: !amount || amount <= 0\n  }, \"Apply Global Update\"))));\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/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/checkbox/checkbox.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-group.mjs\");\n/* harmony import */ var _chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__ = __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_5__ = __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_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/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/toast/use-toast.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_16__ = __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 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\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_15__.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    }),\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  (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, allStores, _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_16__[\"default\"].get(\"/api/stores\");\n          case 1:\n            res = _context.v;\n            allStores = ((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.stores) || []; // filter out the current store since we pull from it\n            setStores(allStores.filter(function (s) {\n              return s.is_current === \"0\" || s.is_current === 0;\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 _ref2.apply(this, arguments);\n    };\n  }();\n  var handleSync = /*#__PURE__*/function () {\n    var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {\n      var _resStores$data, resStores, currentStore, payload, _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            _context2.p = 2;\n            _context2.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_16__[\"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_16__[\"default\"].post(\"/api/store-manager/sync-products\", payload);\n          case 4:\n            toast({\n              title: \"Products synced successfully\",\n              status: \"success\",\n              duration: 3000\n            });\n            onClose();\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  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_11__.Modal, {\n    isOpen: isOpen,\n    onClose: onClose,\n    size: \"md\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_10__.ModalOverlay, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_12__.ModalContent, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_9__.ModalHeader, null, \"Sync Products (\", selectedProductIds.length, \" selected)\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_7__.ModalCloseButton, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_6__.ModalBody, null, /*#__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_4__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.FormLabel, null, \"Target Stores\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.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_13__.Stack, {\n    spacing: 2\n  }, stores.map(function (store) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Checkbox, {\n      key: store.id,\n      value: store.id.toString()\n    }, store.name);\n  }), stores.length === 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n    style: {\n      color: \"gray\"\n    }\n  }, \"No target stores available. Please add them first.\")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.FormControl, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_5__.FormLabel, null, \"What to sync?\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_13__.Stack, {\n    spacing: 2\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Checkbox, {\n    isChecked: options.price,\n    onChange: function onChange(e) {\n      return setOptions(_objectSpread(_objectSpread({}, options), {}, {\n        price: e.target.checked\n      }));\n    }\n  }, \"Price\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Checkbox, {\n    isChecked: options.stock,\n    onChange: function onChange(e) {\n      return setOptions(_objectSpread(_objectSpread({}, options), {}, {\n        stock: e.target.checked\n      }));\n    }\n  }, \"Stock Status & Quantity\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Checkbox, {\n    isChecked: options.description,\n    onChange: function onChange(e) {\n      return setOptions(_objectSpread(_objectSpread({}, options), {}, {\n        description: e.target.checked\n      }));\n    }\n  }, \"Description\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Checkbox, {\n    isChecked: options.image,\n    onChange: function onChange(e) {\n      return setOptions(_objectSpread(_objectSpread({}, options), {}, {\n        image: e.target.checked\n      }));\n    }\n  }, \"Images\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_8__.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    isDisabled: isSyncing\n  }, \"Cancel\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.Button, {\n    colorScheme: \"blue\",\n    onClick: handleSync,\n    isLoading: isSyncing,\n    isDisabled: selectedStores.length === 0\n  }, \"Start Sync\"))));\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/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\");\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 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 _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.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  })), /*#__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/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/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/table-container.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/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/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 framer_motion__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! framer-motion */ \"./node_modules/framer-motion/dist/es/render/dom/motion.mjs\");\n/* harmony import */ var framer_motion__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! framer-motion */ \"./node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! react-hot-toast */ \"./node_modules/react-hot-toast/dist/index.mjs\");\n/* harmony import */ var _Components_shared_ConfirmDialog__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../../../Components/shared/ConfirmDialog */ \"./src/Components/shared/ConfirmDialog.jsx\");\n/* harmony import */ var _Components_shared_ProFeatureModal__WEBPACK_IMPORTED_MODULE_39__ = __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\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  // 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 _useDisclosure3 = (0,_chakra_ui_react__WEBPACK_IMPORTED_MODULE_1__.useDisclosure)(),\n    isProModalOpen = _useDisclosure3.isOpen,\n    onProModalOpen = _useDisclosure3.onOpen,\n    onProModalClose = _useDisclosure3.onClose;\n  var fetchStores = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n    var _response$data, response, _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_36__[\"default\"].get('/api/stores');\n        case 2:\n          response = _context.v;\n          setStores(((_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.stores) || []);\n          _context.n = 4;\n          break;\n        case 3:\n          _context.p = 3;\n          _t = _context.v;\n          react_hot_toast__WEBPACK_IMPORTED_MODULE_37__[\"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  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n    fetchStores();\n  }, [fetchStores]);\n  var handleStoreSelect = /*#__PURE__*/function () {\n    var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(store) {\n      var _t2;\n      return _regenerator().w(function (_context2) {\n        while (1) switch (_context2.p = _context2.n) {\n          case 0:\n            if (!loadingStoreId) {\n              _context2.n = 1;\n              break;\n            }\n            return _context2.a(2);\n          case 1:\n            setLoadingStoreId(store.id);\n            _context2.p = 2;\n            _context2.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_36__[\"default\"].post('/api/stores/switch', {\n              store_id: store.id\n            });\n          case 3:\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_37__[\"default\"].success('Switched to ' + store.name);\n            window.location.reload();\n            _context2.n = 5;\n            break;\n          case 4:\n            _context2.p = 4;\n            _t2 = _context2.v;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_37__[\"default\"].error('Failed to switch store');\n          case 5:\n            _context2.p = 5;\n            setLoadingStoreId(null);\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 handleStoreSelect(_x) {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n  var handleAddStore = /*#__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            if (!(!newStore.url || !newStore.consumer_key || !newStore.consumer_secret)) {\n              _context3.n = 1;\n              break;\n            }\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_37__[\"default\"].error('Please fill in all required fields');\n            return _context3.a(2);\n          case 1:\n            setIsSaving(true);\n            _context3.p = 2;\n            _context3.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_36__[\"default\"].post('/api/stores', newStore);\n          case 3:\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_37__[\"default\"].success('Store added successfully');\n            onClose();\n            setNewStore({\n              name: '',\n              url: '',\n              consumer_key: '',\n              consumer_secret: ''\n            });\n            fetchStores();\n            _context3.n = 5;\n            break;\n          case 4:\n            _context3.p = 4;\n            _t3 = _context3.v;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_37__[\"default\"].error('Failed to add store');\n          case 5:\n            _context3.p = 5;\n            setIsSaving(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 handleAddStore() {\n      return _ref3.apply(this, arguments);\n    };\n  }();\n  var handleDeleteClick = function handleDeleteClick(store) {\n    setStoreToDelete(store);\n    onConfirmOpen();\n  };\n  var handleConfirmDelete = /*#__PURE__*/function () {\n    var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {\n      var _t4;\n      return _regenerator().w(function (_context4) {\n        while (1) switch (_context4.p = _context4.n) {\n          case 0:\n            if (storeToDelete) {\n              _context4.n = 1;\n              break;\n            }\n            return _context4.a(2);\n          case 1:\n            setIsDeleting(true);\n            _context4.p = 2;\n            _context4.n = 3;\n            return axios__WEBPACK_IMPORTED_MODULE_36__[\"default\"][\"delete\"](\"/api/stores/\".concat(storeToDelete.id));\n          case 3:\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_37__[\"default\"].success('Store removed');\n            fetchStores();\n            _context4.n = 5;\n            break;\n          case 4:\n            _context4.p = 4;\n            _t4 = _context4.v;\n            react_hot_toast__WEBPACK_IMPORTED_MODULE_37__[\"default\"].error('Failed to remove store');\n          case 5:\n            _context4.p = 5;\n            setIsDeleting(false);\n            setStoreToDelete(null);\n            onConfirmClose();\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 handleConfirmDelete() {\n      return _ref4.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_22__.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_21__.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_22__.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_31__.Heading, {\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_32__.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_4__.Button, {\n    leftIcon: canAddStore ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.FiPlus, null) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_icons_fi__WEBPACK_IMPORTED_MODULE_33__.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_31__.Heading, {\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_33__.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_24__.TableContainer, {\n    overflowX: \"auto\",\n    w: \"100%\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_23__.Table, {\n    variant: \"simple\"\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, {\n    color: \"gray.500\",\n    fontWeight: \"800\"\n  }, \"Store\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Th, {\n    color: \"gray.500\",\n    fontWeight: \"800\"\n  }, \"URL\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.Th, {\n    color: \"gray.500\",\n    fontWeight: \"800\"\n  }, \"Status\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_27__.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_25__.Tbody, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(framer_motion__WEBPACK_IMPORTED_MODULE_35__.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_29__.Tr, {\n      key: store.id,\n      as: framer_motion__WEBPACK_IMPORTED_MODULE_34__.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      cursor: \"pointer\",\n      onClick: function onClick() {\n        return handleStoreSelect(store);\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_26__.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_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_32__.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_26__.Td, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_32__.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_26__.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_26__.Td, {\n      textAlign: \"right\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.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_30__.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_33__.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_33__.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_32__.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_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_22__.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_32__.Text, {\n    fontSize: \"xs\",\n    color: \"gray.400\",\n    mt: 2,\n    fontWeight: \"500\"\n  }, \"Must include https://\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_21__.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_32__.Text, {\n    my: 0,\n    fontSize: \"xs\",\n    color: \"blue.600\",\n    fontWeight: \"600\"\n  }, 'Tip: 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_38__[\"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_ProFeatureModal__WEBPACK_IMPORTED_MODULE_39__[\"default\"], {\n    isOpen: isProModalOpen,\n    onClose: onProModalClose,\n    description: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null, \"Managing multiple stores is a premium feature. Upgrade to \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"b\", null, \"ShopCentral Pro\"), \" to connect unlimited stores and sync data across your entire network.\")\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(type.charAt(0).toUpperCase() + type.slice(1), \" 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(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 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              // Generate a printable HTML window layout\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\n              // Allow styles to load before print dialog\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  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: 3\n    },\n    spacing: 8\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: 'blue.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: 10\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    p: 4,\n    bg: \"blue.50\",\n    color: \"blue.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__.FiPackage,\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  }, \"Product Master Export\"), /*#__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: 6\n  }, \"Backups up every single product ID, price, stock quantity, and remote origin into a unified CSV file.\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n    colorScheme: \"blue\",\n    mb: 6,\n    px: 2,\n    borderRadius: \"full\"\n  }, \"All Stores\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    w: \"full\",\n    colorScheme: isPro ? \"blue\" : \"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 === 'products',\n    loadingText: \"Extracting...\",\n    onClick: function onClick() {\n      return isPro ? handleExportCSV('products') : onProModalOpen();\n    }\n  }, isPro ? 'Export Products (.csv)' : 'Upgrade to Export'))), /*#__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: 'green.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: 10\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_3__.Box, {\n    p: 4,\n    bg: \"green.50\",\n    color: \"green.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__.FiShoppingCart,\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  }, \"Universal Order Log\"), /*#__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: 6\n  }, \"Aggregates multi-store financial transaction data based on your selected date period.\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_2__.Badge, {\n    colorScheme: \"green\",\n    mb: 6,\n    px: 2,\n    borderRadius: \"full\"\n  }, period === 'all' ? 'All Time' : period === 'month' ? 'This Month' : 'This Year'), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_chakra_ui_react__WEBPACK_IMPORTED_MODULE_4__.Button, {\n    w: \"full\",\n    colorScheme: isPro ? \"green\" : \"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 === 'orders',\n    loadingText: \"Extracting...\",\n    onClick: function onClick() {\n      return isPro ? handleExportCSV('orders') : onProModalOpen();\n    }\n  }, isPro ? 'Export Orders (.csv)' : 'Upgrade to Export'))), /*#__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: 10\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: 6\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: 6,\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    description: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null, \"Data export tools are exclusive to \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"b\", null, \"ShopCentral Pro\"), \". Upgrade now to download unified CSVs and deep-dive records from all your connected WooCommerce stores.\")\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__);
/******/ 	
/******/ })()
;