@burdenoff/microfe-product 2026.624.3 → 2026.626.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/product/pages/ContentPageViewPage.js +41 -36
- package/dist/product/pages/ContentPageViewPage.js.map +1 -1
- package/dist/product/pages/ProductCatalogPage.js +63 -50
- package/dist/product/pages/ProductCatalogPage.js.map +1 -1
- package/dist/product/pages/ProductViewPage.js +220 -178
- package/dist/product/pages/ProductViewPage.js.map +1 -1
- package/dist/product-management/modules/content-pages/components/ContentPageForm.js +7 -7
- package/dist/product-management/modules/content-pages/components/ContentPageForm.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPageCreatePage.js +28 -26
- package/dist/product-management/modules/content-pages/pages/ContentPageCreatePage.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPageDetailPage.js +119 -90
- package/dist/product-management/modules/content-pages/pages/ContentPageDetailPage.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPageEditPage.js +33 -31
- package/dist/product-management/modules/content-pages/pages/ContentPageEditPage.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPagesListPage.js +171 -161
- package/dist/product-management/modules/content-pages/pages/ContentPagesListPage.js.map +1 -1
- package/dist/product-management/modules/feature-flags/components/FeatureFlagForm.js +1 -1
- package/dist/product-management/modules/feature-flags/components/FeatureFlagForm.js.map +1 -1
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagCreatePage.js +26 -24
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagCreatePage.js.map +1 -1
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagDetailPage.js +152 -125
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagDetailPage.js.map +1 -1
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagEditPage.js +36 -34
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagEditPage.js.map +1 -1
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagsListPage.js +144 -136
- package/dist/product-management/modules/feature-flags/pages/FeatureFlagsListPage.js.map +1 -1
- package/dist/product-management/modules/press-kit/components/PressKitAssetForm.js +4 -4
- package/dist/product-management/modules/press-kit/components/PressKitAssetForm.js.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitCreatePage.js +28 -26
- package/dist/product-management/modules/press-kit/pages/PressKitCreatePage.js.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitDetailPage.js +111 -84
- package/dist/product-management/modules/press-kit/pages/PressKitDetailPage.js.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitEditPage.js +33 -31
- package/dist/product-management/modules/press-kit/pages/PressKitEditPage.js.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitListPage.js +85 -75
- package/dist/product-management/modules/press-kit/pages/PressKitListPage.js.map +1 -1
- package/dist/product-management/modules/products/components/ProductForm.js +8 -8
- package/dist/product-management/modules/products/components/ProductForm.js.map +1 -1
- package/dist/product-management/modules/products/components/ProductPlans.js +136 -147
- package/dist/product-management/modules/products/components/ProductPlans.js.map +1 -1
- package/dist/product-management/modules/products/pages/ProductCreatePage.js +28 -26
- package/dist/product-management/modules/products/pages/ProductCreatePage.js.map +1 -1
- package/dist/product-management/modules/products/pages/ProductDetailPage.js +170 -140
- package/dist/product-management/modules/products/pages/ProductDetailPage.js.map +1 -1
- package/dist/product-management/modules/products/pages/ProductEditPage.js +32 -30
- package/dist/product-management/modules/products/pages/ProductEditPage.js.map +1 -1
- package/dist/product-management/modules/products/pages/ProductsListPage.js +219 -202
- package/dist/product-management/modules/products/pages/ProductsListPage.js.map +1 -1
- package/dist/product-management/modules/shortcuts/components/ShortcutForm.js +3 -3
- package/dist/product-management/modules/shortcuts/components/ShortcutForm.js.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutCreatePage.js +28 -23
- package/dist/product-management/modules/shortcuts/pages/ShortcutCreatePage.js.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutDetailPage.js +228 -209
- package/dist/product-management/modules/shortcuts/pages/ShortcutDetailPage.js.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutEditPage.js +31 -26
- package/dist/product-management/modules/shortcuts/pages/ShortcutEditPage.js.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutsListPage.js +209 -198
- package/dist/product-management/modules/shortcuts/pages/ShortcutsListPage.js.map +1 -1
- package/dist/product-management/shared/components/AuditHistoryTab.js +19 -17
- package/dist/product-management/shared/components/AuditHistoryTab.js.map +1 -1
- package/dist/product-management/shared/components/feedback/EmptyState.js +2 -20
- package/package.json +2 -2
- package/dist/product-management/shared/components/feedback/EmptyState.js.map +0 -1
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { useTr as e } from "../../../shared/hooks/useTr.js";
|
|
2
2
|
import { useCallback as t, useEffect as n, useState as r } from "react";
|
|
3
|
-
import { Check as i, DollarSign as a, Edit as o, List as s, Loader2 as c, Plus as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import {
|
|
3
|
+
import { Check as i, DollarSign as a, Edit as o, List as s, Loader2 as c, Plus as ee, ToggleLeft as l, ToggleRight as u } from "lucide-react";
|
|
4
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
5
|
+
import { IllustratedEmptyState as m } from "@burdenoff/fe-libs/ui";
|
|
6
|
+
import { graphqlFetch as h } from "@burdenoff/fe-libs/shared/graphql/fetch";
|
|
6
7
|
//#region src/product-management/modules/products/components/ProductPlans.tsx
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
let
|
|
8
|
+
var g = "\n query GetAllPlans {\n getAllPlans {\n id\n name\n price\n currency\n duration\n isActive\n productID\n features {\n id\n quotaId\n quota {\n id\n name\n limits\n }\n }\n createdAt\n }\n }\n", _ = "\n query GetAllQuotas {\n getAllQuotas {\n id\n name\n limits\n }\n }\n", v = "\n mutation CreateQuota($input: createQuotaInput!) {\n createQuota(input: $input)\n }\n", y = "\n mutation CreatePlan($input: createPlanInput!) {\n createPlan(input: $input)\n }\n", te = "\n mutation UpdatePlan($input: updatePlanInput!) {\n updatePlan(input: $input)\n }\n", b = "\n mutation TogglePlan($planID: ID!, $status: Boolean!) {\n togglePlan(planID: $planID, status: $status)\n }\n";
|
|
9
|
+
function x({ productId: x, productName: ne, readOnly: S = !1 }) {
|
|
10
|
+
let C = e(), [w, T] = r([]), [E, re] = r([]), [ie, D] = r(!0), [O, k] = r(null), [A, j] = r(!1), [M, N] = r(null), [P, F] = r(!1), [I, L] = r(!1), [R, z] = r(""), [B, V] = r({
|
|
10
11
|
name: "",
|
|
11
12
|
price: "",
|
|
12
13
|
currency: "USD",
|
|
13
14
|
duration: "monthly",
|
|
14
15
|
quotas: []
|
|
15
16
|
}), H = t(async (e, t) => {
|
|
16
|
-
let n = await
|
|
17
|
+
let n = await h({
|
|
17
18
|
gateway: "global",
|
|
18
19
|
query: e,
|
|
19
20
|
variables: t
|
|
@@ -23,17 +24,17 @@ function b({ productId: b, productName: ne, readOnly: x = !1 }) {
|
|
|
23
24
|
}, []), U = t(async () => {
|
|
24
25
|
try {
|
|
25
26
|
D(!0);
|
|
26
|
-
let [e, t] = await Promise.all([H(
|
|
27
|
-
|
|
27
|
+
let [e, t] = await Promise.all([H(g), H(_)]);
|
|
28
|
+
T((e?.getAllPlans || []).filter((e) => e.productID === x)), re(t?.getAllQuotas || []), k(null);
|
|
28
29
|
} catch (e) {
|
|
29
|
-
k(
|
|
30
|
+
k(C("products.failedToLoadPlans", "Failed to load plans")), console.error("Failed to fetch plans:", e);
|
|
30
31
|
} finally {
|
|
31
32
|
D(!1);
|
|
32
33
|
}
|
|
33
34
|
}, [
|
|
34
|
-
|
|
35
|
+
x,
|
|
35
36
|
H,
|
|
36
|
-
|
|
37
|
+
C
|
|
37
38
|
]);
|
|
38
39
|
n(() => {
|
|
39
40
|
U();
|
|
@@ -49,29 +50,29 @@ function b({ productId: b, productName: ne, readOnly: x = !1 }) {
|
|
|
49
50
|
}, G = async (e) => {
|
|
50
51
|
e.preventDefault(), F(!0);
|
|
51
52
|
try {
|
|
52
|
-
M ? await H(
|
|
53
|
+
M ? await H(te, { input: {
|
|
53
54
|
id: M.id,
|
|
54
55
|
name: B.name,
|
|
55
56
|
price: parseFloat(B.price),
|
|
56
57
|
currency: B.currency,
|
|
57
58
|
duration: B.duration,
|
|
58
59
|
quotas: B.quotas
|
|
59
|
-
} }) : await H(
|
|
60
|
+
} }) : await H(y, { input: {
|
|
60
61
|
name: B.name,
|
|
61
62
|
price: parseFloat(B.price),
|
|
62
63
|
currency: B.currency,
|
|
63
64
|
duration: B.duration,
|
|
64
|
-
productId:
|
|
65
|
+
productId: x,
|
|
65
66
|
quotas: B.quotas
|
|
66
67
|
} }), W(), await U();
|
|
67
68
|
} catch (e) {
|
|
68
|
-
console.error("Failed to save plan:", e), k(
|
|
69
|
+
console.error("Failed to save plan:", e), k(C("products.failedToSavePlan", "Failed to save plan"));
|
|
69
70
|
} finally {
|
|
70
71
|
F(!1);
|
|
71
72
|
}
|
|
72
73
|
}, K = async (e) => {
|
|
73
74
|
try {
|
|
74
|
-
await H(
|
|
75
|
+
await H(b, {
|
|
75
76
|
planID: e.id,
|
|
76
77
|
status: !e.isActive
|
|
77
78
|
}), await U();
|
|
@@ -91,53 +92,53 @@ function b({ productId: b, productName: ne, readOnly: x = !1 }) {
|
|
|
91
92
|
}), j(!0);
|
|
92
93
|
}, J = async () => {
|
|
93
94
|
if (R.trim()) try {
|
|
94
|
-
F(!0), await H(
|
|
95
|
+
F(!0), await H(v, { input: {
|
|
95
96
|
name: R.trim(),
|
|
96
97
|
quotaType: "PRODUCT_SPECIFIC",
|
|
97
98
|
limits: {},
|
|
98
99
|
reusable: !0
|
|
99
100
|
} }), z(""), L(!1), await U();
|
|
100
101
|
} catch (e) {
|
|
101
|
-
console.error("Failed to create quota:", e), k(
|
|
102
|
+
console.error("Failed to create quota:", e), k(C("products.failedToCreateFeature", "Failed to create feature"));
|
|
102
103
|
} finally {
|
|
103
104
|
F(!1);
|
|
104
105
|
}
|
|
105
106
|
}, Y = (e) => {
|
|
106
107
|
let t = e.toLowerCase();
|
|
107
108
|
return t.includes("team") || t.includes("business") || t.includes("enterprise");
|
|
108
|
-
}, X =
|
|
109
|
-
return /* @__PURE__ */
|
|
110
|
-
className: "bg-surface border border-
|
|
109
|
+
}, X = w.filter((e) => !Y(e.name)), Z = w.filter((e) => Y(e.name)), ae = X.filter((e) => e.duration === "monthly"), oe = X.filter((e) => e.duration === "yearly"), [Q, $] = r("individual");
|
|
110
|
+
return /* @__PURE__ */ p("div", {
|
|
111
|
+
className: "bg-bg-surface bg-accent-wash border border-border-seam rounded-card p-6 shadow-elevation-1 transition-[box-shadow,border-color] duration-200 hover:border-border-strong hover:shadow-[var(--shadow-pop)] lg:col-span-2",
|
|
111
112
|
children: [
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ p("div", {
|
|
113
114
|
className: "flex items-center justify-between mb-4",
|
|
114
|
-
children: [/* @__PURE__ */
|
|
115
|
+
children: [/* @__PURE__ */ p("h2", {
|
|
115
116
|
className: "text-lg font-semibold text-text-primary flex items-center gap-2",
|
|
116
|
-
children: [/* @__PURE__ */
|
|
117
|
-
}), !
|
|
117
|
+
children: [/* @__PURE__ */ f(a, { size: 18 }), C("products.pricingPlans", "Pricing Plans")]
|
|
118
|
+
}), !S && /* @__PURE__ */ p("button", {
|
|
118
119
|
type: "button",
|
|
119
120
|
onClick: () => {
|
|
120
121
|
W(), j(!A);
|
|
121
122
|
},
|
|
122
123
|
className: "\n inline-flex items-center gap-1.5 px-3 py-1.5\n bg-[var(--color-bg-accent)] text-[var(--color-text-on-accent)]\n rounded-lg text-sm font-medium\n hover:opacity-90 transition-all duration-200\n ",
|
|
123
|
-
children: [/* @__PURE__ */
|
|
124
|
+
children: [/* @__PURE__ */ f(ee, { size: 14 }), C("products.addPlan", "Add Plan")]
|
|
124
125
|
})]
|
|
125
126
|
}),
|
|
126
|
-
A && !
|
|
127
|
+
A && !S && /* @__PURE__ */ p("form", {
|
|
127
128
|
onSubmit: G,
|
|
128
129
|
className: "mb-6 p-4 bg-bg-sunken rounded-lg border border-default",
|
|
129
130
|
children: [
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ f("h3", {
|
|
131
132
|
className: "text-sm font-semibold text-text-primary mb-3",
|
|
132
|
-
children: M ?
|
|
133
|
+
children: M ? C("products.editPlan", "Edit Plan") : C("products.createNewPlan", "Create New Plan")
|
|
133
134
|
}),
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ p("div", {
|
|
135
136
|
className: "grid grid-cols-2 sm:grid-cols-4 gap-3",
|
|
136
137
|
children: [
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("label", {
|
|
138
139
|
className: "block text-xs font-medium text-text-secondary mb-1",
|
|
139
|
-
children: [
|
|
140
|
-
}), /* @__PURE__ */
|
|
140
|
+
children: [C("products.planName", "Name"), " *"]
|
|
141
|
+
}), /* @__PURE__ */ f("input", {
|
|
141
142
|
type: "text",
|
|
142
143
|
value: B.name,
|
|
143
144
|
onChange: (e) => V({
|
|
@@ -148,10 +149,10 @@ function b({ productId: b, productName: ne, readOnly: x = !1 }) {
|
|
|
148
149
|
required: !0,
|
|
149
150
|
className: "w-full px-3 py-2 text-sm rounded-md border border-default bg-surface text-text-primary"
|
|
150
151
|
})] }),
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("label", {
|
|
152
153
|
className: "block text-xs font-medium text-text-secondary mb-1",
|
|
153
|
-
children: [
|
|
154
|
-
}), /* @__PURE__ */
|
|
154
|
+
children: [C("products.planPrice", "Price"), " *"]
|
|
155
|
+
}), /* @__PURE__ */ f("input", {
|
|
155
156
|
type: "number",
|
|
156
157
|
step: "0.01",
|
|
157
158
|
min: "0",
|
|
@@ -164,28 +165,28 @@ function b({ productId: b, productName: ne, readOnly: x = !1 }) {
|
|
|
164
165
|
required: !0,
|
|
165
166
|
className: "w-full px-3 py-2 text-sm rounded-md border border-default bg-surface text-text-primary"
|
|
166
167
|
})] }),
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("label", {
|
|
168
169
|
className: "block text-xs font-medium text-text-secondary mb-1",
|
|
169
|
-
children: [
|
|
170
|
-
}), /* @__PURE__ */
|
|
170
|
+
children: [C("products.planDuration", "Duration"), " *"]
|
|
171
|
+
}), /* @__PURE__ */ p("select", {
|
|
171
172
|
value: B.duration,
|
|
172
173
|
onChange: (e) => V({
|
|
173
174
|
...B,
|
|
174
175
|
duration: e.target.value
|
|
175
176
|
}),
|
|
176
177
|
className: "w-full px-3 py-2 text-sm rounded-md border border-default bg-surface text-text-primary",
|
|
177
|
-
children: [/* @__PURE__ */
|
|
178
|
+
children: [/* @__PURE__ */ f("option", {
|
|
178
179
|
value: "monthly",
|
|
179
|
-
children:
|
|
180
|
-
}), /* @__PURE__ */
|
|
180
|
+
children: C("products.monthly", "Monthly")
|
|
181
|
+
}), /* @__PURE__ */ f("option", {
|
|
181
182
|
value: "yearly",
|
|
182
|
-
children:
|
|
183
|
+
children: C("products.yearly", "Yearly")
|
|
183
184
|
})]
|
|
184
185
|
})] }),
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
186
187
|
className: "block text-xs font-medium text-text-secondary mb-1",
|
|
187
|
-
children:
|
|
188
|
-
}), /* @__PURE__ */
|
|
188
|
+
children: C("products.currency", "Currency")
|
|
189
|
+
}), /* @__PURE__ */ p("select", {
|
|
189
190
|
value: B.currency,
|
|
190
191
|
onChange: (e) => V({
|
|
191
192
|
...B,
|
|
@@ -193,19 +194,19 @@ function b({ productId: b, productName: ne, readOnly: x = !1 }) {
|
|
|
193
194
|
}),
|
|
194
195
|
className: "w-full px-3 py-2 text-sm rounded-md border border-default bg-surface text-text-primary",
|
|
195
196
|
children: [
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ f("option", {
|
|
197
198
|
value: "USD",
|
|
198
199
|
children: "USD"
|
|
199
200
|
}),
|
|
200
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ f("option", {
|
|
201
202
|
value: "EUR",
|
|
202
203
|
children: "EUR"
|
|
203
204
|
}),
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ f("option", {
|
|
205
206
|
value: "GBP",
|
|
206
207
|
children: "GBP"
|
|
207
208
|
}),
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ f("option", {
|
|
209
210
|
value: "INR",
|
|
210
211
|
children: "INR"
|
|
211
212
|
})
|
|
@@ -213,19 +214,19 @@ function b({ productId: b, productName: ne, readOnly: x = !1 }) {
|
|
|
213
214
|
})] })
|
|
214
215
|
]
|
|
215
216
|
}),
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ p("div", {
|
|
217
218
|
className: "mt-3",
|
|
218
|
-
children: [/* @__PURE__ */
|
|
219
|
+
children: [/* @__PURE__ */ p("label", {
|
|
219
220
|
className: "block text-xs font-medium text-text-secondary mb-1",
|
|
220
|
-
children: [/* @__PURE__ */
|
|
221
|
+
children: [/* @__PURE__ */ f(s, {
|
|
221
222
|
size: 12,
|
|
222
223
|
className: "inline mr-1"
|
|
223
|
-
}),
|
|
224
|
-
}),
|
|
224
|
+
}), C("products.featuresQuotas", "Features / Quotas")]
|
|
225
|
+
}), E.length > 0 ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("div", {
|
|
225
226
|
className: "space-y-1.5 max-h-32 overflow-y-auto",
|
|
226
|
-
children:
|
|
227
|
+
children: E.map((e) => /* @__PURE__ */ p("label", {
|
|
227
228
|
className: "flex items-center gap-2 text-xs text-text-primary cursor-pointer hover:bg-bg-sunken/50 px-2 py-1 rounded",
|
|
228
|
-
children: [/* @__PURE__ */
|
|
229
|
+
children: [/* @__PURE__ */ f("input", {
|
|
229
230
|
type: "checkbox",
|
|
230
231
|
checked: B.quotas.some((t) => t.quotaId === e.id),
|
|
231
232
|
onChange: (t) => {
|
|
@@ -243,66 +244,66 @@ function b({ productId: b, productName: ne, readOnly: x = !1 }) {
|
|
|
243
244
|
className: "rounded border-default"
|
|
244
245
|
}), e.name]
|
|
245
246
|
}, e.id))
|
|
246
|
-
}), /* @__PURE__ */
|
|
247
|
+
}), /* @__PURE__ */ p("div", {
|
|
247
248
|
className: "flex items-center gap-2 mt-2",
|
|
248
249
|
children: [
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ p("p", {
|
|
250
251
|
className: "text-xs text-text-secondary",
|
|
251
252
|
children: [
|
|
252
253
|
B.quotas.length,
|
|
253
254
|
" ",
|
|
254
|
-
|
|
255
|
+
C("products.featuresSelected", "feature(s) selected")
|
|
255
256
|
]
|
|
256
257
|
}),
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ f("span", {
|
|
258
259
|
className: "text-xs text-text-secondary",
|
|
259
260
|
children: "|"
|
|
260
261
|
}),
|
|
261
|
-
I ? /* @__PURE__ */
|
|
262
|
+
I ? /* @__PURE__ */ p("div", {
|
|
262
263
|
className: "flex items-center gap-1.5",
|
|
263
264
|
children: [
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ f("input", {
|
|
265
266
|
type: "text",
|
|
266
267
|
value: R,
|
|
267
268
|
onChange: (e) => z(e.target.value),
|
|
268
|
-
placeholder:
|
|
269
|
+
placeholder: C("products.featureNamePlaceholder", "Feature name"),
|
|
269
270
|
className: "px-2 py-1 text-xs rounded border border-default bg-surface text-text-primary w-36",
|
|
270
271
|
onKeyDown: (e) => {
|
|
271
272
|
e.key === "Enter" && (e.preventDefault(), J());
|
|
272
273
|
}
|
|
273
274
|
}),
|
|
274
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ f("button", {
|
|
275
276
|
type: "button",
|
|
276
277
|
onClick: J,
|
|
277
278
|
disabled: P || !R.trim(),
|
|
278
279
|
className: "px-2 py-1 text-xs bg-[var(--color-bg-accent)] text-[var(--color-text-on-accent)] rounded hover:opacity-90 disabled:opacity-50",
|
|
279
|
-
children:
|
|
280
|
+
children: C("productCommon.add", "Add")
|
|
280
281
|
}),
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ f("button", {
|
|
282
283
|
type: "button",
|
|
283
284
|
onClick: () => {
|
|
284
285
|
L(!1), z("");
|
|
285
286
|
},
|
|
286
287
|
className: "px-1.5 py-1 text-xs text-text-secondary hover:text-text-primary",
|
|
287
|
-
children:
|
|
288
|
+
children: C("productCommon.cancel", "Cancel")
|
|
288
289
|
})
|
|
289
290
|
]
|
|
290
|
-
}) : /* @__PURE__ */
|
|
291
|
+
}) : /* @__PURE__ */ f("button", {
|
|
291
292
|
type: "button",
|
|
292
293
|
onClick: () => L(!0),
|
|
293
294
|
className: "text-xs text-[var(--color-action-primary-bg)] hover:underline",
|
|
294
|
-
children:
|
|
295
|
+
children: C("products.createNewFeature", "+ Create new feature")
|
|
295
296
|
})
|
|
296
297
|
]
|
|
297
|
-
})] }) : /* @__PURE__ */
|
|
298
|
+
})] }) : /* @__PURE__ */ p("div", {
|
|
298
299
|
className: "text-xs text-text-secondary",
|
|
299
300
|
children: [
|
|
300
|
-
|
|
301
|
+
C("products.noFeaturesCreated", "No features created yet."),
|
|
301
302
|
" ",
|
|
302
|
-
I ? /* @__PURE__ */
|
|
303
|
+
I ? /* @__PURE__ */ p("div", {
|
|
303
304
|
className: "flex items-center gap-1.5 mt-1.5",
|
|
304
305
|
children: [
|
|
305
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ f("input", {
|
|
306
307
|
type: "text",
|
|
307
308
|
value: R,
|
|
308
309
|
onChange: (e) => z(e.target.value),
|
|
@@ -312,14 +313,14 @@ function b({ productId: b, productName: ne, readOnly: x = !1 }) {
|
|
|
312
313
|
e.key === "Enter" && (e.preventDefault(), J());
|
|
313
314
|
}
|
|
314
315
|
}),
|
|
315
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ f("button", {
|
|
316
317
|
type: "button",
|
|
317
318
|
onClick: J,
|
|
318
319
|
disabled: P || !R.trim(),
|
|
319
320
|
className: "px-2 py-1 text-xs bg-[var(--color-bg-accent)] text-[var(--color-text-on-accent)] rounded hover:opacity-90 disabled:opacity-50",
|
|
320
321
|
children: "Add"
|
|
321
322
|
}),
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ f("button", {
|
|
323
324
|
type: "button",
|
|
324
325
|
onClick: () => {
|
|
325
326
|
L(!1), z("");
|
|
@@ -328,68 +329,56 @@ function b({ productId: b, productName: ne, readOnly: x = !1 }) {
|
|
|
328
329
|
children: "Cancel"
|
|
329
330
|
})
|
|
330
331
|
]
|
|
331
|
-
}) : /* @__PURE__ */
|
|
332
|
+
}) : /* @__PURE__ */ f("button", {
|
|
332
333
|
type: "button",
|
|
333
334
|
onClick: () => L(!0),
|
|
334
335
|
className: "text-[var(--color-action-primary-bg)] hover:underline",
|
|
335
|
-
children:
|
|
336
|
+
children: C("products.createYourFirstFeature", "Create your first feature")
|
|
336
337
|
})
|
|
337
338
|
]
|
|
338
339
|
})]
|
|
339
340
|
}),
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ p("div", {
|
|
341
342
|
className: "flex gap-2 mt-3",
|
|
342
|
-
children: [/* @__PURE__ */
|
|
343
|
+
children: [/* @__PURE__ */ p("button", {
|
|
343
344
|
type: "submit",
|
|
344
345
|
disabled: P,
|
|
345
346
|
className: "\n inline-flex items-center gap-1.5 px-4 py-2\n bg-[var(--color-bg-accent)] text-[var(--color-text-on-accent)]\n rounded-md text-sm font-medium\n hover:opacity-90 transition-all duration-200\n disabled:opacity-50\n ",
|
|
346
|
-
children: [P && /* @__PURE__ */
|
|
347
|
+
children: [P && /* @__PURE__ */ f(c, {
|
|
347
348
|
size: 14,
|
|
348
349
|
className: "animate-spin"
|
|
349
|
-
}), M ?
|
|
350
|
-
}), /* @__PURE__ */
|
|
350
|
+
}), M ? C("products.updatePlan", "Update Plan") : C("products.createPlan", "Create Plan")]
|
|
351
|
+
}), /* @__PURE__ */ f("button", {
|
|
351
352
|
type: "button",
|
|
352
353
|
onClick: W,
|
|
353
354
|
className: "px-4 py-2 text-sm text-text-secondary hover:text-text-primary transition-colors",
|
|
354
|
-
children:
|
|
355
|
+
children: C("productCommon.cancel", "Cancel")
|
|
355
356
|
})]
|
|
356
357
|
})
|
|
357
358
|
]
|
|
358
359
|
}),
|
|
359
|
-
O && /* @__PURE__ */
|
|
360
|
+
O && /* @__PURE__ */ f("div", {
|
|
360
361
|
className: "mb-4 p-3 bg-[var(--color-status-error-subtle)] border border-[var(--color-status-error-border)] rounded-lg text-sm text-[var(--color-status-error)]",
|
|
361
362
|
children: O
|
|
362
363
|
}),
|
|
363
|
-
|
|
364
|
+
ie ? /* @__PURE__ */ p("div", {
|
|
364
365
|
className: "flex items-center justify-center py-8",
|
|
365
|
-
children: [/* @__PURE__ */
|
|
366
|
+
children: [/* @__PURE__ */ f(c, {
|
|
366
367
|
size: 20,
|
|
367
368
|
className: "animate-spin text-text-secondary"
|
|
368
|
-
}), /* @__PURE__ */
|
|
369
|
+
}), /* @__PURE__ */ f("span", {
|
|
369
370
|
className: "ml-2 text-sm text-text-secondary",
|
|
370
|
-
children:
|
|
371
|
+
children: C("products.loadingPlans", "Loading plans...")
|
|
371
372
|
})]
|
|
372
|
-
}) :
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
className: "mx-auto mb-2 text-text-secondary opacity-50"
|
|
378
|
-
}),
|
|
379
|
-
/* @__PURE__ */ d("p", {
|
|
380
|
-
className: "text-sm text-text-secondary",
|
|
381
|
-
children: S("products.noPricingPlans", "No pricing plans yet")
|
|
382
|
-
}),
|
|
383
|
-
/* @__PURE__ */ d("p", {
|
|
384
|
-
className: "text-xs text-text-secondary mt-1",
|
|
385
|
-
children: S("products.clickAddPlan", "Click \"Add Plan\" to create your first plan")
|
|
386
|
-
})
|
|
387
|
-
]
|
|
388
|
-
}) : /* @__PURE__ */ f("div", {
|
|
373
|
+
}) : w.length === 0 ? /* @__PURE__ */ f(m, {
|
|
374
|
+
illustration: "empty-data",
|
|
375
|
+
title: C("products.noPricingPlans", "No pricing plans yet"),
|
|
376
|
+
description: C("products.clickAddPlan", "Click \"Add Plan\" to create your first plan")
|
|
377
|
+
}) : /* @__PURE__ */ p("div", {
|
|
389
378
|
className: "space-y-6",
|
|
390
|
-
children: [Z.length > 0 && /* @__PURE__ */
|
|
379
|
+
children: [Z.length > 0 && /* @__PURE__ */ p("div", {
|
|
391
380
|
className: "flex gap-2 mb-2",
|
|
392
|
-
children: [/* @__PURE__ */
|
|
381
|
+
children: [/* @__PURE__ */ p("button", {
|
|
393
382
|
type: "button",
|
|
394
383
|
onClick: () => $("individual"),
|
|
395
384
|
className: `px-4 py-1.5 rounded-lg text-sm font-medium transition-all ${Q === "individual" ? "bg-[var(--color-action-primary-bg)] text-[var(--color-action-primary-text)]" : "bg-[var(--color-bg-muted)] text-text-secondary hover:text-text-primary"}`,
|
|
@@ -398,7 +387,7 @@ function b({ productId: b, productName: ne, readOnly: x = !1 }) {
|
|
|
398
387
|
X.length,
|
|
399
388
|
")"
|
|
400
389
|
]
|
|
401
|
-
}), /* @__PURE__ */
|
|
390
|
+
}), /* @__PURE__ */ p("button", {
|
|
402
391
|
type: "button",
|
|
403
392
|
onClick: () => $("enterprise"),
|
|
404
393
|
className: `px-4 py-1.5 rounded-lg text-sm font-medium transition-all ${Q === "enterprise" ? "bg-[var(--color-action-primary-bg)] text-[var(--color-action-primary-text)]" : "bg-[var(--color-bg-muted)] text-text-secondary hover:text-text-primary"}`,
|
|
@@ -409,86 +398,86 @@ function b({ productId: b, productName: ne, readOnly: x = !1 }) {
|
|
|
409
398
|
]
|
|
410
399
|
})]
|
|
411
400
|
}), (Q === "individual" || Z.length === 0 ? [{
|
|
412
|
-
label:
|
|
413
|
-
plans: ie
|
|
414
|
-
}, {
|
|
415
|
-
label: S("products.yearlyPlans", "Yearly Plans"),
|
|
401
|
+
label: C("products.monthlyPlans", "Monthly Plans"),
|
|
416
402
|
plans: ae
|
|
403
|
+
}, {
|
|
404
|
+
label: C("products.yearlyPlans", "Yearly Plans"),
|
|
405
|
+
plans: oe
|
|
417
406
|
}] : [{
|
|
418
|
-
label:
|
|
407
|
+
label: C("products.enterprisePlans", "Enterprise Plans"),
|
|
419
408
|
plans: Z
|
|
420
|
-
}]).filter((e) => e.plans.length > 0).map((e) => /* @__PURE__ */
|
|
409
|
+
}]).filter((e) => e.plans.length > 0).map((e) => /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h3", {
|
|
421
410
|
className: "text-xs font-semibold text-text-secondary uppercase tracking-wider mb-3",
|
|
422
411
|
children: e.label
|
|
423
|
-
}), /* @__PURE__ */
|
|
412
|
+
}), /* @__PURE__ */ f("div", {
|
|
424
413
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
425
414
|
children: e.plans.sort((e, t) => e.price - t.price).map((e) => {
|
|
426
415
|
let t = e.currency === "USD" ? "$" : e.currency === "EUR" ? "€" : e.currency === "GBP" ? "£" : "₹", n = e.name.toLowerCase().includes("professional") || e.name.toLowerCase().includes("pro");
|
|
427
|
-
return /* @__PURE__ */
|
|
416
|
+
return /* @__PURE__ */ p("div", {
|
|
428
417
|
className: `
|
|
429
418
|
relative rounded-xl border p-5 transition-all duration-200
|
|
430
419
|
${e.isActive ? "border-default bg-surface hover:shadow-md" : "border-default bg-bg-sunken/30 opacity-60"}
|
|
431
420
|
${n ? "border-[var(--color-action-primary-bg)] ring-1 ring-[var(--color-action-primary-bg)]/20" : ""}
|
|
432
421
|
`,
|
|
433
422
|
children: [
|
|
434
|
-
n && /* @__PURE__ */
|
|
423
|
+
n && /* @__PURE__ */ f("span", {
|
|
435
424
|
className: "absolute -top-2.5 left-1/2 -translate-x-1/2 px-3 py-0.5 text-xs font-semibold bg-[var(--color-action-primary-bg)] text-[var(--color-action-primary-text)] rounded-full",
|
|
436
|
-
children:
|
|
425
|
+
children: C("products.popular", "Popular")
|
|
437
426
|
}),
|
|
438
|
-
/* @__PURE__ */
|
|
427
|
+
/* @__PURE__ */ p("div", {
|
|
439
428
|
className: "flex items-start justify-between mb-3",
|
|
440
|
-
children: [/* @__PURE__ */
|
|
429
|
+
children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h4", {
|
|
441
430
|
className: "text-base font-semibold text-text-primary",
|
|
442
431
|
children: e.name
|
|
443
|
-
}), /* @__PURE__ */
|
|
432
|
+
}), /* @__PURE__ */ f("span", {
|
|
444
433
|
className: `inline-flex items-center px-1.5 py-0.5 text-xs font-medium rounded-full mt-1 ${e.isActive ? "bg-[var(--color-status-success-subtle)] text-[var(--color-status-success)]" : "bg-bg-sunken text-text-secondary"}`,
|
|
445
|
-
children: e.isActive ?
|
|
446
|
-
})] }), !
|
|
434
|
+
children: e.isActive ? C("products.statusActive", "Active") : C("products.statusInactive", "Inactive")
|
|
435
|
+
})] }), !S && /* @__PURE__ */ p("div", {
|
|
447
436
|
className: "flex items-center gap-0.5",
|
|
448
|
-
children: [/* @__PURE__ */
|
|
437
|
+
children: [/* @__PURE__ */ f("button", {
|
|
449
438
|
type: "button",
|
|
450
439
|
onClick: () => K(e),
|
|
451
|
-
title: e.isActive ?
|
|
440
|
+
title: e.isActive ? C("products.deactivate", "Deactivate") : C("products.activate", "Activate"),
|
|
452
441
|
className: "p-1.5 rounded-lg hover:bg-bg-sunken transition-colors text-text-secondary hover:text-text-primary",
|
|
453
|
-
children: e.isActive ? /* @__PURE__ */
|
|
442
|
+
children: e.isActive ? /* @__PURE__ */ f(u, {
|
|
454
443
|
size: 16,
|
|
455
444
|
className: "text-[var(--color-status-success)]"
|
|
456
|
-
}) : /* @__PURE__ */
|
|
457
|
-
}), /* @__PURE__ */
|
|
445
|
+
}) : /* @__PURE__ */ f(l, { size: 16 })
|
|
446
|
+
}), /* @__PURE__ */ f("button", {
|
|
458
447
|
type: "button",
|
|
459
448
|
onClick: () => q(e),
|
|
460
|
-
title:
|
|
449
|
+
title: C("products.edit", "Edit"),
|
|
461
450
|
className: "p-1.5 rounded-lg hover:bg-bg-sunken transition-colors text-text-secondary hover:text-text-primary",
|
|
462
|
-
children: /* @__PURE__ */
|
|
451
|
+
children: /* @__PURE__ */ f(o, { size: 14 })
|
|
463
452
|
})]
|
|
464
453
|
})]
|
|
465
454
|
}),
|
|
466
|
-
/* @__PURE__ */
|
|
455
|
+
/* @__PURE__ */ p("div", {
|
|
467
456
|
className: "mb-4",
|
|
468
|
-
children: [/* @__PURE__ */
|
|
469
|
-
className: "text-3xl font-
|
|
457
|
+
children: [/* @__PURE__ */ p("span", {
|
|
458
|
+
className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
|
|
470
459
|
children: [t, e.price]
|
|
471
|
-
}), /* @__PURE__ */
|
|
460
|
+
}), /* @__PURE__ */ p("span", {
|
|
472
461
|
className: "text-sm text-text-secondary ml-1",
|
|
473
462
|
children: ["/", e.duration === "monthly" ? "month" : "year"]
|
|
474
463
|
})]
|
|
475
464
|
}),
|
|
476
|
-
e.features && e.features.length > 0 ? /* @__PURE__ */
|
|
477
|
-
className: "space-y-2 border-t border-
|
|
465
|
+
e.features && e.features.length > 0 ? /* @__PURE__ */ p("div", {
|
|
466
|
+
className: "space-y-2 border-t border-border-seam pt-3",
|
|
478
467
|
children: [e.features.slice(0, 6).map((e) => {
|
|
479
468
|
let t = e.quota, n = e.quotaId;
|
|
480
469
|
if (t) {
|
|
481
470
|
let e = t.name.split("."), r = ((e.length >= 3 ? e[e.length - 2] : e[e.length - 1]) || t.name).replace(/[-_]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()), i = t.limits && typeof t.limits == "object" ? t.limits.value : null;
|
|
482
471
|
n = typeof i == "number" ? `${i.toLocaleString()} ${r}` : r;
|
|
483
472
|
}
|
|
484
|
-
return /* @__PURE__ */
|
|
473
|
+
return /* @__PURE__ */ p("div", {
|
|
485
474
|
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
486
|
-
children: [/* @__PURE__ */
|
|
475
|
+
children: [/* @__PURE__ */ f(i, {
|
|
487
476
|
size: 14,
|
|
488
477
|
className: "text-[var(--color-status-success)] flex-shrink-0"
|
|
489
|
-
}), /* @__PURE__ */
|
|
478
|
+
}), /* @__PURE__ */ f("span", { children: n })]
|
|
490
479
|
}, e.id);
|
|
491
|
-
}), e.features.length > 6 && /* @__PURE__ */
|
|
480
|
+
}), e.features.length > 6 && /* @__PURE__ */ p("p", {
|
|
492
481
|
className: "text-xs text-text-secondary pl-5",
|
|
493
482
|
children: [
|
|
494
483
|
"+",
|
|
@@ -496,11 +485,11 @@ function b({ productId: b, productName: ne, readOnly: x = !1 }) {
|
|
|
496
485
|
" more"
|
|
497
486
|
]
|
|
498
487
|
})]
|
|
499
|
-
}) : /* @__PURE__ */
|
|
500
|
-
className: "border-t border-
|
|
501
|
-
children: /* @__PURE__ */
|
|
488
|
+
}) : /* @__PURE__ */ f("div", {
|
|
489
|
+
className: "border-t border-border-seam pt-3",
|
|
490
|
+
children: /* @__PURE__ */ f("p", {
|
|
502
491
|
className: "text-xs text-text-secondary italic",
|
|
503
|
-
children:
|
|
492
|
+
children: C("products.noFeaturesAssigned", "No features assigned")
|
|
504
493
|
})
|
|
505
494
|
})
|
|
506
495
|
]
|
|
@@ -512,6 +501,6 @@ function b({ productId: b, productName: ne, readOnly: x = !1 }) {
|
|
|
512
501
|
});
|
|
513
502
|
}
|
|
514
503
|
//#endregion
|
|
515
|
-
export {
|
|
504
|
+
export { x as ProductPlans };
|
|
516
505
|
|
|
517
506
|
//# sourceMappingURL=ProductPlans.js.map
|