@burdenoff/microfe-billing 2026.510.114

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 (636) hide show
  1. package/README.md +12 -0
  2. package/dist/billing/BillingAdminRoutes.d.ts +6 -0
  3. package/dist/billing/BillingAdminRoutes.d.ts.map +1 -0
  4. package/dist/billing/BillingAdminRoutes.js +359 -0
  5. package/dist/billing/BillingAdminRoutes.js.map +1 -0
  6. package/dist/billing/BillingRoot.d.ts +37 -0
  7. package/dist/billing/BillingRoot.d.ts.map +1 -0
  8. package/dist/billing/BillingRoot.js +190 -0
  9. package/dist/billing/BillingRoot.js.map +1 -0
  10. package/dist/billing/BillingUserRoutes.d.ts +7 -0
  11. package/dist/billing/BillingUserRoutes.d.ts.map +1 -0
  12. package/dist/billing/BillingUserRoutes.js +479 -0
  13. package/dist/billing/BillingUserRoutes.js.map +1 -0
  14. package/dist/billing/constants/permissions.d.ts +18 -0
  15. package/dist/billing/constants/permissions.d.ts.map +1 -0
  16. package/dist/billing/hooks/useBillingAccountSelection.d.ts +36 -0
  17. package/dist/billing/hooks/useBillingAccountSelection.d.ts.map +1 -0
  18. package/dist/billing/hooks/useBillingAccountSelection.js +81 -0
  19. package/dist/billing/hooks/useBillingAccountSelection.js.map +1 -0
  20. package/dist/billing/hooks/useBillingEventEmitter.d.ts +8 -0
  21. package/dist/billing/hooks/useBillingEventEmitter.d.ts.map +1 -0
  22. package/dist/billing/hooks/useBillingEventEmitter.js +15 -0
  23. package/dist/billing/hooks/useBillingEventEmitter.js.map +1 -0
  24. package/dist/billing/hooks/useBillingNavigate.d.ts +30 -0
  25. package/dist/billing/hooks/useBillingNavigate.d.ts.map +1 -0
  26. package/dist/billing/hooks/useBillingNavigate.js +23 -0
  27. package/dist/billing/hooks/useBillingNavigate.js.map +1 -0
  28. package/dist/billing/hooks/useBillingPermissions.d.ts +94 -0
  29. package/dist/billing/hooks/useBillingPermissions.d.ts.map +1 -0
  30. package/dist/billing/hooks/useBillingPermissions.js +78 -0
  31. package/dist/billing/hooks/useBillingPermissions.js.map +1 -0
  32. package/dist/billing/hooks/useDefaultBillingCurrency.d.ts +14 -0
  33. package/dist/billing/hooks/useDefaultBillingCurrency.d.ts.map +1 -0
  34. package/dist/billing/hooks/useDefaultBillingCurrency.js +23 -0
  35. package/dist/billing/hooks/useDefaultBillingCurrency.js.map +1 -0
  36. package/dist/billing/index.d.ts +31 -0
  37. package/dist/billing/index.d.ts.map +1 -0
  38. package/dist/billing/lib/native-purchases.d.ts +51 -0
  39. package/dist/billing/lib/native-purchases.d.ts.map +1 -0
  40. package/dist/billing/lib/native-purchases.js +44 -0
  41. package/dist/billing/lib/native-purchases.js.map +1 -0
  42. package/dist/billing/modules/addons/components/FloatingCartDrawer.d.ts +4 -0
  43. package/dist/billing/modules/addons/components/FloatingCartDrawer.d.ts.map +1 -0
  44. package/dist/billing/modules/addons/components/FloatingCartDrawer.js +179 -0
  45. package/dist/billing/modules/addons/components/FloatingCartDrawer.js.map +1 -0
  46. package/dist/billing/modules/addons/components/index.d.ts +5 -0
  47. package/dist/billing/modules/addons/components/index.d.ts.map +1 -0
  48. package/dist/billing/modules/addons/hooks/index.d.ts +6 -0
  49. package/dist/billing/modules/addons/hooks/index.d.ts.map +1 -0
  50. package/dist/billing/modules/addons/hooks/index.js +1 -0
  51. package/dist/billing/modules/addons/hooks/useAddons.d.ts +55 -0
  52. package/dist/billing/modules/addons/hooks/useAddons.d.ts.map +1 -0
  53. package/dist/billing/modules/addons/hooks/useAddons.js +77 -0
  54. package/dist/billing/modules/addons/hooks/useAddons.js.map +1 -0
  55. package/dist/billing/modules/addons/index.d.ts +7 -0
  56. package/dist/billing/modules/addons/index.d.ts.map +1 -0
  57. package/dist/billing/modules/addons/index.js +10 -0
  58. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.d.ts +4 -0
  59. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.d.ts.map +1 -0
  60. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +266 -0
  61. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -0
  62. package/dist/billing/modules/addons/pages/AddonCreatePage.d.ts +4 -0
  63. package/dist/billing/modules/addons/pages/AddonCreatePage.d.ts.map +1 -0
  64. package/dist/billing/modules/addons/pages/AddonCreatePage.js +369 -0
  65. package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -0
  66. package/dist/billing/modules/addons/pages/AddonDetailPage.d.ts +4 -0
  67. package/dist/billing/modules/addons/pages/AddonDetailPage.d.ts.map +1 -0
  68. package/dist/billing/modules/addons/pages/AddonDetailPage.js +280 -0
  69. package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -0
  70. package/dist/billing/modules/addons/pages/AddonEditPage.d.ts +4 -0
  71. package/dist/billing/modules/addons/pages/AddonEditPage.d.ts.map +1 -0
  72. package/dist/billing/modules/addons/pages/AddonEditPage.js +396 -0
  73. package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -0
  74. package/dist/billing/modules/addons/pages/AddonsBrowsePage.d.ts +4 -0
  75. package/dist/billing/modules/addons/pages/AddonsBrowsePage.d.ts.map +1 -0
  76. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +582 -0
  77. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -0
  78. package/dist/billing/modules/addons/pages/AddonsListPage.d.ts +4 -0
  79. package/dist/billing/modules/addons/pages/AddonsListPage.d.ts.map +1 -0
  80. package/dist/billing/modules/addons/pages/AddonsListPage.js +744 -0
  81. package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -0
  82. package/dist/billing/modules/addons/pages/index.d.ts +11 -0
  83. package/dist/billing/modules/addons/pages/index.d.ts.map +1 -0
  84. package/dist/billing/modules/addons/pages/index.js +6 -0
  85. package/dist/billing/modules/addons/store/addonCartStore.d.ts +38 -0
  86. package/dist/billing/modules/addons/store/addonCartStore.d.ts.map +1 -0
  87. package/dist/billing/modules/addons/store/addonCartStore.js +74 -0
  88. package/dist/billing/modules/addons/store/addonCartStore.js.map +1 -0
  89. package/dist/billing/modules/affiliate/api.d.ts +101 -0
  90. package/dist/billing/modules/affiliate/api.d.ts.map +1 -0
  91. package/dist/billing/modules/affiliate/api.js +38 -0
  92. package/dist/billing/modules/affiliate/api.js.map +1 -0
  93. package/dist/billing/modules/affiliate/index.d.ts +2 -0
  94. package/dist/billing/modules/affiliate/index.d.ts.map +1 -0
  95. package/dist/billing/modules/affiliate/index.js +2 -0
  96. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.d.ts +4 -0
  97. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.d.ts.map +1 -0
  98. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +464 -0
  99. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -0
  100. package/dist/billing/modules/analytics/index.d.ts +5 -0
  101. package/dist/billing/modules/analytics/index.d.ts.map +1 -0
  102. package/dist/billing/modules/analytics/index.js +3 -0
  103. package/dist/billing/modules/analytics/pages/AnalyticsPage.d.ts +4 -0
  104. package/dist/billing/modules/analytics/pages/AnalyticsPage.d.ts.map +1 -0
  105. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +469 -0
  106. package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -0
  107. package/dist/billing/modules/analytics/pages/index.d.ts +5 -0
  108. package/dist/billing/modules/analytics/pages/index.d.ts.map +1 -0
  109. package/dist/billing/modules/analytics/pages/index.js +1 -0
  110. package/dist/billing/modules/billing/hooks/index.d.ts +10 -0
  111. package/dist/billing/modules/billing/hooks/index.d.ts.map +1 -0
  112. package/dist/billing/modules/billing/hooks/index.js +4 -0
  113. package/dist/billing/modules/billing/hooks/useInvoices.d.ts +67 -0
  114. package/dist/billing/modules/billing/hooks/useInvoices.d.ts.map +1 -0
  115. package/dist/billing/modules/billing/hooks/useInvoices.js +87 -0
  116. package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -0
  117. package/dist/billing/modules/billing/hooks/usePayments.d.ts +62 -0
  118. package/dist/billing/modules/billing/hooks/usePayments.d.ts.map +1 -0
  119. package/dist/billing/modules/billing/hooks/usePayments.js +3 -0
  120. package/dist/billing/modules/billing/hooks/useRefunds.d.ts +191 -0
  121. package/dist/billing/modules/billing/hooks/useRefunds.d.ts.map +1 -0
  122. package/dist/billing/modules/billing/hooks/useRefunds.js +162 -0
  123. package/dist/billing/modules/billing/hooks/useRefunds.js.map +1 -0
  124. package/dist/billing/modules/billing/hooks/useTransactions.d.ts +41 -0
  125. package/dist/billing/modules/billing/hooks/useTransactions.d.ts.map +1 -0
  126. package/dist/billing/modules/billing/hooks/useTransactions.js +55 -0
  127. package/dist/billing/modules/billing/hooks/useTransactions.js.map +1 -0
  128. package/dist/billing/modules/billing/index.d.ts +7 -0
  129. package/dist/billing/modules/billing/index.d.ts.map +1 -0
  130. package/dist/billing/modules/billing/index.js +11 -0
  131. package/dist/billing/modules/billing/pages/InvoiceDetailPage.d.ts +4 -0
  132. package/dist/billing/modules/billing/pages/InvoiceDetailPage.d.ts.map +1 -0
  133. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +631 -0
  134. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -0
  135. package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts +4 -0
  136. package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts.map +1 -0
  137. package/dist/billing/modules/billing/pages/InvoicesListPage.js +382 -0
  138. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -0
  139. package/dist/billing/modules/billing/pages/PaymentMethodsPage.d.ts +4 -0
  140. package/dist/billing/modules/billing/pages/PaymentMethodsPage.d.ts.map +1 -0
  141. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +147 -0
  142. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -0
  143. package/dist/billing/modules/billing/pages/RefundsPage.d.ts +4 -0
  144. package/dist/billing/modules/billing/pages/RefundsPage.d.ts.map +1 -0
  145. package/dist/billing/modules/billing/pages/RefundsPage.js +1074 -0
  146. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -0
  147. package/dist/billing/modules/billing/pages/TransactionsPage.d.ts +4 -0
  148. package/dist/billing/modules/billing/pages/TransactionsPage.d.ts.map +1 -0
  149. package/dist/billing/modules/billing/pages/TransactionsPage.js +587 -0
  150. package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -0
  151. package/dist/billing/modules/billing/pages/index.d.ts +10 -0
  152. package/dist/billing/modules/billing/pages/index.d.ts.map +1 -0
  153. package/dist/billing/modules/billing/pages/index.js +5 -0
  154. package/dist/billing/modules/checkout/components/AutoPayToggle.d.ts +14 -0
  155. package/dist/billing/modules/checkout/components/AutoPayToggle.d.ts.map +1 -0
  156. package/dist/billing/modules/checkout/components/AutoPayToggle.js +3 -0
  157. package/dist/billing/modules/checkout/components/BillingAccountSelector.d.ts +14 -0
  158. package/dist/billing/modules/checkout/components/BillingAccountSelector.d.ts.map +1 -0
  159. package/dist/billing/modules/checkout/components/BillingAccountSelector.js +151 -0
  160. package/dist/billing/modules/checkout/components/BillingAccountSelector.js.map +1 -0
  161. package/dist/billing/modules/checkout/components/CompactAutoPayToggle.d.ts +14 -0
  162. package/dist/billing/modules/checkout/components/CompactAutoPayToggle.d.ts.map +1 -0
  163. package/dist/billing/modules/checkout/components/CompactAutoPayToggle.js +4 -0
  164. package/dist/billing/modules/checkout/components/CreditsAmountInput.d.ts +14 -0
  165. package/dist/billing/modules/checkout/components/CreditsAmountInput.d.ts.map +1 -0
  166. package/dist/billing/modules/checkout/components/CreditsAmountInput.js +130 -0
  167. package/dist/billing/modules/checkout/components/CreditsAmountInput.js.map +1 -0
  168. package/dist/billing/modules/checkout/components/CreditsPaymentOption.d.ts +16 -0
  169. package/dist/billing/modules/checkout/components/CreditsPaymentOption.d.ts.map +1 -0
  170. package/dist/billing/modules/checkout/components/CreditsPaymentOption.js +5 -0
  171. package/dist/billing/modules/checkout/components/CurrencySelector.d.ts +19 -0
  172. package/dist/billing/modules/checkout/components/CurrencySelector.d.ts.map +1 -0
  173. package/dist/billing/modules/checkout/components/CurrencySelector.js +5 -0
  174. package/dist/billing/modules/checkout/components/NativeCheckoutView.d.ts +14 -0
  175. package/dist/billing/modules/checkout/components/NativeCheckoutView.d.ts.map +1 -0
  176. package/dist/billing/modules/checkout/components/NativeCheckoutView.js +273 -0
  177. package/dist/billing/modules/checkout/components/NativeCheckoutView.js.map +1 -0
  178. package/dist/billing/modules/checkout/components/OrderSummary.d.ts +22 -0
  179. package/dist/billing/modules/checkout/components/OrderSummary.d.ts.map +1 -0
  180. package/dist/billing/modules/checkout/components/OrderSummary.js +293 -0
  181. package/dist/billing/modules/checkout/components/OrderSummary.js.map +1 -0
  182. package/dist/billing/modules/checkout/components/PaymentProviderSelector.d.ts +19 -0
  183. package/dist/billing/modules/checkout/components/PaymentProviderSelector.d.ts.map +1 -0
  184. package/dist/billing/modules/checkout/components/PaymentProviderSelector.js +3 -0
  185. package/dist/billing/modules/checkout/components/PromoCodeInput.d.ts +19 -0
  186. package/dist/billing/modules/checkout/components/PromoCodeInput.d.ts.map +1 -0
  187. package/dist/billing/modules/checkout/components/PromoCodeInput.js +102 -0
  188. package/dist/billing/modules/checkout/components/PromoCodeInput.js.map +1 -0
  189. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.d.ts +25 -0
  190. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.d.ts.map +1 -0
  191. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js +169 -0
  192. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js.map +1 -0
  193. package/dist/billing/modules/checkout/components/SavedCardSelector.d.ts +13 -0
  194. package/dist/billing/modules/checkout/components/SavedCardSelector.d.ts.map +1 -0
  195. package/dist/billing/modules/checkout/components/SavedCardSelector.js +4 -0
  196. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.d.ts +13 -0
  197. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.d.ts.map +1 -0
  198. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.js +78 -0
  199. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.js.map +1 -0
  200. package/dist/billing/modules/checkout/components/StripePaymentForm.d.ts +16 -0
  201. package/dist/billing/modules/checkout/components/StripePaymentForm.d.ts.map +1 -0
  202. package/dist/billing/modules/checkout/components/StripePaymentForm.js +253 -0
  203. package/dist/billing/modules/checkout/components/StripePaymentForm.js.map +1 -0
  204. package/dist/billing/modules/checkout/components/SubscriptionSelector.d.ts +26 -0
  205. package/dist/billing/modules/checkout/components/SubscriptionSelector.d.ts.map +1 -0
  206. package/dist/billing/modules/checkout/components/SubscriptionSelector.js +84 -0
  207. package/dist/billing/modules/checkout/components/SubscriptionSelector.js.map +1 -0
  208. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.d.ts +23 -0
  209. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.d.ts.map +1 -0
  210. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.js +229 -0
  211. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.js.map +1 -0
  212. package/dist/billing/modules/checkout/components/index.d.ts +20 -0
  213. package/dist/billing/modules/checkout/components/index.d.ts.map +1 -0
  214. package/dist/billing/modules/checkout/components/index.js +16 -0
  215. package/dist/billing/modules/checkout/graphql/index.d.ts +6 -0
  216. package/dist/billing/modules/checkout/graphql/index.d.ts.map +1 -0
  217. package/dist/billing/modules/checkout/hooks/index.d.ts +9 -0
  218. package/dist/billing/modules/checkout/hooks/index.d.ts.map +1 -0
  219. package/dist/billing/modules/checkout/hooks/index.js +4 -0
  220. package/dist/billing/modules/checkout/hooks/useCheckout.d.ts +69 -0
  221. package/dist/billing/modules/checkout/hooks/useCheckout.d.ts.map +1 -0
  222. package/dist/billing/modules/checkout/hooks/useCheckout.js +377 -0
  223. package/dist/billing/modules/checkout/hooks/useCheckout.js.map +1 -0
  224. package/dist/billing/modules/checkout/hooks/useNativeCheckout.d.ts +26 -0
  225. package/dist/billing/modules/checkout/hooks/useNativeCheckout.d.ts.map +1 -0
  226. package/dist/billing/modules/checkout/hooks/useNativeCheckout.js +88 -0
  227. package/dist/billing/modules/checkout/hooks/useNativeCheckout.js.map +1 -0
  228. package/dist/billing/modules/checkout/hooks/usePaymentProviders.d.ts +19 -0
  229. package/dist/billing/modules/checkout/hooks/usePaymentProviders.d.ts.map +1 -0
  230. package/dist/billing/modules/checkout/hooks/usePaymentProviders.js +16 -0
  231. package/dist/billing/modules/checkout/hooks/usePaymentProviders.js.map +1 -0
  232. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.d.ts +59 -0
  233. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.d.ts.map +1 -0
  234. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.js +107 -0
  235. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.js.map +1 -0
  236. package/dist/billing/modules/checkout/index.d.ts +24 -0
  237. package/dist/billing/modules/checkout/index.d.ts.map +1 -0
  238. package/dist/billing/modules/checkout/index.js +19 -0
  239. package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts +4 -0
  240. package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts.map +1 -0
  241. package/dist/billing/modules/checkout/pages/CheckoutPage.js +1248 -0
  242. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -0
  243. package/dist/billing/modules/checkout/pages/index.d.ts +5 -0
  244. package/dist/billing/modules/checkout/pages/index.d.ts.map +1 -0
  245. package/dist/billing/modules/checkout/pages/index.js +1 -0
  246. package/dist/billing/modules/checkout/types/index.d.ts +270 -0
  247. package/dist/billing/modules/checkout/types/index.d.ts.map +1 -0
  248. package/dist/billing/modules/checkout/utils/storeOrder.d.ts +20 -0
  249. package/dist/billing/modules/checkout/utils/storeOrder.d.ts.map +1 -0
  250. package/dist/billing/modules/checkout/utils/storeOrder.js +27 -0
  251. package/dist/billing/modules/checkout/utils/storeOrder.js.map +1 -0
  252. package/dist/billing/modules/coupons/index.d.ts +5 -0
  253. package/dist/billing/modules/coupons/index.d.ts.map +1 -0
  254. package/dist/billing/modules/coupons/index.js +6 -0
  255. package/dist/billing/modules/coupons/pages/CouponDetailPage.d.ts +4 -0
  256. package/dist/billing/modules/coupons/pages/CouponDetailPage.d.ts.map +1 -0
  257. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +489 -0
  258. package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -0
  259. package/dist/billing/modules/coupons/pages/CouponsListPage.d.ts +4 -0
  260. package/dist/billing/modules/coupons/pages/CouponsListPage.d.ts.map +1 -0
  261. package/dist/billing/modules/coupons/pages/CouponsListPage.js +544 -0
  262. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -0
  263. package/dist/billing/modules/coupons/pages/CreateCouponPage.d.ts +4 -0
  264. package/dist/billing/modules/coupons/pages/CreateCouponPage.d.ts.map +1 -0
  265. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +421 -0
  266. package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -0
  267. package/dist/billing/modules/coupons/pages/EditCouponPage.d.ts +4 -0
  268. package/dist/billing/modules/coupons/pages/EditCouponPage.d.ts.map +1 -0
  269. package/dist/billing/modules/coupons/pages/EditCouponPage.js +379 -0
  270. package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -0
  271. package/dist/billing/modules/coupons/pages/index.d.ts +8 -0
  272. package/dist/billing/modules/coupons/pages/index.d.ts.map +1 -0
  273. package/dist/billing/modules/coupons/pages/index.js +4 -0
  274. package/dist/billing/modules/credits/hooks/index.d.ts +5 -0
  275. package/dist/billing/modules/credits/hooks/index.d.ts.map +1 -0
  276. package/dist/billing/modules/credits/hooks/index.js +1 -0
  277. package/dist/billing/modules/credits/hooks/useCredits.d.ts +75 -0
  278. package/dist/billing/modules/credits/hooks/useCredits.d.ts.map +1 -0
  279. package/dist/billing/modules/credits/hooks/useCredits.js +78 -0
  280. package/dist/billing/modules/credits/hooks/useCredits.js.map +1 -0
  281. package/dist/billing/modules/credits/index.d.ts +6 -0
  282. package/dist/billing/modules/credits/index.d.ts.map +1 -0
  283. package/dist/billing/modules/credits/index.js +8 -0
  284. package/dist/billing/modules/credits/pages/AdminCreditsPage.d.ts +4 -0
  285. package/dist/billing/modules/credits/pages/AdminCreditsPage.d.ts.map +1 -0
  286. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +140 -0
  287. package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -0
  288. package/dist/billing/modules/credits/pages/CreditTransactionsPage.d.ts +4 -0
  289. package/dist/billing/modules/credits/pages/CreditTransactionsPage.d.ts.map +1 -0
  290. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +331 -0
  291. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js.map +1 -0
  292. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts +4 -0
  293. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts.map +1 -0
  294. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +770 -0
  295. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -0
  296. package/dist/billing/modules/credits/pages/CreditsPage.d.ts +4 -0
  297. package/dist/billing/modules/credits/pages/CreditsPage.d.ts.map +1 -0
  298. package/dist/billing/modules/credits/pages/CreditsPage.js +324 -0
  299. package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -0
  300. package/dist/billing/modules/credits/pages/index.d.ts +8 -0
  301. package/dist/billing/modules/credits/pages/index.d.ts.map +1 -0
  302. package/dist/billing/modules/credits/pages/index.js +4 -0
  303. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.d.ts +14 -0
  304. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.d.ts.map +1 -0
  305. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js +185 -0
  306. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js.map +1 -0
  307. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.d.ts +111 -0
  308. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.d.ts.map +1 -0
  309. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js +388 -0
  310. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js.map +1 -0
  311. package/dist/billing/modules/dashboard/components/BillingAccountCard.d.ts +16 -0
  312. package/dist/billing/modules/dashboard/components/BillingAccountCard.d.ts.map +1 -0
  313. package/dist/billing/modules/dashboard/components/BillingAccountCard.js +146 -0
  314. package/dist/billing/modules/dashboard/components/BillingAccountCard.js.map +1 -0
  315. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.d.ts +13 -0
  316. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.d.ts.map +1 -0
  317. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js +1044 -0
  318. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js.map +1 -0
  319. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.d.ts +15 -0
  320. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.d.ts.map +1 -0
  321. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js +216 -0
  322. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js.map +1 -0
  323. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.d.ts +27 -0
  324. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.d.ts.map +1 -0
  325. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js +193 -0
  326. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js.map +1 -0
  327. package/dist/billing/modules/dashboard/components/index.d.ts +10 -0
  328. package/dist/billing/modules/dashboard/components/index.d.ts.map +1 -0
  329. package/dist/billing/modules/dashboard/components/index.js +6 -0
  330. package/dist/billing/modules/dashboard/hooks/index.d.ts +6 -0
  331. package/dist/billing/modules/dashboard/hooks/index.d.ts.map +1 -0
  332. package/dist/billing/modules/dashboard/hooks/index.js +2 -0
  333. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.d.ts +17 -0
  334. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.d.ts.map +1 -0
  335. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.js +42 -0
  336. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.js.map +1 -0
  337. package/dist/billing/modules/dashboard/hooks/useDashboard.d.ts +145 -0
  338. package/dist/billing/modules/dashboard/hooks/useDashboard.d.ts.map +1 -0
  339. package/dist/billing/modules/dashboard/hooks/useDashboard.js +118 -0
  340. package/dist/billing/modules/dashboard/hooks/useDashboard.js.map +1 -0
  341. package/dist/billing/modules/dashboard/index.d.ts +8 -0
  342. package/dist/billing/modules/dashboard/index.d.ts.map +1 -0
  343. package/dist/billing/modules/dashboard/index.js +12 -0
  344. package/dist/billing/modules/dashboard/pages/OverviewPage.d.ts +4 -0
  345. package/dist/billing/modules/dashboard/pages/OverviewPage.d.ts.map +1 -0
  346. package/dist/billing/modules/dashboard/pages/OverviewPage.js +478 -0
  347. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -0
  348. package/dist/billing/modules/dashboard/pages/index.d.ts +5 -0
  349. package/dist/billing/modules/dashboard/pages/index.d.ts.map +1 -0
  350. package/dist/billing/modules/dashboard/pages/index.js +1 -0
  351. package/dist/billing/modules/discounts/index.d.ts +6 -0
  352. package/dist/billing/modules/discounts/index.d.ts.map +1 -0
  353. package/dist/billing/modules/discounts/index.js +3 -0
  354. package/dist/billing/modules/discounts/pages/DiscountsListPage.d.ts +4 -0
  355. package/dist/billing/modules/discounts/pages/DiscountsListPage.d.ts.map +1 -0
  356. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +1009 -0
  357. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -0
  358. package/dist/billing/modules/discounts/pages/index.d.ts +6 -0
  359. package/dist/billing/modules/discounts/pages/index.d.ts.map +1 -0
  360. package/dist/billing/modules/discounts/pages/index.js +1 -0
  361. package/dist/billing/modules/earnings/api.d.ts +131 -0
  362. package/dist/billing/modules/earnings/api.d.ts.map +1 -0
  363. package/dist/billing/modules/earnings/api.js +122 -0
  364. package/dist/billing/modules/earnings/api.js.map +1 -0
  365. package/dist/billing/modules/earnings/index.d.ts +4 -0
  366. package/dist/billing/modules/earnings/index.d.ts.map +1 -0
  367. package/dist/billing/modules/earnings/index.js +4 -0
  368. package/dist/billing/modules/earnings/pages/EarningsPage.d.ts +4 -0
  369. package/dist/billing/modules/earnings/pages/EarningsPage.d.ts.map +1 -0
  370. package/dist/billing/modules/earnings/pages/EarningsPage.js +435 -0
  371. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -0
  372. package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts +4 -0
  373. package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts.map +1 -0
  374. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +273 -0
  375. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -0
  376. package/dist/billing/modules/earnings/pages/PayoutsPage.d.ts +4 -0
  377. package/dist/billing/modules/earnings/pages/PayoutsPage.d.ts.map +1 -0
  378. package/dist/billing/modules/earnings/pages/PayoutsPage.js +480 -0
  379. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -0
  380. package/dist/billing/modules/plans/hooks/index.d.ts +7 -0
  381. package/dist/billing/modules/plans/hooks/index.d.ts.map +1 -0
  382. package/dist/billing/modules/plans/hooks/index.js +2 -0
  383. package/dist/billing/modules/plans/hooks/usePlans.d.ts +46 -0
  384. package/dist/billing/modules/plans/hooks/usePlans.d.ts.map +1 -0
  385. package/dist/billing/modules/plans/hooks/usePlans.js +77 -0
  386. package/dist/billing/modules/plans/hooks/usePlans.js.map +1 -0
  387. package/dist/billing/modules/plans/hooks/useQuotas.d.ts +27 -0
  388. package/dist/billing/modules/plans/hooks/useQuotas.d.ts.map +1 -0
  389. package/dist/billing/modules/plans/hooks/useQuotas.js +21 -0
  390. package/dist/billing/modules/plans/hooks/useQuotas.js.map +1 -0
  391. package/dist/billing/modules/plans/index.d.ts +7 -0
  392. package/dist/billing/modules/plans/index.d.ts.map +1 -0
  393. package/dist/billing/modules/plans/index.js +11 -0
  394. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.d.ts +4 -0
  395. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.d.ts.map +1 -0
  396. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +264 -0
  397. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js.map +1 -0
  398. package/dist/billing/modules/plans/pages/PlanCreatePage.d.ts +4 -0
  399. package/dist/billing/modules/plans/pages/PlanCreatePage.d.ts.map +1 -0
  400. package/dist/billing/modules/plans/pages/PlanCreatePage.js +368 -0
  401. package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -0
  402. package/dist/billing/modules/plans/pages/PlanDetailPage.d.ts +4 -0
  403. package/dist/billing/modules/plans/pages/PlanDetailPage.d.ts.map +1 -0
  404. package/dist/billing/modules/plans/pages/PlanDetailPage.js +356 -0
  405. package/dist/billing/modules/plans/pages/PlanDetailPage.js.map +1 -0
  406. package/dist/billing/modules/plans/pages/PlanEditPage.d.ts +4 -0
  407. package/dist/billing/modules/plans/pages/PlanEditPage.d.ts.map +1 -0
  408. package/dist/billing/modules/plans/pages/PlanEditPage.js +395 -0
  409. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -0
  410. package/dist/billing/modules/plans/pages/PlansBrowsePage.d.ts +4 -0
  411. package/dist/billing/modules/plans/pages/PlansBrowsePage.d.ts.map +1 -0
  412. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +314 -0
  413. package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -0
  414. package/dist/billing/modules/plans/pages/PlansListPage.d.ts +4 -0
  415. package/dist/billing/modules/plans/pages/PlansListPage.d.ts.map +1 -0
  416. package/dist/billing/modules/plans/pages/PlansListPage.js +438 -0
  417. package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -0
  418. package/dist/billing/modules/plans/pages/index.d.ts +11 -0
  419. package/dist/billing/modules/plans/pages/index.d.ts.map +1 -0
  420. package/dist/billing/modules/plans/pages/index.js +6 -0
  421. package/dist/billing/modules/quota/hooks/index.d.ts +6 -0
  422. package/dist/billing/modules/quota/hooks/index.d.ts.map +1 -0
  423. package/dist/billing/modules/quota/hooks/index.js +2 -0
  424. package/dist/billing/modules/quota/hooks/useQuota.d.ts +102 -0
  425. package/dist/billing/modules/quota/hooks/useQuota.d.ts.map +1 -0
  426. package/dist/billing/modules/quota/hooks/useQuota.js +63 -0
  427. package/dist/billing/modules/quota/hooks/useQuota.js.map +1 -0
  428. package/dist/billing/modules/quota/hooks/useQuotaTemplates.d.ts +39 -0
  429. package/dist/billing/modules/quota/hooks/useQuotaTemplates.d.ts.map +1 -0
  430. package/dist/billing/modules/quota/hooks/useQuotaTemplates.js +67 -0
  431. package/dist/billing/modules/quota/hooks/useQuotaTemplates.js.map +1 -0
  432. package/dist/billing/modules/quota/index.d.ts +6 -0
  433. package/dist/billing/modules/quota/index.d.ts.map +1 -0
  434. package/dist/billing/modules/quota/index.js +10 -0
  435. package/dist/billing/modules/quota/pages/QuotaPage.d.ts +4 -0
  436. package/dist/billing/modules/quota/pages/QuotaPage.d.ts.map +1 -0
  437. package/dist/billing/modules/quota/pages/QuotaPage.js +337 -0
  438. package/dist/billing/modules/quota/pages/QuotaPage.js.map +1 -0
  439. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts +4 -0
  440. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts.map +1 -0
  441. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +273 -0
  442. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -0
  443. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.d.ts +4 -0
  444. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.d.ts.map +1 -0
  445. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +272 -0
  446. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js.map +1 -0
  447. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts +4 -0
  448. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts.map +1 -0
  449. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +316 -0
  450. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -0
  451. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.d.ts +4 -0
  452. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.d.ts.map +1 -0
  453. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +401 -0
  454. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js.map +1 -0
  455. package/dist/billing/modules/quota/pages/index.d.ts +9 -0
  456. package/dist/billing/modules/quota/pages/index.d.ts.map +1 -0
  457. package/dist/billing/modules/quota/pages/index.js +5 -0
  458. package/dist/billing/modules/settings/index.d.ts +5 -0
  459. package/dist/billing/modules/settings/index.d.ts.map +1 -0
  460. package/dist/billing/modules/settings/index.js +4 -0
  461. package/dist/billing/modules/settings/pages/SettingsPage.d.ts +4 -0
  462. package/dist/billing/modules/settings/pages/SettingsPage.d.ts.map +1 -0
  463. package/dist/billing/modules/settings/pages/SettingsPage.js +632 -0
  464. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -0
  465. package/dist/billing/modules/settings/pages/TeamPermissionsPage.d.ts +4 -0
  466. package/dist/billing/modules/settings/pages/TeamPermissionsPage.d.ts.map +1 -0
  467. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +270 -0
  468. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -0
  469. package/dist/billing/modules/settings/pages/index.d.ts +6 -0
  470. package/dist/billing/modules/settings/pages/index.d.ts.map +1 -0
  471. package/dist/billing/modules/settings/pages/index.js +2 -0
  472. package/dist/billing/modules/store/graphql/index.d.ts +6 -0
  473. package/dist/billing/modules/store/graphql/index.d.ts.map +1 -0
  474. package/dist/billing/modules/store/graphql/index.js +1 -0
  475. package/dist/billing/modules/store/index.d.ts +6 -0
  476. package/dist/billing/modules/store/index.d.ts.map +1 -0
  477. package/dist/billing/modules/store/index.js +3 -0
  478. package/dist/billing/modules/store/pages/StoreCheckoutPage.d.ts +11 -0
  479. package/dist/billing/modules/store/pages/StoreCheckoutPage.d.ts.map +1 -0
  480. package/dist/billing/modules/store/pages/StoreCheckoutPage.js +18 -0
  481. package/dist/billing/modules/store/pages/StoreCheckoutPage.js.map +1 -0
  482. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.d.ts +12 -0
  483. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.d.ts.map +1 -0
  484. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +167 -0
  485. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js.map +1 -0
  486. package/dist/billing/modules/subscriptions/hooks/index.d.ts +6 -0
  487. package/dist/billing/modules/subscriptions/hooks/index.d.ts.map +1 -0
  488. package/dist/billing/modules/subscriptions/hooks/index.js +1 -0
  489. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts +92 -0
  490. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts.map +1 -0
  491. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js +136 -0
  492. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js.map +1 -0
  493. package/dist/billing/modules/subscriptions/index.d.ts +7 -0
  494. package/dist/billing/modules/subscriptions/index.d.ts.map +1 -0
  495. package/dist/billing/modules/subscriptions/index.js +7 -0
  496. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.d.ts +4 -0
  497. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.d.ts.map +1 -0
  498. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +551 -0
  499. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -0
  500. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts +4 -0
  501. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts.map +1 -0
  502. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +529 -0
  503. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -0
  504. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.d.ts +4 -0
  505. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.d.ts.map +1 -0
  506. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +430 -0
  507. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -0
  508. package/dist/billing/modules/subscriptions/pages/index.d.ts +8 -0
  509. package/dist/billing/modules/subscriptions/pages/index.d.ts.map +1 -0
  510. package/dist/billing/modules/subscriptions/pages/index.js +3 -0
  511. package/dist/billing/modules/usage/hooks/index.d.ts +6 -0
  512. package/dist/billing/modules/usage/hooks/index.d.ts.map +1 -0
  513. package/dist/billing/modules/usage/hooks/index.js +1 -0
  514. package/dist/billing/modules/usage/hooks/useUsage.d.ts +203 -0
  515. package/dist/billing/modules/usage/hooks/useUsage.d.ts.map +1 -0
  516. package/dist/billing/modules/usage/hooks/useUsage.js +271 -0
  517. package/dist/billing/modules/usage/hooks/useUsage.js.map +1 -0
  518. package/dist/billing/modules/usage/index.d.ts +6 -0
  519. package/dist/billing/modules/usage/index.d.ts.map +1 -0
  520. package/dist/billing/modules/usage/index.js +5 -0
  521. package/dist/billing/modules/usage/pages/UsagePage.d.ts +4 -0
  522. package/dist/billing/modules/usage/pages/UsagePage.d.ts.map +1 -0
  523. package/dist/billing/modules/usage/pages/UsagePage.js +817 -0
  524. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -0
  525. package/dist/billing/modules/usage/pages/index.d.ts +5 -0
  526. package/dist/billing/modules/usage/pages/index.d.ts.map +1 -0
  527. package/dist/billing/modules/usage/pages/index.js +1 -0
  528. package/dist/billing/providers/BillingProvider.d.ts +16 -0
  529. package/dist/billing/providers/BillingProvider.d.ts.map +1 -0
  530. package/dist/billing/providers/BillingProvider.js +40 -0
  531. package/dist/billing/providers/BillingProvider.js.map +1 -0
  532. package/dist/billing/shared/components/AccessDenied.d.ts +8 -0
  533. package/dist/billing/shared/components/AccessDenied.d.ts.map +1 -0
  534. package/dist/billing/shared/components/AccessDenied.js +44 -0
  535. package/dist/billing/shared/components/AccessDenied.js.map +1 -0
  536. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.d.ts +11 -0
  537. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.d.ts.map +1 -0
  538. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js +230 -0
  539. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js.map +1 -0
  540. package/dist/billing/shared/components/EmptyState.d.ts +11 -0
  541. package/dist/billing/shared/components/EmptyState.d.ts.map +1 -0
  542. package/dist/billing/shared/components/EmptyState.js +27 -0
  543. package/dist/billing/shared/components/EmptyState.js.map +1 -0
  544. package/dist/billing/shared/components/GeoPricingOverridesEditor.d.ts +11 -0
  545. package/dist/billing/shared/components/GeoPricingOverridesEditor.d.ts.map +1 -0
  546. package/dist/billing/shared/components/GeoPricingOverridesEditor.js +1 -0
  547. package/dist/billing/shared/components/PageHeader.d.ts +11 -0
  548. package/dist/billing/shared/components/PageHeader.d.ts.map +1 -0
  549. package/dist/billing/shared/components/PageHeader.js +25 -0
  550. package/dist/billing/shared/components/PageHeader.js.map +1 -0
  551. package/dist/billing/shared/components/ServerError.d.ts +11 -0
  552. package/dist/billing/shared/components/ServerError.d.ts.map +1 -0
  553. package/dist/billing/shared/components/ServerError.js +75 -0
  554. package/dist/billing/shared/components/ServerError.js.map +1 -0
  555. package/dist/billing/shared/components/StatCard.d.ts +15 -0
  556. package/dist/billing/shared/components/StatCard.d.ts.map +1 -0
  557. package/dist/billing/shared/components/StatCard.js +37 -0
  558. package/dist/billing/shared/components/StatCard.js.map +1 -0
  559. package/dist/billing/shared/components/index.d.ts +11 -0
  560. package/dist/billing/shared/components/index.d.ts.map +1 -0
  561. package/dist/billing/shared/components/index.js +7 -0
  562. package/dist/billing/shared/index.d.ts +8 -0
  563. package/dist/billing/shared/index.d.ts.map +1 -0
  564. package/dist/billing/shared/types/graphql.d.ts +926 -0
  565. package/dist/billing/shared/types/graphql.d.ts.map +1 -0
  566. package/dist/billing/shared/types/graphql.js +30 -0
  567. package/dist/billing/shared/types/graphql.js.map +1 -0
  568. package/dist/billing/shared/types/index.d.ts +96 -0
  569. package/dist/billing/shared/types/index.d.ts.map +1 -0
  570. package/dist/billing/shared/utils/directActivityGraphql.d.ts +13 -0
  571. package/dist/billing/shared/utils/directActivityGraphql.d.ts.map +1 -0
  572. package/dist/billing/shared/utils/directActivityGraphql.js +2 -0
  573. package/dist/billing/shared/utils/directBillingGraphql.d.ts +13 -0
  574. package/dist/billing/shared/utils/directBillingGraphql.d.ts.map +1 -0
  575. package/dist/billing/shared/utils/directBillingGraphql.js +22 -0
  576. package/dist/billing/shared/utils/directBillingGraphql.js.map +1 -0
  577. package/dist/billing/shared/utils/error.d.ts +30 -0
  578. package/dist/billing/shared/utils/error.d.ts.map +1 -0
  579. package/dist/billing/shared/utils/error.js +16 -0
  580. package/dist/billing/shared/utils/error.js.map +1 -0
  581. package/dist/billing/shared/utils/format.d.ts +28 -0
  582. package/dist/billing/shared/utils/format.d.ts.map +1 -0
  583. package/dist/billing/shared/utils/format.js +65 -0
  584. package/dist/billing/shared/utils/format.js.map +1 -0
  585. package/dist/billing/shared/utils/gatewayGraphql.d.ts +15 -0
  586. package/dist/billing/shared/utils/gatewayGraphql.d.ts.map +1 -0
  587. package/dist/billing/shared/utils/gatewayGraphql.js +27 -0
  588. package/dist/billing/shared/utils/gatewayGraphql.js.map +1 -0
  589. package/dist/billing/shared/utils/index.d.ts +13 -0
  590. package/dist/billing/shared/utils/index.d.ts.map +1 -0
  591. package/dist/billing/shared/utils/index.js +8 -0
  592. package/dist/billing/shared/utils/navigation.d.ts +2 -0
  593. package/dist/billing/shared/utils/navigation.d.ts.map +1 -0
  594. package/dist/billing/shared/utils/navigation.js +8 -0
  595. package/dist/billing/shared/utils/navigation.js.map +1 -0
  596. package/dist/billing/shared/utils/paymentTheme.d.ts +18 -0
  597. package/dist/billing/shared/utils/paymentTheme.d.ts.map +1 -0
  598. package/dist/billing/shared/utils/paymentTheme.js +32 -0
  599. package/dist/billing/shared/utils/paymentTheme.js.map +1 -0
  600. package/dist/billing/shared/utils/status.d.ts +28 -0
  601. package/dist/billing/shared/utils/status.d.ts.map +1 -0
  602. package/dist/billing/shared/utils/status.js +57 -0
  603. package/dist/billing/shared/utils/status.js.map +1 -0
  604. package/dist/billing/shared/utils/tokens.d.ts +156 -0
  605. package/dist/billing/shared/utils/tokens.d.ts.map +1 -0
  606. package/dist/billing/shared/utils/tokens.js +128 -0
  607. package/dist/billing/shared/utils/tokens.js.map +1 -0
  608. package/dist/billing/types/index.d.ts +268 -0
  609. package/dist/billing/types/index.d.ts.map +1 -0
  610. package/dist/billing/utils/index.d.ts +128 -0
  611. package/dist/billing/utils/index.d.ts.map +1 -0
  612. package/dist/dev/main.d.ts +2 -0
  613. package/dist/dev/main.d.ts.map +1 -0
  614. package/dist/generated/global-operations.d.ts +9544 -0
  615. package/dist/generated/global-operations.d.ts.map +1 -0
  616. package/dist/generated/global-operations.js +3542 -0
  617. package/dist/generated/global-operations.js.map +1 -0
  618. package/dist/generated/global-types.d.ts +22208 -0
  619. package/dist/generated/global-types.d.ts.map +1 -0
  620. package/dist/generated/global-types.js +12 -0
  621. package/dist/generated/global-types.js.map +1 -0
  622. package/dist/generated/wspace-operations.d.ts +61 -0
  623. package/dist/generated/wspace-operations.d.ts.map +1 -0
  624. package/dist/generated/wspace-operations.js +35 -0
  625. package/dist/generated/wspace-operations.js.map +1 -0
  626. package/dist/generated/wspace-types.d.ts +48578 -0
  627. package/dist/generated/wspace-types.d.ts.map +1 -0
  628. package/dist/index.d.ts +8 -0
  629. package/dist/index.d.ts.map +1 -0
  630. package/dist/index.js +2 -0
  631. package/dist/node_modules/@capacitor/core/dist/index.js +270 -0
  632. package/dist/node_modules/@capacitor/core/dist/index.js.map +1 -0
  633. package/dist/utils/nativeBridge.d.ts +3 -0
  634. package/dist/utils/nativeBridge.d.ts.map +1 -0
  635. package/dist/utils/nativeBridge.js +2 -0
  636. package/package.json +112 -0
