@burdenoff/microfe-product 2026.513.3 → 2026.514.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ProductPlans.d.ts","sourceRoot":"","sources":["../../../../../src/product-management/modules/products/components/ProductPlans.tsx"],"names":[],"mappings":"AA8HA,UAAU,iBAAiB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,WAAW,EAAE,YAAY,EACzB,QAAgB,GACjB,EAAE,iBAAiB,2CAgkBnB"}
1
+ {"version":3,"file":"ProductPlans.d.ts","sourceRoot":"","sources":["../../../../../src/product-management/modules/products/components/ProductPlans.tsx"],"names":[],"mappings":"AA8HA,UAAU,iBAAiB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,WAAW,EAAE,YAAY,EACzB,QAAgB,GACjB,EAAE,iBAAiB,2CAmlBnB"}
@@ -439,15 +439,29 @@ function S({ productId: S, productName: ee, readOnly: C = !1 }) {
439
439
  children: ["/", e.duration === "monthly" ? "month" : "year"]
440
440
  })]
441
441
  }),
442
- e.features && e.features.length > 0 ? /* @__PURE__ */ p("div", {
442
+ e.features && e.features.length > 0 ? /* @__PURE__ */ m("div", {
443
443
  className: "space-y-2 border-t border-default pt-3",
444
- children: e.features.map((e) => /* @__PURE__ */ m("div", {
445
- className: "flex items-center gap-2 text-sm text-text-primary",
446
- children: [/* @__PURE__ */ p(i, {
447
- size: 14,
448
- className: "text-[var(--color-status-success)] flex-shrink-0"
449
- }), /* @__PURE__ */ p("span", { children: e.quota?.name || e.quotaId })]
450
- }, e.id))
444
+ children: [e.features.slice(0, 6).map((e) => {
445
+ let t = e.quota, n = e.quotaId;
446
+ if (t) {
447
+ 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;
448
+ n = typeof i == "number" ? `${i.toLocaleString()} ${r}` : r;
449
+ }
450
+ return /* @__PURE__ */ m("div", {
451
+ className: "flex items-center gap-2 text-sm text-text-primary",
452
+ children: [/* @__PURE__ */ p(i, {
453
+ size: 14,
454
+ className: "text-[var(--color-status-success)] flex-shrink-0"
455
+ }), /* @__PURE__ */ p("span", { children: n })]
456
+ }, e.id);
457
+ }), e.features.length > 6 && /* @__PURE__ */ m("p", {
458
+ className: "text-xs text-text-secondary pl-5",
459
+ children: [
460
+ "+",
461
+ e.features.length - 6,
462
+ " more"
463
+ ]
464
+ })]
451
465
  }) : /* @__PURE__ */ p("div", {
452
466
  className: "border-t border-default pt-3",
453
467
  children: /* @__PURE__ */ p("p", {
@@ -1 +1 @@
1
- {"version":3,"file":"ProductPlans.js","names":[],"sources":["../../../../../src/product-management/modules/products/components/ProductPlans.tsx"],"sourcesContent":["/**\n * Product Plans Management Component\n *\n * Displays and manages pricing plans for a product.\n * Fetches plans from the billing service via the global gateway.\n */\nimport { useState, useEffect, useCallback } from 'react';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql/fetch';\nimport {\n Plus,\n Edit,\n ToggleLeft,\n ToggleRight,\n DollarSign,\n Loader2,\n List,\n Check,\n} from 'lucide-react';\nimport { useTr } from '../../../shared/hooks/useTr';\n\n// ============================================================================\n// Types\n// ============================================================================\n\ninterface PlanQuota {\n id: string;\n quotaId: string;\n quota: {\n id: string;\n name: string;\n limits: Record<string, unknown> | null;\n } | null;\n}\n\ninterface Plan {\n id: string;\n name: string;\n price: number;\n currency: string;\n duration: 'monthly' | 'yearly';\n isActive: boolean;\n productID: string | null;\n features: PlanQuota[];\n createdAt: string;\n}\n\ninterface PlanFormData {\n name: string;\n price: string;\n currency: string;\n duration: 'monthly' | 'yearly';\n quotas: Array<{ quotaId: string; quantity: number }>;\n}\n\ninterface Quota {\n id: string;\n name: string;\n limits: Record<string, unknown> | null;\n}\n\n// ============================================================================\n// GraphQL Operations\n// ============================================================================\n\nconst GET_ALL_PLANS = `\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\nconst GET_ALL_QUOTAS = `\n query GetAllQuotas {\n getAllQuotas {\n id\n name\n limits\n }\n }\n`;\n\nconst CREATE_QUOTA = `\n mutation CreateQuota($input: createQuotaInput!) {\n createQuota(input: $input)\n }\n`;\n\nconst CREATE_PLAN = `\n mutation CreatePlan($input: createPlanInput!) {\n createPlan(input: $input)\n }\n`;\n\nconst UPDATE_PLAN = `\n mutation UpdatePlan($input: updatePlanInput!) {\n updatePlan(input: $input)\n }\n`;\n\nconst TOGGLE_PLAN = `\n mutation TogglePlan($planID: ID!, $status: Boolean!) {\n togglePlan(planID: $planID, status: $status)\n }\n`;\n\n// ============================================================================\n// Component\n// ============================================================================\n\ninterface ProductPlansProps {\n productId: string;\n productName: string;\n readOnly?: boolean;\n}\n\nexport function ProductPlans({\n productId,\n productName: _productName,\n readOnly = false,\n}: ProductPlansProps) {\n const tr = useTr();\n\n const [plans, setPlans] = useState<Plan[]>([]);\n const [availableQuotas, setAvailableQuotas] = useState<Quota[]>([]);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<string | null>(null);\n const [showForm, setShowForm] = useState(false);\n const [editingPlan, setEditingPlan] = useState<Plan | null>(null);\n const [submitting, setSubmitting] = useState(false);\n const [showQuotaForm, setShowQuotaForm] = useState(false);\n const [newQuotaName, setNewQuotaName] = useState('');\n const [formData, setFormData] = useState<PlanFormData>({\n name: '',\n price: '',\n currency: 'USD',\n duration: 'monthly',\n quotas: [],\n });\n\n const fetchGraphQL = useCallback(\n async <T,>(query: string, variables?: Record<string, unknown>): Promise<T | null> => {\n const result = await graphqlFetch<T>({\n gateway: 'global',\n query,\n variables,\n });\n if (result.errors?.length) throw new Error(result.errors[0].message);\n return result.data ?? null;\n },\n []\n );\n\n const fetchPlans = useCallback(async () => {\n try {\n setLoading(true);\n const [plansResult, quotasResult] = await Promise.all([\n fetchGraphQL<{ getAllPlans: Plan[] }>(GET_ALL_PLANS),\n fetchGraphQL<{ getAllQuotas: Quota[] }>(GET_ALL_QUOTAS),\n ]);\n const allPlans = plansResult?.getAllPlans || [];\n setPlans(allPlans.filter((p: Plan) => p.productID === productId));\n setAvailableQuotas(quotasResult?.getAllQuotas || []);\n setError(null);\n } catch (err) {\n setError(tr('products.failedToLoadPlans', 'Failed to load plans'));\n console.error('Failed to fetch plans:', err);\n } finally {\n setLoading(false);\n }\n }, [productId, fetchGraphQL]);\n\n useEffect(() => {\n fetchPlans();\n }, [fetchPlans]);\n\n const resetForm = () => {\n setFormData({ name: '', price: '', currency: 'USD', duration: 'monthly', quotas: [] });\n setEditingPlan(null);\n setShowForm(false);\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n setSubmitting(true);\n\n try {\n if (editingPlan) {\n await fetchGraphQL(UPDATE_PLAN, {\n input: {\n id: editingPlan.id,\n name: formData.name,\n price: parseFloat(formData.price),\n currency: formData.currency,\n duration: formData.duration,\n quotas: formData.quotas,\n },\n });\n } else {\n await fetchGraphQL(CREATE_PLAN, {\n input: {\n name: formData.name,\n price: parseFloat(formData.price),\n currency: formData.currency,\n duration: formData.duration,\n productId: productId,\n quotas: formData.quotas,\n },\n });\n }\n\n resetForm();\n await fetchPlans();\n } catch (err) {\n console.error('Failed to save plan:', err);\n setError(tr('products.failedToSavePlan', 'Failed to save plan'));\n } finally {\n setSubmitting(false);\n }\n };\n\n const handleToggle = async (plan: Plan) => {\n try {\n await fetchGraphQL(TOGGLE_PLAN, { planID: plan.id, status: !plan.isActive });\n await fetchPlans();\n } catch (err) {\n console.error('Failed to toggle plan:', err);\n }\n };\n\n const handleEdit = (plan: Plan) => {\n setEditingPlan(plan);\n setFormData({\n name: plan.name,\n price: plan.price.toString(),\n currency: plan.currency,\n duration: plan.duration,\n quotas: (plan.features || []).map((f) => ({\n quotaId: f.quotaId,\n quantity: 1,\n })),\n });\n setShowForm(true);\n };\n\n const handleCreateQuota = async () => {\n if (!newQuotaName.trim()) return;\n try {\n setSubmitting(true);\n await fetchGraphQL(CREATE_QUOTA, {\n input: {\n name: newQuotaName.trim(),\n quotaType: 'PRODUCT_SPECIFIC',\n limits: {},\n reusable: true,\n },\n });\n setNewQuotaName('');\n setShowQuotaForm(false);\n await fetchPlans(); // refreshes quotas too\n } catch (err) {\n console.error('Failed to create quota:', err);\n setError(tr('products.failedToCreateFeature', 'Failed to create feature'));\n } finally {\n setSubmitting(false);\n }\n };\n\n const monthlyPlans = plans.filter((p) => p.duration === 'monthly');\n const yearlyPlans = plans.filter((p) => p.duration === 'yearly');\n\n return (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)] lg:col-span-2\">\n <div className=\"flex items-center justify-between mb-4\">\n <h2 className=\"text-lg font-semibold text-text-primary flex items-center gap-2\">\n <DollarSign size={18} />\n {tr('products.pricingPlans', 'Pricing Plans')}\n </h2>\n {!readOnly && (\n <button\n onClick={() => {\n resetForm();\n setShowForm(!showForm);\n }}\n 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 \"\n >\n <Plus size={14} />\n {tr('products.addPlan', 'Add Plan')}\n </button>\n )}\n </div>\n\n {/* Create/Edit Form */}\n {showForm && !readOnly && (\n <form\n onSubmit={handleSubmit}\n className=\"mb-6 p-4 bg-muted rounded-lg border border-default\"\n >\n <h3 className=\"text-sm font-semibold text-text-primary mb-3\">\n {editingPlan\n ? tr('products.editPlan', 'Edit Plan')\n : tr('products.createNewPlan', 'Create New Plan')}\n </h3>\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3\">\n <div>\n <label className=\"block text-xs font-medium text-text-secondary mb-1\">\n {tr('products.planName', 'Name')} *\n </label>\n <input\n type=\"text\"\n value={formData.name}\n onChange={(e) => setFormData({ ...formData, name: e.target.value })}\n placeholder=\"e.g. Basic\"\n required\n className=\"w-full px-3 py-2 text-sm rounded-md border border-default bg-surface text-text-primary\"\n />\n </div>\n <div>\n <label className=\"block text-xs font-medium text-text-secondary mb-1\">\n {tr('products.planPrice', 'Price')} *\n </label>\n <input\n type=\"number\"\n step=\"0.01\"\n min=\"0\"\n value={formData.price}\n onChange={(e) => setFormData({ ...formData, price: e.target.value })}\n placeholder=\"9.99\"\n required\n className=\"w-full px-3 py-2 text-sm rounded-md border border-default bg-surface text-text-primary\"\n />\n </div>\n <div>\n <label className=\"block text-xs font-medium text-text-secondary mb-1\">\n {tr('products.planDuration', 'Duration')} *\n </label>\n <select\n value={formData.duration}\n onChange={(e) =>\n setFormData({ ...formData, duration: e.target.value as 'monthly' | 'yearly' })\n }\n className=\"w-full px-3 py-2 text-sm rounded-md border border-default bg-surface text-text-primary\"\n >\n <option value=\"monthly\">{tr('products.monthly', 'Monthly')}</option>\n <option value=\"yearly\">{tr('products.yearly', 'Yearly')}</option>\n </select>\n </div>\n <div>\n <label className=\"block text-xs font-medium text-text-secondary mb-1\">\n {tr('products.currency', 'Currency')}\n </label>\n <select\n value={formData.currency}\n onChange={(e) => setFormData({ ...formData, currency: e.target.value })}\n className=\"w-full px-3 py-2 text-sm rounded-md border border-default bg-surface text-text-primary\"\n >\n <option value=\"USD\">USD</option>\n <option value=\"EUR\">EUR</option>\n <option value=\"GBP\">GBP</option>\n <option value=\"INR\">INR</option>\n </select>\n </div>\n </div>\n {/* Quotas/Features */}\n <div className=\"mt-3\">\n <label className=\"block text-xs font-medium text-text-secondary mb-1\">\n <List size={12} className=\"inline mr-1\" />\n {tr('products.featuresQuotas', 'Features / Quotas')}\n </label>\n {availableQuotas.length > 0 ? (\n <>\n <div className=\"space-y-1.5 max-h-32 overflow-y-auto\">\n {availableQuotas.map((quota) => {\n const isSelected = formData.quotas.some((q) => q.quotaId === quota.id);\n return (\n <label\n key={quota.id}\n className=\"flex items-center gap-2 text-xs text-text-primary cursor-pointer hover:bg-muted/50 px-2 py-1 rounded\"\n >\n <input\n type=\"checkbox\"\n checked={isSelected}\n onChange={(e) => {\n if (e.target.checked) {\n setFormData({\n ...formData,\n quotas: [...formData.quotas, { quotaId: quota.id, quantity: 1 }],\n });\n } else {\n setFormData({\n ...formData,\n quotas: formData.quotas.filter((q) => q.quotaId !== quota.id),\n });\n }\n }}\n className=\"rounded border-default\"\n />\n {quota.name}\n </label>\n );\n })}\n </div>\n <div className=\"flex items-center gap-2 mt-2\">\n <p className=\"text-xs text-text-secondary\">\n {formData.quotas.length}{' '}\n {tr('products.featuresSelected', 'feature(s) selected')}\n </p>\n <span className=\"text-xs text-text-secondary\">|</span>\n {!showQuotaForm ? (\n <button\n type=\"button\"\n onClick={() => setShowQuotaForm(true)}\n className=\"text-xs text-[var(--color-action-primary-bg)] hover:underline\"\n >\n {tr('products.createNewFeature', '+ Create new feature')}\n </button>\n ) : (\n <div className=\"flex items-center gap-1.5\">\n <input\n type=\"text\"\n value={newQuotaName}\n onChange={(e) => setNewQuotaName(e.target.value)}\n placeholder={tr('products.featureNamePlaceholder', 'Feature name')}\n className=\"px-2 py-1 text-xs rounded border border-default bg-surface text-text-primary w-36\"\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n handleCreateQuota();\n }\n }}\n />\n <button\n type=\"button\"\n onClick={handleCreateQuota}\n disabled={submitting || !newQuotaName.trim()}\n 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\"\n >\n {tr('productCommon.add', 'Add')}\n </button>\n <button\n type=\"button\"\n onClick={() => {\n setShowQuotaForm(false);\n setNewQuotaName('');\n }}\n className=\"px-1.5 py-1 text-xs text-text-secondary hover:text-text-primary\"\n >\n {tr('productCommon.cancel', 'Cancel')}\n </button>\n </div>\n )}\n </div>\n </>\n ) : (\n <div className=\"text-xs text-text-secondary\">\n {tr('products.noFeaturesCreated', 'No features created yet.')}{' '}\n {!showQuotaForm ? (\n <button\n type=\"button\"\n onClick={() => setShowQuotaForm(true)}\n className=\"text-[var(--color-action-primary-bg)] hover:underline\"\n >\n {tr('products.createYourFirstFeature', 'Create your first feature')}\n </button>\n ) : (\n <div className=\"flex items-center gap-1.5 mt-1.5\">\n <input\n type=\"text\"\n value={newQuotaName}\n onChange={(e) => setNewQuotaName(e.target.value)}\n placeholder=\"Feature name\"\n className=\"px-2 py-1 text-xs rounded border border-default bg-surface text-text-primary w-36\"\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n handleCreateQuota();\n }\n }}\n />\n <button\n type=\"button\"\n onClick={handleCreateQuota}\n disabled={submitting || !newQuotaName.trim()}\n 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\"\n >\n Add\n </button>\n <button\n type=\"button\"\n onClick={() => {\n setShowQuotaForm(false);\n setNewQuotaName('');\n }}\n className=\"px-1.5 py-1 text-xs text-text-secondary hover:text-text-primary\"\n >\n Cancel\n </button>\n </div>\n )}\n </div>\n )}\n </div>\n\n <div className=\"flex gap-2 mt-3\">\n <button\n type=\"submit\"\n disabled={submitting}\n 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 \"\n >\n {submitting && <Loader2 size={14} className=\"animate-spin\" />}\n {editingPlan\n ? tr('products.updatePlan', 'Update Plan')\n : tr('products.createPlan', 'Create Plan')}\n </button>\n <button\n type=\"button\"\n onClick={resetForm}\n className=\"px-4 py-2 text-sm text-text-secondary hover:text-text-primary transition-colors\"\n >\n {tr('productCommon.cancel', 'Cancel')}\n </button>\n </div>\n </form>\n )}\n\n {/* Error */}\n {error && (\n <div 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)]\">\n {error}\n </div>\n )}\n\n {/* Loading */}\n {loading ? (\n <div className=\"flex items-center justify-center py-8\">\n <Loader2 size={20} className=\"animate-spin text-text-secondary\" />\n <span className=\"ml-2 text-sm text-text-secondary\">\n {tr('products.loadingPlans', 'Loading plans...')}\n </span>\n </div>\n ) : plans.length === 0 ? (\n <div className=\"text-center py-8\">\n <DollarSign size={32} className=\"mx-auto mb-2 text-text-secondary opacity-50\" />\n <p className=\"text-sm text-text-secondary\">\n {tr('products.noPricingPlans', 'No pricing plans yet')}\n </p>\n <p className=\"text-xs text-text-secondary mt-1\">\n {tr('products.clickAddPlan', 'Click \"Add Plan\" to create your first plan')}\n </p>\n </div>\n ) : (\n <div className=\"space-y-6\">\n {[\n { label: tr('products.monthlyPlans', 'Monthly Plans'), plans: monthlyPlans },\n { label: tr('products.yearlyPlans', 'Yearly Plans'), plans: yearlyPlans },\n ]\n .filter((g) => g.plans.length > 0)\n .map((group) => (\n <div key={group.label}>\n <h3 className=\"text-xs font-semibold text-text-secondary uppercase tracking-wider mb-3\">\n {group.label}\n </h3>\n <div className=\"grid grid-cols-1 md:grid-cols-3 gap-4\">\n {group.plans\n .sort((a, b) => a.price - b.price)\n .map((plan) => {\n const currencySymbol =\n plan.currency === 'USD'\n ? '$'\n : plan.currency === 'EUR'\n ? '\\u20AC'\n : plan.currency === 'GBP'\n ? '\\u00A3'\n : '\\u20B9';\n const isPopular =\n plan.name.toLowerCase().includes('professional') ||\n plan.name.toLowerCase().includes('pro');\n return (\n <div\n key={plan.id}\n className={`\n relative rounded-xl border p-5 transition-all duration-200\n ${plan.isActive ? 'border-default bg-surface hover:shadow-md' : 'border-default bg-muted/30 opacity-60'}\n ${isPopular ? 'border-[var(--color-action-primary-bg)] ring-1 ring-[var(--color-action-primary-bg)]/20' : ''}\n `}\n >\n {isPopular && (\n <span 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\">\n {tr('products.popular', 'Popular')}\n </span>\n )}\n\n {/* Header */}\n <div className=\"flex items-start justify-between mb-3\">\n <div>\n <h4 className=\"text-base font-semibold text-text-primary\">\n {plan.name}\n </h4>\n <span\n className={`inline-flex items-center px-1.5 py-0.5 text-xs font-medium rounded-full mt-1 ${\n plan.isActive\n ? 'bg-[var(--color-status-success-subtle)] text-[var(--color-status-success)]'\n : 'bg-muted text-text-secondary'\n }`}\n >\n {plan.isActive\n ? tr('products.statusActive', 'Active')\n : tr('products.statusInactive', 'Inactive')}\n </span>\n </div>\n {!readOnly && (\n <div className=\"flex items-center gap-0.5\">\n <button\n onClick={() => handleToggle(plan)}\n title={\n plan.isActive\n ? tr('products.deactivate', 'Deactivate')\n : tr('products.activate', 'Activate')\n }\n className=\"p-1.5 rounded-lg hover:bg-muted transition-colors text-text-secondary hover:text-text-primary\"\n >\n {plan.isActive ? (\n <ToggleRight\n size={16}\n className=\"text-[var(--color-status-success)]\"\n />\n ) : (\n <ToggleLeft size={16} />\n )}\n </button>\n <button\n onClick={() => handleEdit(plan)}\n title={tr('products.edit', 'Edit')}\n className=\"p-1.5 rounded-lg hover:bg-muted transition-colors text-text-secondary hover:text-text-primary\"\n >\n <Edit size={14} />\n </button>\n </div>\n )}\n </div>\n\n {/* Price */}\n <div className=\"mb-4\">\n <span className=\"text-3xl font-bold text-text-primary\">\n {currencySymbol}\n {plan.price}\n </span>\n <span className=\"text-sm text-text-secondary ml-1\">\n /{plan.duration === 'monthly' ? 'month' : 'year'}\n </span>\n </div>\n\n {/* Features */}\n {plan.features && plan.features.length > 0 ? (\n <div className=\"space-y-2 border-t border-default pt-3\">\n {plan.features.map((f) => (\n <div\n key={f.id}\n className=\"flex items-center gap-2 text-sm text-text-primary\"\n >\n <Check\n size={14}\n className=\"text-[var(--color-status-success)] flex-shrink-0\"\n />\n <span>{f.quota?.name || f.quotaId}</span>\n </div>\n ))}\n </div>\n ) : (\n <div className=\"border-t border-default pt-3\">\n <p className=\"text-xs text-text-secondary italic\">\n {tr('products.noFeaturesAssigned', 'No features assigned')}\n </p>\n </div>\n )}\n </div>\n );\n })}\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;AAgEA,IAAM,IAAgB,qTAwBhB,IAAiB,kGAUjB,IAAe,gGAMf,IAAc,6FAMd,IAAc,6FAMd,IAAc;AAgBpB,SAAgB,EAAa,EAC3B,cACA,aAAa,IACb,cAAW,MACS;CACpB,IAAM,IAAK,GAAO,EAEZ,CAAC,GAAO,KAAY,EAAiB,EAAE,CAAC,EACxC,CAAC,GAAiB,KAAsB,EAAkB,EAAE,CAAC,EAC7D,CAAC,GAAS,KAAc,EAAS,GAAK,EACtC,CAAC,GAAO,KAAY,EAAwB,KAAK,EACjD,CAAC,GAAU,KAAe,EAAS,GAAM,EACzC,CAAC,GAAa,KAAkB,EAAsB,KAAK,EAC3D,CAAC,GAAY,KAAiB,EAAS,GAAM,EAC7C,CAAC,GAAe,KAAoB,EAAS,GAAM,EACnD,CAAC,GAAc,KAAmB,EAAS,GAAG,EAC9C,CAAC,GAAU,KAAe,EAAuB;EACrD,MAAM;EACN,OAAO;EACP,UAAU;EACV,UAAU;EACV,QAAQ,EAAE;EACX,CAAC,EAEI,IAAe,EACnB,OAAW,GAAe,MAA2D;EACnF,IAAM,IAAS,MAAM,EAAgB;GACnC,SAAS;GACT;GACA;GACD,CAAC;AACF,MAAI,EAAO,QAAQ,OAAQ,OAAU,MAAM,EAAO,OAAO,GAAG,QAAQ;AACpE,SA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WAC/B,OAAO,EAAG,iBAAiB,OAAO;WAClC,WAAU;qBAEV,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA;WACX,CAAA,CACL;YAEJ;;QAGN,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,QAAD;UAAM,WAAU;oBAAhB,CACG,GACA,EAAK,MACD;aACP,kBAAC,QAAD;UAAM,WAAU;oBAAhB,CAAmD,KAC/C,EAAK,aAAa,YAAY,UAAU,OACrC;YACH;;QAGL,EAAK,YAAY,EAAK,SAAS,SAAS,IACvC,kBAAC,OAAD;SAAK,WAAU;mBACZ,EAAK,SAAS,KAAK,MAClB,kBAAC,OAAD;UAEE,WAAU;oBAFZ,CAIE,kBAAC,GAAD;WACE,MAAM;WACN,WAAU;WACV,CAAA,EACF,kBAAC,QAAD,EAAA,UAAO,EAAE,OAAO,QAAQ,EAAE,SAAe,CAAA,CACrC;YARC,EAAE,GAQH,CACN;SACE,CAAA,GAEN,kBAAC,OAAD;SAAK,WAAU;mBACb,kBAAC,KAAD;UAAG,WAAU;oBACV,EAAG,+BAA+B,uBAAuB;UACxD,CAAA;SACA,CAAA;QAEJ;SAhGC,EAAK,GAgGN;OAER;KACA,CAAA,CACF,EAAA,EAzHI,EAAM,MAyHV,CACN;IACA,CAAA;GAEJ"}
1
+ {"version":3,"file":"ProductPlans.js","names":[],"sources":["../../../../../src/product-management/modules/products/components/ProductPlans.tsx"],"sourcesContent":["/**\n * Product Plans Management Component\n *\n * Displays and manages pricing plans for a product.\n * Fetches plans from the billing service via the global gateway.\n */\nimport { useState, useEffect, useCallback } from 'react';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql/fetch';\nimport {\n Plus,\n Edit,\n ToggleLeft,\n ToggleRight,\n DollarSign,\n Loader2,\n List,\n Check,\n} from 'lucide-react';\nimport { useTr } from '../../../shared/hooks/useTr';\n\n// ============================================================================\n// Types\n// ============================================================================\n\ninterface PlanQuota {\n id: string;\n quotaId: string;\n quota: {\n id: string;\n name: string;\n limits: Record<string, unknown> | null;\n } | null;\n}\n\ninterface Plan {\n id: string;\n name: string;\n price: number;\n currency: string;\n duration: 'monthly' | 'yearly';\n isActive: boolean;\n productID: string | null;\n features: PlanQuota[];\n createdAt: string;\n}\n\ninterface PlanFormData {\n name: string;\n price: string;\n currency: string;\n duration: 'monthly' | 'yearly';\n quotas: Array<{ quotaId: string; quantity: number }>;\n}\n\ninterface Quota {\n id: string;\n name: string;\n limits: Record<string, unknown> | null;\n}\n\n// ============================================================================\n// GraphQL Operations\n// ============================================================================\n\nconst GET_ALL_PLANS = `\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\nconst GET_ALL_QUOTAS = `\n query GetAllQuotas {\n getAllQuotas {\n id\n name\n limits\n }\n }\n`;\n\nconst CREATE_QUOTA = `\n mutation CreateQuota($input: createQuotaInput!) {\n createQuota(input: $input)\n }\n`;\n\nconst CREATE_PLAN = `\n mutation CreatePlan($input: createPlanInput!) {\n createPlan(input: $input)\n }\n`;\n\nconst UPDATE_PLAN = `\n mutation UpdatePlan($input: updatePlanInput!) {\n updatePlan(input: $input)\n }\n`;\n\nconst TOGGLE_PLAN = `\n mutation TogglePlan($planID: ID!, $status: Boolean!) {\n togglePlan(planID: $planID, status: $status)\n }\n`;\n\n// ============================================================================\n// Component\n// ============================================================================\n\ninterface ProductPlansProps {\n productId: string;\n productName: string;\n readOnly?: boolean;\n}\n\nexport function ProductPlans({\n productId,\n productName: _productName,\n readOnly = false,\n}: ProductPlansProps) {\n const tr = useTr();\n\n const [plans, setPlans] = useState<Plan[]>([]);\n const [availableQuotas, setAvailableQuotas] = useState<Quota[]>([]);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<string | null>(null);\n const [showForm, setShowForm] = useState(false);\n const [editingPlan, setEditingPlan] = useState<Plan | null>(null);\n const [submitting, setSubmitting] = useState(false);\n const [showQuotaForm, setShowQuotaForm] = useState(false);\n const [newQuotaName, setNewQuotaName] = useState('');\n const [formData, setFormData] = useState<PlanFormData>({\n name: '',\n price: '',\n currency: 'USD',\n duration: 'monthly',\n quotas: [],\n });\n\n const fetchGraphQL = useCallback(\n async <T,>(query: string, variables?: Record<string, unknown>): Promise<T | null> => {\n const result = await graphqlFetch<T>({\n gateway: 'global',\n query,\n variables,\n });\n if (result.errors?.length) throw new Error(result.errors[0].message);\n return result.data ?? null;\n },\n []\n );\n\n const fetchPlans = useCallback(async () => {\n try {\n setLoading(true);\n const [plansResult, quotasResult] = await Promise.all([\n fetchGraphQL<{ getAllPlans: Plan[] }>(GET_ALL_PLANS),\n fetchGraphQL<{ getAllQuotas: Quota[] }>(GET_ALL_QUOTAS),\n ]);\n const allPlans = plansResult?.getAllPlans || [];\n setPlans(allPlans.filter((p: Plan) => p.productID === productId));\n setAvailableQuotas(quotasResult?.getAllQuotas || []);\n setError(null);\n } catch (err) {\n setError(tr('products.failedToLoadPlans', 'Failed to load plans'));\n console.error('Failed to fetch plans:', err);\n } finally {\n setLoading(false);\n }\n }, [productId, fetchGraphQL]);\n\n useEffect(() => {\n fetchPlans();\n }, [fetchPlans]);\n\n const resetForm = () => {\n setFormData({ name: '', price: '', currency: 'USD', duration: 'monthly', quotas: [] });\n setEditingPlan(null);\n setShowForm(false);\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n setSubmitting(true);\n\n try {\n if (editingPlan) {\n await fetchGraphQL(UPDATE_PLAN, {\n input: {\n id: editingPlan.id,\n name: formData.name,\n price: parseFloat(formData.price),\n currency: formData.currency,\n duration: formData.duration,\n quotas: formData.quotas,\n },\n });\n } else {\n await fetchGraphQL(CREATE_PLAN, {\n input: {\n name: formData.name,\n price: parseFloat(formData.price),\n currency: formData.currency,\n duration: formData.duration,\n productId: productId,\n quotas: formData.quotas,\n },\n });\n }\n\n resetForm();\n await fetchPlans();\n } catch (err) {\n console.error('Failed to save plan:', err);\n setError(tr('products.failedToSavePlan', 'Failed to save plan'));\n } finally {\n setSubmitting(false);\n }\n };\n\n const handleToggle = async (plan: Plan) => {\n try {\n await fetchGraphQL(TOGGLE_PLAN, { planID: plan.id, status: !plan.isActive });\n await fetchPlans();\n } catch (err) {\n console.error('Failed to toggle plan:', err);\n }\n };\n\n const handleEdit = (plan: Plan) => {\n setEditingPlan(plan);\n setFormData({\n name: plan.name,\n price: plan.price.toString(),\n currency: plan.currency,\n duration: plan.duration,\n quotas: (plan.features || []).map((f) => ({\n quotaId: f.quotaId,\n quantity: 1,\n })),\n });\n setShowForm(true);\n };\n\n const handleCreateQuota = async () => {\n if (!newQuotaName.trim()) return;\n try {\n setSubmitting(true);\n await fetchGraphQL(CREATE_QUOTA, {\n input: {\n name: newQuotaName.trim(),\n quotaType: 'PRODUCT_SPECIFIC',\n limits: {},\n reusable: true,\n },\n });\n setNewQuotaName('');\n setShowQuotaForm(false);\n await fetchPlans(); // refreshes quotas too\n } catch (err) {\n console.error('Failed to create quota:', err);\n setError(tr('products.failedToCreateFeature', 'Failed to create feature'));\n } finally {\n setSubmitting(false);\n }\n };\n\n const monthlyPlans = plans.filter((p) => p.duration === 'monthly');\n const yearlyPlans = plans.filter((p) => p.duration === 'yearly');\n\n return (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)] lg:col-span-2\">\n <div className=\"flex items-center justify-between mb-4\">\n <h2 className=\"text-lg font-semibold text-text-primary flex items-center gap-2\">\n <DollarSign size={18} />\n {tr('products.pricingPlans', 'Pricing Plans')}\n </h2>\n {!readOnly && (\n <button\n onClick={() => {\n resetForm();\n setShowForm(!showForm);\n }}\n 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 \"\n >\n <Plus size={14} />\n {tr('products.addPlan', 'Add Plan')}\n </button>\n )}\n </div>\n\n {/* Create/Edit Form */}\n {showForm && !readOnly && (\n <form\n onSubmit={handleSubmit}\n className=\"mb-6 p-4 bg-muted rounded-lg border border-default\"\n >\n <h3 className=\"text-sm font-semibold text-text-primary mb-3\">\n {editingPlan\n ? tr('products.editPlan', 'Edit Plan')\n : tr('products.createNewPlan', 'Create New Plan')}\n </h3>\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3\">\n <div>\n <label className=\"block text-xs font-medium text-text-secondary mb-1\">\n {tr('products.planName', 'Name')} *\n </label>\n <input\n type=\"text\"\n value={formData.name}\n onChange={(e) => setFormData({ ...formData, name: e.target.value })}\n placeholder=\"e.g. Basic\"\n required\n className=\"w-full px-3 py-2 text-sm rounded-md border border-default bg-surface text-text-primary\"\n />\n </div>\n <div>\n <label className=\"block text-xs font-medium text-text-secondary mb-1\">\n {tr('products.planPrice', 'Price')} *\n </label>\n <input\n type=\"number\"\n step=\"0.01\"\n min=\"0\"\n value={formData.price}\n onChange={(e) => setFormData({ ...formData, price: e.target.value })}\n placeholder=\"9.99\"\n required\n className=\"w-full px-3 py-2 text-sm rounded-md border border-default bg-surface text-text-primary\"\n />\n </div>\n <div>\n <label className=\"block text-xs font-medium text-text-secondary mb-1\">\n {tr('products.planDuration', 'Duration')} *\n </label>\n <select\n value={formData.duration}\n onChange={(e) =>\n setFormData({ ...formData, duration: e.target.value as 'monthly' | 'yearly' })\n }\n className=\"w-full px-3 py-2 text-sm rounded-md border border-default bg-surface text-text-primary\"\n >\n <option value=\"monthly\">{tr('products.monthly', 'Monthly')}</option>\n <option value=\"yearly\">{tr('products.yearly', 'Yearly')}</option>\n </select>\n </div>\n <div>\n <label className=\"block text-xs font-medium text-text-secondary mb-1\">\n {tr('products.currency', 'Currency')}\n </label>\n <select\n value={formData.currency}\n onChange={(e) => setFormData({ ...formData, currency: e.target.value })}\n className=\"w-full px-3 py-2 text-sm rounded-md border border-default bg-surface text-text-primary\"\n >\n <option value=\"USD\">USD</option>\n <option value=\"EUR\">EUR</option>\n <option value=\"GBP\">GBP</option>\n <option value=\"INR\">INR</option>\n </select>\n </div>\n </div>\n {/* Quotas/Features */}\n <div className=\"mt-3\">\n <label className=\"block text-xs font-medium text-text-secondary mb-1\">\n <List size={12} className=\"inline mr-1\" />\n {tr('products.featuresQuotas', 'Features / Quotas')}\n </label>\n {availableQuotas.length > 0 ? (\n <>\n <div className=\"space-y-1.5 max-h-32 overflow-y-auto\">\n {availableQuotas.map((quota) => {\n const isSelected = formData.quotas.some((q) => q.quotaId === quota.id);\n return (\n <label\n key={quota.id}\n className=\"flex items-center gap-2 text-xs text-text-primary cursor-pointer hover:bg-muted/50 px-2 py-1 rounded\"\n >\n <input\n type=\"checkbox\"\n checked={isSelected}\n onChange={(e) => {\n if (e.target.checked) {\n setFormData({\n ...formData,\n quotas: [...formData.quotas, { quotaId: quota.id, quantity: 1 }],\n });\n } else {\n setFormData({\n ...formData,\n quotas: formData.quotas.filter((q) => q.quotaId !== quota.id),\n });\n }\n }}\n className=\"rounded border-default\"\n />\n {quota.name}\n </label>\n );\n })}\n </div>\n <div className=\"flex items-center gap-2 mt-2\">\n <p className=\"text-xs text-text-secondary\">\n {formData.quotas.length}{' '}\n {tr('products.featuresSelected', 'feature(s) selected')}\n </p>\n <span className=\"text-xs text-text-secondary\">|</span>\n {!showQuotaForm ? (\n <button\n type=\"button\"\n onClick={() => setShowQuotaForm(true)}\n className=\"text-xs text-[var(--color-action-primary-bg)] hover:underline\"\n >\n {tr('products.createNewFeature', '+ Create new feature')}\n </button>\n ) : (\n <div className=\"flex items-center gap-1.5\">\n <input\n type=\"text\"\n value={newQuotaName}\n onChange={(e) => setNewQuotaName(e.target.value)}\n placeholder={tr('products.featureNamePlaceholder', 'Feature name')}\n className=\"px-2 py-1 text-xs rounded border border-default bg-surface text-text-primary w-36\"\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n handleCreateQuota();\n }\n }}\n />\n <button\n type=\"button\"\n onClick={handleCreateQuota}\n disabled={submitting || !newQuotaName.trim()}\n 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\"\n >\n {tr('productCommon.add', 'Add')}\n </button>\n <button\n type=\"button\"\n onClick={() => {\n setShowQuotaForm(false);\n setNewQuotaName('');\n }}\n className=\"px-1.5 py-1 text-xs text-text-secondary hover:text-text-primary\"\n >\n {tr('productCommon.cancel', 'Cancel')}\n </button>\n </div>\n )}\n </div>\n </>\n ) : (\n <div className=\"text-xs text-text-secondary\">\n {tr('products.noFeaturesCreated', 'No features created yet.')}{' '}\n {!showQuotaForm ? (\n <button\n type=\"button\"\n onClick={() => setShowQuotaForm(true)}\n className=\"text-[var(--color-action-primary-bg)] hover:underline\"\n >\n {tr('products.createYourFirstFeature', 'Create your first feature')}\n </button>\n ) : (\n <div className=\"flex items-center gap-1.5 mt-1.5\">\n <input\n type=\"text\"\n value={newQuotaName}\n onChange={(e) => setNewQuotaName(e.target.value)}\n placeholder=\"Feature name\"\n className=\"px-2 py-1 text-xs rounded border border-default bg-surface text-text-primary w-36\"\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n handleCreateQuota();\n }\n }}\n />\n <button\n type=\"button\"\n onClick={handleCreateQuota}\n disabled={submitting || !newQuotaName.trim()}\n 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\"\n >\n Add\n </button>\n <button\n type=\"button\"\n onClick={() => {\n setShowQuotaForm(false);\n setNewQuotaName('');\n }}\n className=\"px-1.5 py-1 text-xs text-text-secondary hover:text-text-primary\"\n >\n Cancel\n </button>\n </div>\n )}\n </div>\n )}\n </div>\n\n <div className=\"flex gap-2 mt-3\">\n <button\n type=\"submit\"\n disabled={submitting}\n 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 \"\n >\n {submitting && <Loader2 size={14} className=\"animate-spin\" />}\n {editingPlan\n ? tr('products.updatePlan', 'Update Plan')\n : tr('products.createPlan', 'Create Plan')}\n </button>\n <button\n type=\"button\"\n onClick={resetForm}\n className=\"px-4 py-2 text-sm text-text-secondary hover:text-text-primary transition-colors\"\n >\n {tr('productCommon.cancel', 'Cancel')}\n </button>\n </div>\n </form>\n )}\n\n {/* Error */}\n {error && (\n <div 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)]\">\n {error}\n </div>\n )}\n\n {/* Loading */}\n {loading ? (\n <div className=\"flex items-center justify-center py-8\">\n <Loader2 size={20} className=\"animate-spin text-text-secondary\" />\n <span className=\"ml-2 text-sm text-text-secondary\">\n {tr('products.loadingPlans', 'Loading plans...')}\n </span>\n </div>\n ) : plans.length === 0 ? (\n <div className=\"text-center py-8\">\n <DollarSign size={32} className=\"mx-auto mb-2 text-text-secondary opacity-50\" />\n <p className=\"text-sm text-text-secondary\">\n {tr('products.noPricingPlans', 'No pricing plans yet')}\n </p>\n <p className=\"text-xs text-text-secondary mt-1\">\n {tr('products.clickAddPlan', 'Click \"Add Plan\" to create your first plan')}\n </p>\n </div>\n ) : (\n <div className=\"space-y-6\">\n {[\n { label: tr('products.monthlyPlans', 'Monthly Plans'), plans: monthlyPlans },\n { label: tr('products.yearlyPlans', 'Yearly Plans'), plans: yearlyPlans },\n ]\n .filter((g) => g.plans.length > 0)\n .map((group) => (\n <div key={group.label}>\n <h3 className=\"text-xs font-semibold text-text-secondary uppercase tracking-wider mb-3\">\n {group.label}\n </h3>\n <div className=\"grid grid-cols-1 md:grid-cols-3 gap-4\">\n {group.plans\n .sort((a, b) => a.price - b.price)\n .map((plan) => {\n const currencySymbol =\n plan.currency === 'USD'\n ? '$'\n : plan.currency === 'EUR'\n ? '\\u20AC'\n : plan.currency === 'GBP'\n ? '\\u00A3'\n : '\\u20B9';\n const isPopular =\n plan.name.toLowerCase().includes('professional') ||\n plan.name.toLowerCase().includes('pro');\n return (\n <div\n key={plan.id}\n className={`\n relative rounded-xl border p-5 transition-all duration-200\n ${plan.isActive ? 'border-default bg-surface hover:shadow-md' : 'border-default bg-muted/30 opacity-60'}\n ${isPopular ? 'border-[var(--color-action-primary-bg)] ring-1 ring-[var(--color-action-primary-bg)]/20' : ''}\n `}\n >\n {isPopular && (\n <span 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\">\n {tr('products.popular', 'Popular')}\n </span>\n )}\n\n {/* Header */}\n <div className=\"flex items-start justify-between mb-3\">\n <div>\n <h4 className=\"text-base font-semibold text-text-primary\">\n {plan.name}\n </h4>\n <span\n className={`inline-flex items-center px-1.5 py-0.5 text-xs font-medium rounded-full mt-1 ${\n plan.isActive\n ? 'bg-[var(--color-status-success-subtle)] text-[var(--color-status-success)]'\n : 'bg-muted text-text-secondary'\n }`}\n >\n {plan.isActive\n ? tr('products.statusActive', 'Active')\n : tr('products.statusInactive', 'Inactive')}\n </span>\n </div>\n {!readOnly && (\n <div className=\"flex items-center gap-0.5\">\n <button\n onClick={() => handleToggle(plan)}\n title={\n plan.isActive\n ? tr('products.deactivate', 'Deactivate')\n : tr('products.activate', 'Activate')\n }\n className=\"p-1.5 rounded-lg hover:bg-muted transition-colors text-text-secondary hover:text-text-primary\"\n >\n {plan.isActive ? (\n <ToggleRight\n size={16}\n className=\"text-[var(--color-status-success)]\"\n />\n ) : (\n <ToggleLeft size={16} />\n )}\n </button>\n <button\n onClick={() => handleEdit(plan)}\n title={tr('products.edit', 'Edit')}\n className=\"p-1.5 rounded-lg hover:bg-muted transition-colors text-text-secondary hover:text-text-primary\"\n >\n <Edit size={14} />\n </button>\n </div>\n )}\n </div>\n\n {/* Price */}\n <div className=\"mb-4\">\n <span className=\"text-3xl font-bold text-text-primary\">\n {currencySymbol}\n {plan.price}\n </span>\n <span className=\"text-sm text-text-secondary ml-1\">\n /{plan.duration === 'monthly' ? 'month' : 'year'}\n </span>\n </div>\n\n {/* Features */}\n {plan.features && plan.features.length > 0 ? (\n <div className=\"space-y-2 border-t border-default pt-3\">\n {plan.features.slice(0, 6).map((f) => {\n const quota = f.quota;\n let label = f.quotaId;\n if (quota) {\n // Extract readable name from dotted quota name\n const parts = quota.name.split('.');\n const resource = parts.length >= 3 ? parts[parts.length - 2] : parts[parts.length - 1];\n const readableName = (resource || quota.name)\n .replace(/[-_]/g, ' ')\n .replace(/\\b\\w/g, (c: string) => c.toUpperCase());\n const value = quota.limits && typeof quota.limits === 'object' ? (quota.limits as Record<string, unknown>).value : null;\n label = typeof value === 'number' ? `${value.toLocaleString()} ${readableName}` : readableName;\n }\n return (\n <div\n key={f.id}\n className=\"flex items-center gap-2 text-sm text-text-primary\"\n >\n <Check\n size={14}\n className=\"text-[var(--color-status-success)] flex-shrink-0\"\n />\n <span>{label}</span>\n </div>\n );\n })}\n {plan.features.length > 6 && (\n <p className=\"text-xs text-text-secondary pl-5\">\n +{plan.features.length - 6} more\n </p>\n )}\n </div>\n ) : (\n <div className=\"border-t border-default pt-3\">\n <p className=\"text-xs text-text-secondary italic\">\n {tr('products.noFeaturesAssigned', 'No features assigned')}\n </p>\n </div>\n )}\n </div>\n );\n })}\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;AAgEA,IAAM,IAAgB,qTAwBhB,IAAiB,kGAUjB,IAAe,gGAMf,IAAc,6FAMd,IAAc,6FAMd,IAAc;AAgBpB,SAAgB,EAAa,EAC3B,cACA,aAAa,IACb,cAAW,MACS;CACpB,IAAM,IAAK,GAAO,EAEZ,CAAC,GAAO,KAAY,EAAiB,EAAE,CAAC,EACxC,CAAC,GAAiB,KAAsB,EAAkB,EAAE,CAAC,EAC7D,CAAC,GAAS,KAAc,EAAS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O,EAAM,UAAW,WAAY,EAAM,OAAmC,QAAQ;AACnH,eAAQ,OAAO,KAAU,WAAW,GAAG,EAAM,gBAAgB,CAAC,GAAG,MAAiB;;AAEpF,iBACE,kBAAC,OAAD;WAEE,WAAU;qBAFZ,CAIE,kBAAC,GAAD;YACE,MAAM;YACN,WAAU;YACV,CAAA,EACF,kBAAC,QAAD,EAAA,UAAO,GAAa,CAAA,CAChB;aARC,EAAE,GAQH;WAER,EACD,EAAK,SAAS,SAAS,KACtB,kBAAC,KAAD;UAAG,WAAU;oBAAb;WAAgD;WAC5C,EAAK,SAAS,SAAS;WAAE;WACzB;YAEF;aAEN,kBAAC,OAAD;SAAK,WAAU;mBACb,kBAAC,KAAD;UAAG,WAAU;oBACV,EAAG,+BAA+B,uBAAuB;UACxD,CAAA;SACA,CAAA;QAEJ;SAnHC,EAAK,GAmHN;OAER;KACA,CAAA,CACF,EAAA,EA5II,EAAM,MA4IV,CACN;IACA,CAAA;GAEJ"}
@@ -382,7 +382,7 @@ function O() {
382
382
  })]
383
383
  }),
384
384
  /* @__PURE__ */ T(d, {
385
- productId: N.id,
385
+ productId: N.slug,
386
386
  productName: N.name,
387
387
  readOnly: !0
388
388
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"ProductDetailPage.js","names":[],"sources":["../../../../../src/product-management/modules/products/pages/ProductDetailPage.tsx"],"sourcesContent":["import { useParams } from 'react-router-dom';\nimport {\n ArrowLeft,\n Edit,\n ExternalLink,\n FileText,\n Mail,\n MapPin,\n Package,\n Phone,\n Search,\n Share2,\n Shield,\n Trash2,\n} from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport { useProduct, useDeleteProduct } from '../hooks/useProducts';\nimport { ProductStatusBadge } from '../components/ProductStatusBadge';\nimport { ProductPlans } from '../components/ProductPlans';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport { TagList } from '../../../shared/components/TagList';\nimport { AuditHistoryTab } from '../../../shared/components/AuditHistoryTab';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../../../utils/nativeBridge';\n\n/**\n * Product Detail Page\n * Shows comprehensive product information\n */\nexport function ProductDetailPage() {\n const { id } = useParams<{ id: string }>();\n const { navigate, basePath = '/products' } = useProductConsole();\n const { t } = useI18n();\n const tr = (key: string, fallback: string) => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n const { product, loading, error } = useProduct(id!);\n const { deleteProduct, loading: deleteLoading } = useDeleteProduct();\n\n const handleDelete = async () => {\n void nativeImpact('medium');\n const message = tr(\n 'products.confirmDeleteProduct',\n 'Are you sure you want to delete this product?'\n );\n const native = await nativeConfirm({\n title: 'Delete product',\n message,\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n });\n const ok = native === null ? window.confirm(message) : native;\n if (!ok) return;\n\n try {\n await deleteProduct(id!);\n void nativeNotify('success');\n navigate(basePath);\n } catch (error) {\n void nativeNotify('error');\n console.error('Failed to delete product:', error);\n }\n };\n\n if (loading) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <LoadingState\n message={tr('products.loadingProductDetails', 'Loading product details...')}\n />\n </div>\n );\n }\n\n if (error || !product) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState\n message={error?.message || tr('products.productNotFound', 'Product not found')}\n action={{\n label: tr('products.backToProducts', 'Back to Products'),\n onClick: () => navigate(basePath),\n }}\n />\n </div>\n );\n }\n\n const formatDate = (dateString: string) => {\n return new Date(dateString).toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n });\n };\n\n const hasContactInfo =\n product.contactEmail || product.supportEmail || product.contactPhone || product.contactAddress;\n\n const hasSeoMetadata =\n product.seoTitle || product.seoDescription || product.seoKeywords || product.ogImage;\n\n const hasAppStoreLinks = product.appStoreUrl || product.playStoreUrl;\n\n const hasSocialLinks = product.socialLinks && Object.keys(product.socialLinks).length > 0;\n\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-300\">\n {/* Page Header */}\n <div className=\"mb-6\">\n <button\n onClick={() => navigate(basePath)}\n className=\"\n inline-flex items-center gap-2 mb-4\n text-text-secondary\n hover:text-text-primary\n transition-all duration-200\n \"\n >\n <ArrowLeft size={20} />\n <span className=\"text-sm font-medium\">\n {tr('products.backToProducts', 'Back to Products')}\n </span>\n </button>\n\n <div className=\"flex items-start justify-between\">\n <div className=\"flex items-center gap-4\">\n {product.logoUrl ? (\n <img\n src={product.logoUrl}\n alt={product.name}\n className=\"w-16 h-16 rounded-lg object-cover\"\n />\n ) : (\n <div className=\"w-16 h-16 rounded-lg bg-[var(--color-status-warning-subtle)] flex items-center justify-center\">\n <Package size={32} className=\"text-[var(--color-status-warning)]\" />\n </div>\n )}\n\n <div>\n <div className=\"flex items-center gap-3 mb-2\">\n <h1 className=\"text-3xl font-bold text-text-primary\">{product.name}</h1>\n <ProductStatusBadge status={product.status} />\n </div>\n <p className=\"text-text-secondary\">/{product.slug}</p>\n </div>\n </div>\n\n <div className=\"flex gap-2\">\n <button\n onClick={() => navigate(`${basePath}/${id}/edit`)}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-surface\n text-text-primary\n border border-default\n rounded-lg\n hover:bg-muted\n transition-all duration-200\n font-medium\n \"\n >\n <Edit size={16} />\n {tr('products.editProduct', 'Edit Product')}\n </button>\n\n <button\n onClick={handleDelete}\n disabled={deleteLoading}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-[var(--color-status-error-subtle)]\n text-[var(--color-status-error)]\n border border-[var(--color-status-error-border)]\n rounded-lg\n hover:opacity-80\n transition-all duration-200\n font-medium\n disabled:opacity-50\n \"\n >\n <Trash2 size={16} />\n {tr('products.delete', 'Delete')}\n </button>\n </div>\n </div>\n </div>\n\n {/* Content */}\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-6\">\n {/* Basic Information */}\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('products.basicInformation', 'Basic Information')}\n </h2>\n <dl className=\"space-y-3\">\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.name', 'Name')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">{product.name}</dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.slug', 'Slug')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">{product.slug}</dd>\n </div>\n {product.tags && product.tags.length > 0 && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary mb-1\">\n {tr('products.tags', 'Tags')}\n </dt>\n <dd>\n <TagList tags={product.tags} />\n </dd>\n </div>\n )}\n </dl>\n </div>\n\n {/* Description */}\n {product.description && (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('products.description', 'Description')}\n </h2>\n <p className=\"text-sm text-text-secondary leading-relaxed\">{product.description}</p>\n </div>\n )}\n\n {/* Timestamps */}\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('products.timestamps', 'Timestamps')}\n </h2>\n <dl className=\"space-y-3\">\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.created', 'Created')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">{formatDate(product.createdAt)}</dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.lastUpdated', 'Last Updated')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">{formatDate(product.updatedAt)}</dd>\n </div>\n </dl>\n </div>\n\n {/* Contact Information */}\n {hasContactInfo && (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('products.contactInformation', 'Contact Information')}\n </h2>\n <dl className=\"space-y-3\">\n {product.contactEmail && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary flex items-center gap-1.5\">\n <Mail size={14} />\n {tr('products.contactEmail', 'Contact Email')}\n </dt>\n <dd className=\"text-sm mt-1\">\n <a\n href={`mailto:${product.contactEmail}`}\n className=\"text-[var(--color-text-link)] hover:underline\"\n >\n {product.contactEmail}\n </a>\n </dd>\n </div>\n )}\n {product.supportEmail && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary flex items-center gap-1.5\">\n <Mail size={14} />\n {tr('products.supportEmail', 'Support Email')}\n </dt>\n <dd className=\"text-sm mt-1\">\n <a\n href={`mailto:${product.supportEmail}`}\n className=\"text-[var(--color-text-link)] hover:underline\"\n >\n {product.supportEmail}\n </a>\n </dd>\n </div>\n )}\n {product.contactPhone && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary flex items-center gap-1.5\">\n <Phone size={14} />\n {tr('products.phone', 'Phone')}\n </dt>\n <dd className=\"text-sm mt-1\">\n <a\n href={`tel:${product.contactPhone}`}\n className=\"text-[var(--color-text-link)] hover:underline\"\n >\n {product.contactPhone}\n </a>\n </dd>\n </div>\n )}\n {product.contactAddress && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary flex items-center gap-1.5\">\n <MapPin size={14} />\n {tr('products.address', 'Address')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">{product.contactAddress}</dd>\n </div>\n )}\n </dl>\n </div>\n )}\n\n {/* SEO Metadata */}\n {hasSeoMetadata && (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4 flex items-center gap-2\">\n <Search size={18} />\n {tr('products.seoMetadata', 'SEO Metadata')}\n </h2>\n <dl className=\"space-y-3\">\n {product.seoTitle && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.seoTitle', 'SEO Title')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">{product.seoTitle}</dd>\n </div>\n )}\n {product.seoDescription && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.seoDescription', 'SEO Description')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 leading-relaxed\">\n {product.seoDescription}\n </dd>\n </div>\n )}\n {product.seoKeywords && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.keywords', 'Keywords')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">\n <div className=\"flex flex-wrap gap-1.5 mt-1\">\n {(typeof product.seoKeywords === 'string'\n ? product.seoKeywords.split(',').map((k: string) => k.trim())\n : product.seoKeywords\n ).map((keyword: string) => (\n <span\n key={keyword}\n className=\"inline-flex px-2 py-0.5 text-xs font-medium rounded-full bg-muted text-text-secondary border border-default\"\n >\n {keyword}\n </span>\n ))}\n </div>\n </dd>\n </div>\n )}\n {product.ogImage && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.ogImage', 'OG Image')}\n </dt>\n <dd className=\"text-sm mt-1\">\n <a\n href={product.ogImage}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-[var(--color-text-link)] hover:underline break-all\"\n >\n {product.ogImage}\n </a>\n <img\n src={product.ogImage}\n alt={tr('products.ogImagePreview', 'OG Image preview')}\n className=\"mt-2 max-w-[200px] max-h-[120px] rounded border border-default object-cover\"\n onError={(e) => {\n (e.target as HTMLImageElement).style.display = 'none';\n }}\n />\n </dd>\n </div>\n )}\n </dl>\n </div>\n )}\n\n {/* App Store Links */}\n {hasAppStoreLinks && (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4 flex items-center gap-2\">\n <ExternalLink size={18} />\n {tr('products.appStoreLinks', 'App Store Links')}\n </h2>\n <dl className=\"space-y-3\">\n {product.appStoreUrl && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.appleAppStore', 'Apple App Store')}\n </dt>\n <dd className=\"text-sm mt-1\">\n <a\n href={product.appStoreUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1.5 text-[var(--color-text-link)] hover:underline\"\n >\n {product.appStoreUrl}\n <ExternalLink size={12} />\n </a>\n </dd>\n </div>\n )}\n {product.playStoreUrl && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.googlePlayStore', 'Google Play Store')}\n </dt>\n <dd className=\"text-sm mt-1\">\n <a\n href={product.playStoreUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1.5 text-[var(--color-text-link)] hover:underline\"\n >\n {product.playStoreUrl}\n <ExternalLink size={12} />\n </a>\n </dd>\n </div>\n )}\n </dl>\n </div>\n )}\n\n {/* Social Media Links */}\n {hasSocialLinks && (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4 flex items-center gap-2\">\n <Share2 size={18} />\n {tr('products.socialMediaLinks', 'Social Media Links')}\n </h2>\n <dl className=\"space-y-3\">\n {Object.entries(product.socialLinks!).map(([platform, url]) => (\n <div key={platform}>\n <dt className=\"text-sm font-medium text-text-secondary capitalize\">{platform}</dt>\n <dd className=\"text-sm mt-1\">\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1.5 text-[var(--color-text-link)] hover:underline\"\n >\n {url}\n <ExternalLink size={12} />\n </a>\n </dd>\n </div>\n ))}\n </dl>\n </div>\n )}\n\n {/* Content Pages */}\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4 flex items-center gap-2\">\n <FileText size={18} />\n {tr('products.contentPages', 'Content Pages')}\n </h2>\n <p className=\"text-sm text-text-secondary mb-4\">\n {tr(\n 'products.manageContentPages',\n 'Manage content pages associated with this product.'\n )}\n </p>\n <button\n onClick={() => navigate(`${basePath}/content-pages`)}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-surface\n text-text-primary\n border border-default\n rounded-lg\n hover:bg-muted\n transition-all duration-200\n font-medium\n text-sm\n \"\n >\n <FileText size={16} />\n {tr('products.viewContentPages', 'View Content Pages')}\n </button>\n </div>\n\n {/* Integrations */}\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <div className=\"flex items-center gap-2 mb-4\">\n <Shield size={20} className=\"text-text-secondary\" />\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {tr('products.integrations', 'Integrations')}\n </h2>\n </div>\n <div className=\"space-y-3\">\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.recaptchaSiteKey', 'reCAPTCHA Site Key')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-0.5 font-mono\">\n {product.recaptchaSiteKey || (\n <span className=\"text-text-secondary italic\">\n {tr('products.notConfigured', 'Not configured')}\n </span>\n )}\n </dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.recaptchaSecretKey', 'reCAPTCHA Secret Key')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-0.5\">\n <span className=\"text-text-secondary italic\">\n {tr('products.hiddenSetViaEdit', 'Hidden — set via Edit page')}\n </span>\n </dd>\n </div>\n </div>\n </div>\n\n {/* Pricing Plans (view only) */}\n <ProductPlans productId={product.id} productName={product.name} readOnly />\n\n {/* Activity History */}\n <div className=\"lg:col-span-2 bg-surface border border-default rounded-lg shadow-[var(--shadow-elevation-1)]\">\n <h2 className=\"text-lg font-semibold text-text-primary p-6 pb-0\">\n {tr('products.activityHistory', 'Activity History')}\n </h2>\n <AuditHistoryTab resourceId={product.id} resourceType=\"PlatformProduct\" />\n </div>\n\n {/* Metadata */}\n {product.metadata && Object.keys(product.metadata).length > 0 && (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('products.metadata', 'Metadata')}\n </h2>\n <dl className=\"space-y-3\">\n {Object.entries(product.metadata).map(([key, value]) => (\n <div key={key}>\n <dt className=\"text-sm font-medium text-text-secondary capitalize\">\n {key.replace(/([A-Z])/g, ' $1').trim()}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">\n {JSON.stringify(value)}\n </dd>\n </div>\n ))}\n </dl>\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AA8BA,SAAgB,IAAoB;CAClC,IAAM,EAAE,UAAO,GAA2B,EACpC,EAAE,aAAU,cAAW,gBAAgB,GAAmB,EAC1D,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,MAAqB;EAC5C,IAAM,IAAa,EAAE,EAAI;AACzB,SAAO,MAAe,IAAM,IAAW;IAEnC,EAAE,YAAS,YAAS,aAAU,EAAW,EAAI,EAC7C,EAAE,kBAAe,SAAS,MAAkB,GAAkB,EAE9D,IAAe,YAAY;AAC1B,IAAa,SAAS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AD;OAAI,WAAU;iBACX,EAAG,+BAA+B,uBAAuB;OACvD,CAAA,EACL,kBAAC,MAAD;OAAI,WAAU;iBACZ,kBAAC,QAAD;QAAM,WAAU;kBACb,EAAG,6BAA6B,6BAA6B;QACzD,CAAA;OACJ,CAAA,CACD,EAAA,CAAA,CACF;QACF;;IAGN,kBAAC,GAAD;KAAc,WAAW,EAAQ;KAAI,aAAa,EAAQ;KAAM,UAAA;KAAW,CAAA;IAG3E,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,MAAD;MAAI,WAAU;gBACX,EAAG,4BAA4B,mBAAmB;MAChD,CAAA,EACL,kBAAC,GAAD;MAAiB,YAAY,EAAQ;MAAI,cAAa;MAAoB,CAAA,CACtE;;IAGL,EAAQ,YAAY,OAAO,KAAK,EAAQ,SAAS,CAAC,SAAS,KAC1D,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,MAAD;MAAI,WAAU;gBACX,EAAG,qBAAqB,WAAW;MACjC,CAAA,EACL,kBAAC,MAAD;MAAI,WAAU;gBACX,OAAO,QAAQ,EAAQ,SAAS,CAAC,KAAK,CAAC,GAAK,OAC3C,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAI,QAAQ,YAAY,MAAM,CAAC,MAAM;OACnC,CAAA,EACL,kBAAC,MAAD;OAAI,WAAU;iBACX,KAAK,UAAU,EAAM;OACnB,CAAA,CACD,EAAA,EAPI,EAOJ,CACN;MACC,CAAA,CACD;;IAEJ;KACF"}
1
+ {"version":3,"file":"ProductDetailPage.js","names":[],"sources":["../../../../../src/product-management/modules/products/pages/ProductDetailPage.tsx"],"sourcesContent":["import { useParams } from 'react-router-dom';\nimport {\n ArrowLeft,\n Edit,\n ExternalLink,\n FileText,\n Mail,\n MapPin,\n Package,\n Phone,\n Search,\n Share2,\n Shield,\n Trash2,\n} from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport { useProduct, useDeleteProduct } from '../hooks/useProducts';\nimport { ProductStatusBadge } from '../components/ProductStatusBadge';\nimport { ProductPlans } from '../components/ProductPlans';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport { TagList } from '../../../shared/components/TagList';\nimport { AuditHistoryTab } from '../../../shared/components/AuditHistoryTab';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../../../utils/nativeBridge';\n\n/**\n * Product Detail Page\n * Shows comprehensive product information\n */\nexport function ProductDetailPage() {\n const { id } = useParams<{ id: string }>();\n const { navigate, basePath = '/products' } = useProductConsole();\n const { t } = useI18n();\n const tr = (key: string, fallback: string) => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n const { product, loading, error } = useProduct(id!);\n const { deleteProduct, loading: deleteLoading } = useDeleteProduct();\n\n const handleDelete = async () => {\n void nativeImpact('medium');\n const message = tr(\n 'products.confirmDeleteProduct',\n 'Are you sure you want to delete this product?'\n );\n const native = await nativeConfirm({\n title: 'Delete product',\n message,\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n });\n const ok = native === null ? window.confirm(message) : native;\n if (!ok) return;\n\n try {\n await deleteProduct(id!);\n void nativeNotify('success');\n navigate(basePath);\n } catch (error) {\n void nativeNotify('error');\n console.error('Failed to delete product:', error);\n }\n };\n\n if (loading) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <LoadingState\n message={tr('products.loadingProductDetails', 'Loading product details...')}\n />\n </div>\n );\n }\n\n if (error || !product) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState\n message={error?.message || tr('products.productNotFound', 'Product not found')}\n action={{\n label: tr('products.backToProducts', 'Back to Products'),\n onClick: () => navigate(basePath),\n }}\n />\n </div>\n );\n }\n\n const formatDate = (dateString: string) => {\n return new Date(dateString).toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n });\n };\n\n const hasContactInfo =\n product.contactEmail || product.supportEmail || product.contactPhone || product.contactAddress;\n\n const hasSeoMetadata =\n product.seoTitle || product.seoDescription || product.seoKeywords || product.ogImage;\n\n const hasAppStoreLinks = product.appStoreUrl || product.playStoreUrl;\n\n const hasSocialLinks = product.socialLinks && Object.keys(product.socialLinks).length > 0;\n\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-300\">\n {/* Page Header */}\n <div className=\"mb-6\">\n <button\n onClick={() => navigate(basePath)}\n className=\"\n inline-flex items-center gap-2 mb-4\n text-text-secondary\n hover:text-text-primary\n transition-all duration-200\n \"\n >\n <ArrowLeft size={20} />\n <span className=\"text-sm font-medium\">\n {tr('products.backToProducts', 'Back to Products')}\n </span>\n </button>\n\n <div className=\"flex items-start justify-between\">\n <div className=\"flex items-center gap-4\">\n {product.logoUrl ? (\n <img\n src={product.logoUrl}\n alt={product.name}\n className=\"w-16 h-16 rounded-lg object-cover\"\n />\n ) : (\n <div className=\"w-16 h-16 rounded-lg bg-[var(--color-status-warning-subtle)] flex items-center justify-center\">\n <Package size={32} className=\"text-[var(--color-status-warning)]\" />\n </div>\n )}\n\n <div>\n <div className=\"flex items-center gap-3 mb-2\">\n <h1 className=\"text-3xl font-bold text-text-primary\">{product.name}</h1>\n <ProductStatusBadge status={product.status} />\n </div>\n <p className=\"text-text-secondary\">/{product.slug}</p>\n </div>\n </div>\n\n <div className=\"flex gap-2\">\n <button\n onClick={() => navigate(`${basePath}/${id}/edit`)}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-surface\n text-text-primary\n border border-default\n rounded-lg\n hover:bg-muted\n transition-all duration-200\n font-medium\n \"\n >\n <Edit size={16} />\n {tr('products.editProduct', 'Edit Product')}\n </button>\n\n <button\n onClick={handleDelete}\n disabled={deleteLoading}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-[var(--color-status-error-subtle)]\n text-[var(--color-status-error)]\n border border-[var(--color-status-error-border)]\n rounded-lg\n hover:opacity-80\n transition-all duration-200\n font-medium\n disabled:opacity-50\n \"\n >\n <Trash2 size={16} />\n {tr('products.delete', 'Delete')}\n </button>\n </div>\n </div>\n </div>\n\n {/* Content */}\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-6\">\n {/* Basic Information */}\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('products.basicInformation', 'Basic Information')}\n </h2>\n <dl className=\"space-y-3\">\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.name', 'Name')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">{product.name}</dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.slug', 'Slug')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">{product.slug}</dd>\n </div>\n {product.tags && product.tags.length > 0 && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary mb-1\">\n {tr('products.tags', 'Tags')}\n </dt>\n <dd>\n <TagList tags={product.tags} />\n </dd>\n </div>\n )}\n </dl>\n </div>\n\n {/* Description */}\n {product.description && (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('products.description', 'Description')}\n </h2>\n <p className=\"text-sm text-text-secondary leading-relaxed\">{product.description}</p>\n </div>\n )}\n\n {/* Timestamps */}\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('products.timestamps', 'Timestamps')}\n </h2>\n <dl className=\"space-y-3\">\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.created', 'Created')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">{formatDate(product.createdAt)}</dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.lastUpdated', 'Last Updated')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">{formatDate(product.updatedAt)}</dd>\n </div>\n </dl>\n </div>\n\n {/* Contact Information */}\n {hasContactInfo && (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('products.contactInformation', 'Contact Information')}\n </h2>\n <dl className=\"space-y-3\">\n {product.contactEmail && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary flex items-center gap-1.5\">\n <Mail size={14} />\n {tr('products.contactEmail', 'Contact Email')}\n </dt>\n <dd className=\"text-sm mt-1\">\n <a\n href={`mailto:${product.contactEmail}`}\n className=\"text-[var(--color-text-link)] hover:underline\"\n >\n {product.contactEmail}\n </a>\n </dd>\n </div>\n )}\n {product.supportEmail && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary flex items-center gap-1.5\">\n <Mail size={14} />\n {tr('products.supportEmail', 'Support Email')}\n </dt>\n <dd className=\"text-sm mt-1\">\n <a\n href={`mailto:${product.supportEmail}`}\n className=\"text-[var(--color-text-link)] hover:underline\"\n >\n {product.supportEmail}\n </a>\n </dd>\n </div>\n )}\n {product.contactPhone && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary flex items-center gap-1.5\">\n <Phone size={14} />\n {tr('products.phone', 'Phone')}\n </dt>\n <dd className=\"text-sm mt-1\">\n <a\n href={`tel:${product.contactPhone}`}\n className=\"text-[var(--color-text-link)] hover:underline\"\n >\n {product.contactPhone}\n </a>\n </dd>\n </div>\n )}\n {product.contactAddress && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary flex items-center gap-1.5\">\n <MapPin size={14} />\n {tr('products.address', 'Address')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">{product.contactAddress}</dd>\n </div>\n )}\n </dl>\n </div>\n )}\n\n {/* SEO Metadata */}\n {hasSeoMetadata && (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4 flex items-center gap-2\">\n <Search size={18} />\n {tr('products.seoMetadata', 'SEO Metadata')}\n </h2>\n <dl className=\"space-y-3\">\n {product.seoTitle && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.seoTitle', 'SEO Title')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">{product.seoTitle}</dd>\n </div>\n )}\n {product.seoDescription && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.seoDescription', 'SEO Description')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 leading-relaxed\">\n {product.seoDescription}\n </dd>\n </div>\n )}\n {product.seoKeywords && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.keywords', 'Keywords')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1\">\n <div className=\"flex flex-wrap gap-1.5 mt-1\">\n {(typeof product.seoKeywords === 'string'\n ? product.seoKeywords.split(',').map((k: string) => k.trim())\n : product.seoKeywords\n ).map((keyword: string) => (\n <span\n key={keyword}\n className=\"inline-flex px-2 py-0.5 text-xs font-medium rounded-full bg-muted text-text-secondary border border-default\"\n >\n {keyword}\n </span>\n ))}\n </div>\n </dd>\n </div>\n )}\n {product.ogImage && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.ogImage', 'OG Image')}\n </dt>\n <dd className=\"text-sm mt-1\">\n <a\n href={product.ogImage}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-[var(--color-text-link)] hover:underline break-all\"\n >\n {product.ogImage}\n </a>\n <img\n src={product.ogImage}\n alt={tr('products.ogImagePreview', 'OG Image preview')}\n className=\"mt-2 max-w-[200px] max-h-[120px] rounded border border-default object-cover\"\n onError={(e) => {\n (e.target as HTMLImageElement).style.display = 'none';\n }}\n />\n </dd>\n </div>\n )}\n </dl>\n </div>\n )}\n\n {/* App Store Links */}\n {hasAppStoreLinks && (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4 flex items-center gap-2\">\n <ExternalLink size={18} />\n {tr('products.appStoreLinks', 'App Store Links')}\n </h2>\n <dl className=\"space-y-3\">\n {product.appStoreUrl && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.appleAppStore', 'Apple App Store')}\n </dt>\n <dd className=\"text-sm mt-1\">\n <a\n href={product.appStoreUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1.5 text-[var(--color-text-link)] hover:underline\"\n >\n {product.appStoreUrl}\n <ExternalLink size={12} />\n </a>\n </dd>\n </div>\n )}\n {product.playStoreUrl && (\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.googlePlayStore', 'Google Play Store')}\n </dt>\n <dd className=\"text-sm mt-1\">\n <a\n href={product.playStoreUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1.5 text-[var(--color-text-link)] hover:underline\"\n >\n {product.playStoreUrl}\n <ExternalLink size={12} />\n </a>\n </dd>\n </div>\n )}\n </dl>\n </div>\n )}\n\n {/* Social Media Links */}\n {hasSocialLinks && (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4 flex items-center gap-2\">\n <Share2 size={18} />\n {tr('products.socialMediaLinks', 'Social Media Links')}\n </h2>\n <dl className=\"space-y-3\">\n {Object.entries(product.socialLinks!).map(([platform, url]) => (\n <div key={platform}>\n <dt className=\"text-sm font-medium text-text-secondary capitalize\">{platform}</dt>\n <dd className=\"text-sm mt-1\">\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1.5 text-[var(--color-text-link)] hover:underline\"\n >\n {url}\n <ExternalLink size={12} />\n </a>\n </dd>\n </div>\n ))}\n </dl>\n </div>\n )}\n\n {/* Content Pages */}\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4 flex items-center gap-2\">\n <FileText size={18} />\n {tr('products.contentPages', 'Content Pages')}\n </h2>\n <p className=\"text-sm text-text-secondary mb-4\">\n {tr(\n 'products.manageContentPages',\n 'Manage content pages associated with this product.'\n )}\n </p>\n <button\n onClick={() => navigate(`${basePath}/content-pages`)}\n className=\"\n inline-flex items-center gap-2 px-4 py-2\n bg-surface\n text-text-primary\n border border-default\n rounded-lg\n hover:bg-muted\n transition-all duration-200\n font-medium\n text-sm\n \"\n >\n <FileText size={16} />\n {tr('products.viewContentPages', 'View Content Pages')}\n </button>\n </div>\n\n {/* Integrations */}\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <div className=\"flex items-center gap-2 mb-4\">\n <Shield size={20} className=\"text-text-secondary\" />\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {tr('products.integrations', 'Integrations')}\n </h2>\n </div>\n <div className=\"space-y-3\">\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.recaptchaSiteKey', 'reCAPTCHA Site Key')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-0.5 font-mono\">\n {product.recaptchaSiteKey || (\n <span className=\"text-text-secondary italic\">\n {tr('products.notConfigured', 'Not configured')}\n </span>\n )}\n </dd>\n </div>\n <div>\n <dt className=\"text-sm font-medium text-text-secondary\">\n {tr('products.recaptchaSecretKey', 'reCAPTCHA Secret Key')}\n </dt>\n <dd className=\"text-sm text-text-primary mt-0.5\">\n <span className=\"text-text-secondary italic\">\n {tr('products.hiddenSetViaEdit', 'Hidden — set via Edit page')}\n </span>\n </dd>\n </div>\n </div>\n </div>\n\n {/* Pricing Plans (view only) */}\n <ProductPlans productId={product.slug} productName={product.name} readOnly />\n\n {/* Activity History */}\n <div className=\"lg:col-span-2 bg-surface border border-default rounded-lg shadow-[var(--shadow-elevation-1)]\">\n <h2 className=\"text-lg font-semibold text-text-primary p-6 pb-0\">\n {tr('products.activityHistory', 'Activity History')}\n </h2>\n <AuditHistoryTab resourceId={product.id} resourceType=\"PlatformProduct\" />\n </div>\n\n {/* Metadata */}\n {product.metadata && Object.keys(product.metadata).length > 0 && (\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:shadow-[var(--shadow-elevation-2)]\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('products.metadata', 'Metadata')}\n </h2>\n <dl className=\"space-y-3\">\n {Object.entries(product.metadata).map(([key, value]) => (\n <div key={key}>\n <dt className=\"text-sm font-medium text-text-secondary capitalize\">\n {key.replace(/([A-Z])/g, ' $1').trim()}\n </dt>\n <dd className=\"text-sm text-text-primary mt-1 font-mono\">\n {JSON.stringify(value)}\n </dd>\n </div>\n ))}\n </dl>\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AA8BA,SAAgB,IAAoB;CAClC,IAAM,EAAE,UAAO,GAA2B,EACpC,EAAE,aAAU,cAAW,gBAAgB,GAAmB,EAC1D,EAAE,SAAM,GAAS,EACjB,KAAM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productId: g.id,
71
+ productId: g.slug,
72
72
  productName: g.name
