@burdenoff/microfe-billing 2026.1113.1 → 2026.1113.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/dist/billing/BillingRoot.js +83 -77
  2. package/dist/billing/BillingRoot.js.map +1 -1
  3. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +78 -78
  4. package/dist/billing/modules/addons/pages/AddonCreatePage.js +70 -70
  5. package/dist/billing/modules/addons/pages/AddonDetailPage.js +72 -72
  6. package/dist/billing/modules/addons/pages/AddonEditPage.js +79 -79
  7. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +224 -224
  8. package/dist/billing/modules/addons/pages/AddonsListPage.js +186 -186
  9. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +168 -168
  10. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
  11. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +88 -88
  12. package/dist/billing/modules/billing/hooks/index.js +5 -5
  13. package/dist/billing/modules/billing/hooks/useInvoices.js +39 -20
  14. package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
  15. package/dist/billing/modules/billing/index.js +14 -14
  16. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +92 -92
  17. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +160 -160
  18. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
  19. package/dist/billing/modules/billing/pages/InvoicesListPage.js +100 -100
  20. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js +105 -105
  21. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +37 -37
  22. package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js +41 -41
  23. package/dist/billing/modules/billing/pages/RefundsPage.js +334 -334
  24. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
  25. package/dist/billing/modules/billing/pages/TransactionsPage.js +174 -174
  26. package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
  27. package/dist/billing/modules/billing/pages/UserRefundsPage.js +24 -24
  28. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  29. package/dist/billing/modules/checkout/components/OrderSummary.js +71 -71
  30. package/dist/billing/modules/checkout/pages/CheckoutPage.js +646 -625
  31. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
  32. package/dist/billing/modules/checkout/utils/checkoutOptions.d.ts +23 -0
  33. package/dist/billing/modules/checkout/utils/checkoutOptions.js +8 -0
  34. package/dist/billing/modules/checkout/utils/checkoutOptions.js.map +1 -0
  35. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +112 -112
  36. package/dist/billing/modules/coupons/pages/CouponsListPage.js +118 -118
  37. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
  38. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +119 -119
  39. package/dist/billing/modules/coupons/pages/EditCouponPage.js +82 -82
  40. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +30 -30
  41. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +77 -77
  42. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +144 -144
  43. package/dist/billing/modules/credits/pages/CreditsPage.js +67 -67
  44. package/dist/billing/modules/dashboard/pages/OverviewPage.js +594 -442
  45. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
  46. package/dist/billing/modules/dashboard/utils/overviewSummary.d.ts +46 -0
  47. package/dist/billing/modules/dashboard/utils/overviewSummary.js +37 -0
  48. package/dist/billing/modules/dashboard/utils/overviewSummary.js.map +1 -0
  49. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +199 -199
  50. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  51. package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +64 -64
  52. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +122 -122
  53. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
  54. package/dist/billing/modules/earnings/pages/EarningsPage.js +102 -102
  55. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  56. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +178 -178
  57. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
  58. package/dist/billing/modules/earnings/pages/PayoutsPage.js +107 -107
  59. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  60. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +54 -54
  61. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +94 -94
  62. package/dist/billing/modules/plans/pages/PlanCreatePage.js +73 -73
  63. package/dist/billing/modules/plans/pages/PlanDetailPage.js +96 -96
  64. package/dist/billing/modules/plans/pages/PlanEditPage.js +16 -16
  65. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  66. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +143 -143
  67. package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
  68. package/dist/billing/modules/plans/pages/PlansListPage.js +88 -88
  69. package/dist/billing/modules/plans/utils/planAction.d.ts +9 -0
  70. package/dist/billing/modules/plans/utils/planAction.js +4 -1
  71. package/dist/billing/modules/plans/utils/planAction.js.map +1 -1
  72. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +60 -60
  73. package/dist/billing/modules/promotions/pages/PromotionsListPage.js +37 -37
  74. package/dist/billing/modules/quota/pages/QuotaAssignFreePage.js +62 -62
  75. package/dist/billing/modules/quota/pages/QuotaPage.js +1 -1
  76. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +69 -69
  77. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +76 -76
  78. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +80 -80
  79. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +95 -95
  80. package/dist/billing/modules/settings/pages/SettingsPage.js +134 -134
  81. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  82. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +62 -62
  83. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  84. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +36 -36
  85. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +534 -410
  86. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
  87. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +111 -111
  88. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +166 -160
  89. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
  90. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.d.ts +30 -0
  91. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js +20 -0
  92. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js.map +1 -0
  93. package/dist/billing/modules/subscriptions/utils/upgradeAccess.d.ts +10 -0
  94. package/dist/billing/modules/subscriptions/utils/upgradeAccess.js +7 -0
  95. package/dist/billing/modules/subscriptions/utils/upgradeAccess.js.map +1 -0
  96. package/dist/billing/modules/usage/pages/UsagePage.js +722 -591
  97. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  98. package/dist/billing/modules/usage/utils/usageHealth.d.ts +63 -0
  99. package/dist/billing/modules/usage/utils/usageHealth.js +43 -0
  100. package/dist/billing/modules/usage/utils/usageHealth.js.map +1 -0
  101. package/dist/billing/shared/components/EmptyState.js +3 -3
  102. package/dist/billing/shared/components/MoneyActionDialog.js +12 -12
  103. package/dist/billing/shared/ui/MetricCard.js +13 -13
  104. package/dist/billing/shared/utils/format.js +16 -4
  105. package/dist/billing/shared/utils/format.js.map +1 -1
  106. package/dist/billing/shared/utils/index.js +8 -8
  107. package/dist/generated/global-operations.js +294 -286
  108. package/dist/generated/global-operations.js.map +1 -1
  109. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"PlansBrowsePage.js","names":["combineQuotas","quotaMap","feature","features","quotaId","limitValue","getPlanFeatureQuantity","existing","getFeaturedQuotas","all","byName","q","FEATURED_QUOTA_NAMES","name","PlansBrowsePage","useI18n","tr","translated","t","key","fallback","navigateTo","useBillingNavigate","isFluidgrids","useIsFluidgridsVariant","useDefaultBillingAccount","activeSubscriptions","subscriptions","sub","actionFor","resolvePlanAction","planId","openPlan","action","useBilling","enterpriseOffer","getEnterpriseOffer","productId","usePlans","viewMode","setViewMode","useState","billingInterval","setBillingInterval","PlanDuration","filteredPlans","plans","plan","recommendedIndex","isLoading","j","i","error","isServerError","ServerError","refetch","PagePurpose","plansDocsUrl","interval","IllustratedEmptyState","BrowsePlanCard","idx","EnterpriseCard","BrowsePlanRow","EnterpriseRow","offer","item","enterpriseMailto","planActionLabel","featuredQuotas","extraCount","displayCurrency","useDefaultBillingCurrency","getDisplayPrice","highlighted","Sparkles","formatPlanDurationLabel","formatCurrency","price","currency","formatPlanDuration","Check","FEATURED_QUOTA_LABELS","quota","formatFeaturedQuotaValue","onSubscribe","ArrowRight","onView"],"sources":["../../../../../src/billing/modules/plans/pages/PlansBrowsePage.tsx"],"sourcesContent":["/**\n * Plans Module - Plans Browse Page (User-facing)\n * Browse available plans and subscribe. No create/edit/toggle actions.\n */\n\nimport { useState, type FC } from 'react';\nimport { Check, ArrowRight, Sparkles } from 'lucide-react';\nimport { useBillingNavigate } from '../../../hooks/useBillingNavigate';\nimport { useBilling } from '../../../providers/BillingProvider';\nimport { usePlans } from '../hooks';\nimport { useDefaultBillingAccount } from '../../subscriptions/hooks/useSubscriptions';\nimport { useIsFluidgridsVariant } from '../../../hooks/useBillingVariant';\nimport { resolvePlanAction, type PlanAction } from '../utils/planAction';\nimport { ServerError } from '../../../shared/components';\nimport {\n formatCurrency,\n formatPlanDuration,\n formatPlanDurationLabel,\n getPlanFeatureQuantity,\n isServerError,\n} from '../../../shared/utils';\nimport { PlanDuration } from '../../../shared/types';\nimport type { Plan, PlanFeature } from '../../../shared/types';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { PagePurpose, IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport {\n useDefaultBillingCurrency,\n getDisplayPrice,\n} from '../../../hooks/useDefaultBillingCurrency';\nimport {\n FEATURED_QUOTA_NAMES,\n FEATURED_QUOTA_LABELS,\n formatFeaturedQuotaValue,\n} from '../constants/featuredQuotas';\nimport {\n enterpriseMailto,\n getEnterpriseOffer,\n type EnterpriseOffer,\n} from '../constants/enterprise';\n\ntype ViewMode = 'grid' | 'list';\n\ninterface CombinedQuota {\n quotaId: string;\n name: string;\n totalValue: number;\n}\n\nfunction combineQuotas(features: PlanFeature[]): CombinedQuota[] {\n const quotaMap = new Map<string, CombinedQuota>();\n for (const feature of features) {\n if (!feature.quota) continue;\n const quotaId = feature.quota.id;\n const limitValue = getPlanFeatureQuantity(feature);\n const existing = quotaMap.get(quotaId);\n if (existing) {\n existing.totalValue += limitValue;\n } else {\n quotaMap.set(quotaId, {\n quotaId,\n name: feature.quota.name ?? 'Unknown Quota',\n totalValue: limitValue,\n });\n }\n }\n return Array.from(quotaMap.values());\n}\n\n/** Returns only the featured quotas, in the canonical display order. */\nfunction getFeaturedQuotas(features: PlanFeature[]): CombinedQuota[] {\n const all = combineQuotas(features);\n const byName = new Map(all.map((q) => [q.name, q]));\n return FEATURED_QUOTA_NAMES.flatMap((name) => {\n const q = byName.get(name);\n return q ? [q] : [];\n });\n}\n\nexport const PlansBrowsePage: FC = () => {\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n const navigateTo = useBillingNavigate();\n // FluidGrids: mark the current plan and send subscribers to Change plan (BOFF-11860).\n const isFluidgrids = useIsFluidgridsVariant();\n const { subscriptions } = useDefaultBillingAccount();\n const activeSubscriptions = subscriptions.filter(\n (sub) => String(sub.status).toLowerCase() === 'active'\n );\n const actionFor = (planId: string): PlanAction | null =>\n isFluidgrids ? resolvePlanAction(planId, activeSubscriptions) : null;\n const openPlan = (planId: string) => {\n const action = actionFor(planId);\n if (action?.kind === 'change') {\n navigateTo(`/subscriptions/${action.subscriptionId}/upgrade`);\n return;\n }\n navigateTo(`/checkout/${planId}`);\n };\n const { productId, plansDocsUrl } = useBilling();\n const enterpriseOffer = getEnterpriseOffer(productId);\n const { plans, isLoading, error, refetch } = usePlans({\n includeFree: false,\n productId: productId ?? undefined,\n });\n\n const [viewMode, setViewMode] = useState<ViewMode>('grid');\n const [billingInterval, setBillingInterval] = useState<PlanDuration>(PlanDuration.MONTHLY);\n\n // Only show active, publicly purchasable plans to users\n const filteredPlans = plans.filter(\n (plan) => plan.isActive && plan.isPurchasable !== false && plan.duration === billingInterval\n );\n\n // Spotlight a recommended tier (the second plan when there are 2+, the common\n // \"mid / Pro\" sweet-spot) so the eye lands on a clear primary choice.\n const recommendedIndex = filteredPlans.length >= 2 ? 1 : -1;\n\n if (isLoading && plans.length === 0) {\n return (\n <div className=\"space-y-6 px-6 lg:px-8 py-6\">\n <div className=\"h-8 w-48 bg-bg-sunken animate-pulse rounded-card\" />\n <div className=\"grid grid-cols-1 md:grid-cols-3 gap-6\">\n {[1, 2, 3].map((i) => (\n <div\n key={i}\n className=\"border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 p-5 space-y-4\"\n >\n <div className=\"h-6 w-24 bg-bg-sunken animate-pulse rounded\" />\n <div className=\"h-8 w-32 bg-bg-sunken animate-pulse rounded\" />\n <div className=\"space-y-2\">\n {[1, 2, 3].map((j) => (\n <div key={j} className=\"h-4 w-full bg-bg-sunken animate-pulse rounded\" />\n ))}\n </div>\n </div>\n ))}\n </div>\n </div>\n );\n }\n\n if (error && isServerError(error)) {\n return (\n <div className=\"p-6\">\n <ServerError\n title={tr('billing.plans.serverUnavailable', 'Server Unavailable')}\n message={tr('billing.plans.unableToLoadPlans', 'Unable to load plans.')}\n onRetry={() => refetch()}\n showRetry\n />\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 px-6 lg:px-8 py-6\">\n {/* Header */}\n <div>\n <h1 className=\"text-2xl md:text-3xl font-semibold tracking-tight text-text-primary\">\n {tr('billing.plans.browsePlansTitle', 'Plans')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {tr('billing.plans.browsePlansSubtitle', 'Choose a plan that fits your needs')}\n </p>\n <PagePurpose\n className=\"mt-3\"\n learnMoreHref={plansDocsUrl}\n learnMoreLabel={tr('billing.plans.learnMore', 'Learn more')}\n >\n {tr(\n 'billing.plans.browsePurpose',\n 'Compare what each plan includes — quotas, features and price — and subscribe to the one that fits your team. Switch between monthly and yearly billing to see the difference, or contact us for a custom Enterprise contract.'\n )}\n </PagePurpose>\n </div>\n\n {/* Filters */}\n <div className=\"flex flex-wrap items-center gap-4 pb-4 border-b border-border-subtle\">\n <div className=\"inline-flex rounded-lg border border-border-subtle p-1 bg-bg-sunken\">\n {([PlanDuration.MONTHLY, PlanDuration.YEARLY] as const).map((interval) => (\n <button\n type=\"button\"\n key={interval}\n onClick={() => setBillingInterval(interval)}\n className={`px-3 py-1.5 text-sm font-medium rounded-button transition-colors ${\n billingInterval === interval\n ? 'bg-bg-surface text-text-primary shadow-sm'\n : 'text-text-secondary hover:text-text-primary'\n }`}\n >\n {interval === PlanDuration.MONTHLY ? 'Monthly' : 'Yearly'}\n </button>\n ))}\n </div>\n\n <div className=\"ml-auto inline-flex rounded-lg border border-border-subtle p-1 bg-bg-sunken\">\n <button\n type=\"button\"\n onClick={() => setViewMode('grid')}\n className={`p-1.5 rounded-button transition-colors ${\n viewMode === 'grid'\n ? 'bg-bg-surface text-text-primary shadow-sm'\n : 'text-text-secondary hover:text-text-primary'\n }`}\n title=\"Grid view\"\n >\n <svg className=\"size-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z\"\n />\n </svg>\n </button>\n <button\n type=\"button\"\n onClick={() => setViewMode('list')}\n className={`p-1.5 rounded-button transition-colors ${\n viewMode === 'list'\n ? 'bg-bg-surface text-text-primary shadow-sm'\n : 'text-text-secondary hover:text-text-primary'\n }`}\n title=\"List view\"\n >\n <svg className=\"size-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M4 6h16M4 12h16M4 18h16\"\n />\n </svg>\n </button>\n </div>\n </div>\n\n {/* Plans */}\n {filteredPlans.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={tr('billing.plans.noPlansAvailable', 'No plans available')}\n description={tr('billing.plans.checkBackLater', 'Check back later for new plans.')}\n />\n ) : viewMode === 'grid' ? (\n <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 items-stretch\">\n {filteredPlans.map((plan, idx) => (\n <BrowsePlanCard\n key={plan.id}\n plan={plan}\n highlighted={idx === recommendedIndex}\n onView={() => navigateTo(`/plans/${plan.id}`)}\n onSubscribe={() => openPlan(plan.id)}\n action={actionFor(plan.id)}\n />\n ))}\n <EnterpriseCard offer={enterpriseOffer} />\n </div>\n ) : (\n <div className=\"space-y-3\">\n {filteredPlans.map((plan) => (\n <BrowsePlanRow\n key={plan.id}\n plan={plan}\n onView={() => navigateTo(`/plans/${plan.id}`)}\n onSubscribe={() => openPlan(plan.id)}\n action={actionFor(plan.id)}\n />\n ))}\n <EnterpriseRow offer={enterpriseOffer} />\n </div>\n )}\n </div>\n );\n};\n\n// ============================================================================\n// Static Enterprise \"Contact Us\" card — no backend plan record\n// ============================================================================\n\nconst EnterpriseCard: FC<{ offer: EnterpriseOffer }> = ({ offer }) => (\n <div className=\"border border-border-strong bg-[var(--color-accent-soft)] rounded-card shadow-elevation-1 p-5 flex flex-col h-full\">\n <div className=\"mb-4\">\n <div className=\"flex items-center gap-2\">\n <h3 className=\"text-lg font-semibold text-text-primary\">Enterprise</h3>\n <span className=\"text-xs font-medium px-2 py-0.5 rounded-full bg-bg-surface text-text-link\">\n Contact Us\n </span>\n </div>\n <span className=\"text-sm text-text-secondary\">Custom contract</span>\n </div>\n\n <div className=\"flex items-baseline gap-1 mb-4\">\n <span className=\"text-2xl font-semibold text-text-primary\">Custom pricing</span>\n </div>\n\n <ul className=\"space-y-2 mb-4 flex-1\">\n {offer.highlights.map((item) => (\n <li key={item} className=\"flex items-center gap-2 text-sm\">\n <svg\n className=\"size-4 text-status-success-text shrink-0\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M5 13l4 4L19 7\" />\n </svg>\n <span className=\"text-text-primary\">{item}</span>\n </li>\n ))}\n </ul>\n\n <div className=\"space-y-2 pt-4 border-t border-border-subtle mt-auto\">\n <a\n href={enterpriseMailto(offer)}\n className=\"block w-full px-4 py-2 text-sm font-medium text-center bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors duration-200\"\n >\n Contact Us\n </a>\n </div>\n </div>\n);\n\nconst EnterpriseRow: FC<{ offer: EnterpriseOffer }> = ({ offer }) => (\n <div className=\"flex items-center gap-4 p-5 border border-border-strong rounded-card bg-[var(--color-accent-soft)] shadow-elevation-1 transition-all duration-200 hover:shadow-elevation-2\">\n <div className=\"size-10 rounded-lg bg-bg-surface flex items-center justify-center shrink-0 shadow-elevation-1\">\n <svg className=\"size-5 text-text-link\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-2 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4\"\n />\n </svg>\n </div>\n\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2\">\n <h3 className=\"font-semibold text-text-primary\">Enterprise</h3>\n <span className=\"text-xs font-medium px-2 py-0.5 rounded-full bg-bg-surface text-text-link shrink-0\">\n Contact Us\n </span>\n </div>\n <p className=\"text-sm text-text-secondary\">{offer.summary}</p>\n </div>\n\n <div className=\"text-right\">\n <div className=\"font-semibold text-text-primary\">Custom pricing</div>\n <div className=\"text-sm text-text-secondary\">contract-based</div>\n </div>\n\n <a\n href={enterpriseMailto(offer)}\n className=\"px-3 py-1.5 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors duration-200 shrink-0\"\n >\n Contact Us\n </a>\n </div>\n);\n\n// ============================================================================\n// Browse Plan Card (no edit/toggle)\n// ============================================================================\n\nfunction planActionLabel(action: PlanAction | null): string {\n if (action?.kind === 'current') return 'Current plan';\n if (action?.kind === 'change') return 'Change to this plan';\n return 'Subscribe';\n}\n\nconst BrowsePlanCard: FC<{\n plan: Plan;\n highlighted?: boolean;\n onView: () => void;\n onSubscribe: () => void;\n action: PlanAction | null;\n}> = ({ plan, highlighted = false, onView, onSubscribe, action }) => {\n const featuredQuotas = getFeaturedQuotas(plan.features || []);\n const allQuotas = combineQuotas(plan.features || []);\n const extraCount = allQuotas.length - featuredQuotas.length;\n const displayCurrency = useDefaultBillingCurrency();\n const { price, currency } = getDisplayPrice(\n plan.price,\n plan.currency,\n plan.currencyPrices as Record<string, number> | null,\n displayCurrency\n );\n\n return (\n <div\n className={`relative flex flex-col h-full rounded-card bg-bg-surface p-6 transition-[border-color,box-shadow] duration-200 ${\n highlighted\n ? 'border-2 border-action-primary-bg shadow-[var(--shadow-glow)]'\n : 'border border-border-subtle shadow-elevation-1 hover:border-border-strong hover:shadow-elevation-2'\n }`}\n >\n {action?.kind === 'current' && (\n <span className=\"absolute -top-3 right-4 inline-flex items-center rounded-full bg-bg-sunken px-3 py-1 text-xs font-semibold text-text-primary border border-border-subtle\">\n Current plan\n </span>\n )}\n {highlighted && (\n <span className=\"absolute -top-3 left-1/2 -translate-x-1/2 inline-flex items-center gap-1 rounded-full bg-action-primary-bg px-3 py-1 text-xs font-semibold text-action-primary-text shadow-elevation-2\">\n <Sparkles className=\"size-3.5\" aria-hidden=\"true\" />\n Most popular\n </span>\n )}\n\n <div className=\"mb-4\">\n <h3 className=\"text-lg font-semibold text-text-primary\">{plan.name}</h3>\n <span className=\"text-sm text-text-secondary\">\n {formatPlanDurationLabel(plan.duration)}\n </span>\n </div>\n\n <div className=\"flex items-baseline gap-1.5 mb-5\">\n <span className=\"text-4xl font-bold tabular-nums tracking-tight text-text-primary\">\n {formatCurrency(price, currency)}\n </span>\n <span className=\"text-text-secondary text-sm\">/ {formatPlanDuration(plan.duration)}</span>\n </div>\n\n {featuredQuotas.length > 0 && (\n <ul className=\"space-y-2.5 mb-5 flex-1\">\n {featuredQuotas.map((quota) => (\n <li key={quota.quotaId} className=\"flex items-center justify-between gap-2 text-sm\">\n <span className=\"flex items-center gap-2 min-w-0\">\n <span className=\"flex size-5 shrink-0 items-center justify-center rounded-full bg-[var(--color-accent-soft)]\">\n <Check className=\"size-3 text-action-primary-bg\" aria-hidden=\"true\" />\n </span>\n <span className=\"truncate text-text-primary\">\n {FEATURED_QUOTA_LABELS[quota.name] ?? quota.name}\n </span>\n </span>\n <span className=\"font-semibold text-text-primary tabular-nums shrink-0\">\n {formatFeaturedQuotaValue(quota.name, quota.totalValue)}\n </span>\n </li>\n ))}\n {extraCount > 0 && (\n <li className=\"text-sm text-text-secondary pl-7\">+{extraCount} more — see details</li>\n )}\n </ul>\n )}\n\n <div className=\"space-y-2 pt-4 border-t border-border-subtle mt-auto\">\n <button\n type=\"button\"\n onClick={onSubscribe}\n disabled={action?.kind === 'current'}\n aria-disabled={action?.kind === 'current'}\n className=\"group disabled:cursor-not-allowed disabled:opacity-60 inline-flex w-full items-center justify-center gap-2 rounded-button bg-action-primary-bg px-4 py-2.5 text-sm font-semibold text-action-primary-text shadow-elevation-1 transition-colors duration-200 hover:bg-action-primary-bgHover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]\"\n >\n {planActionLabel(action)}\n <ArrowRight className=\"size-4 transition-transform duration-200\" aria-hidden=\"true\" />\n </button>\n <button\n type=\"button\"\n onClick={onView}\n className=\"w-full px-4 py-2 text-sm font-medium border border-border-subtle text-text-secondary rounded-button hover:bg-bg-sunken hover:text-text-primary hover:border-border-strong transition-colors duration-200\"\n >\n View details\n </button>\n </div>\n </div>\n );\n};\n\n// ============================================================================\n// Browse Plan Row (no edit/toggle)\n// ============================================================================\n\nconst BrowsePlanRow: FC<{\n plan: Plan;\n onView: () => void;\n onSubscribe: () => void;\n action: PlanAction | null;\n}> = ({ plan, onView, onSubscribe, action }) => {\n const featuredQuotas = getFeaturedQuotas(plan.features || []);\n const displayCurrency = useDefaultBillingCurrency();\n\n return (\n <div className=\"flex items-center gap-4 p-5 border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 transition-all duration-200 hover:border-border-strong hover:shadow-elevation-2\">\n <div className=\"size-10 rounded-lg bg-[var(--color-accent-soft)] flex items-center justify-center shrink-0\">\n <svg\n className=\"size-5 text-text-link\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10\"\n />\n </svg>\n </div>\n\n <div className=\"flex-1 min-w-0\">\n <h3 className=\"font-semibold text-text-primary truncate\">{plan.name}</h3>\n <p className=\"text-sm text-text-secondary\">\n {featuredQuotas.length} key feature{featuredQuotas.length !== 1 ? 's' : ''} included\n </p>\n </div>\n\n <div className=\"text-right\">\n <div className=\"font-semibold text-text-primary\">\n {(() => {\n const { price, currency } = getDisplayPrice(\n plan.price,\n plan.currency,\n plan.currencyPrices as Record<string, number> | null,\n displayCurrency\n );\n return formatCurrency(price, currency);\n })()}\n </div>\n <div className=\"text-sm text-text-secondary\">per {formatPlanDuration(plan.duration)}</div>\n </div>\n\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={onSubscribe}\n disabled={action?.kind === 'current'}\n className=\"disabled:cursor-not-allowed disabled:opacity-60 px-3 py-1.5 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors duration-200\"\n >\n {planActionLabel(action)}\n </button>\n <button\n type=\"button\"\n onClick={onView}\n className=\"px-3 py-1.5 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken hover:border-border-strong transition-all duration-200\"\n >\n View\n </button>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAgDA,SAASA,EAAc,GAA0C;CAC/D,IAAMC,oBAAW,IAAI,IAA2B;CAChD,KAAK,IAAMC,KAAWC,GAAU;EAC9B,IAAI,CAACD,EAAQ,OAAO;EACpB,IAAME,IAAUF,EAAQ,MAAM,IACxBG,IAAaC,EAAuBJ,CAAO,GAC3CK,IAAWN,EAAS,IAAIG,CAAO;EACrC,AAAIG,IACF,EAAS,cAAcF,IAEvBJ,EAAS,IAAIG,GAAS;GACpB;GACA,MAAMF,EAAQ,MAAM,QAAQ;GAC5B,YAAYG;EACd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EAAK,UACLA,EAAK,gBACLwB,CACF;MACA,OAAOM,EAAeC,GAAOC,CAAQ;KACvC,EAAA,CAAG;IACA,CAAA,GACL,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CAA6C,QAAKC,EAAmBjC,EAAK,QAAQ,CAAO;IACtF,CAAA,CAAA;;GAEL,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAAC,UAAD;KACE,MAAK;KACL,SAASsC;KACT,UAAUpD,GAAQ,SAAS;KAC3B,WAAU;KAET,UAAAmC,EAAgBnC,CAAM;IACjB,CAAA,GACR,kBAAC,UAAD;KACE,MAAK;KACL,SAASsD;KACT,WAAU;KACX,UAAA;IAEO,CAAA,CACL;;EACF;;AAET"}
