@burdenoff/microfe-subscriberbot 2026.1107.8 → 2026.1110.2
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/generated/global-operations.d.ts +4 -2
- package/dist/generated/global-types.d.ts +2 -22
- package/dist/generated/wspace-operations.d.ts +4 -2
- package/dist/generated/wspace-types.d.ts +4 -24
- package/dist/index.d.ts +0 -1
- package/dist/node_modules/clsx/dist/clsx.js +8 -7
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +134 -151
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/stories/Accessibility.stories.d.ts +2 -4
- package/dist/stories/EmptyState.stories.d.ts +0 -2
- package/dist/stories/MetricsCard.stories.d.ts +0 -2
- package/dist/stories/StatusBadge.stories.d.ts +0 -2
- package/dist/stories/pages/AgentDetailPage.stories.d.ts +0 -2
- package/dist/stories/pages/AgentNewPage.stories.d.ts +0 -2
- package/dist/stories/pages/AgentsListPage.stories.d.ts +0 -2
- package/dist/stories/pages/AssetVaultPage.stories.d.ts +0 -2
- package/dist/stories/pages/BankConnectionsPage.stories.d.ts +0 -2
- package/dist/stories/pages/DashboardPage.stories.d.ts +0 -2
- package/dist/stories/pages/DecisionDetailPage.stories.d.ts +0 -2
- package/dist/stories/pages/DecisionsPage.stories.d.ts +0 -2
- package/dist/stories/pages/EnterpriseSpendPage.stories.d.ts +0 -2
- package/dist/stories/pages/InboxPage.stories.d.ts +0 -2
- package/dist/stories/pages/InboxReadState.stories.d.ts +1 -3
- package/dist/stories/pages/InsightsPage.stories.d.ts +0 -2
- package/dist/stories/pages/InvoicesPage.stories.d.ts +0 -2
- package/dist/stories/pages/NegotiationDetailPage.stories.d.ts +0 -2
- package/dist/stories/pages/NegotiationNewPage.stories.d.ts +0 -2
- package/dist/stories/pages/NegotiationsPage.stories.d.ts +0 -2
- package/dist/stories/pages/ProcurementDetailPage.stories.d.ts +0 -2
- package/dist/stories/pages/ProcurementNewPage.stories.d.ts +0 -2
- package/dist/stories/pages/ProcurementPage.stories.d.ts +0 -2
- package/dist/stories/pages/ProviderDetailPage.stories.d.ts +0 -2
- package/dist/stories/pages/ProviderNewPage.stories.d.ts +0 -2
- package/dist/stories/pages/ProvidersListPage.stories.d.ts +0 -2
- package/dist/stories/pages/RelationshipDetailPage.stories.d.ts +0 -2
- package/dist/stories/pages/RelationshipNewPage.stories.d.ts +0 -2
- package/dist/stories/pages/RelationshipsListPage.stories.d.ts +0 -2
- package/dist/stories/pages/RenewalsPage.stories.d.ts +0 -2
- package/dist/stories/pages/SavingsPage.stories.d.ts +0 -2
- package/dist/stories/pages/WorkflowBuilderPage.stories.d.ts +0 -2
- package/dist/stories/pages/WorkflowsPage.stories.d.ts +0 -2
- package/dist/stories/support/PageHarness.d.ts +0 -2
- package/dist/stories/support/bankingFixtures.d.ts +0 -2
- package/dist/stories/support/fixtures.d.ts +0 -2
- package/dist/stories/support/graphqlMock.d.ts +0 -2
- package/dist/stories/support/handlers.d.ts +0 -2
- package/dist/stories/support/negotiationFixtures.d.ts +0 -2
- package/dist/stories/support/phoneViewport.d.ts +0 -2
- package/dist/stories/support/play.d.ts +0 -2
- package/dist/stories/support/procurementFixtures.d.ts +0 -2
- package/dist/subscriberbot/SubscriberBotRoot.d.ts +0 -2
- package/dist/subscriberbot/SubscriberBotRoot.js +10 -7
- package/dist/subscriberbot/SubscriberBotRoot.js.map +1 -1
- package/dist/subscriberbot/SubscriberBotRoutes.d.ts +0 -2
- package/dist/subscriberbot/SubscriberBotRoutes.js +1 -2
- package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
- package/dist/subscriberbot/admin/AdminDashboardPage.d.ts +0 -2
- package/dist/subscriberbot/admin/AdminDashboardPage.js +9 -10
- package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
- package/dist/subscriberbot/admin/AdminRoot.d.ts +0 -2
- package/dist/subscriberbot/admin/AdminRoot.js +2 -3
- package/dist/subscriberbot/admin/AdminRoot.js.map +1 -1
- package/dist/subscriberbot/admin/NegotiationDeskPanel.d.ts +0 -2
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js +56 -57
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js.map +1 -1
- package/dist/subscriberbot/admin/ProcurementDeskPanel.d.ts +0 -2
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js +107 -108
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js.map +1 -1
- package/dist/subscriberbot/admin/index.d.ts +0 -1
- package/dist/subscriberbot/admin/index.js +1 -1
- package/dist/subscriberbot/components/EmptyState.d.ts +0 -2
- package/dist/subscriberbot/components/EmptyState.js +1 -2
- package/dist/subscriberbot/components/EmptyState.js.map +1 -1
- package/dist/subscriberbot/components/MetricsCard.d.ts +0 -2
- package/dist/subscriberbot/components/MetricsCard.js +1 -2
- package/dist/subscriberbot/components/MetricsCard.js.map +1 -1
- package/dist/subscriberbot/components/Modal.d.ts +0 -2
- package/dist/subscriberbot/components/Modal.js +2 -3
- package/dist/subscriberbot/components/Modal.js.map +1 -1
- package/dist/subscriberbot/components/PageLayout.d.ts +0 -2
- package/dist/subscriberbot/components/PageLayout.js +1 -2
- package/dist/subscriberbot/components/PageLayout.js.map +1 -1
- package/dist/subscriberbot/components/PostureOptions.d.ts +1 -3
- package/dist/subscriberbot/components/PostureOptions.js +7 -8
- package/dist/subscriberbot/components/PostureOptions.js.map +1 -1
- package/dist/subscriberbot/components/StateViews.d.ts +0 -2
- package/dist/subscriberbot/components/StateViews.js +1 -2
- package/dist/subscriberbot/components/StateViews.js.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.d.ts +0 -2
- package/dist/subscriberbot/components/StatusBadge.js +2 -3
- package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionBanners.d.ts +0 -2
- package/dist/subscriberbot/components/decisions/DecisionBanners.js +7 -8
- package/dist/subscriberbot/components/decisions/DecisionBanners.js.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionCard.d.ts +0 -2
- package/dist/subscriberbot/components/decisions/DecisionCard.js +65 -66
- package/dist/subscriberbot/components/decisions/DecisionCard.js.map +1 -1
- package/dist/subscriberbot/components/decisions/decisionModel.d.ts +0 -2
- package/dist/subscriberbot/components/decisions/decisionModel.js +2 -3
- package/dist/subscriberbot/components/decisions/decisionModel.js.map +1 -1
- package/dist/subscriberbot/components/decisions/index.d.ts +0 -1
- package/dist/subscriberbot/components/decisions/index.js +4 -3
- package/dist/subscriberbot/components/index.d.ts +0 -1
- package/dist/subscriberbot/components/index.js +8 -7
- package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts +0 -2
- package/dist/subscriberbot/components/mobile/MobileDashboard.js +23 -24
- package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts +0 -2
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +40 -49
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileScreen.d.ts +0 -2
- package/dist/subscriberbot/components/mobile/MobileScreen.js +1 -2
- package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -1
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.d.ts +0 -2
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.js +1 -2
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.js.map +1 -1
- package/dist/subscriberbot/components/mobile/index.d.ts +0 -1
- package/dist/subscriberbot/components/mobile/index.js +4 -3
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.d.ts +0 -2
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js +1 -2
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.d.ts +0 -2
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js +4 -5
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/OutcomeForm.d.ts +0 -2
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js +4 -5
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/index.d.ts +0 -1
- package/dist/subscriberbot/components/negotiations/index.js +5 -4
- package/dist/subscriberbot/components/negotiations/labels.d.ts +0 -2
- package/dist/subscriberbot/components/negotiations/labels.js +1 -2
- package/dist/subscriberbot/components/negotiations/labels.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.d.ts +0 -2
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js +4 -5
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.d.ts +0 -2
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js +1 -2
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementThread.d.ts +0 -2
- package/dist/subscriberbot/components/procurement/ProcurementThread.js +4 -5
- package/dist/subscriberbot/components/procurement/ProcurementThread.js.map +1 -1
- package/dist/subscriberbot/components/procurement/index.d.ts +0 -1
- package/dist/subscriberbot/components/procurement/index.js +5 -4
- package/dist/subscriberbot/components/procurement/labels.d.ts +0 -2
- package/dist/subscriberbot/components/procurement/labels.js +1 -2
- package/dist/subscriberbot/components/procurement/labels.js.map +1 -1
- package/dist/subscriberbot/components/savings/SavingsCards.d.ts +0 -2
- package/dist/subscriberbot/components/savings/SavingsCards.js +90 -91
- package/dist/subscriberbot/components/savings/SavingsCards.js.map +1 -1
- package/dist/subscriberbot/components/savings/index.d.ts +0 -1
- package/dist/subscriberbot/components/savings/index.js +3 -2
- package/dist/subscriberbot/components/savings/savingsModel.d.ts +0 -2
- package/dist/subscriberbot/components/savings/savingsModel.js +2 -3
- package/dist/subscriberbot/components/savings/savingsModel.js.map +1 -1
- package/dist/subscriberbot/components/viz.d.ts +0 -2
- package/dist/subscriberbot/components/viz.js +2 -3
- package/dist/subscriberbot/components/viz.js.map +1 -1
- package/dist/subscriberbot/config/assistantUsecases.d.ts +0 -1
- package/dist/subscriberbot/context/SubscriberBotContext.d.ts +0 -2
- package/dist/subscriberbot/context/SubscriberBotContext.js +3 -3
- package/dist/subscriberbot/context/SubscriberBotContext.js.map +1 -1
- package/dist/subscriberbot/context/index.d.ts +0 -1
- package/dist/subscriberbot/context/index.js +1 -1
- package/dist/subscriberbot/hooks/index.d.ts +0 -1
- package/dist/subscriberbot/hooks/index.js +2 -2
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.d.ts +0 -2
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.js +2 -3
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.js.map +1 -1
- package/dist/subscriberbot/hooks/useBankingApi.d.ts +0 -2
- package/dist/subscriberbot/hooks/useBankingApi.js +2 -3
- package/dist/subscriberbot/hooks/useBankingApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useCompactViewport.d.ts +0 -1
- package/dist/subscriberbot/hooks/useCompactViewport.js +1 -2
- package/dist/subscriberbot/hooks/useCompactViewport.js.map +1 -1
- package/dist/subscriberbot/hooks/useFormError.d.ts +0 -1
- package/dist/subscriberbot/hooks/useFormError.js +1 -2
- package/dist/subscriberbot/hooks/useFormError.js.map +1 -1
- package/dist/subscriberbot/hooks/useFormatters.d.ts +0 -1
- package/dist/subscriberbot/hooks/useFormatters.js +1 -2
- package/dist/subscriberbot/hooks/useFormatters.js.map +1 -1
- package/dist/subscriberbot/hooks/useNegotiationApi.d.ts +0 -2
- package/dist/subscriberbot/hooks/useNegotiationApi.js +2 -3
- package/dist/subscriberbot/hooks/useNegotiationApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useProcurementApi.d.ts +0 -2
- package/dist/subscriberbot/hooks/useProcurementApi.js +2 -3
- package/dist/subscriberbot/hooks/useProcurementApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useRouteSelection.d.ts +0 -1
- package/dist/subscriberbot/hooks/useRouteSelection.js +3 -3
- package/dist/subscriberbot/hooks/useRouteSelection.js.map +1 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts +0 -2
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +1 -2
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useTr.d.ts +0 -1
- package/dist/subscriberbot/hooks/useTr.js +1 -2
- package/dist/subscriberbot/hooks/useTr.js.map +1 -1
- package/dist/subscriberbot/index.d.ts +0 -1
- package/dist/subscriberbot/index.js +9 -8
- package/dist/subscriberbot/pages/AssetVaultPage.d.ts +0 -2
- package/dist/subscriberbot/pages/AssetVaultPage.js +34 -35
- package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.d.ts +1 -2
- package/dist/subscriberbot/pages/DashboardPage.js +86 -87
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.d.ts +1 -2
- package/dist/subscriberbot/pages/InboxPage.js +194 -199
- package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
- package/dist/subscriberbot/pages/InsightsPage.d.ts +0 -2
- package/dist/subscriberbot/pages/InsightsPage.js +28 -29
- package/dist/subscriberbot/pages/InsightsPage.js.map +1 -1
- package/dist/subscriberbot/pages/InvoicesPage.d.ts +1 -2
- package/dist/subscriberbot/pages/InvoicesPage.js +179 -188
- package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
- package/dist/subscriberbot/pages/RenewalsPage.d.ts +0 -2
- package/dist/subscriberbot/pages/RenewalsPage.js +293 -298
- package/dist/subscriberbot/pages/RenewalsPage.js.map +1 -1
- package/dist/subscriberbot/pages/SavingsPage.d.ts +0 -2
- package/dist/subscriberbot/pages/SavingsPage.js +25 -26
- package/dist/subscriberbot/pages/SavingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.d.ts +1 -2
- package/dist/subscriberbot/pages/WorkflowsPage.js +67 -68
- package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts +1 -2
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +126 -127
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts +1 -2
- package/dist/subscriberbot/pages/agents/AgentNewPage.js +10 -11
- package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts +1 -2
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +23 -24
- package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts +1 -2
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js +337 -359
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/banking/ConnectBankModal.d.ts +1 -3
- package/dist/subscriberbot/pages/banking/ConnectBankModal.js +22 -27
- package/dist/subscriberbot/pages/banking/ConnectBankModal.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts +1 -2
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js +25 -26
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts +1 -2
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js +34 -35
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts +1 -2
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js +125 -130
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts +1 -2
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js +94 -95
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts +1 -2
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js +15 -16
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts +1 -2
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js +20 -21
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts +1 -2
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js +86 -87
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts +1 -2
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js +164 -165
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts +1 -2
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js +20 -21
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts +1 -2
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +350 -351
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderInsights.d.ts +2 -3
- package/dist/subscriberbot/pages/providers/ProviderInsights.js +95 -96
- package/dist/subscriberbot/pages/providers/ProviderInsights.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts +1 -2
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js +11 -12
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts +1 -2
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +62 -63
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts +1 -2
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +166 -172
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts +1 -2
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +12 -13
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts +1 -2
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +21 -22
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts +1 -3
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js +242 -255
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts +0 -2
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js +2 -3
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js.map +1 -1
- package/dist/subscriberbot/services/createSandboxAssistantTransport.d.ts +0 -1
- package/dist/subscriberbot/services/createSandboxAssistantTransport.js +1 -2
- package/dist/subscriberbot/services/createSandboxAssistantTransport.js.map +1 -1
- package/dist/subscriberbot/store/index.d.ts +0 -1
- package/dist/subscriberbot/store/index.js +1 -1
- package/dist/subscriberbot/store/subscriberbotStore.d.ts +1 -3
- package/dist/subscriberbot/store/subscriberbotStore.js +1 -2
- package/dist/subscriberbot/store/subscriberbotStore.js.map +1 -1
- package/dist/subscriberbot/types/assistant.d.ts +0 -2
- package/dist/subscriberbot/types/banking.d.ts +0 -2
- package/dist/subscriberbot/types/index.d.ts +0 -2
- package/dist/subscriberbot/types/negotiation.d.ts +0 -2
- package/dist/subscriberbot/types/procurement.d.ts +0 -1
- package/dist/subscriberbot/utils/bankRedirectLink.d.ts +0 -2
- package/dist/subscriberbot/utils/bankRedirectLink.js +18 -19
- package/dist/subscriberbot/utils/bankRedirectLink.js.map +1 -1
- package/dist/subscriberbot/utils/chartScale.d.ts +0 -1
- package/dist/subscriberbot/utils/chartScale.js +1 -2
- package/dist/subscriberbot/utils/chartScale.js.map +1 -1
- package/dist/subscriberbot/utils/cn.d.ts +0 -2
- package/dist/subscriberbot/utils/cn.js +2 -3
- package/dist/subscriberbot/utils/cn.js.map +1 -1
- package/dist/subscriberbot/utils/formatters.d.ts +0 -1
- package/dist/subscriberbot/utils/formatters.js +4 -5
- package/dist/subscriberbot/utils/formatters.js.map +1 -1
- package/dist/subscriberbot/utils/index.d.ts +0 -1
- package/dist/subscriberbot/utils/navigation.d.ts +0 -1
- package/dist/subscriberbot/utils/navigation.js +1 -2
- package/dist/subscriberbot/utils/navigation.js.map +1 -1
- package/dist/subscriberbot/utils/pageContext.d.ts +0 -1
- package/dist/subscriberbot/utils/pageContext.js +3 -4
- package/dist/subscriberbot/utils/pageContext.js.map +1 -1
- package/dist/subscriberbot/utils/plaidLink.d.ts +0 -1
- package/dist/subscriberbot/utils/plaidLink.js +21 -22
- package/dist/subscriberbot/utils/plaidLink.js.map +1 -1
- package/dist/subscriberbot/utils/portfolio.d.ts +0 -2
- package/dist/subscriberbot/utils/portfolio.js +5 -6
- package/dist/subscriberbot/utils/portfolio.js.map +1 -1
- package/dist/subscriberbot/utils/renewals.d.ts +0 -2
- package/dist/subscriberbot/utils/renewals.js +1 -2
- package/dist/subscriberbot/utils/renewals.js.map +1 -1
- package/package.json +73 -56
- package/dist/generated/global-operations.d.ts.map +0 -1
- package/dist/generated/global-types.d.ts.map +0 -1
- package/dist/generated/wspace-operations.d.ts.map +0 -1
- package/dist/generated/wspace-types.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/stories/Accessibility.stories.d.ts.map +0 -1
- package/dist/stories/EmptyState.stories.d.ts.map +0 -1
- package/dist/stories/MetricsCard.stories.d.ts.map +0 -1
- package/dist/stories/StatusBadge.stories.d.ts.map +0 -1
- package/dist/stories/pages/AgentDetailPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/AgentNewPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/AgentsListPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/AssetVaultPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/BankConnectionsPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/DashboardPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/DecisionDetailPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/DecisionsPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/EnterpriseSpendPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/InboxPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/InboxReadState.stories.d.ts.map +0 -1
- package/dist/stories/pages/InsightsPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/InvoicesPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/NegotiationDetailPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/NegotiationNewPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/NegotiationsPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/ProcurementDetailPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/ProcurementNewPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/ProcurementPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/ProviderDetailPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/ProviderNewPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/ProvidersListPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/RelationshipDetailPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/RelationshipNewPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/RelationshipsListPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/RenewalsPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/SavingsPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/WorkflowBuilderPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/WorkflowsPage.stories.d.ts.map +0 -1
- package/dist/stories/support/PageHarness.d.ts.map +0 -1
- package/dist/stories/support/bankingFixtures.d.ts.map +0 -1
- package/dist/stories/support/fixtures.d.ts.map +0 -1
- package/dist/stories/support/graphqlMock.d.ts.map +0 -1
- package/dist/stories/support/handlers.d.ts.map +0 -1
- package/dist/stories/support/negotiationFixtures.d.ts.map +0 -1
- package/dist/stories/support/phoneViewport.d.ts.map +0 -1
- package/dist/stories/support/play.d.ts.map +0 -1
- package/dist/stories/support/procurementFixtures.d.ts.map +0 -1
- package/dist/subscriberbot/SubscriberBotRoot.d.ts.map +0 -1
- package/dist/subscriberbot/SubscriberBotRoutes.d.ts.map +0 -1
- package/dist/subscriberbot/admin/AdminDashboardPage.d.ts.map +0 -1
- package/dist/subscriberbot/admin/AdminRoot.d.ts.map +0 -1
- package/dist/subscriberbot/admin/NegotiationDeskPanel.d.ts.map +0 -1
- package/dist/subscriberbot/admin/ProcurementDeskPanel.d.ts.map +0 -1
- package/dist/subscriberbot/admin/index.d.ts.map +0 -1
- package/dist/subscriberbot/components/EmptyState.d.ts.map +0 -1
- package/dist/subscriberbot/components/MetricsCard.d.ts.map +0 -1
- package/dist/subscriberbot/components/Modal.d.ts.map +0 -1
- package/dist/subscriberbot/components/PageLayout.d.ts.map +0 -1
- package/dist/subscriberbot/components/PostureOptions.d.ts.map +0 -1
- package/dist/subscriberbot/components/StateViews.d.ts.map +0 -1
- package/dist/subscriberbot/components/StatusBadge.d.ts.map +0 -1
- package/dist/subscriberbot/components/decisions/DecisionBanners.d.ts.map +0 -1
- package/dist/subscriberbot/components/decisions/DecisionCard.d.ts.map +0 -1
- package/dist/subscriberbot/components/decisions/decisionModel.d.ts.map +0 -1
- package/dist/subscriberbot/components/decisions/index.d.ts.map +0 -1
- package/dist/subscriberbot/components/index.d.ts.map +0 -1
- package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts.map +0 -1
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts.map +0 -1
- package/dist/subscriberbot/components/mobile/MobileScreen.d.ts.map +0 -1
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.d.ts.map +0 -1
- package/dist/subscriberbot/components/mobile/index.d.ts.map +0 -1
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.d.ts.map +0 -1
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.d.ts.map +0 -1
- package/dist/subscriberbot/components/negotiations/OutcomeForm.d.ts.map +0 -1
- package/dist/subscriberbot/components/negotiations/index.d.ts.map +0 -1
- package/dist/subscriberbot/components/negotiations/labels.d.ts.map +0 -1
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.d.ts.map +0 -1
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.d.ts.map +0 -1
- package/dist/subscriberbot/components/procurement/ProcurementThread.d.ts.map +0 -1
- package/dist/subscriberbot/components/procurement/index.d.ts.map +0 -1
- package/dist/subscriberbot/components/procurement/labels.d.ts.map +0 -1
- package/dist/subscriberbot/components/savings/SavingsCards.d.ts.map +0 -1
- package/dist/subscriberbot/components/savings/index.d.ts.map +0 -1
- package/dist/subscriberbot/components/savings/savingsModel.d.ts.map +0 -1
- package/dist/subscriberbot/components/viz.d.ts.map +0 -1
- package/dist/subscriberbot/config/assistantUsecases.d.ts.map +0 -1
- package/dist/subscriberbot/context/SubscriberBotContext.d.ts.map +0 -1
- package/dist/subscriberbot/context/index.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/index.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useBankingApi.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useCompactViewport.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useFormError.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useFormatters.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useNegotiationApi.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useProcurementApi.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useRouteSelection.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useTr.d.ts.map +0 -1
- package/dist/subscriberbot/index.d.ts.map +0 -1
- package/dist/subscriberbot/pages/AssetVaultPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/DashboardPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/InboxPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/InsightsPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/InvoicesPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/RenewalsPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/SavingsPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/WorkflowsPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/banking/ConnectBankModal.d.ts.map +0 -1
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/providers/ProviderInsights.d.ts.map +0 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts.map +0 -1
- package/dist/subscriberbot/services/createSandboxAssistantTransport.d.ts.map +0 -1
- package/dist/subscriberbot/store/index.d.ts.map +0 -1
- package/dist/subscriberbot/store/subscriberbotStore.d.ts.map +0 -1
- package/dist/subscriberbot/types/assistant.d.ts.map +0 -1
- package/dist/subscriberbot/types/banking.d.ts.map +0 -1
- package/dist/subscriberbot/types/index.d.ts.map +0 -1
- package/dist/subscriberbot/types/negotiation.d.ts.map +0 -1
- package/dist/subscriberbot/types/procurement.d.ts.map +0 -1
- package/dist/subscriberbot/utils/bankRedirectLink.d.ts.map +0 -1
- package/dist/subscriberbot/utils/chartScale.d.ts.map +0 -1
- package/dist/subscriberbot/utils/cn.d.ts.map +0 -1
- package/dist/subscriberbot/utils/formatters.d.ts.map +0 -1
- package/dist/subscriberbot/utils/index.d.ts.map +0 -1
- package/dist/subscriberbot/utils/navigation.d.ts.map +0 -1
- package/dist/subscriberbot/utils/pageContext.d.ts.map +0 -1
- package/dist/subscriberbot/utils/plaidLink.d.ts.map +0 -1
- package/dist/subscriberbot/utils/portfolio.d.ts.map +0 -1
- package/dist/subscriberbot/utils/renewals.d.ts.map +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { cn as o } from "../../utils/cn.js";
|
|
5
|
-
import { StatusBadge as s } from "../../components/StatusBadge.js";
|
|
6
|
-
import { EmptyState as c } from "../../components/EmptyState.js";
|
|
7
|
-
import { ErrorView as l, LoadingView as u, Section as d } from "../../components/StateViews.js";
|
|
8
|
-
import { PriceHistoryChart as f } from "../../components/viz.js";
|
|
1
|
+
import { EmptyState as e } from "../../components/EmptyState.js";
|
|
2
|
+
import { ErrorView as t, LoadingView as n, Section as r } from "../../components/StateViews.js";
|
|
3
|
+
import { StatusBadge as i } from "../../components/StatusBadge.js";
|
|
9
4
|
import "../../components/index.js";
|
|
10
|
-
import {
|
|
5
|
+
import { useSubscriberBot as a } from "../../context/SubscriberBotContext.js";
|
|
6
|
+
import { useProviderAlternatives as o, useProviderPriceHistory as s } from "../../hooks/useSubscriberBotApi.js";
|
|
7
|
+
import { useTr as c } from "../../hooks/useTr.js";
|
|
8
|
+
import { PriceHistoryChart as l } from "../../components/viz.js";
|
|
9
|
+
import { formatCurrency as u, formatDate as d, formatEnumLabel as f, formatIntervalSuffix as p } from "../../utils/formatters.js";
|
|
10
|
+
import { cn as m } from "../../utils/cn.js";
|
|
11
11
|
import { useMemo as h } from "react";
|
|
12
12
|
import { ArrowRight as g, Shuffle as _ } from "lucide-react";
|
|
13
13
|
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
14
14
|
import { GlassCard as x } from "@burdenoff/fe-libs/ui";
|
|
15
|
-
|
|
15
|
+
// src/subscriberbot/pages/providers/ProviderInsights.tsx
|
|
16
16
|
var S = 6;
|
|
17
17
|
function C(e) {
|
|
18
18
|
return e === null || e === 0 ? "bg-bg-sunken text-text-secondary" : e > 0 ? "bg-status-error-bg-subtle text-status-error-text" : "bg-status-success-bg-subtle text-status-success-text";
|
|
@@ -20,35 +20,35 @@ function C(e) {
|
|
|
20
20
|
function w(e) {
|
|
21
21
|
return `${e > 0 ? "+" : ""}${e}%`;
|
|
22
22
|
}
|
|
23
|
-
function T(e,
|
|
24
|
-
let
|
|
25
|
-
if (!
|
|
26
|
-
let
|
|
23
|
+
function T(e, t) {
|
|
24
|
+
let n = e.summary?.currency;
|
|
25
|
+
if (!n) return [];
|
|
26
|
+
let r = /* @__PURE__ */ new Map();
|
|
27
27
|
for (let t of e.series) {
|
|
28
|
-
if (t.source !== "RELATIONSHIP" || t.currency ===
|
|
29
|
-
let e =
|
|
30
|
-
e.push(...t.points.map((e) => e.observedAt)),
|
|
28
|
+
if (t.source !== "RELATIONSHIP" || t.currency === n || !t.relationshipId) continue;
|
|
29
|
+
let e = r.get(t.relationshipId) ?? [];
|
|
30
|
+
e.push(...t.points.map((e) => e.observedAt)), r.set(t.relationshipId, e);
|
|
31
31
|
}
|
|
32
|
-
return e.series.filter((e) => e.currency ===
|
|
33
|
-
let
|
|
32
|
+
return e.series.filter((e) => e.currency === n).map((e) => {
|
|
33
|
+
let n = e.points.filter((t) => e.source !== "INVOICE" || t.monthlyAmount !== null).map((e) => ({
|
|
34
34
|
at: e.observedAt,
|
|
35
35
|
value: e.monthlyAmount,
|
|
36
|
-
title: `${
|
|
36
|
+
title: `${d(e.observedAt)} · ${u(e.amount, e.currency)}${p(e.interval)}`
|
|
37
37
|
}));
|
|
38
|
-
if (e.source === "RELATIONSHIP" && e.relationshipId) for (let t of
|
|
38
|
+
if (e.source === "RELATIONSHIP" && e.relationshipId) for (let t of r.get(e.relationshipId) ?? []) n.push({
|
|
39
39
|
at: t,
|
|
40
40
|
value: null
|
|
41
41
|
});
|
|
42
42
|
return {
|
|
43
43
|
key: e.key,
|
|
44
|
-
label: e.source === "INVOICE" ?
|
|
44
|
+
label: e.source === "INVOICE" ? t("providers.insights.invoiceSeries", "{{label}} (invoices)", { label: e.label.replace(/ \(invoices\)$/, "") }) : e.label,
|
|
45
45
|
mode: e.source === "INVOICE" ? "dots" : "step",
|
|
46
|
-
points:
|
|
46
|
+
points: n
|
|
47
47
|
};
|
|
48
48
|
}).filter((e) => e.points.some((e) => e.value !== null));
|
|
49
49
|
}
|
|
50
|
-
function E({ providerId:
|
|
51
|
-
let
|
|
50
|
+
function E({ providerId: i }) {
|
|
51
|
+
let o = c(), { navigateTo: f } = a(), { data: g, isLoading: _, isError: E, refetch: D } = s(i), O = h(() => g ? T(g, o) : [], [g, o]), k = h(() => g ? [...g.points].reverse().slice(0, S) : [], [g]), A = g?.summary ?? null, j = A?.currency ?? "USD", M = h(() => {
|
|
52
52
|
let e = /* @__PURE__ */ new Map();
|
|
53
53
|
for (let t of g?.series ?? []) {
|
|
54
54
|
let n = t.points[t.points.length - 1];
|
|
@@ -67,79 +67,79 @@ function E({ providerId: r }) {
|
|
|
67
67
|
count: t.length
|
|
68
68
|
};
|
|
69
69
|
}, [g, j]);
|
|
70
|
-
return /* @__PURE__ */ y(
|
|
71
|
-
title:
|
|
72
|
-
description:
|
|
70
|
+
return /* @__PURE__ */ y(r, {
|
|
71
|
+
title: o("providers.insights.priceHistoryTitle", "Your price history"),
|
|
72
|
+
description: o("providers.insights.priceHistoryDescription", "What this workspace has paid this provider over time, per month"),
|
|
73
73
|
children: /* @__PURE__ */ y(x, {
|
|
74
74
|
treatment: "metric",
|
|
75
75
|
className: "p-5",
|
|
76
76
|
"data-testid": "provider-price-history",
|
|
77
|
-
children: _ ? /* @__PURE__ */ y(
|
|
77
|
+
children: _ ? /* @__PURE__ */ y(n, {
|
|
78
78
|
className: "min-h-[10rem]",
|
|
79
|
-
label:
|
|
80
|
-
}) : E ? /* @__PURE__ */ y(
|
|
79
|
+
label: o("providers.insights.priceHistoryLoading", "Loading price history…")
|
|
80
|
+
}) : E ? /* @__PURE__ */ y(t, {
|
|
81
81
|
className: "min-h-[10rem]",
|
|
82
|
-
title:
|
|
83
|
-
message:
|
|
82
|
+
title: o("providers.insights.priceHistoryErrorTitle", "Price history unavailable"),
|
|
83
|
+
message: o("providers.insights.priceHistoryError", "Could not load what this workspace has paid this provider."),
|
|
84
84
|
onRetry: () => void D()
|
|
85
|
-
}) : !g || !A ? /* @__PURE__ */ y(
|
|
85
|
+
}) : !g || !A ? /* @__PURE__ */ y(e, {
|
|
86
86
|
illustration: "empty-data",
|
|
87
|
-
title:
|
|
88
|
-
description:
|
|
87
|
+
title: o("providers.insights.priceHistoryEmptyTitle", "No prices recorded yet"),
|
|
88
|
+
description: o("providers.insights.priceHistoryEmpty", "Link a relationship to this provider and its price, and every later change, will be charted here.")
|
|
89
89
|
}) : /* @__PURE__ */ b(v, { children: [
|
|
90
90
|
/* @__PURE__ */ b("div", {
|
|
91
91
|
className: "flex flex-wrap items-start gap-x-8 gap-y-3",
|
|
92
92
|
children: [
|
|
93
93
|
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
94
94
|
className: "text-xs text-text-secondary",
|
|
95
|
-
children: M && M.count > 1 ?
|
|
95
|
+
children: M && M.count > 1 ? o("providers.insights.latestMonthlyTotal", "Latest monthly price across {{count}} relationships", { count: M.count }) : o("providers.insights.latestMonthly", "Latest monthly price")
|
|
96
96
|
}), /* @__PURE__ */ b("p", {
|
|
97
97
|
className: "text-2xl font-bold tabular-nums text-text-primary",
|
|
98
|
-
children: [M ?
|
|
98
|
+
children: [M ? u(M.amount, j) : "—", /* @__PURE__ */ y("span", {
|
|
99
99
|
className: "text-sm font-normal text-text-secondary",
|
|
100
100
|
children: "/mo"
|
|
101
101
|
})]
|
|
102
102
|
})] }),
|
|
103
103
|
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
104
104
|
className: "text-xs text-text-secondary",
|
|
105
|
-
children:
|
|
105
|
+
children: o("providers.insights.range", "Range paid")
|
|
106
106
|
}), /* @__PURE__ */ y("p", {
|
|
107
107
|
className: "text-sm font-medium tabular-nums text-text-primary",
|
|
108
|
-
children: A.minMonthlyAmount != null && A.maxMonthlyAmount != null ? `${
|
|
108
|
+
children: A.minMonthlyAmount != null && A.maxMonthlyAmount != null ? `${u(A.minMonthlyAmount, j)} – ${u(A.maxMonthlyAmount, j)}` : "—"
|
|
109
109
|
})] }),
|
|
110
110
|
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
111
111
|
className: "text-xs text-text-secondary",
|
|
112
|
-
children:
|
|
112
|
+
children: o("providers.insights.priceChanges", "Price changes")
|
|
113
113
|
}), /* @__PURE__ */ y("p", {
|
|
114
114
|
className: "text-sm font-medium tabular-nums text-text-primary",
|
|
115
115
|
children: A.priceChangeCount
|
|
116
116
|
})] }),
|
|
117
117
|
A.latestChangePercent != null && /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
118
118
|
className: "text-xs text-text-secondary",
|
|
119
|
-
children:
|
|
119
|
+
children: o("providers.insights.latestChange", "Latest change")
|
|
120
120
|
}), /* @__PURE__ */ b("span", {
|
|
121
|
-
className:
|
|
122
|
-
children: [w(A.latestChangePercent), A.latestChangeAt && ` · ${
|
|
121
|
+
className: m("mt-0.5 inline-block rounded-full px-2 py-0.5 text-xs font-medium tabular-nums", C(A.latestChangePercent)),
|
|
122
|
+
children: [w(A.latestChangePercent), A.latestChangeAt && ` · ${d(A.latestChangeAt)}`]
|
|
123
123
|
})] })
|
|
124
124
|
]
|
|
125
125
|
}),
|
|
126
|
-
O.length > 0 ? /* @__PURE__ */ y(
|
|
126
|
+
O.length > 0 ? /* @__PURE__ */ y(l, {
|
|
127
127
|
className: "mt-4",
|
|
128
128
|
series: O,
|
|
129
129
|
now: /* @__PURE__ */ new Date(),
|
|
130
|
-
ariaLabel:
|
|
131
|
-
valueFormat: (e,
|
|
132
|
-
minimumFractionDigits:
|
|
133
|
-
maximumFractionDigits:
|
|
130
|
+
ariaLabel: o("providers.insights.chartLabel", "Monthly price paid over time, in {{currency}}", { currency: j }),
|
|
131
|
+
valueFormat: (e, t) => u(e, j, {
|
|
132
|
+
minimumFractionDigits: t,
|
|
133
|
+
maximumFractionDigits: t
|
|
134
134
|
}),
|
|
135
|
-
dateFormat: (e) =>
|
|
135
|
+
dateFormat: (e) => d(e, {
|
|
136
136
|
day: void 0,
|
|
137
137
|
month: "short",
|
|
138
138
|
year: "numeric"
|
|
139
139
|
})
|
|
140
140
|
}) : /* @__PURE__ */ y("p", {
|
|
141
141
|
className: "mt-4 text-sm text-text-secondary",
|
|
142
|
-
children:
|
|
142
|
+
children: o("providers.insights.noRecurring", "These prices are not recurring, so there is no monthly trend to chart.")
|
|
143
143
|
}),
|
|
144
144
|
/* @__PURE__ */ y("ul", {
|
|
145
145
|
className: "mt-4 divide-y divide-border-subtle border-t border-border-subtle",
|
|
@@ -150,27 +150,27 @@ function E({ providerId: r }) {
|
|
|
150
150
|
children: [
|
|
151
151
|
/* @__PURE__ */ y("span", {
|
|
152
152
|
className: "w-24 shrink-0 tabular-nums text-text-secondary",
|
|
153
|
-
children:
|
|
153
|
+
children: d(e.observedAt)
|
|
154
154
|
}),
|
|
155
155
|
e.relationshipId ? /* @__PURE__ */ y("button", {
|
|
156
156
|
type: "button",
|
|
157
|
-
onClick: () =>
|
|
157
|
+
onClick: () => f(`/relationships/${e.relationshipId}`),
|
|
158
158
|
className: "truncate text-text-link hover:underline",
|
|
159
|
-
children: e.label ??
|
|
159
|
+
children: e.label ?? o("providers.insights.untitled", "Untitled")
|
|
160
160
|
}) : /* @__PURE__ */ y("span", {
|
|
161
161
|
className: "truncate text-text-primary",
|
|
162
|
-
children: e.label ??
|
|
162
|
+
children: e.label ?? o("providers.insights.removedRelationship", "Removed relationship")
|
|
163
163
|
}),
|
|
164
164
|
/* @__PURE__ */ y("span", {
|
|
165
165
|
className: "rounded-full bg-bg-sunken px-2 py-0.5 text-[11px] text-text-secondary",
|
|
166
|
-
children: e.source === "INVOICE" ?
|
|
166
|
+
children: e.source === "INVOICE" ? o("providers.insights.sourceInvoice", "Invoice") : o("providers.insights.sourceRecorded", "Recorded price")
|
|
167
167
|
})
|
|
168
168
|
]
|
|
169
169
|
}), /* @__PURE__ */ b("span", {
|
|
170
170
|
className: "font-medium tabular-nums text-text-primary",
|
|
171
|
-
children: [
|
|
171
|
+
children: [u(e.amount, e.currency), /* @__PURE__ */ y("span", {
|
|
172
172
|
className: "text-xs font-normal text-text-secondary",
|
|
173
|
-
children:
|
|
173
|
+
children: p(e.interval)
|
|
174
174
|
})]
|
|
175
175
|
})]
|
|
176
176
|
}, e.id))
|
|
@@ -180,11 +180,11 @@ function E({ providerId: r }) {
|
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
function D({ range: e }) {
|
|
183
|
-
let n =
|
|
183
|
+
let t = c(), n = e.minMonthlyAmount === e.maxMonthlyAmount ? u(e.minMonthlyAmount, e.currency) : `${u(e.minMonthlyAmount, e.currency)} – ${u(e.maxMonthlyAmount, e.currency)}`;
|
|
184
184
|
return /* @__PURE__ */ b("span", {
|
|
185
185
|
className: "tabular-nums",
|
|
186
186
|
children: [
|
|
187
|
-
|
|
187
|
+
n,
|
|
188
188
|
/* @__PURE__ */ y("span", {
|
|
189
189
|
className: "text-xs text-text-secondary",
|
|
190
190
|
children: "/mo"
|
|
@@ -192,13 +192,13 @@ function D({ range: e }) {
|
|
|
192
192
|
" ",
|
|
193
193
|
/* @__PURE__ */ y("span", {
|
|
194
194
|
className: "text-xs text-text-secondary",
|
|
195
|
-
children: e.basis === "PLANS" ?
|
|
195
|
+
children: e.basis === "PLANS" ? t("providers.insights.basisPlans", "({{count}} plans)", { count: e.count }) : t("providers.insights.basisRelationships", "(what you pay)")
|
|
196
196
|
})
|
|
197
197
|
]
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
|
-
function O({ alt:
|
|
201
|
-
let
|
|
200
|
+
function O({ alt: e }) {
|
|
201
|
+
let t = c(), { navigateTo: n } = a(), r = e.priceRanges[0];
|
|
202
202
|
return /* @__PURE__ */ b("li", {
|
|
203
203
|
className: "py-4 first:pt-0 last:pb-0",
|
|
204
204
|
"data-testid": "provider-alternative",
|
|
@@ -208,45 +208,45 @@ function O({ alt: n }) {
|
|
|
208
208
|
className: "min-w-0",
|
|
209
209
|
children: [/* @__PURE__ */ b("button", {
|
|
210
210
|
type: "button",
|
|
211
|
-
onClick: () =>
|
|
211
|
+
onClick: () => n(`/providers/${e.providerId}`),
|
|
212
212
|
className: "inline-flex items-center gap-1 text-sm font-semibold text-text-link hover:underline",
|
|
213
213
|
children: [
|
|
214
|
-
|
|
214
|
+
e.name,
|
|
215
215
|
" ",
|
|
216
216
|
/* @__PURE__ */ y(g, { className: "h-3.5 w-3.5" })
|
|
217
217
|
]
|
|
218
218
|
}), /* @__PURE__ */ b("div", {
|
|
219
219
|
className: "mt-1 flex flex-wrap items-center gap-1.5",
|
|
220
220
|
children: [
|
|
221
|
-
|
|
221
|
+
e.provider && /* @__PURE__ */ y(i, { status: e.provider.status }),
|
|
222
222
|
/* @__PURE__ */ y("span", {
|
|
223
223
|
className: "rounded-full border border-border-subtle px-2 py-0.5 text-[11px] font-medium text-text-secondary",
|
|
224
|
-
children:
|
|
224
|
+
children: e.matchReason === "CAPABILITY" ? t("providers.insights.matchCapability", "Same capability") : t("providers.insights.matchCategory", "Same category")
|
|
225
225
|
}),
|
|
226
|
-
|
|
227
|
-
className:
|
|
228
|
-
children:
|
|
229
|
-
},
|
|
226
|
+
e.capabilities.map((t) => /* @__PURE__ */ y("span", {
|
|
227
|
+
className: m("rounded-full px-2 py-0.5 text-[11px]", e.sharedCapabilities.includes(t) ? "bg-[var(--color-accent-soft)] font-medium text-text-primary" : "bg-bg-sunken text-text-secondary"),
|
|
228
|
+
children: f(t.replace(/-/g, "_"))
|
|
229
|
+
}, t))
|
|
230
230
|
]
|
|
231
231
|
})]
|
|
232
232
|
}), /* @__PURE__ */ b("div", {
|
|
233
233
|
className: "text-right text-sm text-text-primary",
|
|
234
|
-
children: [
|
|
234
|
+
children: [r ? /* @__PURE__ */ y(D, { range: r }) : /* @__PURE__ */ y("span", {
|
|
235
235
|
className: "text-text-secondary",
|
|
236
|
-
children:
|
|
236
|
+
children: t("providers.insights.noPrice", "No price on record")
|
|
237
237
|
}), /* @__PURE__ */ y("p", {
|
|
238
238
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
239
|
-
children:
|
|
240
|
-
active:
|
|
241
|
-
tracked:
|
|
242
|
-
}) :
|
|
239
|
+
children: e.activeRelationshipCount > 0 ? t("providers.insights.inUse", "In use · {{active}} of {{tracked}} active", {
|
|
240
|
+
active: e.activeRelationshipCount,
|
|
241
|
+
tracked: e.trackedRelationshipCount
|
|
242
|
+
}) : e.trackedRelationshipCount > 0 ? t("providers.insights.trackedOnly", "{{tracked}} tracked, none active", { tracked: e.trackedRelationshipCount }) : t("providers.insights.notUsed", "Not used in this workspace")
|
|
243
243
|
})]
|
|
244
244
|
})]
|
|
245
|
-
}),
|
|
245
|
+
}), e.relationships.length > 0 && /* @__PURE__ */ y("ul", {
|
|
246
246
|
className: "mt-2 flex flex-wrap gap-2",
|
|
247
|
-
children:
|
|
247
|
+
children: e.relationships.map((e) => /* @__PURE__ */ y("li", { children: /* @__PURE__ */ b("button", {
|
|
248
248
|
type: "button",
|
|
249
|
-
onClick: () =>
|
|
249
|
+
onClick: () => n(`/relationships/${e.id}`),
|
|
250
250
|
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-2 py-1 text-xs text-text-primary hover:bg-bg-sunken",
|
|
251
251
|
children: [
|
|
252
252
|
/* @__PURE__ */ y("span", {
|
|
@@ -255,42 +255,41 @@ function O({ alt: n }) {
|
|
|
255
255
|
}),
|
|
256
256
|
/* @__PURE__ */ b("span", {
|
|
257
257
|
className: "tabular-nums text-text-secondary",
|
|
258
|
-
children: [
|
|
258
|
+
children: [u(e.amount, e.currency), p(e.interval)]
|
|
259
259
|
}),
|
|
260
|
-
/* @__PURE__ */ y(
|
|
260
|
+
/* @__PURE__ */ y(i, { status: e.status })
|
|
261
261
|
]
|
|
262
262
|
}) }, e.id))
|
|
263
263
|
})]
|
|
264
264
|
});
|
|
265
265
|
}
|
|
266
266
|
function k({ providerId: e }) {
|
|
267
|
-
let
|
|
268
|
-
return /* @__PURE__ */ y(
|
|
269
|
-
title:
|
|
270
|
-
description:
|
|
267
|
+
let i = c(), { data: a, isLoading: s, isError: l, refetch: u } = o(e);
|
|
268
|
+
return /* @__PURE__ */ y(r, {
|
|
269
|
+
title: i("providers.insights.alternativesTitle", "Alternatives"),
|
|
270
|
+
description: i("providers.insights.alternativesDescription", "Providers in your registry that cover the same need, the ones you already use first"),
|
|
271
271
|
children: /* @__PURE__ */ y(x, {
|
|
272
272
|
treatment: "metric",
|
|
273
273
|
className: "p-5",
|
|
274
274
|
"data-testid": "provider-alternatives",
|
|
275
|
-
children:
|
|
275
|
+
children: s ? /* @__PURE__ */ y(n, {
|
|
276
276
|
className: "min-h-[8rem]",
|
|
277
|
-
label:
|
|
278
|
-
}) :
|
|
277
|
+
label: i("providers.insights.alternativesLoading", "Finding alternatives…")
|
|
278
|
+
}) : l ? /* @__PURE__ */ y(t, {
|
|
279
279
|
className: "min-h-[8rem]",
|
|
280
|
-
title:
|
|
281
|
-
message:
|
|
282
|
-
onRetry: () => void
|
|
283
|
-
}) : !
|
|
280
|
+
title: i("providers.insights.alternativesErrorTitle", "Alternatives unavailable"),
|
|
281
|
+
message: i("providers.insights.alternativesError", "Could not look up alternative providers."),
|
|
282
|
+
onRetry: () => void u()
|
|
283
|
+
}) : !a || a.length === 0 ? /* @__PURE__ */ b("div", {
|
|
284
284
|
className: "flex items-start gap-3 text-sm text-text-secondary",
|
|
285
|
-
children: [/* @__PURE__ */ y(_, { className: "mt-0.5 h-4 w-4 shrink-0" }), /* @__PURE__ */ y("p", { children:
|
|
285
|
+
children: [/* @__PURE__ */ y(_, { className: "mt-0.5 h-4 w-4 shrink-0" }), /* @__PURE__ */ y("p", { children: i("providers.insights.alternativesEmpty", "No comparable providers yet. Tag providers with capabilities (for example capability:design) or give them a specific category to see alternatives here.") })]
|
|
286
286
|
}) : /* @__PURE__ */ y("ul", {
|
|
287
287
|
className: "divide-y divide-border-subtle",
|
|
288
|
-
children:
|
|
288
|
+
children: a.map((e) => /* @__PURE__ */ y(O, { alt: e }, e.providerId))
|
|
289
289
|
})
|
|
290
290
|
})
|
|
291
291
|
});
|
|
292
292
|
}
|
|
293
|
-
//#endregion
|
|
294
293
|
export { k as ProviderAlternatives, E as ProviderPaidPriceHistory };
|
|
295
294
|
|
|
296
295
|
//# sourceMappingURL=ProviderInsights.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProviderInsights.js","names":[],"sources":["../../../../src/subscriberbot/pages/providers/ProviderInsights.tsx"],"sourcesContent":["/**\n * Provider insights for the provider detail page (BOFF-4003)\n * @module subscriberbot/pages/providers\n *\n * Two sections that turn the provider page into a renewal decision surface:\n *\n * - `ProviderPaidPriceHistory` charts what this workspace has paid the\n * provider over time (`subProviderPriceHistory`): every recorded price of a\n * relationship with it, plus the invoices charged against them.\n * - `ProviderAlternatives` lists registry providers that could replace it\n * (`subProviderAlternatives`), ranked by shared capability tags, then\n * category, with providers the workspace already uses first.\n *\n * Amounts in different currencies are never drawn on one chart: the chart\n * shows the currency the backend summary picked (the most observed one).\n */\n\nimport { useMemo } from 'react';\nimport { ArrowRight, Shuffle } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { EmptyState } from '../../components/EmptyState';\nimport { LoadingView, ErrorView, Section } from '../../components/StateViews';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { PriceHistoryChart, type PriceChartSeries } from '../../components';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { useProviderAlternatives, useProviderPriceHistory } from '../../hooks/useSubscriberBotApi';\nimport { useTr } from '../../hooks/useTr';\nimport {\n formatCurrency,\n formatDate,\n formatEnumLabel,\n formatIntervalSuffix,\n} from '../../utils/formatters';\nimport { cn } from '../../utils/cn';\nimport type {\n SubPriceRange,\n SubProviderAlternative,\n SubProviderPriceHistory,\n SubProviderPriceSeries,\n} from '../../types';\n\n/** Points listed under the chart, newest first. */\nconst RECENT_POINTS = 6;\n\nfunction changeTone(percent: number | null): string {\n if (percent === null || percent === 0) return 'bg-bg-sunken text-text-secondary';\n return percent > 0\n ? 'bg-status-error-bg-subtle text-status-error-text'\n : 'bg-status-success-bg-subtle text-status-success-text';\n}\n\nfunction formatPercent(percent: number): string {\n return `${percent > 0 ? '+' : ''}${percent}%`;\n}\n\nfunction chartSeries(\n history: SubProviderPriceHistory,\n tr: ReturnType<typeof useTr>\n): PriceChartSeries[] {\n const currency = history.summary?.currency;\n if (!currency) return [];\n // A relationship's recorded prices are split per currency. When it moved to\n // another currency, that later price ends the displayed segment, exactly\n // like a non-recurring price does: the old currency's line must not run on.\n const otherCurrencyTimes = new Map<string, string[]>();\n for (const s of history.series) {\n if (s.source !== 'RELATIONSHIP' || s.currency === currency || !s.relationshipId) continue;\n const list = otherCurrencyTimes.get(s.relationshipId) ?? [];\n list.push(...s.points.map((p) => p.observedAt));\n otherCurrencyTimes.set(s.relationshipId, list);\n }\n return history.series\n .filter((s) => s.currency === currency)\n .map((s) => {\n // Recorded prices keep their non-recurring points (null value) so the\n // step line ends where a lifetime or usage-based price took over;\n // invoice dots without a monthly equivalent are simply not drawn.\n const points: PriceChartSeries['points'] = s.points\n .filter((p) => s.source !== 'INVOICE' || p.monthlyAmount !== null)\n .map((p) => ({\n at: p.observedAt,\n value: p.monthlyAmount,\n title: `${formatDate(p.observedAt)} · ${formatCurrency(p.amount, p.currency)}${formatIntervalSuffix(p.interval)}`,\n }));\n if (s.source === 'RELATIONSHIP' && s.relationshipId) {\n for (const at of otherCurrencyTimes.get(s.relationshipId) ?? []) {\n points.push({ at, value: null });\n }\n }\n return {\n key: s.key,\n label:\n s.source === 'INVOICE'\n ? tr('providers.insights.invoiceSeries', '{{label}} (invoices)', {\n label: s.label.replace(/ \\(invoices\\)$/, ''),\n })\n : s.label,\n mode: s.source === 'INVOICE' ? ('dots' as const) : ('step' as const),\n points,\n };\n })\n .filter((s) => s.points.some((p) => p.value !== null));\n}\n\n// ---------------------------------------------------------------------------\n// Price history — what this workspace has paid the provider\n// ---------------------------------------------------------------------------\nexport function ProviderPaidPriceHistory({ providerId }: { providerId: string }) {\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const { data, isLoading, isError, refetch } = useProviderPriceHistory(providerId);\n\n const series = useMemo(() => (data ? chartSeries(data, tr) : []), [data, tr]);\n const recent = useMemo(\n () => (data ? [...data.points].reverse().slice(0, RECENT_POINTS) : []),\n [data]\n );\n const summary = data?.summary ?? null;\n const currency = summary?.currency ?? 'USD';\n // Every relationship tracked under this provider contributes its latest\n // recorded price, so the headline is the workspace's total per month rather\n // than whichever relationship happens to come first.\n const latestTotal = useMemo(() => {\n // Each relationship's current price is its latest recorded point across\n // every currency; only those now priced in the display currency count.\n const latestByRelationship = new Map<string, { at: string; series: SubProviderPriceSeries }>();\n for (const s of data?.series ?? []) {\n const last = s.points[s.points.length - 1];\n if (s.source !== 'RELATIONSHIP' || !last) continue;\n const key = s.relationshipId ?? s.key;\n const seen = latestByRelationship.get(key);\n if (!seen || Date.parse(last.observedAt) > Date.parse(seen.at))\n latestByRelationship.set(key, { at: last.observedAt, series: s });\n }\n const recorded = [...latestByRelationship.values()]\n .map((v) => v.series)\n .filter((s) => s.currency === currency && s.latestMonthlyAmount != null);\n if (recorded.length === 0) return null;\n const amount = recorded.reduce((sum, s) => sum + (s.latestMonthlyAmount ?? 0), 0);\n return { amount: Math.round(amount * 100) / 100, count: recorded.length };\n }, [data, currency]);\n\n return (\n <Section\n title={tr('providers.insights.priceHistoryTitle', 'Your price history')}\n description={tr(\n 'providers.insights.priceHistoryDescription',\n 'What this workspace has paid this provider over time, per month'\n )}\n >\n <GlassCard treatment=\"metric\" className=\"p-5\" data-testid=\"provider-price-history\">\n {isLoading ? (\n <LoadingView\n className=\"min-h-[10rem]\"\n label={tr('providers.insights.priceHistoryLoading', 'Loading price history…')}\n />\n ) : isError ? (\n <ErrorView\n className=\"min-h-[10rem]\"\n title={tr('providers.insights.priceHistoryErrorTitle', 'Price history unavailable')}\n message={tr(\n 'providers.insights.priceHistoryError',\n 'Could not load what this workspace has paid this provider.'\n )}\n onRetry={() => void refetch()}\n />\n ) : !data || !summary ? (\n <EmptyState\n illustration=\"empty-data\"\n title={tr('providers.insights.priceHistoryEmptyTitle', 'No prices recorded yet')}\n description={tr(\n 'providers.insights.priceHistoryEmpty',\n 'Link a relationship to this provider and its price, and every later change, will be charted here.'\n )}\n />\n ) : (\n <>\n <div className=\"flex flex-wrap items-start gap-x-8 gap-y-3\">\n <div>\n <p className=\"text-xs text-text-secondary\">\n {latestTotal && latestTotal.count > 1\n ? tr(\n 'providers.insights.latestMonthlyTotal',\n 'Latest monthly price across {{count}} relationships',\n { count: latestTotal.count }\n )\n : tr('providers.insights.latestMonthly', 'Latest monthly price')}\n </p>\n <p className=\"text-2xl font-bold tabular-nums text-text-primary\">\n {latestTotal ? formatCurrency(latestTotal.amount, currency) : '—'}\n <span className=\"text-sm font-normal text-text-secondary\">/mo</span>\n </p>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('providers.insights.range', 'Range paid')}\n </p>\n <p className=\"text-sm font-medium tabular-nums text-text-primary\">\n {summary.minMonthlyAmount != null && summary.maxMonthlyAmount != null\n ? `${formatCurrency(summary.minMonthlyAmount, currency)} – ${formatCurrency(summary.maxMonthlyAmount, currency)}`\n : '—'}\n </p>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('providers.insights.priceChanges', 'Price changes')}\n </p>\n <p className=\"text-sm font-medium tabular-nums text-text-primary\">\n {summary.priceChangeCount}\n </p>\n </div>\n {summary.latestChangePercent != null && (\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('providers.insights.latestChange', 'Latest change')}\n </p>\n <span\n className={cn(\n 'mt-0.5 inline-block rounded-full px-2 py-0.5 text-xs font-medium tabular-nums',\n changeTone(summary.latestChangePercent)\n )}\n >\n {formatPercent(summary.latestChangePercent)}\n {summary.latestChangeAt && ` · ${formatDate(summary.latestChangeAt)}`}\n </span>\n </div>\n )}\n </div>\n\n {series.length > 0 ? (\n <PriceHistoryChart\n className=\"mt-4\"\n series={series}\n now={new Date()}\n ariaLabel={tr(\n 'providers.insights.chartLabel',\n 'Monthly price paid over time, in {{currency}}',\n { currency }\n )}\n valueFormat={(n, digits) =>\n formatCurrency(n, currency, {\n minimumFractionDigits: digits,\n maximumFractionDigits: digits,\n })\n }\n dateFormat={(d) =>\n formatDate(d, { day: undefined, month: 'short', year: 'numeric' })\n }\n />\n ) : (\n <p className=\"mt-4 text-sm text-text-secondary\">\n {tr(\n 'providers.insights.noRecurring',\n 'These prices are not recurring, so there is no monthly trend to chart.'\n )}\n </p>\n )}\n\n <ul className=\"mt-4 divide-y divide-border-subtle border-t border-border-subtle\">\n {recent.map((point) => (\n <li\n key={point.id}\n className=\"flex flex-wrap items-center justify-between gap-2 py-2 text-sm\"\n >\n <span className=\"flex min-w-0 items-center gap-2\">\n <span className=\"w-24 shrink-0 tabular-nums text-text-secondary\">\n {formatDate(point.observedAt)}\n </span>\n {point.relationshipId ? (\n <button\n type=\"button\"\n onClick={() => navigateTo(`/relationships/${point.relationshipId}`)}\n className=\"truncate text-text-link hover:underline\"\n >\n {point.label ?? tr('providers.insights.untitled', 'Untitled')}\n </button>\n ) : (\n <span className=\"truncate text-text-primary\">\n {point.label ??\n tr('providers.insights.removedRelationship', 'Removed relationship')}\n </span>\n )}\n <span className=\"rounded-full bg-bg-sunken px-2 py-0.5 text-[11px] text-text-secondary\">\n {point.source === 'INVOICE'\n ? tr('providers.insights.sourceInvoice', 'Invoice')\n : tr('providers.insights.sourceRecorded', 'Recorded price')}\n </span>\n </span>\n <span className=\"font-medium tabular-nums text-text-primary\">\n {formatCurrency(point.amount, point.currency)}\n <span className=\"text-xs font-normal text-text-secondary\">\n {formatIntervalSuffix(point.interval)}\n </span>\n </span>\n </li>\n ))}\n </ul>\n </>\n )}\n </GlassCard>\n </Section>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Alternatives — registry providers that could replace this one\n// ---------------------------------------------------------------------------\nfunction PriceRangeText({ range }: { range: SubPriceRange }) {\n const tr = useTr();\n const value =\n range.minMonthlyAmount === range.maxMonthlyAmount\n ? formatCurrency(range.minMonthlyAmount, range.currency)\n : `${formatCurrency(range.minMonthlyAmount, range.currency)} – ${formatCurrency(range.maxMonthlyAmount, range.currency)}`;\n return (\n <span className=\"tabular-nums\">\n {value}\n <span className=\"text-xs text-text-secondary\">/mo</span>{' '}\n <span className=\"text-xs text-text-secondary\">\n {range.basis === 'PLANS'\n ? tr('providers.insights.basisPlans', '({{count}} plans)', { count: range.count })\n : tr('providers.insights.basisRelationships', '(what you pay)')}\n </span>\n </span>\n );\n}\n\nfunction AlternativeRow({ alt }: { alt: SubProviderAlternative }) {\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const range = alt.priceRanges[0];\n return (\n <li className=\"py-4 first:pt-0 last:pb-0\" data-testid=\"provider-alternative\">\n <div className=\"flex flex-wrap items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/providers/${alt.providerId}`)}\n className=\"inline-flex items-center gap-1 text-sm font-semibold text-text-link hover:underline\"\n >\n {alt.name} <ArrowRight className=\"h-3.5 w-3.5\" />\n </button>\n <div className=\"mt-1 flex flex-wrap items-center gap-1.5\">\n {alt.provider && <StatusBadge status={alt.provider.status} />}\n <span className=\"rounded-full border border-border-subtle px-2 py-0.5 text-[11px] font-medium text-text-secondary\">\n {alt.matchReason === 'CAPABILITY'\n ? tr('providers.insights.matchCapability', 'Same capability')\n : tr('providers.insights.matchCategory', 'Same category')}\n </span>\n {alt.capabilities.map((cap) => (\n <span\n key={cap}\n className={cn(\n 'rounded-full px-2 py-0.5 text-[11px]',\n alt.sharedCapabilities.includes(cap)\n ? 'bg-[var(--color-accent-soft)] font-medium text-text-primary'\n : 'bg-bg-sunken text-text-secondary'\n )}\n >\n {formatEnumLabel(cap.replace(/-/g, '_'))}\n </span>\n ))}\n </div>\n </div>\n <div className=\"text-right text-sm text-text-primary\">\n {range ? (\n <PriceRangeText range={range} />\n ) : (\n <span className=\"text-text-secondary\">\n {tr('providers.insights.noPrice', 'No price on record')}\n </span>\n )}\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n {alt.activeRelationshipCount > 0\n ? tr('providers.insights.inUse', 'In use · {{active}} of {{tracked}} active', {\n active: alt.activeRelationshipCount,\n tracked: alt.trackedRelationshipCount,\n })\n : alt.trackedRelationshipCount > 0\n ? tr('providers.insights.trackedOnly', '{{tracked}} tracked, none active', {\n tracked: alt.trackedRelationshipCount,\n })\n : tr('providers.insights.notUsed', 'Not used in this workspace')}\n </p>\n </div>\n </div>\n {alt.relationships.length > 0 && (\n <ul className=\"mt-2 flex flex-wrap gap-2\">\n {alt.relationships.map((rel) => (\n <li key={rel.id}>\n <button\n type=\"button\"\n onClick={() => navigateTo(`/relationships/${rel.id}`)}\n className=\"inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-2 py-1 text-xs text-text-primary hover:bg-bg-sunken\"\n >\n <span className=\"truncate\">{rel.label}</span>\n <span className=\"tabular-nums text-text-secondary\">\n {formatCurrency(rel.amount, rel.currency)}\n {formatIntervalSuffix(rel.interval)}\n </span>\n <StatusBadge status={rel.status} />\n </button>\n </li>\n ))}\n </ul>\n )}\n </li>\n );\n}\n\nexport function ProviderAlternatives({ providerId }: { providerId: string }) {\n const tr = useTr();\n const { data, isLoading, isError, refetch } = useProviderAlternatives(providerId);\n\n return (\n <Section\n title={tr('providers.insights.alternativesTitle', 'Alternatives')}\n description={tr(\n 'providers.insights.alternativesDescription',\n 'Providers in your registry that cover the same need, the ones you already use first'\n )}\n >\n <GlassCard treatment=\"metric\" className=\"p-5\" data-testid=\"provider-alternatives\">\n {isLoading ? (\n <LoadingView\n className=\"min-h-[8rem]\"\n label={tr('providers.insights.alternativesLoading', 'Finding alternatives…')}\n />\n ) : isError ? (\n <ErrorView\n className=\"min-h-[8rem]\"\n title={tr('providers.insights.alternativesErrorTitle', 'Alternatives unavailable')}\n message={tr(\n 'providers.insights.alternativesError',\n 'Could not look up alternative providers.'\n )}\n onRetry={() => void refetch()}\n />\n ) : !data || data.length === 0 ? (\n <div className=\"flex items-start gap-3 text-sm text-text-secondary\">\n <Shuffle className=\"mt-0.5 h-4 w-4 shrink-0\" />\n <p>\n {tr(\n 'providers.insights.alternativesEmpty',\n 'No comparable providers yet. Tag providers with capabilities (for example capability:design) or give them a specific category to see alternatives here.'\n )}\n </p>\n </div>\n ) : (\n <ul className=\"divide-y divide-border-subtle\">\n {data.map((alt) => (\n <AlternativeRow key={alt.providerId} alt={alt} />\n ))}\n </ul>\n )}\n </GlassCard>\n </Section>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA0CA,IAAM,IAAgB;AAEtB,SAAS,EAAW,GAAgC;CAElD,OADI,MAAY,QAAQ,MAAY,IAAU,qCACvC,IAAU,IACb,qDACA;AACN;AAEA,SAAS,EAAc,GAAyB;CAC9C,OAAO,GAAG,IAAU,IAAI,MAAM,KAAK,EAAQ;AAC7C;AAEA,SAAS,EACP,GACA,GACoB;CACpB,IAAM,IAAW,EAAQ,SAAS;CAClC,IAAI,CAAC,GAAU,OAAO,CAAC;CAIvB,IAAM,oBAAqB,IAAI,IAAsB;CACrD,KAAK,IAAM,KAAK,EAAQ,QAAQ;EAC9B,IAAI,EAAE,WAAW,kBAAkB,EAAE,aAAa,KAAY,CAAC,EAAE,gBAAgB;EACjF,IAAM,IAAO,EAAmB,IAAI,EAAE,cAAc,KAAK,CAAC;EAE1D,AADA,EAAK,KAAK,GAAG,EAAE,OAAO,KAAK,MAAM,EAAE,UAAU,CAAC,GAC9C,EAAmB,IAAI,EAAE,gBAAgB,CAAI;CAC/C;CACA,OAAO,EAAQ,OACZ,Q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Af,CACE,kBAAC,GAAD,EAAS,WAAU,0BAA2B,CAAA,GAC9C,kBAAC,KAAD,EAAA,UACG,EACC,wCACA,yJACF,EACC,CAAA,CACA;QAEL,kBAAC,MAAD;IAAI,WAAU;cACX,EAAK,KAAK,MACT,kBAAC,GAAD,EAA0C,OAAM,GAA3B,EAAI,UAAuB,CACjD;GACC,CAAA;EAEG,CAAA;CACJ,CAAA;AAEb"}
|
|
1
|
+
{"version":3,"file":"ProviderInsights.js","names":["EmptyState","_Fragment","EmptyState$1","Fragment$1","RECENT_POINTS","changeTone","percent","formatPercent","chartSeries","currency","history","otherCurrencyTimes","s","list","p","points","formatDate","formatCurrency","formatIntervalSuffix","at","tr","ProviderPaidPriceHistory","useTr","useSubscriberBot","useProviderPriceHistory","providerId","series","useMemo","data","recent","summary","latestTotal","latestByRelationship","last","key","seen","recorded","v","amount","sum","Section","GlassCard","isLoading","LoadingView","isError","ErrorView","refetch","cn","PriceHistoryChart","n","digits","d","point","navigateTo","PriceRangeText","value","range","AlternativeRow","alt","ArrowRight","StatusBadge","cap","formatEnumLabel","rel","ProviderAlternatives","useProviderAlternatives","Shuffle"],"sources":["../../../../src/subscriberbot/pages/providers/ProviderInsights.tsx"],"sourcesContent":["/**\n * Provider insights for the provider detail page (BOFF-4003)\n * @module subscriberbot/pages/providers\n *\n * Two sections that turn the provider page into a renewal decision surface:\n *\n * - `ProviderPaidPriceHistory` charts what this workspace has paid the\n * provider over time (`subProviderPriceHistory`): every recorded price of a\n * relationship with it, plus the invoices charged against them.\n * - `ProviderAlternatives` lists registry providers that could replace it\n * (`subProviderAlternatives`), ranked by shared capability tags, then\n * category, with providers the workspace already uses first.\n *\n * Amounts in different currencies are never drawn on one chart: the chart\n * shows the currency the backend summary picked (the most observed one).\n */\n\nimport { useMemo } from 'react';\nimport { ArrowRight, Shuffle } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { EmptyState } from '../../components/EmptyState';\nimport { LoadingView, ErrorView, Section } from '../../components/StateViews';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { PriceHistoryChart, type PriceChartSeries } from '../../components';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { useProviderAlternatives, useProviderPriceHistory } from '../../hooks/useSubscriberBotApi';\nimport { useTr } from '../../hooks/useTr';\nimport {\n formatCurrency,\n formatDate,\n formatEnumLabel,\n formatIntervalSuffix,\n} from '../../utils/formatters';\nimport { cn } from '../../utils/cn';\nimport type {\n SubPriceRange,\n SubProviderAlternative,\n SubProviderPriceHistory,\n SubProviderPriceSeries,\n} from '../../types';\n\n/** Points listed under the chart, newest first. */\nconst RECENT_POINTS = 6;\n\nfunction changeTone(percent: number | null): string {\n if (percent === null || percent === 0) return 'bg-bg-sunken text-text-secondary';\n return percent > 0\n ? 'bg-status-error-bg-subtle text-status-error-text'\n : 'bg-status-success-bg-subtle text-status-success-text';\n}\n\nfunction formatPercent(percent: number): string {\n return `${percent > 0 ? '+' : ''}${percent}%`;\n}\n\nfunction chartSeries(\n history: SubProviderPriceHistory,\n tr: ReturnType<typeof useTr>\n): PriceChartSeries[] {\n const currency = history.summary?.currency;\n if (!currency) return [];\n // A relationship's recorded prices are split per currency. When it moved to\n // another currency, that later price ends the displayed segment, exactly\n // like a non-recurring price does: the old currency's line must not run on.\n const otherCurrencyTimes = new Map<string, string[]>();\n for (const s of history.series) {\n if (s.source !== 'RELATIONSHIP' || s.currency === currency || !s.relationshipId) continue;\n const list = otherCurrencyTimes.get(s.relationshipId) ?? [];\n list.push(...s.points.map((p) => p.observedAt));\n otherCurrencyTimes.set(s.relationshipId, list);\n }\n return history.series\n .filter((s) => s.currency === currency)\n .map((s) => {\n // Recorded prices keep their non-recurring points (null value) so the\n // step line ends where a lifetime or usage-based price took over;\n // invoice dots without a monthly equivalent are simply not drawn.\n const points: PriceChartSeries['points'] = s.points\n .filter((p) => s.source !== 'INVOICE' || p.monthlyAmount !== null)\n .map((p) => ({\n at: p.observedAt,\n value: p.monthlyAmount,\n title: `${formatDate(p.observedAt)} · ${formatCurrency(p.amount, p.currency)}${formatIntervalSuffix(p.interval)}`,\n }));\n if (s.source === 'RELATIONSHIP' && s.relationshipId) {\n for (const at of otherCurrencyTimes.get(s.relationshipId) ?? []) {\n points.push({ at, value: null });\n }\n }\n return {\n key: s.key,\n label:\n s.source === 'INVOICE'\n ? tr('providers.insights.invoiceSeries', '{{label}} (invoices)', {\n label: s.label.replace(/ \\(invoices\\)$/, ''),\n })\n : s.label,\n mode: s.source === 'INVOICE' ? ('dots' as const) : ('step' as const),\n points,\n };\n })\n .filter((s) => s.points.some((p) => p.value !== null));\n}\n\n// ---------------------------------------------------------------------------\n// Price history — what this workspace has paid the provider\n// ---------------------------------------------------------------------------\nexport function ProviderPaidPriceHistory({ providerId }: { providerId: string }) {\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const { data, isLoading, isError, refetch } = useProviderPriceHistory(providerId);\n\n const series = useMemo(() => (data ? chartSeries(data, tr) : []), [data, tr]);\n const recent = useMemo(\n () => (data ? [...data.points].reverse().slice(0, RECENT_POINTS) : []),\n [data]\n );\n const summary = data?.summary ?? null;\n const currency = summary?.currency ?? 'USD';\n // Every relationship tracked under this provider contributes its latest\n // recorded price, so the headline is the workspace's total per month rather\n // than whichever relationship happens to come first.\n const latestTotal = useMemo(() => {\n // Each relationship's current price is its latest recorded point across\n // every currency; only those now priced in the display currency count.\n const latestByRelationship = new Map<string, { at: string; series: SubProviderPriceSeries }>();\n for (const s of data?.series ?? []) {\n const last = s.points[s.points.length - 1];\n if (s.source !== 'RELATIONSHIP' || !last) continue;\n const key = s.relationshipId ?? s.key;\n const seen = latestByRelationship.get(key);\n if (!seen || Date.parse(last.observedAt) > Date.parse(seen.at))\n latestByRelationship.set(key, { at: last.observedAt, series: s });\n }\n const recorded = [...latestByRelationship.values()]\n .map((v) => v.series)\n .filter((s) => s.currency === currency && s.latestMonthlyAmount != null);\n if (recorded.length === 0) return null;\n const amount = recorded.reduce((sum, s) => sum + (s.latestMonthlyAmount ?? 0), 0);\n return { amount: Math.round(amount * 100) / 100, count: recorded.length };\n }, [data, currency]);\n\n return (\n <Section\n title={tr('providers.insights.priceHistoryTitle', 'Your price history')}\n description={tr(\n 'providers.insights.priceHistoryDescription',\n 'What this workspace has paid this provider over time, per month'\n )}\n >\n <GlassCard treatment=\"metric\" className=\"p-5\" data-testid=\"provider-price-history\">\n {isLoading ? (\n <LoadingView\n className=\"min-h-[10rem]\"\n label={tr('providers.insights.priceHistoryLoading', 'Loading price history…')}\n />\n ) : isError ? (\n <ErrorView\n className=\"min-h-[10rem]\"\n title={tr('providers.insights.priceHistoryErrorTitle', 'Price history unavailable')}\n message={tr(\n 'providers.insights.priceHistoryError',\n 'Could not load what this workspace has paid this provider.'\n )}\n onRetry={() => void refetch()}\n />\n ) : !data || !summary ? (\n <EmptyState\n illustration=\"empty-data\"\n title={tr('providers.insights.priceHistoryEmptyTitle', 'No prices recorded yet')}\n description={tr(\n 'providers.insights.priceHistoryEmpty',\n 'Link a relationship to this provider and its price, and every later change, will be charted here.'\n )}\n />\n ) : (\n <>\n <div className=\"flex flex-wrap items-start gap-x-8 gap-y-3\">\n <div>\n <p className=\"text-xs text-text-secondary\">\n {latestTotal && latestTotal.count > 1\n ? tr(\n 'providers.insights.latestMonthlyTotal',\n 'Latest monthly price across {{count}} relationships',\n { count: latestTotal.count }\n )\n : tr('providers.insights.latestMonthly', 'Latest monthly price')}\n </p>\n <p className=\"text-2xl font-bold tabular-nums text-text-primary\">\n {latestTotal ? formatCurrency(latestTotal.amount, currency) : '—'}\n <span className=\"text-sm font-normal text-text-secondary\">/mo</span>\n </p>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('providers.insights.range', 'Range paid')}\n </p>\n <p className=\"text-sm font-medium tabular-nums text-text-primary\">\n {summary.minMonthlyAmount != null && summary.maxMonthlyAmount != null\n ? `${formatCurrency(summary.minMonthlyAmount, currency)} – ${formatCurrency(summary.maxMonthlyAmount, currency)}`\n : '—'}\n </p>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('providers.insights.priceChanges', 'Price changes')}\n </p>\n <p className=\"text-sm font-medium tabular-nums text-text-primary\">\n {summary.priceChangeCount}\n </p>\n </div>\n {summary.latestChangePercent != null && (\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('providers.insights.latestChange', 'Latest change')}\n </p>\n <span\n className={cn(\n 'mt-0.5 inline-block rounded-full px-2 py-0.5 text-xs font-medium tabular-nums',\n changeTone(summary.latestChangePercent)\n )}\n >\n {formatPercent(summary.latestChangePercent)}\n {summary.latestChangeAt && ` · ${formatDate(summary.latestChangeAt)}`}\n </span>\n </div>\n )}\n </div>\n\n {series.length > 0 ? (\n <PriceHistoryChart\n className=\"mt-4\"\n series={series}\n now={new Date()}\n ariaLabel={tr(\n 'providers.insights.chartLabel',\n 'Monthly price paid over time, in {{currency}}',\n { currency }\n )}\n valueFormat={(n, digits) =>\n formatCurrency(n, currency, {\n minimumFractionDigits: digits,\n maximumFractionDigits: digits,\n })\n }\n dateFormat={(d) =>\n formatDate(d, { day: undefined, month: 'short', year: 'numeric' })\n }\n />\n ) : (\n <p className=\"mt-4 text-sm text-text-secondary\">\n {tr(\n 'providers.insights.noRecurring',\n 'These prices are not recurring, so there is no monthly trend to chart.'\n )}\n </p>\n )}\n\n <ul className=\"mt-4 divide-y divide-border-subtle border-t border-border-subtle\">\n {recent.map((point) => (\n <li\n key={point.id}\n className=\"flex flex-wrap items-center justify-between gap-2 py-2 text-sm\"\n >\n <span className=\"flex min-w-0 items-center gap-2\">\n <span className=\"w-24 shrink-0 tabular-nums text-text-secondary\">\n {formatDate(point.observedAt)}\n </span>\n {point.relationshipId ? (\n <button\n type=\"button\"\n onClick={() => navigateTo(`/relationships/${point.relationshipId}`)}\n className=\"truncate text-text-link hover:underline\"\n >\n {point.label ?? tr('providers.insights.untitled', 'Untitled')}\n </button>\n ) : (\n <span className=\"truncate text-text-primary\">\n {point.label ??\n tr('providers.insights.removedRelationship', 'Removed relationship')}\n </span>\n )}\n <span className=\"rounded-full bg-bg-sunken px-2 py-0.5 text-[11px] text-text-secondary\">\n {point.source === 'INVOICE'\n ? tr('providers.insights.sourceInvoice', 'Invoice')\n : tr('providers.insights.sourceRecorded', 'Recorded price')}\n </span>\n </span>\n <span className=\"font-medium tabular-nums text-text-primary\">\n {formatCurrency(point.amount, point.currency)}\n <span className=\"text-xs font-normal text-text-secondary\">\n {formatIntervalSuffix(point.interval)}\n </span>\n </span>\n </li>\n ))}\n </ul>\n </>\n )}\n </GlassCard>\n </Section>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Alternatives — registry providers that could replace this one\n// ---------------------------------------------------------------------------\nfunction PriceRangeText({ range }: { range: SubPriceRange }) {\n const tr = useTr();\n const value =\n range.minMonthlyAmount === range.maxMonthlyAmount\n ? formatCurrency(range.minMonthlyAmount, range.currency)\n : `${formatCurrency(range.minMonthlyAmount, range.currency)} – ${formatCurrency(range.maxMonthlyAmount, range.currency)}`;\n return (\n <span className=\"tabular-nums\">\n {value}\n <span className=\"text-xs text-text-secondary\">/mo</span>{' '}\n <span className=\"text-xs text-text-secondary\">\n {range.basis === 'PLANS'\n ? tr('providers.insights.basisPlans', '({{count}} plans)', { count: range.count })\n : tr('providers.insights.basisRelationships', '(what you pay)')}\n </span>\n </span>\n );\n}\n\nfunction AlternativeRow({ alt }: { alt: SubProviderAlternative }) {\n const tr = useTr();\n const { navigateTo } = useSubscriberBot();\n const range = alt.priceRanges[0];\n return (\n <li className=\"py-4 first:pt-0 last:pb-0\" data-testid=\"provider-alternative\">\n <div className=\"flex flex-wrap items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/providers/${alt.providerId}`)}\n className=\"inline-flex items-center gap-1 text-sm font-semibold text-text-link hover:underline\"\n >\n {alt.name} <ArrowRight className=\"h-3.5 w-3.5\" />\n </button>\n <div className=\"mt-1 flex flex-wrap items-center gap-1.5\">\n {alt.provider && <StatusBadge status={alt.provider.status} />}\n <span className=\"rounded-full border border-border-subtle px-2 py-0.5 text-[11px] font-medium text-text-secondary\">\n {alt.matchReason === 'CAPABILITY'\n ? tr('providers.insights.matchCapability', 'Same capability')\n : tr('providers.insights.matchCategory', 'Same category')}\n </span>\n {alt.capabilities.map((cap) => (\n <span\n key={cap}\n className={cn(\n 'rounded-full px-2 py-0.5 text-[11px]',\n alt.sharedCapabilities.includes(cap)\n ? 'bg-[var(--color-accent-soft)] font-medium text-text-primary'\n : 'bg-bg-sunken text-text-secondary'\n )}\n >\n {formatEnumLabel(cap.replace(/-/g, '_'))}\n </span>\n ))}\n </div>\n </div>\n <div className=\"text-right text-sm text-text-primary\">\n {range ? (\n <PriceRangeText range={range} />\n ) : (\n <span className=\"text-text-secondary\">\n {tr('providers.insights.noPrice', 'No price on record')}\n </span>\n )}\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n {alt.activeRelationshipCount > 0\n ? tr('providers.insights.inUse', 'In use · {{active}} of {{tracked}} active', {\n active: alt.activeRelationshipCount,\n tracked: alt.trackedRelationshipCount,\n })\n : alt.trackedRelationshipCount > 0\n ? tr('providers.insights.trackedOnly', '{{tracked}} tracked, none active', {\n tracked: alt.trackedRelationshipCount,\n })\n : tr('providers.insights.notUsed', 'Not used in this workspace')}\n </p>\n </div>\n </div>\n {alt.relationships.length > 0 && (\n <ul className=\"mt-2 flex flex-wrap gap-2\">\n {alt.relationships.map((rel) => (\n <li key={rel.id}>\n <button\n type=\"button\"\n onClick={() => navigateTo(`/relationships/${rel.id}`)}\n className=\"inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-2 py-1 text-xs text-text-primary hover:bg-bg-sunken\"\n >\n <span className=\"truncate\">{rel.label}</span>\n <span className=\"tabular-nums text-text-secondary\">\n {formatCurrency(rel.amount, rel.currency)}\n {formatIntervalSuffix(rel.interval)}\n </span>\n <StatusBadge status={rel.status} />\n </button>\n </li>\n ))}\n </ul>\n )}\n </li>\n );\n}\n\nexport function ProviderAlternatives({ providerId }: { providerId: string }) {\n const tr = useTr();\n const { data, isLoading, isError, refetch } = useProviderAlternatives(providerId);\n\n return (\n <Section\n title={tr('providers.insights.alternativesTitle', 'Alternatives')}\n description={tr(\n 'providers.insights.alternativesDescription',\n 'Providers in your registry that cover the same need, the ones you already use first'\n )}\n >\n <GlassCard treatment=\"metric\" className=\"p-5\" data-testid=\"provider-alternatives\">\n {isLoading ? (\n <LoadingView\n className=\"min-h-[8rem]\"\n label={tr('providers.insights.alternativesLoading', 'Finding alternatives…')}\n />\n ) : isError ? (\n <ErrorView\n className=\"min-h-[8rem]\"\n title={tr('providers.insights.alternativesErrorTitle', 'Alternatives unavailable')}\n message={tr(\n 'providers.insights.alternativesError',\n 'Could not look up alternative providers.'\n )}\n onRetry={() => void refetch()}\n />\n ) : !data || data.length === 0 ? (\n <div className=\"flex items-start gap-3 text-sm text-text-secondary\">\n <Shuffle className=\"mt-0.5 h-4 w-4 shrink-0\" />\n <p>\n {tr(\n 'providers.insights.alternativesEmpty',\n 'No comparable providers yet. Tag providers with capabilities (for example capability:design) or give them a specific category to see alternatives here.'\n )}\n </p>\n </div>\n ) : (\n <ul className=\"divide-y divide-border-subtle\">\n {data.map((alt) => (\n <AlternativeRow key={alt.providerId} alt={alt} />\n ))}\n </ul>\n )}\n </GlassCard>\n </Section>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA0CA,IAAMI,IAAgB;AAEtB,SAASC,EAAW,GAAgC;CAElD,OADIC,MAAY,QAAQA,MAAY,IAAU,qCACvCA,IAAU,IACb,qDACA;AACN;AAEA,SAASC,EAAc,GAAyB;CAC9C,OAAO,GAAGD,IAAU,IAAI,MAAM,KAAKA,EAAQ;AAC7C;AAEA,SAASE,EACP,GACA,GACoB;CACpB,IAAMC,IAAWC,EAAQ,SAAS;CAClC,IAAI,CAACD,GAAU,OAAO,CAAC;CAIvB,IAAME,oBAAqB,IAAI,IAAsB;CACrD,KAAK,IAAMC,KAAK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Q,EAAK,KAAK,MACT,kBAAC6B,GAAD,EAA0C,OAAM,GAA3BC,EAAI,UAAuB,CACjD;GACC,CAAA;EAEG,CAAA;CACJ,CAAA;AAEb"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export declare function ProviderNewPage(): import(
|
|
2
|
-
//# sourceMappingURL=ProviderNewPage.d.ts.map
|
|
1
|
+
export declare function ProviderNewPage(): import('react').JSX.Element;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { useFormatters as e } from "../../hooks/useFormatters.js";
|
|
2
|
+
import { useFormError as t } from "../../hooks/useFormError.js";
|
|
3
|
+
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
|
+
import { useSubscriberBot as r } from "../../context/SubscriberBotContext.js";
|
|
5
|
+
import { useCreateProvider as i } from "../../hooks/useSubscriberBotApi.js";
|
|
6
|
+
import { useTr as a } from "../../hooks/useTr.js";
|
|
7
|
+
import { cn as o } from "../../utils/cn.js";
|
|
8
8
|
import { useState as s } from "react";
|
|
9
9
|
import { ArrowLeft as c, Building2 as l, Sparkles as u } from "lucide-react";
|
|
10
10
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
11
11
|
import { GlassCard as p, PagePurpose as m } from "@burdenoff/fe-libs/ui";
|
|
12
|
-
|
|
12
|
+
// src/subscriberbot/pages/providers/ProviderNewPage.tsx
|
|
13
13
|
var h = [
|
|
14
14
|
"SAAS",
|
|
15
15
|
"AI_SERVICE",
|
|
@@ -46,8 +46,8 @@ var h = [
|
|
|
46
46
|
OTHER: "providers.categories.other"
|
|
47
47
|
}, _ = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", v = "mb-1 block text-xs font-medium text-text-secondary";
|
|
48
48
|
function y() {
|
|
49
|
-
let { formatEnumLabel: y } =
|
|
50
|
-
return /* @__PURE__ */ f(
|
|
49
|
+
let { formatEnumLabel: y } = e(), b = a(), { navigateTo: x } = r(), S = i(), [C, w] = s(""), [T, E] = s("SAAS"), [D, O] = s(""), [k, A] = s(""), [j, M] = s(""), [N, P] = s(""), [F, I] = s(""), [L, R, z, B] = t(), V = F.split(",").map((e) => e.trim()).filter(Boolean);
|
|
50
|
+
return /* @__PURE__ */ f(n, {
|
|
51
51
|
title: b("providers.new.title", "Add provider"),
|
|
52
52
|
description: b("providers.new.description", "Register a new provider in the registry"),
|
|
53
53
|
actions: /* @__PURE__ */ f("button", {
|
|
@@ -131,7 +131,7 @@ function y() {
|
|
|
131
131
|
type: "button",
|
|
132
132
|
"aria-pressed": t,
|
|
133
133
|
onClick: () => E(e),
|
|
134
|
-
className:
|
|
134
|
+
className: o("rounded-full border px-3 py-1.5 text-xs font-medium transition-colors", t ? "border-transparent bg-action-primary-bg text-action-primary-text" : "border-border-subtle bg-bg-surface text-text-secondary hover:bg-bg-sunken hover:text-text-primary"),
|
|
135
135
|
children: b(g[e], y(e))
|
|
136
136
|
}, e);
|
|
137
137
|
})
|
|
@@ -291,7 +291,6 @@ function y() {
|
|
|
291
291
|
})]
|
|
292
292
|
});
|
|
293
293
|
}
|
|
294
|
-
//#endregion
|
|
295
294
|
export { y as ProviderNewPage };
|
|
296
295
|
|
|
297
296
|
//# sourceMappingURL=ProviderNewPage.js.map
|