@burdenoff/microfe-subscriberbot 2026.626.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.
Files changed (141) hide show
  1. package/dist/index.js +4 -4
  2. package/dist/subscriberbot/SubscriberBotRoot.js +61 -133
  3. package/dist/subscriberbot/SubscriberBotRoot.js.map +1 -1
  4. package/dist/subscriberbot/SubscriberBotRoutes.js +56 -187
  5. package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
  6. package/dist/subscriberbot/components/StateViews.js +49 -0
  7. package/dist/subscriberbot/components/StateViews.js.map +1 -0
  8. package/dist/subscriberbot/components/StatusBadge.js +45 -47
  9. package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
  10. package/dist/subscriberbot/context/SubscriberBotContext.js +22 -30
  11. package/dist/subscriberbot/context/SubscriberBotContext.js.map +1 -1
  12. package/dist/subscriberbot/hooks/useSubscriberBotApi.js +342 -195
  13. package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
  14. package/dist/subscriberbot/index.js +1 -1
  15. package/dist/subscriberbot/pages/DashboardPage.js +269 -0
  16. package/dist/subscriberbot/pages/DashboardPage.js.map +1 -0
  17. package/dist/subscriberbot/pages/InboxPage.js +186 -0
  18. package/dist/subscriberbot/pages/InboxPage.js.map +1 -0
  19. package/dist/subscriberbot/pages/InvoicesPage.js +211 -0
  20. package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -0
  21. package/dist/subscriberbot/pages/WorkflowsPage.js +236 -0
  22. package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -0
  23. package/dist/subscriberbot/pages/agents/AgentDetailPage.js +160 -0
  24. package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -0
  25. package/dist/subscriberbot/pages/agents/AgentNewPage.js +140 -0
  26. package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -0
  27. package/dist/subscriberbot/pages/agents/AgentsListPage.js +178 -0
  28. package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -0
  29. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +179 -0
  30. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -0
  31. package/dist/subscriberbot/pages/providers/ProviderNewPage.js +185 -0
  32. package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -0
  33. package/dist/subscriberbot/pages/providers/ProvidersListPage.js +254 -0
  34. package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -0
  35. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +306 -0
  36. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -0
  37. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +253 -0
  38. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -0
  39. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +248 -0
  40. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -0
  41. package/dist/subscriberbot/utils/formatters.js +50 -32
  42. package/dist/subscriberbot/utils/formatters.js.map +1 -1
  43. package/package.json +1 -1
  44. package/dist/subscriberbot/components/InvestmentCard.js +0 -97
  45. package/dist/subscriberbot/components/InvestmentCard.js.map +0 -1
  46. package/dist/subscriberbot/components/RatingDisplay.js +0 -35
  47. package/dist/subscriberbot/components/RatingDisplay.js.map +0 -1
  48. package/dist/subscriberbot/mocks/data.js +0 -1517
  49. package/dist/subscriberbot/mocks/data.js.map +0 -1
  50. package/dist/subscriberbot/mocks/users.js +0 -34
  51. package/dist/subscriberbot/mocks/users.js.map +0 -1
  52. package/dist/subscriberbot/pages/HomePage.js +0 -930
  53. package/dist/subscriberbot/pages/HomePage.js.map +0 -1
  54. package/dist/subscriberbot/pages/admin/AdminAnalyticsPage.js +0 -651
  55. package/dist/subscriberbot/pages/admin/AdminAnalyticsPage.js.map +0 -1
  56. package/dist/subscriberbot/pages/admin/AdminDashboard.js +0 -679
  57. package/dist/subscriberbot/pages/admin/AdminDashboard.js.map +0 -1
  58. package/dist/subscriberbot/pages/admin/AdminFinancialPage.js +0 -427
  59. package/dist/subscriberbot/pages/admin/AdminFinancialPage.js.map +0 -1
  60. package/dist/subscriberbot/pages/admin/AdminOrdersPage.js +0 -665
  61. package/dist/subscriberbot/pages/admin/AdminOrdersPage.js.map +0 -1
  62. package/dist/subscriberbot/pages/admin/AdminProfilePage.js +0 -261
  63. package/dist/subscriberbot/pages/admin/AdminProfilePage.js.map +0 -1
  64. package/dist/subscriberbot/pages/admin/AdminSettingsPage.js +0 -654
  65. package/dist/subscriberbot/pages/admin/AdminSettingsPage.js.map +0 -1
  66. package/dist/subscriberbot/pages/admin/CartManagementPage.js +0 -874
  67. package/dist/subscriberbot/pages/admin/CartManagementPage.js.map +0 -1
  68. package/dist/subscriberbot/pages/admin/UserManagementPage.js +0 -898
  69. package/dist/subscriberbot/pages/admin/UserManagementPage.js.map +0 -1
  70. package/dist/subscriberbot/pages/cart-owner/AnalyticsDashboard.js +0 -839
  71. package/dist/subscriberbot/pages/cart-owner/AnalyticsDashboard.js.map +0 -1
  72. package/dist/subscriberbot/pages/cart-owner/BusinessSettingsPage.js +0 -705
  73. package/dist/subscriberbot/pages/cart-owner/BusinessSettingsPage.js.map +0 -1
  74. package/dist/subscriberbot/pages/cart-owner/CartOwnerDashboard.js +0 -802
  75. package/dist/subscriberbot/pages/cart-owner/CartOwnerDashboard.js.map +0 -1
  76. package/dist/subscriberbot/pages/cart-owner/CartOwnerProfilePage.js +0 -891
  77. package/dist/subscriberbot/pages/cart-owner/CartOwnerProfilePage.js.map +0 -1
  78. package/dist/subscriberbot/pages/cart-owner/CartServiceConfigPage.js +0 -633
  79. package/dist/subscriberbot/pages/cart-owner/CartServiceConfigPage.js.map +0 -1
  80. package/dist/subscriberbot/pages/cart-owner/InventoryManagementPage.js +0 -910
  81. package/dist/subscriberbot/pages/cart-owner/InventoryManagementPage.js.map +0 -1
  82. package/dist/subscriberbot/pages/cart-owner/OrderManagementPage.js +0 -879
  83. package/dist/subscriberbot/pages/cart-owner/OrderManagementPage.js.map +0 -1
  84. package/dist/subscriberbot/pages/cart-owner/StaffManagementPage.js +0 -838
  85. package/dist/subscriberbot/pages/cart-owner/StaffManagementPage.js.map +0 -1
  86. package/dist/subscriberbot/pages/common/HelpSupportPage.js +0 -1323
  87. package/dist/subscriberbot/pages/common/HelpSupportPage.js.map +0 -1
  88. package/dist/subscriberbot/pages/common/NotificationCenterPage.js +0 -672
  89. package/dist/subscriberbot/pages/common/NotificationCenterPage.js.map +0 -1
  90. package/dist/subscriberbot/pages/common/SettingsPage.js +0 -973
  91. package/dist/subscriberbot/pages/common/SettingsPage.js.map +0 -1
  92. package/dist/subscriberbot/pages/customer/BookingDetailsPage.js +0 -626
  93. package/dist/subscriberbot/pages/customer/BookingDetailsPage.js.map +0 -1
  94. package/dist/subscriberbot/pages/customer/CartDetailPage.js +0 -654
  95. package/dist/subscriberbot/pages/customer/CartDetailPage.js.map +0 -1
  96. package/dist/subscriberbot/pages/customer/CartDiscoveryPage.js +0 -555
  97. package/dist/subscriberbot/pages/customer/CartDiscoveryPage.js.map +0 -1
  98. package/dist/subscriberbot/pages/customer/CheckoutPage.js +0 -529
  99. package/dist/subscriberbot/pages/customer/CheckoutPage.js.map +0 -1
  100. package/dist/subscriberbot/pages/customer/CustomerDashboard.js +0 -532
  101. package/dist/subscriberbot/pages/customer/CustomerDashboard.js.map +0 -1
  102. package/dist/subscriberbot/pages/customer/CustomerProfilePage.js +0 -630
  103. package/dist/subscriberbot/pages/customer/CustomerProfilePage.js.map +0 -1
  104. package/dist/subscriberbot/pages/customer/DirectServiceBookingPage.js +0 -633
  105. package/dist/subscriberbot/pages/customer/DirectServiceBookingPage.js.map +0 -1
  106. package/dist/subscriberbot/pages/customer/FavoritesPage.js +0 -484
  107. package/dist/subscriberbot/pages/customer/FavoritesPage.js.map +0 -1
  108. package/dist/subscriberbot/pages/customer/OrderHistoryPage.js +0 -446
  109. package/dist/subscriberbot/pages/customer/OrderHistoryPage.js.map +0 -1
  110. package/dist/subscriberbot/pages/customer/OrderTrackingPage.js +0 -394
  111. package/dist/subscriberbot/pages/customer/OrderTrackingPage.js.map +0 -1
  112. package/dist/subscriberbot/pages/customer/PaymentMethodsPage.js +0 -495
  113. package/dist/subscriberbot/pages/customer/PaymentMethodsPage.js.map +0 -1
  114. package/dist/subscriberbot/pages/customer/ReviewsPage.js +0 -613
  115. package/dist/subscriberbot/pages/customer/ReviewsPage.js.map +0 -1
  116. package/dist/subscriberbot/pages/customer/SavedAddressesPage.js +0 -450
  117. package/dist/subscriberbot/pages/customer/SavedAddressesPage.js.map +0 -1
  118. package/dist/subscriberbot/pages/investor/InvestmentDetailsPage.js +0 -886
  119. package/dist/subscriberbot/pages/investor/InvestmentDetailsPage.js.map +0 -1
  120. package/dist/subscriberbot/pages/investor/InvestmentOpportunitiesPage.js +0 -947
  121. package/dist/subscriberbot/pages/investor/InvestmentOpportunitiesPage.js.map +0 -1
  122. package/dist/subscriberbot/pages/investor/InvestorAnalyticsPage.js +0 -687
  123. package/dist/subscriberbot/pages/investor/InvestorAnalyticsPage.js.map +0 -1
  124. package/dist/subscriberbot/pages/investor/InvestorDashboard.js +0 -451
  125. package/dist/subscriberbot/pages/investor/InvestorDashboard.js.map +0 -1
  126. package/dist/subscriberbot/pages/investor/InvestorInvestmentsPage.js +0 -406
  127. package/dist/subscriberbot/pages/investor/InvestorInvestmentsPage.js.map +0 -1
  128. package/dist/subscriberbot/pages/investor/InvestorPortfolioPage.js +0 -575
  129. package/dist/subscriberbot/pages/investor/InvestorPortfolioPage.js.map +0 -1
  130. package/dist/subscriberbot/pages/investor/InvestorProfilePage.js +0 -1070
  131. package/dist/subscriberbot/pages/investor/InvestorProfilePage.js.map +0 -1
  132. package/dist/subscriberbot/pages/worker/TaskDetailsPage.js +0 -535
  133. package/dist/subscriberbot/pages/worker/TaskDetailsPage.js.map +0 -1
  134. package/dist/subscriberbot/pages/worker/WorkerDashboard.js +0 -666
  135. package/dist/subscriberbot/pages/worker/WorkerDashboard.js.map +0 -1
  136. package/dist/subscriberbot/pages/worker/WorkerOrdersPage.js +0 -681
  137. package/dist/subscriberbot/pages/worker/WorkerOrdersPage.js.map +0 -1
  138. package/dist/subscriberbot/pages/worker/WorkerProfilePage.js +0 -692
  139. package/dist/subscriberbot/pages/worker/WorkerProfilePage.js.map +0 -1
  140. package/dist/subscriberbot/pages/worker/WorkerSchedulePage.js +0 -588
  141. package/dist/subscriberbot/pages/worker/WorkerSchedulePage.js.map +0 -1
