@burdenoff/microfe-adaptercloud 2026.625.2 → 2026.628.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/dist/adaptercloud/AdapterCloudRoot.js +65 -121
  2. package/dist/adaptercloud/AdapterCloudRoot.js.map +1 -1
  3. package/dist/adaptercloud/AdapterCloudRoutes.js +70 -182
  4. package/dist/adaptercloud/AdapterCloudRoutes.js.map +1 -1
  5. package/dist/adaptercloud/components/DataState.js +42 -0
  6. package/dist/adaptercloud/components/DataState.js.map +1 -0
  7. package/dist/adaptercloud/components/SeverityBadge.js +12 -0
  8. package/dist/adaptercloud/components/SeverityBadge.js.map +1 -0
  9. package/dist/adaptercloud/components/StatusBadge.js +43 -44
  10. package/dist/adaptercloud/components/StatusBadge.js.map +1 -1
  11. package/dist/adaptercloud/context/AdapterCloudContext.js +22 -30
  12. package/dist/adaptercloud/context/AdapterCloudContext.js.map +1 -1
  13. package/dist/adaptercloud/hooks/useAdapterCloudApi.js +397 -194
  14. package/dist/adaptercloud/hooks/useAdapterCloudApi.js.map +1 -1
  15. package/dist/adaptercloud/index.js +1 -0
  16. package/dist/adaptercloud/pages/OverviewPage.js +334 -0
  17. package/dist/adaptercloud/pages/OverviewPage.js.map +1 -0
  18. package/dist/adaptercloud/pages/adapters/AdapterDetailPage.js +187 -0
  19. package/dist/adaptercloud/pages/adapters/AdapterDetailPage.js.map +1 -0
  20. package/dist/adaptercloud/pages/adapters/AdapterFormPage.js +278 -0
  21. package/dist/adaptercloud/pages/adapters/AdapterFormPage.js.map +1 -0
  22. package/dist/adaptercloud/pages/adapters/AdaptersListPage.js +172 -0
  23. package/dist/adaptercloud/pages/adapters/AdaptersListPage.js.map +1 -0
  24. package/dist/adaptercloud/pages/connections/ConnectionDetailPage.js +247 -0
  25. package/dist/adaptercloud/pages/connections/ConnectionDetailPage.js.map +1 -0
  26. package/dist/adaptercloud/pages/connections/ConnectionFormPage.js +271 -0
  27. package/dist/adaptercloud/pages/connections/ConnectionFormPage.js.map +1 -0
  28. package/dist/adaptercloud/pages/connections/ConnectionsListPage.js +167 -0
  29. package/dist/adaptercloud/pages/connections/ConnectionsListPage.js.map +1 -0
  30. package/dist/adaptercloud/pages/costs/CostsPage.js +169 -0
  31. package/dist/adaptercloud/pages/costs/CostsPage.js.map +1 -0
  32. package/dist/adaptercloud/pages/drift/DriftListPage.js +132 -0
  33. package/dist/adaptercloud/pages/drift/DriftListPage.js.map +1 -0
  34. package/dist/adaptercloud/pages/policies/PoliciesListPage.js +171 -0
  35. package/dist/adaptercloud/pages/policies/PoliciesListPage.js.map +1 -0
  36. package/dist/adaptercloud/pages/policies/PolicyDetailPage.js +185 -0
  37. package/dist/adaptercloud/pages/policies/PolicyDetailPage.js.map +1 -0
  38. package/dist/adaptercloud/pages/policies/PolicyFormPage.js +215 -0
  39. package/dist/adaptercloud/pages/policies/PolicyFormPage.js.map +1 -0
  40. package/dist/adaptercloud/pages/resources/ResourceDetailPage.js +207 -0
  41. package/dist/adaptercloud/pages/resources/ResourceDetailPage.js.map +1 -0
  42. package/dist/adaptercloud/pages/resources/ResourcesListPage.js +182 -0
  43. package/dist/adaptercloud/pages/resources/ResourcesListPage.js.map +1 -0
  44. package/dist/adaptercloud/pages/sync-runs/SyncRunsListPage.js +196 -0
  45. package/dist/adaptercloud/pages/sync-runs/SyncRunsListPage.js.map +1 -0
  46. package/dist/adaptercloud/pages/violations/ViolationsListPage.js +258 -0
  47. package/dist/adaptercloud/pages/violations/ViolationsListPage.js.map +1 -0
  48. package/dist/adaptercloud/store/adaptercloudStore.js +1 -7
  49. package/dist/adaptercloud/store/adaptercloudStore.js.map +1 -1
  50. package/dist/adaptercloud/utils/domain.js +105 -0
  51. package/dist/adaptercloud/utils/domain.js.map +1 -0
  52. package/dist/adaptercloud/utils/formatters.js +1 -12
  53. package/dist/adaptercloud/utils/formatters.js.map +1 -1
  54. package/dist/index.js +5 -4
  55. package/package.json +1 -1
  56. package/dist/adaptercloud/components/InvestmentCard.js +0 -98
  57. package/dist/adaptercloud/components/InvestmentCard.js.map +0 -1
  58. package/dist/adaptercloud/components/RatingDisplay.js +0 -35
  59. package/dist/adaptercloud/components/RatingDisplay.js.map +0 -1
  60. package/dist/adaptercloud/mocks/data.js +0 -1517
  61. package/dist/adaptercloud/mocks/data.js.map +0 -1
  62. package/dist/adaptercloud/mocks/users.js +0 -34
  63. package/dist/adaptercloud/mocks/users.js.map +0 -1
  64. package/dist/adaptercloud/pages/HomePage.js +0 -934
  65. package/dist/adaptercloud/pages/HomePage.js.map +0 -1
  66. package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js +0 -653
  67. package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js.map +0 -1
  68. package/dist/adaptercloud/pages/admin/AdminDashboard.js +0 -665
  69. package/dist/adaptercloud/pages/admin/AdminDashboard.js.map +0 -1
  70. package/dist/adaptercloud/pages/admin/AdminFinancialPage.js +0 -426
  71. package/dist/adaptercloud/pages/admin/AdminFinancialPage.js.map +0 -1
  72. package/dist/adaptercloud/pages/admin/AdminOrdersPage.js +0 -665
  73. package/dist/adaptercloud/pages/admin/AdminOrdersPage.js.map +0 -1
  74. package/dist/adaptercloud/pages/admin/AdminProfilePage.js +0 -261
  75. package/dist/adaptercloud/pages/admin/AdminProfilePage.js.map +0 -1
  76. package/dist/adaptercloud/pages/admin/AdminSettingsPage.js +0 -663
  77. package/dist/adaptercloud/pages/admin/AdminSettingsPage.js.map +0 -1
  78. package/dist/adaptercloud/pages/admin/CartManagementPage.js +0 -874
  79. package/dist/adaptercloud/pages/admin/CartManagementPage.js.map +0 -1
  80. package/dist/adaptercloud/pages/admin/UserManagementPage.js +0 -898
  81. package/dist/adaptercloud/pages/admin/UserManagementPage.js.map +0 -1
  82. package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js +0 -840
  83. package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js.map +0 -1
  84. package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js +0 -714
  85. package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js.map +0 -1
  86. package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js +0 -788
  87. package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js.map +0 -1
  88. package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js +0 -888
  89. package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js.map +0 -1
  90. package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js +0 -634
  91. package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js.map +0 -1
  92. package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js +0 -907
  93. package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js.map +0 -1
  94. package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js +0 -875
  95. package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js.map +0 -1
  96. package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js +0 -827
  97. package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js.map +0 -1
  98. package/dist/adaptercloud/pages/common/HelpSupportPage.js +0 -1329
  99. package/dist/adaptercloud/pages/common/HelpSupportPage.js.map +0 -1
  100. package/dist/adaptercloud/pages/common/NotificationCenterPage.js +0 -671
  101. package/dist/adaptercloud/pages/common/NotificationCenterPage.js.map +0 -1
  102. package/dist/adaptercloud/pages/common/SettingsPage.js +0 -982
  103. package/dist/adaptercloud/pages/common/SettingsPage.js.map +0 -1
  104. package/dist/adaptercloud/pages/customer/BookingDetailsPage.js +0 -596
  105. package/dist/adaptercloud/pages/customer/BookingDetailsPage.js.map +0 -1
  106. package/dist/adaptercloud/pages/customer/CartDetailPage.js +0 -623
  107. package/dist/adaptercloud/pages/customer/CartDetailPage.js.map +0 -1
  108. package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js +0 -552
  109. package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js.map +0 -1
  110. package/dist/adaptercloud/pages/customer/CheckoutPage.js +0 -534
  111. package/dist/adaptercloud/pages/customer/CheckoutPage.js.map +0 -1
  112. package/dist/adaptercloud/pages/customer/CustomerDashboard.js +0 -525
  113. package/dist/adaptercloud/pages/customer/CustomerDashboard.js.map +0 -1
  114. package/dist/adaptercloud/pages/customer/CustomerProfilePage.js +0 -623
  115. package/dist/adaptercloud/pages/customer/CustomerProfilePage.js.map +0 -1
  116. package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js +0 -629
  117. package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js.map +0 -1
  118. package/dist/adaptercloud/pages/customer/FavoritesPage.js +0 -480
  119. package/dist/adaptercloud/pages/customer/FavoritesPage.js.map +0 -1
  120. package/dist/adaptercloud/pages/customer/OrderHistoryPage.js +0 -444
  121. package/dist/adaptercloud/pages/customer/OrderHistoryPage.js.map +0 -1
  122. package/dist/adaptercloud/pages/customer/OrderTrackingPage.js +0 -391
  123. package/dist/adaptercloud/pages/customer/OrderTrackingPage.js.map +0 -1
  124. package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js +0 -504
  125. package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js.map +0 -1
  126. package/dist/adaptercloud/pages/customer/ReviewsPage.js +0 -609
  127. package/dist/adaptercloud/pages/customer/ReviewsPage.js.map +0 -1
  128. package/dist/adaptercloud/pages/customer/SavedAddressesPage.js +0 -459
  129. package/dist/adaptercloud/pages/customer/SavedAddressesPage.js.map +0 -1
  130. package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js +0 -851
  131. package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js.map +0 -1
  132. package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js +0 -942
  133. package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js.map +0 -1
  134. package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js +0 -683
  135. package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js.map +0 -1
  136. package/dist/adaptercloud/pages/investor/InvestorDashboard.js +0 -452
  137. package/dist/adaptercloud/pages/investor/InvestorDashboard.js.map +0 -1
  138. package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js +0 -402
  139. package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js.map +0 -1
  140. package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js +0 -571
  141. package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js.map +0 -1
  142. package/dist/adaptercloud/pages/investor/InvestorProfilePage.js +0 -1067
  143. package/dist/adaptercloud/pages/investor/InvestorProfilePage.js.map +0 -1
  144. package/dist/adaptercloud/pages/worker/TaskDetailsPage.js +0 -526
  145. package/dist/adaptercloud/pages/worker/TaskDetailsPage.js.map +0 -1
  146. package/dist/adaptercloud/pages/worker/WorkerDashboard.js +0 -659
  147. package/dist/adaptercloud/pages/worker/WorkerDashboard.js.map +0 -1
  148. package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js +0 -678
  149. package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js.map +0 -1
  150. package/dist/adaptercloud/pages/worker/WorkerProfilePage.js +0 -689
  151. package/dist/adaptercloud/pages/worker/WorkerProfilePage.js.map +0 -1
  152. package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js +0 -582
  153. package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js.map +0 -1
