@burdenoff/microfe-devportal 2026.728.2 → 2026.801.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.
Files changed (81) hide show
  1. package/dist/__tests__/utils/renderWithProviders.d.ts +1 -1
  2. package/dist/__tests__/utils/renderWithProviders.d.ts.map +1 -1
  3. package/dist/devportal/AdminDevportalRoutes.js +14 -14
  4. package/dist/devportal/AdminDevportalRoutes.js.map +1 -1
  5. package/dist/devportal/DevportalRoutes.js +115 -115
  6. package/dist/devportal/DevportalRoutes.js.map +1 -1
  7. package/dist/devportal/components/SectionNav.js +0 -1
  8. package/dist/devportal/components/SectionNav.js.map +1 -1
  9. package/dist/devportal/components/TelemetryErrorBoundary.js +7 -7
  10. package/dist/devportal/components/TelemetryErrorBoundary.js.map +1 -1
  11. package/dist/devportal/pages/AnalyticsDashboardPage.js +41 -41
  12. package/dist/devportal/pages/AnalyticsDashboardPage.js.map +1 -1
  13. package/dist/devportal/pages/AppLogsPage.js +27 -27
  14. package/dist/devportal/pages/AppLogsPage.js.map +1 -1
  15. package/dist/devportal/pages/ApplicationDetailPage.js +929 -929
  16. package/dist/devportal/pages/ApplicationDetailPage.js.map +1 -1
  17. package/dist/devportal/pages/ApplicationVersionsPage.js +39 -39
  18. package/dist/devportal/pages/ApplicationVersionsPage.js.map +1 -1
  19. package/dist/devportal/pages/CreateWebhookPage.js +55 -55
  20. package/dist/devportal/pages/CreateWebhookPage.js.map +1 -1
  21. package/dist/devportal/pages/EditApplicationPage.js +36 -36
  22. package/dist/devportal/pages/EditApplicationPage.js.map +1 -1
  23. package/dist/devportal/pages/EditPhysicalItemPage.js +40 -40
  24. package/dist/devportal/pages/EditPhysicalItemPage.js.map +1 -1
  25. package/dist/devportal/pages/InvitationDecisionPage.js +25 -25
  26. package/dist/devportal/pages/InvitationDecisionPage.js.map +1 -1
  27. package/dist/devportal/pages/ListingPreviewPage.js +36 -36
  28. package/dist/devportal/pages/ListingPreviewPage.js.map +1 -1
  29. package/dist/devportal/pages/OAuthCallbackPage.js +10 -10
  30. package/dist/devportal/pages/OAuthCallbackPage.js.map +1 -1
  31. package/dist/devportal/pages/OAuthClientDetailPage.js +27 -27
  32. package/dist/devportal/pages/OAuthClientDetailPage.js.map +1 -1
  33. package/dist/devportal/pages/OrganizationDetailPage.js +329 -329
  34. package/dist/devportal/pages/OrganizationDetailPage.js.map +1 -1
  35. package/dist/devportal/pages/OrganizationMembersPage.js +181 -181
  36. package/dist/devportal/pages/OrganizationMembersPage.js.map +1 -1
  37. package/dist/devportal/pages/PublishPage.js +43 -43
  38. package/dist/devportal/pages/PublishPage.js.map +1 -1
  39. package/dist/devportal/pages/RevenueDashboardPage.js +65 -65
  40. package/dist/devportal/pages/RevenueDashboardPage.js.map +1 -1
  41. package/dist/devportal/pages/StoreSubmissionPage.js +126 -126
  42. package/dist/devportal/pages/StoreSubmissionPage.js.map +1 -1
  43. package/dist/devportal/pages/WebhookDetailPage.js +28 -28
  44. package/dist/devportal/pages/WebhookDetailPage.js.map +1 -1
  45. package/dist/devportal/pages/WebhooksPage.js +47 -47
  46. package/dist/devportal/pages/WebhooksPage.js.map +1 -1
  47. package/dist/devportal/providers/DevportalProvider.js +12 -12
  48. package/dist/devportal/providers/DevportalProvider.js.map +1 -1
  49. package/dist/node_modules/react-router/dist/production/lib/components.js +124 -0
  50. package/dist/node_modules/react-router/dist/production/lib/components.js.map +1 -0
  51. package/dist/node_modules/react-router/dist/production/lib/context.js +32 -0
  52. package/dist/node_modules/react-router/dist/production/lib/context.js.map +1 -0
  53. package/dist/node_modules/react-router/dist/production/lib/dom/dom.js +83 -0
  54. package/dist/node_modules/react-router/dist/production/lib/dom/dom.js.map +1 -0
  55. package/dist/node_modules/react-router/dist/production/lib/dom/lib.js +358 -0
  56. package/dist/node_modules/react-router/dist/production/lib/dom/lib.js.map +1 -0
  57. package/dist/node_modules/react-router/dist/production/lib/dom/ssr/components.js +188 -0
  58. package/dist/node_modules/react-router/dist/production/lib/dom/ssr/components.js.map +1 -0
  59. package/dist/node_modules/react-router/dist/production/lib/dom/ssr/invariant.js +8 -0
  60. package/dist/node_modules/react-router/dist/production/lib/dom/ssr/invariant.js.map +1 -0
  61. package/dist/node_modules/react-router/dist/production/lib/dom/ssr/links.js +75 -0
  62. package/dist/node_modules/react-router/dist/production/lib/dom/ssr/links.js.map +1 -0
  63. package/dist/node_modules/react-router/dist/production/lib/dom/ssr/markup.js +15 -0
  64. package/dist/node_modules/react-router/dist/production/lib/dom/ssr/markup.js.map +1 -0
  65. package/dist/node_modules/react-router/dist/production/lib/dom/ssr/routeModules.js +18 -0
  66. package/dist/node_modules/react-router/dist/production/lib/dom/ssr/routeModules.js.map +1 -0
  67. package/dist/node_modules/react-router/dist/production/lib/dom/ssr/single-fetch.js +10 -0
  68. package/dist/node_modules/react-router/dist/production/lib/dom/ssr/single-fetch.js.map +1 -0
  69. package/dist/node_modules/react-router/dist/production/lib/errors.js +19 -0
  70. package/dist/node_modules/react-router/dist/production/lib/errors.js.map +1 -0
  71. package/dist/node_modules/react-router/dist/production/lib/hooks.js +296 -0
  72. package/dist/node_modules/react-router/dist/production/lib/hooks.js.map +1 -0
  73. package/dist/node_modules/react-router/dist/production/lib/router/history.js +166 -0
  74. package/dist/node_modules/react-router/dist/production/lib/router/history.js.map +1 -0
  75. package/dist/node_modules/react-router/dist/production/lib/router/router.js +33 -0
  76. package/dist/node_modules/react-router/dist/production/lib/router/router.js.map +1 -0
  77. package/dist/node_modules/react-router/dist/production/lib/router/url.js +9 -0
  78. package/dist/node_modules/react-router/dist/production/lib/router/url.js.map +1 -0
  79. package/dist/node_modules/react-router/dist/production/lib/router/utils.js +236 -0
  80. package/dist/node_modules/react-router/dist/production/lib/router/utils.js.map +1 -0
  81. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"EditApplicationPage.js","names":[],"sources":["../../../src/devportal/pages/EditApplicationPage.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useState, useEffect } from \"react\";\nimport { useI18n } from \"@burdenoff/fe-libs/shared/providers/shell/I18nProvider\";\nimport { useParams } from \"react-router-dom\";\nimport {\n Save,\n Trash2,\n AlertTriangle,\n Archive,\n Send,\n AlertCircle,\n AppWindow,\n Power,\n Check,\n Copy,\n Eye,\n EyeOff,\n RefreshCw,\n} from \"lucide-react\";\nimport { PageLayout, PageSection } from \"../components/PageLayout\";\nimport {\n InputField,\n TextareaField,\n SelectField,\n TagInput,\n CheckboxField,\n} from \"../components/FormField\";\nimport { MarkdownEditor } from \"../components/MarkdownEditor\";\nimport { StatusBadge } from \"../components/StatusBadge\";\nimport { ConfirmDialog } from \"../components/ConfirmDialog\";\nimport { LoadingState } from \"../components/LoadingState\";\nimport { EmptyState } from \"../components/EmptyState\";\nimport { useDevportal } from \"../providers/DevportalProvider\";\nimport { cn } from \"../utils/cn\";\nimport { nativeImpact, nativeNotify } from \"../../utils/nativeBridge\";\nimport { PermissionGuard } from \"../components\";\nimport { DEVPORTAL_PERMISSIONS } from \"../constants/permissions\";\nimport { useDevportalPermission } from \"../hooks/usePermission\";\nimport type { Application, AppType, AppVisibility, AppStatus } from \"../types\";\nimport { APP_TYPE_LABELS } from \"../utils/constants\";\nimport {\n useGetApplicationQuery,\n useUpdateApplicationMutation,\n useDeleteApplicationMutation,\n useDeactivateAppMutation,\n useRotateApplicationSigningSecretMutation,\n} from \"../../generated/global-operations\";\n\ninterface EditApplicationFormData {\n name: string;\n slug: string;\n shortDescription: string;\n description: string;\n appType: AppType;\n visibility: AppVisibility;\n category: string;\n tags: string[];\n keywords: string[];\n websiteUrl: string;\n documentationUrl: string;\n supportUrl: string;\n privacyPolicyUrl: string;\n termsOfServiceUrl: string;\n githubUrl: string;\n oauthAuthUrl: string;\n oauthRevokeUrl: string;\n requiresApproval: boolean;\n}\n\ninterface FormErrors {\n name?: string;\n slug?: string;\n shortDescription?: string;\n appType?: string;\n category?: string;\n}\n\nconst COMPATIBLE_PRODUCTS = [\n { value: \"fluidgrids\", label: \"FluidGrids\" },\n { value: \"workspaces\", label: \"Workspaces\" },\n { value: \"bigconsole\", label: \"BigConsole\" },\n { value: \"botlit\", label: \"Botlit\" },\n];\n\nconst APP_TYPE_OPTIONS = Object.entries(APP_TYPE_LABELS).map(\n ([value, label]) => ({\n value,\n label,\n }),\n);\n\nconst BASE_VISIBILITY_OPTIONS = [\n { value: \"PUBLIC\", label: \"Public — listed in the marketplace after review\" },\n { value: \"PRIVATE\", label: \"Private — only you (the creator) can see it\" },\n { value: \"INTERNAL\", label: \"Internal — visible to your entire dev org\" },\n];\n\nconst WORKFLOW_VISIBILITY_OPTIONS = [\n ...BASE_VISIBILITY_OPTIONS,\n {\n value: \"UNLISTED\",\n label: \"Unlisted — shareable via link, not listed in store\",\n },\n];\n\nconst CATEGORY_OPTIONS = [\n { value: \"ai\", label: \"AI & Automation\" },\n { value: \"integration\", label: \"Action in an App\" },\n { value: \"data\", label: \"Data & Transform\" },\n { value: \"flow\", label: \"Flow & Logic\" },\n { value: \"core\", label: \"Core\" },\n { value: \"communication\", label: \"Communication\" },\n { value: \"trigger\", label: \"Triggers\" },\n];\n\n/**\n * Helper to safely map GraphQL response to Application type\n */\nfunction mapToApplication(\n data: NonNullable<\n ReturnType<typeof useGetApplicationQuery>[\"data\"]\n >[\"application\"],\n): Application | null {\n if (!data) return null;\n return {\n id: data.id,\n name: data.name,\n slug: data.slug,\n shortDescription: data.shortDescription || undefined,\n description: data.description || undefined,\n appType: data.appType,\n status: data.status,\n visibility: data.visibility,\n tenantId: data.tenantId,\n developerId: data.developerId,\n developerOrganizationId: data.developerOrganizationId || undefined,\n category: data.category || undefined,\n tags: data.tags || [],\n keywords: data.keywords || [],\n iconUrl: data.iconUrl || undefined,\n websiteUrl: data.websiteUrl || undefined,\n documentationUrl: data.documentationUrl || undefined,\n supportUrl: data.supportUrl || undefined,\n privacyPolicyUrl: data.privacyPolicyUrl || undefined,\n termsOfServiceUrl: data.termsOfServiceUrl || undefined,\n githubUrl: data.githubUrl || undefined,\n pricingType: data.pricingType || undefined,\n installCount: data.installCount,\n activeInstallCount: data.activeInstallCount,\n averageRating: data.averageRating ?? undefined,\n reviewCount: data.reviewCount,\n submittedAt: data.submittedAt || undefined,\n publishedAt: data.publishedAt || undefined,\n lastReviewedAt: data.lastReviewedAt || undefined,\n reviewStatus: data.reviewStatus,\n reviewNotes: data.reviewNotes || undefined,\n reviewedBy: data.reviewedBy || undefined,\n isFeatured: data.isFeatured,\n isVerified: data.isVerified,\n requiresApproval: data.requiresApproval,\n oauthAuthUrl: data.oauthAuthUrl || undefined,\n oauthRevokeUrl: data.oauthRevokeUrl || undefined,\n createdAt: data.createdAt,\n updatedAt: data.updatedAt,\n };\n}\n\n/**\n * Edit application page — wired to real GraphQL mutations.\n */\nexport const EditApplicationPage: FC = () => {\n const { navigate, basePath } = useDevportal();\n const { appId } = useParams<{ appId: string }>();\n const { t } = useI18n();\n const { allowed: canUpdate } = useDevportalPermission(\n DEVPORTAL_PERMISSIONS.APP_UPDATE,\n );\n const { allowed: canDelete } = useDevportalPermission(\n DEVPORTAL_PERMISSIONS.APP_DELETE,\n );\n const tr = (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n };\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [errors, setErrors] = useState<FormErrors>({});\n const [showDeleteDialog, setShowDeleteDialog] = useState(false);\n const [showDeprecateDialog, setShowDeprecateDialog] = useState(false);\n const [showDeactivateDialog, setShowDeactivateDialog] = useState(false);\n const [hasChanges, setHasChanges] = useState(false);\n const [showSecret, setShowSecret] = useState(false);\n const [isRotating, setIsRotating] = useState(false);\n const [rotatedSecret, setRotatedSecret] = useState<string | null>(null);\n const [copiedSecret, setCopiedSecret] = useState(false);\n\n // ---------------------------------------------------------------------------\n // GraphQL queries & mutations\n // ---------------------------------------------------------------------------\n const {\n data,\n loading,\n error: queryError,\n refetch,\n } = useGetApplicationQuery({\n variables: { id: appId! },\n skip: !appId,\n });\n\n const [updateApplication] = useUpdateApplicationMutation();\n const [deleteApplication] = useDeleteApplicationMutation();\n const [deactivateApp] = useDeactivateAppMutation();\n const [rotateSigningSecret] = useRotateApplicationSigningSecretMutation();\n\n // ---------------------------------------------------------------------------\n // Derive application from query data\n // ---------------------------------------------------------------------------\n const app = mapToApplication(data?.application);\n\n useEffect(() => {\n const name = app?.name;\n if (!appId || !name) return;\n const reg = (\n window as unknown as {\n __breadcrumbRegistry?: {\n register: (id: string, name: string) => void;\n unregister: (id: string) => void;\n };\n }\n ).__breadcrumbRegistry;\n reg?.register(appId, name);\n return () => reg?.unregister(appId);\n }, [appId, app?.name]);\n\n // ---------------------------------------------------------------------------\n // Form state — initialised from fetched app once available\n // ---------------------------------------------------------------------------\n const [formData, setFormData] = useState<EditApplicationFormData>({\n name: \"\",\n slug: \"\",\n shortDescription: \"\",\n description: \"\",\n appType: \"WEB_APP\",\n visibility: \"PUBLIC\",\n category: \"\",\n tags: [],\n keywords: [],\n websiteUrl: \"\",\n documentationUrl: \"\",\n supportUrl: \"\",\n privacyPolicyUrl: \"\",\n termsOfServiceUrl: \"\",\n githubUrl: \"\",\n oauthAuthUrl: \"\",\n oauthRevokeUrl: \"\",\n requiresApproval: false,\n });\n const [compatibleProducts, setCompatibleProducts] = useState<string[]>([]);\n\n useEffect(() => {\n if (app) {\n setFormData({\n name: app.name,\n slug: app.slug,\n shortDescription: app.shortDescription || \"\",\n description: app.description || \"\",\n appType: app.appType,\n visibility: app.visibility,\n category: app.category || \"\",\n tags: app.tags,\n keywords: app.keywords,\n websiteUrl: app.websiteUrl || \"\",\n documentationUrl: app.documentationUrl || \"\",\n supportUrl: app.supportUrl || \"\",\n privacyPolicyUrl: app.privacyPolicyUrl || \"\",\n termsOfServiceUrl: app.termsOfServiceUrl || \"\",\n githubUrl: app.githubUrl || \"\",\n oauthAuthUrl: app.oauthAuthUrl || \"\",\n oauthRevokeUrl: app.oauthRevokeUrl || \"\",\n requiresApproval: app.requiresApproval,\n });\n // Load compatibleProducts from manifest.compatibility.products\n // Note: mapToApplication doesn't copy manifest, so read from raw query data directly.\n const manifest = data?.application?.manifest as\n Record<string, unknown> | null | undefined;\n const compatibility = manifest?.compatibility as\n Record<string, unknown> | undefined;\n const products = Array.isArray(compatibility?.products)\n ? (compatibility.products as string[])\n : [];\n setCompatibleProducts(products);\n setHasChanges(false);\n }\n // Re-sync form when the underlying application data changes (e.g. after\n // a refetch triggered by a mutation). We intentionally depend on\n // `data?.application` rather than the derived `app` object so that the\n // effect fires when the query cache updates.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [data?.application]);\n\n // ---------------------------------------------------------------------------\n // Handlers\n // ---------------------------------------------------------------------------\n const handleNavigate = (path: string) => {\n navigate?.(`${basePath}${path}`);\n };\n\n const handleChange = (\n field: keyof EditApplicationFormData,\n value: string | string[] | boolean,\n ) => {\n setFormData((prev) => ({ ...prev, [field]: value }));\n setHasChanges(true);\n if (errors[field as keyof FormErrors]) {\n setErrors((prev) => ({ ...prev, [field]: undefined }));\n }\n };\n\n const handleRotateSecret = async () => {\n if (!appId) return;\n setIsRotating(true);\n try {\n const result = await rotateSigningSecret({ variables: { id: appId } });\n const newSecret =\n result.data?.rotateApplicationSigningSecret?.signingSecret;\n if (newSecret) {\n setRotatedSecret(newSecret);\n setShowSecret(true);\n }\n } catch {\n nativeNotify(\"error\");\n } finally {\n setIsRotating(false);\n }\n };\n\n const handleCopySecret = async (secret: string) => {\n await navigator.clipboard.writeText(secret);\n setCopiedSecret(true);\n setTimeout(() => setCopiedSecret(false), 2000);\n };\n\n const validateForm = (): boolean => {\n const newErrors: FormErrors = {};\n\n if (!formData.name.trim()) {\n newErrors.name = tr(\n \"devportal.appNameRequired\",\n \"Application name is required\",\n );\n } else if (formData.name.length < 3) {\n newErrors.name = tr(\n \"devportal.appNameMinLength\",\n \"Name must be at least 3 characters\",\n );\n } else if (formData.name.length > 100) {\n newErrors.name = tr(\n \"devportal.appNameMaxLength\",\n \"Name must be less than 100 characters\",\n );\n }\n\n if (!formData.slug.trim()) {\n newErrors.slug = tr(\"devportal.slugRequired\", \"Slug is required\");\n } else if (!/^[a-z0-9-]+$/.test(formData.slug)) {\n newErrors.slug = tr(\n \"devportal.slugInvalidChars\",\n \"Slug can only contain lowercase letters, numbers, and hyphens\",\n );\n }\n\n if (!formData.shortDescription.trim()) {\n newErrors.shortDescription = tr(\n \"devportal.shortDescriptionRequired\",\n \"Short description is required\",\n );\n } else if (formData.shortDescription.length > 200) {\n newErrors.shortDescription = tr(\n \"devportal.shortDescriptionMaxLength\",\n \"Short description must be less than 200 characters\",\n );\n }\n\n if (!formData.appType) {\n newErrors.appType = tr(\n \"devportal.appTypeRequired\",\n \"Application type is required\",\n );\n }\n\n if (!formData.category) {\n newErrors.category = tr(\n \"devportal.categoryRequired\",\n \"Category is required\",\n );\n }\n\n setErrors(newErrors);\n return Object.keys(newErrors).length === 0;\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n\n if (!validateForm() || !app) {\n return;\n }\n\n setIsSubmitting(true);\n\n try {\n await updateApplication({\n variables: {\n id: app.id,\n input: {\n name: formData.name,\n shortDescription: formData.shortDescription,\n description: formData.description,\n appType: formData.appType,\n visibility: formData.visibility,\n category: formData.category,\n tags: formData.tags,\n keywords: formData.keywords,\n websiteUrl: formData.websiteUrl || null,\n documentationUrl: formData.documentationUrl || null,\n supportUrl: formData.supportUrl || null,\n privacyPolicyUrl: formData.privacyPolicyUrl || null,\n termsOfServiceUrl: formData.termsOfServiceUrl || null,\n githubUrl: formData.githubUrl || null,\n oauthAuthUrl: formData.oauthAuthUrl || null,\n oauthRevokeUrl: formData.oauthRevokeUrl || null,\n compatibleProducts,\n },\n },\n });\n setHasChanges(false);\n } catch (err) {\n console.error(\"Failed to update application:\", err);\n } finally {\n setIsSubmitting(false);\n }\n };\n\n const handleDelete = async () => {\n if (!app) return;\n void nativeImpact(\"medium\");\n try {\n await deleteApplication({\n variables: { id: app.id },\n });\n void nativeNotify(\"success\");\n handleNavigate(\"/apps\");\n } catch (err) {\n void nativeNotify(\"error\");\n console.error(\"Failed to delete application:\", err);\n }\n };\n\n const handleDeprecate = async () => {\n if (!app) return;\n try {\n // Deprecate is modelled as a status transition via update. The backend\n // treats a visibility change to PRIVATE + status mutation or a dedicated\n // deprecation endpoint. Here we use submitApplication with a status note\n // as the deprecate action since there is no separate `deprecateApplication`\n // mutation. If a dedicated mutation is added later, swap it in here.\n await updateApplication({\n variables: {\n id: app.id,\n input: {\n visibility: \"PRIVATE\",\n },\n },\n });\n setShowDeprecateDialog(false);\n } catch (err) {\n console.error(\"Failed to deprecate application:\", err);\n }\n };\n\n const handleDeactivate = async () => {\n if (!app) return;\n try {\n await deactivateApp({\n variables: { id: app.id },\n });\n setShowDeactivateDialog(false);\n handleNavigate(\"/apps\");\n } catch (err) {\n console.error(\"Failed to deactivate application:\", err);\n }\n };\n\n // ---------------------------------------------------------------------------\n // Loading / Error / Not-found states\n // ---------------------------------------------------------------------------\n if (loading) {\n return (\n <LoadingState\n message={tr(\"devportal.loadingApplication\", \"Loading application...\")}\n />\n );\n }\n\n if (queryError) {\n return (\n <PageLayout\n title={tr(\"devportal.error\", \"Error\")}\n backLink={`${basePath}/apps`}\n backLabel={tr(\"devportal.backToApplications\", \"Back to Applications\")}\n >\n <div className=\"flex flex-col items-center justify-center py-12 text-center\">\n <AlertCircle size={48} className=\"text-status-error-text mb-4\" />\n <h3 className=\"text-lg font-semibold mb-2\">\n {tr(\n \"devportal.failedToLoadApplication\",\n \"Failed to load application\",\n )}\n </h3>\n <p className=\"text-sm text-text-secondary\">{queryError.message}</p>\n </div>\n </PageLayout>\n );\n }\n\n if (!app) {\n return (\n <PageLayout\n title={tr(\"devportal.notFound\", \"Not Found\")}\n backLink={`${basePath}/apps`}\n backLabel={tr(\"devportal.backToApplications\", \"Back to Applications\")}\n >\n <EmptyState\n illustration=\"empty-generic\"\n icon={<AppWindow size={48} />}\n title={tr(\"devportal.applicationNotFound\", \"Application not found\")}\n description={tr(\n \"devportal.applicationNotFoundDescription\",\n \"The application you're looking for doesn't exist or you don't have access to it.\",\n )}\n />\n </PageLayout>\n );\n }\n\n // ---------------------------------------------------------------------------\n // Derived flags\n // ---------------------------------------------------------------------------\n const canSubmitForReview =\n app.status === \"DRAFT\" || app.status === \"REJECTED\";\n const canDeprecate = app.status === \"PUBLISHED\";\n const canDeactivate = app.status === \"ACTIVE\" || app.status === \"PUBLISHED\";\n\n // ---------------------------------------------------------------------------\n // Render\n // ---------------------------------------------------------------------------\n return (\n <PermissionGuard authOnly>\n <PageLayout\n title={`${tr(\"devportal.editAppTitlePrefix\", \"Edit:\")} ${app.name}`}\n description={tr(\n \"devportal.editAppDescription\",\n \"Update your application settings\",\n )}\n purpose={tr(\n \"devportal.editAppPurpose\",\n \"Change how this app appears and behaves — its name, description, classification, links, and lifecycle settings. Use the danger zone at the bottom to deprecate or delete it when it is retired.\",\n )}\n backLink={`${basePath}/apps/${app.id}`}\n backLabel={tr(\"devportal.backToApplication\", \"Back to Application\")}\n actions={\n <div className=\"flex items-center gap-2\">\n <StatusBadge status={app.status} type=\"app\" />\n </div>\n }\n >\n <form onSubmit={handleSubmit} className=\"space-y-8 max-w-3xl\">\n {/* Status banner for published apps */}\n {app.status === \"PUBLISHED\" && (\n <div className=\"rounded-lg border border-border-subtle bg-status-warning-bg-subtle p-4 flex gap-3\">\n <AlertTriangle\n size={20}\n className=\"text-status-warning-text flex-shrink-0 mt-0.5\"\n />\n <div className=\"text-sm text-status-warning-text\">\n <p className=\"font-medium\">\n {tr(\n \"devportal.appIsPublished\",\n \"This application is published\",\n )}\n </p>\n <p className=\"mt-1 text-status-warning-text\">\n {tr(\n \"devportal.publishedAppChangesWarning\",\n \"Changes to published apps may require re-review. Major changes will put the app back into review status.\",\n )}\n </p>\n </div>\n </div>\n )}\n\n {/* Basic Information */}\n <PageSection\n title={tr(\"devportal.basicInformation\", \"Basic Information\")}\n description={tr(\n \"devportal.basicInformationDescription\",\n \"Core details about your application\",\n )}\n >\n <div className=\"space-y-4\">\n <InputField\n label={tr(\"devportal.applicationName\", \"Application Name\")}\n value={formData.name}\n onChange={(e) => handleChange(\"name\", e.target.value)}\n placeholder={tr(\n \"devportal.applicationNamePlaceholder\",\n \"My Awesome App\",\n )}\n required\n error={errors.name}\n />\n\n <InputField\n label={tr(\"devportal.slug\", \"Slug\")}\n value={formData.slug}\n onChange={(e) =>\n handleChange(\"slug\", e.target.value.toLowerCase())\n }\n placeholder={tr(\"devportal.slugPlaceholder\", \"my-awesome-app\")}\n required\n error={errors.slug}\n hint={tr(\n \"devportal.slugChangeWarning\",\n \"Changing the slug may break existing integrations\",\n )}\n />\n\n <TextareaField\n label={tr(\"devportal.shortDescription\", \"Short Description\")}\n value={formData.shortDescription}\n onChange={(e) =>\n handleChange(\"shortDescription\", e.target.value)\n }\n placeholder={tr(\n \"devportal.shortDescriptionPlaceholder\",\n \"A brief description of what your app does\",\n )}\n required\n error={errors.shortDescription}\n hint={`${formData.shortDescription.length}/200 ${tr(\"devportal.characters\", \"characters\")}`}\n rows={2}\n />\n\n <MarkdownEditor\n label={tr(\"devportal.fullDescription\", \"Full Description\")}\n value={formData.description}\n onChange={(value) => handleChange(\"description\", value)}\n placeholder={tr(\n \"devportal.fullDescriptionPlaceholder\",\n \"Detailed description of your application, features, and use cases...\",\n )}\n rows={6}\n hint={tr(\n \"devportal.markdownSupported\",\n \"Markdown formatting is supported\",\n )}\n />\n </div>\n </PageSection>\n\n {/* Classification */}\n <PageSection\n title={tr(\"devportal.classification\", \"Classification\")}\n description={tr(\n \"devportal.classificationDescription\",\n \"Categorize your application\",\n )}\n >\n <div className=\"grid gap-4 sm:grid-cols-2\">\n <SelectField\n label={tr(\"devportal.applicationType\", \"Application Type\")}\n value={formData.appType}\n onChange={(e) => handleChange(\"appType\", e.target.value)}\n options={APP_TYPE_OPTIONS}\n required\n error={errors.appType}\n />\n\n <SelectField\n label={tr(\"devportal.category\", \"Category\")}\n value={formData.category}\n onChange={(e) => handleChange(\"category\", e.target.value)}\n options={CATEGORY_OPTIONS}\n required\n error={errors.category}\n />\n\n <SelectField\n label={tr(\"devportal.visibility\", \"Visibility\")}\n value={formData.visibility}\n onChange={(e) =>\n handleChange(\"visibility\", e.target.value as AppVisibility)\n }\n options={\n app?.appType === \"WORKFLOW\"\n ? WORKFLOW_VISIBILITY_OPTIONS\n : BASE_VISIBILITY_OPTIONS\n }\n hint={\n formData.visibility === \"PUBLIC\"\n ? tr(\n \"devportal.visibilityHintPublic\",\n \"Listed in the marketplace after review approval — anyone can discover and install it\",\n )\n : formData.visibility === \"UNLISTED\"\n ? tr(\n \"devportal.visibilityHintUnlisted\",\n \"Not in the store, but accessible via a direct link. You can still submit for marketplace review\",\n )\n : formData.visibility === \"INTERNAL\"\n ? tr(\n \"devportal.visibilityHintInternal\",\n \"Visible to all members of your developer organization — no one outside can access it\",\n )\n : tr(\n \"devportal.visibilityHintPrivate\",\n \"Only you (the creator) can see this — other org members cannot access it\",\n )\n }\n />\n </div>\n\n <TagInput\n label={tr(\"devportal.tags\", \"Tags\")}\n value={formData.tags}\n onChange={(tags) => handleChange(\"tags\", tags)}\n placeholder={tr(\n \"devportal.addTagsPlaceholder\",\n \"Add tags (press Enter)\",\n )}\n />\n\n <TagInput\n label={tr(\"devportal.keywords\", \"Keywords\")}\n value={formData.keywords}\n onChange={(keywords) => handleChange(\"keywords\", keywords)}\n placeholder={tr(\n \"devportal.addKeywordsPlaceholder\",\n \"Add keywords (press Enter)\",\n )}\n />\n\n {/* Compatible Products — NODE and WORKFLOW only */}\n {(formData.appType === \"NODE\" ||\n formData.appType === \"WORKFLOW\") && (\n <div className=\"space-y-2\">\n <label className=\"block text-sm font-medium text-text-primary\">\n Compatible Products\n </label>\n <p className=\"text-xs text-text-secondary\">\n Select which products this {formData.appType.toLowerCase()}{\" \"}\n works with. Users will see it in those products&apos; node\n stores.\n </p>\n <div className=\"flex flex-wrap gap-3\">\n {COMPATIBLE_PRODUCTS.map((product) => {\n const checked = compatibleProducts.includes(product.value);\n return (\n <label\n key={product.value}\n className={cn(\n \"flex items-center gap-2 cursor-pointer rounded-md border px-3 py-2 text-sm transition-colors\",\n checked\n ? \"border-primary bg-primary/10 text-text-primary\"\n : \"border-border-subtle hover:border-border text-text-secondary hover:text-text-primary\",\n )}\n >\n <input\n type=\"checkbox\"\n className=\"sr-only\"\n checked={checked}\n onChange={() => {\n setCompatibleProducts((prev) =>\n checked\n ? prev.filter((v) => v !== product.value)\n : [...prev, product.value],\n );\n setHasChanges(true);\n }}\n />\n {checked && (\n <Check\n size={14}\n className=\"text-primary flex-shrink-0\"\n />\n )}\n {product.label}\n </label>\n );\n })}\n </div>\n </div>\n )}\n </PageSection>\n\n {/* URLs */}\n <PageSection\n title={tr(\"devportal.links\", \"Links\")}\n description={tr(\n \"devportal.linksDescription\",\n \"External resources for your application\",\n )}\n >\n <div className=\"grid gap-4 sm:grid-cols-2\">\n <InputField\n label={tr(\"devportal.websiteUrl\", \"Website URL\")}\n type=\"url\"\n value={formData.websiteUrl}\n onChange={(e) => handleChange(\"websiteUrl\", e.target.value)}\n placeholder={tr(\n \"devportal.websiteUrlPlaceholder\",\n \"https://example.com\",\n )}\n />\n\n <InputField\n label={tr(\"devportal.documentationUrl\", \"Documentation URL\")}\n type=\"url\"\n value={formData.documentationUrl}\n onChange={(e) =>\n handleChange(\"documentationUrl\", e.target.value)\n }\n placeholder={tr(\n \"devportal.documentationUrlPlaceholder\",\n \"https://docs.example.com\",\n )}\n />\n\n <InputField\n label={tr(\"devportal.supportUrl\", \"Support URL\")}\n type=\"url\"\n value={formData.supportUrl}\n onChange={(e) => handleChange(\"supportUrl\", e.target.value)}\n placeholder={tr(\n \"devportal.supportUrlPlaceholder\",\n \"https://support.example.com\",\n )}\n />\n\n <InputField\n label={tr(\"devportal.githubUrl\", \"GitHub URL\")}\n type=\"url\"\n value={formData.githubUrl}\n onChange={(e) => handleChange(\"githubUrl\", e.target.value)}\n placeholder={tr(\n \"devportal.githubUrlPlaceholder\",\n \"https://github.com/org/repo\",\n )}\n />\n\n <InputField\n label={tr(\"devportal.privacyPolicyUrl\", \"Privacy Policy URL\")}\n type=\"url\"\n value={formData.privacyPolicyUrl}\n onChange={(e) =>\n handleChange(\"privacyPolicyUrl\", e.target.value)\n }\n placeholder={tr(\n \"devportal.privacyPolicyUrlPlaceholder\",\n \"https://example.com/privacy\",\n )}\n />\n\n <InputField\n label={tr(\n \"devportal.termsOfServiceUrl\",\n \"Terms of Service URL\",\n )}\n type=\"url\"\n value={formData.termsOfServiceUrl}\n onChange={(e) =>\n handleChange(\"termsOfServiceUrl\", e.target.value)\n }\n placeholder={tr(\n \"devportal.termsOfServiceUrlPlaceholder\",\n \"https://example.com/terms\",\n )}\n />\n </div>\n </PageSection>\n\n {/* Integration Setup — INTEGRATION / API_INTEGRATION only */}\n {(formData.appType === \"INTEGRATION\" ||\n formData.appType === \"API_INTEGRATION\") && (\n <PageSection\n title=\"Integration Setup\"\n description=\"Configure the endpoints for your integration. After a user installs, we redirect them to your callback URL so your server can complete the connection.\"\n >\n <div className=\"space-y-4\">\n <InputField\n label=\"Post-install Callback URL\"\n type=\"url\"\n value={formData.oauthAuthUrl}\n onChange={(e) => handleChange(\"oauthAuthUrl\", e.target.value)}\n placeholder=\"https://yourapp.com/callback\"\n hint=\"Users land here after install with ?installation_id=xxx appended\"\n />\n <InputField\n label=\"Revoke URL\"\n type=\"url\"\n value={formData.oauthRevokeUrl}\n onChange={(e) =>\n handleChange(\"oauthRevokeUrl\", e.target.value)\n }\n placeholder=\"https://yourapp.com/oauth/revoke\"\n hint=\"We POST to this URL when a user uninstalls your integration\"\n />\n {/* Signing secret — read-only, rotate-only */}\n {(() => {\n const displaySecret =\n rotatedSecret ?? data?.application?.signingSecret;\n const masked = \"boff_sk_\" + \"•\".repeat(32);\n return (\n <div className=\"space-y-1.5\">\n <label className=\"block text-sm font-medium text-text-primary\">\n Signing Secret\n </label>\n <p className=\"text-xs text-text-secondary\">\n Use this secret to authenticate{\" \"}\n <code className=\"font-mono text-xs bg-bg-sunken px-1 py-0.5 rounded\">\n verifyInstallation\n </code>{\" \"}\n calls from your integration server. Store it securely —\n it is only shown immediately after generation or\n rotation.\n </p>\n {displaySecret ? (\n <div className=\"flex items-center gap-2\">\n <div className=\"flex-1 flex items-center gap-0 rounded-md border border-border-default bg-bg-sunken overflow-hidden\">\n <code className=\"flex-1 px-3 py-2 text-xs font-mono text-text-primary truncate\">\n {showSecret ? displaySecret : masked}\n </code>\n <button\n type=\"button\"\n onClick={() => setShowSecret((v) => !v)}\n className=\"px-2 py-2 text-text-secondary hover:text-text-primary border-l border-border-default\"\n title={showSecret ? \"Hide\" : \"Reveal\"}\n >\n {showSecret ? (\n <EyeOff size={14} />\n ) : (\n <Eye size={14} />\n )}\n </button>\n <button\n type=\"button\"\n onClick={() => handleCopySecret(displaySecret)}\n className=\"px-2 py-2 text-text-secondary hover:text-text-primary border-l border-border-default\"\n title=\"Copy to clipboard\"\n >\n {copiedSecret ? (\n <Check size={14} className=\"text-green-500\" />\n ) : (\n <Copy size={14} />\n )}\n </button>\n </div>\n <button\n type=\"button\"\n onClick={handleRotateSecret}\n disabled={isRotating}\n className=\"flex items-center gap-1.5 px-3 py-2 text-xs rounded-md border border-border-default bg-bg-default text-text-primary hover:bg-bg-subtle disabled:opacity-50\"\n title=\"Rotate signing secret\"\n >\n <RefreshCw\n size={12}\n className={isRotating ? \"animate-spin\" : \"\"}\n />\n Rotate\n </button>\n </div>\n ) : (\n <button\n type=\"button\"\n onClick={handleRotateSecret}\n disabled={isRotating}\n className=\"flex items-center gap-1.5 px-3 py-2 text-xs rounded-md border border-border-default bg-bg-default text-text-primary hover:bg-bg-subtle disabled:opacity-50\"\n >\n <RefreshCw\n size={12}\n className={isRotating ? \"animate-spin\" : \"\"}\n />\n Generate Signing Secret\n </button>\n )}\n {rotatedSecret && (\n <p className=\"text-xs text-amber-600 dark:text-amber-400\">\n New secret generated. Copy it now — the old secret is\n already invalidated.\n </p>\n )}\n </div>\n );\n })()}\n </div>\n </PageSection>\n )}\n\n {/* Settings */}\n <PageSection\n title={tr(\"devportal.settings\", \"Settings\")}\n description={tr(\n \"devportal.settingsDescription\",\n \"Additional configuration options\",\n )}\n >\n <div className=\"space-y-4\">\n <CheckboxField\n label={tr(\n \"devportal.requireWorkspaceAdminApproval\",\n \"Require workspace admin approval\",\n )}\n description={tr(\n \"devportal.requireWorkspaceAdminApprovalDescription\",\n \"When enabled, workspace admins must approve installations before users can access this app\",\n )}\n checked={formData.requiresApproval}\n onChange={(e) =>\n handleChange(\"requiresApproval\", e.target.checked)\n }\n />\n </div>\n </PageSection>\n\n {/* Submission readiness checklist */}\n {canSubmitForReview && (\n <div className=\"rounded-lg border border-border-subtle bg-bg-sunken p-4 space-y-2\">\n <p className=\"text-sm font-medium text-text-primary flex items-center gap-2\">\n <Send size={14} />\n {tr(\"devportal.submissionChecklist\", \"Submission Checklist\")}\n </p>\n {[\n {\n label: tr(\"devportal.checkName\", \"Name set\"),\n ok: !!formData.name.trim(),\n },\n {\n label: tr(\n \"devportal.checkShortDesc\",\n \"Short description set\",\n ),\n ok: !!formData.shortDescription.trim(),\n },\n {\n label: tr(\n \"devportal.checkFullDesc\",\n \"Full description added\",\n ),\n ok: !!formData.description.trim(),\n },\n {\n label: tr(\"devportal.checkCategory\", \"Category selected\"),\n ok: !!formData.category,\n },\n {\n label: tr(\n \"devportal.checkVisibility\",\n \"Visibility set to Public or Unlisted\",\n ),\n ok:\n !!formData.visibility && formData.visibility !== \"PRIVATE\",\n },\n {\n label: tr(\"devportal.checkSaved\", \"All changes saved\"),\n ok: !hasChanges,\n },\n ...(app?.appType === \"NODE\" || app?.appType === \"WORKFLOW\"\n ? [\n {\n label: tr(\n \"devportal.checkVersion\",\n \"At least one version uploaded\",\n ),\n ok: (data?.application?.versions?.totalCount ?? 0) > 0,\n },\n ]\n : []),\n ].map((item) => (\n <div\n key={item.label}\n className=\"flex items-center gap-2 text-sm\"\n >\n {item.ok ? (\n <span className=\"text-status-success-text\">✓</span>\n ) : (\n <span className=\"text-status-error-text\">✗</span>\n )}\n <span\n className={\n item.ok\n ? \"text-text-secondary line-through\"\n : \"text-text-primary\"\n }\n >\n {item.label}\n </span>\n </div>\n ))}\n </div>\n )}\n\n {/* Actions */}\n <div className=\"flex flex-col gap-4 border-t pt-6\">\n {/* Primary actions */}\n <div className=\"flex items-center justify-end\">\n <button\n type=\"submit\"\n disabled={isSubmitting || !hasChanges || !canUpdate}\n aria-disabled={!canUpdate}\n className=\"inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50\"\n >\n {isSubmitting ? (\n <>\n <span className=\"h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent\" />\n {tr(\"devportal.saving\", \"Saving...\")}\n </>\n ) : (\n <>\n <Save size={16} />\n {tr(\"devportal.saveChanges\", \"Save Changes\")}\n </>\n )}\n </button>\n </div>\n\n {/* Danger zone */}\n <div className=\"rounded-lg border border-border-subtle bg-status-error-bg-subtle p-4\">\n <h3 className=\"text-sm font-medium text-status-error-text\">\n {tr(\"devportal.dangerZone\", \"Danger Zone\")}\n </h3>\n <p className=\"mt-1 text-sm text-status-error-text\">\n {tr(\n \"devportal.dangerZoneWarning\",\n \"These actions are irreversible. Please proceed with caution.\",\n )}\n </p>\n <div className=\"mt-4 flex gap-3\">\n {canDeprecate && (\n <button\n type=\"button\"\n onClick={() => setShowDeprecateDialog(true)}\n className=\"inline-flex items-center gap-2 rounded-md border border-accent-orange bg-bg-surface px-3 py-1.5 text-sm font-medium text-accent-orange hover:bg-accent-orange-subtle transition-colors\"\n >\n <Archive size={14} />\n {tr(\"devportal.deprecateApp\", \"Deprecate App\")}\n </button>\n )}\n {canDeactivate && (\n <button\n type=\"button\"\n onClick={() => setShowDeactivateDialog(true)}\n className=\"inline-flex items-center gap-2 rounded-md border border-accent-orange bg-bg-surface px-3 py-1.5 text-sm font-medium text-accent-orange hover:bg-accent-orange-subtle transition-colors\"\n >\n <Power size={14} />\n {tr(\"devportal.deactivateApp\", \"Deactivate App\")}\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => setShowDeleteDialog(true)}\n disabled={!canDelete}\n aria-disabled={!canDelete}\n className=\"inline-flex items-center gap-2 rounded-md border border-status-error-bg bg-bg-surface px-3 py-1.5 text-sm font-medium text-status-error-text hover:bg-status-error-bg-subtle transition-colors disabled:opacity-50\"\n >\n <Trash2 size={14} />\n {tr(\"devportal.deleteApp\", \"Delete App\")}\n </button>\n </div>\n </div>\n </div>\n </form>\n\n {/* Delete confirmation dialog */}\n <ConfirmDialog\n open={showDeleteDialog}\n onOpenChange={setShowDeleteDialog}\n title={tr(\"devportal.deleteApplication\", \"Delete Application\")}\n description={tr(\n \"devportal.deleteApplicationConfirm\",\n `Are you sure you want to delete \"${app.name}\"? This action cannot be undone. All OAuth clients, API keys, webhooks, and analytics data will be permanently deleted.`,\n )}\n confirmLabel={tr(\"devportal.deleteApplication\", \"Delete Application\")}\n variant=\"destructive\"\n onConfirm={handleDelete}\n />\n\n {/* Deprecate confirmation dialog */}\n <ConfirmDialog\n open={showDeprecateDialog}\n onOpenChange={setShowDeprecateDialog}\n title={tr(\"devportal.deprecateApplication\", \"Deprecate Application\")}\n description={tr(\n \"devportal.deprecateApplicationConfirm\",\n `Are you sure you want to deprecate \"${app.name}\"? Existing users will still be able to use the app, but it will no longer be visible in the marketplace and new installations will be disabled.`,\n )}\n confirmLabel={tr(\n \"devportal.deprecateApplication\",\n \"Deprecate Application\",\n )}\n variant=\"warning\"\n onConfirm={handleDeprecate}\n />\n\n {/* Deactivate confirmation dialog */}\n <ConfirmDialog\n open={showDeactivateDialog}\n onOpenChange={setShowDeactivateDialog}\n title={tr(\n \"devportal.deactivateApplication\",\n \"Deactivate Application\",\n )}\n description={tr(\n \"devportal.deactivateApplicationConfirm\",\n `Are you sure you want to deactivate \"${app.name}\"? This will revoke all active tokens and disable the app from the auth-svc layer. The app will no longer be able to authenticate or act on behalf of users.`,\n )}\n confirmLabel={tr(\n \"devportal.deactivateApplication\",\n \"Deactivate Application\",\n )}\n variant=\"destructive\"\n onConfirm={handleDeactivate}\n />\n </PageLayout>\n </PermissionGuard>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA6EA,IAAM,KAAsB;CAC1B;EAAE,OAAO;EAAc,OAAO;EAAc;CAC5C;EAAE,OAAO;EAAc,OAAO;EAAc;CAC5C;EAAE,OAAO;EAAc,OAAO;EAAc;CAC5C;EAAE,OAAO;EAAU,OAAO;EAAU;CACrC,EAEK,KAAmB,OAAO,QAAQ,EAAgB,CAAC,KACtD,CAAC,GAAO,QAAY;CACnB;CACA;CACD,EACF,EAEK,IAA0B;CAC9B;EAAE,OAAO;EAAU,OAAO;EAAmD;CAC7E;EAAE,OAAO;EAAW,OAAO;EAA+C;CAC1E;EAAE,OAAO;EAAY,OAAO;EAA6C;CAC1E,EAEK,KAA8B,CAClC,GAAG,GACH;CACE,OAAO;CACP,OAAO;CACR,CACF,EAEK,KAAmB;CACvB;EAAE,OAAO;EAAM,OAAO;EAAmB;CACzC;EAAE,OAAO;EAAe,OAAO;EAAoB;CACnD;EAAE,OAAO;EAAQ,OAAO;EAAoB;CAC5C;EAAE,OAAO;EAAQ,OAAO;EAAgB;CACxC;EAAE,OAAO;EAAQ,OAAO;EAAQ;CAChC;EAAE,OAAO;EAAiB,OAAO;EAAiB;CAClD;EAAE,OAAO;EAAW,OAAO;EAAY;CACxC;AAKD,SAAS,GACP,GAGoB;AAEpB,QADK,IACE;EACL,IAAI,EAAK;EACT,MAAM,EAAK;EACX,MAAM,EAAK;EACX,kBAAkB,EAAK,oBAAoB,KAAA;EAC3C,aAAa,EAAK,eAAe,KAAA;EACjC,SAAS,EAAK;EACd,QAAQ,EAAK;EACb,YAAY,EAAK;EACjB,UAAU,EAAK;EACf,aAAa,EAAK;EAClB,yBAAyB,EAAK,2BAA2B,KAAA;EACzD,UAAU,EAAK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kBAAC,IAAD,EAAO,MAAM,IAAM,CAAA,EAClB,EAAG,2BAA2B,iBAAiB,CACzC;;WAEX,kBAAC,UAAD;YACE,MAAK;YACL,eAAe,EAAoB,GAAK;YACxC,UAAU,CAAC;YACX,iBAAe,CAAC;YAChB,WAAU;sBALZ,CAOE,kBAAC,IAAD,EAAQ,MAAM,IAAM,CAAA,EACnB,EAAG,uBAAuB,aAAa,CACjC;;WACL;;SACF;UACF;;MACD;;IAGP,kBAAC,GAAD;KACE,MAAM;KACN,cAAc;KACd,OAAO,EAAG,+BAA+B,qBAAqB;KAC9D,aAAa,EACX,sCACA,oCAAoC,EAAI,KAAK,yHAC9C;KACD,cAAc,EAAG,+BAA+B,qBAAqB;KACrE,SAAQ;KACR,WAAW;KACX,CAAA;IAGF,kBAAC,GAAD;KACE,MAAM;KACN,cAAc;KACd,OAAO,EAAG,kCAAkC,wBAAwB;KACpE,aAAa,EACX,yCACA,uCAAuC,EAAI,KAAK,kJACjD;KACD,cAAc,EACZ,kCACA,wBACD;KACD,SAAQ;KACR,WAAW;KACX,CAAA;IAGF,kBAAC,GAAD;KACE,MAAM;KACN,cAAc;KACd,OAAO,EACL,mCACA,yBACD;KACD,aAAa,EACX,0CACA,wCAAwC,EAAI,KAAK,8JAClD;KACD,cAAc,EACZ,mCACA,yBACD;KACD,SAAQ;KACR,WAAW;KACX,CAAA;IACS;;EACG,CAAA"}