@@ -1,681 +0,0 @@
1
- import { useSubscriberBot as e } from "../../context/SubscriberBotContext.js";
2
- import { cn as t } from "../../utils/cn.js";
3
- import { PageLayout as n } from "../../components/PageLayout.js";
4
- import { StatusBadge as r } from "../../components/StatusBadge.js";
5
- import { EmptyState as i } from "../../components/EmptyState.js";
6
- import { formatCurrency as a } from "../../utils/formatters.js";
7
- import { useCallback as o, useEffect as s, useState as c } from "react";
8
- import { AlertTriangle as l, ArrowRight as u, CheckCircle2 as d, ChefHat as f, ClipboardList as p, CreditCard as m, Loader2 as h, MapPin as g, Navigation as _, Package as v, Phone as y, PlayCircle as b, ShoppingBag as x, Star as S, Truck as C } from "lucide-react";
9
- import { jsx as w, jsxs as T } from "react/jsx-runtime";
10
- import { EmphasisPanel as E, PagePurpose as D } from "@burdenoff/fe-libs/ui";
11
- //#region src/subscriberbot/pages/worker/WorkerOrdersPage.tsx
12
- var O = [
13
- {
14
- id: "task-001",
15
- orderId: "ORD-2024-001",
16
- cartId: "cart-001",
17
- cartName: "South Indian Express",
18
- type: "delivery",
19
- status: "pending",
20
- priority: "high",
21
- customerName: "Rahul Sharma",
22
- customerPhone: "+91-98765-43210",
23
- items: [{
24
- name: "Masala Dosa",
25
- quantity: 2
26
- }, {
27
- name: "Filter Coffee",
28
- quantity: 2
29
- }],
30
- address: {
31
- addressLine1: "123, MG Road",
32
- addressLine2: "Near Central Mall",
33
- landmark: "Opposite SBI Bank",
34
- city: "Bangalore",
35
- pincode: "560001"
36
- },
37
- estimatedTime: new Date(Date.now() + 1800 * 1e3).toISOString(),
38
- assignedTime: (/* @__PURE__ */ new Date(Date.now() - 300 * 1e3)).toISOString(),
39
- distance: 3.5,
40
- specialInstructions: "Please call before delivery",
41
- payment: {
42
- method: "Cash",
43
- amount: 295,
44
- status: "pending"
45
- }
46
- },
47
- {
48
- id: "task-002",
49
- orderId: "ORD-2024-002",
50
- cartId: "cart-001",
51
- cartName: "South Indian Express",
52
- type: "pickup",
53
- status: "in_progress",
54
- priority: "medium",
55
- customerName: "Priya Patel",
56
- customerPhone: "+91-98765-43211",
57
- items: [{
58
- name: "Idli Sambar",
59
- quantity: 3
60
- }],
61
- estimatedTime: new Date(Date.now() + 900 * 1e3).toISOString(),
62
- assignedTime: (/* @__PURE__ */ new Date(Date.now() - 600 * 1e3)).toISOString(),
63
- specialInstructions: "",
64
- payment: {
65
- method: "Online",
66
- amount: 198,
67
- status: "completed"
68
- }
69
- },
70
- {
71
- id: "task-003",
72
- orderId: "ORD-2024-003",
73
- cartId: "cart-002",
74
- cartName: "Chaat Corner",
75
- type: "preparation",
76
- status: "pending",
77
- priority: "urgent",
78
- customerName: "Amit Kumar",
79
- customerPhone: "+91-98765-43212",
80
- items: [{
81
- name: "Pani Puri",
82
- quantity: 2
83
- }, {
84
- name: "Bhel Puri",
85
- quantity: 1
86
- }],
87
- estimatedTime: new Date(Date.now() + 1200 * 1e3).toISOString(),
88
- assignedTime: (/* @__PURE__ */ new Date(Date.now() - 120 * 1e3)).toISOString(),
89
- specialInstructions: "Extra spicy",
90
- payment: {
91
- method: "UPI",
92
- amount: 150,
93
- status: "completed"
94
- }
95
- },
96
- {
97
- id: "task-004",
98
- orderId: "ORD-2024-004",
99
- cartId: "cart-003",
100
- cartName: "Biryani Pot",
101
- type: "delivery",
102
- status: "completed",
103
- priority: "medium",
104
- customerName: "Deepa Nair",
105
- customerPhone: "+91-98765-43213",
106
- items: [{
107
- name: "Chicken Biryani",
108
- quantity: 1
109
- }, {
110
- name: "Raita",
111
- quantity: 1
112
- }],
113
- address: {
114
- addressLine1: "456, Brigade Road",
115
- city: "Bangalore",
116
- pincode: "560025"
117
- },
118
- estimatedTime: (/* @__PURE__ */ new Date(Date.now() - 1800 * 1e3)).toISOString(),
119
- assignedTime: (/* @__PURE__ */ new Date(Date.now() - 5400 * 1e3)).toISOString(),
120
- distance: 2.1,
121
- payment: {
122
- method: "Online",
123
- amount: 340,
124
- status: "completed"
125
- }
126
- }
127
- ];
128
- function k(e) {
129
- let t = /* @__PURE__ */ new Date(), n = new Date(e), r = Math.floor((n.getTime() - t.getTime()) / (1e3 * 60));
130
- return r < 0 ? "Overdue" : r < 60 ? `${r} min` : `${Math.floor(r / 60)}h ${r % 60}m`;
131
- }
132
- function A(e) {
133
- switch (e) {
134
- case "delivery": return {
135
- icon: C,
136
- label: "Delivery",
137
- style: "bg-accent-purple-subtle text-accent-purple"
138
- };
139
- case "pickup": return {
140
- icon: x,
141
- label: "Pickup",
142
- style: "bg-status-info-bg/20 text-status-info-text"
143
- };
144
- case "preparation": return {
145
- icon: f,
146
- label: "Preparation",
147
- style: "bg-status-success-bg/20 text-status-success-text"
148
- };
149
- default: return {
150
- icon: v,
151
- label: e,
152
- style: "bg-secondary text-secondary-foreground"
153
- };
154
- }
155
- }
156
- function j(e) {
157
- switch (e) {
158
- case "urgent": return "bg-status-error-bg/20 text-status-error-text";
159
- case "high": return "bg-status-warning-bg/20 text-status-warning-text";
160
- case "medium": return "bg-status-warning-bg/20 text-status-warning-text";
161
- case "low": return "bg-status-success-bg/20 text-status-success-text";
162
- default: return "bg-secondary text-secondary-foreground";
163
- }
164
- }
165
- var M = () => {
166
- let { navigateTo: f } = e(), [x, C] = c(!0), [M, N] = c([]), [P, F] = c(null), [I, L] = c({
167
- status: "",
168
- type: "",
169
- priority: "",
170
- sortBy: "priority"
171
- }), [R, z] = c({
172
- totalTasks: 0,
173
- completedToday: 0,
174
- pendingTasks: 0,
175
- averageTime: 0,
176
- earnings: 0,
177
- rating: 4.8
178
- }), [, B] = c(0);
179
- s(() => {
180
- let e = setInterval(() => B((e) => e + 1), 6e4);
181
- return () => clearInterval(e);
182
- }, []);
183
- let V = o(() => {
184
- C(!0), setTimeout(() => {
185
- let e = [...O];
186
- I.status && (e = e.filter((e) => e.status === I.status)), I.type && (e = e.filter((e) => e.type === I.type)), I.priority && (e = e.filter((e) => e.priority === I.priority));
187
- let t = {
188
- urgent: 0,
189
- high: 1,
190
- medium: 2,
191
- low: 3
192
- };
193
- switch (I.sortBy) {
194
- case "priority":
195
- e.sort((e, n) => (t[e.priority] ?? 4) - (t[n.priority] ?? 4));
196
- break;
197
- case "time":
198
- e.sort((e, t) => new Date(e.estimatedTime).getTime() - new Date(t.estimatedTime).getTime());
199
- break;
200
- case "distance":
201
- e.sort((e, t) => (e.distance ?? 999) - (t.distance ?? 999));
202
- break;
203
- }
204
- N(e), F(O.find((e) => e.status === "in_progress") ?? null), z({
205
- totalTasks: 45,
206
- completedToday: 12,
207
- pendingTasks: 3,
208
- averageTime: 22,
209
- earnings: 2450,
210
- rating: 4.8
211
- }), C(!1);
212
- }, 600);
213
- }, [I]);
214
- s(() => {
215
- V();
216
- }, [V]);
217
- let H = (e, t) => {
218
- L((n) => ({
219
- ...n,
220
- [e]: t
221
- }));
222
- }, U = (e) => {
223
- let t = O.find((t) => t.id === e);
224
- t && (t.status = "in_progress", F(t), V());
225
- }, W = (e) => {
226
- let t = O.find((t) => t.id === e);
227
- t && (t.status = "completed"), F(null), V(), alert("Task completed successfully");
228
- }, G = (e) => {
229
- window.location.href = `tel:${e.replace(/\s/g, "")}`;
230
- }, K = (e) => {
231
- if (e.address) {
232
- let t = encodeURIComponent(`${e.address.addressLine1}, ${e.address.city}`);
233
- window.open(`https://maps.google.com?q=${t}`, "_blank");
234
- }
235
- };
236
- return x ? /* @__PURE__ */ w(n, {
237
- title: "My Orders",
238
- description: "Manage your assigned orders",
239
- children: /* @__PURE__ */ w("div", {
240
- className: "flex items-center justify-center py-24",
241
- children: /* @__PURE__ */ T("div", {
242
- className: "text-center",
243
- children: [/* @__PURE__ */ w(h, { className: "h-10 w-10 animate-spin text-text-secondary mx-auto mb-4" }), /* @__PURE__ */ w("p", {
244
- className: "text-sm text-text-secondary",
245
- children: "Loading tasks..."
246
- })]
247
- })
248
- })
249
- }) : /* @__PURE__ */ w(n, {
250
- title: "My Orders",
251
- description: "Manage your assigned orders",
252
- children: /* @__PURE__ */ T("div", {
253
- className: "space-y-6",
254
- children: [
255
- /* @__PURE__ */ w(D, {
256
- icon: /* @__PURE__ */ w(v, { className: "h-4 w-4" }),
257
- children: "Every order assigned to you in one queue. Pick up new tasks, update their status as you work, and mark them done to log your earnings. The stats up top show today's progress — tasks completed, time per order, earnings and your rating — so you always know how your shift is going."
258
- }),
259
- /* @__PURE__ */ T(E, {
260
- className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3",
261
- children: [
262
- /* @__PURE__ */ T("div", {
263
- className: "rounded-lg border border-border-seam bg-bg-surface p-4 shadow-sm",
264
- children: [/* @__PURE__ */ w("p", {
265
- className: "text-xs text-text-secondary",
266
- children: "Today's Tasks"
267
- }), /* @__PURE__ */ w("p", {
268
- className: "text-2xl font-bold text-text-primary",
269
- children: R.totalTasks
270
- })]
271
- }),
272
- /* @__PURE__ */ T("div", {
273
- className: "rounded-lg border border-status-success-border/20 bg-status-success-bg/5 p-4 shadow-sm",
274
- children: [/* @__PURE__ */ w("p", {
275
- className: "text-xs text-status-success-text",
276
- children: "Completed"
277
- }), /* @__PURE__ */ w("p", {
278
- className: "text-2xl font-bold text-status-success-text",
279
- children: R.completedToday
280
- })]
281
- }),
282
- /* @__PURE__ */ T("div", {
283
- className: "rounded-lg border border-status-warning-border/20 bg-status-warning-bg/5 p-4 shadow-sm",
284
- children: [/* @__PURE__ */ w("p", {
285
- className: "text-xs text-status-warning-text",
286
- children: "Pending"
287
- }), /* @__PURE__ */ w("p", {
288
- className: "text-2xl font-bold text-status-warning-text",
289
- children: R.pendingTasks
290
- })]
291
- }),
292
- /* @__PURE__ */ T("div", {
293
- className: "rounded-lg border border-border-seam bg-bg-surface p-4 shadow-sm",
294
- children: [/* @__PURE__ */ w("p", {
295
- className: "text-xs text-text-secondary",
296
- children: "Avg Time"
297
- }), /* @__PURE__ */ T("p", {
298
- className: "text-2xl font-bold text-text-primary",
299
- children: [R.averageTime, " min"]
300
- })]
301
- }),
302
- /* @__PURE__ */ T("div", {
303
- className: "rounded-lg border border-border-seam bg-bg-surface p-4 shadow-sm",
304
- children: [/* @__PURE__ */ w("p", {
305
- className: "text-xs text-text-secondary",
306
- children: "Today's Earnings"
307
- }), /* @__PURE__ */ w("p", {
308
- className: "text-2xl font-bold text-text-primary",
309
- children: a(R.earnings, { minimumFractionDigits: 0 })
310
- })]
311
- }),
312
- /* @__PURE__ */ T("div", {
313
- className: "rounded-lg border border-border-seam bg-bg-surface p-4 shadow-sm",
314
- children: [/* @__PURE__ */ w("p", {
315
- className: "text-xs text-text-secondary",
316
- children: "Rating"
317
- }), /* @__PURE__ */ T("p", {
318
- className: "text-2xl font-bold text-text-primary flex items-center gap-1",
319
- children: [/* @__PURE__ */ w(S, { className: "h-4 w-4 fill-status-warning-text text-status-warning-text" }), R.rating]
320
- })]
321
- })
322
- ]
323
- }),
324
- P && /* @__PURE__ */ T("div", {
325
- className: "rounded-lg border-2 border-status-info-border/30 bg-status-info-bg/5 p-5",
326
- children: [/* @__PURE__ */ w("h2", {
327
- className: "text-base font-semibold text-status-info-text mb-4",
328
- children: "Current Task"
329
- }), /* @__PURE__ */ T("div", {
330
- className: "rounded-lg border border-border-seam bg-bg-surface p-4",
331
- children: [/* @__PURE__ */ T("div", {
332
- className: "flex items-center justify-between mb-4",
333
- children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ T("div", {
334
- className: "flex items-center gap-2 flex-wrap",
335
- children: [
336
- /* @__PURE__ */ T("h3", {
337
- className: "text-sm font-semibold text-text-primary",
338
- children: ["Order #", P.orderId]
339
- }),
340
- (() => {
341
- let e = A(P.type), n = e.icon;
342
- return /* @__PURE__ */ T("span", {
343
- className: t("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium", e.style),
344
- children: [/* @__PURE__ */ w(n, { className: "h-3 w-3" }), e.label]
345
- });
346
- })(),
347
- /* @__PURE__ */ w("span", {
348
- className: t("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium capitalize", j(P.priority)),
349
- children: P.priority
350
- })
351
- ]
352
- }), /* @__PURE__ */ w("p", {
353
- className: "text-xs text-text-secondary mt-1",
354
- children: P.cartName
355
- })] }), /* @__PURE__ */ T("div", {
356
- className: "text-right",
357
- children: [/* @__PURE__ */ w("p", {
358
- className: "text-xl font-bold text-status-info-text",
359
- children: k(P.estimatedTime)
360
- }), /* @__PURE__ */ w("p", {
361
- className: "text-xs text-text-secondary",
362
- children: "Time remaining"
363
- })]
364
- })]
365
- }), /* @__PURE__ */ T("div", {
366
- className: "border-t border-border-seam pt-4",
367
- children: [
368
- /* @__PURE__ */ T("div", {
369
- className: "grid grid-cols-1 md:grid-cols-2 gap-4",
370
- children: [/* @__PURE__ */ T("div", { children: [
371
- /* @__PURE__ */ w("p", {
372
- className: "text-xs font-medium text-text-secondary",
373
- children: "Customer"
374
- }),
375
- /* @__PURE__ */ w("p", {
376
- className: "text-sm font-medium text-text-primary",
377
- children: P.customerName
378
- }),
379
- P.address && /* @__PURE__ */ T("p", {
380
- className: "text-xs text-text-secondary mt-1",
381
- children: [
382
- P.address.addressLine1,
383
- ", ",
384
- P.address.city
385
- ]
386
- })
387
- ] }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
388
- className: "text-xs font-medium text-text-secondary",
389
- children: "Items"
390
- }), /* @__PURE__ */ w("div", {
391
- className: "space-y-0.5",
392
- children: P.items.map((e, t) => /* @__PURE__ */ T("p", {
393
- className: "text-xs text-text-primary",
394
- children: [
395
- e.quantity,
396
- "x ",
397
- e.name
398
- ]
399
- }, t))
400
- })] })]
401
- }),
402
- P.specialInstructions && /* @__PURE__ */ T("div", {
403
- className: "mt-3 p-3 rounded-md bg-status-warning-bg/10 border border-status-warning-border/20",
404
- children: [/* @__PURE__ */ T("p", {
405
- className: "text-xs font-medium text-status-warning-text flex items-center gap-1",
406
- children: [/* @__PURE__ */ w(l, { className: "h-3 w-3" }), "Special Instructions:"]
407
- }), /* @__PURE__ */ w("p", {
408
- className: "text-xs text-status-warning-text mt-0.5",
409
- children: P.specialInstructions
410
- })]
411
- }),
412
- /* @__PURE__ */ T("div", {
413
- className: "flex flex-wrap gap-2 mt-4",
414
- children: [
415
- /* @__PURE__ */ T("button", {
416
- type: "button",
417
- onClick: () => G(P.customerPhone),
418
- className: "inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-2 text-xs font-medium text-text-primary hover:bg-accent/80 transition-colors",
419
- children: [/* @__PURE__ */ w(y, { className: "h-3.5 w-3.5" }), "Call Customer"]
420
- }),
421
- P.type === "delivery" && P.address && /* @__PURE__ */ T("button", {
422
- type: "button",
423
- onClick: () => K(P),
424
- className: "inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-2 text-xs font-medium text-text-primary hover:bg-accent/80 transition-colors",
425
- children: [/* @__PURE__ */ w(_, { className: "h-3.5 w-3.5" }), "Navigate"]
426
- }),
427
- /* @__PURE__ */ T("button", {
428
- type: "button",
429
- onClick: () => W(P.id),
430
- className: "ml-auto inline-flex items-center gap-1.5 rounded-md bg-status-success-bg/10 px-3 py-2 text-xs font-medium text-status-success-text hover:bg-status-success-bg/20 transition-colors",
431
- children: [/* @__PURE__ */ w(d, { className: "h-3.5 w-3.5" }), "Complete Task"]
432
- })
433
- ]
434
- })
435
- ]
436
- })]
437
- })]
438
- }),
439
- /* @__PURE__ */ w("div", {
440
- className: "rounded-lg border border-border-seam bg-bg-surface p-4 shadow-sm",
441
- children: /* @__PURE__ */ T("div", {
442
- className: "grid grid-cols-1 md:grid-cols-4 gap-3",
443
- children: [
444
- /* @__PURE__ */ T("select", {
445
- value: I.status,
446
- onChange: (e) => H("status", e.target.value),
447
- className: "w-full rounded-md border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-status-info-border/40",
448
- children: [
449
- /* @__PURE__ */ w("option", {
450
- value: "",
451
- children: "All Tasks"
452
- }),
453
- /* @__PURE__ */ w("option", {
454
- value: "pending",
455
- children: "Pending Tasks"
456
- }),
457
- /* @__PURE__ */ w("option", {
458
- value: "in_progress",
459
- children: "In Progress"
460
- }),
461
- /* @__PURE__ */ w("option", {
462
- value: "completed",
463
- children: "Completed"
464
- })
465
- ]
466
- }),
467
- /* @__PURE__ */ T("select", {
468
- value: I.type,
469
- onChange: (e) => H("type", e.target.value),
470
- className: "w-full rounded-md border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-status-info-border/40",
471
- children: [
472
- /* @__PURE__ */ w("option", {
473
- value: "",
474
- children: "All Types"
475
- }),
476
- /* @__PURE__ */ w("option", {
477
- value: "delivery",
478
- children: "Delivery"
479
- }),
480
- /* @__PURE__ */ w("option", {
481
- value: "pickup",
482
- children: "Pickup"
483
- }),
484
- /* @__PURE__ */ w("option", {
485
- value: "preparation",
486
- children: "Preparation"
487
- })
488
- ]
489
- }),
490
- /* @__PURE__ */ T("select", {
491
- value: I.priority,
492
- onChange: (e) => H("priority", e.target.value),
493
- className: "w-full rounded-md border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-status-info-border/40",
494
- children: [
495
- /* @__PURE__ */ w("option", {
496
- value: "",
497
- children: "All Priorities"
498
- }),
499
- /* @__PURE__ */ w("option", {
500
- value: "urgent",
501
- children: "Urgent"
502
- }),
503
- /* @__PURE__ */ w("option", {
504
- value: "high",
505
- children: "High"
506
- }),
507
- /* @__PURE__ */ w("option", {
508
- value: "medium",
509
- children: "Medium"
510
- }),
511
- /* @__PURE__ */ w("option", {
512
- value: "low",
513
- children: "Low"
514
- })
515
- ]
516
- }),
517
- /* @__PURE__ */ T("select", {
518
- value: I.sortBy,
519
- onChange: (e) => H("sortBy", e.target.value),
520
- className: "w-full rounded-md border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-status-info-border/40",
521
- children: [
522
- /* @__PURE__ */ w("option", {
523
- value: "priority",
524
- children: "Sort by Priority"
525
- }),
526
- /* @__PURE__ */ w("option", {
527
- value: "time",
528
- children: "Sort by Time"
529
- }),
530
- /* @__PURE__ */ w("option", {
531
- value: "distance",
532
- children: "Sort by Distance"
533
- })
534
- ]
535
- })
536
- ]
537
- })
538
- }),
539
- M.length === 0 ? /* @__PURE__ */ w(i, {
540
- illustration: "empty-data",
541
- icon: /* @__PURE__ */ w(p, { className: "h-12 w-12" }),
542
- title: "No tasks available",
543
- description: "Check back later for new tasks"
544
- }) : /* @__PURE__ */ w("div", {
545
- className: "space-y-3",
546
- children: M.map((e) => {
547
- let n = A(e.type), i = n.icon;
548
- return /* @__PURE__ */ T("div", {
549
- className: "rounded-lg border border-border-seam bg-bg-surface p-5 shadow-sm hover:shadow-md transition-shadow",
550
- children: [
551
- /* @__PURE__ */ T("div", {
552
- className: "flex items-center justify-between mb-3",
553
- children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ T("div", {
554
- className: "flex items-center gap-2 flex-wrap",
555
- children: [
556
- /* @__PURE__ */ T("h3", {
557
- className: "text-sm font-semibold text-text-primary",
558
- children: ["Order #", e.orderId]
559
- }),
560
- /* @__PURE__ */ T("span", {
561
- className: t("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium", n.style),
562
- children: [/* @__PURE__ */ w(i, { className: "h-3 w-3" }), n.label]
563
- }),
564
- /* @__PURE__ */ w("span", {
565
- className: t("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium capitalize", j(e.priority)),
566
- children: e.priority
567
- })
568
- ]
569
- }), /* @__PURE__ */ T("p", {
570
- className: "text-xs text-text-secondary mt-1",
571
- children: [
572
- e.cartName,
573
- " · ",
574
- e.customerName
575
- ]
576
- })] }), /* @__PURE__ */ T("div", {
577
- className: "text-right",
578
- children: [/* @__PURE__ */ w("p", {
579
- className: "text-lg font-bold text-text-primary",
580
- children: a(e.payment.amount, { minimumFractionDigits: 0 })
581
- }), /* @__PURE__ */ w("p", {
582
- className: t("text-xs", e.payment.status === "completed" ? "text-status-success-text" : "text-status-warning-text"),
583
- children: /* @__PURE__ */ T("span", {
584
- className: "flex items-center gap-1 justify-end",
585
- children: [/* @__PURE__ */ w(m, { className: "h-3 w-3" }), e.payment.status === "completed" ? "Paid" : "COD"]
586
- })
587
- })]
588
- })]
589
- }),
590
- /* @__PURE__ */ T("div", {
591
- className: "grid grid-cols-1 md:grid-cols-3 gap-3 mb-3 text-sm",
592
- children: [
593
- /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
594
- className: "text-xs text-text-secondary",
595
- children: "Items"
596
- }), /* @__PURE__ */ w("div", {
597
- className: "text-xs text-text-primary",
598
- children: e.items.map((t, n) => /* @__PURE__ */ T("span", { children: [
599
- t.quantity,
600
- "x ",
601
- t.name,
602
- n < e.items.length - 1 && ", "
603
- ] }, n))
604
- })] }),
605
- e.address && /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
606
- className: "text-xs text-text-secondary",
607
- children: "Delivery Address"
608
- }), /* @__PURE__ */ w("p", {
609
- className: "text-xs text-text-primary",
610
- children: e.address.addressLine1
611
- })] }),
612
- /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
613
- className: "text-xs text-text-secondary",
614
- children: "Time"
615
- }), /* @__PURE__ */ w("p", {
616
- className: t("text-xs font-medium", k(e.estimatedTime) === "Overdue" ? "text-status-error-text" : "text-text-primary"),
617
- children: k(e.estimatedTime)
618
- })] })
619
- ]
620
- }),
621
- e.status === "pending" && /* @__PURE__ */ T("div", {
622
- className: "flex items-center flex-wrap gap-2 border-t border-border-seam pt-3",
623
- children: [
624
- /* @__PURE__ */ T("button", {
625
- type: "button",
626
- onClick: () => U(e.id),
627
- disabled: P !== null,
628
- className: t("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors", P === null ? "bg-status-info-bg/10 text-status-info-text hover:bg-status-info-bg/20" : "bg-bg-sunken text-text-secondary cursor-not-allowed"),
629
- children: [/* @__PURE__ */ w(b, { className: "h-3.5 w-3.5" }), P ? "Complete current first" : "Start Task"]
630
- }),
631
- /* @__PURE__ */ T("button", {
632
- type: "button",
633
- onClick: () => G(e.customerPhone),
634
- className: "inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent/80 transition-colors",
635
- children: [/* @__PURE__ */ w(y, { className: "h-3.5 w-3.5" }), "Call"]
636
- }),
637
- e.type === "delivery" && e.distance != null && /* @__PURE__ */ T("span", {
638
- className: "ml-auto text-xs text-text-secondary flex items-center gap-1",
639
- children: [
640
- /* @__PURE__ */ w(g, { className: "h-3 w-3" }),
641
- e.distance,
642
- " km away"
643
- ]
644
- })
645
- ]
646
- }),
647
- e.status === "in_progress" && e.id !== P?.id && /* @__PURE__ */ T("div", {
648
- className: "flex items-center gap-2 border-t border-border-seam pt-3",
649
- children: [/* @__PURE__ */ T("button", {
650
- type: "button",
651
- onClick: () => W(e.id),
652
- className: "inline-flex items-center gap-1.5 rounded-md bg-status-success-bg/10 px-3 py-1.5 text-xs font-medium text-status-success-text hover:bg-status-success-bg/20 transition-colors",
653
- children: [/* @__PURE__ */ w(d, { className: "h-3.5 w-3.5" }), "Complete"]
654
- }), /* @__PURE__ */ T("button", {
655
- type: "button",
656
- onClick: () => f(`/worker/task/${e.id}`),
657
- className: "inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent/80 transition-colors",
658
- children: ["Details", /* @__PURE__ */ w(u, { className: "h-3.5 w-3.5" })]
659
- })]
660
- }),
661
- e.status === "completed" && /* @__PURE__ */ T("div", {
662
- className: "flex items-center gap-2 border-t border-border-seam pt-3",
663
- children: [/* @__PURE__ */ w(r, { status: "completed" }), /* @__PURE__ */ T("button", {
664
- type: "button",
665
- onClick: () => f(`/worker/task/${e.id}`),
666
- className: "ml-auto inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent/80 transition-colors",
667
- children: ["Details", /* @__PURE__ */ w(u, { className: "h-3.5 w-3.5" })]
668
- })]
669
- })
670
- ]
671
- }, e.id);
672
- })
673
- })
674
- ]
675
- })
676
- });
677
- };
678
- //#endregion
679
- export { M as WorkerOrdersPage };
680
-
681
- //# sourceMappingURL=WorkerOrdersPage.js.map