@burdenoff/microfe-adaptercloud 2026.625.2 → 2026.628.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adaptercloud/AdapterCloudRoot.js +65 -121
- package/dist/adaptercloud/AdapterCloudRoot.js.map +1 -1
- package/dist/adaptercloud/AdapterCloudRoutes.js +70 -182
- package/dist/adaptercloud/AdapterCloudRoutes.js.map +1 -1
- package/dist/adaptercloud/components/DataState.js +42 -0
- package/dist/adaptercloud/components/DataState.js.map +1 -0
- package/dist/adaptercloud/components/SeverityBadge.js +12 -0
- package/dist/adaptercloud/components/SeverityBadge.js.map +1 -0
- package/dist/adaptercloud/components/StatusBadge.js +43 -44
- package/dist/adaptercloud/components/StatusBadge.js.map +1 -1
- package/dist/adaptercloud/context/AdapterCloudContext.js +22 -30
- package/dist/adaptercloud/context/AdapterCloudContext.js.map +1 -1
- package/dist/adaptercloud/hooks/useAdapterCloudApi.js +397 -194
- package/dist/adaptercloud/hooks/useAdapterCloudApi.js.map +1 -1
- package/dist/adaptercloud/index.js +1 -0
- package/dist/adaptercloud/pages/OverviewPage.js +334 -0
- package/dist/adaptercloud/pages/OverviewPage.js.map +1 -0
- package/dist/adaptercloud/pages/adapters/AdapterDetailPage.js +187 -0
- package/dist/adaptercloud/pages/adapters/AdapterDetailPage.js.map +1 -0
- package/dist/adaptercloud/pages/adapters/AdapterFormPage.js +278 -0
- package/dist/adaptercloud/pages/adapters/AdapterFormPage.js.map +1 -0
- package/dist/adaptercloud/pages/adapters/AdaptersListPage.js +172 -0
- package/dist/adaptercloud/pages/adapters/AdaptersListPage.js.map +1 -0
- package/dist/adaptercloud/pages/connections/ConnectionDetailPage.js +247 -0
- package/dist/adaptercloud/pages/connections/ConnectionDetailPage.js.map +1 -0
- package/dist/adaptercloud/pages/connections/ConnectionFormPage.js +271 -0
- package/dist/adaptercloud/pages/connections/ConnectionFormPage.js.map +1 -0
- package/dist/adaptercloud/pages/connections/ConnectionsListPage.js +167 -0
- package/dist/adaptercloud/pages/connections/ConnectionsListPage.js.map +1 -0
- package/dist/adaptercloud/pages/costs/CostsPage.js +169 -0
- package/dist/adaptercloud/pages/costs/CostsPage.js.map +1 -0
- package/dist/adaptercloud/pages/drift/DriftListPage.js +132 -0
- package/dist/adaptercloud/pages/drift/DriftListPage.js.map +1 -0
- package/dist/adaptercloud/pages/policies/PoliciesListPage.js +171 -0
- package/dist/adaptercloud/pages/policies/PoliciesListPage.js.map +1 -0
- package/dist/adaptercloud/pages/policies/PolicyDetailPage.js +185 -0
- package/dist/adaptercloud/pages/policies/PolicyDetailPage.js.map +1 -0
- package/dist/adaptercloud/pages/policies/PolicyFormPage.js +215 -0
- package/dist/adaptercloud/pages/policies/PolicyFormPage.js.map +1 -0
- package/dist/adaptercloud/pages/resources/ResourceDetailPage.js +207 -0
- package/dist/adaptercloud/pages/resources/ResourceDetailPage.js.map +1 -0
- package/dist/adaptercloud/pages/resources/ResourcesListPage.js +182 -0
- package/dist/adaptercloud/pages/resources/ResourcesListPage.js.map +1 -0
- package/dist/adaptercloud/pages/sync-runs/SyncRunsListPage.js +196 -0
- package/dist/adaptercloud/pages/sync-runs/SyncRunsListPage.js.map +1 -0
- package/dist/adaptercloud/pages/violations/ViolationsListPage.js +258 -0
- package/dist/adaptercloud/pages/violations/ViolationsListPage.js.map +1 -0
- package/dist/adaptercloud/store/adaptercloudStore.js +1 -7
- package/dist/adaptercloud/store/adaptercloudStore.js.map +1 -1
- package/dist/adaptercloud/utils/domain.js +105 -0
- package/dist/adaptercloud/utils/domain.js.map +1 -0
- package/dist/adaptercloud/utils/formatters.js +1 -12
- package/dist/adaptercloud/utils/formatters.js.map +1 -1
- package/dist/index.js +5 -4
- package/package.json +1 -1
- package/dist/adaptercloud/components/InvestmentCard.js +0 -98
- package/dist/adaptercloud/components/InvestmentCard.js.map +0 -1
- package/dist/adaptercloud/components/RatingDisplay.js +0 -35
- package/dist/adaptercloud/components/RatingDisplay.js.map +0 -1
- package/dist/adaptercloud/mocks/data.js +0 -1517
- package/dist/adaptercloud/mocks/data.js.map +0 -1
- package/dist/adaptercloud/mocks/users.js +0 -34
- package/dist/adaptercloud/mocks/users.js.map +0 -1
- package/dist/adaptercloud/pages/HomePage.js +0 -934
- package/dist/adaptercloud/pages/HomePage.js.map +0 -1
- package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js +0 -653
- package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js.map +0 -1
- package/dist/adaptercloud/pages/admin/AdminDashboard.js +0 -665
- package/dist/adaptercloud/pages/admin/AdminDashboard.js.map +0 -1
- package/dist/adaptercloud/pages/admin/AdminFinancialPage.js +0 -426
- package/dist/adaptercloud/pages/admin/AdminFinancialPage.js.map +0 -1
- package/dist/adaptercloud/pages/admin/AdminOrdersPage.js +0 -665
- package/dist/adaptercloud/pages/admin/AdminOrdersPage.js.map +0 -1
- package/dist/adaptercloud/pages/admin/AdminProfilePage.js +0 -261
- package/dist/adaptercloud/pages/admin/AdminProfilePage.js.map +0 -1
- package/dist/adaptercloud/pages/admin/AdminSettingsPage.js +0 -663
- package/dist/adaptercloud/pages/admin/AdminSettingsPage.js.map +0 -1
- package/dist/adaptercloud/pages/admin/CartManagementPage.js +0 -874
- package/dist/adaptercloud/pages/admin/CartManagementPage.js.map +0 -1
- package/dist/adaptercloud/pages/admin/UserManagementPage.js +0 -898
- package/dist/adaptercloud/pages/admin/UserManagementPage.js.map +0 -1
- package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js +0 -840
- package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js.map +0 -1
- package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js +0 -714
- package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js.map +0 -1
- package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js +0 -788
- package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js.map +0 -1
- package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js +0 -888
- package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js.map +0 -1
- package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js +0 -634
- package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js.map +0 -1
- package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js +0 -907
- package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js.map +0 -1
- package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js +0 -875
- package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js.map +0 -1
- package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js +0 -827
- package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js.map +0 -1
- package/dist/adaptercloud/pages/common/HelpSupportPage.js +0 -1329
- package/dist/adaptercloud/pages/common/HelpSupportPage.js.map +0 -1
- package/dist/adaptercloud/pages/common/NotificationCenterPage.js +0 -671
- package/dist/adaptercloud/pages/common/NotificationCenterPage.js.map +0 -1
- package/dist/adaptercloud/pages/common/SettingsPage.js +0 -982
- package/dist/adaptercloud/pages/common/SettingsPage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/BookingDetailsPage.js +0 -596
- package/dist/adaptercloud/pages/customer/BookingDetailsPage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/CartDetailPage.js +0 -623
- package/dist/adaptercloud/pages/customer/CartDetailPage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js +0 -552
- package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/CheckoutPage.js +0 -534
- package/dist/adaptercloud/pages/customer/CheckoutPage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/CustomerDashboard.js +0 -525
- package/dist/adaptercloud/pages/customer/CustomerDashboard.js.map +0 -1
- package/dist/adaptercloud/pages/customer/CustomerProfilePage.js +0 -623
- package/dist/adaptercloud/pages/customer/CustomerProfilePage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js +0 -629
- package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/FavoritesPage.js +0 -480
- package/dist/adaptercloud/pages/customer/FavoritesPage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/OrderHistoryPage.js +0 -444
- package/dist/adaptercloud/pages/customer/OrderHistoryPage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/OrderTrackingPage.js +0 -391
- package/dist/adaptercloud/pages/customer/OrderTrackingPage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js +0 -504
- package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/ReviewsPage.js +0 -609
- package/dist/adaptercloud/pages/customer/ReviewsPage.js.map +0 -1
- package/dist/adaptercloud/pages/customer/SavedAddressesPage.js +0 -459
- package/dist/adaptercloud/pages/customer/SavedAddressesPage.js.map +0 -1
- package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js +0 -851
- package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js.map +0 -1
- package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js +0 -942
- package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js.map +0 -1
- package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js +0 -683
- package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js.map +0 -1
- package/dist/adaptercloud/pages/investor/InvestorDashboard.js +0 -452
- package/dist/adaptercloud/pages/investor/InvestorDashboard.js.map +0 -1
- package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js +0 -402
- package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js.map +0 -1
- package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js +0 -571
- package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js.map +0 -1
- package/dist/adaptercloud/pages/investor/InvestorProfilePage.js +0 -1067
- package/dist/adaptercloud/pages/investor/InvestorProfilePage.js.map +0 -1
- package/dist/adaptercloud/pages/worker/TaskDetailsPage.js +0 -526
- package/dist/adaptercloud/pages/worker/TaskDetailsPage.js.map +0 -1
- package/dist/adaptercloud/pages/worker/WorkerDashboard.js +0 -659
- package/dist/adaptercloud/pages/worker/WorkerDashboard.js.map +0 -1
- package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js +0 -678
- package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js.map +0 -1
- package/dist/adaptercloud/pages/worker/WorkerProfilePage.js +0 -689
- package/dist/adaptercloud/pages/worker/WorkerProfilePage.js.map +0 -1
- package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js +0 -582
- package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js.map +0 -1
|
@@ -1,907 +0,0 @@
|
|
|
1
|
-
import { useAdapterCloud as e } from "../../context/AdapterCloudContext.js";
|
|
2
|
-
import { cn as t } from "../../utils/cn.js";
|
|
3
|
-
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
|
-
import { EmptyState as r } from "../../components/EmptyState.js";
|
|
5
|
-
import { formatCurrency as i } from "../../utils/formatters.js";
|
|
6
|
-
import { mockProducts as ee } from "../../mocks/data.js";
|
|
7
|
-
import { useMemo as a, useState as o } from "react";
|
|
8
|
-
import { AlertCircle as te, CheckCircle2 as ne, Edit2 as re, Package as s, Plus as c, Search as l, Trash2 as ie, Upload as ae, X as oe } from "lucide-react";
|
|
9
|
-
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
10
|
-
import { EmphasisPanel as p } from "@burdenoff/fe-libs/ui";
|
|
11
|
-
//#region src/adaptercloud/pages/cart-owner/InventoryManagementPage.tsx
|
|
12
|
-
var m = [
|
|
13
|
-
"Service",
|
|
14
|
-
"Repair",
|
|
15
|
-
"Beauty",
|
|
16
|
-
"Care",
|
|
17
|
-
"Cleaning",
|
|
18
|
-
"Health",
|
|
19
|
-
"Wellness",
|
|
20
|
-
"Education"
|
|
21
|
-
], h = (e) => m.some((t) => e.includes(t)), g = (e) => e === "Food & Beverage", _ = [
|
|
22
|
-
10,
|
|
23
|
-
25,
|
|
24
|
-
0,
|
|
25
|
-
50,
|
|
26
|
-
8,
|
|
27
|
-
15,
|
|
28
|
-
3,
|
|
29
|
-
100,
|
|
30
|
-
42,
|
|
31
|
-
0,
|
|
32
|
-
20,
|
|
33
|
-
6,
|
|
34
|
-
35,
|
|
35
|
-
18,
|
|
36
|
-
12,
|
|
37
|
-
30,
|
|
38
|
-
5,
|
|
39
|
-
22,
|
|
40
|
-
0,
|
|
41
|
-
45
|
|
42
|
-
], se = () => ee.slice(0, 20).map((e, t) => ({
|
|
43
|
-
id: e.id,
|
|
44
|
-
name: e.name,
|
|
45
|
-
description: e.description ?? `${e.name} - quality offering from ${e.cartName}`,
|
|
46
|
-
price: e.price,
|
|
47
|
-
originalPrice: t % 4 == 0 ? Math.round(e.price * 1.2) : void 0,
|
|
48
|
-
category: e.category,
|
|
49
|
-
stock: _[t] ?? 10,
|
|
50
|
-
isAvailable: t !== 2 && t !== 9 && t !== 18,
|
|
51
|
-
cartName: e.cartName,
|
|
52
|
-
preparationTime: 15,
|
|
53
|
-
calories: g(e.category) ? Math.floor(Math.random() * 400) + 100 : 0,
|
|
54
|
-
isVegetarian: t % 3 == 0,
|
|
55
|
-
isVegan: t % 5 == 0,
|
|
56
|
-
isGlutenFree: t % 7 == 0,
|
|
57
|
-
spiceLevel: [
|
|
58
|
-
"mild",
|
|
59
|
-
"medium",
|
|
60
|
-
"spicy",
|
|
61
|
-
"none"
|
|
62
|
-
][t % 4],
|
|
63
|
-
tags: [
|
|
64
|
-
"popular",
|
|
65
|
-
"trending",
|
|
66
|
-
"new"
|
|
67
|
-
].slice(0, t % 3 + 1),
|
|
68
|
-
allergens: g(e.category) ? ["nuts", "dairy"].slice(0, t % 2 + 1) : [],
|
|
69
|
-
duration: h(e.category) ? 30 + t * 5 : 0,
|
|
70
|
-
serviceType: h(e.category) ? [
|
|
71
|
-
"instant",
|
|
72
|
-
"appointment",
|
|
73
|
-
"recurring",
|
|
74
|
-
"consultation"
|
|
75
|
-
][t % 4] : "",
|
|
76
|
-
requirements: h(e.category) ? ["advance booking"] : []
|
|
77
|
-
})), v = {
|
|
78
|
-
name: "",
|
|
79
|
-
description: "",
|
|
80
|
-
category: "",
|
|
81
|
-
price: 0,
|
|
82
|
-
originalPrice: void 0,
|
|
83
|
-
isAvailable: !0,
|
|
84
|
-
stock: 0,
|
|
85
|
-
preparationTime: 15,
|
|
86
|
-
calories: 0,
|
|
87
|
-
isVegetarian: !1,
|
|
88
|
-
isVegan: !1,
|
|
89
|
-
isGlutenFree: !1,
|
|
90
|
-
spiceLevel: "mild",
|
|
91
|
-
tags: [],
|
|
92
|
-
allergens: [],
|
|
93
|
-
duration: 30,
|
|
94
|
-
serviceType: "instant",
|
|
95
|
-
requirements: []
|
|
96
|
-
}, y = () => {
|
|
97
|
-
let { navigateTo: ee } = e(), [m, _] = o(se), [y, b] = o(""), [x, S] = o(""), [C, w] = o(""), [T, E] = o("name"), [ce, le] = o(!1), [ue, D] = o(!1), [O, k] = o(null), [A, j] = o(v), [M, N] = o(""), [P, F] = o(""), [I, L] = o(""), [R, z] = o(null), B = a(() => [...new Set(m.map((e) => e.category))].sort(), [m]), V = a(() => {
|
|
98
|
-
let e = [...m];
|
|
99
|
-
if (y) {
|
|
100
|
-
let t = y.toLowerCase();
|
|
101
|
-
e = e.filter((e) => e.name.toLowerCase().includes(t) || e.description.toLowerCase().includes(t) || e.category.toLowerCase().includes(t) || e.tags.some((e) => e.toLowerCase().includes(t)));
|
|
102
|
-
}
|
|
103
|
-
switch (x && (e = e.filter((e) => e.category === x)), C === "available" ? e = e.filter((e) => e.isAvailable) : C === "unavailable" && (e = e.filter((e) => !e.isAvailable)), T) {
|
|
104
|
-
case "name":
|
|
105
|
-
e.sort((e, t) => e.name.localeCompare(t.name));
|
|
106
|
-
break;
|
|
107
|
-
case "price_low":
|
|
108
|
-
e.sort((e, t) => e.price - t.price);
|
|
109
|
-
break;
|
|
110
|
-
case "price_high":
|
|
111
|
-
e.sort((e, t) => t.price - e.price);
|
|
112
|
-
break;
|
|
113
|
-
case "stock":
|
|
114
|
-
e.sort((e, t) => e.stock - t.stock);
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
return e;
|
|
118
|
-
}, [
|
|
119
|
-
m,
|
|
120
|
-
y,
|
|
121
|
-
x,
|
|
122
|
-
C,
|
|
123
|
-
T
|
|
124
|
-
]), H = m.length, U = m.filter((e) => e.isAvailable).length, de = m.filter((e) => !h(e.category) && e.stock === 0).length, fe = m.filter((e) => !h(e.category) && e.stock > 0 && e.stock < 10).length, W = (e, t) => {
|
|
125
|
-
z({
|
|
126
|
-
text: e,
|
|
127
|
-
type: t
|
|
128
|
-
}), setTimeout(() => z(null), 3e3);
|
|
129
|
-
}, G = () => {
|
|
130
|
-
k(null), j({
|
|
131
|
-
...v,
|
|
132
|
-
category: B[0] || ""
|
|
133
|
-
}), N(""), F(""), L(""), D(!0);
|
|
134
|
-
}, K = (e) => {
|
|
135
|
-
k(e), j({
|
|
136
|
-
name: e.name,
|
|
137
|
-
description: e.description,
|
|
138
|
-
category: e.category,
|
|
139
|
-
price: e.price,
|
|
140
|
-
originalPrice: e.originalPrice,
|
|
141
|
-
isAvailable: e.isAvailable,
|
|
142
|
-
stock: e.stock,
|
|
143
|
-
preparationTime: e.preparationTime,
|
|
144
|
-
calories: e.calories,
|
|
145
|
-
isVegetarian: e.isVegetarian,
|
|
146
|
-
isVegan: e.isVegan,
|
|
147
|
-
isGlutenFree: e.isGlutenFree,
|
|
148
|
-
spiceLevel: e.spiceLevel,
|
|
149
|
-
tags: e.tags,
|
|
150
|
-
allergens: e.allergens,
|
|
151
|
-
duration: e.duration,
|
|
152
|
-
serviceType: e.serviceType,
|
|
153
|
-
requirements: e.requirements
|
|
154
|
-
}), N(e.tags.join(", ")), F(e.allergens.join(", ")), L(e.requirements.join(", ")), D(!0);
|
|
155
|
-
}, pe = () => {
|
|
156
|
-
if (!A.name || !A.description || !A.category || A.price <= 0) {
|
|
157
|
-
W("Please fill all required fields (name, description, category, price > 0)", "error");
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
let e = M.split(",").map((e) => e.trim()).filter(Boolean), t = P.split(",").map((e) => e.trim()).filter(Boolean), n = I.split(",").map((e) => e.trim()).filter(Boolean), r = h(A.category) ? "Service" : "Product";
|
|
161
|
-
if (O) _((r) => r.map((r) => r.id === O.id ? {
|
|
162
|
-
...r,
|
|
163
|
-
...A,
|
|
164
|
-
tags: e,
|
|
165
|
-
allergens: t,
|
|
166
|
-
requirements: n
|
|
167
|
-
} : r)), W(`${r} updated successfully`, "success");
|
|
168
|
-
else {
|
|
169
|
-
let i = {
|
|
170
|
-
id: `item-${Date.now()}`,
|
|
171
|
-
...A,
|
|
172
|
-
tags: e,
|
|
173
|
-
allergens: t,
|
|
174
|
-
requirements: n,
|
|
175
|
-
cartName: "Dosa Express"
|
|
176
|
-
};
|
|
177
|
-
_((e) => [i, ...e]), W(`${r} added successfully`, "success");
|
|
178
|
-
}
|
|
179
|
-
D(!1);
|
|
180
|
-
}, q = (e) => {
|
|
181
|
-
confirm("Are you sure you want to delete this offering?") && (_((t) => t.filter((t) => t.id !== e)), W("Offering deleted successfully", "success"));
|
|
182
|
-
}, J = (e, t) => {
|
|
183
|
-
_((n) => n.map((n) => n.id === e ? {
|
|
184
|
-
...n,
|
|
185
|
-
isAvailable: t
|
|
186
|
-
} : n)), W(`Offering ${t ? "enabled" : "disabled"} successfully`, "success");
|
|
187
|
-
}, Y = (e) => {
|
|
188
|
-
let t = e === "enable", n = m.filter((e) => e.isAvailable !== t).length;
|
|
189
|
-
if (n === 0) {
|
|
190
|
-
W(`No offerings to ${e}`, "error");
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
_((e) => e.map((e) => ({
|
|
194
|
-
...e,
|
|
195
|
-
isAvailable: t
|
|
196
|
-
}))), W(`${n} offerings ${e}d successfully`, "success");
|
|
197
|
-
}, X = (e) => h(e.category) ? {
|
|
198
|
-
color: "text-status-success-text",
|
|
199
|
-
label: "Available"
|
|
200
|
-
} : e.stock === 0 ? {
|
|
201
|
-
color: "text-status-error-text",
|
|
202
|
-
label: "Out of Stock"
|
|
203
|
-
} : e.stock < 10 ? {
|
|
204
|
-
color: "text-status-warning-text",
|
|
205
|
-
label: `Low Stock (${e.stock})`
|
|
206
|
-
} : {
|
|
207
|
-
color: "text-status-success-text",
|
|
208
|
-
label: `In Stock (${e.stock})`
|
|
209
|
-
}, Z = A.category ? h(A.category) : !1, me = A.category ? g(A.category) : !1, Q = !Z && me, $ = A.name && A.description && A.category && A.price > 0 && (!Z || A.duration && A.duration > 0) && (Z || A.stock >= 0);
|
|
210
|
-
return /* @__PURE__ */ f(n, {
|
|
211
|
-
title: "Offerings Management",
|
|
212
|
-
description: "Manage your products and services",
|
|
213
|
-
purpose: "Build the menu customers order from — add products and services, set prices and photos, and keep stock and availability up to date. Anything you list and mark available here is instantly bookable by customers.",
|
|
214
|
-
actions: /* @__PURE__ */ f("button", {
|
|
215
|
-
type: "button",
|
|
216
|
-
onClick: G,
|
|
217
|
-
className: "inline-flex items-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent/80 transition-colors",
|
|
218
|
-
children: [/* @__PURE__ */ d(c, { className: "h-4 w-4" }), "Add Item"]
|
|
219
|
-
}),
|
|
220
|
-
children: [/* @__PURE__ */ f("div", {
|
|
221
|
-
className: "space-y-4",
|
|
222
|
-
children: [
|
|
223
|
-
R && /* @__PURE__ */ f("div", {
|
|
224
|
-
className: t("flex items-center gap-2 rounded-lg border p-3", R.type === "success" ? "border-status-success-border/30 bg-status-success-bg-subtle/10" : "border-status-error-border/30 bg-status-error-bg-subtle/10"),
|
|
225
|
-
children: [R.type === "success" ? /* @__PURE__ */ d(ne, { className: "h-4 w-4 text-status-success-text" }) : /* @__PURE__ */ d(te, { className: "h-4 w-4 text-status-error-text" }), /* @__PURE__ */ d("span", {
|
|
226
|
-
className: t("text-sm font-medium", R.type === "success" ? "text-status-success-text" : "text-status-error-text"),
|
|
227
|
-
children: R.text
|
|
228
|
-
})]
|
|
229
|
-
}),
|
|
230
|
-
/* @__PURE__ */ d(p, { children: /* @__PURE__ */ f("div", {
|
|
231
|
-
className: "grid grid-cols-2 lg:grid-cols-4 gap-3",
|
|
232
|
-
children: [
|
|
233
|
-
/* @__PURE__ */ f("div", {
|
|
234
|
-
className: "rounded-lg border border-border-seam bg-bg-surface p-4 bg-gloss-card shadow-pop",
|
|
235
|
-
children: [/* @__PURE__ */ d("p", {
|
|
236
|
-
className: "text-xs text-text-secondary",
|
|
237
|
-
children: "Total Items"
|
|
238
|
-
}), /* @__PURE__ */ d("p", {
|
|
239
|
-
className: "text-2xl font-bold text-text-primary",
|
|
240
|
-
children: H
|
|
241
|
-
})]
|
|
242
|
-
}),
|
|
243
|
-
/* @__PURE__ */ f("div", {
|
|
244
|
-
className: "rounded-lg border border-border-seam bg-bg-surface p-4 bg-gloss-card shadow-pop",
|
|
245
|
-
children: [/* @__PURE__ */ d("p", {
|
|
246
|
-
className: "text-xs text-text-secondary",
|
|
247
|
-
children: "Available"
|
|
248
|
-
}), /* @__PURE__ */ d("p", {
|
|
249
|
-
className: "text-2xl font-bold text-status-success-text",
|
|
250
|
-
children: U
|
|
251
|
-
})]
|
|
252
|
-
}),
|
|
253
|
-
/* @__PURE__ */ f("div", {
|
|
254
|
-
className: "rounded-lg border border-border-seam bg-bg-surface p-4 bg-gloss-card shadow-pop",
|
|
255
|
-
children: [/* @__PURE__ */ d("p", {
|
|
256
|
-
className: "text-xs text-text-secondary",
|
|
257
|
-
children: "Out of Stock"
|
|
258
|
-
}), /* @__PURE__ */ d("p", {
|
|
259
|
-
className: "text-2xl font-bold text-status-error-text",
|
|
260
|
-
children: de
|
|
261
|
-
})]
|
|
262
|
-
}),
|
|
263
|
-
/* @__PURE__ */ f("div", {
|
|
264
|
-
className: "rounded-lg border border-border-seam bg-bg-surface p-4 bg-gloss-card shadow-pop",
|
|
265
|
-
children: [/* @__PURE__ */ d("p", {
|
|
266
|
-
className: "text-xs text-text-secondary",
|
|
267
|
-
children: "Low Stock"
|
|
268
|
-
}), /* @__PURE__ */ d("p", {
|
|
269
|
-
className: "text-2xl font-bold text-status-warning-text",
|
|
270
|
-
children: fe
|
|
271
|
-
})]
|
|
272
|
-
})
|
|
273
|
-
]
|
|
274
|
-
}) }),
|
|
275
|
-
/* @__PURE__ */ f("div", {
|
|
276
|
-
className: "rounded-lg border border-border-seam bg-bg-surface p-4 space-y-4 bg-gloss-card shadow-pop",
|
|
277
|
-
children: [/* @__PURE__ */ f("div", {
|
|
278
|
-
className: "flex flex-col lg:flex-row lg:items-center lg:justify-between gap-3",
|
|
279
|
-
children: [/* @__PURE__ */ f("div", {
|
|
280
|
-
className: "flex flex-wrap gap-2",
|
|
281
|
-
children: [
|
|
282
|
-
/* @__PURE__ */ f("button", {
|
|
283
|
-
type: "button",
|
|
284
|
-
onClick: G,
|
|
285
|
-
className: "inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent/80 transition-colors",
|
|
286
|
-
children: [/* @__PURE__ */ d(c, { className: "h-4 w-4" }), "Add Item"]
|
|
287
|
-
}),
|
|
288
|
-
/* @__PURE__ */ d("button", {
|
|
289
|
-
type: "button",
|
|
290
|
-
onClick: () => Y("enable"),
|
|
291
|
-
className: "rounded-md border border-border-subtle px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
|
|
292
|
-
children: "Enable All"
|
|
293
|
-
}),
|
|
294
|
-
/* @__PURE__ */ d("button", {
|
|
295
|
-
type: "button",
|
|
296
|
-
onClick: () => Y("disable"),
|
|
297
|
-
className: "rounded-md border border-border-subtle px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
|
|
298
|
-
children: "Disable All"
|
|
299
|
-
})
|
|
300
|
-
]
|
|
301
|
-
}), /* @__PURE__ */ f("button", {
|
|
302
|
-
type: "button",
|
|
303
|
-
onClick: () => alert("Import/Export feature coming soon!"),
|
|
304
|
-
className: "inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
|
|
305
|
-
children: [/* @__PURE__ */ d(ae, { className: "h-4 w-4" }), "Import/Export"]
|
|
306
|
-
})]
|
|
307
|
-
}), /* @__PURE__ */ f("div", {
|
|
308
|
-
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",
|
|
309
|
-
children: [
|
|
310
|
-
/* @__PURE__ */ f("div", {
|
|
311
|
-
className: "relative sm:col-span-2 lg:col-span-1",
|
|
312
|
-
children: [/* @__PURE__ */ d(l, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ d("input", {
|
|
313
|
-
type: "text",
|
|
314
|
-
placeholder: "Search offerings...",
|
|
315
|
-
value: y,
|
|
316
|
-
onChange: (e) => b(e.target.value),
|
|
317
|
-
className: "w-full rounded-md border border-border-subtle bg-bg-surface pl-10 pr-4 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
318
|
-
})]
|
|
319
|
-
}),
|
|
320
|
-
/* @__PURE__ */ f("select", {
|
|
321
|
-
value: x,
|
|
322
|
-
onChange: (e) => S(e.target.value),
|
|
323
|
-
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
324
|
-
children: [/* @__PURE__ */ d("option", {
|
|
325
|
-
value: "",
|
|
326
|
-
children: "All Categories"
|
|
327
|
-
}), B.map((e) => /* @__PURE__ */ d("option", {
|
|
328
|
-
value: e,
|
|
329
|
-
children: e
|
|
330
|
-
}, e))]
|
|
331
|
-
}),
|
|
332
|
-
/* @__PURE__ */ f("select", {
|
|
333
|
-
value: C,
|
|
334
|
-
onChange: (e) => w(e.target.value),
|
|
335
|
-
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
336
|
-
children: [
|
|
337
|
-
/* @__PURE__ */ d("option", {
|
|
338
|
-
value: "",
|
|
339
|
-
children: "All Status"
|
|
340
|
-
}),
|
|
341
|
-
/* @__PURE__ */ d("option", {
|
|
342
|
-
value: "available",
|
|
343
|
-
children: "Available"
|
|
344
|
-
}),
|
|
345
|
-
/* @__PURE__ */ d("option", {
|
|
346
|
-
value: "unavailable",
|
|
347
|
-
children: "Unavailable"
|
|
348
|
-
})
|
|
349
|
-
]
|
|
350
|
-
}),
|
|
351
|
-
/* @__PURE__ */ f("select", {
|
|
352
|
-
value: T,
|
|
353
|
-
onChange: (e) => E(e.target.value),
|
|
354
|
-
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
355
|
-
children: [
|
|
356
|
-
/* @__PURE__ */ d("option", {
|
|
357
|
-
value: "name",
|
|
358
|
-
children: "Name A-Z"
|
|
359
|
-
}),
|
|
360
|
-
/* @__PURE__ */ d("option", {
|
|
361
|
-
value: "price_low",
|
|
362
|
-
children: "Price: Low to High"
|
|
363
|
-
}),
|
|
364
|
-
/* @__PURE__ */ d("option", {
|
|
365
|
-
value: "price_high",
|
|
366
|
-
children: "Price: High to Low"
|
|
367
|
-
}),
|
|
368
|
-
/* @__PURE__ */ d("option", {
|
|
369
|
-
value: "stock",
|
|
370
|
-
children: "Stock: Low to High"
|
|
371
|
-
})
|
|
372
|
-
]
|
|
373
|
-
})
|
|
374
|
-
]
|
|
375
|
-
})]
|
|
376
|
-
}),
|
|
377
|
-
V.length === 0 ? /* @__PURE__ */ d(r, {
|
|
378
|
-
illustration: y || x || C ? "empty-search" : "empty-files",
|
|
379
|
-
title: "No Items Found",
|
|
380
|
-
description: y || x || C ? "No items match your current filters. Try adjusting your search criteria." : "You haven't added any items yet. Start building your offerings!",
|
|
381
|
-
action: /* @__PURE__ */ f("div", {
|
|
382
|
-
className: "flex flex-wrap justify-center gap-3",
|
|
383
|
-
children: [/* @__PURE__ */ f("button", {
|
|
384
|
-
type: "button",
|
|
385
|
-
onClick: G,
|
|
386
|
-
className: "inline-flex items-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent/80",
|
|
387
|
-
children: [/* @__PURE__ */ d(c, { className: "h-4 w-4" }), "Add Your First Item"]
|
|
388
|
-
}), (y || x || C) && /* @__PURE__ */ d("button", {
|
|
389
|
-
type: "button",
|
|
390
|
-
onClick: () => {
|
|
391
|
-
b(""), S(""), w(""), E("name");
|
|
392
|
-
},
|
|
393
|
-
className: "rounded-md border border-border-subtle px-4 py-2 text-sm text-text-primary hover:bg-bg-sunken",
|
|
394
|
-
children: "Clear Filters"
|
|
395
|
-
})]
|
|
396
|
-
})
|
|
397
|
-
}) : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", {
|
|
398
|
-
className: "hidden lg:block rounded-lg border border-border-subtle bg-bg-surface shadow-sm overflow-hidden",
|
|
399
|
-
children: /* @__PURE__ */ d("div", {
|
|
400
|
-
className: "overflow-x-auto",
|
|
401
|
-
children: /* @__PURE__ */ f("table", {
|
|
402
|
-
className: "w-full text-sm",
|
|
403
|
-
children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ f("tr", {
|
|
404
|
-
className: "border-b border-border-subtle bg-bg-sunken/50",
|
|
405
|
-
children: [
|
|
406
|
-
/* @__PURE__ */ d("th", {
|
|
407
|
-
className: "px-5 py-3 text-left font-medium text-text-secondary",
|
|
408
|
-
children: "Item"
|
|
409
|
-
}),
|
|
410
|
-
/* @__PURE__ */ d("th", {
|
|
411
|
-
className: "px-5 py-3 text-left font-medium text-text-secondary",
|
|
412
|
-
children: "Category"
|
|
413
|
-
}),
|
|
414
|
-
/* @__PURE__ */ d("th", {
|
|
415
|
-
className: "px-5 py-3 text-right font-medium text-text-secondary",
|
|
416
|
-
children: "Price"
|
|
417
|
-
}),
|
|
418
|
-
/* @__PURE__ */ d("th", {
|
|
419
|
-
className: "px-5 py-3 text-left font-medium text-text-secondary",
|
|
420
|
-
children: "Stock/Status"
|
|
421
|
-
}),
|
|
422
|
-
/* @__PURE__ */ d("th", {
|
|
423
|
-
className: "px-5 py-3 text-center font-medium text-text-secondary",
|
|
424
|
-
children: "Available"
|
|
425
|
-
}),
|
|
426
|
-
/* @__PURE__ */ d("th", {
|
|
427
|
-
className: "px-5 py-3 text-right font-medium text-text-secondary",
|
|
428
|
-
children: "Actions"
|
|
429
|
-
})
|
|
430
|
-
]
|
|
431
|
-
}) }), /* @__PURE__ */ d("tbody", { children: V.map((e) => {
|
|
432
|
-
let n = X(e);
|
|
433
|
-
return /* @__PURE__ */ f("tr", {
|
|
434
|
-
className: "border-b border-border-subtle last:border-0 hover:bg-bg-sunken/30 transition-colors",
|
|
435
|
-
children: [
|
|
436
|
-
/* @__PURE__ */ d("td", {
|
|
437
|
-
className: "px-5 py-3",
|
|
438
|
-
children: /* @__PURE__ */ f("div", {
|
|
439
|
-
className: "flex items-center gap-3",
|
|
440
|
-
children: [/* @__PURE__ */ d("div", {
|
|
441
|
-
className: "flex h-10 w-10 items-center justify-center rounded-md bg-bg-sunken",
|
|
442
|
-
children: /* @__PURE__ */ d(s, { className: "h-4 w-4 text-text-secondary" })
|
|
443
|
-
}), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("p", {
|
|
444
|
-
className: "font-medium text-text-primary",
|
|
445
|
-
children: e.name
|
|
446
|
-
}), /* @__PURE__ */ f("p", {
|
|
447
|
-
className: "text-xs text-text-secondary line-clamp-1",
|
|
448
|
-
children: [e.description.slice(0, 50), "..."]
|
|
449
|
-
})] })]
|
|
450
|
-
})
|
|
451
|
-
}),
|
|
452
|
-
/* @__PURE__ */ d("td", {
|
|
453
|
-
className: "px-5 py-3",
|
|
454
|
-
children: /* @__PURE__ */ d("span", {
|
|
455
|
-
className: "inline-flex rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary",
|
|
456
|
-
children: e.category
|
|
457
|
-
})
|
|
458
|
-
}),
|
|
459
|
-
/* @__PURE__ */ f("td", {
|
|
460
|
-
className: "px-5 py-3 text-right",
|
|
461
|
-
children: [/* @__PURE__ */ d("p", {
|
|
462
|
-
className: "font-medium text-text-primary",
|
|
463
|
-
children: i(e.price, { minimumFractionDigits: 0 })
|
|
464
|
-
}), e.originalPrice && /* @__PURE__ */ d("p", {
|
|
465
|
-
className: "text-xs text-text-secondary line-through",
|
|
466
|
-
children: i(e.originalPrice, { minimumFractionDigits: 0 })
|
|
467
|
-
})]
|
|
468
|
-
}),
|
|
469
|
-
/* @__PURE__ */ d("td", {
|
|
470
|
-
className: "px-5 py-3",
|
|
471
|
-
children: /* @__PURE__ */ d("span", {
|
|
472
|
-
className: t("text-sm font-medium", n.color),
|
|
473
|
-
children: n.label
|
|
474
|
-
})
|
|
475
|
-
}),
|
|
476
|
-
/* @__PURE__ */ d("td", {
|
|
477
|
-
className: "px-5 py-3 text-center",
|
|
478
|
-
children: /* @__PURE__ */ d("button", {
|
|
479
|
-
type: "button",
|
|
480
|
-
onClick: () => J(e.id, !e.isAvailable),
|
|
481
|
-
className: t("h-6 w-11 rounded-full transition-colors relative inline-block", e.isAvailable ? "bg-accent-blue-subtle" : "bg-muted-foreground/30"),
|
|
482
|
-
children: /* @__PURE__ */ d("div", { className: t("absolute top-0.5 h-5 w-5 rounded-full bg-white transition-transform", e.isAvailable ? "translate-x-5" : "translate-x-0.5") })
|
|
483
|
-
})
|
|
484
|
-
}),
|
|
485
|
-
/* @__PURE__ */ d("td", {
|
|
486
|
-
className: "px-5 py-3",
|
|
487
|
-
children: /* @__PURE__ */ f("div", {
|
|
488
|
-
className: "flex items-center justify-end gap-1",
|
|
489
|
-
children: [/* @__PURE__ */ d("button", {
|
|
490
|
-
type: "button",
|
|
491
|
-
onClick: () => K(e),
|
|
492
|
-
className: "rounded p-1.5 text-text-secondary hover:bg-bg-sunken hover:text-text-primary transition-colors",
|
|
493
|
-
title: "Edit",
|
|
494
|
-
children: /* @__PURE__ */ d(re, { className: "h-4 w-4" })
|
|
495
|
-
}), /* @__PURE__ */ d("button", {
|
|
496
|
-
type: "button",
|
|
497
|
-
onClick: () => q(e.id),
|
|
498
|
-
className: "rounded p-1.5 text-text-secondary hover:bg-status-error-bg-subtle/10 hover:text-status-error-text transition-colors",
|
|
499
|
-
title: "Delete",
|
|
500
|
-
children: /* @__PURE__ */ d(ie, { className: "h-4 w-4" })
|
|
501
|
-
})]
|
|
502
|
-
})
|
|
503
|
-
})
|
|
504
|
-
]
|
|
505
|
-
}, e.id);
|
|
506
|
-
}) })]
|
|
507
|
-
})
|
|
508
|
-
})
|
|
509
|
-
}), /* @__PURE__ */ d("div", {
|
|
510
|
-
className: "lg:hidden space-y-3",
|
|
511
|
-
children: V.map((e) => {
|
|
512
|
-
let n = X(e);
|
|
513
|
-
return /* @__PURE__ */ d("div", {
|
|
514
|
-
className: "rounded-lg border border-border-seam bg-bg-surface p-4 bg-gloss-card shadow-pop",
|
|
515
|
-
children: /* @__PURE__ */ f("div", {
|
|
516
|
-
className: "flex items-start gap-3",
|
|
517
|
-
children: [/* @__PURE__ */ d("div", {
|
|
518
|
-
className: "flex h-14 w-14 items-center justify-center rounded-md bg-bg-sunken shrink-0",
|
|
519
|
-
children: /* @__PURE__ */ d(s, { className: "h-6 w-6 text-text-secondary" })
|
|
520
|
-
}), /* @__PURE__ */ f("div", {
|
|
521
|
-
className: "flex-1 min-w-0",
|
|
522
|
-
children: [
|
|
523
|
-
/* @__PURE__ */ f("div", {
|
|
524
|
-
className: "flex items-start justify-between mb-1",
|
|
525
|
-
children: [/* @__PURE__ */ f("div", {
|
|
526
|
-
className: "flex-1",
|
|
527
|
-
children: [/* @__PURE__ */ d("h3", {
|
|
528
|
-
className: "text-sm font-medium text-text-primary line-clamp-1",
|
|
529
|
-
children: e.name
|
|
530
|
-
}), /* @__PURE__ */ d("p", {
|
|
531
|
-
className: "text-xs text-text-secondary mt-0.5 line-clamp-2",
|
|
532
|
-
children: e.description
|
|
533
|
-
})]
|
|
534
|
-
}), /* @__PURE__ */ d("button", {
|
|
535
|
-
type: "button",
|
|
536
|
-
onClick: () => J(e.id, !e.isAvailable),
|
|
537
|
-
className: t("h-5 w-9 rounded-full transition-colors relative ml-2 shrink-0", e.isAvailable ? "bg-accent-blue-subtle" : "bg-muted-foreground/30"),
|
|
538
|
-
children: /* @__PURE__ */ d("div", { className: t("absolute top-0.5 h-4 w-4 rounded-full bg-white transition-transform", e.isAvailable ? "translate-x-4" : "translate-x-0.5") })
|
|
539
|
-
})]
|
|
540
|
-
}),
|
|
541
|
-
/* @__PURE__ */ f("div", {
|
|
542
|
-
className: "flex flex-wrap items-center gap-2 mt-2 text-xs",
|
|
543
|
-
children: [/* @__PURE__ */ d("span", {
|
|
544
|
-
className: "px-2 py-0.5 rounded-full bg-bg-sunken text-text-secondary",
|
|
545
|
-
children: e.category
|
|
546
|
-
}), /* @__PURE__ */ d("span", {
|
|
547
|
-
className: t("font-medium", n.color),
|
|
548
|
-
children: n.label
|
|
549
|
-
})]
|
|
550
|
-
}),
|
|
551
|
-
/* @__PURE__ */ f("div", {
|
|
552
|
-
className: "flex items-center justify-between mt-3",
|
|
553
|
-
children: [/* @__PURE__ */ f("div", {
|
|
554
|
-
className: "flex items-center gap-2",
|
|
555
|
-
children: [/* @__PURE__ */ d("span", {
|
|
556
|
-
className: "font-semibold text-text-primary",
|
|
557
|
-
children: i(e.price, { minimumFractionDigits: 0 })
|
|
558
|
-
}), e.originalPrice && /* @__PURE__ */ d("span", {
|
|
559
|
-
className: "text-xs text-text-secondary line-through",
|
|
560
|
-
children: i(e.originalPrice, { minimumFractionDigits: 0 })
|
|
561
|
-
})]
|
|
562
|
-
}), /* @__PURE__ */ f("div", {
|
|
563
|
-
className: "flex gap-1",
|
|
564
|
-
children: [/* @__PURE__ */ d("button", {
|
|
565
|
-
type: "button",
|
|
566
|
-
onClick: () => K(e),
|
|
567
|
-
className: "rounded px-2 py-1 text-xs border border-border-subtle text-text-primary hover:bg-bg-sunken",
|
|
568
|
-
children: "Edit"
|
|
569
|
-
}), /* @__PURE__ */ d("button", {
|
|
570
|
-
type: "button",
|
|
571
|
-
onClick: () => q(e.id),
|
|
572
|
-
className: "rounded px-2 py-1 text-xs border border-border-subtle text-status-error-text hover:bg-status-error-bg-subtle/10",
|
|
573
|
-
children: "Delete"
|
|
574
|
-
})]
|
|
575
|
-
})]
|
|
576
|
-
})
|
|
577
|
-
]
|
|
578
|
-
})]
|
|
579
|
-
})
|
|
580
|
-
}, e.id);
|
|
581
|
-
})
|
|
582
|
-
})] })
|
|
583
|
-
]
|
|
584
|
-
}), ue && /* @__PURE__ */ d("div", {
|
|
585
|
-
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",
|
|
586
|
-
children: /* @__PURE__ */ d("div", {
|
|
587
|
-
className: "w-full max-w-2xl max-h-[90vh] overflow-y-auto rounded-lg border border-border-subtle bg-bg-surface shadow-xl",
|
|
588
|
-
children: /* @__PURE__ */ f("div", {
|
|
589
|
-
className: "p-6",
|
|
590
|
-
children: [
|
|
591
|
-
/* @__PURE__ */ f("div", {
|
|
592
|
-
className: "flex items-center justify-between mb-4",
|
|
593
|
-
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("h3", {
|
|
594
|
-
className: "text-lg font-semibold text-text-primary",
|
|
595
|
-
children: O ? "Edit Item" : "Add New Item"
|
|
596
|
-
}), A.category && /* @__PURE__ */ f("p", {
|
|
597
|
-
className: "text-sm text-text-secondary mt-0.5",
|
|
598
|
-
children: [
|
|
599
|
-
"Type: ",
|
|
600
|
-
Z ? "Service" : "Product",
|
|
601
|
-
" | Category: ",
|
|
602
|
-
A.category
|
|
603
|
-
]
|
|
604
|
-
})] }), /* @__PURE__ */ d("button", {
|
|
605
|
-
type: "button",
|
|
606
|
-
onClick: () => D(!1),
|
|
607
|
-
className: "rounded p-1.5 text-text-secondary hover:text-text-primary hover:bg-bg-sunken transition-colors",
|
|
608
|
-
children: /* @__PURE__ */ d(oe, { className: "h-5 w-5" })
|
|
609
|
-
})]
|
|
610
|
-
}),
|
|
611
|
-
/* @__PURE__ */ f("div", {
|
|
612
|
-
className: "space-y-4",
|
|
613
|
-
children: [
|
|
614
|
-
/* @__PURE__ */ f("div", {
|
|
615
|
-
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
616
|
-
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
617
|
-
className: "block text-sm font-medium text-text-primary mb-1",
|
|
618
|
-
children: "Item Name *"
|
|
619
|
-
}), /* @__PURE__ */ d("input", {
|
|
620
|
-
type: "text",
|
|
621
|
-
value: A.name,
|
|
622
|
-
onChange: (e) => j((t) => ({
|
|
623
|
-
...t,
|
|
624
|
-
name: e.target.value
|
|
625
|
-
})),
|
|
626
|
-
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary",
|
|
627
|
-
placeholder: "Enter item name"
|
|
628
|
-
})] }), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
629
|
-
className: "block text-sm font-medium text-text-primary mb-1",
|
|
630
|
-
children: "Category *"
|
|
631
|
-
}), /* @__PURE__ */ f("select", {
|
|
632
|
-
value: A.category,
|
|
633
|
-
onChange: (e) => j((t) => ({
|
|
634
|
-
...t,
|
|
635
|
-
category: e.target.value
|
|
636
|
-
})),
|
|
637
|
-
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
638
|
-
children: [/* @__PURE__ */ d("option", {
|
|
639
|
-
value: "",
|
|
640
|
-
children: "Select category"
|
|
641
|
-
}), B.map((e) => /* @__PURE__ */ d("option", {
|
|
642
|
-
value: e,
|
|
643
|
-
children: e
|
|
644
|
-
}, e))]
|
|
645
|
-
})] })]
|
|
646
|
-
}),
|
|
647
|
-
/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
648
|
-
className: "block text-sm font-medium text-text-primary mb-1",
|
|
649
|
-
children: "Description *"
|
|
650
|
-
}), /* @__PURE__ */ d("textarea", {
|
|
651
|
-
value: A.description,
|
|
652
|
-
onChange: (e) => j((t) => ({
|
|
653
|
-
...t,
|
|
654
|
-
description: e.target.value
|
|
655
|
-
})),
|
|
656
|
-
rows: 3,
|
|
657
|
-
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary resize-none",
|
|
658
|
-
placeholder: "Describe the offering..."
|
|
659
|
-
})] }),
|
|
660
|
-
/* @__PURE__ */ f("div", {
|
|
661
|
-
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
662
|
-
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
663
|
-
className: "block text-sm font-medium text-text-primary mb-1",
|
|
664
|
-
children: "Price *"
|
|
665
|
-
}), /* @__PURE__ */ d("input", {
|
|
666
|
-
type: "number",
|
|
667
|
-
value: A.price,
|
|
668
|
-
onChange: (e) => j((t) => ({
|
|
669
|
-
...t,
|
|
670
|
-
price: parseInt(e.target.value) || 0
|
|
671
|
-
})),
|
|
672
|
-
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
673
|
-
})] }), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
674
|
-
className: "block text-sm font-medium text-text-primary mb-1",
|
|
675
|
-
children: "Original Price"
|
|
676
|
-
}), /* @__PURE__ */ d("input", {
|
|
677
|
-
type: "number",
|
|
678
|
-
value: A.originalPrice ?? "",
|
|
679
|
-
onChange: (e) => j((t) => ({
|
|
680
|
-
...t,
|
|
681
|
-
originalPrice: e.target.value ? parseInt(e.target.value) : void 0
|
|
682
|
-
})),
|
|
683
|
-
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
684
|
-
placeholder: "Optional"
|
|
685
|
-
})] })]
|
|
686
|
-
}),
|
|
687
|
-
!Z && /* @__PURE__ */ f("div", {
|
|
688
|
-
className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
|
|
689
|
-
children: [
|
|
690
|
-
/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
691
|
-
className: "block text-sm font-medium text-text-primary mb-1",
|
|
692
|
-
children: "Stock Quantity *"
|
|
693
|
-
}), /* @__PURE__ */ d("input", {
|
|
694
|
-
type: "number",
|
|
695
|
-
value: A.stock,
|
|
696
|
-
onChange: (e) => j((t) => ({
|
|
697
|
-
...t,
|
|
698
|
-
stock: parseInt(e.target.value) || 0
|
|
699
|
-
})),
|
|
700
|
-
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
701
|
-
})] }),
|
|
702
|
-
/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
703
|
-
className: "block text-sm font-medium text-text-primary mb-1",
|
|
704
|
-
children: "Preparation Time (min)"
|
|
705
|
-
}), /* @__PURE__ */ d("input", {
|
|
706
|
-
type: "number",
|
|
707
|
-
value: A.preparationTime,
|
|
708
|
-
onChange: (e) => j((t) => ({
|
|
709
|
-
...t,
|
|
710
|
-
preparationTime: parseInt(e.target.value) || 0
|
|
711
|
-
})),
|
|
712
|
-
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
713
|
-
})] }),
|
|
714
|
-
Q && /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
715
|
-
className: "block text-sm font-medium text-text-primary mb-1",
|
|
716
|
-
children: "Calories"
|
|
717
|
-
}), /* @__PURE__ */ d("input", {
|
|
718
|
-
type: "number",
|
|
719
|
-
value: A.calories,
|
|
720
|
-
onChange: (e) => j((t) => ({
|
|
721
|
-
...t,
|
|
722
|
-
calories: parseInt(e.target.value) || 0
|
|
723
|
-
})),
|
|
724
|
-
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
725
|
-
})] })
|
|
726
|
-
]
|
|
727
|
-
}),
|
|
728
|
-
Z && /* @__PURE__ */ f("div", {
|
|
729
|
-
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
730
|
-
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
731
|
-
className: "block text-sm font-medium text-text-primary mb-1",
|
|
732
|
-
children: "Service Duration (min) *"
|
|
733
|
-
}), /* @__PURE__ */ d("input", {
|
|
734
|
-
type: "number",
|
|
735
|
-
value: A.duration,
|
|
736
|
-
onChange: (e) => j((t) => ({
|
|
737
|
-
...t,
|
|
738
|
-
duration: parseInt(e.target.value) || 30
|
|
739
|
-
})),
|
|
740
|
-
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
741
|
-
})] }), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
742
|
-
className: "block text-sm font-medium text-text-primary mb-1",
|
|
743
|
-
children: "Setup Time (min)"
|
|
744
|
-
}), /* @__PURE__ */ d("input", {
|
|
745
|
-
type: "number",
|
|
746
|
-
value: A.preparationTime,
|
|
747
|
-
onChange: (e) => j((t) => ({
|
|
748
|
-
...t,
|
|
749
|
-
preparationTime: parseInt(e.target.value) || 0
|
|
750
|
-
})),
|
|
751
|
-
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
752
|
-
})] })]
|
|
753
|
-
}),
|
|
754
|
-
Q && /* @__PURE__ */ f("div", {
|
|
755
|
-
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
756
|
-
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
757
|
-
className: "block text-sm font-medium text-text-primary mb-1",
|
|
758
|
-
children: "Spice Level"
|
|
759
|
-
}), /* @__PURE__ */ f("select", {
|
|
760
|
-
value: A.spiceLevel,
|
|
761
|
-
onChange: (e) => j((t) => ({
|
|
762
|
-
...t,
|
|
763
|
-
spiceLevel: e.target.value
|
|
764
|
-
})),
|
|
765
|
-
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
766
|
-
children: [
|
|
767
|
-
/* @__PURE__ */ d("option", {
|
|
768
|
-
value: "none",
|
|
769
|
-
children: "None"
|
|
770
|
-
}),
|
|
771
|
-
/* @__PURE__ */ d("option", {
|
|
772
|
-
value: "mild",
|
|
773
|
-
children: "Mild"
|
|
774
|
-
}),
|
|
775
|
-
/* @__PURE__ */ d("option", {
|
|
776
|
-
value: "medium",
|
|
777
|
-
children: "Medium"
|
|
778
|
-
}),
|
|
779
|
-
/* @__PURE__ */ d("option", {
|
|
780
|
-
value: "spicy",
|
|
781
|
-
children: "Spicy"
|
|
782
|
-
}),
|
|
783
|
-
/* @__PURE__ */ d("option", {
|
|
784
|
-
value: "very-spicy",
|
|
785
|
-
children: "Very Spicy"
|
|
786
|
-
})
|
|
787
|
-
]
|
|
788
|
-
})] }), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
789
|
-
className: "block text-sm font-medium text-text-primary mb-2",
|
|
790
|
-
children: "Dietary Options"
|
|
791
|
-
}), /* @__PURE__ */ d("div", {
|
|
792
|
-
className: "space-y-2",
|
|
793
|
-
children: [
|
|
794
|
-
"isVegetarian",
|
|
795
|
-
"isVegan",
|
|
796
|
-
"isGlutenFree"
|
|
797
|
-
].map((e) => /* @__PURE__ */ f("label", {
|
|
798
|
-
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
799
|
-
children: [/* @__PURE__ */ d("input", {
|
|
800
|
-
type: "checkbox",
|
|
801
|
-
checked: A[e],
|
|
802
|
-
onChange: (t) => j((n) => ({
|
|
803
|
-
...n,
|
|
804
|
-
[e]: t.target.checked
|
|
805
|
-
})),
|
|
806
|
-
className: "rounded border-border-subtle"
|
|
807
|
-
}), e === "isVegetarian" ? "Vegetarian" : e === "isVegan" ? "Vegan" : "Gluten Free"]
|
|
808
|
-
}, e))
|
|
809
|
-
})] })]
|
|
810
|
-
}),
|
|
811
|
-
Z && /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
812
|
-
className: "block text-sm font-medium text-text-primary mb-1",
|
|
813
|
-
children: "Service Type *"
|
|
814
|
-
}), /* @__PURE__ */ f("select", {
|
|
815
|
-
value: A.serviceType,
|
|
816
|
-
onChange: (e) => j((t) => ({
|
|
817
|
-
...t,
|
|
818
|
-
serviceType: e.target.value
|
|
819
|
-
})),
|
|
820
|
-
className: "w-full sm:w-64 rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
821
|
-
children: [
|
|
822
|
-
/* @__PURE__ */ d("option", {
|
|
823
|
-
value: "instant",
|
|
824
|
-
children: "Instant Service"
|
|
825
|
-
}),
|
|
826
|
-
/* @__PURE__ */ d("option", {
|
|
827
|
-
value: "appointment",
|
|
828
|
-
children: "Appointment Based"
|
|
829
|
-
}),
|
|
830
|
-
/* @__PURE__ */ d("option", {
|
|
831
|
-
value: "recurring",
|
|
832
|
-
children: "Recurring Service"
|
|
833
|
-
}),
|
|
834
|
-
/* @__PURE__ */ d("option", {
|
|
835
|
-
value: "consultation",
|
|
836
|
-
children: "Consultation"
|
|
837
|
-
})
|
|
838
|
-
]
|
|
839
|
-
})] }),
|
|
840
|
-
/* @__PURE__ */ f("div", { children: [
|
|
841
|
-
/* @__PURE__ */ d("label", {
|
|
842
|
-
className: "block text-sm font-medium text-text-primary mb-1",
|
|
843
|
-
children: "Tags (comma separated)"
|
|
844
|
-
}),
|
|
845
|
-
/* @__PURE__ */ d("input", {
|
|
846
|
-
type: "text",
|
|
847
|
-
value: M,
|
|
848
|
-
onChange: (e) => N(e.target.value),
|
|
849
|
-
placeholder: Z ? "professional, certified, quick" : "popular, spicy, traditional",
|
|
850
|
-
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary"
|
|
851
|
-
}),
|
|
852
|
-
/* @__PURE__ */ f("p", {
|
|
853
|
-
className: "text-xs text-text-secondary mt-1",
|
|
854
|
-
children: [
|
|
855
|
-
M.split(",").map((e) => e.trim()).filter(Boolean).length,
|
|
856
|
-
" ",
|
|
857
|
-
"tags"
|
|
858
|
-
]
|
|
859
|
-
})
|
|
860
|
-
] }),
|
|
861
|
-
Q && /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
862
|
-
className: "block text-sm font-medium text-text-primary mb-1",
|
|
863
|
-
children: "Allergens (comma separated)"
|
|
864
|
-
}), /* @__PURE__ */ d("input", {
|
|
865
|
-
type: "text",
|
|
866
|
-
value: P,
|
|
867
|
-
onChange: (e) => F(e.target.value),
|
|
868
|
-
placeholder: "nuts, dairy, gluten, soy",
|
|
869
|
-
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary"
|
|
870
|
-
})] }),
|
|
871
|
-
Z && /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
872
|
-
className: "block text-sm font-medium text-text-primary mb-1",
|
|
873
|
-
children: "Service Requirements (comma separated)"
|
|
874
|
-
}), /* @__PURE__ */ d("input", {
|
|
875
|
-
type: "text",
|
|
876
|
-
value: I,
|
|
877
|
-
onChange: (e) => L(e.target.value),
|
|
878
|
-
placeholder: "advance booking, payment required, tools provided",
|
|
879
|
-
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary"
|
|
880
|
-
})] })
|
|
881
|
-
]
|
|
882
|
-
}),
|
|
883
|
-
/* @__PURE__ */ f("div", {
|
|
884
|
-
className: "flex gap-3 mt-6",
|
|
885
|
-
children: [/* @__PURE__ */ d("button", {
|
|
886
|
-
type: "button",
|
|
887
|
-
onClick: () => D(!1),
|
|
888
|
-
className: "flex-1 rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
|
|
889
|
-
children: "Cancel"
|
|
890
|
-
}), /* @__PURE__ */ d("button", {
|
|
891
|
-
type: "button",
|
|
892
|
-
onClick: pe,
|
|
893
|
-
disabled: !$,
|
|
894
|
-
className: t("flex-1 rounded-md px-4 py-2 text-sm font-medium transition-colors", $ ? "bg-accent text-text-primary hover:bg-accent/80" : "bg-bg-sunken text-text-secondary cursor-not-allowed"),
|
|
895
|
-
children: O ? "Update Item" : "Add Item"
|
|
896
|
-
})]
|
|
897
|
-
})
|
|
898
|
-
]
|
|
899
|
-
})
|
|
900
|
-
})
|
|
901
|
-
})]
|
|
902
|
-
});
|
|
903
|
-
};
|
|
904
|
-
//#endregion
|
|
905
|
-
export { y as InventoryManagementPage };
|
|
906
|
-
|
|
907
|
-
//# sourceMappingURL=InventoryManagementPage.js.map
|