@@ -0,0 +1,469 @@
1
+ import { AccessDenied as e } from "../../../shared/components/AccessDenied.js";
2
+ import { PageHeader as t } from "../../../shared/components/PageHeader.js";
3
+ import { StatCard as n } from "../../../shared/components/StatCard.js";
4
+ import "../../../shared/components/index.js";
5
+ import { formatCurrency as r, formatPercentage as i } from "../../../shared/utils/format.js";
6
+ import { useBillingPermissions as a } from "../../../hooks/useBillingPermissions.js";
7
+ import { useGetBillingAnalyticsPageDataQuery as o } from "../../../../generated/global-operations.js";
8
+ import { PlanDuration as s, SubscriptionStatus as c } from "../../../../generated/global-types.js";
9
+ import { useMemo as l, useState as u } from "react";
10
+ import { AlertCircle as d, BarChart3 as f, RefreshCw as p, TrendingUp as m, Users as h, Wallet as g } from "lucide-react";
11
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
12
+ import { useI18n as b } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
13
+ //#region src/billing/modules/analytics/pages/AnalyticsPage.tsx
14
+ var x = [
15
+ {
16
+ value: "LAST_7_DAYS",
17
+ label: "Last 7 days"
18
+ },
19
+ {
20
+ value: "LAST_30_DAYS",
21
+ label: "Last 30 days"
22
+ },
23
+ {
24
+ value: "LAST_90_DAYS",
25
+ label: "Last 90 days"
26
+ },
27
+ {
28
+ value: "CURRENT_MONTH",
29
+ label: "This month"
30
+ },
31
+ {
32
+ value: "LAST_MONTH",
33
+ label: "Last month"
34
+ }
35
+ ], S = new Set([
36
+ c.Active,
37
+ c.Trialing,
38
+ c.PastDue,
39
+ c.Paused
40
+ ]);
41
+ function C(e) {
42
+ let t = new Date(e);
43
+ return t.setHours(0, 0, 0, 0), t;
44
+ }
45
+ function w(e) {
46
+ let t = /* @__PURE__ */ new Date(), n = t;
47
+ switch (e) {
48
+ case "LAST_7_DAYS": {
49
+ let e = new Date(t);
50
+ return e.setDate(e.getDate() - 6), {
51
+ start: C(e),
52
+ end: n
53
+ };
54
+ }
55
+ case "LAST_30_DAYS": {
56
+ let e = new Date(t);
57
+ return e.setDate(e.getDate() - 29), {
58
+ start: C(e),
59
+ end: n
60
+ };
61
+ }
62
+ case "LAST_90_DAYS": {
63
+ let e = new Date(t);
64
+ return e.setDate(e.getDate() - 89), {
65
+ start: C(e),
66
+ end: n
67
+ };
68
+ }
69
+ case "LAST_MONTH": return {
70
+ start: new Date(t.getFullYear(), t.getMonth() - 1, 1),
71
+ end: new Date(t.getFullYear(), t.getMonth(), 0, 23, 59, 59, 999)
72
+ };
73
+ default: return {
74
+ start: new Date(t.getFullYear(), t.getMonth(), 1),
75
+ end: n
76
+ };
77
+ }
78
+ }
79
+ function T(e, t, n) {
80
+ if (!e) return !1;
81
+ let r = new Date(e);
82
+ return r >= t && r <= n;
83
+ }
84
+ function E(e, t) {
85
+ return t === s.Yearly ? e / 12 : e;
86
+ }
87
+ function D(e, t) {
88
+ return new Intl.DateTimeFormat("en-US", {
89
+ month: "short",
90
+ day: "numeric"
91
+ }).format(e);
92
+ }
93
+ function O(e, t, n, r) {
94
+ let i = /* @__PURE__ */ new Map();
95
+ return e.forEach((e) => {
96
+ let a = new Date(e.paidAt || e.createdAt);
97
+ if (a < n || a > r) return;
98
+ let o = D(a, t);
99
+ i.set(o, (i.get(o) ?? 0) + e.amount);
100
+ }), Array.from(i.entries()).map(([e, t]) => ({
101
+ label: e,
102
+ value: t
103
+ }));
104
+ }
105
+ function k(e, t, n, r) {
106
+ let i = /* @__PURE__ */ new Map();
107
+ return e.forEach((e) => {
108
+ let a = new Date(e.createdAt);
109
+ if (a < n || a > r) return;
110
+ let o = D(a, t);
111
+ i.set(o, (i.get(o) ?? 0) + 1);
112
+ }), Array.from(i.entries()).map(([e, t]) => ({
113
+ label: e,
114
+ value: t
115
+ }));
116
+ }
117
+ function A(e, t) {
118
+ try {
119
+ return r(e, t);
120
+ } catch {
121
+ return new Intl.NumberFormat("en-US", {
122
+ style: "currency",
123
+ currency: t,
124
+ maximumFractionDigits: 2
125
+ }).format(e);
126
+ }
127
+ }
128
+ var j = () => {
129
+ let { t: r } = b(), s = a(), [C, D] = u("LAST_30_DAYS"), { start: j, end: M } = l(() => w(C), [C]), { data: N, loading: P, error: F, refetch: I } = o({ fetchPolicy: "cache-and-network" }), L = l(() => N?.getBillingAccountsByOrg ?? [], [N?.getBillingAccountsByOrg]), R = l(() => N?.getPayments ?? [], [N?.getPayments]), z = l(() => L.flatMap((e) => (e.subscriptions ?? []).filter((e) => !!e)), [L]), B = l(() => z.filter((e) => S.has(e.status)), [z]), V = B.find((e) => e.plan?.currency)?.plan?.currency || R[0]?.currency || L[0]?.currency || "USD", H = l(() => {
130
+ let e = B.reduce((e, t) => {
131
+ let n = t.plan?.price ?? 0, r = t.seatCount && t.seatCount > 0 ? t.seatCount : 1;
132
+ return e + E(n, t.plan?.duration) * r;
133
+ }, 0), t = e * 12, n = L.length, r = L.filter((e) => T(e.createdAt, j, M)).length, i = z.filter((e) => (e.status === c.Canceled || e.status === c.Expired) && T(e.canceledAt || e.endDate, j, M)).length, a = B.length + i, o = a > 0 ? i / a * 100 : 0, s = n > 0 ? e / n : 0;
134
+ return {
135
+ mrr: e,
136
+ arr: t,
137
+ arpu: s,
138
+ churnRate: o,
139
+ ltv: o > 0 ? s / (o / 100) : t,
140
+ totalCustomers: n,
141
+ newCustomers: r,
142
+ activeSubscriptions: B.length
143
+ };
144
+ }, [
145
+ B,
146
+ L,
147
+ j,
148
+ M,
149
+ z
150
+ ]), U = l(() => O(R, C, j, M), [
151
+ R,
152
+ C,
153
+ j,
154
+ M
155
+ ]), W = l(() => k(z, C, j, M), [
156
+ C,
157
+ j,
158
+ M,
159
+ z
160
+ ]), G = l(() => {
161
+ let e = /* @__PURE__ */ new Map();
162
+ return B.forEach((t) => {
163
+ let n = t.plan?.name || "Unknown Plan", r = t.seatCount && t.seatCount > 0 ? t.seatCount : 1, i = E(t.plan?.price ?? 0, t.plan?.duration) * r, a = e.get(n);
164
+ e.set(n, {
165
+ name: n,
166
+ activeSubscriptions: (a?.activeSubscriptions ?? 0) + 1,
167
+ estimatedMrr: (a?.estimatedMrr ?? 0) + i
168
+ });
169
+ }), Array.from(e.values()).sort((e, t) => t.estimatedMrr - e.estimatedMrr);
170
+ }, [B]), K = l(() => L.map((e) => {
171
+ let t = (e.subscriptions ?? []).filter((e) => e ? S.has(e.status) : !1), n = t.reduce((e, t) => {
172
+ let n = t.seatCount && t.seatCount > 0 ? t.seatCount : 1;
173
+ return e + E(t.plan?.price ?? 0, t.plan?.duration) * n;
174
+ }, 0);
175
+ return {
176
+ id: e.id ?? e.name ?? e.email ?? "unknown-account",
177
+ name: e.name ?? "Unnamed account",
178
+ email: e.email ?? "No contact email",
179
+ activeSubscriptions: t.length,
180
+ estimatedMrr: n
181
+ };
182
+ }).sort((e, t) => t.estimatedMrr - e.estimatedMrr).slice(0, 5), [L]), q = Math.max(...U.map((e) => e.value), 0), J = Math.max(...W.map((e) => e.value), 0);
183
+ return s.canViewAnalytics ? /* @__PURE__ */ y("div", {
184
+ className: "space-y-6 p-4 sm:p-6",
185
+ children: [
186
+ /* @__PURE__ */ v(t, {
187
+ title: "Revenue Analytics",
188
+ description: "Track recurring revenue, customer growth, and billing performance using live billing data.",
189
+ actions: /* @__PURE__ */ y("div", {
190
+ className: "flex flex-col gap-2 sm:flex-row sm:items-center",
191
+ children: [/* @__PURE__ */ y("button", {
192
+ type: "button",
193
+ onClick: () => I(),
194
+ className: "inline-flex items-center justify-center gap-2 rounded-md border border-border bg-background px-3 py-2 text-sm font-medium text-foreground transition-colors hover:bg-muted",
195
+ children: [/* @__PURE__ */ v(p, { className: "h-4 w-4" }), "Refresh"]
196
+ }), /* @__PURE__ */ v("select", {
197
+ value: C,
198
+ onChange: (e) => D(e.target.value),
199
+ className: "rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-primary",
200
+ children: x.map((e) => /* @__PURE__ */ v("option", {
201
+ value: e.value,
202
+ children: e.label
203
+ }, e.value))
204
+ })]
205
+ })
206
+ }),
207
+ F && /* @__PURE__ */ y("div", {
208
+ className: "flex items-start gap-3 rounded-lg border border-status-error-border bg-status-error-bg-subtle p-4 text-status-error-text",
209
+ children: [/* @__PURE__ */ v(d, { className: "mt-0.5 h-4 w-4 shrink-0" }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
210
+ className: "font-medium",
211
+ children: "Unable to load billing analytics"
212
+ }), /* @__PURE__ */ v("p", {
213
+ className: "mt-1 text-sm",
214
+ children: F.message
215
+ })] })]
216
+ }),
217
+ P && L.length === 0 ? /* @__PURE__ */ v("div", {
218
+ className: "flex min-h-[320px] items-center justify-center rounded-lg border border-border bg-card",
219
+ children: /* @__PURE__ */ y("div", {
220
+ className: "flex flex-col items-center gap-3 text-muted-foreground",
221
+ children: [/* @__PURE__ */ v(p, { className: "h-6 w-6 animate-spin" }), /* @__PURE__ */ v("p", {
222
+ className: "text-sm",
223
+ children: "Loading live billing analytics…"
224
+ })]
225
+ })
226
+ }) : L.length === 0 ? /* @__PURE__ */ y("div", {
227
+ className: "rounded-lg border border-dashed border-border bg-card p-8 text-center",
228
+ children: [
229
+ /* @__PURE__ */ v(f, { className: "mx-auto h-10 w-10 text-muted-foreground" }),
230
+ /* @__PURE__ */ v("h2", {
231
+ className: "mt-4 text-lg font-semibold text-foreground",
232
+ children: "No billing data available yet"
233
+ }),
234
+ /* @__PURE__ */ v("p", {
235
+ className: "mt-2 text-sm text-muted-foreground",
236
+ children: "Create a billing account and complete a subscription or payment to unlock live analytics."
237
+ })
238
+ ]
239
+ }) : /* @__PURE__ */ y(_, { children: [
240
+ /* @__PURE__ */ y("div", {
241
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4",
242
+ children: [
243
+ /* @__PURE__ */ v(n, {
244
+ label: "MRR",
245
+ value: A(H.mrr, V),
246
+ icon: /* @__PURE__ */ v(m, { className: "h-5 w-5" }),
247
+ className: "bg-status-info-bg-subtle"
248
+ }),
249
+ /* @__PURE__ */ v(n, {
250
+ label: "ARR",
251
+ value: A(H.arr, V),
252
+ icon: /* @__PURE__ */ v(f, { className: "h-5 w-5" }),
253
+ className: "bg-status-success-bg-subtle"
254
+ }),
255
+ /* @__PURE__ */ v(n, {
256
+ label: "ARPU",
257
+ value: A(H.arpu, V),
258
+ icon: /* @__PURE__ */ v(g, { className: "h-5 w-5" })
259
+ }),
260
+ /* @__PURE__ */ v(n, {
261
+ label: "Churn Rate",
262
+ value: i(H.churnRate),
263
+ icon: /* @__PURE__ */ v(h, { className: "h-5 w-5" }),
264
+ className: "bg-status-warning-bg-subtle"
265
+ })
266
+ ]
267
+ }),
268
+ /* @__PURE__ */ y("div", {
269
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4",
270
+ children: [
271
+ /* @__PURE__ */ v(n, {
272
+ label: "Total Customers",
273
+ value: H.totalCustomers
274
+ }),
275
+ /* @__PURE__ */ v(n, {
276
+ label: "New Customers",
277
+ value: H.newCustomers
278
+ }),
279
+ /* @__PURE__ */ v(n, {
280
+ label: "Active Subscriptions",
281
+ value: H.activeSubscriptions
282
+ }),
283
+ /* @__PURE__ */ v(n, {
284
+ label: "Estimated LTV",
285
+ value: A(H.ltv, V)
286
+ })
287
+ ]
288
+ }),
289
+ /* @__PURE__ */ y("div", {
290
+ className: "grid grid-cols-1 gap-6 xl:grid-cols-2",
291
+ children: [/* @__PURE__ */ y("section", {
292
+ className: "rounded-lg border border-border bg-card p-4 sm:p-6",
293
+ children: [/* @__PURE__ */ y("div", {
294
+ className: "mb-4 flex items-center justify-between gap-3",
295
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h3", {
296
+ className: "font-semibold text-foreground",
297
+ children: "Revenue over time"
298
+ }), /* @__PURE__ */ v("p", {
299
+ className: "text-sm text-muted-foreground",
300
+ children: "Successful payments received during the selected period."
301
+ })] }), /* @__PURE__ */ y("span", {
302
+ className: "rounded-full bg-status-info-bg-subtle px-2.5 py-1 text-xs font-medium text-status-info-text",
303
+ children: [
304
+ U.length,
305
+ " data point",
306
+ U.length === 1 ? "" : "s"
307
+ ]
308
+ })]
309
+ }), U.length === 0 ? /* @__PURE__ */ v("p", {
310
+ className: "rounded-lg bg-muted/40 p-4 text-sm text-muted-foreground",
311
+ children: "No successful payments were recorded during this period."
312
+ }) : /* @__PURE__ */ v("div", {
313
+ className: "space-y-3",
314
+ children: U.map((e) => /* @__PURE__ */ y("div", {
315
+ className: "space-y-1",
316
+ children: [/* @__PURE__ */ y("div", {
317
+ className: "flex items-center justify-between gap-3 text-sm",
318
+ children: [/* @__PURE__ */ v("span", {
319
+ className: "font-medium text-foreground",
320
+ children: e.label
321
+ }), /* @__PURE__ */ v("span", {
322
+ className: "text-muted-foreground",
323
+ children: A(e.value, V)
324
+ })]
325
+ }), /* @__PURE__ */ v("div", {
326
+ className: "h-2 rounded-full bg-muted",
327
+ children: /* @__PURE__ */ v("div", {
328
+ className: "h-2 rounded-full bg-primary transition-[width]",
329
+ style: { width: `${q > 0 ? e.value / q * 100 : 0}%` }
330
+ })
331
+ })]
332
+ }, e.label))
333
+ })]
334
+ }), /* @__PURE__ */ y("section", {
335
+ className: "rounded-lg border border-border bg-card p-4 sm:p-6",
336
+ children: [/* @__PURE__ */ y("div", {
337
+ className: "mb-4 flex items-center justify-between gap-3",
338
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h3", {
339
+ className: "font-semibold text-foreground",
340
+ children: "Subscription growth"
341
+ }), /* @__PURE__ */ v("p", {
342
+ className: "text-sm text-muted-foreground",
343
+ children: "New subscriptions created during the selected period."
344
+ })] }), /* @__PURE__ */ y("span", {
345
+ className: "rounded-full bg-status-success-bg-subtle px-2.5 py-1 text-xs font-medium text-status-success-text",
346
+ children: [W.reduce((e, t) => e + t.value, 0), " created"]
347
+ })]
348
+ }), W.length === 0 ? /* @__PURE__ */ v("p", {
349
+ className: "rounded-lg bg-muted/40 p-4 text-sm text-muted-foreground",
350
+ children: "No new subscriptions were created during this period."
351
+ }) : /* @__PURE__ */ v("div", {
352
+ className: "space-y-3",
353
+ children: W.map((e) => /* @__PURE__ */ y("div", {
354
+ className: "space-y-1",
355
+ children: [/* @__PURE__ */ y("div", {
356
+ className: "flex items-center justify-between gap-3 text-sm",
357
+ children: [/* @__PURE__ */ v("span", {
358
+ className: "font-medium text-foreground",
359
+ children: e.label
360
+ }), /* @__PURE__ */ y("span", {
361
+ className: "text-muted-foreground",
362
+ children: [e.value, " new"]
363
+ })]
364
+ }), /* @__PURE__ */ v("div", {
365
+ className: "h-2 rounded-full bg-muted",
366
+ children: /* @__PURE__ */ v("div", {
367
+ className: "h-2 rounded-full bg-status-success-bg transition-[width]",
368
+ style: { width: `${J > 0 ? e.value / J * 100 : 0}%` }
369
+ })
370
+ })]
371
+ }, e.label))
372
+ })]
373
+ })]
374
+ }),
375
+ /* @__PURE__ */ y("div", {
376
+ className: "grid grid-cols-1 gap-6 xl:grid-cols-2",
377
+ children: [/* @__PURE__ */ y("section", {
378
+ className: "rounded-lg border border-border bg-card",
379
+ children: [/* @__PURE__ */ y("div", {
380
+ className: "border-b border-border p-4",
381
+ children: [/* @__PURE__ */ v("h3", {
382
+ className: "font-semibold text-foreground",
383
+ children: "Revenue by plan"
384
+ }), /* @__PURE__ */ v("p", {
385
+ className: "mt-1 text-sm text-muted-foreground",
386
+ children: "Estimated monthly recurring revenue based on currently active subscriptions."
387
+ })]
388
+ }), /* @__PURE__ */ v("div", {
389
+ className: "p-4",
390
+ children: G.length === 0 ? /* @__PURE__ */ v("p", {
391
+ className: "text-sm text-muted-foreground",
392
+ children: "No active plans to analyse yet."
393
+ }) : /* @__PURE__ */ v("div", {
394
+ className: "space-y-3",
395
+ children: G.map((e) => /* @__PURE__ */ y("div", {
396
+ className: "flex flex-col gap-2 rounded-lg border border-border-subtle p-3 sm:flex-row sm:items-center sm:justify-between",
397
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
398
+ className: "font-medium text-foreground",
399
+ children: e.name
400
+ }), /* @__PURE__ */ y("p", {
401
+ className: "text-sm text-muted-foreground",
402
+ children: [
403
+ e.activeSubscriptions,
404
+ " active subscription",
405
+ e.activeSubscriptions === 1 ? "" : "s"
406
+ ]
407
+ })] }), /* @__PURE__ */ y("p", {
408
+ className: "text-sm font-semibold text-foreground",
409
+ children: [A(e.estimatedMrr, V), " / month"]
410
+ })]
411
+ }, e.name))
412
+ })
413
+ })]
414
+ }), /* @__PURE__ */ y("section", {
415
+ className: "rounded-lg border border-border bg-card",
416
+ children: [/* @__PURE__ */ y("div", {
417
+ className: "border-b border-border p-4",
418
+ children: [/* @__PURE__ */ v("h3", {
419
+ className: "font-semibold text-foreground",
420
+ children: "Top customers"
421
+ }), /* @__PURE__ */ v("p", {
422
+ className: "mt-1 text-sm text-muted-foreground",
423
+ children: "Ranked by estimated monthly recurring revenue from active subscriptions."
424
+ })]
425
+ }), /* @__PURE__ */ v("div", {
426
+ className: "p-4",
427
+ children: K.length === 0 ? /* @__PURE__ */ v("p", {
428
+ className: "text-sm text-muted-foreground",
429
+ children: "No customer revenue data available yet."
430
+ }) : /* @__PURE__ */ v("div", {
431
+ className: "space-y-3",
432
+ children: K.map((e) => /* @__PURE__ */ y("div", {
433
+ className: "flex flex-col gap-2 rounded-lg border border-border-subtle p-3 sm:flex-row sm:items-center sm:justify-between",
434
+ children: [/* @__PURE__ */ y("div", {
435
+ className: "min-w-0",
436
+ children: [/* @__PURE__ */ v("p", {
437
+ className: "truncate font-medium text-foreground",
438
+ children: e.name
439
+ }), /* @__PURE__ */ v("p", {
440
+ className: "truncate text-sm text-muted-foreground",
441
+ children: e.email
442
+ })]
443
+ }), /* @__PURE__ */ y("div", {
444
+ className: "text-left sm:text-right",
445
+ children: [/* @__PURE__ */ y("p", {
446
+ className: "text-sm font-semibold text-foreground",
447
+ children: [A(e.estimatedMrr, V), " / month"]
448
+ }), /* @__PURE__ */ y("p", {
449
+ className: "text-xs text-muted-foreground",
450
+ children: [
451
+ e.activeSubscriptions,
452
+ " active subscription",
453
+ e.activeSubscriptions === 1 ? "" : "s"
454
+ ]
455
+ })]
456
+ })]
457
+ }, e.id))
458
+ })
459
+ })]
460
+ })]
461
+ })
462
+ ] })
463
+ ]
464
+ }) : /* @__PURE__ */ v(e, { message: "You don't have permission to view analytics." });
465
+ };
466
+ //#endregion
467
+ export { j as AnalyticsPage };
468
+
469
+ //# sourceMappingURL=AnalyticsPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnalyticsPage.js","names":[],"sources":["../../../../../src/billing/modules/analytics/pages/AnalyticsPage.tsx"],"sourcesContent":["/**\n * Analytics Module - Revenue Analytics Page\n * Uses real billing data aggregated from billing accounts, subscriptions, and payments.\n */\n\nimport { useMemo, useState, type FC } from 'react';\nimport { AlertCircle, BarChart3, RefreshCw, TrendingUp, Users, Wallet } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { useBillingPermissions } from '../../../hooks/useBillingPermissions';\nimport { AccessDenied, PageHeader, StatCard } from '../../../shared/components';\nimport { formatCurrency, formatPercentage } from '../../../shared/utils/format';\nimport type { AnalyticsPeriod } from '../../../shared/types';\nimport {\n type GetBillingAnalyticsPageDataQuery,\n useGetBillingAnalyticsPageDataQuery,\n} from '../../../../generated/global-operations';\nimport { PlanDuration, SubscriptionStatus } from '../../../../generated/global-types';\n\nconst PERIOD_OPTIONS: { value: AnalyticsPeriod; label: string }[] = [\n { value: 'LAST_7_DAYS' as AnalyticsPeriod, label: 'Last 7 days' },\n { value: 'LAST_30_DAYS' as AnalyticsPeriod, label: 'Last 30 days' },\n { value: 'LAST_90_DAYS' as AnalyticsPeriod, label: 'Last 90 days' },\n { value: 'CURRENT_MONTH' as AnalyticsPeriod, label: 'This month' },\n { value: 'LAST_MONTH' as AnalyticsPeriod, label: 'Last month' },\n];\n\nconst ACTIVE_SUBSCRIPTION_STATUSES = new Set<SubscriptionStatus>([\n SubscriptionStatus.Active,\n SubscriptionStatus.Trialing,\n SubscriptionStatus.PastDue,\n SubscriptionStatus.Paused,\n]);\n\ntype RevenuePoint = {\n label: string;\n value: number;\n};\n\ntype PlanBreakdown = {\n name: string;\n activeSubscriptions: number;\n estimatedMrr: number;\n};\n\ntype CustomerSummary = {\n id: string;\n name: string;\n email: string;\n activeSubscriptions: number;\n estimatedMrr: number;\n};\n\ntype BillingAnalyticsAccount = GetBillingAnalyticsPageDataQuery['getBillingAccountsByOrg'][number];\ntype BillingAnalyticsSubscription = NonNullable<\n NonNullable<BillingAnalyticsAccount['subscriptions']>[number]\n>;\ntype BillingAnalyticsPayment = GetBillingAnalyticsPageDataQuery['getPayments'][number];\n\nfunction startOfDay(date: Date): Date {\n const value = new Date(date);\n value.setHours(0, 0, 0, 0);\n return value;\n}\n\nfunction getPeriodRange(period: AnalyticsPeriod): { start: Date; end: Date } {\n const now = new Date();\n const end = now;\n\n switch (period) {\n case 'LAST_7_DAYS': {\n const start = new Date(now);\n start.setDate(start.getDate() - 6);\n return { start: startOfDay(start), end };\n }\n case 'LAST_30_DAYS': {\n const start = new Date(now);\n start.setDate(start.getDate() - 29);\n return { start: startOfDay(start), end };\n }\n case 'LAST_90_DAYS': {\n const start = new Date(now);\n start.setDate(start.getDate() - 89);\n return { start: startOfDay(start), end };\n }\n case 'LAST_MONTH': {\n const start = new Date(now.getFullYear(), now.getMonth() - 1, 1);\n const monthEnd = new Date(now.getFullYear(), now.getMonth(), 0, 23, 59, 59, 999);\n return { start, end: monthEnd };\n }\n case 'CURRENT_MONTH':\n default:\n return {\n start: new Date(now.getFullYear(), now.getMonth(), 1),\n end,\n };\n }\n}\n\nfunction isWithinRange(dateValue: string | null | undefined, start: Date, end: Date): boolean {\n if (!dateValue) {\n return false;\n }\n\n const date = new Date(dateValue);\n return date >= start && date <= end;\n}\n\nfunction normalizeRecurringAmount(\n amount: number,\n duration: PlanDuration | null | undefined\n): number {\n if (duration === PlanDuration.Yearly) {\n return amount / 12;\n }\n\n return amount;\n}\n\nfunction getBucketLabel(dateValue: Date, period: AnalyticsPeriod): string {\n if (period === 'LAST_90_DAYS') {\n return new Intl.DateTimeFormat('en-US', { month: 'short', day: 'numeric' }).format(dateValue);\n }\n\n return new Intl.DateTimeFormat('en-US', {\n month: 'short',\n day: 'numeric',\n }).format(dateValue);\n}\n\nfunction buildRevenueSeries(\n payments: Array<{ amount: number; paidAt?: string | null; createdAt: string }>,\n period: AnalyticsPeriod,\n start: Date,\n end: Date\n): RevenuePoint[] {\n const buckets = new Map<string, number>();\n\n payments.forEach((payment) => {\n const paymentDate = new Date(payment.paidAt || payment.createdAt);\n if (paymentDate < start || paymentDate > end) {\n return;\n }\n\n const label = getBucketLabel(paymentDate, period);\n buckets.set(label, (buckets.get(label) ?? 0) + payment.amount);\n });\n\n return Array.from(buckets.entries()).map(([label, value]) => ({ label, value }));\n}\n\nfunction buildSubscriptionGrowthSeries(\n subscriptions: Array<{ createdAt: string }>,\n period: AnalyticsPeriod,\n start: Date,\n end: Date\n): RevenuePoint[] {\n const buckets = new Map<string, number>();\n\n subscriptions.forEach((subscription) => {\n const createdAt = new Date(subscription.createdAt);\n if (createdAt < start || createdAt > end) {\n return;\n }\n\n const label = getBucketLabel(createdAt, period);\n buckets.set(label, (buckets.get(label) ?? 0) + 1);\n });\n\n return Array.from(buckets.entries()).map(([label, value]) => ({ label, value }));\n}\n\nfunction formatMetricCurrency(value: number, currency: string): string {\n try {\n return formatCurrency(value, currency);\n } catch {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency,\n maximumFractionDigits: 2,\n }).format(value);\n }\n}\n\nexport const AnalyticsPage: 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 permissions = useBillingPermissions();\n const [period, setPeriod] = useState<AnalyticsPeriod>('LAST_30_DAYS' as AnalyticsPeriod);\n const { start, end } = useMemo(() => getPeriodRange(period), [period]);\n\n const { data, loading, error, refetch } = useGetBillingAnalyticsPageDataQuery({\n fetchPolicy: 'cache-and-network',\n });\n\n const billingAccounts = useMemo<BillingAnalyticsAccount[]>(\n () => data?.getBillingAccountsByOrg ?? [],\n [data?.getBillingAccountsByOrg]\n );\n const successfulPayments = useMemo<BillingAnalyticsPayment[]>(\n () => data?.getPayments ?? [],\n [data?.getPayments]\n );\n\n const subscriptions = useMemo<BillingAnalyticsSubscription[]>(\n () =>\n billingAccounts.flatMap((account: BillingAnalyticsAccount) =>\n (account.subscriptions ?? []).filter(\n (subscription): subscription is BillingAnalyticsSubscription => Boolean(subscription)\n )\n ),\n [billingAccounts]\n );\n\n const activeSubscriptions = useMemo<BillingAnalyticsSubscription[]>(\n () =>\n subscriptions.filter((subscription: BillingAnalyticsSubscription) =>\n ACTIVE_SUBSCRIPTION_STATUSES.has(subscription.status)\n ),\n [subscriptions]\n );\n\n const displayCurrency =\n activeSubscriptions.find((subscription) => subscription.plan?.currency)?.plan?.currency ||\n successfulPayments[0]?.currency ||\n billingAccounts[0]?.currency ||\n 'USD';\n\n const metrics = useMemo(() => {\n const mrr = activeSubscriptions.reduce(\n (sum: number, subscription: BillingAnalyticsSubscription) => {\n const planPrice = subscription.plan?.price ?? 0;\n const seatCount =\n subscription.seatCount && subscription.seatCount > 0 ? subscription.seatCount : 1;\n return sum + normalizeRecurringAmount(planPrice, subscription.plan?.duration) * seatCount;\n },\n 0\n );\n\n const arr = mrr * 12;\n const totalCustomers = billingAccounts.length;\n const newCustomers = billingAccounts.filter((account: BillingAnalyticsAccount) =>\n isWithinRange(account.createdAt, start, end)\n ).length;\n const churnedSubscriptions = subscriptions.filter(\n (subscription: BillingAnalyticsSubscription) =>\n (subscription.status === SubscriptionStatus.Canceled ||\n subscription.status === SubscriptionStatus.Expired) &&\n isWithinRange(subscription.canceledAt || subscription.endDate, start, end)\n ).length;\n\n const churnBase = activeSubscriptions.length + churnedSubscriptions;\n const churnRate = churnBase > 0 ? (churnedSubscriptions / churnBase) * 100 : 0;\n const arpu = totalCustomers > 0 ? mrr / totalCustomers : 0;\n const ltv = churnRate > 0 ? arpu / (churnRate / 100) : arr;\n\n return {\n mrr,\n arr,\n arpu,\n churnRate,\n ltv,\n totalCustomers,\n newCustomers,\n activeSubscriptions: activeSubscriptions.length,\n };\n }, [activeSubscriptions, billingAccounts, start, end, subscriptions]);\n\n const revenueSeries = useMemo(\n () => buildRevenueSeries(successfulPayments, period, start, end),\n [successfulPayments, period, start, end]\n );\n\n const subscriptionGrowthSeries = useMemo(\n () => buildSubscriptionGrowthSeries(subscriptions, period, start, end),\n [period, start, end, subscriptions]\n );\n\n const revenueByPlan = useMemo<PlanBreakdown[]>(() => {\n const planMap = new Map<string, PlanBreakdown>();\n\n activeSubscriptions.forEach((subscription: BillingAnalyticsSubscription) => {\n const planName = subscription.plan?.name || 'Unknown Plan';\n const seatCount =\n subscription.seatCount && subscription.seatCount > 0 ? subscription.seatCount : 1;\n const estimatedMrr =\n normalizeRecurringAmount(subscription.plan?.price ?? 0, subscription.plan?.duration) *\n seatCount;\n\n const current = planMap.get(planName);\n planMap.set(planName, {\n name: planName,\n activeSubscriptions: (current?.activeSubscriptions ?? 0) + 1,\n estimatedMrr: (current?.estimatedMrr ?? 0) + estimatedMrr,\n });\n });\n\n return Array.from(planMap.values()).sort(\n (left: PlanBreakdown, right: PlanBreakdown) => right.estimatedMrr - left.estimatedMrr\n );\n }, [activeSubscriptions]);\n\n const topCustomers = useMemo<CustomerSummary[]>(() => {\n return billingAccounts\n .map((account: BillingAnalyticsAccount) => {\n const accountSubscriptions = (account.subscriptions ?? []).filter(\n (subscription): subscription is BillingAnalyticsSubscription => {\n if (!subscription) {\n return false;\n }\n\n return ACTIVE_SUBSCRIPTION_STATUSES.has(subscription.status);\n }\n );\n\n const estimatedMrr = accountSubscriptions.reduce(\n (sum: number, subscription: BillingAnalyticsSubscription) => {\n const seatCount =\n subscription.seatCount && subscription.seatCount > 0 ? subscription.seatCount : 1;\n return (\n sum +\n normalizeRecurringAmount(subscription.plan?.price ?? 0, subscription.plan?.duration) *\n seatCount\n );\n },\n 0\n );\n\n return {\n id: account.id ?? account.name ?? account.email ?? 'unknown-account',\n name: account.name ?? 'Unnamed account',\n email: account.email ?? 'No contact email',\n activeSubscriptions: accountSubscriptions.length,\n estimatedMrr,\n };\n })\n .sort(\n (left: CustomerSummary, right: CustomerSummary) => right.estimatedMrr - left.estimatedMrr\n )\n .slice(0, 5);\n }, [billingAccounts]);\n\n const maxRevenuePoint = Math.max(...revenueSeries.map((item) => item.value), 0);\n const maxGrowthPoint = Math.max(...subscriptionGrowthSeries.map((item) => item.value), 0);\n\n if (!permissions.canViewAnalytics) {\n return <AccessDenied message=\"You don't have permission to view analytics.\" />;\n }\n\n return (\n <div className=\"space-y-6 p-4 sm:p-6\">\n <PageHeader\n title=\"Revenue Analytics\"\n description=\"Track recurring revenue, customer growth, and billing performance using live billing data.\"\n actions={\n <div className=\"flex flex-col gap-2 sm:flex-row sm:items-center\">\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"inline-flex items-center justify-center gap-2 rounded-md border border-border bg-background px-3 py-2 text-sm font-medium text-foreground transition-colors hover:bg-muted\"\n >\n <RefreshCw className=\"h-4 w-4\" />\n Refresh\n </button>\n <select\n value={period}\n onChange={(event) => setPeriod(event.target.value as AnalyticsPeriod)}\n className=\"rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-primary\"\n >\n {PERIOD_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n </div>\n }\n />\n\n {error && (\n <div className=\"flex items-start gap-3 rounded-lg border border-status-error-border bg-status-error-bg-subtle p-4 text-status-error-text\">\n <AlertCircle className=\"mt-0.5 h-4 w-4 shrink-0\" />\n <div>\n <p className=\"font-medium\">Unable to load billing analytics</p>\n <p className=\"mt-1 text-sm\">{error.message}</p>\n </div>\n </div>\n )}\n\n {loading && billingAccounts.length === 0 ? (\n <div className=\"flex min-h-[320px] items-center justify-center rounded-lg border border-border bg-card\">\n <div className=\"flex flex-col items-center gap-3 text-muted-foreground\">\n <RefreshCw className=\"h-6 w-6 animate-spin\" />\n <p className=\"text-sm\">Loading live billing analytics…</p>\n </div>\n </div>\n ) : billingAccounts.length === 0 ? (\n <div className=\"rounded-lg border border-dashed border-border bg-card p-8 text-center\">\n <BarChart3 className=\"mx-auto h-10 w-10 text-muted-foreground\" />\n <h2 className=\"mt-4 text-lg font-semibold text-foreground\">\n No billing data available yet\n </h2>\n <p className=\"mt-2 text-sm text-muted-foreground\">\n Create a billing account and complete a subscription or payment to unlock live\n analytics.\n </p>\n </div>\n ) : (\n <>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4\">\n <StatCard\n label=\"MRR\"\n value={formatMetricCurrency(metrics.mrr, displayCurrency)}\n icon={<TrendingUp className=\"h-5 w-5\" />}\n className=\"bg-status-info-bg-subtle\"\n />\n <StatCard\n label=\"ARR\"\n value={formatMetricCurrency(metrics.arr, displayCurrency)}\n icon={<BarChart3 className=\"h-5 w-5\" />}\n className=\"bg-status-success-bg-subtle\"\n />\n <StatCard\n label=\"ARPU\"\n value={formatMetricCurrency(metrics.arpu, displayCurrency)}\n icon={<Wallet className=\"h-5 w-5\" />}\n />\n <StatCard\n label=\"Churn Rate\"\n value={formatPercentage(metrics.churnRate)}\n icon={<Users className=\"h-5 w-5\" />}\n className=\"bg-status-warning-bg-subtle\"\n />\n </div>\n\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4\">\n <StatCard label=\"Total Customers\" value={metrics.totalCustomers} />\n <StatCard label=\"New Customers\" value={metrics.newCustomers} />\n <StatCard label=\"Active Subscriptions\" value={metrics.activeSubscriptions} />\n <StatCard\n label=\"Estimated LTV\"\n value={formatMetricCurrency(metrics.ltv, displayCurrency)}\n />\n </div>\n\n <div className=\"grid grid-cols-1 gap-6 xl:grid-cols-2\">\n <section className=\"rounded-lg border border-border bg-card p-4 sm:p-6\">\n <div className=\"mb-4 flex items-center justify-between gap-3\">\n <div>\n <h3 className=\"font-semibold text-foreground\">Revenue over time</h3>\n <p className=\"text-sm text-muted-foreground\">\n Successful payments received during the selected period.\n </p>\n </div>\n <span className=\"rounded-full bg-status-info-bg-subtle px-2.5 py-1 text-xs font-medium text-status-info-text\">\n {revenueSeries.length} data point{revenueSeries.length === 1 ? '' : 's'}\n </span>\n </div>\n\n {revenueSeries.length === 0 ? (\n <p className=\"rounded-lg bg-muted/40 p-4 text-sm text-muted-foreground\">\n No successful payments were recorded during this period.\n </p>\n ) : (\n <div className=\"space-y-3\">\n {revenueSeries.map((point) => (\n <div key={point.label} className=\"space-y-1\">\n <div className=\"flex items-center justify-between gap-3 text-sm\">\n <span className=\"font-medium text-foreground\">{point.label}</span>\n <span className=\"text-muted-foreground\">\n {formatMetricCurrency(point.value, displayCurrency)}\n </span>\n </div>\n <div className=\"h-2 rounded-full bg-muted\">\n <div\n className=\"h-2 rounded-full bg-primary transition-[width]\"\n style={{\n width: `${maxRevenuePoint > 0 ? (point.value / maxRevenuePoint) * 100 : 0}%`,\n }}\n />\n </div>\n </div>\n ))}\n </div>\n )}\n </section>\n\n <section className=\"rounded-lg border border-border bg-card p-4 sm:p-6\">\n <div className=\"mb-4 flex items-center justify-between gap-3\">\n <div>\n <h3 className=\"font-semibold text-foreground\">Subscription growth</h3>\n <p className=\"text-sm text-muted-foreground\">\n New subscriptions created during the selected period.\n </p>\n </div>\n <span className=\"rounded-full bg-status-success-bg-subtle px-2.5 py-1 text-xs font-medium text-status-success-text\">\n {subscriptionGrowthSeries.reduce((sum, point) => sum + point.value, 0)} created\n </span>\n </div>\n\n {subscriptionGrowthSeries.length === 0 ? (\n <p className=\"rounded-lg bg-muted/40 p-4 text-sm text-muted-foreground\">\n No new subscriptions were created during this period.\n </p>\n ) : (\n <div className=\"space-y-3\">\n {subscriptionGrowthSeries.map((point) => (\n <div key={point.label} className=\"space-y-1\">\n <div className=\"flex items-center justify-between gap-3 text-sm\">\n <span className=\"font-medium text-foreground\">{point.label}</span>\n <span className=\"text-muted-foreground\">{point.value} new</span>\n </div>\n <div className=\"h-2 rounded-full bg-muted\">\n <div\n className=\"h-2 rounded-full bg-status-success-bg transition-[width]\"\n style={{\n width: `${maxGrowthPoint > 0 ? (point.value / maxGrowthPoint) * 100 : 0}%`,\n }}\n />\n </div>\n </div>\n ))}\n </div>\n )}\n </section>\n </div>\n\n <div className=\"grid grid-cols-1 gap-6 xl:grid-cols-2\">\n <section className=\"rounded-lg border border-border bg-card\">\n <div className=\"border-b border-border p-4\">\n <h3 className=\"font-semibold text-foreground\">Revenue by plan</h3>\n <p className=\"mt-1 text-sm text-muted-foreground\">\n Estimated monthly recurring revenue based on currently active subscriptions.\n </p>\n </div>\n <div className=\"p-4\">\n {revenueByPlan.length === 0 ? (\n <p className=\"text-sm text-muted-foreground\">No active plans to analyse yet.</p>\n ) : (\n <div className=\"space-y-3\">\n {revenueByPlan.map((plan) => (\n <div\n key={plan.name}\n className=\"flex flex-col gap-2 rounded-lg border border-border-subtle p-3 sm:flex-row sm:items-center sm:justify-between\"\n >\n <div>\n <p className=\"font-medium text-foreground\">{plan.name}</p>\n <p className=\"text-sm text-muted-foreground\">\n {plan.activeSubscriptions} active subscription\n {plan.activeSubscriptions === 1 ? '' : 's'}\n </p>\n </div>\n <p className=\"text-sm font-semibold text-foreground\">\n {formatMetricCurrency(plan.estimatedMrr, displayCurrency)} / month\n </p>\n </div>\n ))}\n </div>\n )}\n </div>\n </section>\n\n <section className=\"rounded-lg border border-border bg-card\">\n <div className=\"border-b border-border p-4\">\n <h3 className=\"font-semibold text-foreground\">Top customers</h3>\n <p className=\"mt-1 text-sm text-muted-foreground\">\n Ranked by estimated monthly recurring revenue from active subscriptions.\n </p>\n </div>\n <div className=\"p-4\">\n {topCustomers.length === 0 ? (\n <p className=\"text-sm text-muted-foreground\">\n No customer revenue data available yet.\n </p>\n ) : (\n <div className=\"space-y-3\">\n {topCustomers.map((customer) => (\n <div\n key={customer.id}\n className=\"flex flex-col gap-2 rounded-lg border border-border-subtle p-3 sm:flex-row sm:items-center sm:justify-between\"\n >\n <div className=\"min-w-0\">\n <p className=\"truncate font-medium text-foreground\">{customer.name}</p>\n <p className=\"truncate text-sm text-muted-foreground\">{customer.email}</p>\n </div>\n <div className=\"text-left sm:text-right\">\n <p className=\"text-sm font-semibold text-foreground\">\n {formatMetricCurrency(customer.estimatedMrr, displayCurrency)} / month\n </p>\n <p className=\"text-xs text-muted-foreground\">\n {customer.activeSubscriptions} active subscription\n {customer.activeSubscriptions === 1 ? '' : 's'}\n </p>\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n </section>\n </div>\n </>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAkBA,IAAM,IAA8D;CAClE;EAAE,OAAO;EAAkC,OAAO;EAAe;CACjE;EAAE,OAAO;EAAmC,OAAO;EAAgB;CACnE;EAAE,OAAO;EAAmC,OAAO;EAAgB;CACnE;EAAE,OAAO;EAAoC,OAAO;EAAc;CAClE;EAAE,OAAO;EAAiC,OAAO;EAAc;CAChE,EAEK,IAA+B,IAAI,IAAwB;CAC/D,EAAmB;CACnB,EAAmB;CACnB,EAAmB;CACnB,EAAmB;CACpB,CAAC;AA2BF,SAAS,EAAW,GAAkB;CACpC,IAAM,IAAQ,IAAI,KAAK,EAAK;AAE5B,QADA,EAAM,SAAS,GAAG,GAAG,GAAG,EAAE,EACnB;;AAGT,SAAS,EAAe,GAAqD;CAC3E,IAAM,oBAAM,IAAI,MAAM,EACh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AAgC;QAEzC,CAAA,GAEJ,kBAAC,OAAD;QAAK,WAAU;kBACZ,EAAa,KAAK,MACjB,kBAAC,OAAD;SAEE,WAAU;mBAFZ,CAIE,kBAAC,OAAD;UAAK,WAAU;oBAAf,CACE,kBAAC,KAAD;WAAG,WAAU;qBAAwC,EAAS;WAAS,CAAA,EACvE,kBAAC,KAAD;WAAG,WAAU;qBAA0C,EAAS;WAAU,CAAA,CACtE;aACN,kBAAC,OAAD;UAAK,WAAU;oBAAf,CACE,kBAAC,KAAD;WAAG,WAAU;qBAAb,CACG,EAAqB,EAAS,cAAc,EAAgB,EAAC,WAC5D;cACJ,kBAAC,KAAD;WAAG,WAAU;qBAAb;YACG,EAAS;YAAoB;YAC7B,EAAS,wBAAwB,IAAI,KAAK;YACzC;aACA;YACF;WAhBC,EAAS,GAgBV,CACN;QACE,CAAA;OAEJ,CAAA,CACE;QACN;;IACL,EAAA,CAAA;GAED;MAjQC,kBAAC,GAAD,EAAc,SAAQ,gDAAiD,CAAA"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Analytics Module - Pages
3
+ */
4
+ export { AnalyticsPage } from './AnalyticsPage';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/billing/modules/analytics/pages/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1 @@
1
+ import "./AnalyticsPage.js";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Billing Module - Hooks
3
+ * Re-exports all hooks for the Billing module
4
+ */
5
+ export { useInvoices, useInvoice, useInvoiceByNumber, useInvoiceMutations } from './useInvoices';
6
+ export { usePayments, usePayment, usePaymentMethods, useDefaultPaymentMethod, usePaymentMethodMutations, } from './usePayments';
7
+ export { useTransactions } from './useTransactions';
8
+ export { useRefunds, useRefundRecords, usePendingRefunds, useRefundStats, useRefundRecord, useUnprocessedFailedWebhooks, useRefundMutations, } from './useRefunds';
9
+ export type { RefundRecord, RefundStats, RefundRecordStatus, RefundSource, RefundRecordFilters, CreateRefundRecordInput, ProcessRefundResult, WebhookLog, } from './useRefunds';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/billing/modules/billing/hooks/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEjG,OAAO,EACL,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,4BAA4B,EAC5B,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,UAAU,GACX,MAAM,cAAc,CAAC"}
@@ -0,0 +1,4 @@
1
+ import "./useInvoices.js";
2
+ import "./usePayments.js";
3
+ import "./useTransactions.js";
4
+ import "./useRefunds.js";
@@ -0,0 +1,67 @@
1
+ import { Invoice, InvoiceStatus } from '../../../shared/types';
2
+
3
+ interface UseInvoicesOptions {
4
+ status?: InvoiceStatus;
5
+ billingAccountId?: string;
6
+ }
7
+ interface UseInvoicesResult {
8
+ invoices: Invoice[];
9
+ openInvoices: Invoice[];
10
+ paidInvoices: Invoice[];
11
+ isLoading: boolean;
12
+ error: Error | undefined;
13
+ refetch: () => Promise<void>;
14
+ }
15
+ interface UsePaginatedInvoicesOptions {
16
+ status?: InvoiceStatus;
17
+ billingAccountId?: string;
18
+ page?: number;
19
+ pageSize?: number;
20
+ }
21
+ interface UsePaginatedInvoicesResult {
22
+ invoices: Invoice[];
23
+ totalCount: number;
24
+ hasMore: boolean;
25
+ page: number;
26
+ pageSize: number;
27
+ totalPages: number;
28
+ isLoading: boolean;
29
+ error: Error | undefined;
30
+ refetch: () => Promise<void>;
31
+ }
32
+ interface UseInvoiceResult {
33
+ invoice: Invoice | null;
34
+ isLoading: boolean;
35
+ error: Error | undefined;
36
+ refetch: () => Promise<void>;
37
+ }
38
+ interface UseInvoiceMutationsResult {
39
+ generateInvoice: (subscriptionId: string, billingAccountId: string) => Promise<Invoice>;
40
+ payInvoice: (invoiceId: string, paymentMethodId: string, billingAccountId: string) => Promise<Invoice>;
41
+ voidInvoice: (invoiceId: string, billingAccountId: string) => Promise<Invoice>;
42
+ isGenerating: boolean;
43
+ isPaying: boolean;
44
+ isVoiding: boolean;
45
+ }
46
+ /**
47
+ * Hook for fetching invoices
48
+ */
49
+ export declare function useInvoices(options?: UseInvoicesOptions): UseInvoicesResult;
50
+ /**
51
+ * Hook for fetching paginated invoices
52
+ */
53
+ export declare function usePaginatedInvoices(options?: UsePaginatedInvoicesOptions): UsePaginatedInvoicesResult;
54
+ /**
55
+ * Hook for fetching a single invoice by ID
56
+ */
57
+ export declare function useInvoice(id: string | undefined, billingAccountId: string | undefined): UseInvoiceResult;
58
+ /**
59
+ * Hook for fetching an invoice by number
60
+ */
61
+ export declare function useInvoiceByNumber(invoiceNumber: string | undefined, billingAccountId: string | undefined): UseInvoiceResult;
62
+ /**
63
+ * Hook for invoice mutations
64
+ */
65
+ export declare function useInvoiceMutations(): UseInvoiceMutationsResult;
66
+ export {};
67
+ //# sourceMappingURL=useInvoices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInvoices.d.ts","sourceRoot":"","sources":["../../../../../src/billing/modules/billing/hooks/useInvoices.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,OAAO,KAAK,EAAE,OAAO,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