storefront-layouts 1.0.1 → 1.0.4

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 (509) hide show
  1. package/dist/components/auth/LoginForm.js +2 -2
  2. package/dist/components/auth/LoginSheet.js +2 -2
  3. package/dist/components/auth/login-form-core.js +3 -3
  4. package/dist/components/auth/login-sheet-header.js +3 -3
  5. package/dist/components/auth/login-sheet-registry.js +2 -2
  6. package/dist/components/auth/login-sheet-themes/booking-agenda.theme.js +1 -1
  7. package/dist/components/auth/login-sheet-themes/booking.theme.js +1 -1
  8. package/dist/components/auth/login-sheet-themes/clothing-minimal.theme.js +1 -1
  9. package/dist/components/auth/login-sheet-themes/clothing.theme.js +1 -1
  10. package/dist/components/auth/login-sheet-themes/electronics-grid.theme.js +1 -1
  11. package/dist/components/auth/login-sheet-themes/electronics.theme.js +1 -1
  12. package/dist/components/auth/login-sheet-themes/food-modern.theme.js +1 -1
  13. package/dist/components/auth/login-sheet-themes/food.theme.js +1 -1
  14. package/dist/components/auth/login-sheet-themes/index.js +9 -9
  15. package/dist/components/auth/login-sheet-themes/motivational-speaker.theme.js +1 -1
  16. package/dist/components/auth/login-sheet-themes/theme-input-baselines.d.ts +2 -2
  17. package/dist/components/auth/login-sheet-themes/theme-input-baselines.d.ts.map +1 -1
  18. package/dist/components/auth/login-sheet-themes/theme-input-baselines.js +2 -2
  19. package/dist/components/auth/login-sheets/StoreLoginSheetShell.d.ts.map +1 -1
  20. package/dist/components/auth/login-sheets/StoreLoginSheetShell.js +6 -6
  21. package/dist/components/auth/use-login-submit.js +3 -3
  22. package/dist/components/cart/InventoryHoldCountdown.js +2 -2
  23. package/dist/components/categories/category-masonry-grid.js +3 -3
  24. package/dist/components/checkout/CheckoutFeeLines.js +1 -1
  25. package/dist/components/checkout/ShippingOptionsPanel.js +3 -3
  26. package/dist/components/learning/CertificateTemplates.js +2 -2
  27. package/dist/components/learning/CertificateViewer.js +3 -3
  28. package/dist/components/learning/MentorshipProgress.d.ts.map +1 -1
  29. package/dist/components/learning/MentorshipProgress.js +4 -4
  30. package/dist/components/product/ProductVariationSelectors.js +1 -1
  31. package/dist/components/rich-text/CategoryDescription.js +2 -2
  32. package/dist/components/rich-text/ProductDescription.js +2 -2
  33. package/dist/components/rich-text/RichTextExcerpt.js +1 -1
  34. package/dist/components/rich-text/SafeRichHtml.d.ts +8 -11
  35. package/dist/components/rich-text/SafeRichHtml.d.ts.map +1 -1
  36. package/dist/components/rich-text/SafeRichHtml.js +3 -5
  37. package/dist/components/shipping/ProductDeliveryInfoSection.d.ts.map +1 -1
  38. package/dist/components/shipping/ProductDeliveryInfoSection.js +7 -4
  39. package/dist/components/shipping/ShippingQuoteAddressForm.js +3 -3
  40. package/dist/components/ui/alert-modal.js +2 -2
  41. package/dist/components/ui/avatar-image.js +1 -1
  42. package/dist/components/ui/badge.js +1 -1
  43. package/dist/components/ui/breadcrumbs.js +1 -1
  44. package/dist/components/ui/button.d.ts +1 -1
  45. package/dist/components/ui/button.js +1 -1
  46. package/dist/components/ui/card.js +1 -1
  47. package/dist/components/ui/category-tree.js +2 -2
  48. package/dist/components/ui/checkout-button.d.ts.map +1 -1
  49. package/dist/components/ui/checkout-button.js +11 -283
  50. package/dist/components/ui/guest-checkout-modal.js +3 -3
  51. package/dist/components/ui/image-skeleton.js +2 -2
  52. package/dist/components/ui/image-with-fallback.d.ts +3 -1
  53. package/dist/components/ui/image-with-fallback.d.ts.map +1 -1
  54. package/dist/components/ui/image-with-fallback.js +55 -139
  55. package/dist/components/ui/input.js +1 -1
  56. package/dist/components/ui/limited-time-offer-badge.js +2 -2
  57. package/dist/components/ui/loading-skeleton-wrapper.js +1 -1
  58. package/dist/components/ui/modal.js +2 -2
  59. package/dist/components/ui/otp-input.js +1 -1
  60. package/dist/components/ui/out-of-stock-overlay.js +1 -1
  61. package/dist/components/ui/page-animate-wrapper.js +2 -2
  62. package/dist/components/ui/page-content-loader.js +2 -2
  63. package/dist/components/ui/page-loader.js +1 -1
  64. package/dist/components/ui/product-card.d.ts.map +1 -1
  65. package/dist/components/ui/product-card.js +17 -17
  66. package/dist/components/ui/product-rating.js +1 -1
  67. package/dist/components/ui/product-stock-badge.js +2 -2
  68. package/dist/components/ui/review-form.js +2 -2
  69. package/dist/components/ui/route-skeleton-loader.js +6 -6
  70. package/dist/components/ui/sheet.d.ts +2 -1
  71. package/dist/components/ui/sheet.d.ts.map +1 -1
  72. package/dist/components/ui/sheet.js +4 -4
  73. package/dist/components/ui/skeleton.js +1 -1
  74. package/dist/components/ui/skeletons/index.js +5 -5
  75. package/dist/components/ui/skeletons/product-grid-skeleton.js +1 -1
  76. package/dist/components/ui/store-logos.d.ts.map +1 -1
  77. package/dist/components/ui/store-logos.js +4 -4
  78. package/dist/components/ui/toast.js +1 -1
  79. package/dist/components/ui/video-player.js +2 -2
  80. package/dist/editor/alignment-schemas/booking.js +1 -1
  81. package/dist/editor/alignment-schemas/clothing-minimal.js +1 -1
  82. package/dist/editor/alignment-schemas/index.js +20 -20
  83. package/dist/editor/alignment-schemas/lazy-loader.js +1 -1
  84. package/dist/editor/alignment-schemas/metadata.js +1 -1
  85. package/dist/editor/alignment-schemas/resolve-canvas-inspector-leaf.js +3 -3
  86. package/dist/editor/blocks/index.js +3 -3
  87. package/dist/editor/blocks/migrate-clothing-minimal.js +3 -3
  88. package/dist/editor/blocks/nav-outline-utils.js +2 -2
  89. package/dist/editor/blocks/registry.js +1 -1
  90. package/dist/editor/document/adapter.js +4 -4
  91. package/dist/editor/document/block-tree.js +1 -1
  92. package/dist/editor/document/index.js +6 -6
  93. package/dist/editor/document/validate.js +1 -1
  94. package/dist/editor/index.js +12 -12
  95. package/dist/editor/layout-content-loader.js +3 -3
  96. package/dist/editor/payaza-form/ArrayItemManager.js +2 -2
  97. package/dist/editor/payaza-form/EditorCanvasPreview.js +5 -5
  98. package/dist/editor/payaza-form/FieldRenderer.js +17 -17
  99. package/dist/editor/payaza-form/IframePreviewMessageBridge.js +3 -3
  100. package/dist/editor/payaza-form/PayazaFormEditor.js +31 -31
  101. package/dist/editor/payaza-form/PayazaFormEditorFullPage.js +2 -2
  102. package/dist/editor/payaza-form/SliderArrayEditor.js +3 -3
  103. package/dist/editor/payaza-form/components/ArrayField.js +1 -1
  104. package/dist/editor/payaza-form/components/BlockStylesInspector.js +1 -1
  105. package/dist/editor/payaza-form/components/BlocksField.js +9 -9
  106. package/dist/editor/payaza-form/components/ButtonField.js +3 -3
  107. package/dist/editor/payaza-form/components/CanvasGranularInspector.js +11 -11
  108. package/dist/editor/payaza-form/components/IconField.js +2 -2
  109. package/dist/editor/payaza-form/components/ImageField.js +1 -1
  110. package/dist/editor/payaza-form/components/NumberField.js +1 -1
  111. package/dist/editor/payaza-form/components/RichTextField.js +2 -2
  112. package/dist/editor/payaza-form/components/SectionField.js +1 -1
  113. package/dist/editor/payaza-form/components/SectionSchemaInspector.js +3 -3
  114. package/dist/editor/payaza-form/components/StarRatingField.js +2 -2
  115. package/dist/editor/payaza-form/components/TextField.js +1 -1
  116. package/dist/editor/payaza-form/data-merger.js +6 -6
  117. package/dist/editor/payaza-form/data-transformer.js +3 -3
  118. package/dist/editor/payaza-form/engine.js +1 -1
  119. package/dist/editor/payaza-form/examples/custom-widgets.example.js +1 -1
  120. package/dist/editor/payaza-form/index.js +8 -8
  121. package/dist/editor/payaza-form/layout-loader.js +2 -2
  122. package/dist/editor/payaza-form/preview-message-handler.js +3 -3
  123. package/dist/editor/payaza-form/schema-bridge.js +3 -3
  124. package/dist/editor/payaza-form/widget-registry.js +1 -1
  125. package/dist/editor/shared/BlockOutlineTree.js +2 -2
  126. package/dist/editor/shared/EditorHeader.js +2 -2
  127. package/dist/editor/shared/EditorNavigator.js +2 -2
  128. package/dist/editor/shared/IframePreview.js +6 -6
  129. package/dist/editor/shared/InlineCanvasPreview.js +8 -8
  130. package/dist/editor/shared/LayoutRenderer.js +1 -1
  131. package/dist/editor/shared/ResizableSidebar.js +1 -1
  132. package/dist/editor/shared/index.js +7 -7
  133. package/dist/hooks/use-analytics.js +3 -3
  134. package/dist/hooks/use-api.js +1 -1
  135. package/dist/hooks/use-cart-api.d.ts.map +1 -1
  136. package/dist/hooks/use-cart-api.js +8 -3
  137. package/dist/hooks/use-catalog-loader.js +3 -3
  138. package/dist/hooks/use-catalog-price-range.d.ts +2 -5
  139. package/dist/hooks/use-catalog-price-range.d.ts.map +1 -1
  140. package/dist/hooks/use-catalog-price-range.js +20 -5
  141. package/dist/hooks/use-category-products.d.ts +8 -0
  142. package/dist/hooks/use-category-products.d.ts.map +1 -0
  143. package/dist/hooks/use-category-products.js +43 -0
  144. package/dist/hooks/use-checkout-fees.d.ts +3 -4
  145. package/dist/hooks/use-checkout-fees.d.ts.map +1 -1
  146. package/dist/hooks/use-checkout-fees.js +1 -1
  147. package/dist/hooks/use-content-ready.js +1 -1
  148. package/dist/hooks/use-featured-products.d.ts +3 -0
  149. package/dist/hooks/use-featured-products.d.ts.map +1 -0
  150. package/dist/hooks/use-featured-products.js +25 -0
  151. package/dist/hooks/use-multi-store-checkout-fees.d.ts +3 -4
  152. package/dist/hooks/use-multi-store-checkout-fees.d.ts.map +1 -1
  153. package/dist/hooks/use-multi-store-checkout-fees.js +1 -1
  154. package/dist/hooks/use-navigation-loading.js +1 -1
  155. package/dist/hooks/use-payaza-checkout.d.ts +1 -1
  156. package/dist/hooks/use-payaza-checkout.d.ts.map +1 -1
  157. package/dist/hooks/use-payaza-checkout.js +9 -3
  158. package/dist/hooks/use-product-brands.d.ts +5 -0
  159. package/dist/hooks/use-product-brands.d.ts.map +1 -0
  160. package/dist/hooks/use-product-brands.js +25 -0
  161. package/dist/hooks/use-product-by-slug.d.ts +7 -0
  162. package/dist/hooks/use-product-by-slug.d.ts.map +1 -0
  163. package/dist/hooks/use-product-by-slug.js +38 -0
  164. package/dist/hooks/use-product-reviews.d.ts +15 -0
  165. package/dist/hooks/use-product-reviews.d.ts.map +1 -0
  166. package/dist/hooks/use-product-reviews.js +75 -0
  167. package/dist/hooks/use-product-variation-selection.d.ts +2 -8
  168. package/dist/hooks/use-product-variation-selection.d.ts.map +1 -1
  169. package/dist/hooks/use-product-variation-selection.js +1 -1
  170. package/dist/hooks/use-products-api.js +3 -3
  171. package/dist/hooks/use-shipping-quote.js +2 -2
  172. package/dist/hooks/use-store-api.js +4 -4
  173. package/dist/hooks/usePreviewSlideSync.js +1 -1
  174. package/dist/index.d.ts +62 -74
  175. package/dist/index.d.ts.map +1 -1
  176. package/dist/index.js +141 -153
  177. package/dist/layouts/booking/components/BookingHomePage.d.ts.map +1 -1
  178. package/dist/layouts/booking/components/BookingHomePage.js +68 -74
  179. package/dist/layouts/booking/components/BookingMultilineHeading.js +1 -1
  180. package/dist/layouts/booking/components/BookingTestimonialCard.js +2 -2
  181. package/dist/layouts/booking/components/BookingTestimonialsEmptyState.js +1 -1
  182. package/dist/layouts/booking/components/booking-footer-defaults.js +2 -2
  183. package/dist/layouts/booking/index.js +8 -8
  184. package/dist/layouts/booking/pages/AboutPage.d.ts +1 -1
  185. package/dist/layouts/booking/pages/AboutPage.d.ts.map +1 -1
  186. package/dist/layouts/booking/pages/AboutPage.js +39 -60
  187. package/dist/layouts/booking/pages/BookPage.d.ts.map +1 -1
  188. package/dist/layouts/booking/pages/BookPage.js +16 -22
  189. package/dist/layouts/booking/pages/CategoriesPage.js +6 -6
  190. package/dist/layouts/booking/pages/CategoryPage.d.ts +1 -1
  191. package/dist/layouts/booking/pages/CategoryPage.d.ts.map +1 -1
  192. package/dist/layouts/booking/pages/CategoryPage.js +17 -26
  193. package/dist/layouts/booking/pages/ContactPage.d.ts +1 -1
  194. package/dist/layouts/booking/pages/ContactPage.d.ts.map +1 -1
  195. package/dist/layouts/booking/pages/ContactPage.js +5 -12
  196. package/dist/layouts/booking/pages/ProductDetailPage.d.ts +1 -1
  197. package/dist/layouts/booking/pages/ProductDetailPage.d.ts.map +1 -1
  198. package/dist/layouts/booking/pages/ProductDetailPage.js +203 -150
  199. package/dist/layouts/booking/pages/ServicesPage.d.ts +1 -1
  200. package/dist/layouts/booking/pages/ServicesPage.d.ts.map +1 -1
  201. package/dist/layouts/booking/pages/ServicesPage.js +11 -31
  202. package/dist/layouts/booking-agenda/components/BookingHomePageAgenda.d.ts.map +1 -1
  203. package/dist/layouts/booking-agenda/components/BookingHomePageAgenda.js +21 -30
  204. package/dist/layouts/booking-agenda/index.js +8 -8
  205. package/dist/layouts/booking-agenda/pages/AboutPage.d.ts +1 -1
  206. package/dist/layouts/booking-agenda/pages/AboutPage.d.ts.map +1 -1
  207. package/dist/layouts/booking-agenda/pages/AboutPage.js +11 -14
  208. package/dist/layouts/booking-agenda/pages/BookPage.d.ts.map +1 -1
  209. package/dist/layouts/booking-agenda/pages/BookPage.js +15 -21
  210. package/dist/layouts/booking-agenda/pages/CategoriesPage.js +5 -5
  211. package/dist/layouts/booking-agenda/pages/CategoryPage.d.ts +1 -1
  212. package/dist/layouts/booking-agenda/pages/CategoryPage.d.ts.map +1 -1
  213. package/dist/layouts/booking-agenda/pages/CategoryPage.js +12 -18
  214. package/dist/layouts/booking-agenda/pages/ContactPage.d.ts +1 -1
  215. package/dist/layouts/booking-agenda/pages/ContactPage.d.ts.map +1 -1
  216. package/dist/layouts/booking-agenda/pages/ContactPage.js +8 -13
  217. package/dist/layouts/booking-agenda/pages/ProductDetailPage.d.ts +1 -1
  218. package/dist/layouts/booking-agenda/pages/ProductDetailPage.d.ts.map +1 -1
  219. package/dist/layouts/booking-agenda/pages/ProductDetailPage.js +202 -149
  220. package/dist/layouts/booking-agenda/pages/ServicesPage.d.ts +1 -1
  221. package/dist/layouts/booking-agenda/pages/ServicesPage.d.ts.map +1 -1
  222. package/dist/layouts/booking-agenda/pages/ServicesPage.js +8 -23
  223. package/dist/layouts/clothing/components/ClothingHomePage.d.ts.map +1 -1
  224. package/dist/layouts/clothing/components/ClothingHomePage.js +199 -136
  225. package/dist/layouts/clothing/index.js +7 -7
  226. package/dist/layouts/clothing/pages/AboutPage.d.ts +1 -1
  227. package/dist/layouts/clothing/pages/AboutPage.d.ts.map +1 -1
  228. package/dist/layouts/clothing/pages/AboutPage.js +19 -33
  229. package/dist/layouts/clothing/pages/CategoriesPage.js +8 -8
  230. package/dist/layouts/clothing/pages/CategoryPage.d.ts +1 -1
  231. package/dist/layouts/clothing/pages/CategoryPage.d.ts.map +1 -1
  232. package/dist/layouts/clothing/pages/CategoryPage.js +15 -41
  233. package/dist/layouts/clothing/pages/ContactPage.d.ts +1 -1
  234. package/dist/layouts/clothing/pages/ContactPage.d.ts.map +1 -1
  235. package/dist/layouts/clothing/pages/ContactPage.js +5 -8
  236. package/dist/layouts/clothing/pages/ProductDetailPage.d.ts +1 -1
  237. package/dist/layouts/clothing/pages/ProductDetailPage.d.ts.map +1 -1
  238. package/dist/layouts/clothing/pages/ProductDetailPage.js +256 -167
  239. package/dist/layouts/clothing/pages/ProductsPage.d.ts +1 -1
  240. package/dist/layouts/clothing/pages/ProductsPage.d.ts.map +1 -1
  241. package/dist/layouts/clothing/pages/ProductsPage.js +125 -59
  242. package/dist/layouts/clothing/payaza-bindings.js +2 -2
  243. package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.d.ts.map +1 -1
  244. package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.js +32 -131
  245. package/dist/layouts/clothing-minimal/components/clothing-minimal-block-render.js +8 -8
  246. package/dist/layouts/clothing-minimal/index.js +7 -7
  247. package/dist/layouts/clothing-minimal/pages/AboutPage.d.ts +1 -1
  248. package/dist/layouts/clothing-minimal/pages/AboutPage.d.ts.map +1 -1
  249. package/dist/layouts/clothing-minimal/pages/AboutPage.js +37 -61
  250. package/dist/layouts/clothing-minimal/pages/CategoriesPage.js +7 -7
  251. package/dist/layouts/clothing-minimal/pages/CategoryPage.d.ts +1 -1
  252. package/dist/layouts/clothing-minimal/pages/CategoryPage.d.ts.map +1 -1
  253. package/dist/layouts/clothing-minimal/pages/CategoryPage.js +13 -18
  254. package/dist/layouts/clothing-minimal/pages/ContactPage.d.ts +1 -1
  255. package/dist/layouts/clothing-minimal/pages/ContactPage.d.ts.map +1 -1
  256. package/dist/layouts/clothing-minimal/pages/ContactPage.js +5 -8
  257. package/dist/layouts/clothing-minimal/pages/ProductDetailPage.d.ts +1 -1
  258. package/dist/layouts/clothing-minimal/pages/ProductDetailPage.d.ts.map +1 -1
  259. package/dist/layouts/clothing-minimal/pages/ProductDetailPage.js +202 -143
  260. package/dist/layouts/clothing-minimal/pages/ProductsPage.d.ts +1 -1
  261. package/dist/layouts/clothing-minimal/pages/ProductsPage.d.ts.map +1 -1
  262. package/dist/layouts/clothing-minimal/pages/ProductsPage.js +126 -57
  263. package/dist/layouts/electronics/components/ElectronicsCategoriesPage.js +7 -7
  264. package/dist/layouts/electronics/components/ElectronicsGridProductCard.js +10 -10
  265. package/dist/layouts/electronics/components/ElectronicsHomePage.d.ts.map +1 -1
  266. package/dist/layouts/electronics/components/ElectronicsHomePage.js +29 -31
  267. package/dist/layouts/electronics/components/ElectronicsPageWrapper.js +4 -4
  268. package/dist/layouts/electronics/components/ElectronicsProductsPage.d.ts.map +1 -1
  269. package/dist/layouts/electronics/components/ElectronicsProductsPage.js +81 -23
  270. package/dist/layouts/electronics/components/ElectronicsStoreFooter.js +2 -2
  271. package/dist/layouts/electronics/components/ElectronicsStoreHeader.js +6 -6
  272. package/dist/layouts/electronics/index.js +18 -18
  273. package/dist/layouts/electronics/pages/AboutPage.d.ts +1 -1
  274. package/dist/layouts/electronics/pages/AboutPage.d.ts.map +1 -1
  275. package/dist/layouts/electronics/pages/AboutPage.js +11 -14
  276. package/dist/layouts/electronics/pages/CategoriesPage.js +1 -1
  277. package/dist/layouts/electronics/pages/CategoryPage.d.ts +1 -1
  278. package/dist/layouts/electronics/pages/CategoryPage.d.ts.map +1 -1
  279. package/dist/layouts/electronics/pages/CategoryPage.js +14 -20
  280. package/dist/layouts/electronics/pages/ContactPage.d.ts +1 -1
  281. package/dist/layouts/electronics/pages/ContactPage.d.ts.map +1 -1
  282. package/dist/layouts/electronics/pages/ContactPage.js +8 -13
  283. package/dist/layouts/electronics/pages/HelpCenterPage.js +1 -1
  284. package/dist/layouts/electronics/pages/PrivacyPolicyPage.js +1 -1
  285. package/dist/layouts/electronics/pages/ProductDetailPage.d.ts +1 -1
  286. package/dist/layouts/electronics/pages/ProductDetailPage.d.ts.map +1 -1
  287. package/dist/layouts/electronics/pages/ProductDetailPage.js +201 -142
  288. package/dist/layouts/electronics/pages/ProductsPage.d.ts +1 -1
  289. package/dist/layouts/electronics/pages/ProductsPage.d.ts.map +1 -1
  290. package/dist/layouts/electronics/pages/ProductsPage.js +119 -49
  291. package/dist/layouts/electronics/pages/TermsPage.js +1 -1
  292. package/dist/layouts/electronics/pages/TrackOrderPage.js +4 -4
  293. package/dist/layouts/electronics-grid/components/ElectronicsGridProductCard.js +10 -10
  294. package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.d.ts.map +1 -1
  295. package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.js +75 -33
  296. package/dist/layouts/electronics-grid/index.js +14 -14
  297. package/dist/layouts/electronics-grid/pages/AboutPage.d.ts +1 -1
  298. package/dist/layouts/electronics-grid/pages/AboutPage.d.ts.map +1 -1
  299. package/dist/layouts/electronics-grid/pages/AboutPage.js +11 -14
  300. package/dist/layouts/electronics-grid/pages/CategoriesPage.js +1 -1
  301. package/dist/layouts/electronics-grid/pages/CategoryPage.d.ts +1 -1
  302. package/dist/layouts/electronics-grid/pages/CategoryPage.d.ts.map +1 -1
  303. package/dist/layouts/electronics-grid/pages/CategoryPage.js +14 -20
  304. package/dist/layouts/electronics-grid/pages/ContactPage.d.ts +1 -1
  305. package/dist/layouts/electronics-grid/pages/ContactPage.d.ts.map +1 -1
  306. package/dist/layouts/electronics-grid/pages/ContactPage.js +8 -13
  307. package/dist/layouts/electronics-grid/pages/ElectronicsGridCategoriesPage.js +6 -6
  308. package/dist/layouts/electronics-grid/pages/HelpCenterPage.js +1 -1
  309. package/dist/layouts/electronics-grid/pages/PrivacyPolicyPage.js +1 -1
  310. package/dist/layouts/electronics-grid/pages/ProductDetailPage.d.ts +1 -1
  311. package/dist/layouts/electronics-grid/pages/ProductDetailPage.d.ts.map +1 -1
  312. package/dist/layouts/electronics-grid/pages/ProductDetailPage.js +201 -142
  313. package/dist/layouts/electronics-grid/pages/ProductsPage.d.ts +1 -1
  314. package/dist/layouts/electronics-grid/pages/ProductsPage.d.ts.map +1 -1
  315. package/dist/layouts/electronics-grid/pages/ProductsPage.js +121 -52
  316. package/dist/layouts/electronics-grid/pages/TermsPage.js +1 -1
  317. package/dist/layouts/electronics-grid/pages/TrackOrderPage.js +4 -4
  318. package/dist/layouts/food/components/FoodHomePage.d.ts.map +1 -1
  319. package/dist/layouts/food/components/FoodHomePage.js +44 -43
  320. package/dist/layouts/food/index.js +8 -8
  321. package/dist/layouts/food/pages/AboutPage.d.ts +1 -1
  322. package/dist/layouts/food/pages/AboutPage.d.ts.map +1 -1
  323. package/dist/layouts/food/pages/AboutPage.js +44 -45
  324. package/dist/layouts/food/pages/CategoriesPage.js +6 -6
  325. package/dist/layouts/food/pages/CategoryPage.d.ts +1 -1
  326. package/dist/layouts/food/pages/CategoryPage.d.ts.map +1 -1
  327. package/dist/layouts/food/pages/CategoryPage.js +23 -21
  328. package/dist/layouts/food/pages/ContactPage.d.ts +1 -1
  329. package/dist/layouts/food/pages/ContactPage.d.ts.map +1 -1
  330. package/dist/layouts/food/pages/ContactPage.js +5 -7
  331. package/dist/layouts/food/pages/MenuPage.d.ts +1 -1
  332. package/dist/layouts/food/pages/MenuPage.d.ts.map +1 -1
  333. package/dist/layouts/food/pages/MenuPage.js +81 -42
  334. package/dist/layouts/food/pages/ProductDetailPage.d.ts +1 -1
  335. package/dist/layouts/food/pages/ProductDetailPage.d.ts.map +1 -1
  336. package/dist/layouts/food/pages/ProductDetailPage.js +209 -171
  337. package/dist/layouts/food/pages/ProductsPage.d.ts +1 -1
  338. package/dist/layouts/food/pages/ProductsPage.d.ts.map +1 -1
  339. package/dist/layouts/food/pages/ProductsPage.js +130 -45
  340. package/dist/layouts/food-modern/components/FoodHomePageModern.js +10 -10
  341. package/dist/layouts/food-modern/index.js +8 -8
  342. package/dist/layouts/food-modern/pages/AboutPage.d.ts +1 -1
  343. package/dist/layouts/food-modern/pages/AboutPage.d.ts.map +1 -1
  344. package/dist/layouts/food-modern/pages/AboutPage.js +11 -14
  345. package/dist/layouts/food-modern/pages/CategoriesPage.js +5 -5
  346. package/dist/layouts/food-modern/pages/CategoryPage.d.ts +1 -1
  347. package/dist/layouts/food-modern/pages/CategoryPage.d.ts.map +1 -1
  348. package/dist/layouts/food-modern/pages/CategoryPage.js +23 -20
  349. package/dist/layouts/food-modern/pages/ContactPage.d.ts +1 -1
  350. package/dist/layouts/food-modern/pages/ContactPage.d.ts.map +1 -1
  351. package/dist/layouts/food-modern/pages/ContactPage.js +5 -7
  352. package/dist/layouts/food-modern/pages/MenuPage.d.ts +1 -1
  353. package/dist/layouts/food-modern/pages/MenuPage.d.ts.map +1 -1
  354. package/dist/layouts/food-modern/pages/MenuPage.js +81 -46
  355. package/dist/layouts/food-modern/pages/ProductDetailPage.d.ts +1 -1
  356. package/dist/layouts/food-modern/pages/ProductDetailPage.d.ts.map +1 -1
  357. package/dist/layouts/food-modern/pages/ProductDetailPage.js +202 -143
  358. package/dist/layouts/food-modern/pages/ProductsPage.d.ts +1 -1
  359. package/dist/layouts/food-modern/pages/ProductsPage.d.ts.map +1 -1
  360. package/dist/layouts/food-modern/pages/ProductsPage.js +117 -33
  361. package/dist/layouts/motivational-speaker/components/MotivationalHomePage.d.ts.map +1 -1
  362. package/dist/layouts/motivational-speaker/components/MotivationalHomePage.js +32 -23
  363. package/dist/layouts/motivational-speaker/components/MotivationalSpeakerPageWrapper.js +1 -1
  364. package/dist/layouts/motivational-speaker/index.js +9 -9
  365. package/dist/layouts/motivational-speaker/pages/AboutPage.d.ts +1 -1
  366. package/dist/layouts/motivational-speaker/pages/AboutPage.d.ts.map +1 -1
  367. package/dist/layouts/motivational-speaker/pages/AboutPage.js +6 -9
  368. package/dist/layouts/motivational-speaker/pages/CategoryPage.d.ts +1 -1
  369. package/dist/layouts/motivational-speaker/pages/CategoryPage.d.ts.map +1 -1
  370. package/dist/layouts/motivational-speaker/pages/CategoryPage.js +18 -22
  371. package/dist/layouts/motivational-speaker/pages/ContactPage.d.ts +1 -1
  372. package/dist/layouts/motivational-speaker/pages/ContactPage.d.ts.map +1 -1
  373. package/dist/layouts/motivational-speaker/pages/ContactPage.js +9 -13
  374. package/dist/layouts/motivational-speaker/pages/ProductsPage.d.ts +1 -1
  375. package/dist/layouts/motivational-speaker/pages/ProductsPage.d.ts.map +1 -1
  376. package/dist/layouts/motivational-speaker/pages/ProductsPage.js +121 -52
  377. package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.d.ts +1 -1
  378. package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.d.ts.map +1 -1
  379. package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.js +15 -24
  380. package/dist/layouts/motivational-speaker/pages/ServicesPage.d.ts +1 -1
  381. package/dist/layouts/motivational-speaker/pages/ServicesPage.d.ts.map +1 -1
  382. package/dist/layouts/motivational-speaker/pages/ServicesPage.js +8 -23
  383. package/dist/layouts/motivational-speaker/pages/SubscriptionPage.js +7 -7
  384. package/dist/layouts/shared/components/BaseStoreLayout.js +9 -9
  385. package/dist/layouts/shared/components/CartLineQuantityControl.js +1 -1
  386. package/dist/layouts/shared/components/GenericPageWrapper.js +3 -3
  387. package/dist/layouts/shared/components/ProductPriceFilterSection.js +4 -4
  388. package/dist/layouts/shared/components/PromoBanner.d.ts +1 -4
  389. package/dist/layouts/shared/components/PromoBanner.d.ts.map +1 -1
  390. package/dist/layouts/shared/components/PromoBanner.js +12 -8
  391. package/dist/layouts/shared/components/StoreFooter.js +10 -10
  392. package/dist/layouts/shared/components/StoreHeader.js +7 -7
  393. package/dist/layouts/shared/components/TestimonialCard.d.ts.map +1 -1
  394. package/dist/layouts/shared/components/TestimonialCard.js +2 -2
  395. package/dist/layouts/shared/components/headers/BookingAgendaSidebar.js +2 -2
  396. package/dist/layouts/shared/components/headers/ClothingMinimalHeader.js +11 -11
  397. package/dist/layouts/shared/components/headers/FoodModernHeader.js +7 -7
  398. package/dist/layouts/shared/index.js +22 -22
  399. package/dist/layouts/shared/pages/AccountPage.d.ts.map +1 -1
  400. package/dist/layouts/shared/pages/AccountPage.js +101 -27
  401. package/dist/layouts/shared/pages/CartPage.d.ts.map +1 -1
  402. package/dist/layouts/shared/pages/CartPage.js +39 -90
  403. package/dist/layouts/shared/pages/CheckoutPage.d.ts.map +1 -1
  404. package/dist/layouts/shared/pages/CheckoutPage.js +349 -868
  405. package/dist/layouts/shared/pages/CookiePolicyPage.js +1 -1
  406. package/dist/layouts/shared/pages/FeatureDisabledPage.js +1 -1
  407. package/dist/layouts/shared/pages/HelpCenterPage.js +1 -1
  408. package/dist/layouts/shared/pages/MaintenancePage.d.ts.map +1 -1
  409. package/dist/layouts/shared/pages/MaintenancePage.js +2 -3
  410. package/dist/layouts/shared/pages/PortfolioPage.d.ts.map +1 -1
  411. package/dist/layouts/shared/pages/PortfolioPage.js +2 -2
  412. package/dist/layouts/shared/pages/PrivacyPolicyPage.js +1 -1
  413. package/dist/layouts/shared/pages/SizeGuidePage.js +1 -1
  414. package/dist/layouts/shared/pages/StyleGuidePage.js +3 -3
  415. package/dist/layouts/shared/pages/TeamPage.d.ts.map +1 -1
  416. package/dist/layouts/shared/pages/TeamPage.js +1 -1
  417. package/dist/layouts/shared/pages/TermsPage.js +1 -1
  418. package/dist/layouts/shared/pages/TrackOrderPage.js +4 -4
  419. package/dist/layouts/shared/pages/WishlistPage.d.ts.map +1 -1
  420. package/dist/layouts/shared/pages/WishlistPage.js +44 -29
  421. package/dist/layouts/shared/wrappers/BookingAgendaLayout.d.ts.map +1 -1
  422. package/dist/layouts/shared/wrappers/BookingAgendaLayout.js +80 -35
  423. package/dist/layouts/shared/wrappers/ClothingLayout.js +8 -8
  424. package/dist/layouts/shared/wrappers/ClothingMinimalLayout.js +7 -7
  425. package/dist/layouts/shared/wrappers/ElectronicsLayout.js +5 -5
  426. package/dist/layouts/shared/wrappers/FoodModernLayout.js +6 -6
  427. package/dist/layouts/shared/wrappers/MotivationalLayout.js +9 -9
  428. package/dist/layouts/shared/wrappers/StandardLayout.js +8 -8
  429. package/dist/lib/api.d.ts +3 -4
  430. package/dist/lib/api.d.ts.map +1 -1
  431. package/dist/lib/api.js +69 -109
  432. package/dist/lib/auth-context.js +2 -2
  433. package/dist/lib/content-selectors.d.ts +1 -1
  434. package/dist/lib/content-selectors.d.ts.map +1 -1
  435. package/dist/lib/content-selectors.js +8 -0
  436. package/dist/lib/layout-config-hydration.js +2 -2
  437. package/dist/lib/loading-context.d.ts.map +1 -1
  438. package/dist/lib/loading-context.js +11 -21
  439. package/dist/lib/payaza-checkout.d.ts.map +1 -1
  440. package/dist/lib/payaza-checkout.js +2 -4
  441. package/dist/lib/payaza-public-key.d.ts +6 -0
  442. package/dist/lib/payaza-public-key.d.ts.map +1 -0
  443. package/dist/lib/payaza-public-key.js +10 -0
  444. package/dist/lib/rich-html.d.ts +31 -26
  445. package/dist/lib/rich-html.d.ts.map +1 -1
  446. package/dist/lib/rich-html.js +1 -0
  447. package/dist/lib/services/analytics.service.js +1 -1
  448. package/dist/lib/services/auth.service.js +1 -1
  449. package/dist/lib/services/booking.service.js +1 -1
  450. package/dist/lib/services/category.service.js +1 -1
  451. package/dist/lib/services/checkout.service.d.ts +3 -0
  452. package/dist/lib/services/checkout.service.d.ts.map +1 -1
  453. package/dist/lib/services/checkout.service.js +1 -1
  454. package/dist/lib/services/contact.service.js +1 -1
  455. package/dist/lib/services/customer.service.js +1 -1
  456. package/dist/lib/services/fees.service.d.ts +17 -63
  457. package/dist/lib/services/fees.service.d.ts.map +1 -1
  458. package/dist/lib/services/fees.service.js +4 -138
  459. package/dist/lib/services/index.js +13 -13
  460. package/dist/lib/services/location.service.js +1 -1
  461. package/dist/lib/services/order.service.js +1 -1
  462. package/dist/lib/services/payment.service.js +1 -1
  463. package/dist/lib/services/product.service.d.ts +7 -2
  464. package/dist/lib/services/product.service.d.ts.map +1 -1
  465. package/dist/lib/services/product.service.js +13 -1
  466. package/dist/lib/services/promo.service.js +1 -1
  467. package/dist/lib/services/review.service.js +1 -1
  468. package/dist/lib/services/service.service.js +1 -1
  469. package/dist/lib/services/shipping.service.js +1 -1
  470. package/dist/lib/services/store.service.js +1 -1
  471. package/dist/lib/store-config-utils.d.ts +1 -10
  472. package/dist/lib/store-config-utils.d.ts.map +1 -1
  473. package/dist/lib/store-config-utils.js +73 -261
  474. package/dist/lib/store-config.js +1 -1
  475. package/dist/lib/store-context.d.ts +1 -23
  476. package/dist/lib/store-context.d.ts.map +1 -1
  477. package/dist/lib/store-context.js +89 -111
  478. package/dist/lib/store-types.d.ts +9 -91
  479. package/dist/lib/store-types.d.ts.map +1 -1
  480. package/dist/lib/utils/asset-helpers.js +1 -1
  481. package/dist/lib/utils/catalog-price-bounds.d.ts +16 -6
  482. package/dist/lib/utils/catalog-price-bounds.d.ts.map +1 -1
  483. package/dist/lib/utils/catalog-price-bounds.js +58 -14
  484. package/dist/lib/utils/category-tree.d.ts +9 -0
  485. package/dist/lib/utils/category-tree.d.ts.map +1 -1
  486. package/dist/lib/utils/category-tree.js +26 -0
  487. package/dist/lib/utils/editor-preview.d.ts +5 -0
  488. package/dist/lib/utils/editor-preview.d.ts.map +1 -1
  489. package/dist/lib/utils/editor-preview.js +17 -3
  490. package/dist/lib/utils/fee-calculations.d.ts +5 -1
  491. package/dist/lib/utils/fee-calculations.d.ts.map +1 -1
  492. package/dist/lib/utils/fee-calculations.js +28 -31
  493. package/dist/lib/utils/index.d.ts +1 -1
  494. package/dist/lib/utils/index.d.ts.map +1 -1
  495. package/dist/lib/utils/index.js +4 -4
  496. package/dist/lib/utils/product-images.js +1 -1
  497. package/dist/lib/utils/product-share.js +1 -1
  498. package/dist/lib/utils/url-helpers.d.ts +6 -0
  499. package/dist/lib/utils/url-helpers.d.ts.map +1 -1
  500. package/dist/lib/utils/url-helpers.js +20 -4
  501. package/dist/preview/LayoutPreview.js +6 -6
  502. package/dist/preview/PreviewRouter.js +4 -4
  503. package/dist/preview/canvas/PreviewCanvasEnhancer.js +8 -8
  504. package/dist/preview/canvas/preview-flush-await.js +1 -1
  505. package/dist/preview/canvas/preview-isolation.js +1 -1
  506. package/dist/preview/canvas/preview-route.js +2 -2
  507. package/dist/preview/index.js +5 -5
  508. package/dist/styles/index.css +190 -149
  509. package/package.json +31 -43
