@burdenoff/microfe-billing 2026.1113.3 → 2026.1114.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +293 -291
  2. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
  3. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +25 -24
  4. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
  5. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +25 -24
  6. package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
  7. package/dist/billing/modules/billing/hooks/index.js +5 -5
  8. package/dist/billing/modules/billing/hooks/useInvoices.js +20 -39
  9. package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
  10. package/dist/billing/modules/billing/index.js +14 -14
  11. package/dist/billing/modules/billing/pages/InvoicesListPage.js +92 -89
  12. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
  13. package/dist/billing/modules/billing/pages/TransactionsPage.js +2 -2
  14. package/dist/billing/modules/billing/pages/UserRefundsPage.js +140 -140
  15. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  16. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +16 -15
  17. package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
  18. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +305 -282
  19. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
  20. package/dist/billing/modules/credits/pages/CreditsPage.js +164 -137
  21. package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
  22. package/dist/billing/modules/dashboard/pages/OverviewPage.js +444 -594
  23. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
  24. package/dist/billing/modules/earnings/components/PayoutDestinationList.d.ts +15 -0
  25. package/dist/billing/modules/earnings/components/PayoutDestinationList.js +66 -0
  26. package/dist/billing/modules/earnings/components/PayoutDestinationList.js.map +1 -0
  27. package/dist/billing/modules/earnings/components/PayoutErrorNotice.d.ts +7 -0
  28. package/dist/billing/modules/earnings/components/PayoutErrorNotice.js +19 -0
  29. package/dist/billing/modules/earnings/components/PayoutErrorNotice.js.map +1 -0
  30. package/dist/billing/modules/earnings/pages/EarningsPage.js +138 -125
  31. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  32. package/dist/billing/modules/earnings/pages/PayoutsPage.js +260 -202
  33. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  34. package/dist/billing/modules/earnings/utils/payoutDestination.d.ts +20 -0
  35. package/dist/billing/modules/earnings/utils/payoutDestination.js +27 -0
  36. package/dist/billing/modules/earnings/utils/payoutDestination.js.map +1 -0
  37. package/dist/billing/modules/earnings/utils/plainPayoutError.d.ts +10 -0
  38. package/dist/billing/modules/earnings/utils/plainPayoutError.js +50 -0
  39. package/dist/billing/modules/earnings/utils/plainPayoutError.js.map +1 -0
  40. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +32 -32
  41. package/dist/billing/modules/settings/pages/SettingsPage.js +4 -4
  42. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +577 -640
  43. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
  44. package/dist/billing/shared/components/HeaderActions.d.ts +10 -0
  45. package/dist/billing/shared/components/HeaderActions.js +33 -0
  46. package/dist/billing/shared/components/HeaderActions.js.map +1 -0
  47. package/dist/billing/shared/components/index.d.ts +1 -0
  48. package/dist/billing/shared/components/index.js +2 -1
  49. package/dist/billing/shared/utils/format.js +4 -16
  50. package/dist/billing/shared/utils/format.js.map +1 -1
  51. package/dist/billing/shared/utils/index.js +8 -8
  52. package/dist/generated/global-operations.js +286 -294
  53. package/dist/generated/global-operations.js.map +1 -1
  54. package/package.json +1 -1
  55. package/dist/billing/modules/dashboard/utils/overviewSummary.d.ts +0 -46
  56. package/dist/billing/modules/dashboard/utils/overviewSummary.js +0 -37
  57. package/dist/billing/modules/dashboard/utils/overviewSummary.js.map +0 -1
  58. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.d.ts +0 -30
  59. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js +0 -20
  60. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"PayoutsPage.js","names":["_Fragment","Fragment$1","payoutRequestColumns","formatCurrency","request","formatDateTime","PayoutsPage","permissions","useBillingPermissions","isFluidgrids","useIsFluidgridsVariant","isReviewingPayout","setIsReviewingPayout","useState","isSubmittingPayout","setIsSubmittingPayout","payoutError","setPayoutError","payoutResult","setPayoutResult","useBillingEventEmitter","useBilling","billingAccountData","useGetDefaultBillingAccountSettingsQuery","billingAccountId","accounts","setAccounts","requests","setRequests","loading","setLoading","error","setError","accountForm","setAccountForm","requestAmount","setRequestAmount","selectedAccountId","setSelectedAccountId","editingAccountId","setEditingAccountId","archiveAccountId","setArchiveAccountId","notice","setNotice","requestContext","useMemo","apiGatewayUrl","authToken","orgId","loadData","useCallback","loadedAccounts","loadedRequests","fetchPayoutAccounts","fetchPayoutRequests","pickPayableAccountId","current","loadError","useEffect","AccessDenied","isServerError","ServerError","handleAddAccount","payload","updatePayoutAccount","emit","created","addPayoutAccount","handleSetDefault","setDefaultPayoutAccount","accountId","handleArchive","archivePayoutAccount","handleEditAccount","account","selectedAccount","hasPayableAccount","isPayoutAccountPayable","handleRequestPayout","requestPayout","confirmPayout","err","MoneyActionDialog","PageHeader","PagePurpose","event","Landmark","RefreshCw","IllustratedEmptyState","payoutAccountStatusView","Send","statusView","PAYOUT_ACCOUNT_TONE_CLASSES","ResponsiveTable","AlertDialog","open","AlertDialogContent","AlertDialogHeader","AlertDialogTitle","AlertDialogDescription","AlertDialogFooter","AlertDialogCancel","AlertDialogAction","id"],"sources":["../../../../../src/billing/modules/earnings/pages/PayoutsPage.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useState, type FC } from 'react';\nimport { Landmark, RefreshCw, Send } from 'lucide-react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n ResponsiveTable,\n type ResponsiveTableColumn,\n} from '@burdenoff/fe-libs/ui';\n\nimport { useBillingPermissions } from '../../../hooks/useBillingPermissions';\nimport { useIsFluidgridsVariant } from '../../../hooks/useBillingVariant';\nimport { MoneyActionDialog } from '../../../shared/components';\nimport { useBillingEventEmitter } from '../../../hooks/useBillingEventEmitter';\nimport { useBilling } from '../../../providers/BillingProvider';\nimport { AccessDenied, PageHeader, ServerError } from '../../../shared/components';\nimport { PagePurpose, IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport { formatCurrency, formatDateTime, isServerError } from '../../../shared/utils';\nimport { useGetDefaultBillingAccountSettingsQuery } from '../../../../generated/global-operations';\nimport {\n addPayoutAccount,\n archivePayoutAccount,\n fetchPayoutAccounts,\n fetchPayoutRequests,\n requestPayout,\n setDefaultPayoutAccount,\n updatePayoutAccount,\n type PayoutAccount,\n type PayoutRequest,\n} from '../api';\nimport {\n PAYOUT_ACCOUNT_TONE_CLASSES,\n isPayoutAccountPayable,\n payoutAccountStatusView,\n pickPayableAccountId,\n} from '../payoutAccountStatus';\n\nconst payoutRequestColumns: ResponsiveTableColumn<PayoutRequest>[] = [\n {\n key: 'amount',\n header: 'Amount',\n priority: 'primary',\n cell: (request) => (\n <span className=\"tabular-nums\">\n {formatCurrency(request.requestedAmount, request.currency)}\n </span>\n ),\n },\n { key: 'provider', header: 'Provider', cell: (request) => request.provider },\n { key: 'status', header: 'Status', cell: (request) => request.status },\n {\n key: 'account',\n header: 'Account',\n cell: (request) => request.payoutAccount?.label || '-',\n },\n {\n key: 'created',\n header: 'Created',\n cell: (request) => formatDateTime(request.createdAt),\n },\n];\n\nexport const PayoutsPage: FC = () => {\n const permissions = useBillingPermissions();\n const isFluidgrids = useIsFluidgridsVariant();\n // FluidGrids: a review step precedes the request, and the outcome is always shown.\n const [isReviewingPayout, setIsReviewingPayout] = useState(false);\n const [isSubmittingPayout, setIsSubmittingPayout] = useState(false);\n const [payoutError, setPayoutError] = useState<string | null>(null);\n const [payoutResult, setPayoutResult] = useState<{ ok: boolean; message: string } | null>(null);\n const { emit } = useBillingEventEmitter();\n const { apiGatewayUrl, authToken, orgId } = useBilling();\n const { data: billingAccountData } = useGetDefaultBillingAccountSettingsQuery({});\n const billingAccountId = billingAccountData?.getDefaultBillingAccount?.id;\n\n const [accounts, setAccounts] = useState<PayoutAccount[]>([]);\n const [requests, setRequests] = useState<PayoutRequest[]>([]);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n const [accountForm, setAccountForm] = useState({\n label: '',\n type: 'BANK_ACCOUNT',\n providerPreference: 'AUTO',\n country: 'US',\n currency: 'USD',\n accountHolderName: '',\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n });\n const [requestAmount, setRequestAmount] = useState('');\n const [selectedAccountId, setSelectedAccountId] = useState<string>('');\n const [editingAccountId, setEditingAccountId] = useState<string | null>(null);\n const [archiveAccountId, setArchiveAccountId] = useState<string | null>(null);\n const [notice, setNotice] = useState<string | null>(null);\n\n const requestContext = useMemo(\n () => ({\n apiGatewayUrl,\n authToken,\n orgId,\n }),\n [apiGatewayUrl, authToken, orgId]\n );\n\n const loadData = useCallback(async () => {\n if (!billingAccountId) return;\n setLoading(true);\n setError(null);\n try {\n const [loadedAccounts, loadedRequests] = await Promise.all([\n fetchPayoutAccounts(billingAccountId, requestContext),\n fetchPayoutRequests(billingAccountId, requestContext),\n ]);\n setAccounts(loadedAccounts);\n setRequests(loadedRequests);\n // Only verified accounts can be paid out to (BOFF-10953).\n setSelectedAccountId((current) => pickPayableAccountId(loadedAccounts, current));\n } catch (loadError) {\n setError(loadError instanceof Error ? loadError : new Error('Failed to load payout data'));\n } finally {\n setLoading(false);\n }\n }, [billingAccountId, requestContext]);\n\n useEffect(() => {\n void loadData();\n }, [loadData]);\n\n if (!permissions.canManagePaymentMethods) {\n return <AccessDenied message=\"You don't have permission to manage payout accounts.\" />;\n }\n\n if (error && isServerError(error)) {\n return (\n <ServerError\n title=\"Payout data unavailable\"\n message={error.message}\n onRetry={() => void loadData()}\n showRetry\n />\n );\n }\n\n const handleAddAccount = async () => {\n if (!billingAccountId) return;\n setNotice(null);\n const payload = {\n billingAccountId,\n ...accountForm,\n };\n\n if (editingAccountId) {\n await updatePayoutAccount(editingAccountId, payload, requestContext);\n emit('billing.payout_account.updated', {\n route: '/billing/payouts',\n entityId: editingAccountId,\n source: 'payouts',\n });\n } else {\n const created = await addPayoutAccount(payload, requestContext);\n emit('billing.payout_account.added', {\n route: '/billing/payouts',\n entityId: billingAccountId,\n source: 'payouts',\n });\n // RazorpayX and Stripe Connect accounts stay pending until processor\n // onboarding verifies them (BOFF-10895); say so instead of implying the\n // account is ready to receive payouts.\n setNotice(\n created.status === 'ACTIVE'\n ? 'Payout account saved and ready to receive payouts.'\n : 'Payout account saved. It stays pending until the payout processor verifies it; you can request payouts to it once it is verified.'\n );\n }\n\n setAccountForm({\n label: '',\n type: 'BANK_ACCOUNT',\n providerPreference: 'AUTO',\n country: 'US',\n currency: 'USD',\n accountHolderName: '',\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n });\n setEditingAccountId(null);\n await loadData();\n };\n\n const handleSetDefault = async (accountId: string) => {\n setNotice(null);\n await setDefaultPayoutAccount(accountId, requestContext);\n await loadData();\n };\n\n const handleArchive = async (accountId: string) => {\n setNotice(null);\n await archivePayoutAccount(accountId, requestContext);\n emit('billing.payout_account.archived', {\n route: '/billing/payouts',\n entityId: accountId,\n source: 'payouts',\n });\n await loadData();\n };\n\n const handleEditAccount = (account: PayoutAccount) => {\n setNotice(null);\n setEditingAccountId(account.id);\n setAccountForm((current) => ({\n ...current,\n label: account.label,\n type: account.type,\n providerPreference: account.providerPreference,\n country: account.country || current.country,\n currency: account.currency,\n accountHolderName: account.displayName || current.accountHolderName,\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n }));\n };\n\n const selectedAccount = accounts.find((account) => account.id === selectedAccountId);\n const hasPayableAccount = accounts.some(isPayoutAccountPayable);\n\n const handleRequestPayout = async () => {\n if (!billingAccountId || !selectedAccountId || !requestAmount) return;\n if (!selectedAccount || !isPayoutAccountPayable(selectedAccount)) return;\n await requestPayout(\n {\n billingAccountId,\n payoutAccountId: selectedAccountId,\n amount: Number(requestAmount),\n currency: selectedAccount.currency,\n },\n requestContext\n );\n emit('billing.payout.requested', {\n route: '/billing/payouts',\n entityId: selectedAccountId,\n source: 'payouts',\n amount: Number(requestAmount),\n currency: selectedAccount.currency,\n });\n setRequestAmount('');\n await loadData();\n };\n\n const confirmPayout = async () => {\n setIsSubmittingPayout(true);\n setPayoutError(null);\n try {\n await handleRequestPayout();\n setIsReviewingPayout(false);\n setPayoutResult({\n ok: true,\n message: `Payout of ${formatCurrency(Number(requestAmount), selectedAccount?.currency ?? '')} requested. We'll show its status below.`,\n });\n } catch (err) {\n setPayoutError(err instanceof Error ? err.message : 'The payout request failed.');\n } finally {\n setIsSubmittingPayout(false);\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n {isFluidgrids && (\n <MoneyActionDialog\n open={isReviewingPayout}\n title=\"Review your payout\"\n description=\"The amount is moved out of your available balance when you confirm.\"\n details={[\n {\n label: 'Amount',\n value: formatCurrency(Number(requestAmount), selectedAccount?.currency ?? ''),\n },\n {\n label: 'Paid to',\n value: selectedAccount\n ? `${selectedAccount.label} · ${selectedAccount.currency}`\n : '',\n },\n ]}\n confirmLabel=\"Request payout\"\n busyLabel=\"Requesting…\"\n isBusy={isSubmittingPayout}\n error={payoutError}\n onConfirm={() => void confirmPayout()}\n onCancel={() => setIsReviewingPayout(false)}\n />\n )}\n {isFluidgrids && payoutResult && (\n <div\n role={payoutResult.ok ? 'status' : 'alert'}\n className={`rounded-md border p-3 text-sm ${payoutResult.ok ? 'border-status-success-border text-status-success-text' : 'border-status-error-border text-status-error-text'}`}\n >\n {payoutResult.message}\n </div>\n )}\n <PageHeader\n title=\"Payouts\"\n description=\"Register payout accounts, request withdrawals, and track disbursement status.\"\n />\n\n <PagePurpose>\n Get your earnings paid out to a real bank account or UPI. Register where you want to be\n paid, request a withdrawal of your available balance, and track each request from submission\n through to disbursement here.\n </PagePurpose>\n\n {notice ? (\n <div\n role=\"status\"\n className=\"rounded-lg border border-border-subtle bg-status-info-bg-subtle p-4 text-sm text-status-info-text\"\n >\n {notice}\n </div>\n ) : null}\n\n {error && !isServerError(error) ? (\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4 text-sm text-status-error-text\">\n {error.message}\n </div>\n ) : null}\n\n <div className=\"grid gap-6 xl:grid-cols-[1.05fr,1.95fr]\">\n <section className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <h2 className=\"mb-4 text-lg font-semibold text-text-primary\">\n {editingAccountId ? 'Edit payout account' : 'Add payout account'}\n </h2>\n <div className=\"space-y-3\">\n <input\n value={accountForm.label}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, label: event.target.value }))\n }\n placeholder=\"Label\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <div className=\"grid gap-3 md:grid-cols-2\">\n <select\n value={accountForm.type}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, type: event.target.value }))\n }\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"BANK_ACCOUNT\">Bank account</option>\n <option value=\"UPI\">UPI</option>\n <option value=\"WALLET\">Wallet</option>\n </select>\n <select\n value={accountForm.providerPreference}\n onChange={(event) =>\n setAccountForm((current) => ({\n ...current,\n providerPreference: event.target.value,\n }))\n }\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"AUTO\">Auto</option>\n <option value=\"STRIPE\">Stripe</option>\n <option value=\"RAZORPAY\">Razorpay</option>\n <option value=\"MANUAL\">Manual</option>\n </select>\n </div>\n <div className=\"grid gap-3 md:grid-cols-2\">\n <input\n value={accountForm.country}\n onChange={(event) =>\n setAccountForm((current) => ({\n ...current,\n country: event.target.value.toUpperCase(),\n }))\n }\n placeholder=\"Country\"\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <input\n value={accountForm.currency}\n onChange={(event) =>\n setAccountForm((current) => ({\n ...current,\n currency: event.target.value.toUpperCase(),\n }))\n }\n placeholder=\"Currency\"\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n </div>\n <input\n value={accountForm.accountHolderName}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, accountHolderName: event.target.value }))\n }\n placeholder=\"Account holder name\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n {accountForm.type === 'BANK_ACCOUNT' ? (\n <>\n <input\n value={accountForm.bankName}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, bankName: event.target.value }))\n }\n placeholder=\"Bank name\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <input\n value={accountForm.accountNumber}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, accountNumber: event.target.value }))\n }\n placeholder=\"Account number\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <input\n value={\n accountForm.country === 'IN' ? accountForm.ifsc : accountForm.routingNumber\n }\n onChange={(event) =>\n setAccountForm((current) =>\n current.country === 'IN'\n ? { ...current, ifsc: event.target.value }\n : { ...current, routingNumber: event.target.value }\n )\n }\n placeholder={accountForm.country === 'IN' ? 'IFSC' : 'Routing number'}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n </>\n ) : accountForm.type === 'UPI' ? (\n <input\n value={accountForm.upiId}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, upiId: event.target.value }))\n }\n placeholder=\"UPI ID\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n ) : null}\n </div>\n <button\n type=\"button\"\n onClick={() => void handleAddAccount()}\n className=\"mt-4 inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text\"\n >\n <Landmark className=\"size-4\" />\n {editingAccountId ? 'Update payout account' : 'Save payout account'}\n </button>\n {editingAccountId ? (\n <button\n type=\"button\"\n onClick={() => {\n setEditingAccountId(null);\n setAccountForm({\n label: '',\n type: 'BANK_ACCOUNT',\n providerPreference: 'AUTO',\n country: 'US',\n currency: 'USD',\n accountHolderName: '',\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n });\n }}\n className=\"mt-4 ml-3 inline-flex items-center gap-2 rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary\"\n >\n Cancel edit\n </button>\n ) : null}\n </section>\n\n <section className=\"space-y-4\">\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <div className=\"mb-4 flex items-center justify-between\">\n <h2 className=\"text-lg font-semibold text-text-primary\">Request payout</h2>\n <button\n type=\"button\"\n onClick={() => void loadData()}\n className=\"inline-flex items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary\"\n >\n <RefreshCw className=\"size-4\" />\n Refresh\n </button>\n </div>\n {accounts.length === 0 && !loading ? (\n <IllustratedEmptyState\n illustration=\"empty-generic\"\n title=\"No payout accounts yet\"\n description=\"Add a payout account before requesting a withdrawal.\"\n />\n ) : (\n <div className=\"space-y-3\">\n <select\n value={selectedAccountId}\n onChange={(event) => setSelectedAccountId(event.target.value)}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n {!hasPayableAccount ? (\n <option value=\"\">No verified payout account yet</option>\n ) : null}\n {accounts.map((account) => (\n <option\n key={account.id}\n value={account.id}\n disabled={!isPayoutAccountPayable(account)}\n >\n {account.label} · {account.currency} ·{' '}\n {payoutAccountStatusView(account.status).label}\n </option>\n ))}\n </select>\n {!hasPayableAccount ? (\n <p className=\"text-sm text-text-secondary\">\n Payouts can be requested once one of your payout accounts is verified.\n </p>\n ) : null}\n <label className=\"block space-y-1 text-sm font-medium text-text-primary\">\n <span>Amount</span>\n <input\n value={requestAmount}\n onChange={(event) => setRequestAmount(event.target.value)}\n inputMode=\"decimal\"\n placeholder=\"0.00\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-normal text-text-primary\"\n />\n </label>\n <button\n type=\"button\"\n onClick={() => {\n if (!isFluidgrids) {\n void handleRequestPayout();\n return;\n }\n setPayoutError(null);\n setPayoutResult(null);\n setIsReviewingPayout(true);\n }}\n disabled={!selectedAccount || !isPayoutAccountPayable(selectedAccount)}\n className=\"inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <Send className=\"size-4\" />\n Request payout\n </button>\n </div>\n )}\n\n {accounts.length > 0 ? (\n <div className=\"mt-4 space-y-3 rounded-md border border-border-subtle bg-bg-surface/60 p-3\">\n <h3 className=\"text-sm font-semibold text-text-primary\">Saved payout accounts</h3>\n {accounts.map((account) => {\n const statusView = payoutAccountStatusView(account.status);\n return (\n <div\n key={account.id}\n className=\"flex flex-wrap items-center justify-between gap-3 rounded-md border border-border-subtle/70 bg-bg-surface px-3 py-2 text-sm\"\n >\n <div>\n <p className=\"flex flex-wrap items-center gap-2 font-medium text-text-primary\">\n {account.label} {account.isDefault ? '• Default' : ''}\n <span\n className={`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${PAYOUT_ACCOUNT_TONE_CLASSES[statusView.tone]}`}\n >\n {statusView.label}\n </span>\n </p>\n <p className=\"text-text-secondary\">\n {account.providerPreference} · {account.currency}\n </p>\n {statusView.hint ? (\n <p className=\"mt-1 text-xs text-text-secondary\">{statusView.hint}</p>\n ) : null}\n </div>\n <div className=\"flex flex-wrap gap-2\">\n <button\n type=\"button\"\n onClick={() => handleEditAccount(account)}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary\"\n >\n Edit\n </button>\n {!account.isDefault ? (\n <button\n type=\"button\"\n onClick={() => void handleSetDefault(account.id)}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary\"\n >\n Make default\n </button>\n ) : null}\n <button\n type=\"button\"\n onClick={() => setArchiveAccountId(account.id)}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text\"\n >\n Archive\n </button>\n </div>\n </div>\n );\n })}\n </div>\n ) : null}\n </div>\n\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <h2 className=\"mb-4 text-lg font-semibold text-text-primary\">Payout requests</h2>\n {requests.length === 0 && !loading ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title=\"No payout requests yet\"\n description=\"Your payout requests and processing updates will appear here.\"\n />\n ) : (\n <ResponsiveTable\n data={requests}\n rowKey={(request) => request.id}\n columns={payoutRequestColumns}\n />\n )}\n </div>\n </section>\n </div>\n\n <AlertDialog\n open={archiveAccountId !== null}\n onOpenChange={(open) => {\n if (!open) setArchiveAccountId(null);\n }}\n >\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Archive payout account?</AlertDialogTitle>\n <AlertDialogDescription>\n Archive this payout account? You can add a new one at any time.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction\n onClick={() => {\n const id = archiveAccountId;\n setArchiveAccountId(null);\n if (id) void handleArchive(id);\n }}\n >\n Archive\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0CA,IAAME,KAA+D;CACnE;EACE,KAAK;EACL,QAAQ;EACR,UAAU;EACV,OAAO,MACL,kBAAC,QAAD;GAAM,WAAU;GACb,UAAAC,EAAeC,EAAQ,iBAAiBA,EAAQ,QAAQ;EACrD,CAAA;CAEV;CACA;EAAE,KAAK;EAAY,QAAQ;EAAY,OAAO,MAAYA,EAAQ;CAAS;CAC3E;EAAE,KAAK;EAAU,QAAQ;EAAU,OAAO,MAAYA,EAAQ;CAAO;CACrE;EACE,KAAK;EACL,QAAQ;EACR,OAAO,MAAYA,EAAQ,eAAe,SAAS;CACrD;CACA;EACE,KAAK;EACL,QAAQ;EACR,OAAO,MAAYC,EAAeD,EAAQ,SAAS;CACrD;AACF,GAEaE,UAAwB;CACnC,IAAMC,IAAcC,EAAsB,GACpCC,IAAeC,GAAuB,GAEtC,CAACC,IAAmBC,KAAwBC,EAAS,EAAK,GAC1D,CAACC,GAAoBC,KAAyBF,EAAS,EAAK,GAC5D,CAACG,GAAaC,KAAkBJ,EAAwB,IAAI,GAC5D,CAACK,GAAcC,KAAmBN,EAAkD,IAAI,GACxF,EAAE,YAASO,EAAuB,GAClC,EAAE,kBAAe,cAAW,aAAUC,EAAW,GACjD,EAAE,MAAMC,OAAuBC,EAAyC,CAAC,CAAC,GAC1EC,IAAmBF,IAAoB,0BAA0B,IAEjE,CAACG,GAAUC,MAAeb,EAA0B,CAAC,CAAC,GACtD,CAACc,GAAUC,MAAef,EAA0B,CAAC,CAAC,G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AAU;OAA+C,UAAA;MAAmB,CAAA,GAC/EhD,EAAS,WAAW,KAAK,CAACE,IACzB,kBAAC4D,GAAD;OACE,cAAa;OACb,OAAM;OACN,aAAY;MACb,CAAA,IAED,kBAACK,GAAD;OACE,MAAMnE;OACN,SAAS,MAAYvB,EAAQ;OAC7B,SAASF;MACV,CAAA,CAEA;KACE,CAAA,CAAA;IACN,CAAA,CAAA;;GAEL,kBAAC6F,IAAD;IACE,MAAMtD,MAAqB;IAC3B,eAAe,MAAS;KACtB,AAAKuD,KAAMtD,EAAoB,IAAI;IACrC;IAEA,UAAA,kBAACuD,IAAD,EAAA,UAAA,CACE,kBAACC,IAAD,EAAA,UAAA,CACE,kBAACC,IAAD,EAAA,UAAkB,0BAAyC,CAAA,GAC3D,kBAACC,GAAD,EAAA,UAAwB,kEAEA,CAAA,CACP,EAAA,CAAA,GACnB,kBAACC,GAAD,EAAA,UAAA,CACE,kBAACC,IAAD,EAAA,UAAmB,SAAyB,CAAA,GAC5C,kBAACC,IAAD;KACE,eAAe;MACb,IAAMC,IAAK/D;MAEX,AADAC,EAAoB,IAAI,GACpB8D,KAAIhC,GAAmBgC,CAAE;KAC/B;KACD,UAAA;IAEkB,CAAA,CACF,EAAA,CAAA,CACD,EAAA,CAAA;GACT,CAAA;EACV;;AAET"}