1
+ {"version":3,"file":"EditApplicationPage.js","names":[],"sources":["../../../src/devportal/pages/EditApplicationPage.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useState, useEffect } from \"react\";\nimport { useI18n } from \"@burdenoff/fe-libs/shared/providers/shell/I18nProvider\";\nimport { useParams } from \"react-router\";\nimport {\n Save,\n Trash2,\n AlertTriangle,\n Archive,\n Send,\n AlertCircle,\n AppWindow,\n Power,\n Check,\n Copy,\n Eye,\n EyeOff,\n RefreshCw,\n} from \"lucide-react\";\nimport { PageLayout, PageSection } from \"../components/PageLayout\";\nimport {\n InputField,\n TextareaField,\n SelectField,\n TagInput,\n CheckboxField,\n} from \"../components/FormField\";\nimport { MarkdownEditor } from \"../components/MarkdownEditor\";\nimport { StatusBadge } from \"../components/StatusBadge\";\nimport { ConfirmDialog } from \"../components/ConfirmDialog\";\nimport { LoadingState } from \"../components/LoadingState\";\nimport { EmptyState } from \"../components/EmptyState\";\nimport { useDevportal } from \"../providers/DevportalProvider\";\nimport { cn } from \"../utils/cn\";\nimport { nativeImpact, nativeNotify } from \"../../utils/nativeBridge\";\nimport { PermissionGuard } from \"../components\";\nimport { DEVPORTAL_PERMISSIONS } from \"../constants/permissions\";\nimport { useDevportalPermission } from \"../hooks/usePermission\";\nimport type { Application, AppType, AppVisibility, AppStatus } from \"../types\";\nimport { APP_TYPE_LABELS } from \"../utils/constants\";\nimport {\n useGetApplicationQuery,\n useUpdateApplicationMutation,\n useDeleteApplicationMutation,\n useDeactivateAppMutation,\n useRotateApplicationSigningSecretMutation,\n} from \"../../generated/global-operations\";\n\ninterface EditApplicationFormData {\n name: string;\n slug: string;\n shortDescription: string;\n description: string;\n appType: AppType;\n visibility: AppVisibility;\n category: string;\n tags: string[];\n keywords: string[];\n websiteUrl: string;\n documentationUrl: string;\n supportUrl: string;\n privacyPolicyUrl: string;\n termsOfServiceUrl: string;\n githubUrl: string;\n oauthAuthUrl: string;\n oauthRevokeUrl: string;\n requiresApproval: boolean;\n}\n\ninterface FormErrors {\n name?: string;\n slug?: string;\n shortDescription?: string;\n appType?: string;\n category?: string;\n}\n\nconst COMPATIBLE_PRODUCTS = [\n { value: \"fluidgrids\", label: \"FluidGrids\" },\n { value: \"workspaces\", label: \"Workspaces\" },\n { value: \"bigconsole\", label: \"BigConsole\" },\n { value: \"botlit\", label: \"Botlit\" },\n];\n\nconst APP_TYPE_OPTIONS = Object.entries(APP_TYPE_LABELS).map(\n ([value, label]) => ({\n value,\n label,\n }),\n);\n\nconst BASE_VISIBILITY_OPTIONS = [\n { value: \"PUBLIC\", label: \"Public — listed in the marketplace after review\" },\n { value: \"PRIVATE\", label: \"Private — only you (the creator) can see it\" },\n { value: \"INTERNAL\", label: \"Internal — visible to your entire dev org\" },\n];\n\nconst WORKFLOW_VISIBILITY_OPTIONS = [\n ...BASE_VISIBILITY_OPTIONS,\n {\n value: \"UNLISTED\",\n label: \"Unlisted — shareable via link, not listed in store\",\n },\n];\n\nconst CATEGORY_OPTIONS = [\n { value: \"ai\", label: \"AI & Automation\" },\n { value: \"integration\", label: \"Action in an App\" },\n { value: \"data\", label: \"Data & Transform\" },\n { value: \"flow\", label: \"Flow & Logic\" },\n { value: \"core\", label: \"Core\" },\n { value: \"communication\", label: \"Communication\" },\n { value: \"trigger\", label: \"Triggers\" },\n];\n\n/**\n * Helper to safely map GraphQL response to Application type\n */\nfunction mapToApplication(\n data: NonNullable<\n ReturnType<typeof useGetApplicationQuery>[\"data\"]\n >[\"application\"],\n): Application | null {\n if (!data) return null;\n return {\n id: data.id,\n name: data.name,\n slug: data.slug,\n shortDescription: data.shortDescription || undefined,\n description: data.description || undefined,\n appType: data.appType,\n status: data.status,\n visibility: data.visibility,\n tenantId: data.tenantId,\n developerId: data.developerId,\n developerOrganizationId: data.developerOrganizationId || undefined,\n category: data.category || undefined,\n tags: data.tags || [],\n keywords: data.keywords || [],\n iconUrl: data.iconUrl || undefined,\n websiteUrl: data.websiteUrl || undefined,\n documentationUrl: data.documentationUrl || undefined,\n supportUrl: data.supportUrl || undefined,\n privacyPolicyUrl: data.privacyPolicyUrl || undefined,\n termsOfServiceUrl: data.termsOfServiceUrl || undefined,\n githubUrl: data.githubUrl || undefined,\n pricingType: data.pricingType || undefined,\n installCount: data.installCount,\n activeInstallCount: data.activeInstallCount,\n averageRating: data.averageRating ?? undefined,\n reviewCount: data.reviewCount,\n submittedAt: data.submittedAt || undefined,\n publishedAt: data.publishedAt || undefined,\n lastReviewedAt: data.lastReviewedAt || undefined,\n reviewStatus: data.reviewStatus,\n reviewNotes: data.reviewNotes || undefined,\n reviewedBy: data.reviewedBy || undefined,\n isFeatured: data.isFeatured,\n isVerified: data.isVerified,\n requiresApproval: data.requiresApproval,\n oauthAuthUrl: data.oauthAuthUrl || undefined,\n oauthRevokeUrl: data.oauthRevokeUrl || undefined,\n createdAt: data.createdAt,\n updatedAt: data.updatedAt,\n };\n}\n\n/**\n * Edit application page — wired to real GraphQL mutations.\n */\nexport const EditApplicationPage: FC = () => {\n const { navigate, basePath } = useDevportal();\n const { appId } = useParams<{ appId: string }>();\n const { t } = useI18n();\n const { allowed: canUpdate } = useDevportalPermission(\n DEVPORTAL_PERMISSIONS.APP_UPDATE,\n );\n const { allowed: canDelete } = useDevportalPermission(\n DEVPORTAL_PERMISSIONS.APP_DELETE,\n );\n const tr = (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n };\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [errors, setErrors] = useState<FormErrors>({});\n const [showDeleteDialog, setShowDeleteDialog] = useState(false);\n const [showDeprecateDialog, setShowDeprecateDialog] = useState(false);\n const [showDeactivateDialog, setShowDeactivateDialog] = useState(false);\n const [hasChanges, setHasChanges] = useState(false);\n const [showSecret, setShowSecret] = useState(false);\n const [isRotating, setIsRotating] = useState(false);\n const [rotatedSecret, setRotatedSecret] = useState<string | null>(null);\n const [copiedSecret, setCopiedSecret] = useState(false);\n\n // ---------------------------------------------------------------------------\n // GraphQL queries & mutations\n // ---------------------------------------------------------------------------\n const {\n data,\n loading,\n error: queryError,\n refetch,\n } = useGetApplicationQuery({\n variables: { id: appId! },\n skip: !appId,\n });\n\n const [updateApplication] = useUpdateApplicationMutation();\n const [deleteApplication] = useDeleteApplicationMutation();\n const [deactivateApp] = useDeactivateAppMutation();\n const [rotateSigningSecret] = useRotateApplicationSigningSecretMutation();\n\n // ---------------------------------------------------------------------------\n // Derive application from query data\n // ---------------------------------------------------------------------------\n const app = mapToApplication(data?.application);\n\n useEffect(() => {\n const name = app?.name;\n if (!appId || !name) return;\n const reg = (\n window as unknown as {\n __breadcrumbRegistry?: {\n register: (id: string, name: string) => void;\n unregister: (id: string) => void;\n };\n }\n ).__breadcrumbRegistry;\n reg?.register(appId, name);\n return () => reg?.unregister(appId);\n }, [appId, app?.name]);\n\n // ---------------------------------------------------------------------------\n // Form state — initialised from fetched app once available\n // ---------------------------------------------------------------------------\n const [formData, setFormData] = useState<EditApplicationFormData>({\n name: \"\",\n slug: \"\",\n shortDescription: \"\",\n description: \"\",\n appType: \"WEB_APP\",\n visibility: \"PUBLIC\",\n category: \"\",\n tags: [],\n keywords: [],\n websiteUrl: \"\",\n documentationUrl: \"\",\n supportUrl: \"\",\n privacyPolicyUrl: \"\",\n termsOfServiceUrl: \"\",\n githubUrl: \"\",\n oauthAuthUrl: \"\",\n oauthRevokeUrl: \"\",\n requiresApproval: false,\n });\n const [compatibleProducts, setCompatibleProducts] = useState<string[]>([]);\n\n useEffect(() => {\n if (app) {\n setFormData({\n name: app.name,\n slug: app.slug,\n shortDescription: app.shortDescription || \"\",\n description: app.description || \"\",\n appType: app.appType,\n visibility: app.visibility,\n category: app.category || \"\",\n tags: app.tags,\n keywords: app.keywords,\n websiteUrl: app.websiteUrl || \"\",\n documentationUrl: app.documentationUrl || \"\",\n supportUrl: app.supportUrl || \"\",\n privacyPolicyUrl: app.privacyPolicyUrl || \"\",\n termsOfServiceUrl: app.termsOfServiceUrl || \"\",\n githubUrl: app.githubUrl || \"\",\n oauthAuthUrl: app.oauthAuthUrl || \"\",\n oauthRevokeUrl: app.oauthRevokeUrl || \"\",\n requiresApproval: app.requiresApproval,\n });\n // Load compatibleProducts from manifest.compatibility.products\n // Note: mapToApplication doesn't copy manifest, so read from raw query data directly.\n const manifest = data?.application?.manifest as\n Record<string, unknown> | null | undefined;\n const compatibility = manifest?.compatibility as\n Record<string, unknown> | undefined;\n const products = Array.isArray(compatibility?.products)\n ? (compatibility.products as string[])\n : [];\n setCompatibleProducts(products);\n setHasChanges(false);\n }\n // Re-sync form when the underlying application data changes (e.g. after\n // a refetch triggered by a mutation). We intentionally depend on\n // `data?.application` rather than the derived `app` object so that the\n // effect fires when the query cache updates.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [data?.application]);\n\n // ---------------------------------------------------------------------------\n // Handlers\n // ---------------------------------------------------------------------------\n const handleNavigate = (path: string) => {\n navigate?.(`${basePath}${path}`);\n };\n\n const handleChange = (\n field: keyof EditApplicationFormData,\n value: string | string[] | boolean,\n ) => {\n setFormData((prev) => ({ ...prev, [field]: value }));\n setHasChanges(true);\n if (errors[field as keyof FormErrors]) {\n setErrors((prev) => ({ ...prev, [field]: undefined }));\n }\n };\n\n const handleRotateSecret = async () => {\n if (!appId) return;\n setIsRotating(true);\n try {\n const result = await rotateSigningSecret({ variables: { id: appId } });\n const newSecret =\n result.data?.rotateApplicationSigningSecret?.signingSecret;\n if (newSecret) {\n setRotatedSecret(newSecret);\n setShowSecret(true);\n }\n } catch {\n nativeNotify(\"error\");\n } finally {\n setIsRotating(false);\n }\n };\n\n const handleCopySecret = async (secret: string) => {\n await navigator.clipboard.writeText(secret);\n setCopiedSecret(true);\n setTimeout(() => setCopiedSecret(false), 2000);\n };\n\n const validateForm = (): boolean => {\n const newErrors: FormErrors = {};\n\n if (!formData.name.trim()) {\n newErrors.name = tr(\n \"devportal.appNameRequired\",\n \"Application name is required\",\n );\n } else if (formData.name.length < 3) {\n newErrors.name = tr(\n \"devportal.appNameMinLength\",\n \"Name must be at least 3 characters\",\n );\n } else if (formData.name.length > 100) {\n newErrors.name = tr(\n \"devportal.appNameMaxLength\",\n \"Name must be less than 100 characters\",\n );\n }\n\n if (!formData.slug.trim()) {\n newErrors.slug = tr(\"devportal.slugRequired\", \"Slug is required\");\n } else if (!/^[a-z0-9-]+$/.test(formData.slug)) {\n newErrors.slug = tr(\n \"devportal.slugInvalidChars\",\n \"Slug can only contain lowercase letters, numbers, and hyphens\",\n );\n }\n\n if (!formData.shortDescription.trim()) {\n newErrors.shortDescription = tr(\n \"devportal.shortDescriptionRequired\",\n \"Short description is required\",\n );\n } else if (formData.shortDescription.length > 200) {\n newErrors.shortDescription = tr(\n \"devportal.shortDescriptionMaxLength\",\n \"Short description must be less than 200 characters\",\n );\n }\n\n if (!formData.appType) {\n newErrors.appType = tr(\n \"devportal.appTypeRequired\",\n \"Application type is required\",\n );\n }\n\n if (!formData.category) {\n newErrors.category = tr(\n \"devportal.categoryRequired\",\n \"Category is required\",\n );\n }\n\n setErrors(newErrors);\n return Object.keys(newErrors).length === 0;\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n\n if (!validateForm() || !app) {\n return;\n }\n\n setIsSubmitting(true);\n\n try {\n await updateApplication({\n variables: {\n id: app.id,\n input: {\n name: formData.name,\n shortDescription: formData.shortDescription,\n description: formData.description,\n appType: formData.appType,\n visibility: formData.visibility,\n category: formData.category,\n tags: formData.tags,\n keywords: formData.keywords,\n websiteUrl: formData.websiteUrl || null,\n documentationUrl: formData.documentationUrl || null,\n supportUrl: formData.supportUrl || null,\n privacyPolicyUrl: formData.privacyPolicyUrl || null,\n termsOfServiceUrl: formData.termsOfServiceUrl || null,\n githubUrl: formData.githubUrl || null,\n oauthAuthUrl: formData.oauthAuthUrl || null,\n oauthRevokeUrl: formData.oauthRevokeUrl || null,\n compatibleProducts,\n },\n },\n });\n setHasChanges(false);\n } catch (err) {\n console.error(\"Failed to update application:\", err);\n } finally {\n setIsSubmitting(false);\n }\n };\n\n const handleDelete = async () => {\n if (!app) return;\n void nativeImpact(\"medium\");\n try {\n await deleteApplication({\n variables: { id: app.id },\n });\n void nativeNotify(\"success\");\n handleNavigate(\"/apps\");\n } catch (err) {\n void nativeNotify(\"error\");\n console.error(\"Failed to delete application:\", err);\n }\n };\n\n const handleDeprecate = async () => {\n if (!app) return;\n try {\n // Deprecate is modelled as a status transition via update. The backend\n // treats a visibility change to PRIVATE + status mutation or a dedicated\n // deprecation endpoint. Here we use submitApplication with a status note\n // as the deprecate action since there is no separate `deprecateApplication`\n // mutation. If a dedicated mutation is added later, swap it in here.\n await updateApplication({\n variables: {\n id: app.id,\n input: {\n visibility: \"PRIVATE\",\n },\n },\n });\n setShowDeprecateDialog(false);\n } catch (err) {\n console.error(\"Failed to deprecate application:\", err);\n }\n };\n\n const handleDeactivate = async () => {\n if (!app) return;\n try {\n await deactivateApp({\n variables: { id: app.id },\n });\n setShowDeactivateDialog(false);\n handleNavigate(\"/apps\");\n } catch (err) {\n console.error(\"Failed to deactivate application:\", err);\n }\n };\n\n // ---------------------------------------------------------------------------\n // Loading / Error / Not-found states\n // ---------------------------------------------------------------------------\n if (loading) {\n return (\n <LoadingState\n message={tr(\"devportal.loadingApplication\", \"Loading application...\")}\n />\n );\n }\n\n if (queryError) {\n return (\n <PageLayout\n title={tr(\"devportal.error\", \"Error\")}\n backLink={`${basePath}/apps`}\n backLabel={tr(\"devportal.backToApplications\", \"Back to Applications\")}\n >\n <div className=\"flex flex-col items-center justify-center py-12 text-center\">\n <AlertCircle size={48} className=\"text-status-error-text mb-4\" />\n <h3 className=\"text-lg font-semibold mb-2\">\n {tr(\n \"devportal.failedToLoadApplication\",\n \"Failed to load application\",\n )}\n </h3>\n <p className=\"text-sm text-text-secondary\">{queryError.message}</p>\n </div>\n </PageLayout>\n );\n }\n\n if (!app) {\n return (\n <PageLayout\n title={tr(\"devportal.notFound\", \"Not Found\")}\n backLink={`${basePath}/apps`}\n backLabel={tr(\"devportal.backToApplications\", \"Back to Applications\")}\n >\n <EmptyState\n illustration=\"empty-generic\"\n icon={<AppWindow size={48} />}\n title={tr(\"devportal.applicationNotFound\", \"Application not found\")}\n description={tr(\n \"devportal.applicationNotFoundDescription\",\n \"The application you're looking for doesn't exist or you don't have access to it.\",\n )}\n />\n </PageLayout>\n );\n }\n\n // ---------------------------------------------------------------------------\n // Derived flags\n // ---------------------------------------------------------------------------\n const canSubmitForReview =\n app.status === \"DRAFT\" || app.status === \"REJECTED\";\n const canDeprecate = app.status === \"PUBLISHED\";\n const canDeactivate = app.status === \"ACTIVE\" || app.status === \"PUBLISHED\";\n\n // ---------------------------------------------------------------------------\n // Render\n // ---------------------------------------------------------------------------\n return (\n <PermissionGuard authOnly>\n <PageLayout\n title={`${tr(\"devportal.editAppTitlePrefix\", \"Edit:\")} ${app.name}`}\n description={tr(\n \"devportal.editAppDescription\",\n \"Update your application settings\",\n )}\n purpose={tr(\n \"devportal.editAppPurpose\",\n \"Change how this app appears and behaves — its name, description, classification, links, and lifecycle settings. Use the danger zone at the bottom to deprecate or delete it when it is retired.\",\n )}\n backLink={`${basePath}/apps/${app.id}`}\n backLabel={tr(\"devportal.backToApplication\", \"Back to Application\")}\n actions={\n <div className=\"flex items-center gap-2\">\n <StatusBadge status={app.status} type=\"app\" />\n </div>\n }\n >\n <form onSubmit={handleSubmit} className=\"space-y-8 max-w-3xl\">\n {/* Status banner for published apps */}\n {app.status === \"PUBLISHED\" && (\n <div className=\"rounded-lg border border-border-subtle bg-status-warning-bg-subtle p-4 flex gap-3\">\n <AlertTriangle\n size={20}\n className=\"text-status-warning-text flex-shrink-0 mt-0.5\"\n />\n <div className=\"text-sm text-status-warning-text\">\n <p className=\"font-medium\">\n {tr(\n \"devportal.appIsPublished\",\n \"This application is published\",\n )}\n </p>\n <p className=\"mt-1 text-status-warning-text\">\n {tr(\n \"devportal.publishedAppChangesWarning\",\n \"Changes to published apps may require re-review. Major changes will put the app back into review status.\",\n )}\n </p>\n </div>\n </div>\n )}\n\n {/* Basic Information */}\n <PageSection\n title={tr(\"devportal.basicInformation\", \"Basic Information\")}\n description={tr(\n \"devportal.basicInformationDescription\",\n \"Core details about your application\",\n )}\n >\n <div className=\"space-y-4\">\n <InputField\n label={tr(\"devportal.applicationName\", \"Application Name\")}\n value={formData.name}\n onChange={(e) => handleChange(\"name\", e.target.value)}\n placeholder={tr(\n \"devportal.applicationNamePlaceholder\",\n \"My Awesome App\",\n )}\n required\n error={errors.name}\n />\n\n <InputField\n label={tr(\"devportal.slug\", \"Slug\")}\n value={formData.slug}\n onChange={(e) =>\n handleChange(\"slug\", e.target.value.toLowerCase())\n }\n placeholder={tr(\"devportal.slugPlaceholder\", \"my-awesome-app\")}\n required\n error={errors.slug}\n hint={tr(\n \"devportal.slugChangeWarning\",\n \"Changing the slug may break existing integrations\",\n )}\n />\n\n <TextareaField\n label={tr(\"devportal.shortDescription\", \"Short Description\")}\n value={formData.shortDescription}\n onChange={(e) =>\n handleChange(\"shortDescription\", e.target.value)\n }\n placeholder={tr(\n \"devportal.shortDescriptionPlaceholder\",\n \"A brief description of what your app does\",\n )}\n required\n error={errors.shortDescription}\n hint={`${formData.shortDescription.length}/200 ${tr(\"devportal.characters\", \"characters\")}`}\n rows={2}\n />\n\n <MarkdownEditor\n label={tr(\"devportal.fullDescription\", \"Full Description\")}\n value={formData.description}\n onChange={(value) => handleChange(\"description\", value)}\n placeholder={tr(\n \"devportal.fullDescriptionPlaceholder\",\n \"Detailed description of your application, features, and use cases...\",\n )}\n rows={6}\n hint={tr(\n \"devportal.markdownSupported\",\n \"Markdown formatting is supported\",\n )}\n />\n </div>\n </PageSection>\n\n {/* Classification */}\n <PageSection\n title={tr(\"devportal.classification\", \"Classification\")}\n description={tr(\n \"devportal.classificationDescription\",\n \"Categorize your application\",\n )}\n >\n <div className=\"grid gap-4 sm:grid-cols-2\">\n <SelectField\n label={tr(\"devportal.applicationType\", \"Application Type\")}\n value={formData.appType}\n onChange={(e) => handleChange(\"appType\", e.target.value)}\n options={APP_TYPE_OPTIONS}\n required\n error={errors.appType}\n />\n\n <SelectField\n label={tr(\"devportal.category\", \"Category\")}\n value={formData.category}\n onChange={(e) => handleChange(\"category\", e.target.value)}\n options={CATEGORY_OPTIONS}\n required\n error={errors.category}\n />\n\n <SelectField\n label={tr(\"devportal.visibility\", \"Visibility\")}\n value={formData.visibility}\n onChange={(e) =>\n handleChange(\"visibility\", e.target.value as AppVisibility)\n }\n options={\n app?.appType === \"WORKFLOW\"\n ? WORKFLOW_VISIBILITY_OPTIONS\n : BASE_VISIBILITY_OPTIONS\n }\n hint={\n formData.visibility === \"PUBLIC\"\n ? tr(\n \"devportal.visibilityHintPublic\",\n \"Listed in the marketplace after review approval — anyone can discover and install it\",\n )\n : formData.visibility === \"UNLISTED\"\n ? tr(\n \"devportal.visibilityHintUnlisted\",\n \"Not in the store, but accessible via a direct link. You can still submit for marketplace review\",\n )\n : formData.visibility === \"INTERNAL\"\n ? tr(\n \"devportal.visibilityHintInternal\",\n \"Visible to all members of your developer organization — no one outside can access it\",\n )\n : tr(\n \"devportal.visibilityHintPrivate\",\n \"Only you (the creator) can see this — other org members cannot access it\",\n )\n }\n />\n </div>\n\n <TagInput\n label={tr(\"devportal.tags\", \"Tags\")}\n value={formData.tags}\n onChange={(tags) => handleChange(\"tags\", tags)}\n placeholder={tr(\n \"devportal.addTagsPlaceholder\",\n \"Add tags (press Enter)\",\n )}\n />\n\n <TagInput\n label={tr(\"devportal.keywords\", \"Keywords\")}\n value={formData.keywords}\n onChange={(keywords) => handleChange(\"keywords\", keywords)}\n placeholder={tr(\n \"devportal.addKeywordsPlaceholder\",\n \"Add keywords (press Enter)\",\n )}\n />\n\n {/* Compatible Products — NODE and WORKFLOW only */}\n {(formData.appType === \"NODE\" ||\n formData.appType === \"WORKFLOW\") && (\n <div className=\"space-y-2\">\n <label className=\"block text-sm font-medium text-text-primary\">\n Compatible Products\n </label>\n <p className=\"text-xs text-text-secondary\">\n Select which products this {formData.appType.toLowerCase()}{\" \"}\n works with. Users will see it in those products&apos; node\n stores.\n </p>\n <div className=\"flex flex-wrap gap-3\">\n {COMPATIBLE_PRODUCTS.map((product) => {\n const checked = compatibleProducts.includes(product.value);\n return (\n <label\n key={product.value}\n className={cn(\n \"flex items-center gap-2 cursor-pointer rounded-md border px-3 py-2 text-sm transition-colors\",\n checked\n ? \"border-primary bg-primary/10 text-text-primary\"\n : \"border-border-subtle hover:border-border text-text-secondary hover:text-text-primary\",\n )}\n >\n <input\n type=\"checkbox\"\n className=\"sr-only\"\n checked={checked}\n onChange={() => {\n setCompatibleProducts((prev) =>\n checked\n ? prev.filter((v) => v !== product.value)\n : [...prev, product.value],\n );\n setHasChanges(true);\n }}\n />\n {checked && (\n <Check\n size={14}\n className=\"text-primary flex-shrink-0\"\n />\n )}\n {product.label}\n </label>\n );\n })}\n </div>\n </div>\n )}\n </PageSection>\n\n {/* URLs */}\n <PageSection\n title={tr(\"devportal.links\", \"Links\")}\n description={tr(\n \"devportal.linksDescription\",\n \"External resources for your application\",\n )}\n >\n <div className=\"grid gap-4 sm:grid-cols-2\">\n <InputField\n label={tr(\"devportal.websiteUrl\", \"Website URL\")}\n type=\"url\"\n value={formData.websiteUrl}\n onChange={(e) => handleChange(\"websiteUrl\", e.target.value)}\n placeholder={tr(\n \"devportal.websiteUrlPlaceholder\",\n \"https://example.com\",\n )}\n />\n\n <InputField\n label={tr(\"devportal.documentationUrl\", \"Documentation URL\")}\n type=\"url\"\n value={formData.documentationUrl}\n onChange={(e) =>\n handleChange(\"documentationUrl\", e.target.value)\n }\n placeholder={tr(\n \"devportal.documentationUrlPlaceholder\",\n \"https://docs.example.com\",\n )}\n />\n\n <InputField\n label={tr(\"devportal.supportUrl\", \"Support URL\")}\n type=\"url\"\n value={formData.supportUrl}\n onChange={(e) => handleChange(\"supportUrl\", e.target.value)}\n placeholder={tr(\n \"devportal.supportUrlPlaceholder\",\n \"https://support.example.com\",\n )}\n />\n\n <InputField\n label={tr(\"devportal.githubUrl\", \"GitHub URL\")}\n type=\"url\"\n value={formData.githubUrl}\n onChange={(e) => handleChange(\"githubUrl\", e.target.value)}\n placeholder={tr(\n \"devportal.githubUrlPlaceholder\",\n \"https://github.com/org/repo\",\n )}\n />\n\n <InputField\n label={tr(\"devportal.privacyPolicyUrl\", \"Privacy Policy URL\")}\n type=\"url\"\n value={formData.privacyPolicyUrl}\n onChange={(e) =>\n handleChange(\"privacyPolicyUrl\", e.target.value)\n }\n placeholder={tr(\n \"devportal.privacyPolicyUrlPlaceholder\",\n \"https://example.com/privacy\",\n )}\n />\n\n <InputField\n label={tr(\n \"devportal.termsOfServiceUrl\",\n \"Terms of Service URL\",\n )}\n type=\"url\"\n value={formData.termsOfServiceUrl}\n onChange={(e) =>\n handleChange(\"termsOfServiceUrl\", e.target.value)\n }\n placeholder={tr(\n \"devportal.termsOfServiceUrlPlaceholder\",\n \"https://example.com/terms\",\n )}\n />\n </div>\n </PageSection>\n\n {/* Integration Setup — INTEGRATION / API_INTEGRATION only */}\n {(formData.appType === \"INTEGRATION\" ||\n formData.appType === \"API_INTEGRATION\") && (\n <PageSection\n title=\"Integration Setup\"\n description=\"Configure the endpoints for your integration. After a user installs, we redirect them to your callback URL so your server can complete the connection.\"\n >\n <div className=\"space-y-4\">\n <InputField\n label=\"Post-install Callback URL\"\n type=\"url\"\n value={formData.oauthAuthUrl}\n onChange={(e) => handleChange(\"oauthAuthUrl\", e.target.value)}\n placeholder=\"https://yourapp.com/callback\"\n hint=\"Users land here after install with ?installation_id=xxx appended\"\n />\n <InputField\n label=\"Revoke URL\"\n type=\"url\"\n value={formData.oauthRevokeUrl}\n onChange={(e) =>\n handleChange(\"oauthRevokeUrl\", e.target.value)\n }\n placeholder=\"https://yourapp.com/oauth/revoke\"\n hint=\"We POST to this URL when a user uninstalls your integration\"\n />\n {/* Signing secret — read-only, rotate-only */}\n {(() => {\n const displaySecret =\n rotatedSecret ?? data?.application?.signingSecret;\n const masked = \"boff_sk_\" + \"•\".repeat(32);\n return (\n <div className=\"space-y-1.5\">\n <label className=\"block text-sm font-medium text-text-primary\">\n Signing Secret\n </label>\n <p className=\"text-xs text-text-secondary\">\n Use this secret to authenticate{\" \"}\n <code className=\"font-mono text-xs bg-bg-sunken px-1 py-0.5 rounded\">\n verifyInstallation\n </code>{\" \"}\n calls from your integration server. Store it securely —\n it is only shown immediately after generation or\n rotation.\n </p>\n {displaySecret ? (\n <div className=\"flex items-center gap-2\">\n <div className=\"flex-1 flex items-center gap-0 rounded-md border border-border-default bg-bg-sunken overflow-hidden\">\n <code className=\"flex-1 px-3 py-2 text-xs font-mono text-text-primary truncate\">\n {showSecret ? displaySecret : masked}\n </code>\n <button\n type=\"button\"\n onClick={() => setShowSecret((v) => !v)}\n className=\"px-2 py-2 text-text-secondary hover:text-text-primary border-l border-border-default\"\n title={showSecret ? \"Hide\" : \"Reveal\"}\n >\n {showSecret ? (\n <EyeOff size={14} />\n ) : (\n <Eye size={14} />\n )}\n </button>\n <button\n type=\"button\"\n onClick={() => handleCopySecret(displaySecret)}\n className=\"px-2 py-2 text-text-secondary hover:text-text-primary border-l border-border-default\"\n title=\"Copy to clipboard\"\n >\n {copiedSecret ? (\n <Check size={14} className=\"text-green-500\" />\n ) : (\n <Copy size={14} />\n )}\n </button>\n </div>\n <button\n type=\"button\"\n onClick={handleRotateSecret}\n disabled={isRotating}\n className=\"flex items-center gap-1.5 px-3 py-2 text-xs rounded-md border border-border-default bg-bg-default text-text-primary hover:bg-bg-subtle disabled:opacity-50\"\n title=\"Rotate signing secret\"\n >\n <RefreshCw\n size={12}\n className={isRotating ? \"animate-spin\" : \"\"}\n />\n Rotate\n </button>\n </div>\n ) : (\n <button\n type=\"button\"\n onClick={handleRotateSecret}\n disabled={isRotating}\n className=\"flex items-center gap-1.5 px-3 py-2 text-xs rounded-md border border-border-default bg-bg-default text-text-primary hover:bg-bg-subtle disabled:opacity-50\"\n >\n <RefreshCw\n size={12}\n className={isRotating ? \"animate-spin\" : \"\"}\n />\n Generate Signing Secret\n </button>\n )}\n {rotatedSecret && (\n <p className=\"text-xs text-amber-600 dark:text-amber-400\">\n New secret generated. Copy it now — the old secret is\n already invalidated.\n </p>\n )}\n </div>\n );\n })()}\n </div>\n </PageSection>\n )}\n\n {/* Settings */}\n <PageSection\n title={tr(\"devportal.settings\", \"Settings\")}\n description={tr(\n \"devportal.settingsDescription\",\n \"Additional configuration options\",\n )}\n >\n <div className=\"space-y-4\">\n <CheckboxField\n label={tr(\n \"devportal.requireWorkspaceAdminApproval\",\n \"Require workspace admin approval\",\n )}\n description={tr(\n \"devportal.requireWorkspaceAdminApprovalDescription\",\n \"When enabled, workspace admins must approve installations before users can access this app\",\n )}\n checked={formData.requiresApproval}\n onChange={(e) =>\n handleChange(\"requiresApproval\", e.target.checked)\n }\n />\n </div>\n </PageSection>\n\n {/* Submission readiness checklist */}\n {canSubmitForReview && (\n <div className=\"rounded-lg border border-border-subtle bg-bg-sunken p-4 space-y-2\">\n <p className=\"text-sm font-medium text-text-primary flex items-center gap-2\">\n <Send size={14} />\n {tr(\"devportal.submissionChecklist\", \"Submission Checklist\")}\n </p>\n {[\n {\n label: tr(\"devportal.checkName\", \"Name set\"),\n ok: !!formData.name.trim(),\n },\n {\n label: tr(\n \"devportal.checkShortDesc\",\n \"Short description set\",\n ),\n ok: !!formData.shortDescription.trim(),\n },\n {\n label: tr(\n \"devportal.checkFullDesc\",\n \"Full description added\",\n ),\n ok: !!formData.description.trim(),\n },\n {\n label: tr(\"devportal.checkCategory\", \"Category selected\"),\n ok: !!formData.category,\n },\n {\n label: tr(\n \"devportal.checkVisibility\",\n \"Visibility set to Public or Unlisted\",\n ),\n ok:\n !!formData.visibility && formData.visibility !== \"PRIVATE\",\n },\n {\n label: tr(\"devportal.checkSaved\", \"All changes saved\"),\n ok: !hasChanges,\n },\n ...(app?.appType === \"NODE\" || app?.appType === \"WORKFLOW\"\n ? [\n {\n label: tr(\n \"devportal.checkVersion\",\n \"At least one version uploaded\",\n ),\n ok: (data?.application?.versions?.totalCount ?? 0) > 0,\n },\n ]\n : []),\n ].map((item) => (\n <div\n key={item.label}\n className=\"flex items-center gap-2 text-sm\"\n >\n {item.ok ? (\n <span className=\"text-status-success-text\">✓</span>\n ) : (\n <span className=\"text-status-error-text\">✗</span>\n )}\n <span\n className={\n item.ok\n ? \"text-text-secondary line-through\"\n : \"text-text-primary\"\n }\n >\n {item.label}\n </span>\n </div>\n ))}\n </div>\n )}\n\n {/* Actions */}\n <div className=\"flex flex-col gap-4 border-t pt-6\">\n {/* Primary actions */}\n <div className=\"flex items-center justify-end\">\n <button\n type=\"submit\"\n disabled={isSubmitting || !hasChanges || !canUpdate}\n aria-disabled={!canUpdate}\n className=\"inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50\"\n >\n {isSubmitting ? (\n <>\n <span className=\"h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent\" />\n {tr(\"devportal.saving\", \"Saving...\")}\n </>\n ) : (\n <>\n <Save size={16} />\n {tr(\"devportal.saveChanges\", \"Save Changes\")}\n </>\n )}\n </button>\n </div>\n\n {/* Danger zone */}\n <div className=\"rounded-lg border border-border-subtle bg-status-error-bg-subtle p-4\">\n <h3 className=\"text-sm font-medium text-status-error-text\">\n {tr(\"devportal.dangerZone\", \"Danger Zone\")}\n </h3>\n <p className=\"mt-1 text-sm text-status-error-text\">\n {tr(\n \"devportal.dangerZoneWarning\",\n \"These actions are irreversible. Please proceed with caution.\",\n )}\n </p>\n <div className=\"mt-4 flex gap-3\">\n {canDeprecate && (\n <button\n type=\"button\"\n onClick={() => setShowDeprecateDialog(true)}\n className=\"inline-flex items-center gap-2 rounded-md border border-accent-orange bg-bg-surface px-3 py-1.5 text-sm font-medium text-accent-orange hover:bg-accent-orange-subtle transition-colors\"\n >\n <Archive size={14} />\n {tr(\"devportal.deprecateApp\", \"Deprecate App\")}\n </button>\n )}\n {canDeactivate && (\n <button\n type=\"button\"\n onClick={() => setShowDeactivateDialog(true)}\n className=\"inline-flex items-center gap-2 rounded-md border border-accent-orange bg-bg-surface px-3 py-1.5 text-sm font-medium text-accent-orange hover:bg-accent-orange-subtle transition-colors\"\n >\n <Power size={14} />\n {tr(\"devportal.deactivateApp\", \"Deactivate App\")}\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => setShowDeleteDialog(true)}\n disabled={!canDelete}\n aria-disabled={!canDelete}\n className=\"inline-flex items-center gap-2 rounded-md border border-status-error-bg bg-bg-surface px-3 py-1.5 text-sm font-medium text-status-error-text hover:bg-status-error-bg-subtle transition-colors disabled:opacity-50\"\n >\n <Trash2 size={14} />\n {tr(\"devportal.deleteApp\", \"Delete App\")}\n </button>\n </div>\n </div>\n </div>\n </form>\n\n {/* Delete confirmation dialog */}\n <ConfirmDialog\n open={showDeleteDialog}\n onOpenChange={setShowDeleteDialog}\n title={tr(\"devportal.deleteApplication\", \"Delete Application\")}\n description={tr(\n \"devportal.deleteApplicationConfirm\",\n `Are you sure you want to delete \"${app.name}\"? This action cannot be undone. All OAuth clients, API keys, webhooks, and analytics data will be permanently deleted.`,\n )}\n confirmLabel={tr(\"devportal.deleteApplication\", \"Delete Application\")}\n variant=\"destructive\"\n onConfirm={handleDelete}\n />\n\n {/* Deprecate confirmation dialog */}\n <ConfirmDialog\n open={showDeprecateDialog}\n onOpenChange={setShowDeprecateDialog}\n title={tr(\"devportal.deprecateApplication\", \"Deprecate Application\")}\n description={tr(\n \"devportal.deprecateApplicationConfirm\",\n `Are you sure you want to deprecate \"${app.name}\"? Existing users will still be able to use the app, but it will no longer be visible in the marketplace and new installations will be disabled.`,\n )}\n confirmLabel={tr(\n \"devportal.deprecateApplication\",\n \"Deprecate Application\",\n )}\n variant=\"warning\"\n onConfirm={handleDeprecate}\n />\n\n {/* Deactivate confirmation dialog */}\n <ConfirmDialog\n open={showDeactivateDialog}\n onOpenChange={setShowDeactivateDialog}\n title={tr(\n \"devportal.deactivateApplication\",\n \"Deactivate Application\",\n )}\n description={tr(\n \"devportal.deactivateApplicationConfirm\",\n `Are you sure you want to deactivate \"${app.name}\"? This will revoke all active tokens and disable the app from the auth-svc layer. The app will no longer be able to authenticate or act on behalf of users.`,\n )}\n confirmLabel={tr(\n \"devportal.deactivateApplication\",\n \"Deactivate Application\",\n )}\n variant=\"destructive\"\n onConfirm={handleDeactivate}\n />\n </PageLayout>\n </PermissionGuard>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA6EA,IAAM,KAAsB;CAC1B;EAAE,OAAO;EAAc,OAAO;EAAc;CAC5C;E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;WACL;;SACF;UACF;;MACD;;IAGP,kBAAC,GAAD;KACE,MAAM;KACN,cAAc;KACd,OAAO,EAAG,+BAA+B,qBAAqB;KAC9D,aAAa,EACX,sCACA,oCAAoC,EAAI,KAAK,yHAC9C;KACD,cAAc,EAAG,+BAA+B,qBAAqB;KACrE,SAAQ;KACR,WAAW;KACX,CAAA;IAGF,kBAAC,GAAD;KACE,MAAM;KACN,cAAc;KACd,OAAO,EAAG,kCAAkC,wBAAwB;KACpE,aAAa,EACX,yCACA,uCAAuC,EAAI,KAAK,kJACjD;KACD,cAAc,EACZ,kCACA,wBACD;KACD,SAAQ;KACR,WAAW;KACX,CAAA;IAGF,kBAAC,GAAD;KACE,MAAM;KACN,cAAc;KACd,OAAO,EACL,mCACA,yBACD;KACD,aAAa,EACX,0CACA,wCAAwC,EAAI,KAAK,8JAClD;KACD,cAAc,EACZ,mCACA,yBACD;KACD,SAAQ;KACR,WAAW;KACX,CAAA;IACS;;EACG,CAAA"}
@@ -1,10 +1,10 @@
1
- import { useDevportal as e } from "../providers/DevportalProvider.js";
2
- import { cn as t } from "../utils/cn.js";
3
- import { PageLayout as n, PageSection as r } from "../components/PageLayout.js";
4
- import { CheckboxField as i, InputField as a, SelectField as o, TextareaField as s } from "../components/FormField.js";
5
- import { useEffect as c, useState as l } from "react";
6
- import { AlertCircle as u, Info as d, Loader2 as f } from "lucide-react";
7
- import { useParams as p } from "react-router-dom";
1
+ import { useParams as e } from "../../node_modules/react-router/dist/production/lib/hooks.js";
2
+ import { useDevportal as t } from "../providers/DevportalProvider.js";
3
+ import { cn as n } from "../utils/cn.js";
4
+ import { PageLayout as r, PageSection as i } from "../components/PageLayout.js";
5
+ import { CheckboxField as a, InputField as o, SelectField as s, TextareaField as c } from "../components/FormField.js";
6
+ import { useEffect as l, useState as u } from "react";
7
+ import { AlertCircle as d, Info as f, Loader2 as p } from "lucide-react";
8
8
  import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
9
9
  //#region src/devportal/pages/EditPhysicalItemPage.tsx
10
10
  var _ = [
@@ -46,7 +46,7 @@ function S(e) {
46
46
  });
47
47
  }