@@ -1,671 +0,0 @@
1
- import { useAdapterCloud as e } from "../../context/AdapterCloudContext.js";
2
- import { cn as t } from "../../utils/cn.js";
3
- import { PageLayout as n } from "../../components/PageLayout.js";
4
- import { EmptyState as r } from "../../components/EmptyState.js";
5
- import { formatRelativeTime as i } from "../../utils/formatters.js";
6
- import { useCallback as a, useMemo as o, useState as s } from "react";
7
- import { AlertCircle as c, AlertTriangle as l, ArrowUpDown as u, Bell as d, Check as f, CheckCheck as p, Clock as m, CreditCard as h, Inbox as g, MailOpen as _, Megaphone as v, RefreshCw as y, Search as b, ShoppingBag as x, Star as S, Trash2 as C, TrendingUp as w, Truck as T, UserCheck as E, Users as D, X as O } from "lucide-react";
8
- import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
9
- import { EmphasisPanel as M } from "@burdenoff/fe-libs/ui";
10
- //#region src/adaptercloud/pages/common/NotificationCenterPage.tsx
11
- var N = [
12
- {
13
- id: "n-001",
14
- type: "order_update",
15
- title: "Order Delivered Successfully!",
16
- message: "Your order #ORD-001 from Dosa Express has been delivered. Rate your experience to help others!",
17
- priority: "medium",
18
- isRead: !1,
19
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 480 * 1e3)).toISOString(),
20
- actionUrl: "/customer/order/ORD-001",
21
- actionText: "Rate Order",
22
- metadata: {
23
- orderId: "ORD-001",
24
- cartId: "FOOD-001"
25
- }
26
- },
27
- {
28
- id: "n-002",
29
- type: "payment",
30
- title: "Payment Confirmed",
31
- message: "Your payment of ₹495 for order #ORD-002 at Quick Cuts Salon has been processed successfully.",
32
- priority: "medium",
33
- isRead: !1,
34
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 2100 * 1e3)).toISOString(),
35
- metadata: {
36
- orderId: "ORD-002",
37
- amount: 495
38
- }
39
- },
40
- {
41
- id: "n-003",
42
- type: "promotion",
43
- title: "20% Off Beauty Services This Weekend!",
44
- message: "Glow Beauty Services is offering 20% off on all treatments this weekend only. Don't miss out!",
45
- priority: "low",
46
- isRead: !1,
47
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 7200 * 1e3)).toISOString(),
48
- actionUrl: "/customer/cart/SERV-002",
49
- actionText: "Book Now",
50
- metadata: { cartId: "SERV-002" }
51
- },
52
- {
53
- id: "n-004",
54
- type: "review",
55
- title: "New Review Response",
56
- message: "Dosa Express replied to your review: \"Thank you so much for your kind words! We hope to serve you again soon.\"",
57
- priority: "low",
58
- isRead: !1,
59
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 14400 * 1e3)).toISOString(),
60
- actionUrl: "/customer/reviews",
61
- actionText: "View Reply"
62
- },
63
- {
64
- id: "n-005",
65
- type: "system",
66
- title: "App Update Available",
67
- message: "Version 2.4.0 of AdapterCloud is available with improved performance, new category filters, and bug fixes.",
68
- priority: "medium",
69
- isRead: !1,
70
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 420 * 60 * 1e3)).toISOString(),
71
- actionUrl: "/settings",
72
- actionText: "Update Now"
73
- },
74
- {
75
- id: "n-006",
76
- type: "order_update",
77
- title: "Appointment Confirmed",
78
- message: "Your appointment at Quick Cuts Salon has been confirmed for tomorrow at 3:00 PM. The stylist Suresh will be serving you.",
79
- priority: "medium",
80
- isRead: !0,
81
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 1440 * 60 * 1e3)).toISOString(),
82
- actionUrl: "/customer/order/ORD-002",
83
- actionText: "View Details",
84
- metadata: { orderId: "ORD-002" }
85
- },
86
- {
87
- id: "n-007",
88
- type: "investment",
89
- title: "Monthly Returns Credited",
90
- message: "You received ₹1,250 in monthly returns from your Quick Cuts Salon investment. Total portfolio value: ₹2,12,500.",
91
- priority: "medium",
92
- isRead: !0,
93
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 1440 * 60 * 1e3)).toISOString(),
94
- actionUrl: "/investor/portfolio",
95
- actionText: "View Portfolio",
96
- metadata: { amount: 1250 }
97
- },
98
- {
99
- id: "n-008",
100
- type: "delivery",
101
- title: "Delivery Worker Assigned",
102
- message: "Ravi Kumar (rated 4.8) has been assigned to deliver your order from Biryani Pot. Estimated arrival: 25 minutes.",
103
- priority: "high",
104
- isRead: !0,
105
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 1.5 * 24 * 60 * 60 * 1e3)).toISOString(),
106
- metadata: { orderId: "ORD-003" }
107
- },
108
- {
109
- id: "n-009",
110
- type: "alert",
111
- title: "Unusual Login Attempt Detected",
112
- message: "We detected a login attempt from a new device in Mumbai. If this was not you, please change your password immediately.",
113
- priority: "urgent",
114
- isRead: !0,
115
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 2880 * 60 * 1e3)).toISOString(),
116
- actionUrl: "/settings",
117
- actionText: "Review Activity"
118
- },
119
- {
120
- id: "n-010",
121
- type: "promotion",
122
- title: "Flash Sale: Mobile Accessories",
123
- message: "Gadget Zone Brigade is running a flash sale! Up to 30% off on bluetooth headphones, cases, and chargers.",
124
- priority: "low",
125
- isRead: !0,
126
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 4320 * 60 * 1e3)).toISOString(),
127
- actionUrl: "/customer/cart/RETAIL-003",
128
- actionText: "Shop Now",
129
- metadata: { cartId: "RETAIL-003" }
130
- },
131
- {
132
- id: "n-011",
133
- type: "system",
134
- title: "Scheduled Platform Maintenance",
135
- message: "Platform maintenance is scheduled for Sunday 2:00 AM - 4:00 AM IST. Some services may be briefly unavailable during this window.",
136
- priority: "high",
137
- isRead: !0,
138
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 5760 * 60 * 1e3)).toISOString()
139
- },
140
- {
141
- id: "n-012",
142
- type: "account",
143
- title: "KYC Verification Complete",
144
- message: "Your KYC verification has been completed successfully. You now have full access to all platform features including investments.",
145
- priority: "medium",
146
- isRead: !0,
147
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 7200 * 60 * 1e3)).toISOString()
148
- },
149
- {
150
- id: "n-013",
151
- type: "staff",
152
- title: "Staff Schedule Updated",
153
- message: "Priya Sharma has updated her availability for this week. She will be unavailable on Wednesday and Thursday.",
154
- priority: "medium",
155
- isRead: !0,
156
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 8640 * 60 * 1e3)).toISOString(),
157
- actionUrl: "/owner/staff",
158
- actionText: "View Schedule"
159
- },
160
- {
161
- id: "n-014",
162
- type: "payment",
163
- title: "Refund Processed",
164
- message: "Your refund of ₹280 for order #ORD-005 has been processed. The amount will reflect in your account within 3-5 business days.",
165
- priority: "medium",
166
- isRead: !0,
167
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 10080 * 60 * 1e3)).toISOString(),
168
- metadata: {
169
- orderId: "ORD-005",
170
- amount: 280
171
- }
172
- }
173
- ], P = {
174
- order_update: {
175
- icon: x,
176
- color: "text-accent-blue",
177
- bg: "bg-accent-blue-subtle/10",
178
- label: "Order"
179
- },
180
- payment: {
181
- icon: h,
182
- color: "text-status-success-text",
183
- bg: "bg-status-success-bg-subtle/10",
184
- label: "Payment"
185
- },
186
- promotion: {
187
- icon: v,
188
- color: "text-accent-orange",
189
- bg: "bg-accent-orange-subtle/10",
190
- label: "Promo"
191
- },
192
- system: {
193
- icon: c,
194
- color: "text-accent-purple",
195
- bg: "bg-accent-purple-subtle/10",
196
- label: "System"
197
- },
198
- review: {
199
- icon: S,
200
- color: "text-status-warning-text",
201
- bg: "bg-status-warning-bg-subtle/10",
202
- label: "Review"
203
- },
204
- staff: {
205
- icon: D,
206
- color: "text-accent-indigo",
207
- bg: "bg-accent-indigo-subtle/10",
208
- label: "Staff"
209
- },
210
- investment: {
211
- icon: w,
212
- color: "text-status-success-text",
213
- bg: "bg-status-success-bg-subtle/10",
214
- label: "Investment"
215
- },
216
- alert: {
217
- icon: l,
218
- color: "text-status-error-text",
219
- bg: "bg-status-error-bg-subtle/10",
220
- label: "Alert"
221
- },
222
- delivery: {
223
- icon: T,
224
- color: "text-accent-cyan",
225
- bg: "bg-accent-cyan-subtle/10",
226
- label: "Delivery"
227
- },
228
- account: {
229
- icon: E,
230
- color: "text-accent-teal",
231
- bg: "bg-accent-teal-subtle/10",
232
- label: "Account"
233
- }
234
- }, F = {
235
- urgent: "bg-status-error-bg-subtle/20 text-status-error-text",
236
- high: "bg-accent-orange-subtle/20 text-accent-orange",
237
- medium: "bg-accent-blue-subtle/20 text-accent-blue",
238
- low: "bg-bg-sunken text-text-secondary"
239
- }, I = {
240
- urgent: "border-l-red-500",
241
- high: "border-l-orange-500",
242
- medium: "border-l-blue-500",
243
- low: "border-l-border"
244
- }, L = {
245
- urgent: 4,
246
- high: 3,
247
- medium: 2,
248
- low: 1
249
- }, R = [
250
- {
251
- id: "all",
252
- label: "All",
253
- icon: g
254
- },
255
- {
256
- id: "orders",
257
- label: "Orders",
258
- icon: x
259
- },
260
- {
261
- id: "promotions",
262
- label: "Promotions",
263
- icon: v
264
- },
265
- {
266
- id: "system",
267
- label: "System",
268
- icon: c
269
- },
270
- {
271
- id: "unread",
272
- label: "Unread",
273
- icon: d
274
- }
275
- ];
276
- function z(e) {
277
- let t = new Date(e), n = /* @__PURE__ */ new Date(), r = new Date(n.getFullYear(), n.getMonth(), n.getDate()), i = /* @__PURE__ */ new Date(r.getTime() - 1440 * 60 * 1e3);
278
- return t >= r ? "Today" : t >= i ? "Yesterday" : "Earlier";
279
- }
280
- function B(e) {
281
- let t = [], n = /* @__PURE__ */ new Map(), r = [
282
- "Today",
283
- "Yesterday",
284
- "Earlier"
285
- ];
286
- for (let t of e) {
287
- let e = z(t.createdAt);
288
- n.has(e) || n.set(e, []), n.get(e).push(t);
289
- }
290
- for (let e of r) {
291
- let r = n.get(e);
292
- r && r.length > 0 && t.push({
293
- label: e,
294
- items: r
295
- });
296
- }
297
- return t;
298
- }
299
- function V() {
300
- let { navigateTo: c } = e(), [l, h] = s(N), [g, v] = s("all"), [x, S] = s(""), [w, T] = s("recent"), [E, D] = s(!1), V = o(() => l.filter((e) => !e.isRead).length, [l]), H = o(() => l.filter((e) => e.priority === "urgent").length, [l]), U = o(() => l.filter((e) => z(e.createdAt) === "Today").length, [l]), W = o(() => {
301
- let e = /* @__PURE__ */ new Date(Date.now() - 10080 * 60 * 1e3);
302
- return l.filter((t) => new Date(t.createdAt) >= e).length;
303
- }, [l]), G = o(() => {
304
- let e = {
305
- all: 0,
306
- orders: 0,
307
- promotions: 0,
308
- system: 0,
309
- unread: 0
310
- };
311
- for (let t of l) e.all++, t.isRead || e.unread++, (t.type === "order_update" || t.type === "delivery") && e.orders++, t.type === "promotion" && e.promotions++, (t.type === "system" || t.type === "alert" || t.type === "account") && e.system++;
312
- return e;
313
- }, [l]), K = o(() => {
314
- let e = [...l];
315
- switch (g) {
316
- case "orders":
317
- e = e.filter((e) => e.type === "order_update" || e.type === "delivery");
318
- break;
319
- case "promotions":
320
- e = e.filter((e) => e.type === "promotion");
321
- break;
322
- case "system":
323
- e = e.filter((e) => e.type === "system" || e.type === "alert" || e.type === "account");
324
- break;
325
- case "unread":
326
- e = e.filter((e) => !e.isRead);
327
- break;
328
- }
329
- if (x) {
330
- let t = x.toLowerCase();
331
- e = e.filter((e) => e.title.toLowerCase().includes(t) || e.message.toLowerCase().includes(t));
332
- }
333
- switch (w) {
334
- case "recent":
335
- e.sort((e, t) => new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime());
336
- break;
337
- case "priority":
338
- e.sort((e, t) => L[t.priority] - L[e.priority]);
339
- break;
340
- case "unread":
341
- e.sort((e, t) => e.isRead === t.isRead ? 0 : e.isRead ? 1 : -1);
342
- break;
343
- }
344
- return e;
345
- }, [
346
- l,
347
- g,
348
- x,
349
- w
350
- ]), q = o(() => B(K), [K]), J = a((e) => {
351
- h((t) => t.map((t) => t.id === e ? {
352
- ...t,
353
- isRead: !0
354
- } : t));
355
- }, []), Y = a(() => {
356
- h((e) => e.map((e) => ({
357
- ...e,
358
- isRead: !0
359
- })));
360
- }, []), X = a((e) => {
361
- h((t) => t.filter((t) => t.id !== e));
362
- }, []), Z = a((e) => {
363
- e.isRead || J(e.id), e.actionUrl && c(e.actionUrl);
364
- }, [J, c]), Q = a(() => {
365
- window.confirm("Are you sure you want to clear all notifications?") && h([]);
366
- }, []);
367
- return /* @__PURE__ */ j(n, {
368
- title: "Notifications",
369
- description: V > 0 ? `${V} unread notification${V === 1 ? "" : "s"}` : "All caught up!",
370
- purpose: "Your single feed of order updates, account alerts, and platform news. Filter by type, mark items read, and tap any notification to jump straight to what it's about so nothing important slips by.",
371
- actions: /* @__PURE__ */ j("div", {
372
- className: "flex items-center gap-2",
373
- children: [l.length > 0 && /* @__PURE__ */ j("button", {
374
- type: "button",
375
- onClick: Q,
376
- className: "flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-secondary hover:text-text-primary hover:bg-accent transition-colors",
377
- children: [/* @__PURE__ */ A(C, { className: "h-4 w-4" }), /* @__PURE__ */ A("span", {
378
- className: "hidden sm:inline",
379
- children: "Clear All"
380
- })]
381
- }), V > 0 && /* @__PURE__ */ j("button", {
382
- type: "button",
383
- onClick: Y,
384
- className: "flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
385
- children: [/* @__PURE__ */ A(p, { className: "h-4 w-4" }), "Mark All Read"]
386
- })]
387
- }),
388
- children: [
389
- /* @__PURE__ */ A(M, {
390
- className: "mb-6",
391
- children: /* @__PURE__ */ j("div", {
392
- className: "grid grid-cols-2 gap-3 sm:grid-cols-5",
393
- children: [
394
- /* @__PURE__ */ j("div", {
395
- className: "rounded-lg border border-border-subtle bg-bg-surface p-3 text-center",
396
- children: [/* @__PURE__ */ A("p", {
397
- className: "text-2xl font-bold text-text-primary",
398
- children: l.length
399
- }), /* @__PURE__ */ A("p", {
400
- className: "text-xs text-text-secondary",
401
- children: "Total"
402
- })]
403
- }),
404
- /* @__PURE__ */ j("div", {
405
- className: "rounded-lg border border-accent-blue-subtle/30 bg-accent-blue-subtle/5 p-3 text-center",
406
- children: [/* @__PURE__ */ A("p", {
407
- className: "text-2xl font-bold text-accent-blue",
408
- children: V
409
- }), /* @__PURE__ */ A("p", {
410
- className: "text-xs text-text-secondary",
411
- children: "Unread"
412
- })]
413
- }),
414
- /* @__PURE__ */ j("div", {
415
- className: "rounded-lg border border-status-error-border/30 bg-status-error-bg-subtle/5 p-3 text-center",
416
- children: [/* @__PURE__ */ A("p", {
417
- className: "text-2xl font-bold text-status-error-text",
418
- children: H
419
- }), /* @__PURE__ */ A("p", {
420
- className: "text-xs text-text-secondary",
421
- children: "Urgent"
422
- })]
423
- }),
424
- /* @__PURE__ */ j("div", {
425
- className: "rounded-lg border border-status-success-border/30 bg-status-success-bg-subtle/5 p-3 text-center",
426
- children: [/* @__PURE__ */ A("p", {
427
- className: "text-2xl font-bold text-status-success-text",
428
- children: U
429
- }), /* @__PURE__ */ A("p", {
430
- className: "text-xs text-text-secondary",
431
- children: "Today"
432
- })]
433
- }),
434
- /* @__PURE__ */ j("div", {
435
- className: "rounded-lg border border-status-warning-border/30 bg-status-warning-bg-subtle/5 p-3 text-center",
436
- children: [/* @__PURE__ */ A("p", {
437
- className: "text-2xl font-bold text-status-warning-text",
438
- children: W
439
- }), /* @__PURE__ */ A("p", {
440
- className: "text-xs text-text-secondary",
441
- children: "This Week"
442
- })]
443
- })
444
- ]
445
- })
446
- }),
447
- /* @__PURE__ */ A("div", {
448
- className: "flex items-center gap-2 mb-4 overflow-x-auto pb-1",
449
- children: R.map((e) => {
450
- let n = e.icon;
451
- return /* @__PURE__ */ j("button", {
452
- type: "button",
453
- onClick: () => v(e.id),
454
- className: t("flex items-center gap-1.5 whitespace-nowrap rounded-full border px-3 py-1.5 text-sm font-medium transition-colors", g === e.id ? "border-primary bg-action-primary-bg/10 text-text-primary" : "border-border-subtle text-text-secondary hover:text-text-primary hover:border-accent-foreground/20"),
455
- children: [
456
- /* @__PURE__ */ A(n, { className: "h-3.5 w-3.5" }),
457
- e.label,
458
- /* @__PURE__ */ A("span", {
459
- className: t("inline-flex h-5 min-w-[20px] items-center justify-center rounded-full px-1 text-xs", g === e.id ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary"),
460
- children: G[e.id]
461
- })
462
- ]
463
- }, e.id);
464
- })
465
- }),
466
- /* @__PURE__ */ j("div", {
467
- className: "flex items-center gap-3 mb-6",
468
- children: [/* @__PURE__ */ j("div", {
469
- className: "relative flex-1",
470
- children: [
471
- /* @__PURE__ */ A(b, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }),
472
- /* @__PURE__ */ A("input", {
473
- type: "text",
474
- placeholder: "Search notifications...",
475
- value: x,
476
- onChange: (e) => S(e.target.value),
477
- className: "w-full rounded-lg border border-border-subtle bg-bg-surface py-2.5 pl-10 pr-9 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
478
- }),
479
- x && /* @__PURE__ */ A("button", {
480
- type: "button",
481
- onClick: () => S(""),
482
- className: "absolute right-3 top-1/2 -translate-y-1/2 text-text-secondary hover:text-text-primary",
483
- children: /* @__PURE__ */ A(O, { className: "h-4 w-4" })
484
- })
485
- ]
486
- }), /* @__PURE__ */ j("div", {
487
- className: "relative",
488
- children: [/* @__PURE__ */ j("button", {
489
- type: "button",
490
- onClick: () => D(!E),
491
- className: "flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-2.5 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
492
- children: [/* @__PURE__ */ A(u, { className: "h-4 w-4" }), /* @__PURE__ */ A("span", {
493
- className: "hidden sm:inline",
494
- children: "Sort"
495
- })]
496
- }), E && /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A("div", {
497
- className: "fixed inset-0 z-10",
498
- onClick: () => D(!1)
499
- }), /* @__PURE__ */ A("div", {
500
- className: "absolute right-0 top-full mt-1 z-20 w-44 rounded-lg border border-border-subtle bg-bg-surface shadow-lg py-1",
501
- children: [
502
- {
503
- value: "recent",
504
- label: "Most Recent"
505
- },
506
- {
507
- value: "priority",
508
- label: "By Priority"
509
- },
510
- {
511
- value: "unread",
512
- label: "Unread First"
513
- }
514
- ].map((e) => /* @__PURE__ */ A("button", {
515
- type: "button",
516
- onClick: () => {
517
- T(e.value), D(!1);
518
- },
519
- className: t("w-full text-left px-3 py-2 text-sm transition-colors", w === e.value ? "bg-action-primary-bg/10 text-text-primary font-medium" : "text-text-secondary hover:bg-accent hover:text-text-primary"),
520
- children: e.label
521
- }, e.value))
522
- })] })]
523
- })]
524
- }),
525
- K.length === 0 ? /* @__PURE__ */ A(r, {
526
- illustration: "empty-notifications",
527
- icon: /* @__PURE__ */ A(d, { className: "h-12 w-12" }),
528
- title: "No notifications",
529
- description: x ? "No notifications match your search. Try different keywords." : g === "unread" ? "You're all caught up! No unread notifications." : "No notifications in this category yet.",
530
- action: x ? /* @__PURE__ */ A("button", {
531
- type: "button",
532
- onClick: () => S(""),
533
- className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
534
- children: "Clear Search"
535
- }) : g === "all" ? void 0 : /* @__PURE__ */ A("button", {
536
- type: "button",
537
- onClick: () => v("all"),
538
- className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
539
- children: "View All Notifications"
540
- })
541
- }) : /* @__PURE__ */ A("div", {
542
- className: "space-y-6",
543
- children: q.map((e) => /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ j("div", {
544
- className: "flex items-center gap-3 mb-2",
545
- children: [
546
- /* @__PURE__ */ A("h3", {
547
- className: "text-xs font-semibold uppercase tracking-wider text-text-secondary",
548
- children: e.label
549
- }),
550
- /* @__PURE__ */ A("div", { className: "flex-1 border-t border-border-subtle" }),
551
- /* @__PURE__ */ j("span", {
552
- className: "text-xs text-text-secondary",
553
- children: [
554
- e.items.length,
555
- " notification",
556
- e.items.length === 1 ? "" : "s"
557
- ]
558
- })
559
- ]
560
- }), /* @__PURE__ */ A("div", {
561
- className: "rounded-lg border border-border-subtle bg-bg-surface divide-y divide-border overflow-hidden",
562
- children: e.items.map((e) => {
563
- let n = P[e.type] ?? P.system, r = n.icon;
564
- return /* @__PURE__ */ j("div", {
565
- className: t("flex items-start gap-3 px-4 py-4 border-l-4 transition-colors", I[e.priority], !e.isRead && "bg-accent/30"),
566
- children: [
567
- /* @__PURE__ */ A("div", {
568
- className: t("flex h-10 w-10 shrink-0 items-center justify-center rounded-full", n.bg),
569
- children: /* @__PURE__ */ A(r, { className: t("h-5 w-5", n.color) })
570
- }),
571
- /* @__PURE__ */ j("div", {
572
- className: "flex-1 min-w-0",
573
- children: [
574
- /* @__PURE__ */ j("div", {
575
- className: "flex items-center gap-2 flex-wrap",
576
- children: [
577
- /* @__PURE__ */ A("h4", {
578
- className: t("text-sm text-text-primary", e.isRead ? "font-medium" : "font-semibold"),
579
- children: e.title
580
- }),
581
- !e.isRead && /* @__PURE__ */ A("span", { className: "h-2 w-2 rounded-full bg-action-primary-bg shrink-0" }),
582
- /* @__PURE__ */ A("span", {
583
- className: t("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium", F[e.priority]),
584
- children: e.priority
585
- })
586
- ]
587
- }),
588
- /* @__PURE__ */ A("p", {
589
- className: "mt-1 text-sm text-text-secondary leading-relaxed",
590
- children: e.message
591
- }),
592
- /* @__PURE__ */ j("div", {
593
- className: "mt-2 flex items-center gap-3 flex-wrap",
594
- children: [
595
- /* @__PURE__ */ j("span", {
596
- className: "flex items-center gap-1 text-xs text-text-secondary",
597
- children: [/* @__PURE__ */ A(m, { className: "h-3 w-3" }), i(e.createdAt)]
598
- }),
599
- /* @__PURE__ */ A("span", {
600
- className: t("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium", n.bg, n.color),
601
- children: n.label
602
- }),
603
- e.metadata?.orderId && /* @__PURE__ */ j("span", {
604
- className: "text-xs text-text-secondary",
605
- children: ["#", e.metadata.orderId]
606
- })
607
- ]
608
- }),
609
- /* @__PURE__ */ j("div", {
610
- className: "mt-3 flex items-center gap-2 flex-wrap",
611
- children: [
612
- e.actionUrl && /* @__PURE__ */ A("button", {
613
- type: "button",
614
- onClick: () => Z(e),
615
- className: "rounded-lg bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
616
- children: e.actionText ?? "View"
617
- }),
618
- !e.isRead && /* @__PURE__ */ j("button", {
619
- type: "button",
620
- onClick: () => J(e.id),
621
- title: "Mark as read",
622
- className: "flex items-center gap-1 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent transition-colors",
623
- children: [/* @__PURE__ */ A(f, { className: "h-3 w-3" }), "Mark Read"]
624
- }),
625
- /* @__PURE__ */ j("button", {
626
- type: "button",
627
- onClick: () => X(e.id),
628
- title: "Delete notification",
629
- className: "flex items-center gap-1 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text hover:bg-status-error-bg/10 transition-colors",
630
- children: [/* @__PURE__ */ A(C, { className: "h-3 w-3" }), "Delete"]
631
- })
632
- ]
633
- })
634
- ]
635
- }),
636
- /* @__PURE__ */ A("div", {
637
- className: "shrink-0 pt-1",
638
- children: e.isRead ? /* @__PURE__ */ A(_, { className: "h-4 w-4 text-text-secondary/40" }) : /* @__PURE__ */ A(d, { className: "h-4 w-4 text-primary" })
639
- })
640
- ]
641
- }, e.id);
642
- })
643
- })] }, e.label))
644
- }),
645
- K.length > 0 && /* @__PURE__ */ j("div", {
646
- className: "mt-6 flex items-center justify-between rounded-lg border border-border-subtle bg-bg-surface px-4 py-3",
647
- children: [/* @__PURE__ */ j("p", {
648
- className: "text-sm text-text-secondary",
649
- children: [
650
- "Showing ",
651
- K.length,
652
- " of ",
653
- l.length,
654
- " notifications"
655
- ]
656
- }), g !== "all" && /* @__PURE__ */ j("button", {
657
- type: "button",
658
- onClick: () => {
659
- v("all"), S("");
660
- },
661
- className: "flex items-center gap-1.5 text-sm font-medium text-primary hover:underline",
662
- children: [/* @__PURE__ */ A(y, { className: "h-3.5 w-3.5" }), "Show All"]
663
- })]
664
- })
665
- ]
666
- });
667
- }
668
- //#endregion
669
- export { V as NotificationCenterPage };
670
-
671
- //# sourceMappingURL=NotificationCenterPage.js.map