@burdenoff/microfe-billing 2026.625.4 → 2026.625.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +192 -187
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonCreatePage.js +322 -317
- package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonDetailPage.js +190 -185
- package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonEditPage.js +297 -292
- package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +60 -75
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonsListPage.js +86 -101
- package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -1
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +124 -121
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js +103 -111
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +196 -160
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +58 -73
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +65 -75
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/RefundsPage.js +399 -399
- package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js +49 -48
- package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.js +144 -151
- package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.js +430 -425
- package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js +121 -93
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CouponsListPage.js +154 -152
- package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js +467 -462
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/EditCouponPage.js +294 -286
- package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/AdminCreditsPage.js +123 -117
- package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +43 -42
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +192 -207
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditsPage.js +40 -56
- package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
- package/dist/billing/modules/dashboard/pages/OverviewPage.js +128 -121
- package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js +165 -180
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.js +103 -100
- package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +175 -175
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.js +96 -96
- package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +42 -40
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +45 -38
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanCreatePage.js +339 -334
- package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanDetailPage.js +80 -74
- package/dist/billing/modules/plans/pages/PlanDetailPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanEditPage.js +342 -337
- package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js +38 -53
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansListPage.js +60 -75
- package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -1
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +242 -237
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -1
- package/dist/billing/modules/promotions/pages/PromotionsListPage.js +29 -39
- package/dist/billing/modules/promotions/pages/PromotionsListPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaPage.js +1 -0
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +299 -294
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +191 -186
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +308 -303
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +57 -78
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/SettingsPage.js +79 -78
- package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +15 -13
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +338 -299
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +82 -103
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +59 -54
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
- package/dist/billing/modules/usage/pages/UsagePage.js +172 -215
- package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
- package/package.json +2 -2
|
@@ -12,14 +12,15 @@ import "../../plans/hooks/index.js";
|
|
|
12
12
|
import { useState as c } from "react";
|
|
13
13
|
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
14
14
|
import { useI18n as f } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
15
|
+
import { PagePurpose as p } from "@burdenoff/fe-libs/ui";
|
|
15
16
|
//#region src/billing/modules/addons/pages/AddonCreatePage.tsx
|
|
16
|
-
var
|
|
17
|
-
let { t:
|
|
18
|
-
let n =
|
|
17
|
+
var m = () => {
|
|
18
|
+
let { t: m } = f(), h = (e, t) => {
|
|
19
|
+
let n = m(e);
|
|
19
20
|
return n === e ? t : n;
|
|
20
|
-
},
|
|
21
|
-
if (!
|
|
22
|
-
if (
|
|
21
|
+
}, g = a(), _ = i(), { quotas: v, isLoading: y } = s({ onlyActive: !0 }), { createAddon: b, isCreating: x } = o(), [S, C] = c(""), [w, T] = c(""), [E, D] = c("USD"), [O, k] = c(r.MONTHLY), [A, j] = c(""), [M, N] = c([]), [P, F] = c([]), [I, L] = c(null), [R, z] = c(!1);
|
|
22
|
+
if (!_.canManageAddons) return /* @__PURE__ */ u(e, { message: h("billing.addons.noCreatePermission", "You don't have permission to create addons.") });
|
|
23
|
+
if (y) return /* @__PURE__ */ d("div", {
|
|
23
24
|
className: "space-y-6 p-6",
|
|
24
25
|
children: [/* @__PURE__ */ u("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ u("div", {
|
|
25
26
|
className: "max-w-2xl space-y-4",
|
|
@@ -32,338 +33,342 @@ var p = () => {
|
|
|
32
33
|
].map((e) => /* @__PURE__ */ u("div", { className: "h-16 bg-bg-sunken animate-pulse rounded" }, e))
|
|
33
34
|
})]
|
|
34
35
|
});
|
|
35
|
-
let
|
|
36
|
-
|
|
36
|
+
let B = () => {
|
|
37
|
+
N([{
|
|
37
38
|
quotaId: "",
|
|
38
39
|
quantity: 1
|
|
39
|
-
}, ...
|
|
40
|
-
},
|
|
41
|
-
M
|
|
42
|
-
},
|
|
43
|
-
let r = [...
|
|
44
|
-
t === "quotaId" ? r[e].quotaId = n : r[e].quantity = Number(n),
|
|
40
|
+
}, ...M]);
|
|
41
|
+
}, V = (e) => {
|
|
42
|
+
N(M.filter((t, n) => n !== e));
|
|
43
|
+
}, H = (e, t, n) => {
|
|
44
|
+
let r = [...M];
|
|
45
|
+
t === "quotaId" ? r[e].quotaId = n : r[e].quantity = Number(n), N(r);
|
|
45
46
|
};
|
|
46
47
|
return /* @__PURE__ */ d("div", {
|
|
47
48
|
className: "space-y-6 p-6",
|
|
48
|
-
children: [
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
id: "name",
|
|
126
|
-
type: "text",
|
|
127
|
-
value: x,
|
|
128
|
-
onChange: (e) => S(e.target.value),
|
|
129
|
-
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)]",
|
|
130
|
-
placeholder: m("billing.addons.addonNamePlaceholder", "e.g., Extra Storage"),
|
|
131
|
-
required: !0
|
|
132
|
-
})] }),
|
|
133
|
-
/* @__PURE__ */ d("div", { children: [
|
|
134
|
-
/* @__PURE__ */ d("label", {
|
|
135
|
-
htmlFor: "productId",
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ u(t, {
|
|
51
|
+
title: h("billing.addons.createNewAddon", "Create New Addon"),
|
|
52
|
+
description: h("billing.addons.createNewAddonDesc", "Set up a new addon with quotas")
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ u(p, { children: h("billing.addons.createPurpose", "Create an add-on that customers can buy on top of a subscription — extra seats, storage, usage credits and so on. Set its price (with optional per-currency overrides) and the quotas it grants, then make it available to purchase.") }),
|
|
55
|
+
/* @__PURE__ */ d("form", {
|
|
56
|
+
onSubmit: async (e) => {
|
|
57
|
+
if (e.preventDefault(), L(null), z(!1), !S.trim()) {
|
|
58
|
+
L("Addon name is required");
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (!w || isNaN(Number(w)) || Number(w) < 0) {
|
|
62
|
+
L("Valid price is required");
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (!A.trim()) {
|
|
66
|
+
L("Product ID is required");
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (M.length === 0) {
|
|
70
|
+
L("At least one quota is required");
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (M.filter((e) => e.quotaId === "").length > 0) {
|
|
74
|
+
L("Please select a quota for all allocations");
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
let t = {
|
|
78
|
+
name: S.trim(),
|
|
79
|
+
price: Number(w),
|
|
80
|
+
currency: E,
|
|
81
|
+
duration: O,
|
|
82
|
+
productId: A.trim(),
|
|
83
|
+
quotas: M.map((e) => ({
|
|
84
|
+
quotaId: e.quotaId,
|
|
85
|
+
quantity: e.quantity
|
|
86
|
+
})),
|
|
87
|
+
...P.length > 0 ? { currencyPriceOverrides: P } : {}
|
|
88
|
+
};
|
|
89
|
+
try {
|
|
90
|
+
await b(t), z(!0), setTimeout(() => g("/addons"), 1500);
|
|
91
|
+
} catch (e) {
|
|
92
|
+
L(e instanceof Error ? e.message : "Failed to create addon");
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
className: "space-y-6",
|
|
96
|
+
children: [
|
|
97
|
+
I && /* @__PURE__ */ u("div", {
|
|
98
|
+
className: "p-4 bg-status-error-bg-subtle border border-border-subtle rounded-lg",
|
|
99
|
+
children: /* @__PURE__ */ u("p", {
|
|
100
|
+
className: "text-sm text-status-error-text",
|
|
101
|
+
children: I
|
|
102
|
+
})
|
|
103
|
+
}),
|
|
104
|
+
R && /* @__PURE__ */ u("div", {
|
|
105
|
+
className: "p-4 bg-status-success-bg-subtle border border-border-subtle rounded-lg",
|
|
106
|
+
children: /* @__PURE__ */ u("p", {
|
|
107
|
+
className: "text-sm text-status-success-text",
|
|
108
|
+
children: h("billing.addons.createSuccess", "Addon created successfully! Redirecting...")
|
|
109
|
+
})
|
|
110
|
+
}),
|
|
111
|
+
/* @__PURE__ */ d("div", {
|
|
112
|
+
className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
|
|
113
|
+
children: [/* @__PURE__ */ d("div", {
|
|
114
|
+
className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)] h-fit",
|
|
115
|
+
children: [/* @__PURE__ */ u("div", {
|
|
116
|
+
className: "p-4 border-b border-border-subtle bg-bg-sunken/30",
|
|
117
|
+
children: /* @__PURE__ */ u("h2", {
|
|
118
|
+
className: "font-semibold text-text-primary",
|
|
119
|
+
children: h("billing.addons.basicInfo", "Basic Information")
|
|
120
|
+
})
|
|
121
|
+
}), /* @__PURE__ */ d("div", {
|
|
122
|
+
className: "p-4 space-y-4",
|
|
123
|
+
children: [
|
|
124
|
+
/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
|
|
125
|
+
htmlFor: "name",
|
|
136
126
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
137
|
-
children: [
|
|
138
|
-
}),
|
|
139
|
-
|
|
140
|
-
id: "productId",
|
|
127
|
+
children: [h("billing.addons.addonNameLabel", "Addon Name"), " *"]
|
|
128
|
+
}), /* @__PURE__ */ u("input", {
|
|
129
|
+
id: "name",
|
|
141
130
|
type: "text",
|
|
142
|
-
value:
|
|
143
|
-
onChange: (e) =>
|
|
131
|
+
value: S,
|
|
132
|
+
onChange: (e) => C(e.target.value),
|
|
144
133
|
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)]",
|
|
145
|
-
placeholder:
|
|
134
|
+
placeholder: h("billing.addons.addonNamePlaceholder", "e.g., Extra Storage"),
|
|
146
135
|
required: !0
|
|
136
|
+
})] }),
|
|
137
|
+
/* @__PURE__ */ d("div", { children: [
|
|
138
|
+
/* @__PURE__ */ d("label", {
|
|
139
|
+
htmlFor: "productId",
|
|
140
|
+
className: "block text-sm font-medium text-text-primary mb-1",
|
|
141
|
+
children: [h("billing.addons.productId", "Product ID"), " *"]
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ u("input", {
|
|
144
|
+
id: "productId",
|
|
145
|
+
type: "text",
|
|
146
|
+
value: A,
|
|
147
|
+
onChange: (e) => j(e.target.value),
|
|
148
|
+
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)]",
|
|
149
|
+
placeholder: h("billing.addons.productIdPlaceholder", "e.g., prod_abc123"),
|
|
150
|
+
required: !0
|
|
151
|
+
}),
|
|
152
|
+
/* @__PURE__ */ u("p", {
|
|
153
|
+
className: "text-xs text-text-muted mt-1",
|
|
154
|
+
children: h("billing.addons.productIdDesc", "The product this addon belongs to")
|
|
155
|
+
})
|
|
156
|
+
] }),
|
|
157
|
+
/* @__PURE__ */ d("div", {
|
|
158
|
+
className: "grid grid-cols-2 gap-4",
|
|
159
|
+
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
|
|
160
|
+
htmlFor: "price",
|
|
161
|
+
className: "block text-sm font-medium text-text-primary mb-1",
|
|
162
|
+
children: [h("billing.addons.priceLabel", "Price"), " *"]
|
|
163
|
+
}), /* @__PURE__ */ u("input", {
|
|
164
|
+
id: "price",
|
|
165
|
+
type: "number",
|
|
166
|
+
step: "0.01",
|
|
167
|
+
min: "0",
|
|
168
|
+
value: w,
|
|
169
|
+
onChange: (e) => T(e.target.value),
|
|
170
|
+
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)]",
|
|
171
|
+
placeholder: "9.99",
|
|
172
|
+
required: !0
|
|
173
|
+
})] }), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
|
|
174
|
+
htmlFor: "currency",
|
|
175
|
+
className: "block text-sm font-medium text-text-primary mb-1",
|
|
176
|
+
children: [h("billing.addons.currencyLabel", "Currency"), " *"]
|
|
177
|
+
}), /* @__PURE__ */ d("select", {
|
|
178
|
+
id: "currency",
|
|
179
|
+
value: E,
|
|
180
|
+
onChange: (e) => D(e.target.value),
|
|
181
|
+
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)]",
|
|
182
|
+
children: [
|
|
183
|
+
/* @__PURE__ */ u("option", {
|
|
184
|
+
value: "USD",
|
|
185
|
+
children: "USD ($)"
|
|
186
|
+
}),
|
|
187
|
+
/* @__PURE__ */ u("option", {
|
|
188
|
+
value: "EUR",
|
|
189
|
+
children: "EUR"
|
|
190
|
+
}),
|
|
191
|
+
/* @__PURE__ */ u("option", {
|
|
192
|
+
value: "GBP",
|
|
193
|
+
children: "GBP"
|
|
194
|
+
}),
|
|
195
|
+
/* @__PURE__ */ u("option", {
|
|
196
|
+
value: "INR",
|
|
197
|
+
children: "INR"
|
|
198
|
+
}),
|
|
199
|
+
/* @__PURE__ */ u("option", {
|
|
200
|
+
value: "AUD",
|
|
201
|
+
children: "AUD"
|
|
202
|
+
}),
|
|
203
|
+
/* @__PURE__ */ u("option", {
|
|
204
|
+
value: "CAD",
|
|
205
|
+
children: "CAD"
|
|
206
|
+
}),
|
|
207
|
+
/* @__PURE__ */ u("option", {
|
|
208
|
+
value: "JPY",
|
|
209
|
+
children: "JPY"
|
|
210
|
+
}),
|
|
211
|
+
/* @__PURE__ */ u("option", {
|
|
212
|
+
value: "SGD",
|
|
213
|
+
children: "SGD"
|
|
214
|
+
})
|
|
215
|
+
]
|
|
216
|
+
})] })]
|
|
147
217
|
}),
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
|
|
150
|
-
children: m("billing.addons.productIdDesc", "The product this addon belongs to")
|
|
151
|
-
})
|
|
152
|
-
] }),
|
|
153
|
-
/* @__PURE__ */ d("div", {
|
|
154
|
-
className: "grid grid-cols-2 gap-4",
|
|
155
|
-
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
|
|
156
|
-
htmlFor: "price",
|
|
218
|
+
/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
|
|
219
|
+
htmlFor: "duration",
|
|
157
220
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
158
|
-
children: [
|
|
159
|
-
}), /* @__PURE__ */ u("input", {
|
|
160
|
-
id: "price",
|
|
161
|
-
type: "number",
|
|
162
|
-
step: "0.01",
|
|
163
|
-
min: "0",
|
|
164
|
-
value: C,
|
|
165
|
-
onChange: (e) => w(e.target.value),
|
|
166
|
-
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)]",
|
|
167
|
-
placeholder: "9.99",
|
|
168
|
-
required: !0
|
|
169
|
-
})] }), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
|
|
170
|
-
htmlFor: "currency",
|
|
171
|
-
className: "block text-sm font-medium text-text-primary mb-1",
|
|
172
|
-
children: [m("billing.addons.currencyLabel", "Currency"), " *"]
|
|
221
|
+
children: [h("billing.addons.billingPeriodLabel", "Billing Period"), " *"]
|
|
173
222
|
}), /* @__PURE__ */ d("select", {
|
|
174
|
-
id: "
|
|
175
|
-
value:
|
|
176
|
-
onChange: (e) =>
|
|
223
|
+
id: "duration",
|
|
224
|
+
value: O,
|
|
225
|
+
onChange: (e) => k(e.target.value),
|
|
177
226
|
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)]",
|
|
178
|
-
children: [
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
value: "EUR",
|
|
185
|
-
children: "EUR"
|
|
186
|
-
}),
|
|
187
|
-
/* @__PURE__ */ u("option", {
|
|
188
|
-
value: "GBP",
|
|
189
|
-
children: "GBP"
|
|
190
|
-
}),
|
|
191
|
-
/* @__PURE__ */ u("option", {
|
|
192
|
-
value: "INR",
|
|
193
|
-
children: "INR"
|
|
194
|
-
}),
|
|
195
|
-
/* @__PURE__ */ u("option", {
|
|
196
|
-
value: "AUD",
|
|
197
|
-
children: "AUD"
|
|
198
|
-
}),
|
|
199
|
-
/* @__PURE__ */ u("option", {
|
|
200
|
-
value: "CAD",
|
|
201
|
-
children: "CAD"
|
|
202
|
-
}),
|
|
203
|
-
/* @__PURE__ */ u("option", {
|
|
204
|
-
value: "JPY",
|
|
205
|
-
children: "JPY"
|
|
206
|
-
}),
|
|
207
|
-
/* @__PURE__ */ u("option", {
|
|
208
|
-
value: "SGD",
|
|
209
|
-
children: "SGD"
|
|
210
|
-
})
|
|
211
|
-
]
|
|
212
|
-
})] })]
|
|
213
|
-
}),
|
|
214
|
-
/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
|
|
215
|
-
htmlFor: "duration",
|
|
216
|
-
className: "block text-sm font-medium text-text-primary mb-1",
|
|
217
|
-
children: [m("billing.addons.billingPeriodLabel", "Billing Period"), " *"]
|
|
218
|
-
}), /* @__PURE__ */ d("select", {
|
|
219
|
-
id: "duration",
|
|
220
|
-
value: D,
|
|
221
|
-
onChange: (e) => O(e.target.value),
|
|
222
|
-
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)]",
|
|
223
|
-
children: [/* @__PURE__ */ u("option", {
|
|
224
|
-
value: r.MONTHLY,
|
|
225
|
-
children: "Monthly"
|
|
226
|
-
}), /* @__PURE__ */ u("option", {
|
|
227
|
-
value: r.YEARLY,
|
|
228
|
-
children: "Yearly"
|
|
229
|
-
})]
|
|
230
|
-
})] })
|
|
231
|
-
]
|
|
232
|
-
})]
|
|
233
|
-
}), /* @__PURE__ */ d("div", {
|
|
234
|
-
className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)] h-fit",
|
|
235
|
-
children: [/* @__PURE__ */ d("div", {
|
|
236
|
-
className: "p-4 border-b border-border-subtle bg-bg-sunken/30 flex items-center justify-between",
|
|
237
|
-
children: [/* @__PURE__ */ d("h2", {
|
|
238
|
-
className: "font-semibold text-text-primary",
|
|
239
|
-
children: [m("billing.addons.quotaAllocations", "Quota Allocations"), " *"]
|
|
240
|
-
}), /* @__PURE__ */ u("button", {
|
|
241
|
-
type: "button",
|
|
242
|
-
onClick: z,
|
|
243
|
-
disabled: _.length === 0,
|
|
244
|
-
className: "px-3 py-1 text-sm font-medium text-text-link hover:bg-[var(--color-accent-soft)] rounded-md transition-colors disabled:opacity-50",
|
|
245
|
-
children: "+ Add Quota"
|
|
246
|
-
})]
|
|
247
|
-
}), /* @__PURE__ */ u("div", {
|
|
248
|
-
className: "p-4 space-y-3",
|
|
249
|
-
children: _.length === 0 ? /* @__PURE__ */ u("p", {
|
|
250
|
-
className: "text-sm text-text-muted",
|
|
251
|
-
children: m("billing.addons.noQuotasAvailable", "No quotas available. Please create quotas first.")
|
|
252
|
-
}) : j.length === 0 ? /* @__PURE__ */ u("p", {
|
|
253
|
-
className: "text-sm text-text-muted",
|
|
254
|
-
children: m("billing.addons.noQuotasAllocated", "No quotas allocated. Click \"Add Quota\" to add one.")
|
|
255
|
-
}) : j.map((e, t) => {
|
|
256
|
-
let n = _.find((t) => t.id === e.quotaId), r = n?.limits, i = r?.value ?? 0, a = r?.type ?? "unknown", o = i * e.quantity;
|
|
257
|
-
return /* @__PURE__ */ d("div", {
|
|
258
|
-
className: "p-3 border border-border-subtle rounded-lg bg-bg-sunken/20 space-y-3",
|
|
259
|
-
children: [/* @__PURE__ */ d("div", {
|
|
260
|
-
className: "flex items-center gap-3",
|
|
261
|
-
children: [/* @__PURE__ */ d("select", {
|
|
262
|
-
value: e.quotaId,
|
|
263
|
-
onChange: (e) => V(t, "quotaId", e.target.value),
|
|
264
|
-
className: `flex-1 px-3 py-2 border border-border-subtle rounded-input bg-bg-surface focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] ${e.quotaId === "" ? "text-text-muted" : "text-text-primary"}`,
|
|
265
|
-
children: [/* @__PURE__ */ u("option", {
|
|
266
|
-
value: "",
|
|
267
|
-
disabled: !0,
|
|
268
|
-
children: m("billing.addons.selectQuota", "Select a quota...")
|
|
269
|
-
}), _.map((e) => /* @__PURE__ */ u("option", {
|
|
270
|
-
value: e.id,
|
|
271
|
-
children: e.name
|
|
272
|
-
}, e.id))]
|
|
273
|
-
}), /* @__PURE__ */ u("button", {
|
|
274
|
-
type: "button",
|
|
275
|
-
onClick: () => B(t),
|
|
276
|
-
className: "p-2 text-status-error-text hover:bg-status-error-bg-subtle rounded-md transition-colors",
|
|
277
|
-
title: "Remove quota",
|
|
278
|
-
children: /* @__PURE__ */ u("svg", {
|
|
279
|
-
className: "size-5",
|
|
280
|
-
fill: "none",
|
|
281
|
-
viewBox: "0 0 24 24",
|
|
282
|
-
stroke: "currentColor",
|
|
283
|
-
children: /* @__PURE__ */ u("path", {
|
|
284
|
-
strokeLinecap: "round",
|
|
285
|
-
strokeLinejoin: "round",
|
|
286
|
-
strokeWidth: 2,
|
|
287
|
-
d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"
|
|
288
|
-
})
|
|
289
|
-
})
|
|
227
|
+
children: [/* @__PURE__ */ u("option", {
|
|
228
|
+
value: r.MONTHLY,
|
|
229
|
+
children: "Monthly"
|
|
230
|
+
}), /* @__PURE__ */ u("option", {
|
|
231
|
+
value: r.YEARLY,
|
|
232
|
+
children: "Yearly"
|
|
290
233
|
})]
|
|
291
|
-
})
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
234
|
+
})] })
|
|
235
|
+
]
|
|
236
|
+
})]
|
|
237
|
+
}), /* @__PURE__ */ d("div", {
|
|
238
|
+
className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)] h-fit",
|
|
239
|
+
children: [/* @__PURE__ */ d("div", {
|
|
240
|
+
className: "p-4 border-b border-border-subtle bg-bg-sunken/30 flex items-center justify-between",
|
|
241
|
+
children: [/* @__PURE__ */ d("h2", {
|
|
242
|
+
className: "font-semibold text-text-primary",
|
|
243
|
+
children: [h("billing.addons.quotaAllocations", "Quota Allocations"), " *"]
|
|
244
|
+
}), /* @__PURE__ */ u("button", {
|
|
245
|
+
type: "button",
|
|
246
|
+
onClick: B,
|
|
247
|
+
disabled: v.length === 0,
|
|
248
|
+
className: "px-3 py-1 text-sm font-medium text-text-link hover:bg-[var(--color-accent-soft)] rounded-md transition-colors disabled:opacity-50",
|
|
249
|
+
children: "+ Add Quota"
|
|
250
|
+
})]
|
|
251
|
+
}), /* @__PURE__ */ u("div", {
|
|
252
|
+
className: "p-4 space-y-3",
|
|
253
|
+
children: v.length === 0 ? /* @__PURE__ */ u("p", {
|
|
254
|
+
className: "text-sm text-text-muted",
|
|
255
|
+
children: h("billing.addons.noQuotasAvailable", "No quotas available. Please create quotas first.")
|
|
256
|
+
}) : M.length === 0 ? /* @__PURE__ */ u("p", {
|
|
257
|
+
className: "text-sm text-text-muted",
|
|
258
|
+
children: h("billing.addons.noQuotasAllocated", "No quotas allocated. Click \"Add Quota\" to add one.")
|
|
259
|
+
}) : M.map((e, t) => {
|
|
260
|
+
let n = v.find((t) => t.id === e.quotaId), r = n?.limits, i = r?.value ?? 0, a = r?.type ?? "unknown", o = i * e.quantity;
|
|
261
|
+
return /* @__PURE__ */ d("div", {
|
|
262
|
+
className: "p-3 border border-border-subtle rounded-lg bg-bg-sunken/20 space-y-3",
|
|
316
263
|
children: [/* @__PURE__ */ d("div", {
|
|
317
|
-
className: "flex items-center gap-
|
|
318
|
-
children: [/* @__PURE__ */ d("
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
264
|
+
className: "flex items-center gap-3",
|
|
265
|
+
children: [/* @__PURE__ */ d("select", {
|
|
266
|
+
value: e.quotaId,
|
|
267
|
+
onChange: (e) => H(t, "quotaId", e.target.value),
|
|
268
|
+
className: `flex-1 px-3 py-2 border border-border-subtle rounded-input bg-bg-surface focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] ${e.quotaId === "" ? "text-text-muted" : "text-text-primary"}`,
|
|
269
|
+
children: [/* @__PURE__ */ u("option", {
|
|
270
|
+
value: "",
|
|
271
|
+
disabled: !0,
|
|
272
|
+
children: h("billing.addons.selectQuota", "Select a quota...")
|
|
273
|
+
}), v.map((e) => /* @__PURE__ */ u("option", {
|
|
274
|
+
value: e.id,
|
|
275
|
+
children: e.name
|
|
276
|
+
}, e.id))]
|
|
277
|
+
}), /* @__PURE__ */ u("button", {
|
|
278
|
+
type: "button",
|
|
279
|
+
onClick: () => V(t),
|
|
280
|
+
className: "p-2 text-status-error-text hover:bg-status-error-bg-subtle rounded-md transition-colors",
|
|
281
|
+
title: "Remove quota",
|
|
282
|
+
children: /* @__PURE__ */ u("svg", {
|
|
283
|
+
className: "size-5",
|
|
284
|
+
fill: "none",
|
|
285
|
+
viewBox: "0 0 24 24",
|
|
286
|
+
stroke: "currentColor",
|
|
287
|
+
children: /* @__PURE__ */ u("path", {
|
|
288
|
+
strokeLinecap: "round",
|
|
289
|
+
strokeLinejoin: "round",
|
|
290
|
+
strokeWidth: 2,
|
|
291
|
+
d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"
|
|
292
|
+
})
|
|
293
|
+
})
|
|
327
294
|
})]
|
|
328
|
-
}), /* @__PURE__ */ d("div", {
|
|
329
|
-
className: "flex items-center
|
|
330
|
-
children:
|
|
295
|
+
}), n && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", {
|
|
296
|
+
className: "flex items-center justify-between text-sm",
|
|
297
|
+
children: /* @__PURE__ */ d("div", {
|
|
331
298
|
className: "text-text-muted",
|
|
332
|
-
children:
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
299
|
+
children: [
|
|
300
|
+
/* @__PURE__ */ d("span", {
|
|
301
|
+
className: "capitalize",
|
|
302
|
+
children: ["Type: ", a]
|
|
303
|
+
}),
|
|
304
|
+
/* @__PURE__ */ u("span", {
|
|
305
|
+
className: "mx-2",
|
|
306
|
+
children: "•"
|
|
307
|
+
}),
|
|
308
|
+
/* @__PURE__ */ d("span", { children: [
|
|
309
|
+
"Value per unit:",
|
|
310
|
+
" ",
|
|
311
|
+
/* @__PURE__ */ u("span", {
|
|
312
|
+
className: "font-medium text-text-primary",
|
|
313
|
+
children: i.toLocaleString()
|
|
314
|
+
})
|
|
315
|
+
] })
|
|
316
|
+
]
|
|
317
|
+
})
|
|
318
|
+
}), /* @__PURE__ */ d("div", {
|
|
319
|
+
className: "flex items-center gap-4",
|
|
320
|
+
children: [/* @__PURE__ */ d("div", {
|
|
321
|
+
className: "flex items-center gap-2",
|
|
322
|
+
children: [/* @__PURE__ */ d("label", {
|
|
323
|
+
className: "text-sm text-text-muted",
|
|
324
|
+
children: [h("billing.addons.quantity", "Quantity"), ":"]
|
|
325
|
+
}), /* @__PURE__ */ u("input", {
|
|
326
|
+
type: "number",
|
|
327
|
+
min: "1",
|
|
328
|
+
value: e.quantity,
|
|
329
|
+
onChange: (e) => H(t, "quantity", e.target.value),
|
|
330
|
+
className: "w-24 px-3 py-1.5 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] text-center"
|
|
331
|
+
})]
|
|
332
|
+
}), /* @__PURE__ */ d("div", {
|
|
333
|
+
className: "flex items-center gap-2 text-sm",
|
|
334
|
+
children: [/* @__PURE__ */ u("span", {
|
|
335
|
+
className: "text-text-muted",
|
|
336
|
+
children: "="
|
|
337
|
+
}), /* @__PURE__ */ d("span", {
|
|
338
|
+
className: "font-semibold text-status-success-text",
|
|
339
|
+
children: [o.toLocaleString(), " total"]
|
|
340
|
+
})]
|
|
336
341
|
})]
|
|
337
|
-
})]
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
})
|
|
342
|
+
})] })]
|
|
343
|
+
}, t);
|
|
344
|
+
})
|
|
345
|
+
})]
|
|
341
346
|
})]
|
|
342
|
-
})
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
})
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
347
|
+
}),
|
|
348
|
+
/* @__PURE__ */ u(n, {
|
|
349
|
+
overrides: P,
|
|
350
|
+
onChange: F
|
|
351
|
+
}),
|
|
352
|
+
/* @__PURE__ */ d("div", {
|
|
353
|
+
className: "flex items-center gap-3 pt-4",
|
|
354
|
+
children: [/* @__PURE__ */ u("button", {
|
|
355
|
+
type: "submit",
|
|
356
|
+
disabled: x || v.length === 0,
|
|
357
|
+
className: "px-6 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors disabled:opacity-50",
|
|
358
|
+
children: x ? h("billing.addons.creating", "Creating...") : h("billing.addons.createAddonBtn", "Create Addon")
|
|
359
|
+
}), /* @__PURE__ */ u("button", {
|
|
360
|
+
type: "button",
|
|
361
|
+
onClick: () => g("/addons"),
|
|
362
|
+
className: "px-6 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
|
|
363
|
+
children: "Cancel"
|
|
364
|
+
})]
|
|
365
|
+
})
|
|
366
|
+
]
|
|
367
|
+
})
|
|
368
|
+
]
|
|
364
369
|
});
|
|
365
370
|
};
|
|
366
371
|
//#endregion
|
|
367
|
-
export {
|
|
372
|
+
export { m as AddonCreatePage };
|
|
368
373
|
|
|
369
374
|
//# sourceMappingURL=AddonCreatePage.js.map
|