@burdenoff/microfe-billing 2026.624.2 → 2026.625.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 +1 -1
- package/dist/billing/BillingAdminRoutes.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonCreatePage.js +2 -2
- package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonDetailPage.js +4 -4
- package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonEditPage.js +2 -2
- package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonsListPage.js +1 -1
- package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -1
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +98 -99
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js +88 -85
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +6 -6
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +2 -2
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/RefundsPage.js +383 -399
- package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js +232 -252
- package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.js +2 -2
- package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
- package/dist/billing/modules/checkout/components/BillingAccountSelector.js +1 -1
- package/dist/billing/modules/checkout/components/BillingAccountSelector.js.map +1 -1
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js +1 -1
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js.map +1 -1
- package/dist/billing/modules/checkout/components/SubscriptionSelector.js +1 -1
- package/dist/billing/modules/checkout/components/SubscriptionSelector.js.map +1 -1
- package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js +2 -2
- package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js +102 -104
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CouponsListPage.js +211 -249
- package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/AdminCreditsPage.js +1 -1
- package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +1 -1
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditsPage.js +29 -28
- package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
- package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js +2 -2
- package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js.map +1 -1
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js +1 -1
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js.map +1 -1
- package/dist/billing/modules/dashboard/components/BillingAccountCard.js +3 -3
- package/dist/billing/modules/dashboard/components/BillingAccountCard.js.map +1 -1
- package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js +2 -2
- package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js.map +1 -1
- package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js +1 -1
- package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js.map +1 -1
- package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js +1 -1
- package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js.map +1 -1
- package/dist/billing/modules/dashboard/pages/OverviewPage.js +139 -142
- package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js +6 -6
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +4 -4
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +1 -1
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +142 -133
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanCreatePage.js +2 -2
- package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanDetailPage.js +4 -4
- package/dist/billing/modules/plans/pages/PlanDetailPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanEditPage.js +2 -2
- package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js +3 -3
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansListPage.js +2 -2
- package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -1
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +4 -4
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -1
- package/dist/billing/modules/promotions/pages/PromotionsListPage.js +2 -2
- package/dist/billing/modules/promotions/pages/PromotionsListPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +2 -2
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +5 -5
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +2 -2
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +259 -265
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +7 -7
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
- package/dist/billing/modules/usage/pages/UsagePage.js +13 -13
- package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
- package/dist/billing/shared/ui/Card.js +1 -1
- package/dist/billing/shared/ui/Card.js.map +1 -1
- package/dist/billing/shared/ui/MetricCard.js +28 -21
- package/dist/billing/shared/ui/MetricCard.js.map +1 -1
- package/package.json +2 -2
|
@@ -12,12 +12,13 @@ import { GetTransactionDocument as l } from "../../../../generated/global-operat
|
|
|
12
12
|
import { useRefunds as u } from "../hooks/useRefunds.js";
|
|
13
13
|
import "../hooks/index.js";
|
|
14
14
|
import { useCallback as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
15
|
-
import { AlertTriangle as g, Ban as _, CheckCircle as v, ChevronLeft as y, ChevronRight as b, Clock as x, Download as S, Eye as C, Filter as w, Loader2 as T, MoreHorizontal as E, Play as
|
|
16
|
-
import { Fragment as
|
|
17
|
-
import { useI18n as
|
|
18
|
-
import {
|
|
15
|
+
import { AlertTriangle as g, Ban as _, CheckCircle as v, ChevronLeft as y, ChevronRight as b, Clock as x, Download as S, Eye as C, Filter as w, Loader2 as T, MoreHorizontal as E, Play as D, Plus as ee, RefreshCw as O, RotateCcw as k, Search as A, SkipForward as j, X as M, XCircle as N } from "lucide-react";
|
|
16
|
+
import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
17
|
+
import { useI18n as te } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
18
|
+
import { CTAOverflowMenu as ne, ResponsiveTable as re } from "@burdenoff/fe-libs/ui";
|
|
19
|
+
import { useApolloClient as L } from "@apollo/client/react";
|
|
19
20
|
//#region src/billing/modules/billing/pages/RefundsPage.tsx
|
|
20
|
-
var
|
|
21
|
+
var R = {
|
|
21
22
|
PENDING: {
|
|
22
23
|
label: "Pending",
|
|
23
24
|
color: "yellow",
|
|
@@ -36,19 +37,19 @@ var L = {
|
|
|
36
37
|
FAILED: {
|
|
37
38
|
label: "Failed",
|
|
38
39
|
color: "red",
|
|
39
|
-
icon:
|
|
40
|
+
icon: N
|
|
40
41
|
},
|
|
41
42
|
SKIPPED: {
|
|
42
43
|
label: "Skipped",
|
|
43
44
|
color: "gray",
|
|
44
45
|
icon: _
|
|
45
46
|
}
|
|
46
|
-
},
|
|
47
|
+
}, z = {
|
|
47
48
|
MANUAL: "Manual",
|
|
48
49
|
WEBHOOK_RECOVERY: "Webhook Recovery",
|
|
49
50
|
SUBSCRIPTION_CANCEL: "Subscription Cancel",
|
|
50
51
|
DUPLICATE_PAYMENT: "Duplicate Payment"
|
|
51
|
-
},
|
|
52
|
+
}, ie = ["stripe", "razorpay"], B = (e) => {
|
|
52
53
|
let t = {
|
|
53
54
|
yellow: `${r.warning.bg} ${r.warning.text}`,
|
|
54
55
|
blue: `${r.info.bg} ${r.info.text}`,
|
|
@@ -57,7 +58,7 @@ var L = {
|
|
|
57
58
|
gray: `${r.neutral.bg} ${r.neutral.text}`
|
|
58
59
|
};
|
|
59
60
|
return t[e] || t.gray;
|
|
60
|
-
},
|
|
61
|
+
}, ae = ({ record: e, onViewDetails: t, onProcess: n, onSkip: i, onRetry: a, isProcessing: o }) => {
|
|
61
62
|
let [s, c] = h(!1), l = m(null);
|
|
62
63
|
f(() => {
|
|
63
64
|
let e = (e) => {
|
|
@@ -66,62 +67,62 @@ var L = {
|
|
|
66
67
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
67
68
|
}, []);
|
|
68
69
|
let u = e.status === "PENDING", d = e.status === "PENDING", p = e.status === "FAILED";
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
+
return /* @__PURE__ */ I("div", {
|
|
70
71
|
className: "relative",
|
|
71
72
|
ref: l,
|
|
72
|
-
children: [/* @__PURE__ */
|
|
73
|
+
children: [/* @__PURE__ */ F("button", {
|
|
73
74
|
type: "button",
|
|
74
75
|
onClick: () => c(!s),
|
|
75
76
|
disabled: o,
|
|
76
77
|
className: "p-1.5 rounded-md hover:bg-bg-sunken/50 transition-colors disabled:opacity-50",
|
|
77
78
|
"aria-label": "Refund actions",
|
|
78
|
-
children: o ? /* @__PURE__ */
|
|
79
|
-
}), s && /* @__PURE__ */
|
|
79
|
+
children: o ? /* @__PURE__ */ F(T, { className: "size-4 animate-spin text-text-muted" }) : /* @__PURE__ */ F(E, { className: "size-4 text-text-muted" })
|
|
80
|
+
}), s && /* @__PURE__ */ I("div", {
|
|
80
81
|
className: "absolute right-0 top-full mt-1 z-50 min-w-[160px] bg-bg-elevated border border-border-subtle rounded-input shadow-[var(--shadow-elevation-3)] py-1",
|
|
81
82
|
children: [
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ I("button", {
|
|
83
84
|
type: "button",
|
|
84
85
|
onClick: () => {
|
|
85
86
|
t(), c(!1);
|
|
86
87
|
},
|
|
87
88
|
className: "w-full flex items-center gap-2 px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken/50 transition-colors",
|
|
88
|
-
children: [/* @__PURE__ */
|
|
89
|
+
children: [/* @__PURE__ */ F(C, { className: "size-4" }), "View Details"]
|
|
89
90
|
}),
|
|
90
|
-
u && /* @__PURE__ */
|
|
91
|
+
u && /* @__PURE__ */ I("button", {
|
|
91
92
|
type: "button",
|
|
92
93
|
onClick: () => {
|
|
93
94
|
n(), c(!1);
|
|
94
95
|
},
|
|
95
96
|
className: `w-full flex items-center gap-2 px-3 py-2 text-sm ${r.success.text} hover:bg-bg-sunken/50 transition-colors`,
|
|
96
|
-
children: [/* @__PURE__ */
|
|
97
|
+
children: [/* @__PURE__ */ F(D, { className: "size-4" }), "Process Refund"]
|
|
97
98
|
}),
|
|
98
|
-
d && /* @__PURE__ */
|
|
99
|
+
d && /* @__PURE__ */ I("button", {
|
|
99
100
|
type: "button",
|
|
100
101
|
onClick: () => {
|
|
101
102
|
i(), c(!1);
|
|
102
103
|
},
|
|
103
104
|
className: `w-full flex items-center gap-2 px-3 py-2 text-sm ${r.warning.text} hover:bg-bg-sunken/50 transition-colors`,
|
|
104
|
-
children: [/* @__PURE__ */
|
|
105
|
+
children: [/* @__PURE__ */ F(j, { className: "size-4" }), "Skip Refund"]
|
|
105
106
|
}),
|
|
106
|
-
p && /* @__PURE__ */
|
|
107
|
+
p && /* @__PURE__ */ I("button", {
|
|
107
108
|
type: "button",
|
|
108
109
|
onClick: () => {
|
|
109
110
|
a(), c(!1);
|
|
110
111
|
},
|
|
111
112
|
className: `w-full flex items-center gap-2 px-3 py-2 text-sm ${r.info.text} hover:bg-bg-sunken/50 transition-colors`,
|
|
112
|
-
children: [/* @__PURE__ */
|
|
113
|
+
children: [/* @__PURE__ */ F(k, { className: "size-4" }), "Retry Refund"]
|
|
113
114
|
})
|
|
114
115
|
]
|
|
115
116
|
})]
|
|
116
117
|
});
|
|
117
|
-
},
|
|
118
|
+
}, V = {
|
|
118
119
|
provider: "stripe",
|
|
119
120
|
gatewayPaymentId: "",
|
|
120
121
|
amount: 0,
|
|
121
122
|
currency: "USD"
|
|
122
|
-
},
|
|
123
|
-
let i =
|
|
124
|
-
s(""), u(null), p(null), y(
|
|
123
|
+
}, oe = ({ isOpen: e, onClose: t, onSubmit: n, isSubmitting: r }) => {
|
|
124
|
+
let i = L(), [o, s] = h(""), [c, u] = h(null), [f, p] = h(null), [m, g] = h(!1), [_, y] = h(V), b = () => {
|
|
125
|
+
s(""), u(null), p(null), y(V);
|
|
125
126
|
}, x = () => {
|
|
126
127
|
b(), t();
|
|
127
128
|
}, S = d(async (e) => {
|
|
@@ -135,7 +136,7 @@ var L = {
|
|
|
135
136
|
fetchPolicy: "network-only"
|
|
136
137
|
}), n = e?.getTransaction ?? null;
|
|
137
138
|
if (!n) {
|
|
138
|
-
p("Transaction not found. Check the ID and try again."), y(
|
|
139
|
+
p("Transaction not found. Check the ID and try again."), y(V);
|
|
139
140
|
return;
|
|
140
141
|
}
|
|
141
142
|
let r = n.metadata, a = typeof r?.total == "number" ? r.total : n.amount;
|
|
@@ -164,7 +165,7 @@ var L = {
|
|
|
164
165
|
notes: ""
|
|
165
166
|
});
|
|
166
167
|
} catch {
|
|
167
|
-
p("Failed to look up transaction. Ensure the ID is correct."), y(
|
|
168
|
+
p("Failed to look up transaction. Ensure the ID is correct."), y(V);
|
|
168
169
|
} finally {
|
|
169
170
|
g(!1);
|
|
170
171
|
}
|
|
@@ -174,36 +175,36 @@ var L = {
|
|
|
174
175
|
};
|
|
175
176
|
if (!e) return null;
|
|
176
177
|
let w = c?.totalAmount ?? void 0, E = w !== void 0 && _.amount > w + .01;
|
|
177
|
-
return /* @__PURE__ */
|
|
178
|
+
return /* @__PURE__ */ I("div", {
|
|
178
179
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
179
|
-
children: [/* @__PURE__ */
|
|
180
|
+
children: [/* @__PURE__ */ F("div", {
|
|
180
181
|
className: "absolute inset-0 bg-overlay-scrim",
|
|
181
182
|
onClick: x
|
|
182
|
-
}), /* @__PURE__ */
|
|
183
|
-
className: "relative bg-bg-elevated border border-border-
|
|
184
|
-
children: [/* @__PURE__ */
|
|
183
|
+
}), /* @__PURE__ */ I("div", {
|
|
184
|
+
className: "relative bg-bg-elevated border border-border-seam rounded-card shadow-[var(--shadow-elevation-4)] max-w-lg w-full mx-4 max-h-[90vh] overflow-auto",
|
|
185
|
+
children: [/* @__PURE__ */ I("div", {
|
|
185
186
|
className: "flex items-center justify-between p-4 border-b border-border-subtle",
|
|
186
|
-
children: [/* @__PURE__ */
|
|
187
|
+
children: [/* @__PURE__ */ F("h2", {
|
|
187
188
|
className: "text-lg font-semibold",
|
|
188
189
|
children: "Create Manual Refund"
|
|
189
|
-
}), /* @__PURE__ */
|
|
190
|
+
}), /* @__PURE__ */ F("button", {
|
|
190
191
|
type: "button",
|
|
191
192
|
onClick: x,
|
|
192
193
|
className: "p-1 rounded-md hover:bg-bg-sunken/50 transition-colors",
|
|
193
|
-
children: /* @__PURE__ */
|
|
194
|
+
children: /* @__PURE__ */ F(M, { className: "size-5" })
|
|
194
195
|
})]
|
|
195
|
-
}), /* @__PURE__ */
|
|
196
|
+
}), /* @__PURE__ */ I("form", {
|
|
196
197
|
onSubmit: C,
|
|
197
198
|
className: "p-4 space-y-4",
|
|
198
199
|
children: [
|
|
199
|
-
/* @__PURE__ */
|
|
200
|
-
/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ I("div", { children: [
|
|
201
|
+
/* @__PURE__ */ F("label", {
|
|
201
202
|
className: "block text-sm font-medium mb-1",
|
|
202
203
|
children: "Transaction ID *"
|
|
203
204
|
}),
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ I("div", {
|
|
205
206
|
className: "flex gap-2",
|
|
206
|
-
children: [/* @__PURE__ */
|
|
207
|
+
children: [/* @__PURE__ */ F("input", {
|
|
207
208
|
type: "text",
|
|
208
209
|
value: o,
|
|
209
210
|
onChange: (e) => {
|
|
@@ -213,106 +214,106 @@ var L = {
|
|
|
213
214
|
className: "flex-1 px-3 py-2 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
214
215
|
placeholder: "Paste transaction UUID...",
|
|
215
216
|
required: !0
|
|
216
|
-
}), /* @__PURE__ */
|
|
217
|
+
}), /* @__PURE__ */ F("button", {
|
|
217
218
|
type: "button",
|
|
218
219
|
onClick: () => S(o),
|
|
219
220
|
disabled: !o.trim() || m,
|
|
220
221
|
className: "px-3 py-2 border border-border-subtle rounded-md hover:bg-bg-sunken/50 transition-colors disabled:opacity-50 flex items-center gap-1 text-sm",
|
|
221
|
-
children: m ? /* @__PURE__ */
|
|
222
|
+
children: m ? /* @__PURE__ */ F(T, { className: "size-4 animate-spin" }) : /* @__PURE__ */ F(A, { className: "size-4" })
|
|
222
223
|
})]
|
|
223
224
|
}),
|
|
224
|
-
f && /* @__PURE__ */
|
|
225
|
+
f && /* @__PURE__ */ F("p", {
|
|
225
226
|
className: "text-xs text-status-error-text mt-1",
|
|
226
227
|
children: f
|
|
227
228
|
}),
|
|
228
|
-
m && /* @__PURE__ */
|
|
229
|
+
m && /* @__PURE__ */ F("p", {
|
|
229
230
|
className: "text-xs text-text-muted mt-1",
|
|
230
231
|
children: "Looking up transaction…"
|
|
231
232
|
})
|
|
232
233
|
] }),
|
|
233
|
-
c && /* @__PURE__ */
|
|
234
|
-
/* @__PURE__ */
|
|
234
|
+
c && /* @__PURE__ */ I(P, { children: [
|
|
235
|
+
/* @__PURE__ */ I("div", {
|
|
235
236
|
className: "p-3 bg-status-success-bg-subtle border border-border-subtle rounded-md text-sm space-y-1",
|
|
236
|
-
children: [/* @__PURE__ */
|
|
237
|
+
children: [/* @__PURE__ */ I("div", {
|
|
237
238
|
className: "flex items-center gap-2 text-status-success-text font-medium",
|
|
238
|
-
children: [/* @__PURE__ */
|
|
239
|
-
}), /* @__PURE__ */
|
|
239
|
+
children: [/* @__PURE__ */ F(v, { className: "size-4" }), "Transaction found"]
|
|
240
|
+
}), /* @__PURE__ */ I("div", {
|
|
240
241
|
className: "text-text-muted grid grid-cols-2 gap-x-4 gap-y-0.5 mt-1",
|
|
241
242
|
children: [
|
|
242
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ I("span", { children: [
|
|
243
244
|
"Account:",
|
|
244
245
|
" ",
|
|
245
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ I("span", {
|
|
246
247
|
className: "text-text-primary font-mono text-xs",
|
|
247
248
|
children: [c.billingAccountId.slice(0, 16), "…"]
|
|
248
249
|
})
|
|
249
250
|
] }),
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
+
/* @__PURE__ */ I("span", { children: [
|
|
251
252
|
"Paid:",
|
|
252
253
|
" ",
|
|
253
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ F("span", {
|
|
254
255
|
className: "text-text-primary",
|
|
255
256
|
children: a(c.totalAmount, c.currency)
|
|
256
257
|
})
|
|
257
258
|
] }),
|
|
258
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ I("span", { children: [
|
|
259
260
|
"Provider:",
|
|
260
261
|
" ",
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ F("span", {
|
|
262
263
|
className: "text-text-primary capitalize",
|
|
263
264
|
children: _.provider
|
|
264
265
|
})
|
|
265
266
|
] }),
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ I("span", { children: ["Currency: ", /* @__PURE__ */ F("span", {
|
|
267
268
|
className: "text-text-primary",
|
|
268
269
|
children: c.currency
|
|
269
270
|
})] })
|
|
270
271
|
]
|
|
271
272
|
})]
|
|
272
273
|
}),
|
|
273
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ I("div", {
|
|
274
275
|
className: "grid grid-cols-2 gap-3",
|
|
275
|
-
children: [/* @__PURE__ */
|
|
276
|
+
children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("label", {
|
|
276
277
|
className: "block text-xs font-medium text-text-muted mb-1",
|
|
277
278
|
children: "Provider"
|
|
278
|
-
}), /* @__PURE__ */
|
|
279
|
+
}), /* @__PURE__ */ F("div", {
|
|
279
280
|
className: "px-3 py-2 border border-border-subtle rounded-md bg-bg-sunken/30 text-sm capitalize",
|
|
280
281
|
children: _.provider
|
|
281
|
-
})] }), /* @__PURE__ */
|
|
282
|
+
})] }), /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("label", {
|
|
282
283
|
className: "block text-xs font-medium text-text-muted mb-1",
|
|
283
284
|
children: "Currency"
|
|
284
|
-
}), /* @__PURE__ */
|
|
285
|
+
}), /* @__PURE__ */ F("div", {
|
|
285
286
|
className: "px-3 py-2 border border-border-subtle rounded-md bg-bg-sunken/30 text-sm",
|
|
286
287
|
children: _.currency
|
|
287
288
|
})] })]
|
|
288
289
|
}),
|
|
289
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("label", {
|
|
290
291
|
className: "block text-xs font-medium text-text-muted mb-1",
|
|
291
292
|
children: "Gateway Payment ID"
|
|
292
|
-
}), /* @__PURE__ */
|
|
293
|
+
}), /* @__PURE__ */ F("div", {
|
|
293
294
|
className: "px-3 py-2 border border-border-subtle rounded-md bg-bg-sunken/30 text-sm font-mono truncate",
|
|
294
295
|
children: _.gatewayPaymentId
|
|
295
296
|
})] }),
|
|
296
|
-
_.purchaseType && /* @__PURE__ */
|
|
297
|
+
_.purchaseType && /* @__PURE__ */ I("div", {
|
|
297
298
|
className: "grid grid-cols-2 gap-3",
|
|
298
|
-
children: [/* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("label", {
|
|
299
300
|
className: "block text-xs font-medium text-text-muted mb-1",
|
|
300
301
|
children: "Purchase Type"
|
|
301
|
-
}), /* @__PURE__ */
|
|
302
|
+
}), /* @__PURE__ */ F("div", {
|
|
302
303
|
className: "px-3 py-2 border border-border-subtle rounded-md bg-bg-sunken/30 text-sm",
|
|
303
304
|
children: _.purchaseType
|
|
304
|
-
})] }), /* @__PURE__ */
|
|
305
|
+
})] }), /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("label", {
|
|
305
306
|
className: "block text-xs font-medium text-text-muted mb-1",
|
|
306
307
|
children: "Purchase Detail"
|
|
307
|
-
}), /* @__PURE__ */
|
|
308
|
+
}), /* @__PURE__ */ F("div", {
|
|
308
309
|
className: "px-3 py-2 border border-border-subtle rounded-md bg-bg-sunken/30 text-sm truncate",
|
|
309
310
|
children: _.purchaseDetail || "—"
|
|
310
311
|
})] })]
|
|
311
312
|
}),
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ I("div", { children: [
|
|
314
|
+
/* @__PURE__ */ I("label", {
|
|
314
315
|
className: "block text-sm font-medium mb-1",
|
|
315
|
-
children: ["Refund Amount *", /* @__PURE__ */
|
|
316
|
+
children: ["Refund Amount *", /* @__PURE__ */ I("span", {
|
|
316
317
|
className: "text-xs text-text-muted ml-1",
|
|
317
318
|
children: [
|
|
318
319
|
"(max ",
|
|
@@ -321,7 +322,7 @@ var L = {
|
|
|
321
322
|
]
|
|
322
323
|
})]
|
|
323
324
|
}),
|
|
324
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ F("input", {
|
|
325
326
|
type: "number",
|
|
326
327
|
step: "0.01",
|
|
327
328
|
min: "0.01",
|
|
@@ -334,7 +335,7 @@ var L = {
|
|
|
334
335
|
className: `w-full px-3 py-2 border rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] ${E ? "border-status-error-text" : "border-border-subtle"}`,
|
|
335
336
|
required: !0
|
|
336
337
|
}),
|
|
337
|
-
E && /* @__PURE__ */
|
|
338
|
+
E && /* @__PURE__ */ I("p", {
|
|
338
339
|
className: "text-xs text-status-error-text mt-1",
|
|
339
340
|
children: [
|
|
340
341
|
"Amount cannot exceed the original payment of",
|
|
@@ -343,10 +344,10 @@ var L = {
|
|
|
343
344
|
]
|
|
344
345
|
})
|
|
345
346
|
] }),
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("label", {
|
|
347
348
|
className: "block text-sm font-medium mb-1",
|
|
348
349
|
children: "Reason"
|
|
349
|
-
}), /* @__PURE__ */
|
|
350
|
+
}), /* @__PURE__ */ F("input", {
|
|
350
351
|
type: "text",
|
|
351
352
|
value: _.reason || "",
|
|
352
353
|
onChange: (e) => y({
|
|
@@ -356,10 +357,10 @@ var L = {
|
|
|
356
357
|
className: "w-full px-3 py-2 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
357
358
|
placeholder: "Reason for refund"
|
|
358
359
|
})] }),
|
|
359
|
-
/* @__PURE__ */
|
|
360
|
+
/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("label", {
|
|
360
361
|
className: "block text-sm font-medium mb-1",
|
|
361
362
|
children: "Notes"
|
|
362
|
-
}), /* @__PURE__ */
|
|
363
|
+
}), /* @__PURE__ */ F("textarea", {
|
|
363
364
|
value: _.notes || "",
|
|
364
365
|
onChange: (e) => y({
|
|
365
366
|
..._,
|
|
@@ -370,67 +371,67 @@ var L = {
|
|
|
370
371
|
placeholder: "Internal notes"
|
|
371
372
|
})] })
|
|
372
373
|
] }),
|
|
373
|
-
/* @__PURE__ */
|
|
374
|
+
/* @__PURE__ */ I("div", {
|
|
374
375
|
className: "flex gap-2 pt-2",
|
|
375
|
-
children: [/* @__PURE__ */
|
|
376
|
+
children: [/* @__PURE__ */ F("button", {
|
|
376
377
|
type: "button",
|
|
377
378
|
onClick: x,
|
|
378
379
|
className: "flex-1 py-2 px-4 border border-border-subtle rounded-md hover:bg-bg-sunken/50 transition-colors",
|
|
379
380
|
children: "Cancel"
|
|
380
|
-
}), /* @__PURE__ */
|
|
381
|
+
}), /* @__PURE__ */ I("button", {
|
|
381
382
|
type: "submit",
|
|
382
383
|
disabled: r || !c || !_.gatewayPaymentId || _.amount <= 0 || E,
|
|
383
384
|
className: "flex-1 py-2 px-4 bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bgHover transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",
|
|
384
|
-
children: [r && /* @__PURE__ */
|
|
385
|
+
children: [r && /* @__PURE__ */ F(T, { className: "size-4 animate-spin" }), "Create Refund"]
|
|
385
386
|
})]
|
|
386
387
|
})
|
|
387
388
|
]
|
|
388
389
|
})]
|
|
389
390
|
})]
|
|
390
391
|
});
|
|
391
|
-
},
|
|
392
|
+
}, se = ({ isOpen: e, record: t, onClose: n, onSubmit: i, isSubmitting: o }) => {
|
|
392
393
|
let [s, c] = h("");
|
|
393
|
-
return !e || !t ? null : /* @__PURE__ */
|
|
394
|
+
return !e || !t ? null : /* @__PURE__ */ I("div", {
|
|
394
395
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
395
|
-
children: [/* @__PURE__ */
|
|
396
|
+
children: [/* @__PURE__ */ F("div", {
|
|
396
397
|
className: "absolute inset-0 bg-overlay-scrim",
|
|
397
398
|
onClick: n
|
|
398
|
-
}), /* @__PURE__ */
|
|
399
|
-
className: "relative bg-bg-elevated border border-border-
|
|
400
|
-
children: [/* @__PURE__ */
|
|
399
|
+
}), /* @__PURE__ */ I("div", {
|
|
400
|
+
className: "relative bg-bg-elevated border border-border-seam rounded-card shadow-[var(--shadow-elevation-4)] max-w-md w-full mx-4",
|
|
401
|
+
children: [/* @__PURE__ */ I("div", {
|
|
401
402
|
className: "flex items-center justify-between p-4 border-b border-border-subtle",
|
|
402
|
-
children: [/* @__PURE__ */
|
|
403
|
+
children: [/* @__PURE__ */ F("h2", {
|
|
403
404
|
className: "text-lg font-semibold",
|
|
404
405
|
children: "Skip Refund"
|
|
405
|
-
}), /* @__PURE__ */
|
|
406
|
+
}), /* @__PURE__ */ F("button", {
|
|
406
407
|
type: "button",
|
|
407
408
|
onClick: n,
|
|
408
409
|
className: "p-1 rounded-md hover:bg-bg-sunken/50 transition-colors",
|
|
409
|
-
children: /* @__PURE__ */
|
|
410
|
+
children: /* @__PURE__ */ F(M, { className: "size-5" })
|
|
410
411
|
})]
|
|
411
|
-
}), /* @__PURE__ */
|
|
412
|
+
}), /* @__PURE__ */ I("form", {
|
|
412
413
|
onSubmit: async (e) => {
|
|
413
414
|
e.preventDefault(), await i(s), c("");
|
|
414
415
|
},
|
|
415
416
|
className: "p-4 space-y-4",
|
|
416
417
|
children: [
|
|
417
|
-
/* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ F("div", {
|
|
418
419
|
className: `p-3 ${r.warning.bg} border ${r.warning.border} rounded-md`,
|
|
419
|
-
children: /* @__PURE__ */
|
|
420
|
+
children: /* @__PURE__ */ I("div", {
|
|
420
421
|
className: "flex items-start gap-2",
|
|
421
|
-
children: [/* @__PURE__ */
|
|
422
|
+
children: [/* @__PURE__ */ F(g, { className: `size-5 ${r.warning.icon} mt-0.5` }), /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
422
423
|
className: `text-sm font-medium ${r.warning.text}`,
|
|
423
424
|
children: "You are about to skip this refund"
|
|
424
|
-
}), /* @__PURE__ */
|
|
425
|
+
}), /* @__PURE__ */ I("p", {
|
|
425
426
|
className: `text-sm ${r.warning.text} mt-1`,
|
|
426
427
|
children: ["Amount: ", a(t.amount, t.currency)]
|
|
427
428
|
})] })]
|
|
428
429
|
})
|
|
429
430
|
}),
|
|
430
|
-
/* @__PURE__ */
|
|
431
|
+
/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("label", {
|
|
431
432
|
className: "block text-sm font-medium mb-1",
|
|
432
433
|
children: "Reason for skipping *"
|
|
433
|
-
}), /* @__PURE__ */
|
|
434
|
+
}), /* @__PURE__ */ F("textarea", {
|
|
434
435
|
value: s,
|
|
435
436
|
onChange: (e) => c(e.target.value),
|
|
436
437
|
className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface resize-none",
|
|
@@ -438,180 +439,180 @@ var L = {
|
|
|
438
439
|
placeholder: "Explain why this refund is being skipped...",
|
|
439
440
|
required: !0
|
|
440
441
|
})] }),
|
|
441
|
-
/* @__PURE__ */
|
|
442
|
+
/* @__PURE__ */ I("div", {
|
|
442
443
|
className: "flex gap-2",
|
|
443
|
-
children: [/* @__PURE__ */
|
|
444
|
+
children: [/* @__PURE__ */ F("button", {
|
|
444
445
|
type: "button",
|
|
445
446
|
onClick: n,
|
|
446
447
|
className: "flex-1 py-2 px-4 border border-border-subtle rounded-md hover:bg-bg-sunken/50 transition-colors",
|
|
447
448
|
children: "Cancel"
|
|
448
|
-
}), /* @__PURE__ */
|
|
449
|
+
}), /* @__PURE__ */ I("button", {
|
|
449
450
|
type: "submit",
|
|
450
451
|
disabled: o || !s.trim(),
|
|
451
452
|
className: `flex-1 py-2 px-4 ${r.warning.dot} text-action-primary-text rounded-md hover:opacity-90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2`,
|
|
452
|
-
children: [o && /* @__PURE__ */
|
|
453
|
+
children: [o && /* @__PURE__ */ F(T, { className: "size-4 animate-spin" }), "Skip Refund"]
|
|
453
454
|
})]
|
|
454
455
|
})
|
|
455
456
|
]
|
|
456
457
|
})]
|
|
457
458
|
})]
|
|
458
459
|
});
|
|
459
|
-
},
|
|
460
|
+
}, ce = ({ record: e, onClose: t }) => {
|
|
460
461
|
if (!e) return null;
|
|
461
|
-
let n =
|
|
462
|
-
return /* @__PURE__ */
|
|
462
|
+
let n = R[e.status].icon;
|
|
463
|
+
return /* @__PURE__ */ I("div", {
|
|
463
464
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
464
|
-
children: [/* @__PURE__ */
|
|
465
|
+
children: [/* @__PURE__ */ F("div", {
|
|
465
466
|
className: "absolute inset-0 bg-overlay-scrim",
|
|
466
467
|
onClick: t
|
|
467
|
-
}), /* @__PURE__ */
|
|
468
|
-
className: "relative bg-bg-elevated border border-border-
|
|
468
|
+
}), /* @__PURE__ */ I("div", {
|
|
469
|
+
className: "relative bg-bg-elevated border border-border-seam rounded-card shadow-[var(--shadow-elevation-4)] max-w-lg w-full mx-4 max-h-[90vh] overflow-auto",
|
|
469
470
|
children: [
|
|
470
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ I("div", {
|
|
471
472
|
className: "flex items-center justify-between p-4 border-b border-border-subtle",
|
|
472
|
-
children: [/* @__PURE__ */
|
|
473
|
+
children: [/* @__PURE__ */ F("h2", {
|
|
473
474
|
className: "text-lg font-semibold",
|
|
474
475
|
children: "Refund Details"
|
|
475
|
-
}), /* @__PURE__ */
|
|
476
|
+
}), /* @__PURE__ */ F("button", {
|
|
476
477
|
type: "button",
|
|
477
478
|
onClick: t,
|
|
478
479
|
className: "p-1 rounded-md hover:bg-bg-sunken/50 transition-colors",
|
|
479
|
-
children: /* @__PURE__ */
|
|
480
|
+
children: /* @__PURE__ */ F(M, { className: "size-5" })
|
|
480
481
|
})]
|
|
481
482
|
}),
|
|
482
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ I("div", {
|
|
483
484
|
className: "p-4 space-y-4",
|
|
484
485
|
children: [
|
|
485
|
-
/* @__PURE__ */
|
|
486
|
-
className: `flex items-center gap-2 p-3 rounded-md ${
|
|
487
|
-
children: [/* @__PURE__ */
|
|
486
|
+
/* @__PURE__ */ I("div", {
|
|
487
|
+
className: `flex items-center gap-2 p-3 rounded-md ${B(R[e.status].color)}`,
|
|
488
|
+
children: [/* @__PURE__ */ F(n, { className: "size-5" }), /* @__PURE__ */ F("span", {
|
|
488
489
|
className: "font-medium",
|
|
489
|
-
children:
|
|
490
|
+
children: R[e.status].label
|
|
490
491
|
})]
|
|
491
492
|
}),
|
|
492
|
-
/* @__PURE__ */
|
|
493
|
+
/* @__PURE__ */ I("div", {
|
|
493
494
|
className: "grid grid-cols-2 gap-4",
|
|
494
|
-
children: [/* @__PURE__ */
|
|
495
|
+
children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
495
496
|
className: "text-xs text-text-muted mb-1",
|
|
496
497
|
children: "Refund ID"
|
|
497
|
-
}), /* @__PURE__ */
|
|
498
|
+
}), /* @__PURE__ */ F("p", {
|
|
498
499
|
className: "text-sm font-mono break-all",
|
|
499
500
|
children: e.id
|
|
500
|
-
})] }), /* @__PURE__ */
|
|
501
|
+
})] }), /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
501
502
|
className: "text-xs text-text-muted mb-1",
|
|
502
503
|
children: "Source"
|
|
503
|
-
}), /* @__PURE__ */
|
|
504
|
+
}), /* @__PURE__ */ F("p", {
|
|
504
505
|
className: "text-sm",
|
|
505
|
-
children:
|
|
506
|
+
children: z[e.source]
|
|
506
507
|
})] })]
|
|
507
508
|
}),
|
|
508
|
-
/* @__PURE__ */
|
|
509
|
+
/* @__PURE__ */ I("div", {
|
|
509
510
|
className: "grid grid-cols-2 gap-4",
|
|
510
|
-
children: [/* @__PURE__ */
|
|
511
|
+
children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
511
512
|
className: "text-xs text-text-muted mb-1",
|
|
512
513
|
children: "Amount"
|
|
513
|
-
}), /* @__PURE__ */
|
|
514
|
+
}), /* @__PURE__ */ F("p", {
|
|
514
515
|
className: "text-lg font-semibold",
|
|
515
516
|
children: a(e.amount, e.currency)
|
|
516
|
-
})] }), /* @__PURE__ */
|
|
517
|
+
})] }), /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
517
518
|
className: "text-xs text-text-muted mb-1",
|
|
518
519
|
children: "Provider"
|
|
519
|
-
}), /* @__PURE__ */
|
|
520
|
+
}), /* @__PURE__ */ F("p", {
|
|
520
521
|
className: "text-sm capitalize",
|
|
521
522
|
children: e.provider
|
|
522
523
|
})] })]
|
|
523
524
|
}),
|
|
524
|
-
/* @__PURE__ */
|
|
525
|
+
/* @__PURE__ */ I("div", {
|
|
525
526
|
className: "grid grid-cols-2 gap-4",
|
|
526
|
-
children: [/* @__PURE__ */
|
|
527
|
+
children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
527
528
|
className: "text-xs text-text-muted mb-1",
|
|
528
529
|
children: "Gateway Payment ID"
|
|
529
|
-
}), /* @__PURE__ */
|
|
530
|
+
}), /* @__PURE__ */ F("p", {
|
|
530
531
|
className: "text-sm font-mono break-all",
|
|
531
532
|
children: e.gatewayPaymentId
|
|
532
|
-
})] }), e.gatewayOrderId && /* @__PURE__ */
|
|
533
|
+
})] }), e.gatewayOrderId && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
533
534
|
className: "text-xs text-text-muted mb-1",
|
|
534
535
|
children: "Gateway Order ID"
|
|
535
|
-
}), /* @__PURE__ */
|
|
536
|
+
}), /* @__PURE__ */ F("p", {
|
|
536
537
|
className: "text-sm font-mono break-all",
|
|
537
538
|
children: e.gatewayOrderId
|
|
538
539
|
})] })]
|
|
539
540
|
}),
|
|
540
|
-
e.gatewayRefundId && /* @__PURE__ */
|
|
541
|
+
e.gatewayRefundId && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
541
542
|
className: "text-xs text-text-muted mb-1",
|
|
542
543
|
children: "Gateway Refund ID"
|
|
543
|
-
}), /* @__PURE__ */
|
|
544
|
+
}), /* @__PURE__ */ F("p", {
|
|
544
545
|
className: "text-sm font-mono break-all",
|
|
545
546
|
children: e.gatewayRefundId
|
|
546
547
|
})] }),
|
|
547
|
-
(e.purchaseType || e.purchaseDetail) && /* @__PURE__ */
|
|
548
|
+
(e.purchaseType || e.purchaseDetail) && /* @__PURE__ */ I("div", {
|
|
548
549
|
className: "grid grid-cols-2 gap-4",
|
|
549
|
-
children: [e.purchaseType && /* @__PURE__ */
|
|
550
|
+
children: [e.purchaseType && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
550
551
|
className: "text-xs text-text-muted mb-1",
|
|
551
552
|
children: "Purchase Type"
|
|
552
|
-
}), /* @__PURE__ */
|
|
553
|
+
}), /* @__PURE__ */ F("p", {
|
|
553
554
|
className: "text-sm",
|
|
554
555
|
children: e.purchaseType
|
|
555
|
-
})] }), e.purchaseDetail && /* @__PURE__ */
|
|
556
|
+
})] }), e.purchaseDetail && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
556
557
|
className: "text-xs text-text-muted mb-1",
|
|
557
558
|
children: "Purchase Detail"
|
|
558
|
-
}), /* @__PURE__ */
|
|
559
|
+
}), /* @__PURE__ */ F("p", {
|
|
559
560
|
className: "text-sm",
|
|
560
561
|
children: e.purchaseDetail
|
|
561
562
|
})] })]
|
|
562
563
|
}),
|
|
563
|
-
e.reason && /* @__PURE__ */
|
|
564
|
+
e.reason && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
564
565
|
className: "text-xs text-text-muted mb-1",
|
|
565
566
|
children: "Reason"
|
|
566
|
-
}), /* @__PURE__ */
|
|
567
|
+
}), /* @__PURE__ */ F("p", {
|
|
567
568
|
className: "text-sm",
|
|
568
569
|
children: e.reason
|
|
569
570
|
})] }),
|
|
570
|
-
e.notes && /* @__PURE__ */
|
|
571
|
+
e.notes && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
571
572
|
className: "text-xs text-text-muted mb-1",
|
|
572
573
|
children: "Notes"
|
|
573
|
-
}), /* @__PURE__ */
|
|
574
|
+
}), /* @__PURE__ */ F("p", {
|
|
574
575
|
className: "text-sm",
|
|
575
576
|
children: e.notes
|
|
576
577
|
})] }),
|
|
577
|
-
e.errorMessage && /* @__PURE__ */
|
|
578
|
+
e.errorMessage && /* @__PURE__ */ I("div", {
|
|
578
579
|
className: `p-3 ${r.error.bg} border ${r.error.border} rounded-md`,
|
|
579
|
-
children: [/* @__PURE__ */
|
|
580
|
+
children: [/* @__PURE__ */ F("p", {
|
|
580
581
|
className: `text-xs ${r.error.text} mb-1`,
|
|
581
582
|
children: "Error Message"
|
|
582
|
-
}), /* @__PURE__ */
|
|
583
|
+
}), /* @__PURE__ */ F("p", {
|
|
583
584
|
className: `text-sm ${r.error.text}`,
|
|
584
585
|
children: e.errorMessage
|
|
585
586
|
})]
|
|
586
587
|
}),
|
|
587
|
-
/* @__PURE__ */
|
|
588
|
+
/* @__PURE__ */ I("div", {
|
|
588
589
|
className: "grid grid-cols-2 gap-4 pt-2 border-t border-border-subtle",
|
|
589
|
-
children: [/* @__PURE__ */
|
|
590
|
+
children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
590
591
|
className: "text-xs text-text-muted mb-1",
|
|
591
592
|
children: "Created At"
|
|
592
|
-
}), /* @__PURE__ */
|
|
593
|
+
}), /* @__PURE__ */ F("p", {
|
|
593
594
|
className: "text-sm",
|
|
594
595
|
children: o(e.createdAt)
|
|
595
|
-
})] }), e.processedAt && /* @__PURE__ */
|
|
596
|
+
})] }), e.processedAt && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
596
597
|
className: "text-xs text-text-muted mb-1",
|
|
597
598
|
children: "Processed At"
|
|
598
|
-
}), /* @__PURE__ */
|
|
599
|
+
}), /* @__PURE__ */ F("p", {
|
|
599
600
|
className: "text-sm",
|
|
600
601
|
children: o(e.processedAt)
|
|
601
602
|
})] })]
|
|
602
603
|
}),
|
|
603
|
-
e.retryCount > 0 && /* @__PURE__ */
|
|
604
|
+
e.retryCount > 0 && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
604
605
|
className: "text-xs text-text-muted mb-1",
|
|
605
606
|
children: "Retry Count"
|
|
606
|
-
}), /* @__PURE__ */
|
|
607
|
+
}), /* @__PURE__ */ F("p", {
|
|
607
608
|
className: "text-sm",
|
|
608
609
|
children: e.retryCount
|
|
609
610
|
})] })
|
|
610
611
|
]
|
|
611
612
|
}),
|
|
612
|
-
/* @__PURE__ */
|
|
613
|
+
/* @__PURE__ */ F("div", {
|
|
613
614
|
className: "p-4 border-t border-border-subtle",
|
|
614
|
-
children: /* @__PURE__ */
|
|
615
|
+
children: /* @__PURE__ */ F("button", {
|
|
615
616
|
type: "button",
|
|
616
617
|
onClick: t,
|
|
617
618
|
className: "w-full py-2 px-4 bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bgHover transition-colors",
|
|
@@ -621,7 +622,7 @@ var L = {
|
|
|
621
622
|
]
|
|
622
623
|
})]
|
|
623
624
|
});
|
|
624
|
-
},
|
|
625
|
+
}, H = {
|
|
625
626
|
PENDING: {
|
|
626
627
|
label: "Pending",
|
|
627
628
|
status: "PENDING"
|
|
@@ -638,87 +639,177 @@ var L = {
|
|
|
638
639
|
label: "All",
|
|
639
640
|
status: void 0
|
|
640
641
|
}
|
|
641
|
-
},
|
|
642
|
-
let { t:
|
|
643
|
-
let n =
|
|
642
|
+
}, U = () => {
|
|
643
|
+
let { t: r } = te(), l = (e, t) => {
|
|
644
|
+
let n = r(e);
|
|
644
645
|
return n === e ? t : n;
|
|
645
|
-
},
|
|
646
|
-
...
|
|
647
|
-
status:
|
|
646
|
+
}, d = c(), [f, m] = h("PENDING"), [g, _] = h(""), [v, x] = h({}), [C, E] = h(!1), [D, k] = h(null), [j, N] = h(!1), [P, L] = h(!1), [V, U] = h(null), [le, W] = h(null), { records: G, stats: K, pagination: q, isLoading: ue, recordsError: J, unprocessedWebhooks: Y, refetch: X, goToNextPage: de, goToPreviousPage: fe, setFilters: Z, createRefundRecord: pe, processRefund: me, skipRefund: he, retryRefund: ge, createRefundRecordsFromFailedWebhooks: _e, isCreating: ve, isProcessing: ye, isCreatingFromWebhooks: Q } = u({ filters: p(() => ({
|
|
647
|
+
...v,
|
|
648
|
+
status: H[f].status
|
|
648
649
|
}), [
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
650
|
+
f,
|
|
651
|
+
v.source,
|
|
652
|
+
v.provider,
|
|
653
|
+
v.billingAccountId,
|
|
654
|
+
v.fromDate,
|
|
655
|
+
v.toDate
|
|
655
656
|
]) });
|
|
656
|
-
if (!
|
|
657
|
-
if (J && s(J)) return /* @__PURE__ */
|
|
657
|
+
if (!d.canViewPayments) return /* @__PURE__ */ F(e, { message: "You don't have permission to view refunds." });
|
|
658
|
+
if (J && s(J)) return /* @__PURE__ */ F("div", {
|
|
658
659
|
className: "p-6",
|
|
659
|
-
children: /* @__PURE__ */
|
|
660
|
+
children: /* @__PURE__ */ F(i, {
|
|
660
661
|
title: "Server Unavailable",
|
|
661
662
|
message: "Unable to load refunds. The server might be down or experiencing issues.",
|
|
662
663
|
onRetry: () => X(),
|
|
663
664
|
showRetry: !0
|
|
664
665
|
})
|
|
665
666
|
});
|
|
666
|
-
let
|
|
667
|
-
|
|
667
|
+
let be = (e) => {
|
|
668
|
+
m(e), x({}), _("");
|
|
668
669
|
}, $ = (e, t) => {
|
|
669
670
|
if (e === "status") return;
|
|
670
671
|
let n = {
|
|
671
|
-
...
|
|
672
|
+
...v,
|
|
672
673
|
[e]: t || void 0
|
|
673
674
|
};
|
|
674
|
-
|
|
675
|
+
x(n), Z({
|
|
675
676
|
...n,
|
|
676
|
-
status:
|
|
677
|
+
status: H[f].status
|
|
677
678
|
});
|
|
678
|
-
},
|
|
679
|
+
}, xe = async (e) => {
|
|
679
680
|
try {
|
|
680
|
-
await
|
|
681
|
+
await pe(e), N(!1);
|
|
681
682
|
} catch (e) {
|
|
682
683
|
console.error("Failed to create refund:", e);
|
|
683
684
|
}
|
|
684
|
-
},
|
|
685
|
+
}, Se = async (e) => {
|
|
685
686
|
W(e.id);
|
|
686
687
|
try {
|
|
687
|
-
let t = await
|
|
688
|
+
let t = await me(e.id);
|
|
688
689
|
!t.success && t.error && console.error("Refund processing failed:", t.error);
|
|
689
690
|
} catch (e) {
|
|
690
691
|
console.error("Failed to process refund:", e);
|
|
691
692
|
} finally {
|
|
692
693
|
W(null);
|
|
693
694
|
}
|
|
694
|
-
},
|
|
695
|
-
if (
|
|
696
|
-
await
|
|
695
|
+
}, Ce = async (e) => {
|
|
696
|
+
if (V) try {
|
|
697
|
+
await he(V.id, e), L(!1), U(null);
|
|
697
698
|
} catch (e) {
|
|
698
699
|
console.error("Failed to skip refund:", e);
|
|
699
700
|
}
|
|
700
|
-
},
|
|
701
|
+
}, we = async (e) => {
|
|
701
702
|
W(e.id);
|
|
702
703
|
try {
|
|
703
|
-
let t = await
|
|
704
|
+
let t = await ge(e.id);
|
|
704
705
|
!t.success && t.error && console.error("Refund retry failed:", t.error);
|
|
705
706
|
} catch (e) {
|
|
706
707
|
console.error("Failed to retry refund:", e);
|
|
707
708
|
} finally {
|
|
708
709
|
W(null);
|
|
709
710
|
}
|
|
710
|
-
},
|
|
711
|
+
}, Te = async () => {
|
|
711
712
|
try {
|
|
712
|
-
await
|
|
713
|
+
await _e();
|
|
713
714
|
} catch (e) {
|
|
714
715
|
console.error("Failed to create refunds from webhooks:", e);
|
|
715
716
|
}
|
|
716
|
-
},
|
|
717
|
-
|
|
717
|
+
}, Ee = g ? G.filter((e) => e.gatewayPaymentId.toLowerCase().includes(g.toLowerCase()) || e.gatewayOrderId?.toLowerCase().includes(g.toLowerCase()) || e.reason?.toLowerCase().includes(g.toLowerCase())) : G, De = [
|
|
718
|
+
{
|
|
719
|
+
key: "date",
|
|
720
|
+
header: "Date",
|
|
721
|
+
priority: "primary",
|
|
722
|
+
cellClassName: "whitespace-nowrap",
|
|
723
|
+
cell: (e) => /* @__PURE__ */ I("div", {
|
|
724
|
+
className: "flex flex-col",
|
|
725
|
+
children: [/* @__PURE__ */ F("span", {
|
|
726
|
+
className: "text-sm text-text-primary",
|
|
727
|
+
children: o(e.createdAt).split(" ")[0]
|
|
728
|
+
}), /* @__PURE__ */ F("span", {
|
|
729
|
+
className: "text-xs text-text-muted",
|
|
730
|
+
children: o(e.createdAt).split(" ")[1]
|
|
731
|
+
})]
|
|
732
|
+
})
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
key: "status",
|
|
736
|
+
header: "Status",
|
|
737
|
+
cellClassName: "whitespace-nowrap",
|
|
738
|
+
cell: (e) => {
|
|
739
|
+
let t = R[e.status].icon;
|
|
740
|
+
return /* @__PURE__ */ I("span", {
|
|
741
|
+
className: `inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium rounded ${B(R[e.status].color)}`,
|
|
742
|
+
children: [/* @__PURE__ */ F(t, { className: "size-3" }), /* @__PURE__ */ F("span", {
|
|
743
|
+
className: "hidden sm:inline",
|
|
744
|
+
children: R[e.status].label
|
|
745
|
+
})]
|
|
746
|
+
});
|
|
747
|
+
}
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
key: "source",
|
|
751
|
+
header: "Source",
|
|
752
|
+
priority: "hidden-on-mobile",
|
|
753
|
+
cellClassName: "whitespace-nowrap",
|
|
754
|
+
cell: (e) => /* @__PURE__ */ F("span", {
|
|
755
|
+
className: "text-sm text-text-muted",
|
|
756
|
+
children: z[e.source]
|
|
757
|
+
})
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
key: "provider",
|
|
761
|
+
header: "Provider",
|
|
762
|
+
priority: "hidden-on-mobile",
|
|
763
|
+
cellClassName: "whitespace-nowrap",
|
|
764
|
+
cell: (e) => /* @__PURE__ */ F("span", {
|
|
765
|
+
className: "text-sm text-text-primary capitalize",
|
|
766
|
+
children: e.provider
|
|
767
|
+
})
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
key: "paymentId",
|
|
771
|
+
header: "Payment ID",
|
|
772
|
+
cellClassName: "whitespace-nowrap max-w-[120px] sm:max-w-[200px] truncate",
|
|
773
|
+
cell: (e) => /* @__PURE__ */ F("span", {
|
|
774
|
+
className: "text-sm font-mono text-text-muted",
|
|
775
|
+
children: e.gatewayPaymentId
|
|
776
|
+
})
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
key: "amount",
|
|
780
|
+
header: "Amount",
|
|
781
|
+
headerClassName: "text-right",
|
|
782
|
+
cellClassName: "text-right whitespace-nowrap",
|
|
783
|
+
cell: (e) => /* @__PURE__ */ F("span", {
|
|
784
|
+
className: "text-sm font-medium tabular-nums",
|
|
785
|
+
children: a(e.amount, e.currency)
|
|
786
|
+
})
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
key: "reason",
|
|
790
|
+
header: "Reason",
|
|
791
|
+
priority: "hidden-on-mobile",
|
|
792
|
+
cellClassName: "max-w-[200px] truncate",
|
|
793
|
+
cell: (e) => /* @__PURE__ */ F("span", {
|
|
794
|
+
className: "text-sm text-text-muted",
|
|
795
|
+
children: e.reason || "-"
|
|
796
|
+
})
|
|
797
|
+
}
|
|
798
|
+
], Oe = (e) => /* @__PURE__ */ F(ae, {
|
|
799
|
+
record: e,
|
|
800
|
+
onViewDetails: () => k(e),
|
|
801
|
+
onProcess: () => Se(e),
|
|
802
|
+
onSkip: () => {
|
|
803
|
+
U(e), L(!0);
|
|
804
|
+
},
|
|
805
|
+
onRetry: () => we(e),
|
|
806
|
+
isProcessing: le === e.id
|
|
807
|
+
});
|
|
808
|
+
return ue ? /* @__PURE__ */ I("div", {
|
|
718
809
|
className: "space-y-6 p-6",
|
|
719
810
|
children: [
|
|
720
|
-
/* @__PURE__ */
|
|
721
|
-
/* @__PURE__ */
|
|
811
|
+
/* @__PURE__ */ F("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }),
|
|
812
|
+
/* @__PURE__ */ F("div", {
|
|
722
813
|
className: "grid grid-cols-5 gap-4",
|
|
723
814
|
children: [
|
|
724
815
|
1,
|
|
@@ -726,9 +817,9 @@ var L = {
|
|
|
726
817
|
3,
|
|
727
818
|
4,
|
|
728
819
|
5
|
|
729
|
-
].map((e) => /* @__PURE__ */
|
|
820
|
+
].map((e) => /* @__PURE__ */ F("div", { className: "h-24 bg-bg-sunken animate-pulse rounded-lg" }, e))
|
|
730
821
|
}),
|
|
731
|
-
/* @__PURE__ */
|
|
822
|
+
/* @__PURE__ */ F("div", {
|
|
732
823
|
className: "space-y-2",
|
|
733
824
|
children: [
|
|
734
825
|
1,
|
|
@@ -736,56 +827,46 @@ var L = {
|
|
|
736
827
|
3,
|
|
737
828
|
4,
|
|
738
829
|
5
|
|
739
|
-
].map((e) => /* @__PURE__ */
|
|
830
|
+
].map((e) => /* @__PURE__ */ F("div", { className: "h-16 bg-bg-sunken animate-pulse rounded" }, e))
|
|
740
831
|
})
|
|
741
832
|
]
|
|
742
|
-
}) : /* @__PURE__ */
|
|
833
|
+
}) : /* @__PURE__ */ I("div", {
|
|
743
834
|
className: "space-y-6 p-6",
|
|
744
835
|
children: [
|
|
745
|
-
/* @__PURE__ */
|
|
746
|
-
title:
|
|
836
|
+
/* @__PURE__ */ F(t, {
|
|
837
|
+
title: l("billing.refunds.title", "Refund Management"),
|
|
747
838
|
description: "View and manage refund records",
|
|
748
|
-
actions: /* @__PURE__ */ F(
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
className: "inline-flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-button border border-border-subtle bg-bg-surface hover:bg-bg-sunken/50 transition-colors",
|
|
767
|
-
children: [/* @__PURE__ */ P(D, { className: "size-4" }), "Refresh"]
|
|
768
|
-
}),
|
|
769
|
-
/* @__PURE__ */ F("button", {
|
|
770
|
-
type: "button",
|
|
771
|
-
onClick: () => N(!0),
|
|
772
|
-
className: "inline-flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-button bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bgHover transition-colors",
|
|
773
|
-
children: [/* @__PURE__ */ P(te, { className: "size-4" }), "Create Manual Refund"]
|
|
774
|
-
})
|
|
775
|
-
]
|
|
839
|
+
actions: /* @__PURE__ */ F(ne, {
|
|
840
|
+
primary: {
|
|
841
|
+
label: "Create Manual Refund",
|
|
842
|
+
onSelect: () => N(!0),
|
|
843
|
+
icon: /* @__PURE__ */ F(ee, { className: "size-4" })
|
|
844
|
+
},
|
|
845
|
+
actions: [...Y.length > 0 ? [{
|
|
846
|
+
label: `Import ${Y.length} Failed Webhooks`,
|
|
847
|
+
onSelect: Te,
|
|
848
|
+
disabled: Q,
|
|
849
|
+
icon: Q ? /* @__PURE__ */ F(T, { className: "size-4 animate-spin" }) : /* @__PURE__ */ F(S, { className: "size-4" })
|
|
850
|
+
}] : [], {
|
|
851
|
+
label: "Refresh",
|
|
852
|
+
onSelect: () => {
|
|
853
|
+
X();
|
|
854
|
+
},
|
|
855
|
+
icon: /* @__PURE__ */ F(O, { className: "size-4" })
|
|
856
|
+
}]
|
|
776
857
|
})
|
|
777
858
|
}),
|
|
778
|
-
/* @__PURE__ */
|
|
859
|
+
/* @__PURE__ */ F("div", {
|
|
779
860
|
className: "border-b border-border-subtle",
|
|
780
|
-
children: /* @__PURE__ */
|
|
861
|
+
children: /* @__PURE__ */ F("div", {
|
|
781
862
|
className: "flex flex-wrap gap-2 sm:gap-0",
|
|
782
|
-
children: Object.keys(
|
|
783
|
-
let t =
|
|
784
|
-
return /* @__PURE__ */
|
|
863
|
+
children: Object.keys(H).map((e) => {
|
|
864
|
+
let t = f === e, n = K ? e === "PENDING" ? K.pending : e === "COMPLETED" ? K.completed : e === "FAILED" ? K.failed : K.pending + K.processing + K.completed + K.failed + K.skipped : 0;
|
|
865
|
+
return /* @__PURE__ */ I("button", {
|
|
785
866
|
type: "button",
|
|
786
|
-
onClick: () =>
|
|
867
|
+
onClick: () => be(e),
|
|
787
868
|
className: `flex items-center gap-2 px-4 py-3 text-sm font-medium border-b-2 transition-colors whitespace-nowrap ${t ? "border-action-primary-bg text-text-link" : "border-transparent text-text-muted hover:text-text-primary hover:border-border-subtle"}`,
|
|
788
|
-
children: [
|
|
869
|
+
children: [H[e].label, K && /* @__PURE__ */ F("span", {
|
|
789
870
|
className: `px-2 py-0.5 text-xs rounded-full ${t ? "bg-[var(--color-accent-soft)] text-text-link" : "bg-bg-sunken text-text-muted"}`,
|
|
790
871
|
children: n
|
|
791
872
|
})]
|
|
@@ -793,96 +874,96 @@ var L = {
|
|
|
793
874
|
})
|
|
794
875
|
})
|
|
795
876
|
}),
|
|
796
|
-
/* @__PURE__ */
|
|
877
|
+
/* @__PURE__ */ I("div", {
|
|
797
878
|
className: "flex flex-col sm:flex-row gap-4",
|
|
798
879
|
children: [
|
|
799
|
-
/* @__PURE__ */
|
|
880
|
+
/* @__PURE__ */ I("div", {
|
|
800
881
|
className: "relative flex-1",
|
|
801
|
-
children: [/* @__PURE__ */
|
|
882
|
+
children: [/* @__PURE__ */ F(A, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-text-muted" }), /* @__PURE__ */ F("input", {
|
|
802
883
|
type: "text",
|
|
803
884
|
placeholder: "Search by payment ID, order ID, or reason...",
|
|
804
|
-
value:
|
|
805
|
-
onChange: (e) =>
|
|
885
|
+
value: g,
|
|
886
|
+
onChange: (e) => _(e.target.value),
|
|
806
887
|
className: "w-full pl-[3.25rem] pr-4 py-2 border border-border-subtle rounded-md bg-bg-surface"
|
|
807
888
|
})]
|
|
808
889
|
}),
|
|
809
|
-
/* @__PURE__ */
|
|
890
|
+
/* @__PURE__ */ I("button", {
|
|
810
891
|
type: "button",
|
|
811
|
-
onClick: () =>
|
|
812
|
-
className: `inline-flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md border transition-colors ${
|
|
892
|
+
onClick: () => E(!C),
|
|
893
|
+
className: `inline-flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md border transition-colors ${C ? "border-action-primary-bg bg-[var(--color-accent-soft)] text-text-link" : "border-border-subtle bg-bg-surface hover:bg-bg-sunken/50"}`,
|
|
813
894
|
children: [
|
|
814
|
-
/* @__PURE__ */
|
|
895
|
+
/* @__PURE__ */ F(w, { className: "size-4" }),
|
|
815
896
|
"Filters",
|
|
816
|
-
Object.values(
|
|
897
|
+
Object.values(v).filter(Boolean).length > 0 && /* @__PURE__ */ F("span", {
|
|
817
898
|
className: "px-1.5 py-0.5 text-xs rounded-full bg-action-primary-bg text-action-primary-text",
|
|
818
|
-
children: Object.values(
|
|
899
|
+
children: Object.values(v).filter(Boolean).length
|
|
819
900
|
})
|
|
820
901
|
]
|
|
821
902
|
}),
|
|
822
|
-
Object.values(
|
|
903
|
+
Object.values(v).filter(Boolean).length > 0 && /* @__PURE__ */ I("button", {
|
|
823
904
|
type: "button",
|
|
824
905
|
onClick: () => {
|
|
825
|
-
|
|
906
|
+
x({}), Z({});
|
|
826
907
|
},
|
|
827
908
|
className: "inline-flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md text-text-muted hover:text-text-primary transition-colors",
|
|
828
|
-
children: [/* @__PURE__ */
|
|
909
|
+
children: [/* @__PURE__ */ F(M, { className: "size-4" }), "Clear"]
|
|
829
910
|
})
|
|
830
911
|
]
|
|
831
912
|
}),
|
|
832
|
-
|
|
913
|
+
C && /* @__PURE__ */ I("div", {
|
|
833
914
|
className: "p-4 border border-border-subtle rounded-lg bg-bg-sunken/30 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",
|
|
834
915
|
children: [
|
|
835
|
-
/* @__PURE__ */
|
|
916
|
+
/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("label", {
|
|
836
917
|
className: "block text-sm font-medium mb-1",
|
|
837
918
|
children: "Source"
|
|
838
|
-
}), /* @__PURE__ */
|
|
839
|
-
value:
|
|
919
|
+
}), /* @__PURE__ */ I("select", {
|
|
920
|
+
value: v.source || "",
|
|
840
921
|
onChange: (e) => $("source", e.target.value),
|
|
841
922
|
className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface",
|
|
842
|
-
children: [/* @__PURE__ */
|
|
923
|
+
children: [/* @__PURE__ */ F("option", {
|
|
843
924
|
value: "",
|
|
844
925
|
children: "All Sources"
|
|
845
|
-
}), Object.entries(
|
|
926
|
+
}), Object.entries(z).map(([e, t]) => /* @__PURE__ */ F("option", {
|
|
846
927
|
value: e,
|
|
847
928
|
children: t
|
|
848
929
|
}, e))]
|
|
849
930
|
})] }),
|
|
850
|
-
/* @__PURE__ */
|
|
931
|
+
/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("label", {
|
|
851
932
|
className: "block text-sm font-medium mb-1",
|
|
852
933
|
children: "Provider"
|
|
853
|
-
}), /* @__PURE__ */
|
|
854
|
-
value:
|
|
934
|
+
}), /* @__PURE__ */ I("select", {
|
|
935
|
+
value: v.provider || "",
|
|
855
936
|
onChange: (e) => $("provider", e.target.value),
|
|
856
937
|
className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface",
|
|
857
|
-
children: [/* @__PURE__ */
|
|
938
|
+
children: [/* @__PURE__ */ F("option", {
|
|
858
939
|
value: "",
|
|
859
940
|
children: "All Providers"
|
|
860
|
-
}),
|
|
941
|
+
}), ie.map((e) => /* @__PURE__ */ F("option", {
|
|
861
942
|
value: e,
|
|
862
943
|
children: e.charAt(0).toUpperCase() + e.slice(1)
|
|
863
944
|
}, e))]
|
|
864
945
|
})] }),
|
|
865
|
-
/* @__PURE__ */
|
|
946
|
+
/* @__PURE__ */ I("div", {
|
|
866
947
|
className: "sm:col-span-2 lg:col-span-1",
|
|
867
|
-
children: [/* @__PURE__ */
|
|
948
|
+
children: [/* @__PURE__ */ F("label", {
|
|
868
949
|
className: "block text-sm font-medium mb-1",
|
|
869
950
|
children: "Date Range"
|
|
870
|
-
}), /* @__PURE__ */
|
|
951
|
+
}), /* @__PURE__ */ I("div", {
|
|
871
952
|
className: "flex flex-col sm:flex-row items-start sm:items-center gap-2",
|
|
872
953
|
children: [
|
|
873
|
-
/* @__PURE__ */
|
|
954
|
+
/* @__PURE__ */ F("input", {
|
|
874
955
|
type: "date",
|
|
875
|
-
value:
|
|
956
|
+
value: v.fromDate ? v.fromDate.split("T")[0] : "",
|
|
876
957
|
onChange: (e) => $("fromDate", e.target.value ? new Date(e.target.value).toISOString() : void 0),
|
|
877
958
|
className: "w-full sm:flex-1 p-2 border border-border-subtle rounded-md bg-bg-surface text-sm"
|
|
878
959
|
}),
|
|
879
|
-
/* @__PURE__ */
|
|
960
|
+
/* @__PURE__ */ F("span", {
|
|
880
961
|
className: "text-text-muted hidden sm:inline",
|
|
881
962
|
children: "-"
|
|
882
963
|
}),
|
|
883
|
-
/* @__PURE__ */
|
|
964
|
+
/* @__PURE__ */ F("input", {
|
|
884
965
|
type: "date",
|
|
885
|
-
value:
|
|
966
|
+
value: v.toDate ? v.toDate.split("T")[0] : "",
|
|
886
967
|
onChange: (e) => $("toDate", e.target.value ? new Date(e.target.value).toISOString() : void 0),
|
|
887
968
|
className: "w-full sm:flex-1 p-2 border border-border-subtle rounded-md bg-bg-surface text-sm"
|
|
888
969
|
})
|
|
@@ -891,119 +972,22 @@ var L = {
|
|
|
891
972
|
})
|
|
892
973
|
]
|
|
893
974
|
}),
|
|
894
|
-
|
|
895
|
-
icon: /* @__PURE__ */
|
|
975
|
+
Ee.length === 0 ? /* @__PURE__ */ F(n, {
|
|
976
|
+
icon: /* @__PURE__ */ F(O, { className: "size-6 text-text-muted" }),
|
|
896
977
|
title: "No refund records found",
|
|
897
|
-
description: Object.values(
|
|
898
|
-
}) : /* @__PURE__ */
|
|
978
|
+
description: Object.values(v).filter(Boolean).length > 0 ? "Try adjusting your filters." : f === "PENDING" ? "No pending refunds to process." : "Refund records will appear here when created."
|
|
979
|
+
}) : /* @__PURE__ */ F("div", {
|
|
899
980
|
className: "border border-border-subtle rounded-lg overflow-hidden",
|
|
900
|
-
children: /* @__PURE__ */
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
className: "bg-bg-sunken/50",
|
|
906
|
-
children: /* @__PURE__ */ F("tr", { children: [
|
|
907
|
-
/* @__PURE__ */ P("th", {
|
|
908
|
-
className: "text-left text-sm font-medium text-text-muted px-3 py-2 whitespace-nowrap",
|
|
909
|
-
children: "Date"
|
|
910
|
-
}),
|
|
911
|
-
/* @__PURE__ */ P("th", {
|
|
912
|
-
className: "text-left text-sm font-medium text-text-muted px-3 py-2 whitespace-nowrap",
|
|
913
|
-
children: "Status"
|
|
914
|
-
}),
|
|
915
|
-
/* @__PURE__ */ P("th", {
|
|
916
|
-
className: "text-left text-sm font-medium text-text-muted px-3 py-2 whitespace-nowrap hidden sm:table-cell",
|
|
917
|
-
children: "Source"
|
|
918
|
-
}),
|
|
919
|
-
/* @__PURE__ */ P("th", {
|
|
920
|
-
className: "text-left text-sm font-medium text-text-muted px-3 py-2 whitespace-nowrap hidden md:table-cell",
|
|
921
|
-
children: "Provider"
|
|
922
|
-
}),
|
|
923
|
-
/* @__PURE__ */ P("th", {
|
|
924
|
-
className: "text-left text-sm font-medium text-text-muted px-3 py-2 whitespace-nowrap",
|
|
925
|
-
children: "Payment ID"
|
|
926
|
-
}),
|
|
927
|
-
/* @__PURE__ */ P("th", {
|
|
928
|
-
className: "text-right text-sm font-medium text-text-muted px-3 py-2 whitespace-nowrap",
|
|
929
|
-
children: "Amount"
|
|
930
|
-
}),
|
|
931
|
-
/* @__PURE__ */ P("th", {
|
|
932
|
-
className: "text-left text-sm font-medium text-text-muted px-3 py-2 whitespace-nowrap hidden lg:table-cell",
|
|
933
|
-
children: "Reason"
|
|
934
|
-
}),
|
|
935
|
-
/* @__PURE__ */ P("th", { className: "p-2 w-10" })
|
|
936
|
-
] })
|
|
937
|
-
}), /* @__PURE__ */ P("tbody", {
|
|
938
|
-
className: "divide-y divide-border-subtle",
|
|
939
|
-
children: Te.map((e) => {
|
|
940
|
-
let t = L[e.status].icon;
|
|
941
|
-
return /* @__PURE__ */ F("tr", {
|
|
942
|
-
className: "hover:bg-bg-sunken/30 transition-colors",
|
|
943
|
-
children: [
|
|
944
|
-
/* @__PURE__ */ P("td", {
|
|
945
|
-
className: "px-3 py-2 text-sm text-text-primary whitespace-nowrap",
|
|
946
|
-
children: /* @__PURE__ */ F("div", {
|
|
947
|
-
className: "flex flex-col",
|
|
948
|
-
children: [/* @__PURE__ */ P("span", { children: o(e.createdAt).split(" ")[0] }), /* @__PURE__ */ P("span", {
|
|
949
|
-
className: "text-xs text-text-muted",
|
|
950
|
-
children: o(e.createdAt).split(" ")[1]
|
|
951
|
-
})]
|
|
952
|
-
})
|
|
953
|
-
}),
|
|
954
|
-
/* @__PURE__ */ P("td", {
|
|
955
|
-
className: "px-3 py-2 whitespace-nowrap",
|
|
956
|
-
children: /* @__PURE__ */ F("span", {
|
|
957
|
-
className: `inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium rounded ${z(L[e.status].color)}`,
|
|
958
|
-
children: [/* @__PURE__ */ P(t, { className: "size-3" }), /* @__PURE__ */ P("span", {
|
|
959
|
-
className: "hidden sm:inline",
|
|
960
|
-
children: L[e.status].label
|
|
961
|
-
})]
|
|
962
|
-
})
|
|
963
|
-
}),
|
|
964
|
-
/* @__PURE__ */ P("td", {
|
|
965
|
-
className: "px-3 py-2 text-sm text-text-muted whitespace-nowrap hidden sm:table-cell",
|
|
966
|
-
children: R[e.source]
|
|
967
|
-
}),
|
|
968
|
-
/* @__PURE__ */ P("td", {
|
|
969
|
-
className: "px-3 py-2 text-sm text-text-primary capitalize whitespace-nowrap hidden md:table-cell",
|
|
970
|
-
children: e.provider
|
|
971
|
-
}),
|
|
972
|
-
/* @__PURE__ */ P("td", {
|
|
973
|
-
className: "px-3 py-2 text-sm font-mono text-text-muted whitespace-nowrap max-w-[120px] sm:max-w-[200px] truncate",
|
|
974
|
-
children: e.gatewayPaymentId
|
|
975
|
-
}),
|
|
976
|
-
/* @__PURE__ */ P("td", {
|
|
977
|
-
className: "px-3 py-2 text-sm text-right font-medium whitespace-nowrap",
|
|
978
|
-
children: a(e.amount, e.currency)
|
|
979
|
-
}),
|
|
980
|
-
/* @__PURE__ */ P("td", {
|
|
981
|
-
className: "px-3 py-2 text-sm text-text-muted max-w-[200px] truncate hidden lg:table-cell",
|
|
982
|
-
children: e.reason || "-"
|
|
983
|
-
}),
|
|
984
|
-
/* @__PURE__ */ P("td", {
|
|
985
|
-
className: "p-2 text-center",
|
|
986
|
-
children: /* @__PURE__ */ P(ie, {
|
|
987
|
-
record: e,
|
|
988
|
-
onViewDetails: () => A(e),
|
|
989
|
-
onProcess: () => xe(e),
|
|
990
|
-
onSkip: () => {
|
|
991
|
-
U(e), B(!0);
|
|
992
|
-
},
|
|
993
|
-
onRetry: () => Ce(e),
|
|
994
|
-
isProcessing: ce === e.id
|
|
995
|
-
})
|
|
996
|
-
})
|
|
997
|
-
]
|
|
998
|
-
}, e.id);
|
|
999
|
-
})
|
|
1000
|
-
})]
|
|
1001
|
-
})
|
|
981
|
+
children: /* @__PURE__ */ F(re, {
|
|
982
|
+
columns: De,
|
|
983
|
+
data: Ee,
|
|
984
|
+
rowKey: (e) => e.id,
|
|
985
|
+
rowActions: Oe
|
|
1002
986
|
})
|
|
1003
987
|
}),
|
|
1004
|
-
q.totalCount > 0 && /* @__PURE__ */
|
|
988
|
+
q.totalCount > 0 && /* @__PURE__ */ I("div", {
|
|
1005
989
|
className: "flex flex-col sm:flex-row items-center justify-between gap-4 border-t border-border-subtle pt-4",
|
|
1006
|
-
children: [/* @__PURE__ */
|
|
990
|
+
children: [/* @__PURE__ */ I("p", {
|
|
1007
991
|
className: "text-sm text-text-muted text-center sm:text-left",
|
|
1008
992
|
children: [
|
|
1009
993
|
"Showing ",
|
|
@@ -1016,33 +1000,33 @@ var L = {
|
|
|
1016
1000
|
q.totalCount,
|
|
1017
1001
|
" refunds"
|
|
1018
1002
|
]
|
|
1019
|
-
}), /* @__PURE__ */
|
|
1003
|
+
}), /* @__PURE__ */ I("div", {
|
|
1020
1004
|
className: "flex items-center gap-2",
|
|
1021
1005
|
children: [
|
|
1022
|
-
/* @__PURE__ */
|
|
1006
|
+
/* @__PURE__ */ I("button", {
|
|
1023
1007
|
type: "button",
|
|
1024
|
-
onClick:
|
|
1008
|
+
onClick: fe,
|
|
1025
1009
|
disabled: !q.hasPrevious,
|
|
1026
1010
|
className: "inline-flex items-center gap-1 px-3 py-1.5 text-sm font-medium rounded-button border border-border-subtle bg-bg-surface hover:bg-bg-sunken/50 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
1027
|
-
children: [/* @__PURE__ */
|
|
1011
|
+
children: [/* @__PURE__ */ F(y, { className: "size-4" }), /* @__PURE__ */ F("span", {
|
|
1028
1012
|
className: "hidden sm:inline",
|
|
1029
1013
|
children: "Previous"
|
|
1030
1014
|
})]
|
|
1031
1015
|
}),
|
|
1032
|
-
/* @__PURE__ */
|
|
1016
|
+
/* @__PURE__ */ I("span", {
|
|
1033
1017
|
className: "text-sm text-text-muted px-2",
|
|
1034
1018
|
children: [
|
|
1035
|
-
/* @__PURE__ */
|
|
1019
|
+
/* @__PURE__ */ F("span", {
|
|
1036
1020
|
className: "hidden sm:inline",
|
|
1037
1021
|
children: "Page "
|
|
1038
1022
|
}),
|
|
1039
1023
|
q.page + 1,
|
|
1040
1024
|
" ",
|
|
1041
|
-
/* @__PURE__ */
|
|
1025
|
+
/* @__PURE__ */ F("span", {
|
|
1042
1026
|
className: "hidden sm:inline",
|
|
1043
1027
|
children: "of"
|
|
1044
1028
|
}),
|
|
1045
|
-
/* @__PURE__ */
|
|
1029
|
+
/* @__PURE__ */ F("span", {
|
|
1046
1030
|
className: "sm:hidden",
|
|
1047
1031
|
children: "/"
|
|
1048
1032
|
}),
|
|
@@ -1050,42 +1034,42 @@ var L = {
|
|
|
1050
1034
|
Math.ceil(q.totalCount / q.pageSize)
|
|
1051
1035
|
]
|
|
1052
1036
|
}),
|
|
1053
|
-
/* @__PURE__ */
|
|
1037
|
+
/* @__PURE__ */ I("button", {
|
|
1054
1038
|
type: "button",
|
|
1055
|
-
onClick:
|
|
1039
|
+
onClick: de,
|
|
1056
1040
|
disabled: !q.hasMore,
|
|
1057
1041
|
className: "inline-flex items-center gap-1 px-3 py-1.5 text-sm font-medium rounded-button border border-border-subtle bg-bg-surface hover:bg-bg-sunken/50 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
1058
|
-
children: [/* @__PURE__ */
|
|
1042
|
+
children: [/* @__PURE__ */ F("span", {
|
|
1059
1043
|
className: "hidden sm:inline",
|
|
1060
1044
|
children: "Next"
|
|
1061
|
-
}), /* @__PURE__ */
|
|
1045
|
+
}), /* @__PURE__ */ F(b, { className: "size-4" })]
|
|
1062
1046
|
})
|
|
1063
1047
|
]
|
|
1064
1048
|
})]
|
|
1065
1049
|
}),
|
|
1066
|
-
/* @__PURE__ */
|
|
1067
|
-
isOpen:
|
|
1050
|
+
/* @__PURE__ */ F(oe, {
|
|
1051
|
+
isOpen: j,
|
|
1068
1052
|
onClose: () => N(!1),
|
|
1069
|
-
onSubmit:
|
|
1070
|
-
isSubmitting:
|
|
1053
|
+
onSubmit: xe,
|
|
1054
|
+
isSubmitting: ve
|
|
1071
1055
|
}),
|
|
1072
|
-
/* @__PURE__ */
|
|
1073
|
-
isOpen:
|
|
1074
|
-
record:
|
|
1056
|
+
/* @__PURE__ */ F(se, {
|
|
1057
|
+
isOpen: P,
|
|
1058
|
+
record: V,
|
|
1075
1059
|
onClose: () => {
|
|
1076
|
-
|
|
1060
|
+
L(!1), U(null);
|
|
1077
1061
|
},
|
|
1078
|
-
onSubmit:
|
|
1079
|
-
isSubmitting:
|
|
1062
|
+
onSubmit: Ce,
|
|
1063
|
+
isSubmitting: ye
|
|
1080
1064
|
}),
|
|
1081
|
-
/* @__PURE__ */
|
|
1082
|
-
record:
|
|
1083
|
-
onClose: () =>
|
|
1065
|
+
/* @__PURE__ */ F(ce, {
|
|
1066
|
+
record: D,
|
|
1067
|
+
onClose: () => k(null)
|
|
1084
1068
|
})
|
|
1085
1069
|
]
|
|
1086
1070
|
});
|
|
1087
1071
|
};
|
|
1088
1072
|
//#endregion
|
|
1089
|
-
export {
|
|
1073
|
+
export { U as RefundsPage };
|
|
1090
1074
|
|
|
1091
1075
|
//# sourceMappingURL=RefundsPage.js.map
|