@mohasinac/appkit 2.7.49 → 2.7.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/dist/_internal/client/features/layout/SidebarCollapseToggle.d.ts +19 -0
  2. package/dist/_internal/client/features/layout/SidebarCollapseToggle.js +15 -0
  3. package/dist/_internal/client/features/layout/index.d.ts +2 -0
  4. package/dist/_internal/client/features/layout/index.js +1 -0
  5. package/dist/_internal/server/features/checkout/actions.js +25 -2
  6. package/dist/_internal/server/features/promotions/actions.js +3 -1
  7. package/dist/_internal/server/jobs/core/__tests__/couponExpiry.test.d.ts +1 -0
  8. package/dist/_internal/server/jobs/core/__tests__/couponExpiry.test.js +65 -0
  9. package/dist/_internal/server/jobs/core/__tests__/listingProcessor.test.d.ts +1 -0
  10. package/dist/_internal/server/jobs/core/__tests__/listingProcessor.test.js +163 -0
  11. package/dist/_internal/server/jobs/core/__tests__/mediaTmpCleanup.test.d.ts +1 -0
  12. package/dist/_internal/server/jobs/core/__tests__/mediaTmpCleanup.test.js +115 -0
  13. package/dist/_internal/server/jobs/core/__tests__/pendingOrderTimeout.test.d.ts +1 -0
  14. package/dist/_internal/server/jobs/core/__tests__/pendingOrderTimeout.test.js +96 -0
  15. package/dist/_internal/shared/actions/action-registry.js +149 -0
  16. package/dist/client.d.ts +45 -6
  17. package/dist/client.js +27 -4
  18. package/dist/constants/api-endpoints.d.ts +42 -0
  19. package/dist/constants/api-endpoints.js +14 -0
  20. package/dist/features/_guide-cls.d.ts +13 -0
  21. package/dist/features/_guide-cls.js +14 -0
  22. package/dist/features/about/components/HelpPageView.js +29 -26
  23. package/dist/features/account/components/BuyerAccountGuideView.d.ts +1 -0
  24. package/dist/features/account/components/BuyerAccountGuideView.js +39 -0
  25. package/dist/features/account/components/BuyerAuctionsGuideView.d.ts +1 -0
  26. package/dist/features/account/components/BuyerAuctionsGuideView.js +38 -0
  27. package/dist/features/account/components/BuyerOrdersGuideView.d.ts +1 -0
  28. package/dist/features/account/components/BuyerOrdersGuideView.js +48 -0
  29. package/dist/features/account/components/BuyerShoppingGuideView.d.ts +1 -0
  30. package/dist/features/account/components/BuyerShoppingGuideView.js +38 -0
  31. package/dist/features/account/components/UserSidebar.js +2 -1
  32. package/dist/features/admin/components/AdminAnalyticsGuideView.d.ts +1 -0
  33. package/dist/features/admin/components/AdminAnalyticsGuideView.js +24 -0
  34. package/dist/features/admin/components/AdminBlogEditorView.js +102 -75
  35. package/dist/features/admin/components/AdminBundleEditorView.js +20 -14
  36. package/dist/features/admin/components/AdminBundlesView.d.ts +1 -3
  37. package/dist/features/admin/components/AdminBundlesView.js +173 -52
  38. package/dist/features/admin/components/AdminCatalogGuideView.d.ts +1 -0
  39. package/dist/features/admin/components/AdminCatalogGuideView.js +28 -0
  40. package/dist/features/admin/components/AdminContentGuideView.d.ts +1 -0
  41. package/dist/features/admin/components/AdminContentGuideView.js +36 -0
  42. package/dist/features/admin/components/AdminCouponEditorView.js +1 -1
  43. package/dist/features/admin/components/AdminGuideHubView.d.ts +5 -0
  44. package/dist/features/admin/components/AdminGuideHubView.js +79 -0
  45. package/dist/features/admin/components/AdminOrdersGuideView.d.ts +1 -0
  46. package/dist/features/admin/components/AdminOrdersGuideView.js +44 -0
  47. package/dist/features/admin/components/AdminProductsView.js +8 -3
  48. package/dist/features/admin/components/AdminSidebar.js +2 -1
  49. package/dist/features/admin/components/AdminSiteConfigGuideView.d.ts +1 -0
  50. package/dist/features/admin/components/AdminSiteConfigGuideView.js +21 -0
  51. package/dist/features/admin/components/AdminStoresGuideView.d.ts +1 -0
  52. package/dist/features/admin/components/AdminStoresGuideView.js +32 -0
  53. package/dist/features/admin/components/AdminTeamGuideView.d.ts +1 -0
  54. package/dist/features/admin/components/AdminTeamGuideView.js +33 -0
  55. package/dist/features/admin/components/AdminTrustGuideView.d.ts +1 -0
  56. package/dist/features/admin/components/AdminTrustGuideView.js +40 -0
  57. package/dist/features/admin/components/AdminUsersGuideView.d.ts +1 -0
  58. package/dist/features/admin/components/AdminUsersGuideView.js +38 -0
  59. package/dist/features/auth/repository/session.repository.js +16 -1
  60. package/dist/features/cart/hooks/useAddToCart.d.ts +2 -0
  61. package/dist/features/cart/hooks/useAddToCart.js +2 -0
  62. package/dist/features/cart/hooks/useGuestCart.d.ts +2 -0
  63. package/dist/features/cart/utils/guest-cart.d.ts +7 -0
  64. package/dist/features/cart/utils/pending-ops.d.ts +6 -0
  65. package/dist/features/categories/components/CategoryBundlesListing.js +3 -25
  66. package/dist/features/categories/components/CategoryProductsListing.js +6 -10
  67. package/dist/features/categories/components/index.d.ts +0 -2
  68. package/dist/features/categories/components/index.js +0 -1
  69. package/dist/features/categories/schemas/firestore.d.ts +9 -0
  70. package/dist/features/events/components/AdminEventEditorView.js +223 -269
  71. package/dist/features/events/components/EventRaffleWinnerView.d.ts +9 -1
  72. package/dist/features/events/components/EventRaffleWinnerView.js +3 -3
  73. package/dist/features/events/components/SpinWheelView.js +3 -3
  74. package/dist/features/grouped/repository/grouped-listings.repository.d.ts +9 -0
  75. package/dist/features/grouped/repository/grouped-listings.repository.js +12 -0
  76. package/dist/features/layout/BottomNavLayout.d.ts +5 -0
  77. package/dist/features/layout/BottomNavLayout.js +21 -0
  78. package/dist/features/layout/TitleBar.js +7 -1
  79. package/dist/features/layout/TitleBarLayout.d.ts +8 -2
  80. package/dist/features/layout/TitleBarLayout.js +11 -7
  81. package/dist/features/media/upload/MediaUploadField.js +1 -1
  82. package/dist/features/orders/schemas/index.d.ts +2 -2
  83. package/dist/features/pre-orders/components/PreOrdersIndexListing.js +12 -6
  84. package/dist/features/products/components/AuctionsIndexListing.js +3 -1
  85. package/dist/features/products/components/MarketplaceBundleCard.d.ts +21 -0
  86. package/dist/features/products/components/MarketplaceBundleCard.js +56 -0
  87. package/dist/features/products/components/PrizeDrawDetailPageView.js +1 -1
  88. package/dist/features/products/components/PrizeDrawEntryActions.d.ts +3 -1
  89. package/dist/features/products/components/PrizeDrawEntryActions.js +8 -12
  90. package/dist/features/products/components/ProductDetailActions.d.ts +5 -1
  91. package/dist/features/products/components/ProductDetailActions.js +3 -1
  92. package/dist/features/products/components/ProductDetailPageView.d.ts +2 -0
  93. package/dist/features/products/components/ProductDetailPageView.js +4 -0
  94. package/dist/features/products/components/ProductGrid.js +3 -3
  95. package/dist/features/products/components/ProductsIndexListing.js +18 -9
  96. package/dist/features/products/components/index.d.ts +2 -4
  97. package/dist/features/products/components/index.js +1 -2
  98. package/dist/features/promotions/components/CouponCard.d.ts +11 -1
  99. package/dist/features/promotions/components/CouponCard.js +36 -2
  100. package/dist/features/promotions/repository/claimed-coupons.repository.d.ts +27 -0
  101. package/dist/features/promotions/repository/claimed-coupons.repository.js +115 -0
  102. package/dist/features/promotions/schemas/firestore.d.ts +34 -0
  103. package/dist/features/promotions/schemas/firestore.js +14 -1
  104. package/dist/features/reviews/components/index.d.ts +0 -2
  105. package/dist/features/reviews/components/index.js +0 -1
  106. package/dist/features/seller/components/BrandInlineSelect.js +23 -3
  107. package/dist/features/seller/components/CategoryInlineSelect.js +20 -3
  108. package/dist/features/seller/components/SellerAddressesView.js +3 -2
  109. package/dist/features/seller/components/SellerAnalyticsAlertsView.d.ts +6 -0
  110. package/dist/features/seller/components/SellerAnalyticsAlertsView.js +124 -0
  111. package/dist/features/seller/components/SellerAnalyticsView.d.ts +2 -0
  112. package/dist/features/seller/components/SellerAnalyticsView.js +17 -9
  113. package/dist/features/seller/components/SellerBidsView.js +33 -3
  114. package/dist/features/seller/components/SellerBundlesView.d.ts +5 -0
  115. package/dist/features/seller/components/SellerBundlesView.js +104 -0
  116. package/dist/features/seller/components/SellerClassifiedView.d.ts +5 -0
  117. package/dist/features/seller/components/SellerClassifiedView.js +113 -0
  118. package/dist/features/seller/components/SellerDashboardView.js +19 -7
  119. package/dist/features/seller/components/SellerDigitalCodesView.d.ts +5 -0
  120. package/dist/features/seller/components/SellerDigitalCodesView.js +115 -0
  121. package/dist/features/seller/components/SellerGoogleReviewsView.d.ts +14 -0
  122. package/dist/features/seller/components/SellerGoogleReviewsView.js +95 -0
  123. package/dist/features/seller/components/SellerGroupedListingsView.d.ts +6 -0
  124. package/dist/features/seller/components/SellerGroupedListingsView.js +112 -0
  125. package/dist/features/seller/components/SellerLiveView.d.ts +5 -0
  126. package/dist/features/seller/components/SellerLiveView.js +113 -0
  127. package/dist/features/seller/components/SellerOrdersView.js +53 -2
  128. package/dist/features/seller/components/SellerPayoutMethodsView.d.ts +7 -0
  129. package/dist/features/seller/components/SellerPayoutMethodsView.js +120 -0
  130. package/dist/features/seller/components/SellerPayoutSettingsView.js +50 -12
  131. package/dist/features/seller/components/SellerProductShell.d.ts +3 -1
  132. package/dist/features/seller/components/SellerProductShell.js +35 -11
  133. package/dist/features/seller/components/SellerProductsCards.d.ts +19 -0
  134. package/dist/features/seller/components/SellerProductsCards.js +19 -0
  135. package/dist/features/seller/components/SellerProductsFilterDrawer.d.ts +14 -0
  136. package/dist/features/seller/components/SellerProductsFilterDrawer.js +22 -0
  137. package/dist/features/seller/components/SellerProductsView.d.ts +3 -1
  138. package/dist/features/seller/components/SellerProductsView.js +92 -49
  139. package/dist/features/seller/components/SellerReviewsView.js +67 -4
  140. package/dist/features/seller/components/SellerShippingConfigsView.d.ts +7 -0
  141. package/dist/features/seller/components/SellerShippingConfigsView.js +149 -0
  142. package/dist/features/seller/components/SellerShippingView.js +37 -10
  143. package/dist/features/seller/components/SellerSidebar.js +2 -1
  144. package/dist/features/seller/components/SellerStoreCategoriesView.d.ts +9 -0
  145. package/dist/features/seller/components/SellerStoreCategoriesView.js +122 -0
  146. package/dist/features/seller/components/SellerStorefrontView.d.ts +0 -7
  147. package/dist/features/seller/components/SellerStorefrontView.js +26 -29
  148. package/dist/features/seller/components/SellerTemplatesView.d.ts +10 -0
  149. package/dist/features/seller/components/SellerTemplatesView.js +265 -0
  150. package/dist/features/seller/components/index.d.ts +26 -0
  151. package/dist/features/seller/components/index.js +13 -0
  152. package/dist/features/seller/components/seller-products-styles.d.ts +7 -0
  153. package/dist/features/seller/components/seller-products-styles.js +14 -0
  154. package/dist/features/shell/FormShell.d.ts +7 -1
  155. package/dist/features/shell/FormShell.js +5 -2
  156. package/dist/features/store-extensions/index.d.ts +4 -0
  157. package/dist/features/store-extensions/index.js +4 -0
  158. package/dist/features/store-extensions/repository/rbac.repositories.d.ts +23 -0
  159. package/dist/features/store-extensions/repository/rbac.repositories.js +32 -0
  160. package/dist/features/store-extensions/repository/store-extensions.repositories.d.ts +91 -0
  161. package/dist/features/store-extensions/repository/store-extensions.repositories.js +127 -0
  162. package/dist/features/store-extensions/schemas/firestore.d.ts +244 -0
  163. package/dist/features/store-extensions/schemas/firestore.js +158 -0
  164. package/dist/features/store-extensions/schemas/rbac.d.ts +65 -0
  165. package/dist/features/store-extensions/schemas/rbac.js +43 -0
  166. package/dist/features/stores/api/[storeSlug]/reviews/route.js +49 -7
  167. package/dist/features/stores/components/InteractiveStoreCard.js +7 -3
  168. package/dist/features/stores/components/StoreCapabilitiesGuideView.d.ts +3 -0
  169. package/dist/features/stores/components/StoreCapabilitiesGuideView.js +101 -0
  170. package/dist/features/stores/components/StoreFinanceGuideView.d.ts +3 -0
  171. package/dist/features/stores/components/StoreFinanceGuideView.js +79 -0
  172. package/dist/features/stores/components/StoreGuideHubView.d.ts +5 -0
  173. package/dist/features/stores/components/StoreGuideHubView.js +89 -0
  174. package/dist/features/stores/components/StoreListingsGuideView.d.ts +3 -0
  175. package/dist/features/stores/components/StoreListingsGuideView.js +151 -0
  176. package/dist/features/stores/components/StoreOrdersGuideView.d.ts +3 -0
  177. package/dist/features/stores/components/StoreOrdersGuideView.js +122 -0
  178. package/dist/features/stores/components/StoreProductsListing.js +6 -10
  179. package/dist/features/stores/components/StoreReviewsListing.js +100 -23
  180. package/dist/features/stores/components/StoreSettingsGuideView.d.ts +3 -0
  181. package/dist/features/stores/components/StoreSettingsGuideView.js +56 -0
  182. package/dist/features/stores/components/index.d.ts +12 -1
  183. package/dist/features/stores/components/index.js +6 -1
  184. package/dist/features/stores/hooks/useStores.d.ts +5 -0
  185. package/dist/features/stores/hooks/useStores.js +10 -0
  186. package/dist/features/stores/manifest.js +1 -1
  187. package/dist/features/stores/schemas/firestore.d.ts +2 -0
  188. package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +13 -2
  189. package/dist/index.d.ts +60 -9
  190. package/dist/index.js +66 -15
  191. package/dist/next/routing/route-map.d.ts +134 -0
  192. package/dist/next/routing/route-map.js +59 -0
  193. package/dist/providers/db-firebase/__tests__/filter-aliases.test.d.ts +1 -0
  194. package/dist/providers/db-firebase/__tests__/filter-aliases.test.js +93 -0
  195. package/dist/providers/db-firebase/sieve.d.ts +49 -0
  196. package/dist/providers/db-firebase/sieve.js +61 -8
  197. package/dist/react/hooks/useFormStatePreservation.d.ts +17 -0
  198. package/dist/react/hooks/useFormStatePreservation.js +62 -0
  199. package/dist/react/hooks/useInlineRowEdit.d.ts +24 -0
  200. package/dist/react/hooks/useInlineRowEdit.js +68 -0
  201. package/dist/react/index.d.ts +4 -0
  202. package/dist/react/index.js +4 -0
  203. package/dist/repositories/index.d.ts +5 -0
  204. package/dist/repositories/index.js +7 -0
  205. package/dist/seed/actions/demo-seed-actions.d.ts +1 -1
  206. package/dist/seed/claimed-coupons-seed-data.d.ts +13 -0
  207. package/dist/seed/claimed-coupons-seed-data.js +79 -0
  208. package/dist/seed/index.d.ts +2 -0
  209. package/dist/seed/index.js +3 -0
  210. package/dist/seed/manifest.js +17 -0
  211. package/dist/seed/store-extensions-seed-data.d.ts +19 -0
  212. package/dist/seed/store-extensions-seed-data.js +421 -0
  213. package/dist/tailwind-utilities.css +1 -1
  214. package/dist/ui/components/Button.style.css +20 -12
  215. package/dist/ui/components/ClaimCouponButton.d.ts +28 -0
  216. package/dist/ui/components/ClaimCouponButton.js +89 -0
  217. package/dist/ui/components/ListingToolbar.d.ts +8 -1
  218. package/dist/ui/components/ListingToolbar.js +4 -2
  219. package/dist/ui/components/QuickCreateModal.d.ts +15 -0
  220. package/dist/ui/components/QuickCreateModal.js +48 -0
  221. package/dist/ui/components/QuickCreateModal.style.css +84 -0
  222. package/dist/ui/components/StickyBottomBar.d.ts +22 -0
  223. package/dist/ui/components/StickyBottomBar.js +20 -0
  224. package/dist/ui/components/VacationBanner.d.ts +11 -0
  225. package/dist/ui/components/VacationBanner.js +16 -0
  226. package/dist/ui/components/__tests__/BulkActionBar.test.d.ts +1 -0
  227. package/dist/ui/components/__tests__/BulkActionBar.test.js +96 -0
  228. package/dist/ui/components/__tests__/ListingToolbar.test.d.ts +1 -0
  229. package/dist/ui/components/__tests__/ListingToolbar.test.js +125 -0
  230. package/dist/ui/index.d.ts +9 -1
  231. package/dist/ui/index.js +4 -0
  232. package/package.json +8 -2
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { UserCheck, Bell, Heart, Star, Lock, AlertTriangle, Flag } from "lucide-react";
3
+ import { Div, Heading, Text, Section, Alert } from "../../../ui";
4
+ import { ROUTES } from "../../../constants";
5
+ import { GC } from "../../_guide-cls";
6
+ const SECTIONS = [
7
+ {
8
+ Icon: UserCheck, title: "Your Profile",
9
+ content: (_jsxs(Div, { className: "space-y-3", children: [_jsxs(Text, { className: GC.textMuted, children: ["Update your profile at ", _jsx("strong", { children: "My Account \u2192 My Profile" }), ". Your ", _jsx("strong", { children: "display name" }), " is shown to sellers on order summaries."] }), _jsxs(Div, { className: "grid sm:grid-cols-2 gap-4 text-sm", children: [_jsxs(Div, { children: [_jsx(Text, { className: "font-semibold text-[var(--appkit-color-text)] mb-1", children: "Visible to others:" }), _jsxs("ul", { className: GC.listDiscMuted, children: [_jsx("li", { children: "Display name" }), _jsx("li", { children: "Avatar / profile photo" }), _jsx("li", { children: "Bio" }), _jsx("li", { children: "Member since date" })] })] }), _jsxs(Div, { children: [_jsx(Text, { className: "font-semibold text-[var(--appkit-color-text)] mb-1", children: "Only you can see:" }), _jsxs("ul", { className: GC.listDiscMuted, children: [_jsx("li", { children: "Email address" }), _jsx("li", { children: "Phone number" }), _jsx("li", { children: "Saved addresses" }), _jsx("li", { children: "Order history" })] })] })] })] })),
10
+ },
11
+ {
12
+ Icon: Bell, title: "Notifications",
13
+ content: (_jsxs(Div, { className: "space-y-3", children: [_jsx(Text, { className: GC.textMuted, children: "You'll receive in-app notifications for:" }), _jsxs("ul", { className: GC.listDiscMuted, children: [_jsx("li", { children: "Order status changes (Processing, Shipped, Delivered)" }), _jsx("li", { children: "Outbid alerts on auctions you're participating in" }), _jsx("li", { children: "Auction win notification" }), _jsx("li", { children: "Review request after a delivered order" }), _jsx("li", { children: "Support ticket replies" })] }), _jsxs(Text, { className: GC.textMuted, children: ["Manage notification preferences at ", _jsx("strong", { children: "My Account \u2192 Settings \u2192 Notifications" }), "."] })] })),
14
+ },
15
+ {
16
+ Icon: Heart, iconCls: "w-5 h-5 text-rose-500", title: "Wishlist",
17
+ content: (_jsxs(Div, { className: "space-y-3", children: [_jsxs(Text, { className: GC.textMuted, children: ["Save any listing to your wishlist by clicking the heart icon on a product card. View your wishlist at ", _jsx("strong", { children: "My Account \u2192 Wishlist" }), "."] }), _jsxs(Alert, { variant: "info", children: ["Your wishlist holds up to ", _jsx("strong", { children: "20 items" }), ". Remove items you no longer want to make room for new ones. Wishlists are private \u2014 other users cannot see your saved items."] })] })),
18
+ },
19
+ {
20
+ Icon: Star, iconCls: "w-5 h-5 text-amber-400", title: "Leaving a Review",
21
+ content: (_jsxs(Div, { className: "space-y-3", children: [_jsxs(Text, { className: GC.textMuted, children: ["You can leave a review after your order is marked ", _jsx("strong", { children: "DELIVERED" }), ". Reviews are verified \u2014 only buyers who completed an order can review that product."] }), _jsxs("ul", { className: GC.listMuted, children: [_jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Rating" }), " \u2014 1\u20135 stars. Be fair and specific."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Title & body" }), " \u2014 describe item condition vs listing, packaging quality, and seller communication."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Photos" }), " \u2014 optional but helpful for other buyers."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Seller response" }), " \u2014 the seller may respond publicly. You cannot edit a review after a seller has responded."] })] }), _jsx(Text, { className: GC.textMuted, children: "Review guidelines: no personal information, no hate speech or slurs, factual only." })] })),
22
+ },
23
+ {
24
+ Icon: Lock, title: "Account Security",
25
+ content: (_jsxs("ul", { className: GC.listMuted, children: [_jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Change password" }), " \u2014 use \"Forgot password\" on the login page. A reset link is sent to your registered email."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Active sessions" }), " \u2014 view all devices signed in at ", _jsx("strong", { children: "My Account \u2192 Sessions" }), ". Sign out unfamiliar devices immediately."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Sign out everywhere" }), " \u2014 use \"Sign out everywhere\" on the Sessions page to invalidate all active sessions at once."] })] })),
26
+ },
27
+ {
28
+ Icon: AlertTriangle, iconCls: "w-5 h-5 text-amber-500", title: "Scam Awareness",
29
+ content: (_jsxs(_Fragment, { children: [_jsx(Alert, { variant: "warning", title: "Top scam types in the collectibles market:", children: _jsxs("ul", { className: "space-y-1 text-sm mt-1", children: [_jsxs("li", { children: [_jsx("strong", { children: "1. Fake payment screenshots" }), " \u2014 always verify refunds in your bank app."] }), _jsxs("li", { children: [_jsx("strong", { children: "2. Empty box shipping" }), " \u2014 item photos look real but the box arrives empty. Check seller rating."] }), _jsxs("li", { children: [_jsx("strong", { children: "3. Fake graded cards" }), " \u2014 counterfeit PSA/BGS slabs. Verify cert numbers on the grading company's website."] }), _jsxs("li", { children: [_jsx("strong", { children: "4. Urgency pressure" }), " \u2014 \"someone else is about to buy\". Legitimate sellers don't pressure you."] }), _jsxs("li", { children: [_jsx("strong", { children: "5. Sympathy plays" }), " \u2014 emotional manipulation is a red flag."] })] }) }), _jsxs(Text, { className: `${GC.textMuted} mt-4`, children: ["Read the full ", _jsx("a", { href: String(ROUTES.PUBLIC.SCAMS), className: "text-[var(--appkit-color-primary)] underline hover:no-underline font-medium", children: "Scam Registry \u2192" }), " for all 27 documented scam types."] })] })),
30
+ },
31
+ {
32
+ Icon: Flag, iconCls: "w-5 h-5 text-rose-500", title: "Reporting Issues",
33
+ content: (_jsxs(Div, { className: "grid sm:grid-cols-2 gap-6 text-sm", children: [_jsxs(Div, { children: [_jsx(Text, { className: "font-semibold text-[var(--appkit-color-text)] mb-2", children: "Report a seller (scam, fake item, harassment)" }), _jsx(Text, { className: `${GC.textMuted} mb-2`, children: "Use the Scam Registry report form. Our Trust & Safety team reviews within 48 hours." }), _jsx("a", { href: String(ROUTES.PUBLIC.SCAMS), className: "text-[var(--appkit-color-primary)] text-sm font-medium underline hover:no-underline", children: "Go to Scam Registry \u2192" })] }), _jsxs(Div, { children: [_jsx(Text, { className: "font-semibold text-[var(--appkit-color-text)] mb-2", children: "Open a support ticket (order dispute, billing, account)" }), _jsx(Text, { className: `${GC.textMuted} mb-2`, children: "Go to My Account \u2192 Support Tickets. Choose the right category for a faster response." }), _jsx("a", { href: String(ROUTES.USER.SUPPORT), className: "text-[var(--appkit-color-primary)] text-sm font-medium underline hover:no-underline", children: "Open Support Ticket \u2192" })] })] })),
34
+ },
35
+ ];
36
+ // ─── Component ────────────────────────────────────────────────────────────────
37
+ export function BuyerAccountGuideView() {
38
+ return (_jsxs(Div, { className: "space-y-8 pb-10 max-w-3xl mx-auto", children: [_jsxs(Section, { children: [_jsxs(Div, { className: "flex items-center gap-3 mb-2", children: [_jsx(Div, { className: "flex-shrink-0 w-10 h-10 rounded-xl flex items-center justify-center", style: { background: GC.pageHeaderGradient }, children: _jsx(UserCheck, { className: "w-5 h-5 text-white" }) }), _jsx(Text, { className: "text-sm font-semibold text-[var(--appkit-color-text-muted)] uppercase tracking-widest", children: "Buyer Guide" })] }), _jsx(Heading, { level: 1, className: "text-2xl md:text-3xl font-bold text-[var(--appkit-color-text)] mb-2", children: "Account & Safety" }), _jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", children: "Manage your LetItRip profile, stay safe from scams, and know how to report problems." })] }), SECTIONS.map(({ Icon, iconCls, title, content }) => (_jsxs(Section, { className: GC.sectionWrap, children: [_jsxs(Div, { className: GC.sectionHeader, children: [_jsx(Icon, { className: iconCls ?? GC.iconPrimary }), _jsx(Heading, { level: 2, className: GC.sectionTitle, children: title })] }), _jsx(Div, { className: GC.sectionBody, children: content })] }, title)))] }));
39
+ }
@@ -0,0 +1 @@
1
+ export declare function BuyerAuctionsGuideView(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Gavel, TrendingUp, Trophy, AlertTriangle, Package, XCircle, ShieldCheck } from "lucide-react";
3
+ import { Div, Heading, Text, Section, Alert } from "../../../ui";
4
+ import { GC } from "../../_guide-cls";
5
+ const SECTIONS = [
6
+ {
7
+ Icon: Gavel, title: "How Auctions Work",
8
+ content: (_jsxs("ul", { className: GC.listMuted, children: [_jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Reserve price" }), " \u2014 the minimum amount the seller will accept. If bidding ends below the reserve, no sale occurs. You'll see \"Reserve not met\" on the listing."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Bid increment" }), " \u2014 each new bid must exceed the current highest bid by at least the set increment. The increment is shown on the listing."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Auction end time" }), " \u2014 displayed in your local timezone. Countdown timer shows hours and minutes remaining."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Auto-extend" }), " \u2014 if a bid is placed within the last 5 minutes of an auction, the end time extends by 5 minutes. This prevents last-second sniping and gives all bidders a fair chance."] })] })),
9
+ },
10
+ {
11
+ Icon: TrendingUp, title: "Placing a Bid",
12
+ content: (_jsxs(_Fragment, { children: [_jsxs(Text, { className: `${GC.textMuted} mb-3`, children: ["Enter your bid amount \u2014 it must be at least the current high bid plus the increment \u2014 and click ", _jsx("strong", { children: "Place Bid" }), ". You'll be asked to confirm."] }), _jsxs("ul", { className: GC.listMuted, children: [_jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Outbid notification" }), " \u2014 you'll receive an in-app notification and email if someone outbids you."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Max bid (proxy bidding)" }), " \u2014 enter the maximum you're willing to pay. LetItRip will automatically bid on your behalf up to that amount, in the minimum increments needed to keep you in the lead. Your max bid is never revealed to other bidders."] })] }), _jsxs(Text, { className: `${GC.textMuted} mt-3`, children: [_jsx("strong", { children: "Example:" }), " Current bid is \u20B9500, increment is \u20B950. You set a max bid of \u20B9800. Your bid is placed at \u20B9550. If someone bids \u20B9600, the system auto-bids \u20B9650 for you \u2014 up to \u20B9800."] })] })),
13
+ },
14
+ {
15
+ Icon: Trophy, title: "Winning an Auction",
16
+ content: (_jsxs(_Fragment, { children: [_jsx(Text, { className: `${GC.textMuted} mb-3`, children: "When an auction ends and you're the highest bidder (above the reserve), you've won." }), _jsxs("ul", { className: GC.listMuted, children: [_jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Payment window" }), " \u2014 you have ", _jsx("strong", { children: "48 hours" }), " from the auction end time to complete payment."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "No payment" }), " \u2014 the order auto-cancels after 48 hours, you may receive a bid restriction, and the item may be offered to the next highest bidder."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Winner badge" }), " \u2014 your winning order gets an \"Auction Winner\" badge in My Orders."] })] })] })),
17
+ },
18
+ {
19
+ Icon: AlertTriangle, iconCls: "w-5 h-5 text-amber-500", title: "Bid Retraction Policy",
20
+ content: (_jsxs(Alert, { variant: "warning", children: ["Bids on LetItRip are ", _jsx("strong", { children: "binding" }), ". Only place a bid if you intend to pay. Retraction requires contacting support with a valid reason. Repeated retractions may result in a temporary restriction on placing new bids."] })),
21
+ },
22
+ {
23
+ Icon: Package, title: "Pre-orders",
24
+ content: (_jsxs(_Fragment, { children: [_jsx(Text, { className: `${GC.textMuted} mb-3`, children: "A pre-order is an item not yet in stock. The seller takes deposits or full payment upfront and orders from their supplier in bulk once demand is confirmed." }), _jsxs("ul", { className: GC.listMuted, children: [_jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Deposit vs full price" }), " \u2014 check the listing. Some sellers take a partial deposit; others require full payment."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Expected delivery date" }), " \u2014 shown on the listing. This is the seller's estimate based on supplier timelines \u2014 not a guaranteed date."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "\"Confirmed supplier\" status" }), " \u2014 some listings show this badge, meaning the seller has placed the order with their supplier and stock is secured."] })] })] })),
25
+ },
26
+ {
27
+ Icon: XCircle, iconCls: "w-5 h-5 text-rose-500", title: "Pre-order Cancellations",
28
+ content: (_jsxs(_Fragment, { children: [_jsxs(Text, { className: `${GC.textMuted} mb-3`, children: ["To cancel a pre-order before the item is shipped, open a support ticket with category ", _jsx("strong", { children: "Billing & Payment" }), " or ", _jsx("strong", { children: "Order Issue" }), " and reference your order ID."] }), _jsx(Text, { className: GC.textMuted, children: "After cancellation is accepted, refunds follow the standard timeline: 3\u20137 business days to your original payment method." })] })),
29
+ },
30
+ {
31
+ Icon: ShieldCheck, iconCls: "w-5 h-5 text-emerald-500", title: "Bidding Safety Tips",
32
+ content: (_jsx(Alert, { variant: "info", children: _jsxs("ul", { className: "space-y-1 text-sm", children: [_jsx("li", { children: "\u2713 Check the seller's rating and number of completed orders before bidding." }), _jsx("li", { children: "\u2713 Read every product photo carefully \u2014 look for condition issues, especially on graded card slabs." }), _jsx("li", { children: "\u2713 If authenticity is unclear, contact support before placing a bid \u2014 not after." }), _jsx("li", { children: "\u2713 Set a max bid and stick to it. Bid heat is real \u2014 don't let excitement push you past your budget." })] }) })),
33
+ },
34
+ ];
35
+ // ─── Component ────────────────────────────────────────────────────────────────
36
+ export function BuyerAuctionsGuideView() {
37
+ return (_jsxs(Div, { className: "space-y-8 pb-10 max-w-3xl mx-auto", children: [_jsxs(Section, { children: [_jsxs(Div, { className: "flex items-center gap-3 mb-2", children: [_jsx(Div, { className: "flex-shrink-0 w-10 h-10 rounded-xl flex items-center justify-center", style: { background: GC.pageHeaderGradient }, children: _jsx(Gavel, { className: "w-5 h-5 text-white" }) }), _jsx(Text, { className: "text-sm font-semibold text-[var(--appkit-color-text-muted)] uppercase tracking-widest", children: "Buyer Guide" })] }), _jsx(Heading, { level: 1, className: "text-2xl md:text-3xl font-bold text-[var(--appkit-color-text)] mb-2", children: "Auctions & Pre-orders" }), _jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", children: "How bidding works, how to win, and everything you need to know about pre-orders on LetItRip." })] }), SECTIONS.map(({ Icon, iconCls, title, content }) => (_jsxs(Section, { className: GC.sectionWrap, children: [_jsxs(Div, { className: GC.sectionHeader, children: [_jsx(Icon, { className: iconCls ?? GC.iconPrimary }), _jsx(Heading, { level: 2, className: GC.sectionTitle, children: title })] }), _jsx(Div, { className: GC.sectionBody, children: content })] }, title)))] }));
38
+ }
@@ -0,0 +1 @@
1
+ export declare function BuyerOrdersGuideView(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,48 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { PackageCheck, Truck, Camera, RotateCcw, Clock, Headphones, Scale } from "lucide-react";
3
+ import { Div, Heading, Text, Section, Alert } from "../../../ui";
4
+ import { GC } from "../../_guide-cls";
5
+ // ─── Section data ─────────────────────────────────────────────────────────────
6
+ const ORDER_STATUSES = [
7
+ { status: "PENDING", desc: "Payment received. Seller has been notified. You can cancel at this stage." },
8
+ { status: "PROCESSING", desc: "Seller is packing your item. Cancellation window has closed." },
9
+ { status: "SHIPPED", desc: "Item dispatched. Tracking number available in your order detail." },
10
+ { status: "DELIVERED", desc: "Carrier confirmed delivery. Return window (7 days) starts from this date." },
11
+ { status: "RETURN_REQUESTED", desc: "You have opened a return request. Awaiting seller response." },
12
+ { status: "REFUNDED", desc: "Return accepted and refund issued." },
13
+ { status: "CANCELLED", desc: "Order was cancelled before shipping (by you, the seller, or automatically)." },
14
+ ];
15
+ const SECTIONS = [
16
+ {
17
+ Icon: PackageCheck, title: "Order Lifecycle",
18
+ content: (_jsxs(Div, { className: "space-y-4 text-sm", children: [_jsx(Text, { className: GC.textMuted, children: "Every order on LetItRip moves through these statuses:" }), _jsx(Div, { className: "space-y-2", children: ORDER_STATUSES.map(({ status, desc }) => (_jsxs(Div, { className: "flex gap-3", children: [_jsx(Text, { className: "flex-shrink-0 font-mono font-semibold text-[var(--appkit-color-primary)] w-36 text-xs", children: status }), _jsx(Text, { className: GC.textMuted, children: desc })] }, status))) })] })),
19
+ },
20
+ {
21
+ Icon: Truck, title: "Tracking Your Order",
22
+ content: (_jsxs(Div, { className: "space-y-3", children: [_jsxs(Text, { className: GC.textMuted, children: ["Once your order is SHIPPED, go to ", _jsx("strong", { children: "My Orders \u2192 [Order] \u2192 Tracking" }), " tab. Your tracking number and carrier name are shown there."] }), _jsx(Text, { className: GC.textMuted, children: "Paste the tracking number into the carrier's website for real-time updates. Common carriers: Shiprocket, Delhivery, BlueDart, India Post, Ekart." }), _jsx(Text, { className: GC.textMuted, children: "Typical delivery times: 2\u20135 days metro cities, 5\u201310 days remote areas, 7\u201314 days for pre-orders subject to supplier shipping." })] })),
23
+ },
24
+ {
25
+ Icon: Camera, iconCls: "w-5 h-5 text-amber-500", title: "Wrong or Damaged Item",
26
+ content: (_jsxs(_Fragment, { children: [_jsx(Alert, { variant: "warning", title: "Do NOT refuse delivery.", children: "Accept the parcel, then photograph it immediately \u2014 both the packaging and the contents before and after unwrapping. This evidence is required for any return or damage claim." }), _jsxs(Text, { className: `${GC.textMuted} mt-4`, children: ["After photographing, open a ", _jsx("strong", { children: "return request within 2 days of delivery" }), " and attach your photos."] })] })),
27
+ },
28
+ {
29
+ Icon: RotateCcw, title: "Return Policy",
30
+ content: (_jsxs(Div, { className: "space-y-3", children: [_jsxs(Text, { className: GC.textMuted, children: ["Platform-wide return window: ", _jsx("strong", { children: "7 days from DELIVERED date" }), ". Some stores offer 30-day windows \u2014 shown on the product page."] }), _jsx(Text, { className: "text-sm font-semibold text-[var(--appkit-color-text)]", children: "Non-returnable items:" }), _jsxs("ul", { className: GC.listDiscMuted, children: [_jsx("li", { children: "Opened card packs (Pok\u00E9mon, Yu-Gi-Oh!, etc.)" }), _jsx("li", { children: "Cracked or opened graded card slabs without documented photographic evidence of a defect" }), _jsx("li", { children: "Items explicitly marked \"Final Sale\" on the listing" })] })] })),
31
+ },
32
+ {
33
+ Icon: Clock, title: "Refund Timeline",
34
+ content: (_jsxs(Div, { className: "space-y-3", children: [_jsx(Text, { className: GC.textMuted, children: "After the seller accepts your return and confirms receipt of the item:" }), _jsxs("ul", { className: GC.listMuted, children: [_jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Credit/debit card" }), " \u2014 3\u20137 business days back to your card via Razorpay."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "UPI" }), " \u2014 typically 1\u20132 business days."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Net banking" }), " \u2014 3\u20135 business days."] })] }), _jsx(Text, { className: GC.textMuted, children: "Refunds go back to the original payment method. LetItRip does not issue platform credits in lieu of a refund unless both parties agree." })] })),
35
+ },
36
+ {
37
+ Icon: Headphones, title: "Opening a Support Ticket",
38
+ content: (_jsxs(Div, { className: "space-y-3", children: [_jsx(Text, { className: "text-sm font-semibold text-[var(--appkit-color-text)]", children: "When to use a support ticket:" }), _jsxs("ul", { className: GC.listDiscMuted, children: [_jsx("li", { children: "Seller is unresponsive to your return request for more than 3 days" }), _jsx("li", { children: "Tracking has not updated in 7+ days" }), _jsx("li", { children: "Item is significantly not as described" })] }), _jsx(Text, { className: "text-sm font-semibold text-[var(--appkit-color-text)]", children: "What to include:" }), _jsxs("ul", { className: GC.listDiscMuted, children: [_jsxs("li", { children: ["Your order ID (e.g. ", _jsx("code", { className: GC.code, children: "order-2-20260508-a1b2c3" }), ")"] }), _jsx("li", { children: "Photos of the item and packaging" }), _jsx("li", { children: "A clear timeline of events" })] }), _jsx(Text, { className: GC.textMuted, children: "Response SLA: 24\u201348 hours. You can have up to 2 active general tickets and 1 additional ticket per active order." })] })),
39
+ },
40
+ {
41
+ Icon: Scale, title: "Dispute Escalation",
42
+ content: (_jsxs(Div, { className: "space-y-3", children: [_jsxs(Text, { className: GC.textMuted, children: ["If the seller does not respond to your return request within ", _jsx("strong", { children: "3 days" }), ", LetItRip's support team steps in to mediate."] }), _jsxs(Text, { className: GC.textMuted, children: ["If mediation cannot resolve the dispute, LetItRip issues a ", _jsx("strong", { children: "full platform-funded refund" }), " to the buyer. The seller's payout for that order is withheld."] }), _jsx(Alert, { variant: "info", children: "All dispute decisions are final. False dispute claims may result in account restrictions. Always provide accurate, photographic evidence when raising a dispute." })] })),
43
+ },
44
+ ];
45
+ // ─── Component ────────────────────────────────────────────────────────────────
46
+ export function BuyerOrdersGuideView() {
47
+ return (_jsxs(Div, { className: "space-y-8 pb-10 max-w-3xl mx-auto", children: [_jsxs(Section, { children: [_jsxs(Div, { className: "flex items-center gap-3 mb-2", children: [_jsx(Div, { className: "flex-shrink-0 w-10 h-10 rounded-xl flex items-center justify-center", style: { background: GC.pageHeaderGradient }, children: _jsx(PackageCheck, { className: "w-5 h-5 text-white" }) }), _jsx(Text, { className: "text-sm font-semibold text-[var(--appkit-color-text-muted)] uppercase tracking-widest", children: "Buyer Guide" })] }), _jsx(Heading, { level: 1, className: "text-2xl md:text-3xl font-bold text-[var(--appkit-color-text)] mb-2", children: "Orders, Returns & Support" }), _jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", children: "From placing an order to getting a refund \u2014 everything you need to know about managing your orders on LetItRip." })] }), SECTIONS.map(({ Icon, iconCls, title, content }) => (_jsxs(Section, { className: GC.sectionWrap, children: [_jsxs(Div, { className: GC.sectionHeader, children: [_jsx(Icon, { className: iconCls ?? GC.iconPrimary }), _jsx(Heading, { level: 2, className: GC.sectionTitle, children: title })] }), _jsx(Div, { className: GC.sectionBody, children: content })] }, title)))] }));
48
+ }
@@ -0,0 +1 @@
1
+ export declare function BuyerShoppingGuideView(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { ShoppingBag, ShoppingCart, CreditCard, Tag, CheckCircle, UserX } from "lucide-react";
3
+ import { Div, Heading, Text, Section, Alert } from "../../../ui";
4
+ import { GC } from "../../_guide-cls";
5
+ const SECTIONS = [
6
+ {
7
+ Icon: ShoppingBag, title: "Browsing & Search",
8
+ content: (_jsxs(_Fragment, { children: [_jsx(Text, { className: `${GC.textMuted} mb-3`, children: "Use the search bar at the top of any page to find items by keyword \u2014 e.g. \"Charizard Base Set\", \"Hot Wheels Redline\", or \"Beyblade Burst\". Combine keywords for best results." }), _jsx(Text, { className: "text-sm font-semibold text-[var(--appkit-color-text)] mb-2", children: "Available filters:" }), _jsxs("ul", { className: GC.listDiscMuted, children: [_jsxs("li", { children: [_jsx("strong", { children: "Category" }), " \u2014 Trading Cards, Action Figures, Diecast, Spinning Tops, Model Kits, Vintage & Rare"] }), _jsxs("li", { children: [_jsx("strong", { children: "Brand" }), " \u2014 Pok\u00E9mon Company, Bandai, Hot Wheels, Hasbro, Funko, and more"] }), _jsxs("li", { children: [_jsx("strong", { children: "Price range" }), " \u2014 set a minimum and maximum in rupees"] }), _jsxs("li", { children: [_jsx("strong", { children: "Condition" }), " \u2014 grades 1\u201310 (10 = Gem Mint, 1 = Poor)"] }), _jsxs("li", { children: [_jsx("strong", { children: "Listing type" }), " \u2014 Standard / Auction / Pre-order"] })] }), _jsx(Text, { className: `${GC.textMuted} mt-3`, children: "Sort options: Relevance, Price (Low to High), Price (High to Low), Newest First. On mobile, tap the Filter icon to open the filter drawer." })] })),
9
+ },
10
+ {
11
+ Icon: ShoppingBag, title: "Reading a Product Page",
12
+ content: (_jsxs("ul", { className: GC.listMuted, children: [_jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Images" }), " \u2014 tap or click to zoom; swipe left/right to browse all photos."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Condition grade" }), " \u2014 rated 1\u201310: 10 = PSA 10 Gem Mint (flawless), 9 = Mint, 8 = Near Mint\u2013Mint, 7 = Near Mint, 5 = Heavily Played, 3 = Damaged, 1 = Poor."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Seller card" }), " \u2014 shows store name, rating, and total orders delivered. Click the store name to browse all their listings."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Reviews tab" }), " \u2014 verified buyer reviews with star ratings, photos, and seller responses."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Questions?" }), " \u2014 if listing details are unclear, open a support ticket and reference the product URL."] })] })),
13
+ },
14
+ {
15
+ Icon: ShoppingCart, title: "Cart",
16
+ content: (_jsxs("ul", { className: GC.listMuted, children: [_jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Adding items" }), " \u2014 click \"Add to Cart\" on any standard product or pre-order. Auctions have a \"Place Bid\" flow instead."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Guest cart" }), " \u2014 saved in your browser (localStorage); cleared after 30 days of inactivity."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Logged-in cart" }), " \u2014 synced to your account via Firestore; persists across all your devices."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Item limit" }), " \u2014 up to 20 items per cart. Remove items before adding more."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Updating" }), " \u2014 use the quantity selector or click the trash icon to remove. Changes sync instantly."] })] })),
17
+ },
18
+ {
19
+ Icon: CreditCard, title: "Checkout",
20
+ content: (_jsxs("ul", { className: GC.listMuted, children: [_jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Shipping address" }), " \u2014 enter or select a saved address. All fields required: full name, phone, address line, city, state, pin code."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Payment methods" }), " \u2014 UPI, credit/debit card (Visa, Mastercard, Rupay), net banking \u2014 all processed via Razorpay."] }), _jsxs("li", { children: [_jsx("strong", { className: GC.textStrong, children: "Secure checkout" }), " \u2014 LetItRip never stores your card details. All payment data is handled by Razorpay's PCI-DSS compliant gateway."] })] })),
21
+ },
22
+ {
23
+ Icon: Tag, title: "Coupons",
24
+ content: (_jsxs(_Fragment, { children: [_jsx(Text, { className: `${GC.textMuted} mb-3`, children: "Enter your coupon code at step 2 of checkout (Order Summary). The discount is applied immediately and shown in the total." }), _jsx(Text, { className: "text-sm font-semibold text-[var(--appkit-color-text)] mb-2", children: "Why a coupon might not apply:" }), _jsxs("ul", { className: GC.listDiscMuted, children: [_jsx("li", { children: "Your order total is below the coupon's minimum purchase amount" }), _jsx("li", { children: "The coupon has expired or hasn't started yet" }), _jsx("li", { children: "Your cart contains items from categories excluded by the coupon" }), _jsx("li", { children: "The coupon is \"first order only\" but you've placed orders before" }), _jsx("li", { children: "You've already used this coupon the maximum allowed times" })] })] })),
25
+ },
26
+ {
27
+ Icon: CheckCircle, title: "Order Confirmation",
28
+ content: (_jsxs(_Fragment, { children: [_jsx(Text, { className: GC.textMuted, children: "After a successful payment you'll see an on-screen confirmation with your order ID. You'll also receive:" }), _jsxs("ul", { className: `${GC.listDiscMuted} mt-3`, children: [_jsx("li", { children: "An email confirmation to your registered address" }), _jsx("li", { children: "A WhatsApp message if you've added and verified your phone number" })] }), _jsxs(Text, { className: `${GC.textMuted} mt-3`, children: ["View all your orders at any time under ", _jsx("strong", { children: "My Account \u2192 My Orders" }), "."] })] })),
29
+ },
30
+ {
31
+ Icon: UserX, title: "Guest Limitations",
32
+ content: (_jsxs(Alert, { variant: "info", title: "Browsing as a guest?", children: ["You can browse listings and add items to your cart as a guest. However, to ", _jsx("strong", { children: "complete checkout" }), ", save your wishlist, or contact support you must be signed in. Creating an account takes under 30 seconds \u2014 just an email and a password."] })),
33
+ },
34
+ ];
35
+ // ─── Component ────────────────────────────────────────────────────────────────
36
+ export function BuyerShoppingGuideView() {
37
+ return (_jsxs(Div, { className: "space-y-8 pb-10 max-w-3xl mx-auto", children: [_jsxs(Section, { children: [_jsxs(Div, { className: "flex items-center gap-3 mb-2", children: [_jsx(Div, { className: "flex-shrink-0 w-10 h-10 rounded-xl flex items-center justify-center", style: { background: GC.pageHeaderGradient }, children: _jsx(ShoppingBag, { className: "w-5 h-5 text-white" }) }), _jsx(Text, { className: "text-sm font-semibold text-[var(--appkit-color-text-muted)] uppercase tracking-widest", children: "Buyer Guide" })] }), _jsx(Heading, { level: 1, className: "text-2xl md:text-3xl font-bold text-[var(--appkit-color-text)] mb-2", children: "Shopping & Checkout" }), _jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", children: "Everything you need to know about finding, evaluating, and buying collectibles on LetItRip." })] }), SECTIONS.map(({ Icon, title, content }) => (_jsxs(Section, { className: GC.sectionWrap, children: [_jsxs(Div, { className: GC.sectionHeader, children: [_jsx(Icon, { className: GC.iconPrimary }), _jsx(Heading, { level: 2, className: GC.sectionTitle, children: title })] }), _jsx(Div, { className: GC.sectionBody, children: content })] }, title)))] }));
38
+ }
@@ -6,6 +6,7 @@ import Link from "next/link";
6
6
  import { usePathname } from "next/navigation";
7
7
  import { Li, Nav, Span, Ul } from "../../../ui";
8
8
  import { BottomSheet } from "../../layout/BottomSheet";
9
+ import { SidebarCollapseToggle } from "../../../_internal/client/features/layout/SidebarCollapseToggle";
9
10
  function isNavItemActive(item, activeHref) {
10
11
  return activeHref === item.href || activeHref.startsWith(item.href + "/");
11
12
  }
@@ -73,7 +74,7 @@ export function UserSidebar({ items, groups, mobileOpen = false, onCloseMobile,
73
74
  height: "calc(100vh - var(--header-height, 3.5rem))",
74
75
  width: "13rem",
75
76
  transform: desktopOpen ? "translateX(0)" : "translateX(calc(-100% + 1.25rem))",
76
- }, children: [_jsxs("div", { className: "flex-1 bg-white dark:bg-slate-900 border-r border-zinc-200 dark:border-slate-800 flex flex-col overflow-hidden shadow-xl", children: [_jsx("div", { className: "px-4 py-3.5 border-b border-zinc-100 dark:border-slate-800 shrink-0", children: _jsx("span", { className: "text-xs font-semibold uppercase tracking-widest text-zinc-400 dark:text-zinc-500", children: "My Account" }) }), _jsx("div", { className: "flex-1 overflow-y-auto", children: _jsx(DrawerContent, { groups: groups, items: items, activeHref: pathname }) })] }), _jsx("button", { type: "button", onClick: handleToggle, "aria-label": desktopOpen ? "Collapse sidebar" : "Expand sidebar", className: "w-9 shrink-0 flex items-center justify-center cursor-pointer rounded-r-[1.25rem] shadow-lg transition-all duration-200 hover:shadow-xl hover:brightness-110 active:scale-[0.96]", style: { background: "linear-gradient(to bottom, var(--appkit-color-primary-700, var(--appkit-color-primary)), var(--appkit-color-secondary-500, var(--appkit-color-secondary)))" }, children: _jsx("svg", { className: `w-4 h-4 text-white drop-shadow-sm transition-transform duration-300 ${desktopOpen ? "" : "rotate-180"}`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M15 19l-7-7 7-7" }) }) })] }), _jsx("div", { className: "md:hidden", children: _jsx(BottomSheet, { open: mobileOpen, onClose: close, title: "My Account", children: _jsx(DrawerContent, { groups: groups, items: items, activeHref: pathname, onItemClick: close }) }) })] }));
77
+ }, children: [_jsxs("div", { className: "flex-1 bg-white dark:bg-slate-900 border-r border-zinc-200 dark:border-slate-800 flex flex-col overflow-hidden shadow-xl", children: [_jsx("div", { className: "px-4 py-3.5 border-b border-zinc-100 dark:border-slate-800 shrink-0", children: _jsx("span", { className: "text-xs font-semibold uppercase tracking-widest text-zinc-400 dark:text-zinc-500", children: "My Account" }) }), _jsx("div", { className: "flex-1 overflow-y-auto", children: _jsx(DrawerContent, { groups: groups, items: items, activeHref: pathname }) })] }), _jsx(SidebarCollapseToggle, { expanded: desktopOpen, onToggle: handleToggle })] }), _jsx("div", { className: "md:hidden", children: _jsx(BottomSheet, { open: mobileOpen, onClose: close, title: "My Account", children: _jsx(DrawerContent, { groups: groups, items: items, activeHref: pathname, onItemClick: close }) }) })] }));
77
78
  }
78
79
  // ── Overlay variant (default) — portal on desktop, bottom-sheet on mobile ─
79
80
  const content = (_jsx(DrawerContent, { groups: groups, items: items, activeHref: pathname, onItemClick: close }));
@@ -0,0 +1 @@
1
+ export declare function AdminAnalyticsGuideView(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { BarChart2 } from "lucide-react";
3
+ import { Div, Heading, Text, Section, Alert } from "../../../ui";
4
+ import { GC } from "../../_guide-cls";
5
+ export function AdminAnalyticsGuideView() {
6
+ return (_jsxs(Div, { className: "space-y-8 pb-10 max-w-3xl mx-auto", children: [_jsxs(Section, { children: [_jsxs(Div, { className: "flex items-center gap-3 mb-2", children: [_jsx(Div, { className: "flex-shrink-0 w-10 h-10 rounded-xl flex items-center justify-center", style: { background: "linear-gradient(135deg,var(--appkit-color-primary-700,#4f46e5) 0%,var(--appkit-color-cobalt,#2563eb) 100%)" }, children: _jsx(BarChart2, { className: "w-5 h-5 text-white" }) }), _jsx(Text, { className: "text-sm font-semibold text-[var(--appkit-color-text-muted)] uppercase tracking-widest", children: "Admin Guide" })] }), _jsx(Heading, { level: 1, className: "text-2xl md:text-3xl font-bold text-[var(--appkit-color-text)] mb-2", children: "Analytics" }), _jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", children: "Revenue, order funnel, product performance, and store metrics on LetItRip." })] }), [
7
+ {
8
+ title: "Revenue Dashboard",
9
+ content: (_jsxs("ul", { className: GC.listMuted, children: [_jsxs("li", { children: [_jsx("strong", { className: "text-[var(--appkit-color-text)]", children: "GMV (Gross Merchandise Value)" }), ": Total order subtotals across all stores. Does not deduct platform commission or refunds."] }), _jsxs("li", { children: [_jsx("strong", { className: "text-[var(--appkit-color-text)]", children: "Net Revenue" }), ": GMV \u00D7 platformFee \u2014 refunded orders excluded."] }), _jsxs("li", { children: [_jsx("strong", { className: "text-[var(--appkit-color-text)]", children: "Period filter" }), ": Last 7 / 30 / 90 days, or custom date range. All monetary values shown in INR."] }), _jsxs("li", { children: [_jsx("strong", { className: "text-[var(--appkit-color-text)]", children: "Payout total" }), ": Total disbursed to sellers in the same period. Revenue - Payout = Platform earnings."] })] })),
10
+ },
11
+ {
12
+ title: "Order Funnel",
13
+ content: (_jsxs("ul", { className: GC.listMuted, children: [_jsx("li", { children: "The funnel shows drop-off at each stage: Add to Cart \u2192 Checkout started \u2192 Payment initiated \u2192 Payment completed \u2192 Delivered." }), _jsx("li", { children: "High drop-off at \"Payment initiated \u2192 completed\" often indicates a payment gateway issue or UX friction. Check Razorpay dashboard if you see a spike." }), _jsx("li", { children: "High cancellation rate at PENDING \u2192 CANCELLED indicates buyers are placing test orders or listing quality issues (item description doesn't match photos)." })] })),
14
+ },
15
+ {
16
+ title: "Product Performance",
17
+ content: (_jsxs("ul", { className: GC.listMuted, children: [_jsxs("li", { children: [_jsx("strong", { className: "text-[var(--appkit-color-text)]", children: "Top products by orders" }), ": Which products drive the most completed transactions."] }), _jsxs("li", { children: [_jsx("strong", { className: "text-[var(--appkit-color-text)]", children: "Top products by views" }), ": High views but low orders may indicate pricing, photos, or description issues."] }), _jsxs("li", { children: [_jsx("strong", { className: "text-[var(--appkit-color-text)]", children: "Return rate" }), ": Products with >10% return rate need review \u2014 usually a condition description or photo quality issue."] })] })),
18
+ },
19
+ {
20
+ title: "Store-Level Metrics",
21
+ content: (_jsxs(_Fragment, { children: [_jsx(Text, { className: "text-sm text-[var(--appkit-color-text-muted)] mb-3", children: "Filter analytics by store to see individual seller performance. Available metrics:" }), _jsxs("ul", { className: "list-disc list-inside space-y-1 text-sm text-[var(--appkit-color-text-muted)]", children: [_jsx("li", { children: "Total orders and completion rate" }), _jsx("li", { children: "Average order value" }), _jsx("li", { children: "Return and refund rate" }), _jsx("li", { children: "Average seller rating" }), _jsx("li", { children: "Payout history" })] }), _jsx(Alert, { variant: "info", className: "mt-4", children: "Store analytics are visible to the store owner in their seller dashboard. Admin sees the full platform view. Do not share a specific store's metrics with other stores." })] })),
22
+ },
23
+ ].map(({ title, content }) => (_jsxs(Section, { className: "rounded-2xl border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)] overflow-hidden", children: [_jsxs(Div, { className: "flex items-center gap-3 px-6 py-4 border-b border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface-2,var(--appkit-color-border))]/20", children: [_jsx(BarChart2, { className: "w-5 h-5 text-[var(--appkit-color-primary)]" }), _jsx(Heading, { level: 2, className: "text-base font-semibold text-[var(--appkit-color-text)]", children: title })] }), _jsx(Div, { className: "px-6 py-5", children: content })] }, title)))] }));
24
+ }
@@ -1,13 +1,12 @@
1
1
  "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import React from "react";
4
4
  import { useMutation, useQuery } from "@tanstack/react-query";
5
- import { Button, Form, Input, RichTextEditor, Select, StackedViewShell, TagInput, Text, Toggle, useToast } from "../../../ui";
6
- import { FieldInput, FormShellContext, useFormShellState } from "../../../ui/forms";
7
- import { ImageUpload } from "../../media/upload/ImageUpload";
8
- import { useMediaUpload } from "../../media";
5
+ import { Button, ConfirmDeleteModal, Div, Heading, Input, RichTextEditor, RichTextRenderer, Select, StackedViewShell, TagInput, Text, Toggle, useToast, } from "../../../ui";
6
+ import { ImageUpload, useMediaUpload } from "../../media";
9
7
  import { apiClient } from "../../../http";
10
8
  import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
9
+ import { StepForm } from "../../shell";
11
10
  // --- Helpers -----------------------------------------------------------------
12
11
  const STATUS_OPTIONS = [
13
12
  { label: "Draft", value: "draft" },
@@ -21,6 +20,22 @@ const CATEGORY_OPTIONS = [
21
20
  { label: "Updates", value: "updates" },
22
21
  { label: "Community", value: "community" },
23
22
  ];
23
+ const DEFAULT_DRAFT = {
24
+ title: "",
25
+ slug: "",
26
+ excerpt: "",
27
+ content: "",
28
+ coverImage: "",
29
+ youtubeId: "",
30
+ category: "news",
31
+ tags: [],
32
+ status: "published",
33
+ isFeatured: true,
34
+ authorName: "Admin",
35
+ publishedAt: "",
36
+ metaTitle: "",
37
+ metaDescription: "",
38
+ };
24
39
  function toSlug(str) {
25
40
  const base = str
26
41
  .toLowerCase()
@@ -42,23 +57,15 @@ function toDateInputValue(val) {
42
57
  // --- Component ---------------------------------------------------------------
43
58
  export function AdminBlogEditorView({ postId, onSaved, onDeleted, embedded, ...rest }) {
44
59
  const isEdit = Boolean(postId);
45
- const [title, setTitle] = React.useState("");
46
- const [slug, setSlug] = React.useState("");
60
+ const [draft, setDraft] = React.useState(DEFAULT_DRAFT);
47
61
  const [slugManual, setSlugManual] = React.useState(false);
48
- const [excerpt, setExcerpt] = React.useState("");
49
- const [content, setContent] = React.useState("");
50
- const [coverImage, setCoverImage] = React.useState("");
51
- const [category, setCategory] = React.useState("news");
52
- const [tags, setTags] = React.useState([]);
53
- const [status, setStatus] = React.useState("draft");
54
- const [isFeatured, setIsFeatured] = React.useState(false);
55
- const [authorName, setAuthorName] = React.useState("Admin");
56
- const [publishedAt, setPublishedAt] = React.useState("");
57
- const [metaTitle, setMetaTitle] = React.useState("");
58
- const [metaDescription, setMetaDescription] = React.useState("");
62
+ const [currentStep, setCurrentStep] = React.useState(0);
63
+ const [showDeleteConfirm, setShowDeleteConfirm] = React.useState(false);
59
64
  const { showToast } = useToast();
60
65
  const { upload } = useMediaUpload();
61
- const { shellCtx, setFieldError, clearErrors } = useFormShellState();
66
+ const update = React.useCallback((partial) => {
67
+ setDraft((prev) => ({ ...prev, ...partial }));
68
+ }, []);
62
69
  // --- load existing post (edit mode) ---
63
70
  const postQuery = useQuery({
64
71
  queryKey: ["admin", "blog", postId],
@@ -72,49 +79,46 @@ export function AdminBlogEditorView({ postId, onSaved, onDeleted, embedded, ...r
72
79
  const p = postQuery.data;
73
80
  if (!p)
74
81
  return;
75
- setTitle(p.title ?? "");
76
- setSlug(p.slug ?? "");
82
+ setDraft({
83
+ title: p.title ?? "",
84
+ slug: p.slug ?? "",
85
+ excerpt: p.excerpt ?? "",
86
+ content: p.content ?? "",
87
+ coverImage: typeof p.coverImage === "string" ? p.coverImage : p.coverImage?.url ?? "",
88
+ youtubeId: p.youtubeId ?? "",
89
+ category: p.category ?? "news",
90
+ tags: Array.isArray(p.tags) ? p.tags : [],
91
+ status: p.status ?? "published",
92
+ isFeatured: p.isFeatured ?? true,
93
+ authorName: p.authorName ?? "Admin",
94
+ publishedAt: toDateInputValue(p.publishedAt),
95
+ metaTitle: p.metaTitle ?? "",
96
+ metaDescription: p.metaDescription ?? "",
97
+ });
77
98
  setSlugManual(true);
78
- setExcerpt(p.excerpt ?? "");
79
- setContent(p.content ?? "");
80
- setCoverImage(typeof p.coverImage === "string"
81
- ? p.coverImage
82
- : p.coverImage?.url ?? "");
83
- setCategory(p.category ?? "news");
84
- setTags(Array.isArray(p.tags) ? p.tags : []);
85
- setStatus(p.status ?? "draft");
86
- setIsFeatured(p.isFeatured ?? false);
87
- setAuthorName(p.authorName ?? "Admin");
88
- setPublishedAt(toDateInputValue(p.publishedAt));
89
- setMetaTitle(p.metaTitle ?? "");
90
- setMetaDescription(p.metaDescription ?? "");
91
99
  }, [postQuery.data]);
92
- const handleTitleChange = (value) => {
93
- setTitle(value);
94
- if (!slugManual)
95
- setSlug(toSlug(value));
96
- };
97
100
  // --- save ---
98
101
  const saveMutation = useMutation({
99
102
  mutationFn: async () => {
100
103
  const payload = {
101
- title,
102
- slug: slug || toSlug(title),
103
- excerpt,
104
- content,
105
- coverImage: coverImage || undefined,
106
- category,
107
- tags,
108
- status,
109
- isFeatured,
110
- authorName,
111
- publishedAt: status === "published" && !publishedAt
104
+ title: draft.title,
105
+ slug: draft.slug || toSlug(draft.title),
106
+ excerpt: draft.excerpt,
107
+ content: draft.content,
108
+ coverImage: draft.coverImage || undefined,
109
+ youtubeId: draft.youtubeId || undefined,
110
+ category: draft.category,
111
+ tags: draft.tags,
112
+ status: draft.status,
113
+ isFeatured: draft.isFeatured,
114
+ authorName: draft.authorName,
115
+ publishedAt: draft.status === "published" && !draft.publishedAt
112
116
  ? new Date().toISOString()
113
- : publishedAt
114
- ? new Date(publishedAt).toISOString()
117
+ : draft.publishedAt
118
+ ? new Date(draft.publishedAt).toISOString()
115
119
  : undefined,
116
- metaTitle: metaTitle || undefined,
117
- metaDescription: metaDescription || undefined,
120
+ metaTitle: draft.metaTitle || undefined,
121
+ metaDescription: draft.metaDescription || undefined,
118
122
  };
119
123
  if (isEdit) {
120
124
  return apiClient.patch(ADMIN_ENDPOINTS.BLOG_BY_ID(postId), payload);
@@ -122,7 +126,7 @@ export function AdminBlogEditorView({ postId, onSaved, onDeleted, embedded, ...r
122
126
  return apiClient.post(ADMIN_ENDPOINTS.BLOG, {
123
127
  ...payload,
124
128
  authorId: "admin",
125
- readTimeMinutes: Math.max(1, Math.round(content.replace(/<[^>]*>/g, "").split(/\s+/).length / 200)),
129
+ readTimeMinutes: Math.max(1, Math.round(draft.content.replace(/<[^>]*>/g, "").split(/\s+/).filter(Boolean).length / 200)),
126
130
  views: 0,
127
131
  });
128
132
  },
@@ -146,26 +150,49 @@ export function AdminBlogEditorView({ postId, onSaved, onDeleted, embedded, ...r
146
150
  },
147
151
  onError: (err) => showToast(err?.message ?? "Failed to delete post.", "error"),
148
152
  });
149
- const isSubmitting = saveMutation.isPending || postQuery.isLoading;
150
- const canSave = Boolean(title);
151
- const formSection = (_jsx(FormShellContext.Provider, { value: shellCtx, children: _jsxs(Form, { onSubmit: (e) => {
152
- e.preventDefault();
153
- clearErrors();
154
- if (!title.trim()) {
155
- setFieldError("title", "Title is required");
156
- return;
157
- }
158
- saveMutation.mutate();
159
- }, className: "space-y-5", children: [_jsx(FieldInput, { name: "title", label: "Title", value: title, onChange: (v) => handleTitleChange(v), required: true, placeholder: "e.g. How to Grade Pok\u00E9mon Cards" }), _jsx(Input, { label: "Slug", value: slug, onChange: (e) => {
160
- setSlug(e.target.value);
161
- setSlugManual(true);
162
- }, placeholder: "blog-how-to-grade-pokemon-cards", helperText: "Auto-generated from title. Must start with 'blog-'." }), _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsx(Select, { label: "Category", options: CATEGORY_OPTIONS, value: category, onValueChange: (v) => setCategory(v) }), _jsx(Select, { label: "Status", options: STATUS_OPTIONS, value: status, onValueChange: (v) => setStatus(v) })] }), _jsx(Input, { label: "Excerpt", value: excerpt, onChange: (e) => setExcerpt(e.target.value), placeholder: "Short summary shown in listings and cards" }), _jsx(ImageUpload, { label: "Cover image", currentImage: coverImage, onUpload: (file) => upload(file, "blog", true, { type: "blog-cover", title: title || slug, category }), onChange: setCoverImage }), _jsxs("div", { className: "space-y-1", children: [_jsx(Text, { className: "text-sm font-medium text-zinc-700 dark:text-zinc-300", children: "Content" }), _jsx(RichTextEditor, { value: content, onChange: setContent, placeholder: "Write your article here...", minHeightClassName: "min-h-[320px]" })] }), _jsx(TagInput, { label: "Tags", value: tags, onChange: setTags, placeholder: "e.g. pokemon, grading, tcg" }), _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsx(Input, { label: "Author name", value: authorName, onChange: (e) => setAuthorName(e.target.value), placeholder: "Author display name" }), _jsx(Input, { label: "Publish date (optional)", value: publishedAt, onChange: (e) => setPublishedAt(e.target.value), type: "date", helperText: "Auto-set to now when publishing." })] }), _jsx(Toggle, { label: "Featured post", checked: isFeatured, onChange: setIsFeatured }), _jsx(Input, { label: "Meta title (optional)", value: metaTitle, onChange: (e) => setMetaTitle(e.target.value), placeholder: "Defaults to post title" }), _jsx(Input, { label: "Meta description (optional)", value: metaDescription, onChange: (e) => setMetaDescription(e.target.value), placeholder: "SEO description \u2014 max 160 chars", maxLength: 160 }), _jsxs("div", { className: "flex gap-3 pt-2", children: [_jsx(Button, { type: "submit", isLoading: isSubmitting, disabled: !canSave || isSubmitting, children: isEdit ? "Save changes" : "Create post" }), isEdit && (_jsx(Button, { type: "button", variant: "danger", isLoading: deleteMutation.isPending, onClick: () => {
163
- if (confirm("Delete this post? This cannot be undone.")) {
164
- deleteMutation.mutate();
165
- }
166
- }, children: "Delete post" }))] })] }, "blog-form") }));
153
+ const isLoading = saveMutation.isPending || postQuery.isLoading;
154
+ const steps = [
155
+ {
156
+ label: "Content",
157
+ validate: (values) => !values.title.trim() ? "Title is required" : null,
158
+ render: ({ values, onChange }) => (_jsxs("div", { className: "space-y-5", children: [_jsx(Heading, { level: 3, className: "mb-2", children: "Content" }), _jsx(Input, { label: "Title", value: values.title, onChange: (e) => {
159
+ const v = e.target.value;
160
+ onChange({ title: v, ...(!slugManual && { slug: toSlug(v) }) });
161
+ }, placeholder: "e.g. How to Grade Pok\u00E9mon Cards" }), _jsx(Input, { label: "Slug", value: values.slug, onChange: (e) => {
162
+ setSlugManual(true);
163
+ onChange({ slug: e.target.value });
164
+ }, placeholder: "blog-how-to-grade-pokemon-cards", helperText: "Auto-generated from title. Must start with 'blog-'." }), _jsx(Input, { label: "Excerpt", value: values.excerpt, onChange: (e) => onChange({ excerpt: e.target.value }), placeholder: "Short summary shown in listings and cards" }), _jsxs("div", { className: "space-y-1", children: [_jsx(Text, { className: "text-sm font-medium text-zinc-700 dark:text-zinc-300", children: "Content" }), _jsx(RichTextEditor, { value: values.content, onChange: (v) => onChange({ content: v }), placeholder: "Write your article here...", minHeightClassName: "min-h-[320px]" })] })] })),
165
+ },
166
+ {
167
+ label: "Media",
168
+ render: ({ values, onChange }) => (_jsxs("div", { className: "space-y-5", children: [_jsx(Heading, { level: 3, className: "mb-2", children: "Media" }), _jsx(ImageUpload, { label: "Cover Image", currentImage: values.coverImage, onUpload: (file) => upload(file, "blog", true, {
169
+ type: "blog-cover",
170
+ title: values.title || values.slug,
171
+ category: values.category,
172
+ }), onChange: (url) => onChange({ coverImage: url }) }), _jsx(Input, { label: "YouTube Video ID (optional)", value: values.youtubeId, onChange: (e) => onChange({ youtubeId: e.target.value }), placeholder: "e.g. dQw4w9WgXcQ", helperText: "The 11-character video ID from the YouTube URL." })] })),
173
+ },
174
+ {
175
+ label: "SEO & Tags",
176
+ render: ({ values, onChange }) => {
177
+ const readTime = Math.max(1, Math.round(values.content.replace(/<[^>]*>/g, "").split(/\s+/).filter(Boolean).length / 200));
178
+ return (_jsxs("div", { className: "space-y-5", children: [_jsx(Heading, { level: 3, className: "mb-2", children: "SEO & Tags" }), _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsx(Select, { label: "Category", options: CATEGORY_OPTIONS, value: values.category, onValueChange: (v) => onChange({ category: v }) }), _jsxs(Div, { children: [_jsx(Text, { className: "text-sm font-medium mb-1.5", children: "Estimated Read Time" }), _jsxs(Text, { className: "text-sm text-[var(--appkit-color-text-muted)]", children: ["~", readTime, " min (auto-calculated from content)"] })] })] }), _jsx(TagInput, { label: "Tags", value: values.tags, onChange: (t) => onChange({ tags: t }), placeholder: "e.g. pokemon, grading, tcg" }), _jsx(Input, { label: "Meta Title (optional)", value: values.metaTitle, onChange: (e) => onChange({ metaTitle: e.target.value }), placeholder: "Defaults to post title" }), _jsx(Input, { label: "Meta Description (optional)", value: values.metaDescription, onChange: (e) => onChange({ metaDescription: e.target.value }), placeholder: "SEO description \u2014 max 160 chars", maxLength: 160 })] }));
179
+ },
180
+ },
181
+ {
182
+ label: "Publish",
183
+ render: ({ values, onChange }) => (_jsxs("div", { className: "space-y-5", children: [_jsx(Heading, { level: 3, className: "mb-2", children: "Publish Settings" }), _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsx(Select, { label: "Status", options: STATUS_OPTIONS, value: values.status, onValueChange: (v) => onChange({ status: v }) }), _jsx(Input, { label: "Publish date (optional)", value: values.publishedAt, onChange: (e) => onChange({ publishedAt: e.target.value }), type: "date", helperText: "Auto-set to now when publishing." })] }), _jsx(Input, { label: "Author Name", value: values.authorName, onChange: (e) => onChange({ authorName: e.target.value }), placeholder: "Author display name" }), _jsx(Toggle, { label: "Featured post", checked: values.isFeatured, onChange: (checked) => onChange({ isFeatured: checked }) }), isEdit && (_jsx("div", { className: "pt-4 border-t border-[var(--appkit-color-border)]", children: _jsx(Button, { type: "button", variant: "danger", size: "sm", onClick: () => setShowDeleteConfirm(true), isLoading: deleteMutation.isPending, children: "Delete post" }) }))] })),
184
+ },
185
+ ];
186
+ const deleteModal = (_jsx(ConfirmDeleteModal, { isOpen: showDeleteConfirm, onConfirm: () => {
187
+ setShowDeleteConfirm(false);
188
+ deleteMutation.mutate();
189
+ }, onClose: () => setShowDeleteConfirm(false), title: "Delete post", message: "This will permanently delete the blog post. This cannot be undone." }));
190
+ const formContent = (_jsxs(_Fragment, { children: [_jsx(StepForm, { steps: steps, values: draft, onChange: update, onComplete: () => { saveMutation.mutate(); }, formId: "admin-blog", currentStep: currentStep, onStepChange: setCurrentStep, completeLabel: isEdit ? "Save Changes" : "Create Post", isLoading: isLoading }), deleteModal] }));
167
191
  if (embedded) {
168
- return _jsx("div", { className: "overflow-y-auto p-4", children: formSection });
192
+ return _jsx("div", { className: "overflow-y-auto p-4", children: formContent });
169
193
  }
170
- return (_jsx(StackedViewShell, { portal: "admin", ...rest, title: isEdit ? "Edit Post" : "New Blog Post", sections: [formSection] }));
194
+ const previewSection = (_jsxs("div", { className: "rounded-lg border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface-raised)] p-5 max-h-[calc(100vh-12rem)] overflow-y-auto", children: [_jsx("div", { className: "flex items-center gap-2 mb-3 text-xs font-semibold uppercase tracking-wide text-[var(--appkit-color-text-muted)]", children: _jsx("span", { children: "Live preview" }) }), draft.coverImage ? (_jsx("img", { src: draft.coverImage, alt: "", className: "w-full rounded-md mb-4 object-cover max-h-64" })) : null, _jsx(Heading, { level: 1, className: "text-2xl font-bold mb-1", children: draft.title || "Untitled post" }), _jsxs(Text, { className: "text-xs text-[var(--appkit-color-text-muted)] mb-4", children: [draft.authorName || "Anonymous", draft.category ? ` · ${draft.category}` : ""] }), draft.excerpt ? (_jsx(Text, { className: "italic text-[var(--appkit-color-text-secondary)] mb-4", children: draft.excerpt })) : null, _jsx(RichTextRenderer, { html: draft.content || "<em>No content yet…</em>" }), draft.tags.length > 0 ? (_jsx("div", { className: "mt-6 flex flex-wrap gap-1.5", children: draft.tags.map((t) => (_jsxs("span", { className: "px-2 py-0.5 rounded-full bg-[var(--appkit-color-surface)] border border-[var(--appkit-color-border)] text-xs", children: ["#", t] }, t))) })) : null] }, "preview"));
195
+ return (_jsx(StackedViewShell, { portal: "admin", ...rest, title: isEdit ? "Edit Post" : "New Blog Post", sections: [
196
+ _jsxs("div", { className: "lg:grid lg:grid-cols-[3fr_2fr] lg:gap-6", children: [_jsx("div", { children: formContent }), _jsx("div", { className: "mt-6 lg:mt-0 lg:sticky lg:top-4 lg:self-start", children: previewSection })] }, "split"),
197
+ ] }));
171
198
  }