@burdenoff/microfe-atheletebridge 2026.1107.1 → 2026.1109.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/atheletebridge/AthleteBridgeRoot.d.ts +0 -2
- package/dist/atheletebridge/AthleteBridgeRoot.js +10 -7
- package/dist/atheletebridge/AthleteBridgeRoot.js.map +1 -1
- package/dist/atheletebridge/AthleteBridgeRoutes.d.ts +0 -2
- package/dist/atheletebridge/AthleteBridgeRoutes.js +1 -2
- package/dist/atheletebridge/AthleteBridgeRoutes.js.map +1 -1
- package/dist/atheletebridge/admin/AdminDashboardPage.d.ts +0 -2
- package/dist/atheletebridge/admin/AdminDashboardPage.js +96 -97
- package/dist/atheletebridge/admin/AdminDashboardPage.js.map +1 -1
- package/dist/atheletebridge/admin/AdminRoot.d.ts +0 -2
- package/dist/atheletebridge/admin/AdminRoot.js +2 -3
- package/dist/atheletebridge/admin/AdminRoot.js.map +1 -1
- package/dist/atheletebridge/admin/index.d.ts +0 -1
- package/dist/atheletebridge/admin/index.js +3 -2
- package/dist/atheletebridge/components/AthleteSelect.d.ts +1 -2
- package/dist/atheletebridge/components/AthleteSelect.js +8 -9
- package/dist/atheletebridge/components/AthleteSelect.js.map +1 -1
- package/dist/atheletebridge/components/Crest.d.ts +0 -2
- package/dist/atheletebridge/components/Crest.js +1 -2
- package/dist/atheletebridge/components/Crest.js.map +1 -1
- package/dist/atheletebridge/components/CursorPager.d.ts +0 -2
- package/dist/atheletebridge/components/CursorPager.js +1 -2
- package/dist/atheletebridge/components/CursorPager.js.map +1 -1
- package/dist/atheletebridge/components/DrillVideoLink.d.ts +1 -2
- package/dist/atheletebridge/components/DrillVideoLink.js +1 -2
- package/dist/atheletebridge/components/DrillVideoLink.js.map +1 -1
- package/dist/atheletebridge/components/EmptyState.d.ts +0 -2
- package/dist/atheletebridge/components/EmptyState.js +1 -2
- package/dist/atheletebridge/components/EmptyState.js.map +1 -1
- package/dist/atheletebridge/components/FilterSelect.d.ts +1 -2
- package/dist/atheletebridge/components/FilterSelect.js +1 -2
- package/dist/atheletebridge/components/FilterSelect.js.map +1 -1
- package/dist/atheletebridge/components/FixtureCard.d.ts +0 -2
- package/dist/atheletebridge/components/FixtureCard.js +1 -2
- package/dist/atheletebridge/components/FixtureCard.js.map +1 -1
- package/dist/atheletebridge/components/LoadingState.d.ts +0 -2
- package/dist/atheletebridge/components/LoadingState.js +7 -8
- package/dist/atheletebridge/components/LoadingState.js.map +1 -1
- package/dist/atheletebridge/components/MatchupRow.d.ts +0 -2
- package/dist/atheletebridge/components/MatchupRow.js +29 -30
- package/dist/atheletebridge/components/MatchupRow.js.map +1 -1
- package/dist/atheletebridge/components/MetricsCard.d.ts +0 -2
- package/dist/atheletebridge/components/MetricsCard.js +7 -8
- package/dist/atheletebridge/components/MetricsCard.js.map +1 -1
- package/dist/atheletebridge/components/PageLayout.d.ts +0 -2
- package/dist/atheletebridge/components/PageLayout.js +1 -2
- package/dist/atheletebridge/components/PageLayout.js.map +1 -1
- package/dist/atheletebridge/components/ProgramCard.d.ts +0 -2
- package/dist/atheletebridge/components/ProgramCard.js +9 -10
- package/dist/atheletebridge/components/ProgramCard.js.map +1 -1
- package/dist/atheletebridge/components/RouteAnalytics.d.ts +0 -1
- package/dist/atheletebridge/components/RouteAnalytics.js +1 -2
- package/dist/atheletebridge/components/RouteAnalytics.js.map +1 -1
- package/dist/atheletebridge/components/Scoreboard.d.ts +0 -2
- package/dist/atheletebridge/components/Scoreboard.js +59 -60
- package/dist/atheletebridge/components/Scoreboard.js.map +1 -1
- package/dist/atheletebridge/components/SessionCard.d.ts +0 -2
- package/dist/atheletebridge/components/SessionCard.js +7 -8
- package/dist/atheletebridge/components/SessionCard.js.map +1 -1
- package/dist/atheletebridge/components/SessionStatusTimeline.d.ts +0 -2
- package/dist/atheletebridge/components/SessionStatusTimeline.js +11 -12
- package/dist/atheletebridge/components/SessionStatusTimeline.js.map +1 -1
- package/dist/atheletebridge/components/StatusBadge.d.ts +0 -2
- package/dist/atheletebridge/components/StatusBadge.js +2 -3
- package/dist/atheletebridge/components/StatusBadge.js.map +1 -1
- package/dist/atheletebridge/components/TeamCard.d.ts +0 -2
- package/dist/atheletebridge/components/TeamCard.js +11 -12
- package/dist/atheletebridge/components/TeamCard.js.map +1 -1
- package/dist/atheletebridge/components/ToastViewport.d.ts +1 -2
- package/dist/atheletebridge/components/ToastViewport.js +1 -2
- package/dist/atheletebridge/components/ToastViewport.js.map +1 -1
- package/dist/atheletebridge/components/UserAvatar.d.ts +0 -2
- package/dist/atheletebridge/components/UserAvatar.js +1 -2
- package/dist/atheletebridge/components/UserAvatar.js.map +1 -1
- package/dist/atheletebridge/components/UserSearchSelect.d.ts +1 -2
- package/dist/atheletebridge/components/UserSearchSelect.js +11 -12
- package/dist/atheletebridge/components/UserSearchSelect.js.map +1 -1
- package/dist/atheletebridge/components/ai/AgentRunFeed.d.ts +1 -3
- package/dist/atheletebridge/components/ai/AgentRunFeed.js +30 -31
- package/dist/atheletebridge/components/ai/AgentRunFeed.js.map +1 -1
- package/dist/atheletebridge/components/ai/AiErrorNotice.d.ts +1 -2
- package/dist/atheletebridge/components/ai/AiErrorNotice.js +13 -14
- package/dist/atheletebridge/components/ai/AiErrorNotice.js.map +1 -1
- package/dist/atheletebridge/components/ai/AiModelPicker.d.ts +1 -2
- package/dist/atheletebridge/components/ai/AiModelPicker.js +10 -11
- package/dist/atheletebridge/components/ai/AiModelPicker.js.map +1 -1
- package/dist/atheletebridge/components/ai/DecisionCard.d.ts +1 -3
- package/dist/atheletebridge/components/ai/DecisionCard.js +106 -115
- package/dist/atheletebridge/components/ai/DecisionCard.js.map +1 -1
- package/dist/atheletebridge/components/ai/RunDecisionPanel.d.ts +1 -2
- package/dist/atheletebridge/components/ai/RunDecisionPanel.js +59 -72
- package/dist/atheletebridge/components/ai/RunDecisionPanel.js.map +1 -1
- package/dist/atheletebridge/components/ai/SubjectDecisions.d.ts +1 -2
- package/dist/atheletebridge/components/ai/SubjectDecisions.js +6 -7
- package/dist/atheletebridge/components/ai/SubjectDecisions.js.map +1 -1
- package/dist/atheletebridge/components/ai/assessment.d.ts +0 -2
- package/dist/atheletebridge/components/ai/assessment.js +1 -2
- package/dist/atheletebridge/components/ai/assessment.js.map +1 -1
- package/dist/atheletebridge/components/ai/index.d.ts +0 -1
- package/dist/atheletebridge/components/availability/AvailabilityRosterPanel.d.ts +1 -2
- package/dist/atheletebridge/components/availability/AvailabilityRosterPanel.js +13 -14
- package/dist/atheletebridge/components/availability/AvailabilityRosterPanel.js.map +1 -1
- package/dist/atheletebridge/components/availability/AvailabilityRsvpControl.d.ts +1 -2
- package/dist/atheletebridge/components/availability/AvailabilityRsvpControl.js +10 -11
- package/dist/atheletebridge/components/availability/AvailabilityRsvpControl.js.map +1 -1
- package/dist/atheletebridge/components/domain.d.ts +0 -2
- package/dist/atheletebridge/components/domain.js +5 -3
- package/dist/atheletebridge/components/domain.js.map +1 -1
- package/dist/atheletebridge/components/form.d.ts +0 -2
- package/dist/atheletebridge/components/form.js +1 -2
- package/dist/atheletebridge/components/form.js.map +1 -1
- package/dist/atheletebridge/components/index.d.ts +0 -1
- package/dist/atheletebridge/components/registration/OnlineCheckout.d.ts +9 -0
- package/dist/atheletebridge/components/registration/OnlineCheckout.js +101 -0
- package/dist/atheletebridge/components/registration/OnlineCheckout.js.map +1 -0
- package/dist/atheletebridge/components/registration/OnlinePaymentsCard.d.ts +2 -0
- package/dist/atheletebridge/components/registration/OnlinePaymentsCard.js +149 -0
- package/dist/atheletebridge/components/registration/OnlinePaymentsCard.js.map +1 -0
- package/dist/atheletebridge/components/registration/PaymentSummaryPanel.d.ts +0 -2
- package/dist/atheletebridge/components/registration/PaymentSummaryPanel.js +1 -2
- package/dist/atheletebridge/components/registration/PaymentSummaryPanel.js.map +1 -1
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.d.ts +0 -2
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.js +3 -4
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.js.map +1 -1
- package/dist/atheletebridge/components/registration/entryRules.d.ts +0 -2
- package/dist/atheletebridge/components/registration/entryRules.js +2 -3
- package/dist/atheletebridge/components/registration/entryRules.js.map +1 -1
- package/dist/atheletebridge/components/viz/AvatarStack.d.ts +1 -3
- package/dist/atheletebridge/components/viz/BarChart.d.ts +1 -3
- package/dist/atheletebridge/components/viz/BarChart.js +18 -19
- package/dist/atheletebridge/components/viz/BarChart.js.map +1 -1
- package/dist/atheletebridge/components/viz/DonutChart.d.ts +1 -3
- package/dist/atheletebridge/components/viz/DonutChart.js +13 -14
- package/dist/atheletebridge/components/viz/DonutChart.js.map +1 -1
- package/dist/atheletebridge/components/viz/LineChart.d.ts +1 -3
- package/dist/atheletebridge/components/viz/LineChart.js +16 -17
- package/dist/atheletebridge/components/viz/LineChart.js.map +1 -1
- package/dist/atheletebridge/components/viz/ProgressRing.d.ts +1 -3
- package/dist/atheletebridge/components/viz/ProgressRing.js +0 -3
- package/dist/atheletebridge/components/viz/RatingStars.d.ts +1 -2
- package/dist/atheletebridge/components/viz/RatingStars.js +1 -2
- package/dist/atheletebridge/components/viz/RatingStars.js.map +1 -1
- package/dist/atheletebridge/components/viz/Sparkline.d.ts +1 -2
- package/dist/atheletebridge/components/viz/Sparkline.js +12 -11
- package/dist/atheletebridge/components/viz/Sparkline.js.map +1 -1
- package/dist/atheletebridge/components/viz/StatCard.d.ts +1 -3
- package/dist/atheletebridge/components/viz/StatCard.js +1 -2
- package/dist/atheletebridge/components/viz/StatCard.js.map +1 -1
- package/dist/atheletebridge/components/viz/StepProgress.d.ts +1 -2
- package/dist/atheletebridge/components/viz/Timeline.d.ts +1 -3
- package/dist/atheletebridge/components/viz/Timeline.js +1 -2
- package/dist/atheletebridge/components/viz/Timeline.js.map +1 -1
- package/dist/atheletebridge/components/viz/index.d.ts +0 -1
- package/dist/atheletebridge/components/viz/index.js +9 -8
- package/dist/atheletebridge/components/viz/lib/Avatar.d.ts +1 -2
- package/dist/atheletebridge/components/viz/lib/CartesianFrame.d.ts +1 -3
- package/dist/atheletebridge/components/viz/lib/CartesianFrame.js +13 -8
- package/dist/atheletebridge/components/viz/lib/CartesianFrame.js.map +1 -1
- package/dist/atheletebridge/components/viz/lib/ResponsiveSvg.d.ts +1 -3
- package/dist/atheletebridge/components/viz/lib/ResponsiveSvg.js +1 -2
- package/dist/atheletebridge/components/viz/lib/ResponsiveSvg.js.map +1 -1
- package/dist/atheletebridge/components/viz/lib/format.d.ts +0 -1
- package/dist/atheletebridge/components/viz/lib/format.js +1 -2
- package/dist/atheletebridge/components/viz/lib/format.js.map +1 -1
- package/dist/atheletebridge/components/viz/lib/geometry.d.ts +0 -1
- package/dist/atheletebridge/components/viz/lib/geometry.js +1 -2
- package/dist/atheletebridge/components/viz/lib/geometry.js.map +1 -1
- package/dist/atheletebridge/components/viz/lib/hooks.d.ts +0 -2
- package/dist/atheletebridge/components/viz/lib/hooks.js +1 -2
- package/dist/atheletebridge/components/viz/lib/hooks.js.map +1 -1
- package/dist/atheletebridge/components/viz/lib/palette.d.ts +0 -1
- package/dist/atheletebridge/components/viz/lib/palette.js +1 -2
- package/dist/atheletebridge/components/viz/lib/palette.js.map +1 -1
- package/dist/atheletebridge/components/viz/lib/types.d.ts +0 -2
- package/dist/atheletebridge/context/AthleteBridgeContext.d.ts +0 -2
- package/dist/atheletebridge/context/AthleteBridgeContext.js +3 -3
- package/dist/atheletebridge/context/AthleteBridgeContext.js.map +1 -1
- package/dist/atheletebridge/context/index.d.ts +0 -1
- package/dist/atheletebridge/context/index.js +1 -1
- package/dist/atheletebridge/hooks/index.d.ts +0 -1
- package/dist/atheletebridge/hooks/index.js +3 -2
- package/dist/atheletebridge/hooks/useAthleteBridgeAnalytics.d.ts +0 -1
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.d.ts +23 -25
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.js +129 -112
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.js.map +1 -1
- package/dist/atheletebridge/hooks/useAthleteBridgePageView.d.ts +0 -1
- package/dist/atheletebridge/hooks/useRegistrationApi.d.ts +26 -11
- package/dist/atheletebridge/hooks/useRegistrationApi.js +77 -35
- package/dist/atheletebridge/hooks/useRegistrationApi.js.map +1 -1
- package/dist/atheletebridge/hooks/useScheduledTimeGate.d.ts +0 -1
- package/dist/atheletebridge/hooks/useScheduledTimeGate.js +2 -7
- package/dist/atheletebridge/hooks/useScheduledTimeGate.js.map +1 -1
- package/dist/atheletebridge/i18n.d.ts +0 -1
- package/dist/atheletebridge/i18n.js +1 -2
- package/dist/atheletebridge/i18n.js.map +1 -1
- package/dist/atheletebridge/index.d.ts +0 -1
- package/dist/atheletebridge/index.js +9 -8
- package/dist/atheletebridge/pages/DashboardPage.d.ts +1 -2
- package/dist/atheletebridge/pages/DashboardPage.js +28 -29
- package/dist/atheletebridge/pages/DashboardPage.js.map +1 -1
- package/dist/atheletebridge/pages/StandingsPage.d.ts +1 -2
- package/dist/atheletebridge/pages/StandingsPage.js +23 -24
- package/dist/atheletebridge/pages/StandingsPage.js.map +1 -1
- package/dist/atheletebridge/pages/ai/AiOperationsPage.d.ts +1 -2
- package/dist/atheletebridge/pages/ai/AiOperationsPage.js +11 -12
- package/dist/atheletebridge/pages/ai/AiOperationsPage.js.map +1 -1
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.d.ts +1 -2
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.js +39 -40
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.js.map +1 -1
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.d.ts +1 -2
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js +135 -136
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.d.ts +1 -2
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js +166 -173
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixtureFormPage.d.ts +1 -2
- package/dist/atheletebridge/pages/fixtures/FixtureFormPage.js +42 -51
- package/dist/atheletebridge/pages/fixtures/FixtureFormPage.js.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixturesListPage.d.ts +1 -2
- package/dist/atheletebridge/pages/fixtures/FixturesListPage.js +39 -40
- package/dist/atheletebridge/pages/fixtures/FixturesListPage.js.map +1 -1
- package/dist/atheletebridge/pages/onboarding/OnboardingPage.d.ts +0 -2
- package/dist/atheletebridge/pages/onboarding/OnboardingPage.js +157 -165
- package/dist/atheletebridge/pages/onboarding/OnboardingPage.js.map +1 -1
- package/dist/atheletebridge/pages/performance/PerformancePage.d.ts +1 -2
- package/dist/atheletebridge/pages/performance/PerformancePage.js +229 -239
- package/dist/atheletebridge/pages/performance/PerformancePage.js.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.d.ts +1 -2
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.js +58 -59
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramFormPage.d.ts +1 -2
- package/dist/atheletebridge/pages/programs/ProgramFormPage.js +42 -39
- package/dist/atheletebridge/pages/programs/ProgramFormPage.js.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramsListPage.d.ts +1 -2
- package/dist/atheletebridge/pages/programs/ProgramsListPage.js +40 -41
- package/dist/atheletebridge/pages/programs/ProgramsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.d.ts +4 -3
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.js +79 -73
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RecordRegistrationPage.d.ts +1 -2
- package/dist/atheletebridge/pages/registrations/RecordRegistrationPage.js +22 -28
- package/dist/atheletebridge/pages/registrations/RecordRegistrationPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegisterPage.d.ts +1 -2
- package/dist/atheletebridge/pages/registrations/RegisterPage.js +92 -95
- package/dist/atheletebridge/pages/registrations/RegisterPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.d.ts +1 -2
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.js +68 -68
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.d.ts +1 -2
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.js +84 -85
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.d.ts +1 -2
- package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.js +63 -62
- package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.d.ts +1 -2
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js +189 -187
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.d.ts +1 -2
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.js +76 -80
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionFormPage.d.ts +1 -2
- package/dist/atheletebridge/pages/sessions/SessionFormPage.js +44 -47
- package/dist/atheletebridge/pages/sessions/SessionFormPage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionsListPage.d.ts +1 -2
- package/dist/atheletebridge/pages/sessions/SessionsListPage.js +19 -20
- package/dist/atheletebridge/pages/sessions/SessionsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamDetailPage.d.ts +1 -2
- package/dist/atheletebridge/pages/teams/TeamDetailPage.js +220 -227
- package/dist/atheletebridge/pages/teams/TeamDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamFormPage.d.ts +1 -2
- package/dist/atheletebridge/pages/teams/TeamFormPage.js +70 -67
- package/dist/atheletebridge/pages/teams/TeamFormPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamsListPage.d.ts +1 -2
- package/dist/atheletebridge/pages/teams/TeamsListPage.js +30 -31
- package/dist/atheletebridge/pages/teams/TeamsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/tournaments/TournamentBracketPage.d.ts +1 -2
- package/dist/atheletebridge/pages/tournaments/TournamentBracketPage.js +27 -28
- package/dist/atheletebridge/pages/tournaments/TournamentBracketPage.js.map +1 -1
- package/dist/atheletebridge/store/atheletebridgeStore.d.ts +1 -3
- package/dist/atheletebridge/store/atheletebridgeStore.js +1 -2
- package/dist/atheletebridge/store/atheletebridgeStore.js.map +1 -1
- package/dist/atheletebridge/store/index.d.ts +0 -1
- package/dist/atheletebridge/store/index.js +1 -1
- package/dist/atheletebridge/types/assistant.d.ts +0 -1
- package/dist/atheletebridge/types/index.d.ts +0 -2
- package/dist/atheletebridge/types/registration.d.ts +38 -2
- package/dist/atheletebridge/utils/aiDecision.d.ts +0 -2
- package/dist/atheletebridge/utils/aiDecision.js +3 -4
- package/dist/atheletebridge/utils/aiDecision.js.map +1 -1
- package/dist/atheletebridge/utils/cn.d.ts +0 -2
- package/dist/atheletebridge/utils/cn.js +2 -3
- package/dist/atheletebridge/utils/cn.js.map +1 -1
- package/dist/atheletebridge/utils/datetime.d.ts +0 -1
- package/dist/atheletebridge/utils/datetime.js +1 -2
- package/dist/atheletebridge/utils/datetime.js.map +1 -1
- package/dist/atheletebridge/utils/fixtureCapabilities.d.ts +0 -2
- package/dist/atheletebridge/utils/fixtureCapabilities.js +2 -3
- package/dist/atheletebridge/utils/fixtureCapabilities.js.map +1 -1
- package/dist/atheletebridge/utils/fixtureLifecycle.d.ts +0 -2
- package/dist/atheletebridge/utils/fixtureLifecycle.js +1 -2
- package/dist/atheletebridge/utils/fixtureLifecycle.js.map +1 -1
- package/dist/atheletebridge/utils/formatters.d.ts +0 -1
- package/dist/atheletebridge/utils/formatters.js +1 -2
- package/dist/atheletebridge/utils/formatters.js.map +1 -1
- package/dist/atheletebridge/utils/identity.d.ts +0 -1
- package/dist/atheletebridge/utils/identity.js +2 -3
- package/dist/atheletebridge/utils/identity.js.map +1 -1
- package/dist/atheletebridge/utils/index.d.ts +0 -1
- package/dist/atheletebridge/utils/money.d.ts +0 -1
- package/dist/atheletebridge/utils/money.js +2 -3
- package/dist/atheletebridge/utils/money.js.map +1 -1
- package/dist/atheletebridge/utils/navigation.d.ts +0 -1
- package/dist/atheletebridge/utils/navigation.js +1 -2
- package/dist/atheletebridge/utils/navigation.js.map +1 -1
- package/dist/atheletebridge/utils/onlineCheckout.d.ts +67 -0
- package/dist/atheletebridge/utils/onlineCheckout.js +60 -0
- package/dist/atheletebridge/utils/onlineCheckout.js.map +1 -0
- package/dist/atheletebridge/utils/pageContext.d.ts +0 -1
- package/dist/atheletebridge/utils/pageContext.js +3 -4
- package/dist/atheletebridge/utils/pageContext.js.map +1 -1
- package/dist/atheletebridge/utils/recordResult.d.ts +0 -2
- package/dist/atheletebridge/utils/recordResult.js +21 -23
- package/dist/atheletebridge/utils/recordResult.js.map +1 -1
- package/dist/atheletebridge/utils/registration.d.ts +0 -1
- package/dist/atheletebridge/utils/registration.js +1 -2
- package/dist/atheletebridge/utils/registration.js.map +1 -1
- package/dist/atheletebridge/utils/timeAgo.d.ts +0 -1
- package/dist/atheletebridge/utils/timeAgo.js +12 -13
- package/dist/atheletebridge/utils/timeAgo.js.map +1 -1
- package/dist/atheletebridge/utils/url.d.ts +0 -1
- package/dist/atheletebridge/utils/url.js +1 -2
- package/dist/atheletebridge/utils/url.js.map +1 -1
- package/dist/generated/global-operations.d.ts +4 -2
- package/dist/generated/global-types.d.ts +6164 -1927
- package/dist/generated/wspace-operations.d.ts +130 -31
- package/dist/generated/wspace-types.d.ts +60800 -3446
- 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 +229 -167
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/services/createSandboxAssistantTransport.d.ts +0 -1
- package/dist/services/createSandboxAssistantTransport.js +1 -2
- package/dist/services/createSandboxAssistantTransport.js.map +1 -1
- package/package.json +71 -53
- package/dist/atheletebridge/AthleteBridgeRoot.d.ts.map +0 -1
- package/dist/atheletebridge/AthleteBridgeRoutes.d.ts.map +0 -1
- package/dist/atheletebridge/admin/AdminDashboardPage.d.ts.map +0 -1
- package/dist/atheletebridge/admin/AdminRoot.d.ts.map +0 -1
- package/dist/atheletebridge/admin/index.d.ts.map +0 -1
- package/dist/atheletebridge/components/AthleteSelect.d.ts.map +0 -1
- package/dist/atheletebridge/components/Crest.d.ts.map +0 -1
- package/dist/atheletebridge/components/CursorPager.d.ts.map +0 -1
- package/dist/atheletebridge/components/DrillVideoLink.d.ts.map +0 -1
- package/dist/atheletebridge/components/EmptyState.d.ts.map +0 -1
- package/dist/atheletebridge/components/FilterSelect.d.ts.map +0 -1
- package/dist/atheletebridge/components/FixtureCard.d.ts.map +0 -1
- package/dist/atheletebridge/components/LoadingState.d.ts.map +0 -1
- package/dist/atheletebridge/components/MatchupRow.d.ts.map +0 -1
- package/dist/atheletebridge/components/MetricsCard.d.ts.map +0 -1
- package/dist/atheletebridge/components/PageLayout.d.ts.map +0 -1
- package/dist/atheletebridge/components/ProgramCard.d.ts.map +0 -1
- package/dist/atheletebridge/components/RouteAnalytics.d.ts.map +0 -1
- package/dist/atheletebridge/components/Scoreboard.d.ts.map +0 -1
- package/dist/atheletebridge/components/SessionCard.d.ts.map +0 -1
- package/dist/atheletebridge/components/SessionStatusTimeline.d.ts.map +0 -1
- package/dist/atheletebridge/components/StatusBadge.d.ts.map +0 -1
- package/dist/atheletebridge/components/TeamCard.d.ts.map +0 -1
- package/dist/atheletebridge/components/ToastViewport.d.ts.map +0 -1
- package/dist/atheletebridge/components/UserAvatar.d.ts.map +0 -1
- package/dist/atheletebridge/components/UserSearchSelect.d.ts.map +0 -1
- package/dist/atheletebridge/components/ai/AgentRunFeed.d.ts.map +0 -1
- package/dist/atheletebridge/components/ai/AiErrorNotice.d.ts.map +0 -1
- package/dist/atheletebridge/components/ai/AiModelPicker.d.ts.map +0 -1
- package/dist/atheletebridge/components/ai/DecisionCard.d.ts.map +0 -1
- package/dist/atheletebridge/components/ai/RunDecisionPanel.d.ts.map +0 -1
- package/dist/atheletebridge/components/ai/SubjectDecisions.d.ts.map +0 -1
- package/dist/atheletebridge/components/ai/assessment.d.ts.map +0 -1
- package/dist/atheletebridge/components/ai/index.d.ts.map +0 -1
- package/dist/atheletebridge/components/availability/AvailabilityRosterPanel.d.ts.map +0 -1
- package/dist/atheletebridge/components/availability/AvailabilityRsvpControl.d.ts.map +0 -1
- package/dist/atheletebridge/components/domain.d.ts.map +0 -1
- package/dist/atheletebridge/components/form.d.ts.map +0 -1
- package/dist/atheletebridge/components/index.d.ts.map +0 -1
- package/dist/atheletebridge/components/registration/PaymentSummaryPanel.d.ts.map +0 -1
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.d.ts.map +0 -1
- package/dist/atheletebridge/components/registration/entryRules.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/AvatarStack.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/BarChart.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/DonutChart.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/LineChart.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/ProgressRing.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/ProgressRing.js.map +0 -1
- package/dist/atheletebridge/components/viz/RatingStars.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/Sparkline.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/StatCard.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/StepProgress.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/Timeline.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/index.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/lib/Avatar.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/lib/CartesianFrame.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/lib/ResponsiveSvg.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/lib/format.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/lib/geometry.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/lib/hooks.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/lib/palette.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/lib/types.d.ts.map +0 -1
- package/dist/atheletebridge/context/AthleteBridgeContext.d.ts.map +0 -1
- package/dist/atheletebridge/context/index.d.ts.map +0 -1
- package/dist/atheletebridge/hooks/index.d.ts.map +0 -1
- package/dist/atheletebridge/hooks/useAthleteBridgeAnalytics.d.ts.map +0 -1
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.d.ts.map +0 -1
- package/dist/atheletebridge/hooks/useAthleteBridgePageView.d.ts.map +0 -1
- package/dist/atheletebridge/hooks/useRegistrationApi.d.ts.map +0 -1
- package/dist/atheletebridge/hooks/useScheduledTimeGate.d.ts.map +0 -1
- package/dist/atheletebridge/i18n.d.ts.map +0 -1
- package/dist/atheletebridge/index.d.ts.map +0 -1
- package/dist/atheletebridge/pages/DashboardPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/StandingsPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/ai/AiOperationsPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/fixtures/FixtureFormPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/fixtures/FixturesListPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/onboarding/OnboardingPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/performance/PerformancePage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/programs/ProgramFormPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/programs/ProgramsListPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/registrations/RecordRegistrationPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/registrations/RegisterPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/sessions/SessionFormPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/sessions/SessionsListPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/teams/TeamDetailPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/teams/TeamFormPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/teams/TeamsListPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/tournaments/TournamentBracketPage.d.ts.map +0 -1
- package/dist/atheletebridge/store/atheletebridgeStore.d.ts.map +0 -1
- package/dist/atheletebridge/store/index.d.ts.map +0 -1
- package/dist/atheletebridge/types/assistant.d.ts.map +0 -1
- package/dist/atheletebridge/types/index.d.ts.map +0 -1
- package/dist/atheletebridge/types/registration.d.ts.map +0 -1
- package/dist/atheletebridge/utils/aiDecision.d.ts.map +0 -1
- package/dist/atheletebridge/utils/cn.d.ts.map +0 -1
- package/dist/atheletebridge/utils/datetime.d.ts.map +0 -1
- package/dist/atheletebridge/utils/fixtureCapabilities.d.ts.map +0 -1
- package/dist/atheletebridge/utils/fixtureLifecycle.d.ts.map +0 -1
- package/dist/atheletebridge/utils/formatters.d.ts.map +0 -1
- package/dist/atheletebridge/utils/identity.d.ts.map +0 -1
- package/dist/atheletebridge/utils/index.d.ts.map +0 -1
- package/dist/atheletebridge/utils/money.d.ts.map +0 -1
- package/dist/atheletebridge/utils/navigation.d.ts.map +0 -1
- package/dist/atheletebridge/utils/pageContext.d.ts.map +0 -1
- package/dist/atheletebridge/utils/recordResult.d.ts.map +0 -1
- package/dist/atheletebridge/utils/registration.d.ts.map +0 -1
- package/dist/atheletebridge/utils/timeAgo.d.ts.map +0 -1
- package/dist/atheletebridge/utils/url.d.ts.map +0 -1
- 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/services/createSandboxAssistantTransport.d.ts.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ViewMode } from '../types';
|
|
2
|
-
|
|
3
2
|
interface AthleteBridgeState {
|
|
4
3
|
viewMode: ViewMode;
|
|
5
4
|
sidebarCollapsed: boolean;
|
|
@@ -39,7 +38,7 @@ export declare const useAthleteBridgeStore: import('zustand').UseBoundStore<Omit
|
|
|
39
38
|
persist: {
|
|
40
39
|
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<AthleteBridgeState, unknown, unknown>>) => void;
|
|
41
40
|
clearStorage: () => void;
|
|
42
|
-
rehydrate: () => Promise<void
|
|
41
|
+
rehydrate: () => Promise<void>;
|
|
43
42
|
hasHydrated: () => boolean;
|
|
44
43
|
onHydrate: (fn: (state: AthleteBridgeState) => void) => () => void;
|
|
45
44
|
onFinishHydration: (fn: (state: AthleteBridgeState) => void) => () => void;
|
|
@@ -47,4 +46,3 @@ export declare const useAthleteBridgeStore: import('zustand').UseBoundStore<Omit
|
|
|
47
46
|
};
|
|
48
47
|
}>;
|
|
49
48
|
export {};
|
|
50
|
-
//# sourceMappingURL=atheletebridgeStore.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { create as e } from "zustand";
|
|
2
2
|
import { devtools as t, persist as n } from "zustand/middleware";
|
|
3
3
|
import { createProfileScopedStorage as r } from "@burdenoff/fe-libs/shared/utils";
|
|
4
|
-
|
|
4
|
+
// src/atheletebridge/store/atheletebridgeStore.ts
|
|
5
5
|
var i = {
|
|
6
6
|
viewMode: "grid",
|
|
7
7
|
sidebarCollapsed: !1
|
|
@@ -21,7 +21,6 @@ var i = {
|
|
|
21
21
|
name: "AthleteBridge Store",
|
|
22
22
|
enabled: !1
|
|
23
23
|
}));
|
|
24
|
-
//#endregion
|
|
25
24
|
export { a as useAthleteBridgeStore };
|
|
26
25
|
|
|
27
26
|
//# sourceMappingURL=atheletebridgeStore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atheletebridgeStore.js","names":[],"sources":["../../../src/atheletebridge/store/atheletebridgeStore.ts"],"sourcesContent":["/**\n * AthleteBridge Zustand Store\n * @module atheletebridge/store\n *\n * Local UI state only (view mode, sidebar). Server state lives in React Query.\n */\n\nimport { create } from 'zustand';\nimport { devtools, persist } from 'zustand/middleware';\nimport { createProfileScopedStorage } from '@burdenoff/fe-libs/shared/utils';\nimport type { ViewMode } from '../types';\n\n// ============================================================================\n// State Interface\n// ============================================================================\n\ninterface AthleteBridgeState {\n viewMode: ViewMode;\n sidebarCollapsed: boolean;\n\n setViewMode: (mode: ViewMode) => void;\n toggleSidebar: () => void;\n reset: () => void;\n}\n\n// ============================================================================\n// Initial State\n// ============================================================================\n\nconst initialState = {\n viewMode: 'grid' as ViewMode,\n sidebarCollapsed: false,\n};\n\n// ============================================================================\n// Store\n// ============================================================================\n\nexport const useAthleteBridgeStore = create<AthleteBridgeState>()(\n devtools(\n persist(\n (set) => ({\n ...initialState,\n\n setViewMode: (mode) => set({ viewMode: mode }),\n toggleSidebar: () => set((state) => ({ sidebarCollapsed: !state.sidebarCollapsed })),\n\n reset: () => set(initialState),\n }),\n {\n name: 'burdenoff-atheletebridge-storage',\n storage: createProfileScopedStorage(),\n partialize: (state) => ({\n viewMode: state.viewMode,\n sidebarCollapsed: state.sidebarCollapsed,\n }),\n }\n ),\n { name: 'AthleteBridge Store', enabled: import.meta.env.DEV }\n )\n);\n"],"mappings":";;;;AA6BA,
|
|
1
|
+
{"version":3,"file":"atheletebridgeStore.js","names":["initialState","useAthleteBridgeStore","create","devtools","persist","set","mode","state","createProfileScopedStorage"],"sources":["../../../src/atheletebridge/store/atheletebridgeStore.ts"],"sourcesContent":["/**\n * AthleteBridge Zustand Store\n * @module atheletebridge/store\n *\n * Local UI state only (view mode, sidebar). Server state lives in React Query.\n */\n\nimport { create } from 'zustand';\nimport { devtools, persist } from 'zustand/middleware';\nimport { createProfileScopedStorage } from '@burdenoff/fe-libs/shared/utils';\nimport type { ViewMode } from '../types';\n\n// ============================================================================\n// State Interface\n// ============================================================================\n\ninterface AthleteBridgeState {\n viewMode: ViewMode;\n sidebarCollapsed: boolean;\n\n setViewMode: (mode: ViewMode) => void;\n toggleSidebar: () => void;\n reset: () => void;\n}\n\n// ============================================================================\n// Initial State\n// ============================================================================\n\nconst initialState = {\n viewMode: 'grid' as ViewMode,\n sidebarCollapsed: false,\n};\n\n// ============================================================================\n// Store\n// ============================================================================\n\nexport const useAthleteBridgeStore = create<AthleteBridgeState>()(\n devtools(\n persist(\n (set) => ({\n ...initialState,\n\n setViewMode: (mode) => set({ viewMode: mode }),\n toggleSidebar: () => set((state) => ({ sidebarCollapsed: !state.sidebarCollapsed })),\n\n reset: () => set(initialState),\n }),\n {\n name: 'burdenoff-atheletebridge-storage',\n storage: createProfileScopedStorage(),\n partialize: (state) => ({\n viewMode: state.viewMode,\n sidebarCollapsed: state.sidebarCollapsed,\n }),\n }\n ),\n { name: 'AthleteBridge Store', enabled: import.meta.env.DEV }\n )\n);\n"],"mappings":";;;;AA6BA,IAAMA,IAAe;CACnB,UAAU;CACV,kBAAkB;AACpB,GAMaC,IAAwBC,EAA2B,CAAC,CAC/DC,EACEC,GACG,OAAS;CACR,GAAGJ;CAEH,cAAc,MAASK,EAAI,EAAE,UAAUC,EAAK,CAAC;CAC7C,qBAAqBD,GAAK,OAAW,EAAE,kBAAkB,CAACE,EAAM,iBAAiB,EAAE;CAEnF,aAAaF,EAAIL,CAAY;AAC/B,IACA;CACE,MAAM;CACN,SAASQ,EAA2B;CACpC,aAAa,OAAW;EACtB,UAAUD,EAAM;EAChB,kBAAkBA,EAAM;CAC1B;AACF,CACF,GACA;CAAE,MAAM;CAAuB,SAAA;AAA6B,CAC9D,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { useAthleteBridgeStore } from "./atheletebridgeStore.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AthPageInfo } from './index';
|
|
2
|
-
|
|
3
2
|
export type AthRegistrationFormStatus = 'DRAFT' | 'PUBLISHED' | 'CLOSED' | 'ARCHIVED';
|
|
4
3
|
export type AthRegistrationFieldType = 'SHORT_TEXT' | 'LONG_TEXT' | 'EMAIL' | 'PHONE' | 'NUMBER' | 'DATE' | 'SELECT' | 'CHECKBOX';
|
|
5
4
|
export type AthRegistrationFeeType = 'REQUIRED' | 'OPTIONAL';
|
|
@@ -8,6 +7,8 @@ export type AthRegistrationSubmissionStatus = 'SUBMITTED' | 'ACCEPTED' | 'DECLIN
|
|
|
8
7
|
export type AthRegistrationPaymentStatus = 'NOT_REQUIRED' | 'UNPAID' | 'PARTIALLY_PAID' | 'PAID' | 'REFUNDED';
|
|
9
8
|
export type AthRegistrationPaymentMethod = 'CASH' | 'BANK_TRANSFER' | 'CARD_TERMINAL' | 'CHEQUE' | 'ONLINE' | 'OTHER';
|
|
10
9
|
export type AthRegistrationPaymentRecordStatus = 'RECORDED' | 'REFUNDED' | 'VOIDED';
|
|
10
|
+
/** Payment processor behind an online payment or a club's payout account (BOFF-10805). */
|
|
11
|
+
export type AthPaymentProvider = 'STRIPE';
|
|
11
12
|
export type AthRegistrationDecision = 'ACCEPT' | 'DECLINE';
|
|
12
13
|
/** What accepting a team-linked registration did to the roster (BOFF-10806). */
|
|
13
14
|
export type AthRegistrationRosterOutcome = 'ADDED' | 'ALREADY_ON_ROSTER' | 'NO_LINKED_USER' | 'TEAM_UNAVAILABLE';
|
|
@@ -102,6 +103,8 @@ export interface AthRegistrationPayment {
|
|
|
102
103
|
netAmount: number;
|
|
103
104
|
currency: string;
|
|
104
105
|
method: AthRegistrationPaymentMethod;
|
|
106
|
+
/** Set when the payment was collected through the club's connected processor account. */
|
|
107
|
+
processor: AthPaymentProvider | null;
|
|
105
108
|
status: AthRegistrationPaymentRecordStatus;
|
|
106
109
|
reference: string | null;
|
|
107
110
|
note: string | null;
|
|
@@ -158,12 +161,46 @@ export interface AthMyRegistration {
|
|
|
158
161
|
amountPaid: number;
|
|
159
162
|
amountOutstanding: number;
|
|
160
163
|
currency: string;
|
|
164
|
+
/** True when the club takes online payments for this registration (BOFF-10805). */
|
|
165
|
+
onlinePaymentAvailable: boolean;
|
|
161
166
|
submittedAt: string;
|
|
162
167
|
}
|
|
163
168
|
export interface AthMyRegistrationConnection {
|
|
164
169
|
items: AthMyRegistration[];
|
|
165
170
|
pageInfo: AthPageInfo;
|
|
166
171
|
}
|
|
172
|
+
/** The club's connected payout account at the processor (Stripe Connect Express). */
|
|
173
|
+
export interface AthPaymentAccount {
|
|
174
|
+
provider: AthPaymentProvider;
|
|
175
|
+
accountId: string;
|
|
176
|
+
chargesEnabled: boolean;
|
|
177
|
+
payoutsEnabled: boolean;
|
|
178
|
+
detailsSubmitted: boolean;
|
|
179
|
+
lastSyncedAt: string | null;
|
|
180
|
+
createdAt: string;
|
|
181
|
+
}
|
|
182
|
+
export interface AthOnlinePaymentsStatus {
|
|
183
|
+
/** True when this environment has a payment processor configured. */
|
|
184
|
+
processorConfigured: boolean;
|
|
185
|
+
/** True when the configured processor is in test mode (no real money moves). */
|
|
186
|
+
testMode: boolean;
|
|
187
|
+
/** True when families can pay this club online right now. */
|
|
188
|
+
onlineCheckoutAvailable: boolean;
|
|
189
|
+
account: AthPaymentAccount | null;
|
|
190
|
+
}
|
|
191
|
+
export interface AthPaymentAccountLink {
|
|
192
|
+
url: string;
|
|
193
|
+
expiresAt: string;
|
|
194
|
+
account: AthPaymentAccount;
|
|
195
|
+
}
|
|
196
|
+
export interface AthRegistrationCheckoutSession {
|
|
197
|
+
checkoutId: string;
|
|
198
|
+
url: string;
|
|
199
|
+
/** Amount requested, in minor units of currency. */
|
|
200
|
+
amount: number;
|
|
201
|
+
currency: string;
|
|
202
|
+
expiresAt: string | null;
|
|
203
|
+
}
|
|
167
204
|
export interface AthRegistrationFieldInput {
|
|
168
205
|
key: string;
|
|
169
206
|
label: string;
|
|
@@ -228,4 +265,3 @@ export interface AthRecordRegistrationPaymentInput {
|
|
|
228
265
|
note?: string;
|
|
229
266
|
receivedAt?: string;
|
|
230
267
|
}
|
|
231
|
-
//# sourceMappingURL=registration.d.ts.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AthAiAssessment } from '../types';
|
|
2
|
-
|
|
3
2
|
/** One rendered key/value pair from a JSON payload. */
|
|
4
3
|
export interface AiPayloadEntry {
|
|
5
4
|
key: string;
|
|
@@ -82,4 +81,3 @@ export declare function programIdFromInputRefs(inputRefs: unknown): string | nul
|
|
|
82
81
|
*/
|
|
83
82
|
export type ProposalState = 'pending' | 'accepted' | 'overridden' | 'superseded' | 'unknown';
|
|
84
83
|
export declare function proposalStateFor(runId: string, programContext: unknown): ProposalState;
|
|
85
|
-
//# sourceMappingURL=aiDecision.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
// src/atheletebridge/utils/aiDecision.ts
|
|
2
2
|
var e = [
|
|
3
3
|
"AT_RISK",
|
|
4
4
|
"DELOAD",
|
|
5
5
|
"MAINTAIN",
|
|
6
6
|
"PROGRESSION"
|
|
7
|
-
], t = new Set([
|
|
7
|
+
], t = /* @__PURE__ */ new Set([
|
|
8
8
|
"assessment",
|
|
9
9
|
"status",
|
|
10
10
|
"rationale",
|
|
@@ -191,7 +191,6 @@ function _(e, t) {
|
|
|
191
191
|
}
|
|
192
192
|
return n.agentRunId === e ? i === "PROPOSED" ? "pending" : "unknown" : "superseded";
|
|
193
193
|
}
|
|
194
|
-
|
|
195
|
-
export { m as formatConfidence, h as formatLoadChange, r as isRecord, g as programIdFromInputRefs, _ as proposalStateFor, p as summarizeDecision, s as toProvenanceEntries };
|
|
194
|
+
export { m as formatConfidence, h as formatLoadChange, a as formatPayloadValue, i as humanizePayloadKey, r as isRecord, g as programIdFromInputRefs, _ as proposalStateFor, p as summarizeDecision, o as toPayloadEntries, s as toProvenanceEntries };
|
|
196
195
|
|
|
197
196
|
//# sourceMappingURL=aiDecision.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aiDecision.js","names":[],"sources":["../../../src/atheletebridge/utils/aiDecision.ts"],"sourcesContent":["/**\n * AI ledger payload readers\n * @module atheletebridge/utils/aiDecision\n *\n * `AthAgentRun.decision` and `AthAgentRun.inputRefs` are JSON by contract: the\n * decision engine writes a different shape per decision path (a performance\n * assessment, a coach override, a generated program plan) and, when the model's\n * reply could not be parsed, a `{ parseError }` marker on an otherwise\n * SUCCEEDED row.\n *\n * Two rules govern this file:\n *\n * 1. NOTHING IS HIDDEN. A payload shape this module does not recognise is still\n * rendered, key by key, via `extra`. A card that silently drops unknown keys\n * is how a failed decision reads as an empty success.\n * 2. NOTHING IS CAST. Every read is a guarded lookup on `unknown`, so a payload\n * that disagrees with the shape we expect degrades to \"shown generically\"\n * rather than to a runtime crash inside the render.\n */\n\nimport type { AthAiAssessment } from '../types';\n\n/** One rendered key/value pair from a JSON payload. */\nexport interface AiPayloadEntry {\n key: string;\n label: string;\n value: string;\n}\n\nexport type AiDecisionKind =\n /** No decision recorded (a FAILED run never reached one). */\n | 'none'\n /** The provider replied but the reply was unusable — `{ parseError }`. */\n | 'parse-failure'\n /** `athAdjustPlanFromPerformance` — the AI's read of an athlete's trend. */\n | 'assessment'\n /** `athOverrideAgentRun` — a coach's review of a prior decision. */\n | 'override'\n /** `athGenerateProgram` — a generated multi-week plan. */\n | 'program-plan'\n /** Recognisably JSON, but not a shape this build knows. */\n | 'other';\n\nexport interface AiDecisionSummary {\n kind: AiDecisionKind;\n /** Short headline for the decision card. */\n title: string;\n /** True when the card must read as a failure, not as an empty success. */\n isFailure: boolean;\n assessment: AthAiAssessment | null;\n /** Resolution written by the engine: PROPOSED / ACCEPTED / OVERRIDDEN. */\n status: string | null;\n rationale: string | null;\n note: string | null;\n confidence: number | null;\n recommendedWeeklyLoadChangePct: number | null;\n flags: string[];\n parseError: string | null;\n /** Every payload key not surfaced in a dedicated field above. */\n extra: AiPayloadEntry[];\n}\n\nconst ASSESSMENT_VALUES: readonly AthAiAssessment[] = [\n 'AT_RISK',\n 'DELOAD',\n 'MAINTAIN',\n 'PROGRESSION',\n];\n\n/** Keys rendered through a dedicated field on {@link AiDecisionSummary}. */\nconst DEDICATED_DECISION_KEYS = new Set([\n 'assessment',\n 'status',\n 'rationale',\n 'note',\n 'confidence',\n 'recommendedWeeklyLoadChangePct',\n 'flags',\n 'parseError',\n]);\n\n/** Human labels for the provenance keys the decision engine actually writes. */\nconst PAYLOAD_LABELS: Record<string, string> = {\n agentRunId: 'Agent run',\n athleteId: 'Athlete',\n avgRpe: 'Average RPE',\n avgTotalLoad: 'Average total load',\n constraints: 'Constraints',\n decidedAt: 'Decided at',\n decidedBy: 'Decided by',\n goals: 'Goals',\n level: 'Level',\n loadTrend: 'Load trend',\n metricCount: 'Metrics considered',\n metricSummaries: 'Metric summaries',\n programId: 'Program',\n proposedAssessment: 'AI proposed',\n requestedWeeks: 'Requested weeks',\n rpeTrend: 'RPE trend',\n source: 'Source',\n sport: 'Sport',\n statusCounts: 'Workout status counts',\n supersedesRunId: 'Supersedes run',\n teamId: 'Team',\n weeks: 'Weeks',\n workoutLogCount: 'Workout logs considered',\n};\n\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** Title-cased label for a payload key (`avgRpe` → `Avg rpe`). */\nexport function humanizePayloadKey(key: string): string {\n const known = PAYLOAD_LABELS[key];\n if (known) {\n return known;\n }\n const spaced = key\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .replace(/[_-]+/g, ' ')\n .trim()\n .toLowerCase();\n return spaced ? spaced.charAt(0).toUpperCase() + spaced.slice(1) : key;\n}\n\n/** Render any JSON value as a single readable line. */\nexport function formatPayloadValue(value: unknown): string {\n if (value === null || value === undefined) {\n return '—';\n }\n if (typeof value === 'string') {\n return value.trim() ? value : '—';\n }\n if (typeof value === 'number') {\n return Number.isFinite(value) ? String(value) : '—';\n }\n if (typeof value === 'boolean') {\n return value ? 'Yes' : 'No';\n }\n if (Array.isArray(value)) {\n return value.length === 0 ? '—' : value.map((item) => formatPayloadValue(item)).join(', ');\n }\n if (isRecord(value)) {\n const parts = Object.entries(value).map(\n ([key, nested]) => `${humanizePayloadKey(key)}: ${formatPayloadValue(nested)}`\n );\n return parts.length === 0 ? '—' : parts.join(' · ');\n }\n return String(value);\n}\n\n/** Flatten a JSON payload into ordered, renderable entries. Never drops a key. */\nexport function toPayloadEntries(\n payload: unknown,\n skipKeys?: ReadonlySet<string>\n): AiPayloadEntry[] {\n if (!isRecord(payload)) {\n return [];\n }\n return Object.entries(payload)\n .filter(([key]) => !skipKeys?.has(key))\n .map(([key, value]) => ({\n key,\n label: humanizePayloadKey(key),\n value: formatPayloadValue(value),\n }));\n}\n\n/**\n * Provenance entries for a run's `inputRefs` — the ids and aggregate stats the\n * model actually considered. Keys whose value is null/undefined are dropped\n * (the engine writes `{ teamId, athleteId }` with one of them unset).\n */\nexport function toProvenanceEntries(inputRefs: unknown): AiPayloadEntry[] {\n if (!isRecord(inputRefs)) {\n return [];\n }\n return Object.entries(inputRefs)\n .filter(([, value]) => value !== null && value !== undefined)\n .map(([key, value]) => ({\n key,\n label: humanizePayloadKey(key),\n value: formatPayloadValue(value),\n }));\n}\n\nfunction readString(record: Record<string, unknown>, key: string): string | null {\n const value = record[key];\n return typeof value === 'string' && value.trim() ? value : null;\n}\n\nfunction readNumber(record: Record<string, unknown>, key: string): number | null {\n const value = record[key];\n return typeof value === 'number' && Number.isFinite(value) ? value : null;\n}\n\nfunction readAssessment(record: Record<string, unknown>): AthAiAssessment | null {\n const value = record.assessment;\n return typeof value === 'string' && (ASSESSMENT_VALUES as readonly string[]).includes(value)\n ? (value as AthAiAssessment)\n : null;\n}\n\nfunction readFlags(record: Record<string, unknown>): string[] {\n const value = record.flags;\n if (!Array.isArray(value)) {\n return [];\n }\n return value.filter((flag): flag is string => typeof flag === 'string' && flag.trim().length > 0);\n}\n\nconst EMPTY_SUMMARY: Omit<AiDecisionSummary, 'kind' | 'title' | 'isFailure'> = {\n assessment: null,\n status: null,\n rationale: null,\n note: null,\n confidence: null,\n recommendedWeeklyLoadChangePct: null,\n flags: [],\n parseError: null,\n extra: [],\n};\n\n/**\n * Classify and unpack a ledger row's `decision` payload for rendering.\n *\n * A `parseError` payload is classified as a FAILURE even though the ledger row\n * itself is SUCCEEDED (the provider answered; the answer was unusable) — that\n * distinction is the whole point of recording it, so the card must show it.\n */\nexport function summarizeDecision(decision: unknown): AiDecisionSummary {\n if (decision === null || decision === undefined) {\n return { kind: 'none', title: 'No decision recorded', isFailure: false, ...EMPTY_SUMMARY };\n }\n\n if (!isRecord(decision)) {\n return {\n kind: 'other',\n title: 'Decision payload',\n isFailure: false,\n ...EMPTY_SUMMARY,\n extra: [{ key: 'value', label: 'Value', value: formatPayloadValue(decision) }],\n };\n }\n\n const parseError = readString(decision, 'parseError');\n if (parseError) {\n return {\n kind: 'parse-failure',\n title: 'Unusable model reply',\n isFailure: true,\n ...EMPTY_SUMMARY,\n parseError,\n extra: toPayloadEntries(decision, DEDICATED_DECISION_KEYS),\n };\n }\n\n const assessment = readAssessment(decision);\n const note = readString(decision, 'note');\n const status = readString(decision, 'status');\n const rationale = readString(decision, 'rationale');\n const extra = toPayloadEntries(decision, DEDICATED_DECISION_KEYS);\n\n if (assessment && note) {\n // A coach override: assessment + note + resolution status, no rationale.\n return {\n ...EMPTY_SUMMARY,\n kind: 'override',\n title: 'Coach decision',\n isFailure: false,\n assessment,\n status,\n note,\n rationale,\n flags: readFlags(decision),\n extra,\n };\n }\n\n if (assessment) {\n return {\n ...EMPTY_SUMMARY,\n kind: 'assessment',\n title: 'Performance assessment',\n isFailure: false,\n assessment,\n status,\n rationale,\n confidence: readNumber(decision, 'confidence'),\n recommendedWeeklyLoadChangePct: readNumber(decision, 'recommendedWeeklyLoadChangePct'),\n flags: readFlags(decision),\n extra,\n };\n }\n\n if (Array.isArray(decision.weeks)) {\n return {\n ...EMPTY_SUMMARY,\n kind: 'program-plan',\n title: 'Generated training plan',\n isFailure: false,\n rationale,\n extra,\n };\n }\n\n return {\n ...EMPTY_SUMMARY,\n kind: 'other',\n title: 'Decision payload',\n isFailure: false,\n status,\n rationale,\n note,\n flags: readFlags(decision),\n extra,\n };\n}\n\n/** Format a confidence in 0–1 as a percentage, or null when absent. */\nexport function formatConfidence(confidence: number | null): string | null {\n if (confidence === null) {\n return null;\n }\n const clamped = Math.min(Math.max(confidence, 0), 1);\n return `${Math.round(clamped * 100)}%`;\n}\n\n/** Format a signed weekly-load change, e.g. `-10%` / `+5%`. */\nexport function formatLoadChange(pct: number | null): string | null {\n if (pct === null) {\n return null;\n }\n const rounded = Math.round(pct * 10) / 10;\n return `${rounded > 0 ? '+' : ''}${rounded}%`;\n}\n\n/**\n * The program an override can legally be filed against, read off the run's\n * provenance. `athAdjustPlanFromPerformance` and earlier overrides name it in\n * `inputRefs.programId`; `athGenerateProgram` runs BEFORE the program exists,\n * so its runs carry no program id and the coach must choose one (the service\n * validates the link and answers NOT_FOUND when the run never touched it).\n */\nexport function programIdFromInputRefs(inputRefs: unknown): string | null {\n if (!isRecord(inputRefs)) {\n return null;\n }\n return readString(inputRefs, 'programId');\n}\n\n/**\n * Where an AI proposal stands, read from its program's `context.lastAiAdjustment`.\n *\n * - `pending` — the program's current read IS this run and no coach has\n * resolved it yet (status PROPOSED). Accept/override applies.\n * - `accepted` /\n * `overridden` — a coach resolved THIS run (`overridesRunId` names it).\n * - `superseded` — the program has moved on to a different, later read.\n * - `unknown` — the program carries no AI read at all (or is unreadable).\n */\nexport type ProposalState = 'pending' | 'accepted' | 'overridden' | 'superseded' | 'unknown';\n\nexport function proposalStateFor(runId: string, programContext: unknown): ProposalState {\n const adjustment = isRecord(programContext) ? programContext.lastAiAdjustment : null;\n if (!isRecord(adjustment)) return 'unknown';\n const status = typeof adjustment.status === 'string' ? adjustment.status : null;\n if (adjustment.overridesRunId === runId) {\n if (status === 'ACCEPTED') return 'accepted';\n if (status === 'OVERRIDDEN') return 'overridden';\n }\n if (adjustment.agentRunId === runId) {\n return status === 'PROPOSED' ? 'pending' : 'unknown';\n }\n return 'superseded';\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"aiDecision.js","names":["ASSESSMENT_VALUES","DEDICATED_DECISION_KEYS","PAYLOAD_LABELS","isRecord","value","humanizePayloadKey","known","key","spaced","formatPayloadValue","item","parts","nested","toPayloadEntries","payload","skipKeys","toProvenanceEntries","inputRefs","readString","record","readNumber","readAssessment","readFlags","flag","EMPTY_SUMMARY","summarizeDecision","decision","parseError","assessment","note","status","rationale","extra","formatConfidence","confidence","formatLoadChange","pct","rounded","programIdFromInputRefs","proposalStateFor","adjustment","programContext","runId"],"sources":["../../../src/atheletebridge/utils/aiDecision.ts"],"sourcesContent":["/**\n * AI ledger payload readers\n * @module atheletebridge/utils/aiDecision\n *\n * `AthAgentRun.decision` and `AthAgentRun.inputRefs` are JSON by contract: the\n * decision engine writes a different shape per decision path (a performance\n * assessment, a coach override, a generated program plan) and, when the model's\n * reply could not be parsed, a `{ parseError }` marker on an otherwise\n * SUCCEEDED row.\n *\n * Two rules govern this file:\n *\n * 1. NOTHING IS HIDDEN. A payload shape this module does not recognise is still\n * rendered, key by key, via `extra`. A card that silently drops unknown keys\n * is how a failed decision reads as an empty success.\n * 2. NOTHING IS CAST. Every read is a guarded lookup on `unknown`, so a payload\n * that disagrees with the shape we expect degrades to \"shown generically\"\n * rather than to a runtime crash inside the render.\n */\n\nimport type { AthAiAssessment } from '../types';\n\n/** One rendered key/value pair from a JSON payload. */\nexport interface AiPayloadEntry {\n key: string;\n label: string;\n value: string;\n}\n\nexport type AiDecisionKind =\n /** No decision recorded (a FAILED run never reached one). */\n | 'none'\n /** The provider replied but the reply was unusable — `{ parseError }`. */\n | 'parse-failure'\n /** `athAdjustPlanFromPerformance` — the AI's read of an athlete's trend. */\n | 'assessment'\n /** `athOverrideAgentRun` — a coach's review of a prior decision. */\n | 'override'\n /** `athGenerateProgram` — a generated multi-week plan. */\n | 'program-plan'\n /** Recognisably JSON, but not a shape this build knows. */\n | 'other';\n\nexport interface AiDecisionSummary {\n kind: AiDecisionKind;\n /** Short headline for the decision card. */\n title: string;\n /** True when the card must read as a failure, not as an empty success. */\n isFailure: boolean;\n assessment: AthAiAssessment | null;\n /** Resolution written by the engine: PROPOSED / ACCEPTED / OVERRIDDEN. */\n status: string | null;\n rationale: string | null;\n note: string | null;\n confidence: number | null;\n recommendedWeeklyLoadChangePct: number | null;\n flags: string[];\n parseError: string | null;\n /** Every payload key not surfaced in a dedicated field above. */\n extra: AiPayloadEntry[];\n}\n\nconst ASSESSMENT_VALUES: readonly AthAiAssessment[] = [\n 'AT_RISK',\n 'DELOAD',\n 'MAINTAIN',\n 'PROGRESSION',\n];\n\n/** Keys rendered through a dedicated field on {@link AiDecisionSummary}. */\nconst DEDICATED_DECISION_KEYS = new Set([\n 'assessment',\n 'status',\n 'rationale',\n 'note',\n 'confidence',\n 'recommendedWeeklyLoadChangePct',\n 'flags',\n 'parseError',\n]);\n\n/** Human labels for the provenance keys the decision engine actually writes. */\nconst PAYLOAD_LABELS: Record<string, string> = {\n agentRunId: 'Agent run',\n athleteId: 'Athlete',\n avgRpe: 'Average RPE',\n avgTotalLoad: 'Average total load',\n constraints: 'Constraints',\n decidedAt: 'Decided at',\n decidedBy: 'Decided by',\n goals: 'Goals',\n level: 'Level',\n loadTrend: 'Load trend',\n metricCount: 'Metrics considered',\n metricSummaries: 'Metric summaries',\n programId: 'Program',\n proposedAssessment: 'AI proposed',\n requestedWeeks: 'Requested weeks',\n rpeTrend: 'RPE trend',\n source: 'Source',\n sport: 'Sport',\n statusCounts: 'Workout status counts',\n supersedesRunId: 'Supersedes run',\n teamId: 'Team',\n weeks: 'Weeks',\n workoutLogCount: 'Workout logs considered',\n};\n\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** Title-cased label for a payload key (`avgRpe` → `Avg rpe`). */\nexport function humanizePayloadKey(key: string): string {\n const known = PAYLOAD_LABELS[key];\n if (known) {\n return known;\n }\n const spaced = key\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .replace(/[_-]+/g, ' ')\n .trim()\n .toLowerCase();\n return spaced ? spaced.charAt(0).toUpperCase() + spaced.slice(1) : key;\n}\n\n/** Render any JSON value as a single readable line. */\nexport function formatPayloadValue(value: unknown): string {\n if (value === null || value === undefined) {\n return '—';\n }\n if (typeof value === 'string') {\n return value.trim() ? value : '—';\n }\n if (typeof value === 'number') {\n return Number.isFinite(value) ? String(value) : '—';\n }\n if (typeof value === 'boolean') {\n return value ? 'Yes' : 'No';\n }\n if (Array.isArray(value)) {\n return value.length === 0 ? '—' : value.map((item) => formatPayloadValue(item)).join(', ');\n }\n if (isRecord(value)) {\n const parts = Object.entries(value).map(\n ([key, nested]) => `${humanizePayloadKey(key)}: ${formatPayloadValue(nested)}`\n );\n return parts.length === 0 ? '—' : parts.join(' · ');\n }\n return String(value);\n}\n\n/** Flatten a JSON payload into ordered, renderable entries. Never drops a key. */\nexport function toPayloadEntries(\n payload: unknown,\n skipKeys?: ReadonlySet<string>\n): AiPayloadEntry[] {\n if (!isRecord(payload)) {\n return [];\n }\n return Object.entries(payload)\n .filter(([key]) => !skipKeys?.has(key))\n .map(([key, value]) => ({\n key,\n label: humanizePayloadKey(key),\n value: formatPayloadValue(value),\n }));\n}\n\n/**\n * Provenance entries for a run's `inputRefs` — the ids and aggregate stats the\n * model actually considered. Keys whose value is null/undefined are dropped\n * (the engine writes `{ teamId, athleteId }` with one of them unset).\n */\nexport function toProvenanceEntries(inputRefs: unknown): AiPayloadEntry[] {\n if (!isRecord(inputRefs)) {\n return [];\n }\n return Object.entries(inputRefs)\n .filter(([, value]) => value !== null && value !== undefined)\n .map(([key, value]) => ({\n key,\n label: humanizePayloadKey(key),\n value: formatPayloadValue(value),\n }));\n}\n\nfunction readString(record: Record<string, unknown>, key: string): string | null {\n const value = record[key];\n return typeof value === 'string' && value.trim() ? value : null;\n}\n\nfunction readNumber(record: Record<string, unknown>, key: string): number | null {\n const value = record[key];\n return typeof value === 'number' && Number.isFinite(value) ? value : null;\n}\n\nfunction readAssessment(record: Record<string, unknown>): AthAiAssessment | null {\n const value = record.assessment;\n return typeof value === 'string' && (ASSESSMENT_VALUES as readonly string[]).includes(value)\n ? (value as AthAiAssessment)\n : null;\n}\n\nfunction readFlags(record: Record<string, unknown>): string[] {\n const value = record.flags;\n if (!Array.isArray(value)) {\n return [];\n }\n return value.filter((flag): flag is string => typeof flag === 'string' && flag.trim().length > 0);\n}\n\nconst EMPTY_SUMMARY: Omit<AiDecisionSummary, 'kind' | 'title' | 'isFailure'> = {\n assessment: null,\n status: null,\n rationale: null,\n note: null,\n confidence: null,\n recommendedWeeklyLoadChangePct: null,\n flags: [],\n parseError: null,\n extra: [],\n};\n\n/**\n * Classify and unpack a ledger row's `decision` payload for rendering.\n *\n * A `parseError` payload is classified as a FAILURE even though the ledger row\n * itself is SUCCEEDED (the provider answered; the answer was unusable) — that\n * distinction is the whole point of recording it, so the card must show it.\n */\nexport function summarizeDecision(decision: unknown): AiDecisionSummary {\n if (decision === null || decision === undefined) {\n return { kind: 'none', title: 'No decision recorded', isFailure: false, ...EMPTY_SUMMARY };\n }\n\n if (!isRecord(decision)) {\n return {\n kind: 'other',\n title: 'Decision payload',\n isFailure: false,\n ...EMPTY_SUMMARY,\n extra: [{ key: 'value', label: 'Value', value: formatPayloadValue(decision) }],\n };\n }\n\n const parseError = readString(decision, 'parseError');\n if (parseError) {\n return {\n kind: 'parse-failure',\n title: 'Unusable model reply',\n isFailure: true,\n ...EMPTY_SUMMARY,\n parseError,\n extra: toPayloadEntries(decision, DEDICATED_DECISION_KEYS),\n };\n }\n\n const assessment = readAssessment(decision);\n const note = readString(decision, 'note');\n const status = readString(decision, 'status');\n const rationale = readString(decision, 'rationale');\n const extra = toPayloadEntries(decision, DEDICATED_DECISION_KEYS);\n\n if (assessment && note) {\n // A coach override: assessment + note + resolution status, no rationale.\n return {\n ...EMPTY_SUMMARY,\n kind: 'override',\n title: 'Coach decision',\n isFailure: false,\n assessment,\n status,\n note,\n rationale,\n flags: readFlags(decision),\n extra,\n };\n }\n\n if (assessment) {\n return {\n ...EMPTY_SUMMARY,\n kind: 'assessment',\n title: 'Performance assessment',\n isFailure: false,\n assessment,\n status,\n rationale,\n confidence: readNumber(decision, 'confidence'),\n recommendedWeeklyLoadChangePct: readNumber(decision, 'recommendedWeeklyLoadChangePct'),\n flags: readFlags(decision),\n extra,\n };\n }\n\n if (Array.isArray(decision.weeks)) {\n return {\n ...EMPTY_SUMMARY,\n kind: 'program-plan',\n title: 'Generated training plan',\n isFailure: false,\n rationale,\n extra,\n };\n }\n\n return {\n ...EMPTY_SUMMARY,\n kind: 'other',\n title: 'Decision payload',\n isFailure: false,\n status,\n rationale,\n note,\n flags: readFlags(decision),\n extra,\n };\n}\n\n/** Format a confidence in 0–1 as a percentage, or null when absent. */\nexport function formatConfidence(confidence: number | null): string | null {\n if (confidence === null) {\n return null;\n }\n const clamped = Math.min(Math.max(confidence, 0), 1);\n return `${Math.round(clamped * 100)}%`;\n}\n\n/** Format a signed weekly-load change, e.g. `-10%` / `+5%`. */\nexport function formatLoadChange(pct: number | null): string | null {\n if (pct === null) {\n return null;\n }\n const rounded = Math.round(pct * 10) / 10;\n return `${rounded > 0 ? '+' : ''}${rounded}%`;\n}\n\n/**\n * The program an override can legally be filed against, read off the run's\n * provenance. `athAdjustPlanFromPerformance` and earlier overrides name it in\n * `inputRefs.programId`; `athGenerateProgram` runs BEFORE the program exists,\n * so its runs carry no program id and the coach must choose one (the service\n * validates the link and answers NOT_FOUND when the run never touched it).\n */\nexport function programIdFromInputRefs(inputRefs: unknown): string | null {\n if (!isRecord(inputRefs)) {\n return null;\n }\n return readString(inputRefs, 'programId');\n}\n\n/**\n * Where an AI proposal stands, read from its program's `context.lastAiAdjustment`.\n *\n * - `pending` — the program's current read IS this run and no coach has\n * resolved it yet (status PROPOSED). Accept/override applies.\n * - `accepted` /\n * `overridden` — a coach resolved THIS run (`overridesRunId` names it).\n * - `superseded` — the program has moved on to a different, later read.\n * - `unknown` — the program carries no AI read at all (or is unreadable).\n */\nexport type ProposalState = 'pending' | 'accepted' | 'overridden' | 'superseded' | 'unknown';\n\nexport function proposalStateFor(runId: string, programContext: unknown): ProposalState {\n const adjustment = isRecord(programContext) ? programContext.lastAiAdjustment : null;\n if (!isRecord(adjustment)) return 'unknown';\n const status = typeof adjustment.status === 'string' ? adjustment.status : null;\n if (adjustment.overridesRunId === runId) {\n if (status === 'ACCEPTED') return 'accepted';\n if (status === 'OVERRIDDEN') return 'overridden';\n }\n if (adjustment.agentRunId === runId) {\n return status === 'PROPOSED' ? 'pending' : 'unknown';\n }\n return 'superseded';\n}\n"],"mappings":";AA8DA,IAAMA,IAAgD;CACpD;CACA;CACA;CACA;AACF,GAGMC,oBAA0B,IAAI,IAAI;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,GAGKC,IAAyC;CAC7C,YAAY;CACZ,WAAW;CACX,QAAQ;CACR,cAAc;CACd,aAAa;CACb,WAAW;CACX,WAAW;CACX,OAAO;CACP,OAAO;CACP,WAAW;CACX,aAAa;CACb,iBAAiB;CACjB,WAAW;CACX,oBAAoB;CACpB,gBAAgB;CAChB,UAAU;CACV,QAAQ;CACR,OAAO;CACP,cAAc;CACd,iBAAiB;CACjB,QAAQ;CACR,OAAO;CACP,iBAAiB;AACnB;AAEA,SAAgBC,EAAS,GAAkD;CACzE,OAAO,OAAOC,KAAU,cAAYA,KAAkB,CAAC,MAAM,QAAQA,CAAK;AAC5E;AAGA,SAAgBC,EAAmB,GAAqB;CACtD,IAAMC,IAAQJ,EAAeK;CAC7B,IAAID,GACF,OAAOA;CAET,IAAME,IAASD,EACZ,QAAQ,sBAAsB,OAAO,CAAC,CACtC,QAAQ,UAAU,GAAG,CAAC,CACtB,KAAK,CAAC,CACN,YAAY;CACf,OAAOC,IAASA,EAAO,OAAO,CAAC,CAAC,CAAC,YAAY,IAAIA,EAAO,MAAM,CAAC,IAAID;AACrE;AAGA,SAAgBE,EAAmB,GAAwB;CACzD,IAAIL,KAAU,MACZ,OAAO;CAET,IAAI,OAAOA,KAAU,UACnB,OAAOA,EAAM,KAAK,IAAIA,IAAQ;CAEhC,IAAI,OAAOA,KAAU,UACnB,OAAO,OAAO,SAASA,CAAK,IAAI,OAAOA,CAAK,IAAI;CAElD,IAAI,OAAOA,KAAU,WACnB,OAAOA,IAAQ,QAAQ;CAEzB,IAAI,MAAM,QAAQA,CAAK,GACrB,OAAOA,EAAM,WAAW,IAAI,MAAMA,EAAM,KAAK,MAASK,EAAmBC,CAAI,CAAC,CAAC,CAAC,KAAK,IAAI;CAE3F,IAAIP,EAASC,CAAK,GAAG;EACnB,IAAMO,IAAQ,OAAO,QAAQP,CAAK,CAAC,CAAC,KACjC,CAACG,GAAKK,OAAY,GAAGP,EAAmBE,CAAG,EAAE,IAAIE,EAAmBG,CAAM,GAC7E;EACA,OAAOD,EAAM,WAAW,IAAI,MAAMA,EAAM,KAAK,KAAK;CACpD;CACA,OAAO,OAAOP,CAAK;AACrB;AAGA,SAAgBS,EACd,GACA,GACkB;CAIlB,OAHKV,EAASW,CAAO,IAGd,OAAO,QAAQA,CAAO,CAAC,CAC3B,QAAQ,CAACP,OAAS,CAACQ,GAAU,IAAIR,CAAG,CAAC,CAAC,CACtC,KAAK,CAACA,GAAKH,QAAY;EACtB;EACA,OAAOC,EAAmBE,CAAG;EAC7B,OAAOE,EAAmBL,CAAK;CACjC,EAAE,IARK,CAAC;AASZ;AAOA,SAAgBY,EAAoB,GAAsC;CAIxE,OAHKb,EAASc,CAAS,IAGhB,OAAO,QAAQA,CAAS,CAAC,CAC7B,QAAQ,GAAGb,OAAWA,KAAU,IAA2B,CAAC,CAC5D,KAAK,CAACG,GAAKH,QAAY;EACtB;EACA,OAAOC,EAAmBE,CAAG;EAC7B,OAAOE,EAAmBL,CAAK;CACjC,EAAE,IARK,CAAC;AASZ;AAEA,SAASc,EAAW,GAAiC,GAA4B;CAC/E,IAAMd,IAAQe,EAAOZ;CACrB,OAAO,OAAOH,KAAU,YAAYA,EAAM,KAAK,IAAIA,IAAQ;AAC7D;AAEA,SAASgB,EAAW,GAAiC,GAA4B;CAC/E,IAAMhB,IAAQe,EAAOZ;CACrB,OAAO,OAAOH,KAAU,YAAY,OAAO,SAASA,CAAK,IAAIA,IAAQ;AACvE;AAEA,SAASiB,EAAe,GAAyD;CAC/E,IAAMjB,IAAQe,EAAO;CACrB,OAAO,OAAOf,KAAU,YAAaJ,EAAwC,SAASI,CAAK,IACtFA,IACD;AACN;AAEA,SAASkB,EAAU,GAA2C;CAC5D,IAAMlB,IAAQe,EAAO;CAIrB,OAHK,MAAM,QAAQf,CAAK,IAGjBA,EAAM,QAAQ,MAAyB,OAAOmB,KAAS,YAAYA,EAAK,KAAK,CAAC,CAAC,SAAS,CAAC,IAFvF,CAAC;AAGZ;AAEA,IAAMC,IAAyE;CAC7E,YAAY;CACZ,QAAQ;CACR,WAAW;CACX,MAAM;CACN,YAAY;CACZ,gCAAgC;CAChC,OAAO,CAAC;CACR,YAAY;CACZ,OAAO,CAAC;AACV;AASA,SAAgBC,EAAkB,GAAsC;CACtE,IAAIC,KAAa,MACf,OAAO;EAAE,MAAM;EAAQ,OAAO;EAAwB,WAAW;EAAO,GAAGF;CAAc;CAG3F,IAAI,CAACrB,EAASuB,CAAQ,GACpB,OAAO;EACL,MAAM;EACN,OAAO;EACP,WAAW;EACX,GAAGF;EACH,OAAO,CAAC;GAAE,KAAK;GAAS,OAAO;GAAS,OAAOf,EAAmBiB,CAAQ;EAAE,CAAC;CAC/E;CAGF,IAAMC,IAAaT,EAAWQ,GAAU,YAAY;CACpD,IAAIC,GACF,OAAO;EACL,MAAM;EACN,OAAO;EACP,WAAW;EACX,GAAGH;EACH;EACA,OAAOX,EAAiBa,GAAUzB,CAAuB;CAC3D;CAGF,IAAM2B,IAAaP,EAAeK,CAAQ,GACpCG,IAAOX,EAAWQ,GAAU,MAAM,GAClCI,IAASZ,EAAWQ,GAAU,QAAQ,GACtCK,IAAYb,EAAWQ,GAAU,WAAW,GAC5CM,IAAQnB,EAAiBa,GAAUzB,CAAuB;CA6ChE,OA3CI2B,KAAcC,IAET;EACL,GAAGL;EACH,MAAM;EACN,OAAO;EACP,WAAW;EACX;EACA;EACA;EACA;EACA,OAAOF,EAAUI,CAAQ;EACzB;CACF,IAGEE,IACK;EACL,GAAGJ;EACH,MAAM;EACN,OAAO;EACP,WAAW;EACX;EACA;EACA;EACA,YAAYJ,EAAWM,GAAU,YAAY;EAC7C,gCAAgCN,EAAWM,GAAU,gCAAgC;EACrF,OAAOJ,EAAUI,CAAQ;EACzB;CACF,IAGE,MAAM,QAAQA,EAAS,KAAK,IACvB;EACL,GAAGF;EACH,MAAM;EACN,OAAO;EACP,WAAW;EACX;EACA;CACF,IAGK;EACL,GAAGA;EACH,MAAM;EACN,OAAO;EACP,WAAW;EACX;EACA;EACA;EACA,OAAOF,EAAUI,CAAQ;EACzB;CACF;AACF;AAGA,SAAgBO,EAAiB,GAA0C;CAKzE,OAJIC,MAAe,OACV,OAGF,GAAG,KAAK,MADC,KAAK,IAAI,KAAK,IAAIA,GAAY,CAAC,GAAG,CAC7B,IAAU,GAAG,EAAE;AACtC;AAGA,SAAgBC,EAAiB,GAAmC;CAClE,IAAIC,MAAQ,MACV,OAAO;CAET,IAAMC,IAAU,KAAK,MAAMD,IAAM,EAAE,IAAI;CACvC,OAAO,GAAGC,IAAU,IAAI,MAAM,KAAKA,EAAQ;AAC7C;AASA,SAAgBC,EAAuB,GAAmC;CAIxE,OAHKnC,EAASc,CAAS,IAGhBC,EAAWD,GAAW,WAAW,IAF/B;AAGX;AAcA,SAAgBsB,EAAiB,GAAe,GAAwC;CACtF,IAAMC,IAAarC,EAASsC,CAAc,IAAIA,EAAe,mBAAmB;CAChF,IAAI,CAACtC,EAASqC,CAAU,GAAG,OAAO;CAClC,IAAMV,IAAS,OAAOU,EAAW,UAAW,WAAWA,EAAW,SAAS;CAC3E,IAAIA,EAAW,mBAAmBE,GAAO;EACvC,IAAIZ,MAAW,YAAY,OAAO;EAClC,IAAIA,MAAW,cAAc,OAAO;CACtC;CAIA,OAHIU,EAAW,eAAeE,IACrBZ,MAAW,aAAa,YAAY,YAEtC;AACT"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import e from "../../node_modules/clsx/dist/clsx.js";
|
|
1
|
+
import { clsx as e } from "../../node_modules/clsx/dist/clsx.js";
|
|
2
2
|
import { twMerge as t } from "../../node_modules/tailwind-merge/dist/bundle-mjs.js";
|
|
3
|
-
|
|
3
|
+
// src/atheletebridge/utils/cn.ts
|
|
4
4
|
function n(...n) {
|
|
5
5
|
return t(e(n));
|
|
6
6
|
}
|
|
7
|
-
//#endregion
|
|
8
7
|
export { n as cn };
|
|
9
8
|
|
|
10
9
|
//# sourceMappingURL=cn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cn.js","names":[],"sources":["../../../src/atheletebridge/utils/cn.ts"],"sourcesContent":["/**\n * Class name utility\n * @module atheletebridge/utils\n */\n\nimport { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;AAQA,
|
|
1
|
+
{"version":3,"file":"cn.js","names":["cn","inputs","twMerge","clsx"],"sources":["../../../src/atheletebridge/utils/cn.ts"],"sourcesContent":["/**\n * Class name utility\n * @module atheletebridge/utils\n */\n\nimport { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;AAQA,SAAgBA,EAAG,GAAGC,GAA8B;CAClD,OAAOC,EAAQC,EAAKF,CAAM,CAAC;AAC7B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/atheletebridge/utils/datetime.ts
|
|
2
2
|
function e(e) {
|
|
3
3
|
if (!e) return;
|
|
4
4
|
let t = new Date(e);
|
|
@@ -11,7 +11,6 @@ function t(e) {
|
|
|
11
11
|
let n = (e) => String(e).padStart(2, "0");
|
|
12
12
|
return `${t.getFullYear()}-${n(t.getMonth() + 1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`;
|
|
13
13
|
}
|
|
14
|
-
//#endregion
|
|
15
14
|
export { t as isoToLocalInput, e as toIsoOrUndefined };
|
|
16
15
|
|
|
17
16
|
//# sourceMappingURL=datetime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datetime.js","names":[],"sources":["../../../src/atheletebridge/utils/datetime.ts"],"sourcesContent":["/**\n * Datetime helpers for form inputs\n * @module atheletebridge/utils/datetime\n */\n\n/**\n * Convert a `datetime-local` input value to an ISO string, or undefined when\n * the value is empty. Returns undefined for unparseable values so callers never\n * send \"Invalid Date\" to the API.\n */\nexport function toIsoOrUndefined(value: string): string | undefined {\n if (!value) return undefined;\n const d = new Date(value);\n return Number.isNaN(d.getTime()) ? undefined : d.toISOString();\n}\n\n/**\n * Convert an ISO datetime string into the `datetime-local` input format\n * (`YYYY-MM-DDTHH:mm`) in the browser's local timezone.\n */\nexport function isoToLocalInput(iso: string | null | undefined): string {\n if (!iso) return '';\n const d = new Date(iso);\n if (Number.isNaN(d.getTime())) return '';\n const pad = (n: number) => String(n).padStart(2, '0');\n return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(\n d.getHours()\n )}:${pad(d.getMinutes())}`;\n}\n"],"mappings":";AAUA,
|
|
1
|
+
{"version":3,"file":"datetime.js","names":["toIsoOrUndefined","value","d","isoToLocalInput","iso","pad","n"],"sources":["../../../src/atheletebridge/utils/datetime.ts"],"sourcesContent":["/**\n * Datetime helpers for form inputs\n * @module atheletebridge/utils/datetime\n */\n\n/**\n * Convert a `datetime-local` input value to an ISO string, or undefined when\n * the value is empty. Returns undefined for unparseable values so callers never\n * send \"Invalid Date\" to the API.\n */\nexport function toIsoOrUndefined(value: string): string | undefined {\n if (!value) return undefined;\n const d = new Date(value);\n return Number.isNaN(d.getTime()) ? undefined : d.toISOString();\n}\n\n/**\n * Convert an ISO datetime string into the `datetime-local` input format\n * (`YYYY-MM-DDTHH:mm`) in the browser's local timezone.\n */\nexport function isoToLocalInput(iso: string | null | undefined): string {\n if (!iso) return '';\n const d = new Date(iso);\n if (Number.isNaN(d.getTime())) return '';\n const pad = (n: number) => String(n).padStart(2, '0');\n return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(\n d.getHours()\n )}:${pad(d.getMinutes())}`;\n}\n"],"mappings":";AAUA,SAAgBA,EAAiB,GAAmC;CAClE,IAAI,CAACC,GAAO;CACZ,IAAMC,IAAI,IAAI,KAAKD,CAAK;CACxB,OAAO,OAAO,MAAMC,EAAE,QAAQ,CAAC,IAAI,KAAA,IAAYA,EAAE,YAAY;AAC/D;AAMA,SAAgBC,EAAgB,GAAwC;CACtE,IAAI,CAACC,GAAK,OAAO;CACjB,IAAMF,IAAI,IAAI,KAAKE,CAAG;CACtB,IAAI,OAAO,MAAMF,EAAE,QAAQ,CAAC,GAAG,OAAO;CACtC,IAAMG,KAAO,MAAc,OAAOC,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG;CACpD,OAAO,GAAGJ,EAAE,YAAY,EAAE,GAAGG,EAAIH,EAAE,SAAS,IAAI,CAAC,EAAE,GAAGG,EAAIH,EAAE,QAAQ,CAAC,EAAE,GAAGG,EACxEH,EAAE,SAAS,CACb,EAAE,GAAGG,EAAIH,EAAE,WAAW,CAAC;AACzB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AthFixture } from '../types';
|
|
2
|
-
|
|
3
2
|
/** `extraTime*Score` / `penalty*Score` on AthFixture and AthRecordResultInput. */
|
|
4
3
|
export declare const FIXTURE_KNOCKOUT_SCORES_LIVE = false;
|
|
5
4
|
/** `cricketScorecard` on AthFixture and AthRecordResultInput. */
|
|
@@ -16,4 +15,3 @@ export declare function fixtureOutcomeSelection(cricketScorecardSelection: strin
|
|
|
16
15
|
export declare function normalizeFixture<T extends Partial<AthFixture>>(fixture: T): T;
|
|
17
16
|
/** `normalizeFixture` over a nullable value. */
|
|
18
17
|
export declare function normalizeFixtureOrNull<T extends Partial<AthFixture>>(fixture: T | null): T | null;
|
|
19
|
-
//# sourceMappingURL=fixtureCapabilities.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
// src/atheletebridge/utils/fixtureCapabilities.ts
|
|
2
2
|
function e(e) {
|
|
3
|
-
return
|
|
3
|
+
return "";
|
|
4
4
|
}
|
|
5
5
|
function t(e) {
|
|
6
6
|
return {
|
|
@@ -15,7 +15,6 @@ function t(e) {
|
|
|
15
15
|
function n(e) {
|
|
16
16
|
return e ? t(e) : null;
|
|
17
17
|
}
|
|
18
|
-
//#endregion
|
|
19
18
|
export { e as fixtureOutcomeSelection, t as normalizeFixture, n as normalizeFixtureOrNull };
|
|
20
19
|
|
|
21
20
|
//# sourceMappingURL=fixtureCapabilities.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtureCapabilities.js","names":[],"sources":["../../../src/atheletebridge/utils/fixtureCapabilities.ts"],"sourcesContent":["/**\n * Fixture fields the deployed backend can serve.\n * @module atheletebridge/utils/fixtureCapabilities\n *\n * The knockout-outcome scores (BOFF-7640: extra time and penalties) and the\n * cricket scorecard (BOFF-7644) shipped in this MFE before the matching\n * `wspace-atheletebridge-svc` changes (svc PRs #9 and #10, still in review).\n * The gateway validates every operation against the composed supergraph, so\n * selecting a field the subgraph does not publish fails the WHOLE operation\n * with GRAPHQL_VALIDATION_FAILED. In production that took down the fixture\n * list, the fixture detail page and the team detail page (\"Team not found\").\n *\n * Until the backend publishes those fields, they are left out of every\n * selection and normalised to `null`, which every reader already treats as\n * \"not recorded\". The UI for entering them stays hidden for the same reason.\n * Flip the matching flag once the svc release that adds the field is live in\n * both alpha and production.\n */\n\nimport type { AthFixture } from '../types';\n\n/** `extraTime*Score` / `penalty*Score` on AthFixture and AthRecordResultInput. */\nexport const FIXTURE_KNOCKOUT_SCORES_LIVE = false;\n\n/** `cricketScorecard` on AthFixture and AthRecordResultInput. */\nexport const FIXTURE_CRICKET_SCORECARD_LIVE = false;\n\nconst KNOCKOUT_SCORE_FIELDS = [\n 'extraTimeHomeScore',\n 'extraTimeAwayScore',\n 'penaltyHomeScore',\n 'penaltyAwayScore',\n] as const;\n\n/**\n * The optional part of a fixture selection, built from the flags above.\n * `cricketScorecardSelection` is the scorecard's own sub-selection.\n */\nexport function fixtureOutcomeSelection(cricketScorecardSelection: string): string {\n const parts: string[] = [];\n if (FIXTURE_KNOCKOUT_SCORES_LIVE) parts.push(KNOCKOUT_SCORE_FIELDS.join(' '));\n if (FIXTURE_CRICKET_SCORECARD_LIVE)\n parts.push(`cricketScorecard { ${cricketScorecardSelection} }`);\n return parts.join('\\n');\n}\n\n/**\n * Fill the fields that were not selected with `null`, so a reader that checks\n * `!== null` never mistakes an absent value for a recorded one.\n */\nexport function normalizeFixture<T extends Partial<AthFixture>>(fixture: T): T {\n return {\n ...fixture,\n extraTimeHomeScore: fixture.extraTimeHomeScore ?? null,\n extraTimeAwayScore: fixture.extraTimeAwayScore ?? null,\n penaltyHomeScore: fixture.penaltyHomeScore ?? null,\n penaltyAwayScore: fixture.penaltyAwayScore ?? null,\n cricketScorecard: fixture.cricketScorecard ?? null,\n };\n}\n\n/** `normalizeFixture` over a nullable value. */\nexport function normalizeFixtureOrNull<T extends Partial<AthFixture>>(fixture: T | null): T | null {\n return fixture ? normalizeFixture(fixture) : null;\n}\n"],"mappings":";AAsCA,
|
|
1
|
+
{"version":3,"file":"fixtureCapabilities.js","names":["fixtureOutcomeSelection","normalizeFixture","fixture","normalizeFixtureOrNull"],"sources":["../../../src/atheletebridge/utils/fixtureCapabilities.ts"],"sourcesContent":["/**\n * Fixture fields the deployed backend can serve.\n * @module atheletebridge/utils/fixtureCapabilities\n *\n * The knockout-outcome scores (BOFF-7640: extra time and penalties) and the\n * cricket scorecard (BOFF-7644) shipped in this MFE before the matching\n * `wspace-atheletebridge-svc` changes (svc PRs #9 and #10, still in review).\n * The gateway validates every operation against the composed supergraph, so\n * selecting a field the subgraph does not publish fails the WHOLE operation\n * with GRAPHQL_VALIDATION_FAILED. In production that took down the fixture\n * list, the fixture detail page and the team detail page (\"Team not found\").\n *\n * Until the backend publishes those fields, they are left out of every\n * selection and normalised to `null`, which every reader already treats as\n * \"not recorded\". The UI for entering them stays hidden for the same reason.\n * Flip the matching flag once the svc release that adds the field is live in\n * both alpha and production.\n */\n\nimport type { AthFixture } from '../types';\n\n/** `extraTime*Score` / `penalty*Score` on AthFixture and AthRecordResultInput. */\nexport const FIXTURE_KNOCKOUT_SCORES_LIVE = false;\n\n/** `cricketScorecard` on AthFixture and AthRecordResultInput. */\nexport const FIXTURE_CRICKET_SCORECARD_LIVE = false;\n\nconst KNOCKOUT_SCORE_FIELDS = [\n 'extraTimeHomeScore',\n 'extraTimeAwayScore',\n 'penaltyHomeScore',\n 'penaltyAwayScore',\n] as const;\n\n/**\n * The optional part of a fixture selection, built from the flags above.\n * `cricketScorecardSelection` is the scorecard's own sub-selection.\n */\nexport function fixtureOutcomeSelection(cricketScorecardSelection: string): string {\n const parts: string[] = [];\n if (FIXTURE_KNOCKOUT_SCORES_LIVE) parts.push(KNOCKOUT_SCORE_FIELDS.join(' '));\n if (FIXTURE_CRICKET_SCORECARD_LIVE)\n parts.push(`cricketScorecard { ${cricketScorecardSelection} }`);\n return parts.join('\\n');\n}\n\n/**\n * Fill the fields that were not selected with `null`, so a reader that checks\n * `!== null` never mistakes an absent value for a recorded one.\n */\nexport function normalizeFixture<T extends Partial<AthFixture>>(fixture: T): T {\n return {\n ...fixture,\n extraTimeHomeScore: fixture.extraTimeHomeScore ?? null,\n extraTimeAwayScore: fixture.extraTimeAwayScore ?? null,\n penaltyHomeScore: fixture.penaltyHomeScore ?? null,\n penaltyAwayScore: fixture.penaltyAwayScore ?? null,\n cricketScorecard: fixture.cricketScorecard ?? null,\n };\n}\n\n/** `normalizeFixture` over a nullable value. */\nexport function normalizeFixtureOrNull<T extends Partial<AthFixture>>(fixture: T | null): T | null {\n return fixture ? normalizeFixture(fixture) : null;\n}\n"],"mappings":";AAsCA,SAAgBA,EAAwB,GAA2C;CAKjF,OAAO;AACT;AAMA,SAAgBC,EAAgD,GAAe;CAC7E,OAAO;EACL,GAAGC;EACH,oBAAoBA,EAAQ,sBAAsB;EAClD,oBAAoBA,EAAQ,sBAAsB;EAClD,kBAAkBA,EAAQ,oBAAoB;EAC9C,kBAAkBA,EAAQ,oBAAoB;EAC9C,kBAAkBA,EAAQ,oBAAoB;CAChD;AACF;AAGA,SAAgBC,EAAsD,GAA6B;CACjG,OAAOD,IAAUD,EAAiBC,CAAO,IAAI;AAC/C"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AthFixtureStatus } from '../types';
|
|
2
|
-
|
|
3
2
|
export interface FixtureLifecycleActions {
|
|
4
3
|
canReschedule: boolean;
|
|
5
4
|
canPostpone: boolean;
|
|
@@ -35,4 +34,3 @@ export declare function initialScheduleInputs(kind: 'reschedule' | 'postpone', f
|
|
|
35
34
|
scheduledAtInput: string;
|
|
36
35
|
kickoffAtInput: string;
|
|
37
36
|
};
|
|
38
|
-
//# sourceMappingURL=fixtureLifecycle.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isoToLocalInput as e, toIsoOrUndefined as t } from "./datetime.js";
|
|
2
|
-
|
|
2
|
+
// src/atheletebridge/utils/fixtureLifecycle.ts
|
|
3
3
|
function n(e) {
|
|
4
4
|
let t = e === "SCHEDULED" || e === "POSTPONED";
|
|
5
5
|
return {
|
|
@@ -24,7 +24,6 @@ function i(t, n, r = Date.now()) {
|
|
|
24
24
|
kickoffAtInput: a ? e(n.kickoffAt) : ""
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
//#endregion
|
|
28
27
|
export { r as buildScheduleInput, n as getFixtureLifecycleActions, i as initialScheduleInputs };
|
|
29
28
|
|
|
30
29
|
//# sourceMappingURL=fixtureLifecycle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtureLifecycle.js","names":[],"sources":["../../../src/atheletebridge/utils/fixtureLifecycle.ts"],"sourcesContent":["/**\n * Fixture lifecycle rules for the detail page (BOFF-7642).\n *\n * These mirror the backend guards in `wspace-atheletebridge-svc`\n * (`updateFixture` / `postponeFixture` / `cancelFixture`). The backend is the\n * authority — it rejects an invalid transition regardless of what the UI\n * offers — this only keeps the page from showing actions that cannot succeed.\n * @module atheletebridge/utils/fixtureLifecycle\n */\n\nimport type { AthFixtureStatus } from '../types';\nimport { isoToLocalInput, toIsoOrUndefined } from './datetime';\n\nexport interface FixtureLifecycleActions {\n canReschedule: boolean;\n canPostpone: boolean;\n canCancel: boolean;\n}\n\n/**\n * Which lifecycle actions a fixture in `status` offers. Rescheduling a\n * POSTPONED fixture returns it to SCHEDULED; only SCHEDULED or LIVE fixtures\n * can be postponed; anything not yet final can be cancelled. COMPLETED and\n * CANCELLED are terminal and offer nothing.\n */\nexport function getFixtureLifecycleActions(status: AthFixtureStatus): FixtureLifecycleActions {\n const canReschedule = status === 'SCHEDULED' || status === 'POSTPONED';\n const canPostpone = status === 'SCHEDULED' || status === 'LIVE';\n const canCancel = canReschedule || status === 'LIVE';\n return { canReschedule, canPostpone, canCancel };\n}\n\nexport interface ScheduleInput {\n scheduledAt: string;\n kickoffAt?: string;\n}\n\n/**\n * Build the mutation input from the dialog's `datetime-local` values, or null\n * when no valid schedule was picked (the caller shows a validation toast\n * instead of calling the API).\n */\nexport function buildScheduleInput(\n scheduledAtInput: string,\n kickoffAtInput: string\n): ScheduleInput | null {\n const scheduledAt = toIsoOrUndefined(scheduledAtInput);\n if (!scheduledAt) return null;\n const kickoffAt = toIsoOrUndefined(kickoffAtInput);\n return kickoffAt ? { scheduledAt, kickoffAt } : { scheduledAt };\n}\n\n/**\n * Initial dialog values. The kickoff belongs to the schedule being replaced,\n * so it is only carried over while it is still in the future — a past or\n * stale kickoff would be rejected by the backend (or, for a postponement,\n * pin the fixture to its old kickoff). Postponing starts from a blank kickoff.\n */\nexport function initialScheduleInputs(\n kind: 'reschedule' | 'postpone',\n fixture: { scheduledAt?: string | null; kickoffAt?: string | null },\n now: number = Date.now()\n): { scheduledAtInput: string; kickoffAtInput: string } {\n const kickoff = fixture.kickoffAt ? new Date(fixture.kickoffAt).getTime() : NaN;\n const keepKickoff = kind === 'reschedule' && Number.isFinite(kickoff) && kickoff > now;\n return {\n scheduledAtInput: isoToLocalInput(fixture.scheduledAt),\n kickoffAtInput: keepKickoff ? isoToLocalInput(fixture.kickoffAt) : '',\n };\n}\n"],"mappings":";;AAyBA,
|
|
1
|
+
{"version":3,"file":"fixtureLifecycle.js","names":["getFixtureLifecycleActions","canReschedule","status","buildScheduleInput","scheduledAt","toIsoOrUndefined","scheduledAtInput","kickoffAt","kickoffAtInput","initialScheduleInputs","kickoff","fixture","keepKickoff","kind","now","isoToLocalInput"],"sources":["../../../src/atheletebridge/utils/fixtureLifecycle.ts"],"sourcesContent":["/**\n * Fixture lifecycle rules for the detail page (BOFF-7642).\n *\n * These mirror the backend guards in `wspace-atheletebridge-svc`\n * (`updateFixture` / `postponeFixture` / `cancelFixture`). The backend is the\n * authority — it rejects an invalid transition regardless of what the UI\n * offers — this only keeps the page from showing actions that cannot succeed.\n * @module atheletebridge/utils/fixtureLifecycle\n */\n\nimport type { AthFixtureStatus } from '../types';\nimport { isoToLocalInput, toIsoOrUndefined } from './datetime';\n\nexport interface FixtureLifecycleActions {\n canReschedule: boolean;\n canPostpone: boolean;\n canCancel: boolean;\n}\n\n/**\n * Which lifecycle actions a fixture in `status` offers. Rescheduling a\n * POSTPONED fixture returns it to SCHEDULED; only SCHEDULED or LIVE fixtures\n * can be postponed; anything not yet final can be cancelled. COMPLETED and\n * CANCELLED are terminal and offer nothing.\n */\nexport function getFixtureLifecycleActions(status: AthFixtureStatus): FixtureLifecycleActions {\n const canReschedule = status === 'SCHEDULED' || status === 'POSTPONED';\n const canPostpone = status === 'SCHEDULED' || status === 'LIVE';\n const canCancel = canReschedule || status === 'LIVE';\n return { canReschedule, canPostpone, canCancel };\n}\n\nexport interface ScheduleInput {\n scheduledAt: string;\n kickoffAt?: string;\n}\n\n/**\n * Build the mutation input from the dialog's `datetime-local` values, or null\n * when no valid schedule was picked (the caller shows a validation toast\n * instead of calling the API).\n */\nexport function buildScheduleInput(\n scheduledAtInput: string,\n kickoffAtInput: string\n): ScheduleInput | null {\n const scheduledAt = toIsoOrUndefined(scheduledAtInput);\n if (!scheduledAt) return null;\n const kickoffAt = toIsoOrUndefined(kickoffAtInput);\n return kickoffAt ? { scheduledAt, kickoffAt } : { scheduledAt };\n}\n\n/**\n * Initial dialog values. The kickoff belongs to the schedule being replaced,\n * so it is only carried over while it is still in the future — a past or\n * stale kickoff would be rejected by the backend (or, for a postponement,\n * pin the fixture to its old kickoff). Postponing starts from a blank kickoff.\n */\nexport function initialScheduleInputs(\n kind: 'reschedule' | 'postpone',\n fixture: { scheduledAt?: string | null; kickoffAt?: string | null },\n now: number = Date.now()\n): { scheduledAtInput: string; kickoffAtInput: string } {\n const kickoff = fixture.kickoffAt ? new Date(fixture.kickoffAt).getTime() : NaN;\n const keepKickoff = kind === 'reschedule' && Number.isFinite(kickoff) && kickoff > now;\n return {\n scheduledAtInput: isoToLocalInput(fixture.scheduledAt),\n kickoffAtInput: keepKickoff ? isoToLocalInput(fixture.kickoffAt) : '',\n };\n}\n"],"mappings":";;AAyBA,SAAgBA,EAA2B,GAAmD;CAC5F,IAAMC,IAAgBC,MAAW,eAAeA,MAAW;CAG3D,OAAO;EAAE;EAAe,aAFJA,MAAW,eAAeA,MAAW;EAEpB,WADnBD,KAAiBC,MAAW;CACC;AACjD;AAYA,SAAgBC,EACd,GACA,GACsB;CACtB,IAAMC,IAAcC,EAAiBC,CAAgB;CACrD,IAAI,CAACF,GAAa,OAAO;CACzB,IAAMG,IAAYF,EAAiBG,CAAc;CACjD,OAAOD,IAAY;EAAE;EAAa;CAAU,IAAI,EAAE,eAAY;AAChE;AAQA,SAAgBE,EACd,GACA,GACA,IAAc,KAAK,IAAI,GAC+B;CACtD,IAAMC,IAAUC,EAAQ,YAAY,IAAI,KAAKA,EAAQ,SAAS,CAAC,CAAC,QAAQ,IAAI,KACtEC,IAAcC,MAAS,gBAAgB,OAAO,SAASH,CAAO,KAAKA,IAAUI;CACnF,OAAO;EACL,kBAAkBC,EAAgBJ,EAAQ,WAAW;EACrD,gBAAgBC,IAAcG,EAAgBJ,EAAQ,SAAS,IAAI;CACrE;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/atheletebridge/utils/formatters.ts
|
|
2
2
|
function e(e, t) {
|
|
3
3
|
let n = typeof e == "string" ? new Date(e) : e;
|
|
4
4
|
return new Intl.DateTimeFormat("en-IN", {
|
|
@@ -19,7 +19,6 @@ function t(e) {
|
|
|
19
19
|
let r = Math.floor(t / 24), i = t % 24;
|
|
20
20
|
return i === 0 ? `${r} day${r === 1 ? "" : "s"}` : `${r} day${r === 1 ? "" : "s"} ${i}h`;
|
|
21
21
|
}
|
|
22
|
-
//#endregion
|
|
23
22
|
export { e as formatDate, t as formatDuration };
|
|
24
23
|
|
|
25
24
|
//# sourceMappingURL=formatters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatters.js","names":[],"sources":["../../../src/atheletebridge/utils/formatters.ts"],"sourcesContent":["/**\n * Formatting utilities for the AthleteBridge microfrontend\n * @module atheletebridge/utils/formatters\n */\n\n/**\n * Format a date string or Date object into a human-readable format\n *\n * @param date - ISO date string or Date object\n * @param options - Optional Intl.DateTimeFormat options\n * @returns Formatted date string (e.g., \"15 Jan 2024, 4:00 PM\")\n *\n * @example\n * formatDate('2024-01-15T10:30:00Z')\n * // => \"15 Jan 2024, 4:00 PM\" (in IST)\n */\nexport function formatDate(\n date: string | Date,\n options?: Partial<Intl.DateTimeFormatOptions>\n): string {\n const d = typeof date === 'string' ? new Date(date) : date;\n return new Intl.DateTimeFormat('en-IN', {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n hour12: true,\n ...options,\n }).format(d);\n}\n\n/**\n * Format a duration in minutes into a human-readable string\n *\n * @param minutes - Duration in minutes\n * @returns Formatted duration string\n *\n * @example\n * formatDuration(5) // => \"5 min\"\n * formatDuration(90) // => \"1h 30min\"\n * formatDuration(1440) // => \"1 day\"\n * formatDuration(4320) // => \"3 days\"\n */\nexport function formatDuration(minutes: number): string {\n if (minutes < 1) return 'instant';\n if (minutes < 60) return `${minutes} min`;\n\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n\n if (hours < 24) {\n if (remainingMinutes === 0) {\n return `${hours}h`;\n }\n return `${hours}h ${remainingMinutes}min`;\n }\n\n const days = Math.floor(hours / 24);\n const remainingHours = hours % 24;\n\n if (remainingHours === 0) {\n return `${days} day${days !== 1 ? 's' : ''}`;\n }\n return `${days} day${days !== 1 ? 's' : ''} ${remainingHours}h`;\n}\n"],"mappings":";AAgBA,
|
|
1
|
+
{"version":3,"file":"formatters.js","names":["formatDate","d","date","options","formatDuration","minutes","hours","remainingMinutes","days","remainingHours"],"sources":["../../../src/atheletebridge/utils/formatters.ts"],"sourcesContent":["/**\n * Formatting utilities for the AthleteBridge microfrontend\n * @module atheletebridge/utils/formatters\n */\n\n/**\n * Format a date string or Date object into a human-readable format\n *\n * @param date - ISO date string or Date object\n * @param options - Optional Intl.DateTimeFormat options\n * @returns Formatted date string (e.g., \"15 Jan 2024, 4:00 PM\")\n *\n * @example\n * formatDate('2024-01-15T10:30:00Z')\n * // => \"15 Jan 2024, 4:00 PM\" (in IST)\n */\nexport function formatDate(\n date: string | Date,\n options?: Partial<Intl.DateTimeFormatOptions>\n): string {\n const d = typeof date === 'string' ? new Date(date) : date;\n return new Intl.DateTimeFormat('en-IN', {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n hour12: true,\n ...options,\n }).format(d);\n}\n\n/**\n * Format a duration in minutes into a human-readable string\n *\n * @param minutes - Duration in minutes\n * @returns Formatted duration string\n *\n * @example\n * formatDuration(5) // => \"5 min\"\n * formatDuration(90) // => \"1h 30min\"\n * formatDuration(1440) // => \"1 day\"\n * formatDuration(4320) // => \"3 days\"\n */\nexport function formatDuration(minutes: number): string {\n if (minutes < 1) return 'instant';\n if (minutes < 60) return `${minutes} min`;\n\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n\n if (hours < 24) {\n if (remainingMinutes === 0) {\n return `${hours}h`;\n }\n return `${hours}h ${remainingMinutes}min`;\n }\n\n const days = Math.floor(hours / 24);\n const remainingHours = hours % 24;\n\n if (remainingHours === 0) {\n return `${days} day${days !== 1 ? 's' : ''}`;\n }\n return `${days} day${days !== 1 ? 's' : ''} ${remainingHours}h`;\n}\n"],"mappings":";AAgBA,SAAgBA,EACd,GACA,GACQ;CACR,IAAMC,IAAI,OAAOC,KAAS,WAAW,IAAI,KAAKA,CAAI,IAAIA;CACtD,OAAO,IAAI,KAAK,eAAe,SAAS;EACtC,KAAK;EACL,OAAO;EACP,MAAM;EACN,MAAM;EACN,QAAQ;EACR,QAAQ;EACR,GAAGC;CACL,CAAC,CAAC,CAAC,OAAOF,CAAC;AACb;AAcA,SAAgBG,EAAe,GAAyB;CACtD,IAAIC,IAAU,GAAG,OAAO;CACxB,IAAIA,IAAU,IAAI,OAAO,GAAGA,EAAQ;CAEpC,IAAMC,IAAQ,KAAK,MAAMD,IAAU,EAAE,GAC/BE,IAAmBF,IAAU;CAEnC,IAAIC,IAAQ,IAIV,OAHIC,MAAqB,IAChB,GAAGD,EAAM,KAEX,GAAGA,EAAM,IAAIC,EAAiB;CAGvC,IAAMC,IAAO,KAAK,MAAMF,IAAQ,EAAE,GAC5BG,IAAiBH,IAAQ;CAK/B,OAHIG,MAAmB,IACd,GAAGD,EAAK,MAAMA,MAAS,IAAU,KAAN,QAE7B,GAAGA,EAAK,MAAMA,MAAS,IAAU,KAAN,IAAS,GAAGC,EAAe;AAC/D"}
|
|
@@ -21,4 +21,3 @@ export declare const CREST_GRADIENTS: readonly [string, string][];
|
|
|
21
21
|
export declare function gradientForSeed(seed: string): [string, string];
|
|
22
22
|
/** A CSS `linear-gradient(...)` string for a seed, ready for a `background` style. */
|
|
23
23
|
export declare function gradientCss(seed: string, angle?: number): string;
|
|
24
|
-
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/atheletebridge/utils/identity.ts
|
|
2
2
|
function e(e) {
|
|
3
3
|
let t = 5381;
|
|
4
4
|
for (let n = 0; n < e.length; n += 1) t = t * 33 ^ e.charCodeAt(n);
|
|
@@ -25,7 +25,6 @@ function i(e, t = 135) {
|
|
|
25
25
|
let [n, i] = r(e);
|
|
26
26
|
return `linear-gradient(${t}deg, ${n}, ${i})`;
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
export { i as gradientCss, r as gradientForSeed, t as initials };
|
|
28
|
+
export { n as CREST_GRADIENTS, i as gradientCss, r as gradientForSeed, t as initials, e as stableHash };
|
|
30
29
|
|
|
31
30
|
//# sourceMappingURL=identity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.js","names":[],"sources":["../../../src/atheletebridge/utils/identity.ts"],"sourcesContent":["/**\n * Deterministic identity helpers\n * @module atheletebridge/utils/identity\n *\n * Stable, seed-derived visuals for teams / athletes / coaches. The backend has\n * NO logo or photo field, so crests and avatars are honest monogram stand-ins:\n * initials over a gradient chosen deterministically from the entity's name/id.\n * Every color is a fe-libs semantic token — never a raw hex.\n */\n\n/** Small stable, order-independent-per-char string hash (djb2 xor variant). */\nexport function stableHash(input: string): number {\n let hash = 5381;\n for (let i = 0; i < input.length; i += 1) {\n hash = (hash * 33) ^ input.charCodeAt(i);\n }\n // Force to a positive 32-bit int.\n return hash >>> 0;\n}\n\n/** Up-to-`max`-letter initials from a display name (e.g. \"Riverside FC\" → \"RF\"). */\nexport function initials(name: string, max = 2): string {\n const parts = name.trim().split(/\\s+/).filter(Boolean);\n if (parts.length === 0) {\n return '?';\n }\n if (parts.length === 1) {\n return parts[0].slice(0, max).toUpperCase();\n }\n return parts\n .slice(0, max)\n .map((p) => p[0])\n .join('')\n .toUpperCase();\n}\n\n/**\n * Curated tokenized gradient stop pairs. Drawn from the categorical chart tokens\n * and product accents so crests read as distinct \"club colors\" while staying\n * theme-aware. Never emit a raw color.\n */\nexport const CREST_GRADIENTS: readonly [string, string][] = [\n ['var(--color-accent-primary)', 'var(--color-chart-2)'],\n ['var(--color-accent-blue)', 'var(--color-accent-indigo)'],\n ['var(--color-accent-teal)', 'var(--color-chart-3)'],\n ['var(--color-accent-purple)', 'var(--color-chart-11)'],\n ['var(--color-chart-4)', 'var(--color-chart-5)'],\n ['var(--color-chart-6)', 'var(--color-chart-7)'],\n ['var(--color-chart-8)', 'var(--color-chart-9)'],\n ['var(--color-chart-10)', 'var(--color-chart-12)'],\n];\n\n/** Deterministic gradient stop pair for a seed (name or id). */\nexport function gradientForSeed(seed: string): [string, string] {\n return CREST_GRADIENTS[stableHash(seed) % CREST_GRADIENTS.length];\n}\n\n/** A CSS `linear-gradient(...)` string for a seed, ready for a `background` style. */\nexport function gradientCss(seed: string, angle = 135): string {\n const [from, to] = gradientForSeed(seed);\n return `linear-gradient(${angle}deg, ${from}, ${to})`;\n}\n"],"mappings":";AAWA,
|
|
1
|
+
{"version":3,"file":"identity.js","names":["stableHash","hash","i","input","initials","parts","name","max","p","CREST_GRADIENTS","gradientForSeed","seed","gradientCss","from","to","angle"],"sources":["../../../src/atheletebridge/utils/identity.ts"],"sourcesContent":["/**\n * Deterministic identity helpers\n * @module atheletebridge/utils/identity\n *\n * Stable, seed-derived visuals for teams / athletes / coaches. The backend has\n * NO logo or photo field, so crests and avatars are honest monogram stand-ins:\n * initials over a gradient chosen deterministically from the entity's name/id.\n * Every color is a fe-libs semantic token — never a raw hex.\n */\n\n/** Small stable, order-independent-per-char string hash (djb2 xor variant). */\nexport function stableHash(input: string): number {\n let hash = 5381;\n for (let i = 0; i < input.length; i += 1) {\n hash = (hash * 33) ^ input.charCodeAt(i);\n }\n // Force to a positive 32-bit int.\n return hash >>> 0;\n}\n\n/** Up-to-`max`-letter initials from a display name (e.g. \"Riverside FC\" → \"RF\"). */\nexport function initials(name: string, max = 2): string {\n const parts = name.trim().split(/\\s+/).filter(Boolean);\n if (parts.length === 0) {\n return '?';\n }\n if (parts.length === 1) {\n return parts[0].slice(0, max).toUpperCase();\n }\n return parts\n .slice(0, max)\n .map((p) => p[0])\n .join('')\n .toUpperCase();\n}\n\n/**\n * Curated tokenized gradient stop pairs. Drawn from the categorical chart tokens\n * and product accents so crests read as distinct \"club colors\" while staying\n * theme-aware. Never emit a raw color.\n */\nexport const CREST_GRADIENTS: readonly [string, string][] = [\n ['var(--color-accent-primary)', 'var(--color-chart-2)'],\n ['var(--color-accent-blue)', 'var(--color-accent-indigo)'],\n ['var(--color-accent-teal)', 'var(--color-chart-3)'],\n ['var(--color-accent-purple)', 'var(--color-chart-11)'],\n ['var(--color-chart-4)', 'var(--color-chart-5)'],\n ['var(--color-chart-6)', 'var(--color-chart-7)'],\n ['var(--color-chart-8)', 'var(--color-chart-9)'],\n ['var(--color-chart-10)', 'var(--color-chart-12)'],\n];\n\n/** Deterministic gradient stop pair for a seed (name or id). */\nexport function gradientForSeed(seed: string): [string, string] {\n return CREST_GRADIENTS[stableHash(seed) % CREST_GRADIENTS.length];\n}\n\n/** A CSS `linear-gradient(...)` string for a seed, ready for a `background` style. */\nexport function gradientCss(seed: string, angle = 135): string {\n const [from, to] = gradientForSeed(seed);\n return `linear-gradient(${angle}deg, ${from}, ${to})`;\n}\n"],"mappings":";AAWA,SAAgBA,EAAW,GAAuB;CAChD,IAAIC,IAAO;CACX,KAAK,IAAIC,IAAI,GAAGA,IAAIC,EAAM,QAAQ,KAAK,GACrC,IAAQF,IAAO,KAAME,EAAM,WAAWD,CAAC;CAGzC,OAAOD,MAAS;AAClB;AAGA,SAAgBG,EAAS,GAAc,IAAM,GAAW;CACtD,IAAMC,IAAQC,EAAK,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,OAAO,OAAO;CAOrD,OANID,EAAM,WAAW,IACZ,MAELA,EAAM,WAAW,IACZA,EAAM,EAAE,CAAC,MAAM,GAAGE,CAAG,CAAC,CAAC,YAAY,IAErCF,EACJ,MAAM,GAAGE,CAAG,CAAC,CACb,KAAK,MAAMC,EAAE,EAAE,CAAC,CAChB,KAAK,EAAE,CAAC,CACR,YAAY;AACjB;AAOA,IAAaC,IAA+C;CAC1D,CAAC,+BAA+B,sBAAsB;CACtD,CAAC,4BAA4B,4BAA4B;CACzD,CAAC,4BAA4B,sBAAsB;CACnD,CAAC,8BAA8B,uBAAuB;CACtD,CAAC,wBAAwB,sBAAsB;CAC/C,CAAC,wBAAwB,sBAAsB;CAC/C,CAAC,wBAAwB,sBAAsB;CAC/C,CAAC,yBAAyB,uBAAuB;AACnD;AAGA,SAAgBC,EAAgB,GAAgC;CAC9D,OAAOD,EAAgBT,EAAWW,CAAI,IAAIF,EAAgB;AAC5D;AAGA,SAAgBG,EAAY,GAAc,IAAQ,KAAa;CAC7D,IAAM,CAACC,GAAMC,KAAMJ,EAAgBC,CAAI;CACvC,OAAO,mBAAmBI,EAAM,OAAOF,EAAK,IAAIC,EAAG;AACrD"}
|
|
@@ -13,4 +13,3 @@ export type { AiPayloadEntry, AiDecisionKind, AiDecisionSummary } from './aiDeci
|
|
|
13
13
|
export { stableHash, initials, gradientForSeed, gradientCss, CREST_GRADIENTS } from './identity';
|
|
14
14
|
export { buildCricketResultInput, buildRecordResultInput, parseScoreInput } from './recordResult';
|
|
15
15
|
export type { CricketDecidedBy, CricketResultFields, CricketWinner, RecordResultFields, RecordResultDraft, } from './recordResult';
|
|
16
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -19,4 +19,3 @@ export declare function formatMoney(minor: number, currency: string, locale?: st
|
|
|
19
19
|
export declare function parseMoney(input: string, currency: string): number | null;
|
|
20
20
|
/** Render minor units as an editable decimal string (no symbol). */
|
|
21
21
|
export declare function minorToInput(minor: number, currency: string): string;
|
|
22
|
-
//# sourceMappingURL=money.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/atheletebridge/utils/money.ts
|
|
2
2
|
function e(e) {
|
|
3
3
|
try {
|
|
4
4
|
return new Intl.NumberFormat("en", {
|
|
@@ -32,7 +32,6 @@ function r(t, n) {
|
|
|
32
32
|
let r = e(n);
|
|
33
33
|
return (t / 10 ** r).toFixed(r);
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
export { t as formatMoney, r as minorToInput, n as parseMoney };
|
|
35
|
+
export { e as currencyExponent, t as formatMoney, r as minorToInput, n as parseMoney };
|
|
37
36
|
|
|
38
37
|
//# sourceMappingURL=money.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"money.js","names":[],"sources":["../../../src/atheletebridge/utils/money.ts"],"sourcesContent":["/**\n * Money helpers for registration fees (BOFF-4135).\n *\n * The API carries every amount as an integer in minor units of an ISO 4217\n * currency. These helpers convert between that and what people type / read,\n * using the currency's own minor-unit exponent (JPY has none, KWD has three).\n *\n * @module atheletebridge/utils/money\n */\n\n/** Number of minor-unit digits for a currency (2 for USD/INR, 0 for JPY). */\nexport function currencyExponent(currency: string): number {\n try {\n return (\n new Intl.NumberFormat('en', { style: 'currency', currency }).resolvedOptions()\n .maximumFractionDigits ?? 2\n );\n } catch {\n return 2;\n }\n}\n\n/** Format minor units for display, e.g. `formatMoney(12550, 'USD')` → `$125.50`. */\nexport function formatMoney(minor: number, currency: string, locale?: string): string {\n const exponent = currencyExponent(currency);\n const major = minor / 10 ** exponent;\n try {\n return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(major);\n } catch {\n return `${major.toFixed(exponent)} ${currency}`;\n }\n}\n\n/**\n * Parse a typed amount (e.g. `\"125.50\"`, `\"1,250\"`) into minor units.\n * Returns null for anything that is not a non-negative amount with at most the\n * currency's number of decimals — never silently rounds.\n */\nexport function parseMoney(input: string, currency: string): number | null {\n const cleaned = input.trim().replace(/[,\\s]/g, '');\n if (cleaned === '') return null;\n const exponent = currencyExponent(currency);\n const pattern = exponent > 0 ? new RegExp(`^\\\\d+(\\\\.\\\\d{1,${exponent}})?$`) : /^\\d+$/;\n if (!pattern.test(cleaned)) return null;\n const [whole = '0', fraction = ''] = cleaned.split('.');\n const minor = Number(whole) * 10 ** exponent + Number(fraction.padEnd(exponent, '0') || '0');\n return Number.isSafeInteger(minor) ? minor : null;\n}\n\n/** Render minor units as an editable decimal string (no symbol). */\nexport function minorToInput(minor: number, currency: string): string {\n const exponent = currencyExponent(currency);\n return (minor / 10 ** exponent).toFixed(exponent);\n}\n"],"mappings":";AAWA,
|
|
1
|
+
{"version":3,"file":"money.js","names":["currencyExponent","formatMoney","exponent","currency","major","minor","locale","parseMoney","cleaned","input","whole","fraction","minorToInput"],"sources":["../../../src/atheletebridge/utils/money.ts"],"sourcesContent":["/**\n * Money helpers for registration fees (BOFF-4135).\n *\n * The API carries every amount as an integer in minor units of an ISO 4217\n * currency. These helpers convert between that and what people type / read,\n * using the currency's own minor-unit exponent (JPY has none, KWD has three).\n *\n * @module atheletebridge/utils/money\n */\n\n/** Number of minor-unit digits for a currency (2 for USD/INR, 0 for JPY). */\nexport function currencyExponent(currency: string): number {\n try {\n return (\n new Intl.NumberFormat('en', { style: 'currency', currency }).resolvedOptions()\n .maximumFractionDigits ?? 2\n );\n } catch {\n return 2;\n }\n}\n\n/** Format minor units for display, e.g. `formatMoney(12550, 'USD')` → `$125.50`. */\nexport function formatMoney(minor: number, currency: string, locale?: string): string {\n const exponent = currencyExponent(currency);\n const major = minor / 10 ** exponent;\n try {\n return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(major);\n } catch {\n return `${major.toFixed(exponent)} ${currency}`;\n }\n}\n\n/**\n * Parse a typed amount (e.g. `\"125.50\"`, `\"1,250\"`) into minor units.\n * Returns null for anything that is not a non-negative amount with at most the\n * currency's number of decimals — never silently rounds.\n */\nexport function parseMoney(input: string, currency: string): number | null {\n const cleaned = input.trim().replace(/[,\\s]/g, '');\n if (cleaned === '') return null;\n const exponent = currencyExponent(currency);\n const pattern = exponent > 0 ? new RegExp(`^\\\\d+(\\\\.\\\\d{1,${exponent}})?$`) : /^\\d+$/;\n if (!pattern.test(cleaned)) return null;\n const [whole = '0', fraction = ''] = cleaned.split('.');\n const minor = Number(whole) * 10 ** exponent + Number(fraction.padEnd(exponent, '0') || '0');\n return Number.isSafeInteger(minor) ? minor : null;\n}\n\n/** Render minor units as an editable decimal string (no symbol). */\nexport function minorToInput(minor: number, currency: string): string {\n const exponent = currencyExponent(currency);\n return (minor / 10 ** exponent).toFixed(exponent);\n}\n"],"mappings":";AAWA,SAAgBA,EAAiB,GAA0B;CACzD,IAAI;EACF,OACE,IAAI,KAAK,aAAa,MAAM;GAAE,OAAO;GAAY;EAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAC3E,yBAAyB;CAEhC,QAAQ;EACN,OAAO;CACT;AACF;AAGA,SAAgBC,EAAY,GAAe,GAAkB,GAAyB;CACpF,IAAMC,IAAWF,EAAiBG,CAAQ,GACpCC,IAAQC,IAAQ,MAAMH;CAC5B,IAAI;EACF,OAAO,IAAI,KAAK,aAAaI,GAAQ;GAAE,OAAO;GAAY;EAAS,CAAC,CAAC,CAAC,OAAOF,CAAK;CACpF,QAAQ;EACN,OAAO,GAAGA,EAAM,QAAQF,CAAQ,EAAE,GAAGC;CACvC;AACF;AAOA,SAAgBI,EAAW,GAAe,GAAiC;CACzE,IAAMC,IAAUC,EAAM,KAAK,CAAC,CAAC,QAAQ,UAAU,EAAE;CACjD,IAAID,MAAY,IAAI,OAAO;CAC3B,IAAMN,IAAWF,EAAiBG,CAAQ;CAE1C,IAAI,EADYD,IAAW,IAAQ,OAAO,kBAAkBA,EAAS,KAAK,IAAI,QAAA,CACjE,KAAKM,CAAO,GAAG,OAAO;CACnC,IAAM,CAACE,IAAQ,KAAKC,IAAW,MAAMH,EAAQ,MAAM,GAAG,GAChDH,IAAQ,OAAOK,CAAK,IAAI,MAAMR,IAAW,OAAOS,EAAS,OAAOT,GAAU,GAAG,KAAK,GAAG;CAC3F,OAAO,OAAO,cAAcG,CAAK,IAAIA,IAAQ;AAC/C;AAGA,SAAgBO,EAAa,GAAe,GAA0B;CACpE,IAAMV,IAAWF,EAAiBG,CAAQ;CAC1C,QAAQE,IAAQ,MAAMH,EAAA,CAAU,QAAQA,CAAQ;AAClD"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// src/atheletebridge/utils/navigation.ts
|
|
2
2
|
function e(e, t) {
|
|
3
3
|
let n = e.endsWith("/") ? e.slice(0, -1) : e;
|
|
4
4
|
return !t || t === "" ? n || "/" : n + (t.startsWith("/") ? t : `/${t}`);
|
|
5
5
|
}
|
|
6
|
-
//#endregion
|
|
7
6
|
export { e as joinPath };
|
|
8
7
|
|
|
9
8
|
//# sourceMappingURL=navigation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.js","names":[],"sources":["../../../src/atheletebridge/utils/navigation.ts"],"sourcesContent":["/**\n * Navigation utilities for the AthleteBridge microfrontend\n * @module atheletebridge/utils\n */\n\n/**\n * Join basePath with a relative path, correctly handling slashes\n *\n * @param basePath - The base path (e.g., '/' or '/atheletebridge')\n * @param relativePath - The relative path (e.g., 'carts/new' or '/carts/new')\n * @returns The joined path (e.g., '/atheletebridge/carts/new')\n *\n * @example\n * joinPath('/', 'carts/new') // => '/carts/new'\n * joinPath('/', '/carts/new') // => '/carts/new'\n * joinPath('/atheletebridge', 'orders') // => '/atheletebridge/orders'\n * joinPath('/atheletebridge/', 'orders') // => '/atheletebridge/orders'\n * joinPath('/atheletebridge', '') // => '/atheletebridge'\n */\nexport function joinPath(basePath: string, relativePath: string): string {\n // Remove trailing slash from base\n const cleanBase = basePath.endsWith('/') ? basePath.slice(0, -1) : basePath;\n\n // Handle empty relative path (go to base)\n if (!relativePath || relativePath === '') {\n return cleanBase || '/';\n }\n\n // Ensure relative path starts with /\n const cleanPath = relativePath.startsWith('/') ? relativePath : `/${relativePath}`;\n\n // Join them\n return cleanBase + cleanPath;\n}\n"],"mappings":";AAmBA,
|
|
1
|
+
{"version":3,"file":"navigation.js","names":["joinPath","cleanBase","basePath","relativePath"],"sources":["../../../src/atheletebridge/utils/navigation.ts"],"sourcesContent":["/**\n * Navigation utilities for the AthleteBridge microfrontend\n * @module atheletebridge/utils\n */\n\n/**\n * Join basePath with a relative path, correctly handling slashes\n *\n * @param basePath - The base path (e.g., '/' or '/atheletebridge')\n * @param relativePath - The relative path (e.g., 'carts/new' or '/carts/new')\n * @returns The joined path (e.g., '/atheletebridge/carts/new')\n *\n * @example\n * joinPath('/', 'carts/new') // => '/carts/new'\n * joinPath('/', '/carts/new') // => '/carts/new'\n * joinPath('/atheletebridge', 'orders') // => '/atheletebridge/orders'\n * joinPath('/atheletebridge/', 'orders') // => '/atheletebridge/orders'\n * joinPath('/atheletebridge', '') // => '/atheletebridge'\n */\nexport function joinPath(basePath: string, relativePath: string): string {\n // Remove trailing slash from base\n const cleanBase = basePath.endsWith('/') ? basePath.slice(0, -1) : basePath;\n\n // Handle empty relative path (go to base)\n if (!relativePath || relativePath === '') {\n return cleanBase || '/';\n }\n\n // Ensure relative path starts with /\n const cleanPath = relativePath.startsWith('/') ? relativePath : `/${relativePath}`;\n\n // Join them\n return cleanBase + cleanPath;\n}\n"],"mappings":";AAmBA,SAAgBA,EAAS,GAAkB,GAA8B;CAEvE,IAAMC,IAAYC,EAAS,SAAS,GAAG,IAAIA,EAAS,MAAM,GAAG,EAAE,IAAIA;CAWnE,OARI,CAACC,KAAgBA,MAAiB,KAC7BF,KAAa,MAOfA,KAHWE,EAAa,WAAW,GAAG,IAAIA,IAAe,IAAIA;AAItE"}
|