@burdenoff/microfe-kadaikodi 2026.704.3 → 2026.704.5
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/kadaikodi/KadaikodiRoutes.js +34 -26
- package/dist/kadaikodi/KadaikodiRoutes.js.map +1 -1
- package/dist/kadaikodi/components/viz/AllocationBar.js +68 -0
- package/dist/kadaikodi/components/viz/AllocationBar.js.map +1 -0
- package/dist/kadaikodi/components/viz/AreaChart.js +102 -0
- package/dist/kadaikodi/components/viz/AreaChart.js.map +1 -0
- package/dist/kadaikodi/components/viz/AvatarStack.js +36 -0
- package/dist/kadaikodi/components/viz/AvatarStack.js.map +1 -0
- package/dist/kadaikodi/components/viz/BarChart.js +83 -0
- package/dist/kadaikodi/components/viz/BarChart.js.map +1 -0
- package/dist/kadaikodi/components/viz/CertificateCard.js +4 -0
- package/dist/kadaikodi/components/viz/DonutChart.js +109 -0
- package/dist/kadaikodi/components/viz/DonutChart.js.map +1 -0
- package/dist/kadaikodi/components/viz/HBarFunnel.js +54 -0
- package/dist/kadaikodi/components/viz/HBarFunnel.js.map +1 -0
- package/dist/kadaikodi/components/viz/Heatmap.js +3 -0
- package/dist/kadaikodi/components/viz/KanbanBoard.js +50 -0
- package/dist/kadaikodi/components/viz/KanbanBoard.js.map +1 -0
- package/dist/kadaikodi/components/viz/LineChart.js +4 -0
- package/dist/kadaikodi/components/viz/OrgTree.js +2 -0
- package/dist/kadaikodi/components/viz/PathSteps.js +3 -0
- package/dist/kadaikodi/components/viz/ProgressRing.js +68 -0
- package/dist/kadaikodi/components/viz/ProgressRing.js.map +1 -0
- package/dist/kadaikodi/components/viz/RatingStars.js +51 -0
- package/dist/kadaikodi/components/viz/RatingStars.js.map +1 -0
- package/dist/kadaikodi/components/viz/SegmentedTabs.js +69 -0
- package/dist/kadaikodi/components/viz/SegmentedTabs.js.map +1 -0
- package/dist/kadaikodi/components/viz/SkillBar.js +3 -0
- package/dist/kadaikodi/components/viz/Sparkline.js +74 -0
- package/dist/kadaikodi/components/viz/Sparkline.js.map +1 -0
- package/dist/kadaikodi/components/viz/StatCard.js +60 -0
- package/dist/kadaikodi/components/viz/StatCard.js.map +1 -0
- package/dist/kadaikodi/components/viz/StepProgress.js +64 -0
- package/dist/kadaikodi/components/viz/StepProgress.js.map +1 -0
- package/dist/kadaikodi/components/viz/Timeline.js +66 -0
- package/dist/kadaikodi/components/viz/Timeline.js.map +1 -0
- package/dist/kadaikodi/components/viz/index.js +23 -0
- package/dist/kadaikodi/components/viz/lib/Avatar.js +30 -0
- package/dist/kadaikodi/components/viz/lib/Avatar.js.map +1 -0
- package/dist/kadaikodi/components/viz/lib/CartesianFrame.js +119 -0
- package/dist/kadaikodi/components/viz/lib/CartesianFrame.js.map +1 -0
- package/dist/kadaikodi/components/viz/lib/ResponsiveSvg.js +35 -0
- package/dist/kadaikodi/components/viz/lib/ResponsiveSvg.js.map +1 -0
- package/dist/kadaikodi/components/viz/lib/format.js +21 -0
- package/dist/kadaikodi/components/viz/lib/format.js.map +1 -0
- package/dist/kadaikodi/components/viz/lib/geometry.js +61 -0
- package/dist/kadaikodi/components/viz/lib/geometry.js.map +1 -0
- package/dist/kadaikodi/components/viz/lib/hooks.js +39 -0
- package/dist/kadaikodi/components/viz/lib/hooks.js.map +1 -0
- package/dist/kadaikodi/components/viz/lib/palette.js +27 -0
- package/dist/kadaikodi/components/viz/lib/palette.js.map +1 -0
- package/dist/kadaikodi/hooks/useKadaikodiApi.js +84 -6
- package/dist/kadaikodi/hooks/useKadaikodiApi.js.map +1 -1
- package/dist/kadaikodi/pages/HomePage.js +373 -631
- package/dist/kadaikodi/pages/HomePage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js +304 -169
- package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminDashboard.js +255 -271
- package/dist/kadaikodi/pages/admin/AdminDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminFinancialPage.js +185 -125
- package/dist/kadaikodi/pages/admin/AdminFinancialPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminOrdersPage.js +141 -102
- package/dist/kadaikodi/pages/admin/AdminOrdersPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminSettingsPage.js +332 -276
- package/dist/kadaikodi/pages/admin/AdminSettingsPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/CartManagementPage.js +564 -729
- package/dist/kadaikodi/pages/admin/CartManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/UserManagementPage.js +310 -366
- package/dist/kadaikodi/pages/admin/UserManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/AnalyticsDashboard.js +201 -120
- package/dist/kadaikodi/pages/cart-owner/AnalyticsDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.js +290 -257
- package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js +173 -194
- package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/CartOwnerProfilePage.js +270 -228
- package/dist/kadaikodi/pages/cart-owner/CartOwnerProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js +194 -173
- package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js +428 -347
- package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/InvestmentListingPage.js +332 -0
- package/dist/kadaikodi/pages/cart-owner/InvestmentListingPage.js.map +1 -0
- package/dist/kadaikodi/pages/cart-owner/MerchantOnboardingPage.js +373 -0
- package/dist/kadaikodi/pages/cart-owner/MerchantOnboardingPage.js.map +1 -0
- package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js +294 -162
- package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js +180 -181
- package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/common/HelpSupportPage.js +310 -317
- package/dist/kadaikodi/pages/common/HelpSupportPage.js.map +1 -1
- package/dist/kadaikodi/pages/common/NotificationCenterPage.js.map +1 -1
- package/dist/kadaikodi/pages/common/SettingsPage.js +502 -586
- package/dist/kadaikodi/pages/common/SettingsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/BookingDetailsPage.js +239 -156
- package/dist/kadaikodi/pages/customer/BookingDetailsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CartDetailPage.js +405 -248
- package/dist/kadaikodi/pages/customer/CartDetailPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js +258 -232
- package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CheckoutPage.js +254 -205
- package/dist/kadaikodi/pages/customer/CheckoutPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CustomerDashboard.js +5 -5
- package/dist/kadaikodi/pages/customer/CustomerDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CustomerProfilePage.js +189 -199
- package/dist/kadaikodi/pages/customer/CustomerProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js +272 -230
- package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/FavoritesPage.js +150 -413
- package/dist/kadaikodi/pages/customer/FavoritesPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/OrderHistoryPage.js +173 -134
- package/dist/kadaikodi/pages/customer/OrderHistoryPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/OrderTrackingPage.js +411 -305
- package/dist/kadaikodi/pages/customer/OrderTrackingPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/ReviewsPage.js +310 -406
- package/dist/kadaikodi/pages/customer/ReviewsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/SavedAddressesPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/shared.js +181 -0
- package/dist/kadaikodi/pages/customer/shared.js.map +1 -0
- package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js +438 -311
- package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js +320 -293
- package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorAnalyticsPage.js +159 -91
- package/dist/kadaikodi/pages/investor/InvestorAnalyticsPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorDashboard.js +137 -107
- package/dist/kadaikodi/pages/investor/InvestorDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorInvestmentsPage.js +157 -135
- package/dist/kadaikodi/pages/investor/InvestorInvestmentsPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorPortfolioPage.js +280 -206
- package/dist/kadaikodi/pages/investor/InvestorPortfolioPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorProfilePage.js +441 -514
- package/dist/kadaikodi/pages/investor/InvestorProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.js +428 -431
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerDashboard.js +328 -445
- package/dist/kadaikodi/pages/worker/WorkerDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js +141 -164
- package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerProfilePage.js +360 -288
- package/dist/kadaikodi/pages/worker/WorkerProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js +303 -281
- package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,14 +2,16 @@ import { useKadaikodi as e } from "../../context/KadaikodiContext.js";
|
|
|
2
2
|
import { cn as t } from "../../utils/cn.js";
|
|
3
3
|
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
4
|
import { EmptyState as r } from "../../components/EmptyState.js";
|
|
5
|
-
import {
|
|
5
|
+
import { useCreateOffering as i, useDeleteOffering as ee, useOfferings as te, useProviders as ne, useUpdateOffering as re } from "../../hooks/useKadaikodiApi.js";
|
|
6
6
|
import { formatCurrency as a } from "../../utils/formatters.js";
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import { StatCard as o } from "../../components/viz/StatCard.js";
|
|
8
|
+
import "../../components/viz/index.js";
|
|
9
|
+
import { useEffect as ie, useMemo as s, useState as c } from "react";
|
|
10
|
+
import { AlertCircle as l, CheckCircle2 as ae, Download as oe, Edit2 as se, Filter as ce, Package as u, Plus as d, Search as le, Trash2 as ue, Upload as de, X as fe } from "lucide-react";
|
|
11
|
+
import { Fragment as pe, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
12
|
+
import { EmphasisPanel as me, PagePurpose as he } from "@burdenoff/fe-libs/ui";
|
|
11
13
|
//#region src/kadaikodi/pages/cart-owner/InventoryManagementPage.tsx
|
|
12
|
-
var
|
|
14
|
+
var ge = [
|
|
13
15
|
"Service",
|
|
14
16
|
"Repair",
|
|
15
17
|
"Beauty",
|
|
@@ -18,7 +20,7 @@ var pe = [
|
|
|
18
20
|
"Health",
|
|
19
21
|
"Wellness",
|
|
20
22
|
"Education"
|
|
21
|
-
],
|
|
23
|
+
], m = (e) => ge.some((t) => e.includes(t)), _e = (e) => e === "Food & Beverage", h = {
|
|
22
24
|
FOOD_BEVERAGE: "Food & Beverage",
|
|
23
25
|
PERSONAL_CARE_BEAUTY: "Personal Care & Beauty",
|
|
24
26
|
CLOTHING_FASHION: "Clothing & Fashion",
|
|
@@ -28,13 +30,18 @@ var pe = [
|
|
|
28
30
|
EDUCATION_SKILLS: "Education & Skills",
|
|
29
31
|
RETAIL_MERCHANDISE: "Retail & Merchandise",
|
|
30
32
|
GROCERY_ESSENTIALS: "Grocery & Essentials"
|
|
31
|
-
},
|
|
33
|
+
}, ve = Object.fromEntries(Object.entries(h).map(([e, t]) => [t, e])), ye = Object.values(h).sort(), be = (e) => `${e.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "offering"}-${Date.now().toString(36)}`, xe = (e) => {
|
|
34
|
+
let t = String(e ?? "");
|
|
35
|
+
return /[",\n]/.test(t) ? `"${t.replace(/"/g, "\"\"")}"` : t;
|
|
36
|
+
}, Se = (e, t) => ({
|
|
32
37
|
id: e.id,
|
|
33
38
|
name: e.name,
|
|
34
39
|
description: e.description ?? "",
|
|
35
40
|
price: e.price,
|
|
36
41
|
originalPrice: e.originalPrice ?? void 0,
|
|
37
|
-
category:
|
|
42
|
+
category: h[e.category] ?? e.category,
|
|
43
|
+
kind: e.kind === "SERVICE" ? "Service" : "Product",
|
|
44
|
+
image: e.media?.[0] ?? void 0,
|
|
38
45
|
stock: e.stock ?? 0,
|
|
39
46
|
isAvailable: e.isAvailable,
|
|
40
47
|
cartName: t,
|
|
@@ -49,7 +56,7 @@ var pe = [
|
|
|
49
56
|
duration: e.durationMinutes ?? 0,
|
|
50
57
|
serviceType: e.serviceType ?? "",
|
|
51
58
|
requirements: []
|
|
52
|
-
}),
|
|
59
|
+
}), Ce = {
|
|
53
60
|
name: "",
|
|
54
61
|
description: "",
|
|
55
62
|
category: "",
|
|
@@ -68,18 +75,18 @@ var pe = [
|
|
|
68
75
|
duration: 30,
|
|
69
76
|
serviceType: "instant",
|
|
70
77
|
requirements: []
|
|
71
|
-
},
|
|
72
|
-
let { navigateTo:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}, [
|
|
76
|
-
let [
|
|
77
|
-
let e = [...
|
|
78
|
-
if (
|
|
79
|
-
let t =
|
|
78
|
+
}, g = () => {
|
|
79
|
+
let { navigateTo: ge, currentUser: h } = e(), { data: g = [] } = ne(), _ = s(() => g.find((e) => e.ownerId === h?.id) ?? g[0], [g, h?.id]), v = _?.id, { data: y = [], isLoading: we } = te(v), b = re(), Te = i(), Ee = ee(), [x, S] = c([]);
|
|
80
|
+
ie(() => {
|
|
81
|
+
S(y.map((e) => Se(e, _?.name ?? "")));
|
|
82
|
+
}, [y, _?.name]);
|
|
83
|
+
let [C, w] = c(""), [T, E] = c(""), [D, O] = c(""), [k, A] = c("name"), [De, Oe] = c(!1), [ke, j] = c(!1), [M, N] = c(null), [P, F] = c(Ce), [I, L] = c(""), [R, z] = c(""), [B, V] = c(""), [H, U] = c(null), Ae = s(() => [...new Set(x.map((e) => e.category))].sort(), [x]), W = s(() => {
|
|
84
|
+
let e = [...x];
|
|
85
|
+
if (C) {
|
|
86
|
+
let t = C.toLowerCase();
|
|
80
87
|
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)));
|
|
81
88
|
}
|
|
82
|
-
switch (
|
|
89
|
+
switch (T && (e = e.filter((e) => e.category === T)), D === "available" ? e = e.filter((e) => e.isAvailable) : D === "unavailable" && (e = e.filter((e) => !e.isAvailable)), k) {
|
|
83
90
|
case "name":
|
|
84
91
|
e.sort((e, t) => e.name.localeCompare(t.name));
|
|
85
92
|
break;
|
|
@@ -95,23 +102,23 @@ var pe = [
|
|
|
95
102
|
}
|
|
96
103
|
return e;
|
|
97
104
|
}, [
|
|
98
|
-
y,
|
|
99
105
|
x,
|
|
100
106
|
C,
|
|
101
107
|
T,
|
|
102
|
-
D
|
|
103
|
-
|
|
104
|
-
|
|
108
|
+
D,
|
|
109
|
+
k
|
|
110
|
+
]), je = x.length, Me = x.filter((e) => e.isAvailable).length, Ne = x.filter((e) => !m(e.category) && e.stock === 0).length, Pe = x.filter((e) => !m(e.category) && e.stock > 0 && e.stock < 10).length, G = (e, t) => {
|
|
111
|
+
U({
|
|
105
112
|
text: e,
|
|
106
113
|
type: t
|
|
107
|
-
}), setTimeout(() =>
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
...
|
|
111
|
-
category:
|
|
112
|
-
}),
|
|
113
|
-
},
|
|
114
|
-
|
|
114
|
+
}), setTimeout(() => U(null), 3e3);
|
|
115
|
+
}, K = () => {
|
|
116
|
+
N(null), F({
|
|
117
|
+
...Ce,
|
|
118
|
+
category: ""
|
|
119
|
+
}), L(""), z(""), V(""), j(!0);
|
|
120
|
+
}, q = (e) => {
|
|
121
|
+
N(e), F({
|
|
115
122
|
name: e.name,
|
|
116
123
|
description: e.description,
|
|
117
124
|
category: e.category,
|
|
@@ -130,65 +137,116 @@ var pe = [
|
|
|
130
137
|
duration: e.duration,
|
|
131
138
|
serviceType: e.serviceType,
|
|
132
139
|
requirements: e.requirements
|
|
133
|
-
}),
|
|
134
|
-
},
|
|
135
|
-
if (!
|
|
136
|
-
|
|
140
|
+
}), L(e.tags.join(", ")), z(e.allergens.join(", ")), V(e.requirements.join(", ")), j(!0);
|
|
141
|
+
}, Fe = () => {
|
|
142
|
+
if (!P.name || !P.description || !P.category || P.price <= 0) {
|
|
143
|
+
G("Please fill all required fields (name, description, category, price > 0)", "error");
|
|
137
144
|
return;
|
|
138
145
|
}
|
|
139
|
-
let e =
|
|
140
|
-
if (
|
|
146
|
+
let e = I.split(",").map((e) => e.trim()).filter(Boolean), t = R.split(",").map((e) => e.trim()).filter(Boolean), n = B.split(",").map((e) => e.trim()).filter(Boolean), r = m(P.category), i = r ? "Service" : "Product";
|
|
147
|
+
if (M) S((r) => r.map((r) => r.id === M.id ? {
|
|
141
148
|
...r,
|
|
142
|
-
...
|
|
149
|
+
...P,
|
|
143
150
|
tags: e,
|
|
144
151
|
allergens: t,
|
|
145
152
|
requirements: n
|
|
146
|
-
} : r)),
|
|
147
|
-
id:
|
|
153
|
+
} : r)), b.mutate({
|
|
154
|
+
id: M.id,
|
|
148
155
|
input: {
|
|
149
|
-
name:
|
|
150
|
-
description:
|
|
151
|
-
price:
|
|
152
|
-
originalPrice:
|
|
153
|
-
stock:
|
|
156
|
+
name: P.name,
|
|
157
|
+
description: P.description,
|
|
158
|
+
price: P.price,
|
|
159
|
+
originalPrice: P.originalPrice,
|
|
160
|
+
stock: r ? void 0 : P.stock,
|
|
154
161
|
tags: e,
|
|
155
|
-
serviceType:
|
|
156
|
-
durationMinutes: r ?
|
|
162
|
+
serviceType: P.serviceType || void 0,
|
|
163
|
+
durationMinutes: r ? P.duration : void 0
|
|
157
164
|
}
|
|
158
|
-
}, { onError: () =>
|
|
165
|
+
}, { onError: () => G("Could not save changes to the server", "error") }), G(`${i} updated successfully`, "success"), j(!1);
|
|
159
166
|
else {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
167
|
+
if (!v) {
|
|
168
|
+
G("Create your cart before adding offerings", "error");
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
let t = ve[P.category];
|
|
172
|
+
if (!t) {
|
|
173
|
+
G("Please choose a valid category", "error");
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
Te.mutate({
|
|
177
|
+
providerId: v,
|
|
178
|
+
name: P.name,
|
|
179
|
+
slug: be(P.name),
|
|
180
|
+
description: P.description,
|
|
181
|
+
category: t,
|
|
182
|
+
kind: r ? "SERVICE" : "PRODUCT",
|
|
183
|
+
price: P.price,
|
|
184
|
+
originalPrice: P.originalPrice,
|
|
185
|
+
stock: r ? void 0 : P.stock,
|
|
163
186
|
tags: e,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
187
|
+
serviceType: r && P.serviceType || void 0,
|
|
188
|
+
durationMinutes: r ? P.duration : void 0
|
|
189
|
+
}, {
|
|
190
|
+
onSuccess: () => {
|
|
191
|
+
G(`${i} added successfully`, "success"), j(!1);
|
|
192
|
+
},
|
|
193
|
+
onError: () => G(`Could not create the ${i.toLowerCase()}`, "error")
|
|
194
|
+
});
|
|
169
195
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
196
|
+
}, J = (e) => {
|
|
197
|
+
if (!confirm("Are you sure you want to delete this offering?")) return;
|
|
198
|
+
let t = x;
|
|
199
|
+
S((t) => t.filter((t) => t.id !== e)), Ee.mutate(e, {
|
|
200
|
+
onSuccess: () => G("Offering deleted successfully", "success"),
|
|
201
|
+
onError: () => {
|
|
202
|
+
S(t), G("Could not delete the offering", "error");
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}, Y = (e, t) => {
|
|
206
|
+
S((n) => n.map((n) => n.id === e ? {
|
|
175
207
|
...n,
|
|
176
208
|
isAvailable: t
|
|
177
|
-
} : n)),
|
|
209
|
+
} : n)), b.mutate({
|
|
178
210
|
id: e,
|
|
179
211
|
input: { isAvailable: t }
|
|
180
|
-
}, { onError: () =>
|
|
181
|
-
},
|
|
182
|
-
let t = e === "enable", n =
|
|
183
|
-
if (n === 0) {
|
|
184
|
-
|
|
212
|
+
}, { onError: () => G("Could not update availability on the server", "error") }), G(`Offering ${t ? "enabled" : "disabled"} successfully`, "success");
|
|
213
|
+
}, X = (e) => {
|
|
214
|
+
let t = e === "enable", n = x.filter((e) => e.isAvailable !== t);
|
|
215
|
+
if (n.length === 0) {
|
|
216
|
+
G(`No offerings to ${e}`, "error");
|
|
185
217
|
return;
|
|
186
218
|
}
|
|
187
|
-
|
|
219
|
+
S((e) => e.map((e) => ({
|
|
188
220
|
...e,
|
|
189
221
|
isAvailable: t
|
|
190
|
-
}))),
|
|
191
|
-
|
|
222
|
+
}))), n.forEach((e) => b.mutate({
|
|
223
|
+
id: e.id,
|
|
224
|
+
input: { isAvailable: t }
|
|
225
|
+
}, { onError: () => G("Some offerings could not be updated on the server", "error") })), G(`${n.length} offerings ${e}d successfully`, "success");
|
|
226
|
+
}, Ie = () => {
|
|
227
|
+
if (x.length === 0) {
|
|
228
|
+
G("There are no offerings to export yet", "error");
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
let e = [[
|
|
232
|
+
"Name",
|
|
233
|
+
"Category",
|
|
234
|
+
"Price",
|
|
235
|
+
"Original Price",
|
|
236
|
+
"Stock",
|
|
237
|
+
"Available",
|
|
238
|
+
"Tags"
|
|
239
|
+
], ...x.map((e) => [
|
|
240
|
+
e.name,
|
|
241
|
+
e.category,
|
|
242
|
+
e.price,
|
|
243
|
+
e.originalPrice ?? "",
|
|
244
|
+
m(e.category) ? "" : e.stock,
|
|
245
|
+
e.isAvailable ? "Yes" : "No",
|
|
246
|
+
e.tags.join("; ")
|
|
247
|
+
])].map((e) => e.map(xe).join(",")).join("\n"), t = new Blob([e], { type: "text/csv;charset=utf-8;" }), n = URL.createObjectURL(t), r = document.createElement("a");
|
|
248
|
+
r.href = n, r.download = `offerings-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`, document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(n), G(`Exported ${x.length} offerings to CSV`, "success");
|
|
249
|
+
}, Le = (e) => m(e.category) ? {
|
|
192
250
|
color: "text-status-success-text",
|
|
193
251
|
label: "Available"
|
|
194
252
|
} : e.stock === 0 ? {
|
|
@@ -200,173 +258,171 @@ var pe = [
|
|
|
200
258
|
} : {
|
|
201
259
|
color: "text-status-success-text",
|
|
202
260
|
label: `In Stock (${e.stock})`
|
|
203
|
-
}, Z =
|
|
204
|
-
return /* @__PURE__ */
|
|
261
|
+
}, Z = P.category ? m(P.category) : !1, Re = P.category ? _e(P.category) : !1, Q = !Z && Re, $ = P.name && P.description && P.category && P.price > 0 && (!Z || P.duration && P.duration > 0) && (Z || P.stock >= 0);
|
|
262
|
+
return /* @__PURE__ */ p(n, {
|
|
205
263
|
title: "Offerings Management",
|
|
206
264
|
description: "Manage your products and services",
|
|
207
|
-
actions: /* @__PURE__ */
|
|
265
|
+
actions: /* @__PURE__ */ p("button", {
|
|
208
266
|
type: "button",
|
|
209
|
-
onClick:
|
|
267
|
+
onClick: K,
|
|
210
268
|
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",
|
|
211
|
-
children: [/* @__PURE__ */
|
|
269
|
+
children: [/* @__PURE__ */ f(d, { className: "h-4 w-4" }), "Add Item"]
|
|
212
270
|
}),
|
|
213
271
|
children: [
|
|
214
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ f(he, {
|
|
215
273
|
className: "mb-6",
|
|
216
274
|
children: "The menu and stock control room for your cart. Use this page to add and edit the products and services you offer, set prices and availability, and keep stock levels accurate so customers never order something you can't fulfil. Watch the out-of-stock and low-stock counts and restock before they cost you sales."
|
|
217
275
|
}),
|
|
218
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ p("div", {
|
|
219
277
|
className: "space-y-4",
|
|
220
278
|
children: [
|
|
221
|
-
|
|
222
|
-
className: t("flex items-center gap-2 rounded-lg border p-3",
|
|
223
|
-
children: [
|
|
224
|
-
className: t("text-sm font-medium",
|
|
225
|
-
children:
|
|
279
|
+
H && /* @__PURE__ */ p("div", {
|
|
280
|
+
className: t("flex items-center gap-2 rounded-lg border p-3", H.type === "success" ? "border-status-success-text/30 bg-status-success-bg-subtle" : "border-status-error-text/30 bg-status-error-bg-subtle"),
|
|
281
|
+
children: [H.type === "success" ? /* @__PURE__ */ f(ae, { className: "h-4 w-4 text-status-success-text" }) : /* @__PURE__ */ f(l, { className: "h-4 w-4 text-status-error-text" }), /* @__PURE__ */ f("span", {
|
|
282
|
+
className: t("text-sm font-medium", H.type === "success" ? "text-status-success-text" : "text-status-error-text"),
|
|
283
|
+
children: H.text
|
|
226
284
|
})]
|
|
227
285
|
}),
|
|
228
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ p(me, { children: [/* @__PURE__ */ f("h2", {
|
|
229
287
|
className: "mb-4 text-base font-semibold text-text-primary",
|
|
230
288
|
children: "Stock at a Glance"
|
|
231
|
-
}), /* @__PURE__ */
|
|
289
|
+
}), /* @__PURE__ */ p("div", {
|
|
232
290
|
className: "grid grid-cols-2 lg:grid-cols-4 gap-3",
|
|
233
291
|
children: [
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
children: "Total Items"
|
|
239
|
-
}), /* @__PURE__ */ u("p", {
|
|
240
|
-
className: "text-2xl font-bold text-text-primary",
|
|
241
|
-
children: xe
|
|
242
|
-
})]
|
|
292
|
+
/* @__PURE__ */ f(o, {
|
|
293
|
+
label: "Total Items",
|
|
294
|
+
value: je,
|
|
295
|
+
icon: /* @__PURE__ */ f(u, { className: "h-4 w-4" })
|
|
243
296
|
}),
|
|
244
|
-
/* @__PURE__ */
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
className: "text-
|
|
248
|
-
children:
|
|
249
|
-
}),
|
|
250
|
-
|
|
251
|
-
children: Se
|
|
252
|
-
})]
|
|
297
|
+
/* @__PURE__ */ f(o, {
|
|
298
|
+
label: "Available",
|
|
299
|
+
value: /* @__PURE__ */ f("span", {
|
|
300
|
+
className: "text-status-success-text",
|
|
301
|
+
children: Me
|
|
302
|
+
}),
|
|
303
|
+
icon: /* @__PURE__ */ f(ae, { className: "h-4 w-4" })
|
|
253
304
|
}),
|
|
254
|
-
/* @__PURE__ */
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
className: "text-
|
|
258
|
-
children:
|
|
259
|
-
}),
|
|
260
|
-
|
|
261
|
-
children: Ce
|
|
262
|
-
})]
|
|
305
|
+
/* @__PURE__ */ f(o, {
|
|
306
|
+
label: "Out of Stock",
|
|
307
|
+
value: /* @__PURE__ */ f("span", {
|
|
308
|
+
className: "text-status-error-text",
|
|
309
|
+
children: Ne
|
|
310
|
+
}),
|
|
311
|
+
icon: /* @__PURE__ */ f(l, { className: "h-4 w-4" })
|
|
263
312
|
}),
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
className: "text-
|
|
268
|
-
children:
|
|
269
|
-
}),
|
|
270
|
-
|
|
271
|
-
children: we
|
|
272
|
-
})]
|
|
313
|
+
/* @__PURE__ */ f(o, {
|
|
314
|
+
label: "Low Stock",
|
|
315
|
+
value: /* @__PURE__ */ f("span", {
|
|
316
|
+
className: "text-status-warning-text",
|
|
317
|
+
children: Pe
|
|
318
|
+
}),
|
|
319
|
+
icon: /* @__PURE__ */ f(ce, { className: "h-4 w-4" })
|
|
273
320
|
})
|
|
274
321
|
]
|
|
275
322
|
})] }),
|
|
276
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ p("div", {
|
|
277
324
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 shadow-sm space-y-4",
|
|
278
|
-
children: [/* @__PURE__ */
|
|
325
|
+
children: [/* @__PURE__ */ p("div", {
|
|
279
326
|
className: "flex flex-col lg:flex-row lg:items-center lg:justify-between gap-3",
|
|
280
|
-
children: [/* @__PURE__ */
|
|
327
|
+
children: [/* @__PURE__ */ p("div", {
|
|
281
328
|
className: "flex flex-wrap gap-2",
|
|
282
329
|
children: [
|
|
283
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ p("button", {
|
|
284
331
|
type: "button",
|
|
285
|
-
onClick:
|
|
332
|
+
onClick: K,
|
|
286
333
|
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",
|
|
287
|
-
children: [/* @__PURE__ */
|
|
334
|
+
children: [/* @__PURE__ */ f(d, { className: "h-4 w-4" }), "Add Item"]
|
|
288
335
|
}),
|
|
289
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ f("button", {
|
|
290
337
|
type: "button",
|
|
291
|
-
onClick: () =>
|
|
338
|
+
onClick: () => X("enable"),
|
|
292
339
|
className: "rounded-md border border-border-subtle px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
|
|
293
340
|
children: "Enable All"
|
|
294
341
|
}),
|
|
295
|
-
/* @__PURE__ */
|
|
342
|
+
/* @__PURE__ */ f("button", {
|
|
296
343
|
type: "button",
|
|
297
|
-
onClick: () =>
|
|
344
|
+
onClick: () => X("disable"),
|
|
298
345
|
className: "rounded-md border border-border-subtle px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
|
|
299
346
|
children: "Disable All"
|
|
300
347
|
})
|
|
301
348
|
]
|
|
302
|
-
}), /* @__PURE__ */
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
349
|
+
}), /* @__PURE__ */ p("div", {
|
|
350
|
+
className: "flex flex-wrap gap-2",
|
|
351
|
+
children: [/* @__PURE__ */ p("button", {
|
|
352
|
+
type: "button",
|
|
353
|
+
onClick: Ie,
|
|
354
|
+
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",
|
|
355
|
+
children: [/* @__PURE__ */ f(oe, { className: "h-4 w-4" }), "Export CSV"]
|
|
356
|
+
}), /* @__PURE__ */ p("button", {
|
|
357
|
+
type: "button",
|
|
358
|
+
disabled: !0,
|
|
359
|
+
title: "Bulk import is coming soon",
|
|
360
|
+
className: "inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-2 text-sm text-text-secondary opacity-60 cursor-not-allowed",
|
|
361
|
+
children: [/* @__PURE__ */ f(de, { className: "h-4 w-4" }), "Import (coming soon)"]
|
|
362
|
+
})]
|
|
307
363
|
})]
|
|
308
|
-
}), /* @__PURE__ */
|
|
364
|
+
}), /* @__PURE__ */ p("div", {
|
|
309
365
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",
|
|
310
366
|
children: [
|
|
311
|
-
/* @__PURE__ */
|
|
367
|
+
/* @__PURE__ */ p("div", {
|
|
312
368
|
className: "relative sm:col-span-2 lg:col-span-1",
|
|
313
|
-
children: [/* @__PURE__ */
|
|
369
|
+
children: [/* @__PURE__ */ f(le, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ f("input", {
|
|
314
370
|
type: "text",
|
|
315
371
|
placeholder: "Search offerings...",
|
|
316
|
-
value:
|
|
317
|
-
onChange: (e) =>
|
|
372
|
+
value: C,
|
|
373
|
+
onChange: (e) => w(e.target.value),
|
|
318
374
|
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)]"
|
|
319
375
|
})]
|
|
320
376
|
}),
|
|
321
|
-
/* @__PURE__ */
|
|
322
|
-
value:
|
|
323
|
-
onChange: (e) =>
|
|
377
|
+
/* @__PURE__ */ p("select", {
|
|
378
|
+
value: T,
|
|
379
|
+
onChange: (e) => E(e.target.value),
|
|
324
380
|
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
325
|
-
children: [/* @__PURE__ */
|
|
381
|
+
children: [/* @__PURE__ */ f("option", {
|
|
326
382
|
value: "",
|
|
327
383
|
children: "All Categories"
|
|
328
|
-
}),
|
|
384
|
+
}), Ae.map((e) => /* @__PURE__ */ f("option", {
|
|
329
385
|
value: e,
|
|
330
386
|
children: e
|
|
331
387
|
}, e))]
|
|
332
388
|
}),
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
-
value:
|
|
335
|
-
onChange: (e) =>
|
|
389
|
+
/* @__PURE__ */ p("select", {
|
|
390
|
+
value: D,
|
|
391
|
+
onChange: (e) => O(e.target.value),
|
|
336
392
|
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
337
393
|
children: [
|
|
338
|
-
/* @__PURE__ */
|
|
394
|
+
/* @__PURE__ */ f("option", {
|
|
339
395
|
value: "",
|
|
340
396
|
children: "All Status"
|
|
341
397
|
}),
|
|
342
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ f("option", {
|
|
343
399
|
value: "available",
|
|
344
400
|
children: "Available"
|
|
345
401
|
}),
|
|
346
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ f("option", {
|
|
347
403
|
value: "unavailable",
|
|
348
404
|
children: "Unavailable"
|
|
349
405
|
})
|
|
350
406
|
]
|
|
351
407
|
}),
|
|
352
|
-
/* @__PURE__ */
|
|
353
|
-
value:
|
|
354
|
-
onChange: (e) =>
|
|
408
|
+
/* @__PURE__ */ p("select", {
|
|
409
|
+
value: k,
|
|
410
|
+
onChange: (e) => A(e.target.value),
|
|
355
411
|
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
356
412
|
children: [
|
|
357
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ f("option", {
|
|
358
414
|
value: "name",
|
|
359
415
|
children: "Name A-Z"
|
|
360
416
|
}),
|
|
361
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ f("option", {
|
|
362
418
|
value: "price_low",
|
|
363
419
|
children: "Price: Low to High"
|
|
364
420
|
}),
|
|
365
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ f("option", {
|
|
366
422
|
value: "price_high",
|
|
367
423
|
children: "Price: High to Low"
|
|
368
424
|
}),
|
|
369
|
-
/* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ f("option", {
|
|
370
426
|
value: "stock",
|
|
371
427
|
children: "Stock: Low to High"
|
|
372
428
|
})
|
|
@@ -375,133 +431,147 @@ var pe = [
|
|
|
375
431
|
]
|
|
376
432
|
})]
|
|
377
433
|
}),
|
|
378
|
-
|
|
434
|
+
we ? /* @__PURE__ */ f("div", {
|
|
379
435
|
className: "flex items-center justify-center py-16",
|
|
380
|
-
children: /* @__PURE__ */
|
|
381
|
-
}) :
|
|
382
|
-
illustration:
|
|
436
|
+
children: /* @__PURE__ */ f("div", { className: "h-10 w-10 animate-spin rounded-full border-b-2 border-foreground" })
|
|
437
|
+
}) : W.length === 0 ? /* @__PURE__ */ f(r, {
|
|
438
|
+
illustration: C || T || D ? "empty-search" : "empty-files",
|
|
383
439
|
title: "No items found",
|
|
384
|
-
description:
|
|
385
|
-
action: /* @__PURE__ */
|
|
440
|
+
description: C || T || D ? "No items match your current filters. Try adjusting your search criteria." : "You haven't added any items yet. Start building your offerings so customers can order from you.",
|
|
441
|
+
action: /* @__PURE__ */ p("div", {
|
|
386
442
|
className: "flex flex-wrap justify-center gap-3",
|
|
387
|
-
children: [/* @__PURE__ */
|
|
443
|
+
children: [/* @__PURE__ */ p("button", {
|
|
388
444
|
type: "button",
|
|
389
|
-
onClick:
|
|
445
|
+
onClick: K,
|
|
390
446
|
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",
|
|
391
|
-
children: [/* @__PURE__ */
|
|
392
|
-
}), (
|
|
447
|
+
children: [/* @__PURE__ */ f(d, { className: "h-4 w-4" }), "Add Your First Item"]
|
|
448
|
+
}), (C || T || D) && /* @__PURE__ */ f("button", {
|
|
393
449
|
type: "button",
|
|
394
450
|
onClick: () => {
|
|
395
|
-
|
|
451
|
+
w(""), E(""), O(""), A("name");
|
|
396
452
|
},
|
|
397
453
|
className: "rounded-md border border-border-subtle px-4 py-2 text-sm text-text-primary hover:bg-bg-sunken",
|
|
398
454
|
children: "Clear Filters"
|
|
399
455
|
})]
|
|
400
456
|
})
|
|
401
|
-
}) : /* @__PURE__ */
|
|
457
|
+
}) : /* @__PURE__ */ p(pe, { children: [/* @__PURE__ */ f("div", {
|
|
402
458
|
className: "hidden lg:block rounded-lg border border-border-subtle bg-bg-surface shadow-sm overflow-hidden",
|
|
403
|
-
children: /* @__PURE__ */
|
|
459
|
+
children: /* @__PURE__ */ f("div", {
|
|
404
460
|
className: "overflow-x-auto",
|
|
405
|
-
children: /* @__PURE__ */
|
|
461
|
+
children: /* @__PURE__ */ p("table", {
|
|
406
462
|
className: "w-full text-sm",
|
|
407
|
-
children: [/* @__PURE__ */
|
|
463
|
+
children: [/* @__PURE__ */ f("thead", { children: /* @__PURE__ */ p("tr", {
|
|
408
464
|
className: "border-b border-border-subtle bg-bg-sunken/50",
|
|
409
465
|
children: [
|
|
410
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ f("th", {
|
|
411
467
|
className: "px-5 py-3 text-left font-medium text-text-secondary",
|
|
412
468
|
children: "Item"
|
|
413
469
|
}),
|
|
414
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ f("th", {
|
|
415
471
|
className: "px-5 py-3 text-left font-medium text-text-secondary",
|
|
416
472
|
children: "Category"
|
|
417
473
|
}),
|
|
418
|
-
/* @__PURE__ */
|
|
474
|
+
/* @__PURE__ */ f("th", {
|
|
419
475
|
className: "px-5 py-3 text-right font-medium text-text-secondary",
|
|
420
476
|
children: "Price"
|
|
421
477
|
}),
|
|
422
|
-
/* @__PURE__ */
|
|
478
|
+
/* @__PURE__ */ f("th", {
|
|
423
479
|
className: "px-5 py-3 text-left font-medium text-text-secondary",
|
|
424
480
|
children: "Stock/Status"
|
|
425
481
|
}),
|
|
426
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ f("th", {
|
|
427
483
|
className: "px-5 py-3 text-center font-medium text-text-secondary",
|
|
428
484
|
children: "Available"
|
|
429
485
|
}),
|
|
430
|
-
/* @__PURE__ */
|
|
486
|
+
/* @__PURE__ */ f("th", {
|
|
431
487
|
className: "px-5 py-3 text-right font-medium text-text-secondary",
|
|
432
488
|
children: "Actions"
|
|
433
489
|
})
|
|
434
490
|
]
|
|
435
|
-
}) }), /* @__PURE__ */
|
|
436
|
-
let n =
|
|
437
|
-
return /* @__PURE__ */
|
|
491
|
+
}) }), /* @__PURE__ */ f("tbody", { children: W.map((e) => {
|
|
492
|
+
let n = Le(e);
|
|
493
|
+
return /* @__PURE__ */ p("tr", {
|
|
438
494
|
className: "border-b border-border-subtle last:border-0 hover:bg-bg-sunken/30 transition-colors",
|
|
439
495
|
children: [
|
|
440
|
-
/* @__PURE__ */
|
|
496
|
+
/* @__PURE__ */ f("td", {
|
|
441
497
|
className: "px-5 py-3",
|
|
442
|
-
children: /* @__PURE__ */
|
|
498
|
+
children: /* @__PURE__ */ p("div", {
|
|
443
499
|
className: "flex items-center gap-3",
|
|
444
|
-
children: [/* @__PURE__ */
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
className: "
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
className: "
|
|
452
|
-
|
|
453
|
-
|
|
500
|
+
children: [e.image ? /* @__PURE__ */ f("img", {
|
|
501
|
+
src: e.image,
|
|
502
|
+
alt: "",
|
|
503
|
+
loading: "lazy",
|
|
504
|
+
className: "h-10 w-10 shrink-0 rounded-md object-cover"
|
|
505
|
+
}) : /* @__PURE__ */ f("div", {
|
|
506
|
+
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-bg-sunken",
|
|
507
|
+
children: /* @__PURE__ */ f(u, { className: "h-4 w-4 text-text-secondary" })
|
|
508
|
+
}), /* @__PURE__ */ p("div", {
|
|
509
|
+
className: "min-w-0",
|
|
510
|
+
children: [/* @__PURE__ */ p("div", {
|
|
511
|
+
className: "flex items-center gap-2",
|
|
512
|
+
children: [/* @__PURE__ */ f("p", {
|
|
513
|
+
className: "font-medium text-text-primary",
|
|
514
|
+
children: e.name
|
|
515
|
+
}), /* @__PURE__ */ f("span", {
|
|
516
|
+
className: "inline-flex shrink-0 rounded bg-status-info-bg-subtle px-1.5 py-0.5 text-[10px] font-medium text-status-info-text",
|
|
517
|
+
children: e.kind
|
|
518
|
+
})]
|
|
519
|
+
}), e.description && /* @__PURE__ */ f("p", {
|
|
520
|
+
className: "text-xs text-text-secondary line-clamp-1",
|
|
521
|
+
children: e.description
|
|
522
|
+
})]
|
|
523
|
+
})]
|
|
454
524
|
})
|
|
455
525
|
}),
|
|
456
|
-
/* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ f("td", {
|
|
457
527
|
className: "px-5 py-3",
|
|
458
|
-
children: /* @__PURE__ */
|
|
528
|
+
children: /* @__PURE__ */ f("span", {
|
|
459
529
|
className: "inline-flex rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary",
|
|
460
530
|
children: e.category
|
|
461
531
|
})
|
|
462
532
|
}),
|
|
463
|
-
/* @__PURE__ */
|
|
533
|
+
/* @__PURE__ */ p("td", {
|
|
464
534
|
className: "px-5 py-3 text-right",
|
|
465
|
-
children: [/* @__PURE__ */
|
|
535
|
+
children: [/* @__PURE__ */ f("p", {
|
|
466
536
|
className: "font-medium text-text-primary",
|
|
467
537
|
children: a(e.price, { minimumFractionDigits: 0 })
|
|
468
|
-
}), e.originalPrice && /* @__PURE__ */
|
|
538
|
+
}), e.originalPrice && /* @__PURE__ */ f("p", {
|
|
469
539
|
className: "text-xs text-text-secondary line-through",
|
|
470
540
|
children: a(e.originalPrice, { minimumFractionDigits: 0 })
|
|
471
541
|
})]
|
|
472
542
|
}),
|
|
473
|
-
/* @__PURE__ */
|
|
543
|
+
/* @__PURE__ */ f("td", {
|
|
474
544
|
className: "px-5 py-3",
|
|
475
|
-
children: /* @__PURE__ */
|
|
545
|
+
children: /* @__PURE__ */ f("span", {
|
|
476
546
|
className: t("text-sm font-medium", n.color),
|
|
477
547
|
children: n.label
|
|
478
548
|
})
|
|
479
549
|
}),
|
|
480
|
-
/* @__PURE__ */
|
|
550
|
+
/* @__PURE__ */ f("td", {
|
|
481
551
|
className: "px-5 py-3 text-center",
|
|
482
|
-
children: /* @__PURE__ */
|
|
552
|
+
children: /* @__PURE__ */ f("button", {
|
|
483
553
|
type: "button",
|
|
484
|
-
onClick: () =>
|
|
554
|
+
onClick: () => Y(e.id, !e.isAvailable),
|
|
485
555
|
className: t("h-6 w-11 rounded-full transition-colors relative inline-block", e.isAvailable ? "bg-action-primary-bg" : "bg-muted-foreground/30"),
|
|
486
|
-
children: /* @__PURE__ */
|
|
556
|
+
children: /* @__PURE__ */ f("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") })
|
|
487
557
|
})
|
|
488
558
|
}),
|
|
489
|
-
/* @__PURE__ */
|
|
559
|
+
/* @__PURE__ */ f("td", {
|
|
490
560
|
className: "px-5 py-3",
|
|
491
|
-
children: /* @__PURE__ */
|
|
561
|
+
children: /* @__PURE__ */ p("div", {
|
|
492
562
|
className: "flex items-center justify-end gap-1",
|
|
493
|
-
children: [/* @__PURE__ */
|
|
563
|
+
children: [/* @__PURE__ */ f("button", {
|
|
494
564
|
type: "button",
|
|
495
|
-
onClick: () =>
|
|
565
|
+
onClick: () => q(e),
|
|
496
566
|
className: "rounded p-1.5 text-text-secondary hover:bg-bg-sunken hover:text-text-primary transition-colors",
|
|
497
567
|
title: "Edit",
|
|
498
|
-
children: /* @__PURE__ */
|
|
499
|
-
}), /* @__PURE__ */
|
|
568
|
+
children: /* @__PURE__ */ f(se, { className: "h-4 w-4" })
|
|
569
|
+
}), /* @__PURE__ */ f("button", {
|
|
500
570
|
type: "button",
|
|
501
|
-
onClick: () =>
|
|
571
|
+
onClick: () => J(e.id),
|
|
502
572
|
className: "rounded p-1.5 text-text-secondary hover:bg-status-error-bg-subtle hover:text-status-error-text transition-colors",
|
|
503
573
|
title: "Delete",
|
|
504
|
-
children: /* @__PURE__ */
|
|
574
|
+
children: /* @__PURE__ */ f(ue, { className: "h-4 w-4" })
|
|
505
575
|
})]
|
|
506
576
|
})
|
|
507
577
|
})
|
|
@@ -510,69 +580,80 @@ var pe = [
|
|
|
510
580
|
}) })]
|
|
511
581
|
})
|
|
512
582
|
})
|
|
513
|
-
}), /* @__PURE__ */
|
|
583
|
+
}), /* @__PURE__ */ f("div", {
|
|
514
584
|
className: "lg:hidden space-y-3",
|
|
515
|
-
children:
|
|
516
|
-
let n =
|
|
517
|
-
return /* @__PURE__ */
|
|
585
|
+
children: W.map((e) => {
|
|
586
|
+
let n = Le(e);
|
|
587
|
+
return /* @__PURE__ */ f("div", {
|
|
518
588
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 shadow-sm",
|
|
519
|
-
children: /* @__PURE__ */
|
|
589
|
+
children: /* @__PURE__ */ p("div", {
|
|
520
590
|
className: "flex items-start gap-3",
|
|
521
|
-
children: [/* @__PURE__ */
|
|
591
|
+
children: [e.image ? /* @__PURE__ */ f("img", {
|
|
592
|
+
src: e.image,
|
|
593
|
+
alt: "",
|
|
594
|
+
loading: "lazy",
|
|
595
|
+
className: "h-14 w-14 shrink-0 rounded-md object-cover"
|
|
596
|
+
}) : /* @__PURE__ */ f("div", {
|
|
522
597
|
className: "flex h-14 w-14 items-center justify-center rounded-md bg-bg-sunken shrink-0",
|
|
523
|
-
children: /* @__PURE__ */ u
|
|
524
|
-
}), /* @__PURE__ */
|
|
598
|
+
children: /* @__PURE__ */ f(u, { className: "h-6 w-6 text-text-secondary" })
|
|
599
|
+
}), /* @__PURE__ */ p("div", {
|
|
525
600
|
className: "flex-1 min-w-0",
|
|
526
601
|
children: [
|
|
527
|
-
/* @__PURE__ */
|
|
602
|
+
/* @__PURE__ */ p("div", {
|
|
528
603
|
className: "flex items-start justify-between mb-1",
|
|
529
|
-
children: [/* @__PURE__ */
|
|
604
|
+
children: [/* @__PURE__ */ p("div", {
|
|
530
605
|
className: "flex-1",
|
|
531
|
-
children: [/* @__PURE__ */
|
|
532
|
-
className: "
|
|
533
|
-
children:
|
|
534
|
-
|
|
606
|
+
children: [/* @__PURE__ */ p("div", {
|
|
607
|
+
className: "flex items-center gap-2",
|
|
608
|
+
children: [/* @__PURE__ */ f("h3", {
|
|
609
|
+
className: "text-sm font-medium text-text-primary line-clamp-1",
|
|
610
|
+
children: e.name
|
|
611
|
+
}), /* @__PURE__ */ f("span", {
|
|
612
|
+
className: "inline-flex shrink-0 rounded bg-status-info-bg-subtle px-1.5 py-0.5 text-[10px] font-medium text-status-info-text",
|
|
613
|
+
children: e.kind
|
|
614
|
+
})]
|
|
615
|
+
}), /* @__PURE__ */ f("p", {
|
|
535
616
|
className: "text-xs text-text-secondary mt-0.5 line-clamp-2",
|
|
536
617
|
children: e.description
|
|
537
618
|
})]
|
|
538
|
-
}), /* @__PURE__ */
|
|
619
|
+
}), /* @__PURE__ */ f("button", {
|
|
539
620
|
type: "button",
|
|
540
|
-
onClick: () =>
|
|
621
|
+
onClick: () => Y(e.id, !e.isAvailable),
|
|
541
622
|
className: t("h-5 w-9 rounded-full transition-colors relative ml-2 shrink-0", e.isAvailable ? "bg-action-primary-bg" : "bg-muted-foreground/30"),
|
|
542
|
-
children: /* @__PURE__ */
|
|
623
|
+
children: /* @__PURE__ */ f("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") })
|
|
543
624
|
})]
|
|
544
625
|
}),
|
|
545
|
-
/* @__PURE__ */
|
|
626
|
+
/* @__PURE__ */ p("div", {
|
|
546
627
|
className: "flex flex-wrap items-center gap-2 mt-2 text-xs",
|
|
547
|
-
children: [/* @__PURE__ */
|
|
628
|
+
children: [/* @__PURE__ */ f("span", {
|
|
548
629
|
className: "px-2 py-0.5 rounded-full bg-bg-sunken text-text-secondary",
|
|
549
630
|
children: e.category
|
|
550
|
-
}), /* @__PURE__ */
|
|
631
|
+
}), /* @__PURE__ */ f("span", {
|
|
551
632
|
className: t("font-medium", n.color),
|
|
552
633
|
children: n.label
|
|
553
634
|
})]
|
|
554
635
|
}),
|
|
555
|
-
/* @__PURE__ */
|
|
636
|
+
/* @__PURE__ */ p("div", {
|
|
556
637
|
className: "flex items-center justify-between mt-3",
|
|
557
|
-
children: [/* @__PURE__ */
|
|
638
|
+
children: [/* @__PURE__ */ p("div", {
|
|
558
639
|
className: "flex items-center gap-2",
|
|
559
|
-
children: [/* @__PURE__ */
|
|
640
|
+
children: [/* @__PURE__ */ f("span", {
|
|
560
641
|
className: "font-semibold text-text-primary",
|
|
561
642
|
children: a(e.price, { minimumFractionDigits: 0 })
|
|
562
|
-
}), e.originalPrice && /* @__PURE__ */
|
|
643
|
+
}), e.originalPrice && /* @__PURE__ */ f("span", {
|
|
563
644
|
className: "text-xs text-text-secondary line-through",
|
|
564
645
|
children: a(e.originalPrice, { minimumFractionDigits: 0 })
|
|
565
646
|
})]
|
|
566
|
-
}), /* @__PURE__ */
|
|
647
|
+
}), /* @__PURE__ */ p("div", {
|
|
567
648
|
className: "flex gap-1",
|
|
568
|
-
children: [/* @__PURE__ */
|
|
649
|
+
children: [/* @__PURE__ */ f("button", {
|
|
569
650
|
type: "button",
|
|
570
|
-
onClick: () =>
|
|
651
|
+
onClick: () => q(e),
|
|
571
652
|
className: "rounded px-2 py-1 text-xs border border-border-subtle text-text-primary hover:bg-bg-sunken",
|
|
572
653
|
children: "Edit"
|
|
573
|
-
}), /* @__PURE__ */
|
|
654
|
+
}), /* @__PURE__ */ f("button", {
|
|
574
655
|
type: "button",
|
|
575
|
-
onClick: () =>
|
|
656
|
+
onClick: () => J(e.id),
|
|
576
657
|
className: "rounded px-2 py-1 text-xs border border-border-subtle text-status-error-text hover:bg-status-error-bg-subtle",
|
|
577
658
|
children: "Delete"
|
|
578
659
|
})]
|
|
@@ -586,75 +667,75 @@ var pe = [
|
|
|
586
667
|
})] })
|
|
587
668
|
]
|
|
588
669
|
}),
|
|
589
|
-
|
|
670
|
+
ke && /* @__PURE__ */ f("div", {
|
|
590
671
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",
|
|
591
|
-
children: /* @__PURE__ */
|
|
672
|
+
children: /* @__PURE__ */ f("div", {
|
|
592
673
|
className: "w-full max-w-2xl max-h-[90vh] overflow-y-auto rounded-lg border border-border-subtle bg-bg-surface shadow-xl",
|
|
593
|
-
children: /* @__PURE__ */
|
|
674
|
+
children: /* @__PURE__ */ p("div", {
|
|
594
675
|
className: "p-6",
|
|
595
676
|
children: [
|
|
596
|
-
/* @__PURE__ */
|
|
677
|
+
/* @__PURE__ */ p("div", {
|
|
597
678
|
className: "flex items-center justify-between mb-4",
|
|
598
|
-
children: [/* @__PURE__ */
|
|
679
|
+
children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h3", {
|
|
599
680
|
className: "text-lg font-semibold text-text-primary",
|
|
600
|
-
children:
|
|
601
|
-
}),
|
|
681
|
+
children: M ? "Edit Item" : "Add New Item"
|
|
682
|
+
}), P.category && /* @__PURE__ */ p("p", {
|
|
602
683
|
className: "text-sm text-text-secondary mt-0.5",
|
|
603
684
|
children: [
|
|
604
685
|
"Type: ",
|
|
605
686
|
Z ? "Service" : "Product",
|
|
606
687
|
" | Category: ",
|
|
607
|
-
|
|
688
|
+
P.category
|
|
608
689
|
]
|
|
609
|
-
})] }), /* @__PURE__ */
|
|
690
|
+
})] }), /* @__PURE__ */ f("button", {
|
|
610
691
|
type: "button",
|
|
611
|
-
onClick: () =>
|
|
692
|
+
onClick: () => j(!1),
|
|
612
693
|
className: "rounded p-1.5 text-text-secondary hover:text-text-primary hover:bg-bg-sunken transition-colors",
|
|
613
|
-
children: /* @__PURE__ */
|
|
694
|
+
children: /* @__PURE__ */ f(fe, { className: "h-5 w-5" })
|
|
614
695
|
})]
|
|
615
696
|
}),
|
|
616
|
-
/* @__PURE__ */
|
|
697
|
+
/* @__PURE__ */ p("div", {
|
|
617
698
|
className: "space-y-4",
|
|
618
699
|
children: [
|
|
619
|
-
/* @__PURE__ */
|
|
700
|
+
/* @__PURE__ */ p("div", {
|
|
620
701
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
621
|
-
children: [/* @__PURE__ */
|
|
702
|
+
children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
622
703
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
623
704
|
children: "Item Name *"
|
|
624
|
-
}), /* @__PURE__ */
|
|
705
|
+
}), /* @__PURE__ */ f("input", {
|
|
625
706
|
type: "text",
|
|
626
|
-
value:
|
|
627
|
-
onChange: (e) =>
|
|
707
|
+
value: P.name,
|
|
708
|
+
onChange: (e) => F((t) => ({
|
|
628
709
|
...t,
|
|
629
710
|
name: e.target.value
|
|
630
711
|
})),
|
|
631
712
|
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",
|
|
632
713
|
placeholder: "Enter item name"
|
|
633
|
-
})] }), /* @__PURE__ */
|
|
714
|
+
})] }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
634
715
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
635
716
|
children: "Category *"
|
|
636
|
-
}), /* @__PURE__ */
|
|
637
|
-
value:
|
|
638
|
-
onChange: (e) =>
|
|
717
|
+
}), /* @__PURE__ */ p("select", {
|
|
718
|
+
value: P.category,
|
|
719
|
+
onChange: (e) => F((t) => ({
|
|
639
720
|
...t,
|
|
640
721
|
category: e.target.value
|
|
641
722
|
})),
|
|
642
723
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
643
|
-
children: [/* @__PURE__ */
|
|
724
|
+
children: [/* @__PURE__ */ f("option", {
|
|
644
725
|
value: "",
|
|
645
726
|
children: "Select category"
|
|
646
|
-
}),
|
|
727
|
+
}), ye.map((e) => /* @__PURE__ */ f("option", {
|
|
647
728
|
value: e,
|
|
648
729
|
children: e
|
|
649
730
|
}, e))]
|
|
650
731
|
})] })]
|
|
651
732
|
}),
|
|
652
|
-
/* @__PURE__ */
|
|
733
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
653
734
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
654
735
|
children: "Description *"
|
|
655
|
-
}), /* @__PURE__ */
|
|
656
|
-
value:
|
|
657
|
-
onChange: (e) =>
|
|
736
|
+
}), /* @__PURE__ */ f("textarea", {
|
|
737
|
+
value: P.description,
|
|
738
|
+
onChange: (e) => F((t) => ({
|
|
658
739
|
...t,
|
|
659
740
|
description: e.target.value
|
|
660
741
|
})),
|
|
@@ -662,26 +743,26 @@ var pe = [
|
|
|
662
743
|
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",
|
|
663
744
|
placeholder: "Describe the offering..."
|
|
664
745
|
})] }),
|
|
665
|
-
/* @__PURE__ */
|
|
746
|
+
/* @__PURE__ */ p("div", {
|
|
666
747
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
667
|
-
children: [/* @__PURE__ */
|
|
748
|
+
children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
668
749
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
669
750
|
children: "Price *"
|
|
670
|
-
}), /* @__PURE__ */
|
|
751
|
+
}), /* @__PURE__ */ f("input", {
|
|
671
752
|
type: "number",
|
|
672
|
-
value:
|
|
673
|
-
onChange: (e) =>
|
|
753
|
+
value: P.price,
|
|
754
|
+
onChange: (e) => F((t) => ({
|
|
674
755
|
...t,
|
|
675
756
|
price: parseInt(e.target.value) || 0
|
|
676
757
|
})),
|
|
677
758
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
678
|
-
})] }), /* @__PURE__ */
|
|
759
|
+
})] }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
679
760
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
680
761
|
children: "Original Price"
|
|
681
|
-
}), /* @__PURE__ */
|
|
762
|
+
}), /* @__PURE__ */ f("input", {
|
|
682
763
|
type: "number",
|
|
683
|
-
value:
|
|
684
|
-
onChange: (e) =>
|
|
764
|
+
value: P.originalPrice ?? "",
|
|
765
|
+
onChange: (e) => F((t) => ({
|
|
685
766
|
...t,
|
|
686
767
|
originalPrice: e.target.value ? parseInt(e.target.value) : void 0
|
|
687
768
|
})),
|
|
@@ -689,40 +770,40 @@ var pe = [
|
|
|
689
770
|
placeholder: "Optional"
|
|
690
771
|
})] })]
|
|
691
772
|
}),
|
|
692
|
-
!Z && /* @__PURE__ */
|
|
773
|
+
!Z && /* @__PURE__ */ p("div", {
|
|
693
774
|
className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
|
|
694
775
|
children: [
|
|
695
|
-
/* @__PURE__ */
|
|
776
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
696
777
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
697
778
|
children: "Stock Quantity *"
|
|
698
|
-
}), /* @__PURE__ */
|
|
779
|
+
}), /* @__PURE__ */ f("input", {
|
|
699
780
|
type: "number",
|
|
700
|
-
value:
|
|
701
|
-
onChange: (e) =>
|
|
781
|
+
value: P.stock,
|
|
782
|
+
onChange: (e) => F((t) => ({
|
|
702
783
|
...t,
|
|
703
784
|
stock: parseInt(e.target.value) || 0
|
|
704
785
|
})),
|
|
705
786
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
706
787
|
})] }),
|
|
707
|
-
/* @__PURE__ */
|
|
788
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
708
789
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
709
790
|
children: "Preparation Time (min)"
|
|
710
|
-
}), /* @__PURE__ */
|
|
791
|
+
}), /* @__PURE__ */ f("input", {
|
|
711
792
|
type: "number",
|
|
712
|
-
value:
|
|
713
|
-
onChange: (e) =>
|
|
793
|
+
value: P.preparationTime,
|
|
794
|
+
onChange: (e) => F((t) => ({
|
|
714
795
|
...t,
|
|
715
796
|
preparationTime: parseInt(e.target.value) || 0
|
|
716
797
|
})),
|
|
717
798
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
718
799
|
})] }),
|
|
719
|
-
Q && /* @__PURE__ */
|
|
800
|
+
Q && /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
720
801
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
721
802
|
children: "Calories"
|
|
722
|
-
}), /* @__PURE__ */
|
|
803
|
+
}), /* @__PURE__ */ f("input", {
|
|
723
804
|
type: "number",
|
|
724
|
-
value:
|
|
725
|
-
onChange: (e) =>
|
|
805
|
+
value: P.calories,
|
|
806
|
+
onChange: (e) => F((t) => ({
|
|
726
807
|
...t,
|
|
727
808
|
calories: parseInt(e.target.value) || 0
|
|
728
809
|
})),
|
|
@@ -730,81 +811,81 @@ var pe = [
|
|
|
730
811
|
})] })
|
|
731
812
|
]
|
|
732
813
|
}),
|
|
733
|
-
Z && /* @__PURE__ */
|
|
814
|
+
Z && /* @__PURE__ */ p("div", {
|
|
734
815
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
735
|
-
children: [/* @__PURE__ */
|
|
816
|
+
children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
736
817
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
737
818
|
children: "Service Duration (min) *"
|
|
738
|
-
}), /* @__PURE__ */
|
|
819
|
+
}), /* @__PURE__ */ f("input", {
|
|
739
820
|
type: "number",
|
|
740
|
-
value:
|
|
741
|
-
onChange: (e) =>
|
|
821
|
+
value: P.duration,
|
|
822
|
+
onChange: (e) => F((t) => ({
|
|
742
823
|
...t,
|
|
743
824
|
duration: parseInt(e.target.value) || 30
|
|
744
825
|
})),
|
|
745
826
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
746
|
-
})] }), /* @__PURE__ */
|
|
827
|
+
})] }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
747
828
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
748
829
|
children: "Setup Time (min)"
|
|
749
|
-
}), /* @__PURE__ */
|
|
830
|
+
}), /* @__PURE__ */ f("input", {
|
|
750
831
|
type: "number",
|
|
751
|
-
value:
|
|
752
|
-
onChange: (e) =>
|
|
832
|
+
value: P.preparationTime,
|
|
833
|
+
onChange: (e) => F((t) => ({
|
|
753
834
|
...t,
|
|
754
835
|
preparationTime: parseInt(e.target.value) || 0
|
|
755
836
|
})),
|
|
756
837
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
757
838
|
})] })]
|
|
758
839
|
}),
|
|
759
|
-
Q && /* @__PURE__ */
|
|
840
|
+
Q && /* @__PURE__ */ p("div", {
|
|
760
841
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
761
|
-
children: [/* @__PURE__ */
|
|
842
|
+
children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
762
843
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
763
844
|
children: "Spice Level"
|
|
764
|
-
}), /* @__PURE__ */
|
|
765
|
-
value:
|
|
766
|
-
onChange: (e) =>
|
|
845
|
+
}), /* @__PURE__ */ p("select", {
|
|
846
|
+
value: P.spiceLevel,
|
|
847
|
+
onChange: (e) => F((t) => ({
|
|
767
848
|
...t,
|
|
768
849
|
spiceLevel: e.target.value
|
|
769
850
|
})),
|
|
770
851
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
771
852
|
children: [
|
|
772
|
-
/* @__PURE__ */
|
|
853
|
+
/* @__PURE__ */ f("option", {
|
|
773
854
|
value: "none",
|
|
774
855
|
children: "None"
|
|
775
856
|
}),
|
|
776
|
-
/* @__PURE__ */
|
|
857
|
+
/* @__PURE__ */ f("option", {
|
|
777
858
|
value: "mild",
|
|
778
859
|
children: "Mild"
|
|
779
860
|
}),
|
|
780
|
-
/* @__PURE__ */
|
|
861
|
+
/* @__PURE__ */ f("option", {
|
|
781
862
|
value: "medium",
|
|
782
863
|
children: "Medium"
|
|
783
864
|
}),
|
|
784
|
-
/* @__PURE__ */
|
|
865
|
+
/* @__PURE__ */ f("option", {
|
|
785
866
|
value: "spicy",
|
|
786
867
|
children: "Spicy"
|
|
787
868
|
}),
|
|
788
|
-
/* @__PURE__ */
|
|
869
|
+
/* @__PURE__ */ f("option", {
|
|
789
870
|
value: "very-spicy",
|
|
790
871
|
children: "Very Spicy"
|
|
791
872
|
})
|
|
792
873
|
]
|
|
793
|
-
})] }), /* @__PURE__ */
|
|
874
|
+
})] }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
794
875
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
795
876
|
children: "Dietary Options"
|
|
796
|
-
}), /* @__PURE__ */
|
|
877
|
+
}), /* @__PURE__ */ f("div", {
|
|
797
878
|
className: "space-y-2",
|
|
798
879
|
children: [
|
|
799
880
|
"isVegetarian",
|
|
800
881
|
"isVegan",
|
|
801
882
|
"isGlutenFree"
|
|
802
|
-
].map((e) => /* @__PURE__ */
|
|
883
|
+
].map((e) => /* @__PURE__ */ p("label", {
|
|
803
884
|
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
804
|
-
children: [/* @__PURE__ */
|
|
885
|
+
children: [/* @__PURE__ */ f("input", {
|
|
805
886
|
type: "checkbox",
|
|
806
|
-
checked:
|
|
807
|
-
onChange: (t) =>
|
|
887
|
+
checked: P[e],
|
|
888
|
+
onChange: (t) => F((n) => ({
|
|
808
889
|
...n,
|
|
809
890
|
[e]: t.target.checked
|
|
810
891
|
})),
|
|
@@ -813,91 +894,91 @@ var pe = [
|
|
|
813
894
|
}, e))
|
|
814
895
|
})] })]
|
|
815
896
|
}),
|
|
816
|
-
Z && /* @__PURE__ */
|
|
897
|
+
Z && /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
817
898
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
818
899
|
children: "Service Type *"
|
|
819
|
-
}), /* @__PURE__ */
|
|
820
|
-
value:
|
|
821
|
-
onChange: (e) =>
|
|
900
|
+
}), /* @__PURE__ */ p("select", {
|
|
901
|
+
value: P.serviceType,
|
|
902
|
+
onChange: (e) => F((t) => ({
|
|
822
903
|
...t,
|
|
823
904
|
serviceType: e.target.value
|
|
824
905
|
})),
|
|
825
906
|
className: "w-full sm:w-64 rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
826
907
|
children: [
|
|
827
|
-
/* @__PURE__ */
|
|
908
|
+
/* @__PURE__ */ f("option", {
|
|
828
909
|
value: "instant",
|
|
829
910
|
children: "Instant Service"
|
|
830
911
|
}),
|
|
831
|
-
/* @__PURE__ */
|
|
912
|
+
/* @__PURE__ */ f("option", {
|
|
832
913
|
value: "appointment",
|
|
833
914
|
children: "Appointment Based"
|
|
834
915
|
}),
|
|
835
|
-
/* @__PURE__ */
|
|
916
|
+
/* @__PURE__ */ f("option", {
|
|
836
917
|
value: "recurring",
|
|
837
918
|
children: "Recurring Service"
|
|
838
919
|
}),
|
|
839
|
-
/* @__PURE__ */
|
|
920
|
+
/* @__PURE__ */ f("option", {
|
|
840
921
|
value: "consultation",
|
|
841
922
|
children: "Consultation"
|
|
842
923
|
})
|
|
843
924
|
]
|
|
844
925
|
})] }),
|
|
845
|
-
/* @__PURE__ */
|
|
846
|
-
/* @__PURE__ */
|
|
926
|
+
/* @__PURE__ */ p("div", { children: [
|
|
927
|
+
/* @__PURE__ */ f("label", {
|
|
847
928
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
848
929
|
children: "Tags (comma separated)"
|
|
849
930
|
}),
|
|
850
|
-
/* @__PURE__ */
|
|
931
|
+
/* @__PURE__ */ f("input", {
|
|
851
932
|
type: "text",
|
|
852
|
-
value:
|
|
853
|
-
onChange: (e) =>
|
|
933
|
+
value: I,
|
|
934
|
+
onChange: (e) => L(e.target.value),
|
|
854
935
|
placeholder: Z ? "professional, certified, quick" : "popular, spicy, traditional",
|
|
855
936
|
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"
|
|
856
937
|
}),
|
|
857
|
-
/* @__PURE__ */
|
|
938
|
+
/* @__PURE__ */ p("p", {
|
|
858
939
|
className: "text-xs text-text-secondary mt-1",
|
|
859
940
|
children: [
|
|
860
|
-
|
|
941
|
+
I.split(",").map((e) => e.trim()).filter(Boolean).length,
|
|
861
942
|
" ",
|
|
862
943
|
"tags"
|
|
863
944
|
]
|
|
864
945
|
})
|
|
865
946
|
] }),
|
|
866
|
-
Q && /* @__PURE__ */
|
|
947
|
+
Q && /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
867
948
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
868
949
|
children: "Allergens (comma separated)"
|
|
869
|
-
}), /* @__PURE__ */
|
|
950
|
+
}), /* @__PURE__ */ f("input", {
|
|
870
951
|
type: "text",
|
|
871
|
-
value:
|
|
872
|
-
onChange: (e) =>
|
|
952
|
+
value: R,
|
|
953
|
+
onChange: (e) => z(e.target.value),
|
|
873
954
|
placeholder: "nuts, dairy, gluten, soy",
|
|
874
955
|
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"
|
|
875
956
|
})] }),
|
|
876
|
-
Z && /* @__PURE__ */
|
|
957
|
+
Z && /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
877
958
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
878
959
|
children: "Service Requirements (comma separated)"
|
|
879
|
-
}), /* @__PURE__ */
|
|
960
|
+
}), /* @__PURE__ */ f("input", {
|
|
880
961
|
type: "text",
|
|
881
|
-
value:
|
|
882
|
-
onChange: (e) =>
|
|
962
|
+
value: B,
|
|
963
|
+
onChange: (e) => V(e.target.value),
|
|
883
964
|
placeholder: "advance booking, payment required, tools provided",
|
|
884
965
|
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"
|
|
885
966
|
})] })
|
|
886
967
|
]
|
|
887
968
|
}),
|
|
888
|
-
/* @__PURE__ */
|
|
969
|
+
/* @__PURE__ */ p("div", {
|
|
889
970
|
className: "flex gap-3 mt-6",
|
|
890
|
-
children: [/* @__PURE__ */
|
|
971
|
+
children: [/* @__PURE__ */ f("button", {
|
|
891
972
|
type: "button",
|
|
892
|
-
onClick: () =>
|
|
973
|
+
onClick: () => j(!1),
|
|
893
974
|
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",
|
|
894
975
|
children: "Cancel"
|
|
895
|
-
}), /* @__PURE__ */
|
|
976
|
+
}), /* @__PURE__ */ f("button", {
|
|
896
977
|
type: "button",
|
|
897
|
-
onClick:
|
|
978
|
+
onClick: Fe,
|
|
898
979
|
disabled: !$,
|
|
899
980
|
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"),
|
|
900
|
-
children:
|
|
981
|
+
children: M ? "Update Item" : "Add Item"
|
|
901
982
|
})]
|
|
902
983
|
})
|
|
903
984
|
]
|
|
@@ -908,6 +989,6 @@ var pe = [
|
|
|
908
989
|
});
|
|
909
990
|
};
|
|
910
991
|
//#endregion
|
|
911
|
-
export {
|
|
992
|
+
export { g as InventoryManagementPage };
|
|
912
993
|
|
|
913
994
|
//# sourceMappingURL=InventoryManagementPage.js.map
|