48
48
  var C = () => {
49
- let { navigate: v, basePath: C, apiGatewayUrl: w, authToken: T } = e(), { itemId: E } = p(), D = `${w || ""}/global/graphql`, [O, k] = l(!0), [A, j] = l(null), [M, N] = l(null), [P, F] = l({
49
+ let { navigate: v, basePath: C, apiGatewayUrl: w, authToken: T } = t(), { itemId: E } = e(), D = `${w || ""}/global/graphql`, [O, k] = u(!0), [A, j] = u(null), [M, N] = u(null), [P, F] = u({
50
50
  name: "",
51
51
  shortDescription: "",
52
52
  longDescription: "",
@@ -62,7 +62,7 @@ var C = () => {
62
62
  countryOfOrigin: "",
63
63
  warrantyInfo: "",
64
64
  returnPolicy: ""
65
- }), [I, L] = l(!1), [R, z] = l(null), [B, V] = l(!1), H = S(P);
65
+ }), [I, L] = u(!1), [R, z] = u(null), [B, V] = u(!1), H = S(P);
66
66
  async function U(e, t) {
67
67
  let n = await (await fetch(D, {
68
68
  method: "POST",
@@ -79,7 +79,7 @@ var C = () => {
79
79
  if (n.errors?.length) throw Error(n.errors.map((e) => e.message).join("; "));
80
80
  return n.data;
81
81
  }
82
- c(() => {
82
+ l(() => {
83
83
  if (!E) return;
84
84
  let e = !1;
85
85
  return k(!0), j(null), (async () => {
@@ -165,22 +165,22 @@ var C = () => {
165
165
  }
166
166
  }
167
167
  };
168
- if (O) return /* @__PURE__ */ h(n, {
168
+ if (O) return /* @__PURE__ */ h(r, {
169
169
  title: "Edit Item",
170
170
  backLink: "/seller/items",
171
171
  backLabel: "Back to My Items",
172
172
  children: /* @__PURE__ */ h("div", {
173
173
  className: "flex items-center justify-center py-20",
174
- children: /* @__PURE__ */ h(f, { className: "h-8 w-8 animate-spin text-text-secondary" })
174
+ children: /* @__PURE__ */ h(p, { className: "h-8 w-8 animate-spin text-text-secondary" })
175
175
  })
176
176
  });
177
- if (A) return /* @__PURE__ */ h(n, {
177
+ if (A) return /* @__PURE__ */ h(r, {
178
178
  title: "Edit Item",
179
179
  backLink: "/seller/items",
180
180
  backLabel: "Back to My Items",
181
181
  children: /* @__PURE__ */ g("div", {
182
182
  className: "flex items-center gap-3 rounded-lg border border-status-error-border/50 bg-status-error-bg/10 px-4 py-3 text-sm",
183
- children: [/* @__PURE__ */ h(u, {
183
+ children: [/* @__PURE__ */ h(d, {
184
184
  size: 16,
185
185
  className: "shrink-0 text-status-error-text"
186
186
  }), /* @__PURE__ */ h("span", {
@@ -190,7 +190,7 @@ var C = () => {
190
190
  })
191
191
  });
192
192
  let q = M === "DRAFT" || M === "REJECTED";
193
- return /* @__PURE__ */ h(n, {
193
+ return /* @__PURE__ */ h(r, {
194
194
  title: `Edit: ${P.name || "Item"}`,
195
195
  description: "Update your listing details. Changes take effect immediately for drafts; published items may require re-review.",
196
196
  backLink: "/seller/items",
@@ -209,7 +209,7 @@ var C = () => {
209
209
  M && /* @__PURE__ */ g("div", {
210
210
  className: "flex items-start gap-2 rounded-input border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
211
211
  children: [
212
- /* @__PURE__ */ h(d, {
212
+ /* @__PURE__ */ h(f, {
213
213
  size: 13,
214
214
  className: "mt-0.5 shrink-0 text-text-muted"
215
215
  }),
@@ -225,13 +225,13 @@ var C = () => {
225
225
  })
226
226
  ]
227
227
  }),
228
- /* @__PURE__ */ h(r, {
228
+ /* @__PURE__ */ h(i, {
229
229
  title: "Basic Information",
230
230
  description: "Core details shown in the store listing.",
231
231
  children: /* @__PURE__ */ g("div", {
232
232
  className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
233
233
  children: [
234
- /* @__PURE__ */ h(a, {
234
+ /* @__PURE__ */ h(o, {
235
235
  label: "Name",
236
236
  required: !0,
237
237
  value: P.name,
@@ -239,7 +239,7 @@ var C = () => {
239
239
  placeholder: "e.g. Wireless Ergonomic Keyboard",
240
240
  maxLength: 120
241
241
  }),
242
- /* @__PURE__ */ h(a, {
242
+ /* @__PURE__ */ h(o, {
243
243
  label: "Short Description",
244
244
  required: !0,
245
245
  value: P.shortDescription,
@@ -248,7 +248,7 @@ var C = () => {
248
248
  maxLength: 160,
249
249
  hint: `${P.shortDescription.length}/160`
250
250
  }),
251
- /* @__PURE__ */ h(s, {
251
+ /* @__PURE__ */ h(c, {
252
252
  label: "Long Description",
253
253
  value: P.longDescription,
254
254
  onChange: (e) => W("longDescription", e.target.value),
@@ -258,13 +258,13 @@ var C = () => {
258
258
  ]
259
259
  })
260
260
  }),
261
- /* @__PURE__ */ h(r, {
261
+ /* @__PURE__ */ h(i, {
262
262
  title: "Pricing",
263
263
  children: /* @__PURE__ */ g("div", {
264
264
  className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
265
265
  children: [/* @__PURE__ */ g("div", {
266
266
  className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
267
- children: [/* @__PURE__ */ h(a, {
267
+ children: [/* @__PURE__ */ h(o, {
268
268
  label: "Price",
269
269
  required: !0,
270
270
  type: "number",
@@ -273,7 +273,7 @@ var C = () => {
273
273
  placeholder: "0.00",
274
274
  min: .01,
275
275
  step: "0.01"
276
- }), /* @__PURE__ */ h(o, {
276
+ }), /* @__PURE__ */ h(s, {
277
277
  label: "Currency",
278
278
  required: !0,
279
279
  value: P.currency,
@@ -281,7 +281,7 @@ var C = () => {
281
281
  options: _,
282
282
  placeholder: "Select currency"
283
283
  })]
284
- }), /* @__PURE__ */ h(a, {
284
+ }), /* @__PURE__ */ h(o, {
285
285
  label: "Tags",
286
286
  value: P.tags,
287
287
  onChange: (e) => W("tags", e.target.value),
@@ -290,13 +290,13 @@ var C = () => {
290
290
  })]
291
291
  })
292
292
  }),
293
- /* @__PURE__ */ h(r, {
293
+ /* @__PURE__ */ h(i, {
294
294
  title: "Inventory",
295
295
  children: /* @__PURE__ */ g("div", {
296
296
  className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
297
297
  children: [/* @__PURE__ */ g("div", {
298
298
  className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
299
- children: [/* @__PURE__ */ h(a, {
299
+ children: [/* @__PURE__ */ h(o, {
300
300
  label: "Stock Quantity",
301
301
  required: !0,
302
302
  type: "number",
@@ -304,14 +304,14 @@ var C = () => {
304
304
  onChange: (e) => W("stockQuantity", e.target.value),
305
305
  min: 0,
306
306
  step: 1
307
- }), /* @__PURE__ */ h(a, {
307
+ }), /* @__PURE__ */ h(o, {
308
308
  label: "SKU",
309
309
  value: P.sku,
310
310
  onChange: (e) => W("sku", e.target.value),
311
311
  placeholder: "e.g. KB-WL-001",
312
312
  hint: "Your internal stock-keeping unit reference."
313
313
  })]
314
- }), /* @__PURE__ */ h(i, {
314
+ }), /* @__PURE__ */ h(a, {
315
315
  label: "Track Inventory",
316
316
  description: "Automatically reduce stock when orders are placed.",
317
317
  checked: P.trackInventory,
@@ -319,16 +319,16 @@ var C = () => {
319
319
  })]
320
320
  })
321
321
  }),
322
- /* @__PURE__ */ h(r, {
322
+ /* @__PURE__ */ h(i, {
323
323
  title: "Shipping",
324
324
  children: /* @__PURE__ */ g("div", {
325
325
  className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
326
- children: [/* @__PURE__ */ h(i, {
326
+ children: [/* @__PURE__ */ h(a, {
327
327
  label: "Requires Shipping",
328
328
  description: "This item will be physically shipped to the buyer.",
329
329
  checked: P.requiresShipping,
330
330
  onChange: G("requiresShipping")
331
- }), P.requiresShipping && /* @__PURE__ */ h(a, {
331
+ }), P.requiresShipping && /* @__PURE__ */ h(o, {
332
332
  label: "Weight (kg)",
333
333
  type: "number",
334
334
  value: P.weightKg,
@@ -340,7 +340,7 @@ var C = () => {
340
340
  })]
341
341
  })
342
342
  }),
343
- /* @__PURE__ */ h(r, {
343
+ /* @__PURE__ */ h(i, {
344
344
  title: "Product Details",
345
345
  description: "Optional supplemental information for buyers.",
346
346
  children: /* @__PURE__ */ g("div", {
@@ -348,25 +348,25 @@ var C = () => {
348
348
  children: [
349
349
  /* @__PURE__ */ g("div", {
350
350
  className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
351
- children: [/* @__PURE__ */ h(a, {
351
+ children: [/* @__PURE__ */ h(o, {
352
352
  label: "Brand",
353
353
  value: P.brand,
354
354
  onChange: (e) => W("brand", e.target.value),
355
355
  placeholder: "e.g. Logitech"
356
- }), /* @__PURE__ */ h(a, {
356
+ }), /* @__PURE__ */ h(o, {
357
357
  label: "Country of Origin",
358
358
  value: P.countryOfOrigin,
359
359
  onChange: (e) => W("countryOfOrigin", e.target.value),
360
360
  placeholder: "e.g. China"
361
361
  })]
362
362
  }),
363
- /* @__PURE__ */ h(a, {
363
+ /* @__PURE__ */ h(o, {
364
364
  label: "Warranty Info",
365
365
  value: P.warrantyInfo,
366
366
  onChange: (e) => W("warrantyInfo", e.target.value),
367
367
  placeholder: "e.g. 1-year limited manufacturer warranty"
368
368
  }),
369
- /* @__PURE__ */ h(s, {
369
+ /* @__PURE__ */ h(c, {
370
370
  label: "Return Policy",
371
371
  value: P.returnPolicy,
372
372
  onChange: (e) => W("returnPolicy", e.target.value),
@@ -391,8 +391,8 @@ var C = () => {
391
391
  disabled: !H || I,
392
392
  "aria-disabled": !H || I,
393
393
  title: H ? void 0 : "Fill in all required fields to continue",
394
- className: t("inline-flex items-center gap-2 rounded-button px-5 py-2 text-sm font-medium transition-colors", "border border-border-strong bg-bg-surface text-text-primary", "hover:bg-bg-sunken", "disabled:opacity-50 disabled:cursor-not-allowed"),
395
- children: I ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(f, {
394
+ className: n("inline-flex items-center gap-2 rounded-button px-5 py-2 text-sm font-medium transition-colors", "border border-border-strong bg-bg-surface text-text-primary", "hover:bg-bg-sunken", "disabled:opacity-50 disabled:cursor-not-allowed"),
395
+ children: I ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(p, {
396
396
  size: 15,
397
397
  className: "animate-spin"
398
398
  }), "Saving..."] }) : "Save Changes"
@@ -402,8 +402,8 @@ var C = () => {
402
402
  onClick: () => void K(!0),
403
403
  disabled: !H || I,
404
404
  "aria-disabled": !H || I,
405
- className: t("inline-flex items-center gap-2 rounded-button px-5 py-2 text-sm font-medium transition-colors", "bg-action-primary-bg text-action-primary-text", "hover:bg-action-primary-bg/90", "disabled:opacity-50 disabled:cursor-not-allowed"),
406
- children: I ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(f, {
405
+ className: n("inline-flex items-center gap-2 rounded-button px-5 py-2 text-sm font-medium transition-colors", "bg-action-primary-bg text-action-primary-text", "hover:bg-action-primary-bg/90", "disabled:opacity-50 disabled:cursor-not-allowed"),
406
+ children: I ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(p, {
407
407
  size: 15,
408
408
  className: "animate-spin"
409
409
  }), "Saving..."] }) : "Save & Resubmit for Review"