storefront-layouts 1.0.0

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 (1210) hide show
  1. package/README.md +546 -0
  2. package/dist/components/auth/LoginForm.d.ts +9 -0
  3. package/dist/components/auth/LoginForm.d.ts.map +1 -0
  4. package/dist/components/auth/LoginForm.js +21 -0
  5. package/dist/components/auth/LoginSheet.d.ts +7 -0
  6. package/dist/components/auth/LoginSheet.d.ts.map +1 -0
  7. package/dist/components/auth/LoginSheet.js +8 -0
  8. package/dist/components/auth/login-form-core.d.ts +11 -0
  9. package/dist/components/auth/login-form-core.d.ts.map +1 -0
  10. package/dist/components/auth/login-form-core.js +19 -0
  11. package/dist/components/auth/login-sheet-header.d.ts +10 -0
  12. package/dist/components/auth/login-sheet-header.d.ts.map +1 -0
  13. package/dist/components/auth/login-sheet-header.js +10 -0
  14. package/dist/components/auth/login-sheet-registry.d.ts +11 -0
  15. package/dist/components/auth/login-sheet-registry.d.ts.map +1 -0
  16. package/dist/components/auth/login-sheet-registry.js +9 -0
  17. package/dist/components/auth/login-sheet-theme.types.d.ts +29 -0
  18. package/dist/components/auth/login-sheet-theme.types.d.ts.map +1 -0
  19. package/dist/components/auth/login-sheet-theme.types.js +1 -0
  20. package/dist/components/auth/login-sheet-themes/booking-agenda.theme.d.ts +3 -0
  21. package/dist/components/auth/login-sheet-themes/booking-agenda.theme.d.ts.map +1 -0
  22. package/dist/components/auth/login-sheet-themes/booking-agenda.theme.js +21 -0
  23. package/dist/components/auth/login-sheet-themes/booking.theme.d.ts +3 -0
  24. package/dist/components/auth/login-sheet-themes/booking.theme.d.ts.map +1 -0
  25. package/dist/components/auth/login-sheet-themes/booking.theme.js +20 -0
  26. package/dist/components/auth/login-sheet-themes/clothing-minimal.theme.d.ts +3 -0
  27. package/dist/components/auth/login-sheet-themes/clothing-minimal.theme.d.ts.map +1 -0
  28. package/dist/components/auth/login-sheet-themes/clothing-minimal.theme.js +20 -0
  29. package/dist/components/auth/login-sheet-themes/clothing.theme.d.ts +3 -0
  30. package/dist/components/auth/login-sheet-themes/clothing.theme.d.ts.map +1 -0
  31. package/dist/components/auth/login-sheet-themes/clothing.theme.js +21 -0
  32. package/dist/components/auth/login-sheet-themes/electronics-grid.theme.d.ts +3 -0
  33. package/dist/components/auth/login-sheet-themes/electronics-grid.theme.d.ts.map +1 -0
  34. package/dist/components/auth/login-sheet-themes/electronics-grid.theme.js +20 -0
  35. package/dist/components/auth/login-sheet-themes/electronics.theme.d.ts +3 -0
  36. package/dist/components/auth/login-sheet-themes/electronics.theme.d.ts.map +1 -0
  37. package/dist/components/auth/login-sheet-themes/electronics.theme.js +20 -0
  38. package/dist/components/auth/login-sheet-themes/food-modern.theme.d.ts +3 -0
  39. package/dist/components/auth/login-sheet-themes/food-modern.theme.d.ts.map +1 -0
  40. package/dist/components/auth/login-sheet-themes/food-modern.theme.js +22 -0
  41. package/dist/components/auth/login-sheet-themes/food.theme.d.ts +3 -0
  42. package/dist/components/auth/login-sheet-themes/food.theme.d.ts.map +1 -0
  43. package/dist/components/auth/login-sheet-themes/food.theme.js +22 -0
  44. package/dist/components/auth/login-sheet-themes/index.d.ts +14 -0
  45. package/dist/components/auth/login-sheet-themes/index.d.ts.map +1 -0
  46. package/dist/components/auth/login-sheet-themes/index.js +29 -0
  47. package/dist/components/auth/login-sheet-themes/motivational-speaker.theme.d.ts +3 -0
  48. package/dist/components/auth/login-sheet-themes/motivational-speaker.theme.d.ts.map +1 -0
  49. package/dist/components/auth/login-sheet-themes/motivational-speaker.theme.js +20 -0
  50. package/dist/components/auth/login-sheet-themes/theme-input-baselines.d.ts +24 -0
  51. package/dist/components/auth/login-sheet-themes/theme-input-baselines.d.ts.map +1 -0
  52. package/dist/components/auth/login-sheet-themes/theme-input-baselines.js +23 -0
  53. package/dist/components/auth/login-sheets/StoreLoginSheetShell.d.ts +13 -0
  54. package/dist/components/auth/login-sheets/StoreLoginSheetShell.d.ts.map +1 -0
  55. package/dist/components/auth/login-sheets/StoreLoginSheetShell.js +14 -0
  56. package/dist/components/auth/use-login-submit.d.ts +22 -0
  57. package/dist/components/auth/use-login-submit.d.ts.map +1 -0
  58. package/dist/components/auth/use-login-submit.js +99 -0
  59. package/dist/components/cart/InventoryHoldCountdown.d.ts +8 -0
  60. package/dist/components/cart/InventoryHoldCountdown.d.ts.map +1 -0
  61. package/dist/components/cart/InventoryHoldCountdown.js +73 -0
  62. package/dist/components/categories/category-masonry-grid.d.ts +18 -0
  63. package/dist/components/categories/category-masonry-grid.d.ts.map +1 -0
  64. package/dist/components/categories/category-masonry-grid.js +50 -0
  65. package/dist/components/categories/category-masonry-utils.d.ts +9 -0
  66. package/dist/components/categories/category-masonry-utils.d.ts.map +1 -0
  67. package/dist/components/categories/category-masonry-utils.js +67 -0
  68. package/dist/components/checkout/CheckoutFeeLines.d.ts +12 -0
  69. package/dist/components/checkout/CheckoutFeeLines.d.ts.map +1 -0
  70. package/dist/components/checkout/CheckoutFeeLines.js +9 -0
  71. package/dist/components/checkout/ShippingOptionsPanel.d.ts +54 -0
  72. package/dist/components/checkout/ShippingOptionsPanel.d.ts.map +1 -0
  73. package/dist/components/checkout/ShippingOptionsPanel.js +115 -0
  74. package/dist/components/learning/CertificateTemplates.d.ts +25 -0
  75. package/dist/components/learning/CertificateTemplates.d.ts.map +1 -0
  76. package/dist/components/learning/CertificateTemplates.js +31 -0
  77. package/dist/components/learning/CertificateViewer.d.ts +11 -0
  78. package/dist/components/learning/CertificateViewer.d.ts.map +1 -0
  79. package/dist/components/learning/CertificateViewer.js +114 -0
  80. package/dist/components/learning/MentorshipProgress.d.ts +18 -0
  81. package/dist/components/learning/MentorshipProgress.d.ts.map +1 -0
  82. package/dist/components/learning/MentorshipProgress.js +20 -0
  83. package/dist/components/product/ProductVariationSelectors.d.ts +12 -0
  84. package/dist/components/product/ProductVariationSelectors.d.ts.map +1 -0
  85. package/dist/components/product/ProductVariationSelectors.js +46 -0
  86. package/dist/components/rich-text/CategoryDescription.d.ts +7 -0
  87. package/dist/components/rich-text/CategoryDescription.d.ts.map +1 -0
  88. package/dist/components/rich-text/CategoryDescription.js +11 -0
  89. package/dist/components/rich-text/ProductDescription.d.ts +9 -0
  90. package/dist/components/rich-text/ProductDescription.d.ts.map +1 -0
  91. package/dist/components/rich-text/ProductDescription.js +10 -0
  92. package/dist/components/rich-text/RichTextExcerpt.d.ts +10 -0
  93. package/dist/components/rich-text/RichTextExcerpt.d.ts.map +1 -0
  94. package/dist/components/rich-text/RichTextExcerpt.js +12 -0
  95. package/dist/components/rich-text/SafeRichHtml.d.ts +14 -0
  96. package/dist/components/rich-text/SafeRichHtml.d.ts.map +1 -0
  97. package/dist/components/rich-text/SafeRichHtml.js +15 -0
  98. package/dist/components/shipping/MerchantHandledDeliveryNotice.d.ts +7 -0
  99. package/dist/components/shipping/MerchantHandledDeliveryNotice.d.ts.map +1 -0
  100. package/dist/components/shipping/MerchantHandledDeliveryNotice.js +7 -0
  101. package/dist/components/shipping/ProductDeliveryInfoSection.d.ts +21 -0
  102. package/dist/components/shipping/ProductDeliveryInfoSection.d.ts.map +1 -0
  103. package/dist/components/shipping/ProductDeliveryInfoSection.js +22 -0
  104. package/dist/components/shipping/ShippingQuoteAddressForm.d.ts +11 -0
  105. package/dist/components/shipping/ShippingQuoteAddressForm.d.ts.map +1 -0
  106. package/dist/components/shipping/ShippingQuoteAddressForm.js +66 -0
  107. package/dist/components/ui/address-selector.d.ts +11 -0
  108. package/dist/components/ui/address-selector.d.ts.map +1 -0
  109. package/dist/components/ui/address-selector.js +21 -0
  110. package/dist/components/ui/alert-modal.d.ts +21 -0
  111. package/dist/components/ui/alert-modal.d.ts.map +1 -0
  112. package/dist/components/ui/alert-modal.js +59 -0
  113. package/dist/components/ui/avatar-image.d.ts +11 -0
  114. package/dist/components/ui/avatar-image.d.ts.map +1 -0
  115. package/dist/components/ui/avatar-image.js +39 -0
  116. package/dist/components/ui/background-patterns.d.ts +27 -0
  117. package/dist/components/ui/background-patterns.d.ts.map +1 -0
  118. package/dist/components/ui/background-patterns.js +5 -0
  119. package/dist/components/ui/badge.d.ts +10 -0
  120. package/dist/components/ui/badge.d.ts.map +1 -0
  121. package/dist/components/ui/badge.js +20 -0
  122. package/dist/components/ui/breadcrumbs.d.ts +12 -0
  123. package/dist/components/ui/breadcrumbs.d.ts.map +1 -0
  124. package/dist/components/ui/breadcrumbs.js +12 -0
  125. package/dist/components/ui/button.d.ts +11 -0
  126. package/dist/components/ui/button.d.ts.map +1 -0
  127. package/dist/components/ui/button.js +34 -0
  128. package/dist/components/ui/card.d.ts +10 -0
  129. package/dist/components/ui/card.d.ts.map +1 -0
  130. package/dist/components/ui/card.js +24 -0
  131. package/dist/components/ui/category-tree.d.ts +16 -0
  132. package/dist/components/ui/category-tree.d.ts.map +1 -0
  133. package/dist/components/ui/category-tree.js +74 -0
  134. package/dist/components/ui/checkout-button.d.ts +11 -0
  135. package/dist/components/ui/checkout-button.d.ts.map +1 -0
  136. package/dist/components/ui/checkout-button.js +298 -0
  137. package/dist/components/ui/dynamic-icon.d.ts +11 -0
  138. package/dist/components/ui/dynamic-icon.d.ts.map +1 -0
  139. package/dist/components/ui/dynamic-icon.js +77 -0
  140. package/dist/components/ui/guest-checkout-modal.d.ts +19 -0
  141. package/dist/components/ui/guest-checkout-modal.d.ts.map +1 -0
  142. package/dist/components/ui/guest-checkout-modal.js +95 -0
  143. package/dist/components/ui/image-skeleton.d.ts +7 -0
  144. package/dist/components/ui/image-skeleton.d.ts.map +1 -0
  145. package/dist/components/ui/image-skeleton.js +15 -0
  146. package/dist/components/ui/image-with-fallback.d.ts +10 -0
  147. package/dist/components/ui/image-with-fallback.d.ts.map +1 -0
  148. package/dist/components/ui/image-with-fallback.js +165 -0
  149. package/dist/components/ui/input.d.ts +6 -0
  150. package/dist/components/ui/input.d.ts.map +1 -0
  151. package/dist/components/ui/input.js +8 -0
  152. package/dist/components/ui/limited-time-offer-badge.d.ts +12 -0
  153. package/dist/components/ui/limited-time-offer-badge.d.ts.map +1 -0
  154. package/dist/components/ui/limited-time-offer-badge.js +13 -0
  155. package/dist/components/ui/loading-skeleton-wrapper.d.ts +6 -0
  156. package/dist/components/ui/loading-skeleton-wrapper.d.ts.map +1 -0
  157. package/dist/components/ui/loading-skeleton-wrapper.js +10 -0
  158. package/dist/components/ui/modal.d.ts +11 -0
  159. package/dist/components/ui/modal.d.ts.map +1 -0
  160. package/dist/components/ui/modal.js +26 -0
  161. package/dist/components/ui/otp-input.d.ts +10 -0
  162. package/dist/components/ui/otp-input.d.ts.map +1 -0
  163. package/dist/components/ui/otp-input.js +57 -0
  164. package/dist/components/ui/out-of-stock-overlay.d.ts +8 -0
  165. package/dist/components/ui/out-of-stock-overlay.d.ts.map +1 -0
  166. package/dist/components/ui/out-of-stock-overlay.js +12 -0
  167. package/dist/components/ui/page-animate-wrapper.d.ts +7 -0
  168. package/dist/components/ui/page-animate-wrapper.d.ts.map +1 -0
  169. package/dist/components/ui/page-animate-wrapper.js +13 -0
  170. package/dist/components/ui/page-content-loader.d.ts +13 -0
  171. package/dist/components/ui/page-content-loader.d.ts.map +1 -0
  172. package/dist/components/ui/page-content-loader.js +12 -0
  173. package/dist/components/ui/page-loader.d.ts +20 -0
  174. package/dist/components/ui/page-loader.d.ts.map +1 -0
  175. package/dist/components/ui/page-loader.js +31 -0
  176. package/dist/components/ui/product-card.d.ts +11 -0
  177. package/dist/components/ui/product-card.d.ts.map +1 -0
  178. package/dist/components/ui/product-card.js +139 -0
  179. package/dist/components/ui/product-rating.d.ts +17 -0
  180. package/dist/components/ui/product-rating.d.ts.map +1 -0
  181. package/dist/components/ui/product-rating.js +54 -0
  182. package/dist/components/ui/product-stock-badge.d.ts +9 -0
  183. package/dist/components/ui/product-stock-badge.d.ts.map +1 -0
  184. package/dist/components/ui/product-stock-badge.js +20 -0
  185. package/dist/components/ui/review-form.d.ts +9 -0
  186. package/dist/components/ui/review-form.d.ts.map +1 -0
  187. package/dist/components/ui/review-form.js +28 -0
  188. package/dist/components/ui/route-skeleton-loader.d.ts +7 -0
  189. package/dist/components/ui/route-skeleton-loader.d.ts.map +1 -0
  190. package/dist/components/ui/route-skeleton-loader.js +75 -0
  191. package/dist/components/ui/sheet.d.ts +29 -0
  192. package/dist/components/ui/sheet.d.ts.map +1 -0
  193. package/dist/components/ui/sheet.js +45 -0
  194. package/dist/components/ui/skeleton.d.ts +3 -0
  195. package/dist/components/ui/skeleton.d.ts.map +1 -0
  196. package/dist/components/ui/skeleton.js +6 -0
  197. package/dist/components/ui/skeletons/category-grid-skeleton.d.ts +6 -0
  198. package/dist/components/ui/skeletons/category-grid-skeleton.d.ts.map +1 -0
  199. package/dist/components/ui/skeletons/category-grid-skeleton.js +9 -0
  200. package/dist/components/ui/skeletons/checkout-skeleton.d.ts +2 -0
  201. package/dist/components/ui/skeletons/checkout-skeleton.d.ts.map +1 -0
  202. package/dist/components/ui/skeletons/checkout-skeleton.js +4 -0
  203. package/dist/components/ui/skeletons/index.d.ts +6 -0
  204. package/dist/components/ui/skeletons/index.d.ts.map +1 -0
  205. package/dist/components/ui/skeletons/index.js +5 -0
  206. package/dist/components/ui/skeletons/page-skeleton.d.ts +2 -0
  207. package/dist/components/ui/skeletons/page-skeleton.d.ts.map +1 -0
  208. package/dist/components/ui/skeletons/page-skeleton.js +4 -0
  209. package/dist/components/ui/skeletons/product-card-skeleton.d.ts +2 -0
  210. package/dist/components/ui/skeletons/product-card-skeleton.d.ts.map +1 -0
  211. package/dist/components/ui/skeletons/product-card-skeleton.js +4 -0
  212. package/dist/components/ui/skeletons/product-detail-skeleton.d.ts +2 -0
  213. package/dist/components/ui/skeletons/product-detail-skeleton.d.ts.map +1 -0
  214. package/dist/components/ui/skeletons/product-detail-skeleton.js +4 -0
  215. package/dist/components/ui/skeletons/product-grid-skeleton.d.ts +7 -0
  216. package/dist/components/ui/skeletons/product-grid-skeleton.d.ts.map +1 -0
  217. package/dist/components/ui/skeletons/product-grid-skeleton.js +12 -0
  218. package/dist/components/ui/store-logos.d.ts +43 -0
  219. package/dist/components/ui/store-logos.d.ts.map +1 -0
  220. package/dist/components/ui/store-logos.js +83 -0
  221. package/dist/components/ui/toast.d.ts +20 -0
  222. package/dist/components/ui/toast.d.ts.map +1 -0
  223. package/dist/components/ui/toast.js +33 -0
  224. package/dist/components/ui/video-player.d.ts +48 -0
  225. package/dist/components/ui/video-player.d.ts.map +1 -0
  226. package/dist/components/ui/video-player.js +101 -0
  227. package/dist/editor/alignment-schemas/booking-agenda.d.ts +3 -0
  228. package/dist/editor/alignment-schemas/booking-agenda.d.ts.map +1 -0
  229. package/dist/editor/alignment-schemas/booking-agenda.js +145 -0
  230. package/dist/editor/alignment-schemas/booking-footer-section.d.ts +4 -0
  231. package/dist/editor/alignment-schemas/booking-footer-section.d.ts.map +1 -0
  232. package/dist/editor/alignment-schemas/booking-footer-section.js +69 -0
  233. package/dist/editor/alignment-schemas/booking.d.ts +3 -0
  234. package/dist/editor/alignment-schemas/booking.d.ts.map +1 -0
  235. package/dist/editor/alignment-schemas/booking.js +476 -0
  236. package/dist/editor/alignment-schemas/clothing-minimal.d.ts +3 -0
  237. package/dist/editor/alignment-schemas/clothing-minimal.d.ts.map +1 -0
  238. package/dist/editor/alignment-schemas/clothing-minimal.js +363 -0
  239. package/dist/editor/alignment-schemas/clothing.d.ts +3 -0
  240. package/dist/editor/alignment-schemas/clothing.d.ts.map +1 -0
  241. package/dist/editor/alignment-schemas/clothing.js +477 -0
  242. package/dist/editor/alignment-schemas/electronics-grid.d.ts +3 -0
  243. package/dist/editor/alignment-schemas/electronics-grid.d.ts.map +1 -0
  244. package/dist/editor/alignment-schemas/electronics-grid.js +97 -0
  245. package/dist/editor/alignment-schemas/electronics.d.ts +3 -0
  246. package/dist/editor/alignment-schemas/electronics.d.ts.map +1 -0
  247. package/dist/editor/alignment-schemas/electronics.js +145 -0
  248. package/dist/editor/alignment-schemas/food-modern.d.ts +3 -0
  249. package/dist/editor/alignment-schemas/food-modern.d.ts.map +1 -0
  250. package/dist/editor/alignment-schemas/food-modern.js +237 -0
  251. package/dist/editor/alignment-schemas/food.d.ts +3 -0
  252. package/dist/editor/alignment-schemas/food.d.ts.map +1 -0
  253. package/dist/editor/alignment-schemas/food.js +494 -0
  254. package/dist/editor/alignment-schemas/index.d.ts +15 -0
  255. package/dist/editor/alignment-schemas/index.d.ts.map +1 -0
  256. package/dist/editor/alignment-schemas/index.js +50 -0
  257. package/dist/editor/alignment-schemas/lazy-loader.d.ts +14 -0
  258. package/dist/editor/alignment-schemas/lazy-loader.d.ts.map +1 -0
  259. package/dist/editor/alignment-schemas/lazy-loader.js +80 -0
  260. package/dist/editor/alignment-schemas/metadata.d.ts +25 -0
  261. package/dist/editor/alignment-schemas/metadata.d.ts.map +1 -0
  262. package/dist/editor/alignment-schemas/metadata.js +225 -0
  263. package/dist/editor/alignment-schemas/motivational-speaker.d.ts +3 -0
  264. package/dist/editor/alignment-schemas/motivational-speaker.d.ts.map +1 -0
  265. package/dist/editor/alignment-schemas/motivational-speaker.js +185 -0
  266. package/dist/editor/alignment-schemas/resolve-canvas-inspector-leaf.d.ts +18 -0
  267. package/dist/editor/alignment-schemas/resolve-canvas-inspector-leaf.d.ts.map +1 -0
  268. package/dist/editor/alignment-schemas/resolve-canvas-inspector-leaf.js +166 -0
  269. package/dist/editor/alignment-schemas/resolve-field.d.ts +9 -0
  270. package/dist/editor/alignment-schemas/resolve-field.d.ts.map +1 -0
  271. package/dist/editor/alignment-schemas/resolve-field.js +56 -0
  272. package/dist/editor/alignment-schemas/types.d.ts +53 -0
  273. package/dist/editor/alignment-schemas/types.d.ts.map +1 -0
  274. package/dist/editor/alignment-schemas/types.js +1 -0
  275. package/dist/editor/blocks/defaults/clothing-minimal-home.d.ts +9 -0
  276. package/dist/editor/blocks/defaults/clothing-minimal-home.d.ts.map +1 -0
  277. package/dist/editor/blocks/defaults/clothing-minimal-home.js +207 -0
  278. package/dist/editor/blocks/index.d.ts +4 -0
  279. package/dist/editor/blocks/index.d.ts.map +1 -0
  280. package/dist/editor/blocks/index.js +3 -0
  281. package/dist/editor/blocks/migrate-clothing-minimal.d.ts +5 -0
  282. package/dist/editor/blocks/migrate-clothing-minimal.d.ts.map +1 -0
  283. package/dist/editor/blocks/migrate-clothing-minimal.js +140 -0
  284. package/dist/editor/blocks/nav-outline-utils.d.ts +47 -0
  285. package/dist/editor/blocks/nav-outline-utils.d.ts.map +1 -0
  286. package/dist/editor/blocks/nav-outline-utils.js +201 -0
  287. package/dist/editor/blocks/registry.d.ts +19 -0
  288. package/dist/editor/blocks/registry.d.ts.map +1 -0
  289. package/dist/editor/blocks/registry.js +118 -0
  290. package/dist/editor/blocks/types.d.ts +14 -0
  291. package/dist/editor/blocks/types.d.ts.map +1 -0
  292. package/dist/editor/blocks/types.js +14 -0
  293. package/dist/editor/document/adapter.d.ts +44 -0
  294. package/dist/editor/document/adapter.d.ts.map +1 -0
  295. package/dist/editor/document/adapter.js +159 -0
  296. package/dist/editor/document/block-tree.d.ts +46 -0
  297. package/dist/editor/document/block-tree.d.ts.map +1 -0
  298. package/dist/editor/document/block-tree.js +345 -0
  299. package/dist/editor/document/constants.d.ts +6 -0
  300. package/dist/editor/document/constants.d.ts.map +1 -0
  301. package/dist/editor/document/constants.js +14 -0
  302. package/dist/editor/document/index.d.ts +7 -0
  303. package/dist/editor/document/index.d.ts.map +1 -0
  304. package/dist/editor/document/index.js +6 -0
  305. package/dist/editor/document/layout-id.d.ts +3 -0
  306. package/dist/editor/document/layout-id.d.ts.map +1 -0
  307. package/dist/editor/document/layout-id.js +17 -0
  308. package/dist/editor/document/types.d.ts +91 -0
  309. package/dist/editor/document/types.d.ts.map +1 -0
  310. package/dist/editor/document/types.js +1 -0
  311. package/dist/editor/document/validate.d.ts +11 -0
  312. package/dist/editor/document/validate.d.ts.map +1 -0
  313. package/dist/editor/document/validate.js +92 -0
  314. package/dist/editor/feature-flags.d.ts +11 -0
  315. package/dist/editor/feature-flags.d.ts.map +1 -0
  316. package/dist/editor/feature-flags.js +19 -0
  317. package/dist/editor/index.d.ts +28 -0
  318. package/dist/editor/index.d.ts.map +1 -0
  319. package/dist/editor/index.js +72 -0
  320. package/dist/editor/layout-content-loader.d.ts +13 -0
  321. package/dist/editor/layout-content-loader.d.ts.map +1 -0
  322. package/dist/editor/layout-content-loader.js +222 -0
  323. package/dist/editor/payaza-form/ActiveArrayFocusContext.d.ts +20 -0
  324. package/dist/editor/payaza-form/ActiveArrayFocusContext.d.ts.map +1 -0
  325. package/dist/editor/payaza-form/ActiveArrayFocusContext.js +31 -0
  326. package/dist/editor/payaza-form/ArrayItemManager.d.ts +19 -0
  327. package/dist/editor/payaza-form/ArrayItemManager.d.ts.map +1 -0
  328. package/dist/editor/payaza-form/ArrayItemManager.js +62 -0
  329. package/dist/editor/payaza-form/AssetSelectionContext.d.ts +17 -0
  330. package/dist/editor/payaza-form/AssetSelectionContext.d.ts.map +1 -0
  331. package/dist/editor/payaza-form/AssetSelectionContext.js +81 -0
  332. package/dist/editor/payaza-form/EditorCanvasPreview.d.ts +41 -0
  333. package/dist/editor/payaza-form/EditorCanvasPreview.d.ts.map +1 -0
  334. package/dist/editor/payaza-form/EditorCanvasPreview.js +56 -0
  335. package/dist/editor/payaza-form/EditorLayoutContext.d.ts +8 -0
  336. package/dist/editor/payaza-form/EditorLayoutContext.d.ts.map +1 -0
  337. package/dist/editor/payaza-form/EditorLayoutContext.js +6 -0
  338. package/dist/editor/payaza-form/FieldRenderer.d.ts +16 -0
  339. package/dist/editor/payaza-form/FieldRenderer.d.ts.map +1 -0
  340. package/dist/editor/payaza-form/FieldRenderer.js +192 -0
  341. package/dist/editor/payaza-form/IframePreviewMessageBridge.d.ts +29 -0
  342. package/dist/editor/payaza-form/IframePreviewMessageBridge.d.ts.map +1 -0
  343. package/dist/editor/payaza-form/IframePreviewMessageBridge.js +46 -0
  344. package/dist/editor/payaza-form/PayazaFormEditor.d.ts +12 -0
  345. package/dist/editor/payaza-form/PayazaFormEditor.d.ts.map +1 -0
  346. package/dist/editor/payaza-form/PayazaFormEditor.js +1226 -0
  347. package/dist/editor/payaza-form/PayazaFormEditorFullPage.d.ts +9 -0
  348. package/dist/editor/payaza-form/PayazaFormEditorFullPage.d.ts.map +1 -0
  349. package/dist/editor/payaza-form/PayazaFormEditorFullPage.js +6 -0
  350. package/dist/editor/payaza-form/SliderArrayEditor.d.ts +17 -0
  351. package/dist/editor/payaza-form/SliderArrayEditor.d.ts.map +1 -0
  352. package/dist/editor/payaza-form/SliderArrayEditor.js +96 -0
  353. package/dist/editor/payaza-form/components/ArrayField.d.ts +21 -0
  354. package/dist/editor/payaza-form/components/ArrayField.d.ts.map +1 -0
  355. package/dist/editor/payaza-form/components/ArrayField.js +18 -0
  356. package/dist/editor/payaza-form/components/BlockStylesInspector.d.ts +9 -0
  357. package/dist/editor/payaza-form/components/BlockStylesInspector.d.ts.map +1 -0
  358. package/dist/editor/payaza-form/components/BlockStylesInspector.js +150 -0
  359. package/dist/editor/payaza-form/components/BlocksField.d.ts +17 -0
  360. package/dist/editor/payaza-form/components/BlocksField.d.ts.map +1 -0
  361. package/dist/editor/payaza-form/components/BlocksField.js +108 -0
  362. package/dist/editor/payaza-form/components/ButtonField.d.ts +15 -0
  363. package/dist/editor/payaza-form/components/ButtonField.d.ts.map +1 -0
  364. package/dist/editor/payaza-form/components/ButtonField.js +17 -0
  365. package/dist/editor/payaza-form/components/CanvasGranularInspector.d.ts +16 -0
  366. package/dist/editor/payaza-form/components/CanvasGranularInspector.d.ts.map +1 -0
  367. package/dist/editor/payaza-form/components/CanvasGranularInspector.js +32 -0
  368. package/dist/editor/payaza-form/components/FieldDensityContext.d.ts +10 -0
  369. package/dist/editor/payaza-form/components/FieldDensityContext.d.ts.map +1 -0
  370. package/dist/editor/payaza-form/components/FieldDensityContext.js +13 -0
  371. package/dist/editor/payaza-form/components/IconField.d.ts +12 -0
  372. package/dist/editor/payaza-form/components/IconField.d.ts.map +1 -0
  373. package/dist/editor/payaza-form/components/IconField.js +42 -0
  374. package/dist/editor/payaza-form/components/ImageField.d.ts +10 -0
  375. package/dist/editor/payaza-form/components/ImageField.d.ts.map +1 -0
  376. package/dist/editor/payaza-form/components/ImageField.js +30 -0
  377. package/dist/editor/payaza-form/components/NumberField.d.ts +14 -0
  378. package/dist/editor/payaza-form/components/NumberField.d.ts.map +1 -0
  379. package/dist/editor/payaza-form/components/NumberField.js +23 -0
  380. package/dist/editor/payaza-form/components/ObjectField.d.ts +11 -0
  381. package/dist/editor/payaza-form/components/ObjectField.d.ts.map +1 -0
  382. package/dist/editor/payaza-form/components/ObjectField.js +7 -0
  383. package/dist/editor/payaza-form/components/RichTextField.d.ts +15 -0
  384. package/dist/editor/payaza-form/components/RichTextField.d.ts.map +1 -0
  385. package/dist/editor/payaza-form/components/RichTextField.js +88 -0
  386. package/dist/editor/payaza-form/components/SectionField.d.ts +14 -0
  387. package/dist/editor/payaza-form/components/SectionField.d.ts.map +1 -0
  388. package/dist/editor/payaza-form/components/SectionField.js +8 -0
  389. package/dist/editor/payaza-form/components/SectionSchemaInspector.d.ts +18 -0
  390. package/dist/editor/payaza-form/components/SectionSchemaInspector.d.ts.map +1 -0
  391. package/dist/editor/payaza-form/components/SectionSchemaInspector.js +64 -0
  392. package/dist/editor/payaza-form/components/SegmentedControlField.d.ts +13 -0
  393. package/dist/editor/payaza-form/components/SegmentedControlField.d.ts.map +1 -0
  394. package/dist/editor/payaza-form/components/SegmentedControlField.js +7 -0
  395. package/dist/editor/payaza-form/components/StarRatingField.d.ts +13 -0
  396. package/dist/editor/payaza-form/components/StarRatingField.d.ts.map +1 -0
  397. package/dist/editor/payaza-form/components/StarRatingField.js +16 -0
  398. package/dist/editor/payaza-form/components/TextField.d.ts +13 -0
  399. package/dist/editor/payaza-form/components/TextField.d.ts.map +1 -0
  400. package/dist/editor/payaza-form/components/TextField.js +12 -0
  401. package/dist/editor/payaza-form/components/TextareaField.d.ts +11 -0
  402. package/dist/editor/payaza-form/components/TextareaField.d.ts.map +1 -0
  403. package/dist/editor/payaza-form/components/TextareaField.js +6 -0
  404. package/dist/editor/payaza-form/components/ToggleField.d.ts +12 -0
  405. package/dist/editor/payaza-form/components/ToggleField.d.ts.map +1 -0
  406. package/dist/editor/payaza-form/components/ToggleField.js +15 -0
  407. package/dist/editor/payaza-form/data-merger.d.ts +28 -0
  408. package/dist/editor/payaza-form/data-merger.d.ts.map +1 -0
  409. package/dist/editor/payaza-form/data-merger.js +878 -0
  410. package/dist/editor/payaza-form/data-transformer.d.ts +28 -0
  411. package/dist/editor/payaza-form/data-transformer.d.ts.map +1 -0
  412. package/dist/editor/payaza-form/data-transformer.js +304 -0
  413. package/dist/editor/payaza-form/engine.d.ts +72 -0
  414. package/dist/editor/payaza-form/engine.d.ts.map +1 -0
  415. package/dist/editor/payaza-form/engine.js +140 -0
  416. package/dist/editor/payaza-form/examples/custom-widgets.example.d.ts +8 -0
  417. package/dist/editor/payaza-form/examples/custom-widgets.example.d.ts.map +1 -0
  418. package/dist/editor/payaza-form/examples/custom-widgets.example.js +51 -0
  419. package/dist/editor/payaza-form/field-renderer-ref.d.ts +4 -0
  420. package/dist/editor/payaza-form/field-renderer-ref.d.ts.map +1 -0
  421. package/dist/editor/payaza-form/field-renderer-ref.js +16 -0
  422. package/dist/editor/payaza-form/index.d.ts +11 -0
  423. package/dist/editor/payaza-form/index.d.ts.map +1 -0
  424. package/dist/editor/payaza-form/index.js +8 -0
  425. package/dist/editor/payaza-form/layout-loader.d.ts +12 -0
  426. package/dist/editor/payaza-form/layout-loader.d.ts.map +1 -0
  427. package/dist/editor/payaza-form/layout-loader.js +43 -0
  428. package/dist/editor/payaza-form/payaza-style-sanitize.d.ts +14 -0
  429. package/dist/editor/payaza-form/payaza-style-sanitize.d.ts.map +1 -0
  430. package/dist/editor/payaza-form/payaza-style-sanitize.js +76 -0
  431. package/dist/editor/payaza-form/preview-message-handler.d.ts +18 -0
  432. package/dist/editor/payaza-form/preview-message-handler.d.ts.map +1 -0
  433. package/dist/editor/payaza-form/preview-message-handler.js +89 -0
  434. package/dist/editor/payaza-form/schema-bridge.d.ts +12 -0
  435. package/dist/editor/payaza-form/schema-bridge.d.ts.map +1 -0
  436. package/dist/editor/payaza-form/schema-bridge.js +90 -0
  437. package/dist/editor/payaza-form/widget-registry.d.ts +94 -0
  438. package/dist/editor/payaza-form/widget-registry.d.ts.map +1 -0
  439. package/dist/editor/payaza-form/widget-registry.js +107 -0
  440. package/dist/editor/shared/AIGenerateModal.d.ts +17 -0
  441. package/dist/editor/shared/AIGenerateModal.d.ts.map +1 -0
  442. package/dist/editor/shared/AIGenerateModal.js +59 -0
  443. package/dist/editor/shared/BlockOutlineTree.d.ts +14 -0
  444. package/dist/editor/shared/BlockOutlineTree.d.ts.map +1 -0
  445. package/dist/editor/shared/BlockOutlineTree.js +47 -0
  446. package/dist/editor/shared/EditorHeader.d.ts +61 -0
  447. package/dist/editor/shared/EditorHeader.d.ts.map +1 -0
  448. package/dist/editor/shared/EditorHeader.js +181 -0
  449. package/dist/editor/shared/EditorNavigator.d.ts +42 -0
  450. package/dist/editor/shared/EditorNavigator.d.ts.map +1 -0
  451. package/dist/editor/shared/EditorNavigator.js +44 -0
  452. package/dist/editor/shared/IframePreview.d.ts +36 -0
  453. package/dist/editor/shared/IframePreview.d.ts.map +1 -0
  454. package/dist/editor/shared/IframePreview.js +217 -0
  455. package/dist/editor/shared/InlineCanvasPreview.d.ts +36 -0
  456. package/dist/editor/shared/InlineCanvasPreview.d.ts.map +1 -0
  457. package/dist/editor/shared/InlineCanvasPreview.js +174 -0
  458. package/dist/editor/shared/LayoutRenderer.d.ts +11 -0
  459. package/dist/editor/shared/LayoutRenderer.d.ts.map +1 -0
  460. package/dist/editor/shared/LayoutRenderer.js +7 -0
  461. package/dist/editor/shared/PageTabs.d.ts +13 -0
  462. package/dist/editor/shared/PageTabs.d.ts.map +1 -0
  463. package/dist/editor/shared/PageTabs.js +6 -0
  464. package/dist/editor/shared/ResizableSidebar.d.ts +14 -0
  465. package/dist/editor/shared/ResizableSidebar.d.ts.map +1 -0
  466. package/dist/editor/shared/ResizableSidebar.js +45 -0
  467. package/dist/editor/shared/index.d.ts +8 -0
  468. package/dist/editor/shared/index.d.ts.map +1 -0
  469. package/dist/editor/shared/index.js +7 -0
  470. package/dist/editor/shared/preview-viewport.d.ts +9 -0
  471. package/dist/editor/shared/preview-viewport.d.ts.map +1 -0
  472. package/dist/editor/shared/preview-viewport.js +17 -0
  473. package/dist/editor/shared/useEditorChromeMetrics.d.ts +15 -0
  474. package/dist/editor/shared/useEditorChromeMetrics.d.ts.map +1 -0
  475. package/dist/editor/shared/useEditorChromeMetrics.js +52 -0
  476. package/dist/editor/types.d.ts +162 -0
  477. package/dist/editor/types.d.ts.map +1 -0
  478. package/dist/editor/types.js +1 -0
  479. package/dist/hooks/use-analytics.d.ts +15 -0
  480. package/dist/hooks/use-analytics.d.ts.map +1 -0
  481. package/dist/hooks/use-analytics.js +62 -0
  482. package/dist/hooks/use-api.d.ts +17 -0
  483. package/dist/hooks/use-api.d.ts.map +1 -0
  484. package/dist/hooks/use-api.js +53 -0
  485. package/dist/hooks/use-cart-api.d.ts +28 -0
  486. package/dist/hooks/use-cart-api.d.ts.map +1 -0
  487. package/dist/hooks/use-cart-api.js +116 -0
  488. package/dist/hooks/use-catalog-loader.d.ts +19 -0
  489. package/dist/hooks/use-catalog-loader.d.ts.map +1 -0
  490. package/dist/hooks/use-catalog-loader.js +107 -0
  491. package/dist/hooks/use-catalog-price-range.d.ts +17 -0
  492. package/dist/hooks/use-catalog-price-range.d.ts.map +1 -0
  493. package/dist/hooks/use-catalog-price-range.js +26 -0
  494. package/dist/hooks/use-checkout-fees.d.ts +16 -0
  495. package/dist/hooks/use-checkout-fees.d.ts.map +1 -0
  496. package/dist/hooks/use-checkout-fees.js +105 -0
  497. package/dist/hooks/use-content-ready.d.ts +17 -0
  498. package/dist/hooks/use-content-ready.d.ts.map +1 -0
  499. package/dist/hooks/use-content-ready.js +197 -0
  500. package/dist/hooks/use-debounce.d.ts +6 -0
  501. package/dist/hooks/use-debounce.d.ts.map +1 -0
  502. package/dist/hooks/use-debounce.js +17 -0
  503. package/dist/hooks/use-multi-store-checkout-fees.d.ts +25 -0
  504. package/dist/hooks/use-multi-store-checkout-fees.d.ts.map +1 -0
  505. package/dist/hooks/use-multi-store-checkout-fees.js +116 -0
  506. package/dist/hooks/use-navigation-loading.d.ts +4 -0
  507. package/dist/hooks/use-navigation-loading.d.ts.map +1 -0
  508. package/dist/hooks/use-navigation-loading.js +14 -0
  509. package/dist/hooks/use-payaza-checkout.d.ts +15 -0
  510. package/dist/hooks/use-payaza-checkout.d.ts.map +1 -0
  511. package/dist/hooks/use-payaza-checkout.js +123 -0
  512. package/dist/hooks/use-product-variation-selection.d.ts +28 -0
  513. package/dist/hooks/use-product-variation-selection.d.ts.map +1 -0
  514. package/dist/hooks/use-product-variation-selection.js +53 -0
  515. package/dist/hooks/use-products-api.d.ts +19 -0
  516. package/dist/hooks/use-products-api.d.ts.map +1 -0
  517. package/dist/hooks/use-products-api.js +84 -0
  518. package/dist/hooks/use-shipping-quote.d.ts +25 -0
  519. package/dist/hooks/use-shipping-quote.d.ts.map +1 -0
  520. package/dist/hooks/use-shipping-quote.js +80 -0
  521. package/dist/hooks/use-store-api.d.ts +12 -0
  522. package/dist/hooks/use-store-api.d.ts.map +1 -0
  523. package/dist/hooks/use-store-api.js +73 -0
  524. package/dist/hooks/usePreviewSlideSync.d.ts +5 -0
  525. package/dist/hooks/usePreviewSlideSync.d.ts.map +1 -0
  526. package/dist/hooks/usePreviewSlideSync.js +28 -0
  527. package/dist/index.d.ts +150 -0
  528. package/dist/index.d.ts.map +1 -0
  529. package/dist/index.js +164 -0
  530. package/dist/json/booking-agenda.json +166 -0
  531. package/dist/json/booking.json +224 -0
  532. package/dist/json/clothing-minimal.json +203 -0
  533. package/dist/json/clothing.json +418 -0
  534. package/dist/json/electronics-grid.json +246 -0
  535. package/dist/json/electronics.json +303 -0
  536. package/dist/json/food-modern.json +191 -0
  537. package/dist/json/food.json +283 -0
  538. package/dist/json/json-map.d.ts +7 -0
  539. package/dist/json/json-map.d.ts.map +1 -0
  540. package/dist/json/json-map.js +36 -0
  541. package/dist/json/motivational-speaker.json +361 -0
  542. package/dist/layouts/booking/components/BookingHomePage.d.ts +7 -0
  543. package/dist/layouts/booking/components/BookingHomePage.d.ts.map +1 -0
  544. package/dist/layouts/booking/components/BookingHomePage.js +107 -0
  545. package/dist/layouts/booking/components/BookingMultilineHeading.d.ts +20 -0
  546. package/dist/layouts/booking/components/BookingMultilineHeading.d.ts.map +1 -0
  547. package/dist/layouts/booking/components/BookingMultilineHeading.js +32 -0
  548. package/dist/layouts/booking/components/BookingTestimonialCard.d.ts +10 -0
  549. package/dist/layouts/booking/components/BookingTestimonialCard.d.ts.map +1 -0
  550. package/dist/layouts/booking/components/BookingTestimonialCard.js +11 -0
  551. package/dist/layouts/booking/components/BookingTestimonialsEmptyState.d.ts +9 -0
  552. package/dist/layouts/booking/components/BookingTestimonialsEmptyState.d.ts.map +1 -0
  553. package/dist/layouts/booking/components/BookingTestimonialsEmptyState.js +19 -0
  554. package/dist/layouts/booking/components/booking-about-defaults.d.ts +26 -0
  555. package/dist/layouts/booking/components/booking-about-defaults.d.ts.map +1 -0
  556. package/dist/layouts/booking/components/booking-about-defaults.js +99 -0
  557. package/dist/layouts/booking/components/booking-footer-defaults.d.ts +19 -0
  558. package/dist/layouts/booking/components/booking-footer-defaults.d.ts.map +1 -0
  559. package/dist/layouts/booking/components/booking-footer-defaults.js +52 -0
  560. package/dist/layouts/booking/components/booking-testimonial-defaults.d.ts +21 -0
  561. package/dist/layouts/booking/components/booking-testimonial-defaults.d.ts.map +1 -0
  562. package/dist/layouts/booking/components/booking-testimonial-defaults.js +112 -0
  563. package/dist/layouts/booking/index.d.ts +9 -0
  564. package/dist/layouts/booking/index.d.ts.map +1 -0
  565. package/dist/layouts/booking/index.js +9 -0
  566. package/dist/layouts/booking/pages/AboutPage.d.ts +7 -0
  567. package/dist/layouts/booking/pages/AboutPage.d.ts.map +1 -0
  568. package/dist/layouts/booking/pages/AboutPage.js +69 -0
  569. package/dist/layouts/booking/pages/BookPage.d.ts +8 -0
  570. package/dist/layouts/booking/pages/BookPage.d.ts.map +1 -0
  571. package/dist/layouts/booking/pages/BookPage.js +482 -0
  572. package/dist/layouts/booking/pages/CategoriesPage.d.ts +7 -0
  573. package/dist/layouts/booking/pages/CategoriesPage.d.ts.map +1 -0
  574. package/dist/layouts/booking/pages/CategoriesPage.js +30 -0
  575. package/dist/layouts/booking/pages/CategoryPage.d.ts +8 -0
  576. package/dist/layouts/booking/pages/CategoryPage.d.ts.map +1 -0
  577. package/dist/layouts/booking/pages/CategoryPage.js +51 -0
  578. package/dist/layouts/booking/pages/ContactPage.d.ts +7 -0
  579. package/dist/layouts/booking/pages/ContactPage.d.ts.map +1 -0
  580. package/dist/layouts/booking/pages/ContactPage.js +59 -0
  581. package/dist/layouts/booking/pages/ProductDetailPage.d.ts +8 -0
  582. package/dist/layouts/booking/pages/ProductDetailPage.d.ts.map +1 -0
  583. package/dist/layouts/booking/pages/ProductDetailPage.js +456 -0
  584. package/dist/layouts/booking/pages/ServicesPage.d.ts +9 -0
  585. package/dist/layouts/booking/pages/ServicesPage.d.ts.map +1 -0
  586. package/dist/layouts/booking/pages/ServicesPage.js +54 -0
  587. package/dist/layouts/booking-agenda/components/BookingHomePageAgenda.d.ts +7 -0
  588. package/dist/layouts/booking-agenda/components/BookingHomePageAgenda.d.ts.map +1 -0
  589. package/dist/layouts/booking-agenda/components/BookingHomePageAgenda.js +283 -0
  590. package/dist/layouts/booking-agenda/index.d.ts +9 -0
  591. package/dist/layouts/booking-agenda/index.d.ts.map +1 -0
  592. package/dist/layouts/booking-agenda/index.js +9 -0
  593. package/dist/layouts/booking-agenda/pages/AboutPage.d.ts +7 -0
  594. package/dist/layouts/booking-agenda/pages/AboutPage.d.ts.map +1 -0
  595. package/dist/layouts/booking-agenda/pages/AboutPage.js +51 -0
  596. package/dist/layouts/booking-agenda/pages/BookPage.d.ts +8 -0
  597. package/dist/layouts/booking-agenda/pages/BookPage.d.ts.map +1 -0
  598. package/dist/layouts/booking-agenda/pages/BookPage.js +468 -0
  599. package/dist/layouts/booking-agenda/pages/CategoriesPage.d.ts +7 -0
  600. package/dist/layouts/booking-agenda/pages/CategoriesPage.d.ts.map +1 -0
  601. package/dist/layouts/booking-agenda/pages/CategoriesPage.js +23 -0
  602. package/dist/layouts/booking-agenda/pages/CategoryPage.d.ts +8 -0
  603. package/dist/layouts/booking-agenda/pages/CategoryPage.d.ts.map +1 -0
  604. package/dist/layouts/booking-agenda/pages/CategoryPage.js +48 -0
  605. package/dist/layouts/booking-agenda/pages/ContactPage.d.ts +7 -0
  606. package/dist/layouts/booking-agenda/pages/ContactPage.d.ts.map +1 -0
  607. package/dist/layouts/booking-agenda/pages/ContactPage.js +57 -0
  608. package/dist/layouts/booking-agenda/pages/ProductDetailPage.d.ts +8 -0
  609. package/dist/layouts/booking-agenda/pages/ProductDetailPage.d.ts.map +1 -0
  610. package/dist/layouts/booking-agenda/pages/ProductDetailPage.js +456 -0
  611. package/dist/layouts/booking-agenda/pages/ServicesPage.d.ts +9 -0
  612. package/dist/layouts/booking-agenda/pages/ServicesPage.d.ts.map +1 -0
  613. package/dist/layouts/booking-agenda/pages/ServicesPage.js +46 -0
  614. package/dist/layouts/clothing/components/ClothingHomePage.d.ts +7 -0
  615. package/dist/layouts/clothing/components/ClothingHomePage.d.ts.map +1 -0
  616. package/dist/layouts/clothing/components/ClothingHomePage.js +268 -0
  617. package/dist/layouts/clothing/index.d.ts +8 -0
  618. package/dist/layouts/clothing/index.d.ts.map +1 -0
  619. package/dist/layouts/clothing/index.js +8 -0
  620. package/dist/layouts/clothing/pages/AboutPage.d.ts +7 -0
  621. package/dist/layouts/clothing/pages/AboutPage.d.ts.map +1 -0
  622. package/dist/layouts/clothing/pages/AboutPage.js +55 -0
  623. package/dist/layouts/clothing/pages/CategoriesPage.d.ts +7 -0
  624. package/dist/layouts/clothing/pages/CategoriesPage.d.ts.map +1 -0
  625. package/dist/layouts/clothing/pages/CategoriesPage.js +34 -0
  626. package/dist/layouts/clothing/pages/CategoryPage.d.ts +8 -0
  627. package/dist/layouts/clothing/pages/CategoryPage.d.ts.map +1 -0
  628. package/dist/layouts/clothing/pages/CategoryPage.js +77 -0
  629. package/dist/layouts/clothing/pages/ContactPage.d.ts +7 -0
  630. package/dist/layouts/clothing/pages/ContactPage.d.ts.map +1 -0
  631. package/dist/layouts/clothing/pages/ContactPage.js +58 -0
  632. package/dist/layouts/clothing/pages/ProductDetailPage.d.ts +8 -0
  633. package/dist/layouts/clothing/pages/ProductDetailPage.d.ts.map +1 -0
  634. package/dist/layouts/clothing/pages/ProductDetailPage.js +416 -0
  635. package/dist/layouts/clothing/pages/ProductsPage.d.ts +7 -0
  636. package/dist/layouts/clothing/pages/ProductsPage.d.ts.map +1 -0
  637. package/dist/layouts/clothing/pages/ProductsPage.js +269 -0
  638. package/dist/layouts/clothing/payaza-bindings.d.ts +23 -0
  639. package/dist/layouts/clothing/payaza-bindings.d.ts.map +1 -0
  640. package/dist/layouts/clothing/payaza-bindings.js +17 -0
  641. package/dist/layouts/clothing/styles/clothing.css +80 -0
  642. package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.d.ts +7 -0
  643. package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.d.ts.map +1 -0
  644. package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.js +171 -0
  645. package/dist/layouts/clothing-minimal/components/clothing-minimal-block-render.d.ts +40 -0
  646. package/dist/layouts/clothing-minimal/components/clothing-minimal-block-render.d.ts.map +1 -0
  647. package/dist/layouts/clothing-minimal/components/clothing-minimal-block-render.js +180 -0
  648. package/dist/layouts/clothing-minimal/index.d.ts +8 -0
  649. package/dist/layouts/clothing-minimal/index.d.ts.map +1 -0
  650. package/dist/layouts/clothing-minimal/index.js +8 -0
  651. package/dist/layouts/clothing-minimal/pages/AboutPage.d.ts +7 -0
  652. package/dist/layouts/clothing-minimal/pages/AboutPage.d.ts.map +1 -0
  653. package/dist/layouts/clothing-minimal/pages/AboutPage.js +71 -0
  654. package/dist/layouts/clothing-minimal/pages/CategoriesPage.d.ts +7 -0
  655. package/dist/layouts/clothing-minimal/pages/CategoriesPage.d.ts.map +1 -0
  656. package/dist/layouts/clothing-minimal/pages/CategoriesPage.js +35 -0
  657. package/dist/layouts/clothing-minimal/pages/CategoryPage.d.ts +8 -0
  658. package/dist/layouts/clothing-minimal/pages/CategoryPage.d.ts.map +1 -0
  659. package/dist/layouts/clothing-minimal/pages/CategoryPage.js +56 -0
  660. package/dist/layouts/clothing-minimal/pages/ContactPage.d.ts +7 -0
  661. package/dist/layouts/clothing-minimal/pages/ContactPage.d.ts.map +1 -0
  662. package/dist/layouts/clothing-minimal/pages/ContactPage.js +53 -0
  663. package/dist/layouts/clothing-minimal/pages/ProductDetailPage.d.ts +8 -0
  664. package/dist/layouts/clothing-minimal/pages/ProductDetailPage.d.ts.map +1 -0
  665. package/dist/layouts/clothing-minimal/pages/ProductDetailPage.js +455 -0
  666. package/dist/layouts/clothing-minimal/pages/ProductsPage.d.ts +7 -0
  667. package/dist/layouts/clothing-minimal/pages/ProductsPage.d.ts.map +1 -0
  668. package/dist/layouts/clothing-minimal/pages/ProductsPage.js +274 -0
  669. package/dist/layouts/electronics/components/ElectronicsCategoriesPage.d.ts +7 -0
  670. package/dist/layouts/electronics/components/ElectronicsCategoriesPage.d.ts.map +1 -0
  671. package/dist/layouts/electronics/components/ElectronicsCategoriesPage.js +40 -0
  672. package/dist/layouts/electronics/components/ElectronicsGridProductCard.d.ts +10 -0
  673. package/dist/layouts/electronics/components/ElectronicsGridProductCard.d.ts.map +1 -0
  674. package/dist/layouts/electronics/components/ElectronicsGridProductCard.js +122 -0
  675. package/dist/layouts/electronics/components/ElectronicsHomePage.d.ts +7 -0
  676. package/dist/layouts/electronics/components/ElectronicsHomePage.d.ts.map +1 -0
  677. package/dist/layouts/electronics/components/ElectronicsHomePage.js +104 -0
  678. package/dist/layouts/electronics/components/ElectronicsPageWrapper.d.ts +8 -0
  679. package/dist/layouts/electronics/components/ElectronicsPageWrapper.d.ts.map +1 -0
  680. package/dist/layouts/electronics/components/ElectronicsPageWrapper.js +10 -0
  681. package/dist/layouts/electronics/components/ElectronicsProductsPage.d.ts +7 -0
  682. package/dist/layouts/electronics/components/ElectronicsProductsPage.d.ts.map +1 -0
  683. package/dist/layouts/electronics/components/ElectronicsProductsPage.js +99 -0
  684. package/dist/layouts/electronics/components/ElectronicsStoreFooter.d.ts +7 -0
  685. package/dist/layouts/electronics/components/ElectronicsStoreFooter.d.ts.map +1 -0
  686. package/dist/layouts/electronics/components/ElectronicsStoreFooter.js +11 -0
  687. package/dist/layouts/electronics/components/ElectronicsStoreHeader.d.ts +7 -0
  688. package/dist/layouts/electronics/components/ElectronicsStoreHeader.d.ts.map +1 -0
  689. package/dist/layouts/electronics/components/ElectronicsStoreHeader.js +39 -0
  690. package/dist/layouts/electronics/index.d.ts +19 -0
  691. package/dist/layouts/electronics/index.d.ts.map +1 -0
  692. package/dist/layouts/electronics/index.js +19 -0
  693. package/dist/layouts/electronics/pages/AboutPage.d.ts +7 -0
  694. package/dist/layouts/electronics/pages/AboutPage.d.ts.map +1 -0
  695. package/dist/layouts/electronics/pages/AboutPage.js +51 -0
  696. package/dist/layouts/electronics/pages/CategoriesPage.d.ts +7 -0
  697. package/dist/layouts/electronics/pages/CategoriesPage.d.ts.map +1 -0
  698. package/dist/layouts/electronics/pages/CategoriesPage.js +6 -0
  699. package/dist/layouts/electronics/pages/CategoryPage.d.ts +8 -0
  700. package/dist/layouts/electronics/pages/CategoryPage.d.ts.map +1 -0
  701. package/dist/layouts/electronics/pages/CategoryPage.js +55 -0
  702. package/dist/layouts/electronics/pages/ContactPage.d.ts +7 -0
  703. package/dist/layouts/electronics/pages/ContactPage.d.ts.map +1 -0
  704. package/dist/layouts/electronics/pages/ContactPage.js +57 -0
  705. package/dist/layouts/electronics/pages/HelpCenterPage.d.ts +7 -0
  706. package/dist/layouts/electronics/pages/HelpCenterPage.d.ts.map +1 -0
  707. package/dist/layouts/electronics/pages/HelpCenterPage.js +55 -0
  708. package/dist/layouts/electronics/pages/PrivacyPolicyPage.d.ts +7 -0
  709. package/dist/layouts/electronics/pages/PrivacyPolicyPage.d.ts.map +1 -0
  710. package/dist/layouts/electronics/pages/PrivacyPolicyPage.js +9 -0
  711. package/dist/layouts/electronics/pages/ProductDetailPage.d.ts +8 -0
  712. package/dist/layouts/electronics/pages/ProductDetailPage.d.ts.map +1 -0
  713. package/dist/layouts/electronics/pages/ProductDetailPage.js +453 -0
  714. package/dist/layouts/electronics/pages/ProductsPage.d.ts +7 -0
  715. package/dist/layouts/electronics/pages/ProductsPage.d.ts.map +1 -0
  716. package/dist/layouts/electronics/pages/ProductsPage.js +273 -0
  717. package/dist/layouts/electronics/pages/ShippingReturnsPage.d.ts +7 -0
  718. package/dist/layouts/electronics/pages/ShippingReturnsPage.d.ts.map +1 -0
  719. package/dist/layouts/electronics/pages/ShippingReturnsPage.js +7 -0
  720. package/dist/layouts/electronics/pages/TermsPage.d.ts +7 -0
  721. package/dist/layouts/electronics/pages/TermsPage.d.ts.map +1 -0
  722. package/dist/layouts/electronics/pages/TermsPage.js +9 -0
  723. package/dist/layouts/electronics/pages/TrackOrderPage.d.ts +7 -0
  724. package/dist/layouts/electronics/pages/TrackOrderPage.d.ts.map +1 -0
  725. package/dist/layouts/electronics/pages/TrackOrderPage.js +376 -0
  726. package/dist/layouts/electronics-grid/components/ElectronicsGridProductCard.d.ts +10 -0
  727. package/dist/layouts/electronics-grid/components/ElectronicsGridProductCard.d.ts.map +1 -0
  728. package/dist/layouts/electronics-grid/components/ElectronicsGridProductCard.js +122 -0
  729. package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.d.ts +7 -0
  730. package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.d.ts.map +1 -0
  731. package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.js +112 -0
  732. package/dist/layouts/electronics-grid/index.d.ts +15 -0
  733. package/dist/layouts/electronics-grid/index.d.ts.map +1 -0
  734. package/dist/layouts/electronics-grid/index.js +15 -0
  735. package/dist/layouts/electronics-grid/pages/AboutPage.d.ts +7 -0
  736. package/dist/layouts/electronics-grid/pages/AboutPage.d.ts.map +1 -0
  737. package/dist/layouts/electronics-grid/pages/AboutPage.js +51 -0
  738. package/dist/layouts/electronics-grid/pages/CategoriesPage.d.ts +7 -0
  739. package/dist/layouts/electronics-grid/pages/CategoriesPage.d.ts.map +1 -0
  740. package/dist/layouts/electronics-grid/pages/CategoriesPage.js +6 -0
  741. package/dist/layouts/electronics-grid/pages/CategoryPage.d.ts +8 -0
  742. package/dist/layouts/electronics-grid/pages/CategoryPage.d.ts.map +1 -0
  743. package/dist/layouts/electronics-grid/pages/CategoryPage.js +55 -0
  744. package/dist/layouts/electronics-grid/pages/ContactPage.d.ts +7 -0
  745. package/dist/layouts/electronics-grid/pages/ContactPage.d.ts.map +1 -0
  746. package/dist/layouts/electronics-grid/pages/ContactPage.js +57 -0
  747. package/dist/layouts/electronics-grid/pages/ElectronicsGridCategoriesPage.d.ts +7 -0
  748. package/dist/layouts/electronics-grid/pages/ElectronicsGridCategoriesPage.d.ts.map +1 -0
  749. package/dist/layouts/electronics-grid/pages/ElectronicsGridCategoriesPage.js +26 -0
  750. package/dist/layouts/electronics-grid/pages/HelpCenterPage.d.ts +7 -0
  751. package/dist/layouts/electronics-grid/pages/HelpCenterPage.d.ts.map +1 -0
  752. package/dist/layouts/electronics-grid/pages/HelpCenterPage.js +55 -0
  753. package/dist/layouts/electronics-grid/pages/PrivacyPolicyPage.d.ts +7 -0
  754. package/dist/layouts/electronics-grid/pages/PrivacyPolicyPage.d.ts.map +1 -0
  755. package/dist/layouts/electronics-grid/pages/PrivacyPolicyPage.js +9 -0
  756. package/dist/layouts/electronics-grid/pages/ProductDetailPage.d.ts +8 -0
  757. package/dist/layouts/electronics-grid/pages/ProductDetailPage.d.ts.map +1 -0
  758. package/dist/layouts/electronics-grid/pages/ProductDetailPage.js +453 -0
  759. package/dist/layouts/electronics-grid/pages/ProductsPage.d.ts +7 -0
  760. package/dist/layouts/electronics-grid/pages/ProductsPage.d.ts.map +1 -0
  761. package/dist/layouts/electronics-grid/pages/ProductsPage.js +273 -0
  762. package/dist/layouts/electronics-grid/pages/ShippingReturnsPage.d.ts +7 -0
  763. package/dist/layouts/electronics-grid/pages/ShippingReturnsPage.d.ts.map +1 -0
  764. package/dist/layouts/electronics-grid/pages/ShippingReturnsPage.js +7 -0
  765. package/dist/layouts/electronics-grid/pages/TermsPage.d.ts +7 -0
  766. package/dist/layouts/electronics-grid/pages/TermsPage.d.ts.map +1 -0
  767. package/dist/layouts/electronics-grid/pages/TermsPage.js +9 -0
  768. package/dist/layouts/electronics-grid/pages/TrackOrderPage.d.ts +7 -0
  769. package/dist/layouts/electronics-grid/pages/TrackOrderPage.d.ts.map +1 -0
  770. package/dist/layouts/electronics-grid/pages/TrackOrderPage.js +376 -0
  771. package/dist/layouts/food/components/FoodHomePage.d.ts +7 -0
  772. package/dist/layouts/food/components/FoodHomePage.d.ts.map +1 -0
  773. package/dist/layouts/food/components/FoodHomePage.js +387 -0
  774. package/dist/layouts/food/index.d.ts +9 -0
  775. package/dist/layouts/food/index.d.ts.map +1 -0
  776. package/dist/layouts/food/index.js +9 -0
  777. package/dist/layouts/food/pages/AboutPage.d.ts +7 -0
  778. package/dist/layouts/food/pages/AboutPage.d.ts.map +1 -0
  779. package/dist/layouts/food/pages/AboutPage.js +67 -0
  780. package/dist/layouts/food/pages/CategoriesPage.d.ts +7 -0
  781. package/dist/layouts/food/pages/CategoriesPage.d.ts.map +1 -0
  782. package/dist/layouts/food/pages/CategoriesPage.js +26 -0
  783. package/dist/layouts/food/pages/CategoryPage.d.ts +8 -0
  784. package/dist/layouts/food/pages/CategoryPage.d.ts.map +1 -0
  785. package/dist/layouts/food/pages/CategoryPage.js +65 -0
  786. package/dist/layouts/food/pages/ContactPage.d.ts +7 -0
  787. package/dist/layouts/food/pages/ContactPage.d.ts.map +1 -0
  788. package/dist/layouts/food/pages/ContactPage.js +55 -0
  789. package/dist/layouts/food/pages/MenuPage.d.ts +8 -0
  790. package/dist/layouts/food/pages/MenuPage.d.ts.map +1 -0
  791. package/dist/layouts/food/pages/MenuPage.js +107 -0
  792. package/dist/layouts/food/pages/ProductDetailPage.d.ts +8 -0
  793. package/dist/layouts/food/pages/ProductDetailPage.d.ts.map +1 -0
  794. package/dist/layouts/food/pages/ProductDetailPage.js +506 -0
  795. package/dist/layouts/food/pages/ProductsPage.d.ts +7 -0
  796. package/dist/layouts/food/pages/ProductsPage.d.ts.map +1 -0
  797. package/dist/layouts/food/pages/ProductsPage.js +174 -0
  798. package/dist/layouts/food-modern/components/FoodHomePageModern.d.ts +7 -0
  799. package/dist/layouts/food-modern/components/FoodHomePageModern.d.ts.map +1 -0
  800. package/dist/layouts/food-modern/components/FoodHomePageModern.js +101 -0
  801. package/dist/layouts/food-modern/index.d.ts +9 -0
  802. package/dist/layouts/food-modern/index.d.ts.map +1 -0
  803. package/dist/layouts/food-modern/index.js +9 -0
  804. package/dist/layouts/food-modern/pages/AboutPage.d.ts +7 -0
  805. package/dist/layouts/food-modern/pages/AboutPage.d.ts.map +1 -0
  806. package/dist/layouts/food-modern/pages/AboutPage.js +52 -0
  807. package/dist/layouts/food-modern/pages/CategoriesPage.d.ts +7 -0
  808. package/dist/layouts/food-modern/pages/CategoriesPage.d.ts.map +1 -0
  809. package/dist/layouts/food-modern/pages/CategoriesPage.js +23 -0
  810. package/dist/layouts/food-modern/pages/CategoryPage.d.ts +8 -0
  811. package/dist/layouts/food-modern/pages/CategoryPage.d.ts.map +1 -0
  812. package/dist/layouts/food-modern/pages/CategoryPage.js +64 -0
  813. package/dist/layouts/food-modern/pages/ContactPage.d.ts +7 -0
  814. package/dist/layouts/food-modern/pages/ContactPage.d.ts.map +1 -0
  815. package/dist/layouts/food-modern/pages/ContactPage.js +55 -0
  816. package/dist/layouts/food-modern/pages/MenuPage.d.ts +8 -0
  817. package/dist/layouts/food-modern/pages/MenuPage.d.ts.map +1 -0
  818. package/dist/layouts/food-modern/pages/MenuPage.js +110 -0
  819. package/dist/layouts/food-modern/pages/ProductDetailPage.d.ts +8 -0
  820. package/dist/layouts/food-modern/pages/ProductDetailPage.d.ts.map +1 -0
  821. package/dist/layouts/food-modern/pages/ProductDetailPage.js +450 -0
  822. package/dist/layouts/food-modern/pages/ProductsPage.d.ts +7 -0
  823. package/dist/layouts/food-modern/pages/ProductsPage.d.ts.map +1 -0
  824. package/dist/layouts/food-modern/pages/ProductsPage.js +175 -0
  825. package/dist/layouts/motivational-speaker/components/MotivationalHomePage.d.ts +7 -0
  826. package/dist/layouts/motivational-speaker/components/MotivationalHomePage.d.ts.map +1 -0
  827. package/dist/layouts/motivational-speaker/components/MotivationalHomePage.js +131 -0
  828. package/dist/layouts/motivational-speaker/components/MotivationalSpeakerPageWrapper.d.ts +3 -0
  829. package/dist/layouts/motivational-speaker/components/MotivationalSpeakerPageWrapper.d.ts.map +1 -0
  830. package/dist/layouts/motivational-speaker/components/MotivationalSpeakerPageWrapper.js +7 -0
  831. package/dist/layouts/motivational-speaker/index.d.ts +10 -0
  832. package/dist/layouts/motivational-speaker/index.d.ts.map +1 -0
  833. package/dist/layouts/motivational-speaker/index.js +10 -0
  834. package/dist/layouts/motivational-speaker/pages/AboutPage.d.ts +7 -0
  835. package/dist/layouts/motivational-speaker/pages/AboutPage.d.ts.map +1 -0
  836. package/dist/layouts/motivational-speaker/pages/AboutPage.js +51 -0
  837. package/dist/layouts/motivational-speaker/pages/CategoryPage.d.ts +8 -0
  838. package/dist/layouts/motivational-speaker/pages/CategoryPage.d.ts.map +1 -0
  839. package/dist/layouts/motivational-speaker/pages/CategoryPage.js +72 -0
  840. package/dist/layouts/motivational-speaker/pages/ContactPage.d.ts +7 -0
  841. package/dist/layouts/motivational-speaker/pages/ContactPage.d.ts.map +1 -0
  842. package/dist/layouts/motivational-speaker/pages/ContactPage.js +57 -0
  843. package/dist/layouts/motivational-speaker/pages/ProductsPage.d.ts +7 -0
  844. package/dist/layouts/motivational-speaker/pages/ProductsPage.d.ts.map +1 -0
  845. package/dist/layouts/motivational-speaker/pages/ProductsPage.js +273 -0
  846. package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.d.ts +8 -0
  847. package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.d.ts.map +1 -0
  848. package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.js +153 -0
  849. package/dist/layouts/motivational-speaker/pages/ServicesPage.d.ts +9 -0
  850. package/dist/layouts/motivational-speaker/pages/ServicesPage.d.ts.map +1 -0
  851. package/dist/layouts/motivational-speaker/pages/ServicesPage.js +46 -0
  852. package/dist/layouts/motivational-speaker/pages/SubscriptionPage.d.ts +7 -0
  853. package/dist/layouts/motivational-speaker/pages/SubscriptionPage.d.ts.map +1 -0
  854. package/dist/layouts/motivational-speaker/pages/SubscriptionPage.js +137 -0
  855. package/dist/layouts/shared/components/BaseStoreLayout.d.ts +8 -0
  856. package/dist/layouts/shared/components/BaseStoreLayout.d.ts.map +1 -0
  857. package/dist/layouts/shared/components/BaseStoreLayout.js +49 -0
  858. package/dist/layouts/shared/components/CartLineQuantityControl.d.ts +12 -0
  859. package/dist/layouts/shared/components/CartLineQuantityControl.d.ts.map +1 -0
  860. package/dist/layouts/shared/components/CartLineQuantityControl.js +99 -0
  861. package/dist/layouts/shared/components/GenericPageWrapper.d.ts +8 -0
  862. package/dist/layouts/shared/components/GenericPageWrapper.d.ts.map +1 -0
  863. package/dist/layouts/shared/components/GenericPageWrapper.js +24 -0
  864. package/dist/layouts/shared/components/ProductPriceFilterSection.d.ts +17 -0
  865. package/dist/layouts/shared/components/ProductPriceFilterSection.d.ts.map +1 -0
  866. package/dist/layouts/shared/components/ProductPriceFilterSection.js +128 -0
  867. package/dist/layouts/shared/components/PromoBanner.d.ts +12 -0
  868. package/dist/layouts/shared/components/PromoBanner.d.ts.map +1 -0
  869. package/dist/layouts/shared/components/PromoBanner.js +17 -0
  870. package/dist/layouts/shared/components/StoreFooter.d.ts +7 -0
  871. package/dist/layouts/shared/components/StoreFooter.d.ts.map +1 -0
  872. package/dist/layouts/shared/components/StoreFooter.js +156 -0
  873. package/dist/layouts/shared/components/StoreHeader.d.ts +8 -0
  874. package/dist/layouts/shared/components/StoreHeader.d.ts.map +1 -0
  875. package/dist/layouts/shared/components/StoreHeader.js +111 -0
  876. package/dist/layouts/shared/components/TestimonialCard.d.ts +8 -0
  877. package/dist/layouts/shared/components/TestimonialCard.d.ts.map +1 -0
  878. package/dist/layouts/shared/components/TestimonialCard.js +10 -0
  879. package/dist/layouts/shared/components/headers/BookingAgendaSidebar.d.ts +8 -0
  880. package/dist/layouts/shared/components/headers/BookingAgendaSidebar.d.ts.map +1 -0
  881. package/dist/layouts/shared/components/headers/BookingAgendaSidebar.js +16 -0
  882. package/dist/layouts/shared/components/headers/ClothingMinimalHeader.d.ts +7 -0
  883. package/dist/layouts/shared/components/headers/ClothingMinimalHeader.d.ts.map +1 -0
  884. package/dist/layouts/shared/components/headers/ClothingMinimalHeader.js +39 -0
  885. package/dist/layouts/shared/components/headers/FoodModernHeader.d.ts +7 -0
  886. package/dist/layouts/shared/components/headers/FoodModernHeader.d.ts.map +1 -0
  887. package/dist/layouts/shared/components/headers/FoodModernHeader.js +61 -0
  888. package/dist/layouts/shared/index.d.ts +23 -0
  889. package/dist/layouts/shared/index.d.ts.map +1 -0
  890. package/dist/layouts/shared/index.js +23 -0
  891. package/dist/layouts/shared/pages/AccountPage.d.ts +7 -0
  892. package/dist/layouts/shared/pages/AccountPage.d.ts.map +1 -0
  893. package/dist/layouts/shared/pages/AccountPage.js +549 -0
  894. package/dist/layouts/shared/pages/CartPage.d.ts +7 -0
  895. package/dist/layouts/shared/pages/CartPage.d.ts.map +1 -0
  896. package/dist/layouts/shared/pages/CartPage.js +135 -0
  897. package/dist/layouts/shared/pages/CheckoutPage.d.ts +7 -0
  898. package/dist/layouts/shared/pages/CheckoutPage.d.ts.map +1 -0
  899. package/dist/layouts/shared/pages/CheckoutPage.js +1450 -0
  900. package/dist/layouts/shared/pages/CookiePolicyPage.d.ts +7 -0
  901. package/dist/layouts/shared/pages/CookiePolicyPage.d.ts.map +1 -0
  902. package/dist/layouts/shared/pages/CookiePolicyPage.js +9 -0
  903. package/dist/layouts/shared/pages/FeatureDisabledPage.d.ts +9 -0
  904. package/dist/layouts/shared/pages/FeatureDisabledPage.d.ts.map +1 -0
  905. package/dist/layouts/shared/pages/FeatureDisabledPage.js +8 -0
  906. package/dist/layouts/shared/pages/HelpCenterPage.d.ts +7 -0
  907. package/dist/layouts/shared/pages/HelpCenterPage.d.ts.map +1 -0
  908. package/dist/layouts/shared/pages/HelpCenterPage.js +55 -0
  909. package/dist/layouts/shared/pages/MaintenancePage.d.ts +7 -0
  910. package/dist/layouts/shared/pages/MaintenancePage.d.ts.map +1 -0
  911. package/dist/layouts/shared/pages/MaintenancePage.js +10 -0
  912. package/dist/layouts/shared/pages/PortfolioPage.d.ts +7 -0
  913. package/dist/layouts/shared/pages/PortfolioPage.d.ts.map +1 -0
  914. package/dist/layouts/shared/pages/PortfolioPage.js +130 -0
  915. package/dist/layouts/shared/pages/PrivacyPolicyPage.d.ts +7 -0
  916. package/dist/layouts/shared/pages/PrivacyPolicyPage.d.ts.map +1 -0
  917. package/dist/layouts/shared/pages/PrivacyPolicyPage.js +9 -0
  918. package/dist/layouts/shared/pages/ShippingReturnsPage.d.ts +7 -0
  919. package/dist/layouts/shared/pages/ShippingReturnsPage.d.ts.map +1 -0
  920. package/dist/layouts/shared/pages/ShippingReturnsPage.js +7 -0
  921. package/dist/layouts/shared/pages/SizeGuidePage.d.ts +7 -0
  922. package/dist/layouts/shared/pages/SizeGuidePage.d.ts.map +1 -0
  923. package/dist/layouts/shared/pages/SizeGuidePage.js +10 -0
  924. package/dist/layouts/shared/pages/StyleGuidePage.d.ts +7 -0
  925. package/dist/layouts/shared/pages/StyleGuidePage.d.ts.map +1 -0
  926. package/dist/layouts/shared/pages/StyleGuidePage.js +126 -0
  927. package/dist/layouts/shared/pages/TeamPage.d.ts +7 -0
  928. package/dist/layouts/shared/pages/TeamPage.d.ts.map +1 -0
  929. package/dist/layouts/shared/pages/TeamPage.js +39 -0
  930. package/dist/layouts/shared/pages/TermsPage.d.ts +7 -0
  931. package/dist/layouts/shared/pages/TermsPage.d.ts.map +1 -0
  932. package/dist/layouts/shared/pages/TermsPage.js +9 -0
  933. package/dist/layouts/shared/pages/TrackOrderPage.d.ts +7 -0
  934. package/dist/layouts/shared/pages/TrackOrderPage.d.ts.map +1 -0
  935. package/dist/layouts/shared/pages/TrackOrderPage.js +379 -0
  936. package/dist/layouts/shared/pages/WishlistPage.d.ts +7 -0
  937. package/dist/layouts/shared/pages/WishlistPage.d.ts.map +1 -0
  938. package/dist/layouts/shared/pages/WishlistPage.js +144 -0
  939. package/dist/layouts/shared/wrappers/BookingAgendaLayout.d.ts +14 -0
  940. package/dist/layouts/shared/wrappers/BookingAgendaLayout.d.ts.map +1 -0
  941. package/dist/layouts/shared/wrappers/BookingAgendaLayout.js +152 -0
  942. package/dist/layouts/shared/wrappers/ClothingLayout.d.ts +10 -0
  943. package/dist/layouts/shared/wrappers/ClothingLayout.d.ts.map +1 -0
  944. package/dist/layouts/shared/wrappers/ClothingLayout.js +44 -0
  945. package/dist/layouts/shared/wrappers/ClothingMinimalLayout.d.ts +8 -0
  946. package/dist/layouts/shared/wrappers/ClothingMinimalLayout.d.ts.map +1 -0
  947. package/dist/layouts/shared/wrappers/ClothingMinimalLayout.js +48 -0
  948. package/dist/layouts/shared/wrappers/ElectronicsLayout.d.ts +8 -0
  949. package/dist/layouts/shared/wrappers/ElectronicsLayout.d.ts.map +1 -0
  950. package/dist/layouts/shared/wrappers/ElectronicsLayout.js +40 -0
  951. package/dist/layouts/shared/wrappers/FoodModernLayout.d.ts +8 -0
  952. package/dist/layouts/shared/wrappers/FoodModernLayout.d.ts.map +1 -0
  953. package/dist/layouts/shared/wrappers/FoodModernLayout.js +48 -0
  954. package/dist/layouts/shared/wrappers/MotivationalLayout.d.ts +8 -0
  955. package/dist/layouts/shared/wrappers/MotivationalLayout.d.ts.map +1 -0
  956. package/dist/layouts/shared/wrappers/MotivationalLayout.js +51 -0
  957. package/dist/layouts/shared/wrappers/StandardLayout.d.ts +8 -0
  958. package/dist/layouts/shared/wrappers/StandardLayout.d.ts.map +1 -0
  959. package/dist/layouts/shared/wrappers/StandardLayout.js +45 -0
  960. package/dist/lib/alignment-schemas.d.ts +51 -0
  961. package/dist/lib/alignment-schemas.d.ts.map +1 -0
  962. package/dist/lib/alignment-schemas.js +637 -0
  963. package/dist/lib/api.d.ts +11 -0
  964. package/dist/lib/api.d.ts.map +1 -0
  965. package/dist/lib/api.js +167 -0
  966. package/dist/lib/auth-context.d.ts +49 -0
  967. package/dist/lib/auth-context.d.ts.map +1 -0
  968. package/dist/lib/auth-context.js +296 -0
  969. package/dist/lib/checkout-availability.d.ts +10 -0
  970. package/dist/lib/checkout-availability.d.ts.map +1 -0
  971. package/dist/lib/checkout-availability.js +16 -0
  972. package/dist/lib/compact-array-items.d.ts +7 -0
  973. package/dist/lib/compact-array-items.d.ts.map +1 -0
  974. package/dist/lib/compact-array-items.js +13 -0
  975. package/dist/lib/content-selectors.d.ts +21 -0
  976. package/dist/lib/content-selectors.d.ts.map +1 -0
  977. package/dist/lib/content-selectors.js +75 -0
  978. package/dist/lib/countries.d.ts +13 -0
  979. package/dist/lib/countries.d.ts.map +1 -0
  980. package/dist/lib/countries.js +292 -0
  981. package/dist/lib/currency-symbols.d.ts +36 -0
  982. package/dist/lib/currency-symbols.d.ts.map +1 -0
  983. package/dist/lib/currency-symbols.js +153 -0
  984. package/dist/lib/guest-user.d.ts +27 -0
  985. package/dist/lib/guest-user.d.ts.map +1 -0
  986. package/dist/lib/guest-user.js +71 -0
  987. package/dist/lib/inventory-utils.d.ts +41 -0
  988. package/dist/lib/inventory-utils.d.ts.map +1 -0
  989. package/dist/lib/inventory-utils.js +180 -0
  990. package/dist/lib/layout-badges.d.ts +4 -0
  991. package/dist/lib/layout-badges.d.ts.map +1 -0
  992. package/dist/lib/layout-badges.js +5 -0
  993. package/dist/lib/layout-config-hydration.d.ts +25 -0
  994. package/dist/lib/layout-config-hydration.d.ts.map +1 -0
  995. package/dist/lib/layout-config-hydration.js +264 -0
  996. package/dist/lib/layout-field-normalize.d.ts +18 -0
  997. package/dist/lib/layout-field-normalize.d.ts.map +1 -0
  998. package/dist/lib/layout-field-normalize.js +190 -0
  999. package/dist/lib/layout-route-utils.d.ts +30 -0
  1000. package/dist/lib/layout-route-utils.d.ts.map +1 -0
  1001. package/dist/lib/layout-route-utils.js +79 -0
  1002. package/dist/lib/limited-time-offer.d.ts +6 -0
  1003. package/dist/lib/limited-time-offer.d.ts.map +1 -0
  1004. package/dist/lib/limited-time-offer.js +24 -0
  1005. package/dist/lib/loading-context.d.ts +20 -0
  1006. package/dist/lib/loading-context.d.ts.map +1 -0
  1007. package/dist/lib/loading-context.js +212 -0
  1008. package/dist/lib/mixpanel.d.ts +11 -0
  1009. package/dist/lib/mixpanel.d.ts.map +1 -0
  1010. package/dist/lib/mixpanel.js +61 -0
  1011. package/dist/lib/mock-stores.d.ts +24 -0
  1012. package/dist/lib/mock-stores.d.ts.map +1 -0
  1013. package/dist/lib/mock-stores.js +2106 -0
  1014. package/dist/lib/order-success-cart.d.ts +5 -0
  1015. package/dist/lib/order-success-cart.d.ts.map +1 -0
  1016. package/dist/lib/order-success-cart.js +50 -0
  1017. package/dist/lib/payaza-checkout.d.ts +147 -0
  1018. package/dist/lib/payaza-checkout.d.ts.map +1 -0
  1019. package/dist/lib/payaza-checkout.js +717 -0
  1020. package/dist/lib/payaza-section-styles.d.ts +16 -0
  1021. package/dist/lib/payaza-section-styles.d.ts.map +1 -0
  1022. package/dist/lib/payaza-section-styles.js +93 -0
  1023. package/dist/lib/preview-data.d.ts +58 -0
  1024. package/dist/lib/preview-data.d.ts.map +1 -0
  1025. package/dist/lib/preview-data.js +2576 -0
  1026. package/dist/lib/product-variation-utils.d.ts +19 -0
  1027. package/dist/lib/product-variation-utils.d.ts.map +1 -0
  1028. package/dist/lib/product-variation-utils.js +185 -0
  1029. package/dist/lib/rich-html.d.ts +38 -0
  1030. package/dist/lib/rich-html.d.ts.map +1 -0
  1031. package/dist/lib/rich-html.js +272 -0
  1032. package/dist/lib/services/analytics.service.d.ts +59 -0
  1033. package/dist/lib/services/analytics.service.d.ts.map +1 -0
  1034. package/dist/lib/services/analytics.service.js +382 -0
  1035. package/dist/lib/services/auth.service.d.ts +63 -0
  1036. package/dist/lib/services/auth.service.d.ts.map +1 -0
  1037. package/dist/lib/services/auth.service.js +101 -0
  1038. package/dist/lib/services/booking.service.d.ts +53 -0
  1039. package/dist/lib/services/booking.service.d.ts.map +1 -0
  1040. package/dist/lib/services/booking.service.js +52 -0
  1041. package/dist/lib/services/category.service.d.ts +21 -0
  1042. package/dist/lib/services/category.service.d.ts.map +1 -0
  1043. package/dist/lib/services/category.service.js +41 -0
  1044. package/dist/lib/services/checkout.service.d.ts +168 -0
  1045. package/dist/lib/services/checkout.service.d.ts.map +1 -0
  1046. package/dist/lib/services/checkout.service.js +48 -0
  1047. package/dist/lib/services/contact.service.d.ts +26 -0
  1048. package/dist/lib/services/contact.service.d.ts.map +1 -0
  1049. package/dist/lib/services/contact.service.js +23 -0
  1050. package/dist/lib/services/customer.service.d.ts +54 -0
  1051. package/dist/lib/services/customer.service.d.ts.map +1 -0
  1052. package/dist/lib/services/customer.service.js +64 -0
  1053. package/dist/lib/services/fees.service.d.ts +85 -0
  1054. package/dist/lib/services/fees.service.d.ts.map +1 -0
  1055. package/dist/lib/services/fees.service.js +147 -0
  1056. package/dist/lib/services/index.d.ts +19 -0
  1057. package/dist/lib/services/index.d.ts.map +1 -0
  1058. package/dist/lib/services/index.js +18 -0
  1059. package/dist/lib/services/location.service.d.ts +31 -0
  1060. package/dist/lib/services/location.service.d.ts.map +1 -0
  1061. package/dist/lib/services/location.service.js +25 -0
  1062. package/dist/lib/services/order.service.d.ts +5 -0
  1063. package/dist/lib/services/order.service.d.ts.map +1 -0
  1064. package/dist/lib/services/order.service.js +12 -0
  1065. package/dist/lib/services/payment.service.d.ts +56 -0
  1066. package/dist/lib/services/payment.service.d.ts.map +1 -0
  1067. package/dist/lib/services/payment.service.js +122 -0
  1068. package/dist/lib/services/product.service.d.ts +92 -0
  1069. package/dist/lib/services/product.service.d.ts.map +1 -0
  1070. package/dist/lib/services/product.service.js +86 -0
  1071. package/dist/lib/services/promo.service.d.ts +31 -0
  1072. package/dist/lib/services/promo.service.d.ts.map +1 -0
  1073. package/dist/lib/services/promo.service.js +29 -0
  1074. package/dist/lib/services/review.service.d.ts +47 -0
  1075. package/dist/lib/services/review.service.d.ts.map +1 -0
  1076. package/dist/lib/services/review.service.js +54 -0
  1077. package/dist/lib/services/service.service.d.ts +55 -0
  1078. package/dist/lib/services/service.service.d.ts.map +1 -0
  1079. package/dist/lib/services/service.service.js +37 -0
  1080. package/dist/lib/services/shipping.service.d.ts +62 -0
  1081. package/dist/lib/services/shipping.service.d.ts.map +1 -0
  1082. package/dist/lib/services/shipping.service.js +39 -0
  1083. package/dist/lib/services/store.service.d.ts +89 -0
  1084. package/dist/lib/services/store.service.d.ts.map +1 -0
  1085. package/dist/lib/services/store.service.js +41 -0
  1086. package/dist/lib/shipping-address.util.d.ts +76 -0
  1087. package/dist/lib/shipping-address.util.d.ts.map +1 -0
  1088. package/dist/lib/shipping-address.util.js +149 -0
  1089. package/dist/lib/shipping-settings.util.d.ts +4 -0
  1090. package/dist/lib/shipping-settings.util.d.ts.map +1 -0
  1091. package/dist/lib/shipping-settings.util.js +6 -0
  1092. package/dist/lib/store-config-utils.d.ts +50 -0
  1093. package/dist/lib/store-config-utils.d.ts.map +1 -0
  1094. package/dist/lib/store-config-utils.js +1737 -0
  1095. package/dist/lib/store-config.d.ts +4 -0
  1096. package/dist/lib/store-config.d.ts.map +1 -0
  1097. package/dist/lib/store-config.js +4 -0
  1098. package/dist/lib/store-context.d.ts +69 -0
  1099. package/dist/lib/store-context.d.ts.map +1 -0
  1100. package/dist/lib/store-context.js +483 -0
  1101. package/dist/lib/store-types.d.ts +921 -0
  1102. package/dist/lib/store-types.d.ts.map +1 -0
  1103. package/dist/lib/store-types.js +1 -0
  1104. package/dist/lib/template-pages.d.ts +8 -0
  1105. package/dist/lib/template-pages.d.ts.map +1 -0
  1106. package/dist/lib/template-pages.js +62 -0
  1107. package/dist/lib/utils/asset-helpers.d.ts +111 -0
  1108. package/dist/lib/utils/asset-helpers.d.ts.map +1 -0
  1109. package/dist/lib/utils/asset-helpers.js +462 -0
  1110. package/dist/lib/utils/catalog-price-bounds.d.ts +13 -0
  1111. package/dist/lib/utils/catalog-price-bounds.d.ts.map +1 -0
  1112. package/dist/lib/utils/catalog-price-bounds.js +24 -0
  1113. package/dist/lib/utils/category-tree.d.ts +25 -0
  1114. package/dist/lib/utils/category-tree.d.ts.map +1 -0
  1115. package/dist/lib/utils/category-tree.js +85 -0
  1116. package/dist/lib/utils/demo-detection.d.ts +23 -0
  1117. package/dist/lib/utils/demo-detection.d.ts.map +1 -0
  1118. package/dist/lib/utils/demo-detection.js +36 -0
  1119. package/dist/lib/utils/editor-preview.d.ts +42 -0
  1120. package/dist/lib/utils/editor-preview.d.ts.map +1 -0
  1121. package/dist/lib/utils/editor-preview.js +214 -0
  1122. package/dist/lib/utils/fee-calculations.d.ts +35 -0
  1123. package/dist/lib/utils/fee-calculations.d.ts.map +1 -0
  1124. package/dist/lib/utils/fee-calculations.js +81 -0
  1125. package/dist/lib/utils/footer-nav-defaults.d.ts +11 -0
  1126. package/dist/lib/utils/footer-nav-defaults.d.ts.map +1 -0
  1127. package/dist/lib/utils/footer-nav-defaults.js +67 -0
  1128. package/dist/lib/utils/idempotency-key.d.ts +15 -0
  1129. package/dist/lib/utils/idempotency-key.d.ts.map +1 -0
  1130. package/dist/lib/utils/idempotency-key.js +22 -0
  1131. package/dist/lib/utils/index.d.ts +45 -0
  1132. package/dist/lib/utils/index.d.ts.map +1 -0
  1133. package/dist/lib/utils/index.js +197 -0
  1134. package/dist/lib/utils/mobile-editor.d.ts +13 -0
  1135. package/dist/lib/utils/mobile-editor.d.ts.map +1 -0
  1136. package/dist/lib/utils/mobile-editor.js +34 -0
  1137. package/dist/lib/utils/phone-format.d.ts +6 -0
  1138. package/dist/lib/utils/phone-format.d.ts.map +1 -0
  1139. package/dist/lib/utils/phone-format.js +17 -0
  1140. package/dist/lib/utils/product-catalog.d.ts +11 -0
  1141. package/dist/lib/utils/product-catalog.d.ts.map +1 -0
  1142. package/dist/lib/utils/product-catalog.js +40 -0
  1143. package/dist/lib/utils/product-images.d.ts +20 -0
  1144. package/dist/lib/utils/product-images.d.ts.map +1 -0
  1145. package/dist/lib/utils/product-images.js +31 -0
  1146. package/dist/lib/utils/product-share.d.ts +17 -0
  1147. package/dist/lib/utils/product-share.d.ts.map +1 -0
  1148. package/dist/lib/utils/product-share.js +48 -0
  1149. package/dist/lib/utils/scroll-to-top.util.d.ts +9 -0
  1150. package/dist/lib/utils/scroll-to-top.util.d.ts.map +1 -0
  1151. package/dist/lib/utils/scroll-to-top.util.js +18 -0
  1152. package/dist/lib/utils/url-helpers.d.ts +30 -0
  1153. package/dist/lib/utils/url-helpers.d.ts.map +1 -0
  1154. package/dist/lib/utils/url-helpers.js +61 -0
  1155. package/dist/lib/utils/video-helpers.d.ts +32 -0
  1156. package/dist/lib/utils/video-helpers.d.ts.map +1 -0
  1157. package/dist/lib/utils/video-helpers.js +210 -0
  1158. package/dist/preview/LayoutPreview.d.ts +14 -0
  1159. package/dist/preview/LayoutPreview.d.ts.map +1 -0
  1160. package/dist/preview/LayoutPreview.js +122 -0
  1161. package/dist/preview/PreviewRouter.d.ts +9 -0
  1162. package/dist/preview/PreviewRouter.d.ts.map +1 -0
  1163. package/dist/preview/PreviewRouter.js +332 -0
  1164. package/dist/preview/ShadowDOMWrapper.d.ts +18 -0
  1165. package/dist/preview/ShadowDOMWrapper.d.ts.map +1 -0
  1166. package/dist/preview/ShadowDOMWrapper.js +80 -0
  1167. package/dist/preview/canvas/PreviewBlockToolbar.d.ts +23 -0
  1168. package/dist/preview/canvas/PreviewBlockToolbar.d.ts.map +1 -0
  1169. package/dist/preview/canvas/PreviewBlockToolbar.js +113 -0
  1170. package/dist/preview/canvas/PreviewCanvasEnhancer.d.ts +17 -0
  1171. package/dist/preview/canvas/PreviewCanvasEnhancer.d.ts.map +1 -0
  1172. package/dist/preview/canvas/PreviewCanvasEnhancer.js +741 -0
  1173. package/dist/preview/canvas/PreviewCanvasStyles.d.ts +4 -0
  1174. package/dist/preview/canvas/PreviewCanvasStyles.d.ts.map +1 -0
  1175. package/dist/preview/canvas/PreviewCanvasStyles.js +51 -0
  1176. package/dist/preview/canvas/extract-editable-plain-text.d.ts +11 -0
  1177. package/dist/preview/canvas/extract-editable-plain-text.d.ts.map +1 -0
  1178. package/dist/preview/canvas/extract-editable-plain-text.js +65 -0
  1179. package/dist/preview/canvas/field-key.d.ts +34 -0
  1180. package/dist/preview/canvas/field-key.d.ts.map +1 -0
  1181. package/dist/preview/canvas/field-key.js +62 -0
  1182. package/dist/preview/canvas/preview-editable-commit.util.d.ts +3 -0
  1183. package/dist/preview/canvas/preview-editable-commit.util.d.ts.map +1 -0
  1184. package/dist/preview/canvas/preview-editable-commit.util.js +11 -0
  1185. package/dist/preview/canvas/preview-flush-await.d.ts +6 -0
  1186. package/dist/preview/canvas/preview-flush-await.d.ts.map +1 -0
  1187. package/dist/preview/canvas/preview-flush-await.js +23 -0
  1188. package/dist/preview/canvas/preview-flush-handle.d.ts +13 -0
  1189. package/dist/preview/canvas/preview-flush-handle.d.ts.map +1 -0
  1190. package/dist/preview/canvas/preview-flush-handle.js +3 -0
  1191. package/dist/preview/canvas/preview-isolation.d.ts +9 -0
  1192. package/dist/preview/canvas/preview-isolation.d.ts.map +1 -0
  1193. package/dist/preview/canvas/preview-isolation.js +10 -0
  1194. package/dist/preview/canvas/preview-messages.d.ts +65 -0
  1195. package/dist/preview/canvas/preview-messages.d.ts.map +1 -0
  1196. package/dist/preview/canvas/preview-messages.js +17 -0
  1197. package/dist/preview/canvas/preview-route.d.ts +4 -0
  1198. package/dist/preview/canvas/preview-route.d.ts.map +1 -0
  1199. package/dist/preview/canvas/preview-route.js +76 -0
  1200. package/dist/preview/index.d.ts +13 -0
  1201. package/dist/preview/index.d.ts.map +1 -0
  1202. package/dist/preview/index.js +12 -0
  1203. package/dist/preview/route-audit.d.ts +17 -0
  1204. package/dist/preview/route-audit.d.ts.map +1 -0
  1205. package/dist/preview/route-audit.js +54 -0
  1206. package/dist/styles/index.css +10602 -0
  1207. package/dist/utils/date.d.ts +20 -0
  1208. package/dist/utils/date.d.ts.map +1 -0
  1209. package/dist/utils/date.js +47 -0
  1210. package/package.json +199 -0