@@ -3,23 +3,27 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
3
3
  import Link from 'next/link';
4
4
  import Image from 'next/image';
5
5
  import { useSearchParams, useRouter } from 'next/navigation';
6
- import { Store, User as UserIcon, Package, Settings, LogOut, Heart, Bell, Edit2, Check, Trash2, Lock, Calendar, Clock, Loader2, X, Camera, Truck } from 'lucide-react';
7
- import { Button } from '../../../components/ui/button.js';
8
- import { AvatarImage } from '../../../components/ui/avatar-image.js';
6
+ import { Store, User as UserIcon, Package, Settings, LogOut, Heart, Bell, Edit2, Check, Trash2, Lock, Calendar, Clock, Loader2, X, Camera, Truck, BookOpen, Play, ArrowRight, CheckCircle2 } from 'lucide-react';
7
+ import { Button } from '../../../components/ui/button';
8
+ import { motion } from 'framer-motion';
9
+ import { AvatarImage } from '../../../components/ui/avatar-image';
9
10
  import { useState, useEffect } from 'react';
10
- import { useAuth } from '../../../lib/auth-context.js';
11
- import { getStoreHomeUrl } from '../../../lib/layout-route-utils.js';
12
- import { cn, formatCurrency } from '../../../lib/utils/index.js';
11
+ import { useAuth } from '../../../lib/auth-context';
12
+ import { cn, formatCurrency } from '../../../lib/utils';
13
13
  // Note: orderService and wishlistService removed - these pages are shared and not editable in the editor
