@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.
- package/dist/index.js +4 -4
- package/dist/subscriberbot/SubscriberBotRoot.js +61 -133
- package/dist/subscriberbot/SubscriberBotRoot.js.map +1 -1
- package/dist/subscriberbot/SubscriberBotRoutes.js +56 -187
- package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
- package/dist/subscriberbot/components/StateViews.js +49 -0
- package/dist/subscriberbot/components/StateViews.js.map +1 -0
- package/dist/subscriberbot/components/StatusBadge.js +45 -47
- package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
- package/dist/subscriberbot/context/SubscriberBotContext.js +22 -30
- package/dist/subscriberbot/context/SubscriberBotContext.js.map +1 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +342 -195
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/index.js +1 -1
- package/dist/subscriberbot/pages/DashboardPage.js +269 -0
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -0
- package/dist/subscriberbot/pages/InboxPage.js +186 -0
- package/dist/subscriberbot/pages/InboxPage.js.map +1 -0
- package/dist/subscriberbot/pages/InvoicesPage.js +211 -0
- package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -0
- package/dist/subscriberbot/pages/WorkflowsPage.js +236 -0
- package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -0
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +160 -0
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -0
- package/dist/subscriberbot/pages/agents/AgentNewPage.js +140 -0
- package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -0
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +178 -0
- package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -0
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +179 -0
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -0
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js +185 -0
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -0
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +254 -0
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -0
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +306 -0
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -0
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +253 -0
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -0
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +248 -0
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -0
- package/dist/subscriberbot/utils/formatters.js +50 -32
- package/dist/subscriberbot/utils/formatters.js.map +1 -1
- package/package.json +1 -1
- package/dist/subscriberbot/components/InvestmentCard.js +0 -97
- package/dist/subscriberbot/components/InvestmentCard.js.map +0 -1
- package/dist/subscriberbot/components/RatingDisplay.js +0 -35
- package/dist/subscriberbot/components/RatingDisplay.js.map +0 -1
- package/dist/subscriberbot/mocks/data.js +0 -1517
- package/dist/subscriberbot/mocks/data.js.map +0 -1
- package/dist/subscriberbot/mocks/users.js +0 -34
- package/dist/subscriberbot/mocks/users.js.map +0 -1
- package/dist/subscriberbot/pages/HomePage.js +0 -930
- package/dist/subscriberbot/pages/HomePage.js.map +0 -1
- package/dist/subscriberbot/pages/admin/AdminAnalyticsPage.js +0 -651
- package/dist/subscriberbot/pages/admin/AdminAnalyticsPage.js.map +0 -1
- package/dist/subscriberbot/pages/admin/AdminDashboard.js +0 -679
- package/dist/subscriberbot/pages/admin/AdminDashboard.js.map +0 -1
- package/dist/subscriberbot/pages/admin/AdminFinancialPage.js +0 -427
- package/dist/subscriberbot/pages/admin/AdminFinancialPage.js.map +0 -1
- package/dist/subscriberbot/pages/admin/AdminOrdersPage.js +0 -665
- package/dist/subscriberbot/pages/admin/AdminOrdersPage.js.map +0 -1
- package/dist/subscriberbot/pages/admin/AdminProfilePage.js +0 -261
- package/dist/subscriberbot/pages/admin/AdminProfilePage.js.map +0 -1
- package/dist/subscriberbot/pages/admin/AdminSettingsPage.js +0 -654
- package/dist/subscriberbot/pages/admin/AdminSettingsPage.js.map +0 -1
- package/dist/subscriberbot/pages/admin/CartManagementPage.js +0 -874
- package/dist/subscriberbot/pages/admin/CartManagementPage.js.map +0 -1
- package/dist/subscriberbot/pages/admin/UserManagementPage.js +0 -898
- package/dist/subscriberbot/pages/admin/UserManagementPage.js.map +0 -1
- package/dist/subscriberbot/pages/cart-owner/AnalyticsDashboard.js +0 -839
- package/dist/subscriberbot/pages/cart-owner/AnalyticsDashboard.js.map +0 -1
- package/dist/subscriberbot/pages/cart-owner/BusinessSettingsPage.js +0 -705
- package/dist/subscriberbot/pages/cart-owner/BusinessSettingsPage.js.map +0 -1
- package/dist/subscriberbot/pages/cart-owner/CartOwnerDashboard.js +0 -802
- package/dist/subscriberbot/pages/cart-owner/CartOwnerDashboard.js.map +0 -1
- package/dist/subscriberbot/pages/cart-owner/CartOwnerProfilePage.js +0 -891
- package/dist/subscriberbot/pages/cart-owner/CartOwnerProfilePage.js.map +0 -1
- package/dist/subscriberbot/pages/cart-owner/CartServiceConfigPage.js +0 -633
- package/dist/subscriberbot/pages/cart-owner/CartServiceConfigPage.js.map +0 -1
- package/dist/subscriberbot/pages/cart-owner/InventoryManagementPage.js +0 -910
- package/dist/subscriberbot/pages/cart-owner/InventoryManagementPage.js.map +0 -1
- package/dist/subscriberbot/pages/cart-owner/OrderManagementPage.js +0 -879
- package/dist/subscriberbot/pages/cart-owner/OrderManagementPage.js.map +0 -1
- package/dist/subscriberbot/pages/cart-owner/StaffManagementPage.js +0 -838
- package/dist/subscriberbot/pages/cart-owner/StaffManagementPage.js.map +0 -1
- package/dist/subscriberbot/pages/common/HelpSupportPage.js +0 -1323
- package/dist/subscriberbot/pages/common/HelpSupportPage.js.map +0 -1
- package/dist/subscriberbot/pages/common/NotificationCenterPage.js +0 -672
- package/dist/subscriberbot/pages/common/NotificationCenterPage.js.map +0 -1
- package/dist/subscriberbot/pages/common/SettingsPage.js +0 -973
- package/dist/subscriberbot/pages/common/SettingsPage.js.map +0 -1
- package/dist/subscriberbot/pages/customer/BookingDetailsPage.js +0 -626
- package/dist/subscriberbot/pages/customer/BookingDetailsPage.js.map +0 -1
- package/dist/subscriberbot/pages/customer/CartDetailPage.js +0 -654
- package/dist/subscriberbot/pages/customer/CartDetailPage.js.map +0 -1
- package/dist/subscriberbot/pages/customer/CartDiscoveryPage.js +0 -555
- package/dist/subscriberbot/pages/customer/CartDiscoveryPage.js.map +0 -1
- package/dist/subscriberbot/pages/customer/CheckoutPage.js +0 -529
- package/dist/subscriberbot/pages/customer/CheckoutPage.js.map +0 -1
- package/dist/subscriberbot/pages/customer/CustomerDashboard.js +0 -532
- package/dist/subscriberbot/pages/customer/CustomerDashboard.js.map +0 -1
- package/dist/subscriberbot/pages/customer/CustomerProfilePage.js +0 -630
- package/dist/subscriberbot/pages/customer/CustomerProfilePage.js.map +0 -1
- package/dist/subscriberbot/pages/customer/DirectServiceBookingPage.js +0 -633
- package/dist/subscriberbot/pages/customer/DirectServiceBookingPage.js.map +0 -1
- package/dist/subscriberbot/pages/customer/FavoritesPage.js +0 -484
- package/dist/subscriberbot/pages/customer/FavoritesPage.js.map +0 -1
- package/dist/subscriberbot/pages/customer/OrderHistoryPage.js +0 -446
- package/dist/subscriberbot/pages/customer/OrderHistoryPage.js.map +0 -1
- package/dist/subscriberbot/pages/customer/OrderTrackingPage.js +0 -394
- package/dist/subscriberbot/pages/customer/OrderTrackingPage.js.map +0 -1
- package/dist/subscriberbot/pages/customer/PaymentMethodsPage.js +0 -495
- package/dist/subscriberbot/pages/customer/PaymentMethodsPage.js.map +0 -1
- package/dist/subscriberbot/pages/customer/ReviewsPage.js +0 -613
- package/dist/subscriberbot/pages/customer/ReviewsPage.js.map +0 -1
- package/dist/subscriberbot/pages/customer/SavedAddressesPage.js +0 -450
- package/dist/subscriberbot/pages/customer/SavedAddressesPage.js.map +0 -1
- package/dist/subscriberbot/pages/investor/InvestmentDetailsPage.js +0 -886
- package/dist/subscriberbot/pages/investor/InvestmentDetailsPage.js.map +0 -1
- package/dist/subscriberbot/pages/investor/InvestmentOpportunitiesPage.js +0 -947
- package/dist/subscriberbot/pages/investor/InvestmentOpportunitiesPage.js.map +0 -1
- package/dist/subscriberbot/pages/investor/InvestorAnalyticsPage.js +0 -687
- package/dist/subscriberbot/pages/investor/InvestorAnalyticsPage.js.map +0 -1
- package/dist/subscriberbot/pages/investor/InvestorDashboard.js +0 -451
- package/dist/subscriberbot/pages/investor/InvestorDashboard.js.map +0 -1
- package/dist/subscriberbot/pages/investor/InvestorInvestmentsPage.js +0 -406
- package/dist/subscriberbot/pages/investor/InvestorInvestmentsPage.js.map +0 -1
- package/dist/subscriberbot/pages/investor/InvestorPortfolioPage.js +0 -575
- package/dist/subscriberbot/pages/investor/InvestorPortfolioPage.js.map +0 -1
- package/dist/subscriberbot/pages/investor/InvestorProfilePage.js +0 -1070
- package/dist/subscriberbot/pages/investor/InvestorProfilePage.js.map +0 -1
- package/dist/subscriberbot/pages/worker/TaskDetailsPage.js +0 -535
- package/dist/subscriberbot/pages/worker/TaskDetailsPage.js.map +0 -1
- package/dist/subscriberbot/pages/worker/WorkerDashboard.js +0 -666
- package/dist/subscriberbot/pages/worker/WorkerDashboard.js.map +0 -1
- package/dist/subscriberbot/pages/worker/WorkerOrdersPage.js +0 -681
- package/dist/subscriberbot/pages/worker/WorkerOrdersPage.js.map +0 -1
- package/dist/subscriberbot/pages/worker/WorkerProfilePage.js +0 -692
- package/dist/subscriberbot/pages/worker/WorkerProfilePage.js.map +0 -1
- package/dist/subscriberbot/pages/worker/WorkerSchedulePage.js +0 -588
- package/dist/subscriberbot/pages/worker/WorkerSchedulePage.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriberBotRoutes.js","names":[],"sources":["../../src/subscriberbot/SubscriberBotRoutes.tsx"],"sourcesContent":["/**\n * SubscriberBot Routes\n * @module subscriberbot\n */\n\nimport { type FC, lazy, Suspense } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router-dom';\nimport { useSubscriberBot } from './context/SubscriberBotContext';\n\n// Eager load - HomePage (primary landing page)\nimport { HomePage } from './pages/HomePage';\n\n// Lazy loaded pages - Customer\nconst CustomerDashboard = lazy(() =>\n import('./pages/customer/CustomerDashboard').then((m) => ({ default: m.CustomerDashboard }))\n);\nconst CartDiscoveryPage = lazy(() =>\n import('./pages/customer/CartDiscoveryPage').then((m) => ({ default: m.CartDiscoveryPage }))\n);\nconst CartDetailPage = lazy(() =>\n import('./pages/customer/CartDetailPage').then((m) => ({ default: m.CartDetailPage }))\n);\nconst CheckoutPage = lazy(() =>\n import('./pages/customer/CheckoutPage').then((m) => ({ default: m.CheckoutPage }))\n);\nconst OrderTrackingPage = lazy(() =>\n import('./pages/customer/OrderTrackingPage').then((m) => ({ default: m.OrderTrackingPage }))\n);\nconst OrderHistoryPage = lazy(() =>\n import('./pages/customer/OrderHistoryPage').then((m) => ({ default: m.OrderHistoryPage }))\n);\nconst CustomerProfilePage = lazy(() =>\n import('./pages/customer/CustomerProfilePage').then((m) => ({ default: m.CustomerProfilePage }))\n);\nconst SavedAddressesPage = lazy(() =>\n import('./pages/customer/SavedAddressesPage').then((m) => ({ default: m.SavedAddressesPage }))\n);\nconst FavoritesPage = lazy(() =>\n import('./pages/customer/FavoritesPage').then((m) => ({ default: m.FavoritesPage }))\n);\nconst ReviewsPage = lazy(() =>\n import('./pages/customer/ReviewsPage').then((m) => ({ default: m.ReviewsPage }))\n);\nconst PaymentMethodsPage = lazy(() =>\n import('./pages/customer/PaymentMethodsPage').then((m) => ({ default: m.PaymentMethodsPage }))\n);\nconst DirectServiceBookingPage = lazy(() =>\n import('./pages/customer/DirectServiceBookingPage').then((m) => ({\n default: m.DirectServiceBookingPage,\n }))\n);\nconst BookingDetailsPage = lazy(() =>\n import('./pages/customer/BookingDetailsPage').then((m) => ({ default: m.BookingDetailsPage }))\n);\n\n// Lazy loaded pages - Cart Owner\nconst CartOwnerDashboard = lazy(() =>\n import('./pages/cart-owner/CartOwnerDashboard').then((m) => ({ default: m.CartOwnerDashboard }))\n);\nconst CartServiceConfigPage = lazy(() =>\n import('./pages/cart-owner/CartServiceConfigPage').then((m) => ({\n default: m.CartServiceConfigPage,\n }))\n);\nconst InventoryManagementPage = lazy(() =>\n import('./pages/cart-owner/InventoryManagementPage').then((m) => ({\n default: m.InventoryManagementPage,\n }))\n);\nconst OrderManagementPage = lazy(() =>\n import('./pages/cart-owner/OrderManagementPage').then((m) => ({\n default: m.OrderManagementPage,\n }))\n);\nconst AnalyticsDashboard = lazy(() =>\n import('./pages/cart-owner/AnalyticsDashboard').then((m) => ({ default: m.AnalyticsDashboard }))\n);\nconst StaffManagementPage = lazy(() =>\n import('./pages/cart-owner/StaffManagementPage').then((m) => ({\n default: m.StaffManagementPage,\n }))\n);\nconst BusinessSettingsPage = lazy(() =>\n import('./pages/cart-owner/BusinessSettingsPage').then((m) => ({\n default: m.BusinessSettingsPage,\n }))\n);\nconst CartOwnerProfilePage = lazy(() =>\n import('./pages/cart-owner/CartOwnerProfilePage').then((m) => ({\n default: m.CartOwnerProfilePage,\n }))\n);\n\n// Lazy loaded pages - Worker\nconst WorkerDashboard = lazy(() =>\n import('./pages/worker/WorkerDashboard').then((m) => ({ default: m.WorkerDashboard }))\n);\nconst WorkerOrdersPage = lazy(() =>\n import('./pages/worker/WorkerOrdersPage').then((m) => ({ default: m.WorkerOrdersPage }))\n);\nconst WorkerSchedulePage = lazy(() =>\n import('./pages/worker/WorkerSchedulePage').then((m) => ({ default: m.WorkerSchedulePage }))\n);\nconst WorkerProfilePage = lazy(() =>\n import('./pages/worker/WorkerProfilePage').then((m) => ({ default: m.WorkerProfilePage }))\n);\nconst TaskDetailsPage = lazy(() =>\n import('./pages/worker/TaskDetailsPage').then((m) => ({ default: m.TaskDetailsPage }))\n);\n\n// Lazy loaded pages - Investor\nconst InvestorDashboard = lazy(() =>\n import('./pages/investor/InvestorDashboard').then((m) => ({ default: m.InvestorDashboard }))\n);\nconst InvestorPortfolioPage = lazy(() =>\n import('./pages/investor/InvestorPortfolioPage').then((m) => ({\n default: m.InvestorPortfolioPage,\n }))\n);\nconst InvestmentOpportunitiesPage = lazy(() =>\n import('./pages/investor/InvestmentOpportunitiesPage').then((m) => ({\n default: m.InvestmentOpportunitiesPage,\n }))\n);\nconst InvestmentDetailsPage = lazy(() =>\n import('./pages/investor/InvestmentDetailsPage').then((m) => ({\n default: m.InvestmentDetailsPage,\n }))\n);\nconst InvestorInvestmentsPage = lazy(() =>\n import('./pages/investor/InvestorInvestmentsPage').then((m) => ({\n default: m.InvestorInvestmentsPage,\n }))\n);\nconst InvestorAnalyticsPage = lazy(() =>\n import('./pages/investor/InvestorAnalyticsPage').then((m) => ({\n default: m.InvestorAnalyticsPage,\n }))\n);\nconst InvestorProfilePage = lazy(() =>\n import('./pages/investor/InvestorProfilePage').then((m) => ({\n default: m.InvestorProfilePage,\n }))\n);\n\n// Lazy loaded pages - Admin\nconst AdminDashboard = lazy(() =>\n import('./pages/admin/AdminDashboard').then((m) => ({ default: m.AdminDashboard }))\n);\nconst UserManagementPage = lazy(() =>\n import('./pages/admin/UserManagementPage').then((m) => ({ default: m.UserManagementPage }))\n);\nconst CartManagementPage = lazy(() =>\n import('./pages/admin/CartManagementPage').then((m) => ({ default: m.CartManagementPage }))\n);\nconst AdminAnalyticsPage = lazy(() =>\n import('./pages/admin/AdminAnalyticsPage').then((m) => ({ default: m.AdminAnalyticsPage }))\n);\nconst AdminOrdersPage = lazy(() =>\n import('./pages/admin/AdminOrdersPage').then((m) => ({ default: m.AdminOrdersPage }))\n);\nconst AdminProfilePage = lazy(() =>\n import('./pages/admin/AdminProfilePage').then((m) => ({ default: m.AdminProfilePage }))\n);\nconst AdminSettingsPage = lazy(() =>\n import('./pages/admin/AdminSettingsPage').then((m) => ({ default: m.AdminSettingsPage }))\n);\nconst AdminFinancialPage = lazy(() =>\n import('./pages/admin/AdminFinancialPage').then((m) => ({ default: m.AdminFinancialPage }))\n);\n\n// Lazy loaded pages - Common\nconst NotificationCenterPage = lazy(() =>\n import('./pages/common/NotificationCenterPage').then((m) => ({\n default: m.NotificationCenterPage,\n }))\n);\nconst SettingsPage = lazy(() =>\n import('./pages/common/SettingsPage').then((m) => ({ default: m.SettingsPage }))\n);\nconst HelpSupportPage = lazy(() =>\n import('./pages/common/HelpSupportPage').then((m) => ({ default: m.HelpSupportPage }))\n);\n\n// Loading fallback component\nconst PageLoader: FC = () => (\n <div className=\"flex items-center justify-center min-h-[400px]\">\n <div className=\"animate-spin rounded-full h-8 w-8 border-b-2 border-primary\" />\n </div>\n);\n\nexport const SubscriberBotRoutes: FC = () => {\n const { basePath, isStandalone } = useSubscriberBot();\n const location = useLocation();\n\n // Normalize base path\n const normalizedBasePath = basePath === '/' ? '' : (basePath ?? '').replace(/\\/$/, '');\n\n // Guard: Only render if path matches basePath (when integrated)\n if (normalizedBasePath && !isStandalone) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <div className=\"flex flex-col min-h-full\">\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Home - Eager loaded */}\n <Route index element={<HomePage />} />\n\n {/* Customer Routes */}\n <Route path=\"customer/dashboard\" element={<CustomerDashboard />} />\n <Route path=\"customer/discover\" element={<CartDiscoveryPage />} />\n <Route path=\"customer/cart/:cartId\" element={<CartDetailPage />} />\n <Route\n path=\"customer/cart/:cartId/direct-service\"\n element={<DirectServiceBookingPage />}\n />\n <Route path=\"customer/checkout\" element={<CheckoutPage />} />\n <Route path=\"customer/orders/:orderId/track\" element={<OrderTrackingPage />} />\n <Route path=\"customer/orders\" element={<OrderHistoryPage />} />\n <Route path=\"customer/profile\" element={<CustomerProfilePage />} />\n <Route path=\"customer/addresses\" element={<SavedAddressesPage />} />\n <Route path=\"customer/favorites\" element={<FavoritesPage />} />\n <Route path=\"customer/reviews\" element={<ReviewsPage />} />\n <Route path=\"customer/payment-methods\" element={<PaymentMethodsPage />} />\n <Route path=\"customer/booking/:bookingId\" element={<BookingDetailsPage />} />\n\n {/* Cart Owner Routes */}\n <Route path=\"cart-owner/dashboard\" element={<CartOwnerDashboard />} />\n <Route path=\"cart-owner/service-config\" element={<CartServiceConfigPage />} />\n <Route path=\"cart-owner/inventory\" element={<InventoryManagementPage />} />\n <Route path=\"cart-owner/orders\" element={<OrderManagementPage />} />\n <Route path=\"cart-owner/analytics\" element={<AnalyticsDashboard />} />\n <Route path=\"cart-owner/staff\" element={<StaffManagementPage />} />\n <Route path=\"cart-owner/settings\" element={<BusinessSettingsPage />} />\n <Route path=\"cart-owner/profile\" element={<CartOwnerProfilePage />} />\n\n {/* Worker Routes */}\n <Route path=\"worker/dashboard\" element={<WorkerDashboard />} />\n <Route path=\"worker/orders\" element={<WorkerOrdersPage />} />\n <Route path=\"worker/schedule\" element={<WorkerSchedulePage />} />\n <Route path=\"worker/profile\" element={<WorkerProfilePage />} />\n <Route path=\"worker/task/:taskId\" element={<TaskDetailsPage />} />\n\n {/* Investor Routes */}\n <Route path=\"investor/dashboard\" element={<InvestorDashboard />} />\n <Route path=\"investor/portfolio\" element={<InvestorPortfolioPage />} />\n <Route path=\"investor/opportunities\" element={<InvestmentOpportunitiesPage />} />\n <Route path=\"investor/opportunity/:id\" element={<InvestmentDetailsPage />} />\n <Route path=\"investor/investments/:id\" element={<InvestmentDetailsPage />} />\n <Route path=\"investor/investments\" element={<InvestorInvestmentsPage />} />\n <Route path=\"investor/analytics\" element={<InvestorAnalyticsPage />} />\n <Route path=\"investor/profile\" element={<InvestorProfilePage />} />\n\n {/* Admin Routes */}\n <Route path=\"admin/dashboard\" element={<AdminDashboard />} />\n <Route path=\"admin/users\" element={<UserManagementPage />} />\n <Route path=\"admin/carts\" element={<CartManagementPage />} />\n <Route path=\"admin/analytics\" element={<AdminAnalyticsPage />} />\n <Route path=\"admin/orders\" element={<AdminOrdersPage />} />\n <Route path=\"admin/profile\" element={<AdminProfilePage />} />\n <Route path=\"admin/settings\" element={<AdminSettingsPage />} />\n <Route path=\"admin/financial\" element={<AdminFinancialPage />} />\n\n {/* Common Routes */}\n <Route path=\"notifications\" element={<NotificationCenterPage />} />\n <Route path=\"settings\" element={<SettingsPage />} />\n <Route path=\"help\" element={<HelpSupportPage />} />\n\n {/* Fallback */}\n <Route path=\"*\" element={<Navigate to=\"/\" replace />} />\n </Routes>\n </Suspense>\n </div>\n );\n};\n"],"mappings":";;;;;;AAaA,IAAM,IAAoB,QACxB,OAAO,yCAAsC,MAAM,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAC7F,EACK,IAAoB,QACxB,OAAO,yCAAsC,MAAM,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAC7F,EACK,IAAiB,QACrB,OAAO,sCAAmC,MAAM,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CACvF,EACK,IAAe,QACnB,OAAO,oCAAiC,MAAM,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CACnF,EACK,IAAoB,QACxB,OAAO,yCAAsC,MAAM,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAC7F,EACK,IAAmB,QACvB,OAAO,wCAAqC,MAAM,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAC3F,EACK,IAAsB,QAC1B,OAAO,2CAAwC,MAAM,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,CACjG,EACK,IAAqB,QACzB,OAAO,0CAAuC,MAAM,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAC/F,EACK,IAAgB,QACpB,OAAO,qCAAkC,MAAM,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE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scriberBotRoutes.js","names":[],"sources":["../../src/subscriberbot/SubscriberBotRoutes.tsx"],"sourcesContent":["/**\n * SubscriberBot Routes\n * @module subscriberbot\n *\n * Domain routes for the Subscriber Bot product. The dashboard is eager-loaded\n * (primary landing); all other pages are lazy-loaded.\n */\n\nimport { type FC, lazy, Suspense } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router-dom';\nimport { Spinner } from '@burdenoff/fe-libs/ui';\nimport { useSubscriberBot } from './context/SubscriberBotContext';\n\n// Eager — primary landing\nimport { DashboardPage } from './pages/DashboardPage';\n\n// Relationships\nconst RelationshipsListPage = lazy(() =>\n import('./pages/relationships/RelationshipsListPage').then((m) => ({\n default: m.RelationshipsListPage,\n }))\n);\nconst RelationshipNewPage = lazy(() =>\n import('./pages/relationships/RelationshipNewPage').then((m) => ({\n default: m.RelationshipNewPage,\n }))\n);\nconst RelationshipDetailPage = lazy(() =>\n import('./pages/relationships/RelationshipDetailPage').then((m) => ({\n default: m.RelationshipDetailPage,\n }))\n);\n\n// Providers\nconst ProvidersListPage = lazy(() =>\n import('./pages/providers/ProvidersListPage').then((m) => ({ default: m.ProvidersListPage }))\n);\nconst ProviderNewPage = lazy(() =>\n import('./pages/providers/ProviderNewPage').then((m) => ({ default: m.ProviderNewPage }))\n);\nconst ProviderDetailPage = lazy(() =>\n import('./pages/providers/ProviderDetailPage').then((m) => ({ default: m.ProviderDetailPage }))\n);\n\n// Inbox / Invoices / Workflows\nconst InboxPage = lazy(() => import('./pages/InboxPage').then((m) => ({ default: m.InboxPage })));\nconst InvoicesPage = lazy(() =>\n import('./pages/InvoicesPage').then((m) => ({ default: m.InvoicesPage }))\n);\nconst WorkflowsPage = lazy(() =>\n import('./pages/WorkflowsPage').then((m) => ({ default: m.WorkflowsPage }))\n);\n\n// Agents\nconst AgentsListPage = lazy(() =>\n import('./pages/agents/AgentsListPage').then((m) => ({ default: m.AgentsListPage }))\n);\nconst AgentNewPage = lazy(() =>\n import('./pages/agents/AgentNewPage').then((m) => ({ default: m.AgentNewPage }))\n);\nconst AgentDetailPage = lazy(() =>\n import('./pages/agents/AgentDetailPage').then((m) => ({ default: m.AgentDetailPage }))\n);\n\nconst PageLoader: FC = () => (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <Spinner size=\"lg\" />\n </div>\n);\n\nexport const SubscriberBotRoutes: FC = () => {\n const { basePath, isStandalone } = useSubscriberBot();\n const location = useLocation();\n\n // Normalize base path\n const normalizedBasePath = basePath === '/' ? '' : (basePath ?? '').replace(/\\/$/, '');\n\n // Guard: only render if the current path matches basePath (integrated mode).\n if (normalizedBasePath && !isStandalone) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <div className=\"flex min-h-full flex-col\">\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Overview / dashboard */}\n <Route index element={<DashboardPage />} />\n\n {/* Relationships (the core domain) */}\n <Route path=\"relationships\" element={<RelationshipsListPage />} />\n <Route path=\"relationships/new\" element={<RelationshipNewPage />} />\n <Route path=\"relationships/:id\" element={<RelationshipDetailPage />} />\n\n {/* Providers (registry) */}\n <Route path=\"providers\" element={<ProvidersListPage />} />\n <Route path=\"providers/new\" element={<ProviderNewPage />} />\n <Route path=\"providers/:id\" element={<ProviderDetailPage />} />\n\n {/* Universal Inbox */}\n <Route path=\"inbox\" element={<InboxPage />} />\n\n {/* Invoices */}\n <Route path=\"invoices\" element={<InvoicesPage />} />\n\n {/* AI Agents */}\n <Route path=\"agents\" element={<AgentsListPage />} />\n <Route path=\"agents/new\" element={<AgentNewPage />} />\n <Route path=\"agents/:id\" element={<AgentDetailPage />} />\n\n {/* Workflows */}\n <Route path=\"workflows\" element={<WorkflowsPage />} />\n\n {/* Fallback */}\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n </div>\n );\n};\n"],"mappings":";;;;;;;AAiBA,IAAM,IAAwB,QA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BAAC,GAAD,EAAiB,CAAA;KAAI,CAAA;IAGtD,kBAAC,GAAD;KAAO,MAAK;KAAI,SAAS,kBAAC,GAAD;MAAU,IAAG;MAAG,SAAA;MAAU,CAAA;KAAI,CAAA;IAChD,EAAA,CAAA;GACA,CAAA;EACP,CAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { cn as e } from "../utils/cn.js";
|
|
2
|
+
import { AlertCircle as t } from "lucide-react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { Spinner as i } from "@burdenoff/fe-libs/ui";
|
|
5
|
+
//#region src/subscriberbot/components/StateViews.tsx
|
|
6
|
+
var a = ({ label: t = "Loading…", className: a }) => /* @__PURE__ */ r("div", {
|
|
7
|
+
className: e("flex min-h-[40vh] flex-col items-center justify-center gap-3", a),
|
|
8
|
+
children: [/* @__PURE__ */ n(i, { size: "lg" }), /* @__PURE__ */ n("p", {
|
|
9
|
+
className: "text-sm text-text-secondary",
|
|
10
|
+
children: t
|
|
11
|
+
})]
|
|
12
|
+
}), o = ({ title: i = "Something went wrong", message: a, onRetry: o, className: s }) => /* @__PURE__ */ r("div", {
|
|
13
|
+
className: e("flex min-h-[40vh] flex-col items-center justify-center gap-4 text-center", s),
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ n(t, { className: "h-10 w-10 text-status-error-text" }),
|
|
16
|
+
/* @__PURE__ */ r("div", { children: [/* @__PURE__ */ n("h2", {
|
|
17
|
+
className: "text-lg font-semibold text-text-primary",
|
|
18
|
+
children: i
|
|
19
|
+
}), a && /* @__PURE__ */ n("p", {
|
|
20
|
+
className: "mt-1 max-w-md text-sm text-text-secondary",
|
|
21
|
+
children: a
|
|
22
|
+
})] }),
|
|
23
|
+
o && /* @__PURE__ */ n("button", {
|
|
24
|
+
type: "button",
|
|
25
|
+
onClick: o,
|
|
26
|
+
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
|
|
27
|
+
children: "Retry"
|
|
28
|
+
})
|
|
29
|
+
]
|
|
30
|
+
}), s = ({ title: t, description: i, action: a, children: o, className: s }) => /* @__PURE__ */ r("section", {
|
|
31
|
+
className: e("mt-8 first:mt-0", s),
|
|
32
|
+
children: [/* @__PURE__ */ r("div", {
|
|
33
|
+
className: "mb-3 flex items-end justify-between gap-3",
|
|
34
|
+
children: [/* @__PURE__ */ r("div", { children: [/* @__PURE__ */ n("h2", {
|
|
35
|
+
className: "text-base font-semibold text-text-primary",
|
|
36
|
+
children: t
|
|
37
|
+
}), i && /* @__PURE__ */ n("p", {
|
|
38
|
+
className: "mt-0.5 text-sm text-text-secondary",
|
|
39
|
+
children: i
|
|
40
|
+
})] }), a && /* @__PURE__ */ n("div", {
|
|
41
|
+
className: "shrink-0",
|
|
42
|
+
children: a
|
|
43
|
+
})]
|
|
44
|
+
}), o]
|
|
45
|
+
});
|
|
46
|
+
//#endregion
|
|
47
|
+
export { o as ErrorView, a as LoadingView, s as Section };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=StateViews.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StateViews.js","names":[],"sources":["../../../src/subscriberbot/components/StateViews.tsx"],"sourcesContent":["/**\n * Shared loading / error state views\n * @module subscriberbot/components\n *\n * Small reusable building blocks so every page renders consistent\n * loading / error / empty states without re-implementing them.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { AlertCircle } from 'lucide-react';\nimport { Spinner } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface LoadingViewProps {\n label?: string;\n className?: string;\n}\n\nexport const LoadingView: FC<LoadingViewProps> = ({ label = 'Loading…', className }) => (\n <div className={cn('flex min-h-[40vh] flex-col items-center justify-center gap-3', className)}>\n <Spinner size=\"lg\" />\n <p className=\"text-sm text-text-secondary\">{label}</p>\n </div>\n);\n\ninterface ErrorViewProps {\n title?: string;\n message?: string;\n onRetry?: () => void;\n className?: string;\n}\n\nexport const ErrorView: FC<ErrorViewProps> = ({\n title = 'Something went wrong',\n message,\n onRetry,\n className,\n}) => (\n <div\n className={cn('flex min-h-[40vh] flex-col items-center justify-center gap-4 text-center', className)}\n >\n <AlertCircle className=\"h-10 w-10 text-status-error-text\" />\n <div>\n <h2 className=\"text-lg font-semibold text-text-primary\">{title}</h2>\n {message && <p className=\"mt-1 max-w-md text-sm text-text-secondary\">{message}</p>}\n </div>\n {onRetry && (\n <button\n type=\"button\"\n onClick={onRetry}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90\"\n >\n Retry\n </button>\n )}\n </div>\n);\n\ninterface SectionProps {\n title: string;\n description?: string;\n action?: ReactNode;\n children: ReactNode;\n className?: string;\n}\n\nexport const Section: FC<SectionProps> = ({ title, description, action, children, className }) => (\n <section className={cn('mt-8 first:mt-0', className)}>\n <div className=\"mb-3 flex items-end justify-between gap-3\">\n <div>\n <h2 className=\"text-base font-semibold text-text-primary\">{title}</h2>\n {description && <p className=\"mt-0.5 text-sm text-text-secondary\">{description}</p>}\n </div>\n {action && <div className=\"shrink-0\">{action}</div>}\n </div>\n {children}\n </section>\n);\n"],"mappings":";;;;;AAkBA,IAAa,KAAqC,EAAE,WAAQ,YAAY,mBACtE,kBAAC,OAAD;CAAK,WAAW,EAAG,gEAAgE,EAAU;WAA7F,CACE,kBAAC,GAAD,EAAS,MAAK,MAAO,CAAA,EACrB,kBAAC,KAAD;EAAG,WAAU;YAA+B;EAAU,CAAA,CAClD;IAUK,KAAiC,EAC5C,WAAQ,wBACR,YACA,YACA,mBAEA,kBAAC,OAAD;CACE,WAAW,EAAG,4EAA4E,EAAU;WADtG;EAGE,kBAAC,GAAD,EAAa,WAAU,oCAAqC,CAAA;EAC5D,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;GAAI,WAAU;aAA2C;GAAW,CAAA,EACnE,KAAW,kBAAC,KAAD;GAAG,WAAU;aAA6C;GAAY,CAAA,CAC9E,EAAA,CAAA;EACL,KACC,kBAAC,UAAD;GACE,MAAK;GACL,SAAS;GACT,WAAU;aACX;GAEQ,CAAA;EAEP;IAWK,KAA6B,EAAE,UAAO,gBAAa,WAAQ,aAAU,mBAChF,kBAAC,WAAD;CAAS,WAAW,EAAG,mBAAmB,EAAU;WAApD,CACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;GAAI,WAAU;aAA6C;GAAW,CAAA,EACrE,KAAe,kBAAC,KAAD;GAAG,WAAU;aAAsC;GAAgB,CAAA,CAC/E,EAAA,CAAA,EACL,KAAU,kBAAC,OAAD;GAAK,WAAU;aAAY;GAAa,CAAA,CAC/C;KACL,EACO"}
|
|
@@ -1,54 +1,52 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
|
-
import {
|
|
2
|
+
import { formatEnumLabel as t } from "../utils/formatters.js";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
4
|
//#region src/subscriberbot/components/StatusBadge.tsx
|
|
4
|
-
var
|
|
5
|
-
success: "bg-status-success-bg
|
|
6
|
-
warning: "bg-status-warning-bg
|
|
7
|
-
destructive: "bg-status-error-bg
|
|
8
|
-
secondary: "bg-
|
|
9
|
-
info: "bg-
|
|
5
|
+
var i = {
|
|
6
|
+
success: "bg-status-success-bg-subtle text-status-success-text",
|
|
7
|
+
warning: "bg-status-warning-bg-subtle text-status-warning-text",
|
|
8
|
+
destructive: "bg-status-error-bg-subtle text-status-error-text",
|
|
9
|
+
secondary: "bg-bg-sunken text-text-secondary",
|
|
10
|
+
info: "bg-[var(--color-accent-soft)] text-text-primary",
|
|
10
11
|
outline: "border border-border-seam text-text-primary"
|
|
11
|
-
},
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return /* @__PURE__ */ n("span", {
|
|
47
|
-
className: e("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium", r[l], c),
|
|
48
|
-
children: [u && /* @__PURE__ */ t("span", {
|
|
12
|
+
}, a = new Set([
|
|
13
|
+
"ACTIVE",
|
|
14
|
+
"AUTONOMOUS",
|
|
15
|
+
"TRIAL",
|
|
16
|
+
"EXPIRING"
|
|
17
|
+
]), o = {
|
|
18
|
+
ACTIVE: "success",
|
|
19
|
+
TRIAL: "info",
|
|
20
|
+
PAUSED: "warning",
|
|
21
|
+
PAST_DUE: "destructive",
|
|
22
|
+
LAPSED: "warning",
|
|
23
|
+
EXPIRED: "secondary",
|
|
24
|
+
CANCELLED: "destructive",
|
|
25
|
+
DRAFT: "secondary",
|
|
26
|
+
ISSUED: "info",
|
|
27
|
+
PAID: "success",
|
|
28
|
+
OVERDUE: "destructive",
|
|
29
|
+
FAILED: "destructive",
|
|
30
|
+
REFUNDED: "outline",
|
|
31
|
+
AUTONOMOUS: "success",
|
|
32
|
+
SUGGEST_ONLY: "info",
|
|
33
|
+
DISABLED: "secondary",
|
|
34
|
+
VERIFIED: "success",
|
|
35
|
+
PENDING: "warning",
|
|
36
|
+
EXPIRING: "warning",
|
|
37
|
+
REMOVED: "outline",
|
|
38
|
+
CLAIMED: "success",
|
|
39
|
+
UNVERIFIED: "secondary",
|
|
40
|
+
DEPRECATED: "outline",
|
|
41
|
+
ARCHIVED: "outline"
|
|
42
|
+
}, s = ({ status: s, className: c }) => {
|
|
43
|
+
let l = s.toUpperCase(), u = o[l] ?? "secondary", d = a.has(l);
|
|
44
|
+
return /* @__PURE__ */ r("span", {
|
|
45
|
+
className: e("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium", i[u], c),
|
|
46
|
+
children: [d && /* @__PURE__ */ n("span", {
|
|
49
47
|
"aria-hidden": "true",
|
|
50
|
-
className: "
|
|
51
|
-
}),
|
|
48
|
+
className: "size-1.5 rounded-full bg-current motion-safe:animate-vc-glow-pulse"
|
|
49
|
+
}), t(s)]
|
|
52
50
|
});
|
|
53
51
|
};
|
|
54
52
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/subscriberbot/components/StatusBadge.tsx"],"sourcesContent":["/**\n * Status Badge Component\n * @module subscriberbot/components\n *\n * A colored badge
|
|
1
|
+
{"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/subscriberbot/components/StatusBadge.tsx"],"sourcesContent":["/**\n * Status Badge Component\n * @module subscriberbot/components\n *\n * A colored badge for Subscriber Bot domain statuses (relationship lifecycle,\n * invoice status, agent posture, channel verification, provider status,\n * workflow state) with semantic color mapping. Accepts the raw server enum\n * value (e.g. \"ACTIVE\", \"PAST_DUE\", \"SUGGEST_ONLY\").\n */\n\nimport type { FC } from 'react';\nimport { cn } from '../utils/cn';\nimport { formatEnumLabel } from '../utils/formatters';\n\ninterface StatusBadgeProps {\n status: string;\n className?: string;\n}\n\ntype BadgeVariant = 'success' | 'warning' | 'destructive' | 'secondary' | 'info' | 'outline';\n\nconst variantStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-bg-subtle text-status-success-text',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text',\n destructive: 'bg-status-error-bg-subtle text-status-error-text',\n secondary: 'bg-bg-sunken text-text-secondary',\n info: 'bg-[var(--color-accent-soft)] text-text-primary',\n outline: 'border border-border-seam text-text-primary',\n};\n\n// Statuses that represent a \"live\" / in-progress condition get a subtle,\n// opacity-only glow pulse (reduced-motion safe via motion-safe:).\nconst liveStatuses = new Set(['ACTIVE', 'AUTONOMOUS', 'TRIAL', 'EXPIRING']);\n\nconst statusVariantMap: Record<string, BadgeVariant> = {\n // Relationship lifecycle\n ACTIVE: 'success',\n TRIAL: 'info',\n PAUSED: 'warning',\n PAST_DUE: 'destructive',\n LAPSED: 'warning',\n EXPIRED: 'secondary',\n CANCELLED: 'destructive',\n\n // Invoice status\n DRAFT: 'secondary',\n ISSUED: 'info',\n PAID: 'success',\n OVERDUE: 'destructive',\n FAILED: 'destructive',\n REFUNDED: 'outline',\n\n // Agent posture\n AUTONOMOUS: 'success',\n SUGGEST_ONLY: 'info',\n DISABLED: 'secondary',\n\n // Channel verification / payment instrument\n VERIFIED: 'success',\n PENDING: 'warning',\n EXPIRING: 'warning',\n REMOVED: 'outline',\n\n // Provider status\n CLAIMED: 'success',\n UNVERIFIED: 'secondary',\n DEPRECATED: 'outline',\n\n // Workflow status\n ARCHIVED: 'outline',\n};\n\nexport const StatusBadge: FC<StatusBadgeProps> = ({ status, className }) => {\n const key = status.toUpperCase();\n const variant = statusVariantMap[key] ?? 'secondary';\n const isLive = liveStatuses.has(key);\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium',\n variantStyles[variant],\n className\n )}\n >\n {isLive && (\n <span\n aria-hidden=\"true\"\n className=\"size-1.5 rounded-full bg-current motion-safe:animate-vc-glow-pulse\"\n />\n )}\n {formatEnumLabel(status)}\n </span>\n );\n};\n"],"mappings":";;;;AAqBA,IAAM,IAA8C;CAClD,SAAS;CACT,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,SAAS;CACV,EAIK,IAAe,IAAI,IAAI;CAAC;CAAU;CAAc;CAAS;CAAW,CAAC,EAErE,IAAiD;CAErD,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,SAAS;CACT,WAAW;CAGX,OAAO;CACP,QAAQ;CACR,MAAM;CACN,SAAS;CACT,QAAQ;CACR,UAAU;CAGV,YAAY;CACZ,cAAc;CACd,UAAU;CAGV,UAAU;CACV,SAAS;CACT,UAAU;CACV,SAAS;CAGT,SAAS;CACT,YAAY;CACZ,YAAY;CAGZ,UAAU;CACX,EAEY,KAAqC,EAAE,WAAQ,mBAAgB;CAC1E,IAAM,IAAM,EAAO,aAAa,EAC1B,IAAU,EAAiB,MAAQ,aACnC,IAAS,EAAa,IAAI,EAAI;AAEpC,QACE,kBAAC,QAAD;EACE,WAAW,EACT,mFACA,EAAc,IACd,EACD;YALH,CAOG,KACC,kBAAC,QAAD;GACE,eAAY;GACZ,WAAU;GACV,CAAA,EAEH,EAAgB,EAAO,CACnB"}
|
|
@@ -9,69 +9,61 @@ function l() {
|
|
|
9
9
|
if (!e) throw Error("useSubscriberBot must be used within a SubscriberBotProvider");
|
|
10
10
|
return e;
|
|
11
11
|
}
|
|
12
|
-
var u = ({ children: t, basePath: r, currentUser: a, tenantId: l, workspaceId: u, apiGatewayUrl: d, authToken: f
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
}, [
|
|
16
|
-
basePath:
|
|
12
|
+
var u = ({ children: t, basePath: r, currentUser: a, tenantId: l, workspaceId: u, apiGatewayUrl: d, authToken: f }) => {
|
|
13
|
+
let p = o(), m = r || "/", h = n((t) => e(m, t), [m]), g = n((t) => {
|
|
14
|
+
p(e(m, t));
|
|
15
|
+
}, [m, p]), _ = i(() => ({
|
|
16
|
+
basePath: m,
|
|
17
17
|
navigate: void 0,
|
|
18
18
|
currentUser: a,
|
|
19
19
|
tenantId: l,
|
|
20
20
|
workspaceId: u,
|
|
21
21
|
apiGatewayUrl: d,
|
|
22
22
|
authToken: f,
|
|
23
|
-
onCartSelect: p,
|
|
24
|
-
onOrderSelect: m,
|
|
25
23
|
isStandalone: !0,
|
|
26
|
-
navigateTo:
|
|
27
|
-
getPath:
|
|
24
|
+
navigateTo: g,
|
|
25
|
+
getPath: h
|
|
28
26
|
}), [
|
|
29
|
-
|
|
27
|
+
m,
|
|
30
28
|
a,
|
|
31
29
|
l,
|
|
32
30
|
u,
|
|
33
31
|
d,
|
|
34
32
|
f,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
v,
|
|
38
|
-
_
|
|
33
|
+
g,
|
|
34
|
+
h
|
|
39
35
|
]);
|
|
40
36
|
return /* @__PURE__ */ s(c.Provider, {
|
|
41
|
-
value:
|
|
37
|
+
value: _,
|
|
42
38
|
children: t
|
|
43
39
|
});
|
|
44
|
-
}, d = ({ children: t, basePath: r, navigate: a, currentUser: o, tenantId: l, workspaceId: u, apiGatewayUrl: d, authToken: f
|
|
45
|
-
let
|
|
46
|
-
a(e(
|
|
47
|
-
}, [
|
|
48
|
-
basePath:
|
|
40
|
+
}, d = ({ children: t, basePath: r, navigate: a, currentUser: o, tenantId: l, workspaceId: u, apiGatewayUrl: d, authToken: f }) => {
|
|
41
|
+
let p = r || "/", m = n((t) => e(p, t), [p]), h = n((t) => {
|
|
42
|
+
a(e(p, t));
|
|
43
|
+
}, [p, a]), g = i(() => ({
|
|
44
|
+
basePath: p,
|
|
49
45
|
navigate: a,
|
|
50
46
|
currentUser: o,
|
|
51
47
|
tenantId: l,
|
|
52
48
|
workspaceId: u,
|
|
53
49
|
apiGatewayUrl: d,
|
|
54
50
|
authToken: f,
|
|
55
|
-
onCartSelect: p,
|
|
56
|
-
onOrderSelect: m,
|
|
57
51
|
isStandalone: !1,
|
|
58
|
-
navigateTo:
|
|
59
|
-
getPath:
|
|
52
|
+
navigateTo: h,
|
|
53
|
+
getPath: m
|
|
60
54
|
}), [
|
|
61
|
-
|
|
55
|
+
p,
|
|
62
56
|
a,
|
|
63
57
|
o,
|
|
64
58
|
l,
|
|
65
59
|
u,
|
|
66
60
|
d,
|
|
67
61
|
f,
|
|
68
|
-
|
|
69
|
-
m
|
|
70
|
-
_,
|
|
71
|
-
g
|
|
62
|
+
h,
|
|
63
|
+
m
|
|
72
64
|
]);
|
|
73
65
|
return /* @__PURE__ */ s(c.Provider, {
|
|
74
|
-
value:
|
|
66
|
+
value: g,
|
|
75
67
|
children: t
|
|
76
68
|
});
|
|
77
69
|
}, f = (e) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriberBotContext.js","names":[],"sources":["../../../src/subscriberbot/context/SubscriberBotContext.tsx"],"sourcesContent":["/**\n * SubscriberBot Context Provider\n * @module subscriberbot/context\n */\n\nimport type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useMemo, useCallback } from 'react';\nimport { MemoryRouter, useNavigate as useRouterNavigate } from 'react-router-dom';\nimport type { SubscriberBotRootProps } from '../types';\nimport { joinPath } from '../utils/navigation';\n\n// ============================================================================\n// Context\n// ============================================================================\n\ninterface SubscriberBotContextValue extends Omit<\n SubscriberBotRootProps,\n 'registerNavItems' | 'registerFooterItems' | 'navigate'\n> {\n isStandalone: boolean;\n /** Shell's navigate function (only available in integrated mode) */\n navigate?: (path: string) => void;\n /** Navigate to a path relative to basePath */\n navigateTo: (relativePath: string) => void;\n /** Get the full path for a relative path */\n getPath: (relativePath: string) => string;\n}\n\nconst SubscriberBotContext = createContext<SubscriberBotContextValue | null>(null);\n\n// ============================================================================\n// Hook\n// ============================================================================\n\nexport function useSubscriberBot(): SubscriberBotContextValue {\n const context = useContext(SubscriberBotContext);\n if (!context) {\n throw new Error('useSubscriberBot must be used within a SubscriberBotProvider');\n }\n return context;\n}\n\n// ============================================================================\n// Provider Component\n// ============================================================================\n\ntype ProviderProps = Omit<SubscriberBotRootProps, 'registerNavItems' | 'registerFooterItems'> & {\n isStandalone: boolean;\n};\n\n/** Provider for standalone mode (has access to MemoryRouter) */\nconst StandaloneProviderInner: FC<PropsWithChildren<ProviderProps>> = ({\n children,\n basePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n
|
|
1
|
+
{"version":3,"file":"SubscriberBotContext.js","names":[],"sources":["../../../src/subscriberbot/context/SubscriberBotContext.tsx"],"sourcesContent":["/**\n * SubscriberBot Context Provider\n * @module subscriberbot/context\n */\n\nimport type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useMemo, useCallback } from 'react';\nimport { MemoryRouter, useNavigate as useRouterNavigate } from 'react-router-dom';\nimport type { SubscriberBotRootProps } from '../types';\nimport { joinPath } from '../utils/navigation';\n\n// ============================================================================\n// Context\n// ============================================================================\n\ninterface SubscriberBotContextValue extends Omit<\n SubscriberBotRootProps,\n 'registerNavItems' | 'registerFooterItems' | 'navigate'\n> {\n isStandalone: boolean;\n /** Shell's navigate function (only available in integrated mode) */\n navigate?: (path: string) => void;\n /** Navigate to a path relative to basePath */\n navigateTo: (relativePath: string) => void;\n /** Get the full path for a relative path */\n getPath: (relativePath: string) => string;\n}\n\nconst SubscriberBotContext = createContext<SubscriberBotContextValue | null>(null);\n\n// ============================================================================\n// Hook\n// ============================================================================\n\nexport function useSubscriberBot(): SubscriberBotContextValue {\n const context = useContext(SubscriberBotContext);\n if (!context) {\n throw new Error('useSubscriberBot must be used within a SubscriberBotProvider');\n }\n return context;\n}\n\n// ============================================================================\n// Provider Component\n// ============================================================================\n\ntype ProviderProps = Omit<SubscriberBotRootProps, 'registerNavItems' | 'registerFooterItems'> & {\n isStandalone: boolean;\n};\n\n/** Provider for standalone mode (has access to MemoryRouter) */\nconst StandaloneProviderInner: FC<PropsWithChildren<ProviderProps>> = ({\n children,\n basePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n}) => {\n const routerNavigate = useRouterNavigate();\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n routerNavigate(fullPath);\n },\n [effectiveBasePath, routerNavigate]\n );\n\n const contextValue = useMemo<SubscriberBotContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate: undefined,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n isStandalone: true,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n navigateTo,\n getPath,\n ]\n );\n\n return (\n <SubscriberBotContext.Provider value={contextValue}>{children}</SubscriberBotContext.Provider>\n );\n};\n\n/** Provider for integrated mode (shell provides navigate) */\nconst IntegratedProviderInner: FC<\n PropsWithChildren<ProviderProps & { navigate: (path: string) => void }>\n> = ({\n children,\n basePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n}) => {\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n navigate(fullPath);\n },\n [effectiveBasePath, navigate]\n );\n\n const contextValue = useMemo<SubscriberBotContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n isStandalone: false,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n navigateTo,\n getPath,\n ]\n );\n\n return (\n <SubscriberBotContext.Provider value={contextValue}>{children}</SubscriberBotContext.Provider>\n );\n};\n\nexport const SubscriberBotProvider: FC<PropsWithChildren<SubscriberBotRootProps>> = (props) => {\n const { children, navigate } = props;\n // Standalone mode: no navigate function provided (MFE manages its own router)\n // Integrated mode: navigate function provided by shell (shell provides router)\n const isStandalone = !navigate;\n\n // Standalone mode: wrap in MemoryRouter\n if (isStandalone) {\n return (\n <MemoryRouter>\n <StandaloneProviderInner {...props} isStandalone={true}>\n {children}\n </StandaloneProviderInner>\n </MemoryRouter>\n );\n }\n\n // Integrated mode: shell provides router\n return (\n <IntegratedProviderInner {...props} navigate={navigate} isStandalone={false}>\n {children}\n </IntegratedProviderInner>\n );\n};\n"],"mappings":";;;;;AA4BA,IAAM,IAAuB,EAAgD,KAAK;AAMlF,SAAgB,IAA8C;CAC5D,IAAM,IAAU,EAAW,EAAqB;AAChD,KAAI,CAAC,EACH,OAAU,MAAM,+DAA+D;AAEjF,QAAO;;AAYT,IAAM,KAAiE,EACrE,aACA,aACA,gBACA,aACA,gBACA,kBACA,mBACI;CACJ,IAAM,IAAiB,GAAmB,EACpC,IAAoB,KAAY,KAEhC,IAAU,GACb,MAAyB,EAAS,GAAmB,EAAa,EACnE,CAAC,EAAkB,CACpB,EAEK,IAAa,GAChB,MAAyB;AAExB,IADiB,EAAS,GAAmB,EAAa,CAClC;IAE1B,CAAC,GAAmB,EAAe,CACpC,EAEK,IAAe,SACZ;EACL,UAAU;EACV,UAAU,KAAA;EACV;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;EACD,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAED,QACE,kBAAC,EAAqB,UAAtB;EAA+B,OAAO;EAAe;EAAyC,CAAA;GAK5F,KAED,EACH,aACA,aACA,aACA,gBACA,aACA,gBACA,kBACA,mBACI;CACJ,IAAM,IAAoB,KAAY,KAEhC,IAAU,GACb,MAAyB,EAAS,GAAmB,EAAa,EACnE,CAAC,EAAkB,CACpB,EAEK,IAAa,GAChB,MAAyB;AAExB,IADiB,EAAS,GAAmB,EAAa,CACxC;IAEpB,CAAC,GAAmB,EAAS,CAC9B,EAEK,IAAe,SACZ;EACL,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;EACD,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAED,QACE,kBAAC,EAAqB,UAAtB;EAA+B,OAAO;EAAe;EAAyC,CAA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