1
+ {"version":3,"file":"PayoutsPage.js","names":["_Fragment","Fragment$1","payoutRequestColumns","formatCurrency","request","formatDateTime","PayoutsPage","permissions","useBillingPermissions","isFluidgrids","useIsFluidgridsVariant","tr","useTr","isReviewingPayout","setIsReviewingPayout","useState","isSubmittingPayout","setIsSubmittingPayout","payoutError","setPayoutError","payoutFailure","setPayoutFailure","actionFailure","setActionFailure","payoutResult","setPayoutResult","useBillingEventEmitter","useBilling","billingAccountData","useGetDefaultBillingAccountSettingsQuery","billingAccountId","accounts","setAccounts","requests","setRequests","loading","setLoading","error","setError","accountForm","setAccountForm","requestAmount","setRequestAmount","selectedAccountId","setSelectedAccountId","editingAccountId","setEditingAccountId","archiveAccountId","setArchiveAccountId","notice","setNotice","requestContext","useMemo","apiGatewayUrl","authToken","orgId","loadData","useCallback","loadedAccounts","loadedRequests","fetchPayoutAccounts","fetchPayoutRequests","pickPayableAccountId","current","loadError","useEffect","AccessDenied","isServerError","serverError","ServerError","plainPayoutError","ShowTechnicalDetails","rawErrorText","guarded","action","failure","handleAddAccount","payload","updatePayoutAccount","emit","created","addPayoutAccount","handleSetDefault","setDefaultPayoutAccount","accountId","handleArchive","archivePayoutAccount","handleEditAccount","account","selectedAccount","hasPayableAccount","isPayoutAccountPayable","handleRequestPayout","requestPayout","confirmPayout","err","MoneyActionDialog","PageHeader","PagePurpose","PayoutErrorNotice","event","Landmark","RefreshCw","IllustratedEmptyState","payoutAccountStatusView","Send","PayoutDestinationList","toPayoutDestinations","item","destination","statusView","PAYOUT_ACCOUNT_TONE_CLASSES","ResponsiveTable","AlertDialog","open","AlertDialogContent","AlertDialogHeader","AlertDialogTitle","AlertDialogDescription","AlertDialogFooter","AlertDialogCancel","AlertDialogAction","id"],"sources":["../../../../../src/billing/modules/earnings/pages/PayoutsPage.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useState, type FC } from 'react';\nimport { Landmark, RefreshCw, Send } from 'lucide-react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n ResponsiveTable,\n ShowTechnicalDetails,\n type ResponsiveTableColumn,\n} from '@burdenoff/fe-libs/ui';\n\nimport { useBillingPermissions } from '../../../hooks/useBillingPermissions';\nimport { useIsFluidgridsVariant } from '../../../hooks/useBillingVariant';\nimport { MoneyActionDialog } from '../../../shared/components';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useBillingEventEmitter } from '../../../hooks/useBillingEventEmitter';\nimport { useBilling } from '../../../providers/BillingProvider';\nimport { AccessDenied, PageHeader, ServerError } from '../../../shared/components';\nimport { PagePurpose, IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport { formatCurrency, formatDateTime, isServerError } from '../../../shared/utils';\nimport { useGetDefaultBillingAccountSettingsQuery } from '../../../../generated/global-operations';\nimport {\n addPayoutAccount,\n archivePayoutAccount,\n fetchPayoutAccounts,\n fetchPayoutRequests,\n requestPayout,\n setDefaultPayoutAccount,\n updatePayoutAccount,\n type PayoutAccount,\n type PayoutRequest,\n} from '../api';\nimport {\n PAYOUT_ACCOUNT_TONE_CLASSES,\n isPayoutAccountPayable,\n payoutAccountStatusView,\n pickPayableAccountId,\n} from '../payoutAccountStatus';\nimport { PayoutDestinationList } from '../components/PayoutDestinationList';\nimport { PayoutErrorNotice } from '../components/PayoutErrorNotice';\nimport { toPayoutDestinations } from '../utils/payoutDestination';\nimport { plainPayoutError, rawErrorText } from '../utils/plainPayoutError';\n\nconst payoutRequestColumns: ResponsiveTableColumn<PayoutRequest>[] = [\n {\n key: 'amount',\n header: 'Amount',\n priority: 'primary',\n cell: (request) => (\n <span className=\"tabular-nums\">\n {formatCurrency(request.requestedAmount, request.currency)}\n </span>\n ),\n },\n { key: 'provider', header: 'Provider', cell: (request) => request.provider },\n { key: 'status', header: 'Status', cell: (request) => request.status },\n {\n key: 'account',\n header: 'Account',\n cell: (request) => request.payoutAccount?.label || '-',\n },\n {\n key: 'created',\n header: 'Created',\n cell: (request) => formatDateTime(request.createdAt),\n },\n];\n\nexport const PayoutsPage: FC = () => {\n const permissions = useBillingPermissions();\n const isFluidgrids = useIsFluidgridsVariant();\n const tr = useTr();\n // FluidGrids: a review step precedes the request, and the outcome is always shown.\n const [isReviewingPayout, setIsReviewingPayout] = useState(false);\n const [isSubmittingPayout, setIsSubmittingPayout] = useState(false);\n const [payoutError, setPayoutError] = useState<string | null>(null);\n // Raw failure kept so its text can sit under \"Show technical details\".\n const [payoutFailure, setPayoutFailure] = useState<unknown>(null);\n // FluidGrids: failures of account actions (save, default, archive) shown in plain words.\n const [actionFailure, setActionFailure] = useState<unknown>(null);\n const [payoutResult, setPayoutResult] = useState<{ ok: boolean; message: string } | null>(null);\n const { emit } = useBillingEventEmitter();\n const { apiGatewayUrl, authToken, orgId } = useBilling();\n const { data: billingAccountData } = useGetDefaultBillingAccountSettingsQuery({});\n const billingAccountId = billingAccountData?.getDefaultBillingAccount?.id;\n\n const [accounts, setAccounts] = useState<PayoutAccount[]>([]);\n const [requests, setRequests] = useState<PayoutRequest[]>([]);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n const [accountForm, setAccountForm] = useState({\n label: '',\n type: 'BANK_ACCOUNT',\n providerPreference: 'AUTO',\n country: 'US',\n currency: 'USD',\n accountHolderName: '',\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n });\n const [requestAmount, setRequestAmount] = useState('');\n const [selectedAccountId, setSelectedAccountId] = useState<string>('');\n const [editingAccountId, setEditingAccountId] = useState<string | null>(null);\n const [archiveAccountId, setArchiveAccountId] = useState<string | null>(null);\n const [notice, setNotice] = useState<string | null>(null);\n\n const requestContext = useMemo(\n () => ({\n apiGatewayUrl,\n authToken,\n orgId,\n }),\n [apiGatewayUrl, authToken, orgId]\n );\n\n const loadData = useCallback(async () => {\n if (!billingAccountId) return;\n setLoading(true);\n setError(null);\n try {\n const [loadedAccounts, loadedRequests] = await Promise.all([\n fetchPayoutAccounts(billingAccountId, requestContext),\n fetchPayoutRequests(billingAccountId, requestContext),\n ]);\n setAccounts(loadedAccounts);\n setRequests(loadedRequests);\n // Only verified accounts can be paid out to (BOFF-10953).\n setSelectedAccountId((current) => pickPayableAccountId(loadedAccounts, current));\n } catch (loadError) {\n setError(loadError instanceof Error ? loadError : new Error('Failed to load payout data'));\n } finally {\n setLoading(false);\n }\n }, [billingAccountId, requestContext]);\n\n useEffect(() => {\n void loadData();\n }, [loadData]);\n\n if (!permissions.canManagePaymentMethods) {\n return <AccessDenied message=\"You don't have permission to manage payout accounts.\" />;\n }\n\n if (error && isServerError(error)) {\n const serverError = (\n <ServerError\n title=\"Payout data unavailable\"\n message={isFluidgrids ? plainPayoutError(error, tr) : error.message}\n onRetry={() => void loadData()}\n showRetry\n />\n );\n return isFluidgrids ? (\n <>\n {serverError}\n <div className=\"px-6\">\n <ShowTechnicalDetails copyable>{rawErrorText(error)}</ShowTechnicalDetails>\n </div>\n </>\n ) : (\n serverError\n );\n }\n\n // FluidGrids: show a failed account action in plain words instead of an unhandled rejection.\n const guarded = async (action: () => Promise<void>): Promise<void> => {\n if (!isFluidgrids) return action();\n setActionFailure(null);\n try {\n await action();\n } catch (failure) {\n setActionFailure(failure);\n }\n };\n\n const handleAddAccount = async () => {\n if (!billingAccountId) return;\n setNotice(null);\n const payload = {\n billingAccountId,\n ...accountForm,\n };\n\n if (editingAccountId) {\n await updatePayoutAccount(editingAccountId, payload, requestContext);\n emit('billing.payout_account.updated', {\n route: '/billing/payouts',\n entityId: editingAccountId,\n source: 'payouts',\n });\n } else {\n const created = await addPayoutAccount(payload, requestContext);\n emit('billing.payout_account.added', {\n route: '/billing/payouts',\n entityId: billingAccountId,\n source: 'payouts',\n });\n // RazorpayX and Stripe Connect accounts stay pending until processor\n // onboarding verifies them (BOFF-10895); say so instead of implying the\n // account is ready to receive payouts.\n setNotice(\n created.status === 'ACTIVE'\n ? 'Payout account saved and ready to receive payouts.'\n : 'Payout account saved. It stays pending until the payout processor verifies it; you can request payouts to it once it is verified.'\n );\n }\n\n setAccountForm({\n label: '',\n type: 'BANK_ACCOUNT',\n providerPreference: 'AUTO',\n country: 'US',\n currency: 'USD',\n accountHolderName: '',\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n });\n setEditingAccountId(null);\n await loadData();\n };\n\n const handleSetDefault = async (accountId: string) => {\n setNotice(null);\n await setDefaultPayoutAccount(accountId, requestContext);\n await loadData();\n };\n\n const handleArchive = async (accountId: string) => {\n setNotice(null);\n await archivePayoutAccount(accountId, requestContext);\n emit('billing.payout_account.archived', {\n route: '/billing/payouts',\n entityId: accountId,\n source: 'payouts',\n });\n await loadData();\n };\n\n const handleEditAccount = (account: PayoutAccount) => {\n setNotice(null);\n setEditingAccountId(account.id);\n setAccountForm((current) => ({\n ...current,\n label: account.label,\n type: account.type,\n providerPreference: account.providerPreference,\n country: account.country || current.country,\n currency: account.currency,\n accountHolderName: account.displayName || current.accountHolderName,\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n }));\n };\n\n const selectedAccount = accounts.find((account) => account.id === selectedAccountId);\n const hasPayableAccount = accounts.some(isPayoutAccountPayable);\n\n const handleRequestPayout = async () => {\n if (!billingAccountId || !selectedAccountId || !requestAmount) return;\n if (!selectedAccount || !isPayoutAccountPayable(selectedAccount)) return;\n await requestPayout(\n {\n billingAccountId,\n payoutAccountId: selectedAccountId,\n amount: Number(requestAmount),\n currency: selectedAccount.currency,\n },\n requestContext\n );\n emit('billing.payout.requested', {\n route: '/billing/payouts',\n entityId: selectedAccountId,\n source: 'payouts',\n amount: Number(requestAmount),\n currency: selectedAccount.currency,\n });\n setRequestAmount('');\n await loadData();\n };\n\n const confirmPayout = async () => {\n setIsSubmittingPayout(true);\n setPayoutError(null);\n setPayoutFailure(null);\n try {\n await handleRequestPayout();\n setIsReviewingPayout(false);\n setPayoutResult({\n ok: true,\n message: `Payout of ${formatCurrency(Number(requestAmount), selectedAccount?.currency ?? '')} requested. We'll show its status below.`,\n });\n } catch (err) {\n setPayoutFailure(err);\n setPayoutError(plainPayoutError(err, tr));\n } finally {\n setIsSubmittingPayout(false);\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n {isFluidgrids && (\n <MoneyActionDialog\n open={isReviewingPayout}\n title=\"Review your payout\"\n description=\"The amount is moved out of your available balance when you confirm.\"\n details={[\n {\n label: 'Amount',\n value: formatCurrency(Number(requestAmount), selectedAccount?.currency ?? ''),\n },\n {\n label: 'Paid to',\n value: selectedAccount\n ? `${selectedAccount.label} · ${selectedAccount.currency}`\n : '',\n },\n ...(payoutFailure && rawErrorText(payoutFailure)\n ? [\n {\n label: tr('billing.payoutError.technical', 'Technical details'),\n value: (\n <ShowTechnicalDetails copyable>\n {rawErrorText(payoutFailure)}\n </ShowTechnicalDetails>\n ),\n },\n ]\n : []),\n ]}\n confirmLabel=\"Request payout\"\n busyLabel=\"Requesting…\"\n isBusy={isSubmittingPayout}\n error={payoutError}\n onConfirm={() => void confirmPayout()}\n onCancel={() => setIsReviewingPayout(false)}\n />\n )}\n {isFluidgrids && payoutResult && (\n <div\n role={payoutResult.ok ? 'status' : 'alert'}\n className={`rounded-md border p-3 text-sm ${payoutResult.ok ? 'border-status-success-border text-status-success-text' : 'border-status-error-border text-status-error-text'}`}\n >\n {payoutResult.message}\n </div>\n )}\n <PageHeader\n title=\"Payouts\"\n description=\"Register payout accounts, request withdrawals, and track disbursement status.\"\n />\n\n <PagePurpose>\n Get your earnings paid out to a real bank account or UPI. Register where you want to be\n paid, request a withdrawal of your available balance, and track each request from submission\n through to disbursement here.\n </PagePurpose>\n\n {notice ? (\n <div\n role=\"status\"\n className=\"rounded-lg border border-border-subtle bg-status-info-bg-subtle p-4 text-sm text-status-info-text\"\n >\n {notice}\n </div>\n ) : null}\n\n {error && !isServerError(error) ? (\n isFluidgrids ? (\n <PayoutErrorNotice error={error} />\n ) : (\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4 text-sm text-status-error-text\">\n {error.message}\n </div>\n )\n ) : null}\n {isFluidgrids && actionFailure ? <PayoutErrorNotice error={actionFailure} /> : null}\n\n <div className=\"grid gap-6 xl:grid-cols-[1.05fr,1.95fr]\">\n <section className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <h2 className=\"mb-4 text-lg font-semibold text-text-primary\">\n {editingAccountId ? 'Edit payout account' : 'Add payout account'}\n </h2>\n <div className=\"space-y-3\">\n <input\n value={accountForm.label}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, label: event.target.value }))\n }\n placeholder=\"Label\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <div className=\"grid gap-3 md:grid-cols-2\">\n <select\n value={accountForm.type}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, type: event.target.value }))\n }\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"BANK_ACCOUNT\">Bank account</option>\n <option value=\"UPI\">UPI</option>\n <option value=\"WALLET\">Wallet</option>\n </select>\n <select\n value={accountForm.providerPreference}\n onChange={(event) =>\n setAccountForm((current) => ({\n ...current,\n providerPreference: event.target.value,\n }))\n }\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"AUTO\">Auto</option>\n <option value=\"STRIPE\">Stripe</option>\n <option value=\"RAZORPAY\">Razorpay</option>\n <option value=\"MANUAL\">Manual</option>\n </select>\n </div>\n <div className=\"grid gap-3 md:grid-cols-2\">\n <input\n value={accountForm.country}\n onChange={(event) =>\n setAccountForm((current) => ({\n ...current,\n country: event.target.value.toUpperCase(),\n }))\n }\n placeholder=\"Country\"\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <input\n value={accountForm.currency}\n onChange={(event) =>\n setAccountForm((current) => ({\n ...current,\n currency: event.target.value.toUpperCase(),\n }))\n }\n placeholder=\"Currency\"\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n </div>\n <input\n value={accountForm.accountHolderName}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, accountHolderName: event.target.value }))\n }\n placeholder=\"Account holder name\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n {accountForm.type === 'BANK_ACCOUNT' ? (\n <>\n <input\n value={accountForm.bankName}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, bankName: event.target.value }))\n }\n placeholder=\"Bank name\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <input\n value={accountForm.accountNumber}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, accountNumber: event.target.value }))\n }\n placeholder=\"Account number\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <input\n value={\n accountForm.country === 'IN' ? accountForm.ifsc : accountForm.routingNumber\n }\n onChange={(event) =>\n setAccountForm((current) =>\n current.country === 'IN'\n ? { ...current, ifsc: event.target.value }\n : { ...current, routingNumber: event.target.value }\n )\n }\n placeholder={accountForm.country === 'IN' ? 'IFSC' : 'Routing number'}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n </>\n ) : accountForm.type === 'UPI' ? (\n <input\n value={accountForm.upiId}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, upiId: event.target.value }))\n }\n placeholder=\"UPI ID\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n ) : null}\n </div>\n <button\n type=\"button\"\n onClick={() => void guarded(handleAddAccount)}\n className=\"mt-4 inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text\"\n >\n <Landmark className=\"size-4\" />\n {editingAccountId ? 'Update payout account' : 'Save payout account'}\n </button>\n {editingAccountId ? (\n <button\n type=\"button\"\n onClick={() => {\n setEditingAccountId(null);\n setAccountForm({\n label: '',\n type: 'BANK_ACCOUNT',\n providerPreference: 'AUTO',\n country: 'US',\n currency: 'USD',\n accountHolderName: '',\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n });\n }}\n className=\"mt-4 ml-3 inline-flex items-center gap-2 rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary\"\n >\n Cancel edit\n </button>\n ) : null}\n </section>\n\n <section className=\"space-y-4\">\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <div className=\"mb-4 flex items-center justify-between\">\n <h2 className=\"text-lg font-semibold text-text-primary\">Request payout</h2>\n <button\n type=\"button\"\n onClick={() => void loadData()}\n className=\"inline-flex items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary\"\n >\n <RefreshCw className=\"size-4\" />\n Refresh\n </button>\n </div>\n {accounts.length === 0 && !loading ? (\n <IllustratedEmptyState\n illustration=\"empty-generic\"\n title=\"No payout accounts yet\"\n description=\"Add a payout account before requesting a withdrawal.\"\n />\n ) : (\n <div className=\"space-y-3\">\n <select\n value={selectedAccountId}\n onChange={(event) => setSelectedAccountId(event.target.value)}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n {!hasPayableAccount ? (\n <option value=\"\">No verified payout account yet</option>\n ) : null}\n {accounts.map((account) => (\n <option\n key={account.id}\n value={account.id}\n disabled={!isPayoutAccountPayable(account)}\n >\n {account.label} · {account.currency} ·{' '}\n {payoutAccountStatusView(account.status).label}\n </option>\n ))}\n </select>\n {!hasPayableAccount ? (\n <p className=\"text-sm text-text-secondary\">\n Payouts can be requested once one of your payout accounts is verified.\n </p>\n ) : null}\n <label className=\"block space-y-1 text-sm font-medium text-text-primary\">\n <span>Amount</span>\n <input\n value={requestAmount}\n onChange={(event) => setRequestAmount(event.target.value)}\n inputMode=\"decimal\"\n placeholder=\"0.00\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-normal text-text-primary\"\n />\n </label>\n <button\n type=\"button\"\n onClick={() => {\n if (!isFluidgrids) {\n void handleRequestPayout();\n return;\n }\n setPayoutError(null);\n setPayoutFailure(null);\n setPayoutResult(null);\n setIsReviewingPayout(true);\n }}\n disabled={!selectedAccount || !isPayoutAccountPayable(selectedAccount)}\n className=\"inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <Send className=\"size-4\" />\n Request payout\n </button>\n </div>\n )}\n\n {accounts.length > 0 ? (\n <div className=\"mt-4 space-y-3 rounded-md border border-border-subtle bg-bg-surface/60 p-3\">\n <h3 className=\"text-sm font-semibold text-text-primary\">Saved payout accounts</h3>\n {isFluidgrids ? (\n <PayoutDestinationList\n destinations={toPayoutDestinations(accounts)}\n renderActions={(destination) => {\n const account = accounts.find((item) => item.id === destination.id);\n if (!account) return null;\n return (\n <>\n <button\n type=\"button\"\n onClick={() => handleEditAccount(account)}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary\"\n >\n {tr('billing.payouts.edit', 'Edit')}\n </button>\n {!account.isDefault ? (\n <button\n type=\"button\"\n onClick={() => void guarded(() => handleSetDefault(account.id))}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary\"\n >\n {tr('billing.payouts.makeDefault', 'Make default')}\n </button>\n ) : null}\n <button\n type=\"button\"\n onClick={() => setArchiveAccountId(account.id)}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text\"\n >\n {tr('billing.payouts.archive', 'Archive')}\n </button>\n </>\n );\n }}\n />\n ) : (\n <>\n {accounts.map((account) => {\n const statusView = payoutAccountStatusView(account.status);\n return (\n <div\n key={account.id}\n className=\"flex flex-wrap items-center justify-between gap-3 rounded-md border border-border-subtle/70 bg-bg-surface px-3 py-2 text-sm\"\n >\n <div>\n <p className=\"flex flex-wrap items-center gap-2 font-medium text-text-primary\">\n {account.label} {account.isDefault ? '• Default' : ''}\n <span\n className={`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${PAYOUT_ACCOUNT_TONE_CLASSES[statusView.tone]}`}\n >\n {statusView.label}\n </span>\n </p>\n <p className=\"text-text-secondary\">\n {account.providerPreference} · {account.currency}\n </p>\n {statusView.hint ? (\n <p className=\"mt-1 text-xs text-text-secondary\">{statusView.hint}</p>\n ) : null}\n </div>\n <div className=\"flex flex-wrap gap-2\">\n <button\n type=\"button\"\n onClick={() => handleEditAccount(account)}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary\"\n >\n Edit\n </button>\n {!account.isDefault ? (\n <button\n type=\"button\"\n onClick={() => void guarded(() => handleSetDefault(account.id))}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary\"\n >\n Make default\n </button>\n ) : null}\n <button\n type=\"button\"\n onClick={() => setArchiveAccountId(account.id)}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text\"\n >\n Archive\n </button>\n </div>\n </div>\n );\n })}\n </>\n )}\n </div>\n ) : null}\n </div>\n\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <h2 className=\"mb-4 text-lg font-semibold text-text-primary\">Payout requests</h2>\n {requests.length === 0 && !loading ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title=\"No payout requests yet\"\n description=\"Your payout requests and processing updates will appear here.\"\n />\n ) : (\n <ResponsiveTable\n data={requests}\n rowKey={(request) => request.id}\n columns={payoutRequestColumns}\n />\n )}\n </div>\n </section>\n </div>\n\n <AlertDialog\n open={archiveAccountId !== null}\n onOpenChange={(open) => {\n if (!open) setArchiveAccountId(null);\n }}\n >\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Archive payout account?</AlertDialogTitle>\n <AlertDialogDescription>\n Archive this payout account? You can add a new one at any time.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction\n onClick={() => {\n const id = archiveAccountId;\n setArchiveAccountId(null);\n if (id) void guarded(() => handleArchive(id));\n }}\n >\n Archive\n </A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ACF,CAAA,CAAA;SA5CE,GAAAA,EAAQ,EA4CV;QAET,CAAC,EACD,CAAA,CAED;OACH,CAAA,IAAA;MACD;KAEL,CAAA,GAAA,kBAAC,OAAD;MAAK,WAAU;MAAf,UAAA,CACE,kBAAC,MAAD;OAAI,WAAU;OAA+C,UAAA;MAAmB,CAAA,GAC/EvD,EAAS,WAAW,KAAK,CAACE,IACzB,kBAACoE,GAAD;OACE,cAAa;OACb,OAAM;OACN,aAAY;MACb,CAAA,IAED,kBAACS,IAAD;OACE,MAAM/E;OACN,SAAS,MAAY7B,EAAQ;OAC7B,SAASF;MACV,CAAA,CAEA;KACE,CAAA,CAAA;IACN,CAAA,CAAA;;GAEL,kBAAC+G,IAAD;IACE,MAAMlE,OAAqB;IAC3B,eAAe,MAAS;KACtB,AAAKmE,KAAMlE,EAAoB,IAAI;IACrC;IAEA,UAAA,kBAACmE,IAAD,EAAA,UAAA,CACE,kBAACC,IAAD,EAAA,UAAA,CACE,kBAACC,IAAD,EAAA,UAAkB,0BAAyC,CAAA,GAC3D,kBAACC,IAAD,EAAA,UAAwB,kEAEA,CAAA,CACP,EAAA,CAAA,GACnB,kBAACC,IAAD,EAAA,UAAA,CACE,kBAACC,IAAD,EAAA,UAAmB,SAAyB,CAAA,GAC5C,kBAACC,IAAD;KACE,eAAe;MACb,IAAMC,IAAK3E;MAEX,AADAC,EAAoB,IAAI,GACpB0E,KAAIjD,QAAmBY,GAAcqC,CAAE,CAAC;KAC9C;KACD,UAAA;IAEkB,CAAA,CACF,EAAA,CAAA,CACD,EAAA,CAAA;GACT,CAAA;EACV;;AAET"}
@@ -0,0 +1,20 @@
1
+ import { PayoutAccount } from '../api';
2
+ import { PayoutAccountStatusView } from '../payoutAccountStatus';
3
+ /**
4
+ * One shape for a saved payout destination, so Payouts and Credit withdrawal
5
+ * list the same account the same way (BOFF-11861, FluidGrids variant).
6
+ * Presentation only: it reads an account, it never changes one.
7
+ */
8
+ export type PayoutDestinationKind = 'bank' | 'upi' | 'wallet' | 'other';
9
+ export interface PayoutDestination {
10
+ id: string;
11
+ label: string;
12
+ /** e.g. "Asha Rao · ···1234 · IN · INR" */
13
+ detail: string;
14
+ kind: PayoutDestinationKind;
15
+ isDefault: boolean;
16
+ status: PayoutAccountStatusView;
17
+ }
18
+ export declare function payoutDestinationKind(type: string): PayoutDestinationKind;
19
+ export declare function toPayoutDestination(account: PayoutAccount): PayoutDestination;
20
+ export declare function toPayoutDestinations(accounts: readonly PayoutAccount[]): PayoutDestination[];
@@ -0,0 +1,27 @@
1
+ import { payoutAccountStatusView as e } from "../payoutAccountStatus.js";
2
+ // src/billing/modules/earnings/utils/payoutDestination.ts
3
+ function t(e) {
4
+ switch (e) {
5
+ case "BANK_ACCOUNT": return "bank";
6
+ case "UPI": return "upi";
7
+ case "WALLET": return "wallet";
8
+ default: return "other";
9
+ }
10
+ }
11
+ function n(n) {
12
+ let r = [];
13
+ return n.displayName && r.push(n.displayName), n.accountLast4 && r.push(`···${n.accountLast4}`), n.country && r.push(n.country), n.currency && r.push(n.currency), {
14
+ id: n.id,
15
+ label: n.label,
16
+ detail: r.join(" · "),
17
+ kind: t(n.type),
18
+ isDefault: n.isDefault,
19
+ status: e(n.status)
20
+ };
21
+ }
22
+ function r(e) {
23
+ return e.map(n);
24
+ }
25
+ export { t as payoutDestinationKind, n as toPayoutDestination, r as toPayoutDestinations };
26
+
27
+ //# sourceMappingURL=payoutDestination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payoutDestination.js","names":["payoutDestinationKind","type","toPayoutDestination","parts","account","payoutAccountStatusView","toPayoutDestinations","accounts"],"sources":["../../../../../src/billing/modules/earnings/utils/payoutDestination.ts"],"sourcesContent":["import type { PayoutAccount } from '../api';\nimport { payoutAccountStatusView, type PayoutAccountStatusView } from '../payoutAccountStatus';\n\n/**\n * One shape for a saved payout destination, so Payouts and Credit withdrawal\n * list the same account the same way (BOFF-11861, FluidGrids variant).\n * Presentation only: it reads an account, it never changes one.\n */\nexport type PayoutDestinationKind = 'bank' | 'upi' | 'wallet' | 'other';\n\nexport interface PayoutDestination {\n id: string;\n label: string;\n /** e.g. \"Asha Rao · ···1234 · IN · INR\" */\n detail: string;\n kind: PayoutDestinationKind;\n isDefault: boolean;\n status: PayoutAccountStatusView;\n}\n\nexport function payoutDestinationKind(type: string): PayoutDestinationKind {\n switch (type) {\n case 'BANK_ACCOUNT':\n return 'bank';\n case 'UPI':\n return 'upi';\n case 'WALLET':\n return 'wallet';\n default:\n return 'other';\n }\n}\n\nexport function toPayoutDestination(account: PayoutAccount): PayoutDestination {\n const parts: string[] = [];\n if (account.displayName) parts.push(account.displayName);\n if (account.accountLast4) parts.push(`···${account.accountLast4}`);\n if (account.country) parts.push(account.country);\n if (account.currency) parts.push(account.currency);\n return {\n id: account.id,\n label: account.label,\n detail: parts.join(' · '),\n kind: payoutDestinationKind(account.type),\n isDefault: account.isDefault,\n status: payoutAccountStatusView(account.status),\n };\n}\n\nexport function toPayoutDestinations(accounts: readonly PayoutAccount[]): PayoutDestination[] {\n return accounts.map(toPayoutDestination);\n}\n"],"mappings":";;AAoBA,SAAgBA,EAAsB,GAAqC;CACzE,QAAQC,GAAR;EACE,KAAK,gBACH,OAAO;EACT,KAAK,OACH,OAAO;EACT,KAAK,UACH,OAAO;EACT,SACE,OAAO;CACX;AACF;AAEA,SAAgBC,EAAoB,GAA2C;CAC7E,IAAMC,IAAkB,CAAC;CAKzB,OAJIC,EAAQ,eAAaD,EAAM,KAAKC,EAAQ,WAAW,GACnDA,EAAQ,gBAAcD,EAAM,KAAK,MAAMC,EAAQ,cAAc,GAC7DA,EAAQ,WAASD,EAAM,KAAKC,EAAQ,OAAO,GAC3CA,EAAQ,YAAUD,EAAM,KAAKC,EAAQ,QAAQ,GAC1C;EACL,IAAIA,EAAQ;EACZ,OAAOA,EAAQ;EACf,QAAQD,EAAM,KAAK,KAAK;EACxB,MAAMH,EAAsBI,EAAQ,IAAI;EACxC,WAAWA,EAAQ;EACnB,QAAQC,EAAwBD,EAAQ,MAAM;CAChD;AACF;AAEA,SAAgBE,EAAqB,GAAyD;CAC5F,OAAOC,EAAS,IAAIL,CAAmB;AACzC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Plain-language wording for failed payout / withdrawal / earnings calls
3
+ * (BOFF-11861, FluidGrids variant only). The raw backend text is never shown as
4
+ * the message; callers render it under "Show technical details" instead.
5
+ */
6
+ export type PayoutErrorTr = (key: string, fallback: string) => string;
7
+ export declare const GENERIC_PAYOUT_ERROR_FALLBACK = "That did not work. Nothing was changed. Please try again.";
8
+ /** The raw text of any thrown value, for "Show technical details". */
9
+ export declare function rawErrorText(error: unknown): string;
10
+ export declare function plainPayoutError(error: unknown, tr: PayoutErrorTr): string;
@@ -0,0 +1,50 @@
1
+ // src/billing/modules/earnings/utils/plainPayoutError.ts
2
+ var e = "That did not work. Nothing was changed. Please try again.";
3
+ function t(e) {
4
+ return e instanceof Error ? e.message : typeof e == "string" ? e : "";
5
+ }
6
+ var n = [
7
+ {
8
+ pattern: /failed to fetch|networkerror|network request failed|load failed|econn|enotfound|timed? ?out|offline|socket hang up/i,
9
+ key: "billing.payoutError.network",
10
+ fallback: "We could not reach the server. Check your connection and try again. Nothing was changed."
11
+ },
12
+ {
13
+ pattern: /insufficient|exceeds .*(balance|available|withdrawable)|not enough|balance too low/i,
14
+ key: "billing.payoutError.insufficient",
15
+ fallback: "You do not have enough available balance for this amount. Enter a smaller amount."
16
+ },
17
+ {
18
+ pattern: /not verified|unverified|pending[_ ]verification|verification (failed|pending)|not active|not payable/i,
19
+ key: "billing.payoutError.notVerified",
20
+ fallback: "This payout account is not verified yet. You can use it once the payout processor verifies it."
21
+ },
22
+ {
23
+ pattern: /minimum|at least|below the|too small/i,
24
+ key: "billing.payoutError.minimum",
25
+ fallback: "That amount is below the minimum allowed. Enter a larger amount."
26
+ },
27
+ {
28
+ pattern: /forbidden|permission|not authori[sz]ed|unauthori[sz]ed|access denied|\b40[13]\b|rbac/i,
29
+ key: "billing.payoutError.permission",
30
+ fallback: "You do not have permission to do this. Ask an owner or admin of this account."
31
+ },
32
+ {
33
+ pattern: /not found|does not exist|no longer exists|archived/i,
34
+ key: "billing.payoutError.notFound",
35
+ fallback: "That payout account is no longer available. Refresh the page and pick another one."
36
+ },
37
+ {
38
+ pattern: /invalid|validation|required|must be|malformed|ifsc|routing|upi/i,
39
+ key: "billing.payoutError.invalid",
40
+ fallback: "Some details look wrong. Check the amount and account details, then try again."
41
+ }
42
+ ];
43
+ function r(r, i) {
44
+ let a = t(r);
45
+ for (let e of n) if (e.pattern.test(a)) return i(e.key, e.fallback);
46
+ return i("billing.payoutError.generic", e);
47
+ }
48
+ export { e as GENERIC_PAYOUT_ERROR_FALLBACK, r as plainPayoutError, t as rawErrorText };
49
+
50
+ //# sourceMappingURL=plainPayoutError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plainPayoutError.js","names":["GENERIC_PAYOUT_ERROR_FALLBACK","rawErrorText","error","RULES","plainPayoutError","raw","rule","tr"],"sources":["../../../../../src/billing/modules/earnings/utils/plainPayoutError.ts"],"sourcesContent":["/**\n * Plain-language wording for failed payout / withdrawal / earnings calls\n * (BOFF-11861, FluidGrids variant only). The raw backend text is never shown as\n * the message; callers render it under \"Show technical details\" instead.\n */\nexport type PayoutErrorTr = (key: string, fallback: string) => string;\n\nexport const GENERIC_PAYOUT_ERROR_FALLBACK =\n 'That did not work. Nothing was changed. Please try again.';\n\n/** The raw text of any thrown value, for \"Show technical details\". */\nexport function rawErrorText(error: unknown): string {\n if (error instanceof Error) return error.message;\n if (typeof error === 'string') return error;\n return '';\n}\n\ninterface ErrorRule {\n pattern: RegExp;\n key: string;\n fallback: string;\n}\n\n// Order matters: the first matching rule wins.\nconst RULES: readonly ErrorRule[] = [\n {\n pattern:\n /failed to fetch|networkerror|network request failed|load failed|econn|enotfound|timed? ?out|offline|socket hang up/i,\n key: 'billing.payoutError.network',\n fallback:\n 'We could not reach the server. Check your connection and try again. Nothing was changed.',\n },\n {\n pattern: /insufficient|exceeds .*(balance|available|withdrawable)|not enough|balance too low/i,\n key: 'billing.payoutError.insufficient',\n fallback: 'You do not have enough available balance for this amount. Enter a smaller amount.',\n },\n {\n pattern:\n /not verified|unverified|pending[_ ]verification|verification (failed|pending)|not active|not payable/i,\n key: 'billing.payoutError.notVerified',\n fallback:\n 'This payout account is not verified yet. You can use it once the payout processor verifies it.',\n },\n {\n pattern: /minimum|at least|below the|too small/i,\n key: 'billing.payoutError.minimum',\n fallback: 'That amount is below the minimum allowed. Enter a larger amount.',\n },\n {\n pattern:\n /forbidden|permission|not authori[sz]ed|unauthori[sz]ed|access denied|\\b40[13]\\b|rbac/i,\n key: 'billing.payoutError.permission',\n fallback: 'You do not have permission to do this. Ask an owner or admin of this account.',\n },\n {\n pattern: /not found|does not exist|no longer exists|archived/i,\n key: 'billing.payoutError.notFound',\n fallback: 'That payout account is no longer available. Refresh the page and pick another one.',\n },\n {\n pattern: /invalid|validation|required|must be|malformed|ifsc|routing|upi/i,\n key: 'billing.payoutError.invalid',\n fallback: 'Some details look wrong. Check the amount and account details, then try again.',\n },\n];\n\nexport function plainPayoutError(error: unknown, tr: PayoutErrorTr): string {\n const raw = rawErrorText(error);\n for (const rule of RULES) {\n if (rule.pattern.test(raw)) return tr(rule.key, rule.fallback);\n }\n return tr('billing.payoutError.generic', GENERIC_PAYOUT_ERROR_FALLBACK);\n}\n"],"mappings":";AAOA,IAAaA,IACX;AAGF,SAAgBC,EAAa,GAAwB;CAGnD,OAFIC,aAAiB,QAAcA,EAAM,UACrC,OAAOA,KAAU,WAAiBA,IAC/B;AACT;AASA,IAAMC,IAA8B;CAClC;EACE,SACE;EACF,KAAK;EACL,UACE;CACJ;CACA;EACE,SAAS;EACT,KAAK;EACL,UAAU;CACZ;CACA;EACE,SACE;EACF,KAAK;EACL,UACE;CACJ;CACA;EACE,SAAS;EACT,KAAK;EACL,UAAU;CACZ;CACA;EACE,SACE;EACF,KAAK;EACL,UAAU;CACZ;CACA;EACE,SAAS;EACT,KAAK;EACL,UAAU;CACZ;CACA;EACE,SAAS;EACT,KAAK;EACL,UAAU;CACZ;AACF;AAEA,SAAgBC,EAAiB,GAAgB,GAA2B;CAC1E,IAAMC,IAAMJ,EAAaC,CAAK;CAC9B,KAAK,IAAMI,KAAQH,GACjB,IAAIG,EAAK,QAAQ,KAAKD,CAAG,GAAG,OAAOE,EAAGD,EAAK,KAAKA,EAAK,QAAQ;CAE/D,OAAOC,EAAG,+BAA+BP,CAA6B;AACxE"}
@@ -2,10 +2,10 @@ import { useBillingNavigate as e } from "../../../hooks/useBillingNavigate.js";
2
2
  import { ServerError as t } from "../../../shared/components/ServerError.js";
3
3
  import { useBilling as n } from "../../../providers/BillingProvider.js";
4
4
  import "../hooks/index.js";
5
- import { formatCurrency as r, formatPlanDuration as i, formatPlanDurationLabel as a } from "../../../shared/utils/format.js";
6
- import { isServerError as o } from "../../../shared/utils/error.js";
7
- import { getPlanFeatureQuantity as s } from "../../../shared/utils/planFeatureQuantity.js";
8
- import { useDefaultBillingAccount as c } from "../../subscriptions/hooks/useSubscriptions.js";
5
+ import { useDefaultBillingAccount as r } from "../../subscriptions/hooks/useSubscriptions.js";
6
+ import { formatCurrency as i, formatPlanDuration as a, formatPlanDurationLabel as o } from "../../../shared/utils/format.js";
7
+ import { isServerError as s } from "../../../shared/utils/error.js";
8
+ import { getPlanFeatureQuantity as c } from "../../../shared/utils/planFeatureQuantity.js";
9
9
  import { useIsFluidgridsVariant as l } from "../../../hooks/useBillingVariant.js";
10
10
  import { activeProductSubscriptions as u, resolvePlanAction as d } from "../utils/planAction.js";
11
11
  import "../../../shared/components/index.js";
@@ -25,7 +25,7 @@ function A(e) {
25
25
  let t = /* @__PURE__ */ new Map();
26
26
  for (let n of e) {
27
27
  if (!n.quota) continue;
28
- let e = n.quota.id, r = s(n), i = t.get(e);
28
+ let e = n.quota.id, r = c(n), i = t.get(e);
29
29
  i ? i.totalValue += r : t.set(e, {
30
30
  quotaId: e,
31
31
  name: n.quota.name ?? "Unknown Quota",
@@ -42,15 +42,15 @@ function j(e) {
42
42
  });
43
43
  }
44
44
  var M = () => {
45
- let { t: r } = k(), i = (e, t) => {
46
- let n = r(e);
45
+ let { t: i } = k(), a = (e, t) => {
46
+ let n = i(e);
47
47
  return n === e ? t : n;
48
- }, a = e(), { productId: s, plansDocsUrl: m } = n(), h = b(s), { plans: g, isLoading: _, error: v, refetch: y } = f({
48
+ }, o = e(), { productId: c, plansDocsUrl: m } = n(), h = b(c), { plans: g, isLoading: _, error: v, refetch: y } = f({
49
49
  includeFree: !1,
50
- productId: s ?? void 0
51
- }), w = l(), { subscriptions: T } = c(), E = u(T, new Set(g.map((e) => e.id))), A = (e) => w ? d(e, E) : null, j = (e) => {
50
+ productId: c ?? void 0
51
+ }), w = l(), { subscriptions: T } = r(), E = u(T, new Set(g.map((e) => e.id))), A = (e) => w ? d(e, E) : null, j = (e) => {
52
52
  let t = A(e);
53
- t?.kind === "change" ? a(`/subscriptions/${t.subscriptionId}/upgrade`) : a(`/checkout/${e}`);
53
+ t?.kind === "change" ? o(`/subscriptions/${t.subscriptionId}/upgrade`) : o(`/checkout/${e}`);
54
54
  }, [M, F] = x("grid"), [R, z] = x(p.MONTHLY), B = g.filter((e) => e.isActive && e.isPurchasable !== !1 && e.duration === R), V = B.length >= 2 ? 1 : -1;
55
55
  return _ && g.length === 0 ? /* @__PURE__ */ O("div", {
56
56
  className: "space-y-6 px-6 lg:px-8 py-6",
@@ -76,11 +76,11 @@ var M = () => {
76
76
  ]
77
77
  }, e))
78
78
  })]
79
- }) : v && o(v) ? /* @__PURE__ */ D("div", {
79
+ }) : v && s(v) ? /* @__PURE__ */ D("div", {
80
80
  className: "p-6",
81
81
  children: /* @__PURE__ */ D(t, {
82
- title: i("billing.plans.serverUnavailable", "Server Unavailable"),
83
- message: i("billing.plans.unableToLoadPlans", "Unable to load plans."),
82
+ title: a("billing.plans.serverUnavailable", "Server Unavailable"),
83
+ message: a("billing.plans.unableToLoadPlans", "Unable to load plans."),
84
84
  onRetry: () => y(),
85
85
  showRetry: !0
86
86
  })
@@ -90,17 +90,17 @@ var M = () => {
90
90
  /* @__PURE__ */ O("div", { children: [
91
91
  /* @__PURE__ */ D("h1", {
92
92
  className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
93
- children: i("billing.plans.browsePlansTitle", "Plans")
93
+ children: a("billing.plans.browsePlansTitle", "Plans")
94
94
  }),
95
95
  /* @__PURE__ */ D("p", {
96
96
  className: "text-sm text-text-secondary mt-1",
97
- children: i("billing.plans.browsePlansSubtitle", "Choose a plan that fits your needs")
97
+ children: a("billing.plans.browsePlansSubtitle", "Choose a plan that fits your needs")
98
98
  }),
99
99
  /* @__PURE__ */ D(C, {
100
100
  className: "mt-3",
101
101
  learnMoreHref: m,
102
- learnMoreLabel: i("billing.plans.learnMore", "Learn more"),
103
- children: i("billing.plans.browsePurpose", "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.")
102
+ learnMoreLabel: a("billing.plans.learnMore", "Learn more"),
103
+ children: a("billing.plans.browsePurpose", "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.")
104
104
  })
105
105
  ] }),
106
106
  /* @__PURE__ */ O("div", {
@@ -154,14 +154,14 @@ var M = () => {
154
154
  }),
155
155
  B.length === 0 ? /* @__PURE__ */ D(S, {
156
156
  illustration: "empty-data",
157
- title: i("billing.plans.noPlansAvailable", "No plans available"),
158
- description: i("billing.plans.checkBackLater", "Check back later for new plans.")
157
+ title: a("billing.plans.noPlansAvailable", "No plans available"),
158
+ description: a("billing.plans.checkBackLater", "Check back later for new plans.")
159
159
  }) : M === "grid" ? /* @__PURE__ */ O("div", {
160
160
  className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 items-stretch",
161
161
  children: [B.map((e, t) => /* @__PURE__ */ D(I, {
162
162
  plan: e,
163
163
  highlighted: t === V,
164
- onView: () => a(`/plans/${e.id}`),
164
+ onView: () => o(`/plans/${e.id}`),
165
165
  onSubscribe: () => j(e.id),
166
166
  action: A(e.id)
167
167
  }, e.id)), /* @__PURE__ */ D(N, { offer: h })]
@@ -169,7 +169,7 @@ var M = () => {
169
169
  className: "space-y-3",
170
170
  children: [B.map((e) => /* @__PURE__ */ D(L, {
171
171
  plan: e,
172
- onView: () => a(`/plans/${e.id}`),
172
+ onView: () => o(`/plans/${e.id}`),
173
173
  onSubscribe: () => j(e.id),
174
174
  action: A(e.id)
175
175
  }, e.id)), /* @__PURE__ */ D(P, { offer: h })]
@@ -286,7 +286,7 @@ var M = () => {
286
286
  function F(e) {
287
287
  return e?.kind === "current" ? "Current plan" : e?.kind === "change" ? "Change to this plan" : "Subscribe";
288
288
  }
289
- var I = ({ plan: e, highlighted: t = !1, onView: n, onSubscribe: o, action: s }) => {
289
+ var I = ({ plan: e, highlighted: t = !1, onView: n, onSubscribe: r, action: s }) => {
290
290
  let c = j(e.features || []), l = A(e.features || []).length - c.length, u = h(), { price: d, currency: f } = m(e.price, e.currency, e.currencyPrices, u);
291
291
  return /* @__PURE__ */ O("div", {
292
292
  className: `relative flex flex-col h-full rounded-card bg-bg-surface p-6 transition-[border-color,box-shadow] duration-200 ${t ? "border-2 border-action-primary-bg shadow-[var(--shadow-glow)]" : "border border-border-subtle shadow-elevation-1 hover:border-border-strong hover:shadow-elevation-2"}`,
@@ -309,17 +309,17 @@ var I = ({ plan: e, highlighted: t = !1, onView: n, onSubscribe: o, action: s })
309
309
  children: e.name
310
310
  }), /* @__PURE__ */ D("span", {
311
311
  className: "text-sm text-text-secondary",
312
- children: a(e.duration)
312
+ children: o(e.duration)
313
313
  })]
314
314
  }),
315
315
  /* @__PURE__ */ O("div", {
316
316
  className: "flex items-baseline gap-1.5 mb-5",
317
317
  children: [/* @__PURE__ */ D("span", {
318
318
  className: "text-4xl font-bold tabular-nums tracking-tight text-text-primary",
319
- children: r(d, f)
319
+ children: i(d, f)
320
320
  }), /* @__PURE__ */ O("span", {
321
321
  className: "text-text-secondary text-sm",
322
- children: ["/ ", i(e.duration)]
322
+ children: ["/ ", a(e.duration)]
323
323
  })]
324
324
  }),
325
325
  c.length > 0 && /* @__PURE__ */ O("ul", {
@@ -355,7 +355,7 @@ var I = ({ plan: e, highlighted: t = !1, onView: n, onSubscribe: o, action: s })
355
355
  className: "space-y-2 pt-4 border-t border-border-subtle mt-auto",
356
356
  children: [/* @__PURE__ */ O("button", {
357
357
  type: "button",
358
- onClick: o,
358
+ onClick: r,
359
359
  disabled: s?.kind === "current",
360
360
  "aria-disabled": s?.kind === "current",
361
361
  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)]",
@@ -372,7 +372,7 @@ var I = ({ plan: e, highlighted: t = !1, onView: n, onSubscribe: o, action: s })
372
372
  })
373
373
  ]
374
374
  });
375
- }, L = ({ plan: e, onView: t, onSubscribe: n, action: a }) => {
375
+ }, L = ({ plan: e, onView: t, onSubscribe: n, action: r }) => {
376
376
  let o = j(e.features || []), s = h();
377
377
  return /* @__PURE__ */ O("div", {
378
378
  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",
@@ -413,11 +413,11 @@ var I = ({ plan: e, highlighted: t = !1, onView: n, onSubscribe: o, action: s })
413
413
  className: "font-semibold text-text-primary",
414
414
  children: (() => {
415
415
  let { price: t, currency: n } = m(e.price, e.currency, e.currencyPrices, s);
416
- return r(t, n);
416
+ return i(t, n);
417
417
  })()
418
418
  }), /* @__PURE__ */ O("div", {
419
419
  className: "text-sm text-text-secondary",
420
- children: ["per ", i(e.duration)]
420
+ children: ["per ", a(e.duration)]
421
421
  })]
422
422
  }),
423
423
  /* @__PURE__ */ O("div", {
@@ -425,9 +425,9 @@ var I = ({ plan: e, highlighted: t = !1, onView: n, onSubscribe: o, action: s })
425
425
  children: [/* @__PURE__ */ D("button", {
426
426
  type: "button",
427
427
  onClick: n,
428
- disabled: a?.kind === "current",
428
+ disabled: r?.kind === "current",
429
429
  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",
430
- children: F(a)
430
+ children: F(r)
431
431
  }), /* @__PURE__ */ D("button", {
432
432
  type: "button",
433
433
  onClick: t,
@@ -4,8 +4,8 @@ import { AccessDenied as r } from "../../../shared/components/AccessDenied.js";
4
4
  import { PageHeader as i } from "../../../shared/components/PageHeader.js";
5
5
  import { useBillingEventEmitter as ne } from "../../../hooks/useBillingEventEmitter.js";
6
6
  import { useBillingPermissions as re } from "../../../hooks/useBillingPermissions.js";
7
- import { directBillingGraphqlRequest as ie } from "../../../shared/utils/directBillingGraphql.js";
8
- import { useBilling as ae } from "../../../providers/BillingProvider.js";
7
+ import { useBilling as ie } from "../../../providers/BillingProvider.js";
8
+ import { directBillingGraphqlRequest as ae } from "../../../shared/utils/directBillingGraphql.js";
9
9
  import "../../../shared/components/index.js";
10
10
  import "../../../shared/utils/index.js";
11
11
  import { ArchiveBillingAccountSettingsDocument as oe, useGetBillingAccountSettingsQuery as se, useGetBillingAccountsSettingsQuery as a, useGetDefaultBillingAccountSettingsQuery as ce, useSetDefaultBillingAccountSettingsMutation as le, useUpdateBillingAccountSettingsMutation as ue } from "../../../../generated/global-operations.js";
@@ -17,7 +17,7 @@ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
17
17
  var f = () => {
18
18
  if (typeof window < "u") return new URLSearchParams(window.location.search).get("billingAccountId") || void 0;
19
19
  }, p = () => {
20
- let p = de(), m = re(), h = te(), { apiGatewayUrl: g, authToken: _, orgId: v } = ae(), { emit: y } = ne(), [b, x] = c(f), [S, C] = c(!1), [w, T] = c(!1), [E, D] = c(!1), [O, k] = c(!1), [A, j] = c(null), [we, M] = c(!1), [Te, N] = c(!1), [Ee, P] = c(!1), [F, I] = c(e), { data: L, loading: De, refetch: R } = a({}), z = s(() => L?.getBillingAccountsByOrg || [], [L?.getBillingAccountsByOrg]), { data: Oe, loading: ke, refetch: B } = ce({}), V = Oe?.getDefaultBillingAccount || null, { data: Ae, loading: H, refetch: U } = se({
20
+ let p = de(), m = re(), h = te(), { apiGatewayUrl: g, authToken: _, orgId: v } = ie(), { emit: y } = ne(), [b, x] = c(f), [S, C] = c(!1), [w, T] = c(!1), [E, D] = c(!1), [O, k] = c(!1), [A, j] = c(null), [we, M] = c(!1), [Te, N] = c(!1), [Ee, P] = c(!1), [F, I] = c(e), { data: L, loading: De, refetch: R } = a({}), z = s(() => L?.getBillingAccountsByOrg || [], [L?.getBillingAccountsByOrg]), { data: Oe, loading: ke, refetch: B } = ce({}), V = Oe?.getDefaultBillingAccount || null, { data: Ae, loading: H, refetch: U } = se({
21
21
  variables: { id: b },
22
22
  skip: !b
23
23
  }), W = Ae?.getBillingAccount || null, [G] = ue(), [K] = le(), q = s(() => {
@@ -90,7 +90,7 @@ var f = () => {
90
90
  if (q?.id && q.isActive) {
91
91
  D(!0), j(null), M(!1);
92
92
  try {
93
- await ie({
93
+ await ae({
94
94
  apiGatewayUrl: g,
95
95
  authToken: _,
96
96
  orgId: v,