14
14
  // Using StoreContext for wishlist functionality instead
15
- import { bookingService } from '../../../lib/services/booking.service.js';
16
- import { customerService } from '../../../lib/services/customer.service.js';
17
- import { useStore } from '../../../lib/store-context.js';
18
- import { useToast } from '../../../components/ui/toast.js';
19
- import { useLoading } from '../../../lib/loading-context.js';
20
- import { formatDateSafe, getCurrentYear } from '../../../utils/date.js';
15
+ import { bookingService } from '../../../lib/services/booking.service';
16
+ import { customerService } from '../../../lib/services/customer.service';
17
+ import { useStore } from '../../../lib/store-context';
18
+ import { productService } from '../../../lib/services/product.service';
19
+ import { transformProductToStoreProduct } from '../../../lib/store-config-utils';
20
+ import { useToast } from '../../../components/ui/toast';
21
+ import { useLoading } from '../../../lib/loading-context';
22
+ import { MentorshipProgress } from '../../../components/learning/MentorshipProgress';
23
+ import { CertificateCard } from '../../../components/learning/CertificateTemplates';
24
+ import { formatDateSafe, getCurrentYear } from '../../../utils/date';
21
25
  export function AccountPage({ storeConfig }) {
22
- const { user, isAuthenticated, isLoading, logout, updateUserState, openLogin } = useAuth();
26
+ const { user, isAuthenticated, isLoading, logout, updateUserState } = useAuth();
23
27
  const { wishlist, toggleWishlist } = useStore();
24
28
  const searchParams = useSearchParams();
25
29
  const router = useRouter();
@@ -38,13 +42,13 @@ export function AccountPage({ storeConfig }) {
38
42
  setActiveTab(tabParam);
39
43
  }
40
44
  }, [tabParam, activeTab]);