73
73
  })]
74
74
  })]
@@ -1 +1 @@
1
- {"version":3,"file":"ProductEditPage.js","names":[],"sources":["../../../../../src/product-management/modules/products/pages/ProductEditPage.tsx"],"sourcesContent":["import { useParams } from 'react-router-dom';\nimport { ArrowLeft } from 'lucide-react';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport { useProduct, useUpdateProduct } from '../hooks/useProducts';\nimport { ProductForm } from '../components/ProductForm';\nimport { ProductPlans } from '../components/ProductPlans';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport type { UpdateProductInput } from '../types';\n\nexport function ProductEditPage() {\n const { id } = useParams<{ id: string }>();\n const { navigate, basePath = '/products' } = useProductConsole();\n const tr = useTr();\n const { product, loading: fetchLoading, error } = useProduct(id!);\n const { updateProduct, loading: updateLoading } = useUpdateProduct();\n\n const handleSubmit = async (data: UpdateProductInput) => {\n if (!id) return;\n\n try {\n await updateProduct(id, data);\n navigate(`${basePath}/${id}`);\n } catch (error) {\n console.error('Failed to update product:', error);\n }\n };\n\n const handleCancel = () => {\n navigate(`${basePath}/${id}`);\n };\n\n if (fetchLoading) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <LoadingState message={tr('products.loadingProduct', 'Loading product...')} />\n </div>\n );\n }\n\n if (error || !product) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState\n message={error?.message || tr('products.productNotFound', 'Product not found')}\n action={{\n label: tr('products.backToProducts', 'Back to Products'),\n onClick: () => navigate(basePath),\n }}\n />\n </div>\n );\n }\n\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-300\">\n <div className=\"mb-6\">\n <button\n onClick={handleCancel}\n className=\"\n inline-flex items-center gap-2 mb-4\n text-text-secondary\n hover:text-text-primary\n transition-all duration-200\n \"\n >\n <ArrowLeft size={20} />\n <span className=\"text-sm font-medium\">\n {tr('products.backTo', 'Back to')} {product.name}\n </span>\n </button>\n\n <h1 className=\"text-3xl font-bold text-text-primary mb-2\">\n {tr('products.editProduct', 'Edit Product')}\n </h1>\n <p className=\"text-text-secondary\">\n {tr('products.updateProductInfo', 'Update product information')}\n </p>\n </div>\n\n <div className=\"max-w-4xl space-y-6\">\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)]\">\n <ProductForm\n product={product}\n onSubmit={handleSubmit}\n onCancel={handleCancel}\n loading={updateLoading}\n />\n </div>\n\n {/* Pricing Plans Section */}\n <ProductPlans productId={product.id} productName={product.name} />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,IAAkB;CAChC,IAAM,EAAE,UAAO,GAA2B,EACpC,EAAE,aAAU,cAAW,gBAAgB,GAAmB,EAC1D,IAAK,GAAO,EACZ,EAAE,YAAS,SAAS,GAAc,aAAU,EAAW,EAAI,EAC3D,EAAE,kBAAe,SAAS,MAAkB,GAAkB,EAE9D,IAAe,OAAO,MAA6B;AAClD,QAEL,KAAI;AAEF,GADA,MAAM,EAAc,GAAI,EAAK,EAC7B,EAAS,GAAG,EAAS,GAAG,IAAK;WACtB,GAAO;AACd,WAAQ,MAAM,6BAA6B,EAAM;;IAI/C,UAAqB;AACzB,IAAS,GAAG,EAAS,GAAG,IAAK;;AAyB/B,QAtBI,IAEA,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAc,SAAS,EAAG,2BAA2B,qBAAqB,EAAI,CAAA;EAC1E,CAAA,GAIN,KAAS,CAAC,IAEV,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GACE,SAAS,GAAO,WAAW,EAAG,4BAA4B,oBAAoB;GAC9E,QAAQ;IACN,OAAO,EAAG,2BAA2B,mBAAmB;IACxD,eAAe,EAAS,EAAS;IAClC;GACD,CAAA;EACE,CAAA,GAKR,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,OAAD;GAAK,WAAU;aAAf;IACE,kBAAC,UAAD;KACE,SAAS;KACT,WAAU;eAFZ,CASE,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA,EACvB,kBAAC,QAAD;MAAM,WAAU;gBAAhB;OACG,EAAG,mBAAmB,UAAU;OAAC;OAAE,EAAQ;OACvC;QACA;;IAET,kBAAC,MAAD;KAAI,WAAU;eACX,EAAG,wBAAwB,eAAe;KACxC,CAAA;IACL,kBAAC,KAAD;KAAG,WAAU;eACV,EAAG,8BAA8B,6BAA6B;KAC7D,CAAA;IACA;MAEN,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,GAAD;KACW;KACT,UAAU;KACV,UAAU;KACV,SAAS;KACT,CAAA;IACE,CAAA,EAGN,kBAAC,GAAD;IAAc,WAAW,EAAQ;IAAI,aAAa,EAAQ;IAAQ,CAAA,CAC9D;KACF"}
1
+ {"version":3,"file":"ProductEditPage.js","names":[],"sources":["../../../../../src/product-management/modules/products/pages/ProductEditPage.tsx"],"sourcesContent":["import { useParams } from 'react-router-dom';\nimport { ArrowLeft } from 'lucide-react';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useProductConsole } from '../../../providers/ProductConsoleProvider';\nimport { useProduct, useUpdateProduct } from '../hooks/useProducts';\nimport { ProductForm } from '../components/ProductForm';\nimport { ProductPlans } from '../components/ProductPlans';\nimport { LoadingState } from '../../../shared/components/feedback/LoadingState';\nimport { ErrorState } from '../../../shared/components/feedback/ErrorState';\nimport type { UpdateProductInput } from '../types';\n\nexport function ProductEditPage() {\n const { id } = useParams<{ id: string }>();\n const { navigate, basePath = '/products' } = useProductConsole();\n const tr = useTr();\n const { product, loading: fetchLoading, error } = useProduct(id!);\n const { updateProduct, loading: updateLoading } = useUpdateProduct();\n\n const handleSubmit = async (data: UpdateProductInput) => {\n if (!id) return;\n\n try {\n await updateProduct(id, data);\n navigate(`${basePath}/${id}`);\n } catch (error) {\n console.error('Failed to update product:', error);\n }\n };\n\n const handleCancel = () => {\n navigate(`${basePath}/${id}`);\n };\n\n if (fetchLoading) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <LoadingState message={tr('products.loadingProduct', 'Loading product...')} />\n </div>\n );\n }\n\n if (error || !product) {\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6\">\n <ErrorState\n message={error?.message || tr('products.productNotFound', 'Product not found')}\n action={{\n label: tr('products.backToProducts', 'Back to Products'),\n onClick: () => navigate(basePath),\n }}\n />\n </div>\n );\n }\n\n return (\n <div className=\"min-h-full bg-[var(--color-bg-canvas)] p-6 animate-in fade-in duration-300\">\n <div className=\"mb-6\">\n <button\n onClick={handleCancel}\n className=\"\n inline-flex items-center gap-2 mb-4\n text-text-secondary\n hover:text-text-primary\n transition-all duration-200\n \"\n >\n <ArrowLeft size={20} />\n <span className=\"text-sm font-medium\">\n {tr('products.backTo', 'Back to')} {product.name}\n </span>\n </button>\n\n <h1 className=\"text-3xl font-bold text-text-primary mb-2\">\n {tr('products.editProduct', 'Edit Product')}\n </h1>\n <p className=\"text-text-secondary\">\n {tr('products.updateProductInfo', 'Update product information')}\n </p>\n </div>\n\n <div className=\"max-w-4xl space-y-6\">\n <div className=\"bg-surface border border-default rounded-lg p-6 shadow-[var(--shadow-elevation-1)]\">\n <ProductForm\n product={product}\n onSubmit={handleSubmit}\n onCancel={handleCancel}\n loading={updateLoading}\n />\n </div>\n\n {/* Pricing Plans Section */}\n <ProductPlans productId={product.slug} productName={product.name} />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,IAAkB;CAChC,IAAM,EAAE,UAAO,GAA2B,EACpC,EAAE,aAAU,cAAW,gBAAgB,GAAmB,EAC1D,IAAK,GAAO,EACZ,EAAE,YAAS,SAAS,GAAc,aAAU,EAAW,EAAI,EAC3D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@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-product",
3
- "version": "2026.513.3",
3
+ "version": "2026.514.2",
4
4
  "description": "Product management microfrontend for Burdenoff products",
5
5
  "type": "module",
6
6
  "files": [