@burdenoff/microfe-store 2026.830.1 → 2026.830.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"MarketplaceHomePage.js","names":[],"sources":["../../src/pages/MarketplaceHomePage.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useState, useCallback, useMemo, useId, useEffect, useRef } from 'react';\nimport { useNavigate } from 'react-router';\nimport {\n Search,\n Star,\n Download,\n ChevronRight,\n ChevronDown,\n Sparkles,\n TrendingUp,\n Clock,\n Bot,\n Brain,\n LayoutDashboard,\n GitBranch,\n Box,\n Puzzle,\n ShoppingCart,\n X,\n AlertCircle,\n Gift,\n Filter,\n SlidersHorizontal,\n Loader2,\n FileCode2,\n Database,\n type LucideIcon,\n} from 'lucide-react';\nimport { useDebounce } from '@burdenoff/fe-libs/shared/hooks';\nimport { useEventBus } from '@burdenoff/fe-libs/shared/events';\nimport { useStore } from '../providers/StoreProvider';\nimport { useCart } from '../hooks/useCart';\nimport { CartDrawer } from '../components/cart/CartDrawer';\nimport {\n useHomeGroupedProducts,\n useBrowseStoreWithContext,\n type StoreProduct,\n} from '../hooks/useStoreGraphQL';\nimport type { BrowseStoreInput } from '../generated/global-types';\nimport { StoreSortBy, PricingModel, ProductNature } from '../generated/global-types';\nimport { useGetMyStoreInstallationsQuery } from '../generated/global-operations';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n AuroraBackground,\n GradientText,\n IllustratedEmptyState,\n GlassCard,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\n\n// ========================================\n// Helper Types and Functions\n// ========================================\n\ntype ProductTypeKey =\n | 'BOTAPP'\n | 'AGENT'\n | 'CONSOLE'\n | 'WORKFLOW'\n | 'NODE'\n | 'WIDGET'\n | 'VIBEMODULE'\n | 'DASHBOARD'\n | 'PARSER'\n | 'DATASINK'\n | 'APP'\n | 'TEMPLATE'\n | 'INTEGRATION'\n | 'EXTENSION'\n | 'THEME'\n | 'PLUGIN'\n | 'COMPONENT'\n | string;\n\nconst formatDownloads = (count: number): string => {\n if (count >= 1000000) return `${(count / 1000000).toFixed(1)}M`;\n if (count >= 1000) return `${(count / 1000).toFixed(1)}K`;\n return count.toString();\n};\n\nconst getPriceDisplay = (product: StoreProduct): string => {\n if (product.pricingModel === 'FREE') return 'Free';\n if (product.price === 0) return 'Free';\n return `$${product.price}`;\n};\n\nconst getProductColor = (type: ProductTypeKey): string => {\n const colors: Record<string, string> = {\n BOTAPP: 'var(--color-accent-blue)',\n AGENT: 'var(--color-accent-purple)',\n CONSOLE: 'var(--color-accent-teal)',\n WORKFLOW: 'var(--color-status-warning-bg)',\n NODE: 'var(--color-status-error-bg)',\n WIDGET: 'var(--color-accent-purple)',\n VIBEMODULE: 'var(--color-accent-blue)',\n DASHBOARD: 'var(--color-accent-blue)',\n PARSER: 'var(--color-status-warning-bg)',\n DATASINK: 'var(--color-status-success-bg)',\n APP: 'var(--color-accent-indigo)',\n TEMPLATE: 'var(--color-accent-teal)',\n INTEGRATION: 'var(--color-status-warning-bg)',\n EXTENSION: 'var(--color-accent-purple)',\n THEME: 'var(--color-accent-purple)',\n PLUGIN: 'var(--color-status-success-bg)',\n COMPONENT: 'var(--color-accent-blue)',\n };\n return colors[type] || 'var(--color-text-muted)';\n};\n\n// Helper to get translucent background color from a token\nconst getProductBgColor = (type: ProductTypeKey): string => {\n const color = getProductColor(type);\n return `color-mix(in srgb, ${color}, transparent 85%)`;\n};\n\n// Component wrapper to render type icons\ninterface ProductTypeIconProps {\n type: ProductTypeKey;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst TYPE_ICONS: Record<string, LucideIcon> = {\n BOTAPP: Bot,\n AGENT: Brain,\n CONSOLE: LayoutDashboard,\n WORKFLOW: GitBranch,\n NODE: Box,\n WIDGET: Puzzle,\n VIBEMODULE: Puzzle,\n DASHBOARD: LayoutDashboard,\n PARSER: FileCode2,\n DATASINK: Database,\n APP: Box,\n TEMPLATE: LayoutDashboard,\n INTEGRATION: GitBranch,\n EXTENSION: Puzzle,\n THEME: Puzzle,\n PLUGIN: Puzzle,\n COMPONENT: Box,\n};\n\nconst ProductTypeIcon: FC<ProductTypeIconProps> = ({ type, className, style }) => {\n const IconComponent = TYPE_ICONS[type] || Box;\n return <IconComponent className={className} style={style} />;\n};\n\n// ========================================\n// App Card Component\n// ========================================\n\ninterface AppCardProps {\n product: StoreProduct;\n onClick: () => void;\n variant?: 'default' | 'compact' | 'featured';\n}\n\nconst AppCard: FC<AppCardProps> = ({ product, onClick, variant = 'default' }) => {\n const productColor = getProductColor(product.type);\n\n if (variant === 'featured') {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className=\"group relative flex size-full cursor-pointer flex-col overflow-hidden rounded-2xl border border-border-seam bg-gradient-to-br from-bg-surface to-bg-sunken p-6 text-left shadow-elevation-1 transition-[box-shadow,border-color,color] hover:border-border-strong hover:shadow-[var(--shadow-pop)]\"\n >\n {product.featured && (\n <div className=\"absolute right-4 top-4 flex items-center gap-1 rounded-full bg-status-warning-bg-subtle px-2 py-1 text-xs font-medium text-status-warning-text\">\n <Sparkles className=\"size-3\" />\n Featured\n </div>\n )}\n <div className=\"flex items-start gap-4\">\n <div\n className=\"flex size-16 flex-shrink-0 items-center justify-center rounded-2xl\"\n style={{ backgroundColor: getProductBgColor(product.type) }}\n >\n {product.icon ? (\n <img\n src={product.icon}\n alt={product.name}\n className=\"size-10 rounded-lg object-cover\"\n />\n ) : (\n <ProductTypeIcon\n type={product.type}\n className=\"size-10\"\n style={{ color: productColor }}\n />\n )}\n </div>\n <div className=\"flex-1 overflow-hidden\">\n <h3 className=\"truncate text-lg font-semibold text-text-primary group-hover:text-text-link\">\n {product.name}\n </h3>\n <p className=\"flex items-center gap-2 text-sm text-text-muted\">\n <ProductTypeIcon type={product.type} className=\"size-3.5\" />\n {product.category || product.type}\n </p>\n </div>\n </div>\n <p className=\"mt-4 line-clamp-2 flex-1 text-sm text-text-muted\">\n {product.description || 'No description available'}\n </p>\n <div className=\"mt-4 flex items-center justify-between border-t border-border-seam pt-4\">\n <div className=\"flex items-center gap-3\">\n <span className=\"flex items-center gap-1 text-sm text-text-muted\">\n <Star className=\"size-4 fill-current text-status-warning-text\" />\n {(product.rating ?? 0).toFixed(1)}\n </span>\n <span className=\"flex items-center gap-1 text-sm text-text-muted\">\n <Download className=\"size-4\" />\n {formatDownloads(product.downloads)}\n </span>\n </div>\n <span className=\"rounded-full bg-action-primary-bg/10 px-3 py-1 text-sm font-medium text-text-link\">\n {getPriceDisplay(product)}\n </span>\n </div>\n </button>\n );\n }\n\n if (variant === 'compact') {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className=\"group flex cursor-pointer items-center gap-3 rounded-xl border border-transparent p-3 text-left transition-[background-color,border-color] hover:border-border-seam hover:bg-bg-surface\"\n >\n <div\n className=\"flex size-12 flex-shrink-0 items-center justify-center rounded-xl\"\n style={{ backgroundColor: getProductBgColor(product.type) }}\n >\n {product.icon ? (\n <img src={product.icon} alt={product.name} className=\"size-8 rounded-lg object-cover\" />\n ) : (\n <ProductTypeIcon\n type={product.type}\n className=\"size-8\"\n style={{ color: productColor }}\n />\n )}\n </div>\n <div className=\"flex-1 overflow-hidden\">\n <h4 className=\"truncate font-medium text-text-primary group-hover:text-text-link\">\n {product.name}\n </h4>\n <p className=\"truncate text-xs text-text-muted\">\n {product.category || product.type} · {(product.rating ?? 0).toFixed(1)} ★\n </p>\n </div>\n <span className=\"text-xs font-medium text-text-muted\">{getPriceDisplay(product)}</span>\n </button>\n );\n }\n\n // Default variant\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className=\"group flex cursor-pointer flex-col overflow-hidden rounded-xl border border-border-seam bg-bg-surface p-4 text-left shadow-elevation-1 transition-[box-shadow,border-color,color] hover:border-border-strong hover:shadow-[var(--shadow-pop)]\"\n >\n <div className=\"flex items-start gap-3\">\n <div\n className=\"flex size-14 flex-shrink-0 items-center justify-center rounded-xl\"\n style={{ backgroundColor: getProductBgColor(product.type) }}\n >\n {product.icon ? (\n <img src={product.icon} alt={product.name} className=\"size-9 rounded-lg object-cover\" />\n ) : (\n <ProductTypeIcon\n type={product.type}\n className=\"size-9\"\n style={{ color: productColor }}\n />\n )}\n </div>\n <div className=\"flex-1 overflow-hidden\">\n <h4 className=\"truncate font-semibold text-text-primary group-hover:text-text-link\">\n {product.name}\n </h4>\n <p className=\"flex items-center gap-1.5 text-xs text-text-muted\">\n <ProductTypeIcon type={product.type} className=\"size-3\" />\n {product.category || product.type}\n </p>\n </div>\n </div>\n <p className=\"mt-3 line-clamp-2 text-sm text-text-muted\">\n {product.description || 'No description available'}\n </p>\n <div className=\"mt-3 flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <span className=\"flex items-center gap-0.5 text-xs text-text-muted\">\n <Star className=\"size-3.5 fill-current text-status-warning-text\" />\n {(product.rating ?? 0).toFixed(1)}\n </span>\n <span className=\"text-xs text-text-muted\">·</span>\n <span className=\"text-xs text-text-muted\">\n {formatDownloads(product.downloads)} downloads\n </span>\n </div>\n <span className=\"text-xs font-semibold text-text-link\">{getPriceDisplay(product)}</span>\n </div>\n </button>\n );\n};\n\n// ========================================\n// Deprecated App Card Component\n// ========================================\n\ninterface DeprecatedProduct {\n id: string;\n name: string;\n icon?: string;\n}\n\nconst DeprecatedAppCard: FC<{ product: DeprecatedProduct; onClick: () => void }> = ({\n product,\n onClick,\n}) => (\n <button\n type=\"button\"\n onClick={onClick}\n className=\"group flex cursor-pointer items-center gap-3 rounded-xl border border-status-warning-border/30 bg-bg-surface p-4 text-left shadow-elevation-1 transition-all hover:border-status-warning-border/60 hover:shadow-[var(--shadow-pop)]\"\n >\n <div className=\"relative flex size-14 flex-shrink-0 items-center justify-center rounded-xl bg-status-warning-bg-subtle\">\n {product.icon ? (\n <img\n src={product.icon}\n alt={product.name}\n className=\"size-9 rounded-lg object-cover grayscale\"\n />\n ) : (\n <Box className=\"size-9 text-status-warning-text/50\" />\n )}\n <span className=\"absolute -right-1 -top-1 flex size-4 items-center justify-center rounded-full bg-status-warning-bg-subtle border border-status-warning-border/40\">\n <AlertCircle className=\"size-2.5 text-status-warning-text\" />\n </span>\n </div>\n <div className=\"min-w-0 flex-1\">\n <h4 className=\"truncate font-semibold text-text-secondary group-hover:text-text-link\">\n {product.name}\n </h4>\n <span\n title=\"This node is no longer supported. We encourage you to migrate to newer alternatives.\"\n className=\"mt-1 inline-flex cursor-help items-center gap-1 rounded-full bg-status-warning-bg-subtle px-2 py-0.5 text-xs font-medium text-status-warning-text\"\n >\n <AlertCircle className=\"size-3\" />\n No Longer Supported\n </span>\n </div>\n </button>\n);\n\n// ========================================\n// Section Header Component\n// ========================================\n\ninterface SectionHeaderProps {\n icon: typeof Sparkles;\n title: string;\n subtitle?: string;\n onViewAll?: () => void;\n}\n\nconst SectionHeader: FC<SectionHeaderProps> = ({ icon: Icon, title, subtitle, onViewAll }) => (\n <div className=\"mb-4 flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <div className=\"flex size-10 items-center justify-center rounded-xl bg-action-primary-bg/10\">\n <Icon className=\"size-5 text-text-link\" />\n </div>\n <div>\n <h2 className=\"text-lg font-semibold text-text-primary\">{title}</h2>\n {subtitle && <p className=\"text-sm text-text-muted\">{subtitle}</p>}\n </div>\n </div>\n {onViewAll && (\n <button\n type=\"button\"\n onClick={onViewAll}\n className=\"cursor-pointer flex items-center gap-1 text-sm font-medium text-text-link hover:underline\"\n >\n View all\n <ChevronRight className=\"size-4\" />\n </button>\n )}\n </div>\n);\n\n// ========================================\n// Category Chip Component\n// ========================================\n\ninterface CategoryChipProps {\n typeId: ProductTypeKey;\n name: string;\n count: number;\n active?: boolean;\n onClick: () => void;\n}\n\nconst CategoryChip: FC<CategoryChipProps> = ({ typeId, name, count, active, onClick }) => (\n <button\n type=\"button\"\n onClick={onClick}\n className={`flex cursor-pointer items-center gap-2 rounded-full px-4 py-2 text-sm font-medium transition-all ${\n active\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'bg-bg-surface text-text-primary hover:bg-bg-sunken'\n }`}\n >\n <ProductTypeIcon type={typeId} className=\"size-4\" />\n {name}\n <span\n className={`rounded-full px-1.5 py-0.5 text-xs ${active ? 'bg-bg-surface/20' : 'bg-bg-sunken'}`}\n >\n {count}\n </span>\n </button>\n);\n\n// ========================================\n// Hero Section Component\n// ========================================\n\ninterface HeroSectionProps {\n featuredProducts: StoreProduct[];\n onProductClick: (product: StoreProduct) => void;\n /** Optional tour anchor placed on the hero root (avoids an extra wrapper div). */\n dataTour?: string;\n}\n\nconst HeroSection: FC<HeroSectionProps> = ({ featuredProducts, onProductClick, dataTour }) => {\n const [activeIndex, setActiveIndex] = useState(0);\n const heroProduct = featuredProducts[activeIndex] || featuredProducts[0];\n\n if (!heroProduct) return null;\n\n const productColor = getProductColor(heroProduct.type);\n\n return (\n <GlassCard\n treatment=\"glass\"\n glow\n data-tour={dataTour}\n className=\"relative overflow-hidden rounded-2xl p-8\"\n >\n <div\n className=\"absolute inset-0 opacity-10\"\n style={{\n background: `linear-gradient(135deg, ${productColor} 0%, transparent 50%)`,\n }}\n />\n <div className=\"relative z-10 flex items-center gap-8\">\n <div className=\"flex-1\">\n <div className=\"mb-4 flex items-center gap-2\">\n <span className=\"flex items-center gap-1 rounded-full bg-status-warning-bg-subtle px-3 py-1 text-xs font-semibold text-status-warning-text motion-safe:animate-vc-glow-pulse\">\n <Sparkles className=\"size-3\" />\n Featured App\n </span>\n <span className=\"rounded-full bg-action-primary-bg/10 px-3 py-1 text-xs font-medium text-text-link\">\n {heroProduct.category || heroProduct.type}\n </span>\n </div>\n <h1 className=\"mb-3 text-3xl font-bold text-text-primary\">{heroProduct.name}</h1>\n <p className=\"mb-6 max-w-xl text-text-muted\">\n {heroProduct.description || 'No description available'}\n </p>\n <div className=\"mb-6 flex items-center gap-4\">\n <span className=\"flex items-center gap-1 text-sm\">\n <Star className=\"size-5 fill-current text-status-warning-text\" />\n <span className=\"font-semibold text-text-primary\">\n {(heroProduct.rating ?? 0).toFixed(1)}\n </span>\n <span className=\"text-text-muted\">({heroProduct.reviewCount} reviews)</span>\n </span>\n <span className=\"flex items-center gap-1 text-sm text-text-muted\">\n <Download className=\"size-4\" />\n {heroProduct.downloads.toLocaleString()} downloads\n </span>\n </div>\n <button\n type=\"button\"\n onClick={() => onProductClick(heroProduct)}\n className=\"cursor-pointer rounded-lg bg-action-primary-bg px-6 py-3 font-semibold text-action-primary-text transition-opacity hover:opacity-90\"\n >\n View Details\n </button>\n </div>\n <div className=\"hidden flex-shrink-0 lg:block\">\n <div\n className=\"flex size-48 items-center justify-center rounded-3xl shadow-lg\"\n style={{ backgroundColor: getProductBgColor(heroProduct.type) }}\n >\n {heroProduct.icon ? (\n <img\n src={heroProduct.icon}\n alt={heroProduct.name}\n className=\"size-32 rounded-2xl object-cover\"\n />\n ) : (\n <ProductTypeIcon\n type={heroProduct.type}\n className=\"size-32\"\n style={{ color: productColor }}\n />\n )}\n </div>\n </div>\n </div>\n {/* Featured App Selector */}\n {featuredProducts.length > 1 && (\n <div className=\"relative z-10 mt-6 flex gap-2\">\n {featuredProducts.map((product, index) => (\n <button\n type=\"button\"\n key={product.id}\n onClick={() => setActiveIndex(index)}\n className={`h-2 w-8 rounded-full transition-all ${\n index === activeIndex\n ? 'bg-action-primary-bg'\n : 'bg-border-default hover:bg-action-primary-border'\n }`}\n aria-label={`View ${product.name}`}\n />\n ))}\n </div>\n )}\n </GlassCard>\n );\n};\n\n// ========================================\n// Loading Skeleton Components\n// ========================================\n\nconst ProductCardSkeleton: FC<{ variant?: 'default' | 'compact' | 'featured' }> = ({\n variant = 'default',\n}) => {\n if (variant === 'featured') {\n return (\n <div className=\"h-full animate-pulse rounded-2xl border border-border-seam bg-bg-surface p-6\">\n <div className=\"flex items-start gap-4\">\n <div className=\"size-16 rounded-2xl bg-bg-sunken\" />\n <div className=\"flex-1 space-y-2\">\n <div className=\"h-5 w-3/4 rounded bg-bg-sunken\" />\n <div className=\"h-4 w-1/2 rounded bg-bg-sunken\" />\n </div>\n </div>\n <div className=\"mt-4 space-y-2\">\n <div className=\"h-4 w-full rounded bg-bg-sunken\" />\n <div className=\"h-4 w-2/3 rounded bg-bg-sunken\" />\n </div>\n </div>\n );\n }\n\n if (variant === 'compact') {\n return (\n <div className=\"flex animate-pulse items-center gap-3 p-3\">\n <div className=\"size-12 rounded-xl bg-bg-sunken\" />\n <div className=\"flex-1 space-y-2\">\n <div className=\"h-4 w-3/4 rounded bg-bg-sunken\" />\n <div className=\"h-3 w-1/2 rounded bg-bg-sunken\" />\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"animate-pulse rounded-xl border border-border-seam bg-bg-surface p-4\">\n <div className=\"flex items-start gap-3\">\n <div className=\"size-14 rounded-xl bg-bg-sunken\" />\n <div className=\"flex-1 space-y-2\">\n <div className=\"h-4 w-3/4 rounded bg-bg-sunken\" />\n <div className=\"h-3 w-1/2 rounded bg-bg-sunken\" />\n </div>\n </div>\n <div className=\"mt-3 space-y-2\">\n <div className=\"h-3 w-full rounded bg-bg-sunken\" />\n <div className=\"h-3 w-2/3 rounded bg-bg-sunken\" />\n </div>\n </div>\n );\n};\n\n// Hero Section Skeleton\nconst HeroSkeleton: FC = () => (\n <div className=\"animate-pulse rounded-2xl bg-gradient-to-r from-bg-surface via-bg-sunken to-bg-surface p-8\">\n <div className=\"flex items-center gap-8\">\n <div className=\"flex-1 space-y-4\">\n <div className=\"flex gap-2\">\n <div className=\"h-6 w-24 rounded-full bg-bg-sunken\" />\n <div className=\"h-6 w-20 rounded-full bg-bg-sunken\" />\n </div>\n <div className=\"h-9 w-3/4 rounded bg-bg-sunken\" />\n <div className=\"space-y-2\">\n <div className=\"h-4 w-full rounded bg-bg-sunken\" />\n <div className=\"h-4 w-5/6 rounded bg-bg-sunken\" />\n </div>\n <div className=\"flex gap-4\">\n <div className=\"h-5 w-24 rounded bg-bg-sunken\" />\n <div className=\"h-5 w-32 rounded bg-bg-sunken\" />\n </div>\n <div className=\"h-12 w-36 rounded-lg bg-bg-sunken\" />\n </div>\n <div className=\"hidden size-48 rounded-3xl bg-bg-sunken lg:block\" />\n </div>\n <div className=\"mt-6 flex gap-2\">\n {[...Array(3)].map((_, i) => (\n <div key={i} className=\"h-2 w-8 rounded-full bg-bg-sunken\" />\n ))}\n </div>\n </div>\n);\n\n// Category Chips Skeleton (Browse by Type)\nconst CHIP_WIDTHS = [100, 120, 90, 110, 130, 95, 115, 105];\n\nconst CategoryChipsSkeleton: FC = () => (\n <div className=\"space-y-4\">\n <div className=\"h-6 w-32 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"flex flex-wrap gap-2\">\n {CHIP_WIDTHS.map((width, i) => (\n <div\n key={i}\n className=\"h-9 animate-pulse rounded-full bg-bg-sunken\"\n style={{ width: `${width}px` }}\n />\n ))}\n </div>\n </div>\n);\n\n// Section Header Skeleton\nconst SectionHeaderSkeleton: FC = () => (\n <div className=\"mb-4 flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <div className=\"size-10 animate-pulse rounded-xl bg-bg-sunken\" />\n <div className=\"space-y-1\">\n <div className=\"h-5 w-40 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"h-4 w-32 animate-pulse rounded bg-bg-sunken\" />\n </div>\n </div>\n <div className=\"h-4 w-16 animate-pulse rounded bg-bg-sunken\" />\n </div>\n);\n\n// Full Page Skeleton - shows complete loading state\nconst MarketplacePageSkeleton: FC = () => (\n <div className=\"mx-auto max-w-7xl space-y-8 p-6\">\n {/* Hero Section */}\n <HeroSkeleton />\n\n {/* Browse by Type */}\n <CategoryChipsSkeleton />\n\n {/* Most Downloaded Section */}\n <div>\n <SectionHeaderSkeleton />\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {[...Array(6)].map((_, i) => (\n <ProductCardSkeleton key={i} />\n ))}\n </div>\n </div>\n\n {/* New Releases Section */}\n <div>\n <SectionHeaderSkeleton />\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {[...Array(6)].map((_, i) => (\n <ProductCardSkeleton key={i} />\n ))}\n </div>\n </div>\n\n {/* Free Apps Section */}\n <div>\n <SectionHeaderSkeleton />\n <div className=\"grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-6\">\n {[...Array(6)].map((_, i) => (\n <ProductCardSkeleton key={i} variant=\"compact\" />\n ))}\n </div>\n </div>\n </div>\n);\n\n// ========================================\n// Filter Types\n// ========================================\n\ntype PricingFilter = 'all' | 'free' | 'paid' | 'subscription';\ntype RatingFilter = 'any' | '3' | '3.5' | '4' | '4.5';\ntype NatureFilter = 'all' | 'digital' | 'physical';\ntype SortOption =\n 'relevance' | 'rating' | 'downloads' | 'newest' | 'price-low' | 'price-high' | 'name-asc';\n\ninterface FilterDropdownProps {\n label: string;\n value: string;\n options: { value: string; label: string }[];\n onChange: (value: string) => void;\n}\n\nconst FilterDropdown: FC<FilterDropdownProps> = ({ label, value, options, onChange }) => {\n const selectId = useId();\n\n return (\n <label\n htmlFor={selectId}\n className=\"relative inline-flex items-center gap-2 rounded-lg border border-border-default bg-bg-surface px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken focus-within:border-action-primary-border focus-within:ring-2 focus-within:ring-action-primary-border/20\"\n >\n <span className=\"sr-only\">{label}</span>\n <span className=\"text-text-muted\">{label}:</span>\n <select\n id={selectId}\n aria-label={label}\n value={value}\n onChange={(event) => onChange(event.target.value)}\n className=\"min-w-[8rem] appearance-none bg-transparent pr-6 text-sm font-medium text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]\"\n >\n {options.map((option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n <ChevronDown className=\"pointer-events-none absolute right-3 size-4 text-text-muted\" />\n </label>\n );\n};\n\n// ========================================\n// Main Page Component\n// ========================================\n\nexport const MarketplaceHomePage: FC = () => {\n const navigate = useNavigate();\n const { basePath, user } = useStore();\n const { t } = useI18n();\n const searchInputId = useId();\n const bus = useEventBus();\n const {\n cartOpen,\n closeCart,\n itemCount,\n cartItems,\n subtotal,\n tax,\n total,\n updateQuantity,\n removeProduct,\n } = useCart();\n const [searchQuery, setSearchQuery] = useState('');\n const [selectedType, setSelectedType] = useState<string>('all');\n\n // Filter states\n const [pricingFilter, setPricingFilter] = useState<PricingFilter>('all');\n const [ratingFilter, setRatingFilter] = useState<RatingFilter>('any');\n const [natureFilter, setNatureFilter] = useState<NatureFilter>('all');\n const [selectedCategory, setSelectedCategory] = useState<string>('all');\n const [selectedLicense, setSelectedLicense] = useState<string>('all');\n const [featuredOnly, setFeaturedOnly] = useState(false);\n const [sortOption, setSortOption] = useState<SortOption>('relevance');\n const [showFilters, setShowFilters] = useState(false);\n\n // Debounce search query - 1.5 seconds for better UX\n const debouncedSearchQuery = useDebounce(searchQuery, 1500);\n\n // Filter options\n const pricingOptions = [\n { value: 'all', label: 'All Prices' },\n { value: 'free', label: 'Free' },\n { value: 'paid', label: 'Paid (One-time)' },\n { value: 'subscription', label: 'Subscription' },\n ];\n\n const ratingOptions = [\n { value: 'any', label: 'Any Rating' },\n { value: '3', label: '3+ Stars' },\n { value: '3.5', label: '3.5+ Stars' },\n { value: '4', label: '4+ Stars' },\n { value: '4.5', label: '4.5+ Stars' },\n ];\n\n const natureOptions = [\n { value: 'all', label: 'All Types' },\n { value: 'digital', label: 'Digital' },\n { value: 'physical', label: 'Physical' },\n ];\n\n const sortOptions = [\n { value: 'relevance', label: 'Relevance' },\n { value: 'rating', label: 'Highest Rated' },\n { value: 'downloads', label: 'Most Downloads' },\n { value: 'newest', label: 'Newest First' },\n { value: 'price-low', label: 'Price: Low to High' },\n { value: 'price-high', label: 'Price: High to Low' },\n { value: 'name-asc', label: 'Name A-Z' },\n ];\n\n // Map UI sort option to GraphQL StoreSortBy enum\n const mapSortToApi = (sort: SortOption): StoreSortBy => {\n const mapping: Record<SortOption, StoreSortBy> = {\n relevance: StoreSortBy.Relevance,\n rating: StoreSortBy.Rating,\n downloads: StoreSortBy.Downloads,\n newest: StoreSortBy.Newest,\n 'price-low': StoreSortBy.PriceLow,\n 'price-high': StoreSortBy.PriceHigh,\n 'name-asc': StoreSortBy.NameAsc,\n };\n return mapping[sort];\n };\n\n // Map UI pricing filter to GraphQL PricingModel enum\n const mapPricingToApi = (pricing: PricingFilter): PricingModel | undefined => {\n if (pricing === 'all') return undefined;\n const mapping: Record<string, PricingModel> = {\n free: PricingModel.Free,\n paid: PricingModel.PaidOnetime,\n subscription: PricingModel.Subscription,\n };\n return mapping[pricing];\n };\n\n // Check if any filter is active (using debounced search for API calls)\n const hasActiveFilters =\n debouncedSearchQuery.trim() !== '' ||\n pricingFilter !== 'all' ||\n ratingFilter !== 'any' ||\n natureFilter !== 'all' ||\n selectedCategory !== 'all' ||\n selectedLicense !== 'all' ||\n featuredOnly ||\n selectedType !== 'all' ||\n sortOption !== 'relevance';\n\n // Check if user is currently typing (search not yet debounced)\n const isSearchPending = searchQuery.trim() !== '' && searchQuery !== debouncedSearchQuery;\n\n const clearAllFilters = () => {\n setSearchQuery('');\n setPricingFilter('all');\n setRatingFilter('any');\n setNatureFilter('all');\n setSelectedCategory('all');\n setSelectedLicense('all');\n setFeaturedOnly(false);\n setSortOption('relevance');\n setSelectedType('all');\n };\n\n // Count active filters (excluding search and sort)\n const activeFilterCount =\n (pricingFilter !== 'all' ? 1 : 0) +\n (ratingFilter !== 'any' ? 1 : 0) +\n (natureFilter !== 'all' ? 1 : 0) +\n (selectedCategory !== 'all' ? 1 : 0) +\n (selectedLicense !== 'all' ? 1 : 0) +\n (featuredOnly ? 1 : 0) +\n (selectedType !== 'all' ? 1 : 0);\n\n // Build BrowseStoreInput from filter states for API call\n const browseStoreInput: BrowseStoreInput = useMemo(() => {\n const input: BrowseStoreInput = {\n sortBy: mapSortToApi(sortOption),\n pagination: { limit: 50 },\n };\n\n // Only add filter if we have active filters\n if (hasActiveFilters) {\n input.filter = {};\n\n // Search query (debounced)\n if (debouncedSearchQuery.trim()) {\n input.filter.search = debouncedSearchQuery.trim();\n }\n\n // Type filter\n if (selectedType !== 'all') {\n input.filter.type = selectedType as BrowseStoreInput['filter'] extends { type?: infer T }\n ? T\n : never;\n }\n\n // Category filter\n if (selectedCategory !== 'all') {\n input.filter.category = selectedCategory;\n }\n\n // Nature filter (digital/physical)\n if (natureFilter !== 'all') {\n input.filter.nature =\n natureFilter === 'digital' ? ProductNature.Digital : ProductNature.Physical;\n }\n\n // Pricing filter\n const pricingModel = mapPricingToApi(pricingFilter);\n if (pricingModel) {\n input.filter.pricingModel = pricingModel;\n }\n\n // Rating filter\n if (ratingFilter !== 'any') {\n input.filter.minRating = parseFloat(ratingFilter);\n }\n\n // Featured filter\n if (featuredOnly) {\n input.filter.featured = true;\n }\n\n // License filter\n if (selectedLicense !== 'all') {\n input.filter.license = selectedLicense;\n }\n }\n\n return input;\n }, [\n debouncedSearchQuery,\n selectedType,\n selectedCategory,\n natureFilter,\n pricingFilter,\n ratingFilter,\n featuredOnly,\n selectedLicense,\n sortOption,\n hasActiveFilters,\n ]);\n\n // Fetch grouped products for homepage (when no filters active)\n const {\n featured,\n mostDownloaded,\n recentlyAdded,\n freeItems,\n loading: homeLoading,\n error: homeError,\n refetch: refetchHome,\n } = useHomeGroupedProducts({ skip: hasActiveFilters });\n\n // Fetch filtered products from API when filters are active\n const {\n products: browseProducts,\n totalCount,\n facets,\n loading: browseLoading,\n error: browseError,\n refetch: refetchBrowse,\n } = useBrowseStoreWithContext(hasActiveFilters ? browseStoreInput : {}, {\n skip: !hasActiveFilters,\n });\n\n // Determine which data to show\n const loading = hasActiveFilters ? browseLoading : homeLoading;\n const error = hasActiveFilters ? browseError : homeError;\n const refetch = hasActiveFilters ? refetchBrowse : refetchHome;\n\n // Products to display when filters are active\n const filteredProducts = hasActiveFilters ? browseProducts : [];\n\n // Emit search event when debounced query resolves. Read totalCount via ref so\n // we don't re-emit when only the count changes.\n const totalCountRef = useRef(totalCount);\n totalCountRef.current = totalCount;\n const busRef = useRef(bus);\n busRef.current = bus;\n useEffect(() => {\n if (!debouncedSearchQuery.trim() || browseLoading) return;\n (busRef.current as unknown as { emit: (name: string, payload: unknown) => void }).emit(\n 'store.marketplace.searched',\n {\n query: debouncedSearchQuery,\n resultCount: totalCountRef.current,\n }\n );\n }, [debouncedSearchQuery, browseLoading]);\n\n const handleProductClick = useCallback(\n (product: StoreProduct) => {\n navigate(`${basePath}/marketplace/product/${product.id}`);\n },\n [navigate, basePath]\n );\n\n const handleCheckout = () => {\n closeCart();\n navigate(`${basePath}/cart`);\n };\n\n // Get all unique products for the homepage \"All Apps\" section\n const allProducts = useMemo(\n () => [\n ...new Map(\n [...featured, ...mostDownloaded, ...recentlyAdded, ...freeItems].map((p) => [p.id, p])\n ).values(),\n ],\n [featured, mostDownloaded, recentlyAdded, freeItems]\n );\n\n // Fetch installations to surface deprecated (UNLISTED) apps the user has installed\n const isAuthenticated = !!user?.id;\n const { data: installationsData } = useGetMyStoreInstallationsQuery({\n variables: { limit: 100 },\n skip: !isAuthenticated,\n fetchPolicy: 'cache-and-network',\n });\n\n // Deduplicate by productId (user may have installed in multiple workspaces)\n const deprecatedInstalledProducts = useMemo<DeprecatedProduct[]>(() => {\n if (!installationsData?.myStoreAppInstallations?.items) return [];\n const seen = new Set<string>();\n const result: DeprecatedProduct[] = [];\n for (const item of installationsData.myStoreAppInstallations.items) {\n if (item.productStatus === 'UNLISTED' && !seen.has(item.productId)) {\n seen.add(item.productId);\n result.push({\n id: item.productId,\n name: item.productName ?? 'Unknown App',\n icon: item.productIcon ?? undefined,\n });\n }\n }\n return result;\n }, [installationsData]);\n\n // Build dynamic filter options from facets (when available) or from homepage products\n const typeCategories = useMemo(() => {\n // Use facets from API if available\n if (facets?.types && facets.types.length > 0) {\n return [\n { id: 'all', name: 'All Apps', count: totalCount },\n ...facets.types.map((t) => ({\n id: t.value,\n name: t.value.charAt(0) + t.value.slice(1).toLowerCase().replace(/_/g, ' '),\n count: t.count,\n })),\n ];\n }\n // Fallback to homepage products: count each type in a single pass.\n const typeCounts = allProducts.reduce<Map<string, number>>((acc, p) => {\n acc.set(p.type, (acc.get(p.type) ?? 0) + 1);\n return acc;\n }, new Map());\n const typeOptions = Array.from(typeCounts.entries())\n .flatMap(([type, count]) =>\n count > 0\n ? [\n {\n id: type,\n name: type.charAt(0) + type.slice(1).toLowerCase().replace(/_/g, ' '),\n count,\n },\n ]\n : []\n )\n .sort((a, b) => b.count - a.count);\n return [{ id: 'all', name: 'All Apps', count: allProducts.length }, ...typeOptions];\n }, [facets, allProducts, totalCount]);\n\n // Build category options from facets or products\n const categoryOptions = useMemo(() => {\n if (facets?.categories && facets.categories.length > 0) {\n return [\n { value: 'all', label: 'All Categories' },\n ...facets.categories.map((c) => ({\n value: c.value,\n label: c.value,\n })),\n ];\n }\n return [\n { value: 'all', label: 'All Categories' },\n ...Array.from(new Set(allProducts.flatMap((p) => (p.category ? [p.category] : []))))\n .map((cat) => ({\n value: cat as string,\n label: cat as string,\n }))\n .sort((a, b) => a.label.localeCompare(b.label)),\n ];\n }, [facets, allProducts]);\n\n // Build license options from facets or static list\n const licenseOptions = useMemo(() => {\n if (facets?.licenses && facets.licenses.length > 0) {\n return [\n { value: 'all', label: 'All Licenses' },\n ...facets.licenses.map((l) => ({\n value: l.value,\n label: l.value,\n })),\n ];\n }\n return [{ value: 'all', label: 'All Licenses' }];\n }, [facets]);\n\n return (\n <div className=\"flex h-full flex-col\">\n {/* Header */}\n <header className=\"relative overflow-hidden border-b border-border-seam bg-bg-surface px-6 py-4\">\n <AuroraBackground intensity=\"subtle\" />\n <div className=\"flex items-center justify-between\">\n <div>\n <h1 className=\"text-2xl font-bold text-text-primary\">\n App{' '}\n <GradientText>\n {t('pages.marketplace.title', { defaultValue: 'Marketplace' })}\n </GradientText>\n </h1>\n <p className=\"text-sm text-text-muted\">\n {t('pages.marketplace.subtitle', {\n defaultValue: 'Discover apps, workflows, and integrations for your workspace',\n })}\n </p>\n </div>\n <button\n type=\"button\"\n data-tour=\"store-marketplace-cart-button\"\n onClick={() => navigate(`${basePath}/cart`)}\n className=\"cursor-pointer relative flex items-center gap-2 rounded-lg border border-border-default bg-bg-surface px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken\"\n >\n <ShoppingCart className=\"size-5\" />\n {t('pages.marketplace.cart', { defaultValue: 'Cart' })}\n {itemCount > 0 && (\n <span className=\"absolute -right-2 -top-2 flex size-5 items-center justify-center rounded-full bg-action-primary-bg text-xs font-bold text-action-primary-text\">\n {itemCount}\n </span>\n )}\n </button>\n </div>\n\n {/* Search Bar - Live filtering as you type */}\n <div className=\"mt-4\">\n <div className=\"relative\">\n <label htmlFor={searchInputId} className=\"sr-only\">\n {t('pages.marketplace.search.label', { defaultValue: 'Search marketplace products' })}\n </label>\n <Search className=\"absolute left-4 top-1/2 size-5 -translate-y-1/2 text-text-muted\" />\n <input\n id={searchInputId}\n data-tour=\"store-marketplace-search-input\"\n aria-label={t('pages.marketplace.search.label', {\n defaultValue: 'Search marketplace products',\n })}\n type=\"text\"\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n placeholder={t('pages.marketplace.search.placeholder', {\n defaultValue: 'Search apps, workflows, integrations...',\n })}\n className=\"w-full rounded-xl border border-border-default bg-bg-sunken py-3 pl-12 pr-4 text-text-primary placeholder-text-muted focus:border-action-primary-border focus:bg-bg-surface focus:outline-none focus:ring-2 focus:ring-action-primary-border/20\"\n />\n {searchQuery && (\n <button\n type=\"button\"\n onClick={() => setSearchQuery('')}\n aria-label={t('pages.marketplace.search.clear', { defaultValue: 'Clear search' })}\n className=\"cursor-pointer absolute right-4 top-1/2 -translate-y-1/2 text-text-muted transition-colors hover:text-text-primary\"\n >\n <X className=\"size-4\" aria-hidden=\"true\" />\n </button>\n )}\n </div>\n {/* Search results count / pending indicator */}\n {searchQuery.trim() && (\n <div\n aria-live=\"polite\"\n className=\"mt-2 flex items-center gap-2 text-sm text-text-muted\"\n >\n {isSearchPending || browseLoading ? (\n <>\n <Loader2 className=\"size-4 animate-spin\" />\n <span>\n {t('pages.marketplace.search.searching', { defaultValue: 'Searching...' })}\n </span>\n </>\n ) : (\n <span>\n {totalCount} result{totalCount !== 1 ? 's' : ''} for &ldquo;{debouncedSearchQuery}\n &rdquo;\n </span>\n )}\n </div>\n )}\n </div>\n\n {/* Filter Bar */}\n <div className=\"mt-4 flex flex-wrap items-center gap-3\">\n {/* Filter Toggle Button */}\n <button\n type=\"button\"\n data-tour=\"store-marketplace-filters-button\"\n onClick={() => setShowFilters(!showFilters)}\n className={`cursor-pointer flex items-center gap-2 rounded-lg border px-3 py-2 text-sm font-medium transition-colors ${\n showFilters || activeFilterCount > 0\n ? 'border-action-primary-border bg-action-primary-bg/10 text-text-link'\n : 'border-border-default bg-bg-surface text-text-primary transition-colors hover:bg-bg-sunken'\n }`}\n >\n <SlidersHorizontal className=\"size-4\" />\n {t('pages.marketplace.filters', { defaultValue: 'Filters' })}\n {activeFilterCount > 0 && (\n <span className=\"flex size-5 items-center justify-center rounded-full bg-action-primary-bg text-xs text-action-primary-text\">\n {activeFilterCount}\n </span>\n )}\n </button>\n\n {/* Quick Filter Chips - Always visible */}\n <div\n className=\"flex flex-wrap items-center gap-2\"\n data-tour=\"store-marketplace-quick-filters\"\n >\n <button\n type=\"button\"\n onClick={() => setPricingFilter(pricingFilter === 'free' ? 'all' : 'free')}\n className={`cursor-pointer flex items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors ${\n pricingFilter === 'free'\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'bg-bg-sunken text-text-primary transition-colors hover:bg-bg-surface'\n }`}\n >\n <Gift className=\"size-3.5\" />\n Free\n </button>\n <button\n type=\"button\"\n onClick={() => setRatingFilter(ratingFilter === '4' ? 'any' : '4')}\n className={`cursor-pointer flex items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors ${\n ratingFilter === '4'\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'bg-bg-sunken text-text-primary transition-colors hover:bg-bg-surface'\n }`}\n >\n <Star className=\"size-3.5\" />\n 4+ Stars\n </button>\n <button\n type=\"button\"\n onClick={() => setFeaturedOnly(!featuredOnly)}\n className={`cursor-pointer flex items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors ${\n featuredOnly\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'bg-bg-sunken text-text-primary transition-colors hover:bg-bg-surface'\n }`}\n >\n <Sparkles className=\"size-3.5\" />\n Featured\n </button>\n </div>\n\n {/* Clear Filters */}\n {hasActiveFilters && (\n <button\n type=\"button\"\n onClick={clearAllFilters}\n className=\"cursor-pointer flex items-center gap-1 text-sm text-text-muted transition-colors hover:text-text-primary\"\n >\n <X className=\"size-4\" aria-hidden=\"true\" />\n Clear all\n </button>\n )}\n\n {/* Sort Dropdown - Right aligned */}\n <div className=\"ml-auto\" data-tour=\"store-marketplace-section-sort\">\n <FilterDropdown\n label=\"Sort\"\n value={sortOption}\n options={sortOptions}\n onChange={(value) => setSortOption(value as SortOption)}\n />\n </div>\n </div>\n\n {/* Expanded Filters Panel */}\n {showFilters && (\n <div className=\"mt-4 rounded-lg border border-border-seam bg-bg-surface p-4\">\n <div className=\"flex flex-wrap items-start gap-6\">\n {/* Pricing Filter */}\n <div className=\"flex flex-col gap-2\">\n <span className=\"text-xs font-medium uppercase tracking-wider text-text-muted\">\n Pricing\n </span>\n <FilterDropdown\n label=\"Price\"\n value={pricingFilter}\n options={pricingOptions}\n onChange={(value) => setPricingFilter(value as PricingFilter)}\n />\n </div>\n\n {/* Rating Filter */}\n <div className=\"flex flex-col gap-2\">\n <span className=\"text-xs font-medium uppercase tracking-wider text-text-muted\">\n Min Rating\n </span>\n <FilterDropdown\n label=\"Rating\"\n value={ratingFilter}\n options={ratingOptions}\n onChange={(value) => setRatingFilter(value as RatingFilter)}\n />\n </div>\n\n {/* Category Filter */}\n {categoryOptions.length > 1 && (\n <div className=\"flex flex-col gap-2\">\n <span className=\"text-xs font-medium uppercase tracking-wider text-text-muted\">\n Category\n </span>\n <FilterDropdown\n label=\"Category\"\n value={selectedCategory}\n options={categoryOptions}\n onChange={setSelectedCategory}\n />\n </div>\n )}\n\n {/* Nature Filter (Digital/Physical) */}\n <div className=\"flex flex-col gap-2\">\n <span className=\"text-xs font-medium uppercase tracking-wider text-text-muted\">\n Nature\n </span>\n <FilterDropdown\n label=\"Nature\"\n value={natureFilter}\n options={natureOptions}\n onChange={(value) => setNatureFilter(value as NatureFilter)}\n />\n </div>\n\n {/* License Filter */}\n {licenseOptions.length > 1 && (\n <div className=\"flex flex-col gap-2\">\n <span className=\"text-xs font-medium uppercase tracking-wider text-text-muted\">\n License\n </span>\n <FilterDropdown\n label=\"License\"\n value={selectedLicense}\n options={licenseOptions}\n onChange={setSelectedLicense}\n />\n </div>\n )}\n </div>\n\n {/* Active Filters Summary */}\n {activeFilterCount > 0 && (\n <div className=\"mt-4 flex flex-wrap items-center gap-2 border-t border-border-default pt-4\">\n <span className=\"text-xs font-medium text-text-muted\">Active filters:</span>\n {selectedType !== 'all' && (\n <button\n type=\"button\"\n onClick={() => setSelectedType('all')}\n className=\"inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-action-primary-border bg-action-primary-bg/5 px-3 py-1.5 text-xs font-medium text-text-link shadow-sm transition-colors hover:bg-action-primary-bg/15\"\n >\n <span className=\"text-text-muted\">Type:</span> {selectedType}\n <X className=\"size-3\" aria-hidden=\"true\" />\n </button>\n )}\n {pricingFilter !== 'all' && (\n <button\n type=\"button\"\n onClick={() => setPricingFilter('all')}\n className=\"inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-action-primary-border bg-action-primary-bg/5 px-3 py-1.5 text-xs font-medium text-text-link shadow-sm transition-colors hover:bg-action-primary-bg/15\"\n >\n <span className=\"text-text-muted\">Price:</span>{' '}\n {pricingOptions.find((o) => o.value === pricingFilter)?.label}\n <X className=\"size-3\" aria-hidden=\"true\" />\n </button>\n )}\n {ratingFilter !== 'any' && (\n <button\n type=\"button\"\n onClick={() => setRatingFilter('any')}\n className=\"inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-action-primary-border bg-action-primary-bg/5 px-3 py-1.5 text-xs font-medium text-text-link shadow-sm transition-colors hover:bg-action-primary-bg/15\"\n >\n <span className=\"text-text-muted\">Rating:</span>{' '}\n {ratingOptions.find((o) => o.value === ratingFilter)?.label}\n <X className=\"size-3\" aria-hidden=\"true\" />\n </button>\n )}\n {selectedCategory !== 'all' && (\n <button\n type=\"button\"\n onClick={() => setSelectedCategory('all')}\n className=\"inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-action-primary-border bg-action-primary-bg/5 px-3 py-1.5 text-xs font-medium text-text-link shadow-sm transition-colors hover:bg-action-primary-bg/15\"\n >\n <span className=\"text-text-muted\">Category:</span> {selectedCategory}\n <X className=\"size-3\" aria-hidden=\"true\" />\n </button>\n )}\n {natureFilter !== 'all' && (\n <button\n type=\"button\"\n onClick={() => setNatureFilter('all')}\n className=\"inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-action-primary-border bg-action-primary-bg/5 px-3 py-1.5 text-xs font-medium text-text-link shadow-sm transition-colors hover:bg-action-primary-bg/15\"\n >\n <span className=\"text-text-muted\">Nature:</span>{' '}\n {natureOptions.find((o) => o.value === natureFilter)?.label}\n <X className=\"size-3\" aria-hidden=\"true\" />\n </button>\n )}\n {selectedLicense !== 'all' && (\n <button\n type=\"button\"\n onClick={() => setSelectedLicense('all')}\n className=\"inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-action-primary-border bg-action-primary-bg/5 px-3 py-1.5 text-xs font-medium text-text-link shadow-sm transition-colors hover:bg-action-primary-bg/15\"\n >\n <span className=\"text-text-muted\">License:</span>{' '}\n {licenseOptions.find((o) => o.value === selectedLicense)?.label}\n <X className=\"size-3\" aria-hidden=\"true\" />\n </button>\n )}\n {featuredOnly && (\n <button\n type=\"button\"\n onClick={() => setFeaturedOnly(false)}\n className=\"inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-action-primary-border bg-action-primary-bg/5 px-3 py-1.5 text-xs font-medium text-text-link shadow-sm transition-colors hover:bg-action-primary-bg/15\"\n >\n <Sparkles className=\"size-3\" />\n Featured Only\n <X className=\"size-3\" aria-hidden=\"true\" />\n </button>\n )}\n </div>\n )}\n </div>\n )}\n </header>\n\n {/* Main Content */}\n <main className=\"flex-1 overflow-y-auto\">\n <div className=\"mx-auto max-w-7xl space-y-8 p-6\">\n <PagePurpose>\n The marketplace is where you discover and install apps, agents, workflows, nodes and\n widgets that extend your workspaces. Browse featured and trending picks, filter by type\n or category, search for something specific, then open any product to view pricing and\n reviews before adding it to your cart.\n </PagePurpose>\n {/* Error State */}\n {error && (\n <div\n role=\"alert\"\n className=\"flex flex-col items-center justify-center rounded-xl border border-status-error-border bg-status-error-bg-subtle p-8 text-center\"\n >\n <AlertCircle className=\"mb-4 size-12 text-status-error-text\" />\n <h3 className=\"mb-2 text-lg font-semibold text-status-error-text-emphasis\">\n Failed to load marketplace\n </h3>\n <p className=\"mb-4 text-sm text-status-error-text\">\n {error.message || 'An error occurred while fetching products'}\n </p>\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"cursor-pointer rounded-lg bg-status-error-bg px-4 py-2 text-sm font-medium text-status-error-text transition-colors hover:bg-status-error-bg-emphasis\"\n >\n Try Again\n </button>\n </div>\n )}\n\n {/* Loading State */}\n {loading && !error && <MarketplacePageSkeleton />}\n\n {/* Content - Only show when data is loaded */}\n {!loading && !error && (\n <>\n {/* Hero Section - Featured Products (only when no filters) */}\n {!hasActiveFilters && selectedType === 'all' && featured.length > 0 && (\n <HeroSection\n dataTour=\"store-marketplace-hero-section\"\n featuredProducts={featured}\n onProductClick={handleProductClick}\n />\n )}\n\n {/* Type Filter Categories */}\n {typeCategories.length > 1 && (\n <div>\n <h2 className=\"mb-4 text-lg font-semibold text-text-primary\">Browse by Type</h2>\n <div\n className=\"flex flex-wrap gap-2\"\n data-tour=\"store-marketplace-type-categories\"\n >\n {typeCategories.map((category) => (\n <CategoryChip\n key={category.id}\n typeId={category.id}\n name={category.name}\n count={category.count}\n active={selectedType === category.id}\n onClick={() => setSelectedType(category.id)}\n />\n ))}\n </div>\n </div>\n )}\n\n {/* Show Filtered Results when filters are active */}\n {hasActiveFilters && (\n <section>\n <SectionHeader\n icon={Filter}\n title={debouncedSearchQuery ? `Search Results` : 'Filtered Results'}\n subtitle={`${totalCount} app${totalCount !== 1 ? 's' : ''} found`}\n />\n {filteredProducts.length > 0 ? (\n <div\n className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\"\n data-tour=\"store-marketplace-product-grid\"\n >\n {filteredProducts.map((product) => (\n <AppCard\n key={product.id}\n product={product}\n onClick={() => handleProductClick(product)}\n />\n ))}\n </div>\n ) : (\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title=\"No apps match your filters\"\n description=\"Try adjusting your filter criteria or clearing filters to see more results.\"\n action={\n <button\n type=\"button\"\n onClick={clearAllFilters}\n className=\"cursor-pointer rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-opacity hover:opacity-90\"\n >\n Clear All Filters\n </button>\n }\n />\n )}\n </section>\n )}\n\n {/* Show grouped sections only when no filters are active */}\n {!hasActiveFilters && selectedType === 'all' && (\n <>\n {/* Most Downloaded / Trending Apps */}\n {mostDownloaded.length > 0 && (\n <section>\n <SectionHeader\n icon={TrendingUp}\n title=\"Most Downloaded\"\n subtitle=\"Top picks by our community\"\n />\n <div\n className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3\"\n data-tour=\"store-marketplace-most-downloaded\"\n >\n {mostDownloaded.slice(0, 6).map((product) => (\n <AppCard\n key={product.id}\n product={product}\n onClick={() => handleProductClick(product)}\n />\n ))}\n </div>\n </section>\n )}\n\n {/* Recently Added / New Releases */}\n {recentlyAdded.length > 0 && (\n <section>\n <SectionHeader\n icon={Clock}\n title=\"New Releases\"\n subtitle=\"Recently published apps\"\n />\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {recentlyAdded.slice(0, 6).map((product) => (\n <AppCard\n key={product.id}\n product={product}\n onClick={() => handleProductClick(product)}\n />\n ))}\n </div>\n </section>\n )}\n\n {/* Free Items */}\n {freeItems.length > 0 && (\n <section>\n <SectionHeader\n icon={Gift}\n title=\"Free Apps\"\n subtitle=\"No cost, full functionality\"\n />\n <div className=\"grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-6\">\n {freeItems.slice(0, 6).map((product) => (\n <AppCard\n key={product.id}\n product={product}\n onClick={() => handleProductClick(product)}\n variant=\"compact\"\n />\n ))}\n </div>\n </section>\n )}\n\n {/* All Apps */}\n {allProducts.length > 0 && (\n <section>\n <SectionHeader\n icon={Box}\n title=\"All Apps\"\n subtitle={`${allProducts.length} apps available`}\n />\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n {allProducts.map((product) => (\n <AppCard\n key={product.id}\n product={product}\n onClick={() => handleProductClick(product)}\n />\n ))}\n </div>\n </section>\n )}\n </>\n )}\n\n {/* Deprecated Installed Apps — shown whenever user has UNLISTED products installed */}\n {isAuthenticated && deprecatedInstalledProducts.length > 0 && (\n <section>\n <SectionHeader\n icon={AlertCircle}\n title=\"Deprecated Apps You've Installed\"\n subtitle=\"These apps are no longer supported — hover the badge for details\"\n />\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {deprecatedInstalledProducts.map((product) => (\n <DeprecatedAppCard\n key={product.id}\n product={product}\n onClick={() => navigate(`${basePath}/marketplace/product/${product.id}`)}\n />\n ))}\n </div>\n </section>\n )}\n\n {/* Empty State - No products at all */}\n {allProducts.length === 0 && (\n <IllustratedEmptyState\n illustration=\"onboarding\"\n title=\"No apps available yet\"\n description=\"The marketplace is empty. Check back soon for new apps, workflows, and integrations.\"\n />\n )}\n </>\n )}\n </div>\n </main>\n\n {/* Cart Drawer */}\n <CartDrawer\n isOpen={cartOpen}\n onClose={closeCart}\n onCheckout={handleCheckout}\n cartItems={cartItems}\n itemCount={itemCount}\n subtotal={subtotal}\n tax={tax}\n total={total}\n updateQuantity={updateQuantity}\n removeProduct={removeProduct}\n />\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AA2EA,IAAM,MAAmB,MACnB,KAAS,MAAgB,IAAI,IAAQ,KAAS,QAAQ,EAAE,CAAC,KACzD,KAAS,MAAa,IAAI,IAAQ,KAAM,QAAQ,EAAE,CAAC,KAChD,EAAM,UAAU,EAGnB,KAAmB,MACnB,EAAQ,iBAAiB,UACzB,EAAQ,UAAU,IAAU,SACzB,IAAI,EAAQ,SAGf,KAAmB,OACgB;CACrC,QAAQ;CACR,OAAO;CACP,SAAS;CACT,UAAU;CACV,MAAM;CACN,QAAQ;CACR,YAAY;CACZ,WAAW;CACX,QAAQ;CACR,UAAU;CACV,KAAK;CACL,UAAU;CACV,aAAa;CACb,WAAW;CACX,OAAO;CACP,QAAQ;CACR,WAAW;CACZ,EACa,MAAS,2BAInB,KAAqB,MAElB,sBADO,EAAgB,EAAK,CACA,qBAU/B,IAAyC;CAC7C,QAAQ;CACR,OAAO;CACP,SAAS;CACT,UAAU;CACV,MAAM;CACN,QAAQ;CACR,YAAY;CACZ,WAAW;CACX,QAAQ;CACR,UAAU;CACV,KAAK;CACL,UAAU;CACV,aAAa;CACb,WAAW;CACX,OAAO;CACP,QAAQ;CACR,WAAW;CACZ,EAEK,KAA6C,EAAE,SAAM,cAAW,eAE7D,kBADe,EAAW,MAAS,GACnC;CAA0B;CAAkB;CAAS,CAAA,EAaxD,KAA6B,EAAE,YAAS,YAAS,aAAU,gBAAgB;CAC/E,IAAM,IAAe,EAAgB,EAAQ,KAAK;AAqGlD,QAnGI,MAAY,aAEZ,kBAAC,UAAD;EACE,MAAK;EACI;EACT,WAAU;YAHZ;GAKG,EAAQ,YACP,kBAAC,OAAD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sourcesContent":["import type { FC } from 'react';\nimport { useState, useCallback, useMemo, useId, useEffect, useRef } from 'react';\nimport { useNavigate } from 'react-router';\nimport {\n Search,\n Star,\n Download,\n ChevronRight,\n ChevronDown,\n Sparkles,\n TrendingUp,\n Clock,\n Bot,\n Brain,\n LayoutDashboard,\n GitBranch,\n Box,\n Puzzle,\n ShoppingCart,\n X,\n AlertCircle,\n Gift,\n Filter,\n SlidersHorizontal,\n Loader2,\n FileCode2,\n Database,\n type LucideIcon,\n} from 'lucide-react';\nimport { useDebounce } from '@burdenoff/fe-libs/shared/hooks';\nimport { useEventBus } from '@burdenoff/fe-libs/shared/events';\nimport { useStore } from '../providers/StoreProvider';\nimport { useCart } from '../hooks/useCart';\nimport { CartDrawer } from '../components/cart/CartDrawer';\nimport {\n useHomeGroupedProducts,\n useBrowseStoreWithContext,\n type StoreProduct,\n} from '../hooks/useStoreGraphQL';\nimport type { BrowseStoreInput } from '../generated/global-types';\nimport { StoreSortBy, PricingModel, ProductNature } from '../generated/global-types';\nimport { useGetMyStoreInstallationsQuery } from '../generated/global-operations';\nimport { useTr } from '../shared/hooks/useTr';\nimport {\n AuroraBackground,\n GradientText,\n IllustratedEmptyState,\n GlassCard,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\n\n// ========================================\n// Helper Types and Functions\n// ========================================\n\ntype ProductTypeKey =\n | 'BOTAPP'\n | 'AGENT'\n | 'CONSOLE'\n | 'WORKFLOW'\n | 'NODE'\n | 'WIDGET'\n | 'VIBEMODULE'\n | 'DASHBOARD'\n | 'PARSER'\n | 'DATASINK'\n | 'APP'\n | 'TEMPLATE'\n | 'INTEGRATION'\n | 'EXTENSION'\n | 'THEME'\n | 'PLUGIN'\n | 'COMPONENT'\n | string;\n\nconst formatDownloads = (count: number): string => {\n if (count >= 1000000) return `${(count / 1000000).toFixed(1)}M`;\n if (count >= 1000) return `${(count / 1000).toFixed(1)}K`;\n return count.toString();\n};\n\nconst getPriceDisplay = (\n product: StoreProduct,\n tr?: (key: string, fallback: string) => string\n): string => {\n if (product.pricingModel === 'FREE') return tr ? tr('pages.marketplace.free', 'Free') : 'Free';\n if (product.price === 0) return tr ? tr('pages.marketplace.free', 'Free') : 'Free';\n return `$${product.price}`;\n};\n\nconst getProductColor = (type: ProductTypeKey): string => {\n const colors: Record<string, string> = {\n BOTAPP: 'var(--color-accent-blue)',\n AGENT: 'var(--color-accent-purple)',\n CONSOLE: 'var(--color-accent-teal)',\n WORKFLOW: 'var(--color-status-warning-bg)',\n NODE: 'var(--color-status-error-bg)',\n WIDGET: 'var(--color-accent-purple)',\n VIBEMODULE: 'var(--color-accent-blue)',\n DASHBOARD: 'var(--color-accent-blue)',\n PARSER: 'var(--color-status-warning-bg)',\n DATASINK: 'var(--color-status-success-bg)',\n APP: 'var(--color-accent-indigo)',\n TEMPLATE: 'var(--color-accent-teal)',\n INTEGRATION: 'var(--color-status-warning-bg)',\n EXTENSION: 'var(--color-accent-purple)',\n THEME: 'var(--color-accent-purple)',\n PLUGIN: 'var(--color-status-success-bg)',\n COMPONENT: 'var(--color-accent-blue)',\n };\n return colors[type] || 'var(--color-text-muted)';\n};\n\n// Helper to get translucent background color from a token\nconst getProductBgColor = (type: ProductTypeKey): string => {\n const color = getProductColor(type);\n return `color-mix(in srgb, ${color}, transparent 85%)`;\n};\n\n// Component wrapper to render type icons\ninterface ProductTypeIconProps {\n type: ProductTypeKey;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst TYPE_ICONS: Record<string, LucideIcon> = {\n BOTAPP: Bot,\n AGENT: Brain,\n CONSOLE: LayoutDashboard,\n WORKFLOW: GitBranch,\n NODE: Box,\n WIDGET: Puzzle,\n VIBEMODULE: Puzzle,\n DASHBOARD: LayoutDashboard,\n PARSER: FileCode2,\n DATASINK: Database,\n APP: Box,\n TEMPLATE: LayoutDashboard,\n INTEGRATION: GitBranch,\n EXTENSION: Puzzle,\n THEME: Puzzle,\n PLUGIN: Puzzle,\n COMPONENT: Box,\n};\n\nconst ProductTypeIcon: FC<ProductTypeIconProps> = ({ type, className, style }) => {\n const IconComponent = TYPE_ICONS[type] || Box;\n return <IconComponent className={className} style={style} />;\n};\n\n// ========================================\n// App Card Component\n// ========================================\n\ninterface AppCardProps {\n product: StoreProduct;\n onClick: () => void;\n variant?: 'default' | 'compact' | 'featured';\n}\n\nconst AppCard: FC<AppCardProps> = ({ product, onClick, variant = 'default' }) => {\n const tr = useTr();\n const productColor = getProductColor(product.type);\n\n if (variant === 'featured') {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className=\"group relative flex size-full cursor-pointer flex-col overflow-hidden rounded-2xl border border-border-seam bg-gradient-to-br from-bg-surface to-bg-sunken p-6 text-left shadow-elevation-1 transition-[box-shadow,border-color,color] hover:border-border-strong hover:shadow-[var(--shadow-pop)]\"\n >\n {product.featured && (\n <div className=\"absolute right-4 top-4 flex items-center gap-1 rounded-full bg-status-warning-bg-subtle px-2 py-1 text-xs font-medium text-status-warning-text\">\n <Sparkles className=\"size-3\" />\n {tr('pages.marketplace.featured', 'Featured')}\n </div>\n )}\n <div className=\"flex items-start gap-4\">\n <div\n className=\"flex size-16 flex-shrink-0 items-center justify-center rounded-2xl\"\n style={{ backgroundColor: getProductBgColor(product.type) }}\n >\n {product.icon ? (\n <img\n src={product.icon}\n alt={product.name}\n className=\"size-10 rounded-lg object-cover\"\n />\n ) : (\n <ProductTypeIcon\n type={product.type}\n className=\"size-10\"\n style={{ color: productColor }}\n />\n )}\n </div>\n <div className=\"flex-1 overflow-hidden\">\n <h3 className=\"truncate text-lg font-semibold text-text-primary group-hover:text-text-link\">\n {product.name}\n </h3>\n <p className=\"flex items-center gap-2 text-sm text-text-muted\">\n <ProductTypeIcon type={product.type} className=\"size-3.5\" />\n {product.category || product.type}\n </p>\n </div>\n </div>\n <p className=\"mt-4 line-clamp-2 flex-1 text-sm text-text-muted\">\n {product.description || tr('pages.productDetail.noDesc', 'No description available')}\n </p>\n <div className=\"mt-4 flex items-center justify-between border-t border-border-seam pt-4\">\n <div className=\"flex items-center gap-3\">\n <span className=\"flex items-center gap-1 text-sm text-text-muted\">\n <Star className=\"size-4 fill-current text-status-warning-text\" />\n {(product.rating ?? 0).toFixed(1)}\n </span>\n <span className=\"flex items-center gap-1 text-sm text-text-muted\">\n <Download className=\"size-4\" />\n {formatDownloads(product.downloads)}\n </span>\n </div>\n <span className=\"rounded-full bg-action-primary-bg/10 px-3 py-1 text-sm font-medium text-text-link\">\n {getPriceDisplay(product, tr)}\n </span>\n </div>\n </button>\n );\n }\n\n if (variant === 'compact') {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className=\"group flex cursor-pointer items-center gap-3 rounded-xl border border-transparent p-3 text-left transition-[background-color,border-color] hover:border-border-seam hover:bg-bg-surface\"\n >\n <div\n className=\"flex size-12 flex-shrink-0 items-center justify-center rounded-xl\"\n style={{ backgroundColor: getProductBgColor(product.type) }}\n >\n {product.icon ? (\n <img src={product.icon} alt={product.name} className=\"size-8 rounded-lg object-cover\" />\n ) : (\n <ProductTypeIcon\n type={product.type}\n className=\"size-8\"\n style={{ color: productColor }}\n />\n )}\n </div>\n <div className=\"flex-1 overflow-hidden\">\n <h4 className=\"truncate font-medium text-text-primary group-hover:text-text-link\">\n {product.name}\n </h4>\n <p className=\"truncate text-xs text-text-muted\">\n {product.category || product.type} · {(product.rating ?? 0).toFixed(1)} ★\n </p>\n </div>\n <span className=\"text-xs font-medium text-text-muted\">{getPriceDisplay(product, tr)}</span>\n </button>\n );\n }\n\n // Default variant\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className=\"group flex cursor-pointer flex-col overflow-hidden rounded-xl border border-border-seam bg-bg-surface p-4 text-left shadow-elevation-1 transition-[box-shadow,border-color,color] hover:border-border-strong hover:shadow-[var(--shadow-pop)]\"\n >\n <div className=\"flex items-start gap-3\">\n <div\n className=\"flex size-14 flex-shrink-0 items-center justify-center rounded-xl\"\n style={{ backgroundColor: getProductBgColor(product.type) }}\n >\n {product.icon ? (\n <img src={product.icon} alt={product.name} className=\"size-9 rounded-lg object-cover\" />\n ) : (\n <ProductTypeIcon\n type={product.type}\n className=\"size-9\"\n style={{ color: productColor }}\n />\n )}\n </div>\n <div className=\"flex-1 overflow-hidden\">\n <h4 className=\"truncate font-semibold text-text-primary group-hover:text-text-link\">\n {product.name}\n </h4>\n <p className=\"flex items-center gap-1.5 text-xs text-text-muted\">\n <ProductTypeIcon type={product.type} className=\"size-3\" />\n {product.category || product.type}\n </p>\n </div>\n </div>\n <p className=\"mt-3 line-clamp-2 text-sm text-text-muted\">\n {product.description || tr('pages.productDetail.noDesc', 'No description available')}\n </p>\n <div className=\"mt-3 flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <span className=\"flex items-center gap-0.5 text-xs text-text-muted\">\n <Star className=\"size-3.5 fill-current text-status-warning-text\" />\n {(product.rating ?? 0).toFixed(1)}\n </span>\n <span className=\"text-xs text-text-muted\">·</span>\n <span className=\"text-xs text-text-muted\">\n {tr('pages.marketplace.downloads', '{{count}} downloads', {\n count: formatDownloads(product.downloads),\n })}\n </span>\n </div>\n <span className=\"text-xs font-semibold text-text-link\">{getPriceDisplay(product, tr)}</span>\n </div>\n </button>\n );\n};\n\n// ========================================\n// Deprecated App Card Component\n// ========================================\n\ninterface DeprecatedProduct {\n id: string;\n name: string;\n icon?: string;\n}\n\nconst DeprecatedAppCard: FC<{ product: DeprecatedProduct; onClick: () => void }> = ({\n product,\n onClick,\n}) => {\n const tr = useTr();\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className=\"group flex cursor-pointer items-center gap-3 rounded-xl border border-status-warning-border/30 bg-bg-surface p-4 text-left shadow-elevation-1 transition-all hover:border-status-warning-border/60 hover:shadow-[var(--shadow-pop)]\"\n >\n <div className=\"relative flex size-14 flex-shrink-0 items-center justify-center rounded-xl bg-status-warning-bg-subtle\">\n {product.icon ? (\n <img\n src={product.icon}\n alt={product.name}\n className=\"size-9 rounded-lg object-cover grayscale\"\n />\n ) : (\n <Box className=\"size-9 text-status-warning-text/50\" />\n )}\n <span className=\"absolute -right-1 -top-1 flex size-4 items-center justify-center rounded-full bg-status-warning-bg-subtle border border-status-warning-border/40\">\n <AlertCircle className=\"size-2.5 text-status-warning-text\" />\n </span>\n </div>\n <div className=\"min-w-0 flex-1\">\n <h4 className=\"truncate font-semibold text-text-secondary group-hover:text-text-link\">\n {product.name}\n </h4>\n <span\n title={tr(\n 'pages.marketplace.deprecatedHint',\n 'This node is no longer supported. We encourage you to migrate to newer alternatives.'\n )}\n className=\"mt-1 inline-flex cursor-help items-center gap-1 rounded-full bg-status-warning-bg-subtle px-2 py-0.5 text-xs font-medium text-status-warning-text\"\n >\n <AlertCircle className=\"size-3\" />\n {tr('pages.marketplace.deprecated', 'No Longer Supported')}\n </span>\n </div>\n </button>\n );\n};\n\n// ========================================\n// Section Header Component\n// ========================================\n\ninterface SectionHeaderProps {\n icon: typeof Sparkles;\n title: string;\n subtitle?: string;\n onViewAll?: () => void;\n}\n\nconst SectionHeader: FC<SectionHeaderProps> = ({ icon: Icon, title, subtitle, onViewAll }) => {\n const tr = useTr();\n return (\n <div className=\"mb-4 flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <div className=\"flex size-10 items-center justify-center rounded-xl bg-action-primary-bg/10\">\n <Icon className=\"size-5 text-text-link\" />\n </div>\n <div>\n <h2 className=\"text-lg font-semibold text-text-primary\">{title}</h2>\n {subtitle && <p className=\"text-sm text-text-muted\">{subtitle}</p>}\n </div>\n </div>\n {onViewAll && (\n <button\n type=\"button\"\n onClick={onViewAll}\n className=\"cursor-pointer flex items-center gap-1 text-sm font-medium text-text-link hover:underline\"\n >\n {tr('pages.marketplace.viewAll', 'View all')}\n <ChevronRight className=\"size-4\" />\n </button>\n )}\n </div>\n );\n};\n\n// ========================================\n// Category Chip Component\n// ========================================\n\ninterface CategoryChipProps {\n typeId: ProductTypeKey;\n name: string;\n count: number;\n active?: boolean;\n onClick: () => void;\n}\n\nconst CategoryChip: FC<CategoryChipProps> = ({ typeId, name, count, active, onClick }) => (\n <button\n type=\"button\"\n onClick={onClick}\n className={`flex cursor-pointer items-center gap-2 rounded-full px-4 py-2 text-sm font-medium transition-all ${\n active\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'bg-bg-surface text-text-primary hover:bg-bg-sunken'\n }`}\n >\n <ProductTypeIcon type={typeId} className=\"size-4\" />\n {name}\n <span\n className={`rounded-full px-1.5 py-0.5 text-xs ${active ? 'bg-bg-surface/20' : 'bg-bg-sunken'}`}\n >\n {count}\n </span>\n </button>\n);\n\n// ========================================\n// Hero Section Component\n// ========================================\n\ninterface HeroSectionProps {\n featuredProducts: StoreProduct[];\n onProductClick: (product: StoreProduct) => void;\n /** Optional tour anchor placed on the hero root (avoids an extra wrapper div). */\n dataTour?: string;\n}\n\nconst HeroSection: FC<HeroSectionProps> = ({ featuredProducts, onProductClick, dataTour }) => {\n const tr = useTr();\n const [activeIndex, setActiveIndex] = useState(0);\n const heroProduct = featuredProducts[activeIndex] || featuredProducts[0];\n\n if (!heroProduct) return null;\n\n const productColor = getProductColor(heroProduct.type);\n\n return (\n <GlassCard\n treatment=\"glass\"\n glow\n data-tour={dataTour}\n className=\"relative overflow-hidden rounded-2xl p-8\"\n >\n <div\n className=\"absolute inset-0 opacity-10\"\n style={{\n background: `linear-gradient(135deg, ${productColor} 0%, transparent 50%)`,\n }}\n />\n <div className=\"relative z-10 flex items-center gap-8\">\n <div className=\"flex-1\">\n <div className=\"mb-4 flex items-center gap-2\">\n <span className=\"flex items-center gap-1 rounded-full bg-status-warning-bg-subtle px-3 py-1 text-xs font-semibold text-status-warning-text motion-safe:animate-vc-glow-pulse\">\n <Sparkles className=\"size-3\" />\n {tr('pages.marketplace.featuredApp', 'Featured App')}\n </span>\n <span className=\"rounded-full bg-action-primary-bg/10 px-3 py-1 text-xs font-medium text-text-link\">\n {heroProduct.category || heroProduct.type}\n </span>\n </div>\n <h1 className=\"mb-3 text-3xl font-bold text-text-primary\">{heroProduct.name}</h1>\n <p className=\"mb-6 max-w-xl text-text-muted\">\n {heroProduct.description ||\n tr('pages.productDetail.noDesc', 'No description available')}\n </p>\n <div className=\"mb-6 flex items-center gap-4\">\n <span className=\"flex items-center gap-1 text-sm\">\n <Star className=\"size-5 fill-current text-status-warning-text\" />\n <span className=\"font-semibold text-text-primary\">\n {(heroProduct.rating ?? 0).toFixed(1)}\n </span>\n <span className=\"text-text-muted\">\n {tr('pages.productDetail.reviews_count', '({{count}} reviews)', {\n count: heroProduct.reviewCount,\n })}\n </span>\n </span>\n <span className=\"flex items-center gap-1 text-sm text-text-muted\">\n <Download className=\"size-4\" />\n {tr('pages.marketplace.downloadsCount', '{{count}} downloads', {\n count: heroProduct.downloads.toLocaleString(),\n })}\n </span>\n </div>\n <button\n type=\"button\"\n onClick={() => onProductClick(heroProduct)}\n className=\"cursor-pointer rounded-lg bg-action-primary-bg px-6 py-3 font-semibold text-action-primary-text transition-opacity hover:opacity-90\"\n >\n {tr('pages.marketplace.viewDetails', 'View Details')}\n </button>\n </div>\n <div className=\"hidden flex-shrink-0 lg:block\">\n <div\n className=\"flex size-48 items-center justify-center rounded-3xl shadow-lg\"\n style={{ backgroundColor: getProductBgColor(heroProduct.type) }}\n >\n {heroProduct.icon ? (\n <img\n src={heroProduct.icon}\n alt={heroProduct.name}\n className=\"size-32 rounded-2xl object-cover\"\n />\n ) : (\n <ProductTypeIcon\n type={heroProduct.type}\n className=\"size-32\"\n style={{ color: productColor }}\n />\n )}\n </div>\n </div>\n </div>\n {/* Featured App Selector */}\n {featuredProducts.length > 1 && (\n <div className=\"relative z-10 mt-6 flex gap-2\">\n {featuredProducts.map((product, index) => (\n <button\n type=\"button\"\n key={product.id}\n onClick={() => setActiveIndex(index)}\n className={`h-2 w-8 rounded-full transition-all ${\n index === activeIndex\n ? 'bg-action-primary-bg'\n : 'bg-border-default hover:bg-action-primary-border'\n }`}\n aria-label={tr('pages.marketplace.viewProduct', 'View {{name}}', {\n name: product.name,\n })}\n />\n ))}\n </div>\n )}\n </GlassCard>\n );\n};\n\n// ========================================\n// Loading Skeleton Components\n// ========================================\n\nconst ProductCardSkeleton: FC<{ variant?: 'default' | 'compact' | 'featured' }> = ({\n variant = 'default',\n}) => {\n if (variant === 'featured') {\n return (\n <div className=\"h-full animate-pulse rounded-2xl border border-border-seam bg-bg-surface p-6\">\n <div className=\"flex items-start gap-4\">\n <div className=\"size-16 rounded-2xl bg-bg-sunken\" />\n <div className=\"flex-1 space-y-2\">\n <div className=\"h-5 w-3/4 rounded bg-bg-sunken\" />\n <div className=\"h-4 w-1/2 rounded bg-bg-sunken\" />\n </div>\n </div>\n <div className=\"mt-4 space-y-2\">\n <div className=\"h-4 w-full rounded bg-bg-sunken\" />\n <div className=\"h-4 w-2/3 rounded bg-bg-sunken\" />\n </div>\n </div>\n );\n }\n\n if (variant === 'compact') {\n return (\n <div className=\"flex animate-pulse items-center gap-3 p-3\">\n <div className=\"size-12 rounded-xl bg-bg-sunken\" />\n <div className=\"flex-1 space-y-2\">\n <div className=\"h-4 w-3/4 rounded bg-bg-sunken\" />\n <div className=\"h-3 w-1/2 rounded bg-bg-sunken\" />\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"animate-pulse rounded-xl border border-border-seam bg-bg-surface p-4\">\n <div className=\"flex items-start gap-3\">\n <div className=\"size-14 rounded-xl bg-bg-sunken\" />\n <div className=\"flex-1 space-y-2\">\n <div className=\"h-4 w-3/4 rounded bg-bg-sunken\" />\n <div className=\"h-3 w-1/2 rounded bg-bg-sunken\" />\n </div>\n </div>\n <div className=\"mt-3 space-y-2\">\n <div className=\"h-3 w-full rounded bg-bg-sunken\" />\n <div className=\"h-3 w-2/3 rounded bg-bg-sunken\" />\n </div>\n </div>\n );\n};\n\n// Hero Section Skeleton\nconst HeroSkeleton: FC = () => (\n <div className=\"animate-pulse rounded-2xl bg-gradient-to-r from-bg-surface via-bg-sunken to-bg-surface p-8\">\n <div className=\"flex items-center gap-8\">\n <div className=\"flex-1 space-y-4\">\n <div className=\"flex gap-2\">\n <div className=\"h-6 w-24 rounded-full bg-bg-sunken\" />\n <div className=\"h-6 w-20 rounded-full bg-bg-sunken\" />\n </div>\n <div className=\"h-9 w-3/4 rounded bg-bg-sunken\" />\n <div className=\"space-y-2\">\n <div className=\"h-4 w-full rounded bg-bg-sunken\" />\n <div className=\"h-4 w-5/6 rounded bg-bg-sunken\" />\n </div>\n <div className=\"flex gap-4\">\n <div className=\"h-5 w-24 rounded bg-bg-sunken\" />\n <div className=\"h-5 w-32 rounded bg-bg-sunken\" />\n </div>\n <div className=\"h-12 w-36 rounded-lg bg-bg-sunken\" />\n </div>\n <div className=\"hidden size-48 rounded-3xl bg-bg-sunken lg:block\" />\n </div>\n <div className=\"mt-6 flex gap-2\">\n {[...Array(3)].map((_, i) => (\n <div key={i} className=\"h-2 w-8 rounded-full bg-bg-sunken\" />\n ))}\n </div>\n </div>\n);\n\n// Category Chips Skeleton (Browse by Type)\nconst CHIP_WIDTHS = [100, 120, 90, 110, 130, 95, 115, 105];\n\nconst CategoryChipsSkeleton: FC = () => (\n <div className=\"space-y-4\">\n <div className=\"h-6 w-32 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"flex flex-wrap gap-2\">\n {CHIP_WIDTHS.map((width, i) => (\n <div\n key={i}\n className=\"h-9 animate-pulse rounded-full bg-bg-sunken\"\n style={{ width: `${width}px` }}\n />\n ))}\n </div>\n </div>\n);\n\n// Section Header Skeleton\nconst SectionHeaderSkeleton: FC = () => (\n <div className=\"mb-4 flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <div className=\"size-10 animate-pulse rounded-xl bg-bg-sunken\" />\n <div className=\"space-y-1\">\n <div className=\"h-5 w-40 animate-pulse rounded bg-bg-sunken\" />\n <div className=\"h-4 w-32 animate-pulse rounded bg-bg-sunken\" />\n </div>\n </div>\n <div className=\"h-4 w-16 animate-pulse rounded bg-bg-sunken\" />\n </div>\n);\n\n// Full Page Skeleton - shows complete loading state\nconst MarketplacePageSkeleton: FC = () => (\n <div className=\"mx-auto max-w-7xl space-y-8 p-6\">\n {/* Hero Section */}\n <HeroSkeleton />\n\n {/* Browse by Type */}\n <CategoryChipsSkeleton />\n\n {/* Most Downloaded Section */}\n <div>\n <SectionHeaderSkeleton />\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {[...Array(6)].map((_, i) => (\n <ProductCardSkeleton key={i} />\n ))}\n </div>\n </div>\n\n {/* New Releases Section */}\n <div>\n <SectionHeaderSkeleton />\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {[...Array(6)].map((_, i) => (\n <ProductCardSkeleton key={i} />\n ))}\n </div>\n </div>\n\n {/* Free Apps Section */}\n <div>\n <SectionHeaderSkeleton />\n <div className=\"grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-6\">\n {[...Array(6)].map((_, i) => (\n <ProductCardSkeleton key={i} variant=\"compact\" />\n ))}\n </div>\n </div>\n </div>\n);\n\n// ========================================\n// Filter Types\n// ========================================\n\ntype PricingFilter = 'all' | 'free' | 'paid' | 'subscription';\ntype RatingFilter = 'any' | '3' | '3.5' | '4' | '4.5';\ntype NatureFilter = 'all' | 'digital' | 'physical';\ntype SortOption =\n 'relevance' | 'rating' | 'downloads' | 'newest' | 'price-low' | 'price-high' | 'name-asc';\n\ninterface FilterDropdownProps {\n label: string;\n value: string;\n options: { value: string; label: string }[];\n onChange: (value: string) => void;\n}\n\nconst FilterDropdown: FC<FilterDropdownProps> = ({ label, value, options, onChange }) => {\n const selectId = useId();\n\n return (\n <label\n htmlFor={selectId}\n className=\"relative inline-flex items-center gap-2 rounded-lg border border-border-default bg-bg-surface px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken focus-within:border-action-primary-border focus-within:ring-2 focus-within:ring-action-primary-border/20\"\n >\n <span className=\"sr-only\">{label}</span>\n <span className=\"text-text-muted\">{label}:</span>\n <select\n id={selectId}\n aria-label={label}\n value={value}\n onChange={(event) => onChange(event.target.value)}\n className=\"min-w-[8rem] appearance-none bg-transparent pr-6 text-sm font-medium text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]\"\n >\n {options.map((option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n <ChevronDown className=\"pointer-events-none absolute right-3 size-4 text-text-muted\" />\n </label>\n );\n};\n\n// ========================================\n// Main Page Component\n// ========================================\n\nexport const MarketplaceHomePage: FC = () => {\n const navigate = useNavigate();\n const { basePath, user } = useStore();\n const tr = useTr();\n const searchInputId = useId();\n const bus = useEventBus();\n const {\n cartOpen,\n closeCart,\n itemCount,\n cartItems,\n subtotal,\n tax,\n total,\n updateQuantity,\n removeProduct,\n } = useCart();\n const [searchQuery, setSearchQuery] = useState('');\n const [selectedType, setSelectedType] = useState<string>('all');\n\n // Filter states\n const [pricingFilter, setPricingFilter] = useState<PricingFilter>('all');\n const [ratingFilter, setRatingFilter] = useState<RatingFilter>('any');\n const [natureFilter, setNatureFilter] = useState<NatureFilter>('all');\n const [selectedCategory, setSelectedCategory] = useState<string>('all');\n const [selectedLicense, setSelectedLicense] = useState<string>('all');\n const [featuredOnly, setFeaturedOnly] = useState(false);\n const [sortOption, setSortOption] = useState<SortOption>('relevance');\n const [showFilters, setShowFilters] = useState(false);\n\n // Debounce search query - 1.5 seconds for better UX\n const debouncedSearchQuery = useDebounce(searchQuery, 1500);\n\n // Filter options\n const pricingOptions = [\n { value: 'all', label: tr('pages.marketplace.pricingAll', 'All Prices') },\n { value: 'free', label: tr('pages.marketplace.pricingFree', 'Free') },\n { value: 'paid', label: tr('pages.marketplace.pricingPaid', 'Paid (One-time)') },\n { value: 'subscription', label: tr('pages.marketplace.pricingSubscription', 'Subscription') },\n ];\n\n const ratingOptions = [\n { value: 'any', label: tr('pages.marketplace.ratingAny', 'Any Rating') },\n { value: '3', label: tr('pages.marketplace.rating3', '3+ Stars') },\n { value: '3.5', label: tr('pages.marketplace.rating3_5', '3.5+ Stars') },\n { value: '4', label: tr('pages.marketplace.rating4', '4+ Stars') },\n { value: '4.5', label: tr('pages.marketplace.rating4_5', '4.5+ Stars') },\n ];\n\n const natureOptions = [\n { value: 'all', label: tr('pages.marketplace.natureAll', 'All Types') },\n { value: 'digital', label: tr('pages.marketplace.natureDigital', 'Digital') },\n { value: 'physical', label: tr('pages.marketplace.naturePhysical', 'Physical') },\n ];\n\n const sortOptions = [\n { value: 'relevance', label: tr('pages.marketplace.sortRelevance', 'Relevance') },\n { value: 'rating', label: tr('pages.marketplace.sortRating', 'Highest Rated') },\n { value: 'downloads', label: tr('pages.marketplace.sortDownloads', 'Most Downloads') },\n { value: 'newest', label: tr('pages.marketplace.sortNewest', 'Newest First') },\n { value: 'price-low', label: tr('pages.marketplace.sortPriceLow', 'Price: Low to High') },\n { value: 'price-high', label: tr('pages.marketplace.sortPriceHigh', 'Price: High to Low') },\n { value: 'name-asc', label: tr('pages.marketplace.sortNameAsc', 'Name A-Z') },\n ];\n\n // Map UI sort option to GraphQL StoreSortBy enum\n const mapSortToApi = (sort: SortOption): StoreSortBy => {\n const mapping: Record<SortOption, StoreSortBy> = {\n relevance: StoreSortBy.Relevance,\n rating: StoreSortBy.Rating,\n downloads: StoreSortBy.Downloads,\n newest: StoreSortBy.Newest,\n 'price-low': StoreSortBy.PriceLow,\n 'price-high': StoreSortBy.PriceHigh,\n 'name-asc': StoreSortBy.NameAsc,\n };\n return mapping[sort];\n };\n\n // Map UI pricing filter to GraphQL PricingModel enum\n const mapPricingToApi = (pricing: PricingFilter): PricingModel | undefined => {\n if (pricing === 'all') return undefined;\n const mapping: Record<string, PricingModel> = {\n free: PricingModel.Free,\n paid: PricingModel.PaidOnetime,\n subscription: PricingModel.Subscription,\n };\n return mapping[pricing];\n };\n\n // Check if any filter is active (using debounced search for API calls)\n const hasActiveFilters =\n debouncedSearchQuery.trim() !== '' ||\n pricingFilter !== 'all' ||\n ratingFilter !== 'any' ||\n natureFilter !== 'all' ||\n selectedCategory !== 'all' ||\n selectedLicense !== 'all' ||\n featuredOnly ||\n selectedType !== 'all' ||\n sortOption !== 'relevance';\n\n // Check if user is currently typing (search not yet debounced)\n const isSearchPending = searchQuery.trim() !== '' && searchQuery !== debouncedSearchQuery;\n\n const clearAllFilters = () => {\n setSearchQuery('');\n setPricingFilter('all');\n setRatingFilter('any');\n setNatureFilter('all');\n setSelectedCategory('all');\n setSelectedLicense('all');\n setFeaturedOnly(false);\n setSortOption('relevance');\n setSelectedType('all');\n };\n\n // Count active filters (excluding search and sort)\n const activeFilterCount =\n (pricingFilter !== 'all' ? 1 : 0) +\n (ratingFilter !== 'any' ? 1 : 0) +\n (natureFilter !== 'all' ? 1 : 0) +\n (selectedCategory !== 'all' ? 1 : 0) +\n (selectedLicense !== 'all' ? 1 : 0) +\n (featuredOnly ? 1 : 0) +\n (selectedType !== 'all' ? 1 : 0);\n\n // Build BrowseStoreInput from filter states for API call\n const browseStoreInput: BrowseStoreInput = useMemo(() => {\n const input: BrowseStoreInput = {\n sortBy: mapSortToApi(sortOption),\n pagination: { limit: 50 },\n };\n\n // Only add filter if we have active filters\n if (hasActiveFilters) {\n input.filter = {};\n\n // Search query (debounced)\n if (debouncedSearchQuery.trim()) {\n input.filter.search = debouncedSearchQuery.trim();\n }\n\n // Type filter\n if (selectedType !== 'all') {\n input.filter.type = selectedType as BrowseStoreInput['filter'] extends { type?: infer T }\n ? T\n : never;\n }\n\n // Category filter\n if (selectedCategory !== 'all') {\n input.filter.category = selectedCategory;\n }\n\n // Nature filter (digital/physical)\n if (natureFilter !== 'all') {\n input.filter.nature =\n natureFilter === 'digital' ? ProductNature.Digital : ProductNature.Physical;\n }\n\n // Pricing filter\n const pricingModel = mapPricingToApi(pricingFilter);\n if (pricingModel) {\n input.filter.pricingModel = pricingModel;\n }\n\n // Rating filter\n if (ratingFilter !== 'any') {\n input.filter.minRating = parseFloat(ratingFilter);\n }\n\n // Featured filter\n if (featuredOnly) {\n input.filter.featured = true;\n }\n\n // License filter\n if (selectedLicense !== 'all') {\n input.filter.license = selectedLicense;\n }\n }\n\n return input;\n }, [\n debouncedSearchQuery,\n selectedType,\n selectedCategory,\n natureFilter,\n pricingFilter,\n ratingFilter,\n featuredOnly,\n selectedLicense,\n sortOption,\n hasActiveFilters,\n ]);\n\n // Fetch grouped products for homepage (when no filters active)\n const {\n featured,\n mostDownloaded,\n recentlyAdded,\n freeItems,\n loading: homeLoading,\n error: homeError,\n refetch: refetchHome,\n } = useHomeGroupedProducts({ skip: hasActiveFilters });\n\n // Fetch filtered products from API when filters are active\n const {\n products: browseProducts,\n totalCount,\n facets,\n loading: browseLoading,\n error: browseError,\n refetch: refetchBrowse,\n } = useBrowseStoreWithContext(hasActiveFilters ? browseStoreInput : {}, {\n skip: !hasActiveFilters,\n });\n\n // Determine which data to show\n const loading = hasActiveFilters ? browseLoading : homeLoading;\n const error = hasActiveFilters ? browseError : homeError;\n const refetch = hasActiveFilters ? refetchBrowse : refetchHome;\n\n // Products to display when filters are active\n const filteredProducts = hasActiveFilters ? browseProducts : [];\n\n // Emit search event when debounced query resolves. Read totalCount via ref so\n // we don't re-emit when only the count changes.\n const totalCountRef = useRef(totalCount);\n totalCountRef.current = totalCount;\n const busRef = useRef(bus);\n busRef.current = bus;\n useEffect(() => {\n if (!debouncedSearchQuery.trim() || browseLoading) return;\n (busRef.current as unknown as { emit: (name: string, payload: unknown) => void }).emit(\n 'store.marketplace.searched',\n {\n query: debouncedSearchQuery,\n resultCount: totalCountRef.current,\n }\n );\n }, [debouncedSearchQuery, browseLoading]);\n\n const handleProductClick = useCallback(\n (product: StoreProduct) => {\n navigate(`${basePath}/marketplace/product/${product.id}`);\n },\n [navigate, basePath]\n );\n\n const handleCheckout = () => {\n closeCart();\n navigate(`${basePath}/cart`);\n };\n\n // Get all unique products for the homepage \"All Apps\" section\n const allProducts = useMemo(\n () => [\n ...new Map(\n [...featured, ...mostDownloaded, ...recentlyAdded, ...freeItems].map((p) => [p.id, p])\n ).values(),\n ],\n [featured, mostDownloaded, recentlyAdded, freeItems]\n );\n\n // Fetch installations to surface deprecated (UNLISTED) apps the user has installed\n const isAuthenticated = !!user?.id;\n const { data: installationsData } = useGetMyStoreInstallationsQuery({\n variables: { limit: 100 },\n skip: !isAuthenticated,\n fetchPolicy: 'cache-and-network',\n });\n\n // Deduplicate by productId (user may have installed in multiple workspaces)\n const deprecatedInstalledProducts = useMemo<DeprecatedProduct[]>(() => {\n if (!installationsData?.myStoreAppInstallations?.items) return [];\n const seen = new Set<string>();\n const result: DeprecatedProduct[] = [];\n for (const item of installationsData.myStoreAppInstallations.items) {\n if (item.productStatus === 'UNLISTED' && !seen.has(item.productId)) {\n seen.add(item.productId);\n result.push({\n id: item.productId,\n name: item.productName ?? 'Unknown App',\n icon: item.productIcon ?? undefined,\n });\n }\n }\n return result;\n }, [installationsData]);\n\n // Build dynamic filter options from facets (when available) or from homepage products\n const typeCategories = useMemo(() => {\n // Use facets from API if available\n if (facets?.types && facets.types.length > 0) {\n return [\n { id: 'all', name: tr('pages.marketplace.typeAll', 'All Apps'), count: totalCount },\n ...facets.types.map((t) => ({\n id: t.value,\n name: t.value.charAt(0) + t.value.slice(1).toLowerCase().replace(/_/g, ' '),\n count: t.count,\n })),\n ];\n }\n // Fallback to homepage products: count each type in a single pass.\n const typeCounts = allProducts.reduce<Map<string, number>>((acc, p) => {\n acc.set(p.type, (acc.get(p.type) ?? 0) + 1);\n return acc;\n }, new Map());\n const typeOptions = Array.from(typeCounts.entries())\n .flatMap(([type, count]) =>\n count > 0\n ? [\n {\n id: type,\n name: type.charAt(0) + type.slice(1).toLowerCase().replace(/_/g, ' '),\n count,\n },\n ]\n : []\n )\n .sort((a, b) => b.count - a.count);\n return [\n { id: 'all', name: tr('pages.marketplace.typeAll', 'All Apps'), count: allProducts.length },\n ...typeOptions,\n ];\n }, [facets, allProducts, totalCount, tr]);\n\n // Build category options from facets or products\n const categoryOptions = useMemo(() => {\n if (facets?.categories && facets.categories.length > 0) {\n return [\n { value: 'all', label: tr('pages.marketplace.allCategories', 'All Categories') },\n ...facets.categories.map((c) => ({\n value: c.value,\n label: c.value,\n })),\n ];\n }\n return [\n { value: 'all', label: tr('pages.marketplace.allCategories', 'All Categories') },\n ...Array.from(new Set(allProducts.flatMap((p) => (p.category ? [p.category] : []))))\n .map((cat) => ({\n value: cat as string,\n label: cat as string,\n }))\n .sort((a, b) => a.label.localeCompare(b.label)),\n ];\n }, [facets, allProducts, tr]);\n\n // Build license options from facets or static list\n const licenseOptions = useMemo(() => {\n if (facets?.licenses && facets.licenses.length > 0) {\n return [\n { value: 'all', label: tr('pages.marketplace.allLicenses', 'All Licenses') },\n ...facets.licenses.map((l) => ({\n value: l.value,\n label: l.value,\n })),\n ];\n }\n return [{ value: 'all', label: tr('pages.marketplace.allLicenses', 'All Licenses') }];\n }, [facets, tr]);\n\n return (\n <div className=\"flex h-full flex-col\">\n {/* Header */}\n <header className=\"relative overflow-hidden border-b border-border-seam bg-bg-surface px-6 py-4\">\n <AuroraBackground intensity=\"subtle\" />\n <div className=\"flex items-center justify-between\">\n <div>\n <h1 className=\"text-2xl font-bold text-text-primary\">\n {tr('pages.marketplace.appTitle', 'App')}{' '}\n <GradientText>{tr('pages.marketplace.title', 'Marketplace')}</GradientText>\n </h1>\n <p className=\"text-sm text-text-muted\">\n {tr(\n 'pages.marketplace.subtitle',\n 'Discover apps, workflows, and integrations for your workspace'\n )}\n </p>\n </div>\n <button\n type=\"button\"\n data-tour=\"store-marketplace-cart-button\"\n onClick={() => navigate(`${basePath}/cart`)}\n className=\"cursor-pointer relative flex items-center gap-2 rounded-lg border border-border-default bg-bg-surface px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken\"\n >\n <ShoppingCart className=\"size-5\" />\n {tr('pages.marketplace.cart', 'Cart')}\n {itemCount > 0 && (\n <span className=\"absolute -right-2 -top-2 flex size-5 items-center justify-center rounded-full bg-action-primary-bg text-xs font-bold text-action-primary-text\">\n {itemCount}\n </span>\n )}\n </button>\n </div>\n\n {/* Search Bar - Live filtering as you type */}\n <div className=\"mt-4\">\n <div className=\"relative\">\n <label htmlFor={searchInputId} className=\"sr-only\">\n {tr('pages.marketplace.search.label', 'Search marketplace products')}\n </label>\n <Search className=\"absolute left-4 top-1/2 size-5 -translate-y-1/2 text-text-muted\" />\n <input\n id={searchInputId}\n data-tour=\"store-marketplace-search-input\"\n aria-label={tr('pages.marketplace.search.label', 'Search marketplace products')}\n type=\"text\"\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n placeholder={tr(\n 'pages.marketplace.search.placeholder',\n 'Search apps, workflows, integrations...'\n )}\n className=\"w-full rounded-xl border border-border-default bg-bg-sunken py-3 pl-12 pr-4 text-text-primary placeholder-text-muted focus:border-action-primary-border focus:bg-bg-surface focus:outline-none focus:ring-2 focus:ring-action-primary-border/20\"\n />\n {searchQuery && (\n <button\n type=\"button\"\n onClick={() => setSearchQuery('')}\n aria-label={tr('pages.marketplace.search.clear', 'Clear search')}\n className=\"cursor-pointer absolute right-4 top-1/2 -translate-y-1/2 text-text-muted transition-colors hover:text-text-primary\"\n >\n <X className=\"size-4\" aria-hidden=\"true\" />\n </button>\n )}\n </div>\n {/* Search results count / pending indicator */}\n {searchQuery.trim() && (\n <div\n aria-live=\"polite\"\n className=\"mt-2 flex items-center gap-2 text-sm text-text-muted\"\n >\n {isSearchPending || browseLoading ? (\n <>\n <Loader2 className=\"size-4 animate-spin\" />\n <span>{tr('pages.marketplace.search.searching', 'Searching...')}</span>\n </>\n ) : (\n <span>\n {tr(\n 'pages.marketplace.search.resultCount',\n '{{count}} result{{plural}} for \"{{query}}\"',\n {\n count: totalCount,\n plural: totalCount !== 1 ? 's' : '',\n query: debouncedSearchQuery,\n }\n )}\n </span>\n )}\n </div>\n )}\n </div>\n\n {/* Filter Bar */}\n <div className=\"mt-4 flex flex-wrap items-center gap-3\">\n {/* Filter Toggle Button */}\n <button\n type=\"button\"\n data-tour=\"store-marketplace-filters-button\"\n onClick={() => setShowFilters(!showFilters)}\n className={`cursor-pointer flex items-center gap-2 rounded-lg border px-3 py-2 text-sm font-medium transition-colors ${\n showFilters || activeFilterCount > 0\n ? 'border-action-primary-border bg-action-primary-bg/10 text-text-link'\n : 'border-border-default bg-bg-surface text-text-primary transition-colors hover:bg-bg-sunken'\n }`}\n >\n <SlidersHorizontal className=\"size-4\" />\n {tr('pages.marketplace.filters', 'Filters')}\n {activeFilterCount > 0 && (\n <span className=\"flex size-5 items-center justify-center rounded-full bg-action-primary-bg text-xs text-action-primary-text\">\n {activeFilterCount}\n </span>\n )}\n </button>\n\n {/* Quick Filter Chips - Always visible */}\n <div\n className=\"flex flex-wrap items-center gap-2\"\n data-tour=\"store-marketplace-quick-filters\"\n >\n <button\n type=\"button\"\n onClick={() => setPricingFilter(pricingFilter === 'free' ? 'all' : 'free')}\n className={`cursor-pointer flex items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors ${\n pricingFilter === 'free'\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'bg-bg-sunken text-text-primary transition-colors hover:bg-bg-surface'\n }`}\n >\n <Gift className=\"size-3.5\" />\n {tr('pages.marketplace.quickFilterFree', 'Free')}\n </button>\n <button\n type=\"button\"\n onClick={() => setRatingFilter(ratingFilter === '4' ? 'any' : '4')}\n className={`cursor-pointer flex items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors ${\n ratingFilter === '4'\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'bg-bg-sunken text-text-primary transition-colors hover:bg-bg-surface'\n }`}\n >\n <Star className=\"size-3.5\" />\n {tr('pages.marketplace.quickFilterRating', '4+ Stars')}\n </button>\n <button\n type=\"button\"\n onClick={() => setFeaturedOnly(!featuredOnly)}\n className={`cursor-pointer flex items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors ${\n featuredOnly\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'bg-bg-sunken text-text-primary transition-colors hover:bg-bg-surface'\n }`}\n >\n <Sparkles className=\"size-3.5\" />\n {tr('pages.marketplace.quickFilterFeatured', 'Featured')}\n </button>\n </div>\n\n {/* Clear Filters */}\n {hasActiveFilters && (\n <button\n type=\"button\"\n onClick={clearAllFilters}\n className=\"cursor-pointer flex items-center gap-1 text-sm text-text-muted transition-colors hover:text-text-primary\"\n >\n <X className=\"size-4\" aria-hidden=\"true\" />\n {tr('pages.marketplace.clearAll', 'Clear all')}\n </button>\n )}\n\n {/* Sort Dropdown - Right aligned */}\n <div className=\"ml-auto\" data-tour=\"store-marketplace-section-sort\">\n <FilterDropdown\n label={tr('pages.marketplace.sortLabel', 'Sort')}\n value={sortOption}\n options={sortOptions}\n onChange={(value) => setSortOption(value as SortOption)}\n />\n </div>\n </div>\n\n {/* Expanded Filters Panel */}\n {showFilters && (\n <div className=\"mt-4 rounded-lg border border-border-seam bg-bg-surface p-4\">\n <div className=\"flex flex-wrap items-start gap-6\">\n {/* Pricing Filter */}\n <div className=\"flex flex-col gap-2\">\n <span className=\"text-xs font-medium uppercase tracking-wider text-text-muted\">\n {tr('pages.marketplace.filterPricing', 'Pricing')}\n </span>\n <FilterDropdown\n label={tr('pages.marketplace.filterPrice', 'Price')}\n value={pricingFilter}\n options={pricingOptions}\n onChange={(value) => setPricingFilter(value as PricingFilter)}\n />\n </div>\n\n {/* Rating Filter */}\n <div className=\"flex flex-col gap-2\">\n <span className=\"text-xs font-medium uppercase tracking-wider text-text-muted\">\n {tr('pages.marketplace.filterMinRating', 'Min Rating')}\n </span>\n <FilterDropdown\n label={tr('pages.marketplace.filterRating', 'Rating')}\n value={ratingFilter}\n options={ratingOptions}\n onChange={(value) => setRatingFilter(value as RatingFilter)}\n />\n </div>\n\n {/* Category Filter */}\n {categoryOptions.length > 1 && (\n <div className=\"flex flex-col gap-2\">\n <span className=\"text-xs font-medium uppercase tracking-wider text-text-muted\">\n {tr('pages.marketplace.filterCategory', 'Category')}\n </span>\n <FilterDropdown\n label={tr('pages.marketplace.filterCategory', 'Category')}\n value={selectedCategory}\n options={categoryOptions}\n onChange={setSelectedCategory}\n />\n </div>\n )}\n\n {/* Nature Filter (Digital/Physical) */}\n <div className=\"flex flex-col gap-2\">\n <span className=\"text-xs font-medium uppercase tracking-wider text-text-muted\">\n {tr('pages.marketplace.filterNature', 'Nature')}\n </span>\n <FilterDropdown\n label={tr('pages.marketplace.filterNature', 'Nature')}\n value={natureFilter}\n options={natureOptions}\n onChange={(value) => setNatureFilter(value as NatureFilter)}\n />\n </div>\n\n {/* License Filter */}\n {licenseOptions.length > 1 && (\n <div className=\"flex flex-col gap-2\">\n <span className=\"text-xs font-medium uppercase tracking-wider text-text-muted\">\n {tr('pages.marketplace.filterLicense', 'License')}\n </span>\n <FilterDropdown\n label={tr('pages.marketplace.filterLicense', 'License')}\n value={selectedLicense}\n options={licenseOptions}\n onChange={setSelectedLicense}\n />\n </div>\n )}\n </div>\n\n {/* Active Filters Summary */}\n {activeFilterCount > 0 && (\n <div className=\"mt-4 flex flex-wrap items-center gap-2 border-t border-border-default pt-4\">\n <span className=\"text-xs font-medium text-text-muted\">\n {tr('pages.marketplace.activeFilters', 'Active filters:')}\n </span>\n {selectedType !== 'all' && (\n <button\n type=\"button\"\n onClick={() => setSelectedType('all')}\n className=\"inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-action-primary-border bg-action-primary-bg/5 px-3 py-1.5 text-xs font-medium text-text-link shadow-sm transition-colors hover:bg-action-primary-bg/15\"\n >\n <span className=\"text-text-muted\">\n {tr('pages.marketplace.activeFilterType', 'Type:')}\n </span>{' '}\n {selectedType}\n <X className=\"size-3\" aria-hidden=\"true\" />\n </button>\n )}\n {pricingFilter !== 'all' && (\n <button\n type=\"button\"\n onClick={() => setPricingFilter('all')}\n className=\"inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-action-primary-border bg-action-primary-bg/5 px-3 py-1.5 text-xs font-medium text-text-link shadow-sm transition-colors hover:bg-action-primary-bg/15\"\n >\n <span className=\"text-text-muted\">\n {tr('pages.marketplace.activeFilterPrice', 'Price:')}\n </span>{' '}\n {pricingOptions.find((o) => o.value === pricingFilter)?.label}\n <X className=\"size-3\" aria-hidden=\"true\" />\n </button>\n )}\n {ratingFilter !== 'any' && (\n <button\n type=\"button\"\n onClick={() => setRatingFilter('any')}\n className=\"inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-action-primary-border bg-action-primary-bg/5 px-3 py-1.5 text-xs font-medium text-text-link shadow-sm transition-colors hover:bg-action-primary-bg/15\"\n >\n <span className=\"text-text-muted\">\n {tr('pages.marketplace.activeFilterRating', 'Rating:')}\n </span>{' '}\n {ratingOptions.find((o) => o.value === ratingFilter)?.label}\n <X className=\"size-3\" aria-hidden=\"true\" />\n </button>\n )}\n {selectedCategory !== 'all' && (\n <button\n type=\"button\"\n onClick={() => setSelectedCategory('all')}\n className=\"inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-action-primary-border bg-action-primary-bg/5 px-3 py-1.5 text-xs font-medium text-text-link shadow-sm transition-colors hover:bg-action-primary-bg/15\"\n >\n <span className=\"text-text-muted\">\n {tr('pages.marketplace.activeFilterCategory', 'Category:')}\n </span>{' '}\n {selectedCategory}\n <X className=\"size-3\" aria-hidden=\"true\" />\n </button>\n )}\n {natureFilter !== 'all' && (\n <button\n type=\"button\"\n onClick={() => setNatureFilter('all')}\n className=\"inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-action-primary-border bg-action-primary-bg/5 px-3 py-1.5 text-xs font-medium text-text-link shadow-sm transition-colors hover:bg-action-primary-bg/15\"\n >\n <span className=\"text-text-muted\">\n {tr('pages.marketplace.activeFilterNature', 'Nature:')}\n </span>{' '}\n {natureOptions.find((o) => o.value === natureFilter)?.label}\n <X className=\"size-3\" aria-hidden=\"true\" />\n </button>\n )}\n {selectedLicense !== 'all' && (\n <button\n type=\"button\"\n onClick={() => setSelectedLicense('all')}\n className=\"inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-action-primary-border bg-action-primary-bg/5 px-3 py-1.5 text-xs font-medium text-text-link shadow-sm transition-colors hover:bg-action-primary-bg/15\"\n >\n <span className=\"text-text-muted\">\n {tr('pages.marketplace.activeFilterLicense', 'License:')}\n </span>{' '}\n {licenseOptions.find((o) => o.value === selectedLicense)?.label}\n <X className=\"size-3\" aria-hidden=\"true\" />\n </button>\n )}\n {featuredOnly && (\n <button\n type=\"button\"\n onClick={() => setFeaturedOnly(false)}\n className=\"inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-action-primary-border bg-action-primary-bg/5 px-3 py-1.5 text-xs font-medium text-text-link shadow-sm transition-colors hover:bg-action-primary-bg/15\"\n >\n <Sparkles className=\"size-3\" />\n {tr('pages.marketplace.activeFilterFeatured', 'Featured Only')}\n <X className=\"size-3\" aria-hidden=\"true\" />\n </button>\n )}\n </div>\n )}\n </div>\n )}\n </header>\n\n {/* Main Content */}\n <main className=\"flex-1 overflow-y-auto\">\n <div className=\"mx-auto max-w-7xl space-y-8 p-6\">\n <PagePurpose>\n {tr(\n 'pages.marketplace.pagePurpose',\n 'The marketplace is where you discover and install apps, agents, workflows, nodes and widgets that extend your workspaces. Browse featured and trending picks, filter by type or category, search for something specific, then open any product to view pricing and reviews before adding it to your cart.'\n )}\n </PagePurpose>\n {/* Error State */}\n {error && (\n <div\n role=\"alert\"\n className=\"flex flex-col items-center justify-center rounded-xl border border-status-error-border bg-status-error-bg-subtle p-8 text-center\"\n >\n <AlertCircle className=\"mb-4 size-12 text-status-error-text\" />\n <h3 className=\"mb-2 text-lg font-semibold text-status-error-text-emphasis\">\n {tr('pages.marketplace.errorTitle', 'Failed to load marketplace')}\n </h3>\n <p className=\"mb-4 text-sm text-status-error-text\">\n {error.message ||\n tr(\n 'pages.marketplace.errorDescription',\n 'An error occurred while fetching products'\n )}\n </p>\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"cursor-pointer rounded-lg bg-status-error-bg px-4 py-2 text-sm font-medium text-status-error-text transition-colors hover:bg-status-error-bg-emphasis\"\n >\n {tr('common.tryAgain', 'Try Again')}\n </button>\n </div>\n )}\n\n {/* Loading State */}\n {loading && !error && <MarketplacePageSkeleton />}\n\n {/* Content - Only show when data is loaded */}\n {!loading && !error && (\n <>\n {/* Hero Section - Featured Products (only when no filters) */}\n {!hasActiveFilters && selectedType === 'all' && featured.length > 0 && (\n <HeroSection\n dataTour=\"store-marketplace-hero-section\"\n featuredProducts={featured}\n onProductClick={handleProductClick}\n />\n )}\n\n {/* Type Filter Categories */}\n {typeCategories.length > 1 && (\n <div>\n <h2 className=\"mb-4 text-lg font-semibold text-text-primary\">\n {tr('pages.marketplace.browseByType', 'Browse by Type')}\n </h2>\n <div\n className=\"flex flex-wrap gap-2\"\n data-tour=\"store-marketplace-type-categories\"\n >\n {typeCategories.map((category) => (\n <CategoryChip\n key={category.id}\n typeId={category.id}\n name={category.name}\n count={category.count}\n active={selectedType === category.id}\n onClick={() => setSelectedType(category.id)}\n />\n ))}\n </div>\n </div>\n )}\n\n {/* Show Filtered Results when filters are active */}\n {hasActiveFilters && (\n <section>\n <SectionHeader\n icon={Filter}\n title={\n debouncedSearchQuery\n ? tr('pages.marketplace.searchResults', 'Search Results')\n : tr('pages.marketplace.filteredResults', 'Filtered Results')\n }\n subtitle={tr('pages.marketplace.appsFound', '{{count}} app{{plural}} found', {\n count: totalCount,\n plural: totalCount !== 1 ? 's' : '',\n })}\n />\n {filteredProducts.length > 0 ? (\n <div\n className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\"\n data-tour=\"store-marketplace-product-grid\"\n >\n {filteredProducts.map((product) => (\n <AppCard\n key={product.id}\n product={product}\n onClick={() => handleProductClick(product)}\n />\n ))}\n </div>\n ) : (\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title={tr('pages.marketplace.noFilterMatch', 'No apps match your filters')}\n description={tr(\n 'pages.marketplace.noFilterMatchDescription',\n 'Try adjusting your filter criteria or clearing filters to see more results.'\n )}\n action={\n <button\n type=\"button\"\n onClick={clearAllFilters}\n className=\"cursor-pointer rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-opacity hover:opacity-90\"\n >\n {tr('pages.marketplace.clearAllFilters', 'Clear All Filters')}\n </button>\n }\n />\n )}\n </section>\n )}\n\n {/* Show grouped sections only when no filters are active */}\n {!hasActiveFilters && selectedType === 'all' && (\n <>\n {/* Most Downloaded / Trending Apps */}\n {mostDownloaded.length > 0 && (\n <section>\n <SectionHeader\n icon={TrendingUp}\n title={tr('pages.marketplace.mostDownloaded', 'Most Downloaded')}\n subtitle={tr(\n 'pages.marketplace.mostDownloadedSubtitle',\n 'Top picks by our community'\n )}\n />\n <div\n className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3\"\n data-tour=\"store-marketplace-most-downloaded\"\n >\n {mostDownloaded.slice(0, 6).map((product) => (\n <AppCard\n key={product.id}\n product={product}\n onClick={() => handleProductClick(product)}\n />\n ))}\n </div>\n </section>\n )}\n\n {/* Recently Added / New Releases */}\n {recentlyAdded.length > 0 && (\n <section>\n <SectionHeader\n icon={Clock}\n title={tr('pages.marketplace.newReleases', 'New Releases')}\n subtitle={tr(\n 'pages.marketplace.newReleasesSubtitle',\n 'Recently published apps'\n )}\n />\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {recentlyAdded.slice(0, 6).map((product) => (\n <AppCard\n key={product.id}\n product={product}\n onClick={() => handleProductClick(product)}\n />\n ))}\n </div>\n </section>\n )}\n\n {/* Free Items */}\n {freeItems.length > 0 && (\n <section>\n <SectionHeader\n icon={Gift}\n title={tr('pages.marketplace.freeApps', 'Free Apps')}\n subtitle={tr(\n 'pages.marketplace.freeAppsSubtitle',\n 'No cost, full functionality'\n )}\n />\n <div className=\"grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-6\">\n {freeItems.slice(0, 6).map((product) => (\n <AppCard\n key={product.id}\n product={product}\n onClick={() => handleProductClick(product)}\n variant=\"compact\"\n />\n ))}\n </div>\n </section>\n )}\n\n {/* All Apps */}\n {allProducts.length > 0 && (\n <section>\n <SectionHeader\n icon={Box}\n title={tr('pages.marketplace.allApps', 'All Apps')}\n subtitle={tr(\n 'pages.marketplace.allAppsSubtitle',\n '{{count}} apps available',\n { count: allProducts.length }\n )}\n />\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n {allProducts.map((product) => (\n <AppCard\n key={product.id}\n product={product}\n onClick={() => handleProductClick(product)}\n />\n ))}\n </div>\n </section>\n )}\n </>\n )}\n\n {/* Deprecated Installed Apps — shown whenever user has UNLISTED products installed */}\n {isAuthenticated && deprecatedInstalledProducts.length > 0 && (\n <section>\n <SectionHeader\n icon={AlertCircle}\n title={tr(\n 'pages.marketplace.deprecatedApps',\n \"Deprecated Apps You've Installed\"\n )}\n subtitle={tr(\n 'pages.marketplace.deprecatedAppsSubtitle',\n 'These apps are no longer supported — hover the badge for details'\n )}\n />\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {deprecatedInstalledProducts.map((product) => (\n <DeprecatedAppCard\n key={product.id}\n product={product}\n onClick={() => navigate(`${basePath}/marketplace/product/${product.id}`)}\n />\n ))}\n </div>\n </section>\n )}\n\n {/* Empty State - No products at all */}\n {allProducts.length === 0 && (\n <IllustratedEmptyState\n illustration=\"onboarding\"\n title={tr('pages.marketplace.noAppsTitle', 'No apps available yet')}\n description={tr(\n 'pages.marketplace.noAppsDescription',\n 'The marketplace is empty. Check back soon for new apps, workflows, and integrations.'\n )}\n />\n )}\n </>\n )}\n </div>\n </main>\n\n {/* Cart Drawer */}\n <CartDrawer\n isOpen={cartOpen}\n onClose={closeCart}\n onCheckout={handleCheckout}\n cartItems={cartItems}\n itemCount={itemCount}\n subtotal={subtotal}\n tax={tax}\n total={total}\n updateQuantity={updateQuantity}\n removeProduct={removeProduct}\n />\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AA2EA,IAAM,MAAmB,MACnB,KAAS,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