@@ -0,0 +1,1737 @@
1
+ import { getStoreConfig } from './store-config.js';
2
+ import { shouldUseAPI, getBaseStoreSlug } from './utils/demo-detection.js';
3
+ import { storeService } from './services/store.service.js';
4
+ import { categoryService } from './services/category.service.js';
5
+ import { productService } from './services/product.service.js';
6
+ import { serviceService } from './services/service.service.js';
7
+ import { coerceRichFieldForStorefront } from './rich-html.js';
8
+ import { normalizePrice } from './utils/index.js';
9
+ import { extractPublishedLayoutConfig, resolveLayoutConfigWithTemplateDefaults, extractTemplateLayoutPayload } from '../lib/layout-config-hydration.js';
10
+ import { getTemplateLayoutConfigForLayoutType } from './store-config.js';
11
+ import { resolveCheckoutEnabledFromApi } from './checkout-availability.js';
12
+ import { normalizeBookingTestimonialItems, clampBookingTestimonialLimit, } from '../layouts/booking/components/booking-testimonial-defaults.js';
13
+ // Simple ID generator fallback (doesn't require uuid package)
14
+ function generateId() {
15
+ if (typeof crypto !== 'undefined' && crypto.randomUUID) {
16
+ return crypto.randomUUID();
17
+ }
18
+ // Fallback for environments without crypto.randomUUID
19
+ return `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
20
+ }
21
+ /**
22
+ * Comprehensive function to extract and validate image URLs from any format
23
+ * Handles: strings, objects, arrays, JSON-encoded, comma-separated, fragmented JSON
24
+ * @param input - Can be string, object, array, or any combination
25
+ * @returns Array of valid absolute image URLs
26
+ */
27
+ export function extractImageUrls(input) {
28
+ if (!input) {
29
+ return [];
30
+ }
31
+ // Handle arrays
32
+ if (Array.isArray(input)) {
33
+ if (input.length === 0) {
34
+ return [];
35
+ }
36
+ // Check if array contains objects with url property
37
+ const firstItem = input[0];
38
+ if (firstItem && typeof firstItem === 'object' && firstItem !== null && 'url' in firstItem) {
39
+ // Array of objects: [{url: "...", isPrimary: true}, ...]
40
+ return input
41
+ .map((item) => extractImageUrls(item)) // Recursively extract from each object
42
+ .flat()
43
+ .filter((url) => url.length > 0);
44
+ }
45
+ // Check if array contains fragmented JSON strings (TypeORM simple-array issue)
46
+ if (typeof firstItem === 'string' && firstItem.trim().startsWith('[') && firstItem.includes('"url"')) {
47
+ try {
48
+ // Reconstruct fragmented JSON
49
+ const reconstructedJson = input.join('');
50
+ const parsed = JSON.parse(reconstructedJson);
51
+ return extractImageUrls(parsed); // Recursively process parsed result
52
+ }
53
+ catch {
54
+ // If reconstruction fails, treat as string array
55
+ }
56
+ }
57
+ // Array of strings: ["url1", "url2", ...]
58
+ return input
59
+ .map((item) => extractImageUrls(item)) // Recursively extract from each item
60
+ .flat()
61
+ .filter((url) => url.length > 0);
62
+ }
63
+ // Handle objects
64
+ if (typeof input === 'object' && input !== null) {
65
+ // Object with url property: {url: "...", isPrimary: true}
66
+ if ('url' in input && typeof input.url === 'string') {
67
+ const url = validateAndConvertUrl(input.url);
68
+ return url ? [url] : [];
69
+ }
70
+ // Stringified object: '{"url":"..."}'
71
+ if (typeof input === 'object' && Object.keys(input).length === 0) {
72
+ return [];
73
+ }
74
+ // Try to find url in nested structure
75
+ for (const key of ['url', 'image', 'src', 'imageUrl', 'image_url']) {
76
+ if (key in input && typeof input[key] === 'string') {
77
+ const url = validateAndConvertUrl(input[key]);
78
+ if (url)
79
+ return [url];
80
+ }
81
+ }
82
+ return [];
83
+ }
84
+ // Handle strings
85
+ if (typeof input === 'string') {
86
+ const trimmed = input.trim();
87
+ if (trimmed.length === 0) {
88
+ return [];
89
+ }
90
+ // Check if it's JSON-encoded
91
+ if ((trimmed.startsWith('[') || trimmed.startsWith('{')) && (trimmed.includes('"url"') || trimmed.includes('"image"'))) {
92
+ try {
93
+ const parsed = JSON.parse(trimmed);
94
+ return extractImageUrls(parsed); // Recursively process parsed result
95
+ }
96
+ catch {
97
+ // Not valid JSON, continue as string
98
+ }
99
+ }
100
+ // Check if it's comma-separated URLs
101
+ if (trimmed.includes(',') && (trimmed.includes('http://') || trimmed.includes('https://') || trimmed.includes('r2.dev'))) {
102
+ return trimmed
103
+ .split(',')
104
+ .map((s) => s.trim())
105
+ .map((url) => validateAndConvertUrl(url))
106
+ .filter((url) => url.length > 0);
107
+ }
108
+ // Single URL string
109
+ const url = validateAndConvertUrl(trimmed);
110
+ return url ? [url] : [];
111
+ }
112
+ return [];
113
+ }
114
+ /**
115
+ * Validates a URL string (CDN URLs from Cloudflare Object Storage are used as-is)
116
+ * @param url - URL string to validate
117
+ * @returns Valid URL string or empty string
118
+ */
119
+ function validateAndConvertUrl(url) {
120
+ if (!url || typeof url !== 'string') {
121
+ return '';
122
+ }
123
+ const trimmed = url.trim();
124
+ if (trimmed.length === 0) {
125
+ return '';
126
+ }
127
+ // URLs from Cloudflare Object Storage (CDN) are already absolute - use as-is
128
+ // Only validate that it's a non-empty string
129
+ return trimmed;
130
+ }
131
+ /**
132
+ * Validates a single image URL string
133
+ * @param url - URL to validate
134
+ * @returns Valid URL string or empty string
135
+ */
136
+ function validateImageUrl(url) {
137
+ if (!url) {
138
+ return '';
139
+ }
140
+ // Handle string URLs
141
+ if (typeof url === 'string') {
142
+ const trimmed = url.trim();
143
+ return trimmed.length > 0 ? trimmed : '';
144
+ }
145
+ // Handle number (convert to string)
146
+ if (typeof url === 'number') {
147
+ return String(url).trim();
148
+ }
149
+ // Handle object with url property (nested structures)
150
+ if (typeof url === 'object' && url !== null) {
151
+ // Try common URL property names
152
+ for (const key of ['url', 'src', 'image', 'imageUrl', 'image_url', 'value']) {
153
+ if (key in url && url[key]) {
154
+ const extracted = validateImageUrl(url[key]);
155
+ if (extracted)
156
+ return extracted;
157
+ }
158
+ }
159
+ }
160
+ return '';
161
+ }
162
+ /**
163
+ * Product-specific image extraction function
164
+ * Comprehensive function that handles all image storage formats
165
+ * URLs are used as-is from CDN (Cloudflare Object Storage)
166
+ * @param images - Can be:
167
+ * - Array of objects: [{url: string}, ...] or [{url: {url: string}}, ...]
168
+ * - Array of strings: ["url1", "url2"]
169
+ * - Single object: {url: string}
170
+ * - Single string: "url"
171
+ * - JSON string: '{"url":"..."}' or '[{"url":"..."}]'
172
+ * - null/undefined
173
+ * @returns Array of valid URL strings
174
+ */
175
+ function extractProductImageUrls(images) {
176
+ // Handle null/undefined
177
+ if (!images) {
178
+ return [];
179
+ }
180
+ // Handle JSON strings (parsed or unparsed)
181
+ if (typeof images === 'string') {
182
+ const trimmed = images.trim();
183
+ if (trimmed.length === 0) {
184
+ return [];
185
+ }
186
+ // Try to parse as JSON (handles both single and double-stringified)
187
+ if ((trimmed.startsWith('[') || trimmed.startsWith('{') || trimmed.startsWith('"')) && (trimmed.includes('"url"') || trimmed.includes('"image"'))) {
188
+ try {
189
+ let parsed = JSON.parse(trimmed);
190
+ // Check if result is still a string (double-stringified)
191
+ if (typeof parsed === 'string') {
192
+ try {
193
+ parsed = JSON.parse(parsed);
194
+ }
195
+ catch (e) {
196
+ // Not double-stringified, continue as string URL
197
+ }
198
+ }
199
+ // Recursively process the parsed result
200
+ return extractProductImageUrls(parsed);
201
+ }
202
+ catch (e) {
203
+ // Not valid JSON, continue as string URL
204
+ }
205
+ }
206
+ // Check if it's comma-separated URLs
207
+ if (trimmed.includes(',') && (trimmed.includes('http://') || trimmed.includes('https://') || trimmed.includes('r2.dev') || trimmed.includes('pub-'))) {
208
+ return trimmed
209
+ .split(',')
210
+ .map((url) => validateImageUrl(url))
211
+ .filter((url) => url.length > 0);
212
+ }
213
+ // Single URL string
214
+ const url = validateImageUrl(trimmed);
215
+ return url ? [url] : [];
216
+ }
217
+ // Handle arrays - this is the most common case
218
+ if (Array.isArray(images)) {
219
+ if (images.length === 0) {
220
+ return [];
221
+ }
222
+ const firstItem = images[0];
223
+ // Case 1: Array of objects with url property: [{url: "...", isPrimary: true}, ...]
224
+ // This is what backend normalizeProductImages returns
225
+ // Also handles nested: [{url: {url: "..."}}]
226
+ if (firstItem && typeof firstItem === 'object' && firstItem !== null) {
227
+ const result = [];
228
+ for (const item of images) {
229
+ if (!item)
230
+ continue;
231
+ // Handle object items
232
+ if (typeof item === 'object' && item !== null) {
233
+ // Check for direct url property
234
+ if ('url' in item) {
235
+ const url = validateImageUrl(item.url);
236
+ if (url) {
237
+ result.push(url);
238
+ continue;
239
+ }
240
+ }
241
+ // Check for other common property names
242
+ for (const key of ['src', 'image', 'imageUrl', 'image_url', 'value']) {
243
+ if (key in item) {
244
+ const url = validateImageUrl(item[key]);
245
+ if (url) {
246
+ result.push(url);
247
+ break;
248
+ }
249
+ }
250
+ }
251
+ }
252
+ // Handle string items in mixed arrays
253
+ else if (typeof item === 'string') {
254
+ const url = validateImageUrl(item);
255
+ if (url) {
256
+ result.push(url);
257
+ }
258
+ }
259
+ }
260
+ if (result.length > 0) {
261
+ return result;
262
+ }
263
+ }
264
+ // Case 2: Array of string URLs: ["url1", "url2", ...]
265
+ if (typeof firstItem === 'string') {
266
+ return images
267
+ .map((item) => validateImageUrl(item))
268
+ .filter((url) => url.length > 0);
269
+ }
270
+ // Case 3: Array of mixed types - try to extract from each
271
+ const result = [];
272
+ for (const item of images) {
273
+ const url = validateImageUrl(item);
274
+ if (url) {
275
+ result.push(url);
276
+ }
277
+ }
278
+ return result;
279
+ }
280
+ // Handle single object with url property
281
+ if (typeof images === 'object' && images !== null && !Array.isArray(images)) {
282
+ // Check for direct url property
283
+ if ('url' in images) {
284
+ const url = validateImageUrl(images.url);
285
+ if (url) {
286
+ return [url];
287
+ }
288
+ }
289
+ // Check for other common property names
290
+ for (const key of ['src', 'image', 'imageUrl', 'image_url', 'value']) {
291
+ if (key in images) {
292
+ const url = validateImageUrl(images[key]);
293
+ if (url) {
294
+ return [url];
295
+ }
296
+ }
297
+ }
298
+ }
299
+ return [];
300
+ }
301
+ /**
302
+ * Converts a relative URL to an absolute URL using the API base URL
303
+ * @param url - The URL to convert (can be relative like /uploads/... or already absolute)
304
+ * @returns Absolute URL string
305
+ * @deprecated Use validateAndConvertUrl instead for better validation
306
+ */
307
+ function convertToAbsoluteUrl(url) {
308
+ return validateAndConvertUrl(url);
309
+ }
310
+ /**
311
+ * Valid StoreLayoutType values
312
+ */
313
+ const VALID_LAYOUTS = [
314
+ 'food',
315
+ 'food-modern',
316
+ 'clothing',
317
+ 'clothing-minimal',
318
+ 'booking',
319
+ 'booking-agenda',
320
+ 'electronics',
321
+ 'electronics-grid',
322
+ ];
323
+ /**
324
+ * Maps API layout string to StoreLayoutType
325
+ * Falls back to 'food' if layout is invalid or missing
326
+ */
327
+ function mapLayoutToStoreLayoutType(layout) {
328
+ if (!layout) {
329
+ return 'food'; // Default fallback
330
+ }
331
+ // Check if layout is a valid StoreLayoutType
332
+ if (VALID_LAYOUTS.includes(layout)) {
333
+ return layout;
334
+ }
335
+ // Try to match by prefix for flexibility
336
+ const normalizedLayout = layout.toLowerCase();
337
+ for (const validLayout of VALID_LAYOUTS) {
338
+ if (normalizedLayout.startsWith(validLayout) || validLayout.startsWith(normalizedLayout)) {
339
+ return validLayout;
340
+ }
341
+ }
342
+ // Default fallback
343
+ return 'food';
344
+ }
345
+ /**
346
+ * Category-specific image extraction function
347
+ * Handles all category image storage formats independently
348
+ * @param image - Can be:
349
+ * - String URL: "https://..."
350
+ * - Object: {url: "https://..."}
351
+ * - Array: ["https://..."] or [{url: "https://..."}]
352
+ * - JSON string: '{"url":"..."}' or '"https://..."'
353
+ * - null/undefined
354
+ * @returns Single valid URL string or undefined
355
+ */
356
+ function extractCategoryImageUrl(image) {
357
+ if (!image) {
358
+ return undefined;
359
+ }
360
+ // Handle string URLs
361
+ if (typeof image === 'string') {
362
+ const trimmed = image.trim();
363
+ if (trimmed.length === 0) {
364
+ return undefined;
365
+ }
366
+ // Try to parse as JSON
367
+ if ((trimmed.startsWith('[') || trimmed.startsWith('{')) && (trimmed.includes('"url"') || trimmed.includes('"image"'))) {
368
+ try {
369
+ const parsed = JSON.parse(trimmed);
370
+ return extractCategoryImageUrl(parsed);
371
+ }
372
+ catch {
373
+ // Not valid JSON, continue as string URL
374
+ }
375
+ }
376
+ // Validate and return single URL string
377
+ const url = validateImageUrl(trimmed);
378
+ return url || undefined;
379
+ }
380
+ // Handle arrays - take first valid URL
381
+ if (Array.isArray(image)) {
382
+ if (image.length === 0) {
383
+ return undefined;
384
+ }
385
+ // Try to extract from first item
386
+ for (const item of image) {
387
+ const url = extractCategoryImageUrl(item);
388
+ if (url) {
389
+ return url;
390
+ }
391
+ }
392
+ return undefined;
393
+ }
394
+ // Handle objects
395
+ if (typeof image === 'object' && image !== null) {
396
+ // Check for direct url property
397
+ if ('url' in image) {
398
+ const url = validateImageUrl(image.url);
399
+ if (url) {
400
+ return url;
401
+ }
402
+ }
403
+ // Check for other common property names
404
+ for (const key of ['src', 'image', 'imageUrl', 'image_url', 'value']) {
405
+ if (key in image) {
406
+ const url = validateImageUrl(image[key]);
407
+ if (url) {
408
+ return url;
409
+ }
410
+ }
411
+ }
412
+ }
413
+ return undefined;
414
+ }
415
+ /**
416
+ * Transforms API Category to StoreCategory format
417
+ * Uses dedicated category image extraction function for independent validation
418
+ */
419
+ export function transformCategoryToStoreCategory(apiCategory) {
420
+ // Use category-specific image extraction function
421
+ // This ensures independent validation for category images
422
+ const imageUrl = extractCategoryImageUrl(apiCategory.image);
423
+ return {
424
+ id: apiCategory.id,
425
+ name: apiCategory.name,
426
+ slug: apiCategory.slug,
427
+ description: coerceRichFieldForStorefront(apiCategory.description),
428
+ image: imageUrl,
429
+ parentId: apiCategory.parentId,
430
+ };
431
+ }
432
+ function sumRawAvailableFromInventory(inventory) {
433
+ return inventory.reduce((sum, inv) => {
434
+ const qty = Number(inv.quantity) || 0;
435
+ const reserved = Math.max(0, Math.min(Number(inv.reservedQuantity) || 0, qty));
436
+ return sum + Math.max(0, qty - reserved);
437
+ }, 0);
438
+ }
439
+ function normalizeVariationAttributes(variation) {
440
+ const attributes = {};
441
+ const raw = variation.attributes || {};
442
+ for (const [key, value] of Object.entries(raw)) {
443
+ if (typeof value === 'string' && value.trim() !== '') {
444
+ attributes[key.toLowerCase()] = value.trim();
445
+ }
446
+ }
447
+ if (Object.keys(attributes).length === 0) {
448
+ const sku = typeof variation.sku === 'string' ? variation.sku.trim() : '';
449
+ if (sku) {
450
+ attributes.option = sku;
451
+ }
452
+ }
453
+ return attributes;
454
+ }
455
+ function mapApiVariationsToStoreVariants(apiProduct) {
456
+ const variations = apiProduct.variations;
457
+ if (!Array.isArray(variations) || variations.length === 0) {
458
+ return undefined;
459
+ }
460
+ return variations
461
+ .filter((variation) => variation.isActive !== false)
462
+ .map((variation) => {
463
+ const attributes = normalizeVariationAttributes(variation);
464
+ const optionValue = attributes.option;
465
+ return {
466
+ id: variation.id,
467
+ attributes,
468
+ name: variation.name || (optionValue ? 'Option' : ''),
469
+ value: variation.value || optionValue || '',
470
+ price: variation.price
471
+ ? typeof variation.price === 'string'
472
+ ? parseFloat(variation.price)
473
+ : Number(variation.price)
474
+ : undefined,
475
+ compareAtPrice: variation.compareAtPrice
476
+ ? typeof variation.compareAtPrice === 'string'
477
+ ? parseFloat(variation.compareAtPrice)
478
+ : Number(variation.compareAtPrice)
479
+ : undefined,
480
+ sku: variation.sku,
481
+ stock: variation.stock != null
482
+ ? typeof variation.stock === 'string'
483
+ ? parseFloat(variation.stock)
484
+ : Number(variation.stock)
485
+ : undefined,
486
+ inStock: variation.inStock !== false,
487
+ isActive: variation.isActive !== false,
488
+ images: (() => {
489
+ const raw = variation.images;
490
+ let parsed = raw;
491
+ if (typeof raw === 'string') {
492
+ try {
493
+ parsed = JSON.parse(raw);
494
+ }
495
+ catch {
496
+ return raw.trim() ? [raw.trim()] : undefined;
497
+ }
498
+ }
499
+ if (!Array.isArray(parsed) || parsed.length === 0)
500
+ return undefined;
501
+ const urls = parsed
502
+ .map((img) => {
503
+ if (typeof img === 'string')
504
+ return img.trim();
505
+ if (img && typeof img === 'object' && typeof img.url === 'string') {
506
+ return img.url.trim();
507
+ }
508
+ return '';
509
+ })
510
+ .filter(Boolean);
511
+ return urls.length > 0 ? urls : undefined;
512
+ })(),
513
+ };
514
+ });
515
+ }
516
+ export function transformProductToStoreProduct(apiProduct, options) {
517
+ let availableStock;
518
+ let lowStockThreshold;
519
+ let inStock = true;
520
+ const cartLineQty = options?.cartLineQty != null ? Math.max(0, Math.floor(options.cartLineQty)) : undefined;
521
+ const isCartLineContext = cartLineQty != null && cartLineQty > 0 || apiProduct.stockSource === 'cart-line';
522
+ // All products track inventory by default unless explicitly opted out.
523
+ const isTracked = apiProduct.trackInventory !== false &&
524
+ apiProduct.trackInventory !== 0 &&
525
+ apiProduct.trackInventory !== 'false';
526
+ if (isTracked) {
527
+ const explicitAvailable = typeof apiProduct.availableStock === 'number'
528
+ ? Math.max(0, apiProduct.availableStock)
529
+ : undefined;
530
+ if (isCartLineContext && explicitAvailable != null) {
531
+ availableStock = explicitAvailable;
532
+ inStock = explicitAvailable > 0;
533
+ if (typeof apiProduct.lowStockThreshold === 'number') {
534
+ lowStockThreshold = apiProduct.lowStockThreshold;
535
+ }
536
+ }
537
+ else if (isCartLineContext &&
538
+ apiProduct.inventory &&
539
+ Array.isArray(apiProduct.inventory) &&
540
+ apiProduct.inventory.length > 0) {
541
+ const rawAvailable = sumRawAvailableFromInventory(apiProduct.inventory);
542
+ availableStock = rawAvailable + (cartLineQty ?? 0);
543
+ const thresholds = apiProduct.inventory
544
+ .map((inv) => Number(inv.lowStockThreshold))
545
+ .filter((value) => Number.isFinite(value) && value > 0);
546
+ if (thresholds.length > 0) {
547
+ lowStockThreshold = Math.max(...thresholds);
548
+ }
549
+ inStock = availableStock > 0;
550
+ }
551
+ else if (explicitAvailable != null) {
552
+ availableStock = explicitAvailable;
553
+ inStock = explicitAvailable > 0;
554
+ if (typeof apiProduct.lowStockThreshold === 'number') {
555
+ lowStockThreshold = apiProduct.lowStockThreshold;
556
+ }
557
+ }
558
+ else if (apiProduct.inventory && Array.isArray(apiProduct.inventory) && apiProduct.inventory.length > 0) {
559
+ availableStock = sumRawAvailableFromInventory(apiProduct.inventory);
560
+ const thresholds = apiProduct.inventory
561
+ .map((inv) => Number(inv.lowStockThreshold))
562
+ .filter((value) => Number.isFinite(value) && value > 0);
563
+ if (thresholds.length > 0) {
564
+ lowStockThreshold = Math.max(...thresholds);
565
+ }
566
+ inStock = availableStock > 0;
567
+ }
568
+ else {
569
+ const fallbackStock = Math.max(0, Number(apiProduct.stock) || 0);
570
+ availableStock = fallbackStock;
571
+ inStock = fallbackStock > 0;
572
+ }
573
+ }
574
+ else {
575
+ inStock = true;
576
+ availableStock = undefined;
577
+ }
578
+ // Convert price to number (API may return string from decimal type)
579
+ const price = normalizePrice(apiProduct.price);
580
+ // Convert compareAtPrice to number if it exists and is meaningful
581
+ const compareAtPriceRaw = apiProduct.compareAtPrice != null
582
+ ? normalizePrice(apiProduct.compareAtPrice)
583
+ : undefined;
584
+ const compareAtPrice = compareAtPriceRaw != null && compareAtPriceRaw > 0 ? compareAtPriceRaw : undefined;
585
+ const isLimitedTimeOffer = Boolean(apiProduct.isLimitedTimeOffer);
586
+ const limitedTimeOfferEndsAtRaw = apiProduct.limitedTimeOfferEndsAt;
587
+ const limitedTimeOfferEndsAt = limitedTimeOfferEndsAtRaw != null && String(limitedTimeOfferEndsAtRaw).trim()
588
+ ? String(limitedTimeOfferEndsAtRaw)
589
+ : null;
590
+ // Use product-specific image extraction function
591
+ // Backend returns: [{url: string, isPrimary?: boolean}]
592
+ // Frontend needs: string[] (array of URL strings)
593
+ let images = extractProductImageUrls(apiProduct.images);
594
+ // Ensure all extracted URLs are valid (non-empty strings)
595
+ images = images.filter((url) => url && typeof url === 'string' && url.trim().length > 0);
596
+ // Enhanced logging for debugging image extraction issues
597
+ if (images.length === 0 && apiProduct.images) {
598
+ console.warn('[transformProductToStoreProduct] WARNING: No images extracted!', {
599
+ productId: apiProduct.id,
600
+ productName: apiProduct.name,
601
+ inputImages: apiProduct.images,
602
+ inputType: typeof apiProduct.images,
603
+ inputIsArray: Array.isArray(apiProduct.images),
604
+ inputLength: Array.isArray(apiProduct.images) ? apiProduct.images.length : 'N/A',
605
+ inputStringified: typeof apiProduct.images === 'string' ? apiProduct.images.substring(0, 200) : JSON.stringify(apiProduct.images || []).substring(0, 200)
606
+ });
607
+ // Try fallback extraction using the general extractImageUrls function
608
+ const fallbackImages = extractImageUrls(apiProduct.images);
609
+ if (fallbackImages.length > 0) {
610
+ console.log('[transformProductToStoreProduct] Fallback extraction succeeded:', {
611
+ productId: apiProduct.id,
612
+ extractedCount: fallbackImages.length
613
+ });
614
+ images = fallbackImages.filter((url) => url && typeof url === 'string' && url.trim().length > 0);
615
+ }
616
+ }
617
+ else if (images.length > 0) {
618
+ // Log successful extraction in development
619
+ if (process.env.NODE_ENV === 'development') {
620
+ console.log('[transformProductToStoreProduct] Successfully extracted images:', {
621
+ productId: apiProduct.id,
622
+ productName: apiProduct.name,
623
+ imageCount: images.length,
624
+ firstImage: images[0]?.substring(0, 100)
625
+ });
626
+ }
627
+ }
628
+ // Convert rating to number, handling undefined, null, or string values
629
+ let rating;
630
+ if (apiProduct.rating !== undefined && apiProduct.rating !== null) {
631
+ if (typeof apiProduct.rating === 'number') {
632
+ rating = apiProduct.rating;
633
+ }
634
+ else if (typeof apiProduct.rating === 'string') {
635
+ const parsed = parseFloat(apiProduct.rating);
636
+ rating = isNaN(parsed) ? undefined : parsed;
637
+ }
638
+ else {
639
+ rating = undefined;
640
+ }
641
+ }
642
+ // Generate SKU from slug or name if not provided
643
+ const generateSKU = (product) => {
644
+ // Try to get SKU from metadata first
645
+ if (product.metadata?.sku) {
646
+ return String(product.metadata.sku);
647
+ }
648
+ // Check if any variation has a SKU (use the first one found)
649
+ if (product.variations && product.variations.length > 0) {
650
+ const variationWithSKU = product.variations.find((v) => v.sku);
651
+ if (variationWithSKU?.sku) {
652
+ return String(variationWithSKU.sku);
653
+ }
654
+ }
655
+ // Generate SKU from slug (uppercase, remove hyphens, take first 8-12 chars)
656
+ if (product.slug) {
657
+ const slugSKU = product.slug.toUpperCase().replace(/[^A-Z0-9]/g, '').substring(0, 12);
658
+ return slugSKU.length >= 6 ? slugSKU : slugSKU.padEnd(8, 'X');
659
+ }
660
+ // Fallback: generate from name (uppercase, alphanumeric only, first 8-12 chars)
661
+ const nameSKU = product.name
662
+ .toUpperCase()
663
+ .replace(/[^A-Z0-9]/g, '')
664
+ .substring(0, 12);
665
+ return nameSKU.length >= 6 ? nameSKU : nameSKU.padEnd(8, 'X');
666
+ };
667
+ // Extract reviewCount from API product (added by backend)
668
+ const reviewCount = apiProduct.reviewCount !== undefined
669
+ ? Number(apiProduct.reviewCount)
670
+ : undefined;
671
+ return {
672
+ id: apiProduct.id,
673
+ name: apiProduct.name,
674
+ slug: apiProduct.slug,
675
+ description: coerceRichFieldForStorefront(apiProduct.description),
676
+ price,
677
+ compareAtPrice,
678
+ isLimitedTimeOffer,
679
+ limitedTimeOfferEndsAt,
680
+ images,
681
+ categoryId: apiProduct.categoryId || '',
682
+ inStock,
683
+ trackInventory: isTracked,
684
+ availableStock,
685
+ lowStockThreshold,
686
+ rating,
687
+ reviewCount,
688
+ sku: generateSKU(apiProduct),
689
+ currency: apiProduct.currency || 'USD',
690
+ variants: mapApiVariationsToStoreVariants(apiProduct),
691
+ specifications: apiProduct.brand ? { brand: apiProduct.brand } : undefined,
692
+ isActive: apiProduct.isActive,
693
+ status: apiProduct.status,
694
+ };
695
+ }
696
+ /**
697
+ * Transforms API Service to StoreService format
698
+ */
699
+ export function transformServiceToStoreService(apiService) {
700
+ // Convert price to number (API may return string from decimal type)
701
+ const price = normalizePrice(apiService.price);
702
+ // Extract image from images array or use image field
703
+ let image;
704
+ if (apiService.image) {
705
+ image = apiService.image;
706
+ }
707
+ else if (apiService.images) {
708
+ const imageUrls = extractImageUrls(apiService.images);
709
+ image = imageUrls.length > 0 ? imageUrls[0] : undefined;
710
+ }
711
+ // Convert availability to StoreService format
712
+ let availability;
713
+ if (apiService.availability) {
714
+ if (Array.isArray(apiService.availability)) {
715
+ availability = apiService.availability.map((avail) => ({
716
+ day: avail.day || '',
717
+ slots: avail.slots || [],
718
+ }));
719
+ }
720
+ else if (typeof apiService.availability === 'object') {
721
+ // Handle object format - convert to array format
722
+ const availObj = apiService.availability;
723
+ if (availObj.days && Array.isArray(availObj.days)) {
724
+ availability = availObj.days.map((day) => ({
725
+ day,
726
+ slots: availObj.timeSlots || [],
727
+ }));
728
+ }
729
+ else if (availObj.day) {
730
+ availability = [{
731
+ day: availObj.day,
732
+ slots: availObj.slots || [],
733
+ }];
734
+ }
735
+ }
736
+ }
737
+ // Extract provider info if available (providerId exists but provider relation may not be loaded)
738
+ const provider = apiService.providerId ? {
739
+ id: apiService.providerId,
740
+ name: apiService.provider?.name || 'Service Provider',
741
+ avatar: apiService.provider?.avatar,
742
+ rating: apiService.provider?.rating,
743
+ } : undefined;
744
+ return {
745
+ id: apiService.id,
746
+ name: apiService.name,
747
+ slug: apiService.slug,
748
+ description: coerceRichFieldForStorefront(apiService.description) || '',
749
+ price,
750
+ currency: apiService.currency,
751
+ duration: apiService.duration || 0,
752
+ categoryId: apiService.categoryId || '',
753
+ image,
754
+ provider,
755
+ availability,
756
+ isActive: apiService.isActive,
757
+ status: apiService.status,
758
+ };
759
+ }
760
+ /**
761
+ * Transforms API StoreResponse to StoreConfig format
762
+ */
763
+ export function transformStoreResponseToConfig(apiStore) {
764
+ const layout = mapLayoutToStoreLayoutType(apiStore.layout);
765
+ // Debug logging for layoutConfig
766
+ if (process.env.NODE_ENV === 'development') {
767
+ console.log('[transformStoreResponseToConfig] Received apiStore.layoutConfig:', {
768
+ exists: !!apiStore.layoutConfig,
769
+ type: typeof apiStore.layoutConfig,
770
+ hasSections: !!apiStore.layoutConfig?.sections,
771
+ hasHeroSliders: !!apiStore.layoutConfig?.sections?.hero?.sliders,
772
+ sliderCount: apiStore.layoutConfig?.sections?.hero?.sliders?.length || 0,
773
+ });
774
+ }
775
+ // Build contactInfo from various sources
776
+ let contactInfo = apiStore.contactInfo || {
777
+ email: apiStore.contactEmail,
778
+ phone: apiStore.contactPhone,
779
+ address: apiStore.address,
780
+ };
781
+ // If contactInfo exists but doesn't have an address, merge Store's address if available
782
+ if (contactInfo && !contactInfo.address && apiStore.address) {
783
+ contactInfo = {
784
+ ...contactInfo,
785
+ address: apiStore.address,
786
+ };
787
+ }
788
+ const rawLayoutConfig = apiStore.layoutConfig ??
789
+ apiStore.layoutContent ??
790
+ apiStore.layoutcontent ??
791
+ undefined;
792
+ const transformedLayoutConfig = transformLayoutConfig(rawLayoutConfig, {
793
+ storeSlug: apiStore.slug,
794
+ storeLayout: layout,
795
+ });
796
+ if (process.env.NODE_ENV === 'development') {
797
+ console.log('[transformStoreResponseToConfig] Transformed layoutConfig:', {
798
+ exists: !!transformedLayoutConfig,
799
+ hasSections: !!transformedLayoutConfig?.sections,
800
+ hasHeroSliders: !!transformedLayoutConfig?.sections?.hero?.sliders,
801
+ sliderCount: transformedLayoutConfig?.sections?.hero?.sliders?.length || 0,
802
+ });
803
+ }
804
+ return {
805
+ id: apiStore.id,
806
+ slug: apiStore.slug,
807
+ name: apiStore.name,
808
+ description: apiStore.description || '',
809
+ checkoutEnabled: resolveCheckoutEnabledFromApi(apiStore.checkoutEnabled),
810
+ type: layout,
811
+ layout: layout,
812
+ branding: {
813
+ primaryColor: apiStore.branding?.primaryColor || '#000000',
814
+ secondaryColor: apiStore.branding?.secondaryColor,
815
+ accentColor: apiStore.branding?.secondaryColor || apiStore.branding?.primaryColor || '#000000',
816
+ logo: (apiStore.branding?.logo || apiStore.logo) ? convertToAbsoluteUrl(apiStore.branding?.logo || apiStore.logo || '') : undefined,
817
+ },
818
+ navigation: {
819
+ main: [],
820
+ footer: [],
821
+ },
822
+ features: {
823
+ cart: true,
824
+ wishlist: true,
825
+ reviews: true,
826
+ search: true,
827
+ filters: true,
828
+ booking: layout.startsWith('booking'),
829
+ delivery: true,
830
+ },
831
+ products: [],
832
+ categories: [],
833
+ settings: {
834
+ currency: apiStore.settings?.currency || 'USD',
835
+ taxRate: apiStore.settings?.taxRate, // Deprecated: kept for backward compatibility
836
+ vat: apiStore.settings?.vat,
837
+ serviceCharge: apiStore.settings?.serviceCharge,
838
+ collectionFeePayer: apiStore.settings?.collectionFeePayer,
839
+ },
840
+ contactInfo: (contactInfo.email || contactInfo.phone || contactInfo.address) ? contactInfo : undefined,
841
+ layoutConfig: transformedLayoutConfig, // Transform layoutConfig to match frontend structure
842
+ // Extract puckData from configuration if it exists
843
+ puckData: apiStore.configuration?.puck_configuration?.puckData || undefined,
844
+ };
845
+ }
846
+ function getTemplateLayoutDefaultsForType(layoutType) {
847
+ if (!layoutType)
848
+ return null;
849
+ const layoutConfig = getTemplateLayoutConfigForLayoutType(layoutType);
850
+ if (!layoutConfig)
851
+ return null;
852
+ return extractTemplateLayoutPayload(layoutConfig);
853
+ }
854
+ /**
855
+ * Transforms backend layoutContent structure to frontend layoutConfig structure
856
+ * Backend uses assignedAssets/assignedText, frontend expects sections structure
857
+ */
858
+ function transformLayoutConfig(layoutContent, options) {
859
+ const storeSlug = options?.storeSlug;
860
+ const storeLayout = options?.storeLayout;
861
+ // Real stores: published snapshot only (defaults materialized at publish). Demo stores use template JSON.
862
+ const useTemplateFallback = Boolean(storeSlug && !shouldUseAPI(storeSlug));
863
+ const templateDefaults = useTemplateFallback
864
+ ? getTemplateLayoutDefaultsForType(storeLayout)
865
+ : null;
866
+ if (!layoutContent || typeof layoutContent !== 'object') {
867
+ if (templateDefaults) {
868
+ layoutContent = templateDefaults;
869
+ }
870
+ else {
871
+ console.log('[transformLayoutConfig] No layoutContent provided or invalid');
872
+ return undefined;
873
+ }
874
+ }
875
+ const dbPayload = extractPublishedLayoutConfig(layoutContent);
876
+ const { layoutConfig: resolved } = resolveLayoutConfigWithTemplateDefaults(dbPayload, templateDefaults);
877
+ if (resolved && typeof resolved === 'object') {
878
+ layoutContent = resolved;
879
+ }
880
+ else {
881
+ const editorMeta = layoutContent._editor;
882
+ if (editorMeta?.compiledLegacyConfigJson && typeof editorMeta.compiledLegacyConfigJson === 'object') {
883
+ const compiled = editorMeta.compiledLegacyConfigJson;
884
+ layoutContent =
885
+ compiled.layoutConfig && typeof compiled.layoutConfig === 'object'
886
+ ? compiled.layoutConfig
887
+ : compiled.sections || compiled.pages || compiled.home
888
+ ? compiled
889
+ : layoutContent;
890
+ }
891
+ else if (layoutContent.layoutConfig &&
892
+ typeof layoutContent.layoutConfig === 'object' &&
893
+ !layoutContent.sections &&
894
+ !layoutContent.pages &&
895
+ !layoutContent.home) {
896
+ layoutContent = layoutContent.layoutConfig;
897
+ }
898
+ }
899
+ // If it already has the sections structure, return as-is but ensure assignedAssets/assignedText are preserved
900
+ if (layoutContent.sections || layoutContent.home || layoutContent.pages) {
901
+ console.log('[transformLayoutConfig] Sections structure found, returning as-is');
902
+ console.log('[transformLayoutConfig] Sections found:', {
903
+ hero: !!layoutContent.sections.hero,
904
+ heroSliders: layoutContent.sections?.hero?.sliders?.length || 0,
905
+ categories: !!layoutContent.sections.categories,
906
+ featuredProducts: !!layoutContent.sections.featuredProducts,
907
+ marketing: !!layoutContent.sections.marketing,
908
+ marketingEditorial: !!layoutContent.sections.marketing?.editorial,
909
+ marketingPromoBanner: !!layoutContent.sections.marketing?.promoBanner,
910
+ marketingNewsletter: !!layoutContent.sections.marketing?.newsletter,
911
+ hasAssignedAssets: !!layoutContent.assignedAssets,
912
+ hasAssignedText: !!layoutContent.assignedText,
913
+ });
914
+ // Return the entire structure as-is - all sections are already in the correct format
915
+ // Ensure assignedAssets and assignedText are preserved for backward compatibility
916
+ return {
917
+ ...layoutContent,
918
+ assignedAssets: layoutContent.assignedAssets || {},
919
+ assignedText: layoutContent.assignedText || {},
920
+ };
921
+ }
922
+ // Transform from assignedAssets/assignedText structure to sections structure
923
+ const assignedAssets = layoutContent.assignedAssets || {};
924
+ const assignedText = layoutContent.assignedText || {};
925
+ // Build sections structure
926
+ const sections = {};
927
+ // Marketing section - migrate from old format to structured format
928
+ if (layoutContent.sections?.marketing) {
929
+ // New structure already exists - preserve it exactly as-is from database
930
+ console.log('[transformLayoutConfig] Found sections.marketing, preserving structure');
931
+ console.log('[transformLayoutConfig] Marketing sections:', {
932
+ hasEditorial: !!layoutContent.sections.marketing.editorial,
933
+ hasPromoBanner: !!layoutContent.sections.marketing.promoBanner,
934
+ hasNewsletter: !!layoutContent.sections.marketing.newsletter,
935
+ });
936
+ sections.marketing = {
937
+ show: layoutContent.sections.marketing.show !== false,
938
+ showNewsletter: layoutContent.sections.marketing.showNewsletter !== false,
939
+ showPromoBanner: layoutContent.sections.marketing.showPromoBanner === true,
940
+ // Preserve all marketing subsections exactly as stored
941
+ editorial: layoutContent.sections.marketing.editorial,
942
+ promoBanner: layoutContent.sections.marketing.promoBanner,
943
+ newsletter: layoutContent.sections.marketing.newsletter,
944
+ shopTheLook: layoutContent.sections.marketing.shopTheLook,
945
+ chefRecommendations: layoutContent.sections.marketing.chefRecommendations,
946
+ };
947
+ }
948
+ else {
949
+ // Migrate from old format
950
+ const marketing = {
951
+ show: true,
952
+ showNewsletter: false,
953
+ showPromoBanner: false,
954
+ };
955
+ // Editorial section (lookbook)
956
+ if (assignedAssets.lookbook_main || assignedText['lookbook_main:section_header']) {
957
+ marketing.editorial = {
958
+ show: true,
959
+ label: assignedText['lookbook_main:section_header'] || 'EDITORIAL',
960
+ title: (assignedText['lookbook_main:main_caption'] && assignedText['lookbook_main:main_caption'].length < 50)
961
+ ? assignedText['lookbook_main:main_caption']
962
+ : 'Redefining Modern\nElegance',
963
+ description: assignedText['lookbook_main:main_caption']?.length >= 50
964
+ ? assignedText['lookbook_main:main_caption']
965
+ : assignedText['lookbook_detail:detail_caption'] || assignedText['lookbook_main:main_caption'] || 'Explore our latest editorial featuring timeless pieces crafted for the contemporary wardrobe. From essential basics to statement outwear, find your signature look.',
966
+ image: assignedAssets.lookbook_main,
967
+ detailImage: assignedAssets.lookbook_detail,
968
+ primaryButtonText: 'View Lookbook',
969
+ primaryButtonLink: '/style-guide',
970
+ secondaryButtonText: 'Read Our Story',
971
+ secondaryButtonLink: '/about',
972
+ };
973
+ }
974
+ // Promo banner
975
+ // Check for sale_banner (electronics-grid), promo_banner_image, seasonal_promo_banner, or promo_title text
976
+ const hasPromoBanner = assignedAssets.sale_banner ||
977
+ assignedAssets.promo_banner_image ||
978
+ assignedAssets.seasonal_promo_banner ||
979
+ assignedText['promo_banner_title'] ||
980
+ assignedText['promo_title'] ||
981
+ assignedText['sale_banner:banner_title'];
982
+ if (hasPromoBanner) {
983
+ // Get banner image - prioritize sale_banner for electronics-grid
984
+ const bannerImage = assignedAssets.sale_banner ||
985
+ assignedAssets.promo_banner_image ||
986
+ assignedAssets.seasonal_promo_banner;
987
+ // Get banner text - check sale_banner textElements first, then other sources
988
+ const bannerTitle = assignedText['sale_banner:banner_title'] ||
989
+ assignedText['promo_banner_title'] ||
990
+ assignedText['promo_title'] ||
991
+ assignedText['promo_headline'];
992
+ const bannerSubtitle = assignedText['sale_banner:banner_subtitle'] ||
993
+ assignedText['promo_banner_subtitle'] ||
994
+ assignedText['promo_subtext'] ||
995
+ assignedText['promo_subhead'];
996
+ const bannerButtonText = assignedText['sale_banner:cta_button'] ||
997
+ assignedText['promo_banner_button'] ||
998
+ assignedText['promo_cta'] ||
999
+ assignedText['cta_text'];
1000
+ const bannerButtonLink = assignedText['promo_banner_link'] ||
1001
+ assignedText['sale_banner:button_link'] ||
1002
+ '/products';
1003
+ marketing.showPromoBanner = false; // Disable by default
1004
+ marketing.promoBanner = {
1005
+ show: false, // Disable by default
1006
+ image: bannerImage,
1007
+ title: bannerTitle,
1008
+ subtitle: bannerSubtitle,
1009
+ buttonText: bannerButtonText,
1010
+ buttonLink: bannerButtonLink,
1011
+ };
1012
+ }
1013
+ // Newsletter
1014
+ if (assignedText['newsletter_title'] || assignedText['footer_newsletter_title']) {
1015
+ marketing.showNewsletter = true;
1016
+ marketing.newsletter = {
1017
+ show: true,
1018
+ title: assignedText['newsletter_title'] || assignedText['footer_newsletter_title'],
1019
+ subtitle: assignedText['newsletter_subtitle'] || assignedText['footer_newsletter_subtitle'],
1020
+ button: assignedText['newsletter_button'] || assignedText['footer_newsletter_button'],
1021
+ placeholder: assignedText['newsletter_placeholder'],
1022
+ disclaimer: assignedText['newsletter_disclaimer'],
1023
+ };
1024
+ }
1025
+ // Shop the look (clothing-minimal)
1026
+ if (assignedAssets.shop_the_look_image || assignedText['shop_the_look:section_title']) {
1027
+ marketing.shopTheLook = {
1028
+ show: true,
1029
+ image: assignedAssets.shop_the_look_image,
1030
+ title: assignedText['shop_the_look:section_title'] || assignedText['section_title'],
1031
+ description: assignedText['shop_the_look:look_desc'] || assignedText['look_desc'],
1032
+ products: [], // Will be populated from product data
1033
+ };
1034
+ }
1035
+ // Chef recommendations (food layout)
1036
+ if (assignedText['chef_recommendations_title'] || assignedAssets.chef_image) {
1037
+ marketing.chefRecommendations = {
1038
+ show: true,
1039
+ title: assignedText['chef_recommendations_title'] || 'Chef\'s Recommendations',
1040
+ description: assignedText['chef_recommendations_description'],
1041
+ items: [], // Will be populated from menu item data
1042
+ };
1043
+ }
1044
+ if (Object.keys(marketing).length > 3) { // More than just show, showNewsletter, showPromoBanner
1045
+ sections.marketing = marketing;
1046
+ }
1047
+ }
1048
+ // Hero section - migrate old format to new slider structure
1049
+ if (layoutContent.sections?.hero?.sliders && Array.isArray(layoutContent.sections.hero.sliders)) {
1050
+ // New structure already exists - preserve it exactly as-is from database
1051
+ // This ensures the slider structure with images, text, and buttons is not modified
1052
+ console.log('[transformLayoutConfig] Found sections.hero.sliders, preserving structure');
1053
+ console.log('[transformLayoutConfig] Sliders count:', layoutContent.sections.hero.sliders.length);
1054
+ // Log each slider for debugging
1055
+ layoutContent.sections.hero.sliders.forEach((slider, index) => {
1056
+ console.log(`[transformLayoutConfig] Slider ${index + 1}:`, {
1057
+ id: slider.id,
1058
+ hasImage: !!slider.image,
1059
+ imageUrl: slider.image ? (slider.image.substring(0, 50) + '...') : 'missing',
1060
+ hasTitle: !!slider.title,
1061
+ title: slider.title || 'missing',
1062
+ primaryButtonText: slider.primaryButton?.text || 'empty',
1063
+ secondaryButtonText: slider.secondaryButton?.text || 'empty',
1064
+ });
1065
+ });
1066
+ sections.hero = {
1067
+ ...layoutContent.sections.hero,
1068
+ show: layoutContent.sections.hero.show !== false,
1069
+ showCTA: layoutContent.sections.hero.showCTA !== false,
1070
+ showSecondaryCTA: layoutContent.sections.hero.showSecondaryCTA !== false,
1071
+ autoPlay: layoutContent.sections.hero.autoPlay !== false,
1072
+ showBadges: layoutContent.sections.hero.showBadges === true,
1073
+ // Preserve sliders array exactly as stored - don't transform or modify
1074
+ sliders: layoutContent.sections.hero.sliders,
1075
+ };
1076
+ }
1077
+ else if (assignedAssets.hero_slide_1 || assignedAssets.hero_slide_2 || assignedAssets.hero_slide_3) {
1078
+ // Old format detected - migrate to new structure
1079
+ const sliders = [];
1080
+ // Build sliders array from old format (support up to 10 slides for future growth)
1081
+ for (let i = 1; i <= 10; i++) {
1082
+ const slideKey = `hero_slide_${i}`;
1083
+ const imageUrl = assignedAssets[slideKey];
1084
+ if (imageUrl) {
1085
+ // Determine store slug for default links (use passed parameter or fallback)
1086
+ const defaultProductsLink = storeSlug ? `/${storeSlug}/products` : '/products';
1087
+ const defaultCategoriesLink = storeSlug ? `/${storeSlug}/categories` : '/categories';
1088
+ const slider = {
1089
+ id: slideKey,
1090
+ image: imageUrl,
1091
+ order: i,
1092
+ };
1093
+ // Map old text keys to new structure
1094
+ // Support multiple key variations for backward compatibility
1095
+ const badgeKey = `${slideKey}:badge`;
1096
+ const headingKey = `${slideKey}:heading`;
1097
+ const titleKey = `${slideKey}:title`;
1098
+ const subheadingKey = `${slideKey}:subheading`;
1099
+ const descriptionKey = `${slideKey}:description`;
1100
+ const btnLabelKey = `${slideKey}:btn_label`;
1101
+ const primaryButtonKey = `${slideKey}:primaryButton`;
1102
+ const secondaryBtnKey = `${slideKey}:secondary_btn`;
1103
+ const secondaryButtonKey = `${slideKey}:secondaryButton`;
1104
+ const highlightKey = `${slideKey}:highlight`; // Food layout specific
1105
+ if (assignedText[badgeKey]) {
1106
+ slider.badge = assignedText[badgeKey];
1107
+ }
1108
+ slider.title = assignedText[headingKey] || assignedText[titleKey] || '';
1109
+ if (assignedText[subheadingKey] || assignedText[descriptionKey]) {
1110
+ slider.description = assignedText[subheadingKey] || assignedText[descriptionKey];
1111
+ }
1112
+ // Food layout specific: highlight field
1113
+ if (assignedText[highlightKey]) {
1114
+ slider.highlight = assignedText[highlightKey];
1115
+ }
1116
+ // Primary button - handle both string and object formats
1117
+ const primaryButtonText = assignedText[btnLabelKey] || assignedText[primaryButtonKey];
1118
+ if (primaryButtonText) {
1119
+ // Check if it's already an object (from new format migration)
1120
+ if (typeof primaryButtonText === 'object' && primaryButtonText !== null) {
1121
+ slider.primaryButton = primaryButtonText;
1122
+ }
1123
+ else {
1124
+ slider.primaryButton = {
1125
+ text: String(primaryButtonText),
1126
+ link: defaultProductsLink,
1127
+ };
1128
+ }
1129
+ }
1130
+ // Secondary button - handle both string and object formats
1131
+ const secondaryButtonText = assignedText[secondaryBtnKey] || assignedText[secondaryButtonKey];
1132
+ if (secondaryButtonText) {
1133
+ // Check if it's already an object (from new format migration)
1134
+ if (typeof secondaryButtonText === 'object' && secondaryButtonText !== null) {
1135
+ slider.secondaryButton = secondaryButtonText;
1136
+ }
1137
+ else {
1138
+ slider.secondaryButton = {
1139
+ text: String(secondaryButtonText),
1140
+ link: defaultCategoriesLink,
1141
+ };
1142
+ }
1143
+ }
1144
+ sliders.push(slider);
1145
+ }
1146
+ }
1147
+ // Only create hero section if we have at least one slider
1148
+ if (sliders.length > 0) {
1149
+ sections.hero = {
1150
+ show: true,
1151
+ showCTA: true,
1152
+ showSecondaryCTA: true,
1153
+ autoPlay: true,
1154
+ showBadges: false,
1155
+ sliders: sliders,
1156
+ };
1157
+ }
1158
+ }
1159
+ else if (assignedAssets.hero_bg || assignedAssets.hero_image || assignedAssets.hero_split_image || assignedAssets.hero_video) {
1160
+ // Single image/video hero (non-slider layouts)
1161
+ sections.hero = {
1162
+ show: true,
1163
+ showCTA: true,
1164
+ showSecondaryCTA: true,
1165
+ autoPlay: false,
1166
+ showBadges: false,
1167
+ };
1168
+ }
1169
+ // Categories section - migrate from old format to structured format
1170
+ if (layoutContent.sections?.categories) {
1171
+ // New structure already exists - use it
1172
+ sections.categories = {
1173
+ show: layoutContent.sections.categories.show !== false,
1174
+ showViewAll: layoutContent.sections.categories.showViewAll !== false,
1175
+ limit: layoutContent.sections.categories.limit || 4,
1176
+ title: layoutContent.sections.categories.title,
1177
+ subtitle: layoutContent.sections.categories.subtitle,
1178
+ viewAll: layoutContent.sections.categories.viewAll,
1179
+ };
1180
+ }
1181
+ else {
1182
+ // Migrate from old format
1183
+ sections.categories = {
1184
+ show: true,
1185
+ showViewAll: true,
1186
+ limit: 4,
1187
+ title: assignedText['categories_title'] || assignedText['sections.categories.title'],
1188
+ subtitle: assignedText['categories_subtitle'] || assignedText['sections.categories.subtitle'],
1189
+ viewAll: assignedText['categories_view_all'] || assignedText['sections.categories.viewAll'] || 'View All Categories',
1190
+ };
1191
+ }
1192
+ // Featured products section - migrate from old format to structured format
1193
+ if (layoutContent.sections?.featuredProducts) {
1194
+ // New structure already exists - use it
1195
+ sections.featuredProducts = {
1196
+ show: layoutContent.sections.featuredProducts.show !== false,
1197
+ title: layoutContent.sections.featuredProducts.title,
1198
+ subtitle: layoutContent.sections.featuredProducts.subtitle,
1199
+ showViewAll: layoutContent.sections.featuredProducts.showViewAll !== false,
1200
+ viewAll: layoutContent.sections.featuredProducts.viewAll,
1201
+ showAddToCart: layoutContent.sections.featuredProducts.showAddToCart !== false,
1202
+ showWishlist: layoutContent.sections.featuredProducts.showWishlist !== false,
1203
+ showRatings: layoutContent.sections.featuredProducts.showRatings !== false,
1204
+ emptyState: layoutContent.sections.featuredProducts.emptyState,
1205
+ };
1206
+ }
1207
+ else {
1208
+ // Migrate from old format
1209
+ sections.featuredProducts = {
1210
+ show: true,
1211
+ title: assignedText['featured_products_title'] || assignedText['trending_title'] || assignedText['sections.featuredProducts.title'] || 'Trending Now',
1212
+ subtitle: assignedText['featured_products_subtitle'] || assignedText['sections.featuredProducts.subtitle'],
1213
+ showViewAll: true,
1214
+ viewAll: assignedText['featured_products_view_all'] || assignedText['sections.featuredProducts.viewAll'] || 'View All Products',
1215
+ showAddToCart: true,
1216
+ showWishlist: true,
1217
+ showRatings: true,
1218
+ emptyState: assignedText['featured_products_empty'] || assignedText['sections.featuredProducts.emptyState'],
1219
+ };
1220
+ }
1221
+ // Testimonials section - migrate from old format to structured format
1222
+ if (layoutContent.sections?.testimonials) {
1223
+ const testimonialsData = layoutContent.sections.testimonials;
1224
+ const rawItems = testimonialsData.items && Array.isArray(testimonialsData.items)
1225
+ ? testimonialsData.items.map((item) => ({
1226
+ id: item.id || generateId(),
1227
+ name: item.name || '',
1228
+ role: item.role || '',
1229
+ image: item.image || '',
1230
+ quote: item.quote || item.comment || '',
1231
+ rating: typeof item.rating === 'number' ? item.rating : 5,
1232
+ order: typeof item.order === 'number' ? item.order : 0,
1233
+ location: item.location,
1234
+ date: item.date,
1235
+ }))
1236
+ : testimonialsData.quote
1237
+ ? [
1238
+ {
1239
+ id: generateId(),
1240
+ name: testimonialsData.author || 'Customer',
1241
+ role: testimonialsData.role || 'Customer',
1242
+ image: '',
1243
+ quote: testimonialsData.quote,
1244
+ rating: 5,
1245
+ order: 0,
1246
+ },
1247
+ ]
1248
+ : [];
1249
+ sections.testimonials = {
1250
+ show: testimonialsData.show !== false,
1251
+ title: testimonialsData.title,
1252
+ subtitle: testimonialsData.subtitle,
1253
+ showRatings: testimonialsData.showRatings !== false,
1254
+ limit: clampBookingTestimonialLimit(testimonialsData.limit),
1255
+ items: normalizeBookingTestimonialItems(rawItems),
1256
+ // Keep backward compatibility with old single quote format
1257
+ quote: testimonialsData.quote,
1258
+ author: testimonialsData.author,
1259
+ role: testimonialsData.role,
1260
+ };
1261
+ }
1262
+ else if (assignedText['testimonial_quote'] || assignedText['testimonials_title']) {
1263
+ sections.testimonials = {
1264
+ show: true,
1265
+ title: assignedText['testimonials_title'] || assignedText['sections.testimonials.title'],
1266
+ subtitle: assignedText['testimonials_subtitle'] || assignedText['sections.testimonials.subtitle'],
1267
+ items: assignedText['testimonial_quote'] ? [{
1268
+ id: generateId(),
1269
+ name: assignedText['testimonial_author'] || 'Customer',
1270
+ role: assignedText['testimonial_role'] || 'Customer',
1271
+ image: '',
1272
+ quote: assignedText['testimonial_quote'],
1273
+ rating: 5,
1274
+ order: 0,
1275
+ }] : [],
1276
+ // Keep backward compatibility
1277
+ quote: assignedText['testimonial_quote'],
1278
+ author: assignedText['testimonial_author'],
1279
+ role: assignedText['testimonial_role'],
1280
+ };
1281
+ }
1282
+ // Story section - new structured format
1283
+ if (layoutContent.sections?.story) {
1284
+ sections.story = {
1285
+ show: layoutContent.sections.story.show !== false,
1286
+ label: layoutContent.sections.story.label,
1287
+ title: layoutContent.sections.story.title || '',
1288
+ description: layoutContent.sections.story.description || '',
1289
+ image: layoutContent.sections.story.image,
1290
+ signature: layoutContent.sections.story.signature,
1291
+ };
1292
+ }
1293
+ // PromoBanner section - new structured format (directly in sections, not just in marketing)
1294
+ if (layoutContent.sections?.promoBanner) {
1295
+ sections.promoBanner = {
1296
+ show: layoutContent.sections.promoBanner.show === true,
1297
+ image: layoutContent.sections.promoBanner.image,
1298
+ title: layoutContent.sections.promoBanner.title || '',
1299
+ subtitle: layoutContent.sections.promoBanner.subtitle,
1300
+ buttonText: layoutContent.sections.promoBanner.buttonText,
1301
+ buttonLink: layoutContent.sections.promoBanner.buttonLink,
1302
+ };
1303
+ }
1304
+ // Team section - migrate from old format to structured format
1305
+ if (layoutContent.sections?.team) {
1306
+ sections.team = {
1307
+ show: layoutContent.sections.team.show !== false,
1308
+ title: layoutContent.sections.team.title,
1309
+ description: layoutContent.sections.team.description,
1310
+ showViewAll: layoutContent.sections.team.showViewAll !== false,
1311
+ viewAll: layoutContent.sections.team.viewAll,
1312
+ items: layoutContent.sections.team.items && Array.isArray(layoutContent.sections.team.items)
1313
+ ? layoutContent.sections.team.items.map((item) => ({
1314
+ id: item.id || generateId(),
1315
+ name: item.name || 'Team Member',
1316
+ role: item.role || 'Specialist',
1317
+ image: item.image || item.photo || '',
1318
+ rating: item.rating,
1319
+ reviews: item.reviews,
1320
+ }))
1321
+ : [],
1322
+ };
1323
+ }
1324
+ else if (assignedText['team_section_title'] || assignedText['team_title']) {
1325
+ sections.team = {
1326
+ show: true,
1327
+ title: assignedText['team_section_title'] || assignedText['team_title'] || assignedText['sections.team.title'],
1328
+ description: assignedText['team_section_subtitle'] || assignedText['team_description'] || assignedText['team_desc'] || assignedText['sections.team.description'],
1329
+ showViewAll: true,
1330
+ viewAll: assignedText['team_view_all'] || assignedText['sections.team.viewAll'] || 'View All Team',
1331
+ items: [],
1332
+ };
1333
+ }
1334
+ // Services section - migrate from old format to structured format (for booking layouts)
1335
+ if (layoutContent.sections?.services) {
1336
+ sections.services = {
1337
+ show: layoutContent.sections.services.show !== false,
1338
+ title: layoutContent.sections.services.title,
1339
+ subtitle: layoutContent.sections.services.subtitle,
1340
+ showViewAll: layoutContent.sections.services.showViewAll !== false,
1341
+ viewAll: layoutContent.sections.services.viewAll,
1342
+ limit: layoutContent.sections.services.limit,
1343
+ };
1344
+ }
1345
+ else if (assignedText['services_section_title'] || assignedText['services_title']) {
1346
+ sections.services = {
1347
+ show: true,
1348
+ title: assignedText['services_section_title'] || assignedText['services_title'] || assignedText['sections.services.title'],
1349
+ subtitle: assignedText['services_section_subtitle'] || assignedText['services_subtitle'] || assignedText['sections.services.subtitle'],
1350
+ showViewAll: true,
1351
+ viewAll: assignedText['services_view_all'] || assignedText['sections.services.viewAll'] || 'View All Services',
1352
+ limit: 5,
1353
+ };
1354
+ }
1355
+ // Process section - migrate from old format to structured format (for booking layouts)
1356
+ if (layoutContent.sections?.process) {
1357
+ sections.process = {
1358
+ show: layoutContent.sections.process.show !== false,
1359
+ title: layoutContent.sections.process.title,
1360
+ subtitle: layoutContent.sections.process.subtitle,
1361
+ steps: layoutContent.sections.process.steps,
1362
+ };
1363
+ }
1364
+ else if (assignedText['process_title'] || assignedText['how_it_works_title']) {
1365
+ sections.process = {
1366
+ show: true,
1367
+ title: assignedText['process_title'] || assignedText['how_it_works_title'] || assignedText['sections.process.title'] || 'How it Works',
1368
+ subtitle: assignedText['process_subtitle'] || assignedText['how_it_works_subtitle'] || assignedText['sections.process.subtitle'],
1369
+ steps: [], // Will be populated from layout-specific process steps if available
1370
+ };
1371
+ }
1372
+ // Transform assignedText to structured text config
1373
+ const textConfig = {
1374
+ hero: {
1375
+ badge: assignedText['hero_badge'],
1376
+ title: assignedText['hero_title'],
1377
+ subtitle: assignedText['hero_subtitle'],
1378
+ primaryButton: assignedText['hero_primary_button'] || assignedText['hero_btn_label'] || assignedText['book_btn'],
1379
+ secondaryButton: assignedText['hero_secondary_button'] || assignedText['view_services_btn'],
1380
+ // Support multi-slide heroes
1381
+ slides: assignedText['hero_slide_1:heading'] ? [
1382
+ {
1383
+ badge: assignedText['hero_slide_1:badge'] || assignedText['hero_badge'],
1384
+ title: assignedText['hero_slide_1:heading'] || assignedText['hero_title'],
1385
+ description: assignedText['hero_slide_1:subheading'] || assignedText['hero_subtitle'],
1386
+ primaryButton: assignedText['hero_slide_1:btn_label'] || assignedText['hero_primary_button'],
1387
+ secondaryButton: assignedText['hero_slide_1:secondary_btn'] || assignedText['hero_secondary_button'],
1388
+ },
1389
+ assignedText['hero_slide_2:heading'] ? {
1390
+ badge: assignedText['hero_slide_2:badge'],
1391
+ title: assignedText['hero_slide_2:heading'],
1392
+ description: assignedText['hero_slide_2:subheading'],
1393
+ primaryButton: assignedText['hero_slide_2:btn_label'],
1394
+ secondaryButton: assignedText['hero_slide_2:secondary_btn'],
1395
+ } : undefined,
1396
+ assignedText['hero_slide_3:heading'] ? {
1397
+ badge: assignedText['hero_slide_3:badge'],
1398
+ title: assignedText['hero_slide_3:heading'],
1399
+ description: assignedText['hero_slide_3:subheading'],
1400
+ primaryButton: assignedText['hero_slide_3:btn_label'],
1401
+ secondaryButton: assignedText['hero_slide_3:secondary_btn'],
1402
+ } : undefined,
1403
+ ].filter(Boolean) : undefined,
1404
+ },
1405
+ sections: {
1406
+ categories: {
1407
+ title: assignedText['categories_title'],
1408
+ subtitle: assignedText['categories_subtitle'],
1409
+ viewAll: assignedText['categories_view_all'],
1410
+ },
1411
+ services: {
1412
+ title: assignedText['services_section_title'],
1413
+ subtitle: assignedText['services_section_subtitle'],
1414
+ listTitle: assignedText['services_list_title'],
1415
+ listCount: assignedText['services_list_count'],
1416
+ },
1417
+ testimonials: {
1418
+ quote: assignedText['testimonial_quote'],
1419
+ author: assignedText['testimonial_author'],
1420
+ role: assignedText['testimonial_role'],
1421
+ title: assignedText['testimonials_title'],
1422
+ subtitle: assignedText['testimonials_subtitle'],
1423
+ },
1424
+ cta: {
1425
+ title: assignedText['cta_title'],
1426
+ description: assignedText['cta_description'],
1427
+ },
1428
+ promo: {
1429
+ badge: assignedText['promo_badge'],
1430
+ title: assignedText['promo_title'],
1431
+ description: assignedText['promo_desc'],
1432
+ },
1433
+ experts: {
1434
+ title: assignedText['experts_section_title'],
1435
+ viewAll: assignedText['experts_view_all'],
1436
+ },
1437
+ featuredProducts: {
1438
+ title: assignedText['featured_products_title'] || assignedText['trending_title'] || assignedText['hero_slide_2:heading'],
1439
+ subtitle: assignedText['featured_products_subtitle'],
1440
+ viewAll: assignedText['featured_products_view_all'],
1441
+ emptyState: assignedText['featured_products_empty'],
1442
+ },
1443
+ marketing: {
1444
+ newsletter: {
1445
+ title: assignedText['newsletter_title'] || assignedText['footer_newsletter_title'],
1446
+ subtitle: assignedText['newsletter_subtitle'] || assignedText['footer_newsletter_subtitle'],
1447
+ button: assignedText['newsletter_button'] || assignedText['footer_newsletter_button'],
1448
+ placeholder: assignedText['newsletter_placeholder'],
1449
+ disclaimer: assignedText['newsletter_disclaimer'],
1450
+ },
1451
+ promoBanner: {
1452
+ title: assignedText['promo_banner_title'] || assignedText['promo_title'],
1453
+ subtitle: assignedText['promo_banner_subtitle'] || assignedText['promo_subtext'],
1454
+ button: assignedText['promo_banner_button'] || assignedText['promo_cta'],
1455
+ },
1456
+ },
1457
+ team: {
1458
+ title: assignedText['team_section_title'] || assignedText['team_title'],
1459
+ subtitle: assignedText['team_section_subtitle'] || assignedText['team_description'] || assignedText['team_desc'],
1460
+ viewAll: assignedText['team_view_all'],
1461
+ },
1462
+ process: {
1463
+ title: assignedText['process_title'],
1464
+ subtitle: assignedText['process_subtitle'],
1465
+ },
1466
+ },
1467
+ common: {
1468
+ shopNow: assignedText['common_shop_now'],
1469
+ viewAll: assignedText['common_view_all'],
1470
+ addToCart: assignedText['common_add_to_cart'],
1471
+ buyNow: assignedText['common_buy_now'],
1472
+ learnMore: assignedText['common_learn_more'],
1473
+ readMore: assignedText['common_read_more'],
1474
+ seeMore: assignedText['common_see_more'],
1475
+ discover: assignedText['common_discover'],
1476
+ explore: assignedText['common_explore'],
1477
+ new: assignedText['common_new'],
1478
+ trending: assignedText['common_trending'],
1479
+ limited: assignedText['common_limited'],
1480
+ sale: assignedText['common_sale'],
1481
+ outOfStock: assignedText['common_out_of_stock'],
1482
+ inStock: assignedText['common_in_stock'],
1483
+ selectSize: assignedText['common_select_size'],
1484
+ selectColor: assignedText['common_select_color'],
1485
+ quantity: assignedText['common_quantity'],
1486
+ reviews: assignedText['common_reviews'],
1487
+ writeReview: assignedText['common_write_review'],
1488
+ customerReviews: assignedText['common_customer_reviews'],
1489
+ noReviews: assignedText['common_no_reviews'],
1490
+ search: assignedText['common_search'],
1491
+ searchPlaceholder: assignedText['common_search_placeholder'],
1492
+ cart: assignedText['common_cart'],
1493
+ wishlist: assignedText['common_wishlist'],
1494
+ account: assignedText['common_account'],
1495
+ login: assignedText['common_login'],
1496
+ logout: assignedText['common_logout'],
1497
+ signup: assignedText['common_signup'],
1498
+ checkout: assignedText['common_checkout'],
1499
+ continueShopping: assignedText['common_continue_shopping'],
1500
+ proceedToCheckout: assignedText['common_proceed_to_checkout'],
1501
+ },
1502
+ footer: {
1503
+ newsletter: {
1504
+ title: assignedText['footer_newsletter_title'],
1505
+ subtitle: assignedText['footer_newsletter_subtitle'],
1506
+ button: assignedText['footer_newsletter_button'],
1507
+ placeholder: assignedText['footer_newsletter_placeholder'],
1508
+ disclaimer: assignedText['footer_newsletter_disclaimer'],
1509
+ },
1510
+ copyright: assignedText['footer_copyright'],
1511
+ links: {
1512
+ about: assignedText['footer_link_about'],
1513
+ contact: assignedText['footer_link_contact'],
1514
+ privacy: assignedText['footer_link_privacy'],
1515
+ terms: assignedText['footer_link_terms'],
1516
+ shipping: assignedText['footer_link_shipping'],
1517
+ faq: assignedText['footer_link_faq'],
1518
+ },
1519
+ },
1520
+ header: {
1521
+ searchPlaceholder: assignedText['header_search_placeholder'],
1522
+ cartEmpty: assignedText['header_cart_empty'],
1523
+ wishlistEmpty: assignedText['header_wishlist_empty'],
1524
+ accountMenu: {
1525
+ profile: assignedText['header_account_profile'],
1526
+ orders: assignedText['header_account_orders'],
1527
+ wishlist: assignedText['header_account_wishlist'],
1528
+ logout: assignedText['header_account_logout'],
1529
+ },
1530
+ },
1531
+ booking: {
1532
+ pageTitle: assignedText['booking_page_title'],
1533
+ pageSubtitle: assignedText['booking_page_subtitle'],
1534
+ bookAppointment: assignedText['booking_book_appointment'] || assignedText['book_btn'],
1535
+ viewServices: assignedText['booking_view_services'] || assignedText['view_services_btn'],
1536
+ selectDate: assignedText['booking_select_date'],
1537
+ selectService: assignedText['booking_select_service'],
1538
+ selectTime: assignedText['booking_select_time'],
1539
+ confirmBooking: assignedText['booking_confirm'],
1540
+ completePayment: assignedText['booking_complete_payment'],
1541
+ bookingConfirmed: assignedText['booking_confirmed'],
1542
+ limitedAvailability: assignedText['booking_limited_availability'],
1543
+ availableServices: assignedText['booking_available_services'] || assignedText['services_list_title'],
1544
+ showingResults: assignedText['booking_showing_results'] || assignedText['services_list_count'],
1545
+ filters: assignedText['booking_filters'],
1546
+ providers: assignedText['booking_providers'],
1547
+ },
1548
+ food: {
1549
+ reserveTable: assignedText['food_reserveTable'] || assignedText['food_reserve_table'],
1550
+ viewMenu: assignedText['food_viewMenu'] || assignedText['food_view_menu'],
1551
+ chefRecommendations: assignedText['food_chefRecommendations'] || assignedText['food_chef_recommendations'],
1552
+ ourPhilosophy: assignedText['food_ourPhilosophy'] || assignedText['food_our_philosophy'],
1553
+ meetChef: assignedText['food_meetChef'] || assignedText['food_meet_chef'],
1554
+ menuCategories: assignedText['food_menuCategories'] || assignedText['food_menu_categories'],
1555
+ },
1556
+ electronics: {
1557
+ newArrivals: assignedText['electronics_new_arrivals'],
1558
+ techSpecs: assignedText['electronics_tech_specs'],
1559
+ compare: assignedText['electronics_compare'],
1560
+ addToCompare: assignedText['electronics_add_to_compare'],
1561
+ removeFromCompare: assignedText['electronics_remove_from_compare'],
1562
+ brands: assignedText['electronics_brands'],
1563
+ },
1564
+ };
1565
+ // Remove undefined values to keep the config clean
1566
+ const cleanConfig = (obj) => {
1567
+ if (obj === null || typeof obj !== 'object')
1568
+ return obj;
1569
+ if (Array.isArray(obj))
1570
+ return obj.map(cleanConfig).filter(v => v !== undefined);
1571
+ const newObj = {};
1572
+ Object.entries(obj).forEach(([key, value]) => {
1573
+ const cleaned = cleanConfig(value);
1574
+ if (cleaned !== undefined && !(typeof cleaned === 'object' && cleaned !== null && Object.keys(cleaned).length === 0)) {
1575
+ newObj[key] = cleaned;
1576
+ }
1577
+ });
1578
+ return Object.keys(newObj).length > 0 ? newObj : undefined;
1579
+ };
1580
+ const cleanTextConfig = cleanConfig(textConfig);
1581
+ // Transform theme colors if provided
1582
+ let themeColors;
1583
+ if (layoutContent.themeColors && typeof layoutContent.themeColors === 'object') {
1584
+ themeColors = {
1585
+ background: layoutContent.themeColors.background || undefined,
1586
+ text: layoutContent.themeColors.text || undefined,
1587
+ border: layoutContent.themeColors.border || undefined,
1588
+ gradient: layoutContent.themeColors.gradient || undefined,
1589
+ accent: layoutContent.themeColors.accent || undefined,
1590
+ layoutSpecific: layoutContent.themeColors.layoutSpecific || undefined,
1591
+ };
1592
+ // Remove undefined categories
1593
+ if (Object.values(themeColors).every(v => v === undefined)) {
1594
+ themeColors = undefined;
1595
+ }
1596
+ }
1597
+ // Also set hero at top level for backward compatibility (if sections.hero exists)
1598
+ const hero = sections?.hero ? {
1599
+ show: sections.hero.show !== false,
1600
+ showCTA: sections.hero.showCTA !== false,
1601
+ showSecondaryCTA: sections.hero.showSecondaryCTA !== false,
1602
+ autoPlay: sections.hero.autoPlay !== false,
1603
+ showBadges: sections.hero.showBadges === true,
1604
+ sliders: sections.hero.sliders,
1605
+ } : undefined;
1606
+ return {
1607
+ hero, // Top-level hero for backward compatibility
1608
+ sections,
1609
+ assignedAssets,
1610
+ assignedText, // Preserve assignedText for direct access via getTextContent()
1611
+ assetRequirements: layoutContent.assetRequirements,
1612
+ text: Object.keys(cleanTextConfig).length > 0 ? cleanTextConfig : undefined,
1613
+ themeColors,
1614
+ version: layoutContent.version, // Preserve version for layout version checking
1615
+ };
1616
+ }
1617
+ /**
1618
+ * Async function to get store configuration
1619
+ * - For demo stores: uses mock data from mock-stores
1620
+ * - For real stores: fetches from API and transforms to StoreConfig
1621
+ * - Returns null storeConfig if store not found (for 404 handling)
1622
+ * - Returns maintenanceMode flag when store exists but is not published/active
1623
+ */
1624
+ export async function getStoreConfigAsync(storeSlug) {
1625
+ try {
1626
+ console.log(`[StoreConfig] Loading store config for slug: ${storeSlug}`);
1627
+ if (shouldUseAPI(storeSlug)) {
1628
+ // Use API for non-demo stores
1629
+ const baseSlug = getBaseStoreSlug(storeSlug);
1630
+ const { store: apiStore, maintenanceMode } = await storeService.getStoreBySlug(baseSlug);
1631
+ console.log(`[StoreConfig] Store loaded from API: ${apiStore.name} (ID: ${apiStore.id})`);
1632
+ const storeConfig = transformStoreResponseToConfig(apiStore);
1633
+ // Fetch categories, products, and services in parallel
1634
+ const [categoriesResult, productsResult, servicesResult] = await Promise.allSettled([
1635
+ // Fetch categories (backend Category entity doesn't have isActive field, so include all)
1636
+ categoryService.getCategories(apiStore.id).then((apiCategories) => apiCategories.map(transformCategoryToStoreCategory)),
1637
+ // Fetch products (backend already filters for isActive: true)
1638
+ productService
1639
+ .getProducts({
1640
+ storeId: apiStore.id,
1641
+ limit: 1000, // Fetch a large number to get all products for the store config
1642
+ })
1643
+ .then((response) => response.data.map((product) => transformProductToStoreProduct(product))),
1644
+ // Fetch services (backend already filters for isActive: true)
1645
+ serviceService
1646
+ .getServices(apiStore.id)
1647
+ .then((apiServices) => apiServices.map(transformServiceToStoreService)),
1648
+ ]);
1649
+ // Extract results with graceful degradation
1650
+ const categories = categoriesResult.status === 'fulfilled' ? categoriesResult.value : [];
1651
+ const products = productsResult.status === 'fulfilled' ? productsResult.value : [];
1652
+ const services = servicesResult.status === 'fulfilled' ? servicesResult.value : [];
1653
+ // Log errors if any occurred
1654
+ if (categoriesResult.status === 'rejected') {
1655
+ console.error('[StoreConfig] Failed to fetch categories:', categoriesResult.reason);
1656
+ console.error('[StoreConfig] Category error details:', {
1657
+ message: categoriesResult.reason?.message,
1658
+ status: categoriesResult.reason?.status,
1659
+ response: categoriesResult.reason?.response?.data,
1660
+ });
1661
+ }
1662
+ else {
1663
+ console.log(`[StoreConfig] Successfully fetched ${categories.length} categories for store ${apiStore.id} (${apiStore.slug})`);
1664
+ if (categories.length === 0) {
1665
+ console.warn(`[StoreConfig] WARNING: No categories found for store ${apiStore.id}. This may indicate missing data in the database.`);
1666
+ }
1667
+ }
1668
+ if (productsResult.status === 'rejected') {
1669
+ console.error('[StoreConfig] Failed to fetch products:', productsResult.reason);
1670
+ console.error('[StoreConfig] Product error details:', {
1671
+ message: productsResult.reason?.message,
1672
+ status: productsResult.reason?.status,
1673
+ response: productsResult.reason?.response?.data,
1674
+ });
1675
+ }
1676
+ else {
1677
+ console.log(`[StoreConfig] Successfully fetched ${products.length} products for store ${apiStore.id} (${apiStore.slug})`);
1678
+ if (products.length === 0) {
1679
+ console.warn(`[StoreConfig] WARNING: No products found for store ${apiStore.id}. This may indicate missing data in the database.`);
1680
+ }
1681
+ }
1682
+ if (servicesResult.status === 'rejected') {
1683
+ console.error('[StoreConfig] Failed to fetch services:', servicesResult.reason);
1684
+ console.error('[StoreConfig] Service error details:', {
1685
+ message: servicesResult.reason?.message,
1686
+ status: servicesResult.reason?.status,
1687
+ response: servicesResult.reason?.response?.data,
1688
+ });
1689
+ }
1690
+ else {
1691
+ console.log(`[StoreConfig] Successfully fetched ${services.length} services for store ${apiStore.id} (${apiStore.slug})`);
1692
+ if (services.length === 0) {
1693
+ console.warn(`[StoreConfig] WARNING: No services found for store ${apiStore.id}. This may indicate missing data in the database.`);
1694
+ }
1695
+ }
1696
+ // Populate categories, products, and services in storeConfig
1697
+ storeConfig.categories = categories;
1698
+ storeConfig.products = products;
1699
+ storeConfig.services = services;
1700
+ console.log(`[StoreConfig] Final storeConfig populated with ${categories.length} categories, ${products.length} products, and ${services.length} services`);
1701
+ return {
1702
+ storeConfig,
1703
+ maintenanceMode: maintenanceMode || false,
1704
+ };
1705
+ }
1706
+ else {
1707
+ // Use mock data for demo stores (always active and published)
1708
+ const baseSlug = getBaseStoreSlug(storeSlug);
1709
+ console.log(`[StoreConfig] Using mock data for demo store. Base slug: ${baseSlug}`);
1710
+ const storeConfig = getStoreConfig(baseSlug);
1711
+ if (storeConfig) {
1712
+ console.log(`[StoreConfig] Mock store loaded: ${storeConfig.name} with ${storeConfig.categories?.length || 0} categories and ${storeConfig.products?.length || 0} products`);
1713
+ }
1714
+ return {
1715
+ storeConfig,
1716
+ maintenanceMode: false, // Demo stores are always available
1717
+ };
1718
+ }
1719
+ }
1720
+ catch (error) {
1721
+ // Check if it's a 404 (store not found) vs other error
1722
+ const isNotFound = error?.status === 404 || error?.response?.status === 404;
1723
+ if (isNotFound) {
1724
+ // Store truly doesn't exist
1725
+ return {
1726
+ storeConfig: null,
1727
+ maintenanceMode: false,
1728
+ };
1729
+ }
1730
+ // Other API errors - log and return null
1731
+ console.error('Failed to fetch store config:', error);
1732
+ return {
1733
+ storeConfig: null,
1734
+ maintenanceMode: false,
1735
+ };
1736
+ }
1737
+ }