@burdenoff/microfe-billing 2026.913.1 → 2026.914.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/BillingAdminRoutes.js +84 -71
- package/dist/billing/BillingAdminRoutes.js.map +1 -1
- package/dist/billing/modules/billing/hooks/useRefunds.js.map +1 -1
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +90 -87
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js +97 -58
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js.map +1 -1
- package/dist/billing/modules/checkout/components/OrderSummary.js +22 -19
- package/dist/billing/modules/checkout/components/OrderSummary.js.map +1 -1
- package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js.map +1 -1
- package/dist/billing/modules/checkout/hooks/useCheckout.js +174 -157
- package/dist/billing/modules/checkout/hooks/useCheckout.js.map +1 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.js +189 -182
- package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +293 -274
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js +140 -250
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js.map +1 -1
- package/dist/billing/modules/earnings/api.js +79 -42
- package/dist/billing/modules/earnings/api.js.map +1 -1
- package/dist/billing/modules/earnings/index.js +4 -3
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +103 -310
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +545 -0
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -0
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +246 -196
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js +44 -28
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +317 -270
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +153 -150
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +1 -1
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
- package/dist/billing/modules/usage/hooks/useUsage.js +74 -48
- package/dist/billing/modules/usage/hooks/useUsage.js.map +1 -1
- package/dist/generated/global-operations.js +220 -183
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.js.map +1 -1
- package/dist/node_modules/sonner/dist/index.js +163 -0
- package/dist/node_modules/sonner/dist/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -3,18 +3,19 @@ import { AccessDenied as t } from "../../../shared/components/AccessDenied.js";
|
|
|
3
3
|
import { PageHeader as n } from "../../../shared/components/PageHeader.js";
|
|
4
4
|
import { ServerError as r } from "../../../shared/components/ServerError.js";
|
|
5
5
|
import "../../../shared/components/index.js";
|
|
6
|
-
import { formatCurrency as i
|
|
7
|
-
import { isServerError as
|
|
6
|
+
import { formatCurrency as i } from "../../../shared/utils/format.js";
|
|
7
|
+
import { isServerError as a } from "../../../shared/utils/error.js";
|
|
8
8
|
import "../../../shared/utils/index.js";
|
|
9
|
-
import { useBillingPermissions as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
9
|
+
import { useBillingPermissions as o } from "../../../hooks/useBillingPermissions.js";
|
|
10
|
+
import { useBillingNavigate as s } from "../../../hooks/useBillingNavigate.js";
|
|
11
|
+
import { fetchAdminDeveloperRevenueOrgs as c } from "../api.js";
|
|
12
|
+
import { useCallback as l, useEffect as u, useMemo as d, useState as f } from "react";
|
|
13
|
+
import { Building2 as p, DollarSign as m, Loader2 as h, Receipt as g, Search as _, Wallet as v } from "lucide-react";
|
|
14
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
15
|
+
import { PagePurpose as S } from "@burdenoff/fe-libs/ui";
|
|
15
16
|
//#region src/billing/modules/earnings/pages/DeveloperRevenueAdminPage.tsx
|
|
16
|
-
function
|
|
17
|
-
let t =
|
|
17
|
+
function C({ orgs: e }) {
|
|
18
|
+
let t = d(() => e.reduce((e, t) => ({
|
|
18
19
|
totalRevenue: e.totalRevenue + t.totalRevenue,
|
|
19
20
|
totalPlatformFees: e.totalPlatformFees + t.totalPlatformFees,
|
|
20
21
|
pendingBalance: e.pendingBalance + t.pendingBalance,
|
|
@@ -25,380 +26,194 @@ function j({ orgs: e }) {
|
|
|
25
26
|
pendingBalance: 0,
|
|
26
27
|
totalPayouts: 0
|
|
27
28
|
}), [e]);
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ x("div", {
|
|
29
30
|
className: "grid gap-3 md:grid-cols-2 xl:grid-cols-4",
|
|
30
31
|
children: [
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ x("div", {
|
|
32
33
|
className: "rounded-card border border-border-seam bg-bg-surface p-4 shadow-[var(--shadow-elevation-1)]",
|
|
33
|
-
children: [/* @__PURE__ */
|
|
34
|
+
children: [/* @__PURE__ */ b("div", {
|
|
34
35
|
className: "text-xs uppercase tracking-wide text-text-muted",
|
|
35
36
|
children: "Gross revenue"
|
|
36
|
-
}), /* @__PURE__ */
|
|
37
|
+
}), /* @__PURE__ */ x("div", {
|
|
37
38
|
className: "mt-1 flex items-center gap-2 text-lg font-semibold text-text-primary",
|
|
38
|
-
children: [/* @__PURE__ */
|
|
39
|
+
children: [/* @__PURE__ */ b(m, { className: "size-4 text-text-muted" }), i(t.totalRevenue, "USD")]
|
|
39
40
|
})]
|
|
40
41
|
}),
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ x("div", {
|
|
42
43
|
className: "rounded-card border border-border-seam bg-bg-surface p-4 shadow-[var(--shadow-elevation-1)]",
|
|
43
|
-
children: [/* @__PURE__ */
|
|
44
|
+
children: [/* @__PURE__ */ b("div", {
|
|
44
45
|
className: "text-xs uppercase tracking-wide text-text-muted",
|
|
45
46
|
children: "Platform fees"
|
|
46
|
-
}), /* @__PURE__ */
|
|
47
|
+
}), /* @__PURE__ */ x("div", {
|
|
47
48
|
className: "mt-1 flex items-center gap-2 text-lg font-semibold text-text-primary",
|
|
48
|
-
children: [/* @__PURE__ */
|
|
49
|
+
children: [/* @__PURE__ */ b(g, { className: "size-4 text-text-muted" }), i(t.totalPlatformFees, "USD")]
|
|
49
50
|
})]
|
|
50
51
|
}),
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ x("div", {
|
|
52
53
|
className: "rounded-card border border-border-seam bg-bg-surface p-4 shadow-[var(--shadow-elevation-1)]",
|
|
53
|
-
children: [/* @__PURE__ */
|
|
54
|
+
children: [/* @__PURE__ */ b("div", {
|
|
54
55
|
className: "text-xs uppercase tracking-wide text-text-muted",
|
|
55
56
|
children: "Pending earned credits"
|
|
56
|
-
}), /* @__PURE__ */
|
|
57
|
+
}), /* @__PURE__ */ x("div", {
|
|
57
58
|
className: "mt-1 flex items-center gap-2 text-lg font-semibold text-text-primary",
|
|
58
|
-
children: [/* @__PURE__ */
|
|
59
|
+
children: [/* @__PURE__ */ b(v, { className: "size-4 text-text-muted" }), i(t.pendingBalance, "USD")]
|
|
59
60
|
})]
|
|
60
61
|
}),
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ x("div", {
|
|
62
63
|
className: "rounded-card border border-border-seam bg-bg-surface p-4 shadow-[var(--shadow-elevation-1)]",
|
|
63
|
-
children: [/* @__PURE__ */
|
|
64
|
+
children: [/* @__PURE__ */ b("div", {
|
|
64
65
|
className: "text-xs uppercase tracking-wide text-text-muted",
|
|
65
66
|
children: "Already withdrawn"
|
|
66
|
-
}), /* @__PURE__ */
|
|
67
|
+
}), /* @__PURE__ */ x("div", {
|
|
67
68
|
className: "mt-1 flex items-center gap-2 text-lg font-semibold text-text-primary",
|
|
68
|
-
children: [/* @__PURE__ */
|
|
69
|
+
children: [/* @__PURE__ */ b(p, { className: "size-4 text-text-muted" }), i(t.totalPayouts, "USD")]
|
|
69
70
|
})]
|
|
70
71
|
})
|
|
71
72
|
]
|
|
72
73
|
});
|
|
73
74
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
onOpenChange: (e) => !e && c(),
|
|
78
|
-
children: /* @__PURE__ */ C(E, {
|
|
79
|
-
className: "sm:max-w-4xl",
|
|
80
|
-
children: [
|
|
81
|
-
/* @__PURE__ */ C(k, { children: [/* @__PURE__ */ S(A, { children: e ? `${e.name} revenue details` : "Revenue details" }), /* @__PURE__ */ S(D, { children: "Store revenue is credited into the linked billing account as earned credits. Developers withdraw those credits later through the billing withdrawal flow." })] }),
|
|
82
|
-
n ? /* @__PURE__ */ S("div", {
|
|
83
|
-
className: "flex items-center justify-center py-14 text-text-secondary",
|
|
84
|
-
children: /* @__PURE__ */ S(v, { className: "size-7 animate-spin" })
|
|
85
|
-
}) : r ? /* @__PURE__ */ S("div", {
|
|
86
|
-
className: "rounded-lg border border-status-error-border bg-status-error-bg-subtle p-4 text-sm text-status-error-text",
|
|
87
|
-
children: r.message
|
|
88
|
-
}) : t && e ? /* @__PURE__ */ C("div", {
|
|
89
|
-
className: "space-y-5",
|
|
90
|
-
children: [
|
|
91
|
-
/* @__PURE__ */ C("div", {
|
|
92
|
-
className: "grid gap-3 md:grid-cols-4",
|
|
93
|
-
children: [
|
|
94
|
-
/* @__PURE__ */ C("div", {
|
|
95
|
-
className: "rounded-card border border-border-seam bg-bg-surface p-4",
|
|
96
|
-
children: [
|
|
97
|
-
/* @__PURE__ */ S("div", {
|
|
98
|
-
className: "text-xs uppercase tracking-wide text-text-muted",
|
|
99
|
-
children: "Linked billing account"
|
|
100
|
-
}),
|
|
101
|
-
/* @__PURE__ */ S("div", {
|
|
102
|
-
className: "mt-1 text-sm font-semibold text-text-primary",
|
|
103
|
-
children: e.billingAccountId ? "Connected" : "Not linked"
|
|
104
|
-
}),
|
|
105
|
-
/* @__PURE__ */ S("div", {
|
|
106
|
-
className: "mt-1 break-all text-xs text-text-muted",
|
|
107
|
-
children: e.billingAccountId ?? "Revenue cannot be credited until a billing account is linked."
|
|
108
|
-
})
|
|
109
|
-
]
|
|
110
|
-
}),
|
|
111
|
-
/* @__PURE__ */ C("div", {
|
|
112
|
-
className: "rounded-card border border-border-seam bg-bg-surface p-4",
|
|
113
|
-
children: [/* @__PURE__ */ S("div", {
|
|
114
|
-
className: "text-xs uppercase tracking-wide text-text-muted",
|
|
115
|
-
children: "Earned credits awaiting withdrawal"
|
|
116
|
-
}), /* @__PURE__ */ S("div", {
|
|
117
|
-
className: "mt-1 text-lg font-semibold text-text-primary",
|
|
118
|
-
children: i(t.summary?.pendingBalance ?? e.pendingBalance, "USD")
|
|
119
|
-
})]
|
|
120
|
-
}),
|
|
121
|
-
/* @__PURE__ */ C("div", {
|
|
122
|
-
className: "rounded-card border border-border-seam bg-bg-surface p-4",
|
|
123
|
-
children: [/* @__PURE__ */ S("div", {
|
|
124
|
-
className: "text-xs uppercase tracking-wide text-text-muted",
|
|
125
|
-
children: "Unpaid sales"
|
|
126
|
-
}), /* @__PURE__ */ S("div", {
|
|
127
|
-
className: "mt-1 text-lg font-semibold text-text-primary",
|
|
128
|
-
children: t.unpaidSales.totalCount
|
|
129
|
-
})]
|
|
130
|
-
}),
|
|
131
|
-
/* @__PURE__ */ C("div", {
|
|
132
|
-
className: "rounded-card border border-border-seam bg-bg-surface p-4",
|
|
133
|
-
children: [/* @__PURE__ */ S("div", {
|
|
134
|
-
className: "text-xs uppercase tracking-wide text-text-muted",
|
|
135
|
-
children: "Total sales"
|
|
136
|
-
}), /* @__PURE__ */ S("div", {
|
|
137
|
-
className: "mt-1 text-lg font-semibold text-text-primary",
|
|
138
|
-
children: t.summary?.totalSales ?? 0
|
|
139
|
-
})]
|
|
140
|
-
})
|
|
141
|
-
]
|
|
142
|
-
}),
|
|
143
|
-
/* @__PURE__ */ S("div", {
|
|
144
|
-
className: "rounded-card border border-border-seam bg-bg-surface p-4",
|
|
145
|
-
children: /* @__PURE__ */ C("div", {
|
|
146
|
-
className: "flex items-start gap-3",
|
|
147
|
-
children: [/* @__PURE__ */ S(g, { className: "mt-0.5 size-5 text-text-muted" }), /* @__PURE__ */ C("div", {
|
|
148
|
-
className: "space-y-1 text-sm",
|
|
149
|
-
children: [
|
|
150
|
-
/* @__PURE__ */ S("p", {
|
|
151
|
-
className: "font-medium text-text-primary",
|
|
152
|
-
children: "Correct payout model"
|
|
153
|
-
}),
|
|
154
|
-
/* @__PURE__ */ C("p", {
|
|
155
|
-
className: "text-text-muted",
|
|
156
|
-
children: [
|
|
157
|
-
"Revenue from Store sales is posted into the developer organization's linked billing account as ",
|
|
158
|
-
/* @__PURE__ */ S("strong", { children: "earned credits" }),
|
|
159
|
-
". We do not directly send cash to developer-org payment methods from this page."
|
|
160
|
-
]
|
|
161
|
-
}),
|
|
162
|
-
/* @__PURE__ */ S("p", {
|
|
163
|
-
className: "text-text-muted",
|
|
164
|
-
children: "If the developer wants to cash out, they use the billing withdrawal flow from their own billing account and payout methods."
|
|
165
|
-
})
|
|
166
|
-
]
|
|
167
|
-
})]
|
|
168
|
-
})
|
|
169
|
-
}),
|
|
170
|
-
/* @__PURE__ */ C("section", {
|
|
171
|
-
className: "rounded-card border border-border-seam bg-bg-surface p-4",
|
|
172
|
-
children: [
|
|
173
|
-
/* @__PURE__ */ S("h3", {
|
|
174
|
-
className: "text-sm font-semibold text-text-primary",
|
|
175
|
-
children: "Sales currently contributing to earned credits"
|
|
176
|
-
}),
|
|
177
|
-
/* @__PURE__ */ S("p", {
|
|
178
|
-
className: "mt-1 text-xs text-text-muted",
|
|
179
|
-
children: "These sales represent revenue that should exist as earned credits in the linked billing account until the developer withdraws them."
|
|
180
|
-
}),
|
|
181
|
-
/* @__PURE__ */ S("div", {
|
|
182
|
-
className: "mt-4 overflow-x-auto",
|
|
183
|
-
children: /* @__PURE__ */ C("table", {
|
|
184
|
-
className: "min-w-full text-sm",
|
|
185
|
-
children: [/* @__PURE__ */ S("thead", {
|
|
186
|
-
className: "bg-bg-sunken/60 text-left text-xs uppercase tracking-wide text-text-muted",
|
|
187
|
-
children: /* @__PURE__ */ C("tr", { children: [
|
|
188
|
-
/* @__PURE__ */ S("th", {
|
|
189
|
-
className: "px-3 py-2",
|
|
190
|
-
children: "Application"
|
|
191
|
-
}),
|
|
192
|
-
/* @__PURE__ */ S("th", {
|
|
193
|
-
className: "px-3 py-2",
|
|
194
|
-
children: "Purchased"
|
|
195
|
-
}),
|
|
196
|
-
/* @__PURE__ */ S("th", {
|
|
197
|
-
className: "px-3 py-2",
|
|
198
|
-
children: "Net revenue"
|
|
199
|
-
}),
|
|
200
|
-
/* @__PURE__ */ S("th", {
|
|
201
|
-
className: "px-3 py-2",
|
|
202
|
-
children: "Credit sync"
|
|
203
|
-
}),
|
|
204
|
-
/* @__PURE__ */ S("th", {
|
|
205
|
-
className: "px-3 py-2",
|
|
206
|
-
children: "Status"
|
|
207
|
-
})
|
|
208
|
-
] })
|
|
209
|
-
}), /* @__PURE__ */ S("tbody", { children: t.unpaidSales.items.length === 0 ? /* @__PURE__ */ S("tr", { children: /* @__PURE__ */ S("td", {
|
|
210
|
-
colSpan: 5,
|
|
211
|
-
className: "px-3 py-5 text-center text-sm text-text-muted",
|
|
212
|
-
children: "No outstanding unpaid sales. Revenue has either not started yet or has already been withdrawn through billing."
|
|
213
|
-
}) }) : t.unpaidSales.items.map((t) => /* @__PURE__ */ C("tr", {
|
|
214
|
-
className: "border-t border-border-seam",
|
|
215
|
-
children: [
|
|
216
|
-
/* @__PURE__ */ C("td", {
|
|
217
|
-
className: "px-3 py-2",
|
|
218
|
-
children: [/* @__PURE__ */ S("div", {
|
|
219
|
-
className: "font-medium text-text-primary",
|
|
220
|
-
children: t.application?.name ?? "Unknown app"
|
|
221
|
-
}), /* @__PURE__ */ C("div", {
|
|
222
|
-
className: "text-xs text-text-muted",
|
|
223
|
-
children: ["/", t.application?.slug ?? "unknown"]
|
|
224
|
-
})]
|
|
225
|
-
}),
|
|
226
|
-
/* @__PURE__ */ S("td", {
|
|
227
|
-
className: "px-3 py-2 text-text-secondary",
|
|
228
|
-
children: a(t.purchasedAt)
|
|
229
|
-
}),
|
|
230
|
-
/* @__PURE__ */ S("td", {
|
|
231
|
-
className: "px-3 py-2 text-text-primary",
|
|
232
|
-
children: i(t.netAmount, t.currency)
|
|
233
|
-
}),
|
|
234
|
-
/* @__PURE__ */ C("td", {
|
|
235
|
-
className: "px-3 py-2 text-text-secondary",
|
|
236
|
-
children: [
|
|
237
|
-
/* @__PURE__ */ S("div", { children: t.billingCreditSyncStatus ?? "UNKNOWN" }),
|
|
238
|
-
t.billingCreditSyncError && /* @__PURE__ */ S("div", {
|
|
239
|
-
className: "mt-1 text-xs text-status-error-text",
|
|
240
|
-
children: t.billingCreditSyncError
|
|
241
|
-
}),
|
|
242
|
-
t.billingCreditSyncStatus !== "SYNCED" && e.billingAccountId && /* @__PURE__ */ S("button", {
|
|
243
|
-
type: "button",
|
|
244
|
-
onClick: () => s(t.id),
|
|
245
|
-
disabled: o === t.id,
|
|
246
|
-
className: "mt-2 rounded-md border border-border-subtle px-2 py-1 text-xs font-medium text-text-primary disabled:opacity-50",
|
|
247
|
-
children: o === t.id ? "Retrying…" : "Retry sync"
|
|
248
|
-
})
|
|
249
|
-
]
|
|
250
|
-
}),
|
|
251
|
-
/* @__PURE__ */ S("td", {
|
|
252
|
-
className: "px-3 py-2 text-text-secondary",
|
|
253
|
-
children: t.status
|
|
254
|
-
})
|
|
255
|
-
]
|
|
256
|
-
}, t.id)) })]
|
|
257
|
-
})
|
|
258
|
-
})
|
|
259
|
-
]
|
|
260
|
-
})
|
|
261
|
-
]
|
|
262
|
-
}) : null,
|
|
263
|
-
/* @__PURE__ */ S(O, { children: /* @__PURE__ */ S("button", {
|
|
264
|
-
type: "button",
|
|
265
|
-
onClick: c,
|
|
266
|
-
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary",
|
|
267
|
-
children: "Close"
|
|
268
|
-
}) })
|
|
269
|
-
]
|
|
270
|
-
})
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
var N = () => {
|
|
274
|
-
let a = s(), { apiGatewayUrl: h, authToken: g, orgId: _, navigate: y, basePath: b } = e(), [T, E] = m([]), [D, O] = m(!0), [k, A] = m(null), [N, P] = m(null), [F, I] = m(null), [L, R] = m(!1), [z, B] = m(null), [V, H] = m(null), U = p(() => ({
|
|
275
|
-
apiGatewayUrl: h,
|
|
75
|
+
var w = () => {
|
|
76
|
+
let p = o(), { apiGatewayUrl: m, authToken: g, orgId: v } = e(), w = s(), [T, E] = f([]), [D, O] = f(!0), [k, A] = f(null), [j, M] = f(""), N = d(() => ({
|
|
77
|
+
apiGatewayUrl: m,
|
|
276
78
|
authToken: g,
|
|
277
|
-
orgId:
|
|
79
|
+
orgId: v
|
|
278
80
|
}), [
|
|
279
|
-
|
|
81
|
+
m,
|
|
280
82
|
g,
|
|
281
|
-
|
|
282
|
-
]),
|
|
83
|
+
v
|
|
84
|
+
]), P = l(async () => {
|
|
283
85
|
O(!0), A(null);
|
|
284
86
|
try {
|
|
285
|
-
E((await
|
|
87
|
+
E((await c(N)).filter((e) => e.totalRevenue > 0 || e.pendingBalance > 0 || e.totalPayouts > 0));
|
|
286
88
|
} catch (e) {
|
|
287
89
|
A(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load developer revenue"));
|
|
288
90
|
} finally {
|
|
289
91
|
O(!1);
|
|
290
92
|
}
|
|
291
|
-
}, [
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
I(null), B(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load revenue detail"));
|
|
297
|
-
} finally {
|
|
298
|
-
R(!1);
|
|
299
|
-
}
|
|
300
|
-
};
|
|
301
|
-
return f(() => {
|
|
302
|
-
a.isBillingAdmin && W();
|
|
303
|
-
}, [W, a.isBillingAdmin]), a.isBillingAdmin ? k && o(k) ? /* @__PURE__ */ S(r, {
|
|
93
|
+
}, [N]);
|
|
94
|
+
if (u(() => {
|
|
95
|
+
p.isBillingAdmin && P();
|
|
96
|
+
}, [P, p.isBillingAdmin]), !p.isBillingAdmin) return /* @__PURE__ */ b(t, { message: "You don't have permission to view developer revenue." });
|
|
97
|
+
if (k && a(k)) return /* @__PURE__ */ b(r, {
|
|
304
98
|
title: "Developer revenue unavailable",
|
|
305
99
|
message: k.message,
|
|
306
100
|
showRetry: !0,
|
|
307
|
-
onRetry: () => void
|
|
308
|
-
})
|
|
101
|
+
onRetry: () => void P()
|
|
102
|
+
});
|
|
103
|
+
let F = j.trim().toLowerCase(), I = F ? T.filter((e) => e.name.toLowerCase().includes(F) || e.slug.toLowerCase().includes(F) || e.id.toLowerCase() === F) : T;
|
|
104
|
+
return /* @__PURE__ */ x("div", {
|
|
309
105
|
className: "space-y-6 p-6",
|
|
310
106
|
children: [
|
|
311
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ b(n, {
|
|
312
108
|
title: "Developer revenue",
|
|
313
109
|
description: "See store-generated revenue across developer organizations and confirm that the earnings are flowing into linked billing accounts as earned credits.",
|
|
314
|
-
actions: /* @__PURE__ */
|
|
110
|
+
actions: /* @__PURE__ */ b("button", {
|
|
315
111
|
type: "button",
|
|
316
|
-
onClick: () =>
|
|
112
|
+
onClick: () => w("/payouts"),
|
|
317
113
|
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",
|
|
318
114
|
children: "Open billing withdrawal queue"
|
|
319
115
|
})
|
|
320
116
|
}),
|
|
321
|
-
/* @__PURE__ */ S
|
|
322
|
-
D ? /* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ b(S, { children: "Developer portal revenue does not pay out directly from this page. Each Store sale is credited into the developer organization's linked billing account as earned credits. Developers then withdraw those credits later using the billing withdrawal flow and their own payout methods. Open an organization to see its full revenue history, current credit balance, and withdrawal status." }),
|
|
118
|
+
D ? /* @__PURE__ */ b("div", {
|
|
323
119
|
className: "flex items-center justify-center py-16 text-text-secondary",
|
|
324
|
-
children: /* @__PURE__ */
|
|
325
|
-
}) : /* @__PURE__ */
|
|
120
|
+
children: /* @__PURE__ */ b(h, { className: "size-8 animate-spin" })
|
|
121
|
+
}) : /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(C, { orgs: T }), /* @__PURE__ */ x("div", {
|
|
326
122
|
className: "overflow-hidden rounded-card border border-border-seam bg-bg-surface shadow-[var(--shadow-elevation-1)]",
|
|
327
|
-
children: [/* @__PURE__ */
|
|
123
|
+
children: [/* @__PURE__ */ b("div", {
|
|
328
124
|
className: "border-b border-border-seam px-5 py-4",
|
|
329
|
-
children:
|
|
330
|
-
className: "
|
|
331
|
-
children: "
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
125
|
+
children: /* @__PURE__ */ x("div", {
|
|
126
|
+
className: "flex flex-wrap items-center justify-between gap-3",
|
|
127
|
+
children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("h2", {
|
|
128
|
+
className: "text-base font-semibold text-text-primary",
|
|
129
|
+
children: "Organizations"
|
|
130
|
+
}), /* @__PURE__ */ b("p", {
|
|
131
|
+
className: "mt-1 text-sm text-text-muted",
|
|
132
|
+
children: "Click a row to open its full revenue analysis — balance, monthly trend, and withdrawal history."
|
|
133
|
+
})] }), /* @__PURE__ */ x("div", {
|
|
134
|
+
className: "relative w-full max-w-xs",
|
|
135
|
+
children: [/* @__PURE__ */ b(_, { className: "pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-text-muted" }), /* @__PURE__ */ b("input", {
|
|
136
|
+
type: "text",
|
|
137
|
+
value: j,
|
|
138
|
+
onChange: (e) => M(e.target.value),
|
|
139
|
+
placeholder: "Search by name, slug, or org ID…",
|
|
140
|
+
className: "w-full rounded-md border border-border-subtle bg-bg-surface py-2 pl-9 pr-3 text-sm text-text-primary placeholder:text-text-muted"
|
|
141
|
+
})]
|
|
142
|
+
})]
|
|
143
|
+
})
|
|
144
|
+
}), T.length === 0 ? /* @__PURE__ */ b("div", {
|
|
337
145
|
className: "px-5 py-12 text-center text-sm text-text-muted",
|
|
338
146
|
children: "No developer revenue has been recorded yet."
|
|
339
|
-
}) : /* @__PURE__ */
|
|
147
|
+
}) : I.length === 0 ? /* @__PURE__ */ x("div", {
|
|
148
|
+
className: "px-5 py-12 text-center text-sm text-text-muted",
|
|
149
|
+
children: [
|
|
150
|
+
"No organization matches \"",
|
|
151
|
+
j,
|
|
152
|
+
"\"."
|
|
153
|
+
]
|
|
154
|
+
}) : /* @__PURE__ */ b("div", {
|
|
340
155
|
className: "overflow-x-auto",
|
|
341
|
-
children: /* @__PURE__ */
|
|
156
|
+
children: /* @__PURE__ */ x("table", {
|
|
342
157
|
className: "min-w-full text-sm",
|
|
343
|
-
children: [/* @__PURE__ */
|
|
158
|
+
children: [/* @__PURE__ */ b("thead", {
|
|
344
159
|
className: "bg-bg-sunken/60 text-left text-xs uppercase tracking-wide text-text-muted",
|
|
345
|
-
children: /* @__PURE__ */
|
|
346
|
-
/* @__PURE__ */
|
|
160
|
+
children: /* @__PURE__ */ x("tr", { children: [
|
|
161
|
+
/* @__PURE__ */ b("th", {
|
|
347
162
|
className: "px-4 py-3",
|
|
348
163
|
children: "Organization"
|
|
349
164
|
}),
|
|
350
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ b("th", {
|
|
351
166
|
className: "px-4 py-3",
|
|
352
167
|
children: "Billing linked"
|
|
353
168
|
}),
|
|
354
|
-
/* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ b("th", {
|
|
355
170
|
className: "px-4 py-3",
|
|
356
171
|
children: "Revenue"
|
|
357
172
|
}),
|
|
358
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ b("th", {
|
|
359
174
|
className: "px-4 py-3",
|
|
360
175
|
children: "Platform fee"
|
|
361
176
|
}),
|
|
362
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ b("th", {
|
|
363
178
|
className: "px-4 py-3",
|
|
364
179
|
children: "Earned credits pending withdrawal"
|
|
365
180
|
}),
|
|
366
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ b("th", {
|
|
367
182
|
className: "px-4 py-3",
|
|
368
183
|
children: "Already withdrawn"
|
|
369
184
|
})
|
|
370
185
|
] })
|
|
371
|
-
}), /* @__PURE__ */
|
|
186
|
+
}), /* @__PURE__ */ b("tbody", { children: [...I].sort((e, t) => t.pendingBalance - e.pendingBalance).map((e) => /* @__PURE__ */ x("tr", {
|
|
372
187
|
className: "cursor-pointer border-t border-border-seam transition-colors hover:bg-bg-sunken/30",
|
|
373
|
-
onClick: () =>
|
|
188
|
+
onClick: () => w(`/developer-revenue/${e.id}`),
|
|
374
189
|
children: [
|
|
375
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ x("td", {
|
|
376
191
|
className: "px-4 py-3",
|
|
377
|
-
children: [/* @__PURE__ */
|
|
192
|
+
children: [/* @__PURE__ */ b("div", {
|
|
378
193
|
className: "font-medium text-text-primary",
|
|
379
194
|
children: e.name
|
|
380
|
-
}), /* @__PURE__ */
|
|
195
|
+
}), /* @__PURE__ */ x("div", {
|
|
381
196
|
className: "text-xs text-text-muted",
|
|
382
197
|
children: ["/", e.slug]
|
|
383
198
|
})]
|
|
384
199
|
}),
|
|
385
|
-
/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ b("td", {
|
|
386
201
|
className: "px-4 py-3 text-text-secondary",
|
|
387
202
|
children: e.billingAccountId ? "Yes" : "No"
|
|
388
203
|
}),
|
|
389
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ b("td", {
|
|
390
205
|
className: "px-4 py-3 text-text-primary",
|
|
391
206
|
children: i(e.totalRevenue, "USD")
|
|
392
207
|
}),
|
|
393
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ b("td", {
|
|
394
209
|
className: "px-4 py-3 text-text-secondary",
|
|
395
210
|
children: i(e.totalPlatformFees, "USD")
|
|
396
211
|
}),
|
|
397
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ b("td", {
|
|
398
213
|
className: "px-4 py-3 font-medium text-status-warning-text",
|
|
399
214
|
children: i(e.pendingBalance, "USD")
|
|
400
215
|
}),
|
|
401
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ b("td", {
|
|
402
217
|
className: "px-4 py-3 text-text-secondary",
|
|
403
218
|
children: i(e.totalPayouts, "USD")
|
|
404
219
|
})
|
|
@@ -406,33 +221,11 @@ var N = () => {
|
|
|
406
221
|
}, e.id)) })]
|
|
407
222
|
})
|
|
408
223
|
})]
|
|
409
|
-
})] })
|
|
410
|
-
/* @__PURE__ */ S(M, {
|
|
411
|
-
org: N,
|
|
412
|
-
detail: F,
|
|
413
|
-
loading: L,
|
|
414
|
-
error: z,
|
|
415
|
-
retryingSaleId: V,
|
|
416
|
-
onRetrySale: (e) => {
|
|
417
|
-
N && (async () => {
|
|
418
|
-
H(e), B(null);
|
|
419
|
-
try {
|
|
420
|
-
await u(e, U), await G(N);
|
|
421
|
-
} catch (e) {
|
|
422
|
-
B(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to retry credit sync"));
|
|
423
|
-
} finally {
|
|
424
|
-
H(null);
|
|
425
|
-
}
|
|
426
|
-
})();
|
|
427
|
-
},
|
|
428
|
-
onClose: () => {
|
|
429
|
-
P(null), I(null), B(null);
|
|
430
|
-
}
|
|
431
|
-
})
|
|
224
|
+
})] })
|
|
432
225
|
]
|
|
433
|
-
})
|
|
226
|
+
});
|
|
434
227
|
};
|
|
435
228
|
//#endregion
|
|
436
|
-
export {
|
|
229
|
+
export { w as DeveloperRevenueAdminPage };
|
|
437
230
|
|
|
438
231
|
//# sourceMappingURL=DeveloperRevenueAdminPage.js.map
|