41
- // Open in-store login sheet when not authenticated
45
+ // Redirect if not logged in
42
46
  useEffect(() => {
43
47
  if (!isLoading && !isAuthenticated) {
44
48
  const returnUrl = storeConfig ? `/${storeConfig.slug}/account` : '/account';
45
- openLogin({ callbackUrl: returnUrl });
49
+ router.push(`/auth/login?callbackUrl=${encodeURIComponent(returnUrl)}`);
46
50
  }
47
- }, [isLoading, isAuthenticated, openLogin, storeConfig]);
51
+ }, [isLoading, isAuthenticated, router, storeConfig]);
48
52
  const [isChangingPassword, setIsChangingPassword] = useState(false);
49
53
  const [isSavingProfile, setIsSavingProfile] = useState(false);
50
54
  const [avatarPreview, setAvatarPreview] = useState(null);
@@ -130,14 +134,20 @@ export function AccountPage({ storeConfig }) {
130
134
  }
131
135
  // Use wishlist from StoreContext (localStorage-based)
132
136
  // Note: wishlistService removed - using StoreContext instead
133
- if (wishlist && storeConfig?.products) {
134
- const items = wishlist
135
- .map(productId => {
136
- const product = storeConfig.products?.find(p => p.id === productId);
137
- return product ? { id: productId, productId, product } : null;
138
- })
139
- .filter((item) => item !== null);
140
- setWishlistItems(items);
137
+ if (wishlist && storeConfig) {
138
+ const items = await Promise.all(wishlist.map(async (productId) => {
139
+ const cachedProduct = storeConfig.products?.find((product) => product.id === productId);
140
+ try {
141
+ const product = cachedProduct ||
142
+ transformProductToStoreProduct(await productService.getProductById(productId));
143
+ return { id: productId, productId, product };
144
+ }
145
+ catch {
146
+ return null;
147
+ }
148
+ }));
149
+ const resolvedItems = items.filter((item) => item !== null);
150
+ setWishlistItems(resolvedItems);
141
151
  }
142
152
  else {
143
153
  setWishlistItems([]);
@@ -393,13 +403,14 @@ export function AccountPage({ storeConfig }) {
393
403
  return (_jsx("div", { className: "min-h-screen flex items-center justify-center bg-gray-50", children: _jsx(Loader2, { className: "w-8 h-8 animate-spin text-gray-400" }) }));
394
404
  }
395
405
  if (!isAuthenticated) {
396
- return null; // Login sheet opened via useEffect
406
+ return null; // Will redirect via useEffect
397
407
  }
398
408
  return (_jsxs("div", { className: "min-h-screen bg-gray-50", children: [!storeConfig && (_jsx("header", { className: "bg-white border-b border-gray-200 sticky top-0 z-50", children: _jsx("div", { className: "container mx-auto px-4 sm:px-6 lg:px-8", children: _jsxs("div", { className: "flex items-center justify-between h-16", children: [_jsxs(Link, { href: "/", className: "flex items-center gap-2 group", children: [_jsx("div", { className: "w-8 h-8 bg-black rounded-lg flex items-center justify-center text-white", children: _jsx(Store, { className: "w-5 h-5" }) }), _jsx("span", { className: "text-xl font-bold tracking-tight text-gray-900", children: "Storefront" })] }), _jsxs("div", { className: "flex items-center gap-4", children: [_jsxs("span", { className: "text-sm font-medium text-gray-700 hidden sm:block", children: [user?.firstName, " ", user?.lastName] }), _jsx("div", { className: "w-9 h-9 rounded-full bg-gray-200 overflow-hidden ring-2 ring-gray-100", children: _jsx(AvatarImage, { src: user?.avatar, alt: "Profile", size: 36, className: "rounded-full" }) })] })] }) }) })), _jsx("div", { className: cn("container mx-auto px-4 sm:px-6 lg:px-8 py-8", storeConfig ? "pt-24" : ""), children: _jsxs("div", { className: "flex flex-col lg:flex-row gap-8", children: [_jsx("div", { className: "w-full lg:w-72 flex-shrink-0", children: _jsxs("div", { className: "bg-white rounded-2xl shadow-sm border border-gray-100 p-4 sticky top-24", children: [_jsxs("div", { className: "mb-6 px-4 pt-4 text-center", children: [_jsx("div", { className: "w-20 h-20 mx-auto rounded-full bg-gray-100 mb-3 overflow-hidden", children: _jsx(AvatarImage, { src: user?.avatar, alt: "Profile", size: 80, className: "rounded-full" }) }), _jsxs("h3", { className: "font-bold text-gray-900", children: [user?.firstName, " ", user?.lastName] }), _jsxs("p", { className: "text-sm text-gray-500", children: ["Member since ", user?.createdAt
399
409
  ? new Date(user.createdAt).getFullYear()
400
410
  : getCurrentYear()] })] }), _jsxs("nav", { className: "space-y-1", children: [[
401
411
  { id: 'profile', label: 'My Profile', icon: UserIcon },
402
412
  { id: 'orders', label: 'Orders', icon: Package },
413
+ ...(storeConfig?.layout === 'motivational-speaker' ? [{ id: 'learning', label: 'My Learning', icon: BookOpen }] : []),
403
414
  { id: 'bookings', label: 'My Bookings', icon: Calendar },
404
415
  { id: 'wishlist', label: 'Wishlist', icon: Heart },
405
416
  // { id: 'payment', label: 'Payment Methods', icon: CreditCard }, // Hidden for now
@@ -407,7 +418,7 @@ export function AccountPage({ storeConfig }) {
407
418
  { id: 'settings', label: 'Settings', icon: Settings },
408
419
  ].map((item) => (_jsxs("button", { onClick: () => setActiveTab(item.id), className: `w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-medium transition-colors ${activeTab === item.id
409
420
  ? 'bg-black text-white shadow-md shadow-black/10'
410
- : 'text-gray-600 hover:bg-gray-50'}`, style: activeTab === item.id && storeConfig ? { backgroundColor: primaryColor } : {}, children: [_jsx(item.icon, { className: "w-4.5 h-4.5" }), item.label] }, item.id))), _jsx("div", { className: "pt-4 mt-4 border-t border-gray-100", children: _jsxs("button", { onClick: () => logout(storeConfig?.slug ? getStoreHomeUrl(storeConfig.slug) : '/'), className: "w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-medium text-red-600 hover:bg-red-50 transition-colors", children: [_jsx(LogOut, { className: "w-4.5 h-4.5" }), "Sign Out"] }) })] })] }) }), _jsx("div", { className: "flex-1 min-w-0", children: _jsxs("div", { className: "bg-white rounded-2xl shadow-sm border border-gray-100 min-h-[600px] p-6 sm:p-8", children: [activeTab === 'profile' && (_jsxs("div", { className: "space-y-8 animate-fade-in", children: [_jsxs("div", { className: "flex justify-between items-center", children: [_jsx("h2", { className: "text-2xl font-bold text-gray-900", children: "My Profile" }), !isEditingProfile && (_jsxs(Button, { variant: "outline", size: "sm", onClick: () => setIsEditingProfile(true), className: "gap-2", children: [_jsx(Edit2, { className: "w-4 h-4" }), " Edit Profile"] }))] }), _jsxs("form", { onSubmit: handleProfileSave, className: "space-y-8", children: [_jsxs("div", { className: "flex items-center gap-6 pb-6 border-b border-gray-100", children: [_jsxs("div", { className: "relative", children: [_jsx("div", { className: "w-24 h-24 rounded-full bg-gray-100 overflow-hidden border-2 border-gray-200", children: avatarPreview ? (_jsx(AvatarImage, { src: avatarPreview, alt: "Profile", size: 96, className: "rounded-full" })) : (_jsx(AvatarImage, { src: user?.avatar, alt: "Profile", size: 96, className: "rounded-full" })) }), isEditingProfile && (_jsx("div", { className: "absolute bottom-0 right-0", children: _jsxs("label", { className: "cursor-pointer", children: [_jsx("div", { className: "w-8 h-8 rounded-full bg-black flex items-center justify-center text-white hover:bg-gray-800 transition-colors shadow-lg", style: storeConfig ? { backgroundColor: primaryColor } : {}, children: _jsx(Camera, { className: "w-4 h-4" }) }), _jsx("input", { type: "file", accept: "image/jpeg,image/jpg,image/png,image/gif,image/webp", onChange: handleAvatarChange, className: "hidden" })] }) }))] }), _jsxs("div", { className: "flex-1", children: [_jsx("h3", { className: "font-bold text-gray-900 mb-1", children: "Profile Photo" }), _jsx("p", { className: "text-sm text-gray-500 mb-3", children: "Upload a new profile picture. JPG, PNG, GIF, or WebP. Max size 5MB." }), isEditingProfile && avatarFile && (_jsxs(Button, { type: "button", variant: "outline", size: "sm", onClick: handleRemoveAvatar, className: "gap-2 text-red-600 hover:text-red-700 hover:bg-red-50", children: [_jsx(X, { className: "w-4 h-4" }), " Remove Photo"] }))] })] }), _jsxs("div", { children: [_jsx("h3", { className: "text-lg font-bold text-gray-900 mb-4", children: "Personal Information" }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsxs("div", { className: "space-y-2", children: [_jsxs("label", { className: "text-sm font-semibold text-gray-700", children: ["First Name ", _jsx("span", { className: "text-red-500", children: "*" })] }), _jsx("input", { type: "text", value: profileData.firstName || '', onChange: (e) => setProfileData({ ...profileData, firstName: e.target.value }), disabled: !isEditingProfile, readOnly: !isEditingProfile, required: true, className: cn("w-full px-4 py-2.5 rounded-lg border border-gray-200 focus:outline-none transition-all", isEditingProfile
421
+ : 'text-gray-600 hover:bg-gray-50'}`, style: activeTab === item.id && storeConfig ? { backgroundColor: primaryColor } : {}, children: [_jsx(item.icon, { className: "w-4.5 h-4.5" }), item.label] }, item.id))), _jsx("div", { className: "pt-4 mt-4 border-t border-gray-100", children: _jsxs("button", { onClick: logout, className: "w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-medium text-red-600 hover:bg-red-50 transition-colors", children: [_jsx(LogOut, { className: "w-4.5 h-4.5" }), "Sign Out"] }) })] })] }) }), _jsx("div", { className: "flex-1 min-w-0", children: _jsxs("div", { className: "bg-white rounded-2xl shadow-sm border border-gray-100 min-h-[600px] p-6 sm:p-8", children: [activeTab === 'profile' && (_jsxs("div", { className: "space-y-8 animate-fade-in", children: [_jsxs("div", { className: "flex justify-between items-center", children: [_jsx("h2", { className: "text-2xl font-bold text-gray-900", children: "My Profile" }), !isEditingProfile && (_jsxs(Button, { variant: "outline", size: "sm", onClick: () => setIsEditingProfile(true), className: "gap-2", children: [_jsx(Edit2, { className: "w-4 h-4" }), " Edit Profile"] }))] }), _jsxs("form", { onSubmit: handleProfileSave, className: "space-y-8", children: [_jsxs("div", { className: "flex items-center gap-6 pb-6 border-b border-gray-100", children: [_jsxs("div", { className: "relative", children: [_jsx("div", { className: "w-24 h-24 rounded-full bg-gray-100 overflow-hidden border-2 border-gray-200", children: avatarPreview ? (_jsx(AvatarImage, { src: avatarPreview, alt: "Profile", size: 96, className: "rounded-full" })) : (_jsx(AvatarImage, { src: user?.avatar, alt: "Profile", size: 96, className: "rounded-full" })) }), isEditingProfile && (_jsx("div", { className: "absolute bottom-0 right-0", children: _jsxs("label", { className: "cursor-pointer", children: [_jsx("div", { className: "w-8 h-8 rounded-full bg-black flex items-center justify-center text-white hover:bg-gray-800 transition-colors shadow-lg", style: storeConfig ? { backgroundColor: primaryColor } : {}, children: _jsx(Camera, { className: "w-4 h-4" }) }), _jsx("input", { type: "file", accept: "image/jpeg,image/jpg,image/png,image/gif,image/webp", onChange: handleAvatarChange, className: "hidden" })] }) }))] }), _jsxs("div", { className: "flex-1", children: [_jsx("h3", { className: "font-bold text-gray-900 mb-1", children: "Profile Photo" }), _jsx("p", { className: "text-sm text-gray-500 mb-3", children: "Upload a new profile picture. JPG, PNG, GIF, or WebP. Max size 5MB." }), isEditingProfile && avatarFile && (_jsxs(Button, { type: "button", variant: "outline", size: "sm", onClick: handleRemoveAvatar, className: "gap-2 text-red-600 hover:text-red-700 hover:bg-red-50", children: [_jsx(X, { className: "w-4 h-4" }), " Remove Photo"] }))] })] }), _jsxs("div", { children: [_jsx("h3", { className: "text-lg font-bold text-gray-900 mb-4", children: "Personal Information" }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsxs("div", { className: "space-y-2", children: [_jsxs("label", { className: "text-sm font-semibold text-gray-700", children: ["First Name ", _jsx("span", { className: "text-red-500", children: "*" })] }), _jsx("input", { type: "text", value: profileData.firstName || '', onChange: (e) => setProfileData({ ...profileData, firstName: e.target.value }), disabled: !isEditingProfile, readOnly: !isEditingProfile, required: true, className: cn("w-full px-4 py-2.5 rounded-lg border border-gray-200 focus:outline-none transition-all", isEditingProfile
411
422
  ? "bg-white text-gray-900 cursor-text focus:border-black focus:ring-0"
412
423
  : "bg-gray-50 text-gray-500 cursor-not-allowed") })] }), _jsxs("div", { className: "space-y-2", children: [_jsxs("label", { className: "text-sm font-semibold text-gray-700", children: ["Last Name ", _jsx("span", { className: "text-red-500", children: "*" })] }), _jsx("input", { type: "text", value: profileData.lastName || '', onChange: (e) => setProfileData({ ...profileData, lastName: e.target.value }), disabled: !isEditingProfile, readOnly: !isEditingProfile, required: true, className: cn("w-full px-4 py-2.5 rounded-lg border border-gray-200 focus:outline-none transition-all", isEditingProfile
413
424
  ? "bg-white text-gray-900 cursor-text focus:border-black focus:ring-0"
@@ -545,5 +556,68 @@ export function AccountPage({ storeConfig }) {
545
556
  addToast(errorMessage, 'error');
546
557
  }
547
558
  }, children: _jsx(Heart, { className: "w-5 h-5 fill-current" }) }), _jsx("div", { className: "aspect-square bg-gray-100 rounded-xl mb-4 overflow-hidden relative", children: product?.image ? (_jsx(Image, { src: product.image, alt: product.name || 'Product', fill: true, className: "object-cover group-hover:scale-105 transition-transform duration-500", unoptimized: true })) : (_jsx("div", { className: "w-full h-full flex items-center justify-center bg-gradient-to-br from-gray-100 to-gray-200", children: _jsx(Heart, { className: "w-12 h-12 text-gray-300" }) })) }), storeSlug && (_jsx(Link, { href: `/${storeSlug}`, className: "block text-xs font-bold text-gray-400 uppercase tracking-wider mb-1 hover:text-black", children: product?.storeName || storeConfig?.name || 'Store' })), _jsx("h3", { className: "font-bold text-gray-900 mb-2 truncate", children: product?.name || 'Product' }), _jsxs("div", { className: "flex items-center justify-between mt-4", children: [_jsx("span", { className: "text-lg font-bold", children: product?.price ? formatCurrency(product.price, product.currency || storeConfig?.settings?.currency || 'USD') : formatCurrency(0, storeConfig?.settings?.currency || 'USD') }), storeSlug && productSlug && (_jsx(Link, { href: `/${storeSlug}/product/${productSlug}`, children: _jsx(Button, { size: "sm", className: "rounded-full bg-black text-white px-4", style: storeConfig ? { backgroundColor: primaryColor } : {}, children: "View Item" }) }))] })] }, item.id));
548
- }) })) : (_jsxs("div", { className: "text-center py-12", children: [_jsx("div", { className: "w-16 h-16 bg-gray-50 rounded-full flex items-center justify-center mx-auto mb-4", children: _jsx(Heart, { className: "w-8 h-8 text-gray-300" }) }), _jsx("h3", { className: "text-lg font-medium text-gray-900", children: "Your wishlist is empty" }), _jsx("p", { className: "text-gray-500 mt-2", children: "Start saving items you love!" })] }))] })), activeTab === 'notifications' && (_jsxs("div", { className: "space-y-6 animate-fade-in", children: [_jsx("h2", { className: "text-2xl font-bold text-gray-900", children: "Notification Preferences" }), _jsxs("div", { className: "space-y-4 divide-y divide-gray-100", children: [_jsxs("div", { className: "flex items-center justify-between py-4", children: [_jsxs("div", { children: [_jsx("h3", { className: "font-bold text-gray-900", children: "Order Updates" }), _jsx("p", { className: "text-sm text-gray-500", children: "Receive updates about your order status" })] }), _jsx("div", { className: "relative inline-flex h-6 w-11 items-center rounded-full bg-black transition-colors", style: storeConfig ? { backgroundColor: primaryColor } : {}, children: _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white transition-transform translate-x-6" }) })] }), _jsxs("div", { className: "flex items-center justify-between py-4", children: [_jsxs("div", { children: [_jsx("h3", { className: "font-bold text-gray-900", children: "Promotions" }), _jsx("p", { className: "text-sm text-gray-500", children: "Receive emails about new sales and deals" })] }), _jsx("div", { className: "relative inline-flex h-6 w-11 items-center rounded-full bg-gray-200 transition-colors", children: _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white transition-transform translate-x-1" }) })] }), _jsxs("div", { className: "flex items-center justify-between py-4", children: [_jsxs("div", { children: [_jsx("h3", { className: "font-bold text-gray-900", children: "New Arrivals" }), _jsx("p", { className: "text-sm text-gray-500", children: "Get notified when new products arrive" })] }), _jsx("div", { className: "relative inline-flex h-6 w-11 items-center rounded-full bg-black transition-colors", style: storeConfig ? { backgroundColor: primaryColor } : {}, children: _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white transition-transform translate-x-6" }) })] })] })] })), activeTab === 'settings' && (_jsxs("div", { className: "space-y-8 animate-fade-in", children: [_jsx("h2", { className: "text-2xl font-bold text-gray-900", children: "Account Settings" }), _jsxs("div", { className: "space-y-6", children: [_jsxs("div", { children: [_jsx("div", { className: "flex justify-between items-center mb-4", children: _jsx("h3", { className: "text-lg font-bold text-gray-900", children: "Security" }) }), !isChangingPassword ? (_jsxs(Button, { variant: "outline", className: "w-full justify-between group h-12 rounded-xl", onClick: () => setIsChangingPassword(true), children: [_jsx("span", { children: "Change Password" }), _jsx(Lock, { className: "w-4 h-4 text-gray-400 group-hover:text-black" })] })) : (_jsxs("form", { onSubmit: handlePasswordChange, className: "p-6 border border-gray-200 rounded-xl space-y-4 bg-gray-50/50", children: [_jsx("h4", { className: "font-bold text-gray-900 mb-2", children: "Change Password" }), _jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-sm font-semibold text-gray-700", children: "Current Password" }), _jsx("input", { type: "password", value: passwordData.current, onChange: (e) => setPasswordData({ ...passwordData, current: e.target.value }), className: "w-full px-4 py-2.5 rounded-lg border border-gray-200 bg-white focus:border-black focus:ring-0 focus:outline-none transition-all", required: true })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-sm font-semibold text-gray-700", children: "New Password" }), _jsx("input", { type: "password", value: passwordData.new, onChange: (e) => setPasswordData({ ...passwordData, new: e.target.value }), className: "w-full px-4 py-2.5 rounded-lg border border-gray-200 bg-white focus:border-black focus:ring-0 focus:outline-none transition-all", required: true })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-sm font-semibold text-gray-700", children: "Confirm New Password" }), _jsx("input", { type: "password", value: passwordData.confirm, onChange: (e) => setPasswordData({ ...passwordData, confirm: e.target.value }), className: "w-full px-4 py-2.5 rounded-lg border border-gray-200 bg-white focus:border-black focus:ring-0 focus:outline-none transition-all", required: true })] }), _jsxs("div", { className: "flex justify-end gap-3 pt-2", children: [_jsx(Button, { type: "button", variant: "ghost", onClick: () => setIsChangingPassword(false), children: "Cancel" }), _jsx(Button, { type: "submit", className: "bg-black text-white", style: storeConfig ? { backgroundColor: primaryColor } : {}, children: "Update Password" })] })] }))] }), _jsxs("div", { className: "pt-8 border-t border-gray-100", children: [_jsx("h3", { className: "text-lg font-bold text-red-600 mb-2", children: "Danger Zone" }), _jsx("p", { className: "text-gray-500 text-sm mb-4", children: "Once you delete your account, there is no going back. Please be certain." }), _jsxs(Button, { variant: "outline", className: "border-red-200 text-red-600 hover:bg-red-50 hover:text-red-700 w-full justify-between h-12 rounded-xl", children: [_jsx("span", { children: "Delete Account" }), _jsx(Trash2, { className: "w-4 h-4" })] })] })] })] }))] }) })] }) })] }));
559
+ }) })) : (_jsxs("div", { className: "text-center py-12", children: [_jsx("div", { className: "w-16 h-16 bg-gray-50 rounded-full flex items-center justify-center mx-auto mb-4", children: _jsx(Heart, { className: "w-8 h-8 text-gray-300" }) }), _jsx("h3", { className: "text-lg font-medium text-gray-900", children: "Your wishlist is empty" }), _jsx("p", { className: "text-gray-500 mt-2", children: "Start saving items you love!" })] }))] })), activeTab === 'notifications' && (_jsxs("div", { className: "space-y-6 animate-fade-in", children: [_jsx("h2", { className: "text-2xl font-bold text-gray-900", children: "Notification Preferences" }), _jsxs("div", { className: "space-y-4 divide-y divide-gray-100", children: [_jsxs("div", { className: "flex items-center justify-between py-4", children: [_jsxs("div", { children: [_jsx("h3", { className: "font-bold text-gray-900", children: "Order Updates" }), _jsx("p", { className: "text-sm text-gray-500", children: "Receive updates about your order status" })] }), _jsx("div", { className: "relative inline-flex h-6 w-11 items-center rounded-full bg-black transition-colors", style: storeConfig ? { backgroundColor: primaryColor } : {}, children: _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white transition-transform translate-x-6" }) })] }), _jsxs("div", { className: "flex items-center justify-between py-4", children: [_jsxs("div", { children: [_jsx("h3", { className: "font-bold text-gray-900", children: "Promotions" }), _jsx("p", { className: "text-sm text-gray-500", children: "Receive emails about new sales and deals" })] }), _jsx("div", { className: "relative inline-flex h-6 w-11 items-center rounded-full bg-gray-200 transition-colors", children: _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white transition-transform translate-x-1" }) })] }), _jsxs("div", { className: "flex items-center justify-between py-4", children: [_jsxs("div", { children: [_jsx("h3", { className: "font-bold text-gray-900", children: "New Arrivals" }), _jsx("p", { className: "text-sm text-gray-500", children: "Get notified when new products arrive" })] }), _jsx("div", { className: "relative inline-flex h-6 w-11 items-center rounded-full bg-black transition-colors", style: storeConfig ? { backgroundColor: primaryColor } : {}, children: _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white transition-transform translate-x-6" }) })] })] })] })), activeTab === 'learning' && storeConfig?.layout === 'motivational-speaker' && (_jsxs("div", { className: "space-y-8 animate-fade-in", children: [_jsx("div", { className: "flex justify-between items-center", children: _jsxs("div", { children: [_jsx("h2", { className: "text-2xl font-black text-slate-900 tracking-tight", children: "Learning Hub" }), _jsx("p", { className: "text-slate-500 font-medium", children: "Your personal growth and certification center" })] }) }), _jsx("div", { className: "flex border-b border-slate-100 overflow-x-auto no-scrollbar gap-8", children: [
560
+ { id: 'courses', label: 'My Courses' },
561
+ { id: 'mentorship', label: 'Mentorship' },
562
+ { id: 'certificates', label: 'Credentials' }
563
+ ].map((sub) => (_jsxs("button", { onClick: () => router.push(`?tab=learning&sub=${sub.id}`), className: cn("pb-4 text-xs font-black uppercase tracking-[0.2em] whitespace-nowrap border-b-2 transition-all relative", (searchParams.get('sub') || 'courses') === sub.id
564
+ ? "text-slate-900"
565
+ : "border-transparent text-slate-400 hover:text-slate-600"), children: [sub.label, (searchParams.get('sub') || 'courses') === sub.id && (_jsx(motion.div, { layoutId: "activeLearningTab", className: "absolute bottom-[-2px] left-0 right-0 h-0.5 bg-slate-900 rounded-full", style: storeConfig ? { backgroundColor: primaryColor } : {} }))] }, sub.id))) }), (searchParams.get('sub') === 'courses' || !searchParams.get('sub')) && (_jsxs("div", { className: "space-y-10", children: [_jsx("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-4", children: [
566
+ { label: 'Enrolled', value: '12', icon: BookOpen, color: 'text-blue-600', bg: 'bg-blue-50' },
567
+ { label: 'Completed', value: '8', icon: CheckCircle2, color: 'text-green-600', bg: 'bg-green-50' },
568
+ { label: 'Learning Time', value: '24h', icon: Clock, color: 'text-purple-600', bg: 'bg-purple-50' }
569
+ ].map((stat, i) => (_jsxs("div", { className: "bg-white border border-slate-100 rounded-2xl p-5 flex items-center gap-4 shadow-sm", children: [_jsx("div", { className: cn("w-12 h-12 rounded-xl flex items-center justify-center shrink-0", stat.bg), children: _jsx(stat.icon, { className: cn("w-6 h-6", stat.color) }) }), _jsxs("div", { children: [_jsx("p", { className: "text-[10px] font-black uppercase tracking-widest text-slate-400", children: stat.label }), _jsx("h3", { className: "text-xl font-black text-slate-900", children: stat.value })] })] }, i))) }), _jsxs("div", { className: "space-y-6", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h3", { className: "text-sm font-black uppercase tracking-[0.2em] text-slate-400", children: "In Progress" }), _jsx("span", { className: "bg-slate-100 text-slate-900 rounded-full px-3 py-0.5 text-[10px] font-bold border border-slate-200", children: "2 Active" })] }), _jsx("div", { className: "space-y-4", children: [
570
+ {
571
+ id: 'art-of-focus',
572
+ title: 'The Art of Focus',
573
+ progress: 65,
574
+ type: 'Masterclass',
575
+ thumbnail: 'https://images.unsplash.com/photo-1516321318423-f06f85e504b3?w=400&h=300&fit=crop',
576
+ lastAccessed: '2 days ago'
577
+ },
578
+ {
579
+ id: 'leadership-101',
580
+ title: 'Executive Leadership 101',
581
+ progress: 30,
582
+ type: 'Specialization',
583
+ thumbnail: 'https://images.unsplash.com/photo-1478737270239-2f02b77ac6d5?w=400&h=300&fit=crop',
584
+ lastAccessed: '1 week ago'
585
+ },
586
+ ].map((course) => {
587
+ const courseLink = storeConfig ? `/${storeConfig.slug}/services/${course.id}` : '#';
588
+ return (_jsx(Link, { href: courseLink, className: "group block bg-white border border-slate-100 rounded-3xl p-5 hover:border-slate-300 hover:shadow-xl transition-all", children: _jsxs("div", { className: "flex flex-col sm:flex-row gap-6", children: [_jsxs("div", { className: "relative w-full sm:w-48 h-32 rounded-2xl overflow-hidden bg-slate-100 shrink-0 shadow-sm", children: [_jsx(Image, { src: course.thumbnail, alt: course.title, fill: true, className: "object-cover group-hover:scale-110 transition-transform duration-700", unoptimized: true }), _jsx("div", { className: "absolute inset-0 bg-black/20 group-hover:bg-black/0 transition-colors flex items-center justify-center opacity-0 group-hover:opacity-100", children: _jsx("div", { className: "w-10 h-10 rounded-full bg-white flex items-center justify-center shadow-xl", children: _jsx(Play, { className: "w-5 h-5 text-slate-900 fill-current" }) }) })] }), _jsxs("div", { className: "flex-1 flex flex-col justify-between py-1", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-[10px] font-black uppercase tracking-[0.2em] text-blue-600", children: course.type }), _jsx("h4", { className: "text-xl font-black text-slate-900 leading-tight group-hover:text-primary transition-colors", children: course.title })] }), _jsxs("div", { className: "mt-4 space-y-3", children: [_jsxs("div", { className: "flex items-center justify-between text-xs", children: [_jsx("span", { className: "text-slate-400 font-bold uppercase tracking-widest text-[10px]", children: "Progress" }), _jsxs("span", { className: "font-black text-slate-900", children: [course.progress, "%"] })] }), _jsx("div", { className: "w-full h-1.5 bg-slate-50 rounded-full overflow-hidden", children: _jsx(motion.div, { initial: { width: 0 }, animate: { width: `${course.progress}%` }, className: "h-full bg-slate-900 rounded-full", style: storeConfig ? { backgroundColor: primaryColor } : {} }) }), _jsxs("div", { className: "flex items-center justify-between pt-2", children: [_jsxs("span", { className: "text-[10px] font-bold text-slate-400 uppercase tracking-widest", children: ["Last seen ", course.lastAccessed] }), _jsxs("span", { className: "flex items-center gap-1.5 text-xs font-black text-slate-900 group-hover:translate-x-1 transition-transform", children: ["Continue ", _jsx(ArrowRight, { className: "w-3.5 h-3.5" })] })] })] })] })] }) }, course.id));
589
+ }) })] }), _jsxs("div", { className: "space-y-6", children: [_jsx("h3", { className: "text-sm font-black uppercase tracking-[0.2em] text-slate-400", children: "Recently Completed" }), _jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
590
+ { title: 'Strategic Planning Guide', type: 'Framework', completedDate: '3 days ago' },
591
+ { title: 'Mindset Mastery Basics', type: 'Foundation', completedDate: '2 weeks ago' },
592
+ ].map((course, i) => (_jsxs("div", { className: "bg-slate-50/50 border border-slate-100 rounded-2xl p-5 group hover:bg-white hover:shadow-md transition-all flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-4", children: [_jsx("div", { className: "w-10 h-10 rounded-xl bg-green-100 flex items-center justify-center shrink-0", children: _jsx(Check, { className: "w-5 h-5 text-green-600" }) }), _jsxs("div", { children: [_jsx("h4", { className: "font-bold text-slate-900 text-sm leading-snug", children: course.title }), _jsxs("p", { className: "text-[10px] font-black text-slate-400 uppercase tracking-widest mt-0.5", children: [course.type, " \u2022 ", course.completedDate] })] })] }), _jsx(Button, { variant: "ghost", size: "sm", className: "h-8 rounded-lg text-[10px] font-black uppercase tracking-widest hover:bg-slate-100", children: "Review" })] }, i))) })] })] })), searchParams.get('sub') === 'mentorship' && (_jsx("div", { className: "space-y-6", children: _jsx(MentorshipProgress, { programs: [
593
+ {
594
+ id: 'ment-1',
595
+ name: '1-on-1 Executive Coaching',
596
+ mentorName: 'Dr. Sarah Mitchell',
597
+ mentorAvatar: 'https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=150&h=150&fit=crop',
598
+ startDate: '2025-10-01',
599
+ expiryDate: '2025-12-31',
600
+ sessionsTotal: 12,
601
+ sessionsCompleted: 8,
602
+ status: 'active',
603
+ nextSessionDate: 'Oct 24, 2025 @ 10:00 AM'
604
+ }
605
+ ] }) })), searchParams.get('sub') === 'certificates' && (_jsxs("div", { className: "space-y-8", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h3", { className: "text-sm font-black uppercase tracking-[0.2em] text-slate-400", children: "Verified Credentials" }), _jsx("p", { className: "text-[10px] font-bold text-slate-400 uppercase tracking-widest", children: "Digital PDF Documents" })] }), _jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
606
+ {
607
+ id: 'CERT-8821',
608
+ courseName: 'The Art of Focus',
609
+ date: 'Dec 15, 2025',
610
+ instructor: 'Dr. Sarah Mitchell',
611
+ design: 'modern',
612
+ color: primaryColor
613
+ },
614
+ {
615
+ id: 'CERT-7732',
616
+ courseName: 'Strategic Planning Guide',
617
+ date: 'Nov 20, 2025',
618
+ instructor: 'Marcus Aurelius',
619
+ design: 'minimal',
620
+ color: '#64748b'
621
+ }
622
+ ].map((cert) => (_jsx(CertificateCard, { certificate: cert, onDownload: (id) => window.open(`/${storeConfig?.slug}/account/certificates/${id}`, '_blank') }, cert.id))) })] })), _jsx("div", { className: "pt-12 border-t border-slate-100", children: _jsx(Link, { href: storeConfig ? `/${storeConfig.slug}/services` : '#', children: _jsxs(Button, { className: "w-full h-16 rounded-3xl font-black uppercase tracking-[0.2em] shadow-2xl shadow-slate-200 hover:shadow-primary/20 hover:-translate-y-1 transition-all text-sm", style: storeConfig ? { backgroundColor: primaryColor } : {}, children: ["Explore Learning Catalogue", _jsx(ArrowRight, { className: "ml-3 w-5 h-5" })] }) }) })] })), activeTab === 'settings' && (_jsxs("div", { className: "space-y-8 animate-fade-in", children: [_jsx("h2", { className: "text-2xl font-bold text-gray-900", children: "Account Settings" }), _jsxs("div", { className: "space-y-6", children: [_jsxs("div", { children: [_jsx("div", { className: "flex justify-between items-center mb-4", children: _jsx("h3", { className: "text-lg font-bold text-gray-900", children: "Security" }) }), !isChangingPassword ? (_jsxs(Button, { variant: "outline", className: "w-full justify-between group h-12 rounded-xl", onClick: () => setIsChangingPassword(true), children: [_jsx("span", { children: "Change Password" }), _jsx(Lock, { className: "w-4 h-4 text-gray-400 group-hover:text-black" })] })) : (_jsxs("form", { onSubmit: handlePasswordChange, className: "p-6 border border-gray-200 rounded-xl space-y-4 bg-gray-50/50", children: [_jsx("h4", { className: "font-bold text-gray-900 mb-2", children: "Change Password" }), _jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-sm font-semibold text-gray-700", children: "Current Password" }), _jsx("input", { type: "password", value: passwordData.current, onChange: (e) => setPasswordData({ ...passwordData, current: e.target.value }), className: "w-full px-4 py-2.5 rounded-lg border border-gray-200 bg-white focus:border-black focus:ring-0 focus:outline-none transition-all", required: true })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-sm font-semibold text-gray-700", children: "New Password" }), _jsx("input", { type: "password", value: passwordData.new, onChange: (e) => setPasswordData({ ...passwordData, new: e.target.value }), className: "w-full px-4 py-2.5 rounded-lg border border-gray-200 bg-white focus:border-black focus:ring-0 focus:outline-none transition-all", required: true })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-sm font-semibold text-gray-700", children: "Confirm New Password" }), _jsx("input", { type: "password", value: passwordData.confirm, onChange: (e) => setPasswordData({ ...passwordData, confirm: e.target.value }), className: "w-full px-4 py-2.5 rounded-lg border border-gray-200 bg-white focus:border-black focus:ring-0 focus:outline-none transition-all", required: true })] }), _jsxs("div", { className: "flex justify-end gap-3 pt-2", children: [_jsx(Button, { type: "button", variant: "ghost", onClick: () => setIsChangingPassword(false), children: "Cancel" }), _jsx(Button, { type: "submit", className: "bg-black text-white", style: storeConfig ? { backgroundColor: primaryColor } : {}, children: "Update Password" })] })] }))] }), _jsxs("div", { className: "pt-8 border-t border-gray-100", children: [_jsx("h3", { className: "text-lg font-bold text-red-600 mb-2", children: "Danger Zone" }), _jsx("p", { className: "text-gray-500 text-sm mb-4", children: "Once you delete your account, there is no going back. Please be certain." }), _jsxs(Button, { variant: "outline", className: "border-red-200 text-red-600 hover:bg-red-50 hover:text-red-700 w-full justify-between h-12 rounded-xl", children: [_jsx("span", { children: "Delete Account" }), _jsx(Trash2, { className: "w-4 h-4" })] })] })] })] }))] }) })] }) })] }));
549
623
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CartPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/shared/pages/CartPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAiBhD,UAAU,aAAa;IACrB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,QAAQ,CAAC,EAAE,WAAW,EAAE,EAAE,aAAa,2CAsVtD"}
1
+ {"version":3,"file":"CartPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/shared/pages/CartPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAUhD,UAAU,aAAa;IACrB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,QAAQ,CAAC,EAAE,WAAW,EAAE,EAAE,aAAa,2CAiRtD"}
@@ -1,49 +1,22 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { Button } from '../../../components/ui/button.js';
4
- import { Trash2, ArrowRight, ShoppingBag, ArrowLeft, Lock, Loader2 } from 'lucide-react';
3
+ import { Button } from '../../../components/ui/button';
4
+ import { Minus, Plus, Trash2, ArrowRight, ShoppingBag, ArrowLeft, Lock } from 'lucide-react';
5
5
  import Link from 'next/link';
6
6
  import Image from 'next/image';
7
7
  import { useEffect, useState } from 'react';
8
- import { useStore } from '../../../lib/store-context.js';
9
- import { formatCurrency, normalizePrice, getUserFriendlyErrorMessage } from '../../../lib/utils/index.js';
10
- import { getCartLineStockInfo } from '../../../lib/inventory-utils.js';
11
- import { getCartLineImage } from '../../../lib/product-variation-utils.js';
12
- import { useToast } from '../../../components/ui/toast.js';
13
- import { CartLineQuantityControl } from '../components/CartLineQuantityControl.js';
14
- import { useCheckoutFees } from '../../../hooks/use-checkout-fees.js';
15
- import { CheckoutFeeLines } from '../../../components/checkout/CheckoutFeeLines.js';
16
- import { CHECKOUT_UNAVAILABLE_MESSAGE } from '../../../lib/checkout-availability.js';
17
- import { trackStorefrontEvent } from '../../../lib/mixpanel.js';
8
+ import { useStore } from '../../../lib/store-context';
9
+ import { formatCurrency } from '../../../lib/utils';
10
+ import { calculateVAT, calculateServiceCharge, getVATLabel, getServiceChargeLabel } from '../../../lib/utils/fee-calculations';
18
11
  export function CartPage({ storeConfig }) {
19
12
  const primaryColor = storeConfig.branding.primaryColor;
20
- const { cart, updateCartQuantity, removeFromCart, cartTotal, isCartHydrated, isCartRefreshing, refreshCart } = useStore();
21
- const { addToast } = useToast();
13
+ const { cart, updateCartQuantity, removeFromCart, cartTotal, isCartLoading } = useStore();
22
14
  const [updatingItemId, setUpdatingItemId] = useState(null);
23
15
  const [removingItemId, setRemovingItemId] = useState(null);
24
16
  const [isClient, setIsClient] = useState(false);
25
17
  useEffect(() => {
26
18
  setIsClient(true);
27
19
  }, []);
28
- useEffect(() => {
29
- if (isClient && !isCartHydrated) {
30
- void refreshCart?.().catch((error) => {
31
- addToast(getUserFriendlyErrorMessage(error, 'Unable to load your cart. Please try again.'), 'error');
32
- });
33
- }
34
- }, [isClient, isCartHydrated, refreshCart, addToast]);
35
- // Track cart page view
36
- useEffect(() => {
37
- if (!storeConfig?.id)
38
- return;
39
- trackStorefrontEvent('Cart_viewed', {
40
- storeId: storeConfig.id,
41
- storeSlug: storeConfig.slug,
42
- itemCount: cart.length,
43
- cartTotal,
44
- });
45
- // eslint-disable-next-line react-hooks/exhaustive-deps
46
- }, [storeConfig?.id]);
47
20
  // Helper function to determine cart currency consistently
48
21
  const getCartCurrency = () => {
49
22
  if (cart.length === 0) {
@@ -70,66 +43,42 @@ export function CartPage({ storeConfig }) {
70
43
  return mostCommonCurrency;
71
44
  };
72
45
  const cartCurrency = getCartCurrency();
73
- const checkoutDisabled = storeConfig.checkoutEnabled === false;
74
- const handleQuantityUpdate = async (itemId, nextQuantity) => {
75
- setUpdatingItemId(itemId);
76
- try {
77
- await updateCartQuantity(itemId, nextQuantity);
78
- }
79
- catch (error) {
80
- addToast(error?.message || 'Unable to update quantity', 'error');
81
- }
82
- finally {
83
- setUpdatingItemId(null);
84
- }
85
- };
86
- const stockIssues = cart
87
- .map((item) => getCartLineStockInfo(item.product, item.quantity).stockError)
88
- .filter((message) => Boolean(message));
89
- const hasStockIssues = stockIssues.length > 0;
90
- const computedSubtotal = cart.reduce((sum, item) => sum + normalizePrice(item.price) * item.quantity, 0);
91
- const subtotal = Number.isFinite(cartTotal) && cartTotal > 0 ? cartTotal : computedSubtotal;
92
- const { feeBreakdown, loading: feesLoading, totalPayable, displayLines } = useCheckoutFees({
93
- storeId: storeConfig.id,
94
- subtotal,
95
- currency: cartCurrency,
96
- shippingCost: 0,
97
- onError: (message) => addToast(message, 'error'),
98
- });
99
- const total = feeBreakdown?.totalPayable ?? totalPayable;
46
+ const subtotal = cartTotal;
47
+ // Calculate VAT and service charge using store configuration
48
+ const vatAmount = calculateVAT(subtotal, storeConfig.settings?.vat, storeConfig.settings?.taxRate);
49
+ const serviceChargeAmount = calculateServiceCharge(subtotal, storeConfig.settings?.serviceCharge, 'online');
50
+ const vatLabel = getVATLabel(storeConfig.settings?.vat, storeConfig.settings?.taxRate);
51
+ const serviceChargeLabel = getServiceChargeLabel(storeConfig.settings?.serviceCharge);
52
+ // Calculate total (shipping will be calculated at checkout)
53
+ const total = subtotal + vatAmount + serviceChargeAmount;
100
54
  if (!isClient)
101
55
  return null; // Avoid hydration mismatch
102
- if (!isCartHydrated) {
103
- return (_jsxs("div", { className: "min-h-screen bg-gray-50 flex flex-col items-center justify-center p-4", children: [_jsx(Loader2, { className: "w-10 h-10 text-gray-300 animate-spin mb-4" }), _jsx("p", { className: "text-gray-500 font-medium", children: "Loading your cart..." })] }));
104
- }
105
56
  if (cart.length === 0) {
106
57
  return (_jsxs("div", { className: "min-h-screen bg-gray-50 flex flex-col items-center justify-center p-4", children: [_jsx("div", { className: "w-24 h-24 bg-white rounded-full shadow-lg flex items-center justify-center mb-6 animate-fade-in-up", children: _jsx(ShoppingBag, { className: "w-10 h-10 text-gray-300" }) }), _jsx("h1", { className: "text-3xl font-bold text-gray-900 mb-3 animate-fade-in-up", style: { animationDelay: '100ms' }, children: "Your cart is empty" }), _jsx("p", { className: "text-gray-500 mb-8 max-w-md text-center animate-fade-in-up", style: { animationDelay: '200ms' }, children: "Looks like you haven't added anything to your cart yet. Browse our products to find something you love." }), _jsx(Link, { href: `/${storeConfig.slug}`, className: "animate-fade-in-up", style: { animationDelay: '300ms' }, children: _jsx(Button, { size: "lg", className: "rounded-full px-8 h-12 text-base font-bold shadow-lg transition-transform hover:scale-105", style: { backgroundColor: primaryColor }, children: "Start Shopping" }) })] }));
107
58
  }
108
- return (_jsx("div", { className: "min-h-screen bg-gray-50/50 py-12 px-4 sm:px-6 lg:px-8", children: _jsxs("div", { className: "container mx-auto max-w-6xl", children: [_jsxs("div", { className: "mb-10 flex flex-col md:flex-row md:items-center justify-between gap-4", children: [_jsxs("div", { children: [_jsxs(Link, { href: `/${storeConfig.slug}`, className: "group mb-4 inline-flex items-center gap-2 text-gray-500 transition-colors hover:text-black font-medium", children: [_jsx("div", { className: "rounded-full border border-gray-200 bg-white p-2 transition-colors group-hover:border-black", children: _jsx(ArrowLeft, { className: "h-4 w-4" }) }), "Continue Shopping"] }), _jsx("h1", { className: "text-3xl font-black text-gray-900 tracking-tight", children: "Shopping Cart" }), _jsxs("p", { className: "mt-1 text-sm text-gray-500", children: [cart.length, " items in your cart"] })] }), _jsxs("div", { className: "flex items-center gap-2 text-sm font-medium bg-white px-4 py-2 rounded-full shadow-sm border border-gray-100", children: [_jsx("span", { className: "text-black", children: "Cart" }), _jsx("span", { className: "text-gray-300 mx-1", children: "/" }), _jsx("span", { className: "text-gray-400", children: "Checkout" }), _jsx("span", { className: "text-gray-300 mx-1", children: "/" }), _jsx("span", { className: "text-gray-400", children: "Payment" })] })] }), _jsx("p", { className: "mb-6 text-sm text-gray-500 rounded-2xl border border-gray-100 bg-gray-50 px-4 py-3", children: "Items in your cart are not reserved until you proceed to checkout and payment. Availability is confirmed at checkout." }), _jsxs("div", { className: "relative flex flex-col lg:flex-row gap-8 lg:gap-12", children: [isCartRefreshing && (_jsx("div", { className: "absolute inset-0 z-10 flex items-center justify-center rounded-3xl bg-white/60 backdrop-blur-[1px]", children: _jsx(Loader2, { className: "w-8 h-8 text-gray-400 animate-spin" }) })), _jsx("div", { className: "flex-1 space-y-6", children: cart.map((item) => {
109
- const isItemBusy = updatingItemId === item.id || removingItemId === item.id;
110
- const lineStock = getCartLineStockInfo(item.product, item.quantity);
111
- return (_jsxs("div", { className: `bg-white rounded-3xl p-4 sm:p-6 border border-gray-100 shadow-sm flex flex-row gap-4 sm:gap-6 group transition-all hover:shadow-md hover:border-gray-200 ${isItemBusy ? 'opacity-70' : ''}`, "aria-busy": isItemBusy, children: [_jsx("div", { className: "w-24 h-24 sm:w-32 sm:h-32 aspect-square bg-gray-100 rounded-2xl overflow-hidden flex-shrink-0 relative", children: _jsx(Image, { src: getCartLineImage(item) || item.product.images[0], alt: item.product.name, fill: true, className: "object-cover group-hover:scale-105 transition-transform duration-500", unoptimized: true }) }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col justify-between", children: [_jsxs("div", { children: [_jsxs("div", { className: "flex items-start justify-between gap-3 sm:gap-4", children: [_jsx("h3", { className: "min-w-0 flex-1 text-base font-bold leading-snug text-gray-900 sm:text-lg", children: item.product.name }), _jsx("p", { className: "shrink-0 text-right text-base font-black tabular-nums text-gray-900 sm:text-lg", children: formatCurrency(normalizePrice(item.price) * item.quantity, cartCurrency) })] }), _jsxs("div", { className: "flex flex-wrap gap-2 mt-2", children: [item.variantName && (_jsx("span", { className: "text-xs font-bold px-2 py-1 bg-gray-50 border border-gray-100 rounded-md text-gray-600", children: item.variantName })), lineStock.displayLabel && (_jsx("span", { className: `text-xs font-semibold px-2 py-1 rounded-md border ${lineStock.stockError
112
- ? 'bg-red-50 border-red-100 text-red-700'
113
- : lineStock.remainingToAdd === 0
114
- ? 'bg-gray-50 border-gray-100 text-gray-600'
115
- : 'bg-amber-50 border-amber-100 text-amber-800'}`, children: lineStock.displayLabel }))] })] }), _jsxs("div", { className: "flex justify-between items-end mt-6", children: [item.product.categoryId === 'subscriptions' || item.product.contentType ? (_jsx("div", { className: "text-xs font-bold text-gray-400 uppercase tracking-widest bg-gray-50 px-3 py-1.5 rounded-full border border-gray-100", children: "Digital Content" })) : (_jsx(CartLineQuantityControl, { quantity: item.quantity, product: item.product, disabled: removingItemId === item.id, isUpdating: updatingItemId === item.id, onError: (message) => addToast(message, 'error'), onUpdate: (nextQuantity) => handleQuantityUpdate(item.id, nextQuantity) })), _jsx("button", { onClick: async () => {
116
- setRemovingItemId(item.id);
117
- try {
118
- await removeFromCart(item.id);
119
- }
120
- finally {
121
- setRemovingItemId(null);
122
- }
123
- }, className: "text-gray-400 hover:text-red-500 transition-colors p-2 hover:bg-red-50 rounded-full disabled:opacity-50", "aria-label": "Remove item", disabled: isItemBusy, children: removingItemId === item.id ? (_jsx("div", { className: "w-5 h-5 border-2 border-red-400 border-t-transparent rounded-full animate-spin" })) : (_jsx(Trash2, { className: "w-5 h-5" })) })] })] })] }, item.id));
124
- }) }), _jsx("div", { className: "w-full lg:w-96 flex-shrink-0", children: _jsxs("div", { className: "bg-white rounded-3xl border border-gray-100 shadow-lg shadow-gray-200/50 p-8 sticky top-24", children: [_jsx("h2", { className: "text-2xl font-black text-gray-900 mb-8", children: "Summary" }), _jsxs("div", { className: "mb-8 space-y-4", children: [_jsxs("div", { className: "flex items-center justify-between gap-4 font-medium text-gray-600", children: [_jsx("span", { className: "shrink-0", children: "Subtotal" }), _jsx("span", { className: "shrink-0 text-right font-semibold tabular-nums text-gray-900", children: formatCurrency(subtotal, cartCurrency) })] }), feesLoading && (_jsxs("div", { className: "flex items-center justify-between gap-4 font-medium text-gray-600", children: [_jsx("span", { className: "shrink-0", children: "Fees" }), _jsx("span", { className: "shrink-0 text-right text-gray-400", children: "Calculating..." })] })), !feesLoading && (_jsx(CheckoutFeeLines, { lines: displayLines, currency: cartCurrency })), _jsxs("div", { className: "mt-4 flex items-end justify-between gap-4 border-t-2 border-gray-100 pt-6", children: [_jsx("span", { className: "shrink-0 text-lg font-bold text-gray-900", children: "Total" }), _jsx("span", { className: "shrink-0 text-right text-2xl font-black tracking-tight tabular-nums text-gray-900 sm:text-3xl", children: formatCurrency(total, cartCurrency) })] })] }), _jsxs("div", { className: "space-y-4", children: [hasStockIssues && (_jsx("p", { className: "text-sm text-red-600 font-medium", children: stockIssues[0] })), _jsx(Link, { href: hasStockIssues || checkoutDisabled ? '#' : `/${storeConfig.slug}/checkout`, onClick: (e) => {
125
- if (checkoutDisabled) {
126
- e.preventDefault();
127
- addToast(CHECKOUT_UNAVAILABLE_MESSAGE, 'error');
128
- return;
129
- }
130
- if (hasStockIssues) {
131
- e.preventDefault();
132
- addToast(stockIssues[0] || 'Some items in your cart are no longer available', 'error');
133
- }
134
- }, children: _jsxs(Button, { className: "w-full h-14 rounded-2xl text-lg font-bold shadow-xl transition-all hover:scale-[1.02] active:scale-[0.98] hover:shadow-2xl disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:scale-100", style: { backgroundColor: primaryColor, color: 'white' }, disabled: hasStockIssues || checkoutDisabled, children: [checkoutDisabled ? 'Checkout unavailable' : 'Checkout', " ", _jsx(ArrowRight, { className: "ml-2 w-5 h-5" })] }) }), checkoutDisabled && (_jsx("p", { className: "text-sm text-center text-gray-500", children: CHECKOUT_UNAVAILABLE_MESSAGE })), _jsxs("div", { className: "flex items-center justify-center gap-2 text-xs font-medium text-gray-400", children: [_jsx(Lock, { className: "w-3 h-3" }), "Secure Encrypted Checkout"] })] })] }) })] })] }) }));
59
+ return (_jsx("div", { className: "min-h-screen bg-gray-50/50 py-12 px-4 sm:px-6 lg:px-8", children: _jsxs("div", { className: "container mx-auto max-w-6xl", children: [_jsxs("div", { className: "mb-10 flex flex-col md:flex-row md:items-center justify-between gap-4", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Link, { href: `/${storeConfig.slug}`, className: "p-2 -ml-2 hover:bg-white rounded-full transition-colors text-gray-500 hover:text-black", children: _jsx(ArrowLeft, { className: "w-5 h-5" }) }), _jsxs("div", { children: [_jsx("h1", { className: "text-3xl font-black text-gray-900 tracking-tight", children: "Shopping Cart" }), _jsxs("p", { className: "text-gray-500 text-sm mt-1", children: [cart.length, " items in your cart"] })] })] }), _jsxs("div", { className: "flex items-center gap-2 text-sm font-medium bg-white px-4 py-2 rounded-full shadow-sm border border-gray-100", children: [_jsx("span", { className: "text-black", children: "Cart" }), _jsx("span", { className: "text-gray-300 mx-1", children: "/" }), _jsx("span", { className: "text-gray-400", children: "Checkout" }), _jsx("span", { className: "text-gray-300 mx-1", children: "/" }), _jsx("span", { className: "text-gray-400", children: "Payment" })] })] }), _jsxs("div", { className: "flex flex-col lg:flex-row gap-8 lg:gap-12", children: [_jsx("div", { className: "flex-1 space-y-6", children: cart.map((item) => (_jsxs("div", { className: "bg-white rounded-3xl p-4 sm:p-6 border border-gray-100 shadow-sm flex flex-row gap-4 sm:gap-6 group transition-all hover:shadow-md hover:border-gray-200", children: [_jsx("div", { className: "w-24 h-24 sm:w-32 sm:h-32 aspect-square bg-gray-100 rounded-2xl overflow-hidden flex-shrink-0 relative", children: _jsx(Image, { src: item.product.images[0], alt: item.product.name, fill: true, className: "object-cover group-hover:scale-105 transition-transform duration-500", unoptimized: true }) }), _jsxs("div", { className: "flex-1 flex flex-col justify-between", children: [_jsxs("div", { children: [_jsxs("div", { className: "flex justify-between items-start gap-4", children: [_jsx("h3", { className: "font-bold text-gray-900 text-lg leading-tight", children: item.product.name }), _jsx("p", { className: "font-black text-lg text-gray-900", children: formatCurrency(item.price * item.quantity, cartCurrency) })] }), _jsx("div", { className: "flex flex-wrap gap-2 mt-2", children: item.variantName && (_jsx("span", { className: "text-xs font-bold px-2 py-1 bg-gray-50 border border-gray-100 rounded-md text-gray-600", children: item.variantName })) })] }), _jsxs("div", { className: "flex justify-between items-end mt-6", children: [item.product.categoryId === 'subscriptions' || item.product.contentType ? (_jsx("div", { className: "text-xs font-bold text-gray-400 uppercase tracking-widest bg-gray-50 px-3 py-1.5 rounded-full border border-gray-100", children: "Digital Content" })) : (_jsxs("div", { className: "flex items-center gap-1 bg-gray-50 rounded-full p-1 border border-gray-200", children: [_jsx("button", { onClick: async () => {
60
+ setUpdatingItemId(item.id);
61
+ try {
62
+ await updateCartQuantity(item.id, item.quantity - 1);
63
+ }
64
+ finally {
65
+ setUpdatingItemId(null);
66
+ }
67
+ }, className: "w-8 h-8 flex items-center justify-center rounded-full bg-white shadow-sm hover:bg-gray-50 transition-colors disabled:opacity-50 text-gray-600", disabled: item.quantity <= 1 || updatingItemId === item.id || isCartLoading, children: updatingItemId === item.id ? (_jsx("div", { className: "w-3.5 h-3.5 border-2 border-gray-400 border-t-transparent rounded-full animate-spin" })) : (_jsx(Minus, { className: "w-3.5 h-3.5" })) }), _jsx("span", { className: "text-sm font-bold w-8 text-center text-gray-900", children: updatingItemId === item.id ? (_jsx("div", { className: "w-4 h-4 border-2 border-gray-400 border-t-transparent rounded-full animate-spin mx-auto" })) : (item.quantity) }), _jsx("button", { onClick: async () => {
68
+ setUpdatingItemId(item.id);
69
+ try {
70
+ await updateCartQuantity(item.id, item.quantity + 1);
71
+ }
72
+ finally {
73
+ setUpdatingItemId(null);
74
+ }
75
+ }, className: "w-8 h-8 flex items-center justify-center rounded-full bg-white shadow-sm hover:bg-gray-50 transition-colors disabled:opacity-50 text-gray-900", disabled: updatingItemId === item.id || isCartLoading, children: updatingItemId === item.id ? (_jsx("div", { className: "w-3.5 h-3.5 border-2 border-gray-400 border-t-transparent rounded-full animate-spin" })) : (_jsx(Plus, { className: "w-3.5 h-3.5" })) })] })), _jsx("button", { onClick: async () => {
76
+ setRemovingItemId(item.id);
77
+ try {
78
+ await removeFromCart(item.id);
79
+ }
80
+ finally {
81
+ setRemovingItemId(null);
82
+ }
83
+ }, className: "text-gray-400 hover:text-red-500 transition-colors p-2 hover:bg-red-50 rounded-full disabled:opacity-50", "aria-label": "Remove item", disabled: removingItemId === item.id || isCartLoading, children: removingItemId === item.id ? (_jsx("div", { className: "w-5 h-5 border-2 border-red-400 border-t-transparent rounded-full animate-spin" })) : (_jsx(Trash2, { className: "w-5 h-5" })) })] })] })] }, item.id))) }), _jsx("div", { className: "w-full lg:w-96 flex-shrink-0", children: _jsxs("div", { className: "bg-white rounded-3xl border border-gray-100 shadow-lg shadow-gray-200/50 p-8 sticky top-24", children: [_jsx("h2", { className: "text-2xl font-black text-gray-900 mb-8", children: "Summary" }), _jsxs("div", { className: "space-y-4 mb-8", children: [_jsxs("div", { className: "flex justify-between text-gray-600 font-medium", children: [_jsx("span", { children: "Subtotal" }), _jsx("span", { className: "text-gray-900", children: formatCurrency(subtotal, cartCurrency) })] }), vatAmount > 0 && (_jsxs("div", { className: "flex justify-between text-gray-600 font-medium", children: [_jsx("span", { children: vatLabel }), _jsx("span", { className: "text-gray-900", children: formatCurrency(vatAmount, cartCurrency) })] })), serviceChargeAmount > 0 && (_jsxs("div", { className: "flex justify-between text-gray-600 font-medium", children: [_jsx("span", { children: serviceChargeLabel }), _jsx("span", { className: "text-gray-900", children: formatCurrency(serviceChargeAmount, cartCurrency) })] })), _jsxs("div", { className: "pt-6 border-t-2 border-gray-100 flex justify-between items-end mt-4", children: [_jsx("span", { className: "text-lg font-bold text-gray-900", children: "Total" }), _jsx("span", { className: "text-4xl font-black text-gray-900 tracking-tight", children: formatCurrency(total, cartCurrency) })] })] }), _jsxs("div", { className: "space-y-4", children: [_jsx(Link, { href: `/${storeConfig.slug}/checkout`, children: _jsxs(Button, { className: "w-full h-14 rounded-2xl text-lg font-bold shadow-xl transition-all hover:scale-[1.02] active:scale-[0.98] hover:shadow-2xl", style: { backgroundColor: primaryColor, color: 'white' }, children: ["Checkout ", _jsx(ArrowRight, { className: "ml-2 w-5 h-5" })] }) }), _jsxs("div", { className: "flex items-center justify-center gap-2 text-xs font-medium text-gray-400", children: [_jsx(Lock, { className: "w-3 h-3" }), "Secure Encrypted Checkout"] })] })] }) })] })] }) }));
135
84
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/shared/pages/CheckoutPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAyFhD,UAAU,iBAAiB;IACzB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAUD,wBAAgB,YAAY,CAAC,EAAE,WAAW,EAAE,EAAE,iBAAiB,2CA2zE9D"}
1
+ {"version":3,"file":"CheckoutPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/shared/pages/CheckoutPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA4BhD,UAAU,iBAAiB;IACzB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,YAAY,CAAC,EAAE,WAAW,EAAE,EAAE,iBAAiB,2CAkmD9D"}