@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.
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +293 -291
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +25 -24
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js +25 -24
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
- package/dist/billing/modules/billing/hooks/index.js +5 -5
- package/dist/billing/modules/billing/hooks/useInvoices.js +20 -39
- package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
- package/dist/billing/modules/billing/index.js +14 -14
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +92 -89
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js +2 -2
- package/dist/billing/modules/billing/pages/UserRefundsPage.js +140 -140
- package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js +16 -15
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +305 -282
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditsPage.js +164 -137
- package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
- package/dist/billing/modules/dashboard/pages/OverviewPage.js +444 -594
- package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
- package/dist/billing/modules/earnings/components/PayoutDestinationList.d.ts +15 -0
- package/dist/billing/modules/earnings/components/PayoutDestinationList.js +66 -0
- package/dist/billing/modules/earnings/components/PayoutDestinationList.js.map +1 -0
- package/dist/billing/modules/earnings/components/PayoutErrorNotice.d.ts +7 -0
- package/dist/billing/modules/earnings/components/PayoutErrorNotice.js +19 -0
- package/dist/billing/modules/earnings/components/PayoutErrorNotice.js.map +1 -0
- package/dist/billing/modules/earnings/pages/EarningsPage.js +138 -125
- package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.js +260 -202
- package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
- package/dist/billing/modules/earnings/utils/payoutDestination.d.ts +20 -0
- package/dist/billing/modules/earnings/utils/payoutDestination.js +27 -0
- package/dist/billing/modules/earnings/utils/payoutDestination.js.map +1 -0
- package/dist/billing/modules/earnings/utils/plainPayoutError.d.ts +10 -0
- package/dist/billing/modules/earnings/utils/plainPayoutError.js +50 -0
- package/dist/billing/modules/earnings/utils/plainPayoutError.js.map +1 -0
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js +32 -32
- package/dist/billing/modules/settings/pages/SettingsPage.js +4 -4
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +577 -640
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
- package/dist/billing/shared/components/HeaderActions.d.ts +10 -0
- package/dist/billing/shared/components/HeaderActions.js +33 -0
- package/dist/billing/shared/components/HeaderActions.js.map +1 -0
- package/dist/billing/shared/components/index.d.ts +1 -0
- package/dist/billing/shared/components/index.js +2 -1
- package/dist/billing/shared/utils/format.js +4 -16
- package/dist/billing/shared/utils/format.js.map +1 -1
- package/dist/billing/shared/utils/index.js +8 -8
- package/dist/generated/global-operations.js +286 -294
- package/dist/generated/global-operations.js.map +1 -1
- package/package.json +1 -1
- package/dist/billing/modules/dashboard/utils/overviewSummary.d.ts +0 -46
- package/dist/billing/modules/dashboard/utils/overviewSummary.js +0 -37
- package/dist/billing/modules/dashboard/utils/overviewSummary.js.map +0 -1
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.d.ts +0 -30
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js +0 -20
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js.map +0 -1
|
@@ -1,29 +1,34 @@
|
|
|
1
1
|
import { useBillingPermissions as e } from "../../../hooks/useBillingPermissions.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { useIsFluidgridsVariant as t } from "../../../hooks/useBillingVariant.js";
|
|
3
|
+
import { AccessDenied as ee } from "../../../shared/components/AccessDenied.js";
|
|
4
|
+
import { PageHeader as te } from "../../../shared/components/PageHeader.js";
|
|
5
|
+
import { ServerError as ne } from "../../../shared/components/ServerError.js";
|
|
6
|
+
import { MoneyActionDialog as re } from "../../../shared/components/MoneyActionDialog.js";
|
|
7
7
|
import "../../../shared/components/index.js";
|
|
8
|
+
import { useTr as ie } from "../../../shared/hooks/useTr.js";
|
|
9
|
+
import { useBillingEventEmitter as ae } from "../../../hooks/useBillingEventEmitter.js";
|
|
8
10
|
import { formatCurrency as n, formatDateTime as r } from "../../../shared/utils/format.js";
|
|
9
11
|
import { isServerError as i } from "../../../shared/utils/error.js";
|
|
10
|
-
import {
|
|
11
|
-
import { useBilling as o } from "../../../providers/BillingProvider.js";
|
|
12
|
+
import { useBilling as oe } from "../../../providers/BillingProvider.js";
|
|
12
13
|
import "../../../shared/utils/index.js";
|
|
13
|
-
import { useGetDefaultBillingAccountSettingsQuery as
|
|
14
|
-
import { addPayoutAccount as
|
|
15
|
-
import { PAYOUT_ACCOUNT_TONE_CLASSES as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
14
|
+
import { useGetDefaultBillingAccountSettingsQuery as se } from "../../../../generated/global-operations.js";
|
|
15
|
+
import { addPayoutAccount as ce, archivePayoutAccount as le, fetchPayoutAccounts as ue, fetchPayoutRequests as de, requestPayout as fe, setDefaultPayoutAccount as pe, updatePayoutAccount as me } from "../api.js";
|
|
16
|
+
import { PAYOUT_ACCOUNT_TONE_CLASSES as he, isPayoutAccountPayable as a, payoutAccountStatusView as o, pickPayableAccountId as ge } from "../payoutAccountStatus.js";
|
|
17
|
+
import { PayoutDestinationList as _e } from "../components/PayoutDestinationList.js";
|
|
18
|
+
import { PayoutErrorNotice as s } from "../components/PayoutErrorNotice.js";
|
|
19
|
+
import { toPayoutDestinations as ve } from "../utils/payoutDestination.js";
|
|
20
|
+
import { plainPayoutError as c, rawErrorText as l } from "../utils/plainPayoutError.js";
|
|
21
|
+
import { useCallback as ye, useEffect as be, useMemo as xe, useState as u } from "react";
|
|
22
|
+
import { AlertDialog as Se, AlertDialogAction as Ce, AlertDialogCancel as we, AlertDialogContent as Te, AlertDialogDescription as Ee, AlertDialogFooter as De, AlertDialogHeader as Oe, AlertDialogTitle as ke, IllustratedEmptyState as d, PagePurpose as Ae, ResponsiveTable as je, ShowTechnicalDetails as f } from "@burdenoff/fe-libs/ui";
|
|
23
|
+
import { Landmark as Me, RefreshCw as Ne, Send as Pe } from "lucide-react";
|
|
24
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
20
25
|
// src/billing/modules/earnings/pages/PayoutsPage.tsx
|
|
21
|
-
var
|
|
26
|
+
var Fe = [
|
|
22
27
|
{
|
|
23
28
|
key: "amount",
|
|
24
29
|
header: "Amount",
|
|
25
30
|
priority: "primary",
|
|
26
|
-
cell: (e) => /* @__PURE__ */
|
|
31
|
+
cell: (e) => /* @__PURE__ */ m("span", {
|
|
27
32
|
className: "tabular-nums",
|
|
28
33
|
children: n(e.requestedAmount, e.currency)
|
|
29
34
|
})
|
|
@@ -48,8 +53,8 @@ var Ee = [
|
|
|
48
53
|
header: "Created",
|
|
49
54
|
cell: (e) => r(e.createdAt)
|
|
50
55
|
}
|
|
51
|
-
],
|
|
52
|
-
let r = e(), v =
|
|
56
|
+
], g = () => {
|
|
57
|
+
let r = e(), g = t(), _ = ie(), [Ie, v] = u(!1), [Le, y] = u(!1), [Re, b] = u(null), [x, S] = u(null), [C, w] = u(null), [T, E] = u(null), { emit: D } = ae(), { apiGatewayUrl: O, authToken: k, orgId: A } = oe(), { data: ze } = se({}), j = ze?.getDefaultBillingAccount?.id, [M, Be] = u([]), [N, Ve] = u([]), [P, F] = u(!0), [I, L] = u(null), [R, z] = u({
|
|
53
58
|
label: "",
|
|
54
59
|
type: "BANK_ACCOUNT",
|
|
55
60
|
providerPreference: "AUTO",
|
|
@@ -61,57 +66,74 @@ var Ee = [
|
|
|
61
66
|
routingNumber: "",
|
|
62
67
|
ifsc: "",
|
|
63
68
|
upiId: ""
|
|
64
|
-
}), [
|
|
65
|
-
apiGatewayUrl:
|
|
66
|
-
authToken:
|
|
67
|
-
orgId:
|
|
69
|
+
}), [B, V] = u(""), [H, U] = u(""), [W, G] = u(null), [He, K] = u(null), [q, J] = u(null), Y = xe(() => ({
|
|
70
|
+
apiGatewayUrl: O,
|
|
71
|
+
authToken: k,
|
|
72
|
+
orgId: A
|
|
68
73
|
}), [
|
|
69
|
-
D,
|
|
70
74
|
O,
|
|
71
|
-
k
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
k,
|
|
76
|
+
A
|
|
77
|
+
]), X = ye(async () => {
|
|
78
|
+
if (j) {
|
|
79
|
+
F(!0), L(null);
|
|
75
80
|
try {
|
|
76
|
-
let [e, t] = await Promise.all([
|
|
77
|
-
|
|
81
|
+
let [e, t] = await Promise.all([ue(j, Y), de(j, Y)]);
|
|
82
|
+
Be(e), Ve(t), U((t) => ge(e, t));
|
|
78
83
|
} catch (e) {
|
|
79
|
-
|
|
84
|
+
L(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load payout data"));
|
|
80
85
|
} finally {
|
|
81
|
-
|
|
86
|
+
F(!1);
|
|
82
87
|
}
|
|
83
88
|
}
|
|
84
|
-
}, [
|
|
85
|
-
if (
|
|
89
|
+
}, [j, Y]);
|
|
90
|
+
if (be(() => {
|
|
86
91
|
X();
|
|
87
|
-
}, [X]), !r.canManagePaymentMethods) return /* @__PURE__ */
|
|
88
|
-
if (
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
}, [X]), !r.canManagePaymentMethods) return /* @__PURE__ */ m(ee, { message: "You don't have permission to manage payout accounts." });
|
|
93
|
+
if (I && i(I)) {
|
|
94
|
+
let e = /* @__PURE__ */ m(ne, {
|
|
95
|
+
title: "Payout data unavailable",
|
|
96
|
+
message: g ? c(I, _) : I.message,
|
|
97
|
+
onRetry: () => void X(),
|
|
98
|
+
showRetry: !0
|
|
99
|
+
});
|
|
100
|
+
return g ? /* @__PURE__ */ h(p, { children: [e, /* @__PURE__ */ m("div", {
|
|
101
|
+
className: "px-6",
|
|
102
|
+
children: /* @__PURE__ */ m(f, {
|
|
103
|
+
copyable: !0,
|
|
104
|
+
children: l(I)
|
|
105
|
+
})
|
|
106
|
+
})] }) : e;
|
|
107
|
+
}
|
|
108
|
+
let Z = async (e) => {
|
|
109
|
+
if (!g) return e();
|
|
110
|
+
w(null);
|
|
111
|
+
try {
|
|
112
|
+
await e();
|
|
113
|
+
} catch (e) {
|
|
114
|
+
w(e);
|
|
115
|
+
}
|
|
116
|
+
}, Ue = async () => {
|
|
117
|
+
if (!j) return;
|
|
96
118
|
J(null);
|
|
97
119
|
let e = {
|
|
98
|
-
billingAccountId:
|
|
99
|
-
...
|
|
120
|
+
billingAccountId: j,
|
|
121
|
+
...R
|
|
100
122
|
};
|
|
101
|
-
if (
|
|
123
|
+
if (W) await me(W, e, Y), D("billing.payout_account.updated", {
|
|
102
124
|
route: "/billing/payouts",
|
|
103
|
-
entityId:
|
|
125
|
+
entityId: W,
|
|
104
126
|
source: "payouts"
|
|
105
127
|
});
|
|
106
128
|
else {
|
|
107
|
-
let t = await
|
|
108
|
-
|
|
129
|
+
let t = await ce(e, Y);
|
|
130
|
+
D("billing.payout_account.added", {
|
|
109
131
|
route: "/billing/payouts",
|
|
110
|
-
entityId:
|
|
132
|
+
entityId: j,
|
|
111
133
|
source: "payouts"
|
|
112
134
|
}), J(t.status === "ACTIVE" ? "Payout account saved and ready to receive payouts." : "Payout account saved. It stays pending until the payout processor verifies it; you can request payouts to it once it is verified.");
|
|
113
135
|
}
|
|
114
|
-
|
|
136
|
+
z({
|
|
115
137
|
label: "",
|
|
116
138
|
type: "BANK_ACCOUNT",
|
|
117
139
|
providerPreference: "AUTO",
|
|
@@ -123,17 +145,17 @@ var Ee = [
|
|
|
123
145
|
routingNumber: "",
|
|
124
146
|
ifsc: "",
|
|
125
147
|
upiId: ""
|
|
126
|
-
}),
|
|
127
|
-
},
|
|
128
|
-
J(null), await
|
|
129
|
-
},
|
|
130
|
-
J(null), await
|
|
148
|
+
}), G(null), await X();
|
|
149
|
+
}, We = async (e) => {
|
|
150
|
+
J(null), await pe(e, Y), await X();
|
|
151
|
+
}, Ge = async (e) => {
|
|
152
|
+
J(null), await le(e, Y), D("billing.payout_account.archived", {
|
|
131
153
|
route: "/billing/payouts",
|
|
132
154
|
entityId: e,
|
|
133
155
|
source: "payouts"
|
|
134
156
|
}), await X();
|
|
135
|
-
},
|
|
136
|
-
J(null),
|
|
157
|
+
}, Ke = (e) => {
|
|
158
|
+
J(null), G(e.id), z((t) => ({
|
|
137
159
|
...t,
|
|
138
160
|
label: e.label,
|
|
139
161
|
type: e.type,
|
|
@@ -147,156 +169,167 @@ var Ee = [
|
|
|
147
169
|
ifsc: "",
|
|
148
170
|
upiId: ""
|
|
149
171
|
}));
|
|
150
|
-
},
|
|
151
|
-
|
|
152
|
-
billingAccountId:
|
|
153
|
-
payoutAccountId:
|
|
154
|
-
amount: Number(
|
|
155
|
-
currency:
|
|
156
|
-
}, Y),
|
|
172
|
+
}, Q = M.find((e) => e.id === H), qe = M.some(a), $ = async () => {
|
|
173
|
+
j && H && B && Q && a(Q) && (await fe({
|
|
174
|
+
billingAccountId: j,
|
|
175
|
+
payoutAccountId: H,
|
|
176
|
+
amount: Number(B),
|
|
177
|
+
currency: Q.currency
|
|
178
|
+
}, Y), D("billing.payout.requested", {
|
|
157
179
|
route: "/billing/payouts",
|
|
158
|
-
entityId:
|
|
180
|
+
entityId: H,
|
|
159
181
|
source: "payouts",
|
|
160
|
-
amount: Number(
|
|
161
|
-
currency:
|
|
162
|
-
}),
|
|
163
|
-
},
|
|
164
|
-
|
|
182
|
+
amount: Number(B),
|
|
183
|
+
currency: Q.currency
|
|
184
|
+
}), V(""), await X());
|
|
185
|
+
}, Je = async () => {
|
|
186
|
+
y(!0), b(null), S(null);
|
|
165
187
|
try {
|
|
166
|
-
await $(),
|
|
188
|
+
await $(), v(!1), E({
|
|
167
189
|
ok: !0,
|
|
168
|
-
message: `Payout of ${n(Number(
|
|
190
|
+
message: `Payout of ${n(Number(B), Q?.currency ?? "")} requested. We'll show its status below.`
|
|
169
191
|
});
|
|
170
192
|
} catch (e) {
|
|
171
|
-
|
|
193
|
+
S(e), b(c(e, _));
|
|
172
194
|
} finally {
|
|
173
|
-
|
|
195
|
+
y(!1);
|
|
174
196
|
}
|
|
175
197
|
};
|
|
176
|
-
return /* @__PURE__ */
|
|
198
|
+
return /* @__PURE__ */ h("div", {
|
|
177
199
|
className: "space-y-6 p-6",
|
|
178
200
|
children: [
|
|
179
|
-
|
|
180
|
-
open:
|
|
201
|
+
g && /* @__PURE__ */ m(re, {
|
|
202
|
+
open: Ie,
|
|
181
203
|
title: "Review your payout",
|
|
182
204
|
description: "The amount is moved out of your available balance when you confirm.",
|
|
183
|
-
details: [
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
205
|
+
details: [
|
|
206
|
+
{
|
|
207
|
+
label: "Amount",
|
|
208
|
+
value: n(Number(B), Q?.currency ?? "")
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
label: "Paid to",
|
|
212
|
+
value: Q ? `${Q.label} · ${Q.currency}` : ""
|
|
213
|
+
},
|
|
214
|
+
...x && l(x) ? [{
|
|
215
|
+
label: _("billing.payoutError.technical", "Technical details"),
|
|
216
|
+
value: /* @__PURE__ */ m(f, {
|
|
217
|
+
copyable: !0,
|
|
218
|
+
children: l(x)
|
|
219
|
+
})
|
|
220
|
+
}] : []
|
|
221
|
+
],
|
|
190
222
|
confirmLabel: "Request payout",
|
|
191
223
|
busyLabel: "Requesting…",
|
|
192
|
-
isBusy:
|
|
193
|
-
error:
|
|
194
|
-
onConfirm: () => void
|
|
195
|
-
onCancel: () =>
|
|
224
|
+
isBusy: Le,
|
|
225
|
+
error: Re,
|
|
226
|
+
onConfirm: () => void Je(),
|
|
227
|
+
onCancel: () => v(!1)
|
|
196
228
|
}),
|
|
197
|
-
|
|
198
|
-
role:
|
|
199
|
-
className: `rounded-md border p-3 text-sm ${
|
|
200
|
-
children:
|
|
229
|
+
g && T && /* @__PURE__ */ m("div", {
|
|
230
|
+
role: T.ok ? "status" : "alert",
|
|
231
|
+
className: `rounded-md border p-3 text-sm ${T.ok ? "border-status-success-border text-status-success-text" : "border-status-error-border text-status-error-text"}`,
|
|
232
|
+
children: T.message
|
|
201
233
|
}),
|
|
202
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ m(te, {
|
|
203
235
|
title: "Payouts",
|
|
204
236
|
description: "Register payout accounts, request withdrawals, and track disbursement status."
|
|
205
237
|
}),
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
-
q ? /* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ m(Ae, { children: "Get your earnings paid out to a real bank account or UPI. Register where you want to be paid, request a withdrawal of your available balance, and track each request from submission through to disbursement here." }),
|
|
239
|
+
q ? /* @__PURE__ */ m("div", {
|
|
208
240
|
role: "status",
|
|
209
241
|
className: "rounded-lg border border-border-subtle bg-status-info-bg-subtle p-4 text-sm text-status-info-text",
|
|
210
242
|
children: q
|
|
211
243
|
}) : null,
|
|
212
|
-
|
|
244
|
+
I && !i(I) ? g ? /* @__PURE__ */ m(s, { error: I }) : /* @__PURE__ */ m("div", {
|
|
213
245
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 text-sm text-status-error-text",
|
|
214
|
-
children:
|
|
246
|
+
children: I.message
|
|
215
247
|
}) : null,
|
|
216
|
-
/* @__PURE__ */
|
|
248
|
+
g && C ? /* @__PURE__ */ m(s, { error: C }) : null,
|
|
249
|
+
/* @__PURE__ */ h("div", {
|
|
217
250
|
className: "grid gap-6 xl:grid-cols-[1.05fr,1.95fr]",
|
|
218
|
-
children: [/* @__PURE__ */
|
|
251
|
+
children: [/* @__PURE__ */ h("section", {
|
|
219
252
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
220
253
|
children: [
|
|
221
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ m("h2", {
|
|
222
255
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
223
|
-
children:
|
|
256
|
+
children: W ? "Edit payout account" : "Add payout account"
|
|
224
257
|
}),
|
|
225
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ h("div", {
|
|
226
259
|
className: "space-y-3",
|
|
227
260
|
children: [
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
value:
|
|
230
|
-
onChange: (e) =>
|
|
261
|
+
/* @__PURE__ */ m("input", {
|
|
262
|
+
value: R.label,
|
|
263
|
+
onChange: (e) => z((t) => ({
|
|
231
264
|
...t,
|
|
232
265
|
label: e.target.value
|
|
233
266
|
})),
|
|
234
267
|
placeholder: "Label",
|
|
235
268
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
236
269
|
}),
|
|
237
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ h("div", {
|
|
238
271
|
className: "grid gap-3 md:grid-cols-2",
|
|
239
|
-
children: [/* @__PURE__ */
|
|
240
|
-
value:
|
|
241
|
-
onChange: (e) =>
|
|
272
|
+
children: [/* @__PURE__ */ h("select", {
|
|
273
|
+
value: R.type,
|
|
274
|
+
onChange: (e) => z((t) => ({
|
|
242
275
|
...t,
|
|
243
276
|
type: e.target.value
|
|
244
277
|
})),
|
|
245
278
|
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",
|
|
246
279
|
children: [
|
|
247
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ m("option", {
|
|
248
281
|
value: "BANK_ACCOUNT",
|
|
249
282
|
children: "Bank account"
|
|
250
283
|
}),
|
|
251
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ m("option", {
|
|
252
285
|
value: "UPI",
|
|
253
286
|
children: "UPI"
|
|
254
287
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ m("option", {
|
|
256
289
|
value: "WALLET",
|
|
257
290
|
children: "Wallet"
|
|
258
291
|
})
|
|
259
292
|
]
|
|
260
|
-
}), /* @__PURE__ */
|
|
261
|
-
value:
|
|
262
|
-
onChange: (e) =>
|
|
293
|
+
}), /* @__PURE__ */ h("select", {
|
|
294
|
+
value: R.providerPreference,
|
|
295
|
+
onChange: (e) => z((t) => ({
|
|
263
296
|
...t,
|
|
264
297
|
providerPreference: e.target.value
|
|
265
298
|
})),
|
|
266
299
|
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",
|
|
267
300
|
children: [
|
|
268
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ m("option", {
|
|
269
302
|
value: "AUTO",
|
|
270
303
|
children: "Auto"
|
|
271
304
|
}),
|
|
272
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ m("option", {
|
|
273
306
|
value: "STRIPE",
|
|
274
307
|
children: "Stripe"
|
|
275
308
|
}),
|
|
276
|
-
/* @__PURE__ */
|
|
309
|
+
/* @__PURE__ */ m("option", {
|
|
277
310
|
value: "RAZORPAY",
|
|
278
311
|
children: "Razorpay"
|
|
279
312
|
}),
|
|
280
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ m("option", {
|
|
281
314
|
value: "MANUAL",
|
|
282
315
|
children: "Manual"
|
|
283
316
|
})
|
|
284
317
|
]
|
|
285
318
|
})]
|
|
286
319
|
}),
|
|
287
|
-
/* @__PURE__ */
|
|
320
|
+
/* @__PURE__ */ h("div", {
|
|
288
321
|
className: "grid gap-3 md:grid-cols-2",
|
|
289
|
-
children: [/* @__PURE__ */
|
|
290
|
-
value:
|
|
291
|
-
onChange: (e) =>
|
|
322
|
+
children: [/* @__PURE__ */ m("input", {
|
|
323
|
+
value: R.country,
|
|
324
|
+
onChange: (e) => z((t) => ({
|
|
292
325
|
...t,
|
|
293
326
|
country: e.target.value.toUpperCase()
|
|
294
327
|
})),
|
|
295
328
|
placeholder: "Country",
|
|
296
329
|
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
297
|
-
}), /* @__PURE__ */
|
|
298
|
-
value:
|
|
299
|
-
onChange: (e) =>
|
|
330
|
+
}), /* @__PURE__ */ m("input", {
|
|
331
|
+
value: R.currency,
|
|
332
|
+
onChange: (e) => z((t) => ({
|
|
300
333
|
...t,
|
|
301
334
|
currency: e.target.value.toUpperCase()
|
|
302
335
|
})),
|
|
@@ -304,49 +337,49 @@ var Ee = [
|
|
|
304
337
|
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
305
338
|
})]
|
|
306
339
|
}),
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
value:
|
|
309
|
-
onChange: (e) =>
|
|
340
|
+
/* @__PURE__ */ m("input", {
|
|
341
|
+
value: R.accountHolderName,
|
|
342
|
+
onChange: (e) => z((t) => ({
|
|
310
343
|
...t,
|
|
311
344
|
accountHolderName: e.target.value
|
|
312
345
|
})),
|
|
313
346
|
placeholder: "Account holder name",
|
|
314
347
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
315
348
|
}),
|
|
316
|
-
|
|
317
|
-
/* @__PURE__ */
|
|
318
|
-
value:
|
|
319
|
-
onChange: (e) =>
|
|
349
|
+
R.type === "BANK_ACCOUNT" ? /* @__PURE__ */ h(p, { children: [
|
|
350
|
+
/* @__PURE__ */ m("input", {
|
|
351
|
+
value: R.bankName,
|
|
352
|
+
onChange: (e) => z((t) => ({
|
|
320
353
|
...t,
|
|
321
354
|
bankName: e.target.value
|
|
322
355
|
})),
|
|
323
356
|
placeholder: "Bank name",
|
|
324
357
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
325
358
|
}),
|
|
326
|
-
/* @__PURE__ */
|
|
327
|
-
value:
|
|
328
|
-
onChange: (e) =>
|
|
359
|
+
/* @__PURE__ */ m("input", {
|
|
360
|
+
value: R.accountNumber,
|
|
361
|
+
onChange: (e) => z((t) => ({
|
|
329
362
|
...t,
|
|
330
363
|
accountNumber: e.target.value
|
|
331
364
|
})),
|
|
332
365
|
placeholder: "Account number",
|
|
333
366
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
334
367
|
}),
|
|
335
|
-
/* @__PURE__ */
|
|
336
|
-
value:
|
|
337
|
-
onChange: (e) =>
|
|
368
|
+
/* @__PURE__ */ m("input", {
|
|
369
|
+
value: R.country === "IN" ? R.ifsc : R.routingNumber,
|
|
370
|
+
onChange: (e) => z((t) => t.country === "IN" ? {
|
|
338
371
|
...t,
|
|
339
372
|
ifsc: e.target.value
|
|
340
373
|
} : {
|
|
341
374
|
...t,
|
|
342
375
|
routingNumber: e.target.value
|
|
343
376
|
}),
|
|
344
|
-
placeholder:
|
|
377
|
+
placeholder: R.country === "IN" ? "IFSC" : "Routing number",
|
|
345
378
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
346
379
|
})
|
|
347
|
-
] }) :
|
|
348
|
-
value:
|
|
349
|
-
onChange: (e) =>
|
|
380
|
+
] }) : R.type === "UPI" ? /* @__PURE__ */ m("input", {
|
|
381
|
+
value: R.upiId,
|
|
382
|
+
onChange: (e) => z((t) => ({
|
|
350
383
|
...t,
|
|
351
384
|
upiId: e.target.value
|
|
352
385
|
})),
|
|
@@ -355,16 +388,16 @@ var Ee = [
|
|
|
355
388
|
}) : null
|
|
356
389
|
]
|
|
357
390
|
}),
|
|
358
|
-
/* @__PURE__ */
|
|
391
|
+
/* @__PURE__ */ h("button", {
|
|
359
392
|
type: "button",
|
|
360
|
-
onClick: () => void
|
|
393
|
+
onClick: () => void Z(Ue),
|
|
361
394
|
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",
|
|
362
|
-
children: [/* @__PURE__ */
|
|
395
|
+
children: [/* @__PURE__ */ m(Me, { className: "size-4" }), W ? "Update payout account" : "Save payout account"]
|
|
363
396
|
}),
|
|
364
|
-
|
|
397
|
+
W ? /* @__PURE__ */ m("button", {
|
|
365
398
|
type: "button",
|
|
366
399
|
onClick: () => {
|
|
367
|
-
|
|
400
|
+
G(null), z({
|
|
368
401
|
label: "",
|
|
369
402
|
type: "BANK_ACCOUNT",
|
|
370
403
|
providerPreference: "AUTO",
|
|
@@ -382,98 +415,123 @@ var Ee = [
|
|
|
382
415
|
children: "Cancel edit"
|
|
383
416
|
}) : null
|
|
384
417
|
]
|
|
385
|
-
}), /* @__PURE__ */
|
|
418
|
+
}), /* @__PURE__ */ h("section", {
|
|
386
419
|
className: "space-y-4",
|
|
387
|
-
children: [/* @__PURE__ */
|
|
420
|
+
children: [/* @__PURE__ */ h("div", {
|
|
388
421
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
389
422
|
children: [
|
|
390
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ h("div", {
|
|
391
424
|
className: "mb-4 flex items-center justify-between",
|
|
392
|
-
children: [/* @__PURE__ */
|
|
425
|
+
children: [/* @__PURE__ */ m("h2", {
|
|
393
426
|
className: "text-lg font-semibold text-text-primary",
|
|
394
427
|
children: "Request payout"
|
|
395
|
-
}), /* @__PURE__ */
|
|
428
|
+
}), /* @__PURE__ */ h("button", {
|
|
396
429
|
type: "button",
|
|
397
430
|
onClick: () => void X(),
|
|
398
431
|
className: "inline-flex items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary",
|
|
399
|
-
children: [/* @__PURE__ */
|
|
432
|
+
children: [/* @__PURE__ */ m(Ne, { className: "size-4" }), "Refresh"]
|
|
400
433
|
})]
|
|
401
434
|
}),
|
|
402
|
-
|
|
435
|
+
M.length === 0 && !P ? /* @__PURE__ */ m(d, {
|
|
403
436
|
illustration: "empty-generic",
|
|
404
437
|
title: "No payout accounts yet",
|
|
405
438
|
description: "Add a payout account before requesting a withdrawal."
|
|
406
|
-
}) : /* @__PURE__ */
|
|
439
|
+
}) : /* @__PURE__ */ h("div", {
|
|
407
440
|
className: "space-y-3",
|
|
408
441
|
children: [
|
|
409
|
-
/* @__PURE__ */
|
|
410
|
-
value:
|
|
411
|
-
onChange: (e) =>
|
|
442
|
+
/* @__PURE__ */ h("select", {
|
|
443
|
+
value: H,
|
|
444
|
+
onChange: (e) => U(e.target.value),
|
|
412
445
|
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",
|
|
413
|
-
children: [
|
|
446
|
+
children: [qe ? null : /* @__PURE__ */ m("option", {
|
|
414
447
|
value: "",
|
|
415
448
|
children: "No verified payout account yet"
|
|
416
|
-
}),
|
|
449
|
+
}), M.map((e) => /* @__PURE__ */ h("option", {
|
|
417
450
|
value: e.id,
|
|
418
|
-
disabled: !
|
|
451
|
+
disabled: !a(e),
|
|
419
452
|
children: [
|
|
420
453
|
e.label,
|
|
421
454
|
" · ",
|
|
422
455
|
e.currency,
|
|
423
456
|
" ·",
|
|
424
457
|
" ",
|
|
425
|
-
|
|
458
|
+
o(e.status).label
|
|
426
459
|
]
|
|
427
460
|
}, e.id))]
|
|
428
461
|
}),
|
|
429
|
-
|
|
462
|
+
qe ? null : /* @__PURE__ */ m("p", {
|
|
430
463
|
className: "text-sm text-text-secondary",
|
|
431
464
|
children: "Payouts can be requested once one of your payout accounts is verified."
|
|
432
465
|
}),
|
|
433
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ h("label", {
|
|
434
467
|
className: "block space-y-1 text-sm font-medium text-text-primary",
|
|
435
|
-
children: [/* @__PURE__ */
|
|
436
|
-
value:
|
|
437
|
-
onChange: (e) =>
|
|
468
|
+
children: [/* @__PURE__ */ m("span", { children: "Amount" }), /* @__PURE__ */ m("input", {
|
|
469
|
+
value: B,
|
|
470
|
+
onChange: (e) => V(e.target.value),
|
|
438
471
|
inputMode: "decimal",
|
|
439
472
|
placeholder: "0.00",
|
|
440
473
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-normal text-text-primary"
|
|
441
474
|
})]
|
|
442
475
|
}),
|
|
443
|
-
/* @__PURE__ */
|
|
476
|
+
/* @__PURE__ */ h("button", {
|
|
444
477
|
type: "button",
|
|
445
478
|
onClick: () => {
|
|
446
|
-
|
|
479
|
+
g ? (b(null), S(null), E(null), v(!0)) : $();
|
|
447
480
|
},
|
|
448
|
-
disabled: !
|
|
481
|
+
disabled: !Q || !a(Q),
|
|
449
482
|
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",
|
|
450
|
-
children: [/* @__PURE__ */
|
|
483
|
+
children: [/* @__PURE__ */ m(Pe, { className: "size-4" }), "Request payout"]
|
|
451
484
|
})
|
|
452
485
|
]
|
|
453
486
|
}),
|
|
454
|
-
|
|
487
|
+
M.length > 0 ? /* @__PURE__ */ h("div", {
|
|
455
488
|
className: "mt-4 space-y-3 rounded-md border border-border-subtle bg-bg-surface/60 p-3",
|
|
456
|
-
children: [/* @__PURE__ */
|
|
489
|
+
children: [/* @__PURE__ */ m("h3", {
|
|
457
490
|
className: "text-sm font-semibold text-text-primary",
|
|
458
491
|
children: "Saved payout accounts"
|
|
459
|
-
}),
|
|
460
|
-
|
|
461
|
-
|
|
492
|
+
}), g ? /* @__PURE__ */ m(_e, {
|
|
493
|
+
destinations: ve(M),
|
|
494
|
+
renderActions: (e) => {
|
|
495
|
+
let t = M.find((t) => t.id === e.id);
|
|
496
|
+
return t ? /* @__PURE__ */ h(p, { children: [
|
|
497
|
+
/* @__PURE__ */ m("button", {
|
|
498
|
+
type: "button",
|
|
499
|
+
onClick: () => Ke(t),
|
|
500
|
+
className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary",
|
|
501
|
+
children: _("billing.payouts.edit", "Edit")
|
|
502
|
+
}),
|
|
503
|
+
t.isDefault ? null : /* @__PURE__ */ m("button", {
|
|
504
|
+
type: "button",
|
|
505
|
+
onClick: () => void Z(() => We(t.id)),
|
|
506
|
+
className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary",
|
|
507
|
+
children: _("billing.payouts.makeDefault", "Make default")
|
|
508
|
+
}),
|
|
509
|
+
/* @__PURE__ */ m("button", {
|
|
510
|
+
type: "button",
|
|
511
|
+
onClick: () => K(t.id),
|
|
512
|
+
className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text",
|
|
513
|
+
children: _("billing.payouts.archive", "Archive")
|
|
514
|
+
})
|
|
515
|
+
] }) : null;
|
|
516
|
+
}
|
|
517
|
+
}) : /* @__PURE__ */ m(p, { children: M.map((e) => {
|
|
518
|
+
let t = o(e.status);
|
|
519
|
+
return /* @__PURE__ */ h("div", {
|
|
462
520
|
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",
|
|
463
|
-
children: [/* @__PURE__ */
|
|
464
|
-
/* @__PURE__ */
|
|
521
|
+
children: [/* @__PURE__ */ h("div", { children: [
|
|
522
|
+
/* @__PURE__ */ h("p", {
|
|
465
523
|
className: "flex flex-wrap items-center gap-2 font-medium text-text-primary",
|
|
466
524
|
children: [
|
|
467
525
|
e.label,
|
|
468
526
|
" ",
|
|
469
527
|
e.isDefault ? "• Default" : "",
|
|
470
|
-
/* @__PURE__ */
|
|
471
|
-
className: `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${
|
|
528
|
+
/* @__PURE__ */ m("span", {
|
|
529
|
+
className: `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${he[t.tone]}`,
|
|
472
530
|
children: t.label
|
|
473
531
|
})
|
|
474
532
|
]
|
|
475
533
|
}),
|
|
476
|
-
/* @__PURE__ */
|
|
534
|
+
/* @__PURE__ */ h("p", {
|
|
477
535
|
className: "text-text-secondary",
|
|
478
536
|
children: [
|
|
479
537
|
e.providerPreference,
|
|
@@ -481,26 +539,26 @@ var Ee = [
|
|
|
481
539
|
e.currency
|
|
482
540
|
]
|
|
483
541
|
}),
|
|
484
|
-
t.hint ? /* @__PURE__ */
|
|
542
|
+
t.hint ? /* @__PURE__ */ m("p", {
|
|
485
543
|
className: "mt-1 text-xs text-text-secondary",
|
|
486
544
|
children: t.hint
|
|
487
545
|
}) : null
|
|
488
|
-
] }), /* @__PURE__ */
|
|
546
|
+
] }), /* @__PURE__ */ h("div", {
|
|
489
547
|
className: "flex flex-wrap gap-2",
|
|
490
548
|
children: [
|
|
491
|
-
/* @__PURE__ */
|
|
549
|
+
/* @__PURE__ */ m("button", {
|
|
492
550
|
type: "button",
|
|
493
|
-
onClick: () =>
|
|
551
|
+
onClick: () => Ke(e),
|
|
494
552
|
className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary",
|
|
495
553
|
children: "Edit"
|
|
496
554
|
}),
|
|
497
|
-
e.isDefault ? null : /* @__PURE__ */
|
|
555
|
+
e.isDefault ? null : /* @__PURE__ */ m("button", {
|
|
498
556
|
type: "button",
|
|
499
|
-
onClick: () => void
|
|
557
|
+
onClick: () => void Z(() => We(e.id)),
|
|
500
558
|
className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary",
|
|
501
559
|
children: "Make default"
|
|
502
560
|
}),
|
|
503
|
-
/* @__PURE__ */
|
|
561
|
+
/* @__PURE__ */ m("button", {
|
|
504
562
|
type: "button",
|
|
505
563
|
onClick: () => K(e.id),
|
|
506
564
|
className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text",
|
|
@@ -509,35 +567,35 @@ var Ee = [
|
|
|
509
567
|
]
|
|
510
568
|
})]
|
|
511
569
|
}, e.id);
|
|
512
|
-
})]
|
|
570
|
+
}) })]
|
|
513
571
|
}) : null
|
|
514
572
|
]
|
|
515
|
-
}), /* @__PURE__ */
|
|
573
|
+
}), /* @__PURE__ */ h("div", {
|
|
516
574
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
517
|
-
children: [/* @__PURE__ */
|
|
575
|
+
children: [/* @__PURE__ */ m("h2", {
|
|
518
576
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
519
577
|
children: "Payout requests"
|
|
520
|
-
}),
|
|
578
|
+
}), N.length === 0 && !P ? /* @__PURE__ */ m(d, {
|
|
521
579
|
illustration: "empty-data",
|
|
522
580
|
title: "No payout requests yet",
|
|
523
581
|
description: "Your payout requests and processing updates will appear here."
|
|
524
|
-
}) : /* @__PURE__ */
|
|
525
|
-
data:
|
|
582
|
+
}) : /* @__PURE__ */ m(je, {
|
|
583
|
+
data: N,
|
|
526
584
|
rowKey: (e) => e.id,
|
|
527
|
-
columns:
|
|
585
|
+
columns: Fe
|
|
528
586
|
})]
|
|
529
587
|
})]
|
|
530
588
|
})]
|
|
531
589
|
}),
|
|
532
|
-
/* @__PURE__ */
|
|
533
|
-
open:
|
|
590
|
+
/* @__PURE__ */ m(Se, {
|
|
591
|
+
open: He !== null,
|
|
534
592
|
onOpenChange: (e) => {
|
|
535
593
|
e || K(null);
|
|
536
594
|
},
|
|
537
|
-
children: /* @__PURE__ */
|
|
595
|
+
children: /* @__PURE__ */ h(Te, { children: [/* @__PURE__ */ h(Oe, { children: [/* @__PURE__ */ m(ke, { children: "Archive payout account?" }), /* @__PURE__ */ m(Ee, { children: "Archive this payout account? You can add a new one at any time." })] }), /* @__PURE__ */ h(De, { children: [/* @__PURE__ */ m(we, { children: "Cancel" }), /* @__PURE__ */ m(Ce, {
|
|
538
596
|
onClick: () => {
|
|
539
|
-
let e =
|
|
540
|
-
K(null), e &&
|
|
597
|
+
let e = He;
|
|
598
|
+
K(null), e && Z(() => Ge(e));
|
|
541
599
|
},
|
|
542
600
|
children: "Archive"
|
|
543
601
|
})] })] })
|
|
@@ -545,6 +603,6 @@ var Ee = [
|
|
|
545
603
|
]
|
|
546
604
|
});
|
|
547
605
|
};
|
|
548
|
-
export {
|
|
606
|
+
export { g as PayoutsPage };
|
|
549
607
|
|
|
550
608
|
//# sourceMappingURL=PayoutsPage.js.map
|