1
+ {"version":3,"file":"PlansBrowsePage.js","names":["combineQuotas","quotaMap","feature","features","quotaId","limitValue","getPlanFeatureQuantity","existing","getFeaturedQuotas","all","byName","q","FEATURED_QUOTA_NAMES","name","PlansBrowsePage","useI18n","tr","translated","t","key","fallback","navigateTo","useBillingNavigate","useBilling","enterpriseOffer","getEnterpriseOffer","productId","usePlans","isFluidgrids","useIsFluidgridsVariant","useDefaultBillingAccount","activeSubscriptions","activeProductSubscriptions","subscriptions","plans","plan","actionFor","resolvePlanAction","planId","openPlan","action","viewMode","setViewMode","useState","billingInterval","setBillingInterval","PlanDuration","filteredPlans","recommendedIndex","isLoading","j","i","error","isServerError","ServerError","refetch","PagePurpose","plansDocsUrl","interval","IllustratedEmptyState","BrowsePlanCard","idx","EnterpriseCard","BrowsePlanRow","EnterpriseRow","offer","item","enterpriseMailto","planActionLabel","featuredQuotas","extraCount","displayCurrency","useDefaultBillingCurrency","getDisplayPrice","highlighted","Sparkles","formatPlanDurationLabel","formatCurrency","price","currency","formatPlanDuration","Check","FEATURED_QUOTA_LABELS","quota","formatFeaturedQuotaValue","onSubscribe","ArrowRight","onView"],"sources":["../../../../../src/billing/modules/plans/pages/PlansBrowsePage.tsx"],"sourcesContent":["/**\n * Plans Module - Plans Browse Page (User-facing)\n * Browse available plans and subscribe. No create/edit/toggle actions.\n */\n\nimport { useState, type FC } from 'react';\nimport { Check, ArrowRight, Sparkles } from 'lucide-react';\nimport { useBillingNavigate } from '../../../hooks/useBillingNavigate';\nimport { useBilling } from '../../../providers/BillingProvider';\nimport { usePlans } from '../hooks';\nimport { useDefaultBillingAccount } from '../../subscriptions/hooks/useSubscriptions';\nimport { useIsFluidgridsVariant } from '../../../hooks/useBillingVariant';\nimport {\n activeProductSubscriptions,\n resolvePlanAction,\n type PlanAction,\n} from '../utils/planAction';\nimport { ServerError } from '../../../shared/components';\nimport {\n formatCurrency,\n formatPlanDuration,\n formatPlanDurationLabel,\n getPlanFeatureQuantity,\n isServerError,\n} from '../../../shared/utils';\nimport { PlanDuration } from '../../../shared/types';\nimport type { Plan, PlanFeature } from '../../../shared/types';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { PagePurpose, IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport {\n useDefaultBillingCurrency,\n getDisplayPrice,\n} from '../../../hooks/useDefaultBillingCurrency';\nimport {\n FEATURED_QUOTA_NAMES,\n FEATURED_QUOTA_LABELS,\n formatFeaturedQuotaValue,\n} from '../constants/featuredQuotas';\nimport {\n enterpriseMailto,\n getEnterpriseOffer,\n type EnterpriseOffer,\n} from '../constants/enterprise';\n\ntype ViewMode = 'grid' | 'list';\n\ninterface CombinedQuota {\n quotaId: string;\n name: string;\n totalValue: number;\n}\n\nfunction combineQuotas(features: PlanFeature[]): CombinedQuota[] {\n const quotaMap = new Map<string, CombinedQuota>();\n for (const feature of features) {\n if (!feature.quota) continue;\n const quotaId = feature.quota.id;\n const limitValue = getPlanFeatureQuantity(feature);\n const existing = quotaMap.get(quotaId);\n if (existing) {\n existing.totalValue += limitValue;\n } else {\n quotaMap.set(quotaId, {\n quotaId,\n name: feature.quota.name ?? 'Unknown Quota',\n totalValue: limitValue,\n });\n }\n }\n return Array.from(quotaMap.values());\n}\n\n/** Returns only the featured quotas, in the canonical display order. */\nfunction getFeaturedQuotas(features: PlanFeature[]): CombinedQuota[] {\n const all = combineQuotas(features);\n const byName = new Map(all.map((q) => [q.name, q]));\n return FEATURED_QUOTA_NAMES.flatMap((name) => {\n const q = byName.get(name);\n return q ? [q] : [];\n });\n}\n\nexport const PlansBrowsePage: FC = () => {\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n const navigateTo = useBillingNavigate();\n const { productId, plansDocsUrl } = useBilling();\n const enterpriseOffer = getEnterpriseOffer(productId);\n const { plans, isLoading, error, refetch } = usePlans({\n includeFree: false,\n productId: productId ?? undefined,\n });\n // FluidGrids: mark the current plan and send subscribers to Change plan (BOFF-11860).\n const isFluidgrids = useIsFluidgridsVariant();\n const { subscriptions } = useDefaultBillingAccount();\n // Only this product's subscriptions count: an account's subscription to another product's\n // plan is never the one a plan card here should change.\n const activeSubscriptions = activeProductSubscriptions(\n subscriptions,\n new Set(plans.map((plan) => plan.id))\n );\n const actionFor = (planId: string): PlanAction | null =>\n isFluidgrids ? resolvePlanAction(planId, activeSubscriptions) : null;\n const openPlan = (planId: string) => {\n const action = actionFor(planId);\n if (action?.kind === 'change') {\n navigateTo(`/subscriptions/${action.subscriptionId}/upgrade`);\n return;\n }\n navigateTo(`/checkout/${planId}`);\n };\n\n const [viewMode, setViewMode] = useState<ViewMode>('grid');\n const [billingInterval, setBillingInterval] = useState<PlanDuration>(PlanDuration.MONTHLY);\n\n // Only show active, publicly purchasable plans to users\n const filteredPlans = plans.filter(\n (plan) => plan.isActive && plan.isPurchasable !== false && plan.duration === billingInterval\n );\n\n // Spotlight a recommended tier (the second plan when there are 2+, the common\n // \"mid / Pro\" sweet-spot) so the eye lands on a clear primary choice.\n const recommendedIndex = filteredPlans.length >= 2 ? 1 : -1;\n\n if (isLoading && plans.length === 0) {\n return (\n <div className=\"space-y-6 px-6 lg:px-8 py-6\">\n <div className=\"h-8 w-48 bg-bg-sunken animate-pulse rounded-card\" />\n <div className=\"grid grid-cols-1 md:grid-cols-3 gap-6\">\n {[1, 2, 3].map((i) => (\n <div\n key={i}\n className=\"border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 p-5 space-y-4\"\n >\n <div className=\"h-6 w-24 bg-bg-sunken animate-pulse rounded\" />\n <div className=\"h-8 w-32 bg-bg-sunken animate-pulse rounded\" />\n <div className=\"space-y-2\">\n {[1, 2, 3].map((j) => (\n <div key={j} className=\"h-4 w-full bg-bg-sunken animate-pulse rounded\" />\n ))}\n </div>\n </div>\n ))}\n </div>\n </div>\n );\n }\n\n if (error && isServerError(error)) {\n return (\n <div className=\"p-6\">\n <ServerError\n title={tr('billing.plans.serverUnavailable', 'Server Unavailable')}\n message={tr('billing.plans.unableToLoadPlans', 'Unable to load plans.')}\n onRetry={() => refetch()}\n showRetry\n />\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 px-6 lg:px-8 py-6\">\n {/* Header */}\n <div>\n <h1 className=\"text-2xl md:text-3xl font-semibold tracking-tight text-text-primary\">\n {tr('billing.plans.browsePlansTitle', 'Plans')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {tr('billing.plans.browsePlansSubtitle', 'Choose a plan that fits your needs')}\n </p>\n <PagePurpose\n className=\"mt-3\"\n learnMoreHref={plansDocsUrl}\n learnMoreLabel={tr('billing.plans.learnMore', 'Learn more')}\n >\n {tr(\n 'billing.plans.browsePurpose',\n 'Compare what each plan includes — quotas, features and price — and subscribe to the one that fits your team. Switch between monthly and yearly billing to see the difference, or contact us for a custom Enterprise contract.'\n )}\n </PagePurpose>\n </div>\n\n {/* Filters */}\n <div className=\"flex flex-wrap items-center gap-4 pb-4 border-b border-border-subtle\">\n <div className=\"inline-flex rounded-lg border border-border-subtle p-1 bg-bg-sunken\">\n {([PlanDuration.MONTHLY, PlanDuration.YEARLY] as const).map((interval) => (\n <button\n type=\"button\"\n key={interval}\n onClick={() => setBillingInterval(interval)}\n className={`px-3 py-1.5 text-sm font-medium rounded-button transition-colors ${\n billingInterval === interval\n ? 'bg-bg-surface text-text-primary shadow-sm'\n : 'text-text-secondary hover:text-text-primary'\n }`}\n >\n {interval === PlanDuration.MONTHLY ? 'Monthly' : 'Yearly'}\n </button>\n ))}\n </div>\n\n <div className=\"ml-auto inline-flex rounded-lg border border-border-subtle p-1 bg-bg-sunken\">\n <button\n type=\"button\"\n onClick={() => setViewMode('grid')}\n className={`p-1.5 rounded-button transition-colors ${\n viewMode === 'grid'\n ? 'bg-bg-surface text-text-primary shadow-sm'\n : 'text-text-secondary hover:text-text-primary'\n }`}\n title=\"Grid view\"\n >\n <svg className=\"size-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z\"\n />\n </svg>\n </button>\n <button\n type=\"button\"\n onClick={() => setViewMode('list')}\n className={`p-1.5 rounded-button transition-colors ${\n viewMode === 'list'\n ? 'bg-bg-surface text-text-primary shadow-sm'\n : 'text-text-secondary hover:text-text-primary'\n }`}\n title=\"List view\"\n >\n <svg className=\"size-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M4 6h16M4 12h16M4 18h16\"\n />\n </svg>\n </button>\n </div>\n </div>\n\n {/* Plans */}\n {filteredPlans.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={tr('billing.plans.noPlansAvailable', 'No plans available')}\n description={tr('billing.plans.checkBackLater', 'Check back later for new plans.')}\n />\n ) : viewMode === 'grid' ? (\n <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 items-stretch\">\n {filteredPlans.map((plan, idx) => (\n <BrowsePlanCard\n key={plan.id}\n plan={plan}\n highlighted={idx === recommendedIndex}\n onView={() => navigateTo(`/plans/${plan.id}`)}\n onSubscribe={() => openPlan(plan.id)}\n action={actionFor(plan.id)}\n />\n ))}\n <EnterpriseCard offer={enterpriseOffer} />\n </div>\n ) : (\n <div className=\"space-y-3\">\n {filteredPlans.map((plan) => (\n <BrowsePlanRow\n key={plan.id}\n plan={plan}\n onView={() => navigateTo(`/plans/${plan.id}`)}\n onSubscribe={() => openPlan(plan.id)}\n action={actionFor(plan.id)}\n />\n ))}\n <EnterpriseRow offer={enterpriseOffer} />\n </div>\n )}\n </div>\n );\n};\n\n// ============================================================================\n// Static Enterprise \"Contact Us\" card — no backend plan record\n// ============================================================================\n\nconst EnterpriseCard: FC<{ offer: EnterpriseOffer }> = ({ offer }) => (\n <div className=\"border border-border-strong bg-[var(--color-accent-soft)] rounded-card shadow-elevation-1 p-5 flex flex-col h-full\">\n <div className=\"mb-4\">\n <div className=\"flex items-center gap-2\">\n <h3 className=\"text-lg font-semibold text-text-primary\">Enterprise</h3>\n <span className=\"text-xs font-medium px-2 py-0.5 rounded-full bg-bg-surface text-text-link\">\n Contact Us\n </span>\n </div>\n <span className=\"text-sm text-text-secondary\">Custom contract</span>\n </div>\n\n <div className=\"flex items-baseline gap-1 mb-4\">\n <span className=\"text-2xl font-semibold text-text-primary\">Custom pricing</span>\n </div>\n\n <ul className=\"space-y-2 mb-4 flex-1\">\n {offer.highlights.map((item) => (\n <li key={item} className=\"flex items-center gap-2 text-sm\">\n <svg\n className=\"size-4 text-status-success-text shrink-0\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M5 13l4 4L19 7\" />\n </svg>\n <span className=\"text-text-primary\">{item}</span>\n </li>\n ))}\n </ul>\n\n <div className=\"space-y-2 pt-4 border-t border-border-subtle mt-auto\">\n <a\n href={enterpriseMailto(offer)}\n className=\"block w-full px-4 py-2 text-sm font-medium text-center bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors duration-200\"\n >\n Contact Us\n </a>\n </div>\n </div>\n);\n\nconst EnterpriseRow: FC<{ offer: EnterpriseOffer }> = ({ offer }) => (\n <div className=\"flex items-center gap-4 p-5 border border-border-strong rounded-card bg-[var(--color-accent-soft)] shadow-elevation-1 transition-all duration-200 hover:shadow-elevation-2\">\n <div className=\"size-10 rounded-lg bg-bg-surface flex items-center justify-center shrink-0 shadow-elevation-1\">\n <svg className=\"size-5 text-text-link\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-2 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4\"\n />\n </svg>\n </div>\n\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2\">\n <h3 className=\"font-semibold text-text-primary\">Enterprise</h3>\n <span className=\"text-xs font-medium px-2 py-0.5 rounded-full bg-bg-surface text-text-link shrink-0\">\n Contact Us\n </span>\n </div>\n <p className=\"text-sm text-text-secondary\">{offer.summary}</p>\n </div>\n\n <div className=\"text-right\">\n <div className=\"font-semibold text-text-primary\">Custom pricing</div>\n <div className=\"text-sm text-text-secondary\">contract-based</div>\n </div>\n\n <a\n href={enterpriseMailto(offer)}\n className=\"px-3 py-1.5 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors duration-200 shrink-0\"\n >\n Contact Us\n </a>\n </div>\n);\n\n// ============================================================================\n// Browse Plan Card (no edit/toggle)\n// ============================================================================\n\nfunction planActionLabel(action: PlanAction | null): string {\n if (action?.kind === 'current') return 'Current plan';\n if (action?.kind === 'change') return 'Change to this plan';\n return 'Subscribe';\n}\n\nconst BrowsePlanCard: FC<{\n plan: Plan;\n highlighted?: boolean;\n onView: () => void;\n onSubscribe: () => void;\n action: PlanAction | null;\n}> = ({ plan, highlighted = false, onView, onSubscribe, action }) => {\n const featuredQuotas = getFeaturedQuotas(plan.features || []);\n const allQuotas = combineQuotas(plan.features || []);\n const extraCount = allQuotas.length - featuredQuotas.length;\n const displayCurrency = useDefaultBillingCurrency();\n const { price, currency } = getDisplayPrice(\n plan.price,\n plan.currency,\n plan.currencyPrices as Record<string, number> | null,\n displayCurrency\n );\n\n return (\n <div\n className={`relative flex flex-col h-full rounded-card bg-bg-surface p-6 transition-[border-color,box-shadow] duration-200 ${\n highlighted\n ? 'border-2 border-action-primary-bg shadow-[var(--shadow-glow)]'\n : 'border border-border-subtle shadow-elevation-1 hover:border-border-strong hover:shadow-elevation-2'\n }`}\n >\n {action?.kind === 'current' && (\n <span className=\"absolute -top-3 right-4 inline-flex items-center rounded-full bg-bg-sunken px-3 py-1 text-xs font-semibold text-text-primary border border-border-subtle\">\n Current plan\n </span>\n )}\n {highlighted && (\n <span className=\"absolute -top-3 left-1/2 -translate-x-1/2 inline-flex items-center gap-1 rounded-full bg-action-primary-bg px-3 py-1 text-xs font-semibold text-action-primary-text shadow-elevation-2\">\n <Sparkles className=\"size-3.5\" aria-hidden=\"true\" />\n Most popular\n </span>\n )}\n\n <div className=\"mb-4\">\n <h3 className=\"text-lg font-semibold text-text-primary\">{plan.name}</h3>\n <span className=\"text-sm text-text-secondary\">\n {formatPlanDurationLabel(plan.duration)}\n </span>\n </div>\n\n <div className=\"flex items-baseline gap-1.5 mb-5\">\n <span className=\"text-4xl font-bold tabular-nums tracking-tight text-text-primary\">\n {formatCurrency(price, currency)}\n </span>\n <span className=\"text-text-secondary text-sm\">/ {formatPlanDuration(plan.duration)}</span>\n </div>\n\n {featuredQuotas.length > 0 && (\n <ul className=\"space-y-2.5 mb-5 flex-1\">\n {featuredQuotas.map((quota) => (\n <li key={quota.quotaId} className=\"flex items-center justify-between gap-2 text-sm\">\n <span className=\"flex items-center gap-2 min-w-0\">\n <span className=\"flex size-5 shrink-0 items-center justify-center rounded-full bg-[var(--color-accent-soft)]\">\n <Check className=\"size-3 text-action-primary-bg\" aria-hidden=\"true\" />\n </span>\n <span className=\"truncate text-text-primary\">\n {FEATURED_QUOTA_LABELS[quota.name] ?? quota.name}\n </span>\n </span>\n <span className=\"font-semibold text-text-primary tabular-nums shrink-0\">\n {formatFeaturedQuotaValue(quota.name, quota.totalValue)}\n </span>\n </li>\n ))}\n {extraCount > 0 && (\n <li className=\"text-sm text-text-secondary pl-7\">+{extraCount} more — see details</li>\n )}\n </ul>\n )}\n\n <div className=\"space-y-2 pt-4 border-t border-border-subtle mt-auto\">\n <button\n type=\"button\"\n onClick={onSubscribe}\n disabled={action?.kind === 'current'}\n aria-disabled={action?.kind === 'current'}\n className=\"group disabled:cursor-not-allowed disabled:opacity-60 inline-flex w-full items-center justify-center gap-2 rounded-button bg-action-primary-bg px-4 py-2.5 text-sm font-semibold text-action-primary-text shadow-elevation-1 transition-colors duration-200 hover:bg-action-primary-bgHover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]\"\n >\n {planActionLabel(action)}\n <ArrowRight className=\"size-4 transition-transform duration-200\" aria-hidden=\"true\" />\n </button>\n <button\n type=\"button\"\n onClick={onView}\n className=\"w-full px-4 py-2 text-sm font-medium border border-border-subtle text-text-secondary rounded-button hover:bg-bg-sunken hover:text-text-primary hover:border-border-strong transition-colors duration-200\"\n >\n View details\n </button>\n </div>\n </div>\n );\n};\n\n// ============================================================================\n// Browse Plan Row (no edit/toggle)\n// ============================================================================\n\nconst BrowsePlanRow: FC<{\n plan: Plan;\n onView: () => void;\n onSubscribe: () => void;\n action: PlanAction | null;\n}> = ({ plan, onView, onSubscribe, action }) => {\n const featuredQuotas = getFeaturedQuotas(plan.features || []);\n const displayCurrency = useDefaultBillingCurrency();\n\n return (\n <div className=\"flex items-center gap-4 p-5 border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 transition-all duration-200 hover:border-border-strong hover:shadow-elevation-2\">\n <div className=\"size-10 rounded-lg bg-[var(--color-accent-soft)] flex items-center justify-center shrink-0\">\n <svg\n className=\"size-5 text-text-link\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10\"\n />\n </svg>\n </div>\n\n <div className=\"flex-1 min-w-0\">\n <h3 className=\"font-semibold text-text-primary truncate\">{plan.name}</h3>\n <p className=\"text-sm text-text-secondary\">\n {featuredQuotas.length} key feature{featuredQuotas.length !== 1 ? 's' : ''} included\n </p>\n </div>\n\n <div className=\"text-right\">\n <div className=\"font-semibold text-text-primary\">\n {(() => {\n const { price, currency } = getDisplayPrice(\n plan.price,\n plan.currency,\n plan.currencyPrices as Record<string, number> | null,\n displayCurrency\n );\n return formatCurrency(price, currency);\n })()}\n </div>\n <div className=\"text-sm text-text-secondary\">per {formatPlanDuration(plan.duration)}</div>\n </div>\n\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={onSubscribe}\n disabled={action?.kind === 'current'}\n className=\"disabled:cursor-not-allowed disabled:opacity-60 px-3 py-1.5 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors duration-200\"\n >\n {planActionLabel(action)}\n </button>\n <button\n type=\"button\"\n onClick={onView}\n className=\"px-3 py-1.5 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken hover:border-border-strong transition-all duration-200\"\n >\n View\n </button>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAoDA,SAASA,EAAc,GAA0C;CAC/D,IAAMC,oBAAW,IAAI,IAA2B;CAChD,KAAK,IAAMC,KAAWC,GAAU;EAC9B,IAAI,CAACD,EAAQ,OAAO;EACpB,IAAME,IAAUF,EAAQ,MAAM,IACxBG,IAAaC,EAAuBJ,CAAO,GAC3CK,IAAWN,EAAS,IAAIG,CAAO;EACrC,AAAIG,IACF,EAAS,cAAcF,IAEvBJ,EAAS,IAAIG,GAAS;GACpB;GACA,MAAMF,EAAQ,MAAM,QAAQ;GAC5B,YAAYG;EACd,CAAC;CAEL;CACA,OAAO,MAAM,KAAKJ,EAAS,OAAO,CAAC;AACrC;AAGA,SAASO,EAAkB,GAA0C;CACnE,IAAMC,IAAMT,EAAcG,CAAQ,GAC5BO,IAAS,IAAI,IAAID,EAAI,KAAK,MAAM,CAACE,EAAE,MAAMA,CAAC,CAAC,CAAC;CAClD,OAAOC,EAAqB,SAAS,MAAS;EAC5C,IAAMD,IAAID,EAAO,IAAIG,CAAI;EACzB,OAAOF,IAAI,CAACA,CAAC,IAAI,CAAC;CACpB,CAAC;AACH;AAEA,IAAaG,UAA4B;CACvC,IAAM,EAAE,SAAMC,EAAQ,GAChBC,KAAM,GAAa,MAA6B;EACpD,IAAMC,IAAaC,EAAEC,CAAG;EACxB,OAAOF,MAAeE,IAAMC,IAAWH;CACzC,GACMI,IAAaC,EAAmB,GAChC,EAAE,cAAW,oBAAiBC,EAAW,GACzCC,IAAkBC,EAAmBC,CAAS,GAC9C,EAAE,UAAO,cAAW,UAAO,eAAYC,EAAS;EACpD,aAAa;EACb,WAAWD,KAAa,KAAA;CAC1B,CAAC,GAEKE,IAAeC,EAAuB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